12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /**
- * Modifications copyright (C) 2020 <SuperMap Software Co., Ltd.>
- * Cesium - https://github.com/CesiumGS/cesium
- *
- * Copyright 2011-2020 Cesium Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Columbus View (Pat. Pend.)
- *
- * Portions licensed separately.
- * See https://github.com/CesiumGS/cesium/blob/master/LICENSE.md for full licensing details.
- */
- !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";var factory;function n$1c(e){return(0===e.length||"/"!==e[e.length-1])&&(e+="/"),e}function e$28(e){return null!=e}function t$Z(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}factory=function(){var e,t;e=function(){var e,t=(e=!0,function(t,i){var r=e?function(){if(i){var e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}),i=t(void 0,(function(){return i.toString().search("(((.+)+)+)+$").toString().constructor(i).search("(((.+)+)+)+$")}));i();var r=function(e,t){var i=t.pixelRatio,r=t.version,n=t.stretchX,o=t.stretchY,a=t.content;this.paddedRect=e,this.pixelRatio=i,this.stretchX=n,this.stretchY=o,this.content=a,this.version=r},n={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};n.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},n.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},n.tlbr.get=function(){return this.tl.concat(this.br)},n.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(r.prototype,n);var o,a=(o=!0,function(e,t){var i=o?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return o=!1,i}),s=a(void 0,(function(){return s.toString().search("(((.+)+)+)+$").toString().constructor(s).search("(((.+)+)+)+$")}));s();var l=function(e,t){u(this,e,4,t)};function u(e,t,i,r){var n=t.width,o=t.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*o*i);return e.width=n,e.height=o,e.data=r,e}function c(e,t,i,r,n,o){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)return console.log("out of range source coordinates for image copy"),t;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)return console.log("out of range destination coordinates for image copy"),t;for(var a=e.data,s=t.data,l=0;l<n.height;l++)for(var u=((i.y+l)*e.width+i.x)*o,c=((r.y+l)*t.width+r.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return t}function h(e){for(var t=0,i=0,r=0,n=e;r<n.length;r+=1){var o=n[r];t+=o.w*o.h,i=Math.max(i,o.w)}e.sort((function(e,t){return t.h-e.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}],s=0,l=0,u=0,c=e;u<c.length;u+=1)for(var h=c[u],d=a.length-1;d>=0;d--){var f=a[d];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var p=a.pop();d<a.length&&(a[d]=p)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(a.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:l,fill:t/(s*l)||0}}l.prototype.resize=function(e){!function(e,t,i){var r=t.width,n=t.height;if(r!==e.width||n!==e.height){var o=u({},{width:r,height:n},i);c(e,o,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,n)},i),e.width=r,e.height=n,e.data=o.data}}(this,e,4)},l.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},l.prototype.clone=function(){return new l({width:this.width,height:this.height},new Uint8Array(this.data))},l.copy=function(e,t,i,r,n){c(e,t,i,r,n,4)};var d,f=(d=!0,function(e,t){var i=d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return d=!1,i}),p=f(void 0,(function(){return p.toString().search("(((.+)+)+)+$").toString().constructor(p).search("(((.+)+)+)+$")}));p();var _=function(e,t){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(e,i,n),this.addImages(t,r,n);var o=h(n),a=o.w,s=o.h,u=new l({width:a||1,height:s||1});for(var c in e){var d=e[c],f=i[c].paddedRect;l.copy(d.data,u,{x:0,y:0},{x:f.x+1,y:f.y+1},d.data)}for(var p in t){var _=t[p],m=r[p].paddedRect,$=m.x+1,g=m.y+1,v=_.data.width,y=_.data.height;l.copy(_.data,u,{x:0,y:0},{x:$,y:g},_.data),l.copy(_.data,u,{x:0,y:y-1},{x:$,y:g-1},{width:v,height:1}),l.copy(_.data,u,{x:0,y:0},{x:$,y:g+y},{width:v,height:1}),l.copy(_.data,u,{x:v-1,y:0},{x:$-1,y:g},{width:1,height:y}),l.copy(_.data,u,{x:0,y:0},{x:$+v,y:g},{width:1,height:y})}this.image=u,this.iconPositions=i,this.patternPositions=r};_.prototype.addImages=function(e,t,i){for(var n in e){var o=e[n],a={x:0,y:0,w:o.data.width+2,h:o.data.height+2};i.push(a),t[n]=new r(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},_.prototype.patchUpdatedImages=function(e,t){for(var i in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[i],e.getImage(i),t),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i),t)},_.prototype.patchUpdatedImage=function(e,t,i){if(e&&t&&e.version!==t.version){e.version=t.version;var r=e.tl,n=r[0],o=r[1];i.update(t.data,void 0,{x:n,y:o})}};var m,$=(m=!0,function(e,t){var i=m?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return m=!1,i}),g=$(void 0,(function(){return g.toString().search("(((.+)+)+)+$").toString().constructor(g).search("(((.+)+)+)+$")}));g();var v={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function y(e){return(e=Math.round(e))<0?0:e>255?255:e}function x(e){return e<0?0:e>1?1:e}function b(e){return"%"===e[e.length-1]?y(parseFloat(e)/100*255):y(parseInt(e))}function w(e){return"%"===e[e.length-1]?x(parseFloat(e)/100):x(parseFloat(e))}function C(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}const T=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),S=T(void 0,(function(){return S.toString().search("(((.+)+)+)+$").toString().constructor(S).search("(((.+)+)+)+$")}));S();class E{constructor(e,t,i,r=1){this.r=e,this.g=t,this.b=i,this.a=r}static parse(e){if(!e)return;if(e instanceof E)return e;if("string"!=typeof e)return;const t=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in v)return v[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=i.indexOf("("),n=i.indexOf(")");if(-1!==r&&n+1===i.length){var o=i.substr(0,r),a=i.substr(r+1,n-(r+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=w(a.pop());case"rgb":return 3!==a.length?null:[b(a[0]),b(a[1]),b(a[2]),s];case"hsla":if(4!==a.length)return null;s=w(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=w(a[1]),c=w(a[2]),h=c<=.5?c*(u+1):c+u-c*u,d=2*c-h;return[y(255*C(d,h,l+1/3)),y(255*C(d,h,l)),y(255*C(d,h,l-1/3)),s];default:return null}}return null}(e);return t?new E(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,i,r]=this.toArray();return"rgba("+Math.round(e)+","+Math.round(t)+","+Math.round(i)+","+r+")"}toArray(){const{r:e,g:t,b:i,a:r}=this;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*i/r,r]}}function A(e){if("array"===e.kind){var t=A(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}E.black=new E(0,0,0,1),E.white=new E(1,1,1,1),E.transparent=new E(0,0,0,0),E.red=new E(1,0,0,1);var P=[{kind:"null"},{kind:"number"},{kind:"string"},{kind:"boolean"},{kind:"color"},{kind:"formatted"},{kind:"object"},function(e,t){var i,r=(i=!0,function(e,t){var r=i?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return i=!1,r}),n=r(this,(function(){return n.toString().search("(((.+)+)+)+$").toString().constructor(n).search("(((.+)+)+)+$")}));return n(),{kind:"array",itemType:e,N:t}}({kind:"value"}),{kind:"resolvedImage"}];function I(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!I(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var i=0,r=P;i<r.length;i+=1)if(!I(r[i],t))return null}return"Expected "+A(e)+" but found "+A(t)+" instead."}var M,O=(M=!0,function(e,t){var i=M?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return M=!1,i}),D=O(void 0,(function(){return D.toString().search("(((.+)+)+)+$").toString().constructor(D).search("(((.+)+)+)+$")}));D();var R=function(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};R.prototype.compare=function(e,t){return this.collator.compare(e,t)},R.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var L,B=(L=!0,function(e,t){var i=L?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return L=!1,i}),N=B(void 0,(function(){return N.toString().search("(((.+)+)+)+$").toString().constructor(N).search("(((.+)+)+)+$")}));N();var F,z=function(e,t,i,r,n){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=n},k=(F=!0,function(e,t){var i=F?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return F=!1,i}),V=k(void 0,(function(){return V.toString().search("(((.+)+)+)+$").toString().constructor(V).search("(((.+)+)+)+$")}));V();var U=function(e){this.sections=e};U.fromString=function(e){return new U([new z(e,null,null,null,null)])},U.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},U.factory=function(e){return e instanceof U?e:U.fromString(e)},U.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},U.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];if(r.image)e.push(["image",r.image.name]);else{e.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(n)}}return e};var X,H=(X=!0,function(e,t){var i=X?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return X=!1,i}),G=H(void 0,(function(){return G.toString().search("(((.+)+)+)+$").toString().constructor(G).search("(((.+)+)+)+$")}));G();var W=function(e){this.name=e.name,this.available=e.available};W.prototype.toString=function(){return this.name},W.fromString=function(e){return new W({name:e,available:!1})},W.prototype.serialize=function(){return["image",this.name]};var Y,q=(Y=!0,function(e,t){var i=Y?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Y=!1,i}),j=q(void 0,(function(){return j.toString().search("(((.+)+)+)+$").toString().constructor(j).search("(((.+)+)+)+$")}));j();var Z={kind:"null"},K={kind:"number"},Q={kind:"string"},J={kind:"boolean"},ee={kind:"color"},te={kind:"object"},ie={kind:"value"},re={kind:"collator"},ne={kind:"formatted"},oe={kind:"resolvedImage"};function ae(){}ae.validateRGBA=function(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[e,t,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."},ae.isValue=function(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof E)return!0;if(e instanceof R)return!0;if(e instanceof U)return!0;if(e instanceof W)return!0;if(Array.isArray(e)){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(!ae.isValue(r))return!1}return!0}if("object"==typeof e){for(var n in e)if(!ae.isValue(e[n]))return!1;return!0}return!1},ae.typeOf=function(e){if(null===e)return Z;if("string"==typeof e)return Q;if("boolean"==typeof e)return J;if("number"==typeof e)return K;if(e instanceof E)return ee;if(e instanceof R)return re;if(e instanceof U)return ne;if(e instanceof W)return oe;if(Array.isArray(e)){for(var t,i=e.length,r=0,n=e;r<n.length;r+=1){var o=n[r],a=ae.typeOf(o);if(t){if(t===a)continue;t=ie;break}t=a}return{kind:"array",itemType:t||ie,N:i}}return te},ae.toString$1=function(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof E||e instanceof U||e instanceof W?e.toString():JSON.stringify(e)};var se,le=(se=!0,function(e,t){var i=se?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return se=!1,i}),ue=le(void 0,(function(){return ue.toString().search("(((.+)+)+)+$").toString().constructor(ue).search("(((.+)+)+)+$")}));ue();var ce={kind:"value"},he={string:{kind:"string"},number:{kind:"number"},boolean:{kind:"boolean"},object:{kind:"object"}},de=function(e,t){this.type=e,this.args=t};de.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i,r=1,n=e[0];if("array"===n){var o,a;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in he)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],r++}else o=ce;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],r++}i={kind:"array",itemType:o,N:a}}else i=he[n];for(var l=[];r<e.length;r++){var u=t.parse(e[r],r,ce);if(!u)return null;l.push(u)}return new de(i,l)},de.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var i=this.args[t].evaluate(e);if(!I(this.type,ae.typeOf(i)))return i;if(t===this.args.length-1)throw new RuntimeError("Expected value to be of type "+toString(this.type)+", but found "+toString(ae.typeOf(i))+" instead.")}return null},de.prototype.eachChild=function(e){this.args.forEach(e)},de.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},de.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);var r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var fe,pe=(fe=!0,function(e,t){var i=fe?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return fe=!1,i}),_e=pe(void 0,(function(){return _e.toString().search("(((.+)+)+)+$").toString().constructor(_e).search("(((.+)+)+)+$")}));_e();var me={kind:"number"},$e={kind:"value"},ge=function(e,t,i){this.type=e,this.index=t,this.input=i};ge.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i,r=t.parse(e[1],1,me),n=t.parse(e[2],2,{kind:"array",itemType:t.expectedType||$e,N:i});if(!r||!n)return null;var o=n.type;return new ge(o.itemType,r,n)},ge.prototype.evaluate=function(e){var t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new RuntimeError("Array index out of bounds: "+t+" < 0.");if(t>=i.length)throw new RuntimeError("Array index out of bounds: "+t+" > "+(i.length-1)+".");if(t!==Math.floor(t))throw new RuntimeError("Array index must be an integer, but found "+t+" instead.");return i[t]},ge.prototype.eachChild=function(e){e(this.index),e(this.input)},ge.prototype.possibleOutputs=function(){return[void 0]},ge.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ve,ye=(ve=!0,function(e,t){var i=ve?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ve=!1,i}),xe=ye(void 0,(function(){return xe.toString().search("(((.+)+)+)+$").toString().constructor(xe).search("(((.+)+)+)+$")}));xe();var be={kind:"boolean"},we=function(e,t,i){this.type=e,this.branches=t,this.otherwise=i};we.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var r=[],n=1;n<e.length-1;n+=2){var o=t.parse(e[n],n,be);if(!o)return null;var a=t.parse(e[n+1],n+1,i);if(!a)return null;r.push([o,a]),i=i||a.type}var s=t.parse(e[e.length-1],e.length-1,i);return s?new we(i,r,s):null},we.prototype.evaluate=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];if(n.evaluate(e))return o.evaluate(e)}return this.otherwise.evaluate(e)},we.prototype.eachChild=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];e(n),e(o)}e(this.otherwise)},we.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.branches.map((function(e){return e[0],e[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},we.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Ce,Te=(Ce=!0,function(e,t){var i=Ce?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ce=!1,i}),Se=Te(void 0,(function(){return Se.toString().search("(((.+)+)+)+$").toString().constructor(Se).search("(((.+)+)+)+$")}));Se();var Ee={kind:"value"},Ae=function(e,t){this.type=e,this.args=t};Ae.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var i=null,r=t.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],o=0,a=e.slice(1);o<a.length;o+=1){var s=a[o],l=t.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=r&&n.some((function(e){return I(r,e.type)}));return new Ae(u?Ee:i,n)},Ae.prototype.evaluate=function(e){for(var t,i=null,r=0,n=0,o=this.args;n<o.length&&(r++,(i=o[n].evaluate(e))&&i instanceof W&&!i.available&&(!t&&(t=i.name),i=null,r===this.args.length&&(i=t)),null===i);n+=1);return i},Ae.prototype.eachChild=function(e){this.args.forEach(e)},Ae.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},Ae.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Pe,Ie=(Pe=!0,function(e,t){var i=Pe?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Pe=!1,i}),Me=Ie(void 0,(function(){return Me.toString().search("(((.+)+)+)+$").toString().constructor(Me).search("(((.+)+)+)+$")}));Me();var Oe={kind:"value"},De={"to-boolean":{kind:"boolean"},"to-color":{kind:"color"},"to-number":{kind:"number"},"to-string":{kind:"string"}},Re=function(e,t){this.type=e,this.args=t};Re.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");for(var r=De[i],n=[],o=1;o<e.length;o++){var a=t.parse(e[o],o,Oe);if(!a)return null;n.push(a)}return new Re(r,n)},Re.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(t=n[r].evaluate(e))instanceof E)return t;if("string"==typeof t){var o=e.parseColor(t);if(o)return o}else if(Array.isArray(t)&&!(i=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":validateRGBA(t[0],t[1],t[2],t[3])))return new E(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new RuntimeError(i||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(e)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new RuntimeError("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Formatted.fromString(ae.toString$1(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?W.fromString(ae.toString$1(this.args[0].evaluate(e))):ae.toString$1(this.args[0].evaluate(e))},Re.prototype.eachChild=function(e){this.args.forEach(e)},Re.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},Re.prototype.serialize=function(){if("formatted"===this.type.kind)return new FormatExpression([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ImageExpression(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Le,Be=(Le=!0,function(e,t){var i=Le?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Le=!1,i}),Ne=Be(void 0,(function(){return Ne.toString().search("(((.+)+)+)+$").toString().constructor(Ne).search("(((.+)+)+)+$")}));Ne();var Fe={kind:"string"},ze={kind:"boolean"},ke={kind:"collator"},Ve=function(e,t,i){this.type=ke,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t};Ve.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");var r=t.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ze);if(!r)return null;var n=t.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ze);if(!n)return null;var o=null;return i.locale&&!(o=t.parse(i.locale,1,Fe))?null:new Ve(r,n,o)},Ve.prototype.evaluate=function(e){return new R(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Ve.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Ve.prototype.possibleOutputs=function(){return[void 0]},Ve.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Ue={kind:"boolean"},Xe={kind:"value"},He={kind:"collator"};function Ge(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function We(e,t,i,r){return 0===r.compare(t,i)}function Ye(e,t,i){var r,n=(r=!0,function(e,t){var i=r?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return r=!1,i}),o="=="!==e&&"!="!==e;return function(){var r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function a(e,t,i){this.type=Ue,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return r(),a.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var i=e[0],r=t.parse(e[1],1,Xe);if(!r)return null;if(!Ge(i,r.type))return t.concat(1).error('"'+i+"\" comparisons are not supported for type '"+toString(r.type)+"'.");var n=t.parse(e[2],2,Xe);if(!n)return null;if(!Ge(i,n.type))return t.concat(2).error('"'+i+"\" comparisons are not supported for type '"+toString(n.type)+"'.");if(r.type.kind!==n.type.kind&&"value"!==r.type.kind&&"value"!==n.type.kind)return t.error("Cannot compare types '"+toString(r.type)+"' and '"+toString(n.type)+"'.");o&&("value"===r.type.kind&&"value"!==n.type.kind?r=new de(n.type,[r]):"value"!==r.type.kind&&"value"===n.type.kind&&(n=new de(r.type,[n])));var s=null;if(4===e.length){if("string"!==r.type.kind&&"string"!==n.type.kind&&"value"!==r.type.kind&&"value"!==n.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,He)))return null}return new a(r,n,s)},a.prototype.evaluate=function(r){var n=this.lhs.evaluate(r),a=this.rhs.evaluate(r);if(o&&this.hasUntypedArgument){var s=ae.typeOf(n),l=ae.typeOf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new RuntimeError('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=ae.typeOf(n),c=ae.typeOf(a);if("string"!==u.kind||"string"!==c.kind)return t(r,n,a)}return this.collator?i(r,n,a,this.collator.evaluate(r)):t(r,n,a)},a.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},a.prototype.possibleOutputs=function(){return[!0,!1]},a.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},a}()}var qe={};qe.Equals=Ye("==",(function(e,t,i){return t===i}),We),qe.NotEquals=Ye("!=",(function(e,t,i){return t!==i}),(function(e,t,i,r){return!We(0,t,i,r)})),qe.LessThan=Ye("<",(function(e,t,i){return t<i}),(function(e,t,i,r){return r.compare(t,i)<0})),qe.GreaterThan=Ye(">",(function(e,t,i){return t>i}),(function(e,t,i,r){return r.compare(t,i)>0})),qe.LessThanOrEqual=Ye("<=",(function(e,t,i){return t<=i}),(function(e,t,i,r){return r.compare(t,i)<=0})),qe.GreaterThanOrEqual=Ye(">=",(function(e,t,i){return t>=i}),(function(e,t,i,r){return r.compare(t,i)>=0}));var je,Ze=(je=!0,function(e,t){var i=je?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return je=!1,i}),Ke=Ze(void 0,(function(){return Ke.toString().search("(((.+)+)+)+$").toString().constructor(Ke).search("(((.+)+)+)+$")}));Ke();var Qe={kind:"number"},Je={kind:"string"},et={kind:"color"},tt={kind:"value"},it={kind:"formatted"},rt={kind:"resolvedImage"},nt=function(e){this.type=it,this.sections=e};nt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");for(var r=[],n=!1,o=1;o<=e.length-1;++o){var a=e[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=t.parse(a["font-scale"],1,Qe)))return null;var l=null;if(a["text-font"]&&!(l=t.parse(a["text-font"],1,{kind:"array",itemType:Je,N:void 0})))return null;var u=null;if(a["text-color"]&&!(u=t.parse(a["text-color"],1,et)))return null;var c=r[r.length-1];c.scale=s,c.font=l,c.textColor=u}else{var h=t.parse(e[o],1,tt);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new nt(r)},nt.prototype.evaluate=function(e){return new U(this.sections.map((function(t){var i=t.content.evaluate(e);return ae.typeOf(i)===rt?new z("",i,null,null,null):new z(ae.toString$1(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},nt.prototype.eachChild=function(e){for(var t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}},nt.prototype.possibleOutputs=function(){return[void 0]},nt.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),e.push(n)}return e};var ot,at=(ot=!0,function(e,t){var i=ot?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ot=!1,i}),st=at(void 0,(function(){return st.toString().search("(((.+)+)+)+$").toString().constructor(st).search("(((.+)+)+)+$")}));st();var lt={kind:"string"},ut={kind:"resolvedImage"},ct=function(e){this.type=ut,this.input=e};ct.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,lt);return i?new ct(i):t.error("No image name provided.")},ct.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=!1;return e.availableImages&&e.availableImages.indexOf(t)>-1&&(i=!0),new W({name:t,available:i})},ct.prototype.eachChild=function(e){e(this.input)},ct.prototype.possibleOutputs=function(){return[void 0]},ct.prototype.serialize=function(){return["image",this.input.serialize()]};var ht,dt=(ht=!0,function(e,t){var i=ht?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ht=!1,i}),ft=dt(void 0,(function(){return ft.toString().search("(((.+)+)+)+$").toString().constructor(ft).search("(((.+)+)+)+$")}));ft();var pt=function(e,t,i,r,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}},_t={kind:"number"},mt={kind:"color"};function $t(e,t,i,r){var n=r-i,o=e-i;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}pt.interpolationFactor=function(e,t,i,r){var n=0;if("exponential"===e.name)n=$t(t,e.base,i,r);else if("linear"===e.name)n=$t(t,1,i,r);else if("cubic-bezier"===e.name){var o=e.controlPoints;n=new unitbezier(o[0],o[1],o[2],o[3]).solve($t(t,1,i,r))}return n},pt.parse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e.slice(3);if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some((function(e){return"number"!=typeof e||e<0||e>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,2,_t)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=mt:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],d=o[c+1],f=c+3,p=c+4;if("number"!=typeof h)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var _=t.parse(d,p,u);if(!_)return null;u=u||_.type,l.push([h,_])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new pt(u,i,r,n,l):t.error("Type "+toString(u)+" is not interpolatable.")},pt.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);var o=findStopLessThanOrEqualTo(t,r),a=t[o],s=t[o+1],l=pt.interpolationFactor(this.interpolation,r,a,s),u=i[o].evaluate(e),c=i[o+1].evaluate(e);return"interpolate"===this.operator?interpolate[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?hcl.reverse(hcl.interpolate(hcl.forward(u),hcl.forward(c),l)):lab.reverse(lab.interpolate(lab.forward(u),lab.forward(c),l))},pt.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1)e(i[t])},pt.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()})))},pt.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t};var gt,vt=(gt=!0,function(e,t){var i=gt?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return gt=!1,i}),yt=vt(void 0,(function(){return yt.toString().search("(((.+)+)+)+$").toString().constructor(yt).search("(((.+)+)+)+$")}));yt();var xt={kind:"boolean"},bt={kind:"value"},wt=function(e,t){this.type=xt,this.needle=e,this.haystack=t};wt.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i,r=t.parse(e[1],1,bt),n=t.parse(e[2],2,bt);return r&&n?"boolean"!==(i=r.type).kind&&"string"!==i.kind&&"number"!==i.kind&&"null"!==i.kind&&"value"!==i.kind?t.error("Expected first argument to be of type boolean, string, number or null, but found "+toString(r.type)+" instead"):new wt(r,n):null},wt.prototype.evaluate=function(e){var t,i,r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!r||!n)return!1;if("boolean"!=typeof(t=r)&&"string"!=typeof t&&"number"!=typeof t)throw new RuntimeError("Expected first argument to be of type boolean, string or number, but found "+toString(typeOf(r))+" instead.");if(i=n,!Array.isArray(i)&&"string"!=typeof i)throw new RuntimeError("Expected second argument to be of type array or string, but found "+toString(typeOf(n))+" instead.");return n.indexOf(r)>=0},wt.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},wt.prototype.possibleOutputs=function(){return[!0,!1]},wt.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ct,Tt=(Ct=!0,function(e,t){var i=Ct?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ct=!1,i}),St=Tt(void 0,(function(){return St.toString().search("(((.+)+)+)+$").toString().constructor(St).search("(((.+)+)+)+$")}));St();var Et=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Et.prototype.evaluate=function(e){return this.result.evaluate(e)},Et.prototype.eachChild=function(e){for(var t=0,i=this.bindings;t<i.length;t+=1)e(i[t][1]);e(this.result)},Et.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var i=[],r=1;r<e.length-1;r+=2){var n=e[r];if("string"!=typeof n)return t.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=t.parse(e[r+1],r+1);if(!o)return null;i.push([n,o])}var a=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return a?new Et(i,a):null},Et.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Et.prototype.serialize=function(){for(var e=["let"],t=0,i=this.bindings;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];e.push(n,o.serialize())}return e.push(this.result.serialize()),e};var At,Pt=(At=!0,function(e,t){var i=At?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return At=!1,i}),It=Pt(void 0,(function(){return It.toString().search("(((.+)+)+)+$").toString().constructor(It).search("(((.+)+)+)+$")}));It();var Mt={kind:"number"},Ot=function(e){this.type=Mt,this.input=e};Ot.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error("Expected argument of type string or array, but found "+toString(i.type)+" instead."):new Ot(i):null},Ot.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new RuntimeError("Expected value to be of type string or array, but found "+toString(typeOf(t))+" instead.")},Ot.prototype.eachChild=function(e){e(this.input)},Ot.prototype.possibleOutputs=function(){return[void 0]},Ot.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Dt,Rt=(Dt=!0,function(e,t){var i=Dt?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Dt=!1,i}),Lt=Rt(void 0,(function(){return Lt.toString().search("(((.+)+)+)+$").toString().constructor(Lt).search("(((.+)+)+)+$")}));Lt();var Bt=function(e,t){this.type=e,this.value=t};Bt.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!ae.isValue(e[1]))return t.error("invalid value");var i=e[1],r=ae.typeOf(i),n=t.expectedType;return"array"===r.kind&&0===r.N&&n&&"array"===n.kind&&("number"!=typeof n.N||0===n.N)&&(r=n),new Bt(r,i)},Bt.prototype.evaluate=function(){return this.value},Bt.prototype.eachChild=function(){},Bt.prototype.possibleOutputs=function(){return[this.value]},Bt.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Color?["rgba"].concat(this.value.toArray()):this.value instanceof U?this.value.serialize():this.value};var Nt,Ft=(Nt=!0,function(e,t){var i=Nt?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Nt=!1,i}),zt=Ft(void 0,(function(){return zt.toString().search("(((.+)+)+)+$").toString().constructor(zt).search("(((.+)+)+)+$")}));zt();var kt={kind:"value"},Vt=function(e,t,i,r,n,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o};Vt.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n={},o=[],a=2;a<e.length-1;a+=2){var s=e[a],l=e[a+1];!Array.isArray(s)&&(s=[s]);var u=t.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var d=h[c];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,ae.typeOf(d)))return null}else i=ae.typeOf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=o.length}var f=t.parse(l,a,r);if(!f)return null;r=r||f.type,o.push(f)}var p=t.parse(e[1],1,kt);if(!p)return null;var _=t.parse(e[e.length-1],e.length-1,r);return _?"value"!==p.type.kind&&t.concat(1).checkSubtype(i,p.type)?null:new Vt(i,r,p,n,o,_):null},Vt.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ae.typeOf(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Vt.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Vt.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},Vt.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],i=[],r={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(h=r[this.cases[a]])?(r[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,u=i;l<u.length;l+=1){var c=u[l],h=c[0],d=c[1];1===d.length?t.push(s(d[0])):t.push(d.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Ut,Xt=(Ut=!0,function(e,t){var i=Ut?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ut=!1,i}),Ht=Xt(void 0,(function(){return Ht.toString().search("(((.+)+)+)+$").toString().constructor(Ht).search("(((.+)+)+)+$")}));Ht();var Gt={kind:"number"},Wt={kind:"string"},Yt=function(e,t,i,r,n){this.type=Wt,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};Yt.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,Gt);if(!i)return null;var r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=t.parse(r.locale,1,Wt)))return null;var o=null;if(r.currency&&!(o=t.parse(r.currency,1,Wt)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=t.parse(r["min-fraction-digits"],1,Gt)))return null;var s=null;return r["max-fraction-digits"]&&!(s=t.parse(r["max-fraction-digits"],1,Gt))?null:new Yt(i,n,o,a,s)},Yt.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Yt.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Yt.prototype.possibleOutputs=function(){return[void 0]},Yt.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var qt,jt=(qt=!0,function(e,t){var i=qt?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return qt=!1,i}),Zt=jt(void 0,(function(){return Zt.toString().search("(((.+)+)+)+$").toString().constructor(Zt).search("(((.+)+)+)+$")}));function Kt(e,t){for(var i,r,n=e.length-1,o=0,a=n,s=0;o<=a;)if(i=e[s=Math.floor((o+a)/2)],r=e[s+1],i<=t){if(s===n||t<r)return s;o=s+1}else{if(!(i>t))throw new RuntimeError("Input is not a number.");a=s-1}return 0}Zt();var Qt,Jt=(Qt=!0,function(e,t){var i=Qt?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Qt=!1,i}),ei=Jt(void 0,(function(){return ei.toString().search("(((.+)+)+)+$").toString().constructor(ei).search("(((.+)+)+)+$")}));ei();var ti={kind:"number"},ii=function(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var o=n[r],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};ii.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var i=t.parse(e[1],1,ti);if(!i)return null;var r=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var o=1;o<e.length;o+=2){var a=1===o?-1/0:e[o],s=e[o+1],l=o,u=o+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,u,n);if(!c)return null;n=n||c.type,r.push([a,c])}return new ii(n,i,r)},ii.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[Kt(t,r)].evaluate(e)},ii.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1)e(i[t])},ii.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()})))},ii.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var ri,ni=(ri=!0,function(e,t){var i=ri?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ri=!1,i}),oi=ni(void 0,(function(){return oi.toString().search("(((.+)+)+)+$").toString().constructor(oi).search("(((.+)+)+)+$")}));oi();var ai=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};ai.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var i=e[1];return t.scope.has(i)?new ai(i,t.scope.get(i)):t.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},ai.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},ai.prototype.eachChild=function(){},ai.prototype.possibleOutputs=function(){return[void 0]},ai.prototype.serialize=function(){return["var",this.name]};var si,li=(si=!0,function(e,t){var i=si?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return si=!1,i}),ui=li(void 0,(function(){return ui.toString().search("(((.+)+)+)+$").toString().constructor(ui).search("(((.+)+)+)+$")}));ui();var ci,hi={"==":qe.Equals,"!=":qe.NotEquals,">":qe.GreaterThan,"<":qe.LessThan,">=":qe.GreaterThanOrEqual,"<=":qe.LessThanOrEqual,array:de,at:ge,boolean:de,case:we,coalesce:Ae,collator:Ve,format:nt,image:ct,in:wt,interpolate:pt,"interpolate-hcl":pt,"interpolate-lab":pt,length:Ot,let:Et,literal:Bt,match:Vt,number:de,"number-format":Yt,object:de,step:ii,string:de,"to-boolean":Re,"to-color":Re,"to-number":Re,"to-string":Re,var:ai},di=(ci=!0,function(e,t){var i=ci?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ci=!1,i}),fi=di(void 0,(function(){return fi.toString().search("(((.+)+)+)+$").toString().constructor(fi).search("(((.+)+)+)+$")}));function pi(){}fi();var _i={};for(var mi in pi.register=function(e,t,i){void 0===i&&(i={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),_i[e]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}},pi.register("Object",Object),pi.register("Color",E),pi.register("Error",Error),pi.register("ResolvedImage",W),pi.register("ImageAtlas",_),pi.register("ImagePosition",r),pi.register("RGBAImage",l),pi.register("Formatted",U),pi.register("FormattedSection",z),hi)hi[mi]._classRegistryKey||pi.register("Expression_"+mi,hi[mi]);function $i(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}pi.serialize=function(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if($i(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var i=e;return t&&t.push(i.buffer),i}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var r=[],n=0,o=e;n<o.length;n+=1){var a=o[n];r.push(pi.serialize(a,t))}return r}if("object"==typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var c in e)if(e.hasOwnProperty(c)&&!(_i[l].omit.indexOf(c)>=0)){var h=e[c];"function"!=typeof h&&(u[c]=_i[l].shallow.indexOf(c)>=0?h:pi.serialize(h,t))}e instanceof Error&&(u.message=e.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof e)},pi.deserialize=function(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||$i(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(pi.deserialize);if("object"==typeof e){var t=e.$name||"Object",i=_i[t].klass;if(!i)throw new Error("can't deserialize unregistered class "+t);if(i.deserialize)return i.deserialize(e);for(var r=Object.create(i.prototype),n=0,o=Object.keys(e);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=e[a];r[a]=_i[t].shallow.indexOf(a)>=0?s:pi.deserialize(s)}}return r}throw new Error("can't deserialize object of type "+typeof e)};var gi,vi=(gi=!0,function(e,t){var i=gi?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return gi=!1,i}),yi=vi(void 0,(function(){return yi.toString().search("(((.+)+)+)+$").toString().constructor(yi).search("(((.+)+)+)+$")}));function xi(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}yi(),xi.prototype.trigger=function(){!this._triggered&&(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))};const bi=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),wi=bi(void 0,(function(){return wi.toString().search("(((.+)+)+)+$").toString().constructor(wi).search("(((.+)+)+)+$")}));function Ci(e,t,i){var r;this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},r=this,["receive","process"].forEach((function(e){r[e]&&(r[e]=r[e].bind(r))})),this.invoker=new xi(this.process),this.target.addEventListener("message",this.receive,!1)}wi(),Ci.prototype.send=function(e,t,i,r){const n=++Ci.taskId;i&&(this.callbacks[n]=i);const o=[];return this.target.postMessage({id:n,type:e,hasCallback:!!i,targetMapId:r,sourceMapId:this.mapId,data:pi.serialize(t,o)},o),{cancel:()=>{i&&delete this.callbacks[n],this.target.postMessage({id:n,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}},Ci.prototype.receive=function(e){const t=e.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[i];const e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e()}else this.tasks[i]=t,this.taskQueue.push(i),this.invoker.trigger()},Ci.prototype.process=function(){if(!this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t)if("<response>"===t.type){const i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(pi.deserialize(t.error)):i(null,pi.deserialize(t.data)))}else{let i=!1;const r=t.hasCallback?(t,r)=>{i=!0,delete this.cancelCallbacks[e];const n=[];this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?pi.serialize(t):null,data:pi.serialize(r,n)},n)}:e=>{i=!0};let n=null;const o=pi.deserialize(t.data);if(this.parent[t.type])n=this.parent[t.type](t.sourceMapId,o,r);else if(this.parent.getWorkerSource){const e=t.type.split(".");n=this.parent.getWorkerSource(t.sourceMapId,e[0],o.source)[e[1]](o,r)}else r(new Error("Could not find function "+t.type));!i&&n&&n.cancel&&(this.cancelCallbacks[e]=n.cancel)}},Ci.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},Ci.taskId=0;var Ti,Si=(Ti=!0,function(e,t){var i=Ti?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ti=!1,i}),Ei=Si(void 0,(function(){return Ei.toString().search("(((.+)+)+)+$").toString().constructor(Ei).search("(((.+)+)+)+$")}));Ei();var Ai=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var i=0,r=t;i<r.length;i+=1){var n=r[i],o=n[0],a=n[1];this.bindings[o]=a}};Ai.prototype.concat=function(e){return new Ai(this,e)},Ai.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ai.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Pi,Ii=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){e.call(this,i),this.message=i,this.key=t}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n}(Error),Mi=(Pi=!0,function(e,t){var i=Pi?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Pi=!1,i}),Oi=Mi(void 0,(function(){return Oi.toString().search("(((.+)+)+)+$").toString().constructor(Oi).search("(((.+)+)+)+$")}));Oi();var Di=["Unknown","Point","LineString","Polygon"],Ri=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null};Ri.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Ri.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Di[this.feature.type]:this.feature.type:null},Ri.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Ri.prototype.parseColor=function(e){var t=this._parseColorCache[e];return!t&&(t=this._parseColorCache[e]=E.parse(e)),t},pi.register("EvaluationContext",Ri);var Li,Bi=(Li=!0,function(e,t){var i=Li?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Li=!1,i}),Ni=Bi(void 0,(function(){return Ni.toString().search("(((.+)+)+)+$").toString().constructor(Ni).search("(((.+)+)+)+$")}));function Fi(){}Ni(),Fi.isFeatureConstant=function(e){if(e instanceof Ui.CompoundExpression){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}var t=!0;return e.eachChild((function(e){t&&!Fi.isFeatureConstant(e)&&(t=!1)})),t},Fi.isStateConstant=function(e){if(e instanceof Ui.CompoundExpression&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!Fi.isStateConstant(e)&&(t=!1)})),t},Fi.isGlobalPropertyConstant=function(e,t){if(e instanceof Ui.CompoundExpression&&t.indexOf(e.name)>=0)return!1;var i=!0;return e.eachChild((function(e){i&&!Fi.isGlobalPropertyConstant(e,t)&&(i=!1)})),i};var zi,ki=(zi=!0,function(e,t){var i=zi?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return zi=!1,i}),Vi=ki(void 0,(function(){return Vi.toString().search("(((.+)+)+)+$").toString().constructor(Vi).search("(((.+)+)+)+$")}));Vi();var Ui=function(e,t,i,r,n){void 0===t&&(t=[]),void 0===r&&(r=new Ai),void 0===n&&(n=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=r,this.errors=n,this.expectedType=i};function Xi(e,t){const i=t[e];return void 0===i?null:i}Ui.prototype.parse=function(e,t,i,r,n){return void 0===n&&(n={}),t?this.concat(t,i,r)._parse(e,n):this._parse(e,n)},Ui.prototype._parse=function(e,t){function i(e,t,i){return"assert"===i?new de(t,[e]):"coerce"===i?new Re(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var o=n.parse(e,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=i(o,a,t.typeAnnotation||"coerce");else o=i(o,a,t.typeAnnotation||"assert")}return!(o instanceof Bt)&&o.type.kind,o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Ui.prototype.concat=function(e,t,i){var r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new Ui(this.registry,r,t||null,n,this.errors)},Ui.prototype.error=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var r=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new Ii(r,e))},Ui.prototype.checkSubtype=function(e,t){var i=I(e,t);return i&&this.error(i),i};var Hi=function(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r};Hi.prototype.evaluate=function(e,t){return this._evaluate(e,this.args,t)},Hi.prototype.eachChild=function(e){this.args.forEach(e)},Hi.prototype.possibleOutputs=function(){return[void 0]},Hi.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},Hi.parse=function(e,t){var i,r=e[0],n=Hi.definitions[r];if(!n)return t.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(t){var i=t[0];return!Array.isArray(i)||i.length===e.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],d=h[0],f=h[1];l=new Ui(t.registry,t.path,null,t.scope);for(var p=[],_=!1,m=1;m<e.length;m++){var $=e[m],g=Array.isArray(d)?d[m-1]:d.type,v=l.parse($,1+p.length,g);if(!v){_=!0;break}p.push(v)}if(!_)if(Array.isArray(d)&&d.length!==p.length)l.error("Expected "+d.length+" arguments, but found "+p.length+" instead.");else{for(var y=0;y<p.length;y++){var x=Array.isArray(d)?d[y]:d.type,b=p[y];l.concat(y+1).checkSubtype(x,b.type)}if(0===l.errors.length)return new Hi(r,o,f,p)}}if(1===s.length)(i=t.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(e){var t,i=e[0];return t=i,Array.isArray(t)?"("+t.map(toString).join(", ")+")":"("+toString(t.type)+"...)"})).join(" | "),C=[],T=1;T<e.length;T++){var S=t.parse(e[T],1+C.length);if(!S)return null;C.push(toString(S.type))}t.error("Expected arguments of type "+w+", but found ("+C.join(", ")+") instead.")}return null},Hi.register=function(e,t){for(var i in Hi.definitions=t,t)e[i]=Hi},pi.register("CompoundExpression",Hi);var Gi={kind:"number"},Wi={kind:"string"},Yi={kind:"boolean"},qi={kind:"color"},ji={kind:"object"},Zi={kind:"value"};function Ki(e,t){return{kind:"array",itemType:e,N:t}}function Qi(e){return{type:e}}function Ji(e,t){var i=t[0],r=t[1],n=t[2],o=t[3];i=i.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);var a=o?o.evaluate(e):1,s=Values.validateRGBA(i,r,n,a);if(s)throw new RuntimeError(s);return new Color(i/255*a,r/255*a,n/255*a,a)}Hi.register(hi,{error:[{kind:"error"},[Wi],function(e,t){var i=t[0];throw new RuntimeError(i.evaluate(e))}],typeof:[Wi,[Zi],function(e,t){var i=t[0];return toString(Values.typeOf(i.evaluate(e)))}],"to-rgba":[Ki(Gi,4),[qi],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[qi,[Gi,Gi,Gi],Ji],rgba:[qi,[Gi,Gi,Gi,Gi],Ji],has:{type:Yi,overloads:[[[Wi],function(e,t){var i=t[0];return has(i.evaluate(e),e.properties())}],[[Wi,ji],function(e,t){var i=t[0],r=t[1];return has(i.evaluate(e),r.evaluate(e))}]]},get:{type:Zi,overloads:[[[Wi],function(e,t){return Xi(t[0].evaluate(e),e.properties())}],[[Wi,ji],function(e,t){var i=t[0],r=t[1];return Xi(i.evaluate(e),r.evaluate(e))}]]},"feature-state":[Zi,[Wi],function(e,t){return Xi(t[0].evaluate(e),e.featureState||{})}],properties:[ji,[],function(e){return e.properties()}],"geometry-type":[Wi,[],function(e){return e.geometryType()}],id:[Zi,[],function(e){return e.id()}],zoom:[Gi,[],function(e){return e.globals.zoom}],"heatmap-density":[Gi,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Gi,[],function(e){return e.globals.lineProgress||0}],accumulated:[Zi,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Gi,Qi(Gi),function(e,t){for(var i=0,r=0,n=t;r<n.length;r+=1)i+=n[r].evaluate(e);return i}],"*":[Gi,Qi(Gi),function(e,t){for(var i=1,r=0,n=t;r<n.length;r+=1)i*=n[r].evaluate(e);return i}],"-":{type:Gi,overloads:[[[Gi,Gi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)-r.evaluate(e)}],[[Gi],function(e,t){return-t[0].evaluate(e)}]]},"/":[Gi,[Gi,Gi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)/r.evaluate(e)}],"%":[Gi,[Gi,Gi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)%r.evaluate(e)}],ln2:[Gi,[],function(){return Math.LN2}],pi:[Gi,[],function(){return Math.PI}],e:[Gi,[],function(){return Math.E}],"^":[Gi,[Gi,Gi],function(e,t){var i=t[0],r=t[1];return Math.pow(i.evaluate(e),r.evaluate(e))}],sqrt:[Gi,[Gi],function(e,t){var i=t[0];return Math.sqrt(i.evaluate(e))}],log10:[Gi,[Gi],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN10}],ln:[Gi,[Gi],function(e,t){var i=t[0];return Math.log(i.evaluate(e))}],log2:[Gi,[Gi],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN2}],sin:[Gi,[Gi],function(e,t){var i=t[0];return Math.sin(i.evaluate(e))}],cos:[Gi,[Gi],function(e,t){var i=t[0];return Math.cos(i.evaluate(e))}],tan:[Gi,[Gi],function(e,t){var i=t[0];return Math.tan(i.evaluate(e))}],asin:[Gi,[Gi],function(e,t){var i=t[0];return Math.asin(i.evaluate(e))}],acos:[Gi,[Gi],function(e,t){var i=t[0];return Math.acos(i.evaluate(e))}],atan:[Gi,[Gi],function(e,t){var i=t[0];return Math.atan(i.evaluate(e))}],min:[Gi,Qi(Gi),function(e,t){return Math.min.apply(Math,t.map((function(t){return t.evaluate(e)})))}],max:[Gi,Qi(Gi),function(e,t){return Math.max.apply(Math,t.map((function(t){return t.evaluate(e)})))}],abs:[Gi,[Gi],function(e,t){var i=t[0];return Math.abs(i.evaluate(e))}],round:[Gi,[Gi],function(e,t){var i=t[0].evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[Gi,[Gi],function(e,t){var i=t[0];return Math.floor(i.evaluate(e))}],ceil:[Gi,[Gi],function(e,t){var i=t[0];return Math.ceil(i.evaluate(e))}],"filter-==":[Yi,[Wi,Zi],function(e,t,i){var r=t[0],n=t[1];if(i){var o,a,s=r.value,l=n.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":o=c+d;break;case"-":o=c-d}return o===(a=n.value)}if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(o="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);a="left"==$?d.substring(0,g):d.substring(d.length-g)}else a=n.value;return o===a}return e.properties()[r.value]===e.properties()[n.value]}return e.properties()[r.value]===n.value}],"filter-id-==":[Yi,[Zi],function(e,t){var i=t[0];return e.id()===i.value}],"filter-like":[Yi,[Wi,Wi],function(e,t){var i=t[0].value,r=t[1].value,n=e.properties();return i in n&&(/^%.*[^%]$/.test(r)?(r=r.replace("%",""),n[i].endsWith(r)):/^(?!%).+%$/.test(r)?(r=r.replace("%",""),n[i].startsWith(r)):(r=r.replace(/%/g,""),n[i].indexOf(r)>-1))}],"filter-type-==":[Yi,[Wi],function(e,t){var i=t[0];return e.geometryType()===i.value}],"filter-<":[Yi,[Wi,Zi],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r<n}],"filter-id-<":[Yi,[Zi],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[Yi,[Wi,Zi],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r>n}],"filter-id->":[Yi,[Zi],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[Yi,[Wi,Zi],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r<=n}],"filter-id-<=":[Yi,[Zi],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[Yi,[Wi,Zi],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r>=n}],"filter-id->=":[Yi,[Zi],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[Yi,[Zi],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Yi,[],function(e){return null!==e.id()}],"filter-type-in":[Yi,[Ki(Wi)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Yi,[Ki(Zi)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Yi,[Wi,Ki(Zi)],function(e,t){var i=t[0];return t[1].value.indexOf(e.properties()[i.value])>=0}],"filter-in-large":[Yi,[Wi,Ki(Zi)],function(e,t){var i=t[0],r=t[1];return binarySearch(e.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:Yi,overloads:[[[Yi,Yi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)&&r.evaluate(e)}],[Qi(Yi),function(e,t){for(var i=0,r=t;i<r.length;i+=1)if(!r[i].evaluate(e))return!1;return!0}]]},crossFields:{type:Yi,overloads:[[[Yi,Yi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e,!0)&&r.evaluate(e,!0)}],[Qi(Yi),function(e,t){for(var i=0,r=t;i<r.length;i+=1)if(!r[i].evaluate(e,!0))return!1;return!0}]]},any:{type:Yi,overloads:[[[Yi,Yi],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)||r.evaluate(e)}],[Qi(Yi),function(e,t){for(var i=0,r=t;i<r.length;i+=1)if(r[i].evaluate(e))return!0;return!1}]]},"!":[Yi,[Yi],function(e,t,i){return!t[0].evaluate(e,i)}],"is-supported-script":[Yi,[Wi],function(e,t){var i=t[0],r=e.globals&&e.globals.isSupportedScript;return!r||r(i.evaluate(e))}],upcase:[Wi,[Wi],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[Wi,[Wi],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[Wi,Qi(Zi),function(e,t){return t.map((function(t){return Values.toString$1(t.evaluate(e))})).join("")}],"resolved-locale":[Wi,[{kind:"collator"}],function(e,t){return t[0].evaluate(e).resolvedLocale()}]}),Ui.CompoundExpression=Hi;var er,tr=(er=!0,function(e,t){var i=er?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return er=!1,i}),ir=tr(void 0,(function(){return ir.toString().search("(((.+)+)+)+$").toString().constructor(ir).search("(((.+)+)+)+$")}));ir();var rr=function(e,t){var i,r;this.expression=e,this._warningHistory={},this._evaluator=new Ri,this._defaultValue=t?"color"!==(i=t).type||"object"!=typeof(r=i.default)||null===r||Array.isArray(r)?"color"===i.type?E.parse(i.default)||null:void 0===i.default?null:i.default:new E(0,0,0,0):null,this._enumValues=t&&"enum"===t.type?t.values:null};rr.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},rr.prototype.evaluate=function(e,t,i,r,n){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=n||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new RuntimeError("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(e){return!this._warningHistory[e.message]&&(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}},pi.register("StyleExpression",rr);var nr,or=(nr=!0,function(e,t){var i=nr?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return nr=!1,i}),ar=or(void 0,(function(){return ar.toString().search("(((.+)+)+)+$").toString().constructor(ar).search("(((.+)+)+)+$")}));function sr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function lr(e){return!!e.expression&&e.expression.interpolated}ar();var ur,cr=(ur=!0,function(e,t){var i=ur?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ur=!1,i}),hr=cr(void 0,(function(){return hr.toString().search("(((.+)+)+)+$").toString().constructor(hr).search("(((.+)+)+)+$")}));function dr(){}function fr(e){return{result:"success",value:e}}function pr(e){return{result:"error",value:e}}hr(),dr.isExpression=function(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in hi};var _r={kind:"number"},mr={kind:"string"},$r={kind:"boolean"},gr={kind:"color"},vr={kind:"value"},yr={kind:"formatted"},xr={kind:"resolvedImage"};function br(e){var t=null;if(e instanceof Et)t=br(e.result);else if(e instanceof Ae){for(var i of e.args)if(t=br(i))break}else(e instanceof ii||e instanceof pt)&&e.input instanceof Ui.CompoundExpression&&"zoom"===e.input.name&&(t=e);return t instanceof Ii||e.eachChild((e=>{var i=br(e);i instanceof Ii?t=i:!t&&i?t=new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&i&&t!==i&&(t=new Ii("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function wr(e){var t,i,r={color:gr,string:mr,number:_r,enum:mr,boolean:$r,formatted:yr,resolvedImage:xr};return"array"===e.type?(t=r[e.value]||vr,i=e.length,{kind:"array",itemType:t,N:i}):r[e.type]}function Cr(e){return e}function Tr(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var o=n[r];for(var a in o)e[a]=o[a]}return e}function Sr(e,t,i){var r=void 0!==e.base?e.base:1;if("number"!==Rr(i))return Or(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];var o,a,s,l,u,c,h=Kt(e.stops.map((e=>e[0])),i),d=(o=i,a=r,s=e.stops[h][0],l=e.stops[h+1][0],c=o-s,0==(u=l-s)?0:1===a?c/u:(Math.pow(a,c)-1)/(Math.pow(a,u)-1)),f=e.stops[h][1],p=e.stops[h+1][1],_=interpolate[t.type]||Cr;if(e.colorSpace&&"rgb"!==e.colorSpace){var m=colorSpaces[e.colorSpace];_=(e,t)=>m.reverse(m.interpolate(m.forward(e),m.forward(t),d))}return"function"==typeof f.evaluate?{evaluate(...e){var t=f.evaluate.apply(void 0,e),i=p.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return _(t,i,d)}}:_(f,p,d)}function Er(e,t,i){return"color"===t.type?i=E.parse(i):"formatted"===t.type?i=Formatted.fromString(i.toString()):"resolvedImage"===t.type?i=ResolvedImage.fromString(i.toString()):Rr(i)!==t.type&&("enum"!==t.type||!t.values[i])&&(i=void 0),Or(i,e.default,t.default)}function Ar(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Fi.isStateConstant(t.expression)}function Pr(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Fi.isStateConstant(t.expression),this.interpolationType=r}function Ir(e,t){var i,r,n,o;if(i=e,n=new Ui(hi,[],(r=t)?wr(r):void 0),"error"===(e=(o=n.parse(i,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0))?fr(new rr(o,r)):pr(n.errors)).result)return e;var a=e.value.expression,s=Fi.isFeatureConstant(a);if(!s&&!sr(t))return pr([new Ii("","data expressions not supported")]);var l,u=Fi.isGlobalPropertyConstant(a,["zoom"]);if(!(u||(l=t,l.expression&&l.expression.parameters.indexOf("zoom")>-1)))return pr([new Ii("","zoom expressions not supported")]);var c=br(a);if(!c&&!u)return pr([new Ii("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(c instanceof Ii)return pr([c]);if(c instanceof pt&&!lr(t))return pr([new Ii("",'"interpolate" expressions cannot be used with this property')]);if(!c)return fr(new Ar(s?"constant":"source",e.value));var h=c instanceof pt?c.interpolation:void 0;return fr(new Pr(s?"camera":"composite",e.value,c.labels,h))}function Mr(e,t){var i,r,n,o="color"===t.type,a=e.stops&&"object"==typeof e.stops[0][0],s=a||void 0!==e.property,l=a||!s,u=e.type||(lr(t)?"exponential":"interval");if(o&&((e=Tr({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],E.parse(e[1])]}))),e.default?e.default=E.parse(e.default):e.default=E.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!colorSpaces[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)i=Sr;else if("interval"===u)i=evaluateIntervalFunction;else if("categorical"===u){i=evaluateCategoricalFunction,r=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var d=h[c];r[d[0]]=d[1]}n=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');i=Er}if(a){for(var f={},p=[],_=0;_<e.stops.length;_++){var m=e.stops[_],$=m[0].zoom;void 0===f[$]&&(f[$]={zoom:$,type:e.type,property:e.property,default:e.default,stops:[]},p.push($)),f[$].stops.push([m[0].value,m[1]])}for(var g=[],v=0,y=p;v<y.length;v+=1){var x=y[v];g.push([f[x].zoom,Mr(f[x],t)])}var b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:pt.interpolationFactor.bind(void 0,b),zoomStops:g.map((function(e){return e[0]})),evaluate:function(i,r){var n=i.zoom;return Sr({stops:g,base:e.base},t,n).evaluate(n,r)}}}if(l){var w="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:pt.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(e){return e[0]})),evaluate:function(o){var a=o.zoom;return i(e,t,a,r,n)}}}return{kind:"source",evaluate:function(o,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Or(e.default,t.default):i(e,t,s,r,n)}}}function Or(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}dr.createExpression=function(e,t){var i=new Ui(hi,[],t?wr(t):void 0),r=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?fr(new rr(r,t)):pr(i.errors)},Ar.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)},Ar.prototype.evaluate=function(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)},pi.register("ZoomConstantExpression",Ar),Pr.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)},Pr.prototype.evaluate=function(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)},Pr.prototype.interpolationFactor=function(e,t,i){return this.interpolationType?pt.interpolationFactor(this.interpolationType,e,t,i):0},pi.register("ZoomDependentExpression",Pr);var Dr=function(e,t){this._parameters=e,this._specification=t,Tr(this,Mr(this._parameters,this._specification))};function Rr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}Dr.deserialize=function(e){return new Dr(e._parameters,e._specification)},Dr.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}},pi.register("StylePropertyFunction",Dr),dr.normalizePropertyExpression=function(e,t){if("object"!=typeof(n=e)||null===n||Array.isArray(n)){if(dr.isExpression(e)){var i=Ir(e,t);if("error"===i.result)throw new Error(i.value.map((function(e){return e.key+": "+e.message})).join(", "));return i.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=E.parse(e)),{kind:"constant",evaluate:function(){return r}}}return new Dr(e,t);var n};var Lr,Br=(Lr=!0,function(e,t){var i=Lr?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Lr=!1,i}),Nr=Br(void 0,(function(){return Nr.toString().search("(((.+)+)+)+$").toString().constructor(Nr).search("(((.+)+)+)+$")}));function Fr(){}Nr(),Fr.isExpressionFilter=function(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&Array.isArray(e[2]);case"!in":case"!has":case"none":case"crossFields":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":case"like":case"!like":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,i=e.slice(1);t<i.length;t+=1){var r=i[t];if(!Fr.isExpressionFilter(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}};var zr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function kr(e,t){return e<t?-1:e>t?1:0}function Vr(e){if(!e)return!0;var t,i=e[0];return e.length<=1?"any"!==i:"=="===i?Ur(e[1],e[2],"=="):"!="===i?Gr(Ur(e[1],e[2],"==")):"<"===i||">"===i||"<="===i||">="===i?Ur(e[1],e[2],i):"any"===i?(t=e.slice(1),["any"].concat(t.map(Vr))):"all"===i?["all"].concat(e.slice(1).map(Vr)):"crossFields"===i?["crossFields"].concat(e.slice(1).map(Vr)):"none"===i?["all"].concat(e.slice(1).map(Vr).map(Gr)):"in"===i?Xr(e[1],e.slice(2)):"!in"===i?Gr(Xr(e[1],e.slice(2))):"has"===i?Hr(e[1]):"!has"===i?Gr(Hr(e[1])):"like"===i?Ur(e[1],e[2],"like"):"!like"!==i||Gr(Ur(e[1],e[2],"like"))}function Ur(e,t,i){switch(e){case"$type":return["filter-type-"+i,t];case"$id":return["filter-id-"+i,t];default:return["filter-"+i,e,t]}}function Xr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(kr)]]:["filter-in-small",e,["literal",t]]}}function Hr(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Gr(e){return["!",e]}Fr.createFilter=function(e){if(null==e)return function(){return!0};!Fr.isExpressionFilter(e)&&(e=Vr(e));var t=dr.createExpression(e,zr);if("error"===t.result)throw new Error(t.value.map((function(e){return e.key+": "+e.message})).join(", "));return function(e,i){return t.value.evaluate(e,i)}};var Wr,Yr=(Wr=!0,function(e,t){var i=Wr?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Wr=!1,i}),qr=Yr(void 0,(function(){return qr.toString().search("(((.+)+)+)+$").toString().constructor(qr).search("(((.+)+)+)+$")}));qr();const jr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Zr(e){var t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i="[",r=0,n=e;r<n.length;r+=1)i+=Zr(n[r])+",";return i+"]"}for(var o=Object.keys(e).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+Zr(e[o[s]])+",";return a+"}"}function Kr(e){for(var t="",i=0,r=jr;i<r.length;i+=1)t+="/"+Zr(e[r[i]]);return t}var Qr,Jr=(Qr=!0,function(e,t){var i=Qr?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Qr=!1,i}),en=Jr(void 0,(function(){return en.toString().search("(((.+)+)+)+$").toString().constructor(en).search("(((.+)+)+)+$")}));function tn(e,t){this.x=e,this.y=t}en(),tn.prototype={clone:function(){return new tn(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,n=i*this.x+t*this.y;return this.x=r,this.y=n,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.x+i*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},tn.convert=function(e){return e instanceof tn?e:Array.isArray(e)?new tn(e[0],e[1]):e};var rn,nn=(rn=!0,function(e,t){var i=rn?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return rn=!1,i}),on=nn(void 0,(function(){return on.toString().search("(((.+)+)+)+$").toString().constructor(on).search("(((.+)+)+)+$")}));on();var an={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};function sn(e,t){void 0===t&&(t=1);var i=0,r=0;return{members:e.map((function(e){var n,o=(n=e.type,an[n].BYTES_PER_ELEMENT),a=i=ln(i,Math.max(t,o)),s=e.components||1;return r=Math.max(r,o),i+=o*s,{name:e.name,type:e.type,components:s,offset:a}})),size:ln(i,Math.max(r,t)),alignment:t}}function ln(e,t){return Math.ceil(e/t)*t}var un,cn=(un=!0,function(e,t){var i=un?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return un=!1,i}),hn=cn(void 0,(function(){return hn.toString().search("(((.+)+)+)+$").toString().constructor(hn).search("(((.+)+)+)+$")}));hn();var dn=function(){this.first=!0};dn.prototype.update=function(e,t){var i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=i,!0))},pi.register("ZoomHistory",dn);var fn,pn=(fn=!0,function(e,t){var i=fn?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return fn=!1,i}),_n=pn(void 0,(function(){return _n.toString().search("(((.+)+)+)+$").toString().constructor(_n).search("(((.+)+)+)+$")}));_n();var mn=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new dn,this.transition={})};mn.prototype.isSupportedScript=function(e){return!1},mn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},mn.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),i=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*t}},pi.register("EvaluationParameters",mn);var $n,gn=($n=!0,function(e,t){var i=$n?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return $n=!1,i}),vn=gn(void 0,(function(){return vn.toString().search("(((.+)+)+)+$").toString().constructor(vn).search("(((.+)+)+)+$")}));vn();var yn=8192;function xn(e,t,i){return Math.min(i,Math.max(t,e))}var bn=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),{min:-1*Math.pow(2,e-1),max:Math.pow(2,e-1)-1}}(15);function wn(e){for(var t=yn/e.extent,i=e.loadGeometry(),r=0;r<i.length;r++)for(var n=i[r],o=0;o<n.length;o++){var a=n[o];a.x=Math.round(a.x*t),a.y=yn-Math.round(a.y*t),(a.x<bn.min||a.x>bn.max||a.y<bn.min||a.y>bn.max)&&(a.x=xn(a.x,bn.min,bn.max),a.y=xn(a.y,bn.min,bn.max))}return i}var Cn,Tn=(Cn=!0,function(e,t){var i=Cn?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Cn=!1,i}),Sn=Tn(void 0,(function(){return Sn.toString().search("(((.+)+)+)+$").toString().constructor(Sn).search("(((.+)+)+)+$")}));Sn();var En=function(e){void 0===e&&(e=[]),this.segments=e};En.prototype.prepareSegment=function(e,t,i,r){var n=this.segments[this.segments.length-1];return(!n||n.vertexLength+e>En.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n},En.prototype.get=function(){return this.segments},En.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var i=t[e];for(var r in i.cesiumVaos)i.cesiumVaos[r].destroy()}},En.simpleSegment=function(e,t,i,r){return new En([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:r,vaos:{},cesiumVaos:{},drawCommands:{},sortKey:0}])},En.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,pi.register("SegmentVector",En);const An=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Pn=An(void 0,(function(){return Pn.toString().search("(((.+)+)+)+$").toString().constructor(Pn).search("(((.+)+)+)+$")}));Pn();var In=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Mn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Mn.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Mn.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Mn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Mn.prototype.clear=function(){this.length=0},Mn.prototype.resize=function(e){this.reserve(e),this.length=e},Mn.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&(0==t.length&&console.log("oldUint8Array.length == 0"),this.uint8.set(t))}},Mn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var On=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,e},t}(Mn);On.prototype.bytesPerElement=4,pi.register("StructArrayLayout2i4",On);var Dn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,e},t}(Mn);Dn.prototype.bytesPerElement=8,pi.register("StructArrayLayout4i8",Dn);var Rn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(Mn);Rn.prototype.bytesPerElement=12,pi.register("StructArrayLayout2i4i12",Rn);var Ln=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,e},t}(Mn);Ln.prototype.bytesPerElement=8,pi.register("StructArrayLayout2i4ub8",Ln);var Bn=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(e,t,i,r,n,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,i,r,n,o,a,s)},n.prototype.emplace=function(e,t,i,r,n,o,a,s,l){var u=8*e;return this.uint16[u+0]=t,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=n,this.uint16[u+4]=o,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,e},n}(Mn);Bn.prototype.bytesPerElement=16,pi.register("StructArrayLayout8ui16",Bn);var Nn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,r,n,o,a,s,l,u,c,h)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=12*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=d,e},t}(Mn);Nn.prototype.bytesPerElement=24,pi.register("StructArrayLayout4i4ui4i24",Nn);var Fn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.float32[n+0]=t,this.float32[n+1]=i,this.float32[n+2]=r,e},t}(Mn);Fn.prototype.bytesPerElement=12,pi.register("StructArrayLayout3f12",Fn);var zn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.uint32[i+0]=t,e},t}(Mn);zn.prototype.bytesPerElement=4,pi.register("StructArrayLayout1ul4",zn);var kn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,e,t,i,r,n,o,a,s,l,u,c)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=12*e,f=6*e;return this.int16[d+0]=t,this.int16[d+1]=i,this.int16[d+2]=r,this.int16[d+3]=n,this.int16[d+4]=o,this.int16[d+5]=a,this.uint32[f+3]=s,this.uint16[d+8]=l,this.uint16[d+9]=u,this.int16[d+10]=c,this.int16[d+11]=h,e},t}(Mn);kn.prototype.bytesPerElement=24,pi.register("StructArrayLayout6i1ul2ui2i24",kn);var Vn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(Mn);Vn.prototype.bytesPerElement=12,pi.register("StructArrayLayout2i2i2i12",Vn);var Un=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=i,this.float32[a+1]=r,this.float32[a+2]=n,e},t}(Mn);Un.prototype.bytesPerElement=12,pi.register("StructArrayLayout2ub2f12",Un);var Xn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m){var $=this.length;return this.resize($+1),this.emplace($,e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$){var g=24*e,v=12*e,y=48*e;return this.int16[g+0]=t,this.int16[g+1]=i,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[v+7]=h,this.float32[v+8]=d,this.uint8[y+36]=f,this.uint8[y+37]=p,this.uint8[y+38]=_,this.uint32[v+10]=m,this.int16[g+22]=$,e},t}(Mn);Xn.prototype.bytesPerElement=48,pi.register("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xn);var Hn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T){var S=this.length;return this.resize(S+1),this.emplace(S,e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T,S){var E=30*e,A=15*e;return this.int16[E+0]=t,this.int16[E+1]=i,this.int16[E+2]=r,this.int16[E+3]=n,this.int16[E+4]=o,this.int16[E+5]=a,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=c,this.uint16[E+10]=h,this.uint16[E+11]=d,this.uint16[E+12]=f,this.uint16[E+13]=p,this.uint16[E+14]=_,this.uint16[E+15]=m,this.uint16[E+16]=$,this.uint16[E+17]=g,this.uint16[E+18]=v,this.uint16[E+19]=y,this.uint16[E+20]=x,this.uint16[E+21]=b,this.uint32[A+11]=w,this.float32[A+12]=C,this.float32[A+13]=T,this.float32[A+14]=S,e},t}(Mn);Hn.prototype.bytesPerElement=60,pi.register("StructArrayLayout8i14ui1ul3f60",Hn);var Gn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.float32[i+0]=t,e},t}(Mn);Gn.prototype.bytesPerElement=4,pi.register("StructArrayLayout1f4",Gn);var Wn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.int16[n+0]=t,this.int16[n+1]=i,this.int16[n+2]=r,e},t}(Mn);Wn.prototype.bytesPerElement=6,pi.register("StructArrayLayout3i6",Wn);var Yn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=2*e,o=4*e;return this.uint32[n+0]=t,this.uint16[o+2]=i,this.uint16[o+3]=r,e},t}(Mn);Yn.prototype.bytesPerElement=8,pi.register("StructArrayLayout1ul2ui8",Yn);var qn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,this.uint16[n+2]=r,e},t.prototype.get=function(e){var t=3*e;return[this.uint16[t+0],this.uint16[t+1],this.uint16[t+2]]},t}(Mn);qn.prototype.bytesPerElement=6,pi.register("StructArrayLayout3ui6",qn);var jn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.uint32[n+0]=t,this.uint32[n+1]=i,this.uint32[n+2]=r,e},t.prototype.copyFrom3ui6=function(e){if(!(e instanceof qn))throw new Error("expect array to be type of StructArrayLayout3ui6");this.clear();for(let t=0;t<e.length;t++){let i=e.get(t);this.emplaceBack(i[0],i[1],i[2])}},t}(Mn);jn.prototype.bytesPerElement=12,pi.register("StructArrayLayout3ul12",jn);var Zn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,e},t.prototype.get=function(e){var t=2*e;return[this.uint16[t+0],this.uint16[t+1]]},t}(Mn);Zn.prototype.bytesPerElement=4,pi.register("StructArrayLayout2ui4",Zn);var Kn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.uint32[r+0]=t,this.uint32[r+1]=i,e},t.prototype.copyFrom2ui4=function(e){if(!(e instanceof Zn))throw new Error("expect array to be type of StructArrayLayout2ui4");this.clear();for(let t=0;t<e.length;t++){let i=e.get(t);this.emplaceBack(i[0],i[1])}},t}(Mn);Kn.prototype.bytesPerElement=8,pi.register("StructArrayLayout2ul8",Kn);var Qn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.uint16[i+0]=t,e},t}(Mn);Qn.prototype.bytesPerElement=2,pi.register("StructArrayLayout1ui2",Qn);var Jn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.float32[r+0]=t,this.float32[r+1]=i,e},t}(Mn);Jn.prototype.bytesPerElement=8,pi.register("StructArrayLayout2f8",Jn);var eo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=4*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,e},t}(Mn);eo.prototype.bytesPerElement=16,pi.register("StructArrayLayout4f16",eo);var to=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=r,this.float32[s+3]=n,this.float32[s+4]=o,this.float32[s+5]=a,e},t}(Mn);to.prototype.bytesPerElement=24,pi.register("StructArrayLayout6f24",to);var io=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,i,r,n,o,a,s)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l){var u=8*e;return this.float32[u+0]=t,this.float32[u+1]=i,this.float32[u+2]=r,this.float32[u+3]=n,this.float32[u+4]=o,this.float32[u+5]=a,this.float32[u+6]=s,this.float32[u+7]=l,e},t}(Mn);io.prototype.bytesPerElement=32,pi.register("StructArrayLayout8f32",io);var ro=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,r,n,o,a,s,l,u,c,h)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=12*e;return this.float32[f+0]=t,this.float32[f+1]=i,this.float32[f+2]=r,this.float32[f+3]=n,this.float32[f+4]=o,this.float32[f+5]=a,this.float32[f+6]=s,this.float32[f+7]=l,this.float32[f+8]=u,this.float32[f+9]=c,this.float32[f+10]=h,this.float32[f+11]=d,e},t}(Mn);ro.prototype.bytesPerElement=48,pi.register("StructArrayLayout12f48",ro);var no=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorPointY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.x1.set=function(e){this._structArray.int16[this._pos2+2]=e},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.y1.set=function(e){this._structArray.int16[this._pos2+3]=e},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.x2.set=function(e){this._structArray.int16[this._pos2+4]=e},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.y2.set=function(e){this._structArray.int16[this._pos2+5]=e},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.featureIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+8]=e},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},i.radius.get=function(){return this._structArray.int16[this._pos2+10]},i.radius.set=function(e){this._structArray.int16[this._pos2+10]=e},i.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},i.signedDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+11]=e},i.anchorPoint.get=function(){return new pointGeometry(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,i),t}(In);no.prototype.size=24;var oo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new no(this,e)},t}(kn);pi.register("CollisionBoxArray",oo);var ao=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.glyphStartIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.numGlyphs.set=function(e){this._structArray.uint16[this._pos2+3]=e},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.vertexStartIndex.set=function(e){this._structArray.uint32[this._pos4+2]=e},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineStartIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.lineLength.set=function(e){this._structArray.uint32[this._pos4+4]=e},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.segment.set=function(e){this._structArray.uint16[this._pos2+10]=e},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.lowerSize.set=function(e){this._structArray.uint16[this._pos2+11]=e},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.upperSize.set=function(e){this._structArray.uint16[this._pos2+12]=e},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetX.set=function(e){this._structArray.float32[this._pos4+7]=e},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.lineOffsetY.set=function(e){this._structArray.float32[this._pos4+8]=e},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.writingMode.set=function(e){this._structArray.uint8[this._pos1+36]=e},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},i.associatedIconIndex.set=function(e){this._structArray.int16[this._pos2+22]=e},Object.defineProperties(t.prototype,i),t}(In);ao.prototype.size=48;var so=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ao(this,e)},t}(Xn);pi.register("PlacedSymbolArray",so);var lo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.rightJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+2]=e},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.centerJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+3]=e},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.leftJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+4]=e},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.verticalPlacedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+5]=e},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.placedIconSymbolIndex.set=function(e){this._structArray.int16[this._pos2+6]=e},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.verticalPlacedIconSymbolIndex.set=function(e){this._structArray.int16[this._pos2+7]=e},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.key.set=function(e){this._structArray.uint16[this._pos2+8]=e},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.textBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+10]=e},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+11]=e},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.verticalTextBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+12]=e},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+13]=e},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.iconBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+14]=e},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+15]=e},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.verticalIconBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+16]=e},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.featureIndex.set=function(e){this._structArray.uint16[this._pos2+17]=e},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numHorizontalGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+18]=e},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numVerticalGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+19]=e},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numIconVertices.set=function(e){this._structArray.uint16[this._pos2+20]=e},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.numVerticalIconVertices.set=function(e){this._structArray.uint16[this._pos2+21]=e},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},i.crossTileID.set=function(e){this._structArray.uint32[this._pos4+11]=e},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},i.textBoxScale.set=function(e){this._structArray.float32[this._pos4+12]=e},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset0.set=function(e){this._structArray.float32[this._pos4+13]=e},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},i.textOffset1.set=function(e){this._structArray.float32[this._pos4+14]=e},Object.defineProperties(t.prototype,i),t}(In);lo.prototype.size=60;var uo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new lo(this,e)},t}(Hn);pi.register("SymbolInstanceArray",uo);var co=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={offsetX:{configurable:!0}};return i.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},i.offsetX.set=function(e){this._structArray.float32[this._pos4+0]=e},Object.defineProperties(t.prototype,i),t}(In);co.prototype.size=4;var ho=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t.prototype.get=function(e){return new co(this,e)},t}(Gn);pi.register("GlyphOffsetArray",ho);var fo=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return i.x.get=function(){return this._structArray.int16[this._pos2+0]},i.x.set=function(e){this._structArray.int16[this._pos2+0]=e},i.y.get=function(){return this._structArray.int16[this._pos2+1]},i.y.set=function(e){this._structArray.int16[this._pos2+1]=e},i.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},i.tileUnitDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+2]=e},Object.defineProperties(t.prototype,i),t}(In);fo.prototype.size=6;var po=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t.prototype.get=function(e){return new fo(this,e)},t}(Wn);pi.register("SymbolLineVertexArray",po);var _o=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.featureIndex.set=function(e){this._structArray.uint32[this._pos4+0]=e},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},i.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+3]=e},Object.defineProperties(t.prototype,i),t}(In);_o.prototype.size=8;var mo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new _o(this,e)},t}(Yn);pi.register("FeatureIndexArray",mo);var $o,go=($o=!0,function(e,t){var i=$o?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return $o=!1,i}),vo=go(void 0,(function(){return vo.toString().search("(((.+)+)+)+$").toString().constructor(vo).search("(((.+)+)+)+$")}));vo();var yo=function(e,t,i){this.property=e,this.value=t,this.parameters=i};yo.prototype.isConstant=function(){return"constant"===this.value.kind},yo.prototype.constantOr=function(e){return"constant"===this.value.kind?this.value.value:e},yo.prototype.evaluate=function(e,t,i){return this.property.evaluate(this.value,this.parameters,e,t,i)};var xo={},bo=function(e,t){this.gl=e.gl,this.location=t};xo.Uniform1i=function(e){function t(t,i){e.call(this,t,i),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}(bo),xo.Uniform1f=function(e){function t(t,i){e.call(this,t,i),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}(bo),xo.Uniform2f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}(bo),xo.Uniform3f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}(bo),xo.Uniform4f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}(bo),xo.UniformColor=function(e){function t(t,i){e.call(this,t,i),this.current=E.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}(bo);var wo=new Float32Array(16);function Co(e,t){return e??t}function To(e){return null!=e}function So(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}xo.UniformMatrix4f=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){e.call(this,t,i),this.current=wo}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.set=function(e){this.gl.uniformMatrix4fv(this.location,!1,e)},n}(bo),Co.EMPTY_OBJECT=Object.freeze({}),To(Object.create)&&(So.prototype=Object.create(Error.prototype),So.prototype.constructor=So),So.prototype.toString=function(){var e=this.name+": "+this.message;return To(this.stack)&&(e+="\n"+this.stack.toString()),e},So.throwInstantiationError=function(){throw new So("This function defines an interface and should not be called directly.")};var Eo=Object.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),Ao={BYTE:Eo.BYTE,UNSIGNED_BYTE:Eo.UNSIGNED_BYTE,SHORT:Eo.SHORT,UNSIGNED_SHORT:Eo.UNSIGNED_SHORT,INT:Eo.INT,UNSIGNED_INT:Eo.UNSIGNED_INT,FLOAT:Eo.FLOAT,DOUBLE:Eo.DOUBLE,getSizeInBytes:function(e){if(!To(e))throw new So("value is required.");switch(e){case Ao.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Ao.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ao.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Ao.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ao.INT:return Int32Array.BYTES_PER_ELEMENT;case Ao.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Ao.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Ao.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new So("componentDatatype is not a valid value.")}},fromTypedArray:function(e){return e instanceof Int8Array?Ao.BYTE:e instanceof Uint8Array?Ao.UNSIGNED_BYTE:e instanceof Int16Array?Ao.SHORT:e instanceof Uint16Array?Ao.UNSIGNED_SHORT:e instanceof Int32Array?Ao.INT:e instanceof Uint32Array?Ao.UNSIGNED_INT:e instanceof Float32Array?Ao.FLOAT:e instanceof Float64Array?Ao.DOUBLE:void 0},validate:function(e){return To(e)&&(e===Ao.BYTE||e===Ao.UNSIGNED_BYTE||e===Ao.SHORT||e===Ao.UNSIGNED_SHORT||e===Ao.INT||e===Ao.UNSIGNED_INT||e===Ao.FLOAT||e===Ao.DOUBLE)},createTypedArray:function(e,t){if(!To(e))throw new So("componentDatatype is required.");if(!To(t))throw new So("valuesOrLength is required.");switch(e){case Ao.BYTE:return new Int8Array(t);case Ao.UNSIGNED_BYTE:return new Uint8Array(t);case Ao.SHORT:return new Int16Array(t);case Ao.UNSIGNED_SHORT:return new Uint16Array(t);case Ao.INT:return new Int32Array(t);case Ao.UNSIGNED_INT:return new Uint32Array(t);case Ao.FLOAT:return new Float32Array(t);case Ao.DOUBLE:return new Float64Array(t);default:throw new So("componentDatatype is not a valid value.")}},createArrayBufferView:function(e,t,i,r){if(!To(e))throw new So("componentDatatype is required.");if(!To(t))throw new So("buffer is required.");switch(i=Co(i,0),r=Co(r,(t.byteLength-i)/Ao.getSizeInBytes(e)),e){case Ao.BYTE:return new Int8Array(t,i,r);case Ao.UNSIGNED_BYTE:return new Uint8Array(t,i,r);case Ao.SHORT:return new Int16Array(t,i,r);case Ao.UNSIGNED_SHORT:return new Uint16Array(t,i,r);case Ao.INT:return new Int32Array(t,i,r);case Ao.UNSIGNED_INT:return new Uint32Array(t,i,r);case Ao.FLOAT:return new Float32Array(t,i,r);case Ao.DOUBLE:return new Float64Array(t,i,r);default:throw new So("componentDatatype is not a valid value.")}},fromName:function(e){switch(e){case"BYTE":return Ao.BYTE;case"UNSIGNED_BYTE":return Ao.UNSIGNED_BYTE;case"SHORT":return Ao.SHORT;case"UNSIGNED_SHORT":return Ao.UNSIGNED_SHORT;case"INT":return Ao.INT;case"UNSIGNED_INT":return Ao.UNSIGNED_INT;case"FLOAT":return Ao.FLOAT;case"DOUBLE":return Ao.DOUBLE;default:throw new So("name is not a valid value.")}}},Po=Object.freeze(Ao),Io=function(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)};Io.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++)e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30,this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0},Io.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},Io.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var Mo={};function Oo(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}Mo.typeOf={},Mo.defined=function(e,t){if(!To(t))throw new So(function(e){return e+" is required, actual value was undefined"}(e))},Mo.typeOf.func=function(e,t){if("function"!=typeof t)throw new So(Oo(typeof t,"function",e))},Mo.typeOf.string=function(e,t){if("string"!=typeof t)throw new So(Oo(typeof t,"string",e))},Mo.typeOf.number=function(e,t){if("number"!=typeof t)throw new So(Oo(typeof t,"number",e))},Mo.typeOf.number.lessThan=function(e,t,i){if(Mo.typeOf.number(e,t),t>=i)throw new So("Expected "+e+" to be less than "+i+", actual value was "+t)},Mo.typeOf.number.lessThanOrEquals=function(e,t,i){if(Mo.typeOf.number(e,t),t>i)throw new So("Expected "+e+" to be less than or equal to "+i+", actual value was "+t)},Mo.typeOf.number.greaterThan=function(e,t,i){if(Mo.typeOf.number(e,t),t<=i)throw new So("Expected "+e+" to be greater than "+i+", actual value was "+t)},Mo.typeOf.number.greaterThanOrEquals=function(e,t,i){if(Mo.typeOf.number(e,t),t<i)throw new So("Expected "+e+" to be greater than or equal to"+i+", actual value was "+t)},Mo.typeOf.object=function(e,t){if("object"!=typeof t)throw new So(Oo(typeof t,"object",e))},Mo.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new So(Oo(typeof t,"boolean",e))},Mo.typeOf.number.equals=function(e,t,i,r){if(Mo.typeOf.number(e,i),Mo.typeOf.number(t,r),i!==r)throw new So(e+" must be equal to "+t+", the actual values are "+i+" and "+r)};var Do={Radius:6378137,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};Do.sign=Co(Math.sign,(function(e){return 0==(e=+e)||e!=e?e:e>0?1:-1})),Do.signNotZero=function(e){return e<0?-1:1},Do.toSNorm=function(e,t){return t=Co(t,255),Math.round((.5*Do.clamp(e,-1,1)+.5)*t)},Do.fromSNorm=function(e,t){return t=Co(t,255),Do.clamp(e,0,t)/t*2-1},Do.normalize=function(e,t,i){return 0===(i=Math.max(i-t,0))?0:Do.clamp((e-t)/i,0,1)},Do.sinh=Co(Math.sinh,(function(e){return(Math.exp(e)-Math.exp(-e))/2})),Do.cosh=Co(Math.cosh,(function(e){return(Math.exp(e)+Math.exp(-e))/2})),Do.lerp=function(e,t,i){return(1-i)*e+i*t},Do.PI=Math.PI,Do.ONE_OVER_PI=1/Math.PI,Do.PI_OVER_TWO=Math.PI/2,Do.PI_OVER_THREE=Math.PI/3,Do.PI_OVER_FOUR=Math.PI/4,Do.PI_OVER_SIX=Math.PI/6,Do.THREE_PI_OVER_TWO=3*Math.PI/2,Do.TWO_PI=2*Math.PI,Do.ONE_OVER_TWO_PI=1/(2*Math.PI),Do.RADIANS_PER_DEGREE=Math.PI/180,Do.DEGREES_PER_RADIAN=180/Math.PI,Do.RADIANS_PER_ARCSECOND=Do.RADIANS_PER_DEGREE/3600,Do.toRadians=function(e){if(!To(e))throw new So("degrees is required.");return e*Do.RADIANS_PER_DEGREE},Do.toDegrees=function(e){if(!To(e))throw new So("radians is required.");return e*Do.DEGREES_PER_RADIAN},Do.convertLongitudeRange=function(e){if(!To(e))throw new So("angle is required.");var t=Do.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},Do.clampToLatitudeRange=function(e){if(!To(e))throw new So("angle is required.");return Do.clamp(e,-1*Do.PI_OVER_TWO,Do.PI_OVER_TWO)},Do.negativePiToPi=function(e){if(!To(e))throw new So("angle is required.");return Do.zeroToTwoPi(e+Do.PI)-Do.PI},Do.zeroToTwoPi=function(e){if(!To(e))throw new So("angle is required.");var t=Do.mod(e,Do.TWO_PI);return Math.abs(t)<Do.EPSILON14&&Math.abs(e)>Do.EPSILON14?Do.TWO_PI:t},Do.mod=function(e,t){if(!To(e))throw new So("m is required.");if(!To(t))throw new So("n is required.");return(e%t+t)%t},Do.equalsEpsilon=function(e,t,i,r){if(!To(e))throw new So("left is required.");if(!To(t))throw new So("right is required.");if(!To(i))throw new So("relativeEpsilon is required.");r=Co(r,i);var n=Math.abs(e-t);return n<=r||n<=i*Math.max(Math.abs(e),Math.abs(t))},Do.lessThan=function(e,t,i){if(!To(e))throw new So("first is required.");if(!To(t))throw new So("second is required.");if(!To(i))throw new So("relativeEpsilon is required.");return e-t<-i},Do.lessThanOrEquals=function(e,t,i){if(!To(e))throw new So("first is required.");if(!To(t))throw new So("second is required.");if(!To(i))throw new So("relativeEpsilon is required.");return e-t<i},Do.greaterThan=function(e,t,i){if(!To(e))throw new So("first is required.");if(!To(t))throw new So("second is required.");if(!To(i))throw new So("relativeEpsilon is required.");return e-t>i},Do.greaterThanOrEquals=function(e,t,i){if(!To(e))throw new So("first is required.");if(!To(t))throw new So("second is required.");if(!To(i))throw new So("relativeEpsilon is required.");return e-t>-i};var Ro=[1];Do.factorial=function(e){if("number"!=typeof e||e<0)throw new So("A number greater than or equal to 0 is required.");var t=Ro.length;if(e>=t)for(var i=Ro[t-1],r=t;r<=e;r++){var n=i*r;Ro.push(n),i=n}return Ro[e]},Do.incrementWrap=function(e,t,i){if(i=Co(i,0),!To(e))throw new So("n is required.");if(t<=i)throw new So("maximumValue must be greater than minimumValue.");return++e>t&&(e=i),e},Do.isPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new So("A number greater than or equal to 0 is required.");return 0!==e&&0==(e&e-1)},Do.nextPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new So("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},Do.clamp=function(e,t,i){if(!To(e))throw new So("value is required");if(!To(t))throw new So("min is required.");if(!To(i))throw new So("max is required.");return e<t?t:e>i?i:e};var Lo=new Io;Do.setRandomNumberSeed=function(e){if(!To(e))throw new So("seed is required.");Lo=new Io(e)},Do.nextRandomNumber=function(){return Lo.random()},Do.randomBetween=function(e,t){return Do.nextRandomNumber()*(t-e)+e},Do.acosClamped=function(e){if(!To(e))throw new So("value is required.");return Math.acos(Do.clamp(e,-1,1))},Do.asinClamped=function(e){if(!To(e))throw new So("value is required.");return Math.asin(Do.clamp(e,-1,1))},Do.chordLength=function(e,t){if(!To(e))throw new So("angle is required.");if(!To(t))throw new So("radius is required.");return 2*t*Math.sin(.5*e)},Do.logBase=function(e,t){if(!To(e))throw new So("number is required.");if(!To(t))throw new So("base is required.");return Math.log(e)/Math.log(t)},Do.cbrt=Co(Math.cbrt,(function(e){var t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t})),Do.log2=Co(Math.log2,(function(e){return Math.log(e)*Math.LOG2E})),Do.fog=function(e,t){var i=e*t;return 1-Math.exp(-i*i)},Do.fastApproximateAtan=function(e){return Mo.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},Do.fastApproximateAtan2=function(e,t){Mo.typeOf.number("x",e),Mo.typeOf.number("y",t);var i,r,n=Math.abs(e);i=Math.abs(t),r=Math.max(n,i);var o=(i=Math.min(n,i))/r;if(isNaN(o))throw new So("either x or y must be nonzero");return n=Do.fastApproximateAtan(o),n=Math.abs(t)>Math.abs(e)?Do.PI_OVER_TWO-n:n,n=e<0?Do.PI-n:n,n=t<0?-n:n};var Bo={UNSIGNED_BYTE:Eo.UNSIGNED_BYTE,UNSIGNED_SHORT:Eo.UNSIGNED_SHORT,UNSIGNED_INT:Eo.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case Bo.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Bo.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Bo.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new So("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return Bo.UNSIGNED_SHORT;case 4:return Bo.UNSIGNED_INT;case 1:return Bo.UNSIGNED_BYTE;default:throw new So("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return To(e)&&(e===Bo.UNSIGNED_BYTE||e===Bo.UNSIGNED_SHORT||e===Bo.UNSIGNED_INT)},createTypedArray:function(e,t){if(!To(e))throw new So("numberOfVertices is required.");return e>=Do.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){if(!To(e))throw new So("numberOfVertices is required.");if(!To(t))throw new So("sourceArray is required.");if(!To(i))throw new So("byteOffset is required.");return e>=Do.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)}},No=Object.freeze(Bo),Fo={STREAM_DRAW:Eo.STREAM_DRAW,STATIC_DRAW:Eo.STATIC_DRAW,DYNAMIC_DRAW:Eo.DYNAMIC_DRAW,validate:function(e){return e===Fo.STREAM_DRAW||e===Fo.STATIC_DRAW||e===Fo.DYNAMIC_DRAW}};function zo(){return!0}function ko(e){if(e=Co(e,Co.EMPTY_OBJECT),Mo.defined("options.context",e.context),!To(e.typedArray)&&!To(e.sizeInBytes))throw new So("Either options.sizeInBytes or options.typedArray is required.");if(To(e.typedArray)&&To(e.sizeInBytes))throw new So("Cannot pass in both options.sizeInBytes and options.typedArray.");if(To(e.typedArray)&&(Mo.typeOf.object("options.typedArray",e.typedArray),Mo.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Fo.validate(e.usage))throw new So("usage is invalid.");var t=e.context._gl,i=e.bufferTarget,r=e.typedArray,n=e.sizeInBytes,o=e.usage,a=To(r);a&&(n=r.byteLength),Mo.typeOf.number.greaterThan("sizeInBytes",n,0);var s=t.createBuffer();t.bindBuffer(i,s),t.bufferData(i,a?r:n,o),t.bindBuffer(i,null),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=i,this._sizeInBytes=n,this._usage=o,this._buffer=s,this.vertexArrayDestroyable=!0,this.context=e.context,e.context.memorySize+=n}function Vo(e,t){this.x=Co(e,0),this.y=Co(t,0)}ko.createVertexBuffer=function(e){return Mo.defined("options.context",e.context),new ko({context:e.context,bufferTarget:Eo.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},ko.createIndexBuffer=function(e){if(Mo.defined("options.context",e.context),!No.validate(e.indexDatatype))throw new So("Invalid indexDatatype.");if(e.indexDatatype===No.UNSIGNED_INT&&!e.context.elementIndexUint)throw new So("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");var t=e.context,i=e.indexDatatype,r=No.getSizeInBytes(i),n=new ko({context:t,bufferTarget:Eo.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=n.sizeInBytes/r;return Object.defineProperties(n,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return o}}}),n},Object.defineProperties(ko.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),ko.prototype._getBuffer=function(){return this._buffer},ko.prototype.copyFromArrayView=function(e,t){t=Co(t,0),Mo.defined("arrayView",e),Mo.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);var i=this._gl,r=this._bufferTarget;i.bindBuffer(r,this._buffer),i.bufferSubData(r,t,e),i.bindBuffer(r,null)},ko.prototype.copyFromBuffer=function(e,t,i,r){if(!this._webgl2)throw new So("A WebGL 2 context is required.");if(!To(e))throw new So("readBuffer must be defined.");if(!To(r)||r<=0)throw new So("sizeInBytes must be defined and be greater than zero.");if(!To(t)||t<0||t+r>e._sizeInBytes)throw new So("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!To(i)||i<0||i+r>this._sizeInBytes)throw new So("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(i>=t&&i<t+r||t>i&&t<i+r))throw new So("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===Eo.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==Eo.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==Eo.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===Eo.ELEMENT_ARRAY_BUFFER)throw new So("Can not copy an index buffer into another buffer type.");var n=Eo.COPY_READ_BUFFER,o=Eo.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(n,e._buffer),a.copyBufferSubData(n,o,t,i,r),a.bindBuffer(o,null),a.bindBuffer(n,null)},ko.prototype.getBufferData=function(e,t,i,r){if(t=Co(t,0),i=Co(i,0),!this._webgl2)throw new So("A WebGL 2 context is required.");if(!To(e))throw new So("arrayView is required.");var n,o,a=e.byteLength;if(To(r)?(n=r,To(a)?o=1:(a=e.length,o=e.BYTES_PER_ELEMENT)):To(a)?(n=a-i,o=1):(n=(a=e.length)-i,o=e.BYTES_PER_ELEMENT),i<0||i>a)throw new So("destinationOffset must be greater than zero and less than the arrayView length.");if(i+n>a)throw new So("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new So("sourceOffset must be greater than zero and less than the buffers size.");if(t+n*o>this._sizeInBytes)throw new So("sourceOffset + length must be less than the buffers size.");var s=this._gl,l=Eo.COPY_READ_BUFFER;s.bindBuffer(l,this._buffer),s.getBufferSubData(l,t,e,i,r),s.bindBuffer(l,null)},ko.prototype.isDestroyed=function(){return!1},ko.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),this.context.memorySize-=this.sizeInBytes,function(e,t){function i(){throw new So(t)}for(var r in t=Co(t,"This object was destroyed, i.e., destroy() was called."),e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=zo}(this)},Vo.fromElements=function(e,t,i){return To(i)?(i.x=e,i.y=t,i):new Vo(e,t)},Vo.clone=function(e,t){if(To(e))return To(t)?(t.x=e.x,t.y=e.y,t):new Vo(e.x,e.y)},Vo.fromCartesian3=Vo.clone,Vo.fromCartesian4=Vo.clone,Vo.packedLength=2,Vo.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.x,t[i]=e.y,t},Vo.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Vo),i.x=e[t++],i.y=e[t],i},Vo.packArray=function(e,t){Mo.defined("array",e);var i=e.length,r=2*i;if(To(t)){if(!Array.isArray(t)&&t.length!==r)throw new So("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;n<i;++n)Vo.pack(e[n],t,2*n);return t},Vo.unpackArray=function(e,t){if(Mo.defined("array",e),Mo.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!=0)throw new So("array length must be a multiple of 2.");var i=e.length;To(t)?t.length=i/2:t=new Array(i/2);for(var r=0;r<i;r+=2){var n=r/2;t[n]=Vo.unpack(e,r,t[n])}return t},Vo.fromArray=Vo.unpack,Vo.maximumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.max(e.x,e.y)},Vo.minimumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.min(e.x,e.y)},Vo.minimumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},Vo.maximumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},Vo.magnitudeSquared=function(e){return Mo.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},Vo.magnitude=function(e){return Math.sqrt(Vo.magnitudeSquared(e))};var Uo=new Vo;Vo.distance=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Vo.subtract(e,t,Uo),Vo.magnitude(Uo)},Vo.distanceSquared=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Vo.subtract(e,t,Uo),Vo.magnitudeSquared(Uo)},Vo.normalize=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Vo.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,isNaN(t.x)||isNaN(t.y))throw new So("normalized result is not a number");return t},Vo.dot=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),e.x*t.x+e.y*t.y},Vo.multiplyComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i},Vo.divideComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i},Vo.add=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i},Vo.subtract=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i},Vo.multiplyByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i},Vo.divideByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i},Vo.negate=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},Vo.abs=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Xo=new Vo;Vo.lerp=function(e,t,i,r){return Mo.typeOf.object("start",e),Mo.typeOf.object("end",t),Mo.typeOf.number("t",i),Mo.typeOf.object("result",r),Vo.multiplyByScalar(t,i,Xo),r=Vo.multiplyByScalar(e,1-i,r),Vo.add(Xo,r,r)};var Ho=new Vo,Go=new Vo;Vo.angleBetween=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Vo.normalize(e,Ho),Vo.normalize(t,Go),Do.acosClamped(Vo.dot(Ho,Go))};var Wo=new Vo;function Yo(e,t,i){this.x=Co(e,0),this.y=Co(t,0),this.z=Co(i,0)}Vo.mostOrthogonalAxis=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Vo.normalize(e,Wo);return Vo.abs(i,i),t=i.x<=i.y?Vo.clone(Vo.UNIT_X,t):Vo.clone(Vo.UNIT_Y,t)},Vo.equals=function(e,t){return e===t||To(e)&&To(t)&&e.x===t.x&&e.y===t.y},Vo.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},Vo.equalsEpsilon=function(e,t,i,r){return e===t||To(e)&&To(t)&&Do.equalsEpsilon(e.x,t.x,i,r)&&Do.equalsEpsilon(e.y,t.y,i,r)},Vo.ZERO=Object.freeze(new Vo(0,0)),Vo.UNIT_X=Object.freeze(new Vo(1,0)),Vo.UNIT_Y=Object.freeze(new Vo(0,1)),Vo.prototype.clone=function(e){return Vo.clone(this,e)},Vo.prototype.equals=function(e){return Vo.equals(this,e)},Vo.prototype.equalsEpsilon=function(e,t,i){return Vo.equalsEpsilon(this,e,t,i)},Vo.prototype.toString=function(){return"("+this.x+", "+this.y+")"},Yo.fromSpherical=function(e,t){Mo.typeOf.object("spherical",e),To(t)||(t=new Yo);var i=e.clock,r=e.cone,n=Co(e.magnitude,1),o=n*Math.sin(r);return t.x=o*Math.cos(i),t.y=o*Math.sin(i),t.z=n*Math.cos(r),t},Yo.fromElements=function(e,t,i,r){return To(r)?(r.x=e,r.y=t,r.z=i,r):new Yo(e,t,i)},Yo.clone=function(e,t){if(To(e))return To(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Yo(e.x,e.y,e.z)},Yo.fromCartesian4=Yo.clone,Yo.packedLength=3,Yo.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},Yo.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Yo),i.x=e[t++],i.y=e[t++],i.z=e[t],i},Yo.packArray=function(e,t){Mo.defined("array",e);var i=e.length;To(t)?t.length=3*i:t=new Array(3*i);for(var r=0;r<i;++r)Yo.pack(e[r],t,3*r);return t},Yo.unpackArray=function(e,t){if(Mo.defined("array",e),Mo.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!=0)throw new So("array length must be a multiple of 3.");var i=e.length;To(t)?t.length=i/3:t=new Array(i/3);for(var r=0;r<i;r+=3){var n=r/3;t[n]=Yo.unpack(e,r,t[n])}return t},Yo.fromArray=Yo.unpack,Yo.maximumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},Yo.minimumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},Yo.minimumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},Yo.maximumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},Yo.magnitudeSquared=function(e){return Mo.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},Yo.magnitude=function(e){return Math.sqrt(Yo.magnitudeSquared(e))};var qo=new Yo;Yo.distance=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Yo.subtract(e,t,qo),Yo.magnitude(qo)},Yo.distanceSquared=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Yo.subtract(e,t,qo),Yo.magnitudeSquared(qo)},Yo.normalize=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Yo.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new So("normalized result is not a number");return t},Yo.dot=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},Yo.multiplyComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},Yo.divideComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},Yo.add=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},Yo.subtract=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},Yo.multiplyByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},Yo.divideByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},Yo.negate=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},Yo.abs=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var jo=new Yo;Yo.lerp=function(e,t,i,r){return Mo.typeOf.object("start",e),Mo.typeOf.object("end",t),Mo.typeOf.number("t",i),Mo.typeOf.object("result",r),Yo.multiplyByScalar(t,i,jo),r=Yo.multiplyByScalar(e,1-i,r),Yo.add(jo,r,r)};var Zo=new Yo,Ko=new Yo;Yo.angleBetween=function(e,t){Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Yo.normalize(e,Zo),Yo.normalize(t,Ko);var i=Yo.dot(Zo,Ko),r=Yo.magnitude(Yo.cross(Zo,Ko,Zo));return Math.atan2(r,i)};var Qo=new Yo;Yo.mostOrthogonalAxis=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Yo.normalize(e,Qo);return Yo.abs(i,i),t=i.x<=i.y?i.x<=i.z?Yo.clone(Yo.UNIT_X,t):Yo.clone(Yo.UNIT_Z,t):i.y<=i.z?Yo.clone(Yo.UNIT_Y,t):Yo.clone(Yo.UNIT_Z,t)},Yo.projectVector=function(e,t,i){Mo.defined("a",e),Mo.defined("b",t),Mo.defined("result",i);var r=Yo.dot(e,t)/Yo.dot(t,t);return Yo.multiplyByScalar(t,r,i)},Yo.equals=function(e,t){return e===t||To(e)&&To(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},Yo.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},Yo.equalsEpsilon=function(e,t,i,r){return e===t||To(e)&&To(t)&&Do.equalsEpsilon(e.x,t.x,i,r)&&Do.equalsEpsilon(e.y,t.y,i,r)&&Do.equalsEpsilon(e.z,t.z,i,r)},Yo.cross=function(e,t,i){Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i);var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},Yo.midpoint=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y),i.z=.5*(e.z+t.z),i},Yo.fromDegrees=function(e,t,i,r,n){return Mo.typeOf.number("longitude",e),Mo.typeOf.number("latitude",t),e=Do.toRadians(e),t=Do.toRadians(t),Yo.fromRadians(e,t,i,r,n)};var Jo=new Yo,ea=new Yo,ta=new Yo(40680631590769,40680631590769,40408299984661.445),ia=new Yo(40680631590769,40680631590769,40680631590769);Yo.fromRadians=function(e,t,i,r,n){Mo.typeOf.number("longitude",e),Mo.typeOf.number("latitude",t),i=Co(i,0);var o=To(r)?r.radiiSquared:ia;Do.equalsEpsilon(Do.Radius,6356752.314245179,Do.EPSILON10)&&(o=To(r)?r.radiiSquared:ta);var a=Math.cos(t);Jo.x=a*Math.cos(e),Jo.y=a*Math.sin(e),Jo.z=Math.sin(t),Jo=Yo.normalize(Jo,Jo),Yo.multiplyComponents(o,Jo,ea);var s=Math.sqrt(Yo.dot(Jo,ea));return ea=Yo.divideByScalar(ea,s,ea),Jo=Yo.multiplyByScalar(Jo,i,Jo),To(n)||(n=new Yo),Yo.add(ea,Jo,n)},Yo.fromDegreesArray=function(e,t,i){if(Mo.defined("coordinates",e),e.length<2||e.length%2!=0)throw new So("the number of coordinates must be a multiple of 2 and at least 2");var r=e.length;To(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var o=e[n],a=e[n+1],s=n/2;i[s]=Yo.fromDegrees(o,a,0,t,i[s])}return i},Yo.fromRadiansArray=function(e,t,i){if(Mo.defined("coordinates",e),e.length<2||e.length%2!=0)throw new So("the number of coordinates must be a multiple of 2 and at least 2");var r=e.length;To(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var o=e[n],a=e[n+1],s=n/2;i[s]=Yo.fromRadians(o,a,0,t,i[s])}return i},Yo.fromDegreesArrayHeights=function(e,t,i){if(Mo.defined("coordinates",e),e.length<3||e.length%3!=0)throw new So("the number of coordinates must be a multiple of 3 and at least 3");var r=e.length;To(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var o=e[n],a=e[n+1],s=e[n+2],l=n/3;i[l]=Yo.fromDegrees(o,a,s,t,i[l])}return i},Yo.fromRadiansArrayHeights=function(e,t,i){if(Mo.defined("coordinates",e),e.length<3||e.length%3!=0)throw new So("the number of coordinates must be a multiple of 3 and at least 3");var r=e.length;To(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var o=e[n],a=e[n+1],s=e[n+2],l=n/3;i[l]=Yo.fromRadians(o,a,s,t,i[l])}return i},Yo.ZERO=Object.freeze(new Yo(0,0,0)),Yo.UNIT_X=Object.freeze(new Yo(1,0,0)),Yo.UNIT_Y=Object.freeze(new Yo(0,1,0)),Yo.UNIT_Z=Object.freeze(new Yo(0,0,1)),Yo.UNIT_XYZ=Object.freeze(new Yo(1,1,1)),Yo.prototype.clone=function(e){return Yo.clone(this,e)},Yo.prototype.equals=function(e){return Yo.equals(this,e)},Yo.prototype.equalsEpsilon=function(e,t,i){return Yo.equalsEpsilon(this,e,t,i)},Yo.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Yo.globalOffset=new Yo(0,0,0);var ra=new Yo,na=new Yo;function oa(e,t,i,r,n){if(!To(e))throw new So("cartesian is required.");if(!To(t))throw new So("oneOverRadii is required.");if(!To(i))throw new So("oneOverRadiiSquared is required.");if(!To(r))throw new So("centerToleranceSquared is required.");var o=e.x,a=e.y,s=e.z,l=t.x,u=t.y,c=t.z,h=o*o*l*l,d=a*a*u*u,f=s*s*c*c,p=h+d+f,_=Math.sqrt(1/p),m=Yo.multiplyByScalar(e,_,ra);if(p<r)return isFinite(_)?Yo.clone(m,n):void 0;var $=i.x,g=i.y,v=i.z,y=na;y.x=m.x*$*2,y.y=m.y*g*2,y.z=m.z*v*2;var x,b,w,C,T,S,E,A=(1-_)*Yo.magnitude(e)/(.5*Yo.magnitude(y)),P=0;do{P=(x=h*(T=(b=1/(1+(A-=P)*$))*b)+d*(S=(w=1/(1+A*g))*w)+f*(E=(C=1/(1+A*v))*C)-1)/(-2*(h*(T*b)*$+d*(S*w)*g+f*(E*C)*v))}while(Math.abs(x)>Do.EPSILON12);return To(n)?(n.x=o*b,n.y=a*w,n.z=s*C,n):new Yo(o*b,a*w,s*C)}function aa(e,t,i){this.longitude=Co(e,0),this.latitude=Co(t,0),this.height=Co(i,0)}aa.fromRadians=function(e,t,i,r){return Mo.typeOf.number("longitude",e),Mo.typeOf.number("latitude",t),i=Co(i,0),To(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new aa(e,t,i)},aa.fromDegrees=function(e,t,i,r){return Mo.typeOf.number("longitude",e),Mo.typeOf.number("latitude",t),e=Do.toRadians(e),t=Do.toRadians(t),aa.fromRadians(e,t,i,r)};var sa=new Yo,la=new Yo,ua=new Yo,ca=new Yo(1/6378137,1/6378137,1/6356752.314245179),ha=new Yo(1/6378137,1/6378137,1/6378137),da=new Yo(1/40680631590769,1/40680631590769,1/40408299984661.445),fa=new Yo(1/40680631590769,1/40680631590769,1/40680631590769),pa=Do.EPSILON1;function _a(e,t,i,r){t=Co(t,0),i=Co(i,0),r=Co(r,0),Mo.typeOf.number.greaterThanOrEquals("x",t,0),Mo.typeOf.number.greaterThanOrEquals("y",i,0),Mo.typeOf.number.greaterThanOrEquals("z",r,0),Do.equalsEpsilon(r,6356752.314245179,Do.EPSILON10)&&(Do.Radius=r),e._radii=new Yo(t,i,r),e._radiiSquared=new Yo(t*t,i*i,r*r),e._radiiToTheFourth=new Yo(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new Yo(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new Yo(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=Do.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function ma(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,_a(this,e,t,i)}aa.fromCartesian=function(e,t,i){var r=To(t)?t.oneOverRadii:ha,n=To(t)?t.oneOverRadiiSquared:fa,o=To(t)?t._centerToleranceSquared:pa;Do.equalsEpsilon(Do.Radius,6356752.314245179,Do.EPSILON10)&&(r=To(t)?t.oneOverRadii:ca,n=To(t)?t.oneOverRadiiSquared:da);var a=oa(e,r,n,o,la);if(To(a)){var s=Yo.multiplyComponents(a,n,sa);s=Yo.normalize(s,s);var l=Yo.subtract(e,a,ua),u=Math.atan2(s.y,s.x),c=Math.asin(s.z),h=Do.sign(Yo.dot(l,e))*Yo.magnitude(l);return To(i)?(i.longitude=u,i.latitude=c,i.height=h,i):new aa(u,c,h)}},aa.toCartesian=function(e,t,i){return Mo.defined("cartographic",e),Yo.fromRadians(e.longitude,e.latitude,e.height,t,i)},aa.sphericalDistance=function(e,t,i,r){if(Mo.defined("longitudeA",e),Mo.defined("longitudeB",i),Mo.defined("latitudeA",t),Mo.defined("latitudeB",r),e===i&&t===r)return 0;var n=Do.toRadians(t),o=Do.toRadians(r),a=Do.toRadians(e),s=Do.toRadians(i),l=a*a+n*n,u=s*s+o*o,c=(l+u-((a-s)*(a-s)+(n-o)*(n-o)))/(2*Math.sqrt(l)*Math.sqrt(u));return c=Do.clamp(c,-1,1),Math.acos(c)*Do.Radius},aa.clone=function(e,t){if(To(e))return To(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new aa(e.longitude,e.latitude,e.height)},aa.equals=function(e,t){return e===t||To(e)&&To(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},aa.equalsEpsilon=function(e,t,i){return Mo.typeOf.number("epsilon",i),e===t||To(e)&&To(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},aa.ZERO=Object.freeze(new aa(0,0,0)),aa.prototype.clone=function(e){return aa.clone(this,e)},aa.prototype.equals=function(e){return aa.equals(this,e)},aa.prototype.equalsEpsilon=function(e,t){return aa.equalsEpsilon(this,e,t)},aa.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(ma.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}}}),ma.clone=function(e,t){if(To(e)){var i=e._radii;return To(t)?(Yo.clone(i,t._radii),Yo.clone(e._radiiSquared,t._radiiSquared),Yo.clone(e._radiiToTheFourth,t._radiiToTheFourth),Yo.clone(e._oneOverRadii,t._oneOverRadii),Yo.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new ma(i.x,i.y,i.z)}},ma.fromCartesian3=function(e,t){return To(t)||(t=new ma),To(e)&&_a(t,e.x,e.y,e.z),t},ma.WGS84=Object.freeze(new ma(6378137,6378137,Do.Radius)),ma.XIAN80=Object.freeze(new ma(6378140,6378140,6356755.29)),ma.CGCS2000=Object.freeze(new ma(6378137,6378137,6356752.31)),ma.UNIT_SPHERE=Object.freeze(new ma(1,1,1)),ma.MOON=Object.freeze(new ma(Do.LUNAR_RADIUS,Do.LUNAR_RADIUS,Do.LUNAR_RADIUS)),ma.prototype.clone=function(e){return ma.clone(this,e)},ma.packedLength=Yo.packedLength,ma.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),Yo.pack(e._radii,t,i),t},ma.unpack=function(e,t,i){Mo.defined("array",e),t=Co(t,0);var r=Yo.unpack(e,t);return ma.fromCartesian3(r,i)},ma.prototype.geocentricSurfaceNormal=Yo.normalize,ma.prototype.geodeticSurfaceNormalCartographic=function(e,t){Mo.typeOf.object("cartographic",e);var i=e.longitude,r=e.latitude,n=Math.cos(r),o=n*Math.cos(i),a=n*Math.sin(i),s=Math.sin(r);return To(t)||(t=new Yo),t.x=o,t.y=a,t.z=s,Yo.normalize(t,t)},ma.prototype.geodeticSurfaceNormal=function(e,t){return To(t)||(t=new Yo),t=Yo.multiplyComponents(e,this._oneOverRadiiSquared,t),Yo.normalize(t,t)};var $a=new Yo,ga=new Yo;ma.prototype.cartographicToCartesian=function(e,t){var i=$a,r=ga;this.geodeticSurfaceNormalCartographic(e,i),Yo.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(Yo.dot(i,r));return Yo.divideByScalar(r,n,r),Yo.multiplyByScalar(i,e.height,i),To(t)||(t=new Yo),Yo.add(r,i,t)},ma.prototype.cartographicArrayToCartesianArray=function(e,t){Mo.defined("cartographics",e);var i=e.length;To(t)?t.length=i:t=new Array(i);for(var r=0;r<i;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var va=new Yo,ya=new Yo,xa=new Yo;function ba(e){this._ellipsoid=Co(e,ma.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}ma.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,ya);if(To(i)){var r=this.geodeticSurfaceNormal(i,va),n=Yo.subtract(e,i,xa),o=Math.atan2(r.y,r.x),a=Math.asin(r.z),s=Do.sign(Yo.dot(n,e))*Yo.magnitude(n);return To(t)?(t.longitude=o,t.latitude=a,t.height=s,t):new aa(o,a,s)}},ma.prototype.cartesianArrayToCartographicArray=function(e,t){Mo.defined("cartesians",e);var i=e.length;To(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},ma.prototype.scaleToGeodeticSurface=function(e,t){return oa(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},ma.prototype.scaleToGeocentricSurface=function(e,t){Mo.typeOf.object("cartesian",e),To(t)||(t=new Yo);var i=e.x,r=e.y,n=e.z,o=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*o.x+r*r*o.y+n*n*o.z);return Yo.multiplyByScalar(e,a,t)},ma.prototype.transformPositionToScaledSpace=function(e,t){return To(t)||(t=new Yo),Yo.multiplyComponents(e,this._oneOverRadii,t)},ma.prototype.transformPositionFromScaledSpace=function(e,t){return To(t)||(t=new Yo),Yo.multiplyComponents(e,this._radii,t)},ma.prototype.equals=function(e){return this===e||To(e)&&Yo.equals(this._radii,e._radii)},ma.prototype.toString=function(){return this._radii.toString()},ma.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,i){if(Mo.typeOf.object("position",e),!Do.equalsEpsilon(this._radii.x,this._radii.y,Do.EPSILON15))throw new So("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");Mo.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=Co(t,0);var r=this._squaredXOverSquaredZ;if(To(i)||(i=new Yo),i.x=0,i.y=0,i.z=e.z*(1-r),!(Math.abs(i.z)>=this._radii.z-t))return i},Object.defineProperties(ba.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ba.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,n=e.latitude*i,o=e.height;return To(t)?(t.x=r,t.y=n,t.z=o,t):new Yo(r,n,o)},ba.prototype.unproject=function(e,t){if(!To(e))throw new So("cartesian is required");var i=this._oneOverSemimajorAxis,r=e.x*i,n=e.y*i,o=e.z;return To(t)?(t.longitude=r,t.latitude=n,t.height=o,t):new aa(r,n,o)};var wa=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function Ca(e,t,i,r){this.west=Co(e,0),this.south=Co(t,0),this.east=Co(i,0),this.north=Co(r,0)}Object.defineProperties(Ca.prototype,{width:{get:function(){return Ca.computeWidth(this)}},height:{get:function(){return Ca.computeHeight(this)}}}),Ca.packedLength=4,Ca.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},Ca.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Ca),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},Ca.computeWidth=function(e){Mo.typeOf.object("rectangle",e);var t=e.east,i=e.west;return t<i&&(t+=Do.TWO_PI),t-i},Ca.computeHeight=function(e){return Mo.typeOf.object("rectangle",e),e.north-e.south},Ca.fromDegrees=function(e,t,i,r,n){return e=Do.toRadians(Co(e,0)),t=Do.toRadians(Co(t,0)),i=Do.toRadians(Co(i,0)),r=Do.toRadians(Co(r,0)),To(n)?(n.west=e,n.south=t,n.east=i,n.north=r,n):new Ca(e,t,i,r)},Ca.fromRadians=function(e,t,i,r,n){return To(n)?(n.west=Co(e,0),n.south=Co(t,0),n.east=Co(i,0),n.north=Co(r,0),n):new Ca(e,t,i,r)},Ca.fromCartographicArray=function(e,t){Mo.defined("cartographics",e);for(var i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=0,u=e.length;l<u;l++){var c=e[l];i=Math.min(i,c.longitude),r=Math.max(r,c.longitude),a=Math.min(a,c.latitude),s=Math.max(s,c.latitude);var h=c.longitude>=0?c.longitude:c.longitude+Do.TWO_PI;n=Math.min(n,h),o=Math.max(o,h)}return r-i>o-n&&(i=n,(r=o)>Do.PI&&(r-=Do.TWO_PI),i>Do.PI&&(i-=Do.TWO_PI)),To(t)?(t.west=i,t.south=a,t.east=r,t.north=s,t):new Ca(i,a,r,s)},Ca.fromCartesianArray=function(e,t,i){Mo.defined("cartesians",e),t=Co(t,ma.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0,c=e.length;u<c;u++){var h=t.cartesianToCartographic(e[u]);r=Math.min(r,h.longitude),n=Math.max(n,h.longitude),s=Math.min(s,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+Do.TWO_PI;o=Math.min(o,d),a=Math.max(a,d)}return n-r>a-o&&(r=o,(n=a)>Do.PI&&(n-=Do.TWO_PI),r>Do.PI&&(r-=Do.TWO_PI)),To(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new Ca(r,s,n,l)},Ca.clone=function(e,t){if(To(e))return To(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Ca(e.west,e.south,e.east,e.north)},Ca.equalsEpsilon=function(e,t,i){return Mo.typeOf.number("absoluteEpsilon",i),e===t||To(e)&&To(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},Ca.prototype.clone=function(e){return Ca.clone(this,e)},Ca.prototype.equals=function(e){return Ca.equals(this,e)},Ca.equals=function(e,t){return e===t||To(e)&&To(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Ca.prototype.equalsEpsilon=function(e,t){return Mo.typeOf.number("epsilon",t),Ca.equalsEpsilon(this,e,t)},Ca.validate=function(e){Mo.typeOf.object("rectangle",e);var t=e.north;Mo.typeOf.number.greaterThanOrEquals("north",t,-Do.PI_OVER_TWO),Mo.typeOf.number.lessThanOrEquals("north",t,Do.PI_OVER_TWO);var i=e.south;Mo.typeOf.number.greaterThanOrEquals("south",i,-Do.PI_OVER_TWO),Mo.typeOf.number.lessThanOrEquals("south",i,Do.PI_OVER_TWO);var r=e.west;Mo.typeOf.number.greaterThanOrEquals("west",r,-Math.PI),Mo.typeOf.number.lessThanOrEquals("west",r,Math.PI);var n=e.east;Mo.typeOf.number.greaterThanOrEquals("east",n,-Math.PI),Mo.typeOf.number.lessThanOrEquals("east",n,Math.PI)},Ca.southwest=function(e,t){return Mo.typeOf.object("rectangle",e),To(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new aa(e.west,e.south)},Ca.northwest=function(e,t){return Mo.typeOf.object("rectangle",e),To(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new aa(e.west,e.north)},Ca.northeast=function(e,t){return Mo.typeOf.object("rectangle",e),To(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new aa(e.east,e.north)},Ca.southeast=function(e,t){return Mo.typeOf.object("rectangle",e),To(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new aa(e.east,e.south)},Ca.center=function(e,t){Mo.typeOf.object("rectangle",e);var i=e.east,r=e.west;i<r&&(i+=Do.TWO_PI);var n=Do.negativePiToPi(.5*(r+i)),o=.5*(e.south+e.north);return To(t)?(t.longitude=n,t.latitude=o,t.height=0,t):new aa(n,o)},Ca.intersection=function(e,t,i){Mo.typeOf.object("rectangle",e),Mo.typeOf.object("otherRectangle",t);var r=e.east,n=e.west,o=t.east,a=t.west;r<n&&o>0?r+=Do.TWO_PI:o<a&&r>0&&(o+=Do.TWO_PI),r<n&&a<0?a+=Do.TWO_PI:o<a&&n<0&&(n+=Do.TWO_PI);var s=Do.negativePiToPi(Math.max(n,a)),l=Do.negativePiToPi(Math.min(r,o));if(!((e.west<e.east||t.west<t.east)&&l<=s)){var u=Math.max(e.south,t.south),c=Math.min(e.north,t.north);if(!(u>=c))return To(i)?(i.west=s,i.south=u,i.east=l,i.north=c,i):new Ca(s,u,l,c)}},Ca.simpleIntersection=function(e,t,i){Mo.typeOf.object("rectangle",e),Mo.typeOf.object("otherRectangle",t);var r=Math.max(e.west,t.west),n=Math.max(e.south,t.south),o=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(n>=a||r>=o))return To(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):new Ca(r,n,o,a)},Ca.union=function(e,t,i){Mo.typeOf.object("rectangle",e),Mo.typeOf.object("otherRectangle",t),To(i)||(i=new Ca);var r=e.east,n=e.west,o=t.east,a=t.west;r<n&&o>0?r+=Do.TWO_PI:o<a&&r>0&&(o+=Do.TWO_PI),r<n&&a<0?a+=Do.TWO_PI:o<a&&n<0&&(n+=Do.TWO_PI);var s=Do.convertLongitudeRange(Math.min(n,a)),l=Do.convertLongitudeRange(Math.max(r,o));return i.west=s,i.south=Math.min(e.south,t.south),i.east=l,i.north=Math.max(e.north,t.north),i},Ca.expand=function(e,t,i){return Mo.typeOf.object("rectangle",e),Mo.typeOf.object("cartographic",t),To(i)||(i=new Ca),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},Ca.contains=function(e,t){Mo.typeOf.object("rectangle",e),Mo.typeOf.object("cartographic",t);var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return o<n&&(o+=Do.TWO_PI,i<0&&(i+=Do.TWO_PI)),(i>n||Do.equalsEpsilon(i,n,Do.EPSILON14))&&(i<o||Do.equalsEpsilon(i,o,Do.EPSILON14))&&r>=e.south&&r<=e.north};var Ta=new aa;Ca.subsample=function(e,t,i,r){Mo.typeOf.object("rectangle",e),t=Co(t,ma.WGS84),i=Co(i,0),To(r)||(r=[]);var n=0,o=e.north,a=e.south,s=e.east,l=e.west,u=Ta;u.height=i,u.longitude=l,u.latitude=o,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=s,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=a,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=l,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=o<0?o:a>0?a:0;for(var c=1;c<8;++c)u.longitude=-Math.PI+c*Do.PI_OVER_TWO,Ca.contains(e,u)&&(r[n]=t.cartographicToCartesian(u,r[n]),n++);return 0===u.latitude&&(u.longitude=l,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=s,r[n]=t.cartographicToCartesian(u,r[n]),n++),r.length=n,r};var Sa=new aa;function Ea(e,t,i,r){this.x=Co(e,0),this.y=Co(t,0),this.width=Co(i,0),this.height=Co(r,0)}Ca.prototype.contains=function(e){return Ca.contains(this,Ca.southwest(e,Sa))&&Ca.contains(this,Ca.northwest(e,Sa))&&Ca.contains(this,Ca.southeast(e,Sa))&&Ca.contains(this,Ca.northeast(e,Sa))},Ca.MAX_VALUE=Object.freeze(new Ca(-Math.PI,-Do.PI_OVER_TWO,Math.PI,Do.PI_OVER_TWO)),Ea.packedLength=4,Ea.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},Ea.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Ea),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},Ea.fromPoints=function(e,t){if(To(t)||(t=new Ea),!To(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,r=e[0].x,n=e[0].y,o=e[0].x,a=e[0].y,s=1;s<i;s++){var l=e[s],u=l.x,c=l.y;r=Math.min(u,r),o=Math.max(u,o),n=Math.min(c,n),a=Math.max(c,a)}return t.x=r,t.y=n,t.width=o-r,t.height=a-n,t};var Aa=new ba,Pa=new aa,Ia=new aa;Ea.fromRectangle=function(e,t,i){if(To(i)||(i=new Ea),!To(e))return i.x=0,i.y=0,i.width=0,i.height=0,i;var r=(t=Co(t,Aa)).project(Ca.southwest(e,Pa)),n=t.project(Ca.northeast(e,Ia));return Vo.subtract(n,r,n),i.x=r.x,i.y=r.y,i.width=n.x,i.height=n.y,i},Ea.clone=function(e,t){if(To(e))return To(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Ea(e.x,e.y,e.width,e.height)},Ea.union=function(e,t,i){Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),To(i)||(i=new Ea);var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),a=Math.max(e.y+e.height,t.y+t.height);return i.x=r,i.y=n,i.width=o-r,i.height=a-n,i},Ea.expand=function(e,t,i){Mo.typeOf.object("rectangle",e),Mo.typeOf.object("point",t),i=Ea.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},Ea.intersect=function(e,t){Mo.typeOf.object("left",e),Mo.typeOf.object("right",t);var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?wa.OUTSIDE:wa.INTERSECTING},Ea.equals=function(e,t){return e===t||To(e)&&To(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},Ea.prototype.clone=function(e){return Ea.clone(this,e)},Ea.prototype.intersect=function(e){return Ea.intersect(this,e)},Ea.prototype.equals=function(e){return Ea.equals(this,e)};var Ma,Oa,Da,Ra,La,Ba,Na,Fa,za,ka,Va,Ua,Xa,Ha,Ga,Wa,Ya,qa,ja,Za,Ka,Qa,Ja,es,ts={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},is={};function rs(e,t,i,r){return ns(e).then(t,i,r)}function ns(e){var t,i;return e instanceof os?t=e:ls(e)?(i=ss(),e.then((function(e){i.resolve(e)}),(function(e){i.reject(e)}),(function(e){i.progress(e)})),t=i.promise):t=function(e){var t=new os((function(t){try{return ns(t?t(e):e)}catch(e){return as(e)}}));return t}(e),t}function os(e){this.then=e}function as(e){var t=new os((function(t,i){try{return i?ns(i(e)):as(e)}catch(e){return as(e)}}));return t}function ss(){var e,t,i,r,n,o;return e=new os(a),t=[],i=[],r=function(e,r,n){var o,a;return o=ss(),a="function"==typeof n?function(e){try{o.progress(n(e))}catch(e){o.progress(e)}}:function(e){o.progress(e)},t.push((function(t){t.then(e,r).then(o.resolve,o.reject,a)})),i.push(a),o.promise},n=function(e){return ds(i,e),e},o=function(e){return e=ns(e),r=e.then,o=ns,n=ps,ds(t,e),i=t=Ra,e},{then:a,resolve:s,reject:l,progress:u,promise:e,resolver:{resolve:s,reject:l,progress:u}};function a(e,t,i){return r(e,t,i)}function s(e){return o(e)}function l(e){return o(as(e))}function u(e){return n(e)}}function ls(e){return e&&"function"==typeof e.then}function us(e,t,i,r,n){return fs(2,arguments),rs(e,(function(e){var o,a,s,l,u,c,h,d,f,p;if(f=e.length>>>0,o=Math.max(0,Math.min(t,f)),s=[],a=f-o+1,l=[],u=ss(),o)for(d=u.progress,h=function(e){l.push(e),--a||(c=h=ps,u.reject(l))},c=function(e){s.push(e),--o||(c=h=ps,u.resolve(s))},p=0;p<f;++p)p in e&&rs(e[p],m,_,d);else u.resolve(s);return u.then(i,r,n);function _(e){h(e)}function m(e){c(e)}}))}function cs(e,t,i,r){return fs(1,arguments),hs(e,_s).then(t,i,r)}function hs(e,t){return rs(e,(function(e){var i,r,n,o,a,s;if(n=r=e.length>>>0,i=[],s=ss(),n)for(o=function(e,r){rs(e,t).then((function(e){i[r]=e,--n||s.resolve(i)}),s.reject)},a=0;a<r;a++)a in e?o(e[a],a):--n;else s.resolve(i);return s.promise}))}function ds(e,t){for(var i,r=0;i=e[r++];)i(t)}function fs(e,t){for(var i,r=t.length;r>e;)if(null!=(i=t[--r])&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function ps(){}function _s(e){return e}function ms(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function $s(){if(!To(Ba)&&(Ba=!1,!xs())){var e=/ Chrome\/([\.0-9]+)/.exec(La.userAgent);null!==e&&(Ba=!0,Na=ms(e[1]))}return Ba}function gs(){if(!To(Fa)&&(Fa=!1,!$s()&&!xs()&&/ Safari\/[\.0-9]+/.test(La.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(La.userAgent);null!==e&&(Fa=!0,za=ms(e[1]))}return Fa}function vs(){if(!To(ka)){ka=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(La.userAgent);null!==e&&(ka=!0,(Va=ms(e[1])).isNightly=!!e[2])}return ka}function ys(){var e;return To(Ua)||(Ua=!1,"Microsoft Internet Explorer"===La.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(La.userAgent))&&(Ua=!0,Xa=ms(e[1])):"Netscape"===La.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(La.userAgent))&&(Ua=!0,Xa=ms(e[1]))),Ua}function xs(){if(!To(Ha)){Ha=!1;var e=/ Edge\/([\.0-9]+)/.exec(La.userAgent);null!==e&&(Ha=!0,Ga=ms(e[1]))}return Ha}function bs(){if(!To(Wa)){Wa=!1;var e=/Firefox\/([\.0-9]+)/.exec(La.userAgent);null!==e&&(Wa=!0,Ya=ms(e[1]))}return Wa}function ws(){if(!To(Qa)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var t=e.style.imageRendering;(Qa=To(t)&&""!==t)&&(Ka=t)}return Qa}function Cs(){if(To(es))return es.promise;es=rs.defer(),xs()&&(Ja=!1,es.resolve(Ja));var e=new Image;return e.onload=function(){Ja=e.width>0&&e.height>0,es.resolve(Ja)},e.onerror=function(){Ja=!1,es.resolve(Ja)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",es.promise}Object.defineProperties(is,{element:{get:function(){if(is.supportsFullscreen())return document[ts.fullscreenElement]}},changeEventName:{get:function(){if(is.supportsFullscreen())return ts.fullscreenchange}},errorEventName:{get:function(){if(is.supportsFullscreen())return ts.fullscreenerror}},enabled:{get:function(){if(is.supportsFullscreen())return document[ts.fullscreenEnabled]}},fullscreen:{get:function(){if(is.supportsFullscreen())return null!==is.element}}}),is.supportsFullscreen=function(){if(To(Ma))return Ma;Ma=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return ts.requestFullscreen="requestFullscreen",ts.exitFullscreen="exitFullscreen",ts.fullscreenEnabled="fullscreenEnabled",ts.fullscreenElement="fullscreenElement",ts.fullscreenchange="fullscreenchange",ts.fullscreenerror="fullscreenerror",Ma=!0;for(var t,i=["webkit","moz","o","ms","khtml"],r=0,n=i.length;r<n;++r){var o=i[r];("function"==typeof e[t=o+"RequestFullscreen"]||"function"==typeof e[t=o+"RequestFullScreen"])&&(ts.requestFullscreen=t,Ma=!0),t=o+"ExitFullscreen","function"==typeof document[t]?ts.exitFullscreen=t:(t=o+"CancelFullScreen","function"==typeof document[t]&&(ts.exitFullscreen=t)),t=o+"FullscreenEnabled",void 0!==document[t]?ts.fullscreenEnabled=t:(t=o+"FullScreenEnabled",void 0!==document[t]&&(ts.fullscreenEnabled=t)),t=o+"FullscreenElement",void 0!==document[t]?ts.fullscreenElement=t:(t=o+"FullScreenElement",void 0!==document[t]&&(ts.fullscreenElement=t)),t=o+"fullscreenchange",void 0!==document["on"+t]&&("ms"===o&&(t="MSFullscreenChange"),ts.fullscreenchange=t),t=o+"fullscreenerror",void 0!==document["on"+t]&&("ms"===o&&(t="MSFullscreenError"),ts.fullscreenerror=t)}return Ma},is.requestFullscreen=function(e,t){!is.supportsFullscreen()||e[ts.requestFullscreen]({vrDisplay:t})},is.exitFullscreen=function(){!is.supportsFullscreen()||document[ts.exitFullscreen]()},is._names=ts,rs.defer=ss,rs.resolve=ns,rs.reject=function(e){return rs(e,as)},rs.join=function(){return hs(arguments,_s)},rs.all=cs,rs.map=hs,rs.reduce=function(e,t){var i=Da.call(arguments,1);return rs(e,(function(e){var r;return r=e.length,i[0]=function(e,i,n){return rs(e,(function(e){return rs(i,(function(i){return t(e,i,n,r)}))}))},Oa.apply(e,i)}))},rs.any=function(e,t,i,r){return us(e,1,(function(e){return t?t(e[0]):e[0]}),i,r)},rs.some=us,rs.allSettled=function(e,t,i,r){return fs(1,arguments),rs(e,(function(e){var n,o,a,s,l,u,c,h,d;for(c=e.length>>>0,h=e.length>>>0,n=[],o=[],u=(a=ss()).progress,l=function(e){o.push(e),--h||(s=l=ps,a.resolve(n))},s=function(e,t){n[t]=e,--h||(s=l=ps,a.resolve(n))},d=0;d<c;++d)switch(d){case 0:rs(e[d],_,f,u);break;case 1:rs(e[d],m,f,u);break;case 2:rs(e[d],$,f,u);break;case 3:rs(e[d],g,f,u);break;case 4:rs(e[d],v,f,u);break;default:rs(e[d],p,f,u)}return a.then(t,i,r);function f(e){l(e)}function p(e){s(e,0)}function _(e){s(e,0)}function m(e){s(e,1)}function $(e){s(e,2)}function g(e){s(e,3)}function v(e){s(e,4)}}))},rs.chain=function(e,t,i){var r=arguments.length>2;return rs(e,(function(e){return e=r?i:e,t.resolve(e),e}),(function(e){return t.reject(e),as(e)}),t.progress)},rs.isPromise=ls,os.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(Ra,e)},yield:function(e){return this.then((function(){return e}))},spread:function(e){return this.then((function(t){return cs(t,(function(t){return e.apply(Ra,t)}))}))}},Da=[].slice,Oa=[].reduce||function(e){var t,i,r,n,o;if(o=0,n=(t=Object(this)).length>>>0,(i=arguments).length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o<n;++o)o in t&&(r=e(r,t[o],o,t));return r},La=typeof navigator<"u"?navigator:{};var Ts=[];typeof ArrayBuffer<"u"&&(Ts.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&Ts.push(Uint8ClampedArray),typeof CanvasPixelArray<"u"&&Ts.push(CanvasPixelArray));var Ss,Es,As,Ps={isChrome:$s,chromeVersion:function(){return $s()&&Na},isSafari:gs,safariVersion:function(){return gs()&&za},isWebkit:vs,webkitVersion:function(){return vs()&&Va},isInternetExplorer:ys,internetExplorerVersion:function(){return ys()&&Xa},isEdge:xs,edgeVersion:function(){return xs()&&Ga},isFirefox:bs,firefoxVersion:function(){return bs()&&Ya},isWindows:function(){return To(qa)||(qa=/Windows/i.test(La.appVersion)),qa},isNodeJs:function(){return To(ja)||(ja="object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)),ja},hardwareConcurrency:Co(La.hardwareConcurrency,3),supportsPointerEvents:function(){return To(Za)||(Za=!bs()&&typeof PointerEvent<"u"&&(!To(La.pointerEnabled)||La.pointerEnabled)),Za},supportsImageRenderingPixelated:ws,supportsWebP:Cs,supportsWebPSync:function(){return To(es)||Cs(),Ja},imageRenderingValue:function(){return ws()?Ka:void 0},typedArrayTypes:Ts,isPCBroswer:function(){var e=window.navigator.userAgent.toLowerCase(),t="ipad"==e.match(/ipad/i),i="iphone os"==e.match(/iphone os/i),r="midp"==e.match(/midp/i),n="ucweb"==e.match(/ucweb/i),o="android"==e.match(/android/i),a="windows ce"==e.match(/windows ce/i),s="windows mobile"==e.match(/windows mobile/i);return!(t||i||r||n||o||a||s)}};function Is(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function Ms(e,t,i,r){this.red=Co(e,1),this.green=Co(t,1),this.blue=Co(i,1),this.alpha=Co(r,1)}Ps.supportsFullscreen=function(){return is.supportsFullscreen()},Ps.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},Ps.supportsWebWorkers=function(){return typeof Worker<"u"},Ps.supportsWebAssembly=function(){return typeof WebAssembly<"u"&&!Ps.isEdge()},Ps.supportsOffscreenCanvas=function(){return typeof OffscreenCanvas<"u"&&!Ps.isEdge()},Ms.fromCartesian4=function(e,t){return Mo.typeOf.object("cartesian",e),To(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new Ms(e.x,e.y,e.z,e.w)},Ms.fromBytes=function(e,t,i,r,n){return e=Ms.byteToFloat(Co(e,255)),t=Ms.byteToFloat(Co(t,255)),i=Ms.byteToFloat(Co(i,255)),r=Ms.byteToFloat(Co(r,255)),To(n)?(n.red=e,n.green=t,n.blue=i,n.alpha=r,n):new Ms(e,t,i,r)},Ms.fromAlpha=function(e,t,i){return Mo.typeOf.object("color",e),Mo.typeOf.number("alpha",t),To(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new Ms(e.red,e.green,e.blue,t)},Ps.supportsTypedArrays()&&(Ss=new ArrayBuffer(4),Es=new Uint32Array(Ss),As=new Uint8Array(Ss)),Ms.fromRgba=function(e,t){return Es[0]=e,Ms.fromBytes(As[0],As[1],As[2],As[3],t)},Ms.byteToRgba=function(e,t,i,r){return As[0]=e,As[1]=t,As[2]=i,As[3]=r,Es[0]},Ms.fromHsl=function(e,t,i,r,n){e=Co(e,0)%1,t=Co(t,0),i=Co(i,0),r=Co(r,1);var o=i,a=i,s=i;if(0!==t){var l,u=2*i-(l=i<.5?i*(1+t):i+t-i*t);o=Is(u,l,e+1/3),a=Is(u,l,e),s=Is(u,l,e-1/3)}return To(n)?(n.red=o,n.green=a,n.blue=s,n.alpha=r,n):new Ms(o,a,s,r)},Ms.fromRandom=function(e,t){var i=(e=Co(e,Co.EMPTY_OBJECT)).red;if(!To(i)){var r=Co(e.minimumRed,0),n=Co(e.maximumRed,1);Mo.typeOf.number.lessThanOrEquals("minimumRed",r,n),i=r+Do.nextRandomNumber()*(n-r)}var o=e.green;if(!To(o)){var a=Co(e.minimumGreen,0),s=Co(e.maximumGreen,1);Mo.typeOf.number.lessThanOrEquals("minimumGreen",a,s),o=a+Do.nextRandomNumber()*(s-a)}var l=e.blue;if(!To(l)){var u=Co(e.minimumBlue,0),c=Co(e.maximumBlue,1);Mo.typeOf.number.lessThanOrEquals("minimumBlue",u,c),l=u+Do.nextRandomNumber()*(c-u)}var h=e.alpha;if(!To(h)){var d=Co(e.minimumAlpha,0),f=Co(e.maximumAlpha,1);Mo.typeOf.number.lessThanOrEquals("minumumAlpha",d,f),h=d+Do.nextRandomNumber()*(f-d)}return To(t)?(t.red=i,t.green=o,t.blue=l,t.alpha=h,t):new Ms(i,o,l,h)};var Os=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,Ds=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,Rs=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,Ls=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;Ms.fromCssColorString=function(e,t){Mo.typeOf.string("color",e),To(t)||(t=new Ms);var i=Ms[e.toUpperCase()];if(To(i))return Ms.clone(i,t),t;var r=Os.exec(e);return null!==r?(t.red=parseInt(r[1],16)/15,t.green=parseInt(r[2],16)/15,t.blue=parseInt(r[3],16)/15,t.alpha=1,t):null!==(r=Ds.exec(e))?(t.red=parseInt(r[1],16)/255,t.green=parseInt(r[2],16)/255,t.blue=parseInt(r[3],16)/255,t.alpha=1,t):null!==(r=Rs.exec(e))?(t.red=parseFloat(r[1])/("%"===r[1].substr(-1)?100:255),t.green=parseFloat(r[2])/("%"===r[2].substr(-1)?100:255),t.blue=parseFloat(r[3])/("%"===r[3].substr(-1)?100:255),t.alpha=parseFloat(Co(r[4],"1.0")),t):null!==(r=Ls.exec(e))?Ms.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(Co(r[4],"1.0")),t):t=void 0},Ms.packedLength=4,Ms.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.red,t[i++]=e.green,t[i++]=e.blue,t[i]=e.alpha,t},Ms.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Ms),i.red=e[t++],i.green=e[t++],i.blue=e[t++],i.alpha=e[t],i},Ms.byteToFloat=function(e){return e/255},Ms.floatToByte=function(e){return 1===e?255:256*e|0},Ms.clone=function(e,t){if(To(e))return To(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new Ms(e.red,e.green,e.blue,e.alpha)},Ms.equals=function(e,t){return e===t||To(e)&&To(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},Ms.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},Ms.prototype.clone=function(e){return Ms.clone(this,e)},Ms.prototype.equals=function(e){return Ms.equals(this,e)},Ms.prototype.equalsEpsilon=function(e,t){return this===e||To(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},Ms.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},Ms.prototype.toCssColorString=function(){var e=Ms.floatToByte(this.red),t=Ms.floatToByte(this.green),i=Ms.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},Ms.prototype.toCssHexString=function(){let e=Ms.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=Ms.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let i=Ms.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=Ms.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${e}${t}${i}${r}`}return`#${e}${t}${i}`},Ms.prototype.toBytes=function(e){var t=Ms.floatToByte(this.red),i=Ms.floatToByte(this.green),r=Ms.floatToByte(this.blue),n=Ms.floatToByte(this.alpha);return To(e)?(e[0]=t,e[1]=i,e[2]=r,e[3]=n,e):[t,i,r,n]},Ms.prototype.toRgba=function(){return As[0]=Ms.floatToByte(this.red),As[1]=Ms.floatToByte(this.green),As[2]=Ms.floatToByte(this.blue),As[3]=Ms.floatToByte(this.alpha),Es[0]},Ms.prototype.brighten=function(e,t){return Mo.typeOf.number("magnitude",e),Mo.typeOf.number.greaterThanOrEquals("magnitude",e,0),Mo.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},Ms.prototype.darken=function(e,t){return Mo.typeOf.number("magnitude",e),Mo.typeOf.number.greaterThanOrEquals("magnitude",e,0),Mo.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},Ms.prototype.withAlpha=function(e,t){return Ms.fromAlpha(this,e,t)},Ms.add=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},Ms.subtract=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},Ms.multiply=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},Ms.divide=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},Ms.mod=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},Ms.lerp=function(e,t,i,r){return Mo.typeOf.object("start",e),Mo.typeOf.object("end",t),Mo.typeOf.number("t",i),Mo.typeOf.object("result",r),r.red=Do.lerp(e.red,t.red,i),r.green=Do.lerp(e.green,t.green,i),r.blue=Do.lerp(e.blue,t.blue,i),r.alpha=Do.lerp(e.alpha,t.alpha,i),r},Ms.multiplyByScalar=function(e,t,i){return Mo.typeOf.object("color",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},Ms.divideByScalar=function(e,t,i){return Mo.typeOf.object("color",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},Ms.ALICEBLUE=Object.freeze(Ms.fromCssColorString("#F0F8FF")),Ms.ANTIQUEWHITE=Object.freeze(Ms.fromCssColorString("#FAEBD7")),Ms.AQUA=Object.freeze(Ms.fromCssColorString("#00FFFF")),Ms.AQUAMARINE=Object.freeze(Ms.fromCssColorString("#7FFFD4")),Ms.AZURE=Object.freeze(Ms.fromCssColorString("#F0FFFF")),Ms.BEIGE=Object.freeze(Ms.fromCssColorString("#F5F5DC")),Ms.BISQUE=Object.freeze(Ms.fromCssColorString("#FFE4C4")),Ms.BLACK=Object.freeze(Ms.fromCssColorString("#000000")),Ms.BLANCHEDALMOND=Object.freeze(Ms.fromCssColorString("#FFEBCD")),Ms.BLUE=Object.freeze(Ms.fromCssColorString("#0000FF")),Ms.BLUEVIOLET=Object.freeze(Ms.fromCssColorString("#8A2BE2")),Ms.BROWN=Object.freeze(Ms.fromCssColorString("#A52A2A")),Ms.BURLYWOOD=Object.freeze(Ms.fromCssColorString("#DEB887")),Ms.CADETBLUE=Object.freeze(Ms.fromCssColorString("#5F9EA0")),Ms.CHARTREUSE=Object.freeze(Ms.fromCssColorString("#7FFF00")),Ms.CHOCOLATE=Object.freeze(Ms.fromCssColorString("#D2691E")),Ms.CORAL=Object.freeze(Ms.fromCssColorString("#FF7F50")),Ms.CORNFLOWERBLUE=Object.freeze(Ms.fromCssColorString("#6495ED")),Ms.CORNSILK=Object.freeze(Ms.fromCssColorString("#FFF8DC")),Ms.CRIMSON=Object.freeze(Ms.fromCssColorString("#DC143C")),Ms.CYAN=Object.freeze(Ms.fromCssColorString("#00FFFF")),Ms.DARKBLUE=Object.freeze(Ms.fromCssColorString("#00008B")),Ms.DARKCYAN=Object.freeze(Ms.fromCssColorString("#008B8B")),Ms.DARKGOLDENROD=Object.freeze(Ms.fromCssColorString("#B8860B")),Ms.DARKGRAY=Object.freeze(Ms.fromCssColorString("#A9A9A9")),Ms.DARKGREEN=Object.freeze(Ms.fromCssColorString("#006400")),Ms.DARKGREY=Ms.DARKGRAY,Ms.DARKKHAKI=Object.freeze(Ms.fromCssColorString("#BDB76B")),Ms.DARKMAGENTA=Object.freeze(Ms.fromCssColorString("#8B008B")),Ms.DARKOLIVEGREEN=Object.freeze(Ms.fromCssColorString("#556B2F")),Ms.DARKORANGE=Object.freeze(Ms.fromCssColorString("#FF8C00")),Ms.DARKORCHID=Object.freeze(Ms.fromCssColorString("#9932CC")),Ms.DARKRED=Object.freeze(Ms.fromCssColorString("#8B0000")),Ms.DARKSALMON=Object.freeze(Ms.fromCssColorString("#E9967A")),Ms.DARKSEAGREEN=Object.freeze(Ms.fromCssColorString("#8FBC8F")),Ms.DARKSLATEBLUE=Object.freeze(Ms.fromCssColorString("#483D8B")),Ms.DARKSLATEGRAY=Object.freeze(Ms.fromCssColorString("#2F4F4F")),Ms.DARKSLATEGREY=Ms.DARKSLATEGRAY,Ms.DARKTURQUOISE=Object.freeze(Ms.fromCssColorString("#00CED1")),Ms.DARKVIOLET=Object.freeze(Ms.fromCssColorString("#9400D3")),Ms.DEEPPINK=Object.freeze(Ms.fromCssColorString("#FF1493")),Ms.DEEPSKYBLUE=Object.freeze(Ms.fromCssColorString("#00BFFF")),Ms.DIMGRAY=Object.freeze(Ms.fromCssColorString("#696969")),Ms.DIMGREY=Ms.DIMGRAY,Ms.DODGERBLUE=Object.freeze(Ms.fromCssColorString("#1E90FF")),Ms.FIREBRICK=Object.freeze(Ms.fromCssColorString("#B22222")),Ms.FLORALWHITE=Object.freeze(Ms.fromCssColorString("#FFFAF0")),Ms.FORESTGREEN=Object.freeze(Ms.fromCssColorString("#228B22")),Ms.FUCHSIA=Object.freeze(Ms.fromCssColorString("#FF00FF")),Ms.GAINSBORO=Object.freeze(Ms.fromCssColorString("#DCDCDC")),Ms.GHOSTWHITE=Object.freeze(Ms.fromCssColorString("#F8F8FF")),Ms.GOLD=Object.freeze(Ms.fromCssColorString("#FFD700")),Ms.GOLDENROD=Object.freeze(Ms.fromCssColorString("#DAA520")),Ms.GRAY=Object.freeze(Ms.fromCssColorString("#808080")),Ms.GREEN=Object.freeze(Ms.fromCssColorString("#008000")),Ms.GREENYELLOW=Object.freeze(Ms.fromCssColorString("#ADFF2F")),Ms.GREY=Ms.GRAY,Ms.HONEYDEW=Object.freeze(Ms.fromCssColorString("#F0FFF0")),Ms.HOTPINK=Object.freeze(Ms.fromCssColorString("#FF69B4")),Ms.INDIANRED=Object.freeze(Ms.fromCssColorString("#CD5C5C")),Ms.INDIGO=Object.freeze(Ms.fromCssColorString("#4B0082")),Ms.IVORY=Object.freeze(Ms.fromCssColorString("#FFFFF0")),Ms.KHAKI=Object.freeze(Ms.fromCssColorString("#F0E68C")),Ms.LAVENDER=Object.freeze(Ms.fromCssColorString("#E6E6FA")),Ms.LAVENDAR_BLUSH=Object.freeze(Ms.fromCssColorString("#FFF0F5")),Ms.LAWNGREEN=Object.freeze(Ms.fromCssColorString("#7CFC00")),Ms.LEMONCHIFFON=Object.freeze(Ms.fromCssColorString("#FFFACD")),Ms.LIGHTBLUE=Object.freeze(Ms.fromCssColorString("#ADD8E6")),Ms.LIGHTCORAL=Object.freeze(Ms.fromCssColorString("#F08080")),Ms.LIGHTCYAN=Object.freeze(Ms.fromCssColorString("#E0FFFF")),Ms.LIGHTGOLDENRODYELLOW=Object.freeze(Ms.fromCssColorString("#FAFAD2")),Ms.LIGHTGRAY=Object.freeze(Ms.fromCssColorString("#D3D3D3")),Ms.LIGHTGREEN=Object.freeze(Ms.fromCssColorString("#90EE90")),Ms.LIGHTGREY=Ms.LIGHTGRAY,Ms.LIGHTPINK=Object.freeze(Ms.fromCssColorString("#FFB6C1")),Ms.LIGHTSEAGREEN=Object.freeze(Ms.fromCssColorString("#20B2AA")),Ms.LIGHTSKYBLUE=Object.freeze(Ms.fromCssColorString("#87CEFA")),Ms.LIGHTSLATEGRAY=Object.freeze(Ms.fromCssColorString("#778899")),Ms.LIGHTSLATEGREY=Ms.LIGHTSLATEGRAY,Ms.LIGHTSTEELBLUE=Object.freeze(Ms.fromCssColorString("#B0C4DE")),Ms.LIGHTYELLOW=Object.freeze(Ms.fromCssColorString("#FFFFE0")),Ms.LIME=Object.freeze(Ms.fromCssColorString("#00FF00")),Ms.LIMEGREEN=Object.freeze(Ms.fromCssColorString("#32CD32")),Ms.LINEN=Object.freeze(Ms.fromCssColorString("#FAF0E6")),Ms.MAGENTA=Object.freeze(Ms.fromCssColorString("#FF00FF")),Ms.MAROON=Object.freeze(Ms.fromCssColorString("#800000")),Ms.MEDIUMAQUAMARINE=Object.freeze(Ms.fromCssColorString("#66CDAA")),Ms.MEDIUMBLUE=Object.freeze(Ms.fromCssColorString("#0000CD")),Ms.MEDIUMORCHID=Object.freeze(Ms.fromCssColorString("#BA55D3")),Ms.MEDIUMPURPLE=Object.freeze(Ms.fromCssColorString("#9370DB")),Ms.MEDIUMSEAGREEN=Object.freeze(Ms.fromCssColorString("#3CB371")),Ms.MEDIUMSLATEBLUE=Object.freeze(Ms.fromCssColorString("#7B68EE")),Ms.MEDIUMSPRINGGREEN=Object.freeze(Ms.fromCssColorString("#00FA9A")),Ms.MEDIUMTURQUOISE=Object.freeze(Ms.fromCssColorString("#48D1CC")),Ms.MEDIUMVIOLETRED=Object.freeze(Ms.fromCssColorString("#C71585")),Ms.MIDNIGHTBLUE=Object.freeze(Ms.fromCssColorString("#191970")),Ms.MINTCREAM=Object.freeze(Ms.fromCssColorString("#F5FFFA")),Ms.MISTYROSE=Object.freeze(Ms.fromCssColorString("#FFE4E1")),Ms.MOCCASIN=Object.freeze(Ms.fromCssColorString("#FFE4B5")),Ms.NAVAJOWHITE=Object.freeze(Ms.fromCssColorString("#FFDEAD")),Ms.NAVY=Object.freeze(Ms.fromCssColorString("#000080")),Ms.OLDLACE=Object.freeze(Ms.fromCssColorString("#FDF5E6")),Ms.OLIVE=Object.freeze(Ms.fromCssColorString("#808000")),Ms.OLIVEDRAB=Object.freeze(Ms.fromCssColorString("#6B8E23")),Ms.ORANGE=Object.freeze(Ms.fromCssColorString("#FFA500")),Ms.ORANGERED=Object.freeze(Ms.fromCssColorString("#FF4500")),Ms.ORCHID=Object.freeze(Ms.fromCssColorString("#DA70D6")),Ms.PALEGOLDENROD=Object.freeze(Ms.fromCssColorString("#EEE8AA")),Ms.PALEGREEN=Object.freeze(Ms.fromCssColorString("#98FB98")),Ms.PALETURQUOISE=Object.freeze(Ms.fromCssColorString("#AFEEEE")),Ms.PALEVIOLETRED=Object.freeze(Ms.fromCssColorString("#DB7093")),Ms.PAPAYAWHIP=Object.freeze(Ms.fromCssColorString("#FFEFD5")),Ms.PEACHPUFF=Object.freeze(Ms.fromCssColorString("#FFDAB9")),Ms.PERU=Object.freeze(Ms.fromCssColorString("#CD853F")),Ms.PINK=Object.freeze(Ms.fromCssColorString("#FFC0CB")),Ms.PLUM=Object.freeze(Ms.fromCssColorString("#DDA0DD")),Ms.POWDERBLUE=Object.freeze(Ms.fromCssColorString("#B0E0E6")),Ms.PURPLE=Object.freeze(Ms.fromCssColorString("#800080")),Ms.RED=Object.freeze(Ms.fromCssColorString("#FF0000")),Ms.ROSYBROWN=Object.freeze(Ms.fromCssColorString("#BC8F8F")),Ms.ROYALBLUE=Object.freeze(Ms.fromCssColorString("#4169E1")),Ms.SADDLEBROWN=Object.freeze(Ms.fromCssColorString("#8B4513")),Ms.SALMON=Object.freeze(Ms.fromCssColorString("#FA8072")),Ms.SANDYBROWN=Object.freeze(Ms.fromCssColorString("#F4A460")),Ms.SEAGREEN=Object.freeze(Ms.fromCssColorString("#2E8B57")),Ms.SEASHELL=Object.freeze(Ms.fromCssColorString("#FFF5EE")),Ms.SIENNA=Object.freeze(Ms.fromCssColorString("#A0522D")),Ms.SILVER=Object.freeze(Ms.fromCssColorString("#C0C0C0")),Ms.SKYBLUE=Object.freeze(Ms.fromCssColorString("#87CEEB")),Ms.SLATEBLUE=Object.freeze(Ms.fromCssColorString("#6A5ACD")),Ms.SLATEGRAY=Object.freeze(Ms.fromCssColorString("#708090")),Ms.SLATEGREY=Ms.SLATEGRAY,Ms.SNOW=Object.freeze(Ms.fromCssColorString("#FFFAFA")),Ms.SPRINGGREEN=Object.freeze(Ms.fromCssColorString("#00FF7F")),Ms.STEELBLUE=Object.freeze(Ms.fromCssColorString("#4682B4")),Ms.TAN=Object.freeze(Ms.fromCssColorString("#D2B48C")),Ms.TEAL=Object.freeze(Ms.fromCssColorString("#008080")),Ms.THISTLE=Object.freeze(Ms.fromCssColorString("#D8BFD8")),Ms.TOMATO=Object.freeze(Ms.fromCssColorString("#FF6347")),Ms.TURQUOISE=Object.freeze(Ms.fromCssColorString("#40E0D0")),Ms.VIOLET=Object.freeze(Ms.fromCssColorString("#EE82EE")),Ms.WHEAT=Object.freeze(Ms.fromCssColorString("#F5DEB3")),Ms.WHITE=Object.freeze(Ms.fromCssColorString("#FFFFFF")),Ms.WHITESMOKE=Object.freeze(Ms.fromCssColorString("#F5F5F5")),Ms.YELLOW=Object.freeze(Ms.fromCssColorString("#FFFF00")),Ms.YELLOWGREEN=Object.freeze(Ms.fromCssColorString("#9ACD32")),Ms.TRANSPARENT=Object.freeze(new Ms(0,0,0,0));var Bs={CLOCKWISE:Eo.CW,COUNTER_CLOCKWISE:Eo.CCW,NONE:Eo.NONE,validate:function(e){return e===Bs.CLOCKWISE||e===Bs.COUNTER_CLOCKWISE}},Ns=Object.freeze(Bs),Fs={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1,_uniformBufferOffsetAlignment:256,_maxUniformBufferBinding:36,_maxArrayTextureLayers:256};function zs(e){if("object"!=typeof e||null===e)return e;for(var t,i=Object.keys(e),r=0;r<i.length;r++)t=i[r],e.hasOwnProperty(t)&&"_applyFunctions"!==t&&(e[t]=zs(e[t]));return Object.freeze(e)}function ks(e){return e===Eo.FUNC_ADD||e===Eo.FUNC_SUBTRACT||e===Eo.FUNC_REVERSE_SUBTRACT||e===Eo.MIN||e===Eo.MAX}function Vs(e){return e===Eo.ZERO||e===Eo.ONE||e===Eo.SRC_COLOR||e===Eo.ONE_MINUS_SRC_COLOR||e===Eo.DST_COLOR||e===Eo.ONE_MINUS_DST_COLOR||e===Eo.SRC_ALPHA||e===Eo.ONE_MINUS_SRC_ALPHA||e===Eo.DST_ALPHA||e===Eo.ONE_MINUS_DST_ALPHA||e===Eo.CONSTANT_COLOR||e===Eo.ONE_MINUS_CONSTANT_COLOR||e===Eo.CONSTANT_ALPHA||e===Eo.ONE_MINUS_CONSTANT_ALPHA||e===Eo.SRC_ALPHA_SATURATE}function Us(e){return e===Eo.NEVER||e===Eo.LESS||e===Eo.EQUAL||e===Eo.LEQUAL||e===Eo.GREATER||e===Eo.NOTEQUAL||e===Eo.GEQUAL||e===Eo.ALWAYS}function Xs(e){return e===Eo.ZERO||e===Eo.KEEP||e===Eo.REPLACE||e===Eo.INCR||e===Eo.DECR||e===Eo.INVERT||e===Eo.INCR_WRAP||e===Eo.DECR_WRAP}function Hs(e){var t=Co(e,{}),i=Co(t.cull,{}),r=Co(t.polygonOffset,{}),n=Co(t.scissorTest,{}),o=Co(n.rectangle,{}),a=Co(t.depthRange,{}),s=Co(t.depthTest,{}),l=Co(t.colorMask,{}),u=Co(t.blending,{}),c=Co(u.color,{}),h=Co(t.stencilTest,{}),d=Co(h.frontOperation,{}),f=Co(h.backOperation,{}),p=Co(t.sampleCoverage,{}),_=t.viewport;if(this.frontFace=Co(t.frontFace,Ns.COUNTER_CLOCKWISE),this.cull={enabled:Co(i.enabled,!1),face:Co(i.face,Eo.BACK)},this.lineWidth=Co(t.lineWidth,1),this.polygonOffset={enabled:Co(r.enabled,!1),factor:Co(r.factor,0),units:Co(r.units,0)},this.scissorTest={enabled:Co(n.enabled,!1),rectangle:Ea.clone(o)},this.depthRange={near:Co(a.near,0),far:Co(a.far,1)},this.depthTest={enabled:Co(s.enabled,!1),func:Co(s.func,Eo.LESS)},this.colorMask={red:Co(l.red,!0),green:Co(l.green,!0),blue:Co(l.blue,!0),alpha:Co(l.alpha,!0)},this.depthMask=Co(t.depthMask,!0),this.stencilMask=Co(t.stencilMask,-1),this.blending={enabled:Co(u.enabled,!1),color:new Ms(Co(c.red,0),Co(c.green,0),Co(c.blue,0),Co(c.alpha,0)),equationRgb:Co(u.equationRgb,Eo.FUNC_ADD),equationAlpha:Co(u.equationAlpha,Eo.FUNC_ADD),functionSourceRgb:Co(u.functionSourceRgb,Eo.ONE),functionSourceAlpha:Co(u.functionSourceAlpha,Eo.ONE),functionDestinationRgb:Co(u.functionDestinationRgb,Eo.ZERO),functionDestinationAlpha:Co(u.functionDestinationAlpha,Eo.ZERO)},this.stencilTest={enabled:Co(h.enabled,!1),frontFunction:Co(h.frontFunction,Eo.ALWAYS),backFunction:Co(h.backFunction,Eo.ALWAYS),reference:Co(h.reference,0),mask:Co(h.mask,-1),frontOperation:{fail:Co(d.fail,Eo.KEEP),zFail:Co(d.zFail,Eo.KEEP),zPass:Co(d.zPass,Eo.KEEP)},backOperation:{fail:Co(f.fail,Eo.KEEP),zFail:Co(f.zFail,Eo.KEEP),zPass:Co(f.zPass,Eo.KEEP)}},this.sampleCoverage={enabled:Co(p.enabled,!1),value:Co(p.value,1),invert:Co(p.invert,!1)},this.viewport=To(_)?new Ea(_.x,_.y,_.width,_.height):void 0,this.lineWidth<Fs.minimumAliasedLineWidth||this.lineWidth>Fs.maximumAliasedLineWidth)throw new So("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!Ns.validate(this.frontFace))throw new So("Invalid renderState.frontFace.");if(!function(e){return e===Eo.FRONT||e===Eo.BACK||e===Eo.FRONT_AND_BACK}(this.cull.face))throw new So("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new So("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new So("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new So("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new So("renderState.depthRange.far must be less than or equal to one.");if(!function(e){return e===Eo.NEVER||e===Eo.LESS||e===Eo.EQUAL||e===Eo.LEQUAL||e===Eo.GREATER||e===Eo.NOTEQUAL||e===Eo.GEQUAL||e===Eo.ALWAYS}(this.depthTest.func))throw new So("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new So("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!ks(this.blending.equationRgb))throw new So("Invalid renderState.blending.equationRgb.");if(!ks(this.blending.equationAlpha))throw new So("Invalid renderState.blending.equationAlpha.");if(!Vs(this.blending.functionSourceRgb))throw new So("Invalid renderState.blending.functionSourceRgb.");if(!Vs(this.blending.functionSourceAlpha))throw new So("Invalid renderState.blending.functionSourceAlpha.");if(!Vs(this.blending.functionDestinationRgb))throw new So("Invalid renderState.blending.functionDestinationRgb.");if(!Vs(this.blending.functionDestinationAlpha))throw new So("Invalid renderState.blending.functionDestinationAlpha.");if(!Us(this.stencilTest.frontFunction))throw new So("Invalid renderState.stencilTest.frontFunction.");if(!Us(this.stencilTest.backFunction))throw new So("Invalid renderState.stencilTest.backFunction.");if(!Xs(this.stencilTest.frontOperation.fail))throw new So("Invalid renderState.stencilTest.frontOperation.fail.");if(!Xs(this.stencilTest.frontOperation.zFail))throw new So("Invalid renderState.stencilTest.frontOperation.zFail.");if(!Xs(this.stencilTest.frontOperation.zPass))throw new So("Invalid renderState.stencilTest.frontOperation.zPass.");if(!Xs(this.stencilTest.backOperation.fail))throw new So("Invalid renderState.stencilTest.backOperation.fail.");if(!Xs(this.stencilTest.backOperation.zFail))throw new So("Invalid renderState.stencilTest.backOperation.zFail.");if(!Xs(this.stencilTest.backOperation.zPass))throw new So("Invalid renderState.stencilTest.backOperation.zPass.");if(To(this.viewport)){if(this.viewport.width<0)throw new So("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new So("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>Fs.maximumViewportWidth)throw new So("renderState.viewport.width must be less than or equal to the maximum viewport width ("+Fs.maximumViewportWidth.toString()+"). Check maximumViewportWidth.");if(this.viewport.height>Fs.maximumViewportHeight)throw new So("renderState.viewport.height must be less than or equal to the maximum viewport height ("+Fs.maximumViewportHeight.toString()+"). Check maximumViewportHeight.")}this.id=0,this._applyFunctions=[]}Object.defineProperties(Fs,{maximumCombinedTextureImageUnits:{get:function(){return Fs._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Fs._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Fs._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Fs._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Fs._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Fs._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Fs._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Fs._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Fs._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Fs._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Fs._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Fs._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Fs._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Fs._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Fs._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Fs._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Fs._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Fs._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Fs._maximumColorAttachments}},highpFloatSupported:{get:function(){return Fs._highpFloatSupported}},highpIntSupported:{get:function(){return Fs._highpIntSupported}},uniformBufferOffsetAlignment:{get:function(){return Fs._uniformBufferOffsetAlignment}},maxUniformBufferBinding:{get:function(){return Fs._maxUniformBufferBinding}},maxArrayTextureLayers:{get:function(){return Fs._maxArrayTextureLayers}}});var Gs=0,Ws={};function Ys(e,t,i){i?e.enable(t):e.disable(t)}function qs(e,t){e.frontFace(t.frontFace)}function js(e,t){var i=t.cull,r=i.enabled;Ys(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function Zs(e,t){e.lineWidth(t.lineWidth)}function Ks(e,t){var i=t.polygonOffset,r=i.enabled;Ys(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function Qs(e,t,i){var r=t.scissorTest,n=To(i.scissorTest)?i.scissorTest.enabled:r.enabled;if(Ys(e,e.SCISSOR_TEST,n),n){var o=To(i.scissorTest)?i.scissorTest.rectangle:r.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function Js(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function el(e,t){var i=t.depthTest,r=i.enabled;Ys(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function tl(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function il(e,t){e.depthMask(t.depthMask)}function rl(e,t){e.stencilMask(t.stencilMask)}function nl(e,t,i){var r=t.blending,n=To(i.blendingEnabled)?i.blendingEnabled:r.enabled;Ys(e,e.BLEND,n),n&&(function(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}(e,r.color),e.blendEquationSeparate(r.equationRgb,r.equationAlpha),e.blendFuncSeparate(r.functionSourceRgb,r.functionDestinationRgb,r.functionSourceAlpha,r.functionDestinationAlpha))}function ol(e,t){var i=t.stencilTest,r=i.enabled;if(Ys(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,c=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,c,h);var d=i.backOperation,f=d.fail,p=d.zFail,_=d.zPass;e.stencilOpSeparate(e.BACK,f,p,_)}}function al(e,t){var i=t.sampleCoverage,r=i.enabled;Ys(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}Hs.fromCache=function(e){var t=JSON.stringify(e),i=Ws[t];if(To(i))return++i.referenceCount,i.state;var r=new Hs(e),n=JSON.stringify(r);return To(i=Ws[n])||(r.id=Gs++,i={referenceCount:0,state:r=zs(r)},Ws[n]=i),++i.referenceCount,Ws[t]={referenceCount:1,state:i.state},i.state},Hs.removeFromCache=function(e){var t=new Hs(e),i=JSON.stringify(t),r=Ws[i],n=JSON.stringify(e),o=Ws[n];To(o)&&(--o.referenceCount,0===o.referenceCount&&(delete Ws[n],To(r)&&--r.referenceCount)),To(r)&&0===r.referenceCount&&delete Ws[i]},Hs.getCache=function(){return Ws},Hs.clearCache=function(){Ws={}};var sl=new Ea;function ll(e,t,i){var r=Co(t.viewport,i.viewport);To(r)||((r=sl).width=i.context.drawingBufferWidth,r.height=i.context.drawingBufferHeight),i.context.uniformState.viewport=r,e.viewport(r.x,r.y,r.width,r.height)}Hs.apply=function(e,t,i){qs(e,t),js(e,t),Zs(e,t),Ks(e,t),Js(e,t),el(e,t),tl(e,t),il(e,t),rl(e,t),ol(e,t),al(e,t),Qs(e,t,i),nl(e,t,i),ll(e,t,i)},Hs.partialApply=function(e,t,i,r,n,o,a,s){if(t!==i){var l=i._applyFunctions[t.id];To(l)||(l=function(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(qs),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(js),e.lineWidth!==t.lineWidth&&i.push(Zs),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(Ks),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(Js),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(el),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&i.push(tl),e.depthMask!==t.depthMask&&i.push(il),e.stencilMask!==t.stencilMask&&i.push(rl),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&i.push(ol),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(al),i}(t,i),i._applyFunctions[t.id]=l);for(var u=l.length,c=0;c<u;++c)l[c](e,i)}((To(r.scissorTest)?r.scissorTest:t.scissorTest)!==(To(n.scissorTest)?n.scissorTest:i.scissorTest)||s)&&Qs(e,i,n);var h=To(r.blendingEnabled)?r.blendingEnabled:t.blending.enabled,d=To(n.blendingEnabled)?n.blendingEnabled:i.blending.enabled;(h!==d||d&&t.blending!==i.blending)&&nl(e,i,n),(t!==i||r!==n||r.context!==n.context||o!==a)&&ll(e,i,n)},Hs.getState=function(e){if(!To(e))throw new So("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ea.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:Ms.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:To(e.viewport)?Ea.clone(e.viewport):void 0}};var ul,cl={ADD:Eo.FUNC_ADD,SUBTRACT:Eo.FUNC_SUBTRACT,REVERSE_SUBTRACT:Eo.FUNC_REVERSE_SUBTRACT,MIN:Eo.MIN,MAX:Eo.MAX},hl=Object.freeze(cl),dl={ZERO:Eo.ZERO,ONE:Eo.ONE,SOURCE_COLOR:Eo.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:Eo.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:Eo.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:Eo.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:Eo.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:Eo.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:Eo.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:Eo.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:Eo.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:Eo.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:Eo.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:Eo.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:Eo.SRC_ALPHA_SATURATE},fl=Object.freeze(dl),pl={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:hl.ADD,equationAlpha:hl.ADD,functionSourceRgb:fl.SOURCE_ALPHA,functionSourceAlpha:fl.ONE,functionDestinationRgb:fl.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:fl.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:hl.ADD,equationAlpha:hl.ADD,functionSourceRgb:fl.ONE,functionSourceAlpha:fl.ONE,functionDestinationRgb:fl.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:fl.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:hl.ADD,equationAlpha:hl.ADD,functionSourceRgb:fl.SOURCE_ALPHA,functionSourceAlpha:fl.ONE,functionDestinationRgb:fl.ONE,functionDestinationAlpha:fl.ONE})},_l=Object.freeze(pl),ml=(ul=!0,function(e,t){var i=ul?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ul=!1,i}),$l=ml(void 0,(function(){return $l.toString().search("(((.+)+)+)+$").toString().constructor($l).search("(((.+)+)+)+$")}));function gl(){}$l(),gl.toVertexBuffer=function(e,t,i,r){var n=ko.createVertexBuffer({context:e,typedArray:t.arrayBuffer,usage:r?Fo.DYNAMIC_DRAW:Fo.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n.bytesPerElement=t.bytesPerElement,n.length=t.length,n.attributes=i,n.itemSize=t.bytesPerElement,n.dynamicDraw=r,!r&&delete t.arrayBuffer,n},gl.toIndexBuffer=function(e,t,i){if(0!==t.length){var r=ko.createIndexBuffer({context:e,typedArray:t.arrayBuffer,usage:Fo.STATIC_DRAW,indexDatatype:void 0!==t.uint16?No.UNSIGNED_SHORT:No.UNSIGNED_INT});return r.vertexArrayDestroyable=!1,r.dynamicDraw=i,!r.dynamicDraw&&delete t.arrayBuffer,r}},gl.toRenderState=function(e,t,i){var r=_l.DISABLED;e.blendFunction[0]==Eo.ONE&&e.blendFunction[1]==Eo.ONE_MINUS_SRC_ALPHA&&(r=_l.ALPHA_BLEND);var n={frontFace:i.frontFace,cull:{enabled:i.enable,face:i.mode},depthRange:{near:t.range[0],far:t.range[1]},depthTest:{enabled:t.func!==Eo.ALWAYS,func:t.func},depthMask:t.mask,colorMask:{red:e.mask[0],green:e.mask[1],blue:e.mask[2],alpha:e.mask[3]},blending:r};return Hs.fromCache(n)},gl.toComponentDatatype=function(e){switch(e){case"Int8":return Po.BYTE;case"Uint8":return Po.UNSIGNED_BYTE;case"Int16":return Po.SHORT;case"Uint16":return Po.UNSIGNED_SHORT;case"Int32":return Po.INT;case"Uint32":return Po.UNSIGNED_INT;default:return Po.FLOAT}},gl.mbxAttributeToCesiumVertexArrtribute=function(e,t,i,r){var n=this.toComponentDatatype(e.type);Po.getSizeInBytes(n);var o=t.bytesPerElement,a=e.offset+o*(r||0);return{name:e.name,index:i,vertexBuffer:t,componentsPerAttribute:e.components,componentDatatype:n,offsetInBytes:a,strideInBytes:o,normalize:!1}};var vl,yl=(vl=!0,function(e,t){var i=vl?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return vl=!1,i}),xl=yl(void 0,(function(){return xl.toString().search("(((.+)+)+)+$").toString().constructor(xl).search("(((.+)+)+)+$")}));xl();var bl=function(){this.ids=[],this.positions=[],this.indexed=!1};function wl(e,t,i,r){if(!(i>=r)){for(var n=e[i+r>>1],o=i-1,a=r+1;;){do{o++}while(e[o]<n);do{a--}while(e[a]>n);if(o>=a)break;Cl(e,o,a),Cl(t,3*o,3*a),Cl(t,3*o+1,3*a+1),Cl(t,3*o+2,3*a+2)}wl(e,t,i,a),wl(e,t,a+1,r)}}function Cl(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Tl(e,t,i,r){this.x=Co(e,0),this.y=Co(t,0),this.z=Co(i,0),this.w=Co(r,0)}bl.prototype.add=function(e,t,i,r){this.ids.push(e),this.positions.push(t,i,r)},bl.prototype.getPositions=function(e){for(var t=0,i=this.ids.length-1;t<i;){var r=t+i>>1;this.ids[r]>=e?i=r:t=r+1}for(var n=[];this.ids[t]===e;){var o=this.positions[3*t],a=this.positions[3*t+1],s=this.positions[3*t+2];n.push({index:o,start:a,end:s}),t++}return n},bl.serialize=function(e,t){var i=new Float64Array(e.ids),r=new Uint32Array(e.positions);return wl(i,r,0,i.length-1),t&&t.push(i.buffer,r.buffer),{ids:i,positions:r}},bl.deserialize=function(e){var t=new bl;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t},pi.register("FeaturePositionMap",bl),Tl.fromElements=function(e,t,i,r,n){return To(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new Tl(e,t,i,r)},Tl.fromColor=function(e,t){return Mo.typeOf.object("color",e),To(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Tl(e.red,e.green,e.blue,e.alpha)},Tl.clone=function(e,t){if(To(e))return To(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Tl(e.x,e.y,e.z,e.w)},Tl.packedLength=4,Tl.pack=function(e,t,i){return Mo.typeOf.object("value",e),Mo.defined("array",t),i=Co(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Tl.unpack=function(e,t,i){return Mo.defined("array",e),t=Co(t,0),To(i)||(i=new Tl),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Tl.packArray=function(e,t){Mo.defined("array",e);var i=e.length,r=4*i;if(To(t)){if(!Array.isArray(t)&&t.length!==r)throw new So("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;n<i;++n)Tl.pack(e[n],t,4*n);return t},Tl.unpackArray=function(e,t){if(Mo.defined("array",e),Mo.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new So("array length must be a multiple of 4.");var i=e.length;To(t)?t.length=i/4:t=new Array(i/4);for(var r=0;r<i;r+=4){var n=r/4;t[n]=Tl.unpack(e,r,t[n])}return t},Tl.fromArray=Tl.unpack,Tl.maximumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},Tl.minimumComponent=function(e){return Mo.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},Tl.minimumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},Tl.maximumByComponent=function(e,t,i){return Mo.typeOf.object("first",e),Mo.typeOf.object("second",t),Mo.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},Tl.magnitudeSquared=function(e){return Mo.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},Tl.magnitude=function(e){return Math.sqrt(Tl.magnitudeSquared(e))};var Sl=new Tl;Tl.distance=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Tl.subtract(e,t,Sl),Tl.magnitude(Sl)},Tl.distanceSquared=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Tl.subtract(e,t,Sl),Tl.magnitudeSquared(Sl)},Tl.normalize=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Tl.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new So("normalized result is not a number");return t},Tl.dot=function(e,t){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},Tl.multiplyComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},Tl.divideComponents=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},Tl.add=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},Tl.subtract=function(e,t,i){return Mo.typeOf.object("left",e),Mo.typeOf.object("right",t),Mo.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},Tl.multiplyByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},Tl.divideByScalar=function(e,t,i){return Mo.typeOf.object("cartesian",e),Mo.typeOf.number("scalar",t),Mo.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},Tl.negate=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},Tl.abs=function(e,t){return Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var El=new Tl;Tl.lerp=function(e,t,i,r){return Mo.typeOf.object("start",e),Mo.typeOf.object("end",t),Mo.typeOf.number("t",i),Mo.typeOf.object("result",r),Tl.multiplyByScalar(t,i,El),r=Tl.multiplyByScalar(e,1-i,r),Tl.add(El,r,r)};var Al=new Tl;Tl.mostOrthogonalAxis=function(e,t){Mo.typeOf.object("cartesian",e),Mo.typeOf.object("result",t);var i=Tl.normalize(e,Al);return Tl.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?Tl.clone(Tl.UNIT_X,t):Tl.clone(Tl.UNIT_W,t):i.z<=i.w?Tl.clone(Tl.UNIT_Z,t):Tl.clone(Tl.UNIT_W,t):i.y<=i.z?i.y<=i.w?Tl.clone(Tl.UNIT_Y,t):Tl.clone(Tl.UNIT_W,t):i.z<=i.w?Tl.clone(Tl.UNIT_Z,t):Tl.clone(Tl.UNIT_W,t)},Tl.equals=function(e,t){return e===t||To(e)&&To(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Tl.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},Tl.equalsEpsilon=function(e,t,i,r){return e===t||To(e)&&To(t)&&Do.equalsEpsilon(e.x,t.x,i,r)&&Do.equalsEpsilon(e.y,t.y,i,r)&&Do.equalsEpsilon(e.z,t.z,i,r)&&Do.equalsEpsilon(e.w,t.w,i,r)},Tl.ZERO=Object.freeze(new Tl(0,0,0,0)),Tl.UNIT_X=Object.freeze(new Tl(1,0,0,0)),Tl.UNIT_Y=Object.freeze(new Tl(0,1,0,0)),Tl.UNIT_Z=Object.freeze(new Tl(0,0,1,0)),Tl.UNIT_W=Object.freeze(new Tl(0,0,0,1)),Tl.prototype.clone=function(e){return Tl.clone(this,e)},Tl.prototype.equals=function(e){return Tl.equals(this,e)},Tl.prototype.equalsEpsilon=function(e,t,i){return Tl.equalsEpsilon(this,e,t,i)},Tl.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var Pl=new Float32Array(1),Il=256;Tl.packFloat=function(e,t){if(Mo.typeOf.number("value",e),To(t)||(t=new Tl),Pl[0]=e,0===(e=Pl[0]))return Tl.clone(Tl.ZERO,t);var i,r=e<0?1:0;isFinite(e)?(e=Math.abs(e),i=Math.floor(Do.logBase(e,10))+1,e/=Math.pow(10,i)):(e=.1,i=38);var n=e*Il;return t.x=Math.floor(n),n=(n-t.x)*Il,t.y=Math.floor(n),n=(n-t.y)*Il,t.z=Math.floor(n),t.w=2*(i+38)+r,t},Tl.unpackFloat=function(e){Mo.typeOf.object("packedFloat",e);var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(r=-(r=2*r-1),(i-=38)>=38)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*.00390625;return n+=r*e.y*152587890625e-16,(n+=r*e.z*5.960464477539063e-8)*Math.pow(10,i)};var Ml,Ol=(Ml=!0,function(e,t){var i=Ml?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ml=!1,i}),Dl=Ol(void 0,(function(){return Dl.toString().search("(((.+)+)+)+$").toString().constructor(Dl).search("(((.+)+)+)+$")}));function Rl(e,t,i){return Math.min(i,Math.max(t,e))}function Ll(e,t){return 256*(e=Rl(Math.floor(e),0,255))+(t=Rl(Math.floor(t),0,255))}function Bl(e){return[Ll(255*e.r,255*e.g),Ll(255*e.b,255*e.a)]}Dl();var Nl=function(e,t,i){this.value=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e})),this.type=i,this.maxValue=-1/0};Nl.prototype.defines=function(){return this.names.map((function(e){return"HAS_UNIFORM_u_"+e}))},Nl.prototype.setConstantPatternPositions=function(){},Nl.prototype.populatePaintArray=function(){},Nl.prototype.updatePaintArray=function(){},Nl.prototype.upload=function(){},Nl.prototype.destroy=function(){},Nl.prototype.setUniforms=function(e,t,i,r){t.set(r.constantOr(this.value))},Nl.prototype.getBinding=function(e,t){return"color"===this.type?new xo.UniformColor(e,t):new xo.Uniform1f(e,t)},Nl.prototype.setUniformMap=function(e,t,i,r){var n=this;e[t]=function(){var e=r.get(i).constantOr(n.value);return"color"===n.type&&(e.red=e.r,e.green=e.g,e.blue=e.b,e.alpha=e.a),e}},Nl.serialize=function(e){var t=e.value,i=e.names,r=e.type;return{value:pi.serialize(t),names:i,type:r}},Nl.deserialize=function(e){var t=e.value,i=e.names,r=e.type;return new Nl(pi.deserialize(t),i,r)};var Fl=function(e,t,i){this.value=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e})),this.type=i,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};Fl.prototype.defines=function(){return this.names.map((function(e){return"HAS_UNIFORM_u_"+e}))},Fl.prototype.populatePaintArray=function(){},Fl.prototype.updatePaintArray=function(){},Fl.prototype.upload=function(){},Fl.prototype.destroy=function(){},Fl.prototype.setConstantPatternPositions=function(e,t){this.patternPositions.patternTo=e.tlbr,this.patternPositions.patternFrom=t.tlbr},Fl.prototype.setUniforms=function(e,t,i,r,n){var o=this.patternPositions;"u_pattern_to"===n&&o.patternTo&&t.set(Tl(o.patternTo[0],o.patternTo[1],o.patternTo[2],o.patternTo[3])),"u_pattern_from"===n&&o.patternFrom&&t.set(Tl(o.patternFrom[0],o.patternFrom[1],o.patternFrom[2],o.patternFrom[3]))},Fl.prototype.getBinding=function(e,t){return new xo.Uniform4f(e,t)},Fl.prototype.setUniformMap=function(e,t,i,r){var n=this.patternPositions;e[t]=function(){return"u_pattern_to"===t&&n.patternTo?new Tl(n.patternTo[0],n.patternTo[1],n.patternTo[2],n.patternTo[3]):"u_pattern_from"===t&&n.patternFrom?new Tl(n.patternFrom[0],n.patternFrom[1],n.patternFrom[2],n.patternFrom[3]):void console.log("CrossFadedConstantBinder is not support")}};var zl=function(e,t,i,r){this.expression=e,this.names=t,this.type=i,this.uniformNames=this.names.map((function(e){return"a_"+e})),this.maxValue=-1/0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===i?2:1,offset:0}})),this.paintVertexArray=new r};zl.prototype.defines=function(){return[]},zl.prototype.setConstantPatternPositions=function(){},zl.prototype.populatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=n.length;n.reserve(e);var a=this.expression.evaluate(new mn(0),t,{},[],r);if("color"===this.type)for(var s=Bl(a),l=o;l<e;l++)n.emplaceBack(s[0],s[1]);else{for(var u=o;u<e;u++)n.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},zl.prototype.updatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:0},i,r);if("color"===this.type)for(var a=Bl(o),s=e;s<t;s++)n.emplace(s,a[0],a[1]);else{for(var l=e;l<t;l++)n.emplace(l,o);this.maxValue=Math.max(this.maxValue,o)}},zl.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=gl.toVertexBuffer(e,this.paintVertexArray,this.paintVertexAttributes))},zl.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},zl.prototype.setUniforms=function(e,t){t.set(0)},zl.prototype.getBinding=function(e,t){return new xo.Uniform1f(e,t)},zl.prototype.setUniformMap=function(e,t,i,r){e[t]=function(){return 0}};var kl=function(e,t,i,r,n,o){this.expression=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e+"_t"})),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===i?4:2,offset:0}})),this.paintVertexArray=new a};kl.prototype.defines=function(){return[]},kl.prototype.setConstantPatternPositions=function(){},kl.prototype.populatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=n.length;n.reserve(e);var a=this.expression.evaluate(new mn(this.zoom),t,{},[],r),s=this.expression.evaluate(new mn(this.zoom+1),t,{},[],r);if("color"===this.type)for(var l=Bl(a),u=Bl(s),c=o;c<e;c++)n.emplaceBack(l[0],l[1],u[0],u[1]);else{for(var h=o;h<e;h++)n.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},kl.prototype.updatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},i,r),a=this.expression.evaluate({zoom:this.zoom+1},i,r);if("color"===this.type)for(var s=Bl(o),l=Bl(a),u=e;u<t;u++)n.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=e;c<t;c++)n.emplace(c,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},kl.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=gl.toVertexBuffer(e,this.paintVertexArray,this.paintVertexAttributes))},kl.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},kl.prototype.interpolationFactor=function(e){return this.useIntegerZoom&&(e=Math.floor(e)),Rl(this.expression.interpolationFactor(e,this.zoom,this.zoom+1),0,1)},kl.prototype.setUniforms=function(e,t,i){t.set(this.interpolationFactor(i.zoom))},kl.prototype.getBinding=function(e,t){return new xo.Uniform1f(e,t)},kl.prototype.setUniformMap=function(e,t,i,r){var n=this;e[t]=function(){return n.interpolationFactor(0)}};var Vl=function(e,t,i,r,n,o,a){this.expression=e,this.names=t,this.type=i,this.uniformNames=this.names.map((function(e){return"u_"+e+"_t"})),this.useIntegerZoom=r,this.zoom=n,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};Vl.prototype.defines=function(){return[]},Vl.prototype.setConstantPatternPositions=function(){},Vl.prototype.populatePaintArray=function(e,t,i){var r=this.zoomInPaintVertexArray,n=this.zoomOutPaintVertexArray,o=this.layerId,a=r.length;if(r.reserve(e),n.reserve(e),i&&t.patterns&&t.patterns[o]){var s=t.patterns[o],l=s.min,u=s.mid,c=s.max,h=i[l],d=i[u],f=i[c];if(!h||!d||!f)return;for(var p=a;p<e;p++)r.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),n.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},Vl.prototype.updatePaintArray=function(e,t,i,r,n){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(n&&i.patterns&&i.patterns[s]){var l=i.patterns[s],u=l.min,c=l.mid,h=l.max,d=n[u],f=n[c],p=n[h];if(!d||!f||!p)return;for(var _=e;_<t;_++)o.emplace(_,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1]),a.emplace(_,f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1])}},Vl.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomInPaintVertexArray.length>0&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray.length>0&&(this.zoomInPaintVertexBuffer=gl.toVertexBuffer(e,this.zoomInPaintVertexArray,this.paintVertexAttributes),this.zoomOutPaintVertexBuffer=gl.toVertexBuffer(e,this.zoomOutPaintVertexArray,this.paintVertexAttributes))},Vl.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Vl.prototype.setUniforms=function(e,t){t.set(0)},Vl.prototype.getBinding=function(e,t){return new Uniform1f(e,t)},Vl.prototype.setUniformMap=function(e,t,i,r){e[t]=function(){return 0}};class Ul{constructor(){this.binders={},this.cacheKey="",this._buffers=[]}static createDynamic(e,t,i){const r=new Ul,n=[];for(const s in e.paint._values){if(!i(s))continue;const l=e.paint.get(s);if(!(l instanceof yo&&sr(l.property.specification)))continue;const u=(o=s,a=e.type,{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"text-show-background":["show-background"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[o]||[o.replace(a+"-","").replace(/-/g,"_")]),c=l.property.specification.type,h=l.property.useIntegerZoom;if("cross-faded"===l.property.specification["property-type"]||"cross-faded-data-driven"===l.property.specification["property-type"])if("constant"===l.value.kind)r.binders[s]=new Fl(l.value.value,u,c),n.push("/u_"+s);else{const i=Hl(s,c,"source");r.binders[s]=new Vl(l.value,u,c,h,t,i,e.id),n.push("/a_"+s)}else if("constant"===l.value.kind)r.binders[s]=new Nl(l.value.value,u,c),n.push("/u_"+s);else if("source"===l.value.kind){const e=Hl(s,c,"source");r.binders[s]=new zl(l.value,u,c,e),n.push("/a_"+s)}else{const e=Hl(s,c,"composite");r.binders[s]=new kl(l.value,u,c,h,t,e),n.push("/z_"+s)}}var o,a;return r.cacheKey=n.sort().join(""),r}populatePaintArrays(e,t,i,r,n){for(const i in this.binders)this.binders[i].populatePaintArray(e,t,r,n)}setConstantPatternPositions(e,t){for(const i in this.binders)this.binders[i].setConstantPatternPositions(e,t)}updatePaintArrays(e,t,i,r,n){let o=!1;for(const a in e){const s=t.getPositions(+a);for(const t of s){const s=i.feature(t.index);for(const i in this.binders){const l=this.binders[i];if(!(l instanceof Nl||l instanceof Fl)&&!0===l.expression.isStateDependent){const u=r.paint.get(i);l.expression=u.value,l.updatePaintArray(t.start,t.end,s,e[a],n),o=!0}}}}return o}defines(){var e=[];for(var t in this.binders)e.push.apply(e,this.binders[t].defines());return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){const i=[];for(const r in this.binders){const n=this.binders[r];for(const o of n.uniformNames)if(t[o]){const a=n.getBinding(e,t[o]);i.push({name:o,property:r,binding:a})}}return i}setUniforms(e,t,i,r){for(const{name:n,property:o,binding:a}of t)this.binders[o].setUniforms(e,a,r,i.get(o),n)}updatePatternPaintBuffers(e){const t=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof Vl){const i=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&t.push(i)}else(r instanceof zl||r instanceof kl)&&r.paintVertexBuffer&&t.push(r.paintVertexBuffer)}this._buffers=t}upload(e){for(const t in this.binders)this.binders[t].upload(e);const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof zl||i instanceof kl)&&i.paintVertexBuffer&&t.push(i.paintVertexBuffer)}this._buffers=t}getAttributeLocation(){for(var e=0,t={},i=0;i<this.layoutAttributes.length;i++)t[this.layoutAttributes[i].name]=i,e++;for(var r=this.getPaintVertexBuffers(),n=0;r&&n<r.length;n++)for(var o=r[n],a=0;a<o.attributes.length;a++)t[o.attributes[a].name]=e++;return t}getUniformMaps(e,t,i){for(var r in this.binders)for(var n=this.binders[r],o=0,a=n.uniformNames;o<a.length;o+=1){var s=a[o];e[s]&&n.setUniformMap(i,s,r,t)}for(var l in e)!i[l]&&l.indexOf("_t")>-1&&(i[l]=function(){return 0});return i}destroy(){for(const e in this.binders)this.binders[e].destroy()}}class Xl{constructor(e,t,i,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=Ul.createDynamic(n,i,r),this.programConfigurations[n.id].layoutAttributes=e;this.needsUpload=!1,this._featureMap=new bl,this._bufferOffset=0}populatePaintArrays(e,t,i,r,n){for(const o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,i,r,n);void 0!==t.id&&this._featureMap.add(+t.id,i,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Hl(e,t,i){var r={color:{source:Jn,composite:eo},number:{source:Gn,composite:Jn}},n={"line-pattern":{source:io,composite:io},"fill-pattern":{source:io,composite:io},"fill-extrusion-pattern":{source:io,composite:io}}[e];return n&&n[i]||r[t][i]}pi.register("ConstantBinder",Nl),pi.register("CrossFadedConstantBinder",Fl),pi.register("SourceExpressionBinder",zl),pi.register("CrossFadedCompositeBinder",Vl),pi.register("CompositeExpressionBinder",kl),pi.register("ProgramConfiguration",Ul,{omit:["_buffers"]}),pi.register("ProgramConfigurationSet",Xl);var Gl,Wl=(Gl=!0,function(e,t){var i=Gl?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Gl=!1,i}),Yl=Wl(void 0,(function(){return Yl.toString().search("(((.+)+)+)+$").toString().constructor(Yl).search("(((.+)+)+)+$")}));Yl();var ql=sn([{name:"a_pos",components:2,type:"Int16"}],4).members,jl=sn([{name:"a_pos",components:2,type:"Float32"}],4).members;function Zl(e,t,i,r,n){e.emplaceBack(2*t+(r+1)/2,2*i+(n+1)/2)}var Kl=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this._sourceLayerIds={};var t=this;this.layerIds=this.layers.map((function(e,i){return t._sourceLayerIds[e.sourceLayer]=i,e.sourceLayer})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new On,this.indexArray=new qn,this.segments=new En,this.programConfigurations=new Xl(ql,e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Kl.prototype.populate=function(e,t){var i=this.layers[0],r=[],n=null;"circle"===i.type&&(n=i.layout.get("circle-sort-key"));for(var o=0,a=e;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.index,c=s.sourceLayerIndex,h=s.sourceLayerId,d=this._sourceLayerIds[h],f=this.layers[d];if(f){var p=16*f.paint.get("circle-radius").value.value;if(this.layers[0]._featureFilter(new mn(0),l)){var _=wn(l),m=n?n.evaluate(l,{}):void 0,$={id:l.id,properties:l.properties,type:l.type,sourceLayerIndex:c,index:u,geometry:_,patterns:{},sortKey:m,circleRadius:p};r.push($)}}}n&&r.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,v=r;g<v.length;g+=1){var y=v[g],x=y,b=x.geometry,w=x.index,C=x.sourceLayerIndex,T=e[w].feature;this.addFeature(y,b,w),t.featureIndex.insert(T,b,w,C,this.index,void 0,x.circleRadius)}},Kl.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},Kl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Kl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Kl.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=e.webgpu?jl:ql;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=gl.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=gl.toIndexBuffer(e,this.indexArray))}this.programConfigurations.upload(e),this.uploaded=!0},Kl.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Kl.prototype.clear=function(){To(this.layoutVertexArray)&&(this.layoutVertexArray=null),To(this.indexArray)&&(this.indexArray=null)},Kl.prototype.addFeature=function(e,t,i){for(var r=0,n=t;r<n.length;r+=1)for(var o=0,a=n[r];o<a.length;o+=1){var s=a[o],l=s.x,u=s.y;if(!(l<0||l>=yn||u<0||u>=yn)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),h=c.vertexLength;Zl(this.layoutVertexArray,l,u,-1,-1),Zl(this.layoutVertexArray,l,u,1,-1),Zl(this.layoutVertexArray,l,u,1,1),Zl(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{})},pi.register("CircleBucket",Kl,{omit:["layers"]});var Ql,Jl=(Ql=!0,function(e,t){var i=Ql?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ql=!1,i}),eu=Jl(void 0,(function(){return eu.toString().search("(((.+)+)+)+$").toString().constructor(eu).search("(((.+)+)+)+$")}));eu();var tu=function(e){this.specification=e};tu.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},tu.prototype.interpolate=function(e,t,i){var r=interpolate[this.specification.type];return r?r(e,t,i):e},pi.register("DataConstantProperty",tu);var iu,ru=(iu=!0,function(e,t){var i=iu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return iu=!1,i}),nu=ru(void 0,(function(){return nu.toString().search("(((.+)+)+)+$").toString().constructor(nu).search("(((.+)+)+)+$")}));nu();var ou=function(e,t){this.specification=e,this.overrides=t};ou.prototype.possiblyEvaluate=function(e,t,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new yo(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i)},t):new yo(this,e.expression,t)},ou.prototype.interpolate=function(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new yo(this,{kind:"constant",value:void 0},e.parameters);var r=interpolate[this.specification.type];return r?new yo(this,{kind:"constant",value:r(e.value.value,t.value.value,i)},e.parameters):e},ou.prototype.evaluate=function(e,t,i,r,n){return"constant"===e.kind?e.value:e.evaluate(t,i,r,n)},pi.register("DataDrivenProperty",ou);var au,su=(au=!0,function(e,t){var i=au?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return au=!1,i}),lu=su(void 0,(function(){return lu.toString().search("(((.+)+)+)+$").toString().constructor(lu).search("(((.+)+)+)+$")}));lu();var uu=function(e,t){this.property=e,this.value=t,this.expression=dr.normalizePropertyExpression(void 0===t?e.specification.default:t,e.specification)};uu.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},uu.prototype.possiblyEvaluate=function(e,t){return this.property.possiblyEvaluate(this,e,t)};var cu,hu=(cu=!0,function(e,t){var i=cu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return cu=!1,i}),du=hu(void 0,(function(){return du.toString().search("(((.+)+)+)+$").toString().constructor(du).search("(((.+)+)+)+$")}));du();var fu=function(e,t,i,r,n){this.property=e,this.value=t,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=i)};fu.prototype.possiblyEvaluate=function(e,t){var i=e.now||0,r=this.value.possiblyEvaluate(e,t),n=this.prior;if(n){if(i>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(i<this.begin)return n.possiblyEvaluate(e,t);var o=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(e,t),r,function(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}(o))}return r};const pu=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_u=pu(void 0,(function(){return _u.toString().search("(((.+)+)+)+$").toString().constructor(_u).search("(((.+)+)+)+$")}));function mu(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var o=n[r];for(var a in o)e[a]=o[a]}return e}function $u(e,t){return-1!==e.indexOf(t,e.length-t.length)}function gu(e,t,i){const r={};for(const n in e)r[n]=t.call(i||this,e[n],n,e);return r}function vu(e){return Array.isArray(e)?e.map(vu):"object"==typeof e&&e?gu(e,vu):e}_u(),function(e,t,i,r){const n=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),o=n(this,(function(){return o.toString().search("(((.+)+)+)+$").toString().constructor(o).search("(((.+)+)+)+$")}));o()}();const yu={};function xu(e){yu[e]||("undefined"!=typeof console&&console.warn(e),yu[e]=!0)}function bu(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function wu(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function Cu(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,i,r,n)=>{const o=r||n;return t[i]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}var Tu,Su=(Tu=!0,function(e,t){var i=Tu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Tu=!1,i}),Eu=Su(void 0,(function(){return Eu.toString().search("(((.+)+)+)+$").toString().constructor(Eu).search("(((.+)+)+)+$")}));Eu();var Au=function(e){this.property=e,this.value=new uu(e,void 0)};Au.prototype.transitioned=function(e,t){return new fu(this.property,this.value,t,mu({},e.transition,this.transition),e.now)},Au.prototype.untransitioned=function(){return new fu(this.property,this.value,null,{},0)};var Pu,Iu=(Pu=!0,function(e,t){var i=Pu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Pu=!1,i}),Mu=Iu(void 0,(function(){return Mu.toString().search("(((.+)+)+)+$").toString().constructor(Mu).search("(((.+)+)+)+$")}));Mu();var Ou,Du=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var i=e[t];i.specification.overridable&&this.overridableProperties.push(t);var r=this.defaultPropertyValues[t]=new uu(i,void 0),n=this.defaultTransitionablePropertyValues[t]=new Au(i);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}},Ru=(Ou=!0,function(e,t){var i=Ou?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ou=!1,i}),Lu=Ru(void 0,(function(){return Lu.toString().search("(((.+)+)+)+$").toString().constructor(Lu).search("(((.+)+)+)+$")}));function Bu(){}Lu(),Bu.getMaximumPaintValue=function(e,t,i){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:i.programConfigurations.get(t.id).binders[e].maxValue},Bu.translateDistance=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},Bu.translate=function(e,t,i,r,n){if(!t||!t[0]&&!t[1])return e;var o=tn.convert(t)._mult(n);"viewport"===i&&o._rotate(-r);for(var a=[],s=0;s<e.length;s++){var l=e[s];a.push(l.sub(o))}return a};var Nu,Fu=(Nu=!0,function(e,t){var i=Nu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Nu=!1,i}),zu=Fu(void 0,(function(){return zu.toString().search("(((.+)+)+)+$").toString().constructor(zu).search("(((.+)+)+)+$")}));zu();var ku=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};ku.prototype.get=function(e){return this._values[e]};var Vu,Uu=(Vu=!0,function(e,t){var i=Vu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Vu=!1,i}),Xu=Uu(void 0,(function(){return Xu.toString().search("(((.+)+)+)+$").toString().constructor(Xu).search("(((.+)+)+)+$")}));Xu();var Hu=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Hu.prototype.getValue=function(e){return vu(this._values[e].value)},Hu.prototype.setValue=function(e,t){this._values[e]=new uu(this._values[e].property,null===t?void 0:vu(t))},Hu.prototype.serialize=function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n)}return e},Hu.prototype.possiblyEvaluate=function(e,t){for(var i=new ku(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].possiblyEvaluate(e,t)}return i};var Gu,Wu=(Gu=!0,function(e,t){var i=Gu?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Gu=!1,i}),Yu=Wu(void 0,(function(){return Yu.toString().search("(((.+)+)+)+$").toString().constructor(Yu).search("(((.+)+)+)+$")}));Yu();var qu=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};qu.prototype.possiblyEvaluate=function(e,t){for(var i=new ku(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].possiblyEvaluate(e,t)}return i},qu.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var i=t[e];if(this._values[i].prior)return!0}return!1};var ju,Zu=(ju=!0,function(e,t){var i=ju?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return ju=!1,i}),Ku=Zu(void 0,(function(){return Ku.toString().search("(((.+)+)+)+$").toString().constructor(Ku).search("(((.+)+)+)+$")}));Ku();var Qu=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Qu.prototype.getValue=function(e){return vu(this._values[e].value.value)},Qu.prototype.setValue=function(e,t){!this._values.hasOwnProperty(e)&&(this._values[e]=new Au(this._values[e].property)),this._values[e].value=new uu(this._values[e].property,null===t?void 0:vu(t))},Qu.prototype.getTransition=function(e){return vu(this._values[e].transition)},Qu.prototype.setTransition=function(e,t){!this._values.hasOwnProperty(e)&&(this._values[e]=new Au(this._values[e].property)),this._values[e].transition=vu(t)||void 0},Qu.prototype.serialize=function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n);var o=this.getTransition(r);void 0!==o&&(e[r+"-transition"]=o)}return e},Qu.prototype.transitioned=function(e,t){for(var i=new qu(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].transitioned(e,t._values[o])}return i},Qu.prototype.untransitioned=function(){for(var e=new qu(this._properties),t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t];e._values[r]=this._values[r].untransitioned()}return e};var Ju,ec=(Ju=!0,function(e,t){var i=Ju?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ju=!1,i}),tc=ec(void 0,(function(){return tc.toString().search("(((.+)+)+)+$").toString().constructor(tc).search("(((.+)+)+)+$")}));tc();var ic="-transition";function rc(e,t){if(this.id=e.id,this.type=e.type,"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Hu(t.layout)),t.paint)){for(var i in this._transitionablePaint=new Qu(t.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}rc.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},rc.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},rc.prototype.setLayoutProperty=function(e,t,i){if(null!=t&&this.id,"visibility"===e)return this.visibility=t,void(this.config&&this.config.layout&&(this.config.layout.visibility=t));this._unevaluatedLayout.setValue(e,t)},rc.prototype.getPaintProperty=function(e){return $u(e,ic)?this._transitionablePaint.getTransition(e.slice(0,-ic.length)):this._transitionablePaint.getValue(e)},rc.prototype.setPaintProperty=function(e,t,i){if(null!=t&&this.id,$u(e,ic))return this._transitionablePaint.setTransition(e.slice(0,-ic.length),t||void 0),!1;var r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var s=this._transitionablePaint._values[e].value;return s.isDataDriven()||o||n||this._handleOverridablePaintPropertyUpdate(e,a,s)},rc.prototype._handleSpecialPaintPropertyUpdate=function(e){},rc.prototype._handleOverridablePaintPropertyUpdate=function(e,t,i){return!1},rc.prototype.isHidden=function(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility},rc.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},rc.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},rc.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,t)},rc.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),function(e,t,i){const r={};for(const n in e)t.call(i||this,e[n],n,e)&&(r[n]=e[n]);return r}(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))},rc.prototype._validate=function(e,t,i,r,n){return!0},rc.prototype.is3D=function(){return!1},rc.prototype.isTileClipped=function(){return!1},rc.prototype.hasOffscreenPass=function(){return!1},rc.prototype.resize=function(){},rc.prototype.isStateDependent=function(){return!0};var nc,oc=(nc=!0,function(e,t){var i=nc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return nc=!1,i}),ac=oc(void 0,(function(){return ac.toString().search("(((.+)+)+)+$").toString().constructor(ac).search("(((.+)+)+)+$")}));ac();var sc,lc={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},uc={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},cc={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},hc={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},dc={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},fc={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},pc={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},_c={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-show-background":{type:"boolean",default:!1,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},mc=(sc=!0,function(e,t){var i=sc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return sc=!1,i}),$c=mc(void 0,(function(){return $c.toString().search("(((.+)+)+)+$").toString().constructor($c).search("(((.+)+)+)+$")}));function gc(){}function vc(e,t,i){if(e.length>1){if(yc(e,t))return!0;for(var r=0;r<t.length;r++)if(xc(t[r],e,i))return!0}for(var n=0;n<e.length;n++)if(xc(e[n],t,i))return!0;return!1}function yc(e,t){if(0===e.length||0===t.length)return!1;for(var i=0;i<e.length-1;i++)for(var r=e[i],n=e[i+1],o=0;o<t.length-1;o++){var a=t[o],s=t[o+1];if(u=n,bu(l=r,c=a,h=s)!==bu(u,c,h)&&bu(l,u,c)!==bu(l,u,h))return!0}var l,u,c,h;return!1}function xc(e,t,i){var r=i*i;if(1===t.length)return e.distSqr(t[0])<r;for(var n=1;n<t.length;n++){var o=t[n-1],a=t[n];if(gc.distToSegmentSquared(e,o,a)<r)return!0}return!1}function bc(e,t){for(var i,r,n,o=!1,a=0;a<e.length;a++)for(var s=0,l=(i=e[a]).length-1;s<i.length;l=s++)r=i[s],n=i[l],r.y>t.y!=n.y>t.y&&t.x<(n.x-r.x)*(t.y-r.y)/(n.y-r.y)+r.x&&(o=!o);return o}function wc(e,t){for(var i=!1,r=0,n=e.length-1;r<e.length;n=r++){var o=e[r],a=e[n];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}$c(),gc.polygonIntersectsPolygon=function(e,t){for(var i=0;i<e.length;i++)if(wc(t,e[i]))return!0;for(var r=0;r<t.length;r++)if(wc(e,t[r]))return!0;return!!yc(e,t)},gc.polygonIntersectsBufferedPoint=function(e,t,i){return!!wc(e,t)||!!xc(t,e,i)},gc.polygonIntersectsMultiPolygon=function(e,t){if(1===e.length)return bc(t,e[0]);for(var i=0;i<t.length;i++)for(var r=t[i],n=0;n<r.length;n++)if(wc(e,r[n]))return!0;for(var o=0;o<e.length;o++)if(bc(t,e[o]))return!0;for(var a=0;a<t.length;a++)if(yc(e,t[a]))return!0;return!1},gc.polygonIntersectsBufferedMultiLine=function(e,t,i){for(var r=0;r<t.length;r++){var n=t[r];if(e.length>=3)for(var o=0;o<n.length;o++)if(wc(e,n[o]))return!0;if(vc(e,n,i))return!0}return!1},gc.distToSegmentSquared=function(e,t,i){var r=t.distSqr(i);if(0===r)return e.distSqr(t);var n=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/r;return n<0?e.distSqr(t):n>1?e.distSqr(i):e.distSqr(i.sub(t)._mult(n)._add(t))},gc.polygonIntersectPoint=function(e,t){return wc(e,t)};var Cc=new Du({"circle-sort-key":new ou(uc["circle-sort-key"])}),Tc={paint:new Du({"circle-radius":new ou(pc["circle-radius"]),"circle-color":new ou(pc["circle-color"]),"circle-blur":new ou(pc["circle-blur"]),"circle-opacity":new ou(pc["circle-opacity"]),"circle-translate":new tu(pc["circle-translate"]),"circle-translate-anchor":new tu(pc["circle-translate-anchor"]),"circle-pitch-scale":new tu(pc["circle-pitch-scale"]),"circle-pitch-alignment":new tu(pc["circle-pitch-alignment"]),"circle-stroke-width":new ou(pc["circle-stroke-width"]),"circle-stroke-color":new ou(pc["circle-stroke-color"]),"circle-stroke-opacity":new ou(pc["circle-stroke-opacity"])}),layout:Cc},Sc=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,Tc)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.createBucket=function(e){return new Kl(e)},n.prototype.queryRadius=function(e){var t=e;return Bu.getMaximumPaintValue("circle-radius",this,t)+Bu.getMaximumPaintValue("circle-stroke-width",this,t)+Bu.translateDistance(this.paint.get("circle-translate"))},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a,s,l){var u;(u=new Float32Array(16))[0]=1,u[5]=1,u[10]=1,u[15]=1,s=u;for(var c,h=Bu.translate(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),0,a),d=this.paint.get("circle-radius"),f=this.paint.get("circle-stroke-width"),p=(void 0===d?void 0:d.evaluate(t,i))+(void 0===f?void 0:f.evaluate(t,i)),_="map"===this.paint.get("circle-pitch-alignment"),m=_?h:(c=s,h.map((function(e){return Ec(e,c)}))),$=_?p*a:p,g=0,v=r;g<v.length;g+=1)for(var y=0,x=v[g];y<x.length;y+=1){var b=x[y],w=_?b:Ec(b,s),C=$;if(Ac([],[b.x,b.y,0,1],s),"viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")||"map"===this.paint.get("circle-pitch-scale")&&this.paint.get("circle-pitch-alignment"),l=To(l)?l:10,gc.polygonIntersectsBufferedPoint(m,w,C*l))return!0}return!1},n}(rc);function Ec(e,t){var i=Ac([],[e.x,e.y,0,1],t);return new tn(i[0],i[1])}function Ac(e,t,i){var r=t[0],n=t[1],o=t[2],a=i[3]*r+i[7]*n+i[11]*o+i[15];return a=a||1,e[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/a,e[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/a,e[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/a,e}function Pc(e,t,i,r,n){Ic(e,t,i||0,r||e.length-1,n||Oc)}function Ic(e,t,i,r,n){for(;r>i;){if(r-i>600){var o=r-i+1,a=t-i+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Ic(e,t,Math.max(i,Math.floor(t-a*l/o+u)),Math.min(r,Math.floor(t+(o-a)*l/o+u)),n)}var c=e[t],h=i,d=r;for(Mc(e,i,t),n(e[r],c)>0&&Mc(e,i,r);h<d;){for(Mc(e,h,d),h++,d--;n(e[h],c)<0;)h++;for(;n(e[d],c)>0;)d--}0===n(e[i],c)?Mc(e,i,d):Mc(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function Mc(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Oc(e,t){return e<t?-1:e>t?1:0}var Dc,Rc=(Dc=!0,function(e,t){var i=Dc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Dc=!1,i}),Lc=Rc(void 0,(function(){return Lc.toString().search("(((.+)+)+)+$").toString().constructor(Lc).search("(((.+)+)+)+$")}));function Bc(e){for(var t=0,i=0,r=e.length,n=r-1,o=void 0,a=void 0;i<r;n=i++)o=e[i],t+=((a=e[n]).x-o.x)*(o.y+a.y);return t}function Nc(e,t){var i=e.length;if(i<=1)return[e];for(var r,n,o=[],a=0;a<i;a++){var s=Bc(e[a]);0!==s&&(e[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(r&&o.push(r),r=[e[a]]):r.push(e[a]))}if(r&&o.push(r),t>1)for(var l=0;l<o.length;l++)o[l].length<=t||(Pc(o[l],t,1,o[l].length-1,Fc),o[l]=o[l].slice(0,t));return o}function Fc(e,t){return t.area-e.area}function zc(e,t,i){i=i||2;var r,n,o,a,s,l,u,c=t&&t.length,h=c?t[0]*i:e.length,d=kc(e,0,h,i,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(e,t,i,r){var n,o,a,s,l,u=[];for(n=0,o=t.length;n<o;n++)a=t[n]*r,s=n<o-1?t[n+1]*r:e.length,(l=kc(e,a,s,r,!1))===l.next&&(l.steiner=!0),u.push(Kc(l));for(u.sort(Yc),n=0;n<u.length;n++)qc(u[n],i),i=Vc(i,i.next);return i}(e,t,d,i)),e.length>80*i){r=o=e[0],n=a=e[1];for(var p=i;p<h;p+=i)(s=e[p])<r&&(r=s),(l=e[p+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-r,a-n))?1/u:0}return Uc(d,f,i,r,n,u),f}function kc(e,t,i,r,n){var o,a;if(n===ch(e,t,i,r)>0)for(o=t;o<i;o+=r)a=sh(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=sh(o,e[o],e[o+1],a);return a&&th(a,a.next)&&(lh(a),a=a.next),a}function Vc(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!th(r,r.next)&&0!==eh(r.prev,r,r.next))r=r.next;else{if(lh(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function Uc(e,t,i,r,n,o,a){if(e){!a&&o&&function(e,t,i,r){var n=e;do{null===n.z&&(n.z=Zc(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1)}(n)}(e,r,n,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Hc(e,r,n,o):Xc(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),lh(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?Uc(e=Gc(Vc(e),t,i),t,i,r,n,o,2):2===a&&Wc(e,t,i,r,n,o):Uc(Vc(e),t,i,r,n,o,1);break}}}function Xc(e){var t=e.prev,i=e,r=e.next;if(eh(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(Qc(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&eh(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function Hc(e,t,i,r){var n=e.prev,o=e,a=e.next;if(eh(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=Zc(s,l,t,i,r),d=Zc(u,c,t,i,r),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&Qc(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&eh(f.prev,f,f.next)>=0||(f=f.prevZ,p!==e.prev&&p!==e.next&&Qc(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&eh(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&Qc(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&eh(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&Qc(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&eh(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Gc(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!th(n,o)&&ih(n,r,r.next,o)&&oh(n,o)&&oh(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),lh(r),lh(r.next),r=e=o),r=r.next}while(r!==e);return Vc(r)}function Wc(e,t,i,r,n,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Jc(a,s)){var l=ah(a,s);return a=Vc(a,a.next),l=Vc(l,l.next),Uc(a,t,i,r,n,o),void Uc(l,t,i,r,n,o)}s=s.next}a=a.next}while(a!==e)}function Yc(e,t){return e.x-t.x}function qc(e,t){if(t=function(e,t){var i,r=t,n=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===a)return i;var l,u=i,c=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=c&&n!==r.x&&Qc(o<h?n:a,o,c,h,o<h?a:n,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(n-r.x),oh(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&jc(i,r)))&&(i=r,d=l)),r=r.next}while(r!==u);return i}(e,t),t){var i=ah(t,e);Vc(i,i.next)}}function jc(e,t){return eh(e.prev,e,t.prev)<0&&eh(t.next,e,e.next)<0}function Zc(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Kc(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function Qc(e,t,i,r,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function Jc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&ih(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(oh(e,t)&&oh(t,e)&&function(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}(e,t)&&(eh(e.prev,e,t.prev)||eh(e,t.prev,t))||th(e,t)&&eh(e.prev,e,e.next)>0&&eh(t.prev,t,t.next)>0)}function eh(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function th(e,t){return e.x===t.x&&e.y===t.y}function ih(e,t,i,r){var n=nh(eh(e,t,i)),o=nh(eh(e,t,r)),a=nh(eh(i,r,e)),s=nh(eh(i,r,t));return!!(n!==o&&a!==s||0===n&&rh(e,i,t)||0===o&&rh(e,r,t)||0===a&&rh(i,e,r)||0===s&&rh(i,t,r))}function rh(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function nh(e){return e>0?1:e<0?-1:0}function oh(e,t){return eh(e.prev,e,e.next)<0?eh(e,t,e.next)>=0&&eh(e,e.prev,t)>=0:eh(e,t,e.prev)<0||eh(e,e.next,t)<0}function ah(e,t){var i=new uh(e.i,e.x,e.y),r=new uh(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function sh(e,t,i,r){var n=new uh(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function lh(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 uh(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 ch(e,t,i,r){for(var n=0,o=t,a=i-r;o<i;o+=r)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}Lc(),zc.deviation=function(e,t,i,r){var n=t&&t.length,o=n?t[0]*i:e.length,a=Math.abs(ch(e,0,o,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;a-=Math.abs(ch(e,u,c,i))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*i,f=r[s+1]*i,p=r[s+2]*i;h+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},zc.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[n][o][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i};var hh,dh=(hh=!0,function(e,t){var i=hh?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return hh=!1,i}),fh=dh(void 0,(function(){return fh.toString().search("(((.+)+)+)+$").toString().constructor(fh).search("(((.+)+)+)+$")}));function ph(e,t,i,r,n){for(var o=n.patternDependencies,a=0,s=t;a<s.length;a+=1){var l=s[a],u=l.paint.get(e+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:r-1},i,{},n.availableImages),h=u.evaluate({zoom:r},i,{},n.availableImages),d=u.evaluate({zoom:r+1},i,{},n.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,o[c]=!0,o[h]=!0,o[d]=!0,i.patterns[l.id]={min:c,mid:h,max:d}}}return i}fh();var _h,mh=(_h=!0,function(e,t){var i=_h?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _h=!1,i}),$h=mh(void 0,(function(){return $h.toString().search("(((.+)+)+)+$").toString().constructor($h).search("(((.+)+)+)+$")}));$h();var gh,vh=(gh=!0,function(e,t){var i=gh?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return gh=!1,i}),yh=vh(void 0,(function(){return yh.toString().search("(((.+)+)+)+$").toString().constructor(yh).search("(((.+)+)+)+$")}));yh();var xh=sn([{name:"a_pos",components:2,type:"Int16"}],4).members,bh=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new On,this.indexArray=new qn,this.indexArray2=new Zn,this.programConfigurations=new Xl(xh,e.layers,e.zoom),this.segments=new En,this.segments2=new En,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};bh.prototype.populate=function(e,t){this.hasPattern=function(e,t,i){for(var r=i.patternDependencies,n=!1,o=0,a=t;o<a.length;o+=1){var s=a[o].paint.get(e+"-pattern");!s.isConstant()&&(n=!0);var l=s.constantOr(null);l&&(n=!0,r[l.to]=!0,r[l.from]=!0)}return n}("fill",this.layers,t);for(var i=[],r=0,n=e;r<n.length;r+=1){var o=n[r],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new mn(0),a)){var u=wn(a),c={id:a.id,properties:a.properties,type:a.type,sourceLayerIndex:l,index:s,geometry:u,patterns:{},sortKey:void 0};i.push(c)}}for(var h=0,d=i;h<d.length;h+=1){var f=d[h],p=f,_=p.geometry,m=p.index,$=p.sourceLayerIndex;if(this.hasPattern){var g=ph("fill",this.layers,f,this.zoom,t);this.patternFeatures.push(g)}else this.addFeature(f,_,m,{},t.indexData);var v=e[m].feature;t.featureIndex.insert(v,_,m,$,this.index)}},bh.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},bh.prototype.addFeatures=function(e,t){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var n=r[i];this.addFeature(n,n.geometry,n.index,t)}},bh.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},bh.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bh.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=xh;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=gl.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=gl.toIndexBuffer(e,this.indexArray),this.cesiumIndexBuffer2=gl.toIndexBuffer(e,this.indexArray2))}this.programConfigurations.upload(e),this.uploaded=!0},bh.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer&&this.cesiumIndexBuffer.destroy(),this.cesiumIndexBuffer2&&this.cesiumIndexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},bh.prototype.clear=function(){To(this.layoutVertexArray)&&(this.layoutVertexArray=null),To(this.indexArray)&&(this.indexArray=null),To(this.indexArray2)&&(this.indexArray2=null)},bh.prototype.addFeature=function(e,t,i,r,n){for(var o=0,a=Nc(t,500);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1){var h=c[u];l+=h.length}for(var d,f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=f.vertexLength,_=[],m=[],$=0,g=s;$<g.length;$+=1){var v=g[$];if(0!==v.length){if(v!==s[0]&&m.push(_.length/2),h.length>En.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof qn){let e=this.indexArray,t=this.indexArray2;this.indexArray=new jn,this.indexArray2=new Kn,this.indexArray.copyFrom3ui6(e),this.indexArray2.copyFrom2ui4(t)}var y=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=y.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),_.push(v[0].x),_.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),_.push(v[b].x),_.push(v[b].y);y.vertexLength+=v.length,y.primitiveLength+=v.length}}d=To(n)&&To(n[e.id])?n[e.id]:zc(_,m);for(var w=0;w<d.length;w+=3)this.indexArray.emplaceBack(p+d[w],p+d[w+1],p+d[w+2]);f.vertexLength+=l,f.primitiveLength+=d.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,r)},pi.register("FillBucket",bh,{omit:["layers","patternFeatures"]});var wh=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.possiblyEvaluate=function(e,t,i){if(void 0===e.value)return new yo(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var r=e.expression.evaluate(t,null,{},i),n="resolvedImage"===e.property.specification.type&&"string"!=typeof r?r.name:r,o=this._calculate(n,n,n,t);return new yo(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){var a=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new yo(this,{kind:"constant",value:a},t)}return new yo(this,e.expression,t)},n.prototype.evaluate=function(e,t,i,r,n){if("source"===e.kind){var o=e.evaluate(t,i,r,n);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},i,r),e.evaluate({zoom:Math.floor(t.zoom)},i,r),e.evaluate({zoom:Math.floor(t.zoom)+1},i,r),t):e.value},n.prototype._calculate=function(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}},n.prototype.interpolate=function(e){return e},n}(ou);pi.register("DataDrivenProperty",ou);var Ch,Th=new Du({"fill-sort-key":new ou(lc["fill-sort-key"])}),Sh={paint:new Du({"fill-antialias":new tu(dc["fill-antialias"]),"fill-opacity":new ou(dc["fill-opacity"]),"fill-color":new ou(dc["fill-color"]),"fill-outline-color":new ou(dc["fill-outline-color"]),"fill-translate":new tu(dc["fill-translate"]),"fill-translate-anchor":new tu(dc["fill-translate-anchor"]),"fill-pattern":new wh(dc["fill-pattern"])}),layout:Th},Eh=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,Sh)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.recalculate=function(t,i){e.prototype.recalculate.call(this,t,i);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},n.prototype.createBucket=function(e){return new bh(e)},n.prototype.queryRadius=function(){return Bu.translateDistance(this.paint.get("fill-translate"))},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a){var s=Bu.translate(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),0,a);return gc.polygonIntersectsMultiPolygon(s,r)},n.prototype.isTileClipped=function(){return!0},n}(rc),Ah=(Ch=!0,function(e,t){var i=Ch?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Ch=!1,i}),Ph=Ah(void 0,(function(){return Ph.toString().search("(((.+)+)+)+$").toString().constructor(Ph).search("(((.+)+)+)+$")}));Ph();var Ih=["Unknown","Point","LineString","Polygon"],Mh=sn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Oh=Math.cos(Math.PI/180*37.5),Dh=Math.pow(2,14)/.5,Rh=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ln,this.indexArray=new qn,this.programConfigurations=new Xl(Mh,e.layers,e.zoom),this.segments=new En,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Rh.prototype.populate=function(e,t){this.hasPattern=!1;for(var i=this.layers[0].layout.get("line-sort-key"),r=[],n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.feature,l=a.index,u=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new mn(0),s)){var c=wn(s),h=i?i.evaluate(s,{}):void 0,d={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:c,patterns:{},sortKey:h};r.push(d)}}i&&r.sort((function(e,t){return e.sortKey-t.sortKey}));for(var f=0,p=r;f<p.length;f+=1){var _=p[f],m=_,$=m.geometry,g=m.index,v=m.sourceLayerIndex;if(this.hasPattern){var y=ph("line",this.layers,_,this.zoom,t);this.patternFeatures.push(y)}else this.addFeature(_,$,g,{});var x=e[g].feature;t.featureIndex.insert(x,$,g,v,this.index)}},Rh.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},Rh.prototype.addFeatures=function(e,t){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var n=r[i];this.addFeature(n,n.geometry,n.index,t)}},Rh.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Rh.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Rh.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=Mh;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=gl.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=gl.toIndexBuffer(e,this.indexArray))}this.programConfigurations.upload(e),this.uploaded=!0},Rh.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer.destroy()),this.programConfigurations.destroy(),this.segments.destroy())},Rh.prototype.clear=function(){To(this.layoutVertexArray)&&(this.layoutVertexArray=null),To(this.indexArray)&&(this.indexArray=null)},Rh.prototype.addFeature=function(e,t,i,r){for(var n=this.layers[0].layout,o=n.get("line-join").evaluate(e,{}),a=n.get("line-cap"),s=n.get("line-miter-limit"),l=n.get("line-round-limit"),u=0,c=t;u<c.length;u+=1){var h=c[u];this.addLine(h,e,o,a,s,l,i,r)}},Rh.prototype.addLine=function(e,t,i,r,n,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+t.properties.mapbox_clip_start,this.clipEnd=+t.properties.mapbox_clip_end;for(var l=0;l<e.length-1;l++)this.totalDistance+=e[l].dist(e[l+1])}for(var u="Polygon"===Ih[t.type],c=e.length;c>=2&&e[c-1].equals(e[c-2]);)c--;for(var h=0;h<c-1&&e[h].equals(e[h+1]);)h++;if(!(c<(u?3:2))){"bevel"===i&&(n=1.05);var d=this.overscaling<=16?122880/(512*this.overscaling):0;if(10*c>En.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof qn){let e=this.indexArray;this.indexArray=new jn,this.indexArray.copyFrom3ui6(e)}var f,p=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray),_=void 0,m=void 0,$=void 0,g=void 0;this.e1=this.e2=-1,u&&(f=e[c-2],g=e[h].sub(f)._unit()._perp());for(var v=h;v<c;v++)if(!(m=u&&v===c-1?e[h+1]:e[v+1])||!e[v].equals(m)){g&&($=g),f&&(_=f),f=e[v],g=m?m.sub(f)._unit()._perp():$;var y=($=$||g).add(g);(0!==y.x||0!==y.y)&&y._unit();var x=$.x*g.x+$.y*g.y,b=y.x*g.x+y.y*g.y,w=0!==b?1/b:1/0,C=2*Math.sqrt(2-2*b),T=b<Oh&&_&&m,S=$.x*g.y-$.y*g.x>0;if(T&&v>h){var E=f.dist(_);if(E>2*d){var A=f.sub(f.sub(_)._mult(d/E)._round());this.updateDistance(_,A),this.addCurrentVertex(A,$,0,0,p),_=A}}var P=_&&m,I=P?i:u?"butt":r;if(P&&"round"===I&&(w<o?I="miter":w<=2&&(I="fakeround")),"miter"===I&&w>n&&(I="bevel"),"bevel"===I&&(w>2&&(I="flipbevel"),w<n&&(I="miter")),_&&this.updateDistance(_,f),"miter"===I)y._mult(w),this.addCurrentVertex(f,y,0,0,p);else if("flipbevel"===I){if(w>100)y=g.mult(-1);else{var M=w*$.add(g).mag()/$.sub(g).mag();y._perp()._mult(M*(S?-1:1))}this.addCurrentVertex(f,y,0,0,p),this.addCurrentVertex(f,y.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var O=-Math.sqrt(w*w-1),D=S?O:0,R=S?0:O;if(_&&this.addCurrentVertex(f,$,D,R,p),"fakeround"===I)for(var L=Math.round(180*C/Math.PI/20),B=1;B<L;B++){var N=B/L;if(.5!==N){var F=N-.5;N+=N*F*(N-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*F*F+(.848013+x*(.215638*x-1.06021)))}var z=g.sub($)._mult(N)._add($)._unit()._mult(S?-1:1);this.addHalfVertex(f,z.x,z.y,!1,S,0,p)}m&&this.addCurrentVertex(f,g,-D,-R,p)}else if("butt"===I)this.addCurrentVertex(f,y,0,0,p);else if("square"===I){var k=_?1:-1;this.addCurrentVertex(f,y,k,k,p)}else"round"===I&&(_&&(this.addCurrentVertex(f,$,0,0,p),this.addCurrentVertex(f,$,1,1,p,!0)),m&&(this.addCurrentVertex(f,g,-1,-1,p,!0),this.addCurrentVertex(f,g,0,0,p)));if(T&&v<c-1){var V=f.dist(m);if(V>2*d){var U=f.add(m.sub(f)._mult(d/V)._round());this.updateDistance(f,U),this.addCurrentVertex(U,g,0,0,p),f=U}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,s)}},Rh.prototype.addCurrentVertex=function(e,t,i,r,n,o){void 0===o&&(o=!1);var a=t.x+t.y*i,s=t.y-t.x*i,l=-t.x+t.y*r,u=-t.y-t.x*r;this.addHalfVertex(e,a,s,o,!1,i,n),this.addHalfVertex(e,l,u,o,!0,-r,n),this.distance>Dh/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,i,r,n,o))},Rh.prototype.addHalfVertex=function(e,t,i,r,n,o,a){var s=e.x,l=e.y,u=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(l<<1)+(n?1:0),Math.round(63*t)+128,Math.round(63*i)+128,1+(0===o?0:o<0?-1:1)|(63&u)<<2,u>>6);var c=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),n?this.e2=c:this.e1=c},Rh.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Dh-1):this.distance},pi.register("LineBucket",Rh,{omit:["layers","patternFeatures"]});var Lh,Bh=(Lh=!0,function(e,t){var i=Lh?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Lh=!1,i}),Nh=Bh(void 0,(function(){return Nh.toString().search("(((.+)+)+)+$").toString().constructor(Nh).search("(((.+)+)+)+$")}));Nh();var Fh=function(e){this.specification=e};Fh.prototype.possiblyEvaluate=function(e,t,i){if(void 0!==e.value){if("constant"===e.expression.kind){var r=e.expression.evaluate(t,null,{},i);return this._calculate(r,r,r,t)}return this._calculate(e.expression.evaluate(new mn(Math.floor(t.zoom-1),t)),e.expression.evaluate(new mn(Math.floor(t.zoom),t)),e.expression.evaluate(new mn(Math.floor(t.zoom+1),t)),t)}},Fh.prototype._calculate=function(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}},Fh.prototype.interpolate=function(e){return e},pi.register("CrossFadedProperty",Fh);var zh,kh=(zh=!0,function(e,t){var i=zh?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return zh=!1,i}),Vh=kh(void 0,(function(){return Vh.toString().search("(((.+)+)+)+$").toString().constructor(Vh).search("(((.+)+)+)+$")}));Vh();var Uh=function(e){this.specification=e};Uh.prototype.possiblyEvaluate=function(e,t,i){return!!e.expression.evaluate(t,null,{},i)},Uh.prototype.interpolate=function(){return!1},pi.register("ColorRampProperty",Uh);var Xh=new Du({"line-cap":new tu(cc["line-cap"]),"line-join":new ou(cc["line-join"]),"line-miter-limit":new tu(cc["line-miter-limit"]),"line-round-limit":new tu(cc["line-round-limit"]),"line-sort-key":new ou(cc["line-sort-key"])}),Hh={paint:new Du({"line-opacity":new ou(fc["line-opacity"]),"line-color":new ou(fc["line-color"]),"line-translate":new tu(fc["line-translate"]),"line-translate-anchor":new tu(fc["line-translate-anchor"]),"line-width":new ou(fc["line-width"]),"line-gap-width":new ou(fc["line-gap-width"]),"line-offset":new ou(fc["line-offset"]),"line-blur":new ou(fc["line-blur"]),"line-dasharray":new Fh(fc["line-dasharray"]),"line-pattern":new wh(fc["line-pattern"]),"line-gradient":new Uh(fc["line-gradient"])}),layout:Xh},Gh=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.possiblyEvaluate=function(t,i){return i=new mn(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),e.prototype.possiblyEvaluate.call(this,t,i)},n.prototype.evaluate=function(t,i,r,n){return i=extend({},i,{zoom:Math.floor(i.zoom)}),e.prototype.evaluate.call(this,t,i,r,n)},n}(ou),Wh=new Gh(Hh.paint.properties["line-width"].specification);Wh.useIntegerZoom=!0;var Yh=function(e){function t(t){e.call(this,t,Hh)}function i(e,t){return t>0?t+2*e:e}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=renderColorRamp(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t,i){e.prototype.recalculate.call(this,t,i),this.paint._values["line-floorwidth"]=Wh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Rh(e)},t.prototype.queryRadius=function(e){var t=e,r=i(Bu.getMaximumPaintValue("line-width",this,t),Bu.getMaximumPaintValue("line-gap-width",this,t)),n=Bu.getMaximumPaintValue("line-offset",this,t);return r/2+Math.abs(n)+Bu.translateDistance(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,o,a,s){var l=Bu.translate(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),0,s),u=this.paint.get("line-width"),c=this.paint.get("line-gap-width"),h=i(void 0===u?void 0:u.evaluate(t,r),void 0===c?void 0:c.evaluate(t,r)),d=s/2*(h=Math.max(h,5)),f=this.paint.get("line-offset"),p=void 0===f?void 0:f.evaluate(t,r);return p&&(n=function(e,t){for(var i=[],r=new tn(0,0),n=0;n<e.length;n++){for(var o=e[n],a=[],s=0;s<o.length;s++){var l=o[s-1],u=o[s],c=o[s+1],h=0===s?r:u.sub(l)._unit()._perp(),d=s===o.length-1?r:c.sub(u)._unit()._perp(),f=h._add(d)._unit(),p=f.x*d.x+f.y*d.y;f._mult(1/p),a.push(f._mult(t)._add(u))}i.push(a)}return i}(n,p*s)),gc.polygonIntersectsBufferedMultiLine(l,n,d)},t.prototype.isTileClipped=function(){return!0},t}(rc);const qh=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),jh=qh(void 0,(function(){return jh.toString().search("(((.+)+)+)+$").toString().constructor(jh).search("(((.+)+)+)+$")}));jh();const Zh=sn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Kh=sn([{name:"a_projected_pos",components:3,type:"Float32"}],4);sn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),sn([{name:"a_fade_opacity",components:1,type:"Float32"}],4);const Qh=sn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);sn([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]);const Jh=sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ed=sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);sn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),sn([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),sn([{type:"Float32",name:"offsetX"}]),sn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var td,id=(td=!0,function(e,t){var i=td?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return td=!1,i}),rd=id(void 0,(function(){return rd.toString().search("(((.+)+)+)+$").toString().constructor(rd).search("(((.+)+)+)+$")}));rd();var nd=function(e){return e>=128&&e<=255},od=function(e){return e>=1536&&e<=1791},ad=function(e){return e>=1872&&e<=1919},sd=function(e){return e>=2208&&e<=2303},ld=function(e){return e>=4352&&e<=4607},ud=function(e){return e>=5120&&e<=5759},cd=function(e){return e>=6320&&e<=6399},hd=function(e){return e>=8192&&e<=8303},dd=function(e){return e>=8448&&e<=8527},fd=function(e){return e>=8528&&e<=8591},pd=function(e){return e>=8960&&e<=9215},_d=function(e){return e>=9216&&e<=9279},md=function(e){return e>=9280&&e<=9311},$d=function(e){return e>=9312&&e<=9471},gd=function(e){return e>=9632&&e<=9727},vd=function(e){return e>=9728&&e<=9983},yd=function(e){return e>=11008&&e<=11263},xd=function(e){return e>=11904&&e<=12031},bd=function(e){return e>=12032&&e<=12255},wd=function(e){return e>=12272&&e<=12287},Cd=function(e){return e>=12288&&e<=12351},Td=function(e){return e>=12352&&e<=12447},Sd=function(e){return e>=12448&&e<=12543},Ed=function(e){return e>=12544&&e<=12591},Ad=function(e){return e>=12592&&e<=12687},Pd=function(e){return e>=12688&&e<=12703},Id=function(e){return e>=12704&&e<=12735},Md=function(e){return e>=12736&&e<=12783},Od=function(e){return e>=12784&&e<=12799},Dd=function(e){return e>=12800&&e<=13055},Rd=function(e){return e>=13056&&e<=13311},Ld=function(e){return e>=13312&&e<=19903},Bd=function(e){return e>=19904&&e<=19967},Nd=function(e){return e>=19968&&e<=40959},Fd=function(e){return e>=40960&&e<=42127},zd=function(e){return e>=42128&&e<=42191},kd=function(e){return e>=43360&&e<=43391},Vd=function(e){return e>=44032&&e<=55215},Ud=function(e){return e>=55216&&e<=55295},Xd=function(e){return e>=57344&&e<=63743},Hd=function(e){return e>=63744&&e<=64255},Gd=function(e){return e>=64336&&e<=65023},Wd=function(e){return e>=65040&&e<=65055},Yd=function(e){return e>=65072&&e<=65103},qd=function(e){return e>=65104&&e<=65135},jd=function(e){return e>=65136&&e<=65279},Zd=function(e){return e>=65280&&e<=65519};const Kd=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Qd=Kd(void 0,(function(){return Qd.toString().search("(((.+)+)+)+$").toString().constructor(Qd).search("(((.+)+)+)+$")}));function Jd(e){for(const t of e)if(tf(t.charCodeAt(0)))return!0;return!1}function ef(e){for(const i of e)if(t=i.charCodeAt(0),od(t)||ad(t)||sd(t)||Gd(t)||jd(t))return!1;var t;return!0}function tf(e){return!(746!==e&&747!==e&&(e<4352||!(Id(e)||Ed(e)||Yd(e)&&!(e>=65097&&e<=65103)||Hd(e)||Rd(e)||xd(e)||Md(e)||!(!Cd(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Ld(e)||Nd(e)||Dd(e)||Ad(e)||kd(e)||Ud(e)||ld(e)||Vd(e)||Td(e)||wd(e)||Pd(e)||bd(e)||Od(e)||Sd(e)&&12540!==e||!(!Zd(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!qd(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ud(e)||cd(e)||Wd(e)||Bd(e)||Fd(e)||zd(e))))}function rf(e){return!(tf(e)||(t=e,nd(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||hd(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||dd(t)||fd(t)||pd(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||_d(t)&&9251!==t||md(t)||$d(t)||gd(t)||vd(t)&&!(t>=9754&&t<=9759)||yd(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Cd(t)||Sd(t)||Xd(t)||Yd(t)||qd(t)||Zd(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}function nf(e){return od(e)||ad(e)||sd(e)||Gd(e)||jd(e)}function of(e){for(const i of e)if((t=i.charCodeAt(0))>=1424&&t<=2303||Gd(t)||jd(t))return!0;var t;return!1}Qd();const af=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),sf=af(void 0,(function(){return sf.toString().search("(((.+)+)+)+$").toString().constructor(sf).search("(((.+)+)+)+$")}));sf();const lf={"!":"�","#":"�",$:"�","%":"�","&":"�","(":"�",")":"�","*":"�","+":"�",",":"�","-":"�",".":"�","/":"�",":":"�",";":"�","<":"�","=":"�",">":"�","?":"�","@":"�","[":"�","\\":"�","]":"�","^":"�",_:"�","`":"�","{":"�","|":"�","}":"�","~":"�","¢":"�","£":"�","¥":"�","¦":"�","¬":"�","¯":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�","�":"�"};var uf,cf=(uf=!0,function(e,t){var i=uf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return uf=!1,i}),hf=cf(void 0,(function(){return hf.toString().search("(((.+)+)+)+$").toString().constructor(hf).search("(((.+)+)+)+$")}));hf();var df,ff=(df=!0,function(e,t){var i=df?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return df=!1,i}),pf=ff(void 0,(function(){return pf.toString().search("(((.+)+)+)+$").toString().constructor(pf).search("(((.+)+)+)+$")}));pf(),function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){void 0===i&&(i={}),e.call(this,"error",mu({error:t},i))}r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n}((function(e,t){void 0===t&&(t={}),mu(this,t),this.type=e}));const _f=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),mf=_f(void 0,(function(){return mf.toString().search("(((.+)+)+)+$").toString().constructor(mf).search("(((.+)+)+)+$")}));mf();const $f=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function gf(e){return $f.test(e)}const vf=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),yf=vf(void 0,(function(){return yf.toString().search("(((.+)+)+)+$").toString().constructor(yf).search("(((.+)+)+)+$")}));yf();const xf="mapbox-tiles";let bf;function wf(e,t,i){if(!window.caches)return;const r={status:t.status,statusText:t.statusText,headers:new window.Headers};t.headers.forEach(((e,t)=>r.headers.set(t,e)));const n=Cu(t.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-i<42e4||function(e,t){if(void 0===bf)try{new Response(new ReadableStream),bf=!0}catch(e){bf=!1}bf?t(e.body):e.blob().then(t)}(t,(t=>{const i=new window.Response(t,r);window.caches.open(xf).then((t=>t.put(Cf(e.url),i)))})))}function Cf(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Tf(e,t){if(!window.caches)return t(null);const i=Cf(e.url);window.caches.open(xf).catch(t).then((e=>{e.match(i).catch(t).then((r=>{const n=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")),i=Cu(e.headers.get("Cache-Control")||"");return t>Date.now()&&!i["no-cache"]}(r);e.delete(i),n&&e.put(i,r.clone()),t(null,r,n)}))}))}const Sf=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Ef=Sf(void 0,(function(){return Ef.toString().search("(((.+)+)+)+$").toString().constructor(Ef).search("(((.+)+)+)+$")}));Ef(),"function"==typeof Object.freeze&&Object.freeze({Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"});class Af extends Error{constructor(e,t,i){401===t&&gf(i)&&(e+=": you may have provided an invalid Mapbox access token"),super(e),this.status=t,this.url=i,this.name=this.constructor.name,this.message=e}toString(){return this.name+": "+this.message+" ("+this.status+"): "+this.url}}const Pf=wu()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function If(e,t){const i=wu()?self:window,r=new i.AbortController,n=new i.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Pf(),signal:r.signal});let o=!1,a=!1;const s=(l=n.url).indexOf("sku=")>0&&gf(l);var l;"json"===e.type&&n.headers.set("Accept","application/json");const u=(r,o,l)=>{if(a)return;if(r&&"SecurityError"!==r.message&&xu(r),o&&l)return c(o);const u=Date.now();i.fetch(n).then((i=>{if(i.ok){const e=s?i.clone():null;return c(i,e,u)}return t(new Af(i.statusText,i.status,e.url))})).catch((e=>{20!==e.code&&t(new Error(e.message))}))},c=(i,r,s)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then((e=>{a||(r&&s&&wf(n,r,s),o=!0,t(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((e=>t(new Error(e.message))))};return s?Tf(n,u):u(null,null),{cancel:()=>{a=!0,o||r.abort()}}}const Mf=function(e,t){const i=wu()?self:window;if(r=e.url,!(/^file:/.test(r)||/^file:/.test(Pf())&&!/^\w+:/.test(r))){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return If(e,t);if(wu()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t)}var r;return function(e,t){const i=new((wu()?self:window).XMLHttpRequest);i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===e.type)try{r=JSON.parse(i.response)}catch(e){return t(e)}t(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else t(new Af(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}(e,t)},Of=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Df=Of(void 0,(function(){return Df.toString().search("(((.+)+)+)+$").toString().constructor(Df).search("(((.+)+)+)+$")}));Df();const Rf=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Lf=Rf(void 0,(function(){return Lf.toString().search("(((.+)+)+)+$").toString().constructor(Lf).search("(((.+)+)+)+$")}));Lf();const Bf="loading",Nf="loaded";let Ff="unavailable",zf=null;const kf={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ff===Nf||null!=kf.applyArabicShaping,isLoading:()=>Ff===Bf,setState(e){Ff=e.pluginStatus,zf=e.pluginURL},isParsed:()=>null!=kf.applyArabicShaping,getPluginURL:()=>zf};var Vf,Uf=(Vf=!0,function(e,t){var i=Vf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Vf=!1,i}),Xf=Uf(void 0,(function(){return Xf.toString().search("(((.+)+)+)+$").toString().constructor(Xf).search("(((.+)+)+)+$")}));Xf();var Hf,Gf=24,Wf=(Hf=!0,function(e,t){var i=Hf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Hf=!1,i}),Yf=Wf(void 0,(function(){return Yf.toString().search("(((.+)+)+)+$").toString().constructor(Yf).search("(((.+)+)+)+$")}));Yf();var qf=function(e,t){jf(this,e,1,t)};function jf(e,t,i,r){var n=t.width,o=t.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*o*i);return e.width=n,e.height=o,e.data=r,e}function Zf(e,t,i,r,n,o){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=e.data,s=t.data,l=0;l<n.height;l++)for(var u=((i.y+l)*e.width+i.x)*o,c=((r.y+l)*t.width+r.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return t}qf.prototype.resize=function(e){!function(e,t,i){var r=t.width,n=t.height;if(r!==e.width||n!==e.height){var o=jf({},{width:r,height:n},i);Zf(e,o,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,n)},i),e.width=r,e.height=n,e.data=o.data}}(this,e,1)},qf.prototype.clone=function(){return new qf({width:this.width,height:this.height},new Uint8Array(this.data))},qf.copy=function(e,t,i,r,n){Zf(e,t,i,r,n,1)},pi.register("AlphaImage",qf);var Kf=function(e,t,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?n-1:0,d=i?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)},Qf=function(e,t,i,r,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,h=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*l-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+f]=255&s,f+=p,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;e[i+f]=255&a,f+=p,a/=256,u-=8);e[i+f-p]|=128*_};function Jf(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Jf.Varint=0,Jf.Fixed64=1,Jf.Bytes=2,Jf.Fixed32=5;var ep=4294967296,tp=1/ep;function ip(e){return e.type===Jf.Bytes?e.readVarint()+e.pos:e.pos+1}function rp(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=e;n--)i.buf[n+r]=i.buf[n]}function np(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function op(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function ap(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function sp(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function lp(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function up(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function cp(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function hp(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function dp(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function fp(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function pp(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function _p(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Jf.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,e(n,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=fp(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=_p(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=fp(this.buf,this.pos)+fp(this.buf,this.pos+4)*ep;return this.pos+=8,e},readSFixed64:function(){var e=fp(this.buf,this.pos)+_p(this.buf,this.pos+4)*ep;return this.pos+=8,e},readFloat:function(){var e=Kf(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Kf(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128||(t|=(127&(i=r[this.pos++]))<<7,i<128)||(t|=(127&(i=r[this.pos++]))<<14,i<128)||(t|=(127&(i=r[this.pos++]))<<21,i<128)?t:function(e,t,i){var r,n,o=i.buf;if(n=o[i.pos++],r=(112&n)>>4,n<128||(n=o[i.pos++],r|=(127&n)<<3,n<128)||(n=o[i.pos++],r|=(127&n)<<10,n<128)||(n=o[i.pos++],r|=(127&n)<<17,n<128)||(n=o[i.pos++],r|=(127&n)<<24,n<128)||(n=o[i.pos++],r|=(1&n)<<31,n<128))return function(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this)},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){for(var r="",n=t;n<i;){var o,a,s,l=e[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(u=l):2===c?128==(192&(o=e[n+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=e[n+1],a=e[n+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=e[n+1],a=e[n+2],s=e[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),n+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=ip(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=ip(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Jf.Varint)for(;this.buf[this.pos++]>127;);else if(t===Jf.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Jf.Fixed32)this.pos+=4;else{if(t!==Jf.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),pp(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),pp(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),pp(this.buf,-1&e,this.pos),pp(this.buf,Math.floor(e*tp),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),pp(this.buf,-1&e,this.pos),pp(this.buf,Math.floor(e*tp),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var i,r;if(e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,n,o=0;o<t.length;o++){if((r=t.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&rp(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),Qf(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Qf(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;r>=128&&rp(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,Jf.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,np,t)},writePackedSVarint:function(e,t){this.writeMessage(e,op,t)},writePackedBoolean:function(e,t){this.writeMessage(e,lp,t)},writePackedFloat:function(e,t){this.writeMessage(e,ap,t)},writePackedDouble:function(e,t){this.writeMessage(e,sp,t)},writePackedFixed32:function(e,t){this.writeMessage(e,up,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,cp,t)},writePackedFixed64:function(e,t){this.writeMessage(e,hp,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,dp,t)},writeBytesField:function(e,t){this.writeTag(e,Jf.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Jf.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Jf.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Jf.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Jf.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Jf.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Jf.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Jf.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Jf.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Jf.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};const mp=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),$p=mp(void 0,(function(){return $p.toString().search("(((.+)+)+)+$").toString().constructor($p).search("(((.+)+)+)+$")}));$p();const gp=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),vp=gp(void 0,(function(){return vp.toString().search("(((.+)+)+)+$").toString().constructor(vp).search("(((.+)+)+)+$")}));vp();const yp={horizontal:1,vertical:2,horizontalOnly:3},xp=-17;class bp{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const i=new bp;return i.scale=e||1,i.fontStack=t,i}static forImage(e){const t=new bp;return t.imageName=e,t}}class wp{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const i=new wp;for(let r=0;r<e.sections.length;r++){const n=e.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,t)}return i}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t="";for(let i=0;i<e.length;i++){const r=e.charCodeAt(i+1)||null,n=e.charCodeAt(i-1)||null;r&&rf(r)&&!lf[e[i+1]]||n&&rf(n)&&!lf[e[i-1]]||!lf[e[i]]?t+=e[i]:t+=lf[e[i]]}return t}(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Tp[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let i=this.text.length-1;i>=0&&i>=e&&Tp[this.text.charCodeAt(i)];i--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const i=new wp;return i.text=this.text.substring(e,t),i.sectionIndex=this.sectionIndex.slice(e,t),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(bp.forText(e.scale,e.fontStack||t));const i=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(i)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void xu("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(bp.forImage(t)),this.sectionIndex.push(this.sections.length-1)):xu("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Cp(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_){const m=wp.fromFeature(e,n);let $;h===yp.vertical&&m.verticalizePunctuation();const{processBidirectionalText:g,processStyledBidirectionalText:v}=kf;if(g&&1===m.sections.length){$=[];const e=g(m.toString(),Op(m,u,o,t,r,f,p));for(const t of e){const e=new wp;e.text=t,e.sections=m.sections;for(let i=0;i<t.length;i++)e.sectionIndex.push(0);$.push(e)}}else if(v){$=[];const e=v(m.text,m.sectionIndex,Op(m,u,o,t,r,f,p));for(const t of e){const e=new wp;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,$.push(e)}}else $=function(e,t){const i=[],r=e.text;let n=0;for(const r of t)i.push(e.substring(n,r)),n=r;return n<r.length&&i.push(e.substring(n,r.length)),i}(m,Op(m,u,o,t,r,f,p));const y=[],x={positionedLines:y,text:m.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(e,t,i,r,n,o,a,s,l,u,c,h){let d=0,f=xp,p=0,_=0;const m="right"===s?1:"left"===s?0:.5;let $=0;for(const a of n){a.trim();const n=a.getMaxScale(),s=(n-1)*Gf,g={positionedGlyphs:[],lineOffset:0};e.positionedLines[$]=g;const v=g.positionedGlyphs;let y=0;if(!a.length()){f+=o,++$;continue}for(let o=0;o<a.length();o++){const p=a.getSection(o),_=a.getSectionIndex(o),m=a.getCharCode(o);let $=0,g=null,x=null,b=null,w=Gf;const C=!(l===yp.horizontal||!c&&!tf(m)||c&&(Tp[m]||nf(m)));if(p.imageName){const t=r[p.imageName];if(!t)continue;b=p.imageName,e.iconsInText=e.iconsInText||!0,x=t.paddedRect;const i=t.displaySize;p.scale=p.scale*Gf/h,g={width:i[0],height:i[1],left:1,top:-3,advance:C?i[1]:i[0]},$=s+(Gf-i[1]*p.scale),w=g.advance;const o=C?i[0]*p.scale-Gf*n:i[1]*p.scale-Gf*n;o>0&&o>y&&(y=o)}else{const e=i[p.fontStack],r=e&&e[m];if(r&&r.rect)x=r.rect,g=r.metrics;else{const e=t[p.fontStack],i=e&&e[m];if(!i)continue;g=i.metrics}$=(n-p.scale)*Gf}C?(e.verticalizable=!0,v.push({glyph:m,imageName:b,x:d,y:f+$,vertical:C,scale:p.scale,fontStack:p.fontStack,sectionIndex:_,metrics:g,rect:x}),d+=w*p.scale+u):(v.push({glyph:m,imageName:b,x:d,y:f+$,vertical:C,scale:p.scale,fontStack:p.fontStack,sectionIndex:_,metrics:g,rect:x}),d+=g.advance*p.scale+u)}if(0!==v.length){const e=d-u;p=Math.max(e,p),Rp(v,0,v.length-1,m,y)}d=0;const x=o*n+y;g.lineOffset=Math.max(y,s),f+=x,_=Math.max(x,_),++$}const g=f-xp,{horizontalAlign:v,verticalAlign:y}=Dp(a);(function(e,t,i,r,n,o,a,s,l){const u=(t-i)*n;let c=0;c=o!==a?-s*r-xp:(-r*l+.5)*a;for(const t of e)for(const e of t.positionedGlyphs)e.x+=u,e.y+=c})(e.positionedLines,m,v,y,p,_,o,g,n.length),e.top+=-y*g,e.bottom=e.top+g,e.left+=-v*p,e.right=e.left+p}(x,t,i,r,$,a,s,l,h,u,d,_),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(y)&&x}const Tp={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Sp={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Ep(e,t,i,r,n,o){if(t.imageName){const e=r[t.imageName];return e?e.displaySize[0]*t.scale*Gf/o+n:0}{const r=i[t.fontStack],o=r&&r[e];return o?o.metrics.advance*t.scale+n:0}}function Ap(e,t,i,r){const n=Math.pow(e-t,2);return r?e<t?n/2:2*n:n+Math.abs(i)*i}function Pp(e,t,i){let r=0;return 10===e&&(r-=1e4),i&&(r+=150),(40===e||65288===e)&&(r+=50),(41===t||65289===t)&&(r+=50),r}function Ip(e,t,i,r,n,o){let a=null,s=Ap(t,i,n,o);for(const e of r){const r=Ap(t-e.x,i,n,o)+e.badness;r<=s&&(a=e,s=r)}return{index:e,x:t,priorBreak:a,badness:s}}function Mp(e){return e?Mp(e.priorBreak).concat(e.index):[]}function Op(e,t,i,r,n,o,a){if("point"!==o)return[];if(!e)return[];const s=[],l=function(e,t,i,r,n,o){let a=0;for(let i=0;i<e.length();i++){const s=e.getSection(i);a+=Ep(e.getCharCode(i),s,r,n,t,o)}return a/Math.max(1,Math.ceil(a/i))}(e,t,i,r,n,a),u=e.text.indexOf("�")>=0;let c=0;for(let i=0;i<e.length();i++){const o=e.getSection(i),d=e.getCharCode(i);if(Tp[d]||(c+=Ep(d,o,r,n,t,a)),i<e.length()-1){const t=!((h=d)<11904||!(Id(h)||Ed(h)||Yd(h)||Hd(h)||Rd(h)||xd(h)||Md(h)||Cd(h)||Ld(h)||Nd(h)||Dd(h)||Zd(h)||Td(h)||wd(h)||bd(h)||Od(h)||Sd(h)||Wd(h)||zd(h)||Fd(h)));(Sp[d]||t||o.imageName)&&s.push(Ip(i+1,c,l,s,Pp(d,e.getCharCode(i+1),t&&u),!1))}}var h;return Mp(Ip(e.length(),c,l,s,0,!0))}function Dp(e){let t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function Rp(e,t,i,r,n){if(!r&&!n)return;const o=e[i],a=o.metrics.advance*o.scale,s=(e[i].x+a)*r;for(let r=t;r<=i;r++)e[r].x-=s,e[r].y+=n}function Lp(e,t,i){const{horizontalAlign:r,verticalAlign:n}=Dp(i),o=t[0],a=t[1],s=o-e.displaySize[0]*r,l=s+e.displaySize[0],u=a-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:s,right:l}}function Bp(e,t,i,r,n,o){const a=e.image;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,u=t.right*o;let c,h,d,f;"width"===i||"both"===i?(f=n[0]+l-r[3],h=n[0]+u+r[1]):(f=n[0]+(l+u-a.displaySize[0])/2,h=f+a.displaySize[0]);const p=t.top*o,_=t.bottom*o;return"height"===i||"both"===i?(c=n[1]+p-r[0],d=n[1]+_+r[2]):(c=n[1]+(p+_-a.displaySize[1])/2,d=c+a.displaySize[1]),{image:a,top:c,right:h,bottom:d,left:f,collisionPadding:s}}var Np,Fp=(Np=!0,function(e,t){var i=Np?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Np=!1,i}),zp=Fp(void 0,(function(){return zp.toString().search("(((.+)+)+)+$").toString().constructor(zp).search("(((.+)+)+)+$")}));zp();const kp=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),Vp=kp(void 0,(function(){return Vp.toString().search("(((.+)+)+)+$").toString().constructor(Vp).search("(((.+)+)+)+$")}));Vp();const Up=128;function Xp(e,t){const{expression:i}=t;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new mn(e+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=i;let n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let o=n;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[n],s=t[o];return"composite"===i.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:s,minSize:i.evaluate(new mn(a)),maxSize:i.evaluate(new mn(s)),interpolationType:r}}}var Hp=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i,r,n){e.call(this,t,i),this.angle=r,void 0!==n&&(this.segment=n)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)},n}(tn);pi.register("Anchor",Hp);var Gp,Wp=(Gp=!0,function(e,t){var i=Gp?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Gp=!1,i}),Yp=Wp(void 0,(function(){return Yp.toString().search("(((.+)+)+)+$").toString().constructor(Yp).search("(((.+)+)+)+$")}));function qp(e,t,i,r,n){if(void 0===t.segment)return!0;for(var o=t,a=t.segment+1,s=0;s>-i/2;){if(--a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;for(var l=[],u=0;s<i/2;){var c=e[a-1],h=e[a],d=e[a+1];if(!d)return!1;var f=c.angleTo(h)-h.angleTo(d);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:f}),u+=f;s-l[0].distance>r;)u-=l.shift().angleDelta;if(u>n)return!1;a++,s+=h.dist(d)}return!0}Yp();var jp,Zp=(jp=!0,function(e,t){var i=jp?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return jp=!1,i}),Kp=Zp(void 0,(function(){return Kp.toString().search("(((.+)+)+)+$").toString().constructor(Kp).search("(((.+)+)+)+$")}));function Qp(e,t,i){return e*(1-i)+t*i}Kp();var Jp=function(){};function e_(e){for(var t=0,i=0;i<e.length-1;i++)t+=e[i].dist(e[i+1]);return t}function t_(e,t,i){return e?.6*t*i:0}function i_(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function r_(e,t,i,r,n,o,a,s,l){for(var u=o/2,c=e_(e),h=0,d=t-i,f=[],p=0;p<e.length-1;p++){for(var _=e[p],m=e[p+1],$=_.dist(m),g=m.angleTo(_);d+i<h+$;){var v=((d+=i)-h)/$,y=Qp(_.x,m.x,v),x=Qp(_.y,m.y,v);if(y>=0&&y<l&&x>=0&&x<l&&d-u>=0&&d+u<=c){var b=new Hp(y,x,g,p);b._round(),(!r||qp(e,b,o,r,n))&&f.push(b)}}h+=$}return!s&&!f.length&&!a&&(f=r_(e,h/2,i,r,n,o,a,!0,l)),f}Jp.getCenterAnchor=function(e,t,i,r,n,o){for(var a=t_(i,n,o),s=i_(i,r)*o,l=0,u=e_(e)/2,c=0;c<e.length-1;c++){var h=e[c],d=e[c+1],f=h.dist(d);if(l+f>u){var p=(u-l)/f,_=Qp(h.x,d.x,p),m=Qp(h.y,d.y,p),$=new Hp(_,m,d.angleTo(h),c);return $._round(),!a||qp(e,$,s,a,t)?$:void 0}l+=f}},Jp.getAnchors=function(e,t,i,r,n,o,a,s,l){var u=t_(r,o,a),c=i_(r,n),h=c*a,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),r_(e,d?t/2*s%t:(c/2+2*o)*a*s%t,t,u,i,h,d,!1,l)};var n_,o_=(n_=!0,function(e,t){var i=n_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return n_=!1,i}),a_=o_(void 0,(function(){return a_.toString().search("(((.+)+)+)+$").toString().constructor(a_).search("(((.+)+)+)+$")}));a_();var s_,l_=(s_=!0,function(e,t){var i=s_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return s_=!1,i}),u_=l_(void 0,(function(){return u_.toString().search("(((.+)+)+)+$").toString().constructor(u_).search("(((.+)+)+)+$")}));u_();var c_=function(){};function h_(e,t,i){for(var r=0,n=0,o=e;n<o.length;n+=1){var a=o[n];r+=Math.max(t,Math.min(i,a[1]))-Math.max(t,Math.min(i,a[0]))}return r}function d_(e,t,i){for(var r=[{fixed:-1,stretch:0}],n=0,o=e;n<o.length;n+=1){var a=o[n],s=a[0],l=a[1],u=r[r.length-1];r.push({fixed:s-u.stretch,stretch:u.stretch}),r.push({fixed:s-u.stretch,stretch:u.stretch+(l-s)})}return r.push({fixed:t+1,stretch:i}),r}function f_(e,t,i,r){return e/t*i+r}function p_(e,t,i,r){return e-t*i/r}c_.getIconQuads=function(e,t,i,r){var n=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2,l=o.paddedRect.h-2,u=e.right-e.left,c=e.bottom-e.top,h=o.stretchX||[[0,s]],d=o.stretchY||[[0,l]],f=function(e,t){return e+t[1]-t[0]},p=h.reduce(f,0),_=d.reduce(f,0),m=s-p,$=l-_,g=0,v=p,y=0,x=_,b=0,w=m,C=0,T=$;if(o.content&&r){var S=o.content;g=h_(h,0,S[0]),y=h_(d,0,S[1]),v=h_(h,S[0],S[2]),x=h_(d,S[1],S[3]),b=S[0]-g,C=S[1]-y,w=S[2]-S[0]-v,T=S[3]-S[1]-x}var E=function(r,n,s,l){var h=f_(r.stretch-g,v,u,e.left),d=p_(r.fixed-b,w,r.stretch,p),f=f_(n.stretch-y,x,c,e.top),m=p_(n.fixed-C,T,n.stretch,_),$=f_(s.stretch-g,v,u,e.left),S=p_(s.fixed-b,w,s.stretch,p),E=f_(l.stretch-y,x,c,e.top),A=p_(l.fixed-C,T,l.stretch,_),P=new tn(h,f),I=new tn($,f),M=new tn($,E),O=new tn(h,E),D=new tn(d/a,m/a),R=new tn(S/a,A/a),L=t*Math.PI/180;if(L){var B=Math.sin(L),N=Math.cos(L),F=[N,-B,B,N];P._matMult(F),I._matMult(F),O._matMult(F),M._matMult(F)}var z=r.stretch+r.fixed,k=s.stretch+s.fixed,V=n.stretch+n.fixed,U=l.stretch+l.fixed;return{tl:P,tr:I,bl:O,br:M,tex:{x:o.paddedRect.x+1+z,y:o.paddedRect.y+1+V,w:k-z,h:U-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:R,minFontScaleX:w/a/u,minFontScaleY:T/a/c,isSDF:i}};if(r&&(o.stretchX||o.stretchY))for(var A=d_(h,m,p),P=d_(d,$,_),I=0;I<A.length-1;I++)for(var M=A[I],O=A[I+1],D=0;D<P.length-1;D++){var R=P[D],L=P[D+1];n.push(E(M,R,O,L))}else n.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return n},c_.getGlyphQuads=function(e,t,i,r,n,o,a,s){for(var l=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],c=0,h=t.positionedLines;c<h.length;c+=1)for(var d=h[c],f=0,p=d.positionedGlyphs;f<p.length;f+=1){var _=p[f];if(_.rect){var m=_.rect||{},$=4,g=!0,v=1,y=0,x=(n||s)&&_.vertical,b=_.metrics.advance*_.scale/2;if(s&&t.verticalizable){var w=(_.scale-1)*Gf,C=(Gf-_.metrics.width*_.scale)/2;y=d.lineOffset/2-(_.imageName?-C:w)}if(_.imageName){var T=a[_.imageName];g=T.sdf,$=1/(v=T.pixelRatio)}var S=n?[_.x+b,_.y]:[0,0],E=n?[0,0]:[_.x+b+i[0],_.y+i[1]-y],A=[0,0];x&&(A=E,E=[0,0]);var P=(_.metrics.left-$)*_.scale-b+E[0],I=(-_.metrics.top-$)*_.scale+E[1],M=P+m.w*_.scale/v,O=I+m.h*_.scale/v,D=new tn(P,I),R=new tn(M,I),L=new tn(P,O),B=new tn(M,O);if(x){var N=new tn(-b,b- -17),F=-Math.PI/2,z=12-b,k=new tn(22-z,-(_.imageName?z:0)),V=new(Function.prototype.bind.apply(tn,[null].concat(A)));D._rotateAround(F,N)._add(k)._add(V),R._rotateAround(F,N)._add(k)._add(V),L._rotateAround(F,N)._add(k)._add(V),B._rotateAround(F,N)._add(k)._add(V)}if(l){var U=Math.sin(l),X=Math.cos(l),H=[X,-U,U,X];D._matMult(H),R._matMult(H),L._matMult(H),B._matMult(H)}var G=new tn(0,0),W=new tn(0,0);u.push({tl:D,tr:R,bl:L,br:B,tex:m,writingMode:t.writingMode,glyphOffset:S,sectionIndex:_.sectionIndex,isSDF:g,pixelOffsetTL:G,pixelOffsetBR:W,minFontScaleX:0,minFontScaleY:0})}}return u};var __,m_=(__=!0,function(e,t){var i=__?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return __=!1,i}),$_=m_(void 0,(function(){return $_.toString().search("(((.+)+)+)+$").toString().constructor($_).search("(((.+)+)+)+$")}));$_();var g_=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=a.top*s-l,f=a.bottom*s+l,p=a.left*s-l,_=a.right*s+l,m=a.collisionPadding;if(m&&(p-=m[0]*s,d-=m[1]*s,_+=m[2]*s,f+=m[3]*s),this.boxStartIndex=e.length,u){var $=f-d,g=_-p;$>0&&($=Math.max(10*s,$),this._addLineCollisionCircles(e,t,i,i.segment,g,$,r,n,o,c))}else{if(h){var v=new tn(p,d),y=new tn(_,d),x=new tn(p,f),b=new tn(_,f),w=h*Math.PI/180;v._rotate(w),y._rotate(w),x._rotate(w),b._rotate(w),p=Math.min(v.x,y.x,x.x,b.x),_=Math.max(v.x,y.x,x.x,b.x),d=Math.min(v.y,y.y,x.y,b.y),f=Math.max(v.y,y.y,x.y,b.y)}e.emplaceBack(i.x,i.y,p,d,_,f,r,n,o,0,0)}this.boxEndIndex=e.length};g_.prototype._addLineCollisionCircles=function(e,t,i,r,n,o,a,s,l,u){var c=o/2,h=Math.floor(n/c)||1,d=1+.4*Math.log(u)/Math.LN2,f=Math.floor(h*d/2),p=-o/2,_=i,m=r+1,$=p,g=-n/2,v=g-n/4;do{if(--m<0){if($>g)return;m=0;break}$-=t[m].dist(_),_=t[m]}while($>v);for(var y=t[m].dist(t[m+1]),x=-f;x<h+f;x++){var b=x*c,w=g+b;if(b<0&&(w+=b),b>n&&(w+=b-n),!(w<$)){for(;$+y<w;){if($+=y,1+ ++m>=t.length)return;y=t[m].dist(t[m+1])}var C=w-$,T=t[m],S=t[m+1].sub(T)._unit()._mult(C)._add(T)._round(),E=Math.abs(w-p)<c?0:.8*(w-p);e.emplaceBack(S.x,S.y,-o/2,-o/2,o/2,o/2,a,s,l,o/2,E)}}};var v_,y_=(v_=!0,function(e,t){var i=v_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return v_=!1,i}),x_=y_(void 0,(function(){return x_.toString().search("(((.+)+)+)+$").toString().constructor(x_).search("(((.+)+)+)+$")}));function b_(e,t,i){void 0===t&&(t=1),void 0===i&&(i=!1);for(var r=1/0,n=1/0,o=-1/0,a=-1/0,s=e[0],l=0;l<s.length;l++){var u=s[l];(!l||u.x<r)&&(r=u.x),(!l||u.y<n)&&(n=u.y),(!l||u.x>o)&&(o=u.x),(!l||u.y>a)&&(a=u.y)}var c=o-r,h=a-n,d=Math.min(c,h),f=d/2,p=new TinyQueue([],w_);if(0===d)return new tn(r,n);for(var _=r;_<o;_+=d)for(var m=n;m<a;m+=d)p.push(new C_(_+f,m+f,f,e));for(var $=function(e){for(var t=0,i=0,r=0,n=e[0],o=0,a=n.length,s=a-1;o<a;s=o++){var l=n[o],u=n[s],c=l.x*u.y-u.x*l.y;i+=(l.x+u.x)*c,r+=(l.y+u.y)*c,t+=3*c}return new C_(i/t,r/t,0,e)}(e),g=p.length;p.length;){var v=p.pop();(v.d>$.d||!$.d)&&($=v,i&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,g)),v.max-$.d<=t||(f=v.h/2,p.push(new C_(v.p.x-f,v.p.y-f,f,e)),p.push(new C_(v.p.x+f,v.p.y-f,f,e)),p.push(new C_(v.p.x-f,v.p.y+f,f,e)),p.push(new C_(v.p.x+f,v.p.y+f,f,e)),g+=4)}return i&&(console.log("num probes: "+g),console.log("best distance: "+$.d)),$.p}function w_(e,t){return t.max-e.max}function C_(e,t,i,r){this.p=new tn(e,t),this.h=i,this.d=function(e,t){for(var i=!1,r=1/0,n=0;n<t.length;n++)for(var o=t[n],a=0,s=o.length,l=s-1;a<s;l=a++){var u=o[a],c=o[l];u.y>e.y!=c.y>e.y&&e.x<(c.x-u.x)*(e.y-u.y)/(c.y-u.y)+u.x&&(i=!i),r=Math.min(r,gc.distToSegmentSquared(e,u,c))}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}x_();var T_,S_=(T_=!0,function(e,t){var i=T_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return T_=!1,i}),E_=S_(void 0,(function(){return E_.toString().search("(((.+)+)+)+$").toString().constructor(E_).search("(((.+)+)+)+$")}));function A_(e,t){var i,r,n,o,a,s,l,u;for(i=3&e.length,r=e.length-i,n=t,a=3432918353,s=461845907,u=0;u<r;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}E_();const P_=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),I_=P_(void 0,(function(){return I_.toString().search("(((.+)+)+)+$").toString().constructor(I_).search("(((.+)+)+)+$")}));I_();const M_=Number.POSITIVE_INFINITY;function O_(e,t,i,r,n,o){e.createArrays();const a=512*e.overscaling;e.tilePixelRatio=yn/a,e.compareText={},e.iconsNeedLinear=!1;const s=e.layers[0].layout,l=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.textSizeData;u.compositeTextSizes=[l["text-size"].possiblyEvaluate(new mn(t)),l["text-size"].possiblyEvaluate(new mn(i))]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.iconSizeData;u.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new mn(t)),l["icon-size"].possiblyEvaluate(new mn(i))]}u.layoutTextSize=l["text-size"].possiblyEvaluate(new mn(e.zoom+1)),u.layoutIconSize=l["icon-size"].possiblyEvaluate(new mn(e.zoom+1)),u.textMaxSize=l["text-size"].possiblyEvaluate(new mn(18));const c=s.get("text-line-height")*Gf,h="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),d=s.get("text-keep-upright"),f=s.get("text-size");for(const o of e.features){const a=s.get("text-font").evaluate(o,{}).join(","),l=f.evaluate(o,{}),m=u.layoutTextSize.evaluate(o,{}),$=u.layoutIconSize.evaluate(o,{}),g={horizontal:{},vertical:void 0},v=o.text;let y=[0,0];if(v){const r=v.toString(),u=s.get("text-letter-spacing").evaluate(o,{})*Gf,f=ef(r)?u:0,$=s.get("text-anchor").evaluate(o,{}),x=s.get("text-variable-anchor");if(!x){const e=s.get("text-radial-offset").evaluate(o,{});e?(p=$,y=(_=[e*Gf,M_])[1]!==M_?function(e,t,i){let r=0,n=0;switch(t=Math.abs(t),i=Math.abs(i),e){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(e){case"top-right":case"bottom-right":case"right":r=-t;break;case"top-left":case"bottom-left":case"left":r=t}return[r,n]}(p,_[0],_[1]):function(e,t){let i=0,r=0;t<0&&(t=0);const n=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-t;break;case"top":r=t-7}switch(e){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=t;break;case"right":i=-t}return[i,r]}(p,_[0])):y=s.get("text-offset").evaluate(o,{}).map((e=>e*Gf))}let b=h?"center":s.get("text-justify").evaluate(o,{});const w=s.get("symbol-placement"),C="point"===w?s.get("text-max-width").evaluate(o,{})*Gf:0,T=()=>{e.allowVerticalPlacement&&Jd(r)&&(g.vertical=Cp(v,t,i,n,a,C,c,$,"left",f,y,yp.vertical,!0,w,m,l))};if(!h&&x){const e="auto"===b?x.map((e=>D_(e))):[b];let r=!1;for(let o=0;o<e.length;o++){const s=e[o];if(!g.horizontal[s])if(r)g.horizontal[s]=g.horizontal[0];else{const e=Cp(v,t,i,n,a,C,c,"center",s,f,y,yp.horizontal,!1,w,m,l);e&&(g.horizontal[s]=e,r=1===e.positionedLines.length)}}T()}else{"auto"===b&&(b=D_($));const e=Cp(v,t,i,n,a,C,c,$,b,f,y,yp.horizontal,!1,w,m,l);e&&(g.horizontal[b]=e),T(),Jd(r)&&h&&d&&(g.vertical=Cp(v,t,i,n,a,C,c,$,b,f,y,yp.vertical,!1,w,m,l))}}let x,b=!1;if(o.icon&&o.icon.name){const t=r[o.icon.name];t&&(x=Lp(n[o.icon.name],s.get("icon-offset").evaluate(o,{}),s.get("icon-anchor").evaluate(o,{})),b=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&xu("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==s.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const w=N_(g.horizontal)||g.vertical;e.iconsInText=!!w&&w.iconsInText,(w||x)&&R_(e,o,g,x,r,u,m,$,y,b)}var p,_;o&&e.generateCollisionDebugBuffers()}function D_(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function R_(e,t,i,r,n,o,a,s,l,u){let c=o.textMaxSize.evaluate(t,{});void 0===c&&(c=a);const h=e.layers[0].layout,d=h.get("icon-offset").evaluate(t,{}),f=N_(i.horizontal),p=a/24,_=e.tilePixelRatio*p,m=e.tilePixelRatio*c/24,$=e.tilePixelRatio*s,g=e.tilePixelRatio*h.get("symbol-spacing"),v=h.get("text-padding")*e.tilePixelRatio,y=h.get("icon-padding")*e.tilePixelRatio,x=h.get("text-max-angle")/180*Math.PI,b="map"===h.get("text-rotation-alignment")&&"point"!==h.get("symbol-placement"),w="map"===h.get("icon-rotation-alignment")&&"point"!==h.get("symbol-placement"),C=h.get("symbol-placement"),T=g/2,S=h.get("icon-text-fit");let E;r&&"none"!==S&&(e.allowVerticalPlacement&&i.vertical&&(E=Bp(r,i.vertical,S,h.get("icon-text-fit-padding"),d,p)),f&&(r=Bp(r,f,S,h.get("icon-text-fit-padding"),d,p)));const A=(a,s)=>{s.x<0||s.x>=yn||s.y<0||s.y>=yn||function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b){const w=e.addToLineVertexArray(t,i);let C,T,S,E,A=0,P=0,I=0,M=0,O=-1,D=-1;const R={};let L=A_(""),B=0,N=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?[B,N]=s.layout.get("text-offset").evaluate(y,{}).map((e=>e*Gf)):(B=s.layout.get("text-radial-offset").evaluate(y,{})*Gf,N=M_),e.allowVerticalPlacement&&r.vertical){const n=s.layout.get("text-rotate").evaluate(y,{})+90,o=r.vertical;S=new g_(l,i,t,u,c,h,o,d,f,p,e.overscaling,n),a&&(E=new g_(l,i,t,u,c,h,a,m,$,p,e.overscaling,n))}if(n){const r=s.layout.get("icon-rotate").evaluate(y,{}),o="none"!==s.layout.get("icon-text-fit"),d=c_.getIconQuads(n,r,b,o),f=a?c_.getIconQuads(a,r,b,o):void 0;T=new g_(l,i,t,u,c,h,n,m,$,!1,e.overscaling,r),A=4*d.length;const p=e.iconSizeData;let _=null;"source"===p.kind?(_=[Up*s.layout.get("icon-size").evaluate(y,{})],_[0]>L_&&xu(e.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".')):"composite"===p.kind&&(_=[Up*x.compositeIconSizes[0].evaluate(y,{}),Up*x.compositeIconSizes[1].evaluate(y,{})],(_[0]>L_||_[1]>L_)&&xu(e.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".')),e.addSymbols(e.icon,d,_,v,g,y,!1,t,w.lineStartIndex,w.lineLength,-1),O=e.icon.placedSymbolArray.length-1,f&&(P=4*f.length,e.addSymbols(e.icon,f,_,v,g,y,yp.vertical,t,w.lineStartIndex,w.lineLength,-1),D=e.icon.placedSymbolArray.length-1)}for(const n in r.horizontal){const a=r.horizontal[n];if(!C){L=A_(a.text);const r=s.layout.get("text-rotate").evaluate(y,{});C=new g_(l,i,t,u,c,h,a,d,f,p,e.overscaling,r)}const m=1===a.positionedLines.length;if(I+=B_(e,t,a,o,s,p,y,_,w,r.vertical?yp.horizontal:yp.horizontalOnly,m?Object.keys(r.horizontal):[n],R,O,x),m)break}r.vertical&&(M+=B_(e,t,r.vertical,o,s,p,y,_,w,yp.vertical,["vertical"],R,D,x));const F=C?C.boxStartIndex:e.collisionBoxArray.length,z=C?C.boxEndIndex:e.collisionBoxArray.length,k=S?S.boxStartIndex:e.collisionBoxArray.length,V=S?S.boxEndIndex:e.collisionBoxArray.length,U=T?T.boxStartIndex:e.collisionBoxArray.length,X=T?T.boxEndIndex:e.collisionBoxArray.length,H=E?E.boxStartIndex:e.collisionBoxArray.length,G=E?E.boxEndIndex:e.collisionBoxArray.length;e.glyphOffsetArray.length>=J_.MAX_GLYPHS&&xu("Too many glyphs being rendered in a tile."),e.symbolInstances.emplaceBack(t.x,t.y,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,O,D,L,F,z,k,V,U,X,H,G,u,I,M,A,P,0,d,B,N)}(e,s,a,i,r,n,E,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,_,v,b,l,$,y,w,d,t,o,u)};if("line"===C)for(const n of function(e,t,i,r,n){for(var o=[],a=0;a<e.length;a++)for(var s=e[a],l=void 0,u=0;u<s.length-1;u++){var c=s[u],h=s[u+1];c.x<t&&h.x<t||(c.x<t?c=new tn(t,c.y+(h.y-c.y)*((t-c.x)/(h.x-c.x)))._round():h.x<t&&(h=new tn(t,c.y+(h.y-c.y)*((t-c.x)/(h.x-c.x)))._round()),c.y<i&&h.y<i||(c.y<i?c=new tn(c.x+(h.x-c.x)*((i-c.y)/(h.y-c.y)),i)._round():h.y<i&&(h=new tn(c.x+(h.x-c.x)*((i-c.y)/(h.y-c.y)),i)._round()),c.x>=r&&h.x>=r||(c.x>=r?c=new tn(r,c.y+(h.y-c.y)*((r-c.x)/(h.x-c.x)))._round():h.x>=r&&(h=new tn(r,c.y+(h.y-c.y)*((r-c.x)/(h.x-c.x)))._round()),c.y>=n&&h.y>=n||(c.y>=n?c=new tn(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round():h.y>=n&&(h=new tn(c.x+(h.x-c.x)*((n-c.y)/(h.y-c.y)),n)._round()),(!l||!c.equals(l[l.length-1]))&&(l=[c],o.push(l)),l.push(h)))))}return o}(t.geometry,0,0,yn,yn)){const t=Jp.getAnchors(n,g,x,i.vertical||f,r,24,m,e.overscaling,yn);for(const i of t){const t=f;(!t||!F_(e,t.text,T,i))&&A(n,i)}}else if("line-center"===C){for(const e of t.geometry)if(e.length>1){const t=Jp.getCenterAnchor(e,x,i.vertical||f,r,24,m);t&&A(e,t)}}else if("Polygon"===t.type)for(const e of Nc(t.geometry,0)){const t=b_(e,16);A(e[0],new Hp(t.x,t.y,0))}else if("LineString"===t.type)for(const e of t.geometry)A(e,new Hp(e[0].x,e[0].y,0));else if("Point"===t.type)for(const e of t.geometry)for(const t of e)A([t],new Hp(t.x,t.y,0))}const L_=32640;function B_(e,t,i,r,n,o,a,s,l,u,c,h,d,f){const p=c_.getGlyphQuads(t,i,s,n,o,a,r,e.allowVerticalPlacement),_=e.textSizeData;let m=null;"source"===_.kind?(m=[Up*n.layout.get("text-size").evaluate(a,{})],m[0]>L_&&xu(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".')):"composite"===_.kind&&(m=[Up*f.compositeTextSizes[0].evaluate(a,{}),Up*f.compositeTextSizes[1].evaluate(a,{})],(m[0]>L_||m[1]>L_)&&xu(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".')),e.addSymbols(e.text,p,m,s,o,a,u,t,l.lineStartIndex,l.lineLength,d);for(const t of c)h[t]=e.text.placedSymbolArray.length-1;return 4*p.length}function N_(e){for(const t in e)return e[t];return null}function F_(e,t,i,r){const n=e.compareText;if(t in n){const e=n[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])<i)return!0}else n[t]=[];return n[t].push(r),!1}var z_,k_=(z_=!0,function(e,t){var i=z_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return z_=!1,i}),V_=k_(void 0,(function(){return V_.toString().search("(((.+)+)+)+$").toString().constructor(V_).search("(((.+)+)+)+$")}));function U_(e,t,i){return e.sections.forEach((function(e){var r,n,o;e.text=(r=e.text,n=i,"uppercase"===(o=t.layout.get("text-transform").evaluate(n,{}))?r=r.toLocaleUpperCase():"lowercase"===o&&(r=r.toLocaleLowerCase()),r)})),e}V_();var X_,H_=(X_=!0,function(e,t){var i=X_?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return X_=!1,i}),G_=H_(void 0,(function(){return G_.toString().search("(((.+)+)+)+$").toString().constructor(G_).search("(((.+)+)+)+$")}));G_();var W_=["Unknown","Point","LineString","Polygon"],Y_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function q_(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=s?Math.min(L_,Math.round(s[0])):0,p=s?Math.min(L_,Math.round(s[1])):0;e.emplaceBack(t,i,Math.round(32*r),Math.round(32*n),o,a,(f<<1)+(l?1:0),p,16*u,16*c,256*h,256*d)}function j_(e,t,i){e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i)}function Z_(e){for(var t=0,i=e.sections;t<i.length;t+=1)if(of(i[t].text))return!0;return!1}var K_=function(e){this.layoutVertexArray=new Nn,this.indexArray=new qn,this.programConfigurations=e,this.segments=new En,this.dynamicLayoutVertexArray=new Fn,this.opacityVertexArray=new zn,this.placedSymbolArray=new so};K_.prototype.upload=function(e,t,i,r){i&&(this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=gl.toVertexBuffer(e,this.layoutVertexArray,Zh.members)),this.indexArray.length>0&&(this.indexBuffer=gl.toIndexBuffer(e,this.indexArray,t)),this.dynamicLayoutVertexArray.length>0&&(this.dynamicLayoutVertexBuffer=gl.toVertexBuffer(e,this.dynamicLayoutVertexArray,Kh.members,!0)),this.opacityVertexArray.length>0&&(this.opacityVertexBuffer=gl.toVertexBuffer(e,this.opacityVertexArray,Y_,!0),this.opacityVertexBuffer.itemSize=1)),(i||r)&&this.programConfigurations.upload(e)},K_.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.layoutVertexBuffer=null),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=null),this.dynamicLayoutVertexBuffer&&(this.dynamicLayoutVertexBuffer.destroy(),this.dynamicLayoutVertexBuffer=null),this.opacityVertexBuffer&&(this.opacityVertexBuffer.destroy(),this.opacityVertexBuffer=null),this.programConfigurations.destroy(),this.segments.destroy()},K_.prototype.clear=function(){},pi.register("SymbolBuffers",K_);var Q_=function(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new En,this.collisionVertexArray=new Un};Q_.prototype.upload=function(e){this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=gl.toVertexBuffer(e,this.layoutVertexArray,this.layoutAttributes)),this.indexArray.length>0&&(this.indexBuffer=gl.toIndexBuffer(e,this.indexArray)),this.collisionVertexArray.length>0&&(this.collisionVertexBuffer=gl.toVertexBuffer(e,this.collisionVertexArray,Qh.members,!0))},Q_.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.layoutVertexBuffer=null),this.collisionVertexBuffer&&(this.collisionVertexBuffer.destroy(),this.collisionVertexBuffer=null),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=null),this.segments.destroy()},pi.register("CollisionBuffers",Q_);var J_=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1,this.hasRTLText=!1;var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Xp(this.zoom,t["text-size"]),this.iconSizeData=Xp(this.zoom,t["icon-size"]);var i=this.layers[0].layout,r=i.get("symbol-sort-key"),n=i.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==r.constantOr(1);var o="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")),"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((function(e){return yp[e]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=e.sourceID,this.overscaling=1};J_.prototype.createArrays=function(){const e=this.layers[0].layout;this.hasPaintOverrides=lm.hasPaintOverrides(e);var t=Zh.members;this.text=new K_(new Xl(t,this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new K_(new Xl(t,this.layers,this.zoom,(e=>/^icon/.test(e)))),this.textCollisionBox=new Q_(Vn,Jh.members,Zn),this.iconCollisionBox=new Q_(Vn,Jh.members,Zn),this.textCollisionCircle=new Q_(Vn,ed.members,qn),this.iconCollisionCircle=new Q_(Vn,ed.members,qn),this.glyphOffsetArray=new ho,this.lineVertexArray=new po,this.symbolInstances=new uo},J_.prototype.calculateGlyphDependencies=function(e,t,i,r,n){for(let o=0;o<e.length;o++)if(t[e.charCodeAt(o)]=!0,(i||r)&&n){const i=lf[e.charAt(o)];i&&(t[i.charCodeAt(0)]=!0)}},J_.prototype.populate=function(e,t){var i=this.layers[0],r=i.layout,n=r.get("text-font"),o=r.get("text-field"),a=r.get("icon-image"),s=("constant"!==o.value.kind||o.value.value instanceof U&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),l=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],s||l){for(var c=t.iconDependencies,h=t.glyphDependencies,d=t.availableImages,f=new mn(this.zoom),p=0,_=e;p<_.length;p+=1){var m=_[p],$=m.feature,g=m.index,v=m.sourceLayerIndex;if(i._featureFilter(f,$)){var y=void 0;if(s){var x=i.getValueAndResolveTokens("text-field",$,d),b=U.factory(x);Z_(b)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===getRTLTextPluginStatus()||this.hasRTLText&&plugin.isParsed())&&(y=U_(b,i,$))}var w=void 0;if(l){var C=i.getValueAndResolveTokens("icon-image",$,d);w=C instanceof W?C:W.fromString(C)}if(y||w){var T=this.sortFeaturesByKey?u.evaluate($,{}):void 0,S={text:y,icon:w,index:g,sourceLayerIndex:v,geometry:wn($),properties:$.properties,type:W_[$.type],sortKey:T};if(void 0!==$.id&&(S.id=$.id),this.features.push(S),w&&(c[w.name]=!0),y){var E=n.evaluate($,{}).join(","),A="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(yp.vertical)>=0;for(var P=0,I=y.sections;P<I.length;P+=1){var M=I[P];if(M.image)c[M.image.name]=!0;else{var O=Jd(y.toString()),D=M.fontStack||E,R=h[D]=h[D]||{};this.calculateGlyphDependencies(M.text,R,A,this.allowVerticalPlacement,O)}}}}}}if("point"===r.get("symbol-placement"))for(p=0,_=this.features;p<_.length;p+=1){var L=_[p],B=L.geometry,N=L.index,F=L.sourceLayerIndex,z=e[N].feature;t.featureIndex.insert(z,B,N,F,this.index)}"line"===r.get("symbol-placement")&&(this.features=function(e){var t={},i={},r=[],n=0;function o(t){r.push(e[t]),n++}function a(e,t,n){var o=i[e];return delete i[e],i[t]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function s(e,i,n){var o=t[i];return delete t[i],t[e]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function l(e,t,i){var r=i?t[0][t[0].length-1]:t[0][0];return e+":"+r.x+":"+r.y}for(var u=0;u<e.length;u++){var c=e[u],h=c.geometry,d=c.text?c.text.toString():null;if(d){var f=l(d,h),p=l(d,h,!0);if(f in i&&p in t&&i[f]!==t[p]){var _=s(f,p,h),m=a(f,p,r[_].geometry);delete t[f],delete i[p],i[l(d,r[m].geometry,!0)]=m,r[_].geometry=null}else f in i?a(f,p,h):p in t?s(f,p,h):(o(u),t[f]=n-1,i[p]=n-1)}else o(u)}return r.filter((function(e){return e.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}},J_.prototype.update=function(e,t,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,i),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,i))},J_.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},J_.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},J_.prototype.upload=function(e){this.text&&(!this.uploaded&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e),this.textCollisionCircle.upload(e),this.iconCollisionCircle.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0)},J_.prototype.destroy=function(){this.text&&(this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy())},J_.prototype.clear=function(){},J_.prototype.addToLineVertexArray=function(e,t){var i=this.lineVertexArray.length;if(void 0!==e.segment){for(var r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),o={},a=e.segment+1;a<t.length;a++)o[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:r},a<t.length-1&&(r+=t[a+1].dist(t[a]));for(var s=e.segment||0;s>=0;s--)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},J_.prototype.addSymbols=function(e,t,i,r,n,o,a,s,l,u,c){var h=this,d=e.indexArray,f=e.layoutVertexArray,p=e.dynamicLayoutVertexArray,_=e.segments.prepareSegment(4*t.length,e.layoutVertexArray,e.indexArray,o.sortKey),m=this.glyphOffsetArray.length,$=_.vertexLength,g=this.allowVerticalPlacement&&a===yp.vertical?Math.PI/2:0,v=function(e){var t=e.tl,r=e.tr,o=e.bl,l=e.br,u=e.tex,c=e.pixelOffsetTL,m=e.pixelOffsetBR,$=e.minFontScaleX,v=e.minFontScaleY,y=_.vertexLength,x=e.glyphOffset[1];n&&a!==yp.horizontal?(q_(f,s.x,s.y,t.x,x+t.y,u.x+u.w,u.y,i,e.isSDF,c.x,c.y,$,v),q_(f,s.x,s.y,r.x,x+r.y,u.x,u.y,i,e.isSDF,m.x,c.y,$,v),q_(f,s.x,s.y,o.x,x+o.y,u.x+u.w,u.y+u.h,i,e.isSDF,c.x,m.y,$,v),q_(f,s.x,s.y,l.x,x+l.y,u.x,u.y+u.h,i,e.isSDF,m.x,m.y,$,v)):(q_(f,s.x,s.y,t.x,x+t.y,u.x,u.y+u.h,i,e.isSDF,c.x,c.y,$,v),q_(f,s.x,s.y,r.x,x+r.y,u.x+u.w,u.y+u.h,i,e.isSDF,m.x,c.y,$,v),q_(f,s.x,s.y,o.x,x+o.y,u.x,u.y,i,e.isSDF,c.x,m.y,$,v),q_(f,s.x,s.y,l.x,x+l.y,u.x+u.w,u.y,i,e.isSDF,m.x,m.y,$,v)),j_(p,s,g),d.emplaceBack(y,y+1,y+2),d.emplaceBack(y+1,y+2,y+3),_.vertexLength+=4,_.primitiveLength+=2,h.glyphOffsetArray.emplaceBack(e.glyphOffset[0])};if(o.text&&o.text.sections){var y=o.text.sections;if(this.hasPaintOverrides){for(var x,b=function(t,i){void 0!==x&&(x!==t||i)&&e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{},y[x]),x=t},w=0,C=t;w<C.length;w+=1){var T=C[w];b(T.sectionIndex,!1),v(T)}b(x,!0)}else{for(var S=0,E=t;S<E.length;S+=1)v(E[S]);e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{},y[0])}}else{for(var A=0,P=t;A<P.length;A+=1)v(P[A]);e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{})}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,$,l,u,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],a,0,!1,0,c)},J_.prototype._addCollisionDebugVertex=function(e,t,i,r,n,o){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,r,n,Math.round(o.x),Math.round(o.y))},J_.prototype.addCollisionDebugVertices=function(e,t,i,r,n,o,a,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),u=l.vertexLength,c=n.layoutVertexArray,h=n.collisionVertexArray,d=a.anchorX,f=a.anchorY;if(this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(e,t)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(i,t)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(i,r)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(e,r)),l.vertexLength+=4,s){var p=n.indexArray;p.emplaceBack(u,u+1,u+2),p.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var _=n.indexArray;_.emplaceBack(u,u+1),_.emplaceBack(u+1,u+2),_.emplaceBack(u+2,u+3),_.emplaceBack(u+3,u),l.primitiveLength+=4}},J_.prototype.addDebugCollisionBoxes=function(e,t,i,r){for(var n=e;n<t;n++){var o=this.collisionBoxArray.get(n),a=o.x1,s=o.y1,l=o.x2,u=o.y2,c=o.radius>0;this.addCollisionDebugVertices(a,s,l,u,c?r?this.textCollisionCircle:this.iconCollisionCircle:r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,i,c)}},J_.prototype.generateCollisionDebugBuffers=function(){for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},J_.prototype._deserializeCollisionBoxesForSymbol=function(e,t,i,r,n,o,a,s,l){for(var u={},c=t;c<i;c++){var h=e.get(c);if(0===h.radius){u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}!u.textCircles&&(u.textCircles=[],u.textFeatureIndex=h.featureIndex),u.textCircles.push(h.anchorPointX,h.anchorPointY,h.radius,h.signedDistanceFromAnchor,1)}for(var d=r;d<n;d++){var f=e.get(d);if(0===f.radius){u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}}for(var p=o;p<a;p++){var _=e.get(p);if(0===_.radius){u.iconBox={x1:_.x1,y1:_.y1,x2:_.x2,y2:_.y2,anchorPointX:_.anchorPointX,anchorPointY:_.anchorPointY},u.iconFeatureIndex=_.featureIndex;break}}for(var m=s;m<l;m++){var $=e.get(m);if(0===$.radius){u.verticalIconBox={x1:$.x1,y1:$.y1,x2:$.x2,y2:$.y2,anchorPointX:$.anchorPointX,anchorPointY:$.anchorPointY},u.verticalIconFeatureIndex=$.featureIndex;break}}return u},J_.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}},J_.prototype.hasTextData=function(){return this.text.segments.get().length>0},J_.prototype.hasIconData=function(){return this.icon.segments.get().length>0},J_.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},J_.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},J_.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},J_.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},J_.prototype.addIndicesForPlacedSymbol=function(e,t){for(var i=e.placedSymbolArray.get(t),r=i.vertexStartIndex+4*i.numGlyphs,n=i.vertexStartIndex;n<r;n+=4)e.indexArray.emplaceBack(n,n+1,n+2),e.indexArray.emplaceBack(n+1,n+2,n+3)},J_.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),i=Math.cos(e),r=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);r.push(0|Math.round(t*s.anchorX+i*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(e,t){return r[e]-r[t]||n[t]-n[e]})),o},J_.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var i=0,r=this.symbolInstanceIndexes;i<r.length;i+=1){var n=r[i],o=this.symbolInstances.get(n);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(e,i,r){e>=0&&r.indexOf(e)===i&&t.addIndicesForPlacedSymbol(t.text,e)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},pi.register("SymbolBucket",J_,{omit:["layers","collisionBoxArray","compareText"]}),J_.MAX_GLYPHS=65535,J_.addDynamicAttributes=j_;var em,tm=(em=!0,function(e,t){var i=em?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return em=!1,i}),im=tm(void 0,(function(){return im.toString().search("(((.+)+)+)+$").toString().constructor(im).search("(((.+)+)+)+$")}));im();var rm,nm={kind:"formatted"},om=new Du({"symbol-placement":new tu(hc["symbol-placement"]),"symbol-spacing":new tu(hc["symbol-spacing"]),"symbol-avoid-edges":new tu(hc["symbol-avoid-edges"]),"symbol-sort-key":new ou(hc["symbol-sort-key"]),"symbol-z-order":new tu(hc["symbol-z-order"]),"icon-allow-overlap":new tu(hc["icon-allow-overlap"]),"icon-ignore-placement":new tu(hc["icon-ignore-placement"]),"icon-optional":new tu(hc["icon-optional"]),"icon-rotation-alignment":new tu(hc["icon-rotation-alignment"]),"icon-size":new ou(hc["icon-size"]),"icon-text-fit":new tu(hc["icon-text-fit"]),"icon-text-fit-padding":new tu(hc["icon-text-fit-padding"]),"icon-image":new ou(hc["icon-image"]),"icon-rotate":new ou(hc["icon-rotate"]),"icon-padding":new tu(hc["icon-padding"]),"icon-keep-upright":new tu(hc["icon-keep-upright"]),"icon-offset":new ou(hc["icon-offset"]),"icon-anchor":new ou(hc["icon-anchor"]),"icon-pitch-alignment":new tu(hc["icon-pitch-alignment"]),"text-pitch-alignment":new tu(hc["text-pitch-alignment"]),"text-rotation-alignment":new tu(hc["text-rotation-alignment"]),"text-field":new ou(hc["text-field"]),"text-font":new ou(hc["text-font"]),"text-size":new ou(hc["text-size"]),"text-max-width":new ou(hc["text-max-width"]),"text-line-height":new tu(hc["text-line-height"]),"text-letter-spacing":new ou(hc["text-letter-spacing"]),"text-justify":new ou(hc["text-justify"]),"text-radial-offset":new ou(hc["text-radial-offset"]),"text-variable-anchor":new tu(hc["text-variable-anchor"]),"text-anchor":new ou(hc["text-anchor"]),"text-max-angle":new tu(hc["text-max-angle"]),"text-writing-mode":new tu(hc["text-writing-mode"]),"text-rotate":new ou(hc["text-rotate"]),"text-padding":new tu(hc["text-padding"]),"text-keep-upright":new tu(hc["text-keep-upright"]),"text-transform":new ou(hc["text-transform"]),"text-offset":new ou(hc["text-offset"]),"text-allow-overlap":new tu(hc["text-allow-overlap"]),"text-ignore-placement":new tu(hc["text-ignore-placement"]),"text-optional":new tu(hc["text-optional"])}),am={paint:new Du({"icon-opacity":new ou(_c["icon-opacity"]),"icon-color":new ou(_c["icon-color"]),"icon-halo-color":new ou(_c["icon-halo-color"]),"icon-halo-width":new ou(_c["icon-halo-width"]),"icon-halo-blur":new ou(_c["icon-halo-blur"]),"icon-translate":new tu(_c["icon-translate"]),"icon-translate-anchor":new tu(_c["icon-translate-anchor"]),"text-opacity":new ou(_c["text-opacity"]),"text-color":new ou(_c["text-color"],{runtimeType:{kind:"color"},getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new ou(_c["text-halo-color"]),"text-halo-width":new ou(_c["text-halo-width"]),"text-halo-blur":new ou(_c["text-halo-blur"]),"text-show-background":new ou(_c["text-show-background"]),"text-translate":new tu(_c["text-translate"]),"text-translate-anchor":new tu(_c["text-translate-anchor"])}),layout:om},sm=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,am)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.recalculate=function(t,i){if(e.prototype.recalculate.call(this,t,i),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"line"==this.layout.get("symbol-placement")&&"viewport"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],o=0,a=r;o<a.length;o+=1){var s=a[o];n.indexOf(s)<0&&n.push(s)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},n.prototype.getValueAndResolveTokens=function(e,t,i){var r,n=this.layout.get(e).evaluate(t,{},i),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||dr.isExpression(o.value)||!n?n:(r=t.properties,n.replace(/{([^{}]+)}/g,((e,t)=>t in r?String(r[t]):"")))},n.prototype.createBucket=function(e){return new J_(e)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a){return gc.polygonIntersectPoint(e,r[0][0])},n.prototype._setPaintOverrides=function(){for(var e=0,t=am.paint.overridableProperties;e<t.length;e+=1){var i=t[e];if(n.hasPaintOverride(this.layout,i)){var r=this.paint.get(i);new FormatSectionOverride(r),"constant"===r.value.kind||r.value.kind,this.paint._values[i]=new PossiblyEvaluatedPropertyValue(r.property,null,r.parameters)}}},n.prototype._handleOverridablePaintPropertyUpdate=function(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&n.hasPaintOverride(this.layout,e)},n.hasPaintOverride=function(e,t){var i=e.get("text-field"),r=am.paint.properties[t],n=!1,o=function(e){for(var t=0,i=e;t<i.length;t+=1){var o=i[t];if(r.overrides&&r.overrides.hasOverride(o))return void(n=!0)}};if("constant"===i.value.kind&&i.value.value instanceof U)o(i.value.value.sections);else if("source"===i.value.kind){var a=function(e){if(!n)if(e instanceof Bt&&ae.typeOf(e.value)===nm){var t=e.value;o(t.sections)}else e instanceof nt?o(e.sections):e.eachChild(a)},s=i.value;s._styleExpression&&a(s._styleExpression.expression)}return n},n.hasPaintOverrides=function(e){for(var t=0,i=am.paint.overridableProperties;t<i.length;t+=1){var r=i[t];if(n.hasPaintOverride(e,r))return!0}return!1},n}(rc),lm=sm,um=(rm=!0,function(e,t){var i=rm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return rm=!1,i}),cm=um(void 0,(function(){return cm.toString().search("(((.+)+)+)+$").toString().constructor(cm).search("(((.+)+)+)+$")}));cm();var hm,dm={circle:Sc,fill:Eh,line:Yh,symbol:lm},fm=(hm=!0,function(e,t){var i=hm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return hm=!1,i}),pm=fm(void 0,(function(){return pm.toString().search("(((.+)+)+)+$").toString().constructor(pm).search("(((.+)+)+)+$")}));pm();var _m=function(e){this.keyCache={},e&&this.replace(e)};_m.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},_m.prototype.update=function(e,t){for(var i,r=this,n=0,o=e;n<o.length;n+=1){var a=o[n];this._layerConfigs[a.id]=a;var s=dm[(i=a).type]?new dm[i.type](i):null;null!=s&&(this._layers[a.id]=s,s._featureFilter=Fr.createFilter(s.filter),this.keyCache[a.id]&&delete this.keyCache[a.id])}for(var l=0,u=t;l<u.length;l+=1){var c=u[l];delete this.keyCache[c],delete this._layerConfigs[c],delete this._layers[c]}this.familiesBySource={};for(var h=0,d=function(e,t){for(var i={},r=0;r<e.length;r++){var n=t&&t[e[r].id]||Kr(e[r]);t&&(t[e[r].id]=n);var o=i[n];!o&&(o=i[n]=[]),o.push(e[r])}var a=[];for(var s in i)a.push(i[s]);return a}(function(e){var t=[];for(var i in e)t.push(e[i]);return t}(this._layerConfigs),this.keyCache);h<d.length;h+=1){var f=d[h].map((function(e){return r._layers[e.id]})),p=f[0];if(null!=p&&"none"!==p.visibility){var _=p.source||"",m=this.familiesBySource[_];!m&&(m=this.familiesBySource[_]={});var $=p.sourceLayer,g=m[$];!g&&(g=m[$]=[]),g.push(f)}}};var mm,$m=(mm=!0,function(e,t){var i=mm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return mm=!1,i}),gm=$m(void 0,(function(){return gm.toString().search("(((.+)+)+)+$").toString().constructor(gm).search("(((.+)+)+)+$")}));function vm(e,t,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=n,e.readFields(ym,this,t)}function ym(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){for(var i=e.readVarint()+e.pos;e.pos<i;){var r=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[r]=n}}(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function xm(e){for(var t,i,r=0,n=0,o=e.length,a=o-1;n<o;a=n++)t=e[n],r+=((i=e[a]).x-t.x)*(t.y+i.y);return r}gm(),vm.types=["Unknown","Point","LineString","Polygon"],vm.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,r=1,n=0,o=0,a=0,s=[];e.pos<i;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}n--,1===r||2===r?(o+=e.readSVarint(),a+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new tn(o,a))):7===r?t&&t.push(t[0].clone()):console.log("VectorTileFeature loadGeometry unknown command "+r)}return t&&s.push(t),s},vm.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(r<=0){var c=e.readVarint();i=7&c,r=c>>3}if(r--,1===i||2===i)(n+=e.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=e.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,u]},vm.prototype.toGeoJSON=function(e,t,i){var r,n,o=this.extent*Math.pow(2,i),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=vm.types[this.type];function c(e){for(var t=0;t<e.length;t++){var i=e[t],r=180-360*(i.y+s)/o;e[t]=[360*(i.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<l.length;r++)h[r]=l[r][0];c(l=h);break;case 2:for(r=0;r<l.length;r++)c(l[r]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var i,r,n=[],o=0;o<t;o++){var a=xm(e[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&n.push(i),i=[e[o]]):i.push(e[o]))}return i&&n.push(i),n}(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)c(l[r][n])}1===l.length?l=l[0]:u="Multi"+u;var d={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var bm,wm=(bm=!0,function(e,t){var i=bm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return bm=!1,i}),Cm=wm(void 0,(function(){return Cm.toString().search("(((.+)+)+)+$").toString().constructor(Cm).search("(((.+)+)+)+$")}));function Tm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Sm,this,t),this.length=this._features.length}function Sm(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){for(var t=null,i=e.readVarint()+e.pos;e.pos<i;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(i))}Cm(),Tm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new vm(this._pbf,t,this.extent,this._keys,this._values)};var Em,Am=(Em=!0,function(e,t){var i=Em?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Em=!1,i}),Pm=Am(void 0,(function(){return Pm.toString().search("(((.+)+)+)+$").toString().constructor(Pm).search("(((.+)+)+)+$")}));function Im(e,t){this.layers=e.readFields(Mm,{},t)}function Mm(e,t,i){if(3===e){var r=new Tm(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}Pm();var Om,Dm=(Om=!0,function(e,t){var i=Om?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Om=!1,i}),Rm=Dm(void 0,(function(){return Rm.toString().search("(((.+)+)+)+$").toString().constructor(Rm).search("(((.+)+)+)+$")}));function Lm(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}Rm(),Lm.prototype.encode=function(e){return this._stringToNumber[e]},Lm.prototype.decode=function(e){return this._numberToString[e]};var Bm,Nm=(Bm=!0,function(e,t){var i=Bm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Bm=!1,i}),Fm=Nm(void 0,(function(){return Fm.toString().search("(((.+)+)+)+$").toString().constructor(Fm).search("(((.+)+)+)+$")}));function zm(e,t,i){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],i=n[2],this.d=t+2*i;for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];r.push(a===s?null:n.subarray(a,s))}var l=n[3+r.length],u=n[3+r.length+1];this.keys=n.subarray(l,u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=t+2*i;for(var c=0;c<this.d*this.d;c++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=i,this.scale=t/e,this.uid=0;var h=i/t*e;this.min=-h,this.max=e+h}Fm(),zm.prototype.insert=function(e,t,i,r,n){this._forEachCell(t,i,r,n,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},zm.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},zm.prototype._insertCell=function(e,t,i,r,n,o){this.cells[n].push(o)},zm.prototype.query=function(e,t,i,r,n){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,i,r,this._queryCell,s,{},n),s},zm.prototype._queryCell=function(e,t,i,r,n,o,a,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===a[d]){var f=4*d;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):e<=c[f+2]&&t<=c[f+3]&&i>=c[f+0]&&r>=c[f+1])?(a[d]=!0,o.push(u[d])):a[d]=!1}}},zm.prototype._forEachCell=function(e,t,i,r,n,o,a,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(i),h=this._convertToCellCoord(r),d=l;d<=c;d++)for(var f=u;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&n.call(this,e,t,i,r,p,o,a,s))return}},zm.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},zm.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},zm.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var n=new Int32Array(t+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=t,a=0;a<e.length;a++){var s=e[a];n[3+a]=o,n.set(s,o),o+=s.length}return n[3+e.length]=o,n.set(this.keys,o),o+=this.keys.length,n[3+e.length+1]=o,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer},pi.register("GridIndex",zm,{omit:["layers","patternFeatures"]});var km,Vm=(km=!0,function(e,t){var i=km?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return km=!1,i}),Um=Vm(void 0,(function(){return Um.toString().search("(((.+)+)+)+$").toString().constructor(Um).search("(((.+)+)+)+$")}));Um();var Xm=function(e,t,i){this.x=e.x,this.y=e.y,this.z=e.z,this.grid=t||new zm(yn,16,0),this.featureIndexArray=i||new mo};function Hm(e,t){return t-e}Xm.prototype.insert=function(e,t,i,r,n,o,a){var s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);var l=this.grid;a=a||0;for(var u=0;u<t.length;u++){for(var c=t[u],h=[1/0,1/0,-1/0,-1/0],d=0;d<c.length;d++){var f=c[d];h[0]=Math.min(h[0],f.x),h[1]=Math.min(h[1],f.y),h[2]=Math.max(h[2],f.x),h[3]=Math.max(h[3],f.y)}h[0]<yn&&h[1]<yn&&h[2]>=0&&h[3]>=0&&l.insert(s,h[0]-a,h[1]-a,h[2]+a,h[3]+a)}},Xm.prototype.loadVTLayers=function(){return!this.vtLayers&&(this.vtLayers=new Im(new Jf(this.rawTileData)).layers,this.sourceLayerCoder=new Lm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Xm.prototype.query=function(e,t,i){var r=this;this.loadVTLayers();var n=e.params||{},o=function(e,t,i){if(To(i)&&i.realtime&&To(i.zoom)){var r=i.zoom-e,n=yn/(t*Math.pow(2,r));return n*=t/512}return yn/t}(this.z,e.tileSize,n),a=Fr.createFilter(n.filter),s=e.queryGeometry,l=5,u=function(e){for(var t=1/0,i=1/0,r=-1/0,n=-1/0,o=0,a=e;o<a.length;o+=1){var s=a[o];t=Math.min(t,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y)}return{minX:t,minY:i,maxX:r,maxY:n}}(s),c=[];To(n.selectTolerance)&&(l+=o*n.selectTolerance),(c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l)).sort(Hm);for(var h,d={},f=function(i){var l=c[i];if(l!==h){h=l;var u=r.featureIndexArray.get(l),f=null;r.loadMatchingFeature(d,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,a,n.layers,t,(function(t,i){return!f&&(f=wn(t)),i.queryIntersectsFeature(s,t,{},f,r.z,e.transform,o,e.pixelPosMatrix,e.adjustScale)}))}},p=0;p<c.length;p++)f(p);return d},Xm.prototype.loadMatchingFeature=function(e,t,i,r,n,o,a,s){if(To(t)&&To(i)&&To(r)){var l=this.bucketLayerIDs[t];if(!o||function(e,t){for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>=0)return!0;return!1}(o,l)){var u=this.sourceLayerCoder.decode(i),c=this.vtLayers[u].feature(r);if(n(new mn(this.z),c))for(var h=0;h<l.length;h++){var d=l[h];if(!(o&&o.indexOf(d)<0)){var f=a[d];if(f){var p=!s||s(c,f);if(p){c.layer=f.serialize();var _=e[d];void 0===_&&(_=e[d]=[]),_.push({featureIndex:r,feature:c,intersectionZ:p})}}}}}}},Xm.prototype.lookupSymbolFeatures=function(e,t,i,r,n,o){var a={};this.loadVTLayers();for(var s=createFilter(r),l=0,u=e;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(a,t,i,c,s,n,o)}return a},Xm.prototype.hasLayer=function(e){for(var t=0,i=this.bucketLayerIDs;t<i.length;t+=1)for(var r=0,n=i[t];r<n.length;r+=1)if(e===n[r])return!0;return!1},pi.register("FeatureIndex",Xm,{omit:["rawTileData","sourceLayerCoder","vtLayers"]});var Gm,Wm=(Gm=!0,function(e,t){var i=Gm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return Gm=!1,i}),Ym=Wm(void 0,(function(){return Ym.toString().search("(((.+)+)+)+$").toString().constructor(Ym).search("(((.+)+)+)+$")}));Ym();var qm=function(e){var t={},i=[];for(var r in e){var n=e[r],o=t[r]={};for(var a in n){var s=n[+a];if(s&&0!==s.bitmap.width&&0!==s.bitmap.height){var l={x:0,y:0,w:s.bitmap.width+2,h:s.bitmap.height+2};i.push(l),o[a]={rect:l,metrics:s.metrics}}}}var u=h(i),c=u.w,d=u.h,f=new qf({width:c||1,height:d||1});for(var p in e){var _=e[p];for(var m in _){var $=_[+m];if($&&0!==$.bitmap.width&&0!==$.bitmap.height){var g=t[p][m].rect;qf.copy($.bitmap,f,{x:0,y:0},{x:g.x+1,y:g.y+1},$.bitmap)}}}this.image=f,this.positions=t};pi.register("GlyphAtlas",qm);var jm,Zm=(jm=!0,function(e,t){var i=jm?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return jm=!1,i}),Km=Zm(void 0,(function(){return Km.toString().search("(((.+)+)+)+$").toString().constructor(Km).search("(((.+)+)+)+$")}));function Qm(e){this.uid=e.uid,this.source=e.source,this.showCollisionBoxes=!1,this.zoom=e.tileID.z}function Jm(e,t,i){for(var r=new mn(t),n=0,o=e;n<o.length;n+=1)o[n].recalculate(r,i)}Km(),pi.register("FeatureIndex",Xm,{omit:["rawTileData","sourceLayerCoder"]}),Qm.prototype.parse=function(e,t,i,r,n,o){try{this.status="parsing",this.data=t,this.collisionBoxArray=new oo,this.tileID=e.tileID;var a=e.featureIndex;!To(a)&&((a=new Xm(e.tileID)).bucketLayerIDs=[]);var s={},l=new Lm(Object.keys(t.layers).sort()),u={},c={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r};for(var h in i.familiesBySource){var d=i.familiesBySource[h];for(var f in d){var p=t.layers[f];if(p){for(var m=l.encode(f),$=[],g=0;g<p.length;g++){var v=p.feature(g);$.push({feature:v,index:g,sourceLayerIndex:m,sourceLayerId:f})}for(var y=0,x=d[f];y<x.length;y+=1){var b=x[y],w=b[0];if(!(w.minzoom&&this.zoom<Math.floor(w.minzoom)||w.maxzoom&&this.zoom>=w.maxzoom||"none"===w.visibility)){Jm(b,0,r);var C=w.id,T=u[C]=w.createBucket({index:a.bucketLayerIDs.length,layers:b,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:m,webgpu:e.webgpu});To(e.indexData)&&To(e.indexData[w.id])&&(c.indexData=e.indexData[w.id]),T.populate($,c),a.bucketLayerIDs.push(b.map((function(e){return e.id})))}}}}}let S,E,A,P;const I=gu(c.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(I).length?n.send("getGlyphs",{uid:0,stacks:I},((e,t)=>{!S&&(S=e,E=t,D.call(this))})):E={};const M=Object.keys(c.iconDependencies);M.length?n.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{!S&&(S=e,A=t,D.call(this))})):A={};const O=Object.keys(c.patternDependencies);function D(){if(S)return o(S);if(E&&A&&P){const r=new qm(E),n=new _(A,P);for(var t in u){var i=u[t];i instanceof J_?(i.layers[0].layout,O_(i,E,r.positions,A,n.iconPositions,this.showCollisionBoxes)):i.hasPattern&&(i instanceof Rh||i instanceof bh)&&i.addFeatures(c,n.patternPositions)}s.buckets=u,s.imageAtlas=n,s.glyphAtlasImage=r.image,s.featureIndex=a,s.pickId=e.pickId,this.status="done",o(null,s)}}O.length?n.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{!S&&(S=e,P=t,D.call(this))})):P={},D.call(this)}catch(R){console.log(R)}};const e$=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),t$=e$(void 0,(function(){return t$.toString().search("(((.+)+)+)+$").toString().constructor(t$).search("(((.+)+)+)+$")}));function i$(e,t){const i=(r=e.request,n=(e,i,r,n)=>{e?t(e):i&&t(null,{vectorTile:new Im(new Jf(i)),rawData:i,cacheControl:r,expires:n})},Mf(mu(r,{type:"arrayBuffer"}),n));var r,n;return()=>{i.cancel(),t()}}t$();class r${constructor(e,t,i,r){this.actor=e,this.layerIndex=t,this.availableImages=i,this.loadVectorData=r||i$,this.loading={},this.loaded={}}loadTile(e,t){const i=e.uid;this.loading||(this.loading={});const r=this.loading[i]=new Qm(e);r.abort=this.loadVectorData(e,((n,o)=>{if(delete this.loading[i],n||!o)return r.status="done",this.loaded[i]=r,t(n);const a=o.rawData,s={};o.expires&&(s.expires=o.expires),o.cacheControl&&(s.cacheControl=o.cacheControl);const l={};r.vectorTile=o.vectorTile,r.parse(e,o.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,i)=>{if(e||!i)return t(e);t(null,mu({rawTileData:a.slice(0)},i,s,l))})),this.loaded=this.loaded||{},this.loaded[i]=r}))}reloadTile(e,t){const i=this.loaded,r=e.uid,n=this;if(i&&i[r]){const o=i[r];o.showCollisionBoxes=e.showCollisionBoxes;const a=(i,r)=>{const a=o.reloadCallback;a&&(delete o.reloadCallback,o.parse(e,o.vectorTile,n.layerIndex,this.availableImages,n.actor,a)),t(i,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(e,o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(e,t){const i=this.loading,r=e.uid;i&&i[r]&&i[r].abort&&(i[r].abort(),delete i[r]),t()}removeTile(e,t){const i=this.loaded,r=e.uid;i&&i[r]&&delete i[r],t()}}const n$=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),o$=n$(void 0,(function(){return o$.toString().search("(((.+)+)+)+$").toString().constructor(o$).search("(((.+)+)+)+$")}));o$(),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new class{constructor(e){this.self=e,this.actor=new Ci(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:r$},this.workerSources={},this.demWorkerSources={}}setReferrer(e,t){this.referrer=t}setImages(e,t,i){this.availableImages[e]=t,i()}setLayers(e,t,i){this.getLayerIndex(e).replace(t),i()}updateLayers(e,t,i){this.getLayerIndex(e).update(t.layers,t.removedIds),i()}loadTile(e,t,i){this.getWorkerSource(e,t.type,t.source).loadTile(t,i)}reloadTile(e,t,i){this.getWorkerSource(e,t.type,t.source).reloadTile(t,i)}abortTile(e,t,i){this.getWorkerSource(e,t.type,t.source).abortTile(t,i)}removeTile(e,t,i){this.getWorkerSource(e,t.type,t.source).removeTile(t,i)}removeSource(e,t,i){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const r=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,i):i()}loadWorkerSource(e,t,i){try{this.self.importScripts(t.url),i()}catch(e){i(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return!t&&(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return!t&&(t=this.layerIndexes[e]=new _m),t}getWorkerSource(e,t,i){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][i]){const r={send:(t,i,r)=>{this.actor.send(t,i,r,e)}};this.workerSources[e][t][i]=new this.workerSourceTypes[t](r,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][i]}enforceCacheSizeLimit(e,t){var i;i=t,window.caches&&window.caches.open(xf).then((e=>{e.keys().then((t=>{for(let r=0;r<t.length-i;r++)e.delete(t[r])}))}))}}(self))},t="("+e+")()",window.mvtWorkerUrl=window.URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},"function"==typeof define&&define.amd?define(factory):factory(),e$28(Object.create)&&(t$Z.prototype=Object.create(Error.prototype),t$Z.prototype.constructor=t$Z),t$Z.prototype.toString=function(){var e=this.name+": "+this.message;return e$28(this.stack)&&(e+="\n"+this.stack.toString()),e},t$Z.throwInstantiationError=function(){throw new t$Z("This function defines an interface and should not be called directly.")};var o$1u={};function p$1c(e){return e+" is required, actual value was undefined"}function t$Y(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}function u$Y(e,t){return e??t}o$1u.typeOf={},o$1u.defined=function(e,t){if(!e$28(t))throw new t$Z(p$1c(e))},o$1u.typeOf.func=function(e,t){if("function"!=typeof t)throw new t$Z(t$Y(typeof t,"function",e))},o$1u.typeOf.string=function(e,t){if("string"!=typeof t)throw new t$Z(t$Y(typeof t,"string",e))},o$1u.typeOf.number=function(e,t){if("number"!=typeof t)throw new t$Z(t$Y(typeof t,"number",e))},o$1u.typeOf.number.lessThan=function(e,t,i){if(o$1u.typeOf.number(e,t),t>=i)throw new t$Z("Expected "+e+" to be less than "+i+", actual value was "+t)},o$1u.typeOf.number.lessThanOrEquals=function(e,t,i){if(o$1u.typeOf.number(e,t),t>i)throw new t$Z("Expected "+e+" to be less than or equal to "+i+", actual value was "+t)},o$1u.typeOf.number.greaterThan=function(e,t,i){if(o$1u.typeOf.number(e,t),t<=i)throw new t$Z("Expected "+e+" to be greater than "+i+", actual value was "+t)},o$1u.typeOf.number.greaterThanOrEquals=function(e,t,i){if(o$1u.typeOf.number(e,t),t<i)throw new t$Z("Expected "+e+" to be greater than or equal to"+i+", actual value was "+t)},o$1u.typeOf.object=function(e,t){if("object"!=typeof t)throw new t$Z(t$Y(typeof t,"object",e))},o$1u.typeOf.bool=function(e,t){if("boolean"!=typeof t)throw new t$Z(t$Y(typeof t,"boolean",e))},o$1u.typeOf.number.equals=function(e,t,i,r){if(o$1u.typeOf.number(e,i),o$1u.typeOf.number(t,r),i!==r)throw new t$Z(e+" must be equal to "+t+", the actual values are "+i+" and "+r)},u$Y.EMPTY_OBJECT=Object.freeze({});var s$$=function(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)};s$$.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},s$$.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},s$$.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var e$27={Radius:6378137,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};e$27.sign=u$Y(Math.sign,(function(e){return 0===(e=+e)||e!=e?e:e>0?1:-1})),e$27.signNotZero=function(e){return e<0?-1:1},e$27.toSNorm=function(e,t){return t=u$Y(t,255),Math.round((.5*e$27.clamp(e,-1,1)+.5)*t)},e$27.fromSNorm=function(e,t){return t=u$Y(t,255),e$27.clamp(e,0,t)/t*2-1},e$27.normalize=function(e,t,i){return 0===(i=Math.max(i-t,0))?0:e$27.clamp((e-t)/i,0,1)},e$27.sinh=u$Y(Math.sinh,(function(e){return(Math.exp(e)-Math.exp(-e))/2})),e$27.cosh=u$Y(Math.cosh,(function(e){return(Math.exp(e)+Math.exp(-e))/2})),e$27.lerp=function(e,t,i){return(1-i)*e+i*t},e$27.PI=Math.PI,e$27.ONE_OVER_PI=1/Math.PI,e$27.PI_OVER_TWO=Math.PI/2,e$27.PI_OVER_THREE=Math.PI/3,e$27.PI_OVER_FOUR=Math.PI/4,e$27.PI_OVER_SIX=Math.PI/6,e$27.THREE_PI_OVER_TWO=3*Math.PI/2,e$27.TWO_PI=2*Math.PI,e$27.ONE_OVER_TWO_PI=1/(2*Math.PI),e$27.RADIANS_PER_DEGREE=Math.PI/180,e$27.DEGREES_PER_RADIAN=180/Math.PI,e$27.RADIANS_PER_ARCSECOND=e$27.RADIANS_PER_DEGREE/3600,e$27.toRadians=function(e){if(!e$28(e))throw new t$Z("degrees is required.");return e*e$27.RADIANS_PER_DEGREE},e$27.toDegrees=function(e){if(!e$28(e))throw new t$Z("radians is required.");return e*e$27.DEGREES_PER_RADIAN},e$27.convertLongitudeRange=function(e){if(!e$28(e))throw new t$Z("angle is required.");var t=e$27.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},e$27.clampToLatitudeRange=function(e){if(!e$28(e))throw new t$Z("angle is required.");return e$27.clamp(e,-1*e$27.PI_OVER_TWO,e$27.PI_OVER_TWO)},e$27.negativePiToPi=function(e){if(!e$28(e))throw new t$Z("angle is required.");return e$27.zeroToTwoPi(e+e$27.PI)-e$27.PI},e$27.zeroToTwoPi=function(e){if(!e$28(e))throw new t$Z("angle is required.");var t=e$27.mod(e,e$27.TWO_PI);return Math.abs(t)<e$27.EPSILON14&&Math.abs(e)>e$27.EPSILON14?e$27.TWO_PI:t},e$27.mod=function(e,t){if(!e$28(e))throw new t$Z("m is required.");if(!e$28(t))throw new t$Z("n is required.");return(e%t+t)%t},e$27.equalsEpsilon=function(e,t,i,r){if(!e$28(e))throw new t$Z("left is required.");if(!e$28(t))throw new t$Z("right is required.");if(!e$28(i))throw new t$Z("relativeEpsilon is required.");r=u$Y(r,i);var n=Math.abs(e-t);return n<=r||n<=i*Math.max(Math.abs(e),Math.abs(t))},e$27.lessThan=function(e,t,i){if(!e$28(e))throw new t$Z("first is required.");if(!e$28(t))throw new t$Z("second is required.");if(!e$28(i))throw new t$Z("relativeEpsilon is required.");return e-t<-i},e$27.lessThanOrEquals=function(e,t,i){if(!e$28(e))throw new t$Z("first is required.");if(!e$28(t))throw new t$Z("second is required.");if(!e$28(i))throw new t$Z("relativeEpsilon is required.");return e-t<i},e$27.greaterThan=function(e,t,i){if(!e$28(e))throw new t$Z("first is required.");if(!e$28(t))throw new t$Z("second is required.");if(!e$28(i))throw new t$Z("relativeEpsilon is required.");return e-t>i},e$27.greaterThanOrEquals=function(e,t,i){if(!e$28(e))throw new t$Z("first is required.");if(!e$28(t))throw new t$Z("second is required.");if(!e$28(i))throw new t$Z("relativeEpsilon is required.");return e-t>-i};var h$12=[1];e$27.factorial=function(e){if("number"!=typeof e||e<0)throw new t$Z("A number greater than or equal to 0 is required.");var t=h$12.length;if(e>=t)for(var i=h$12[t-1],r=t;r<=e;r++){var n=i*r;h$12.push(n),i=n}return h$12[e]},e$27.incrementWrap=function(e,t,i){if(i=u$Y(i,0),!e$28(e))throw new t$Z("n is required.");if(t<=i)throw new t$Z("maximumValue must be greater than minimumValue.");return++e>t&&(e=i),e},e$27.isPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new t$Z("A number greater than or equal to 0 is required.");return 0!==e&&0==(e&e-1)},e$27.nextPowerOfTwo=function(e){if("number"!=typeof e||e<0)throw new t$Z("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},e$27.clamp=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("min is required.");if(!e$28(i))throw new t$Z("max is required.");return e<t?t:e>i?i:e};var I$1y=new s$$;function t$X(e,t,i){this.x=u$Y(e,0),this.y=u$Y(t,0),this.z=u$Y(i,0)}e$27.setRandomNumberSeed=function(e){if(!e$28(e))throw new t$Z("seed is required.");I$1y=new s$$(e)},e$27.nextRandomNumber=function(){return I$1y.random()},e$27.randomBetween=function(e,t){return e$27.nextRandomNumber()*(t-e)+e},e$27.acosClamped=function(e){if(!e$28(e))throw new t$Z("value is required.");return Math.acos(e$27.clamp(e,-1,1))},e$27.asinClamped=function(e){if(!e$28(e))throw new t$Z("value is required.");return Math.asin(e$27.clamp(e,-1,1))},e$27.chordLength=function(e,t){if(!e$28(e))throw new t$Z("angle is required.");if(!e$28(t))throw new t$Z("radius is required.");return 2*t*Math.sin(.5*e)},e$27.logBase=function(e,t){if(!e$28(e))throw new t$Z("number is required.");if(!e$28(t))throw new t$Z("base is required.");return Math.log(e)/Math.log(t)},e$27.cbrt=u$Y(Math.cbrt,(function(e){var t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t})),e$27.log2=u$Y(Math.log2,(function(e){return Math.log(e)*Math.LOG2E})),e$27.fog=function(e,t){var i=e*t;return 1-Math.exp(-i*i)},e$27.fastApproximateAtan=function(e){return o$1u.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)},e$27.fastApproximateAtan2=function(e,t){o$1u.typeOf.number("x",e),o$1u.typeOf.number("y",t);var i,r,n=Math.abs(e);i=Math.abs(t),r=Math.max(n,i);var o=(i=Math.min(n,i))/r;if(isNaN(o))throw new t$Z("either x or y must be nonzero");return n=e$27.fastApproximateAtan(o),n=Math.abs(t)>Math.abs(e)?e$27.PI_OVER_TWO-n:n,n=e<0?e$27.PI-n:n,n=t<0?-n:n},t$X.fromSpherical=function(e,t){o$1u.typeOf.object("spherical",e),e$28(t)||(t=new t$X);var i=e.clock,r=e.cone,n=u$Y(e.magnitude,1),o=n*Math.sin(r);return t.x=o*Math.cos(i),t.y=o*Math.sin(i),t.z=n*Math.cos(r),t},t$X.fromElements=function(e,t,i,r){return e$28(r)?(r.x=e,r.y=t,r.z=i,r):new t$X(e,t,i)},t$X.clone=function(e,t){if(e$28(e))return e$28(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new t$X(e.x,e.y,e.z)},t$X.fromCartesian4=t$X.clone,t$X.packedLength=3,t$X.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},t$X.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new t$X),i.x=e[t++],i.y=e[t++],i.z=e[t],i},t$X.packArray=function(e,t){o$1u.defined("array",e);var i=e.length;e$28(t)?t.length=3*i:t=new Array(3*i);for(var r=0;r<i;++r)t$X.pack(e[r],t,3*r);return t},t$X.unpackArray=function(e,t){if(o$1u.defined("array",e),o$1u.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!=0)throw new t$Z("array length must be a multiple of 3.");var i=e.length;e$28(t)?t.length=i/3:t=new Array(i/3);for(var r=0;r<i;r+=3){var n=r/3;t[n]=t$X.unpack(e,r,t[n])}return t},t$X.fromArray=t$X.unpack,t$X.maximumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)},t$X.minimumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)},t$X.minimumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},t$X.maximumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},t$X.magnitudeSquared=function(e){return o$1u.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z},t$X.magnitude=function(e){return Math.sqrt(t$X.magnitudeSquared(e))};var j$1g=new t$X;t$X.distance=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),t$X.subtract(e,t,j$1g),t$X.magnitude(j$1g)},t$X.distanceSquared=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),t$X.subtract(e,t,j$1g),t$X.magnitudeSquared(j$1g)},t$X.normalize=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=t$X.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new t$Z("normalized result is not a number");return t},t$X.dot=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z},t$X.multiplyComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},t$X.divideComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},t$X.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},t$X.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},t$X.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},t$X.divideByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},t$X.negate=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t},t$X.abs=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var d$1i=new t$X;t$X.lerp=function(e,t,i,r){return o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r),t$X.multiplyByScalar(t,i,d$1i),r=t$X.multiplyByScalar(e,1-i,r),t$X.add(d$1i,r,r)};var v$T=new t$X,x$1l=new t$X;t$X.angleBetween=function(e,t){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),t$X.normalize(e,v$T),t$X.normalize(t,x$1l);var i=t$X.dot(v$T,x$1l),r=t$X.magnitude(t$X.cross(v$T,x$1l,v$T));return Math.atan2(r,i)};var q$1g=new t$X;t$X.mostOrthogonalAxis=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=t$X.normalize(e,q$1g);return t$X.abs(i,i),t=i.x<=i.y?i.x<=i.z?t$X.clone(t$X.UNIT_X,t):t$X.clone(t$X.UNIT_Z,t):i.y<=i.z?t$X.clone(t$X.UNIT_Y,t):t$X.clone(t$X.UNIT_Z,t)},t$X.projectVector=function(e,t,i){o$1u.defined("a",e),o$1u.defined("b",t),o$1u.defined("result",i);var r=t$X.dot(e,t)/t$X.dot(t,t);return t$X.multiplyByScalar(t,r,i)},t$X.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},t$X.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},t$X.equalsEpsilon=function(e,t,i,r){return e===t||e$28(e)&&e$28(t)&&e$27.equalsEpsilon(e.x,t.x,i,r)&&e$27.equalsEpsilon(e.y,t.y,i,r)&&e$27.equalsEpsilon(e.z,t.z,i,r)},t$X.cross=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},t$X.midpoint=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=.5*(e.x+t.x),i.y=.5*(e.y+t.y),i.z=.5*(e.z+t.z),i},t$X.fromDegrees=function(e,t,i,r,n){return o$1u.typeOf.number("longitude",e),o$1u.typeOf.number("latitude",t),e=e$27.toRadians(e),t=e$27.toRadians(t),t$X.fromRadians(e,t,i,r,n)};var b$1i=new t$X,u$X=new t$X,M$1f=new t$X(40680631590769,40680631590769,40408299984661.445),A$1k=new t$X(40680631590769,40680631590769,40680631590769);t$X.fromRadians=function(e,t,i,r,n){o$1u.typeOf.number("longitude",e),o$1u.typeOf.number("latitude",t),i=u$Y(i,0);var o=e$28(r)?r.radiiSquared:A$1k;e$27.equalsEpsilon(e$27.Radius,6356752.314245179,e$27.EPSILON10)&&(o=e$28(r)?r.radiiSquared:M$1f);var a=Math.cos(t);b$1i.x=a*Math.cos(e),b$1i.y=a*Math.sin(e),b$1i.z=Math.sin(t),b$1i=t$X.normalize(b$1i,b$1i),t$X.multiplyComponents(o,b$1i,u$X);var s=Math.sqrt(t$X.dot(b$1i,u$X));return u$X=t$X.divideByScalar(u$X,s,u$X),b$1i=t$X.multiplyByScalar(b$1i,i,b$1i),e$28(n)||(n=new t$X),t$X.add(u$X,b$1i,n)},t$X.fromDegreesArray=function(e,t,i){if(o$1u.defined("coordinates",e),e.length<2||e.length%2!=0)throw new t$Z("the number of coordinates must be a multiple of 2 and at least 2");var r=e.length;e$28(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var o=e[n],a=e[n+1],s=n/2;i[s]=t$X.fromDegrees(o,a,0,t,i[s])}return i},t$X.fromRadiansArray=function(e,t,i){if(o$1u.defined("coordinates",e),e.length<2||e.length%2!=0)throw new t$Z("the number of coordinates must be a multiple of 2 and at least 2");var r=e.length;e$28(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var o=e[n],a=e[n+1],s=n/2;i[s]=t$X.fromRadians(o,a,0,t,i[s])}return i},t$X.fromDegreesArrayHeights=function(e,t,i){if(o$1u.defined("coordinates",e),e.length<3||e.length%3!=0)throw new t$Z("the number of coordinates must be a multiple of 3 and at least 3");var r=e.length;e$28(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var o=e[n],a=e[n+1],s=e[n+2],l=n/3;i[l]=t$X.fromDegrees(o,a,s,t,i[l])}return i},t$X.fromRadiansArrayHeights=function(e,t,i){if(o$1u.defined("coordinates",e),e.length<3||e.length%3!=0)throw new t$Z("the number of coordinates must be a multiple of 3 and at least 3");var r=e.length;e$28(i)?i.length=r/3:i=new Array(r/3);for(var n=0;n<r;n+=3){var o=e[n],a=e[n+1],s=e[n+2],l=n/3;i[l]=t$X.fromRadians(o,a,s,t,i[l])}return i},t$X.ZERO=Object.freeze(new t$X(0,0,0)),t$X.UNIT_X=Object.freeze(new t$X(1,0,0)),t$X.UNIT_Y=Object.freeze(new t$X(0,1,0)),t$X.UNIT_Z=Object.freeze(new t$X(0,0,1)),t$X.UNIT_XYZ=Object.freeze(new t$X(1,1,1)),t$X.prototype.clone=function(e){return t$X.clone(this,e)},t$X.prototype.equals=function(e){return t$X.equals(this,e)},t$X.prototype.equalsEpsilon=function(e,t,i){return t$X.equalsEpsilon(this,e,t,i)},t$X.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},t$X.globalOffset=new t$X(0,0,0);var F$1n=new t$X,L$1n=new t$X;function P$1f(e,t,i,r,n){if(!e$28(e))throw new t$Z("cartesian is required.");if(!e$28(t))throw new t$Z("oneOverRadii is required.");if(!e$28(i))throw new t$Z("oneOverRadiiSquared is required.");if(!e$28(r))throw new t$Z("centerToleranceSquared is required.");var o=e.x,a=e.y,s=e.z,l=t.x,u=t.y,c=t.z,h=o*o*l*l,d=a*a*u*u,f=s*s*c*c,p=h+d+f,_=Math.sqrt(1/p),m=t$X.multiplyByScalar(e,_,F$1n);if(p<r)return isFinite(_)?t$X.clone(m,n):void 0;var $=i.x,g=i.y,v=i.z,y=L$1n;y.x=m.x*$*2,y.y=m.y*g*2,y.z=m.z*v*2;var x,b,w,C,T,S,E,A=(1-_)*t$X.magnitude(e)/(.5*t$X.magnitude(y)),P=0;do{P=(x=h*(T=(b=1/(1+(A-=P)*$))*b)+d*(S=(w=1/(1+A*g))*w)+f*(E=(C=1/(1+A*v))*C)-1)/(-2*(h*(T*b)*$+d*(S*w)*g+f*(E*C)*v))}while(Math.abs(x)>e$27.EPSILON12);return e$28(n)?(n.x=o*b,n.y=a*w,n.z=s*C,n):new t$X(o*b,a*w,s*C)}function t$W(e,t,i){this.longitude=u$Y(e,0),this.latitude=u$Y(t,0),this.height=u$Y(i,0)}t$W.fromRadians=function(e,t,i,r){return o$1u.typeOf.number("longitude",e),o$1u.typeOf.number("latitude",t),i=u$Y(i,0),e$28(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new t$W(e,t,i)},t$W.fromDegrees=function(e,t,i,r){return o$1u.typeOf.number("longitude",e),o$1u.typeOf.number("latitude",t),e=e$27.toRadians(e),t=e$27.toRadians(t),t$W.fromRadians(e,t,i,r)};var g$17=new t$X,p$1b=new t$X,S$11=new t$X,b$1h=new t$X(1/6378137,1/6378137,1/6356752.314245179),y$17=new t$X(1/6378137,1/6378137,1/6378137),C$16=new t$X(1/40680631590769,1/40680631590769,1/40408299984661.445),E$1m=new t$X(1/40680631590769,1/40680631590769,1/40680631590769),M$1e=e$27.EPSILON1;function _$18(e,t,i,r){t=u$Y(t,0),i=u$Y(i,0),r=u$Y(r,0),o$1u.typeOf.number.greaterThanOrEquals("x",t,0),o$1u.typeOf.number.greaterThanOrEquals("y",i,0),o$1u.typeOf.number.greaterThanOrEquals("z",r,0),e$27.equalsEpsilon(r,6356752.314245179,e$27.EPSILON10)&&(e$27.Radius=r),e._radii=new t$X(t,i,r),e._radiiSquared=new t$X(t*t,i*i,r*r),e._radiiToTheFourth=new t$X(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new t$X(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new t$X(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=e$27.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function t$V(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,_$18(this,e,t,i)}t$W.fromCartesian=function(e,t,i){var r=e$28(t)?t.oneOverRadii:y$17,n=e$28(t)?t.oneOverRadiiSquared:E$1m,o=e$28(t)?t._centerToleranceSquared:M$1e;e$27.equalsEpsilon(e$27.Radius,6356752.314245179,e$27.EPSILON10)&&(r=e$28(t)?t.oneOverRadii:b$1h,n=e$28(t)?t.oneOverRadiiSquared:C$16);var a=P$1f(e,r,n,o,p$1b);if(e$28(a)){var s=t$X.multiplyComponents(a,n,g$17);s=t$X.normalize(s,s);var l=t$X.subtract(e,a,S$11),u=Math.atan2(s.y,s.x),c=Math.asin(s.z),h=e$27.sign(t$X.dot(l,e))*t$X.magnitude(l);return e$28(i)?(i.longitude=u,i.latitude=c,i.height=h,i):new t$W(u,c,h)}},t$W.toCartesian=function(e,t,i){return o$1u.defined("cartographic",e),t$X.fromRadians(e.longitude,e.latitude,e.height,t,i)},t$W.sphericalDistance=function(e,t,i,r){if(o$1u.defined("longitudeA",e),o$1u.defined("longitudeB",i),o$1u.defined("latitudeA",t),o$1u.defined("latitudeB",r),e===i&&t===r)return 0;var n=e$27.toRadians(t),o=e$27.toRadians(r),a=e$27.toRadians(e),s=e$27.toRadians(i),l=a*a+n*n,u=s*s+o*o,c=(l+u-((a-s)*(a-s)+(n-o)*(n-o)))/(2*Math.sqrt(l)*Math.sqrt(u));return c=e$27.clamp(c,-1,1),Math.acos(c)*e$27.Radius},t$W.clone=function(e,t){if(e$28(e))return e$28(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new t$W(e.longitude,e.latitude,e.height)},t$W.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},t$W.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},t$W.ZERO=Object.freeze(new t$W(0,0,0)),t$W.prototype.clone=function(e){return t$W.clone(this,e)},t$W.prototype.equals=function(e){return t$W.equals(this,e)},t$W.prototype.equalsEpsilon=function(e,t){return t$W.equalsEpsilon(this,e,t)},t$W.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(t$V.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}}}),t$V.clone=function(e,t){if(e$28(e)){var i=e._radii;return e$28(t)?(t$X.clone(i,t._radii),t$X.clone(e._radiiSquared,t._radiiSquared),t$X.clone(e._radiiToTheFourth,t._radiiToTheFourth),t$X.clone(e._oneOverRadii,t._oneOverRadii),t$X.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new t$V(i.x,i.y,i.z)}},t$V.fromCartesian3=function(e,t){return e$28(t)||(t=new t$V),e$28(e)&&_$18(t,e.x,e.y,e.z),t},t$V.WGS84=Object.freeze(new t$V(6378137,6378137,e$27.Radius)),t$V.XIAN80=Object.freeze(new t$V(6378140,6378140,6356755.29)),t$V.CGCS2000=Object.freeze(new t$V(6378137,6378137,6356752.31)),t$V.UNIT_SPHERE=Object.freeze(new t$V(1,1,1)),t$V.MOON=Object.freeze(new t$V(e$27.LUNAR_RADIUS,e$27.LUNAR_RADIUS,e$27.LUNAR_RADIUS)),t$V.prototype.clone=function(e){return t$V.clone(this,e)},t$V.packedLength=t$X.packedLength,t$V.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t$X.pack(e._radii,t,i),t},t$V.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=t$X.unpack(e,t);return t$V.fromCartesian3(r,i)},t$V.prototype.geocentricSurfaceNormal=t$X.normalize,t$V.prototype.geodeticSurfaceNormalCartographic=function(e,t){o$1u.typeOf.object("cartographic",e);var i=e.longitude,r=e.latitude,n=Math.cos(r),o=n*Math.cos(i),a=n*Math.sin(i),s=Math.sin(r);return e$28(t)||(t=new t$X),t.x=o,t.y=a,t.z=s,t$X.normalize(t,t)},t$V.prototype.geodeticSurfaceNormal=function(e,t){return e$28(t)||(t=new t$X),t=t$X.multiplyComponents(e,this._oneOverRadiiSquared,t),t$X.normalize(t,t)};var g$16=new t$X,q$1f=new t$X;t$V.prototype.cartographicToCartesian=function(e,t){var i=g$16,r=q$1f;this.geodeticSurfaceNormalCartographic(e,i),t$X.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(t$X.dot(i,r));return t$X.divideByScalar(r,n,r),t$X.multiplyByScalar(i,e.height,i),e$28(t)||(t=new t$X),t$X.add(r,i,t)},t$V.prototype.cartographicArrayToCartesianArray=function(e,t){o$1u.defined("cartographics",e);var i=e.length;e$28(t)?t.length=i:t=new Array(i);for(var r=0;r<i;r++)t[r]=this.cartographicToCartesian(e[r],t[r]);return t};var R$10=new t$X,T$16=new t$X,y$16=new t$X;function n$1b(e){this._ellipsoid=u$Y(e,t$V.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}t$V.prototype.cartesianToCartographic=function(e,t){var i=this.scaleToGeodeticSurface(e,T$16);if(e$28(i)){var r=this.geodeticSurfaceNormal(i,R$10),n=t$X.subtract(e,i,y$16),o=Math.atan2(r.y,r.x),a=Math.asin(r.z),s=e$27.sign(t$X.dot(n,e))*t$X.magnitude(n);return e$28(t)?(t.longitude=o,t.latitude=a,t.height=s,t):new t$W(o,a,s)}},t$V.prototype.cartesianArrayToCartographicArray=function(e,t){o$1u.defined("cartesians",e);var i=e.length;e$28(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.cartesianToCartographic(e[r],t[r]);return t},t$V.prototype.scaleToGeodeticSurface=function(e,t){return P$1f(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},t$V.prototype.scaleToGeocentricSurface=function(e,t){o$1u.typeOf.object("cartesian",e),e$28(t)||(t=new t$X);var i=e.x,r=e.y,n=e.z,o=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*o.x+r*r*o.y+n*n*o.z);return t$X.multiplyByScalar(e,a,t)},t$V.prototype.transformPositionToScaledSpace=function(e,t){return e$28(t)||(t=new t$X),t$X.multiplyComponents(e,this._oneOverRadii,t)},t$V.prototype.transformPositionFromScaledSpace=function(e,t){return e$28(t)||(t=new t$X),t$X.multiplyComponents(e,this._radii,t)},t$V.prototype.equals=function(e){return this===e||e$28(e)&&t$X.equals(this._radii,e._radii)},t$V.prototype.toString=function(){return this._radii.toString()},t$V.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,i){if(o$1u.typeOf.object("position",e),!e$27.equalsEpsilon(this._radii.x,this._radii.y,e$27.EPSILON15))throw new t$Z("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");o$1u.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=u$Y(t,0);var r=this._squaredXOverSquaredZ;if(e$28(i)||(i=new t$X),i.x=0,i.y=0,i.z=e.z*(1-r),!(Math.abs(i.z)>=this._radii.z-t))return i},Object.defineProperties(n$1b.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),n$1b.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,n=e.latitude*i,o=e.height;return e$28(t)?(t.x=r,t.y=n,t.z=o,t):new t$X(r,n,o)},n$1b.prototype.unproject=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required");var i=this._oneOverSemimajorAxis,r=e.x*i,n=e.y*i,o=e.z;return e$28(t)?(t.longitude=r,t.latitude=n,t.height=o,t):new t$W(r,n,o)};var e$26={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},pt$a=Object.freeze(e$26);function o$1t(e,t){this.start=u$Y(e,0),this.stop=u$Y(t,0)}function p$1a(e,t,i,r,n,o,a,s,l){this[0]=u$Y(e,0),this[1]=u$Y(r,0),this[2]=u$Y(a,0),this[3]=u$Y(t,0),this[4]=u$Y(n,0),this[5]=u$Y(s,0),this[6]=u$Y(i,0),this[7]=u$Y(o,0),this[8]=u$Y(l,0)}p$1a.packedLength=9,p$1a.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},p$1a.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new p$1a),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},p$1a.clone=function(e,t){if(e$28(e))return e$28(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new p$1a(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},p$1a.fromArray=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new p$1a),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},p$1a.fromColumnMajorArray=function(e,t){return o$1u.defined("values",e),p$1a.clone(e,t)},p$1a.fromRowMajorArray=function(e,t){return o$1u.defined("values",e),e$28(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new p$1a(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},p$1a.fromQuaternion=function(e,t){o$1u.typeOf.object("quaternion",e);var i=e.x*e.x,r=e.x*e.y,n=e.x*e.z,o=e.x*e.w,a=e.y*e.y,s=e.y*e.z,l=e.y*e.w,u=e.z*e.z,c=e.z*e.w,h=e.w*e.w,d=i-a-u+h,f=2*(r-c),p=2*(n+l),_=2*(r+c),m=-i+a-u+h,$=2*(s-o),g=2*(n-l),v=2*(s+o),y=-i-a+u+h;return e$28(t)?(t[0]=d,t[1]=_,t[2]=g,t[3]=f,t[4]=m,t[5]=v,t[6]=p,t[7]=$,t[8]=y,t):new p$1a(d,f,p,_,m,$,g,v,y)},p$1a.fromHeadingPitchRoll=function(e,t){o$1u.typeOf.object("headingPitchRoll",e);var i=Math.cos(-e.pitch),r=Math.cos(-e.heading),n=Math.cos(e.roll),o=Math.sin(-e.pitch),a=Math.sin(-e.heading),s=Math.sin(e.roll),l=i*r,u=-n*a+s*o*r,c=s*a+n*o*r,h=i*a,d=n*r+s*o*a,f=-s*r+n*o*a,p=-o,_=s*i,m=n*i;return e$28(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=u,t[4]=d,t[5]=_,t[6]=c,t[7]=f,t[8]=m,t):new p$1a(l,u,c,h,d,f,p,_,m)},p$1a.fromScale=function(e,t){return o$1u.typeOf.object("scale",e),e$28(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new p$1a(e.x,0,0,0,e.y,0,0,0,e.z)},p$1a.fromUniformScale=function(e,t){return o$1u.typeOf.number("scale",e),e$28(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new p$1a(e,0,0,0,e,0,0,0,e)},p$1a.fromCrossProduct=function(e,t){return o$1u.typeOf.object("vector",e),e$28(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new p$1a(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},p$1a.fromRotationX=function(e,t){o$1u.typeOf.number("angle",e);var i=Math.cos(e),r=Math.sin(e);return e$28(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=r,t[6]=0,t[7]=-r,t[8]=i,t):new p$1a(1,0,0,0,i,-r,0,r,i)},p$1a.fromRotationY=function(e,t){o$1u.typeOf.number("angle",e);var i=Math.cos(e),r=Math.sin(e);return e$28(t)?(t[0]=i,t[1]=0,t[2]=-r,t[3]=0,t[4]=1,t[5]=0,t[6]=r,t[7]=0,t[8]=i,t):new p$1a(i,0,r,0,1,0,-r,0,i)},p$1a.fromRotationZ=function(e,t){o$1u.typeOf.number("angle",e);var i=Math.cos(e),r=Math.sin(e);return e$28(t)?(t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p$1a(i,-r,0,r,i,0,0,0,1)},p$1a.toArray=function(e,t){return o$1u.typeOf.object("matrix",e),e$28(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},p$1a.getElementIndex=function(e,t){return o$1u.typeOf.number.greaterThanOrEquals("row",t,0),o$1u.typeOf.number.lessThanOrEquals("row",t,2),o$1u.typeOf.number.greaterThanOrEquals("column",e,0),o$1u.typeOf.number.lessThanOrEquals("column",e,2),3*e+t},p$1a.getColumn=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,2),o$1u.typeOf.object("result",i);var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},p$1a.setColumn=function(e,t,i,r){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,2),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r);var n=3*t;return(r=p$1a.clone(e,r))[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},p$1a.getRow=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,2),o$1u.typeOf.object("result",i);var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},p$1a.setRow=function(e,t,i,r){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,2),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r),(r=p$1a.clone(e,r))[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var W$15=new t$X;p$1a.getScale=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t.x=t$X.magnitude(t$X.fromElements(e[0],e[1],e[2],W$15)),t.y=t$X.magnitude(t$X.fromElements(e[3],e[4],e[5],W$15)),t.z=t$X.magnitude(t$X.fromElements(e[6],e[7],e[8],W$15)),t};var A$1j=new t$X;p$1a.getMaximumScale=function(e){return p$1a.getScale(e,A$1j),t$X.maximumComponent(A$1j)},p$1a.multiply=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},p$1a.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},p$1a.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},p$1a.multiplyByVector=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("cartesian",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},p$1a.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},p$1a.multiplyByScale=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("scale",t),o$1u.typeOf.object("result",i),i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},p$1a.negate=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},p$1a.transpose=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var F$1m=new t$X(1,1,1);function X$10(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}p$1a.getRotation=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=t$X.divideComponents(F$1m,p$1a.getScale(e,A$1j),A$1j);return t=p$1a.multiplyByScale(e,i,t)};var D$1b=[1,0,0],q$1e=[2,2,1];function H$17(e){for(var t=0,i=0;i<3;++i){var r=e[p$1a.getElementIndex(q$1e[i],D$1b[i])];t+=2*r*r}return Math.sqrt(t)}function Q$19(e,t){for(var i=e$27.EPSILON15,r=0,n=1,o=0;o<3;++o){var a=Math.abs(e[p$1a.getElementIndex(q$1e[o],D$1b[o])]);a>r&&(n=o,r=a)}var s=1,l=0,u=D$1b[n],c=q$1e[n];if(Math.abs(e[p$1a.getElementIndex(c,u)])>i){var h,d=(e[p$1a.getElementIndex(c,c)]-e[p$1a.getElementIndex(u,u)])/2/e[p$1a.getElementIndex(c,u)];l=(h=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)))*(s=1/Math.sqrt(1+h*h))}return(t=p$1a.clone(p$1a.IDENTITY,t))[p$1a.getElementIndex(u,u)]=t[p$1a.getElementIndex(c,c)]=s,t[p$1a.getElementIndex(c,u)]=l,t[p$1a.getElementIndex(u,c)]=-l,t}var U$1a=new p$1a,V$10=new p$1a;function e$25(e,t,i,r){this.x=u$Y(e,0),this.y=u$Y(t,0),this.z=u$Y(i,0),this.w=u$Y(r,0)}p$1a.computeEigenDecomposition=function(e,t){o$1u.typeOf.object("matrix",e);var i=e$27.EPSILON20,r=0,n=0;e$28(t)||(t={});for(var o=t.unitary=p$1a.clone(p$1a.IDENTITY,t.unitary),a=t.diagonal=p$1a.clone(e,t.diagonal),s=i*X$10(a);n<10&&H$17(a)>s;)Q$19(a,U$1a),p$1a.transpose(U$1a,V$10),p$1a.multiply(a,U$1a,a),p$1a.multiply(V$10,a,a),p$1a.multiply(o,U$1a,o),++r>2&&(++n,r=0);return t},p$1a.abs=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),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},p$1a.determinant=function(e){o$1u.typeOf.object("matrix",e);var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},p$1a.inverse=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=p$1a.determinant(e);if(Math.abs(h)<=e$27.EPSILON15)throw new t$Z("matrix is not invertible");t[0]=a*c-u*s,t[1]=u*n-r*c,t[2]=r*s-a*n,t[3]=l*s-o*c,t[4]=i*c-l*n,t[5]=o*n-i*s,t[6]=o*u-l*a,t[7]=l*r-i*u,t[8]=i*a-o*r;var d=1/h;return p$1a.multiplyByScalar(t,d,t)},p$1a.equals=function(e,t){return e===t||e$28(e)&&e$28(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]},p$1a.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(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},p$1a.IDENTITY=Object.freeze(new p$1a(1,0,0,0,1,0,0,0,1)),p$1a.ZERO=Object.freeze(new p$1a(0,0,0,0,0,0,0,0,0)),p$1a.COLUMN0ROW0=0,p$1a.COLUMN0ROW1=1,p$1a.COLUMN0ROW2=2,p$1a.COLUMN1ROW0=3,p$1a.COLUMN1ROW1=4,p$1a.COLUMN1ROW2=5,p$1a.COLUMN2ROW0=6,p$1a.COLUMN2ROW1=7,p$1a.COLUMN2ROW2=8,Object.defineProperties(p$1a.prototype,{length:{get:function(){return p$1a.packedLength}}}),p$1a.prototype.clone=function(e){return p$1a.clone(this,e)},p$1a.prototype.equals=function(e){return p$1a.equals(this,e)},p$1a.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]},p$1a.prototype.equalsEpsilon=function(e,t){return p$1a.equalsEpsilon(this,e,t)},p$1a.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},e$25.fromElements=function(e,t,i,r,n){return e$28(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new e$25(e,t,i,r)},e$25.fromColor=function(e,t){return o$1u.typeOf.object("color",e),e$28(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new e$25(e.red,e.green,e.blue,e.alpha)},e$25.clone=function(e,t){if(e$28(e))return e$28(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new e$25(e.x,e.y,e.z,e.w)},e$25.packedLength=4,e$25.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},e$25.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new e$25),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},e$25.packArray=function(e,t){o$1u.defined("array",e);var i=e.length,r=4*i;if(e$28(t)){if(!Array.isArray(t)&&t.length!==r)throw new t$Z("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;n<i;++n)e$25.pack(e[n],t,4*n);return t},e$25.unpackArray=function(e,t){if(o$1u.defined("array",e),o$1u.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new t$Z("array length must be a multiple of 4.");var i=e.length;e$28(t)?t.length=i/4:t=new Array(i/4);for(var r=0;r<i;r+=4){var n=r/4;t[n]=e$25.unpack(e,r,t[n])}return t},e$25.fromArray=e$25.unpack,e$25.maximumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},e$25.minimumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},e$25.minimumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},e$25.maximumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},e$25.magnitudeSquared=function(e){return o$1u.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},e$25.magnitude=function(e){return Math.sqrt(e$25.magnitudeSquared(e))};var c$1b=new e$25;e$25.distance=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e$25.subtract(e,t,c$1b),e$25.magnitude(c$1b)},e$25.distanceSquared=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e$25.subtract(e,t,c$1b),e$25.magnitudeSquared(c$1b)},e$25.normalize=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=e$25.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new t$Z("normalized result is not a number");return t},e$25.dot=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},e$25.multiplyComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},e$25.divideComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},e$25.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},e$25.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},e$25.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},e$25.divideByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},e$25.negate=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},e$25.abs=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var j$1f=new e$25;e$25.lerp=function(e,t,i,r){return o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r),e$25.multiplyByScalar(t,i,j$1f),r=e$25.multiplyByScalar(e,1-i,r),e$25.add(j$1f,r,r)};var h$11=new e$25;e$25.mostOrthogonalAxis=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=e$25.normalize(e,h$11);return e$25.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?e$25.clone(e$25.UNIT_X,t):e$25.clone(e$25.UNIT_W,t):i.z<=i.w?e$25.clone(e$25.UNIT_Z,t):e$25.clone(e$25.UNIT_W,t):i.y<=i.z?i.y<=i.w?e$25.clone(e$25.UNIT_Y,t):e$25.clone(e$25.UNIT_W,t):i.z<=i.w?e$25.clone(e$25.UNIT_Z,t):e$25.clone(e$25.UNIT_W,t)},e$25.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},e$25.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},e$25.equalsEpsilon=function(e,t,i,r){return e===t||e$28(e)&&e$28(t)&&e$27.equalsEpsilon(e.x,t.x,i,r)&&e$27.equalsEpsilon(e.y,t.y,i,r)&&e$27.equalsEpsilon(e.z,t.z,i,r)&&e$27.equalsEpsilon(e.w,t.w,i,r)},e$25.ZERO=Object.freeze(new e$25(0,0,0,0)),e$25.UNIT_X=Object.freeze(new e$25(1,0,0,0)),e$25.UNIT_Y=Object.freeze(new e$25(0,1,0,0)),e$25.UNIT_Z=Object.freeze(new e$25(0,0,1,0)),e$25.UNIT_W=Object.freeze(new e$25(0,0,0,1)),e$25.prototype.clone=function(e){return e$25.clone(this,e)},e$25.prototype.equals=function(e){return e$25.equals(this,e)},e$25.prototype.equalsEpsilon=function(e,t,i){return e$25.equalsEpsilon(this,e,t,i)},e$25.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var i$1b=new Float32Array(1),z$$=256,T$15=65536,N$Y=16777216,_$17=1/z$$,M$1d=1/T$15,d$1h=1/N$Y,O$W=38;function t$U(e){var t;this.name="RuntimeError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}function y$15(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_){this[0]=u$Y(e,0),this[1]=u$Y(n,0),this[2]=u$Y(l,0),this[3]=u$Y(d,0),this[4]=u$Y(t,0),this[5]=u$Y(o,0),this[6]=u$Y(u,0),this[7]=u$Y(f,0),this[8]=u$Y(i,0),this[9]=u$Y(a,0),this[10]=u$Y(c,0),this[11]=u$Y(p,0),this[12]=u$Y(r,0),this[13]=u$Y(s,0),this[14]=u$Y(h,0),this[15]=u$Y(_,0)}e$25.packFloat=function(e,t){if(o$1u.typeOf.number("value",e),e$28(t)||(t=new e$25),i$1b[0]=e,0===(e=i$1b[0]))return e$25.clone(e$25.ZERO,t);var i,r=e<0?1:0;isFinite(e)?(e=Math.abs(e),i=Math.floor(e$27.logBase(e,10))+1,e/=Math.pow(10,i)):(e=.1,i=O$W);var n=e*z$$;return t.x=Math.floor(n),n=(n-t.x)*z$$,t.y=Math.floor(n),n=(n-t.y)*z$$,t.z=Math.floor(n),t.w=2*(i+O$W)+r,t},e$25.unpackFloat=function(e){o$1u.typeOf.object("packedFloat",e);var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(r=-(r=2*r-1),(i-=O$W)>=O$W)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*_$17;return n+=r*e.y*M$1d,(n+=r*e.z*d$1h)*Math.pow(10,i)},e$28(Object.create)&&(t$U.prototype=Object.create(Error.prototype),t$U.prototype.constructor=t$U),t$U.prototype.toString=function(){var e=this.name+": "+this.message;return e$28(this.stack)&&(e+="\n"+this.stack.toString()),e},y$15.packedLength=16,y$15.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t[i++]=e[9],t[i++]=e[10],t[i++]=e[11],t[i++]=e[12],t[i++]=e[13],t[i++]=e[14],t[i]=e[15],t},y$15.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new y$15),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},y$15.clone=function(e,t){if(e$28(e))return e$28(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new y$15(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},y$15.fromArray=y$15.unpack,y$15.fromColumnMajorArray=function(e,t){return o$1u.defined("values",e),y$15.clone(e,t)},y$15.fromRowMajorArray=function(e,t){return o$1u.defined("values",e),e$28(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new y$15(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},y$15.fromRotationTranslation=function(e,t,i){return o$1u.typeOf.object("rotation",e),t=u$Y(t,t$X.ZERO),e$28(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,i):new y$15(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},y$15.fromTranslationQuaternionRotationScale=function(e,t,i,r){o$1u.typeOf.object("translation",e),o$1u.typeOf.object("rotation",t),o$1u.typeOf.object("scale",i),e$28(r)||(r=new y$15);var n=i.x,o=i.y,a=i.z,s=t.x*t.x,l=t.x*t.y,u=t.x*t.z,c=t.x*t.w,h=t.y*t.y,d=t.y*t.z,f=t.y*t.w,p=t.z*t.z,_=t.z*t.w,m=t.w*t.w,$=s-h-p+m,g=2*(l-_),v=2*(u+f),y=2*(l+_),x=-s+h-p+m,b=2*(d-c),w=2*(u-f),C=2*(d+c),T=-s-h+p+m;return r[0]=$*n,r[1]=y*n,r[2]=w*n,r[3]=0,r[4]=g*o,r[5]=x*o,r[6]=C*o,r[7]=0,r[8]=v*a,r[9]=b*a,r[10]=T*a,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},y$15.fromTranslationRotationScale=function(e,t){return o$1u.typeOf.object("translationRotationScale",e),y$15.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},y$15.fromTranslation=function(e,t){return o$1u.typeOf.object("translation",e),y$15.fromRotationTranslation(p$1a.IDENTITY,e,t)},y$15.fromScale=function(e,t){return o$1u.typeOf.object("scale",e),e$28(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new y$15(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},y$15.fromUniformScale=function(e,t){return o$1u.typeOf.number("scale",e),e$28(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new y$15(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var D$1a=new t$X,I$1x=new t$X,i$1a=new t$X;y$15.fromCamera=function(e,t){o$1u.typeOf.object("camera",e);var i=e.position,r=e.direction,n=e.up;o$1u.typeOf.object("camera.position",i),o$1u.typeOf.object("camera.direction",r),o$1u.typeOf.object("camera.up",n),t$X.normalize(r,D$1a),t$X.normalize(t$X.cross(D$1a,n,I$1x),I$1x),t$X.normalize(t$X.cross(I$1x,D$1a,i$1a),i$1a);var o=I$1x.x,a=I$1x.y,s=I$1x.z,l=D$1a.x,u=D$1a.y,c=D$1a.z,h=i$1a.x,d=i$1a.y,f=i$1a.z,p=i.x,_=i.y,m=i.z,$=o*-p+a*-_+s*-m,g=h*-p+d*-_+f*-m,v=l*p+u*_+c*m;return e$28(t)?(t[0]=o,t[1]=h,t[2]=-l,t[3]=0,t[4]=a,t[5]=d,t[6]=-u,t[7]=0,t[8]=s,t[9]=f,t[10]=-c,t[11]=0,t[12]=$,t[13]=g,t[14]=v,t[15]=1,t):new y$15(o,a,s,$,h,d,f,g,-l,-u,-c,v,0,0,0,1)},y$15.computePerspectiveFieldOfView=function(e,t,i,r,n){o$1u.typeOf.number.greaterThan("fovY",e,0),o$1u.typeOf.number.lessThan("fovY",e,Math.PI),o$1u.typeOf.number.greaterThan("near",i,0),o$1u.typeOf.number.greaterThan("far",r,0),o$1u.typeOf.object("result",n);var o=1/Math.tan(.5*e),a=o/t,s=(r+i)/(i-r),l=2*r*i/(i-r);return n[0]=a,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=s,n[11]=-1,n[12]=0,n[13]=0,n[14]=l,n[15]=0,n},y$15.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){o$1u.typeOf.number("left",e),o$1u.typeOf.number("right",t),o$1u.typeOf.number("bottom",i),o$1u.typeOf.number("top",r),o$1u.typeOf.number("near",n),o$1u.typeOf.number("far",o),o$1u.typeOf.object("result",a);var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,h=-(r+i)*l,d=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=h,a[14]=d,a[15]=1,a},y$15.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){o$1u.typeOf.number("left",e),o$1u.typeOf.number("right",t),o$1u.typeOf.number("bottom",i),o$1u.typeOf.number("top",r),o$1u.typeOf.number("near",n),o$1u.typeOf.number("far",o),o$1u.typeOf.object("result",a);var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),h=-(o+n)/(o-n),d=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=h,a[11]=-1,a[12]=0,a[13]=0,a[14]=d,a[15]=0,a},y$15.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){o$1u.typeOf.number("left",e),o$1u.typeOf.number("right",t),o$1u.typeOf.number("bottom",i),o$1u.typeOf.number("top",r),o$1u.typeOf.number("near",n),o$1u.typeOf.object("result",o);var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},y$15.computeViewportTransformation=function(e,t,i,r){o$1u.typeOf.object("result",r),e=u$Y(e,u$Y.EMPTY_OBJECT);var n=u$Y(e.x,0),o=u$Y(e.y,0),a=u$Y(e.width,0),s=u$Y(e.height,0);t=u$Y(t,0);var l=.5*a,u=.5*s,c=.5*((i=u$Y(i,1))-t),h=l,d=u,f=c,p=n+l,_=o+u,m=t+c;return r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=d,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=f,r[11]=0,r[12]=p,r[13]=_,r[14]=m,r[15]=1,r},y$15.computeView=function(e,t,i,r,n){return o$1u.typeOf.object("position",e),o$1u.typeOf.object("direction",t),o$1u.typeOf.object("up",i),o$1u.typeOf.object("right",r),o$1u.typeOf.object("result",n),n[0]=r.x,n[1]=i.x,n[2]=-t.x,n[3]=0,n[4]=r.y,n[5]=i.y,n[6]=-t.y,n[7]=0,n[8]=r.z,n[9]=i.z,n[10]=-t.z,n[11]=0,n[12]=-t$X.dot(r,e),n[13]=-t$X.dot(i,e),n[14]=t$X.dot(t,e),n[15]=1,n},y$15.toArray=function(e,t){return o$1u.typeOf.object("matrix",e),e$28(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},y$15.getElementIndex=function(e,t){return o$1u.typeOf.number.greaterThanOrEquals("row",t,0),o$1u.typeOf.number.lessThanOrEquals("row",t,3),o$1u.typeOf.number.greaterThanOrEquals("column",e,0),o$1u.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},y$15.getColumn=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,3),o$1u.typeOf.object("result",i);var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},y$15.setColumn=function(e,t,i,r){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,3),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r);var n=4*t;return(r=y$15.clone(e,r))[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},y$15.setTranslation=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("translation",t),o$1u.typeOf.object("result",i),i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i};var y1=new t$X;y$15.setScale=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("scale",t),o$1u.typeOf.object("result",i);var r=y$15.getScale(e,y1),n=t$X.divideComponents(t,r,y1);return y$15.multiplyByScale(e,n,i)},y$15.getRow=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,3),o$1u.typeOf.object("result",i);var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},y$15.setRow=function(e,t,i,r){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,3),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r),(r=y$15.clone(e,r))[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var O1=new t$X;y$15.getScale=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t.x=t$X.magnitude(t$X.fromElements(e[0],e[1],e[2],O1)),t.y=t$X.magnitude(t$X.fromElements(e[4],e[5],e[6],O1)),t.z=t$X.magnitude(t$X.fromElements(e[8],e[9],e[10],O1)),t};var b1=new t$X;y$15.getMaximumScale=function(e){return y$15.getScale(e,b1),t$X.maximumComponent(b1)},y$15.multiply=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],_=e[12],m=e[13],$=e[14],g=e[15],v=t[0],y=t[1],x=t[2],b=t[3],w=t[4],C=t[5],T=t[6],S=t[7],E=t[8],A=t[9],P=t[10],I=t[11],M=t[12],O=t[13],D=t[14],R=t[15],L=r*v+s*y+h*x+_*b,B=n*v+l*y+d*x+m*b,N=o*v+u*y+f*x+$*b,F=a*v+c*y+p*x+g*b,z=r*w+s*C+h*T+_*S,k=n*w+l*C+d*T+m*S,V=o*w+u*C+f*T+$*S,U=a*w+c*C+p*T+g*S,X=r*E+s*A+h*P+_*I,H=n*E+l*A+d*P+m*I,G=o*E+u*A+f*P+$*I,W=a*E+c*A+p*P+g*I,Y=r*M+s*O+h*D+_*R,q=n*M+l*O+d*D+m*R,j=o*M+u*O+f*D+$*R,Z=a*M+c*O+p*D+g*R;return i[0]=L,i[1]=B,i[2]=N,i[3]=F,i[4]=z,i[5]=k,i[6]=V,i[7]=U,i[8]=X,i[9]=H,i[10]=G,i[11]=W,i[12]=Y,i[13]=q,i[14]=j,i[15]=Z,i},y$15.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},y$15.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},y$15.multiplyTransformation=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],f=e[13],p=e[14],_=t[0],m=t[1],$=t[2],g=t[4],v=t[5],y=t[6],x=t[8],b=t[9],w=t[10],C=t[12],T=t[13],S=t[14],E=r*_+a*m+u*$,A=n*_+s*m+c*$,P=o*_+l*m+h*$,I=r*g+a*v+u*y,M=n*g+s*v+c*y,O=o*g+l*v+h*y,D=r*x+a*b+u*w,R=n*x+s*b+c*w,L=o*x+l*b+h*w,B=r*C+a*T+u*S+d,N=n*C+s*T+c*S+f,F=o*C+l*T+h*S+p;return i[0]=E,i[1]=A,i[2]=P,i[3]=0,i[4]=I,i[5]=M,i[6]=O,i[7]=0,i[8]=D,i[9]=R,i[10]=L,i[11]=0,i[12]=B,i[13]=N,i[14]=F,i[15]=1,i},y$15.multiplyByMatrix3=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("rotation",t),o$1u.typeOf.object("result",i);var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=t[0],f=t[1],p=t[2],_=t[3],m=t[4],$=t[5],g=t[6],v=t[7],y=t[8],x=r*d+a*f+u*p,b=n*d+s*f+c*p,w=o*d+l*f+h*p,C=r*_+a*m+u*$,T=n*_+s*m+c*$,S=o*_+l*m+h*$,E=r*g+a*v+u*y,A=n*g+s*v+c*y,P=o*g+l*v+h*y;return i[0]=x,i[1]=b,i[2]=w,i[3]=0,i[4]=C,i[5]=T,i[6]=S,i[7]=0,i[8]=E,i[9]=A,i[10]=P,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},y$15.multiplyByTranslation=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("translation",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var r$1d=new t$X;y$15.multiplyByUniformScale=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number("scale",t),o$1u.typeOf.object("result",i),r$1d.x=t,r$1d.y=t,r$1d.z=t,y$15.multiplyByScale(e,r$1d,i)},y$15.multiplyByScale=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("scale",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?y$15.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},y$15.multiplyByVector=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("cartesian",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},y$15.multiplyByPointAsVector=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("cartesian",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},y$15.multiplyByPoint=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("cartesian",t),o$1u.typeOf.object("result",i);var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},y$15.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},y$15.multiplyByPlane=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("plane",t),o$1u.typeOf.object("result",i);var r=new y$15,n=new y$15;y$15.inverse(e,r),y$15.transpose(r,n);var o=new e$25(t.normal.x,t.normal.y,t.normal.z,t.distance);y$15.multiplyByVector(n,o,o),i.normal.x=o.x,i.normal.y=o.y,i.normal.z=o.z;var a=t$X.magnitude(i.normal);return t$X.normalize(i.normal,i.normal),i.distance=o.w/a,i},y$15.negate=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},y$15.transpose=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},y$15.abs=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},y$15.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},y$15.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},y$15.getTranslation=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},y$15.getMatrix3=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},y$15.getRotation=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var z1=new p$1a,h1=new p$1a,T1=new e$25,C1=new e$25(0,0,0,1);function h$10(e,t,i,r){this.west=u$Y(e,0),this.south=u$Y(t,0),this.east=u$Y(i,0),this.north=u$Y(r,0)}y$15.inverse=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[0],r=e[4],n=e[8],o=e[12],a=e[1],s=e[5],l=e[9],u=e[13],c=e[2],h=e[6],d=e[10],f=e[14],p=e[3],_=e[7],m=e[11],$=e[15],g=d*$,v=f*m,y=h*$,x=f*_,b=h*m,w=d*_,C=c*$,T=f*p,S=c*m,E=d*p,A=c*_,P=h*p,I=g*s+x*l+b*u-(v*s+y*l+w*u),M=v*a+C*l+E*u-(g*a+T*l+S*u),O=y*a+T*s+A*u-(x*a+C*s+P*u),D=w*a+S*s+P*l-(b*a+E*s+A*l),R=v*r+y*n+w*o-(g*r+x*n+b*o),L=g*i+T*n+S*o-(v*i+C*n+E*o),B=x*i+C*r+P*o-(y*i+T*r+A*o),N=b*i+E*r+A*n-(w*i+S*r+P*n),F=(g=n*u)*_+(x=o*s)*m+(b=r*l)*$-((v=o*l)*_+(y=r*u)*m+(w=n*s)*$),z=v*p+(C=i*u)*m+(E=n*a)*$-(g*p+(T=o*a)*m+(S=i*l)*$),k=y*p+T*_+(A=i*s)*$-(x*p+C*_+(P=r*a)*$),V=w*p+S*_+P*m-(b*p+E*_+A*m),U=y*d+w*f+v*h-(b*f+g*h+x*d),X=S*f+g*c+T*d-(C*d+E*f+v*c),H=C*h+P*f+x*c-(A*f+y*c+T*h),G=A*d+b*c+E*h-(S*h+P*d+w*c),W=i*I+r*M+n*O+o*D;if(Math.abs(W)<e$27.EPSILON21){if(p$1a.equalsEpsilon(y$15.getRotation(e,z1),h1,e$27.EPSILON5)&&e$25.equals(y$15.getRow(e,3,T1),C1))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new t$U("matrix is not invertible because its determinate is zero.")}return W=1/W,t[0]=I*W,t[1]=M*W,t[2]=O*W,t[3]=D*W,t[4]=R*W,t[5]=L*W,t[6]=B*W,t[7]=N*W,t[8]=F*W,t[9]=z*W,t[10]=k*W,t[11]=V*W,t[12]=U*W,t[13]=X*W,t[14]=H*W,t[15]=G*W,t},y$15.inverseTransformation=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[0],r=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],h=e[12],d=e[13],f=e[14],p=-i*h-r*d-n*f,_=-o*h-a*d-s*f,m=-l*h-u*d-c*f;return t[0]=i,t[1]=o,t[2]=l,t[3]=0,t[4]=r,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=p,t[13]=_,t[14]=m,t[15]=1,t},y$15.IDENTITY=Object.freeze(new y$15(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),y$15.ZERO=Object.freeze(new y$15(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),y$15.COLUMN0ROW0=0,y$15.COLUMN0ROW1=1,y$15.COLUMN0ROW2=2,y$15.COLUMN0ROW3=3,y$15.COLUMN1ROW0=4,y$15.COLUMN1ROW1=5,y$15.COLUMN1ROW2=6,y$15.COLUMN1ROW3=7,y$15.COLUMN2ROW0=8,y$15.COLUMN2ROW1=9,y$15.COLUMN2ROW2=10,y$15.COLUMN2ROW3=11,y$15.COLUMN3ROW0=12,y$15.COLUMN3ROW1=13,y$15.COLUMN3ROW2=14,y$15.COLUMN3ROW3=15,Object.defineProperties(y$15.prototype,{length:{get:function(){return y$15.packedLength}}}),y$15.prototype.clone=function(e){return y$15.clone(this,e)},y$15.prototype.equals=function(e){return y$15.equals(this,e)},y$15.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},y$15.prototype.equalsEpsilon=function(e,t){return y$15.equalsEpsilon(this,e,t)},y$15.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},Object.defineProperties(h$10.prototype,{width:{get:function(){return h$10.computeWidth(this)}},height:{get:function(){return h$10.computeHeight(this)}}}),h$10.packedLength=4,h$10.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},h$10.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new h$10),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},h$10.computeWidth=function(e){o$1u.typeOf.object("rectangle",e);var t=e.east,i=e.west;return t<i&&(t+=e$27.TWO_PI),t-i},h$10.computeHeight=function(e){return o$1u.typeOf.object("rectangle",e),e.north-e.south},h$10.fromDegrees=function(e,t,i,r,n){return e=e$27.toRadians(u$Y(e,0)),t=e$27.toRadians(u$Y(t,0)),i=e$27.toRadians(u$Y(i,0)),r=e$27.toRadians(u$Y(r,0)),e$28(n)?(n.west=e,n.south=t,n.east=i,n.north=r,n):new h$10(e,t,i,r)},h$10.fromRadians=function(e,t,i,r,n){return e$28(n)?(n.west=u$Y(e,0),n.south=u$Y(t,0),n.east=u$Y(i,0),n.north=u$Y(r,0),n):new h$10(e,t,i,r)},h$10.fromCartographicArray=function(e,t){o$1u.defined("cartographics",e);for(var i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=0,u=e.length;l<u;l++){var c=e[l];i=Math.min(i,c.longitude),r=Math.max(r,c.longitude),a=Math.min(a,c.latitude),s=Math.max(s,c.latitude);var h=c.longitude>=0?c.longitude:c.longitude+e$27.TWO_PI;n=Math.min(n,h),o=Math.max(o,h)}return r-i>o-n&&(i=n,(r=o)>e$27.PI&&(r-=e$27.TWO_PI),i>e$27.PI&&(i-=e$27.TWO_PI)),e$28(t)?(t.west=i,t.south=a,t.east=r,t.north=s,t):new h$10(i,a,r,s)},h$10.fromCartesianArray=function(e,t,i){o$1u.defined("cartesians",e),t=u$Y(t,t$V.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0,c=e.length;u<c;u++){var h=t.cartesianToCartographic(e[u]);r=Math.min(r,h.longitude),n=Math.max(n,h.longitude),s=Math.min(s,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+e$27.TWO_PI;o=Math.min(o,d),a=Math.max(a,d)}return n-r>a-o&&(r=o,(n=a)>e$27.PI&&(n-=e$27.TWO_PI),r>e$27.PI&&(r-=e$27.TWO_PI)),e$28(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new h$10(r,s,n,l)},h$10.clone=function(e,t){if(e$28(e))return e$28(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new h$10(e.west,e.south,e.east,e.north)},h$10.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("absoluteEpsilon",i),e===t||e$28(e)&&e$28(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},h$10.prototype.clone=function(e){return h$10.clone(this,e)},h$10.prototype.equals=function(e){return h$10.equals(this,e)},h$10.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},h$10.prototype.equalsEpsilon=function(e,t){return o$1u.typeOf.number("epsilon",t),h$10.equalsEpsilon(this,e,t)},h$10.validate=function(e){o$1u.typeOf.object("rectangle",e);var t=e.north;o$1u.typeOf.number.greaterThanOrEquals("north",t,-e$27.PI_OVER_TWO),o$1u.typeOf.number.lessThanOrEquals("north",t,e$27.PI_OVER_TWO);var i=e.south;o$1u.typeOf.number.greaterThanOrEquals("south",i,-e$27.PI_OVER_TWO),o$1u.typeOf.number.lessThanOrEquals("south",i,e$27.PI_OVER_TWO);var r=e.west;o$1u.typeOf.number.greaterThanOrEquals("west",r,-Math.PI),o$1u.typeOf.number.lessThanOrEquals("west",r,Math.PI);var n=e.east;o$1u.typeOf.number.greaterThanOrEquals("east",n,-Math.PI),o$1u.typeOf.number.lessThanOrEquals("east",n,Math.PI)},h$10.southwest=function(e,t){return o$1u.typeOf.object("rectangle",e),e$28(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new t$W(e.west,e.south)},h$10.northwest=function(e,t){return o$1u.typeOf.object("rectangle",e),e$28(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new t$W(e.west,e.north)},h$10.northeast=function(e,t){return o$1u.typeOf.object("rectangle",e),e$28(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new t$W(e.east,e.north)},h$10.southeast=function(e,t){return o$1u.typeOf.object("rectangle",e),e$28(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new t$W(e.east,e.south)},h$10.center=function(e,t){o$1u.typeOf.object("rectangle",e);var i=e.east,r=e.west;i<r&&(i+=e$27.TWO_PI);var n=e$27.negativePiToPi(.5*(r+i)),o=.5*(e.south+e.north);return e$28(t)?(t.longitude=n,t.latitude=o,t.height=0,t):new t$W(n,o)},h$10.intersection=function(e,t,i){o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("otherRectangle",t);var r=e.east,n=e.west,o=t.east,a=t.west;r<n&&o>0?r+=e$27.TWO_PI:o<a&&r>0&&(o+=e$27.TWO_PI),r<n&&a<0?a+=e$27.TWO_PI:o<a&&n<0&&(n+=e$27.TWO_PI);var s=e$27.negativePiToPi(Math.max(n,a)),l=e$27.negativePiToPi(Math.min(r,o));if(!((e.west<e.east||t.west<t.east)&&l<=s)){var u=Math.max(e.south,t.south),c=Math.min(e.north,t.north);if(!(u>=c))return e$28(i)?(i.west=s,i.south=u,i.east=l,i.north=c,i):new h$10(s,u,l,c)}},h$10.simpleIntersection=function(e,t,i){o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("otherRectangle",t);var r=Math.max(e.west,t.west),n=Math.max(e.south,t.south),o=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(n>=a||r>=o))return e$28(i)?(i.west=r,i.south=n,i.east=o,i.north=a,i):new h$10(r,n,o,a)},h$10.union=function(e,t,i){o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("otherRectangle",t),e$28(i)||(i=new h$10);var r=e.east,n=e.west,o=t.east,a=t.west;r<n&&o>0?r+=e$27.TWO_PI:o<a&&r>0&&(o+=e$27.TWO_PI),r<n&&a<0?a+=e$27.TWO_PI:o<a&&n<0&&(n+=e$27.TWO_PI);var s=e$27.convertLongitudeRange(Math.min(n,a)),l=e$27.convertLongitudeRange(Math.max(r,o));return i.west=s,i.south=Math.min(e.south,t.south),i.east=l,i.north=Math.max(e.north,t.north),i},h$10.expand=function(e,t,i){return o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("cartographic",t),e$28(i)||(i=new h$10),i.west=Math.min(e.west,t.longitude),i.south=Math.min(e.south,t.latitude),i.east=Math.max(e.east,t.longitude),i.north=Math.max(e.north,t.latitude),i},h$10.contains=function(e,t){o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("cartographic",t);var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return o<n&&(o+=e$27.TWO_PI,i<0&&(i+=e$27.TWO_PI)),(i>n||e$27.equalsEpsilon(i,n,e$27.EPSILON14))&&(i<o||e$27.equalsEpsilon(i,o,e$27.EPSILON14))&&r>=e.south&&r<=e.north};var T$14=new t$W;h$10.subsample=function(e,t,i,r){o$1u.typeOf.object("rectangle",e),t=u$Y(t,t$V.WGS84),i=u$Y(i,0),e$28(r)||(r=[]);var n=0,o=e.north,a=e.south,s=e.east,l=e.west,u=T$14;u.height=i,u.longitude=l,u.latitude=o,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=s,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=a,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=l,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=o<0?o:a>0?a:0;for(var c=1;c<8;++c)u.longitude=-Math.PI+c*e$27.PI_OVER_TWO,h$10.contains(e,u)&&(r[n]=t.cartographicToCartesian(u,r[n]),n++);return 0===u.latitude&&(u.longitude=l,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=s,r[n]=t.cartographicToCartesian(u,r[n]),n++),r.length=n,r};var p$19=new t$W;function i$19(e,t){this.center=t$X.clone(u$Y(e,t$X.ZERO)),this.radius=u$Y(t,0)}h$10.prototype.contains=function(e){return h$10.contains(this,h$10.southwest(e,p$19))&&h$10.contains(this,h$10.northwest(e,p$19))&&h$10.contains(this,h$10.southeast(e,p$19))&&h$10.contains(this,h$10.northeast(e,p$19))},h$10.MAX_VALUE=Object.freeze(new h$10(-Math.PI,-e$27.PI_OVER_TWO,Math.PI,e$27.PI_OVER_TWO));var T$13=new t$X,F$1l=new t$X,I$1w=new t$X,J$17=new t$X,K$12=new t$X,Q$18=new t$X,$$14=new t$X,M$1c=new t$X,L$1m=new t$X,H$16=new t$X,s$_=new t$X,aa$5=new t$X,da$5=4/3*e$27.PI;i$19.fromPoints=function(e,t){if(e$28(t)||(t=new i$19),!e$28(e)||0===e.length)return t.center=t$X.clone(t$X.ZERO,t.center),t.radius=0,t;var i,r=t$X.clone(e[0],$$14),n=t$X.clone(r,T$13),o=t$X.clone(r,F$1l),a=t$X.clone(r,I$1w),s=t$X.clone(r,J$17),l=t$X.clone(r,K$12),u=t$X.clone(r,Q$18),c=e.length;for(i=1;i<c;i++){t$X.clone(e[i],r);var h=r.x,d=r.y,f=r.z;h<n.x&&t$X.clone(r,n),h>s.x&&t$X.clone(r,s),d<o.y&&t$X.clone(r,o),d>l.y&&t$X.clone(r,l),f<a.z&&t$X.clone(r,a),f>u.z&&t$X.clone(r,u)}var p=t$X.magnitudeSquared(t$X.subtract(s,n,M$1c)),_=t$X.magnitudeSquared(t$X.subtract(l,o,M$1c)),m=t$X.magnitudeSquared(t$X.subtract(u,a,M$1c)),$=n,g=s,v=p;_>v&&(v=_,$=o,g=l),m>v&&(v=m,$=a,g=u);var y=L$1m;y.x=.5*($.x+g.x),y.y=.5*($.y+g.y),y.z=.5*($.z+g.z);var x=t$X.magnitudeSquared(t$X.subtract(g,y,M$1c)),b=Math.sqrt(x),w=H$16;w.x=n.x,w.y=o.y,w.z=a.z;var C=s$_;C.x=s.x,C.y=l.y,C.z=u.z;var T=t$X.midpoint(w,C,aa$5),S=0;for(i=0;i<c;i++){t$X.clone(e[i],r);var E=t$X.magnitude(t$X.subtract(r,T,M$1c));E>S&&(S=E);var A=t$X.magnitudeSquared(t$X.subtract(r,y,M$1c));if(A>x){var P=Math.sqrt(A);x=(b=.5*(b+P))*b;var I=P-b;y.x=(b*y.x+I*r.x)/P,y.y=(b*y.y+I*r.y)/P,y.z=(b*y.z+I*r.z)/P}}return b<S?(t$X.clone(y,t.center),t.radius=b):(t$X.clone(T,t.center),t.radius=S),t};var ua$6=new n$1b,ma$5=new t$X,ya$6=new t$X,ra$5=new t$W,ea$5=new t$W;i$19.fromRectangle2D=function(e,t,i){return i$19.fromRectangleWithHeights2D(e,t,0,0,i)},i$19.fromRectangleWithHeights2D=function(e,t,i,r,n){if(e$28(n)||(n=new i$19),!e$28(e))return n.center=t$X.clone(t$X.ZERO,n.center),n.radius=0,n;t=u$Y(t,ua$6),h$10.southwest(e,ra$5),ra$5.height=i,h$10.northeast(e,ea$5),ea$5.height=r;var o=t.project(ra$5,ma$5),a=t.project(ea$5,ya$6),s=a.x-o.x,l=a.y-o.y,u=a.z-o.z;n.radius=.5*Math.sqrt(s*s+l*l+u*u);var c=n.center;return c.x=o.x+.5*s,c.y=o.y+.5*l,c.z=o.z+.5*u,n};var xa$7=[];i$19.fromRectangle3D=function(e,t,i,r){if(t=u$Y(t,t$V.WGS84),i=u$Y(i,0),e$28(r)||(r=new i$19),!e$28(e))return r.center=t$X.clone(t$X.ZERO,r.center),r.radius=0,r;var n=h$10.subsample(e,t,i,xa$7);return i$19.fromPoints(n,r)},i$19.fromVertices=function(e,t,i,r){if(e$28(r)||(r=new i$19),!e$28(e)||0===e.length)return r.center=t$X.clone(t$X.ZERO,r.center),r.radius=0,r;t=u$Y(t,t$X.ZERO),i=u$Y(i,3),o$1u.typeOf.number.greaterThanOrEquals("stride",i,3);var n=$$14;n.x=e[0]+t.x,n.y=e[1]+t.y,n.z=e[2]+t.z;var o,a=t$X.clone(n,T$13),s=t$X.clone(n,F$1l),l=t$X.clone(n,I$1w),u=t$X.clone(n,J$17),c=t$X.clone(n,K$12),h=t$X.clone(n,Q$18),d=e.length;for(o=0;o<d;o+=i){var f=e[o]+t.x,p=e[o+1]+t.y,_=e[o+2]+t.z;n.x=f,n.y=p,n.z=_,f<a.x&&t$X.clone(n,a),f>u.x&&t$X.clone(n,u),p<s.y&&t$X.clone(n,s),p>c.y&&t$X.clone(n,c),_<l.z&&t$X.clone(n,l),_>h.z&&t$X.clone(n,h)}var m=t$X.magnitudeSquared(t$X.subtract(u,a,M$1c)),$=t$X.magnitudeSquared(t$X.subtract(c,s,M$1c)),g=t$X.magnitudeSquared(t$X.subtract(h,l,M$1c)),v=a,y=u,x=m;$>x&&(x=$,v=s,y=c),g>x&&(x=g,v=l,y=h);var b=L$1m;b.x=.5*(v.x+y.x),b.y=.5*(v.y+y.y),b.z=.5*(v.z+y.z);var w=t$X.magnitudeSquared(t$X.subtract(y,b,M$1c)),C=Math.sqrt(w),T=H$16;T.x=a.x,T.y=s.y,T.z=l.z;var S=s$_;S.x=u.x,S.y=c.y,S.z=h.z;var E=t$X.midpoint(T,S,aa$5),A=0;for(o=0;o<d;o+=i){n.x=e[o]+t.x,n.y=e[o+1]+t.y,n.z=e[o+2]+t.z;var P=t$X.magnitude(t$X.subtract(n,E,M$1c));P>A&&(A=P);var I=t$X.magnitudeSquared(t$X.subtract(n,b,M$1c));if(I>w){var M=Math.sqrt(I);w=(C=.5*(C+M))*C;var O=M-C;b.x=(C*b.x+O*n.x)/M,b.y=(C*b.y+O*n.y)/M,b.z=(C*b.z+O*n.z)/M}}return C<A?(t$X.clone(b,r.center),r.radius=C):(t$X.clone(E,r.center),r.radius=A),r},i$19.fromEncodedCartesianVertices=function(e,t,i){if(e$28(i)||(i=new i$19),!e$28(e)||!e$28(t)||e.length!==t.length||0===e.length)return i.center=t$X.clone(t$X.ZERO,i.center),i.radius=0,i;var r=$$14;r.x=e[0]+t[0],r.y=e[1]+t[1],r.z=e[2]+t[2];var n,o=t$X.clone(r,T$13),a=t$X.clone(r,F$1l),s=t$X.clone(r,I$1w),l=t$X.clone(r,J$17),u=t$X.clone(r,K$12),c=t$X.clone(r,Q$18),h=e.length;for(n=0;n<h;n+=3){var d=e[n]+t[n],f=e[n+1]+t[n+1],p=e[n+2]+t[n+2];r.x=d,r.y=f,r.z=p,d<o.x&&t$X.clone(r,o),d>l.x&&t$X.clone(r,l),f<a.y&&t$X.clone(r,a),f>u.y&&t$X.clone(r,u),p<s.z&&t$X.clone(r,s),p>c.z&&t$X.clone(r,c)}var _=t$X.magnitudeSquared(t$X.subtract(l,o,M$1c)),m=t$X.magnitudeSquared(t$X.subtract(u,a,M$1c)),$=t$X.magnitudeSquared(t$X.subtract(c,s,M$1c)),g=o,v=l,y=_;m>y&&(y=m,g=a,v=u),$>y&&(y=$,g=s,v=c);var x=L$1m;x.x=.5*(g.x+v.x),x.y=.5*(g.y+v.y),x.z=.5*(g.z+v.z);var b=t$X.magnitudeSquared(t$X.subtract(v,x,M$1c)),w=Math.sqrt(b),C=H$16;C.x=o.x,C.y=a.y,C.z=s.z;var T=s$_;T.x=l.x,T.y=u.y,T.z=c.z;var S=t$X.midpoint(C,T,aa$5),E=0;for(n=0;n<h;n+=3){r.x=e[n]+t[n],r.y=e[n+1]+t[n+1],r.z=e[n+2]+t[n+2];var A=t$X.magnitude(t$X.subtract(r,S,M$1c));A>E&&(E=A);var P=t$X.magnitudeSquared(t$X.subtract(r,x,M$1c));if(P>b){var I=Math.sqrt(P);b=(w=.5*(w+I))*w;var M=I-w;x.x=(w*x.x+M*r.x)/I,x.y=(w*x.y+M*r.y)/I,x.z=(w*x.z+M*r.z)/I}}return w<E?(t$X.clone(x,i.center),i.radius=w):(t$X.clone(S,i.center),i.radius=E),i},i$19.fromCornerPoints=function(e,t,i){o$1u.typeOf.object("corner",e),o$1u.typeOf.object("oppositeCorner",t),e$28(i)||(i=new i$19);var r=t$X.midpoint(e,t,i.center);return i.radius=t$X.distance(r,t),i},i$19.fromEllipsoid=function(e,t){return o$1u.typeOf.object("ellipsoid",e),e$28(t)||(t=new i$19),t$X.clone(t$X.ZERO,t.center),t.radius=e.maximumRadius,t};var za$5=new t$X;i$19.fromBoundingSpheres=function(e,t){if(e$28(t)||(t=new i$19),!e$28(e)||0===e.length)return t.center=t$X.clone(t$X.ZERO,t.center),t.radius=0,t;var i=e.length;if(1===i)return i$19.clone(e[0],t);if(2===i)return i$19.union(e[0],e[1],t);var r,n=[];for(r=0;r<i;r++)n.push(e[r].center);var o=(t=i$19.fromPoints(n,t)).center,a=t.radius;for(r=0;r<i;r++){var s=e[r];a=Math.max(a,t$X.distance(o,s.center,za$5)+s.radius)}return t.radius=a,t};var Sa$4=new t$X,ha$4=new t$X,pa$3=new t$X;i$19.fromOrientedBoundingBox=function(e,t){o$1u.defined("orientedBoundingBox",e),e$28(t)||(t=new i$19);var i=e.halfAxes,r=p$1a.getColumn(i,0,Sa$4),n=p$1a.getColumn(i,1,ha$4),o=p$1a.getColumn(i,2,pa$3);return t$X.add(r,n,r),t$X.add(r,o,r),t.center=t$X.clone(e.center,t.center),t.radius=t$X.magnitude(r),t},i$19.clone=function(e,t){if(e$28(e))return e$28(t)?(t.center=t$X.clone(e.center,t.center),t.radius=e.radius,t):new i$19(e.center,e.radius)},i$19.packedLength=4,i$19.pack=function(e,t,i){o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0);var r=e.center;return t[i++]=r.x,t[i++]=r.y,t[i++]=r.z,t[i]=e.radius,t},i$19.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new i$19);var r=i.center;return r.x=e[t++],r.y=e[t++],r.z=e[t++],i.radius=e[t],i};var wa$5=new t$X,Oa$6=new t$X;i$19.union=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e$28(i)||(i=new i$19);var r=e.center,n=e.radius,o=t.center,a=t.radius,s=t$X.subtract(o,r,wa$5),l=t$X.magnitude(s);if(n>=l+a)return e.clone(i),i;if(a>=l+n)return t.clone(i),i;var u=.5*(n+l+a),c=t$X.multiplyByScalar(s,(-n+u)/l,Oa$6);return t$X.add(c,r,c),t$X.clone(c,i.center),i.radius=u,i};var ba$6=new t$X;i$19.expand=function(e,t,i){o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("point",t),i=i$19.clone(e,i);var r=t$X.magnitude(t$X.subtract(t,i.center,ba$6));return r>i.radius&&(i.radius=r),i},i$19.intersectPlane=function(e,t){o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("plane",t);var i=e.center,r=e.radius,n=t.normal,o=t$X.dot(n,i)+t.distance;return o<-r?pt$a.OUTSIDE:o<r?pt$a.INTERSECTING:pt$a.INSIDE},i$19.transform=function(e,t,i){return o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("transform",t),e$28(i)||(i=new i$19),i.center=y$15.multiplyByPoint(t,e.center,i.center),i.radius=y$15.getMaximumScale(t)*e.radius,i};var ga$5=new t$X;i$19.distanceSquaredTo=function(e,t){o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("cartesian",t);var i=t$X.subtract(e.center,t,ga$5);return t$X.magnitudeSquared(i)-e.radius*e.radius},i$19.transformWithoutScale=function(e,t,i){return o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("transform",t),e$28(i)||(i=new i$19),i.center=y$15.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var Ma$6=new t$X;i$19.computePlaneDistances=function(e,t,i,r){o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("position",t),o$1u.typeOf.object("direction",i),e$28(r)||(r=new o$1t);var n=t$X.subtract(e.center,t,Ma$6),o=t$X.dot(i,n);return r.start=o-e.radius,r.stop=o+e.radius,r};for(var ca$4=new t$X,Ra$7=new t$X,qa$5=new t$X,ja$3=new t$X,Pa$5=new t$X,Ba$5=new t$W,ia$4=new Array(8),na$3=0;na$3<8;++na$3)ia$4[na$3]=new t$X;var Da$6=new n$1b;function h$$(e){if(e instanceof h$$)this.scheme=e.scheme,this.authority=e.authority,this.path=e.path,this.query=e.query,this.fragment=e.fragment;else if(e){var t=o$1s.exec(e);this.scheme=t[1],this.authority=t[2],this.path=t[3],this.query=t[4],this.fragment=t[5]}}i$19.projectTo2D=function(e,t,i){o$1u.typeOf.object("sphere",e);var r,n=(t=u$Y(t,Da$6)).ellipsoid,o=e.center,a=e.radius;r=t$X.equals(o,t$X.ZERO)?t$X.clone(t$X.UNIT_X,ca$4):n.geodeticSurfaceNormal(o,ca$4);var s=t$X.cross(t$X.UNIT_Z,r,Ra$7);t$X.normalize(s,s);var l=t$X.cross(r,s,qa$5);t$X.normalize(l,l),t$X.multiplyByScalar(r,a,r),t$X.multiplyByScalar(l,a,l),t$X.multiplyByScalar(s,a,s);var u=t$X.negate(l,Pa$5),c=t$X.negate(s,ja$3),h=ia$4,d=h[0];t$X.add(r,l,d),t$X.add(d,s,d),d=h[1],t$X.add(r,l,d),t$X.add(d,c,d),d=h[2],t$X.add(r,u,d),t$X.add(d,c,d),d=h[3],t$X.add(r,u,d),t$X.add(d,s,d),t$X.negate(r,r),d=h[4],t$X.add(r,l,d),t$X.add(d,s,d),d=h[5],t$X.add(r,l,d),t$X.add(d,c,d),d=h[6],t$X.add(r,u,d),t$X.add(d,c,d),d=h[7],t$X.add(r,u,d),t$X.add(d,s,d);for(var f=h.length,p=0;p<f;++p){var _=h[p];t$X.add(o,_,_);var m=n.cartesianToCartographic(_,Ba$5);t.project(m,_)}var $=(o=(i=i$19.fromPoints(h,i)).center).x,g=o.y,v=o.z;return o.x=v,o.y=$,o.z=g,i},i$19.isOccluded=function(e,t){return o$1u.typeOf.object("sphere",e),o$1u.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},i$19.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&t$X.equals(e.center,t.center)&&e.radius===t.radius},i$19.prototype.intersectPlane=function(e){return i$19.intersectPlane(this,e)},i$19.prototype.distanceSquaredTo=function(e){return i$19.distanceSquaredTo(this,e)},i$19.prototype.computePlaneDistances=function(e,t,i){return i$19.computePlaneDistances(this,e,t,i)},i$19.prototype.isOccluded=function(e){return i$19.isOccluded(this,e)},i$19.prototype.equals=function(e){return i$19.equals(this,e)},i$19.prototype.clone=function(e){return i$19.clone(this,e)},i$19.prototype.volume=function(){var e=this.radius;return da$5*e*e*e},h$$.prototype.scheme=null,h$$.prototype.authority=null,h$$.prototype.path="",h$$.prototype.query=null,h$$.prototype.fragment=null;var o$1s=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");h$$.prototype.getScheme=function(){return this.scheme},h$$.prototype.getAuthority=function(){return this.authority},h$$.prototype.getPath=function(){return this.path},h$$.prototype.getQuery=function(){return this.query},h$$.prototype.getFragment=function(){return this.fragment},h$$.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},h$$.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},h$$.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},h$$.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(n$1a,u$W).replace(s$Z,a$19)),this.path&&(this.path=this.path.replace(s$Z,a$19)),this.query&&(this.query=this.query.replace(s$Z,a$19)),this.fragment&&(this.fragment=this.fragment.replace(s$Z,a$19))};var s$Z=/%[0-9a-z]{2}/gi,p$18=/[a-zA-Z0-9\-\._~]/,n$1a=/(.*@)?([^@:]*)(:.*)?/,H$15,M$1b,S$10;function a$19(e){var t=unescape(e);return p$18.test(t)?t:e.toUpperCase()}function u$W(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}function o$1r(e,t){var i;return typeof document<"u"&&(i=document),o$1r._implementation(e,t,i)}function o$1q(e,t,i,r){return y$14(e).then(t,i,r)}function y$14(e){var t,i;return e instanceof _$16?t=e:T$12(e)?(i=k$1g(),e.then((function(e){i.resolve(e)}),(function(e){i.reject(e)}),(function(e){i.progress(e)})),t=i.promise):t=G$1i(e),t}function D$19(e){return o$1q(e,b$1g)}function _$16(e){this.then=e}function G$1i(e){var t=new _$16((function(t){try{return y$14(t?t(e):e)}catch(e){return b$1g(e)}}));return t}function b$1g(e){var t=new _$16((function(t,i){try{return i?y$14(i(e)):b$1g(e)}catch(e){return b$1g(e)}}));return t}function k$1g(){var e,t,i,r,n,o;return e=new _$16(a),t=[],i=[],r=function(e,r,n){var o,a;return o=k$1g(),a="function"==typeof n?function(e){try{o.progress(n(e))}catch(e){o.progress(e)}}:function(e){o.progress(e)},t.push((function(t){t.then(e,r).then(o.resolve,o.reject,a)})),i.push(a),o.promise},n=function(e){return Q$17(i,e),e},o=function(e){return e=y$14(e),r=e.then,o=y$14,n=P$1e,Q$17(t,e),i=t=S$10,e},{then:a,resolve:s,reject:l,progress:u,promise:e,resolver:{resolve:s,reject:l,progress:u}};function a(e,t,i){return r(e,t,i)}function s(e){return o(e)}function l(e){return o(b$1g(e))}function u(e){return n(e)}}function T$12(e){return e&&"function"==typeof e.then}function A$1i(e,t,i,r,n){return E$1l(2,arguments),o$1q(e,(function(e){var o,a,s,l,u,c,h,d,f,p;if(f=e.length>>>0,o=Math.max(0,Math.min(t,f)),s=[],a=f-o+1,l=[],u=k$1g(),o)for(d=u.progress,h=function(e){l.push(e),--a||(c=h=P$1e,u.reject(l))},c=function(e){s.push(e),--o||(c=h=P$1e,u.resolve(s))},p=0;p<f;++p)p in e&&o$1q(e[p],m,_,d);else u.resolve(s);return u.then(i,r,n);function _(e){h(e)}function m(e){c(e)}}))}function I$1v(e,t,i,r){return E$1l(1,arguments),o$1q(e,(function(e){var n,o,a,s,l,u,c,h,d;for(c=e.length>>>0,h=e.length>>>0,n=[],o=[],u=(a=k$1g()).progress,l=function(e){o.push(e),--h||(s=l=P$1e,a.resolve(n))},s=function(e,t){n[t]=e,--h||(s=l=P$1e,a.resolve(n))},d=0;d<c;++d)switch(d){case 0:o$1q(e[d],_,f,u);break;case 1:o$1q(e[d],m,f,u);break;case 2:o$1q(e[d],$,f,u);break;case 3:o$1q(e[d],g,f,u);break;case 4:o$1q(e[d],v,f,u);break;default:o$1q(e[d],p,f,u)}return a.then(t,i,r);function f(e){l(e)}function p(e){s(e,0)}function _(e){s(e,0)}function m(e){s(e,1)}function $(e){s(e,2)}function g(e){s(e,3)}function v(e){s(e,4)}}))}function J$16(e,t,i,r){return A$1i(e,1,(function(e){return t?t(e[0]):e[0]}),i,r)}function L$1l(e,t,i,r){return E$1l(1,arguments),x$1k(e,q$1d).then(t,i,r)}function K$11(){return x$1k(arguments,q$1d)}function x$1k(e,t){return o$1q(e,(function(e){var i,r,n,o,a,s;if(n=r=e.length>>>0,i=[],s=k$1g(),n)for(o=function(e,r){o$1q(e,t).then((function(e){i[r]=e,--n||s.resolve(i)}),s.reject)},a=0;a<r;a++)a in e?o(e[a],a):--n;else s.resolve(i);return s.promise}))}function N$X(e,t){var i=M$1b.call(arguments,1);return o$1q(e,(function(e){var r;return r=e.length,i[0]=function(e,i,n){return o$1q(e,(function(e){return o$1q(i,(function(i){return t(e,i,n,r)}))}))},H$15.apply(e,i)}))}function U$19(e,t,i){var r=arguments.length>2;return o$1q(e,(function(e){return e=r?i:e,t.resolve(e),e}),(function(e){return t.reject(e),b$1g(e)}),t.progress)}function Q$17(e,t){for(var i,r=0;i=e[r++];)i(t)}function E$1l(e,t){for(var i,r=t.length;r>e;)if(null!=(i=t[--r])&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function P$1e(){}function q$1d(e){return e}function l$1e(e,t){if(null===e||"object"!=typeof e)return e;t=u$Y(t,!1);var i=new e.constructor;for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];t&&(n=l$1e(n,t)),i[r]=n}return i}function p$17(e,t,i){i=u$Y(i,!1);var r,n,o,a={},s=e$28(e),l=e$28(t);if(s)for(r in e)e.hasOwnProperty(r)&&(n=e[r],l&&i&&"object"==typeof n&&t.hasOwnProperty(r)?(o=t[r],a[r]="object"==typeof o?p$17(n,o,i):n):a[r]=n);if(l)for(r in t)t.hasOwnProperty(r)&&!a.hasOwnProperty(r)&&(o=t[r],a[r]=o);return a}function i$18(e,t){if(!e$28(e))throw new t$Z("uri is required.");var i="",r=e.lastIndexOf("/");return-1!==r&&(i=e.substring(0,r+1)),t&&(e$28((e=new h$$(e)).query)&&(i+="?"+e.query),e$28(e.fragment)&&(i+="#"+e.fragment)),i}function a$18(e){if(!e$28(e))throw new t$Z("uri is required.");var t=new h$$(e);t.normalize();var i=t.path,r=i.lastIndexOf("/");return-1!==r&&(i=i.substr(r+1)),r=i.lastIndexOf("."),i=-1===r?"":i.substr(r+1)}h$$.prototype.resolve=function(e){var t=new h$$;return this.scheme?(t.scheme=this.scheme,t.authority=this.authority,t.path=this.path,t.query=this.query):(t.scheme=e.scheme,this.authority?(t.authority=this.authority,t.path=this.path,t.query=this.query):(t.authority=e.authority,""==this.path?(t.path=e.path,t.query=this.query||e.query):("/"==this.path.charAt(0)?(t.path=this.path,t.removeDotSegments()):(e.authority&&""==e.path?t.path="/"+this.path:t.path=e.path.substring(0,e.path.lastIndexOf("/")+1)+this.path,t.removeDotSegments()),t.query=this.query))),t.fragment=this.fragment,t},h$$.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]&&t.shift();t.length;)".."==(e=t.shift())?i.pop():"."!=e&&i.push(e);("."==e||".."==e)&&i.push(""),r&&i.unshift(""),this.path=i.join("/")},h$$.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},o$1r._implementation=function(e,t,i){if(!e$28(e))throw new t$Z("relative uri is required.");if(!e$28(t)){if(typeof i>"u")return e;t=u$Y(i.baseURI,i.location.href)}var r=new h$$(t);return new h$$(e).resolve(r).toString()},o$1q.defer=k$1g,o$1q.resolve=y$14,o$1q.reject=D$19,o$1q.join=K$11,o$1q.all=L$1l,o$1q.map=x$1k,o$1q.reduce=N$X,o$1q.any=J$16,o$1q.some=A$1i,o$1q.allSettled=I$1v,o$1q.chain=U$19,o$1q.isPromise=T$12,_$16.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(S$10,e)},yield:function(e){return this.then((function(){return e}))},spread:function(e){return this.then((function(t){return L$1l(t,(function(t){return e.apply(S$10,t)}))}))}},M$1b=[].slice,H$15=[].reduce||function(e){var t,i,r,n,o;if(o=0,n=(t=Object(this)).length>>>0,(i=arguments).length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o<n;++o)o in t&&(r=e(r,t[o],o,t));return r};var e$24=/^blob:/i,o$1p;function i$17(e){return o$1u.typeOf.string("uri",e),e$24.test(e)}function i$16(e){e$28(o$1p)||(o$1p=document.createElement("a")),o$1p.href=window.location.href;var t=o$1p.host,i=o$1p.protocol;return o$1p.href=e,o$1p.href=o$1p.href,i!==o$1p.protocol||t!==o$1p.host}var a$17=/^data:/i;function e$23(e){return o$1u.typeOf.string("uri",e),a$17.test(e)}function a$16(e){var t=o$1q.defer(),i=document.createElement("script");i.async=!0,i.src=e;var r=document.getElementsByTagName("head")[0];return i.onload=function(){i.onload=void 0,r.removeChild(i),t.resolve()},i.onerror=function(e){t.reject(e)},r.appendChild(i),t.promise}function m$1k(e,t){if(!e$28(e))throw new t$Z("obj is required.");var i="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(Array.isArray(n))for(var a=0,s=n.length;a<s;++a)i+=!0===t?o+encodeURI(n[a])+"&":o+encodeURIComponent(n[a])+"&";else i+=!0===t?o+encodeURI(n)+"&":o+encodeURIComponent(n)+"&"}return i=i.slice(0,-1)}function m$1j(e){if(!e$28(e))throw new t$Z("queryString is required.");var t={};if(""===e)return t;for(var i=e.replace(/\+/g,"%20").split(/[&;]/),r=0,n=i.length;r<n;++r){var o=i[r].split("=");if(o.length>2){var a=i[r].indexOf("=");o=[i[r].substring(0,a),i[r].substring(a+1,i[r].length)]}var s=decodeURIComponent(o[0]),l=o[1];l=e$28(l)?decodeURIComponent(l):"";var u=t[s];"string"==typeof u?t[s]=[u,l]:Array.isArray(u)?u.push(l):t[s]=l}return t}var e$22={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},W$14=Object.freeze(e$22),e$21={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3,PACK:4,BLOCK:5,BLOCKPACK:6},$$13=Object.freeze(e$21),e$20;function r$1c(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.throttleByServer,!1),i=u$Y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=u$Y(e.priority,0),this.throttle=i,this.throttleByServer=t,this.type=u$Y(e.type,$$13.OTHER),this.serverKey=void 0,this.state=W$14.UNISSUED,this.deferred=void 0,this.cancelled=!1}function n$19(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n=i[r],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}function s$Y(e,t,i){this.statusCode=e,this.response=t,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=n$19(this.responseHeaders))}function o$1o(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function v$S(e,t){return t-e}function o$1n(e){o$1u.typeOf.object("options",e),o$1u.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function m$1i(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}r$1c.prototype.cancel=function(){this.cancelled=!0},r$1c.prototype.clone=function(e){return e$28(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new r$1c(this)},s$Y.prototype.toString=function(){var e="Request has failed.";return e$28(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(o$1o.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),o$1o.prototype.addEventListener=function(e,t){o$1u.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},o$1o.prototype.removeEventListener=function(e,t){o$1u.typeOf.func("listener",e);for(var i=this._listeners,r=this._scopes,n=-1,o=0;o<i.length;o++)if(i[o]===e&&r[o]===t){n=o;break}return-1!==n&&(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0)},o$1o.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var e,t=this._listeners,i=this._scopes,r=t.length;for(e=0;e<r;e++){var n=t[e];e$28(n)&&t[e].apply(i[e],arguments)}var o=this._toRemove;if((r=o.length)>0){for(o.sort(v$S),e=0;e<r;e++){var a=o[e];t.splice(a,1),i.splice(a,1)}o.length=0}this._insideRaiseEvent=!1},Object.defineProperties(o$1n.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),o$1n.prototype.reserve=function(e){e=u$Y(e,this._length),this._array.length=e},o$1n.prototype.heapify=function(e){e=u$Y(e,0);for(var t=this._length,i=this._comparator,r=this._array,n=-1,o=!0;o;){var a=2*(e+1),s=a-1;n=s<t&&i(r[s],r[e])<0?s:e,a<t&&i(r[a],r[n])<0&&(n=a),n!==e?(m$1i(r,n,e),e=n):o=!1}},o$1n.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},o$1n.prototype.insert=function(e){o$1u.defined("element",e);var t,i=this._array,r=this._comparator,n=this._maximumLength,o=this._length++;for(o<i.length?i[o]=e:i.push(e);0!==o;){var a=Math.floor((o-1)/2);if(!(r(i[o],i[a])<0))break;m$1i(i,o,a),o=a}return e$28(n)&&this._length>n&&(t=i[n],i.pop(),this._length=n),t},o$1n.prototype.pop=function(e){if(e=u$Y(e,0),0!==this._length){o$1u.typeOf.number.lessThan("index",e,this._length);var t=this._array,i=t[e];return m$1i(t,e,--this._length),t[this._length]=void 0,this.heapify(e),i}},e$20=typeof performance<"u"&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};var kt$7=e$20;function S$$(e,t){return e.priority-t.priority}var i$15={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0,totalRequestTime:0},b$1f=20,o$1m=new o$1n({comparator:S$$});o$1m.maximumLength=b$1f,o$1m.reserve(b$1f);var c$1a=[],v$R={},I$1u=typeof document<"u"?new h$$(document.location.href):new h$$,k$1f=new o$1o;function r$1b(){}function K$10(e){e$28(e.priorityFunction)&&(e.priority=e.priorityFunction())}function C$15(e){var t=u$Y(r$1b.requestsByServer[e],r$1b.maximumRequestsPerServer);return v$R[e]<t}function q$1c(e){return e$28(e.packKey)||(e.packKey=e.serverKey+"_"+e.providerName),e.packKey}function L$1k(e){return e$28(e.blockKey)||(e.blockKey=e.serverKey+"_"+e.providerName+"_"+e.quadKey+e.url.substring(e.url.indexOf("dataVersion"))),e.blockKey}function N$W(e){var t=q$1c(e);return e$28(r$1b.packRequestGroup[t])||(r$1b.packRequestGroup[t]=[]),e$28(r$1b.packRequestQuadKey[t])||(r$1b.packRequestQuadKey[t]=""),e$28(r$1b.packRequestPromise[t])||(r$1b.packRequestPromise[t]=o$1q.defer()),e$28(r$1b.quadKeyIndex[t])||(r$1b.quadKeyIndex[t]=0),e.quadKeyIndex=r$1b.quadKeyIndex[t]++,e.deferred=r$1b.packRequestPromise[t],e.state=W$14.ISSUED,r$1b.packRequestGroup[t].push(e),e.deferred.promise}function T$11(e){var t=L$1k(e),i=r$1b.blockDefer[t];return e$28(i)||(i=r$1b.blockDefer[t]=o$1q.defer(),r$1b.blockRequest[t]=e),e.deferred=i,e.state=W$14.ISSUED,e.deferred.promise}function H$14(){r$1b.packRequestGroup={},r$1b.packRequestPromise={},r$1b.packRequestQuadKey={},r$1b.quadKeyIndex={}}function U$18(){r$1b.blockRequest={}}function Q$16(e){for(var t=0,i=e.length;t<i;t++){e[t].state=W$14.CANCELLED}}function j$1e(e){for(var t=[],i={},r=0,n=e.length;r<n;r++){var o=e[r];if(!o.cancelled){var a=o.quadKey;i[a]||(i[a]=!0,t.push(a))}}return t}function V$$(){var e=r$1b.packRequestGroup;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];if(i.length<1)continue;var r=i[0].clone(),n=-1!==r.url.indexOf("rest/maps");r.serverKey=i[0].serverKey,r.state=i[0].state;var o=r.url,a=j$1e(i);if(a.length<1)continue;r$1b.packRequestQuadKey[t]=n?a.join(","):a.join(";");var s=r$1b.packRequestQuadKey[t];if(r.throttleByServer&&!C$15(r.serverKey)){Q$16(i),r$1b.packRequestPromise[t].reject();continue}r.deferred=r$1b.packRequestPromise[t];var l=new h$$(o);l.query=n?e$28(l.query)?l.query+"&tiles="+s:"tiles="+s:e$28(l.query)?l.query+"&extratiles="+s:"extratiles="+s,r.url=l.toString(),A$1h(r,r.url)}H$14()}function _$15(){var e=r$1b.blockRequest;for(var t in e)if(e.hasOwnProperty(t)){A$1h(e[t])}U$18()}function x$1j(e){if(e.state===W$14.UNISSUED)if(e.state=W$14.ISSUED,e.type===$$13.PACK||e.type===$$13.BLOCKPACK){var t=q$1c(e);e$28(r$1b.packRequestPromise[t])||(r$1b.packRequestPromise[t]=o$1q.defer()),e.deferred=r$1b.packRequestPromise[t]}else e.deferred=o$1q.defer();return e.deferred.promise}function M$1a(e){return function(t){if(e.state!==W$14.CANCELLED&&(--i$15.numberOfActiveRequests,--v$R[e.serverKey],k$1f.raiseEvent(),e.state=W$14.RECEIVED,e.deferred.resolve(t),e.endTime=kt$7(),(r$1b.statisticRequestTime>0||e.type!==$$13.OTHER)&&(i$15.totalRequestTime+=e.endTime-e.startTime),e.type===$$13.BLOCK||e.type===$$13.BLOCKPACK)){var i=L$1k(e);e$28(r$1b.blockDefer[i])&&(r$1b.blockDefer[i]=void 0,delete r$1b.blockDefer[i])}}}function z$_(e){return function(t){e.state!==W$14.CANCELLED&&(++i$15.numberOfFailedRequests,--i$15.numberOfActiveRequests,--v$R[e.serverKey],k$1f.raiseEvent(t),e.state=W$14.FAILED,e.deferred.reject(t))}}function A$1h(e,t){var i=x$1j(e);return e.state=W$14.ACTIVE,c$1a.push(e),++i$15.numberOfActiveRequests,++i$15.numberOfActiveRequestsEver,++v$R[e.serverKey],e.startTime=kt$7(),e.requestFunction(t).then(M$1a(e)).otherwise(z$_(e)),i}function p$16(e){var t=e.state===W$14.ACTIVE;e.state=W$14.CANCELLED,++i$15.numberOfCancelledRequests,e.deferred.reject(),t&&(--i$15.numberOfActiveRequests,--v$R[e.serverKey],++i$15.numberOfCancelledActiveRequests),e$28(e.cancelFunction)&&e.cancelFunction()}function G$1h(){for(var e in r$1b.packRequestHeap)if(r$1b.packRequestHeap.hasOwnProperty(e)){for(var t=r$1b.packRequestHeap[e],i=t.internalArray,r=t.length,n=0;n<r;++n)K$10(i[n]);t.resort()}}function J$15(){for(var e in r$1b.packRequestHeap)if(r$1b.packRequestHeap.hasOwnProperty(e))for(var t=r$1b.packRequestHeap[e];t.length>0;){var i=t.pop();i.cancelled?p$16(i):N$W(i)}V$$()}function W$13(e){var t=q$1c(e),i=r$1b.packRequestHeap[t];return e$28(i)||((i=r$1b.packRequestHeap[t]=new o$1n({comparator:S$$})).maximumLength=r$1b.perPacketCount,i.reserve(b$1f)),i}function X$$(){!r$1b.debugShowStatistics||(0===i$15.numberOfActiveRequests&&i$15.lastNumberOfActiveRequests>0&&(i$15.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+i$15.numberOfAttemptedRequests),i$15.numberOfAttemptedRequests=0),i$15.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+i$15.numberOfCancelledRequests),i$15.numberOfCancelledRequests=0),i$15.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+i$15.numberOfCancelledActiveRequests),i$15.numberOfCancelledActiveRequests=0),i$15.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+i$15.numberOfFailedRequests),i$15.numberOfFailedRequests=0)),i$15.lastNumberOfActiveRequests=i$15.numberOfActiveRequests)}r$1b.TIMEOUT=5e3,r$1b.CANCLE_COUNT=3,r$1b.statisticRequestTime=-1,r$1b.maximumRequests=50,r$1b.maximumRequestsPerServer=6,r$1b.perPacketCount=20,r$1b.requestsByServer={},r$1b.throttleRequests=!0,r$1b.debugShowStatistics=!1,r$1b.requestCompletedEvent=k$1f,Object.defineProperties(r$1b,{activeRequestLength:{get:function(){return c$1a.length}},statistics:{get:function(){return i$15}},priorityHeapLength:{get:function(){return b$1f},set:function(e){if(e<b$1f)for(;o$1m.length>e;){p$16(o$1m.pop())}b$1f=e,o$1m.maximumLength=e,o$1m.reserve(e)}}}),r$1b.packRequestGroup={},r$1b.packRequestPromise={},r$1b.packRequestQuadKey={},r$1b.quadKeyIndex={},r$1b.packRequestHeap={},r$1b.blockDefer={},r$1b.blockRequest={},r$1b.update=function(){var e,t,i=0,r=c$1a.length;for(e=0;e<r;++e)(t=c$1a[e]).cancelled&&p$16(t),t.state===W$14.ACTIVE?i>0&&(c$1a[e-i]=t):++i;c$1a.length-=i;var n=o$1m.internalArray,o=o$1m.length;for(e=0;e<o;++e)K$10(n[e]);o$1m.resort(),G$1h(),_$15(),J$15();for(var a=Math.max(r$1b.maximumRequests-c$1a.length,0),s=0;s<a&&o$1m.length>0;)(t=o$1m.pop()).cancelled?p$16(t):!t.throttleByServer||C$15(t.serverKey)?(A$1h(t),++s):p$16(t);X$$()},r$1b.getServerKey=function(e){o$1u.typeOf.string("url",e);var t=new h$$(e).resolve(I$1u);t.normalize();var i=t.authority;return/:/.test(i)||(i=i+":"+("https"===t.scheme?"443":"80")),e$28(v$R[i])||(v$R[i]=0),i},r$1b.request=function(e){if(o$1u.typeOf.object("request",e),o$1u.typeOf.string("request.url",e.url),o$1u.typeOf.func("request.requestFunction",e.requestFunction),e$23(e.url)||i$17(e.url))return k$1f.raiseEvent(),e.state=W$14.RECEIVED,e.requestFunction();if(++i$15.numberOfAttemptedRequests,e$28(e.serverKey)||(e.serverKey=r$1b.getServerKey(e.url)),e.type===$$13.BLOCK)return T$11(e);if(!e.throttleByServer||C$15(e.serverKey)){if(!r$1b.throttleRequests||!e.throttle)return A$1h(e);if(!(c$1a.length>=r$1b.maximumRequests)){var t;if(K$10(e),e.type===$$13.PACK||e.type===$$13.BLOCKPACK){var i=W$13(e),r=!0;if(e.type===$$13.BLOCKPACK)for(var n=0;n<i.length;n++)if(i._array[n].quadKey===e.quadKey){e.blockRequest=i._array[n],r=!1;break}r&&(t=i.insert(e))}else t=o$1m.insert(e);if(e$28(t)){if(t===e)return;p$16(t)}return x$1j(e)}}},r$1b.clearForSpecs=function(){for(;o$1m.length>0;){p$16(o$1m.pop())}for(var e=c$1a.length,t=0;t<e;++t)p$16(c$1a[t]);c$1a.length=0,v$R={},i$15.numberOfAttemptedRequests=0,i$15.numberOfActiveRequests=0,i$15.numberOfCancelledRequests=0,i$15.numberOfCancelledActiveRequests=0,i$15.numberOfFailedRequests=0,i$15.numberOfActiveRequestsEver=0,i$15.lastNumberOfActiveRequests=0,i$15.totalRequestTime=0},r$1b.numberOfActiveRequestsByServer=function(e){return v$R[e]},r$1b.requestHeap=o$1m;var u$V={},n$18={};function w$X(e){var t=new h$$(e);t.normalize();var i=t.getAuthority();if(e$28(i)){if(-1!==i.indexOf("@")){var r=i.split("@");i=r[1]}if(-1===i.indexOf(":")){var n=t.getScheme();if(e$28(n)||(n=(n=window.location.protocol).substring(0,n.length-1)),"http"===n)i+=":80";else{if("https"!==n)return;i+=":443"}}return i}}u$V.add=function(e,t){if(!e$28(e))throw new t$Z("host is required.");if(!e$28(t)||t<=0)throw new t$Z("port is required to be greater than 0.");var i=e.toLowerCase()+":"+t;e$28(n$18[i])||(n$18[i]=!0)},u$V.remove=function(e,t){if(!e$28(e))throw new t$Z("host is required.");if(!e$28(t)||t<=0)throw new t$Z("port is required to be greater than 0.");var i=e.toLowerCase()+":"+t;e$28(n$18[i])&&delete n$18[i]},u$V.contains=function(e){if(!e$28(e))throw new t$Z("url is required.");var t=w$X(e);return!(!e$28(t)||!e$28(n$18[t]))},u$V.clear=function(){n$18={}};var i$14={};function e$1$(e,t){if(!e$28(e))throw new t$Z("identifier is required.");e$28(i$14[e])||(i$14[e]=!0,console.warn(u$Y(t,e)))}function t$T(e,t){if(!e$28(e)||!e$28(t))throw new t$Z("identifier and message are required.");e$1$(e,t)}e$1$.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",e$1$.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",e$1$.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",e$1$.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var L$1j=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch{return!1}}(),_$14;function x$1i(e,t,i,r){var n,o=e.query;if(!e$28(o)||0===o.length)return{};if(-1===o.indexOf("=")){var a={};a[o]=void 0,n=a}else n=m$1j(o);t._queryParameters=i?O$V(n,t._queryParameters,r):n,e.query=void 0}function re$D(e,t){var i=t._queryParameters,r=Object.keys(i);1!==r.length||e$28(i[r[0]])?e.query=m$1k(i):e.query=r[0]}function v$Q(e,t){return e$28(e)?e$28(e.clone)?e.clone():l$1e(e):t}function C$14(e){if(e.state===W$14.ISSUED||e.state===W$14.ACTIVE)throw new t$U("The Resource is already being fetched.");e.state=W$14.UNISSUED,e.deferred=void 0}function O$V(e,t,i){if(!i)return p$17(e,t);var r=l$1e(e,!0);for(var n in t)if(t.hasOwnProperty(n)){var o=r[n],a=t[n];e$28(o)?(Array.isArray(o)||(o=r[n]=[o]),r[n]=o.concat(a)):r[n]=Array.isArray(a)?a.slice():a}return r}function t$S(e){"string"==typeof(e=u$Y(e,u$Y.EMPTY_OBJECT))&&(e={url:e}),o$1u.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=v$Q(e.templateValues,{}),this._queryParameters=v$Q(e.queryParameters,{}),this.headers=v$Q(e.headers,{}),this.request=u$Y(e.request,new r$1c),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=u$Y(e.retryAttempts,0),this._retryCount=0;var t=new h$$(e.url);x$1i(t,this,!0,!0),t.fragment=void 0,this._url=t.toString()}function j$1d(e){var t=e.resource,i=e.flipY,r=e.preferImageBitmap,n=t.request;n.url=t.url,n.requestFunction=function(){var e=!1;!t.isDataUri&&!t.isBlobUri&&(e=t.isCrossOriginUrl);var o=o$1q.defer();return t$S._Implementations.createImage(n,e,o,i,r),o.promise};var o=r$1b.request(n);if(e$28(o))return o.otherwise((function(e){return n.state!==W$14.FAILED?o$1q.reject(e):t.retryOnError(e).then((function(o){return o?(n.state=W$14.UNISSUED,n.deferred=void 0,j$1d({resource:t,flipY:i,preferImageBitmap:r})):o$1q.reject(e)}))}))}function k$1e(e,t,i){var r={};r[t]=i,e.setQueryParameters(r);var n=e.request;n.url=e.url,n.requestFunction=function(){var t=o$1q.defer();return window[i]=function(e){t.resolve(e);try{delete window[i]}catch{window[i]=void 0}},t$S._Implementations.loadAndExecuteScript(e.url,i,t),t.promise};var o=r$1b.request(n);if(e$28(o))return o.otherwise((function(r){return n.state!==W$14.FAILED?o$1q.reject(r):e.retryOnError(r).then((function(o){return o?(n.state=W$14.UNISSUED,n.deferred=void 0,k$1e(e,t,i)):o$1q.reject(r)}))}))}t$S.createIfNeeded=function(e){return e instanceof t$S?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new t$S({url:e})},t$S.supportsImageBitmapOptions=function(){if(e$28(_$14))return _$14;if("function"!=typeof createImageBitmap)return _$14=o$1q.resolve(!1);return _$14=t$S.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg=="}).then((function(e){return createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none"})})).then((function(e){return!0})).otherwise((function(){return!1})),_$14},Object.defineProperties(t$S,{isBlobSupported:{get:function(){return L$1j}}}),Object.defineProperties(t$S.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){var t=new h$$(e);x$1i(t,this,!1),t.fragment=void 0,this._url=t.toString()}},extension:{get:function(){return a$18(this._url)}},isDataUri:{get:function(){return e$23(this._url)}},isBlobUri:{get:function(){return i$17(this._url)}},isCrossOriginUrl:{get:function(){return i$16(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),t$S.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var i=new h$$(this._url);e&&re$D(i,this);var r=i.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),n=this._templateValues;return r=r.replace(/{(.*?)}/g,(function(e,t){var i=n[t];return e$28(i)&&"s"==t?encodeURI(i):e$28(i)?encodeURIComponent(i):e})),t&&e$28(this.proxy)&&(r=this.proxy.getURL(r)),r},t$S.prototype.setQueryParameters=function(e,t){this._queryParameters=t?O$V(this._queryParameters,e,!1):O$V(e,this._queryParameters,!1)},t$S.prototype.appendQueryParameters=function(e){this._queryParameters=O$V(e,this._queryParameters,!0)},t$S.prototype.setTemplateValues=function(e,t){this._templateValues=t?p$17(this._templateValues,e):p$17(e,this._templateValues)},t$S.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,e$28(e.url)){var i=new h$$(e.url);x$1i(i,t,!0,u$Y(e.preserveQueryParameters,!1)),i.fragment=void 0,t._url=i.resolve(new h$$(o$1r(this._url))).toString()}return e$28(e.queryParameters)&&(t._queryParameters=p$17(e.queryParameters,t._queryParameters)),e$28(e.templateValues)&&(t._templateValues=p$17(e.templateValues,t.templateValues)),e$28(e.headers)&&(t.headers=p$17(e.headers,t.headers)),e$28(e.proxy)&&(t.proxy=e.proxy),e$28(e.request)&&(t.request=e.request),e$28(e.retryCallback)&&(t.retryCallback=e.retryCallback),e$28(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},t$S.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return o$1q(!1);var i=this;return o$1q(t(this,e)).then((function(e){return++i._retryCount,e}))},t$S.prototype.clone=function(e){return e$28(e)||(e=new t$S({url:this._url})),e._url=this._url,e._queryParameters=l$1e(this._queryParameters),e._templateValues=l$1e(this._templateValues),e.headers=l$1e(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},t$S.prototype.getBaseUri=function(e){return i$18(this.getUrlComponent(e),e)},t$S.prototype.appendForwardSlash=function(){this._url=n$1c(this._url)},t$S.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},t$S.fetchArrayBuffer=function(e){return new t$S(e).fetchArrayBuffer()},t$S.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},t$S.fetchBlob=function(e){return new t$S(e).fetchBlob()},t$S.prototype.fetchImage=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.preferImageBitmap,!1),i=u$Y(e.preferBlob,!1),r=u$Y(e.flipY,!1);if(C$14(this.request),!L$1j||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!i)return j$1d({resource:this,flipY:r,preferImageBitmap:t});var n,o,a,s=this.fetchBlob();return e$28(s)?t$S.supportsImageBitmapOptions().then((function(e){return n=e&&t,s})).then((function(e){if(e$28(e)){if(a=e,n)return t$S.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return j$1d({resource:o=new t$S({url:t}),flipY:r,preferImageBitmap:!1})}})).then((function(e){if(e$28(e))return e.blob=a,n||window.URL.revokeObjectURL(o.url),e})).otherwise((function(e){return e$28(o)&&window.URL.revokeObjectURL(o.url),e.blob=a,o$1q.reject(e)})):void 0},t$S.fetchImage=function(e){return new t$S(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},t$S.prototype.fetchText=function(){return this.fetch({responseType:"text"})},t$S.fetchText=function(e){return new t$S(e).fetchText()},t$S.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(e$28(e))return e.then((function(e){if(e$28(e))return JSON.parse(e)}))},t$S.fetchJson=function(e){return new t$S(e).fetchJson()},t$S.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},t$S.fetchXML=function(e){return new t$S(e).fetchXML()},t$S.prototype.fetchJsonp=function(e){var t;e=u$Y(e,"callback"),C$14(this.request);do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(e$28(window[t]));return k$1e(this,e,t)},t$S.fetchJsonp=function(e){return new t$S(e).fetchJsonp(e.callbackParameterName)},t$S.prototype._makeRequest=function(e){var t=this;C$14(t.request);var i=t.request;i.url=t.url,i.requestFunction=function(r){var n=e.responseType,o=p$17(e.headers,t.headers),a=e.overrideMimeType,s=e.method,l=e.data,u=o$1q.defer(),c=e$28(r)?r:t.url,h=t$S._Implementations.loadWithXhr(c,n,s,l,o,u,a);return e$28(h)&&e$28(h.abort)&&(i.cancelFunction=function(){h.abort()}),u.promise};var r=r$1b.request(i);if(e$28(r))return r.then((function(e){return e})).otherwise((function(r){return i.state!==W$14.FAILED?o$1q.reject(r):t.retryOnError(r).then((function(n){return n?(i.state=W$14.UNISSUED,i.deferred=void 0,t.fetch(e)):o$1q.reject(r)}))}))};var te$I=/^data:(.*?)(;base64)?,(.*)$/;function E$1k(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function Y$V(e,t){for(var i=E$1k(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function ne$I(e,t){t=u$Y(t,"");var i=e[1],r=!!e[2],n=e[3];switch(t){case"":case"text":return E$1k(r,n);case"arraybuffer":return Y$V(r,n);case"blob":var o=Y$V(r,n);return new Blob([o],{type:i});case"document":return(new DOMParser).parseFromString(E$1k(r,n),i);case"json":return JSON.parse(E$1k(r,n));default:throw new t$Z("Unhandled responseType: "+t)}}function ae$A(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(u$V.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e}function F$1k(e,t){switch(t){case"text":return e.toString("utf8");case"json":return JSON.parse(e.toString("utf8"));default:return new Uint8Array(e).buffer}}function ie$D(e,t,i,r,n,o,a){var s=require("url").parse(e),l="https:"===s.protocol?require("https"):require("http"),u=require("zlib"),c={protocol:s.protocol,hostname:s.hostname,port:s.port,path:s.path,query:s.query,method:i,headers:n};l.request(c).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)o.reject(new s$Y(e.statusCode,e,e.headers));else{var i=[];e.on("data",(function(e){i.push(e)})),e.on("end",(function(){var r=Buffer.concat(i);"gzip"===e.headers["content-encoding"]?u.gunzip(r,(function(e,i){e?o.reject(new t$U("Error decompressing response.")):o.resolve(F$1k(i,t))})):o.resolve(F$1k(r,t))}))}})).on("error",(function(e){o.reject(new s$Y)})).end()}t$S.prototype.fetch=function(e){return(e=v$Q(e,{})).method="GET",this._makeRequest(e)},t$S.fetch=function(e){return new t$S(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S.prototype.delete=function(e){return(e=v$Q(e,{})).method="DELETE",this._makeRequest(e)},t$S.delete=function(e){return new t$S(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},t$S.prototype.head=function(e){return(e=v$Q(e,{})).method="HEAD",this._makeRequest(e)},t$S.head=function(e){return new t$S(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S.prototype.options=function(e){return(e=v$Q(e,{})).method="OPTIONS",this._makeRequest(e)},t$S.options=function(e){return new t$S(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S.prototype.post=function(e,t){return o$1u.defined("data",e),(t=v$Q(t,{})).method="POST",t.data=e,this._makeRequest(t)},t$S.post=function(e){return new t$S(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S.prototype.put=function(e,t){return o$1u.defined("data",e),(t=v$Q(t,{})).method="PUT",t.data=e,this._makeRequest(t)},t$S.put=function(e){return new t$S(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S.prototype.patch=function(e,t){return o$1u.defined("data",e),(t=v$Q(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},t$S.patch=function(e){return new t$S(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},t$S._Implementations={},t$S._Implementations.createImage=function(e,t,i,r,n){var o=e.url;t$S.supportsImageBitmapOptions().then((function(a){if(a&&n){var s=o$1q.defer(),l=t$S._Implementations.loadWithXhr(o,"blob","GET",void 0,void 0,s,void 0,void 0,void 0);return e$28(l)&&e$28(l.abort)&&(e.cancelFunction=function(){l.abort()}),s.promise.then((function(e){if(e$28(e))return t$S.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});i.reject(new t$U("Successfully retrieved "+o+" but it contained no content."))})).then(i.resolve)}ae$A(o,t,i)})).otherwise(i.reject)},t$S.createImageBitmapFromBlob=function(e,t){return o$1u.defined("options",t),o$1u.typeOf.bool("options.flipY",t.flipY),o$1u.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none"})};var ue$x=typeof XMLHttpRequest>"u";t$S._Implementations.loadWithXhr=function(e,t,i,r,n,o,a){var s=te$I.exec(e);if(null===s){if(!ue$x){var l=new XMLHttpRequest;if(u$V.contains(e)&&(l.withCredentials=!0),e=e.replace(/{/g,"%7B").replace(/}/g,"%7D"),l.open(i,e,!0),e$28(a)&&e$28(l.overrideMimeType)&&l.overrideMimeType(a),e$28(n))for(var u in n)n.hasOwnProperty(u)&&l.setRequestHeader(u,n[u]);e$28(t)&&(l.responseType=t);var c=!1;return"string"==typeof e&&(c=0===e.indexOf("file://")||typeof window<"u"&&"file://"===window.location.origin),l.onload=function(){if(!(l.status<200||l.status>=300)||c&&0===l.status){var e=l.response,r=l.responseType;if("HEAD"===i||"OPTIONS"===i){var n=l.getAllResponseHeaders().trim().split(/[\r\n]+/),a={};return n.forEach((function(e){var t=e.split(": "),i=t.shift();a[i]=t.join(": ")})),void o.resolve(a)}if(204===l.status)o.resolve();else if(!e$28(e)||e$28(t)&&r!==t)if("json"===t&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(e){o.reject(e)}else(""===r||"document"===r)&&e$28(l.responseXML)&&l.responseXML.hasChildNodes()?o.resolve(l.responseXML):""!==r&&"text"!==r||!e$28(l.responseText)?o.reject(new t$U("Invalid XMLHttpRequest response type.")):o.resolve(l.responseText);else o.resolve(e)}else o.reject(new s$Y(l.status,l.response,l.getAllResponseHeaders()))},l.onerror=function(e){o.reject(new s$Y)},l.send(r),l}ie$D(e,t,i,r,n,o)}else o.resolve(ne$I(s,t))},t$S._Implementations.loadAndExecuteScript=function(e,t,i){return a$16(e).otherwise(i.reject)},t$S._DefaultImplementations={},t$S._DefaultImplementations.createImage=t$S._Implementations.createImage,t$S._DefaultImplementations.loadWithXhr=t$S._Implementations.loadWithXhr,t$S._DefaultImplementations.loadAndExecuteScript=t$S._Implementations.loadAndExecuteScript,t$S.DEFAULT=Object.freeze(new t$S({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var d$1g=/((?:.*\/)|^)Cesium\.js$/,u$U,i$13,o$1l;function g$15(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t){var r=e[t].getAttribute("src"),n=d$1g.exec(r);if(null!==n)return n[1]}}function f$19(e){return typeof document>"u"?e:(e$28(u$U)||(u$U=document.createElement("a")),u$U.href=e,u$U.href=u$U.href,u$U.href)}function s$X(){if(e$28(i$13))return i$13;var e;if(e=typeof CESIUM_BASE_URL<"u"?CESIUM_BASE_URL:"object"==typeof define&&e$28(define.amd)&&!define.amd.toUrlUndefined&&e$28(require.toUrl)?o$1r("..",n$17("Core/buildModuleUrl.js")):g$15(),!e$28(e))throw new t$Z("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return(i$13=new t$S({url:f$19(e)})).appendForwardSlash(),i$13}function v$P(e){return f$19(require.toUrl("../"+e))}function m$1h(e){return s$X().getDerivedResource({url:e}).url}function n$17(e){return e$28(o$1l)||(o$1l="object"==typeof define&&e$28(define.amd)&&!define.amd.toUrlUndefined&&e$28(require.toUrl)?v$P:m$1h),o$1l(e)}function o$1k(e,t){this.x=u$Y(e,0),this.y=u$Y(t,0)}n$17._cesiumScriptRegex=d$1g,n$17._buildModuleUrlFromBaseUrl=m$1h,n$17._clearBaseResource=function(){i$13=void 0},n$17.setBaseUrl=function(e){i$13=t$S.DEFAULT.getDerivedResource({url:e})},n$17.getCesiumBaseUrl=s$X,o$1k.fromElements=function(e,t,i){return e$28(i)?(i.x=e,i.y=t,i):new o$1k(e,t)},o$1k.clone=function(e,t){if(e$28(e))return e$28(t)?(t.x=e.x,t.y=e.y,t):new o$1k(e.x,e.y)},o$1k.fromCartesian3=o$1k.clone,o$1k.fromCartesian4=o$1k.clone,o$1k.packedLength=2,o$1k.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.x,t[i]=e.y,t},o$1k.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new o$1k),i.x=e[t++],i.y=e[t],i},o$1k.packArray=function(e,t){o$1u.defined("array",e);var i=e.length,r=2*i;if(e$28(t)){if(!Array.isArray(t)&&t.length!==r)throw new t$Z("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;n<i;++n)o$1k.pack(e[n],t,2*n);return t},o$1k.unpackArray=function(e,t){if(o$1u.defined("array",e),o$1u.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!=0)throw new t$Z("array length must be a multiple of 2.");var i=e.length;e$28(t)?t.length=i/2:t=new Array(i/2);for(var r=0;r<i;r+=2){var n=r/2;t[n]=o$1k.unpack(e,r,t[n])}return t},o$1k.fromArray=o$1k.unpack,o$1k.maximumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.max(e.x,e.y)},o$1k.minimumComponent=function(e){return o$1u.typeOf.object("cartesian",e),Math.min(e.x,e.y)},o$1k.minimumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},o$1k.maximumByComponent=function(e,t,i){return o$1u.typeOf.object("first",e),o$1u.typeOf.object("second",t),o$1u.typeOf.object("result",i),i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},o$1k.magnitudeSquared=function(e){return o$1u.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y},o$1k.magnitude=function(e){return Math.sqrt(o$1k.magnitudeSquared(e))};var i$12=new o$1k;o$1k.distance=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1k.subtract(e,t,i$12),o$1k.magnitude(i$12)},o$1k.distanceSquared=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1k.subtract(e,t,i$12),o$1k.magnitudeSquared(i$12)},o$1k.normalize=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=o$1k.magnitude(e);if(t.x=e.x/i,t.y=e.y/i,isNaN(t.x)||isNaN(t.y))throw new t$Z("normalized result is not a number");return t},o$1k.dot=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e.x*t.x+e.y*t.y},o$1k.multiplyComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x*t.x,i.y=e.y*t.y,i},o$1k.divideComponents=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x/t.x,i.y=e.y/t.y,i},o$1k.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i},o$1k.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i},o$1k.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i},o$1k.divideByScalar=function(e,t,i){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i},o$1k.negate=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t},o$1k.abs=function(e,t){return o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var m$1g=new o$1k;o$1k.lerp=function(e,t,i,r){return o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r),o$1k.multiplyByScalar(t,i,m$1g),r=o$1k.multiplyByScalar(e,1-i,r),o$1k.add(m$1g,r,r)};var b$1e=new o$1k,O$U=new o$1k;o$1k.angleBetween=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1k.normalize(e,b$1e),o$1k.normalize(t,O$U),e$27.acosClamped(o$1k.dot(b$1e,O$U))};var x$1h=new o$1k;function g$14(e){e=u$Y(e,{}),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._rectangle=u$Y(e.rectangle,h$10.MAX_VALUE),this._projection=new n$1b(this._ellipsoid),this._numberOfLevelZeroTilesX=u$Y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=u$Y(e.numberOfLevelZeroTilesY,1),this._customDPI=e.customDPI,this._scaleDenominators=e.scaleDenominators,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._beginLevel=u$Y(e.beginLevel,0),this._origin=u$Y(e.origin,void 0)}o$1k.mostOrthogonalAxis=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=o$1k.normalize(e,x$1h);return o$1k.abs(i,i),t=i.x<=i.y?o$1k.clone(o$1k.UNIT_X,t):o$1k.clone(o$1k.UNIT_Y,t)},o$1k.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y},o$1k.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},o$1k.equalsEpsilon=function(e,t,i,r){return e===t||e$28(e)&&e$28(t)&&e$27.equalsEpsilon(e.x,t.x,i,r)&&e$27.equalsEpsilon(e.y,t.y,i,r)},o$1k.ZERO=Object.freeze(new o$1k(0,0)),o$1k.UNIT_X=Object.freeze(new o$1k(1,0)),o$1k.UNIT_Y=Object.freeze(new o$1k(0,1)),o$1k.prototype.clone=function(e){return o$1k.clone(this,e)},o$1k.prototype.equals=function(e){return o$1k.equals(this,e)},o$1k.prototype.equalsEpsilon=function(e,t,i){return o$1k.equalsEpsilon(this,e,t,i)},o$1k.prototype.toString=function(){return"("+this.x+", "+this.y+")"},Object.defineProperties(g$14.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},beginLevel:{get:function(){return this._beginLevel}},origin:{get:function(){return this._origin}}}),g$14.prototype.getNumberOfXTilesAtLevel=function(e){if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var t=this.calculateResolution(e),i=this._tileWidth*t.x;return Math.ceil(this._rectangle.width/i)}return this._numberOfLevelZeroTilesX<<e-this._beginLevel},g$14.prototype.getNumberOfYTilesAtLevel=function(e){if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var t=this.calculateResolution(e),i=this._tileHeight*t.y;return Math.ceil(this._rectangle.height/i)}return this._numberOfLevelZeroTilesY<<e-this._beginLevel},g$14.prototype.rectangleToNativeRectangle=function(e,t){o$1u.defined("rectangle",e);var i=e$27.toDegrees(e.west),r=e$27.toDegrees(e.south),n=e$27.toDegrees(e.east),o=e$27.toDegrees(e.north);return e$28(t)?(t.west=i,t.south=r,t.east=n,t.north=o,t):new h$10(i,r,n,o)},g$14.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=e$27.toDegrees(n.west),n.south=e$27.toDegrees(n.south),n.east=e$27.toDegrees(n.east),n.north=e$27.toDegrees(n.north),n},g$14.prototype.tileXYToRectangle=function(e,t,i,r){var n=this._rectangle,o=e$28(this._origin)?this._origin.longitude:n.west,a=e$28(this._origin)?this._origin.latitude:n.north;if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var s=this.calculateResolution(i),l=o+e*this._tileWidth*s.x,u=o+(e+1)*this._tileWidth*s.x,c=a-t*this._tileHeight*s.y,h=a-(t+1)*this._tileHeight*s.y;return e$28(r)?(r.west=l,r.south=h,r.east=u,r.north=c,r):new h$10(l,h,u,c)}var d=this.getNumberOfXTilesAtLevel(i),f=this.getNumberOfYTilesAtLevel(i),p=n.width/d,_=(l=e*p+n.west,u=(e+1)*p+n.west,n.height/f);c=n.north-t*_,h=n.north-(t+1)*_;return e$28(r)||(r=new h$10(l,h,u,c)),r.west=l,r.south=h,r.east=u,r.north=c,r},g$14.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(h$10.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=e$28(this._origin)?this._origin.longitude:r.west,s=e$28(this._origin)?this._origin.latitude:r.north,l=r.width/n,u=r.height/o;if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var c=this.calculateResolution(t);l=this._tileWidth*c.x,u=this._tileHeight*c.y}var h=e.longitude;r.east<r.west&&(h+=e$27.TWO_PI),e$28(this._origin)&&(n+=this._origin.longitude!=r.west?Math.ceil((e.longitude-this._origin.longitude)/l):0,o+=this._origin.latitude!=r.north?Math.ceil((this._origin.latitude-e.latitude)/u):0);var d=(h-a)/l|0;d>=n&&(d=n-1);var f=(s-e.latitude)/u|0;return f>=o&&(f=o-1),e$28(i)?(i.x=d,i.y=f,i):new o$1k(d,f)}},g$14.prototype.calculateResolution=function(e){var t=Math.min(e-this._beginLevel,this._scaleDenominators.length-1),i=.0254*this._scaleDenominators[t]/this._customDPI.x,r=.0254*this._scaleDenominators[t]/this._customDPI.y,n=t$V.WGS84.maximumRadius;return new o$1k(i/n,r/n)};var _$13=new t$X,M$19=new t$X,C$13=new t$W,d$1f=new t$X,X$_=new t$X,S$_=new i$19,z$Z=new g$14,c$19=[new t$W,new t$W,new t$W,new t$W],g$13=new o$1k,e$1_={};function L$1i(e){t$W.fromRadians(e.east,e.north,0,c$19[0]),t$W.fromRadians(e.west,e.north,0,c$19[1]),t$W.fromRadians(e.east,e.south,0,c$19[2]),t$W.fromRadians(e.west,e.south,0,c$19[3]);var t,i=0,r=0,n=0,o=0,a=e$1_._terrainHeightsMaxLevel;for(t=0;t<=a;++t){for(var s=!1,l=0;l<4;++l){var u=c$19[l];if(z$Z.positionToTileXY(u,t,g$13),0===l)n=g$13.x,o=g$13.y;else if(n!==g$13.x||o!==g$13.y){s=!0;break}}if(s)break;i=n,r=o}if(0!==t)return{x:i,y:r,level:t>a?a:t-1}}function g$12(e){if(e=u$Y(e,{}),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._rectangle=u$Y(e.rectangle,h$10.MAX_VALUE),this._projection=new n$1b(this._ellipsoid),this._numberOfLevelZeroTilesX=u$Y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=u$Y(e.numberOfLevelZeroTilesY,1),e.hasOwnProperty("tileInfo")&&(this._tileInfo=e.tileInfo),this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._beginLevel=0,this._suggest=void 0,e$28(e.resolutions)){this._resolutions=e.resolutions;for(var t=0,i=6378137*Math.PI/this._tileWidth;i>this._resolutions[0];)i*=.5,t++;this._beginLevel=t-1,this._dataBounds=e.dataBounds,this._tileBounds=[];for(var r=this._dataBounds.east-this._tileInfo.origin.x,n=this._tileInfo.origin.y-this._dataBounds.south,o=this._dataBounds.west-this._tileInfo.origin.x,a=this._tileInfo.origin.y-this._dataBounds.north,s=0;s<this._resolutions.length;s++){var l=this._resolutions[s]*this._tileInfo.cols,u=this._resolutions[s]*this._tileInfo.rows,c=Math.floor(o/l),h=Math.floor(a/u),d=Math.floor(r/l),f=Math.floor(n/u);this._tileBounds.push(new h$10(c,f,d,h))}}}e$1_.initialize=function(){var e=e$1_._initPromise;return e$28(e)||(e=t$S.fetchJson(n$17("Assets/approximateTerrainHeights.json")).then((function(e){e$1_._terrainHeights=e})),e$1_._initPromise=e),e},e$1_.getMinimumMaximumHeights=function(e,t){if(o$1u.defined("rectangle",e),!e$28(e$1_._terrainHeights))throw new t$Z("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=u$Y(t,t$V.WGS84);var i=L$1i(e),r=e$1_._defaultMinTerrainHeight,n=e$1_._defaultMaxTerrainHeight;if(e$28(i)){var o=i.level+"-"+i.x+"-"+i.y,a=e$1_._terrainHeights[o];e$28(a)&&(r=a[0],n=a[1]),t.cartographicToCartesian(h$10.northeast(e,C$13),_$13),t.cartographicToCartesian(h$10.southwest(e,C$13),M$19),t$X.midpoint(M$19,_$13,d$1f);var s=t.scaleToGeodeticSurface(d$1f,X$_);if(e$28(s)){var l=t$X.distance(d$1f,s);r=Math.min(r,-l)}else r=e$1_._defaultMinTerrainHeight}return{minimumTerrainHeight:r=Math.max(e$1_._defaultMinTerrainHeight,r),maximumTerrainHeight:n}},e$1_.getBoundingSphere=function(e,t){if(o$1u.defined("rectangle",e),!e$28(e$1_._terrainHeights))throw new t$Z("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=u$Y(t,t$V.WGS84);var i=L$1i(e),r=e$1_._defaultMaxTerrainHeight;if(e$28(i)){var n=i.level+"-"+i.x+"-"+i.y,o=e$1_._terrainHeights[n];e$28(o)&&(r=o[1])}var a=i$19.fromRectangle3D(e,t,0);return i$19.fromRectangle3D(e,t,r,S$_),i$19.union(a,S$_,a)},e$1_._terrainHeightsMaxLevel=6,e$1_._defaultMaxTerrainHeight=9e3,e$1_._defaultMinTerrainHeight=-1e5,e$1_._terrainHeights=void 0,e$1_._initPromise=void 0,Object.defineProperties(e$1_,{initialized:{get:function(){return e$28(e$1_._terrainHeights)}}}),Object.defineProperties(g$12.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),g$12.prototype.getNumberOfXTilesAtLevel=function(e){if(e$28(this._resolutions)){if(e<this._beginLevel)return this._numberOfLevelZeroTilesX<<e;var t=this._dataBounds.east-this._tileInfo.origin.x,i=e$27.clamp(e-this._beginLevel,0,this._resolutions.length-1),r=this._resolutions[i]*this._tileInfo.cols;return Math.ceil(t/r)}if(e$28(this._tileInfo)){var n=this._tileInfo.lods.filter((function(t){return t.level===e})),o=e$27.toDegrees(this._rectangle.east)-this._tileInfo.origin.x,a=n[0].resolution;return Math.ceil(o/(this._tileInfo.rows*a))}return this._numberOfLevelZeroTilesX<<e},g$12.prototype.getNumberOfYTilesAtLevel=function(e){if(e$28(this._resolutions)){if(e<this._beginLevel)return this._numberOfLevelZeroTilesY<<e;var t=this._tileInfo.origin.y-this._dataBounds.south,i=e$27.clamp(e-this._beginLevel,0,this._resolutions.length-1),r=this._resolutions[i]*this._tileInfo.rows;return Math.ceil(t/r)}if(e$28(this._tileInfo)){var n=this._tileInfo.lods.filter((function(t){return t.level===e})),o=this._tileInfo.origin.y-e$27.toDegrees(this._rectangle.south),a=n[0].resolution;return Math.ceil(o/(this._tileInfo.cols*a))}return this._numberOfLevelZeroTilesY<<e},g$12.prototype.rectangleToNativeRectangle=function(e,t){o$1u.defined("rectangle",e);var i=e$27.toDegrees(e.west),r=e$27.toDegrees(e.south),n=e$27.toDegrees(e.east),o=e$27.toDegrees(e.north);return e$28(t)?(t.west=i,t.south=r,t.east=n,t.north=o,t):new h$10(i,r,n,o)},g$12.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=e$27.toDegrees(n.west),n.south=e$27.toDegrees(n.south),n.east=e$27.toDegrees(n.east),n.north=e$27.toDegrees(n.north),n},g$12.prototype.tileXYToRectangle=function(e,t,i,r){var n=this._rectangle;if(e$28(this._resolutions)){var o=this._resolutions[i-this._beginLevel],a=this._tileInfo.origin.x,s=this._tileInfo.origin.y,l=a+e*this._tileWidth*o,u=a+(e+1)*this._tileWidth*o,c=s-t*this._tileHeight*o,h=s-(t+1)*this._tileHeight*o;return r.west=l,r.south=h,r.east=u,r.north=c,r}if(e$28(this._tileInfo)){o=this._tileInfo.lods[i].resolution*e$27.TWO_PI/360;a=e$27.toRadians(this._tileInfo.origin.x),s=e$27.toRadians(this._tileInfo.origin.y);l=a+e*this._tileWidth*o,u=a+(e+1)*this._tileWidth*o,c=s-t*this._tileHeight*o,h=s-(t+1)*this._tileHeight*o;return e$28(r)?(r.west=l,r.south=h,r.east=u,r.north=c,r):new h$10(l,h,u,c)}var d=this.getNumberOfXTilesAtLevel(i),f=this.getNumberOfYTilesAtLevel(i),p=n.width/d,_=(l=e*p+n.west,u=(e+1)*p+n.west,n.height/f);c=n.north-t*_,h=n.north-(t+1)*_;return e$28(r)||(r=new h$10(l,h,u,c)),r.west=l,r.south=h,r.east=u,r.north=c,r},g$12.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(h$10.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=r.width/n,s=r.height/o;if(e$28(this._resolutions)){var l=this._resolutions[t-this._beginLevel];a=this._tileWidth*l,s=this._tileHeight*l}else if(e$28(this._tileInfo)){l=this._tileInfo.lods[t].resolution*e$27.TWO_PI/360;a=this._tileWidth*l,s=this._tileHeight*l}var u=e.longitude;r.east<r.west&&(u+=e$27.TWO_PI);var c=(u-(e$28(this._resolutions)?this._tileInfo.origin.x:e$28(this._tileInfo)?e$27.toRadians(this._tileInfo.origin.x):r.west))/a|0;c>=n&&(c=n-1);var h=((e$28(this._resolutions)?this._tileInfo.origin.y:e$28(this._tileInfo)?e$27.toRadians(this._tileInfo.origin.y):r.north)-e.latitude)/s|0;return h>=o&&(h=o-1),e$28(i)?(i.x=c,i.y=h,i):new o$1k(c,h)}};var ce$w=["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],ve$r=["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"],he$u=["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"],Te$q=["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"],Ae$q=["#text"],_e$s=["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","crossorigin","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","integrity","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns"],q$1b=["accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"],ge$r=["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"],M$18=["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"];function o$1j(e,t){for(var i=t.length;i--;)"string"==typeof t[i]&&(t[i]=t[i].toLowerCase()),e[t[i]]=!0;return e}function ye$t(e){var t={},i=void 0;for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}var We$m=/\{\{[\s\S]*|[\s\S]*\}\}/gm,Be$p=/<%[\s\S]*|[\s\S]*%>/gm,Ge$k=/^data-[\-\w.\u00B7-\uFFFF]/,$e$d=/^aria-[\-\w]+$/,qe$i=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Ve$m=/^(?:\w+script|data):/i,Xe$e=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,x$1g="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 c$18(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}var Ye$h=function(){return typeof window>"u"?null:window};function Ee$o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ye$h(),t=function(e){return Ee$o(e)};if(t.version="1.0.8",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var i=e.document,r=!1,n=!1,o=e.document,a=e.DocumentFragment,s=e.HTMLTemplateElement,l=e.Node,u=e.NodeFilter,c=e.NamedNodeMap,h=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,d=e.Text,f=e.Comment,p=e.DOMParser;if("function"==typeof s){var _=o.createElement("template");_.content&&_.content.ownerDocument&&(o=_.content.ownerDocument)}var m=o,$=m.implementation,g=m.createNodeIterator,v=m.getElementsByTagName,y=m.createDocumentFragment,x=i.importNode,b={};t.isSupported=$&&typeof $.createHTMLDocument<"u"&&9!==o.documentMode;var w=We$m,C=Be$p,T=Ge$k,S=$e$d,E=Ve$m,A=Xe$e,P=qe$i,I=null,M=o$1j({},[].concat(c$18(ce$w),c$18(ve$r),c$18(he$u),c$18(Te$q),c$18(Ae$q))),O=null,D=o$1j({},[].concat(c$18(_e$s),c$18(q$1b),c$18(ge$r),c$18(M$18))),R=null,L=null,B=!0,N=!0,F=!1,z=!1,k=!1,V=!1,U=!1,X=!1,H=!1,G=!1,W=!1,Y=!0,q=!0,j=!1,Z={},K=o$1j({},["audio","head","math","script","style","template","svg","video"]),Q=o$1j({},["audio","video","img","source","image"]),J=o$1j({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),ee=null,te=o.createElement("form"),ie=function(e){"object"!==(typeof e>"u"?"undefined":x$1g(e))&&(e={}),I="ALLOWED_TAGS"in e?o$1j({},e.ALLOWED_TAGS):M,O="ALLOWED_ATTR"in e?o$1j({},e.ALLOWED_ATTR):D,R="FORBID_TAGS"in e?o$1j({},e.FORBID_TAGS):{},L="FORBID_ATTR"in e?o$1j({},e.FORBID_ATTR):{},Z="USE_PROFILES"in e&&e.USE_PROFILES,B=!1!==e.ALLOW_ARIA_ATTR,N=!1!==e.ALLOW_DATA_ATTR,F=e.ALLOW_UNKNOWN_PROTOCOLS||!1,z=e.SAFE_FOR_JQUERY||!1,k=e.SAFE_FOR_TEMPLATES||!1,V=e.WHOLE_DOCUMENT||!1,H=e.RETURN_DOM||!1,G=e.RETURN_DOM_FRAGMENT||!1,W=e.RETURN_DOM_IMPORT||!1,X=e.FORCE_BODY||!1,Y=!1!==e.SANITIZE_DOM,q=!1!==e.KEEP_CONTENT,j=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||P,k&&(N=!1),G&&(H=!0),Z&&(I=o$1j({},[].concat(c$18(Ae$q))),O=[],!0===Z.html&&(o$1j(I,ce$w),o$1j(O,_e$s)),!0===Z.svg&&(o$1j(I,ve$r),o$1j(O,q$1b),o$1j(O,M$18)),!0===Z.svgFilters&&(o$1j(I,he$u),o$1j(O,q$1b),o$1j(O,M$18)),!0===Z.mathMl&&(o$1j(I,Te$q),o$1j(O,ge$r),o$1j(O,M$18))),e.ADD_TAGS&&(I===M&&(I=ye$t(I)),o$1j(I,e.ADD_TAGS)),e.ADD_ATTR&&(O===D&&(O=ye$t(O)),o$1j(O,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&o$1j(J,e.ADD_URI_SAFE_ATTR),q&&(I["#text"]=!0),V&&o$1j(I,["html","head","body"]),I.table&&o$1j(I,["tbody"]),Object&&"freeze"in Object&&Object.freeze(e),ee=e},re=function(e){t.removed.push({element:e});try{e.parentNode.removeChild(e)}catch{e.outerHTML=""}},ne=function(e,i){try{t.removed.push({attribute:i.getAttributeNode(e),from:i})}catch{t.removed.push({attribute:null,from:i})}i.removeAttribute(e)},oe=function(e){var t=void 0,i=void 0;if(X)e="<remove></remove>"+e;else{var a=e.match(/^[\s]+/);(i=a&&a[0])&&(e=e.slice(i.length))}if(r)try{t=(new p).parseFromString(e,"text/html")}catch{}if(n&&o$1j(R,["title"]),!t||!t.documentElement){var s=(t=$.createHTMLDocument("")).body;s.parentNode.removeChild(s.parentNode.firstElementChild),s.outerHTML=e}return i&&t.body.insertBefore(o.createTextNode(i),t.body.childNodes[0]||null),v.call(t,V?"html":"body")[0]};t.isSupported&&(function(){try{oe('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">').querySelector("svg img")&&(r=!0)}catch{}}(),function(){try{oe("<x/><title></title><img>").querySelector("title").textContent.match(/<\/title/)&&(n=!0)}catch{}}());var ae=function(e){return g.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,(function(){return u.FILTER_ACCEPT}),!1)},se=function(e){return!(e instanceof d||e instanceof f)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute)},le=function(e){return"object"===(typeof l>"u"?"undefined":x$1g(l))?e instanceof l:e&&"object"===(typeof e>"u"?"undefined":x$1g(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ue=function(e,i,r){!b[e]||b[e].forEach((function(e){e.call(t,i,r,ee)}))},ce=function(e){var i=void 0;if(ue("beforeSanitizeElements",e,null),se(e))return re(e),!0;var r=e.nodeName.toLowerCase();if(ue("uponSanitizeElement",e,{tagName:r,allowedTags:I}),!I[r]||R[r]){if(q&&!K[r]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch{}return re(e),!0}return z&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)&&/</g.test(e.textContent)&&(t.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),k&&3===e.nodeType&&(i=(i=(i=e.textContent).replace(w," ")).replace(C," "),e.textContent!==i&&(t.removed.push({element:e.cloneNode()}),e.textContent=i)),ue("afterSanitizeElements",e,null),!1},he=function(e,t,i){if(Y&&("id"===t||"name"===t)&&(i in o||i in te))return!1;if(!(k&&(i=i.replace(w," "),i=i.replace(C," ")),N&&T.test(t)||B&&S.test(t))){if(!O[t]||L[t])return!1;if(!J[t]&&!P.test(i.replace(A,""))&&("src"!==t&&"xlink:href"!==t||"script"===e||0!==i.indexOf("data:")||!Q[e])&&(!F||E.test(i.replace(A,"")))&&i)return!1}return!0},de=function(e){var i=void 0,r=void 0,n=void 0,o=void 0,a=void 0;ue("beforeSanitizeAttributes",e,null);var s=e.attributes;if(s){var l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O};for(a=s.length;a--;){var u=i=s[a],c=u.name,h=u.namespaceURI;if(r=i.value.trim(),n=c.toLowerCase(),l.attrName=n,l.attrValue=r,l.keepAttr=!0,ue("uponSanitizeAttribute",e,l),r=l.attrValue,"name"===n&&"IMG"===e.nodeName&&s.id)o=s.id,s=Array.prototype.slice.apply(s),ne("id",e),ne(c,e),s.indexOf(o)>a&&e.setAttribute("id",o.value);else{if("INPUT"===e.nodeName&&"type"===n&&"file"===r&&(O[n]||!L[n]))continue;"id"===c&&e.setAttribute(c,""),ne(c,e)}if(l.keepAttr){var d=e.nodeName.toLowerCase();if(he(d,n,r))try{h?e.setAttributeNS(h,c,r):e.setAttribute(c,r),t.removed.pop()}catch{}}}ue("afterSanitizeAttributes",e,null)}},fe=function e(t){var i=void 0,r=ae(t);for(ue("beforeSanitizeShadowDOM",t,null);i=r.nextNode();)ue("uponSanitizeShadowNode",i,null),!ce(i)&&(i.content instanceof a&&e(i.content),de(i));ue("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,n){var o=void 0,s=void 0,u=void 0,c=void 0,h=void 0;if(r||(r="\x3c!--\x3e"),"string"!=typeof r&&!le(r)){if("function"!=typeof r.toString)throw new TypeError("toString is not a function");if("string"!=typeof(r=r.toString()))throw new TypeError("dirty is not a string, aborting")}if(!t.isSupported){if("object"===x$1g(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(le(r))return e.toStaticHTML(r.outerHTML)}return r}if(U||ie(n),t.removed=[],!j)if(r instanceof l)1===(s=(o=oe("\x3c!--\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===s.nodeName?o=s:o.appendChild(s);else{if(!H&&!V&&-1===r.indexOf("<"))return r;if(!(o=oe(r)))return H?null:""}o&&X&&re(o.firstChild);for(var d=ae(j?r:o);u=d.nextNode();)3===u.nodeType&&u===c||ce(u)||(u.content instanceof a&&fe(u.content),de(u),c=u);if(j)return r;if(H){if(G)for(h=y.call(o.ownerDocument);o.firstChild;)h.appendChild(o.firstChild);else h=o;return W&&(h=x.call(i,h,!0)),h}return V?o.outerHTML:o.innerHTML},t.setConfig=function(e){ie(e),U=!0},t.clearConfig=function(){ee=null,U=!1},t.isValidAttribute=function(e,t,i){ee||ie({});var r=e.toLowerCase(),n=t.toLowerCase();return he(r,n,i)},t.addHook=function(e,t){"function"==typeof t&&(b[e]=b[e]||[],b[e].push(t))},t.removeHook=function(e){b[e]&&b[e].pop()},t.removeHooks=function(e){b[e]&&(b[e]=[])},t.removeAllHooks=function(){b={}},t}var je$k=Ee$o(),a$15=0,l$1d={};function r$1a(e,t){o$1u.typeOf.string("html",e);var i,r=e;e$28(l$1d[r])?i=l$1d[r]:(i=a$15++,l$1d[r]=i),t=u$Y(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(r$1a.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!e$28(this._element)){var e=je$k.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<i.length;r++)i[r].setAttribute("target","_blank");this._element=t}return this._element}}}),r$1a.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e._id===t._id},r$1a.prototype.equals=function(e){return r$1a.equals(this,e)},r$1a.getIonCredit=function(e){var t=e$28(e.collapsible)&&!e.collapsible,i=new r$1a(e.html,t);return i._isIon=-1!==i.html.indexOf("logo.png"),i},r$1a.clone=function(e){if(e$28(e))return new r$1a(e.html,e.showOnScreen)};var e$1Z={NONE:0,LERC:1},T$10=Object.freeze(e$1Z);function e$1Y(e,t,i){this.minimum=t$X.clone(u$Y(e,t$X.ZERO)),this.maximum=t$X.clone(u$Y(t,t$X.ZERO)),i=e$28(i)?t$X.clone(i):t$X.midpoint(this.minimum,this.maximum,new t$X),this.center=i}e$1Y.fromPoints=function(e,t){if(e$28(t)||(t=new e$1Y),!e$28(e)||0===e.length)return t.minimum=t$X.clone(t$X.ZERO,t.minimum),t.maximum=t$X.clone(t$X.ZERO,t.maximum),t.center=t$X.clone(t$X.ZERO,t.center),t;for(var i=e[0].x,r=e[0].y,n=e[0].z,o=e[0].x,a=e[0].y,s=e[0].z,l=e.length,u=1;u<l;u++){var c=e[u],h=c.x,d=c.y,f=c.z;i=Math.min(h,i),o=Math.max(h,o),r=Math.min(d,r),a=Math.max(d,a),n=Math.min(f,n),s=Math.max(f,s)}var p=t.minimum;p.x=i,p.y=r,p.z=n;var _=t.maximum;return _.x=o,_.y=a,_.z=s,t.center=t$X.midpoint(p,_,t.center),t},e$1Y.clone=function(e,t){if(e$28(e))return e$28(t)?(t.minimum=t$X.clone(e.minimum,t.minimum),t.maximum=t$X.clone(e.maximum,t.maximum),t.center=t$X.clone(e.center,t.center),t):new e$1Y(e.minimum,e.maximum,e.center)},e$1Y.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&t$X.equals(e.center,t.center)&&t$X.equals(e.minimum,t.minimum)&&t$X.equals(e.maximum,t.maximum)};var x$1f=new t$X;function s$W(e,t){o$1u.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new t$X,this._cameraPositionInScaledSpace=new t$X,this._distanceToLimbInScaledSpaceSquared=0,e$28(t)&&(this.cameraPosition=t)}e$1Y.intersectPlane=function(e,t){o$1u.defined("box",e),o$1u.defined("plane",t),x$1f=t$X.subtract(e.maximum,e.minimum,x$1f);var i=t$X.multiplyByScalar(x$1f,.5,x$1f),r=t.normal,n=i.x*Math.abs(r.x)+i.y*Math.abs(r.y)+i.z*Math.abs(r.z),o=t$X.dot(e.center,r)+t.distance;return o-n>0?pt$a.INSIDE:o+n<0?pt$a.OUTSIDE:pt$a.INTERSECTING},e$1Y.prototype.clone=function(e){return e$1Y.clone(this,e)},e$1Y.prototype.intersectPlane=function(e){return e$1Y.intersectPlane(this,e)},e$1Y.prototype.equals=function(e){return e$1Y.equals(this,e)},Object.defineProperties(s$W.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var t=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=t$X.magnitudeSquared(t)-1;t$X.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=t,this._distanceToLimbInScaledSpaceSquared=i}}});var _$12=new t$X;s$W.prototype.isPointVisible=function(e){return h$_(this._ellipsoid.transformPositionToScaledSpace(e,_$12),this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)},s$W.prototype.isScaledSpacePointVisible=function(e){return h$_(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var w$W=new t$X;s$W.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){var i,r,n=this._ellipsoid;return e$28(t)&&t<0&&n.minimumRadius>-t?((r=w$W).x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),h$_(e,r,i)},s$W.prototype.computeHorizonCullingPoint=function(e,t,i){return q$1a(this._ellipsoid,e,t,i)};var b$1d=t$V.clone(t$V.UNIT_SPHERE);s$W.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,r){return q$1a(z$Y(this._ellipsoid,i,b$1d),e,t,r)},s$W.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,r,n){return E$1j(this._ellipsoid,e,t,i,r,n)},s$W.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,r,n,o){return E$1j(z$Y(this._ellipsoid,n,b$1d),e,t,i,r,o)};var O$T=[];s$W.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){o$1u.typeOf.object("rectangle",e);var r=h$10.subsample(e,t,0,O$T),n=i$19.fromPoints(r);if(!(t$X.magnitude(n.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(n.center,r,i)};var R$$=new t$X;function z$Y(e,t,i){if(e$28(t)&&t<0&&e.minimumRadius>-t){var r=t$X.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,R$$);e=t$V.fromCartesian3(r,i)}return e}function q$1a(e,t,i,r){o$1u.typeOf.object("directionToPoint",t),o$1u.defined("positions",i),e$28(r)||(r=new t$X);for(var n=C$12(e,t),o=0,a=0,s=i.length;a<s;++a){var l=g$11(e,i[a],n);if(l<0)return;o=Math.max(o,l)}return x$1e(n,o,r)}var m$1f=new t$X;function E$1j(e,t,i,r,n,o){o$1u.typeOf.object("directionToPoint",t),o$1u.defined("vertices",i),o$1u.typeOf.number("stride",r),e$28(o)||(o=new t$X),r=u$Y(r,3),n=u$Y(n,t$X.ZERO);for(var a=C$12(e,t),s=0,l=0,u=i.length;l<u;l+=r){m$1f.x=i[l]+n.x,m$1f.y=i[l+1]+n.y,m$1f.z=i[l+2]+n.z;var c=g$11(e,m$1f,a);if(c<0)return;s=Math.max(s,c)}return x$1e(a,s,o)}function h$_(e,t,i){var r=t,n=i,o=t$X.subtract(e,r,_$12),a=-t$X.dot(o,r);return!(n<0?a>0:a>n&&a*a/t$X.magnitudeSquared(o)>n)}var V$_=new t$X,k$1d=new t$X;function g$11(e,t,i){var r=e.transformPositionToScaledSpace(t,V$_),n=t$X.magnitudeSquared(r),o=Math.sqrt(n),a=t$X.divideByScalar(r,o,k$1d);n=Math.max(1,n);var s=1/(o=Math.max(1,o));return 1/(t$X.dot(a,i)*s-t$X.magnitude(t$X.cross(a,i,a))*(Math.sqrt(n-1)*s))}function x$1e(e,t,i){if(!(t<=0||t===1/0||t!=t))return t$X.multiplyByScalar(e,t,i)}var P$1d=new t$X;function C$12(e,t){return t$X.equals(t,t$X.ZERO)?t:(e.transformPositionToScaledSpace(t,P$1d),t$X.normalize(P$1d,P$1d))}var m$1e={};function p$15(e,t,i){var r=e+t;return e$27.sign(e)!==e$27.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}m$1e.computeDiscriminant=function(e,t,i){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");return t*t-4*e*i},m$1e.computeRealRoots=function(e,t,i){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");var r;if(0===e)return 0===t?[]:[-i/t];if(0===t){if(0===i)return[0,0];var n=Math.abs(i),o=Math.abs(e);if(n<o&&n/o<e$27.EPSILON14)return[0,0];if(n>o&&o/n<e$27.EPSILON14)return[];if((r=-i/e)<0)return[];var a=Math.sqrt(r);return[-a,a]}if(0===i)return(r=-t/e)<0?[r,0]:[0,r];var s=p$15(t*t,-(4*e*i),e$27.EPSILON14);if(s<0)return[];var l=-.5*p$15(t,e$27.sign(t)*Math.sqrt(s),e$27.EPSILON14);return t>0?[l/e,i/l]:[i/l,l/e]};var j$1c={};function k$1c(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,f=l*l,p=a*l-d,_=a*u-s*l,m=s*u-f,$=4*p*m-_*_;if($<0){var g,v,y;d*h>=c*f?(g=a,v=p,y=-2*s*p+a*_):(g=u,v=m,y=-u*_+2*l*m);var x=-(y<0?-1:1)*Math.abs(g)*Math.sqrt(-$),b=(o=-y+x)/2,w=b<0?-Math.pow(-b,1/3):Math.pow(b,1/3),C=o===x?-w:-v/w;return n=v<=0?w+C:-y/(w*w+C*C+v),d*h>=c*f?[(n-s)/a]:[-u/(n+l)]}var T=p,S=-2*s*p+a*_,E=m,A=-u*_+2*l*m,P=Math.sqrt($),I=Math.sqrt(3)/2,M=Math.abs(Math.atan2(a*P,-S)/3);n=2*Math.sqrt(-T);var O=Math.cos(M);o=n*O;var D=n*(-O/2-I*Math.sin(M)),R=o+D>2*s?o-s:D-s,L=a,B=R/L;M=Math.abs(Math.atan2(u*P,-A)/3);var N=-u,F=(o=(n=2*Math.sqrt(-E))*(O=Math.cos(M)))+(D=n*(-O/2-I*Math.sin(M)))<2*l?o+l:D+l,z=N/F,k=-R*F-L*N,V=(l*k-s*(R*N))/(-s*k+l*(L*F));return B<=V?B<=z?V<=z?[B,V,z]:[B,z,V]:[z,B,V]:B<=z?[V,B,z]:V<=z?[V,z,B]:[z,V,B]}j$1c.computeDiscriminant=function(e,t,i,r){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");if("number"!=typeof r)throw new t$Z("d is a required number.");var n=t*t,o=i*i;return 18*e*t*i*r+n*o-27*(e*e)*(r*r)-4*(e*o*i+n*t*r)},j$1c.computeRealRoots=function(e,t,i,r){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");if("number"!=typeof r)throw new t$Z("d is a required number.");var n,o;if(0===e)return m$1e.computeRealRoots(t,i,r);if(0===t){if(0===i){if(0===r)return[0,0,0];var a=(o=-r/e)<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[a,a,a]}return 0===r?0===(n=m$1e.computeRealRoots(e,0,i)).Length?[0]:[n[0],0,n[1]]:k$1c(e,0,i,r)}return 0===i?0===r?(o=-t/e)<0?[o,0,0]:[0,0,o]:k$1c(e,t,0,r):0===r?0===(n=m$1e.computeRealRoots(e,t,i)).length?[0]:n[1]<=0?[n[0],n[1],0]:n[0]>=0?[0,n[0],n[1]]:[n[0],0,n[1]]:k$1c(e,t,i,r)};var F$1j={};function P$1c(e,t,i,r){var n=e*e,o=t-3*n/8,a=i-t*e/2+n*e/8,s=r-i*e/4+t*n/16-3*n*n/256,l=j$1c.computeRealRoots(1,2*o,o*o-4*s,-a*a);if(l.length>0){var u=-e/4,c=l[l.length-1];if(Math.abs(c)<e$27.EPSILON14){var h=m$1e.computeRealRoots(1,o,s);if(2===h.length){var d,f=h[0],p=h[1];if(f>=0&&p>=0){var _=Math.sqrt(f),m=Math.sqrt(p);return[u-m,u-_,u+_,u+m]}if(f>=0&&p<0)return[u-(d=Math.sqrt(f)),u+d];if(f<0&&p>=0)return[u-(d=Math.sqrt(p)),u+d]}return[]}if(c>0){var $=Math.sqrt(c),g=(o+c-a/$)/2,v=(o+c+a/$)/2,y=m$1e.computeRealRoots(1,$,g),x=m$1e.computeRealRoots(1,-$,v);return 0!==y.length?(y[0]+=u,y[1]+=u,0!==x.length?(x[0]+=u,x[1]+=u,y[1]<=x[0]?[y[0],y[1],x[0],x[1]]:x[1]<=y[0]?[x[0],x[1],y[0],y[1]]:y[0]>=x[0]&&y[1]<=x[1]?[x[0],y[0],y[1],x[1]]:x[0]>=y[0]&&x[1]<=y[1]?[y[0],x[0],x[1],y[1]]:y[0]>x[0]&&y[0]<x[1]?[x[0],y[0],x[1],y[1]]:[y[0],x[0],y[1],x[1]]):y):0!==x.length?(x[0]+=u,x[1]+=u,x):[]}}return[]}function y$13(e,t,i,r){var n=e*e,o=-2*t,a=i*e+t*t-4*r,s=n*r-i*t*e+i*i,l=j$1c.computeRealRoots(1,o,a,s);if(l.length>0){var u,c,h,d,f,p,_=l[0],m=t-_,$=m*m,g=e/2,v=m/2,y=$-4*r,x=$+4*Math.abs(r),b=n-4*_,w=n+4*Math.abs(_);if(_<0||y*w<b*x){var C=Math.sqrt(b);u=C/2,c=0===C?0:(e*v-i)/C}else{var T=Math.sqrt(y);u=0===T?0:(e*v-i)/T,c=T/2}0===g&&0===u?(h=0,d=0):e$27.sign(g)===e$27.sign(u)?d=_/(h=g+u):h=_/(d=g-u),0===v&&0===c?(f=0,p=0):e$27.sign(v)===e$27.sign(c)?p=r/(f=v+c):f=r/(p=v-c);var S=m$1e.computeRealRoots(1,h,f),E=m$1e.computeRealRoots(1,d,p);if(0!==S.length)return 0!==E.length?S[1]<=E[0]?[S[0],S[1],E[0],E[1]]:E[1]<=S[0]?[E[0],E[1],S[0],S[1]]:S[0]>=E[0]&&S[1]<=E[1]?[E[0],S[0],S[1],E[1]]:E[0]>=S[0]&&E[1]<=S[1]?[S[0],E[0],E[1],S[1]]:S[0]>E[0]&&S[0]<E[1]?[E[0],S[0],E[1],S[1]]:[S[0],E[0],S[1],E[1]]:S;if(0!==E.length)return E}return[]}function f$18(e,t){t=t$X.clone(u$Y(t,t$X.ZERO)),t$X.equals(t,t$X.ZERO)||t$X.normalize(t,t),this.origin=t$X.clone(u$Y(e,t$X.ZERO)),this.direction=t}F$1j.computeDiscriminant=function(e,t,i,r,n){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");if("number"!=typeof r)throw new t$Z("d is a required number.");if("number"!=typeof n)throw new t$Z("e is a required number.");var o=e*e,a=t*t,s=a*t,l=i*i,u=l*i,c=r*r,h=c*r,d=n*n;return a*l*c-4*s*h-4*e*u*c+18*e*t*i*h-27*o*c*c+256*(o*e)*(d*n)+n*(18*s*i*r-4*a*u+16*e*l*l-80*e*t*l*r-6*e*a*c+144*o*i*c)+d*(144*e*a*i-27*a*a-128*o*l-192*o*t*r)},F$1j.computeRealRoots=function(e,t,i,r,n){if("number"!=typeof e)throw new t$Z("a is a required number.");if("number"!=typeof t)throw new t$Z("b is a required number.");if("number"!=typeof i)throw new t$Z("c is a required number.");if("number"!=typeof r)throw new t$Z("d is a required number.");if("number"!=typeof n)throw new t$Z("e is a required number.");if(Math.abs(e)<e$27.EPSILON15)return j$1c.computeRealRoots(t,i,r,n);var o=t/e,a=i/e,s=r/e,l=n/e,u=o<0?1:0;switch(u+=a<0?u+1:u,u+=s<0?u+1:u,u+=l<0?u+1:u){case 0:case 3:case 4:case 6:case 7:case 9:case 10:case 12:case 13:case 14:case 15:return P$1c(o,a,s,l);case 1:case 2:case 5:case 8:case 11:return y$13(o,a,s,l);default:return}},f$18.clone=function(e,t){if(e$28(e))return e$28(t)?(t.origin=t$X.clone(e.origin),t.direction=t$X.clone(e.direction),t):new f$18(e.origin,e.direction)},f$18.getPoint=function(e,t,i){return o$1u.typeOf.object("ray",e),o$1u.typeOf.number("t",t),e$28(i)||(i=new t$X),i=t$X.multiplyByScalar(e.direction,t,i),t$X.add(e.origin,i,i)};var g$10={rayPlane:function(e,t,i){if(!e$28(e))throw new t$Z("ray is required.");if(!e$28(t))throw new t$Z("plane is required.");e$28(i)||(i=new t$X);var r=e.origin,n=e.direction,o=t.normal,a=t$X.dot(o,n);if(!(Math.abs(a)<e$27.EPSILON15)){var s=(-t.distance-t$X.dot(o,r))/a;if(!(s<0))return i=t$X.multiplyByScalar(n,s,i),t$X.add(r,i,i)}}},or$c=new t$X,dr$7=new t$X,Y$U=new t$X,j$1b=new t$X,H$13=new t$X;g$10.rayTriangleParametric=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("ray is required.");if(!e$28(t))throw new t$Z("p0 is required.");if(!e$28(i))throw new t$Z("p1 is required.");if(!e$28(r))throw new t$Z("p2 is required.");n=u$Y(n,!1);var o,a,s,l,u,c=e.origin,h=e.direction,d=t$X.subtract(i,t,or$c),f=t$X.subtract(r,t,dr$7),p=t$X.cross(h,f,Y$U),_=t$X.dot(d,p);if(n){if(_<e$27.EPSILON6||(o=t$X.subtract(c,t,j$1b),(s=t$X.dot(o,p))<0||s>_)||(a=t$X.cross(o,d,H$13),(l=t$X.dot(h,a))<0||s+l>_))return;u=t$X.dot(f,a)/_}else{if(Math.abs(_)<e$27.EPSILON6)return;var m=1/_;if(o=t$X.subtract(c,t,j$1b),(s=t$X.dot(o,p)*m)<0||s>1||(a=t$X.cross(o,d,H$13),(l=t$X.dot(h,a)*m)<0||s+l>1))return;u=t$X.dot(f,a)*m}return u},g$10.rayTriangle=function(e,t,i,r,n,o){var a=g$10.rayTriangleParametric(e,t,i,r,n);if(e$28(a)&&!(a<0))return e$28(o)||(o=new t$X),t$X.multiplyByScalar(e.direction,a,o),t$X.add(e.origin,o,o)};var fr$6=new f$18;function vr$9(e,t,i,r){var n=t*t-4*e*i;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}g$10.lineSegmentTriangle=function(e,t,i,r,n,o,a){if(!e$28(e))throw new t$Z("v0 is required.");if(!e$28(t))throw new t$Z("v1 is required.");if(!e$28(i))throw new t$Z("p0 is required.");if(!e$28(r))throw new t$Z("p1 is required.");if(!e$28(n))throw new t$Z("p2 is required.");var s=fr$6;t$X.clone(e,s.origin),t$X.subtract(t,e,s.direction),t$X.normalize(s.direction,s.direction);var l=g$10.rayTriangleParametric(s,i,r,n,o);if(!(!e$28(l)||l<0||l>t$X.distance(e,t)))return e$28(a)||(a=new t$X),t$X.multiplyByScalar(s.direction,l,a),t$X.add(s.origin,a,a)};var cr$7={root0:0,root1:0};function J$14(e,t,i){e$28(i)||(i=new o$1t);var r=e.origin,n=e.direction,o=t.center,a=t.radius*t.radius,s=t$X.subtract(r,o,Y$U),l=vr$9(t$X.dot(n,n),2*t$X.dot(n,s),t$X.magnitudeSquared(s)-a,cr$7);if(e$28(l))return i.start=l.root0,i.stop=l.root1,i}g$10.raySphere=function(e,t,i){if(!e$28(e))throw new t$Z("ray is required.");if(!e$28(t))throw new t$Z("sphere is required.");if(e$28(i=J$14(e,t,i))&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var ur$a=new f$18;g$10.lineSegmentSphere=function(e,t,i,r){if(!e$28(e))throw new t$Z("p0 is required.");if(!e$28(t))throw new t$Z("p1 is required.");if(!e$28(i))throw new t$Z("sphere is required.");var n=ur$a;t$X.clone(e,n.origin);var o=t$X.subtract(t,e,n.direction),a=t$X.magnitude(o);if(t$X.normalize(o,o),!(!e$28(r=J$14(n,i,r))||r.stop<0||r.start>a))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,a),r};var sr$6=new t$X,hr$8=new t$X;function E$1i(e,t,i){var r=e+t;return e$27.sign(e)!==e$27.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function mr$9(e,t,i,r,n){var o,a=r*r,s=n*n,l=(e[p$1a.COLUMN1ROW1]-e[p$1a.COLUMN2ROW2])*s,u=n*(r*E$1i(e[p$1a.COLUMN1ROW0],e[p$1a.COLUMN0ROW1],e$27.EPSILON15)+t.y),c=e[p$1a.COLUMN0ROW0]*a+e[p$1a.COLUMN2ROW2]*s+r*t.x+i,h=s*E$1i(e[p$1a.COLUMN2ROW1],e[p$1a.COLUMN1ROW2],e$27.EPSILON15),d=n*(r*E$1i(e[p$1a.COLUMN2ROW0],e[p$1a.COLUMN0ROW2])+t.z),f=[];if(0===d&&0===h){if(0===(o=m$1e.computeRealRoots(l,u,c)).length)return f;var p=o[0],_=Math.sqrt(Math.max(1-p*p,0));if(f.push(new t$X(r,n*p,n*-_)),f.push(new t$X(r,n*p,n*_)),2===o.length){var m=o[1],$=Math.sqrt(Math.max(1-m*m,0));f.push(new t$X(r,n*m,n*-$)),f.push(new t$X(r,n*m,n*$))}return f}var g=d*d,v=h*h,y=d*h,x=l*l+v,b=2*(u*l+y),w=2*c*l+u*u-v+g,C=2*(c*u-y),T=c*c-g;if(0===x&&0===b&&0===w&&0===C)return f;var S=(o=F$1j.computeRealRoots(x,b,w,C,T)).length;if(0===S)return f;for(var E=0;E<S;++E){var A=o[E],P=A*A,I=Math.max(1-P,0),M=Math.sqrt(I),O=(e$27.sign(l)===e$27.sign(c)?E$1i(l*P+c,u*A,e$27.EPSILON12):e$27.sign(c)===e$27.sign(u*A)?E$1i(l*P,u*A+c,e$27.EPSILON12):E$1i(l*P+u*A,c,e$27.EPSILON12))*E$1i(h*A,d,e$27.EPSILON15);O<0?f.push(new t$X(r,n*A,n*M)):O>0?f.push(new t$X(r,n*A,n*-M)):0!==M?(f.push(new t$X(r,n*A,n*-M)),f.push(new t$X(r,n*A,n*M)),++E):f.push(new t$X(r,n*A,n*M))}return f}g$10.rayEllipsoid=function(e,t){if(!e$28(e))throw new t$Z("ray is required.");if(!e$28(t))throw new t$Z("ellipsoid is required.");var i,r,n,o,a,s=t.oneOverRadii,l=t$X.multiplyComponents(s,e.origin,sr$6),u=t$X.multiplyComponents(s,e.direction,hr$8),c=t$X.magnitudeSquared(l),h=t$X.dot(l,u);if(c>1){if(h>=0)return;var d=h*h;if(i=c-1,d<(n=(r=t$X.magnitudeSquared(u))*i))return;if(d>n){o=h*h-n;var f=(a=-h+Math.sqrt(o))/r,p=i/a;return f<p?new o$1t(f,p):{start:p,stop:f}}var _=Math.sqrt(i/r);return new o$1t(_,_)}return c<1?(i=c-1,o=h*h-(n=(r=t$X.magnitudeSquared(u))*i),new o$1t(0,(a=-h+Math.sqrt(o))/r)):h<0?new o$1t(0,-h/(r=t$X.magnitudeSquared(u))):void 0};var Z$19=new t$X,K$$=new t$X,X$Z=new t$X,V$Z=new t$X,wr$6=new t$X,gr$9=new p$1a,Sr$4=new p$1a,lr$a=new p$1a,qr$3=new p$1a,yr$6=new p$1a,$$12=new p$1a,k$1b=new p$1a,F$1i=new t$X,Or$4=new t$X,Mr$5=new t$W;g$10.grazingAltitudeLocation=function(e,t){if(!e$28(e))throw new t$Z("ray is required.");if(!e$28(t))throw new t$Z("ellipsoid is required.");var i=e.origin,r=e.direction;if(!t$X.equals(i,t$X.ZERO)){var n=t.geodeticSurfaceNormal(i,Z$19);if(t$X.dot(r,n)>=0)return i}var o=e$28(this.rayEllipsoid(e,t)),a=t.transformPositionToScaledSpace(r,Z$19),s=t$X.normalize(a,a),l=t$X.mostOrthogonalAxis(a,V$Z),u=t$X.normalize(t$X.cross(l,s,K$$),K$$),c=t$X.normalize(t$X.cross(s,u,X$Z),X$Z),h=gr$9;h[0]=s.x,h[1]=s.y,h[2]=s.z,h[3]=u.x,h[4]=u.y,h[5]=u.z,h[6]=c.x,h[7]=c.y,h[8]=c.z;var d=p$1a.transpose(h,Sr$4),f=p$1a.fromScale(t.radii,lr$a),p=p$1a.fromScale(t.oneOverRadii,qr$3),_=yr$6;_[0]=0,_[1]=-r.z,_[2]=r.y,_[3]=r.z,_[4]=0,_[5]=-r.x,_[6]=-r.y,_[7]=r.x,_[8]=0;var m,$,g=p$1a.multiply(p$1a.multiply(d,p,$$12),_,$$12),v=p$1a.multiply(p$1a.multiply(g,f,k$1b),h,k$1b),y=p$1a.multiplyByVector(g,i,wr$6),x=mr$9(v,t$X.negate(y,Z$19),0,0,1),b=x.length;if(b>0){for(var w=t$X.clone(t$X.ZERO,Or$4),C=Number.NEGATIVE_INFINITY,T=0;T<b;++T){m=p$1a.multiplyByVector(f,p$1a.multiplyByVector(h,x[T],F$1i),F$1i);var S=t$X.normalize(t$X.subtract(m,i,V$Z),V$Z),E=t$X.dot(S,r);E>C&&(C=E,w=t$X.clone(m,w))}var A=t.cartesianToCartographic(w,Mr$5);return C=e$27.clamp(C,0,1),$=t$X.magnitude(t$X.subtract(w,i,V$Z))*Math.sqrt(1-C*C),$=o?-$:$,A.height=$,t.cartographicToCartesian(A,new t$X)}};var Pr$6=new t$X;function o$1i(e,t){if(o$1u.typeOf.object("normal",e),!e$27.equalsEpsilon(t$X.magnitude(e),1,e$27.EPSILON6))throw new t$Z("normal must be normalized.");o$1u.typeOf.number("distance",t),this.normal=t$X.clone(e),this.distance=t}g$10.lineSegmentPlane=function(e,t,i,r){if(!e$28(e))throw new t$Z("endPoint0 is required.");if(!e$28(t))throw new t$Z("endPoint1 is required.");if(!e$28(i))throw new t$Z("plane is required.");e$28(r)||(r=new t$X);var n=t$X.subtract(t,e,Pr$6),o=i.normal,a=t$X.dot(o,n);if(!(Math.abs(a)<e$27.EPSILON6)){var s=t$X.dot(o,e),l=-(i.distance+s)/a;if(!(l<0||l>1))return t$X.multiplyByScalar(n,l,r),t$X.add(e,r,r),r}},g$10.trianglePlaneIntersection=function(e,t,i,r){if(!(e$28(e)&&e$28(t)&&e$28(i)&&e$28(r)))throw new t$Z("p0, p1, p2, and plane are required.");var n,o,a=r.normal,s=r.distance,l=t$X.dot(a,e)+s<0,u=t$X.dot(a,t)+s<0,c=t$X.dot(a,i)+s<0,h=0;if(h+=l?1:0,h+=u?1:0,(1===(h+=c?1:0)||2===h)&&(n=new t$X,o=new t$X),1===h){if(l)return g$10.lineSegmentPlane(e,t,r,n),g$10.lineSegmentPlane(e,i,r,o),{positions:[e,t,i,n,o],indices:[0,3,4,1,2,4,1,4,3]};if(u)return g$10.lineSegmentPlane(t,i,r,n),g$10.lineSegmentPlane(t,e,r,o),{positions:[e,t,i,n,o],indices:[1,3,4,2,0,4,2,4,3]};if(c)return g$10.lineSegmentPlane(i,e,r,n),g$10.lineSegmentPlane(i,t,r,o),{positions:[e,t,i,n,o],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!l)return g$10.lineSegmentPlane(t,e,r,n),g$10.lineSegmentPlane(i,e,r,o),{positions:[e,t,i,n,o],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return g$10.lineSegmentPlane(i,t,r,n),g$10.lineSegmentPlane(e,t,r,o),{positions:[e,t,i,n,o],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return g$10.lineSegmentPlane(e,i,r,n),g$10.lineSegmentPlane(t,i,r,o),{positions:[e,t,i,n,o],indices:[0,1,4,0,4,3,2,3,4]}}},o$1i.fromPointNormal=function(e,t,i){if(o$1u.typeOf.object("point",e),o$1u.typeOf.object("normal",t),!e$27.equalsEpsilon(t$X.magnitude(t),1,e$27.EPSILON6))throw new t$Z("normal must be normalized.");var r=-t$X.dot(t,e);return e$28(i)?(t$X.clone(t,i.normal),i.distance=r,i):new o$1i(t,r)};var m$1d=new t$X;o$1i.fromCartesian4=function(e,t){o$1u.typeOf.object("coefficients",e);var i=t$X.fromCartesian4(e,m$1d),r=e.w;if(!e$27.equalsEpsilon(t$X.magnitude(i),1,e$27.EPSILON6))throw new t$Z("normal must be normalized.");return e$28(t)?(t$X.clone(i,t.normal),t.distance=r,t):new o$1i(i,r)},o$1i.getPointDistance=function(e,t){return o$1u.typeOf.object("plane",e),o$1u.typeOf.object("point",t),t$X.dot(e.normal,t)+e.distance};var O$S=new t$X;o$1i.projectPointOntoPlane=function(e,t,i){o$1u.typeOf.object("plane",e),o$1u.typeOf.object("point",t),e$28(i)||(i=new t$X);var r=o$1i.getPointDistance(e,t),n=t$X.multiplyByScalar(e.normal,r,O$S);return t$X.subtract(t,n,i)};var l$1c=new t$X;function a$14(e,t,i){o$1u.defined("array",e),o$1u.defined("itemToFind",t),o$1u.defined("comparator",i);for(var r,n,o=0,a=e.length-1;o<=a;)if((n=i(e[r=~~((o+a)/2)],t))<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}function n$16(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}function $$11(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return e=(i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"")+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var f,p,_,m,$;if("%%"==e)return"%";for(var g=!1,v="",y=!1,x=!1,b=" ",w=l.length,C=0;l&&C<w;C++)switch(l.charAt(C)){case" ":v=" ";break;case"+":v="+";break;case"-":g=!0;break;case"'":b=l.charAt(C+1);break;case"0":y=!0;break;case"#":x=!0}if((u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0)<0&&(u=-u,g=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[i++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,$=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String($),g,u,h,y,b);case"c":return s(String.fromCharCode(+$),g,u,h,y);case"b":return a($,2,x,g,u,h,y);case"o":return a($,8,x,g,u,h,y);case"x":return a($,16,x,g,u,h,y);case"X":return a($,16,x,g,u,h,y).toUpperCase();case"u":return a($,10,x,g,u,h,y);case"i":case"d":return f=+$||0,$=(p=(f=Math.round(f-f%1))<0?"-":v)+n(String(Math.abs(f)),h,"0",!1),o($,p,g,u,y);case"e":case"E":case"f":case"F":case"g":case"G":return p=(f=+$)<0?"-":v,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],$=p+Math.abs(f)[_](h),o($,p,g,u,y)[m]();default:return e}};return r.replace(e,l)}function d$1e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}function i$11(e){if(null===e||isNaN(e))throw new t$Z("year is required and must be a number.");return e%4==0&&e%100!=0||e%400==0}function a$13(e,t){this.julianDate=e,this.offset=t}o$1i.transform=function(e,t,i){return o$1u.typeOf.object("plane",e),o$1u.typeOf.object("transform",t),y$15.multiplyByPointAsVector(t,e.normal,m$1d),t$X.normalize(m$1d,m$1d),t$X.multiplyByScalar(e.normal,-e.distance,l$1c),y$15.multiplyByPoint(t,l$1c,l$1c),o$1i.fromPointNormal(l$1c,m$1d,i)},o$1i.clone=function(e,t){return o$1u.typeOf.object("plane",e),e$28(t)?(t$X.clone(e.normal,t.normal),t.distance=e.distance,t):new o$1i(e.normal,e.distance)},o$1i.equals=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e.distance===t.distance&&t$X.equals(e.normal,t.normal)},o$1i.ORIGIN_XY_PLANE=Object.freeze(new o$1i(t$X.UNIT_Z,0)),o$1i.ORIGIN_YZ_PLANE=Object.freeze(new o$1i(t$X.UNIT_X,0)),o$1i.ORIGIN_ZX_PLANE=Object.freeze(new o$1i(t$X.UNIT_Y,0));var E$1h={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},h$Z=Object.freeze(E$1h),e$1X={UTC:0,TAI:1},H$12=Object.freeze(e$1X),Z$18=new d$1e,U$17=[31,28,31,30,31,30,31,31,30,31,30,31],b$1c=29;function H$11(e,t){return a$12.compare(e.julianDate,t.julianDate)}var O$R=new a$13;function q$19(e){O$R.julianDate=e;var t=a$12.leapSeconds,i=a$14(t,O$R,H$11);i<0&&(i=~i),i>=t.length&&(i=t.length-1);var r=t[i].offset;i>0&&(a$12.secondsDifference(t[i].julianDate,e)>r&&(r=t[--i].offset));a$12.addSeconds(e,r,e)}function F$1h(e,t){O$R.julianDate=e;var i=a$12.leapSeconds,r=a$14(i,O$R,H$11);if(r<0&&(r=~r),0===r)return a$12.addSeconds(e,-i[0].offset,t);if(r>=i.length)return a$12.addSeconds(e,-i[r-1].offset,t);var n=a$12.secondsDifference(i[r].julianDate,e);return 0===n?a$12.addSeconds(e,-i[r].offset,t):n<=1?void 0:a$12.addSeconds(e,-i[--r].offset,t)}function I$1t(e,t,i){var r=t/h$Z.SECONDS_PER_DAY|0;return e+=r,(t-=h$Z.SECONDS_PER_DAY*r)<0&&(e--,t+=h$Z.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function x$1d(e,t,i,r,n,o,a){var s=(t-14)/12|0,l=e+4800+s,u=(1461*l/4|0)+(367*(t-2-12*s)/12|0)-(3*((l+100)/100|0)/4|0)+i-32075;(r-=12)<0&&(r+=24);var c=o+(r*h$Z.SECONDS_PER_HOUR+n*h$Z.SECONDS_PER_MINUTE+a*h$Z.SECONDS_PER_MILLISECOND);return c>=43200&&(u-=1),[u,c]}var V$Y=/^(\d{4})$/,B$$=/^(\d{4})-(\d{2})$/,K$_=/^(\d{4})-?(\d{3})$/,Q$15=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,X$Y=/^(\d{4})-?(\d{2})-?(\d{2})$/,G$1g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,j$1a=/^(\d{2})(\.\d+)?/.source+G$1g.source,ee$F=/^(\d{2}):?(\d{2})(\.\d+)?/.source+G$1g.source,ne$H=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+G$1g.source,y$12="Invalid ISO 8601 date.";function a$12(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=u$Y(e,0),t=u$Y(t,0),i=u$Y(i,H$12.UTC);var r=0|e;I$1t(r,t+=(e-r)*h$Z.SECONDS_PER_DAY,this),i===H$12.UTC&&q$19(this)}a$12.fromGregorianDate=function(e,t){if(!(e instanceof d$1e))throw new t$Z("date must be a valid GregorianDate.");var i=x$1d(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return e$28(t)?(I$1t(i[0],i[1],t),q$19(t),t):new a$12(i[0],i[1],H$12.UTC)},a$12.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new t$Z("date must be a valid JavaScript Date.");var i=x$1d(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return e$28(t)?(I$1t(i[0],i[1],t),q$19(t),t):new a$12(i[0],i[1],H$12.UTC)},a$12.fromIso8601=function(e,t){if("string"!=typeof e)throw new t$Z(y$12);var i,r,n,o,a,s=(e=e.replace(",",".")).split("T"),l=1,u=1,c=0,h=0,d=0,f=0,p=s[0],_=s[1];if(!e$28(p))throw new t$Z(y$12);if(null!==(s=p.match(X$Y))){if((o=p.split("-").length-1)>0&&2!==o)throw new t$Z(y$12);i=+s[1],l=+s[2],u=+s[3]}else if(null!==(s=p.match(B$$)))i=+s[1],l=+s[2];else if(null!==(s=p.match(V$Y)))i=+s[1];else{var m;if(null!==(s=p.match(K$_))){if(i=+s[1],m=+s[2],n=i$11(i),m<1||n&&m>366||!n&&m>365)throw new t$Z(y$12)}else{if(null===(s=p.match(Q$15)))throw new t$Z(y$12);i=+s[1];var $=+s[2],g=+s[3]||0;if((o=p.split("-").length-1)>0&&(!e$28(s[3])&&1!==o||e$28(s[3])&&2!==o))throw new t$Z(y$12);m=7*$+g-new Date(Date.UTC(i,0,4)).getUTCDay()-3}(r=new Date(Date.UTC(i,0,1))).setUTCDate(m),l=r.getUTCMonth()+1,u=r.getUTCDate()}if(n=i$11(i),l<1||l>12||u<1||(2!==l||!n)&&u>U$17[l-1]||n&&2===l&&u>b$1c)throw new t$Z(y$12);if(e$28(_)){if(null!==(s=_.match(ne$H))){if((o=_.split(":").length-1)>0&&2!==o&&3!==o)throw new t$Z(y$12);c=+s[1],h=+s[2],d=+s[3],f=1e3*+(s[4]||0),a=5}else if(null!==(s=_.match(ee$F))){if((o=_.split(":").length-1)>2)throw new t$Z(y$12);c=+s[1],h=+s[2],d=60*+(s[3]||0),a=4}else{if(null===(s=_.match(j$1a)))throw new t$Z(y$12);c=+s[1],h=60*+(s[2]||0),a=3}if(h>=60||d>=61||c>24||24===c&&(h>0||d>0||f>0))throw new t$Z(y$12);var v=s[a],y=+s[a+1],x=+(s[a+2]||0);switch(v){case"+":c-=y,h-=x;break;case"-":c+=y,h+=x;break;case"Z":break;default:h+=new Date(Date.UTC(i,l-1,u,c,h)).getTimezoneOffset()}}var b=60===d;for(b&&d--;h>=60;)h-=60,c++;for(;c>=24;)c-=24,u++;for(r=n&&2===l?b$1c:U$17[l-1];u>r;)u-=r,++l>12&&(l-=12,i++),r=n&&2===l?b$1c:U$17[l-1];for(;h<0;)h+=60,c--;for(;c<0;)c+=24,u--;for(;u<1;)--l<1&&(l+=12,i--),u+=r=n&&2===l?b$1c:U$17[l-1];var w=x$1d(i,l,u,c,h,d,f);return e$28(t)?(I$1t(w[0],w[1],t),q$19(t)):t=new a$12(w[0],w[1],H$12.UTC),b&&a$12.addSeconds(t,1,t),t},a$12.now=function(e){return a$12.fromDate(new Date,e)};var g$$=new a$12(0,0,H$12.TAI);function x$1c(e){if(e=u$Y(e,u$Y.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=u$Y(e.addNewLeapSeconds,!0),e$28(e.data))U$16(this,e.data);else if(e$28(e.url)){var t=t$S.createIfNeeded(e.url),i=this;this._downloadPromise=o$1q(t.fetchJson(),(function(e){U$16(i,e)}),(function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."}))}else U$16(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function F$1g(e,t){return a$12.compare(e.julianDate,t)}function U$16(e,t){if(e$28(t.columnNames))if(e$28(t.samples)){var i=t.columnNames.indexOf("modifiedJulianDateUtc"),r=t.columnNames.indexOf("xPoleWanderRadians"),n=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||r<0||n<0||o<0||a<0||s<0||l<0)e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";else{var u=e._samples=t.samples,c=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=r,e._yPoleWanderRadiansColumn=n,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;for(var h,d=e._addNewLeapSeconds,f=0,p=u.length;f<p;f+=e._columnCount){var _=u[f+i],m=u[f+l],$=new a$12(_+h$Z.MODIFIED_JULIAN_DATE_DIFFERENCE,m,H$12.TAI);if(c.push($),d){if(m!==h&&e$28(h)){var g=a$12.leapSeconds,v=a$14(g,$,F$1g);if(v<0){var y=new a$13($,m);g.splice(~v,0,y)}}h=m}}}}else e._dataError="Error in loaded EOP data: The samples property is required.";else e._dataError="Error in loaded EOP data: The columnNames property is required."}function T$$(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function O$Q(e,t,i){return t+e*(i-t)}function I$1s(e,t,i,r,n,o,a){var s=e._columnCount;if(o>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;var l=t[n],u=t[o];if(l.equals(u)||r.equals(l))return T$$(e,i,n,s,a),a;if(r.equals(u))return T$$(e,i,o,s,a),a;var c=a$12.secondsDifference(r,l)/a$12.secondsDifference(u,l),h=n*s,d=o*s,f=i[h+e._ut1MinusUtcSecondsColumn],p=i[d+e._ut1MinusUtcSecondsColumn],_=p-f;if(_>.5||_<-.5){var m=i[h+e._taiMinusUtcSecondsColumn],$=i[d+e._taiMinusUtcSecondsColumn];m!==$&&(u.equals(r)?f=p:p-=$-m)}return a.xPoleWander=O$Q(c,i[h+e._xPoleWanderRadiansColumn],i[d+e._xPoleWanderRadiansColumn]),a.yPoleWander=O$Q(c,i[h+e._yPoleWanderRadiansColumn],i[d+e._yPoleWanderRadiansColumn]),a.xPoleOffset=O$Q(c,i[h+e._xCelestialPoleOffsetRadiansColumn],i[d+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=O$Q(c,i[h+e._yCelestialPoleOffsetRadiansColumn],i[d+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=O$Q(c,f,p),a}function i$10(e,t,i){this.heading=u$Y(e,0),this.pitch=u$Y(t,0),this.roll=u$Y(i,0)}function a$11(e,t,i){this.x=e,this.y=t,this.s=i}function D$18(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._xysFileUrlTemplate=t$S.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=u$Y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=u$Y(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a$12(this._sampleZeroJulianEphemerisDate,0,H$12.TAI),this._stepSizeDays=u$Y(e.stepSizeDays,1),this._samplesPerXysFile=u$Y(e.samplesPerXysFile,1e3),this._totalSamples=u$Y(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),r=this._xTable=new Array(t+1),n=Math.pow(this._stepSizeDays,t),o=0;o<=t;++o){i[o]=n,r[o]=o*this._stepSizeDays;for(var a=0;a<=t;++a)a!==o&&(i[o]*=o-a);i[o]=1/i[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}a$12.toGregorianDate=function(e,t){if(!e$28(e))throw new t$Z("julianDate is required.");var i=!1,r=F$1h(e,g$$);e$28(r)||(a$12.addSeconds(e,-1,g$$),r=F$1h(g$$,g$$),i=!0);var n=r.dayNumber,o=r.secondsOfDay;o>=43200&&(n+=1);var a=n+68569|0,s=4*a/146097|0,l=4e3*((a=a-((146097*s+3)/4|0)|0)+1)/1461001|0,u=80*(a=a-(1461*l/4|0)+31|0)/2447|0,c=a-(2447*u/80|0)|0,h=u+2-12*(a=u/11|0)|0,d=100*(s-49)+l+a|0,f=o/h$Z.SECONDS_PER_HOUR|0,p=o-f*h$Z.SECONDS_PER_HOUR,_=p/h$Z.SECONDS_PER_MINUTE|0,m=0|(p-=_*h$Z.SECONDS_PER_MINUTE),$=(p-m)/h$Z.SECONDS_PER_MILLISECOND;return(f+=12)>23&&(f-=24),i&&(m+=1),e$28(t)?(t.year=d,t.month=h,t.day=c,t.hour=f,t.minute=_,t.second=m,t.millisecond=$,t.isLeapSecond=i,t):new d$1e(d,h,c,f,_,m,$,i)},a$12.toDate=function(e){if(!e$28(e))throw new t$Z("julianDate is required.");var t=a$12.toGregorianDate(e,Z$18),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},a$12.toIso8601=function(e,t){if(!e$28(e))throw new t$Z("julianDate is required.");var i=a$12.toGregorianDate(e,Z$18),r=i.year,n=i.month,o=i.day,a=i.hour,s=i.minute,l=i.second,u=i.millisecond;return 1e4===r&&1===n&&1===o&&0===a&&0===s&&0===l&&0===u&&(r=9999,n=12,o=31,a=24),e$28(t)||0===u?e$28(t)&&0!==t?$$11("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,n,o,a,s,l,(.01*u).toFixed(t).replace(".","").slice(0,t)):$$11("%04d-%02d-%02dT%02d:%02d:%02dZ",r,n,o,a,s,l):$$11("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",r,n,o,a,s,l,(.01*u).toString().replace(".",""))},a$12.clone=function(e,t){if(e$28(e))return e$28(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new a$12(e.dayNumber,e.secondsOfDay,H$12.TAI)},a$12.compare=function(e,t){if(!e$28(e))throw new t$Z("left is required.");if(!e$28(t))throw new t$Z("right is required.");var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},a$12.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},a$12.equalsEpsilon=function(e,t,i){if(!e$28(i))throw new t$Z("epsilon is required.");return e===t||e$28(e)&&e$28(t)&&Math.abs(a$12.secondsDifference(e,t))<=i},a$12.totalDays=function(e){if(!e$28(e))throw new t$Z("julianDate is required.");return e.dayNumber+e.secondsOfDay/h$Z.SECONDS_PER_DAY},a$12.secondsDifference=function(e,t){if(!e$28(e))throw new t$Z("left is required.");if(!e$28(t))throw new t$Z("right is required.");return(e.dayNumber-t.dayNumber)*h$Z.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},a$12.daysDifference=function(e,t){if(!e$28(e))throw new t$Z("left is required.");if(!e$28(t))throw new t$Z("right is required.");return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/h$Z.SECONDS_PER_DAY},a$12.computeTaiMinusUtc=function(e){O$R.julianDate=e;var t=a$12.leapSeconds,i=a$14(t,O$R,H$11);return i<0&&(i=~i,--i<0&&(i=0)),t[i].offset},a$12.addSeconds=function(e,t,i){if(!e$28(e))throw new t$Z("julianDate is required.");if(!e$28(t))throw new t$Z("seconds is required.");if(!e$28(i))throw new t$Z("result is required.");return I$1t(e.dayNumber,e.secondsOfDay+t,i)},a$12.addMinutes=function(e,t,i){if(!e$28(e))throw new t$Z("julianDate is required.");if(!e$28(t))throw new t$Z("minutes is required.");if(!e$28(i))throw new t$Z("result is required.");var r=e.secondsOfDay+t*h$Z.SECONDS_PER_MINUTE;return I$1t(e.dayNumber,r,i)},a$12.addHours=function(e,t,i){if(!e$28(e))throw new t$Z("julianDate is required.");if(!e$28(t))throw new t$Z("hours is required.");if(!e$28(i))throw new t$Z("result is required.");var r=e.secondsOfDay+t*h$Z.SECONDS_PER_HOUR;return I$1t(e.dayNumber,r,i)},a$12.addDays=function(e,t,i){if(!e$28(e))throw new t$Z("julianDate is required.");if(!e$28(t))throw new t$Z("days is required.");if(!e$28(i))throw new t$Z("result is required.");return I$1t(e.dayNumber+t,e.secondsOfDay,i)},a$12.lessThan=function(e,t){return a$12.compare(e,t)<0},a$12.lessThanOrEquals=function(e,t){return a$12.compare(e,t)<=0},a$12.greaterThan=function(e,t){return a$12.compare(e,t)>0},a$12.greaterThanOrEquals=function(e,t){return a$12.compare(e,t)>=0},a$12.prototype.clone=function(e){return a$12.clone(this,e)},a$12.prototype.equals=function(e){return a$12.equals(this,e)},a$12.prototype.equalsEpsilon=function(e,t){return a$12.equalsEpsilon(this,e,t)},a$12.prototype.toString=function(){return a$12.toIso8601(this)},a$12.leapSeconds=[new a$13(new a$12(2441317,43210,H$12.TAI),10),new a$13(new a$12(2441499,43211,H$12.TAI),11),new a$13(new a$12(2441683,43212,H$12.TAI),12),new a$13(new a$12(2442048,43213,H$12.TAI),13),new a$13(new a$12(2442413,43214,H$12.TAI),14),new a$13(new a$12(2442778,43215,H$12.TAI),15),new a$13(new a$12(2443144,43216,H$12.TAI),16),new a$13(new a$12(2443509,43217,H$12.TAI),17),new a$13(new a$12(2443874,43218,H$12.TAI),18),new a$13(new a$12(2444239,43219,H$12.TAI),19),new a$13(new a$12(2444786,43220,H$12.TAI),20),new a$13(new a$12(2445151,43221,H$12.TAI),21),new a$13(new a$12(2445516,43222,H$12.TAI),22),new a$13(new a$12(2446247,43223,H$12.TAI),23),new a$13(new a$12(2447161,43224,H$12.TAI),24),new a$13(new a$12(2447892,43225,H$12.TAI),25),new a$13(new a$12(2448257,43226,H$12.TAI),26),new a$13(new a$12(2448804,43227,H$12.TAI),27),new a$13(new a$12(2449169,43228,H$12.TAI),28),new a$13(new a$12(2449534,43229,H$12.TAI),29),new a$13(new a$12(2450083,43230,H$12.TAI),30),new a$13(new a$12(2450630,43231,H$12.TAI),31),new a$13(new a$12(2451179,43232,H$12.TAI),32),new a$13(new a$12(2453736,43233,H$12.TAI),33),new a$13(new a$12(2454832,43234,H$12.TAI),34),new a$13(new a$12(2456109,43235,H$12.TAI),35),new a$13(new a$12(2457204,43236,H$12.TAI),36),new a$13(new a$12(2457754,43237,H$12.TAI),37)],x$1c.NONE=Object.freeze({getPromiseToLoad:function(){return o$1q()},compute:function(e,t){return e$28(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n$16(0,0,0,0,0),t}}),x$1c.prototype.getPromiseToLoad=function(){return o$1q(this._downloadPromise)},x$1c.prototype.compute=function(e,t){if(e$28(this._samples)){if(e$28(t)||(t=new n$16(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;var i=this._dates,r=this._lastIndex,n=0,o=0;if(e$28(r)){var a=i[r],s=i[r+1],l=a$12.lessThanOrEquals(a,e),u=!e$28(s),c=u||a$12.greaterThanOrEquals(s,e);if(l&&c)return n=r,!u&&s.equals(e)&&++n,o=n+1,I$1s(this,i,this._samples,e,n,o,t),t}var h=a$14(i,e,a$12.compare,this._dateColumn);return h>=0?(h<i.length-1&&i[h+1].equals(e)&&++h,n=h,o=h):(n=(o=~h)-1)<0&&(n=0),this._lastIndex=n,I$1s(this,i,this._samples,e,n,o,t),t}if(e$28(this._dataError))throw new t$U(this._dataError)},i$10.fromQuaternion=function(e,t){if(!e$28(e))throw new t$Z("quaternion is required");e$28(t)||(t=new i$10);var i=2*(e.w*e.y-e.z*e.x),r=1-2*(e.x*e.x+e.y*e.y),n=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,o),t.roll=Math.atan2(n,r),t.pitch=-e$27.asinClamped(i),t},i$10.fromDegrees=function(e,t,i,r){if(!e$28(e))throw new t$Z("heading is required");if(!e$28(t))throw new t$Z("pitch is required");if(!e$28(i))throw new t$Z("roll is required");return e$28(r)||(r=new i$10),r.heading=e*e$27.RADIANS_PER_DEGREE,r.pitch=t*e$27.RADIANS_PER_DEGREE,r.roll=i*e$27.RADIANS_PER_DEGREE,r},i$10.clone=function(e,t){if(e$28(e))return e$28(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new i$10(e.heading,e.pitch,e.roll)},i$10.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},i$10.equalsEpsilon=function(e,t,i,r){return e===t||e$28(e)&&e$28(t)&&e$27.equalsEpsilon(e.heading,t.heading,i,r)&&e$27.equalsEpsilon(e.pitch,t.pitch,i,r)&&e$27.equalsEpsilon(e.roll,t.roll,i,r)},i$10.prototype.clone=function(e){return i$10.clone(this,e)},i$10.prototype.equals=function(e){return i$10.equals(this,e)},i$10.prototype.equalsEpsilon=function(e,t,i){return i$10.equalsEpsilon(this,e,t,i)},i$10.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"};var E$1g=new a$12(0,0,H$12.TAI);function w$V(e,t,i){var r=E$1g;return r.dayNumber=t,r.secondsOfDay=i,a$12.daysDifference(r,e._sampleZeroDateTT)}function T$_(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];var i=o$1q.defer();e._chunkDownloadsInProgress[t]=i;var r=e._xysFileUrlTemplate;return o$1q((e$28(r)?r.getDerivedResource({templateValues:{0:t}}):new t$S({url:n$17("Assets/IAU2006_XYS/IAU2006_XYS_"+t+".json")})).fetchJson(),(function(r){e._chunkDownloadsInProgress[t]=!1;for(var n=e._samples,o=r.samples,a=t*e._samplesPerXysFile*3,s=0,l=o.length;s<l;++s)n[a+s]=o[s];i.resolve()})),i.promise}D$18.prototype.preload=function(e,t,i,r){var n=w$V(this,e,t),o=w$V(this,i,r),a=n/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var l=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,c=[],h=l;h<=u;++h)c.push(T$_(this,h));return o$1q.all(c)},D$18.prototype.computeXysRadians=function(e,t,i){var r=w$V(this,e,t);if(!(r<0)){var n=r/this._stepSizeDays|0;if(!(n>=this._totalSamples)){var o=this._interpolationOrder,a=n-(o/2|0);a<0&&(a=0);var s=a+o;s>=this._totalSamples&&((a=(s=this._totalSamples-1)-o)<0&&(a=0));var l=!1,u=this._samples;if(e$28(u[3*a])||(T$_(this,a/this._samplesPerXysFile|0),l=!0),e$28(u[3*s])||(T$_(this,s/this._samplesPerXysFile|0),l=!0),!l){e$28(i)?(i.x=0,i.y=0,i.s=0):i=new a$11(0,0,0);var c,h,d=r-a*this._stepSizeDays,f=this._work,p=this._denominators,_=this._coef,m=this._xTable;for(c=0;c<=o;++c)f[c]=d-m[c];for(c=0;c<=o;++c){for(_[c]=1,h=0;h<=o;++h)h!==c&&(_[c]*=f[h]);_[c]*=p[c];var $=3*(a+c);i.x+=_[c]*u[$++],i.y+=_[c]*u[$++],i.s+=_[c]*u[$]}return i}}}};var r$19,n$15={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},l$1b={},r$18,l$1a,E$1f,c$17,W$12,d$1d,h$Y,f$17,w$U,v$O,k$1a,A$1g,S$Z,R$_,V$X,I$1r,N$V,g$_,a$10,i$$;function o$1h(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function b$1b(){if(!e$28(l$1a)&&(l$1a=!1,!p$14())){var e=/ Chrome\/([\.0-9]+)/.exec(r$18.userAgent);null!==e&&(l$1a=!0,E$1f=o$1h(e[1]))}return l$1a}function z$X(){return b$1b()&&E$1f}function P$1b(){if(!e$28(c$17)&&(c$17=!1,!b$1b()&&!p$14()&&/ Safari\/[\.0-9]+/.test(r$18.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(r$18.userAgent);null!==e&&(c$17=!0,W$12=o$1h(e[1]))}return c$17}function G$1f(){return P$1b()&&W$12}function C$11(){if(!e$28(d$1d)){d$1d=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(r$18.userAgent);null!==e&&(d$1d=!0,(h$Y=o$1h(e[1])).isNightly=!!e[2])}return d$1d}function K$Z(){return C$11()&&h$Y}function F$1f(){var e;e$28(f$17)||(f$17=!1,"Microsoft Internet Explorer"===r$18.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(r$18.userAgent))&&(f$17=!0,w$U=o$1h(e[1])):"Netscape"===r$18.appName&&(null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(r$18.userAgent))&&(f$17=!0,w$U=o$1h(e[1]))));return f$17}function L$1h(){return F$1f()&&w$U}function p$14(){if(!e$28(v$O)){v$O=!1;var e=/ Edge\/([\.0-9]+)/.exec(r$18.userAgent);null!==e&&(v$O=!0,k$1a=o$1h(e[1]))}return v$O}function X$X(){return p$14()&&k$1a}function x$1b(){if(!e$28(A$1g)){A$1g=!1;var e=/Firefox\/([\.0-9]+)/.exec(r$18.userAgent);null!==e&&(A$1g=!0,S$Z=o$1h(e[1]))}return A$1g}function Y$T(){return e$28(R$_)||(R$_=/Windows/i.test(r$18.appVersion)),R$_}function q$18(){return x$1b()&&S$Z}function H$10(){return e$28(V$X)||(V$X="object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)),V$X}function Z$17(){return e$28(I$1r)||(I$1r=!x$1b()&&typeof PointerEvent<"u"&&(!e$28(r$18.pointerEnabled)||r$18.pointerEnabled)),I$1r}function U$15(){if(!e$28(g$_)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var t=e.style.imageRendering;(g$_=e$28(t)&&""!==t)&&(N$V=t)}return g$_}function _$11(){return U$15()?N$V:void 0}function B$_(){if(e$28(i$$))return i$$.promise;i$$=o$1q.defer(),p$14()&&(a$10=!1,i$$.resolve(a$10));var e=new Image;return e.onload=function(){a$10=e.width>0&&e.height>0,i$$.resolve(a$10)},e.onerror=function(){a$10=!1,i$$.resolve(a$10)},e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",i$$.promise}function $$10(){return e$28(i$$)||B$_(),a$10}Object.defineProperties(l$1b,{element:{get:function(){if(l$1b.supportsFullscreen())return document[n$15.fullscreenElement]}},changeEventName:{get:function(){if(l$1b.supportsFullscreen())return n$15.fullscreenchange}},errorEventName:{get:function(){if(l$1b.supportsFullscreen())return n$15.fullscreenerror}},enabled:{get:function(){if(l$1b.supportsFullscreen())return document[n$15.fullscreenEnabled]}},fullscreen:{get:function(){if(l$1b.supportsFullscreen())return null!==l$1b.element}}}),l$1b.supportsFullscreen=function(){if(e$28(r$19))return r$19;r$19=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n$15.requestFullscreen="requestFullscreen",n$15.exitFullscreen="exitFullscreen",n$15.fullscreenEnabled="fullscreenEnabled",n$15.fullscreenElement="fullscreenElement",n$15.fullscreenchange="fullscreenchange",n$15.fullscreenerror="fullscreenerror",r$19=!0;for(var t,i=["webkit","moz","o","ms","khtml"],r=0,n=i.length;r<n;++r){var o=i[r];"function"==typeof e[t=o+"RequestFullscreen"]?(n$15.requestFullscreen=t,r$19=!0):"function"==typeof e[t=o+"RequestFullScreen"]&&(n$15.requestFullscreen=t,r$19=!0),t=o+"ExitFullscreen","function"==typeof document[t]?n$15.exitFullscreen=t:(t=o+"CancelFullScreen","function"==typeof document[t]&&(n$15.exitFullscreen=t)),t=o+"FullscreenEnabled",void 0!==document[t]?n$15.fullscreenEnabled=t:(t=o+"FullScreenEnabled",void 0!==document[t]&&(n$15.fullscreenEnabled=t)),t=o+"FullscreenElement",void 0!==document[t]?n$15.fullscreenElement=t:(t=o+"FullScreenElement",void 0!==document[t]&&(n$15.fullscreenElement=t)),t=o+"fullscreenchange",void 0!==document["on"+t]&&("ms"===o&&(t="MSFullscreenChange"),n$15.fullscreenchange=t),t=o+"fullscreenerror",void 0!==document["on"+t]&&("ms"===o&&(t="MSFullscreenError"),n$15.fullscreenerror=t)}return r$19},l$1b.requestFullscreen=function(e,t){!l$1b.supportsFullscreen()||e[n$15.requestFullscreen]({vrDisplay:t})},l$1b.exitFullscreen=function(){!l$1b.supportsFullscreen()||document[n$15.exitFullscreen]()},l$1b._names=n$15,r$18=typeof navigator<"u"?navigator:{};var m$1c=[];typeof ArrayBuffer<"u"&&(m$1c.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&m$1c.push(Uint8ClampedArray),typeof CanvasPixelArray<"u"&&m$1c.push(CanvasPixelArray));var s$V={isChrome:b$1b,chromeVersion:z$X,isSafari:P$1b,safariVersion:G$1f,isWebkit:C$11,webkitVersion:K$Z,isInternetExplorer:F$1f,internetExplorerVersion:L$1h,isEdge:p$14,edgeVersion:X$X,isFirefox:x$1b,firefoxVersion:q$18,isWindows:Y$T,isNodeJs:H$10,hardwareConcurrency:u$Y(r$18.hardwareConcurrency,3),supportsPointerEvents:Z$17,supportsImageRenderingPixelated:U$15,supportsWebP:B$_,supportsWebPSync:$$10,imageRenderingValue:_$11,typedArrayTypes:m$1c,isPCBroswer:ee$E};function ee$E(){var e=window.navigator.userAgent.toLowerCase(),t="ipad"==e.match(/ipad/i),i="iphone os"==e.match(/iphone os/i),r="midp"==e.match(/midp/i),n="ucweb"==e.match(/ucweb/i),o="android"==e.match(/android/i),a="windows ce"==e.match(/windows ce/i),s="windows mobile"==e.match(/windows mobile/i);return!(t||i||r||n||o||a||s)}function n$14(e,t,i,r){this.x=u$Y(e,0),this.y=u$Y(t,0),this.z=u$Y(i,0),this.w=u$Y(r,0)}s$V.supportsFullscreen=function(){return l$1b.supportsFullscreen()},s$V.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},s$V.supportsWebWorkers=function(){return typeof Worker<"u"},s$V.supportsWebAssembly=function(){return typeof WebAssembly<"u"&&!s$V.isEdge()},s$V.supportsOffscreenCanvas=function(){return typeof OffscreenCanvas<"u"&&!s$V.isEdge()};var E$1e=new t$X;n$14.fromAxisAngle=function(e,t,i){o$1u.typeOf.object("axis",e),o$1u.typeOf.number("angle",t);var r=t/2,n=Math.sin(r),o=(E$1e=t$X.normalize(e,E$1e)).x*n,a=E$1e.y*n,s=E$1e.z*n,l=Math.cos(r);return e$28(i)?(i.x=o,i.y=a,i.z=s,i.w=l,i):new n$14(o,a,s,l)};var G$1e=[1,2,0],J$13=new Array(3);n$14.fromRotationMatrix=function(e,t){o$1u.typeOf.object("matrix",e);var i,r,n,o,a,s=e[p$1a.COLUMN0ROW0],l=e[p$1a.COLUMN1ROW1],u=e[p$1a.COLUMN2ROW2],c=s+l+u;if(c>0)a=.5*(i=Math.sqrt(c+1)),i=.5/i,r=(e[p$1a.COLUMN1ROW2]-e[p$1a.COLUMN2ROW1])*i,n=(e[p$1a.COLUMN2ROW0]-e[p$1a.COLUMN0ROW2])*i,o=(e[p$1a.COLUMN0ROW1]-e[p$1a.COLUMN1ROW0])*i;else{var h=G$1e,d=0;l>s&&(d=1),u>s&&u>l&&(d=2);var f=h[d],p=h[f];i=Math.sqrt(e[p$1a.getElementIndex(d,d)]-e[p$1a.getElementIndex(f,f)]-e[p$1a.getElementIndex(p,p)]+1);var _=J$13;_[d]=.5*i,i=.5/i,a=(e[p$1a.getElementIndex(p,f)]-e[p$1a.getElementIndex(f,p)])*i,_[f]=(e[p$1a.getElementIndex(f,d)]+e[p$1a.getElementIndex(d,f)])*i,_[p]=(e[p$1a.getElementIndex(p,d)]+e[p$1a.getElementIndex(d,p)])*i,r=-_[0],n=-_[1],o=-_[2]}return e$28(t)?(t.x=r,t.y=n,t.z=o,t.w=a,t):new n$14(r,n,o,a)};var Y$S=new n$14,Z$16=new n$14,I$1q=new n$14,k$19=new n$14;n$14.fromHeadingPitchRoll=function(e,t){return o$1u.typeOf.object("headingPitchRoll",e),k$19=n$14.fromAxisAngle(t$X.UNIT_X,e.roll,Y$S),I$1q=n$14.fromAxisAngle(t$X.UNIT_Y,-e.pitch,t),t=n$14.multiply(I$1q,k$19,I$1q),Z$16=n$14.fromAxisAngle(t$X.UNIT_Z,-e.heading,Y$S),n$14.multiply(Z$16,t,t)};var g$Z=new t$X,U$14=new t$X,i$_=new n$14,H$$=new n$14,C$10=new n$14;n$14.packedLength=4,n$14.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},n$14.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new n$14),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},n$14.packedInterpolationLength=3,n$14.convertPackedArrayForInterpolation=function(e,t,i,r){n$14.unpack(e,4*i,C$10),n$14.conjugate(C$10,C$10);for(var n=0,o=i-t+1;n<o;n++){var a=3*n;n$14.unpack(e,4*(t+n),i$_),n$14.multiply(i$_,C$10,i$_),i$_.w<0&&n$14.negate(i$_,i$_),n$14.computeAxis(i$_,g$Z);var s=n$14.computeAngle(i$_);r[a]=g$Z.x*s,r[a+1]=g$Z.y*s,r[a+2]=g$Z.z*s}},n$14.unpackInterpolationResult=function(e,t,i,r,n){e$28(n)||(n=new n$14),t$X.fromArray(e,0,U$14);var o=t$X.magnitude(U$14);return n$14.unpack(t,4*r,H$$),0===o?n$14.clone(n$14.IDENTITY,i$_):n$14.fromAxisAngle(U$14,o,i$_),n$14.multiply(i$_,H$$,n)},n$14.clone=function(e,t){if(e$28(e))return e$28(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new n$14(e.x,e.y,e.z,e.w)},n$14.conjugate=function(e,t){return o$1u.typeOf.object("quaternion",e),o$1u.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},n$14.magnitudeSquared=function(e){return o$1u.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},n$14.magnitude=function(e){return Math.sqrt(n$14.magnitudeSquared(e))},n$14.normalize=function(e,t){o$1u.typeOf.object("result",t);var i=1/n$14.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},n$14.inverse=function(e,t){o$1u.typeOf.object("result",t);var i=n$14.magnitudeSquared(e);return t=n$14.conjugate(e,t),n$14.multiplyByScalar(t,1/i,t)},n$14.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},n$14.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},n$14.negate=function(e,t){return o$1u.typeOf.object("quaternion",e),o$1u.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},n$14.dot=function(e,t){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},n$14.multiply=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,h=a*s+r*c+n*u-o*l,d=a*l-r*u+n*c+o*s,f=a*u+r*l-n*s+o*c,p=a*c-r*s-n*l-o*u;return i.x=h,i.y=d,i.z=f,i.w=p,i},n$14.multiplyByVec=function(e,t,i){var r=new t$X,n=new t$X,o=new t$X(e.x,e.y,e.z);r=t$X.cross(o,t,r),n=t$X.cross(o,r,n);var a=new t$X;a=t$X.multiplyByScalar(r,2*e.w,a);var s=new t$X;return s=t$X.multiplyByScalar(r,2,s),i=t$X.add(t,a,i),i=t$X.add(i,s,i)},n$14.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("quaternion",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},n$14.divideByScalar=function(e,t,i){return o$1u.typeOf.object("quaternion",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},n$14.computeAxis=function(e,t){o$1u.typeOf.object("quaternion",e),o$1u.typeOf.object("result",t);var i=e.w;if(Math.abs(i-1)<e$27.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-i*i);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},n$14.computeAngle=function(e){return o$1u.typeOf.object("quaternion",e),Math.abs(e.w-1)<e$27.EPSILON6?0:2*Math.acos(e.w)};var W$11=new n$14;n$14.lerp=function(e,t,i,r){return o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r),W$11=n$14.multiplyByScalar(t,i,W$11),r=n$14.multiplyByScalar(e,1-i,r),n$14.add(W$11,r,r)};var X$W=new n$14,D$17=new n$14,F$1e=new n$14;n$14.slerp=function(e,t,i,r){o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r);var n=n$14.dot(e,t),o=t;if(n<0&&(n=-n,o=X$W=n$14.negate(t,X$W)),1-n<e$27.EPSILON6)return n$14.lerp(e,o,i,r);var a=Math.acos(n);return D$17=n$14.multiplyByScalar(e,Math.sin((1-i)*a),D$17),F$1e=n$14.multiplyByScalar(o,Math.sin(i*a),F$1e),r=n$14.add(D$17,F$1e,r),n$14.multiplyByScalar(r,1/Math.sin(a),r)},n$14.log=function(e,t){o$1u.typeOf.object("quaternion",e),o$1u.typeOf.object("result",t);var i=e$27.acosClamped(e.w),r=0;return 0!==i&&(r=i/Math.sin(i)),t$X.multiplyByScalar(e,r,t)},n$14.exp=function(e,t){o$1u.typeOf.object("cartesian",e),o$1u.typeOf.object("result",t);var i=t$X.magnitude(e),r=0;return 0!==i&&(r=Math.sin(i)/i),t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t.w=Math.cos(i),t};var K$Y=new t$X,$$$=new t$X,N$U=new n$14,l$19=new n$14;n$14.computeInnerQuadrangle=function(e,t,i,r){o$1u.typeOf.object("q0",e),o$1u.typeOf.object("q1",t),o$1u.typeOf.object("q2",i),o$1u.typeOf.object("result",r);var n=n$14.conjugate(t,N$U);n$14.multiply(n,i,l$19);var o=n$14.log(l$19,K$Y);n$14.multiply(n,e,l$19);var a=n$14.log(l$19,$$$);return t$X.add(o,a,o),t$X.multiplyByScalar(o,.25,o),t$X.negate(o,o),n$14.exp(o,N$U),n$14.multiply(t,N$U,r)},n$14.squad=function(e,t,i,r,n,o){o$1u.typeOf.object("q0",e),o$1u.typeOf.object("q1",t),o$1u.typeOf.object("s0",i),o$1u.typeOf.object("s1",r),o$1u.typeOf.number("t",n),o$1u.typeOf.object("result",o);var a=n$14.slerp(e,t,n,N$U),s=n$14.slerp(i,r,n,l$19);return n$14.slerp(a,s,2*n*(1-n),o)};for(var s$U=new n$14,_$10=1.9011074535173003,B$Z=s$V.supportsTypedArrays()?new Float32Array(8):[],L$1g=s$V.supportsTypedArrays()?new Float32Array(8):[],x$1a=s$V.supportsTypedArrays()?new Float32Array(8):[],S$Y=s$V.supportsTypedArrays()?new Float32Array(8):[],Q$14=0;Q$14<7;++Q$14){var P$1a=Q$14+1,V$W=2*P$1a+1;B$Z[Q$14]=1/(P$1a*V$W),L$1g[Q$14]=P$1a/V$W}B$Z[7]=_$10/136,L$1g[7]=8*_$10/17,n$14.fastSlerp=function(e,t,i,r){o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r);var n,o=n$14.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,l=i*i,u=s*s,c=7;c>=0;--c)x$1a[c]=(B$Z[c]*l-L$1g[c])*a,S$Y[c]=(B$Z[c]*u-L$1g[c])*a;var h=n*i*(1+x$1a[0]*(1+x$1a[1]*(1+x$1a[2]*(1+x$1a[3]*(1+x$1a[4]*(1+x$1a[5]*(1+x$1a[6]*(1+x$1a[7])))))))),d=s*(1+S$Y[0]*(1+S$Y[1]*(1+S$Y[2]*(1+S$Y[3]*(1+S$Y[4]*(1+S$Y[5]*(1+S$Y[6]*(1+S$Y[7])))))))),f=n$14.multiplyByScalar(e,d,s$U);return n$14.multiplyByScalar(t,h,r),n$14.add(f,r,r)},n$14.fastSquad=function(e,t,i,r,n,o){o$1u.typeOf.object("q0",e),o$1u.typeOf.object("q1",t),o$1u.typeOf.object("s0",i),o$1u.typeOf.object("s1",r),o$1u.typeOf.number("t",n),o$1u.typeOf.object("result",o);var a=n$14.fastSlerp(e,t,n,N$U),s=n$14.fastSlerp(i,r,n,l$19);return n$14.fastSlerp(a,s,2*n*(1-n),o)},n$14.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},n$14.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},n$14.ZERO=Object.freeze(new n$14(0,0,0,0)),n$14.IDENTITY=Object.freeze(new n$14(0,0,0,1)),n$14.prototype.clone=function(e){return n$14.clone(this,e)},n$14.prototype.equals=function(e){return n$14.equals(this,e)},n$14.prototype.equalsEpsilon=function(e,t){return n$14.equalsEpsilon(this,e,t)},n$14.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var m$1b={},B$Y={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},O$P={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Y$R={},y$11={east:new t$X,north:new t$X,up:new t$X,west:new t$X,south:new t$X,down:new t$X},x$19=new t$X,P$19=new t$X,E$1d=new t$X;m$1b.localFrameToFixedFrameGenerator=function(e,t){if(!B$Y.hasOwnProperty(e)||!B$Y[e].hasOwnProperty(t))throw new t$Z("firstAxis and secondAxis must be east, north, up, west, south or down.");var i,r=B$Y[e][t],n=e+t;return e$28(Y$R[n])?i=Y$R[n]:(i=function(i,n,o){if(!e$28(i))throw new t$Z("origin is required.");if(e$28(o)||(o=new y$15),t$X.equalsEpsilon(i,t$X.ZERO,e$27.EPSILON14))t$X.unpack(O$P[e],0,x$19),t$X.unpack(O$P[t],0,P$19),t$X.unpack(O$P[r],0,E$1d);else if(e$27.equalsEpsilon(i.x,0,e$27.EPSILON14)&&e$27.equalsEpsilon(i.y,0,e$27.EPSILON14)){var a=e$27.sign(i.z);t$X.unpack(O$P[e],0,x$19),"east"!==e&&"west"!==e&&t$X.multiplyByScalar(x$19,a,x$19),t$X.unpack(O$P[t],0,P$19),"east"!==t&&"west"!==t&&t$X.multiplyByScalar(P$19,a,P$19),t$X.unpack(O$P[r],0,E$1d),"east"!==r&&"west"!==r&&t$X.multiplyByScalar(E$1d,a,E$1d)}else{(n=u$Y(n,t$V.WGS84)).geodeticSurfaceNormal(i,y$11.up);var s=y$11.up,l=y$11.east;l.x=-i.y,l.y=i.x,l.z=0,t$X.normalize(l,y$11.east),t$X.cross(s,l,y$11.north),t$X.multiplyByScalar(y$11.up,-1,y$11.down),t$X.multiplyByScalar(y$11.east,-1,y$11.west),t$X.multiplyByScalar(y$11.north,-1,y$11.south),x$19=y$11[e],P$19=y$11[t],E$1d=y$11[r]}return o[0]=x$19.x,o[1]=x$19.y,o[2]=x$19.z,o[3]=0,o[4]=P$19.x,o[5]=P$19.y,o[6]=P$19.z,o[7]=0,o[8]=E$1d.x,o[9]=E$1d.y,o[10]=E$1d.z,o[11]=0,o[12]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o},Y$R[n]=i),i},m$1b.eastNorthUpToFixedFrame=m$1b.localFrameToFixedFrameGenerator("east","north"),m$1b.northEastDownToFixedFrame=m$1b.localFrameToFixedFrameGenerator("north","east"),m$1b.northUpEastToFixedFrame=m$1b.localFrameToFixedFrameGenerator("north","up"),m$1b.northWestUpToFixedFrame=m$1b.localFrameToFixedFrameGenerator("north","west");var fa$3=new n$14,da$4=new t$X(1,1,1),ua$5=new y$15;m$1b.headingPitchRollToFixedFrame=function(e,t,i,r,n){o$1u.typeOf.object("HeadingPitchRoll",t),r=u$Y(r,m$1b.eastNorthUpToFixedFrame);var o=n$14.fromHeadingPitchRoll(t,fa$3),a=y$15.fromTranslationQuaternionRotationScale(t$X.ZERO,o,da$4,ua$5);return n=r(e,i,n),y$15.multiply(n,a,n)};var ya$5=new y$15,la$3=new p$1a;m$1b.headingPitchRollQuaternion=function(e,t,i,r,n){o$1u.typeOf.object("HeadingPitchRoll",t);var o=m$1b.headingPitchRollToFixedFrame(e,t,i,r,ya$5),a=y$15.getMatrix3(o,la$3);return n$14.fromRotationMatrix(a,n)};var Ta$6=new t$X(1,1,1),xa$6=new t$X,aa$4=new y$15,Pa$4=new y$15,Ea$5=new p$1a,Sa$3=new n$14;m$1b.fixedFrameToHeadingPitchRoll=function(e,t,i,r){o$1u.defined("transform",e),t=u$Y(t,t$V.WGS84),i=u$Y(i,m$1b.eastNorthUpToFixedFrame),e$28(r)||(r=new i$10);var n=y$15.getTranslation(e,xa$6);if(t$X.equals(n,t$X.ZERO))return r.heading=0,r.pitch=0,r.roll=0,r;var o=y$15.inverseTransformation(i(n,t,aa$4),aa$4),a=y$15.setScale(e,Ta$6,Pa$4);a=y$15.setTranslation(a,t$X.ZERO,a),o=y$15.multiply(o,a,o);var s=n$14.fromRotationMatrix(y$15.getMatrix3(o,Ea$5),Sa$3);return s=n$14.normalize(s,s),i$10.fromQuaternion(s,r)};var Fa$7=24110.54841,Ca$5=8640184.812866,Ma$5=.093104,Oa$5=-62e-7,Na$5=11772758384668e-32,Ra$6=72921158553e-15,Da$5=e$27.TWO_PI/86400,q$17=new a$12;m$1b.computeTemeToPseudoFixedMatrix=function(e,t){if(!e$28(e))throw new t$Z("date is required.");var i,r=(q$17=a$12.addSeconds(e,-a$12.computeTaiMinusUtc(e),q$17)).dayNumber,n=q$17.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/h$Z.DAYS_PER_JULIAN_CENTURY:(o-.5)/h$Z.DAYS_PER_JULIAN_CENTURY;var a=(Fa$7+i*(Ca$5+i*(Ma$5+i*Oa$5)))*Da$5%e$27.TWO_PI+(Ra$6+Na$5*(r-2451545.5))*((n+.5*h$Z.SECONDS_PER_DAY)%h$Z.SECONDS_PER_DAY),s=Math.cos(a),l=Math.sin(a);return e$28(t)?(t[0]=s,t[1]=-l,t[2]=0,t[3]=l,t[4]=s,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p$1a(s,l,0,-l,s,0,0,0,1)},m$1b.iau2006XysData=new D$18,m$1b.earthOrientationParameters=x$1c.NONE;var H$_=32.184,ga$4=2451545;m$1b.preloadIcrfFixed=function(e){var t=e.start.dayNumber,i=e.start.secondsOfDay+H$_,r=e.stop.dayNumber,n=e.stop.secondsOfDay+H$_,o=m$1b.iau2006XysData.preload(t,i,r,n),a=m$1b.earthOrientationParameters.getPromiseToLoad();return o$1q.all([o,a])},m$1b.computeIcrfToFixedMatrix=function(e,t){if(!e$28(e))throw new t$Z("date is required.");e$28(t)||(t=new p$1a);var i=m$1b.computeFixedToIcrfMatrix(e,t);if(e$28(i))return p$1a.transpose(i,t)};var Ua$6=new a$11(0,0,0),_a$5=new n$16(0,0,0,0,0,0),Q$13=new p$1a,Z$15=new p$1a;m$1b.computeFixedToIcrfMatrix=function(e,t){if(!e$28(e))throw new t$Z("date is required.");e$28(t)||(t=new p$1a);var i=m$1b.earthOrientationParameters.compute(e,_a$5);if(e$28(i)){var r=e.dayNumber,n=e.secondsOfDay+H$_,o=m$1b.iau2006XysData.computeXysRadians(r,n,Ua$6);if(e$28(o)){var a=o.x+i.xPoleOffset,s=o.y+i.yPoleOffset,l=1/(1+Math.sqrt(1-a*a-s*s)),u=Q$13;u[0]=1-l*a*a,u[3]=-l*a*s,u[6]=a,u[1]=-l*a*s,u[4]=1-l*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-l*(a*a+s*s);var c=p$1a.fromRotationZ(-o.s,Z$15),h=p$1a.multiply(u,c,Q$13),d=e.dayNumber-2451545,f=(e.secondsOfDay-a$12.computeTaiMinusUtc(e)+i.ut1MinusUtc)/h$Z.SECONDS_PER_DAY,p=.779057273264+f+.00273781191135448*(d+f);p=p%1*e$27.TWO_PI;var _=p$1a.fromRotationZ(p,Z$15),m=p$1a.multiply(h,_,Q$13),$=Math.cos(i.xPoleWander),g=Math.cos(i.yPoleWander),v=Math.sin(i.xPoleWander),y=Math.sin(i.yPoleWander),x=r-ga$4+n/h$Z.SECONDS_PER_DAY,b=-47e-6*(x/=36525)*e$27.RADIANS_PER_DEGREE/3600,w=Math.cos(b),C=Math.sin(b),T=Z$15;return T[0]=$*w,T[1]=$*C,T[2]=v,T[3]=-g*C+y*v*w,T[4]=g*w+y*v*C,T[5]=-y*$,T[6]=-y*C-g*v*w,T[7]=y*w-g*v*C,T[8]=g*$,p$1a.multiply(m,T,t)}}};var Ia$5=new e$25;m$1b.pointToWindowCoordinates=function(e,t,i,r){return(r=m$1b.pointToGLWindowCoordinates(e,t,i,r)).y=2*t[5]-r.y,r},m$1b.pointToGLWindowCoordinates=function(e,t,i,r){if(!e$28(e))throw new t$Z("modelViewProjectionMatrix is required.");if(!e$28(t))throw new t$Z("viewportTransformation is required.");if(!e$28(i))throw new t$Z("point is required.");e$28(r)||(r=new o$1k);var n=Ia$5;return y$15.multiplyByVector(e,e$25.fromElements(i.x,i.y,i.z,1,n),n),e$25.multiplyByScalar(n,1/n.w,n),y$15.multiplyByVector(t,n,n),o$1k.fromCartesian4(n,r)};var za$4=new t$X,qa$4=new t$X,Wa$5=new t$X;m$1b.rotationMatrixFromPositionVelocity=function(e,t,i,r){if(!e$28(e))throw new t$Z("position is required.");if(!e$28(t))throw new t$Z("velocity is required.");var n=u$Y(i,t$V.WGS84).geodeticSurfaceNormal(e,za$4),o=t$X.cross(t,n,qa$4);t$X.equalsEpsilon(o,t$X.ZERO,e$27.EPSILON6)&&(o=t$X.clone(t$X.UNIT_X,o));var a=t$X.cross(o,t,Wa$5);return t$X.normalize(a,a),t$X.cross(t,a,o),t$X.negate(o,o),t$X.normalize(o,o),e$28(r)||(r=new p$1a),r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=o.x,r[4]=o.y,r[5]=o.z,r[6]=a.x,r[7]=a.y,r[8]=a.z,r};var ra$4=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),oa$3=new t$W,ta$3=new t$X,ba$5=new t$X,Ga$6=new p$1a,k$18=new y$15,ea$4=new y$15;m$1b.basisTo2D=function(e,t,i){if(!e$28(e))throw new t$Z("projection is required.");if(!e$28(t))throw new t$Z("matrix is required.");if(!e$28(i))throw new t$Z("result is required.");var r=y$15.getTranslation(t,ba$5),n=e.ellipsoid,o=n.cartesianToCartographic(r,oa$3),a=e.project(o,ta$3);t$X.fromElements(a.z,a.x,a.y,a);var s=m$1b.eastNorthUpToFixedFrame(r,n,k$18),l=y$15.inverseTransformation(s,ea$4),u=y$15.getMatrix3(t,Ga$6),c=y$15.multiplyByMatrix3(l,u,i);return y$15.multiply(ra$4,c,i),y$15.setTranslation(i,a,i),i},m$1b.wgs84To2DModelMatrix=function(e,t,i){if(!e$28(e))throw new t$Z("projection is required.");if(!e$28(t))throw new t$Z("center is required.");if(!e$28(i))throw new t$Z("result is required.");var r=e.ellipsoid,n=m$1b.eastNorthUpToFixedFrame(t,r,k$18),o=y$15.inverseTransformation(n,ea$4),a=r.cartesianToCartographic(t,oa$3),s=e.project(a,ta$3);t$X.fromElements(s.z,s.x,s.y,s);var l=y$15.fromTranslation(s,k$18);return y$15.multiply(ra$4,o,i),y$15.multiply(l,i,i),i},m$1b.buildUp=function(e,t){var i=t.clone(),r=e.clone();r=t$X.normalize(r,r),Math.abs(t$X.dot(r,i))>=1&&(r=Math.abs(t$X.dot(i,t$X.UNIT_Y))<1?t$X.clone(t$X.UNIT_Y,r):t$X.clone(t$X.UNIT_Z,r));var n=new t$X;return t$X.cross(r,i,n),n=t$X.normalize(n,n),t$X.cross(i,n,r),r=t$X.normalize(r,r)},m$1b.getHeading=function(e,t){var i;return i=e$27.equalsEpsilon(Math.abs(e.z),1,e$27.EPSILON3)?Math.atan2(t.y,t.x)-e$27.PI_OVER_TWO:Math.atan2(e.y,e.x)-e$27.PI_OVER_TWO,e$27.TWO_PI-e$27.zeroToTwoPi(i)},m$1b.convertToColumbusCartesian=function(e){var t=new n$1b,i=t.ellipsoid,r=new t$X,n=new t$W;return i.cartesianToCartographic(e,n),t.project(n,r),t$X.fromElements(r.z,r.x,r.y)},m$1b.convertTo3DCartesian=function(e){var t=new n$1b,i=t.ellipsoid,r=new t$X,n=new t$W;return r=t$X.fromElements(e.y,e.z,e.x),t.unproject(r,n),i.cartographicToCartesian(n,r)};var l$18=new e$25;function f$16(e,t){if(o$1u.defined("origin",e),!e$28(e=(t=u$Y(t,t$V.WGS84)).scaleToGeodeticSurface(e)))throw new t$Z("origin must not be at the center of the ellipsoid.");var i=m$1b.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=t$X.fromCartesian4(y$15.getColumn(i,0,l$18)),this._yAxis=t$X.fromCartesian4(y$15.getColumn(i,1,l$18));var r=t$X.fromCartesian4(y$15.getColumn(i,2,l$18));this._plane=o$1i.fromPointNormal(e,r)}Object.defineProperties(f$16.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var w$T=new e$1Y;f$16.fromPoints=function(e,t){return o$1u.defined("cartesians",e),new f$16(e$1Y.fromPoints(e,w$T).center,t)};var x$18=new f$18,m$1a=new t$X;f$16.prototype.projectPointOntoPlane=function(e,t){o$1u.defined("cartesian",e);var i=x$18;i.origin=e,t$X.normalize(e,i.direction);var r=g$10.rayPlane(i,this._plane,m$1a);if(e$28(r)||(t$X.negate(i.direction,i.direction),r=g$10.rayPlane(i,this._plane,m$1a)),e$28(r)){var n=t$X.subtract(r,this._origin,r),o=t$X.dot(this._xAxis,n),a=t$X.dot(this._yAxis,n);return e$28(t)?(t.x=o,t.y=a,t):new o$1k(o,a)}},f$16.prototype.projectPointsOntoPlane=function(e,t){o$1u.defined("cartesians",e),e$28(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var o=this.projectPointOntoPlane(e[n],t[i]);e$28(o)&&(t[i]=o,i++)}return t.length=i,t},f$16.prototype.projectPointToNearestOnPlane=function(e,t){o$1u.defined("cartesian",e),e$28(t)||(t=new o$1k);var i=x$18;i.origin=e,t$X.clone(this._plane.normal,i.direction);var r=g$10.rayPlane(i,this._plane,m$1a);e$28(r)||(t$X.negate(i.direction,i.direction),r=g$10.rayPlane(i,this._plane,m$1a));var n=t$X.subtract(r,this._origin,r),o=t$X.dot(this._xAxis,n),a=t$X.dot(this._yAxis,n);return t.x=o,t.y=a,t},f$16.prototype.projectPointsToNearestOnPlane=function(e,t){o$1u.defined("cartesians",e),e$28(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;r<i;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var C$$=new t$X;function z$W(e,t,i){i=i||2;var r,n,o,a,s,l,u,c=t&&t.length,h=c?t[0]*i:e.length,d=P$18(e,0,h,i,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=K$X(e,t,d,i)),e.length>80*i){r=o=e[0],n=a=e[1];for(var p=i;p<h;p+=i)(s=e[p])<r&&(r=s),(l=e[p+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-r,a-n))?1/u:0}return g$Y(d,f,i,r,n,u),f}function P$18(e,t,i,r,n){var o,a;if(n===E$1c(e,t,i,r)>0)for(o=t;o<i;o+=r)a=D$16(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=D$16(o,e[o],e[o+1],a);return a&&L$1f(a,a.next)&&(M$17(a),a=a.next),a}function Z$14(e,t){if(!e)return e;t||(t=e);var i,r=e;do{if(i=!1,r.steiner||!L$1f(r,r.next)&&0!==h$X(r.prev,r,r.next))r=r.next;else{if(M$17(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function g$Y(e,t,i,r,n,o,a){if(e){!a&&o&&_$$(e,r,n,o);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?V$V(e,r,n,o):O$O(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),M$17(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?g$Y(e=G$1d(Z$14(e),t,i),t,i,r,n,o,2):2===a&&J$12(e,t,i,r,n,o):g$Y(Z$14(e),t,i,r,n,o,1);break}}}function O$O(e){var t=e.prev,i=e,r=e.next;if(h$X(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(w$S(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&h$X(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function V$V(e,t,i,r){var n=e.prev,o=e,a=e.next;if(h$X(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=T$Z(s,l,t,i,r),d=T$Z(u,c,t,i,r),f=e.prevZ,p=e.nextZ;f&&f.z>=h&&p&&p.z<=d;){if(f!==e.prev&&f!==e.next&&w$S(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&h$X(f.prev,f,f.next)>=0||(f=f.prevZ,p!==e.prev&&p!==e.next&&w$S(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&h$X(p.prev,p,p.next)>=0))return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==e.prev&&f!==e.next&&w$S(n.x,n.y,o.x,o.y,a.x,a.y,f.x,f.y)&&h$X(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&w$S(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&h$X(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function G$1d(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!L$1f(n,o)&&C$_(n,r,r.next,o)&&F$1d(n,o)&&F$1d(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),M$17(r),M$17(r.next),r=e=o),r=r.next}while(r!==e);return Z$14(r)}function J$12(e,t,i,r,n,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Y$Q(a,s)){var l=B$X(a,s);return a=Z$14(a,a.next),l=Z$14(l,l.next),g$Y(a,t,i,r,n,o),void g$Y(l,t,i,r,n,o)}s=s.next}a=a.next}while(a!==e)}function K$X(e,t,i,r){var n,o,a,s=[];for(n=0,o=t.length;n<o;n++)(a=P$18(e,t[n]*r,n<o-1?t[n+1]*r:e.length,r,!1))===a.next&&(a.steiner=!0),s.push(X$V(a));for(s.sort(Q$12),n=0;n<s.length;n++)R$Z(s[n],i),i=Z$14(i,i.next);return i}function Q$12(e,t){return e.x-t.x}function R$Z(e,t){if(t=U$13(e,t)){var i=B$X(t,e);Z$14(i,i.next)}}function U$13(e,t){var i,r=t,n=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===a)return i;var l,u=i,c=i.x,h=i.y,d=1/0;r=i;do{n>=r.x&&r.x>=c&&n!==r.x&&w$S(o<h?n:a,o,c,h,o<h?a:n,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(n-r.x),F$1d(r,e)&&(l<d||l===d&&(r.x>i.x||r.x===i.x&&W$10(i,r)))&&(i=r,d=l)),r=r.next}while(r!==u);return i}function W$10(e,t){return h$X(e.prev,e,t.prev)<0&&h$X(t.next,e,e.next)<0}function _$$(e,t,i,r){var n=e;do{null===n.z&&(n.z=T$Z(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,$$_(n)}function $$_(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function T$Z(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function X$V(e){var t=e,i=e;do{(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),t=t.next}while(t!==e);return i}function w$S(e,t,i,r,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function Y$Q(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!I$1p(e,t)&&(F$1d(e,t)&&F$1d(t,e)&&S$X(e,t)&&(h$X(e.prev,e,t.prev)||h$X(e,t.prev,t))||L$1f(e,t)&&h$X(e.prev,e,e.next)>0&&h$X(t.prev,t,t.next)>0)}function h$X(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function L$1f(e,t){return e.x===t.x&&e.y===t.y}function C$_(e,t,i,r){var n=H$Z(h$X(e,t,i)),o=H$Z(h$X(e,t,r)),a=H$Z(h$X(i,r,e)),s=H$Z(h$X(i,r,t));return!!(n!==o&&a!==s||0===n&&k$17(e,i,t)||0===o&&k$17(e,r,t)||0===a&&k$17(i,e,r)||0===s&&k$17(i,t,r))}function k$17(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function H$Z(e){return e>0?1:e<0?-1:0}function I$1p(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C$_(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function F$1d(e,t){return h$X(e.prev,e,e.next)<0?h$X(e,t,e.next)>=0&&h$X(e,e.prev,t)>=0:h$X(e,t,e.prev)<0||h$X(e,e.next,t)<0}function S$X(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r}function B$X(e,t){var i=new A$1f(e.i,e.x,e.y),r=new A$1f(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function D$16(e,t,i,r){var n=new A$1f(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function M$17(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A$1f(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 E$1c(e,t,i,r){for(var n=0,o=t,a=i-r;o<i;o+=r)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}f$16.prototype.projectPointOntoEllipsoid=function(e,t){o$1u.defined("cartesian",e),e$28(t)||(t=new t$X);var i=this._ellipsoid,r=this._origin,n=this._xAxis,o=this._yAxis,a=C$$;return t$X.multiplyByScalar(n,e.x,a),t=t$X.add(r,a,t),t$X.multiplyByScalar(o,e.y,a),t$X.add(t,a,t),i.scaleToGeocentricSurface(t,t),t},f$16.prototype.projectPointsOntoEllipsoid=function(e,t){o$1u.defined("cartesians",e);var i=e.length;e$28(t)?t.length=i:t=new Array(i);for(var r=0;r<i;++r)t[r]=this.projectPointOntoEllipsoid(e[r],t[r]);return t},z$W.deviation=function(e,t,i,r){var n=t&&t.length,o=n?t[0]*i:e.length,a=Math.abs(E$1c(e,0,o,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;a-=Math.abs(E$1c(e,u,c,i))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*i,f=r[s+1]*i,p=r[s+2]*i;h+=Math.abs((e[d]-e[p])*(e[f+1]-e[d+1])-(e[d]-e[f])*(e[p+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},z$W.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[n][o][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i};var E$1b={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},de$y=Object.freeze(E$1b),r$17={BYTE:de$y.BYTE,UNSIGNED_BYTE:de$y.UNSIGNED_BYTE,SHORT:de$y.SHORT,UNSIGNED_SHORT:de$y.UNSIGNED_SHORT,INT:de$y.INT,UNSIGNED_INT:de$y.UNSIGNED_INT,FLOAT:de$y.FLOAT,DOUBLE:de$y.DOUBLE,getSizeInBytes:function(e){if(!e$28(e))throw new t$Z("value is required.");switch(e){case r$17.BYTE:return Int8Array.BYTES_PER_ELEMENT;case r$17.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r$17.SHORT:return Int16Array.BYTES_PER_ELEMENT;case r$17.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r$17.INT:return Int32Array.BYTES_PER_ELEMENT;case r$17.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case r$17.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case r$17.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new t$Z("componentDatatype is not a valid value.")}},fromTypedArray:function(e){return e instanceof Int8Array?r$17.BYTE:e instanceof Uint8Array?r$17.UNSIGNED_BYTE:e instanceof Int16Array?r$17.SHORT:e instanceof Uint16Array?r$17.UNSIGNED_SHORT:e instanceof Int32Array?r$17.INT:e instanceof Uint32Array?r$17.UNSIGNED_INT:e instanceof Float32Array?r$17.FLOAT:e instanceof Float64Array?r$17.DOUBLE:void 0},validate:function(e){return e$28(e)&&(e===r$17.BYTE||e===r$17.UNSIGNED_BYTE||e===r$17.SHORT||e===r$17.UNSIGNED_SHORT||e===r$17.INT||e===r$17.UNSIGNED_INT||e===r$17.FLOAT||e===r$17.DOUBLE)},createTypedArray:function(e,t){if(!e$28(e))throw new t$Z("componentDatatype is required.");if(!e$28(t))throw new t$Z("valuesOrLength is required.");switch(e){case r$17.BYTE:return new Int8Array(t);case r$17.UNSIGNED_BYTE:return new Uint8Array(t);case r$17.SHORT:return new Int16Array(t);case r$17.UNSIGNED_SHORT:return new Uint16Array(t);case r$17.INT:return new Int32Array(t);case r$17.UNSIGNED_INT:return new Uint32Array(t);case r$17.FLOAT:return new Float32Array(t);case r$17.DOUBLE:return new Float64Array(t);default:throw new t$Z("componentDatatype is not a valid value.")}},createArrayBufferView:function(e,t,i,r){if(!e$28(e))throw new t$Z("componentDatatype is required.");if(!e$28(t))throw new t$Z("buffer is required.");switch(i=u$Y(i,0),r=u$Y(r,(t.byteLength-i)/r$17.getSizeInBytes(e)),e){case r$17.BYTE:return new Int8Array(t,i,r);case r$17.UNSIGNED_BYTE:return new Uint8Array(t,i,r);case r$17.SHORT:return new Int16Array(t,i,r);case r$17.UNSIGNED_SHORT:return new Uint16Array(t,i,r);case r$17.INT:return new Int32Array(t,i,r);case r$17.UNSIGNED_INT:return new Uint32Array(t,i,r);case r$17.FLOAT:return new Float32Array(t,i,r);case r$17.DOUBLE:return new Float64Array(t,i,r);default:throw new t$Z("componentDatatype is not a valid value.")}},fromName:function(e){switch(e){case"BYTE":return r$17.BYTE;case"UNSIGNED_BYTE":return r$17.UNSIGNED_BYTE;case"SHORT":return r$17.SHORT;case"UNSIGNED_SHORT":return r$17.UNSIGNED_SHORT;case"INT":return r$17.INT;case"UNSIGNED_INT":return r$17.UNSIGNED_INT;case"FLOAT":return r$17.FLOAT;case"DOUBLE":return r$17.DOUBLE;default:throw new t$Z("name is not a valid value.")}}},S$W=Object.freeze(r$17);function T$Y(e,t,i){if(0===e)return t*i;var r=e*e,n=r*r,o=n*r,a=o*r,s=a*r,l=s*r,u=i;return t*((1-r/4-3*n/64-5*o/256-175*a/16384-441*s/65536-4851*l/1048576)*u-(3*r/8+3*n/32+45*o/1024+105*a/4096+2205*s/131072+6237*l/524288)*Math.sin(2*u)+(15*n/256+45*o/1024+525*a/16384+1575*s/65536+155925*l/8388608)*Math.sin(4*u)-(35*o/3072+175*a/12288+3675*s/262144+13475*l/1048576)*Math.sin(6*u)+(315*a/131072+2205*s/524288+43659*l/8388608)*Math.sin(8*u)-(693*s/1310720+6237*l/5242880)*Math.sin(10*u)+1001*l/8388608*Math.sin(12*u))}function z$V(e,t,i){var r=e/i;if(0===t)return r;var n=r*r,o=n*r,a=o*r,s=t*t,l=s*s,u=l*s,c=u*s,h=c*s,d=h*s,f=Math.sin(2*r),p=Math.cos(2*r),_=Math.sin(4*r),m=Math.cos(4*r),$=Math.sin(6*r),g=Math.cos(6*r),v=Math.sin(8*r),y=Math.cos(8*r),x=Math.sin(10*r);return r+r*s/4+7*r*l/64+15*r*u/256+579*r*c/16384+1515*r*h/65536+16837*r*d/1048576+(3*r*l/16+45*r*u/256-r*(32*n-561)*c/4096-r*(232*n-1677)*h/16384+r*(399985-90560*n+512*a)*d/5242880)*p+(21*r*u/256+483*r*c/4096-r*(224*n-1969)*h/16384-r*(33152*n-112599)*d/1048576)*m+(151*r*c/4096+4681*r*h/65536+1479*r*d/16384-453*o*d/32768)*g+(1097*r*h/65536+42783*r*d/1048576)*y+8011*r*d/1048576*Math.cos(10*r)+(3*s/8+3*l/16+213*u/2048-3*n*u/64+255*c/4096-33*n*c/512+20861*h/524288-33*n*h/512+a*h/1024+28273*d/1048576-471*n*d/8192+9*a*d/4096)*f+(21*l/256+21*u/256+533*c/8192-21*n*c/512+197*h/4096-315*n*h/4096+584039*d/16777216-12517*n*d/131072+7*a*d/2048)*_+(151*u/6144+151*c/4096+5019*h/131072-453*n*h/16384+26965*d/786432-8607*n*d/131072)*$+(1097*c/131072+1097*h/65536+225797*d/10485760-1097*n*d/65536)*v+(8011*h/2621440+8011*d/1048576)*x+293393*d/251658240*Math.sin(12*r)}function p$13(e,t){if(0===e)return Math.log(Math.tan(.5*(e$27.PI_OVER_TWO+t)));var i=e*Math.sin(t);return Math.log(Math.tan(.5*(e$27.PI_OVER_TWO+t)))-e/2*Math.log((1+i)/(1-i))}function G$1c(e,t,i,r,n){var o=p$13(e._ellipticity,i),a=p$13(e._ellipticity,n);return Math.atan2(e$27.negativePiToPi(r-t),a-o)}function k$16(e,t,i,r,n,o,a){var s=e._heading,l=o-r,u=0;if(e$27.equalsEpsilon(Math.abs(s),e$27.PI_OVER_TWO,e$27.EPSILON8))if(t===i)u=t*Math.cos(n)*e$27.negativePiToPi(l);else{var c=Math.sin(n);u=t*Math.cos(n)*e$27.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*c*c)}else{var h=T$Y(e._ellipticity,t,n);u=(T$Y(e._ellipticity,t,a)-h)/Math.cos(s)}return Math.abs(u)}var A$1e=new t$X,q$16=new t$X;function D$15(e,t,i,r){var n=t$X.normalize(r.cartographicToCartesian(t,q$16),A$1e),o=t$X.normalize(r.cartographicToCartesian(i,q$16),q$16);o$1u.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(t$X.angleBetween(n,o))-Math.PI),.0125);var a=r.maximumRadius,s=r.minimumRadius,l=a*a,u=s*s;e._ellipticitySquared=(l-u)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=t$W.clone(t,e._start),e._start.height=0,e._end=t$W.clone(i,e._end),e._end.height=0,e._heading=G$1c(e,t.longitude,t.latitude,i.longitude,i.latitude),e._distance=k$16(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude)}function W$$(e,t,i,r,n,o){var a,s,l,u=n*n;if(Math.abs(e$27.PI_OVER_TWO-Math.abs(t))>e$27.EPSILON8){s=z$V(T$Y(n,r,e.latitude)+i*Math.cos(t),n,r);var c=p$13(n,e.latitude),h=p$13(n,s);l=Math.tan(t)*(h-c),a=e$27.negativePiToPi(e.longitude+l)}else{var d;if(s=e.latitude,0===n)d=r*Math.cos(e.latitude);else{var f=Math.sin(e.latitude);d=r*Math.cos(e.latitude)/Math.sqrt(1-u*f*f)}l=i/d,a=t>0?e$27.negativePiToPi(e.longitude+l):e$27.negativePiToPi(e.longitude-l)}return e$28(o)?(o.longitude=a,o.latitude=s,o.height=0,o):new t$W(a,s,0)}function P$17(e,t,i){var r=u$Y(i,t$V.WGS84);this._ellipsoid=r,this._start=new t$W,this._end=new t$W,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,e$28(e)&&e$28(t)&&D$15(this,e,t,r)}Object.defineProperties(P$17.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return o$1u.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return o$1u.defined("distance",this._distance),this._heading}}}),P$17.fromStartHeadingDistance=function(e,t,i,r,n){o$1u.defined("start",e),o$1u.defined("heading",t),o$1u.defined("distance",i),o$1u.typeOf.number.greaterThan("distance",i,0);var o=u$Y(r,t$V.WGS84),a=o.maximumRadius,s=o.minimumRadius,l=a*a,u=s*s,c=Math.sqrt((l-u)/l),h=W$$(e,t=e$27.negativePiToPi(t),i,o.maximumRadius,c);return!e$28(n)||e$28(r)&&!r.equals(n.ellipsoid)?new P$17(e,h,o):(n.setEndPoints(e,h),n)},P$17.prototype.setEndPoints=function(e,t){o$1u.defined("start",e),o$1u.defined("end",t),D$15(this,e,t,this._ellipsoid)},P$17.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)},P$17.prototype.interpolateUsingSurfaceDistance=function(e,t){if(o$1u.typeOf.number("distance",e),!e$28(this._distance)||0===this._distance)throw new t$Z("EllipsoidRhumbLine must have distinct start and end set.");return W$$(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)},P$17.prototype.findIntersectionWithLongitude=function(e,t){if(o$1u.typeOf.number("intersectionLongitude",e),!e$28(this._distance)||0===this._distance)throw new t$Z("EllipsoidRhumbLine must have distinct start and end set.");var i=this._ellipticity,r=this._heading,n=Math.abs(r),o=this._start;if(e=e$27.negativePiToPi(e),e$27.equalsEpsilon(Math.abs(e),Math.PI,e$27.EPSILON14)&&(e=e$27.sign(o.longitude)*Math.PI),e$28(t)||(t=new t$W),Math.abs(e$27.PI_OVER_TWO-n)<=e$27.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(e$27.equalsEpsilon(Math.abs(e$27.PI_OVER_TWO-n),e$27.PI_OVER_TWO,e$27.EPSILON8))return e$27.equalsEpsilon(e,o.longitude,e$27.EPSILON12)?void 0:(t.longitude=e,t.latitude=e$27.PI_OVER_TWO*e$27.sign(e$27.PI_OVER_TWO-r),t.height=0,t);var a,s=o.latitude,l=i*Math.sin(s),u=Math.tan(.5*(e$27.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(r)),c=(1+l)/(1-l),h=o.latitude;do{a=h;var d=i*Math.sin(a),f=(1+d)/(1-d);h=2*Math.atan(u*Math.pow(f/c,i/2))-e$27.PI_OVER_TWO}while(!e$27.equalsEpsilon(h,a,e$27.EPSILON12));return t.longitude=e,t.latitude=h,t.height=0,t},P$17.prototype.findIntersectionWithLatitude=function(e,t){if(o$1u.typeOf.number("intersectionLatitude",e),!e$28(this._distance)||0===this._distance)throw new t$Z("EllipsoidRhumbLine must have distinct start and end set.");var i=this._ellipticity,r=this._heading,n=this._start;if(!e$27.equalsEpsilon(Math.abs(r),e$27.PI_OVER_TWO,e$27.EPSILON8)){var o=p$13(i,n.latitude),a=p$13(i,e),s=Math.tan(r)*(a-o),l=e$27.negativePiToPi(n.longitude+s);return e$28(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new t$W(l,e,0)}};var e$1W={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},Me$r=Object.freeze(e$1W);function f$15(e,t,i,r){this[0]=u$Y(e,0),this[1]=u$Y(i,0),this[2]=u$Y(t,0),this[3]=u$Y(r,0)}f$15.packedLength=4,f$15.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},f$15.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new f$15),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},f$15.clone=function(e,t){if(e$28(e))return e$28(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new f$15(e[0],e[2],e[1],e[3])},f$15.fromArray=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new f$15),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},f$15.fromColumnMajorArray=function(e,t){return o$1u.defined("values",e),f$15.clone(e,t)},f$15.fromRowMajorArray=function(e,t){return o$1u.defined("values",e),e$28(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new f$15(e[0],e[1],e[2],e[3])},f$15.fromScale=function(e,t){return o$1u.typeOf.object("scale",e),e$28(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new f$15(e.x,0,0,e.y)},f$15.fromUniformScale=function(e,t){return o$1u.typeOf.number("scale",e),e$28(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new f$15(e,0,0,e)},f$15.fromRotation=function(e,t){o$1u.typeOf.number("angle",e);var i=Math.cos(e),r=Math.sin(e);return e$28(t)?(t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t):new f$15(i,-r,r,i)},f$15.toArray=function(e,t){return o$1u.typeOf.object("matrix",e),e$28(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]]},f$15.getElementIndex=function(e,t){return o$1u.typeOf.number.greaterThanOrEquals("row",t,0),o$1u.typeOf.number.lessThanOrEquals("row",t,1),o$1u.typeOf.number.greaterThanOrEquals("column",e,0),o$1u.typeOf.number.lessThanOrEquals("column",e,1),2*e+t},f$15.getColumn=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,1),o$1u.typeOf.object("result",i);var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},f$15.setColumn=function(e,t,i,r){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,1),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r);var n=2*t;return(r=f$15.clone(e,r))[n]=i.x,r[n+1]=i.y,r},f$15.getRow=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,1),o$1u.typeOf.object("result",i);var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},f$15.setRow=function(e,t,i,r){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number.greaterThanOrEquals("index",t,0),o$1u.typeOf.number.lessThanOrEquals("index",t,1),o$1u.typeOf.object("cartesian",i),o$1u.typeOf.object("result",r),(r=f$15.clone(e,r))[t]=i.x,r[t+2]=i.y,r};var u$T=new o$1k;f$15.getScale=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t.x=o$1k.magnitude(o$1k.fromElements(e[0],e[1],u$T)),t.y=o$1k.magnitude(o$1k.fromElements(e[2],e[3],u$T)),t};var w$R=new o$1k;f$15.getMaximumScale=function(e){return f$15.getScale(e,w$R),o$1k.maximumComponent(w$R)},f$15.multiply=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i);var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},f$15.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),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},f$15.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),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},f$15.multiplyByVector=function(e,t,i){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("cartesian",t),o$1u.typeOf.object("result",i);var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},f$15.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},f$15.multiplyByScale=function(e,t,i){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("scale",t),o$1u.typeOf.object("result",i),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},f$15.negate=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},f$15.transpose=function(e,t){o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t);var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},f$15.abs=function(e,t){return o$1u.typeOf.object("matrix",e),o$1u.typeOf.object("result",t),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},f$15.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},f$15.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]},f$15.equalsEpsilon=function(e,t,i){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(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},f$15.IDENTITY=Object.freeze(new f$15(1,0,0,1)),f$15.ZERO=Object.freeze(new f$15(0,0,0,0)),f$15.COLUMN0ROW0=0,f$15.COLUMN0ROW1=1,f$15.COLUMN1ROW0=2,f$15.COLUMN1ROW1=3,Object.defineProperties(f$15.prototype,{length:{get:function(){return f$15.packedLength}}}),f$15.prototype.clone=function(e){return f$15.clone(this,e)},f$15.prototype.equals=function(e){return f$15.equals(this,e)},f$15.prototype.equalsEpsilon=function(e,t){return f$15.equalsEpsilon(this,e,t)},f$15.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var I$1o={POINTS:de$y.POINTS,LINES:de$y.LINES,LINE_LOOP:de$y.LINE_LOOP,LINE_STRIP:de$y.LINE_STRIP,TRIANGLES:de$y.TRIANGLES,TRIANGLE_STRIP:de$y.TRIANGLE_STRIP,TRIANGLE_FAN:de$y.TRIANGLE_FAN,validate:function(e){return e===I$1o.POINTS||e===I$1o.LINES||e===I$1o.LINE_LOOP||e===I$1o.LINE_STRIP||e===I$1o.TRIANGLES||e===I$1o.TRIANGLE_STRIP||e===I$1o.TRIANGLE_FAN}},W$_=Object.freeze(I$1o);function I$1n(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=u$Y(e.primitiveType,W$_.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=u$Y(e.geometryType,Me$r.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}I$1n.computeNumberOfVertices=function(e){o$1u.typeOf.object("geometry",e);var t=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&e$28(e.attributes[i])&&e$28(e.attributes[i].values)){var r=e.attributes[i];if(r.isInstanceAttribute)continue;var n=r.values.length/r.componentsPerAttribute;if(t!==n&&-1!==t)throw new t$Z("All attribute lists must have the same number of attributes.");t=n}return t};var R$Y=new t$W,W$Z=new t$X,P$16=new y$15,Z$13=[new t$W,new t$W,new t$W],q$15=[new o$1k,new o$1k,new o$1k],z$U=[new o$1k,new o$1k,new o$1k],D$14=new t$X,K$W=new n$14,$$Z=new y$15,rr$f=new f$15;function o$1g(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).componentDatatype))throw new t$Z("options.componentDatatype is required.");if(!e$28(e.componentsPerAttribute))throw new t$Z("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new t$Z("options.componentsPerAttribute must be between 1 and 4.");if(!e$28(e.values))throw new t$Z("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=u$Y(e.normalize,!1),this.values=e.values}I$1n._textureCoordinateRotationPoints=function(e,t,i,r){var n,o=h$10.center(r,R$Y),a=t$W.toCartesian(o,i,W$Z),s=m$1b.eastNorthUpToFixedFrame(a,i,P$16),l=y$15.inverse(s,P$16),u=q$15,c=Z$13;c[0].longitude=r.west,c[0].latitude=r.south,c[1].longitude=r.west,c[1].latitude=r.north,c[2].longitude=r.east,c[2].latitude=r.south;var h=D$14;for(n=0;n<3;n++)t$W.toCartesian(c[n],i,h),h=y$15.multiplyByPointAsVector(l,h,h),u[n].x=h.x,u[n].y=h.y;var d=n$14.fromAxisAngle(t$X.UNIT_Z,-t,K$W),f=p$1a.fromQuaternion(d,$$Z),p=e.length,_=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,g=Number.NEGATIVE_INFINITY;for(n=0;n<p;n++)h=y$15.multiplyByPointAsVector(l,e[n],h),h=p$1a.multiplyByVector(f,h,h),_=Math.min(_,h.x),m=Math.min(m,h.y),$=Math.max($,h.x),g=Math.max(g,h.y);var v=f$15.fromRotation(t,rr$f),y=z$U;y[0].x=_,y[0].y=m,y[1].x=_,y[1].y=g,y[2].x=$,y[2].y=m;var x=u[0],b=u[2].x-x.x,w=u[1].y-x.y;for(n=0;n<3;n++){var C=y[n];f$15.multiplyByVector(v,C,C),C.x=(C.x-x.x)/b,C.y=(C.y-x.y)/w}var T=y[0],S=y[1],E=y[2],A=new Array(6);return o$1k.pack(T,A),o$1k.pack(S,A,2),o$1k.pack(E,A,4),A};var e$1V={CLOCKWISE:de$y.CW,COUNTER_CLOCKWISE:de$y.CCW,NONE:de$y.NONE,validate:function(e){return e===e$1V.CLOCKWISE||e===e$1V.COUNTER_CLOCKWISE}},_0x4a48d8=Object.freeze(e$1V),nr$d=new t$X,ur$9=new t$X,A$1d={computeArea2D:function(e){o$1u.defined("positions",e),o$1u.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},computeWindingOrder2D:function(e){return A$1d.computeArea2D(e)>0?_0x4a48d8.COUNTER_CLOCKWISE:_0x4a48d8.CLOCKWISE},triangulate:function(e,t){return o$1u.defined("positions",e),z$W(o$1k.packArray(e),t,2)}},X$U=new t$X,Y$P=new t$X,Z$12=new t$X,$$Y=new t$X,H$Y=new t$X,rr$e=new t$X,g$X=new t$X;A$1d.computeSubdivision=function(e,t,i,r,n){n=u$Y(n,!1),r=u$Y(r,e$27.RADIANS_PER_DEGREE),o$1u.typeOf.object("ellipsoid",e),o$1u.defined("positions",t),o$1u.defined("indices",i),o$1u.typeOf.number.greaterThanOrEquals("indices.length",i.length,3),o$1u.typeOf.number.equals("indices.length % 3","0",i.length%3,0),o$1u.typeOf.number.greaterThan("granularity",r,0);var o,a=i.slice(0),s=t.length,l=new Array(3*s),u=0;for(o=0;o<s;o++){var c=t[o];l[u++]=c.x,l[u++]=c.y,l[u++]=c.z}for(var h=[],d={},f=e.maximumRadius,p=e$27.chordLength(r,f),_=p*p;a.length>0;){var m,$,g=a.pop(),v=a.pop(),y=a.pop(),x=t$X.fromArray(l,3*y,X$U),b=t$X.fromArray(l,3*v,Y$P),w=t$X.fromArray(l,3*g,Z$12),C=n?x:t$X.multiplyByScalar(t$X.normalize(x,$$Y),f,$$Y),T=n?b:t$X.multiplyByScalar(t$X.normalize(b,H$Y),f,H$Y),S=n?w:t$X.multiplyByScalar(t$X.normalize(w,rr$e),f,rr$e),E=t$X.magnitudeSquared(t$X.subtract(C,T,g$X)),A=t$X.magnitudeSquared(t$X.subtract(T,S,g$X)),P=t$X.magnitudeSquared(t$X.subtract(S,C,g$X)),I=Math.max(E,A,P);I>_?E===I?(e$28(o=d[m=Math.min(y,v)+" "+Math.max(y,v)])||($=t$X.add(x,b,g$X),t$X.multiplyByScalar($,.5,$),l.push($.x,$.y,$.z),o=l.length/3-1,d[m]=o),a.push(y,o,g),a.push(o,v,g)):A===I?(e$28(o=d[m=Math.min(v,g)+" "+Math.max(v,g)])||($=t$X.add(b,w,g$X),t$X.multiplyByScalar($,.5,$),l.push($.x,$.y,$.z),o=l.length/3-1,d[m]=o),a.push(v,o,y),a.push(o,g,y)):P===I&&(e$28(o=d[m=Math.min(g,y)+" "+Math.max(g,y)])||($=t$X.add(w,x,g$X),t$X.multiplyByScalar($,.5,$),l.push($.x,$.y,$.z),o=l.length/3-1,d[m]=o),a.push(g,o,v),a.push(o,y,v)):(h.push(y),h.push(v),h.push(g))}return new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:l})},indices:h,primitiveType:W$_.TRIANGLES})};var or$b=new t$W,hr$7=new t$W,vr$8=new t$W,F$1c=new t$W;function f$14(){return!0}function i$Z(e,t){function i(){throw new t$Z(t)}for(var r in t=u$Y(t,"This object was destroyed, i.e., destroy() was called."),e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=f$14}A$1d.computeRhumbLineSubdivision=function(e,t,i,r){r=u$Y(r,e$27.RADIANS_PER_DEGREE),o$1u.typeOf.object("ellipsoid",e),o$1u.defined("positions",t),o$1u.defined("indices",i),o$1u.typeOf.number.greaterThanOrEquals("indices.length",i.length,3),o$1u.typeOf.number.equals("indices.length % 3","0",i.length%3,0),o$1u.typeOf.number.greaterThan("granularity",r,0);var n,o=i.slice(0),a=t.length,s=new Array(3*a),l=0;for(n=0;n<a;n++){var u=t[n];s[l++]=u.x,s[l++]=u.y,s[l++]=u.z}for(var c=[],h={},d=e.maximumRadius,f=e$27.chordLength(r,d),p=new P$17(void 0,void 0,e),_=new P$17(void 0,void 0,e),m=new P$17(void 0,void 0,e);o.length>0;){var $=o.pop(),g=o.pop(),v=o.pop(),y=t$X.fromArray(s,3*v,X$U),x=t$X.fromArray(s,3*g,Y$P),b=t$X.fromArray(s,3*$,Z$12),w=e.cartesianToCartographic(y,or$b),C=e.cartesianToCartographic(x,hr$7),T=e.cartesianToCartographic(b,vr$8);p.setEndPoints(w,C);var S=p.surfaceDistance;_.setEndPoints(C,T);var E=_.surfaceDistance;m.setEndPoints(T,w);var A,P,I,M,O=m.surfaceDistance,D=Math.max(S,E,O);D>f?S===D?(e$28(n=h[A=Math.min(v,g)+" "+Math.max(v,g)])||(P=p.interpolateUsingFraction(.5,F$1c),I=.5*(w.height+C.height),M=t$X.fromRadians(P.longitude,P.latitude,I,e,g$X),s.push(M.x,M.y,M.z),n=s.length/3-1,h[A]=n),o.push(v,n,$),o.push(n,g,$)):E===D?(e$28(n=h[A=Math.min(g,$)+" "+Math.max(g,$)])||(P=_.interpolateUsingFraction(.5,F$1c),I=.5*(C.height+T.height),M=t$X.fromRadians(P.longitude,P.latitude,I,e,g$X),s.push(M.x,M.y,M.z),n=s.length/3-1,h[A]=n),o.push(g,n,v),o.push(n,$,v)):O===D&&(e$28(n=h[A=Math.min($,v)+" "+Math.max($,v)])||(P=m.interpolateUsingFraction(.5,F$1c),I=.5*(T.height+w.height),M=t$X.fromRadians(P.longitude,P.latitude,I,e,g$X),s.push(M.x,M.y,M.z),n=s.length/3-1,h[A]=n),o.push($,n,g),o.push(n,v,g)):(c.push(v),c.push(g),c.push($))}return new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:s})},indices:c,primitiveType:W$_.TRIANGLES})},A$1d.scaleToGeodeticHeight=function(e,t,i,r){i=u$Y(i,t$V.WGS84);var n=nr$d,o=ur$9;if(t=u$Y(t,0),r=u$Y(r,!0),e$28(e))for(var a=e.length,s=0;s<a;s+=3)t$X.fromArray(e,s,o),r&&(o=i.scaleToGeodeticSurface(o,o)),0!==t&&(n=i.geodeticSurfaceNormal(o,n),t$X.multiplyByScalar(n,t,n),t$X.add(o,n,o)),e[s]=o.x,e[s+1]=o.y,e[s+2]=o.z;return e};var r$16={UNSIGNED_BYTE:de$y.UNSIGNED_BYTE,UNSIGNED_SHORT:de$y.UNSIGNED_SHORT,UNSIGNED_INT:de$y.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case r$16.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r$16.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r$16.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new t$Z("indexDatatype is required and must be a valid IndexDatatype constant.")},fromSizeInBytes:function(e){switch(e){case 2:return r$16.UNSIGNED_SHORT;case 4:return r$16.UNSIGNED_INT;case 1:return r$16.UNSIGNED_BYTE;default:throw new t$Z("Size in bytes cannot be mapped to an IndexDatatype")}},validate:function(e){return e$28(e)&&(e===r$16.UNSIGNED_BYTE||e===r$16.UNSIGNED_SHORT||e===r$16.UNSIGNED_INT)},createTypedArray:function(e,t){if(!e$28(e))throw new t$Z("numberOfVertices is required.");return e>=e$27.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){if(!e$28(e))throw new t$Z("numberOfVertices is required.");if(!e$28(t))throw new t$Z("sourceArray is required.");if(!e$28(i))throw new t$Z("byteOffset is required.");return e>=e$27.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)}},ce$v=Object.freeze(r$16),A$1c={STREAM_DRAW:de$y.STREAM_DRAW,STATIC_DRAW:de$y.STATIC_DRAW,DYNAMIC_DRAW:de$y.DYNAMIC_DRAW,validate:function(e){return e===A$1c.STREAM_DRAW||e===A$1c.STATIC_DRAW||e===A$1c.DYNAMIC_DRAW}};function h$W(e){if(e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context),!e$28(e.typedArray)&&!e$28(e.sizeInBytes))throw new t$Z("Either options.sizeInBytes or options.typedArray is required.");if(e$28(e.typedArray)&&e$28(e.sizeInBytes))throw new t$Z("Cannot pass in both options.sizeInBytes and options.typedArray.");if(e$28(e.typedArray)&&(o$1u.typeOf.object("options.typedArray",e.typedArray),o$1u.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!A$1c.validate(e.usage))throw new t$Z("usage is invalid.");var t=e.context._gl,i=e.bufferTarget,r=e.typedArray,n=e.sizeInBytes,o=e.usage,a=e$28(r);a&&(n=r.byteLength),o$1u.typeOf.number.greaterThan("sizeInBytes",n,0);var s=t.createBuffer();t.bindBuffer(i,s),t.bufferData(i,a?r:n,o),t.bindBuffer(i,null),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=i,this._sizeInBytes=n,this._usage=o,this._buffer=s,this.vertexArrayDestroyable=!0,this.context=e.context,e.context.memorySize+=n}h$W.createVertexBuffer=function(e){return o$1u.defined("options.context",e.context),new h$W({context:e.context,bufferTarget:de$y.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},h$W.createIndexBuffer=function(e){if(o$1u.defined("options.context",e.context),!ce$v.validate(e.indexDatatype))throw new t$Z("Invalid indexDatatype.");if(e.indexDatatype===ce$v.UNSIGNED_INT&&!e.context.elementIndexUint)throw new t$Z("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");var t=e.context,i=e.indexDatatype,r=ce$v.getSizeInBytes(i),n=new h$W({context:t,bufferTarget:de$y.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=n.sizeInBytes/r;return Object.defineProperties(n,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return o}}}),n},Object.defineProperties(h$W.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),h$W.prototype._getBuffer=function(){return this._buffer},h$W.prototype.copyFromArrayView=function(e,t){t=u$Y(t,0),o$1u.defined("arrayView",e),o$1u.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);var i=this._gl,r=this._bufferTarget;i.bindBuffer(r,this._buffer),i.bufferSubData(r,t,e),i.bindBuffer(r,null)},h$W.prototype.copyFromBuffer=function(e,t,i,r){if(!this._webgl2)throw new t$Z("A WebGL 2 context is required.");if(!e$28(e))throw new t$Z("readBuffer must be defined.");if(!e$28(r)||r<=0)throw new t$Z("sizeInBytes must be defined and be greater than zero.");if(!e$28(t)||t<0||t+r>e._sizeInBytes)throw new t$Z("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!e$28(i)||i<0||i+r>this._sizeInBytes)throw new t$Z("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(i>=t&&i<t+r||t>i&&t<i+r))throw new t$Z("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===de$y.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==de$y.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==de$y.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===de$y.ELEMENT_ARRAY_BUFFER)throw new t$Z("Can not copy an index buffer into another buffer type.");var n=de$y.COPY_READ_BUFFER,o=de$y.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(n,e._buffer),a.copyBufferSubData(n,o,t,i,r),a.bindBuffer(o,null),a.bindBuffer(n,null)},h$W.prototype.getBufferData=function(e,t,i,r){if(t=u$Y(t,0),i=u$Y(i,0),!this._webgl2)throw new t$Z("A WebGL 2 context is required.");if(!e$28(e))throw new t$Z("arrayView is required.");var n,o,a=e.byteLength;if(e$28(r)?(n=r,e$28(a)?o=1:(a=e.length,o=e.BYTES_PER_ELEMENT)):e$28(a)?(n=a-i,o=1):(n=(a=e.length)-i,o=e.BYTES_PER_ELEMENT),i<0||i>a)throw new t$Z("destinationOffset must be greater than zero and less than the arrayView length.");if(i+n>a)throw new t$Z("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new t$Z("sourceOffset must be greater than zero and less than the buffers size.");if(t+n*o>this._sizeInBytes)throw new t$Z("sourceOffset + length must be less than the buffers size.");var s=this._gl,l=de$y.COPY_READ_BUFFER;s.bindBuffer(l,this._buffer),s.getBufferSubData(l,t,e,i,r),s.bindBuffer(l,null)},h$W.prototype.isDestroyed=function(){return!1},h$W.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),this.context.memorySize-=this.sizeInBytes,i$Z(this)};var e$1U={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1,_uniformBufferOffsetAlignment:256,_maxUniformBufferBinding:36,_maxArrayTextureLayers:256};function N$T(e,t,i,r){var n=e$28(t.vertexBuffer),o=e$28(t.value),a=t.value?t.value.length:t.componentsPerAttribute;if(!n&&!o)throw new t$Z("attribute must have a vertexBuffer or a value.");if(n&&o)throw new t$Z("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(1!==a&&2!==a&&3!==a&&4!==a)throw new t$Z(o?"attribute.value.length must be in the range [1, 4].":"attribute.componentsPerAttribute must be in the range [1, 4].");if(e$28(t.componentDatatype)&&!S$W.validate(t.componentDatatype))throw new t$Z("attribute must have a valid componentDatatype or not specify it.");if(e$28(t.strideInBytes)&&t.strideInBytes>255)throw new t$Z("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(e$28(t.instanceDivisor)&&t.instanceDivisor>0&&!r.instancedArrays)throw new t$Z("instanced arrays is not supported");if(e$28(t.instanceDivisor)&&t.instanceDivisor<0)throw new t$Z("attribute must have an instanceDivisor greater than or equal to zero");if(e$28(t.instanceDivisor)&&o)throw new t$Z("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(e$28(t.instanceDivisor)&&t.instanceDivisor>0&&0===t.index)throw new t$Z("attribute zero cannot have an instanceDivisor greater than 0");var s={index:u$Y(t.index,i),enabled:u$Y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:u$Y(t.componentDatatype,S$W.FLOAT),normalize:u$Y(t.normalize,!1),offsetInBytes:u$Y(t.offsetInBytes,0),strideInBytes:u$Y(t.strideInBytes,0),instanceDivisor:u$Y(t.instanceDivisor,0)};if(n)s.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(r.glVertexAttribDivisor(t,this.instanceDivisor),r._vertexAttribDivisors[t]=this.instanceDivisor,r._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&r.glVertexAttribDivisor(i,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}s.disableVertexAttribArray=function(e){}}e.push(s)}function O$N(e,t,i){for(var r=0;r<t.length;++r){var n=t[r];n.enabled&&n.vertexAttrib(e)}e$28(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}function m$19(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context),o$1u.defined("options.attributes",e.attributes);var t,i=e.context,r=i._gl,n=e.attributes,o=e.indexBuffer,a=[],s=1,l=!1,u=!1,c=n.length;for(t=0;t<c;++t)N$T(a,n[t],t,i);for(c=a.length,t=0;t<c;++t){var h=a[t];if(e$28(h.vertexBuffer)&&0===h.instanceDivisor){var d=h.strideInBytes||h.componentsPerAttribute*S$W.getSizeInBytes(h.componentDatatype);s=h.vertexBuffer.sizeInBytes/d;break}}for(t=0;t<c;++t)a[t].instanceDivisor>0&&(l=!0),e$28(a[t].value)&&(u=!0);var f,p={};for(t=0;t<c;++t){var _=a[t].index;if(p[_])throw new t$Z("Index "+_+" is used by more than one attribute.");p[_]=!0}i.vertexArrayObject&&(f=i.glCreateVertexArray(),i.glBindVertexArray(f),O$N(r,a,o),i.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=i,this._gl=r,this._vao=f,this._attributes=a,this._indexBuffer=o}function P$15(e){return e.values.length/e.componentsPerAttribute}function M$16(e){return S$W.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function j$19(e){var t,i,r,n=[];for(i in e)e.hasOwnProperty(i)&&e$28(e[i])&&e$28(e[i].values)&&(n.push(i),e[i].componentDatatype===S$W.DOUBLE&&(e[i].componentDatatype=S$W.FLOAT,e[i].values=S$W.createTypedArray(S$W.FLOAT,e[i].values)));var o,a=n.length;if(a>0)for(o=P$15(e[n[0]]),t=1;t<a;++t){var s=P$15(e[n[t]]);if(s!==o)throw new t$U("Each attribute list must have the same number of vertices. Attribute "+n[t]+" has a different number of vertices ("+s.toString()+") than attribute "+n[0]+" ("+o.toString()+").")}n.sort((function(t,i){return S$W.getSizeInBytes(e[i].componentDatatype)-S$W.getSizeInBytes(e[t].componentDatatype)}));var l=0,u={};for(t=0;t<a;++t)i=n[t],r=e[i],u[i]=l,l+=M$16(r);if(l>0){var c=S$W.getSizeInBytes(e[n[0]].componentDatatype),h=l%c;0!==h&&(l+=c-h);var d=new ArrayBuffer(o*l),f={};for(t=0;t<a;++t){i=n[t];var p=S$W.getSizeInBytes(e[i].componentDatatype);f[i]={pointer:S$W.createTypedArray(e[i].componentDatatype,d),index:u[i]/p,strideInComponentType:l/p}}for(t=0;t<o;++t)for(var _=0;_<a;++_){i=n[_];for(var m=(r=e[i]).values,$=f[i],g=$.pointer,v=r.componentsPerAttribute,y=0;y<v;++y)g[$.index+y]=m[t*v+y];$.index+=$.strideInComponentType}return{buffer:d,offsetsInBytes:u,vertexSizeInBytes:l}}}function k$15(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=e$1U.maximumVertexAttributes;if(i){var s=o.length;for(r=0;r<s;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;r<a;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}function G$1b(e,t){for(var i=e._attributes,r=i.length,n=0;n<r;++n){var o=i[n];o.enabled&&e$28(o.value)&&o.vertexAttrib(t)}}function r$15(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._cull=u$Y(e.cull,!0),this._occlude=u$Y(e.occlude,!0),this._modelMatrix=e.modelMatrix,this._primitiveType=u$Y(e.primitiveType,W$_.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=u$Y(e.offset,0),this._instanceCount=u$Y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._executeInClosestFrustum=u$Y(e.executeInClosestFrustum,!1),this._owner=e.owner,this._debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=u$Y(e.castShadows,!1),this._receiveShadows=u$Y(e.receiveShadows,!1),this._selectCastShadows=!1,this._pickId=e.pickId,this._pickOnly=u$Y(e.pickOnly,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={},this._uniformBuffers=[]}function S$V(e,t){var i=/#define OUTPUT_DECLARATION/,r=e.split("\n");if(/#version 300 es/g.test(e))return e;var n,o,a=-1;for(n=0;n<r.length;++n)if(o=r[n],i.test(o)){a=n;break}if(-1===a)throw new t$Z("Could not find a #define OUTPUT_DECLARATION!");var s=[];for(n=0;n<10;n++){var l="gl_FragData\\["+n+"\\]",u="czm_out"+n;new RegExp(l,"g").test(e)&&(L$1e(u,s),g$W(l,u,r),r.splice(a,0,"layout(location = "+n+") out vec4 "+u+";"),a+=1)}var c="czm_fragColor";z$T("gl_FragColor",r)&&(L$1e(c,s),g$W("gl_FragColor",c,r),r.splice(a,0,"layout(location = 0) out vec4 czm_fragColor;"),a+=1);var h=P$14(s,r),d={};for(n=0;n<r.length;n++)for(var f in o=r[n],h)if(h.hasOwnProperty(f)){new RegExp("(layout)[^]+(out)[^]+("+f+")[^]+","g").test(o)&&(d[o]=f)}for(var p in d)if(d.hasOwnProperty(p)){var _,m=d[p],$=r.indexOf(p),g=h[m],v=g.length;for(_=0;_<v;_++)r.splice($,0,g[_]);for($+=v+1,_=v-1;_>=0;_--)r.splice($,0,"#endif //"+g[_])}var y="#version 300 es",x=!1;for(n=0;n<r.length;n++)/#version/.test(r[n])&&(r[n]=y,x=!0);return x||r.splice(0,0,y),R$X("EXT_draw_buffers",r),R$X("EXT_frag_depth",r),g$W("texture2D","texture",r),g$W("texture3D","texture",r),g$W("textureCube","texture",r),g$W("gl_FragDepthEXT","gl_FragDepth",r),t?g$W("varying","in",r):(g$W("attribute","in",r),g$W("varying","out",r)),F$1b(r)}function g$W(e,t,i){for(var r=new RegExp("(^|[^\\w])("+e+")($|[^\\w])","g"),n=i.length,o=0;o<n;++o){var a=i[o];i[o]=a.replace(r,"$1"+t+"$3")}}function m$18(e,t,i){for(var r=i.length,n=0;n<r;++n){var o=i[n];i[n]=o.replace(e,t)}}function z$T(e,t){for(var i=new RegExp("(^|[^\\w])("+e+")($|[^\\w])","g"),r=t.length,n=0;n<r;++n){var o=t[n];if(i.test(o))return!0}return!1}function F$1b(e){for(var t="",i=e.length,r=0;r<i;++r)t+=e[r]+"\n";return t}function L$1e(e,t){-1===t.indexOf(e)&&t.push(e)}function P$14(e,t){for(var i={},r=e.length,n=[],o=0;o<t.length;++o){var a=t[o],s=/(#ifdef|#if)/g.test(a),l=/#else/g.test(a),u=/#endif/g.test(a);if(s)n.push(a);else if(l){var c=n[n.length-1].replace("ifdef","ifndef");/if/g.test(c)&&(c=c.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),n.pop(),n.push(c)}else if(u)n.pop();else if(!/layout/g.test(a))for(var h=0;h<r;++h){var d=e[h];-1!==a.indexOf(d)&&(e$28(i[d])?i[d]=i[d].filter((function(e){return n.indexOf(e)>=0})):i[d]=n.slice())}}return i}function R$X(e,t){m$18(new RegExp("#extension\\s+GL_"+e+"\\s+:\\s+[a-zA-Z0-9]+\\s*$","g"),"",t)}Object.defineProperties(e$1U,{maximumCombinedTextureImageUnits:{get:function(){return e$1U._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return e$1U._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return e$1U._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return e$1U._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return e$1U._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return e$1U._maximumTextureSize}},maximumVaryingVectors:{get:function(){return e$1U._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return e$1U._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return e$1U._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return e$1U._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return e$1U._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return e$1U._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return e$1U._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return e$1U._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return e$1U._maximumViewportWidth}},maximumViewportHeight:{get:function(){return e$1U._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return e$1U._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return e$1U._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return e$1U._maximumColorAttachments}},highpFloatSupported:{get:function(){return e$1U._highpFloatSupported}},highpIntSupported:{get:function(){return e$1U._highpIntSupported}},uniformBufferOffsetAlignment:{get:function(){return e$1U._uniformBufferOffsetAlignment}},maxUniformBufferBinding:{get:function(){return e$1U._maxUniformBufferBinding}},maxArrayTextureLayers:{get:function(){return e$1U._maxArrayTextureLayers}}}),m$19.fromGeometry=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context);var t,i,r,n=e.context,o=u$Y(e.geometry,u$Y.EMPTY_OBJECT),a=u$Y(e.bufferUsage,A$1c.DYNAMIC_DRAW),s=u$Y(e.attributeLocations,u$Y.EMPTY_OBJECT),l=u$Y(e.interleave,!1),u=e.vertexArrayAttributes,c=e$28(u)?u:[],h=o.attributes;if(l){var d=j$19(h);if(e$28(d)){r=h$W.createVertexBuffer({context:n,typedArray:d.buffer,usage:a});var f=d.offsetsInBytes,p=d.vertexSizeInBytes;for(t in h)h.hasOwnProperty(t)&&e$28(h[t])&&(e$28((i=h[t]).values)?c.push({index:s[t],vertexBuffer:r,componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,offsetInBytes:f[t],strideInBytes:p}):c.push({index:s[t],value:i.value,componentDatatype:i.componentDatatype,normalize:i.normalize}))}}else for(t in h)if(h.hasOwnProperty(t)&&e$28(h[t])){var _=(i=h[t]).componentDatatype;_===S$W.DOUBLE&&(_=S$W.FLOAT),r=void 0,e$28(i.values)&&(r=h$W.createVertexBuffer({context:n,typedArray:S$W.createTypedArray(_,i.values),usage:a})),c.push({index:s[t],vertexBuffer:r,value:i.value,componentDatatype:_,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize})}var m,$=o.indices;return e$28($)&&(m=I$1n.computeNumberOfVertices(o)>=e$27.SIXTY_FOUR_KILOBYTES&&n.elementIndexUint?h$W.createIndexBuffer({context:n,typedArray:new Uint32Array($),usage:a,indexDatatype:ce$v.UNSIGNED_INT}):h$W.createIndexBuffer({context:n,typedArray:new Uint16Array($),usage:a,indexDatatype:ce$v.UNSIGNED_SHORT})),new m$19({context:n,attributes:c,indexBuffer:m})},Object.defineProperties(m$19.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),m$19.prototype.getAttribute=function(e){return o$1u.defined("index",e),this._attributes[e]},m$19.prototype._bind=function(){e$28(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&k$15(this),this._hasConstantAttributes&&G$1b(this,this._gl)):O$N(this._gl,this._attributes,this._indexBuffer)},m$19.prototype._unBind=function(){if(e$28(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;i<e.length;++i){var r=e[i];r.enabled&&r.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},m$19.prototype.isDestroyed=function(){return!1},m$19.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var i=e[t].vertexBuffer;e$28(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}var r=this._indexBuffer;return e$28(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy(),e$28(this._vao)&&this._context.glDeleteVertexArray(this._vao),i$Z(this)},Object.defineProperties(r$15.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},occlude:{get:function(){return this._occlude},set:function(e){this._occlude!==e&&(this._occlude=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},selectCastShadows:{get:function(){return this._selectCastShadows},set:function(e){this._selectCastShadows!==e&&(this._selectCastShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return this._pickOnly},set:function(e){this._pickOnly!==e&&(this._pickOnly=e,this.dirty=!0)}}}),r$15.prototype.addUniformBuffer=function(e){e.increaseRef(),this._uniformBuffers.push(e)},r$15.prototype.removeAllUniformBuffer=function(){if(e$28(this._uniformBuffers)){for(var e=0;e<this._uniformBuffers.length;e++)this._uniformBuffers[e].decreaseRef();this._uniformBuffers=[]}},r$15.shallowClone=function(e,t){if(e$28(e))return e$28(t)||(t=new r$15),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._cull=e._cull,t._occlude=e._occlude,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._uniformBuffers=e._uniformBuffers,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._executeInClosestFrustum=e._executeInClosestFrustum,t._owner=e._owner,t._debugShowBoundingVolume=e._debugShowBoundingVolume,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._castShadows=e._castShadows,t._receiveShadows=e._receiveShadows,t._selectCastShadows=e._selectCastShadows,t._pickId=e._pickId,t._pickOnly=e._pickOnly,t._pointCloudEyeDomeLighting=e._pointCloudEyeDomeLighting,t.dirty=!0,t.lastDirtyTime=0,t},r$15.prototype.execute=function(e,t){e.draw(this,t)};var c$16=new t$X;function n$13(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var i$Y={};i$Y[de$y.FLOAT]="float",i$Y[de$y.FLOAT_VEC2]="vec2",i$Y[de$y.FLOAT_VEC3]="vec3",i$Y[de$y.FLOAT_VEC4]="vec4",i$Y[de$y.INT]="int",i$Y[de$y.INT_VEC2]="ivec2",i$Y[de$y.INT_VEC3]="ivec3",i$Y[de$y.INT_VEC4]="ivec4",i$Y[de$y.BOOL]="bool",i$Y[de$y.BOOL_VEC2]="bvec2",i$Y[de$y.BOOL_VEC3]="bvec3",i$Y[de$y.BOOL_VEC4]="bvec4",i$Y[de$y.FLOAT_MAT2]="mat2",i$Y[de$y.FLOAT_MAT3]="mat3",i$Y[de$y.FLOAT_MAT4]="mat4",i$Y[de$y.SAMPLER_2D]="sampler2D",i$Y[de$y.SAMPLER_CUBE]="samplerCube",n$13.prototype.getDeclaration=function(e){var t="uniform "+i$Y[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var s$T={czm_viewport:new n$13({size:1,datatype:de$y.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new n$13({size:1,datatype:de$y.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new n$13({size:1,datatype:de$y.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_cameraPositionWC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e._cameraPosition}}),czm_viewerPositionWC:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return y$15.getTranslation(e.inverseView,c$16)}}),czm_frameNumber:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new n$13({size:1,datatype:de$y.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new n$13({size:1,datatype:de$y.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapSize:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.specularEnvironmentMapsDimensions}}),czm_specularEnvironmentMapsMaximumLOD:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new n$13({size:9,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new n$13({size:1,datatype:de$y.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_resolutionScale:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.imagerySplitPosition}}),czm_globeSplitPosition:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.globeSplitPosition}}),czm_geometricToleranceOverMeter:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new n$13({size:1,datatype:de$y.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.gamma}}),czm_sunColor:new n$13({size:1,datatype:de$y.FLOAT_VEC3,getValue:function(e){return e.sunColor}}),czm_globeDepthTextureDim:new n$13({size:1,datatype:de$y.FLOAT_VEC2,getValue:function(e){return e.globeDepthTextureDim}}),czm_nonSelDepthTexture:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.nonSelDepthTexture}}),czm_maskTexture:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.maskTexture}}),czm_hdrEnvMap:new n$13({size:1,datatype:de$y.SAMPLER_2D,getValue:function(e){return e.hdrEnvMap}}),czm_toneMappingExposure:new n$13({size:1,datatype:de$y.FLOAT,getValue:function(e){return e.toneMappingExposure}})};function T$X(e){}function E$1a(e){return!(e.indexOf("defined",0)>=0||e.indexOf("#if ",0)>=0||e.indexOf("#elif ",0)>=0)}function c$15(e,t,i){var r=e.indexOf("\n",i+t+1),n=i+t+1;return e.substring(n,r)}function g$V(e){this.ifIndex=e$28(e.ifIndex)?e.ifIndex:void 0,this.elseIndex=e$28(e.elseIndex)?e.elseIndex:void 0,this.endIndex=e$28(e.endIndex)?e.endIndex:void 0,this.ifChildTokens=[],this.elseChildTokens=[],this.parentToken=e$28(e.parentToken)?e.parentToken:void 0,this.type=e$28(e.type)?e.type:void 0}function v$N(e,t){this.Key=e,this.String=t,this.StringLength=t.length}T$X.removeUnuseMacroCode=function(e,t,i){if(!E$1a(i))return i;var r=[];return m$17(e,t,y$10(i),i,r),b$1a(i,r)},g$V.prototype.addChildToken=function(e){e$28(this.elseIndex)?this.elseChildTokens.push(e):this.ifChildTokens.push(e)},v$N.isEqual=function(e,t){return e.Key===t.Key};var s$S={TK_IFDEF:new v$N(0,"#ifdef"),TK_IFNEF:new v$N(1,"#ifndef"),TK_ELSE:new v$N(2,"#else"),TK_END:new v$N(3,"#endif")};function K$V(e,t){var i=-1,r=s$S.TK_IFDEF;for(var n in s$S){var o=s$S[n],a=e.indexOf(o.String,t);(-1===i||a>=0&&a<i)&&(i=a,r=o)}return{type:r,findIndex:i}}function y$10(e){for(var t=[],i=0,r=0,n=void 0;-1!==i;){var o=K$V(e,r);if(r=(i=o.findIndex)+o.type.StringLength,-1===i)break;switch(o.type.Key){case s$S.TK_IFDEF.Key:case s$S.TK_IFNEF.Key:var a=new g$V({type:o.type,ifIndex:i});e$28(n)?e$28(n.endIndex)?(e$28(n.parentToken)||t.push(a),n=a):(n.addChildToken(a),a.parentToken=n,n=a):(n=a,t.push(a));break;case s$S.TK_ELSE.Key:if(!e$28(n))continue;n.elseIndex=i;break;case s$S.TK_END.Key:if(!e$28(n))continue;n.endIndex=i,e$28(n.parentToken)&&(n=n.parentToken)}}return t}function S$U(e,t,i){return!(!v$N.isEqual(i,s$S.TK_IFDEF)||!e$28(e[t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]))||!(!v$N.isEqual(i,s$S.TK_IFNEF)||e$28(e[t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")]))}function u$S(e,t,i,r){var n=0,o=c$15(i,e.type.StringLength,e.ifIndex);if(S$U(t,o,e.type)){e$28(e.elseIndex)&&(n=e.elseIndex+s$S.TK_ELSE.StringLength+1,r.push({startIndex:n,endIndex:e.endIndex}));for(var a=0;a<e.ifChildTokens.length;a++)u$S(e.ifChildTokens[a],t,i,r)}else{e$28(e.elseIndex)?r.push({startIndex:e.ifIndex+e.type.StringLength+_$_(i,e.ifIndex,e.type.String)+o.length,endIndex:e.elseIndex}):r.push({startIndex:e.ifIndex,endIndex:e.endIndex+s$S.TK_END.StringLength});for(a=0;a<e.elseChildTokens.length;a++)u$S(e.elseChildTokens[a],t,i,r)}}function _$_(e,t,i){for(var r=i.length,n=t+r;n<e.length;n++){if(" "!==e.charAt(n))break}return n-(t+r)}function D$13(e,t,i){var r=t.defines,n={};if(e$28(r))for(var o=0;o<r.length;++o){n[r[o]]=1}if(e$28(e._sysShaderDefines))for(o=0;o<e._sysShaderDefines.length;++o){n[e._sysShaderDefines[o]]=1}for(var a=0,s=0;-1!==a&&-1!==(a=i.indexOf("#define ",s));){var l=a+8,u=i.indexOf("\n",a);n[i.substring(l,u).trim()]=1,s=u}return n}function m$17(e,t,i,r,n){if(0!==i.length)for(var o=D$13(e,t,r),a=0;a<i.length;a++){u$S(i[a],o,r,n)}}function b$1a(e,t){for(var i=e,r=0;r<t.length;r++){var n=t[r];if(n.endIndex-n.startIndex>1){var o=e.substring(n.startIndex,n.endIndex);i=i.replace(o,"")}}return i=i.replace(/(#ifdef|#ifndef|#else|#endif).*/gm,"")}var czm_degreesPerRadian="const float czm_degreesPerRadian = 57.29577951308232;\n",czm_depthRange="const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n",czm_ellipsoidInverseRadii="const vec3 czm_ellipsoidInverseRadii = vec3(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.314245);\n",czm_ellipsoidRadii="const vec3 czm_ellipsoidRadii = vec3(6378137.0, 6378137.0, 6356752.314245);\n",czm_epsilon1="const float czm_epsilon1 = 0.1;\n",czm_epsilon2="const float czm_epsilon2 = 0.01;\n",czm_epsilon3="const float czm_epsilon3 = 0.001;\n",czm_epsilon4="const float czm_epsilon4 = 0.0001;\n",czm_epsilon5="const float czm_epsilon5 = 0.00001;\n",czm_epsilon6="const float czm_epsilon6 = 0.000001;\n",czm_epsilon7="const float czm_epsilon7 = 0.0000001;\n",czm_infinity="const float czm_infinity = 5906376272000.0;\n",czm_oneOverPi="const float czm_oneOverPi = 0.3183098861837907;\n",czm_oneOverTwoPi="const float czm_oneOverTwoPi = 0.15915494309189535;\n",czm_passCesium3DTile="const float czm_passCesium3DTile = 4.0;\n",czm_passCesium3DTileClassification="const float czm_passCesium3DTileClassification = 5.0;\n",czm_passCesium3DTileClassificationIgnoreShow="const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n",czm_passClassification="const float czm_passClassification = 7.0;\n",czm_passCompute="const float czm_passCompute = 1.0;\n",czm_passEnvironment="const float czm_passEnvironment = 0.0;\n",czm_passGlobe="const float czm_passGlobe = 2.0;\n",czm_passGround="const float czm_passGround = 4.0;\n",czm_passOpaque="const float czm_passOpaque = 12.0;\n",czm_passOverlay="const float czm_passOverlay = 20.0;\n",czm_passTerrainClassification="const float czm_passTerrainClassification = 3.0;\n",czm_passTranslucent="const float czm_passTranslucent = 18.0;\n",czm_pi="const float czm_pi = 3.141592653589793;\n",czm_piOverFour="const float czm_piOverFour = 0.7853981633974483;\n",czm_piOverSix="const float czm_piOverSix = 0.5235987755982988;\n",czm_piOverThree="const float czm_piOverThree = 1.0471975511965976;\n",czm_piOverTwo="const float czm_piOverTwo = 1.5707963267948966;\n",czm_radiansPerDegree="const float czm_radiansPerDegree = 0.017453292519943295;\n",czm_sceneMode2D="const float czm_sceneMode2D = 2.0;\n",czm_sceneMode3D="const float czm_sceneMode3D = 3.0;\n",czm_sceneModeColumbusView="const float czm_sceneModeColumbusView = 1.0;\n",czm_sceneModeMorphing="const float czm_sceneModeMorphing = 0.0;\n",czm_solarRadius="const float czm_solarRadius = 695500000.0;\n",czm_threePiOver2="const float czm_threePiOver2 = 4.71238898038469;\n",czm_twoPi="const float czm_twoPi = 6.283185307179586;\n",czm_webMercatorMaxLatitude="const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n",czm_depthRangeStruct="struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n",czm_ellipsoid="struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n",czm_material="struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n",czm_materialInput="struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\nfloat height;\nfloat slope;\n};\n",czm_ray="struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n",czm_raySegment="struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n",czm_s3mMaterialInput="struct czm_s3mMaterialInput\n{\nvec4 ambientColor;\nvec4 diffuseColor;\nvec4 ambientLightColor;\nvec4 sunLightColor;\nmat4 texMatrix;\nfloat texture0Width;\nfloat texture1Width;\nvec3 sunDirectionEC;\nfloat sunLightON;\n};\n",czm_shadowParameters="struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n",czm_acesTonemapping="vec3 czm_acesTonemapping(vec3 color) {\nfloat g = 0.985;\nfloat a = 0.065;\nfloat b = 0.0001;\nfloat c = 0.433;\nfloat d = 0.238;\ncolor = (color * (color + a) - b) / (color * (g * color + c) + d);\ncolor = clamp(color, 0.0, 1.0);\nreturn color;\n}\n",czm_adjustColor="uniform float uBrightness;\nuniform float uContrast;\nuniform float uHue;\nuniform float uSaturation;\nuniform float uOneOverGamma;\nvec3 czm_adjustColor(vec3 inputColor)\n{\nvec3 outputColor = inputColor;\noutputColor.rgb = mix(vec3(0.0), outputColor.rgb, uBrightness);\noutputColor.rgb = mix(vec3(0.5), outputColor.rgb, uContrast);\noutputColor.rgb = czm_hue(outputColor.rgb, uHue);\noutputColor.rgb = clamp(outputColor.rgb, 0.0, 1.0);\noutputColor.rgb = czm_saturation(outputColor.rgb, uSaturation);\noutputColor.rgb = pow(outputColor.rgb, vec3(uOneOverGamma));\nreturn outputColor;\n}\n",czm_alphaWeight="float czm_alphaWeight(float a)\n{\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n",czm_antialias="vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n",czm_approximateSphericalCoordinates="vec2 czm_approximateSphericalCoordinates(vec3 normal) {\nfloat latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\nfloat longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\nreturn vec2(latitudeApproximation, longitudeApproximation);\n}\n",czm_branchFreeTernary="float czm_branchFreeTernary(bool comparison, float a, float b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\nfloat useA = float(comparison);\nreturn a * useA + b * (1.0 - useA);\n}\n",czm_cascadeColor="vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n",czm_cascadeDistance="uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n",czm_cascadeMatrix="uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n",czm_cascadeWeights="uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n",czm_clip="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform float clip_mode;\nuniform vec4 clip_planes[6];\nuniform vec4 clip_line_color;\nconst float clip_lineWidth = 3.0;\nfloat GetClipDistance(vec3 pos, vec3 planeNormal, float disToOrigin)\n{\nreturn dot(planeNormal, pos) + disToOrigin;\n}\nfloat ClipBehindAllPlane(float fBorderWidth, vec4 clip_vertex)\n{\nfloat distance = 0.0;\nfloat result = -1.0;\n#ifdef CLIPPLANE\ndistance = GetClipDistance(clip_vertex.xyz, clip_planes[0].xyz, clip_planes[0].w);\nif (distance < 0.0)\n{\nreturn 1.0;\n}\nelse if (distance < fBorderWidth)\n{\nresult = 0.0;\n}\n#else\nfor(int i = 0; i < 6; i++)\n{\ndistance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\nif(distance < 0.0)\n{\nreturn 1.0;\n}\nelse if(distance < fBorderWidth)\n{\nresult = 0.0;\n}\n}\n#endif\nreturn result;\n}\nfloat ClipBehindAnyPlane(float fBorderWidth, vec4 clip_vertex)\n{\nfloat result = 1.0;\nfor(int i = 0; i < 6; i++)\n{\nfloat distance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\nif((distance + fBorderWidth) < 0.0)\n{\nreturn -1.0;\n}\nelse if(distance < 0.0)\n{\nresult = 0.0;\n}\n}\nreturn result;\n}\nfloat ClipAnythingButLine(float fBorderWidth, vec4 clip_vertex)\n{\nfloat result = -1.0;\nfor(int i = 0; i < 6; i++)\n{\nfloat distance = GetClipDistance(clip_vertex.xyz, clip_planes[i].xyz, clip_planes[i].w);\nif(distance < 0.0)\n{\nreturn -1.0;\n}\nelse if(distance < fBorderWidth)\n{\nresult = 0.0;\n}\n}\nreturn result;\n}\nvec4 czm_clip(vec4 clip_vertex, float fIsFiltByID)\n{\nif(fIsFiltByID < 0.1)\n{\nreturn vec4(1.0);\n}\nif(clip_mode < 0.5)\n{\nreturn vec4(1.0);\n}\n#ifdef GL_OES_standard_derivatives\nfloat dxc = abs(dFdx(clip_vertex.x));\nfloat dyc = abs(dFdy(clip_vertex.y));\nfloat fBorderWidth = max(dxc, dyc) * clip_lineWidth;\n#else\nfloat fBorderWidth = clip_lineWidth;\n#endif\nfloat clipResult = 1.0;\nif(clip_line_color.a < 0.01)\n{\nfBorderWidth = 0.0;\n}\nif(clip_mode < 1.5)\n{\nclipResult = ClipBehindAnyPlane(fBorderWidth, clip_vertex);\n}\nelse if(clip_mode < 2.5)\n{\nclipResult = ClipBehindAllPlane(fBorderWidth, clip_vertex);\n}\nelse if(clip_mode < 3.5)\n{\nclipResult = ClipAnythingButLine(fBorderWidth, clip_vertex);\n}\nif(clipResult < -0.5)\n{\ndiscard;\n}\nelse if(clipResult < 0.5)\n{\nreturn clip_line_color;\n}\nelse\n{\nreturn vec4(1.0);\n}\n}\n",czm_columbusViewMorph="vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n",czm_computeLightColorInFP="vec4 czm_computeLightColorInFP(czm_s3mMaterialInput material, vec3 positionMC, float hasNormal, vec3 normal)\n{\nvec3 normalEC;\n#ifdef HAS_NORMAL\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\nnormalEC = normalize(normal) * faceDirection;\n#else\nnormalEC = normalize(czm_normal*czm_computeNormal(positionMC));\n#endif\nvec3 positionEC = vec3(czm_modelView * vec4(positionMC,1.0)).xyz;\nreturn czm_directionLight(material, normalEC, -positionEC, positionMC);\n}\n",czm_computeLightColorInstanceInFP="vec4 czm_computeLightColorInstanceInFP(czm_s3mMaterialInput material, vec3 positionRotateMC, vec3 positionMC, float hasNormal, vec3 normal)\n{\nvec3 normalEC;\n#ifdef HAS_NORMAL\nfloat faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\nnormalEC = normalize(normal) * faceDirection;\n#else\nnormalEC = normalize(czm_normal*czm_computeNormal(positionRotateMC));\n#endif\nvec3 positionEC = vec3(czm_modelView * vec4(positionMC,1.0)).xyz;\nreturn czm_directionLight(material, normalEC, -positionEC, positionMC);\n}\n",czm_computeNormal="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nvec3 czm_computeNormal(in vec3 oriVertex)\n{\nvec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z)));\nnormal = normalize(normal);\nreturn normal;\n}\n",czm_computePosition="vec4 czm_computePosition();\n",czm_cosineAndSine="vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n",czm_decompressTextureCoordinates="vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n",czm_depthClampFarPlane="#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\nvec4 czm_depthClampFarPlane(vec4 coords)\n{\n#ifndef LOG_DEPTH\nv_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\ncoords.z = min(coords.z, coords.w);\n#endif\nreturn coords;\n}\n",czm_directionLight="const vec3 SideLightColor = vec3(0.0);\nuniform vec4 uSpecularColor;\nuniform float uShininess;\nconst vec3 specular = vec3(0.066666);\nconst float shininess2 = 30.0;\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\nif ( decayExponent > 0.0 ) {\nreturn pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n}\nreturn 1.0;\n}\n#if POINT_LIGHTS > 0\nuniform vec3 uPointLightPositionEC[POINT_LIGHTS];\nuniform vec3 uPointLightColor[POINT_LIGHTS];\nuniform vec2 uPointLightDistanceAndDecay[POINT_LIGHTS];\n#endif\n#if SPOT_LIGHTS > 0\nuniform vec3 uSpotLightPosition[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightDirection[ SPOT_LIGHTS ];\nuniform float uSpotLightExponent[ SPOT_LIGHTS ];\nuniform vec4 uSpotLightDistanceDecayCosPenumbra[ SPOT_LIGHTS ];\n#endif\n#if DIR_LIGHTS > 0\nuniform vec3 uDirectionalLightDirection[ DIR_LIGHTS ];\nuniform vec3 uDirectionalLightColor[ DIR_LIGHTS];\n#endif\n#if HEMISPHERE_LIGHTS > 0\nuniform vec3 uSkyColor[ HEMISPHERE_LIGHTS ];\nuniform vec3 uGroundColor[ HEMISPHERE_LIGHTS];\n#endif\nvec4 czm_directionLight(czm_s3mMaterialInput material, vec3 normalEC, vec3 positionToEyeEC, vec3 positionMC)\n{\nvec3 totalDiffuseLight = vec3(0.0);\nvec3 totalSpecularLight = vec3(0.0);\nfloat sunLightDiffuseWeight = max( dot( normalEC, material.sunDirectionEC ), 0.0 );\nfloat sideLightDiffuseWeight = max( dot( normalEC, vec3(0.0,0.0,1.0) ), 0.0 );\ntotalDiffuseLight = material.sunLightColor.rgb * sunLightDiffuseWeight * material.sunLightON + sideLightDiffuseWeight * SideLightColor;\nvec3 positionToEyeECDir = normalize(positionToEyeEC);\n#if HEMISPHERE_LIGHTS > 0\nfor ( int i = 0; i < HEMISPHERE_LIGHTS; i ++ )\n{\nvec3 dirVectorEC = normalize(czm_normal * vec3(0.0, 0.0, 1.0));\nfloat dotProduct = dot( normalEC, dirVectorEC );\nvec3 skyColor = uSkyColor[i];\nvec3 groundColor = uGroundColor[i];\nfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\nvec3 irradiance = mix( groundColor, skyColor, hemiDiffuseWeight );\nirradiance *= 3.141592653589793;\ntotalDiffuseLight += irradiance;\n}\n#endif\n#if DIR_LIGHTS > 0\nfor ( int i = 0; i < DIR_LIGHTS; i ++ )\n{\nvec3 dirVectorEC = normalize((czm_view * vec4(uDirectionalLightDirection[ i ], 0.0)).xyz);\nfloat dotProduct = dot( normalEC, dirVectorEC );\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\ntotalDiffuseLight += uDirectionalLightColor[ i ] * dirDiffuseWeight;\n}\n#endif\n#if POINT_LIGHTS > 0\nfor ( int i = 0; i < POINT_LIGHTS; i ++ )\n{\nvec3 lVector = uPointLightPositionEC[i] + positionToEyeEC;\nfloat lengthToLight = length( lVector );\nfloat cutoffDis = uPointLightDistanceAndDecay[i].x;\nif(lengthToLight > cutoffDis)\n{\ncontinue;\n}\nfloat attenuation = calcLightAttenuation( lengthToLight, cutoffDis, uPointLightDistanceAndDecay[i].y);\nlVector = normalize( lVector );\nfloat dotProduct = dot( normalEC, lVector );\nfloat pointLightDiffuse = max( dotProduct, 0.0 );\ntotalDiffuseLight += uPointLightColor[i] * pointLightDiffuse * attenuation;\nvec3 pointHalfVector = normalize( lVector + positionToEyeECDir );\nfloat pointDotNormalHalf = max( dot( normalEC, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = max( pow( pointDotNormalHalf, shininess2 ), 0.0 );\nfloat specularNormalization = ( shininess2 + 2.0 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\ntotalSpecularLight += schlick * uPointLightColor[ i ] * pointSpecularWeight * pointLightDiffuse * attenuation * specularNormalization;\n}\n#endif\n#if SPOT_LIGHTS > 0\nvec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\nfor ( int i = 0; i < SPOT_LIGHTS; i ++ )\n{\nvec3 lVector = uSpotLightPositionEC[i] + positionToEyeEC;\nfloat attenuation = calcLightAttenuation( length( lVector ), uSpotLightDistanceDecayCosPenumbra[i].x, uSpotLightDistanceDecayCosPenumbra[i].y);\nlVector = normalize( lVector );\nfloat spotEffect = dot( uSpotLightDirection[ i ], normalize( uSpotLightPosition[ i ] - positionWC ) );\nif ( spotEffect > uSpotLightDistanceDecayCosPenumbra[i].z ) {\nspotEffect = max( pow( max( spotEffect, 0.0 ), uSpotLightExponent[ i ] ), 0.0 );\nfloat dotProduct = dot( normalEC, lVector );\nfloat spotDiffuseWeight = max( dotProduct, 0.0 );\ntotalDiffuseLight += uSpotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\nvec3 spotHalfVector = normalize( lVector + positionToEyeECDir );\nfloat spotDotNormalHalf = max( dot( normalEC, spotHalfVector ), 0.0 );\nfloat spotSpecularWeight = max( pow( spotDotNormalHalf, shininess2 ), 0.0 );\nfloat specularNormalization = ( shininess2 + 2.0 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\ntotalSpecularLight += schlick * uSpotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n}\n}\n#endif\nvec4 color = vec4(material.diffuseColor.rgb * (totalDiffuseLight + material.ambientColor.rgb * material.ambientLightColor.rgb) + totalSpecularLight, material.diffuseColor.a);\nreturn color;\n}\n",czm_eastNorthUpToEyeCoordinates="mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n",czm_ellipsoidContainsPoint="bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\nvec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n",czm_ellipsoidNew="czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n",czm_ellipsoidWgs84TextureCoordinates="vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n",czm_equalsEpsilon="bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n",czm_executeExcavation="#ifdef EXCAVATION\nuniform sampler2D uExcavationTexture;\nuniform float uExcavationMode;\nuniform vec4 uExcavationRect;\nvarying vec4 vExcavationVertexPos;\nvec2 CalculateExcavationPolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect)\n{\nvec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\nvec2 texCoord = vec2(vertexPos.x - rectPos.x, vertexPos.y - rectPos.y);\ntexCoord.x = texCoord.x / vecRatio.x;\ntexCoord.y = texCoord.y / vecRatio.y;\nptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\ntexCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\nreturn texCoord;\n}\nbool czm_executeExcavation()\n{\nfloat hasExcavation = 1.0;\nvec2 vecExcavationTexCoord = CalculateExcavationPolyTexCoord(vExcavationVertexPos, uExcavationRect, hasExcavation);\nbool excavationInside = (uExcavationMode < 0.5);\nif(hasExcavation < 0.1)\n{\nreturn !excavationInside;\n}\nif(excavationInside)\n{\nreturn texture2D(uExcavationTexture, vecExcavationTexCoord.xy).r > 0.5;\n}\nelse\n{\nreturn texture2D(uExcavationTexture, vecExcavationTexCoord.xy).r < 0.5;\n}\n}\n#endif\n",czm_eyeOffset="vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n",czm_eyeToWindowCoordinates="vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n",czm_fastApproximateAtan="float czm_fastApproximateAtan(float x) {\nreturn x * (-0.1784 * x - 0.0663 * x * x + 1.0301);\n}\nfloat czm_fastApproximateAtan(float x, float y) {\nfloat t = abs(x);\nfloat opposite = abs(y);\nfloat adjacent = max(t, opposite);\nopposite = min(t, opposite);\nt = czm_fastApproximateAtan(opposite / adjacent);\nt = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);\nt = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);\nt = czm_branchFreeTernary(y < 0.0, -t, t);\nreturn t;\n}\n",czm_fog="vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\nreturn mix(color, fogColor, fog);\n}\n",czm_gammaCorrect="vec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\ncolor = pow(color, vec3(czm_gamma));\n#endif\nreturn color;\n}\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\ncolor.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\nreturn color;\n}\n",czm_geodeticSurfaceNormal="vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n",czm_getDefaultMaterial="czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n",czm_getEmissiveTextureColor="uniform float uMaxCategoryOrHypCeil;\nuniform float uMinCategoryOrHypFloor;\nuniform sampler2D uEmissionTexAtlas;\nuniform vec4 uEmissionTexAtlasTilingAndOffset[EMISSION_TEXTURE_COUNT];\nuniform vec4 uEmissionTexAtlasRects[EMISSION_TEXTURE_COUNT];\nuniform float uLayerCornerLength;\nvarying vec2 vLayerTexCoord;\nvarying vec2 vModIndexAndTexIndex;\nvec3 czm_getEmissiveTextureColor(float w)\n{\nvec3 texColor = vec3(0.0);\nvec2 emissionTexCoord;\nint nEmissionTexTexIdx = int(floor(vModIndexAndTexIndex.y + 0.5));\nvec2 atlasTexCoord;\nfor(int i = 0; i < EMISSION_TEXTURE_COUNT; i++){\nif(nEmissionTexTexIdx == i){\nemissionTexCoord.x = mod(length(vLayerTexCoord) * uLayerCornerLength / uEmissionTexAtlasTilingAndOffset[i].x, 1.0);\nemissionTexCoord.y = mod((w - uMinCategoryOrHypFloor) / uEmissionTexAtlasTilingAndOffset[i].y, 1.0) ;\nemissionTexCoord.x += uEmissionTexAtlasTilingAndOffset[i].z;\nemissionTexCoord.y += vModIndexAndTexIndex.x + uEmissionTexAtlasTilingAndOffset[i].w;\nemissionTexCoord.xy = fract(emissionTexCoord.xy);\natlasTexCoord = mix(uEmissionTexAtlasRects[i].xy, uEmissionTexAtlasRects[i].zw, emissionTexCoord);\nbreak;\n}\n}\ntexColor = texture2D(uEmissionTexAtlas, atlasTexCoord).rgb;\nreturn texColor;\n}\nvec3 czm_getEmissiveTextureColor(float w, vec2 texCoord)\n{\nvec3 texColor = vec3(0.0);\nvec2 emissionTexCoord;\nint nEmissionTexTexIdx = int(floor(vModIndexAndTexIndex.y + 0.5));\nvec2 atlasTexCoord;\nfor(int i = 0; i < EMISSION_TEXTURE_COUNT; i++){\nif(nEmissionTexTexIdx == i){\nemissionTexCoord.x = mod(texCoord.x / uEmissionTexAtlasTilingAndOffset[i].x, 1.0);\nemissionTexCoord.y = mod(texCoord.y / uEmissionTexAtlasTilingAndOffset[i].y, 1.0);\nemissionTexCoord.x += uEmissionTexAtlasTilingAndOffset[i].z;\nemissionTexCoord.y += vModIndexAndTexIndex.x + uEmissionTexAtlasTilingAndOffset[i].w;\nemissionTexCoord.xy = fract(emissionTexCoord.xy);\natlasTexCoord = mix(uEmissionTexAtlasRects[i].xy, uEmissionTexAtlasRects[i].zw, emissionTexCoord);\nbreak;\n}\n}\ntexColor = texture2D(uEmissionTexAtlas, atlasTexCoord).rgb;\nreturn texColor;\n}\n",czm_getHorizontalColor="uniform float uHorizontalLine;\nuniform vec4 uHorizontalColor;\nfloat computeContourline(float fValue)\n{\nfloat distanceToContour = uHorizontalLine;\nfloat dxc = abs(dFdx(fValue));\nfloat dyc = abs(dFdy(fValue));\nfloat dF = max(dxc, dyc);\nreturn (abs(distanceToContour-fValue) < dF) ? 1.0 : 0.0;\n}\nvec4 czm_getHorizontalColor(vec4 oriColor, float fValue)\n{\nfloat finalOpacity = computeContourline(fValue);\nreturn mix(oriColor,uHorizontalColor, finalOpacity);\n}\n",czm_getHypsometricColor="uniform sampler2D uHypsometricTexture;\nuniform sampler2D uHypsometricRenderTexture;\nuniform float uHypsometricVisible;\nuniform float uHypOpacity;\nuniform float uHypContourInterval;\nuniform vec4 uHypLineColor;\nuniform float uHypContourFillMode;\nuniform float uHypFloor;\nuniform float uHypCeil;\nuniform float uHypMaxVisibleValue;\nuniform float uHypMinVisibleValue;\nuniform float uHypHasAnalysisRegion;\nvarying vec2 vecHypTexCoord;\nuniform float uMixColorType;\nuniform vec4 uNoValueColor;\n#ifdef Volume\nvarying vec3 vecRotioCoord;\nuniform float uDataFloor;\nuniform float uDataCeil;\nuniform float uVolumeType;\n#endif\n#ifdef Volume2\nuniform float uDataFloor;\nuniform float uDataCeil;\nuniform float uFilterMode;\n#endif\nfloat computeMixCon(float fValue)\n{\nfloat distanceToContour;\nif(abs(uHypMaxVisibleValue - uHypMinVisibleValue) > 0.1)\n{\nif(fValue < 0.5)\n{\ndistanceToContour = mod(fValue - 0.0002, uHypContourInterval);\n}\nelse\n{\nfloat t = floor(fValue / uHypContourInterval);\ndistanceToContour = abs(fValue - (t * uHypContourInterval) - 0.1);\n}\n}\nelse\n{\ndistanceToContour = abs(fValue - uHypMaxVisibleValue);\n}\nfloat dxc = abs(dFdx(fValue));\nfloat dyc = abs(dFdy(fValue));\nfloat dF = max(dxc, dyc);\nreturn (distanceToContour < dF) ? 1.0 : 0.0;\n}\nvec4 computeContourMapColor(float fValue)\n{\nfloat threshold = abs(uHypCeil - uHypFloor);\nfloat contourRate = (fValue - uHypFloor) / threshold;\nfloat finalCoord = clamp(contourRate, 0.0, 1.0);\nfloat count = floor(finalCoord * 16.0);\nfloat y = (count*2.0 + 1.0)/32.0;\nfloat x = fract(finalCoord*16.0);\nif(y > 1.0)\n{\nx = 1.0;\n}\nvec2 contourCoord = vec2(x, y);\nvec4 color = texture2D(uHypsometricTexture, contourCoord);\nvec3 linearColor = pow(color.rgb, vec3(2.2));\nreturn vec4(linearColor, color.a);\n}\n#ifdef Volume2\nvec4 czm_getContourMapColor(vec4 oriColor, vec4 volColor)\n{\nif(uFilterMode > 0.5)\n{\nvec4 finalColor = volColor * oriColor;\nif(uMixColorType > 0.5)\n{\nfinalColor = volColor;\n}\nreturn finalColor;\n}\nvec4 contourMapColor = vec4(0.0);\nfloat finalOpacity = uHypOpacity;\nfloat noValue = volColor.a;\nfloat texTest = clamp(czm_unpackVolume(volColor.zyx),0.0,1.0);\nfloat fValue;\nif(noValue > 0.5)\n{\nfValue = uDataFloor + texTest * (uDataCeil - uDataFloor);\n}\nelse\n{\nfValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n}\nfloat extendHeight = czm_branchFreeTernary(uHypContourFillMode > 2.9, 0.0, czm_branchFreeTernary(uHypContourFillMode > 1.9, 5.0, 0.0));\nif(fValue > uHypMaxVisibleValue + extendHeight || fValue < uHypMinVisibleValue - extendHeight)\n{\nreturn uNoValueColor * oriColor;\n}\n#ifdef GL_OES_standard_derivatives\nif(uHypContourFillMode > 2.9)\n{\nfloat mix_con = computeMixCon(fValue);\ncontourMapColor = mix(computeContourMapColor(fValue), uHypLineColor, mix_con);\n}\nelse if(uHypContourFillMode > 1.9)\n{\nfinalOpacity = computeMixCon(fValue);\ncontourMapColor = uHypLineColor;\n}\nelse if(uHypContourFillMode > 0.9)\n#else\nif(uHypContourFillMode > 0.9)\n#endif\n{\ncontourMapColor = computeContourMapColor(fValue);\n}\nelse\n{\nfinalOpacity = 0.0;\n}\nvec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\nvec4 finalColor = mixColor * oriColor;\n#ifdef PT_CLOUD\nfinalColor = mixColor;\n#endif\nif(uMixColorType > 0.5)\n{\nfinalColor = mixColor;\n}\nreturn finalColor;\n}\n#else\nvec4 czm_getContourMapColor(vec4 oriColor, float fValue)\n{\nvec4 contourMapColor = vec4(0.0);\nfloat finalOpacity = uHypOpacity;\n#ifdef Volume\nvec3 aRatioT = vecRotioCoord;\nif((aRatioT.x < 1.0 && aRatioT.x >0.0) && (aRatioT.y < 1.0 && aRatioT.y >0.0) && (aRatioT.z < 1.0 && aRatioT.z >0.0))\n{\nif(uVolumeType > 0.5)\n{\nvec4 volumeColor = czm_getVolumeValue(aRatioT);\nif(uMixColorType > 0.5)\n{\nvolumeColor = volumeColor * oriColor;\n}\nreturn volumeColor;\n}\nfloat noValue;\nfloat texTest = czm_getVolumeValue(aRatioT, noValue);\nif(noValue > 0.5)\n{\nfValue = uDataFloor + texTest * (uDataCeil - uDataFloor);\n}\nelse\n{\nfValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n}\n}\nelse\n{\nfValue = uHypMaxVisibleValue + abs(uHypMaxVisibleValue * 0.1);\n}\n#endif\nfloat extendHeight = czm_branchFreeTernary(uHypContourFillMode > 2.9, 0.0, czm_branchFreeTernary(uHypContourFillMode > 1.9, 5.0, 0.0));\nif(fValue > uHypMaxVisibleValue + extendHeight || fValue < uHypMinVisibleValue - extendHeight)\n{\nreturn uNoValueColor * oriColor;\n}\n#ifdef GL_OES_standard_derivatives\nif(uHypContourFillMode > 2.9)\n{\nfloat mix_con = computeMixCon(fValue);\ncontourMapColor = mix(computeContourMapColor(fValue), uHypLineColor, mix_con);\n}\nelse if(uHypContourFillMode > 1.9)\n{\nfinalOpacity = computeMixCon(fValue);\ncontourMapColor = uHypLineColor;\n}\nelse if(uHypContourFillMode > 0.9)\n#else\nif(uHypContourFillMode > 0.9)\n#endif\n{\ncontourMapColor = computeContourMapColor(fValue);\n}\nelse\n{\nfinalOpacity = 0.0;\n}\nvec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\nvec4 finalColor = mix(oriColor, contourMapColor, finalOpacity);\n#ifdef PT_CLOUD\nfinalColor = mixColor;\n#endif\n#ifdef Volume\nif(uMixColorType > 0.5)\n{\nfinalColor = mixColor;\n}\n#endif\nreturn finalColor;\n}\n#endif\n#ifdef Volume2\nvec4 czm_getHypsometricColor(vec4 oriColor, vec4 volColor)\n{\nif(uHypHasAnalysisRegion > 0.1)\n{\nvec4 hypColor = texture2D(uHypsometricRenderTexture, vecHypTexCoord);\nif(hypColor.r < 0.1)\n{\nreturn oriColor;\n}\n}\nreturn czm_getContourMapColor(oriColor, volColor);\n}\n#else\nvec4 czm_getHypsometricColor(vec4 oriColor, float wValue)\n{\nfloat fValue = wValue;\nif(uHypHasAnalysisRegion > 0.1)\n{\nvec4 hypColor = texture2D(uHypsometricRenderTexture, vecHypTexCoord);\nif(hypColor.r < 0.1)\n{\nreturn oriColor;\n}\n}\nreturn czm_getContourMapColor(oriColor, fValue);\n}\nvec4 czm_getHypsometricColorByGeoBounds(vec4 oriColor, float wValue, vec4 hypRect, vec2 vTexCoord, vec4 geoBounds)\n{\nif(uHypHasAnalysisRegion > 0.1)\n{\nvec2 polyTexCoord = vTexCoord.xy;\npolyTexCoord.x = polyTexCoord.x * (geoBounds.z - geoBounds.x) + geoBounds.x;\npolyTexCoord.y = polyTexCoord.y * (geoBounds.w - geoBounds.y) + geoBounds.y;\nif(polyTexCoord.x < hypRect.x || polyTexCoord.x>hypRect.z || polyTexCoord.y< hypRect.y || polyTexCoord.y > hypRect.w)\n{\nreturn oriColor;\n}\nvec4 hypColor = texture2D(uHypsometricRenderTexture, polyTexCoord);\nif(hypColor.r < 0.1)\n{\nreturn oriColor;\n}\n}\nreturn czm_getContourMapColor(oriColor, wValue);\n}\n#endif\n",czm_getLambertDiffuse="float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n",czm_getSpecular="float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n",czm_getTexColorForS3M="void CalculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile);\nvec2 dy = dFdy(inTexCoord * vecTile);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid CalculateMipLevel(in vec2 inTexCoord, in vec2 vecTile, in float fMaxMip, inout float mipLevel)\n{\nvec2 dx = dFdx(inTexCoord * vecTile.x);\nvec2 dy = dFdy(inTexCoord * vecTile.y);\nfloat dotX = dot(dx, dx);\nfloat dotY = dot(dy, dy);\nfloat dMax = max(dotX, dotY);\nfloat dMin = min(dotX, dotY);\nfloat offset = (dMax - dMin) / (dMax + dMin);\noffset = clamp(offset, 0.0, 1.0);\nfloat d = dMax * (1.0 - offset) + dMin * offset;\nmipLevel = 0.5 * log2(d);\nmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\nvoid CalculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord)\n{\nif(inTexCoord.z < -9000.0)\n{\noutTexCoord = inTexCoord.xy;\n}\nelse\n{\nvec2 fTexCoord = fract(inTexCoord.xy);\nfloat offset = 1.0 * pow(2.0, mipLevel) / fTile;\nfTexCoord = clamp(fTexCoord, offset, 1.0 - offset);\noutTexCoord.x = (fTexCoord.x + XTran) * scale;\noutTexCoord.y = (fTexCoord.y + YTran) * scale;\n}\n}\nvec4 czm_getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate,float isRGBA, vec4 texUVoffset, out vec2 outTexCoord)\n{\nvec4 color = vec4(1.0);\nif(oriTexCoord.z <= -99900.0){\nreturn color;\n}\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\nCalculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel);\n#endif\nvec2 realTexCoord;\nCalculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord);\nif(isRGBA > 0.5)\n{\nvec2 rgbTexCoord;\nrgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5;\nrgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5;\nrgbTexCoord.xy += texUVoffset.xy;\ncolor = texture2D(curTexture, rgbTexCoord.xy, -10.0);\nvec2 vecAlphaTexCoord;\nvecAlphaTexCoord.x = rgbTexCoord.x;\nvecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5;\nvecAlphaTexCoord.xy += texUVoffset.xy;\ncolor.a = texture2D(curTexture, vecAlphaTexCoord.xy, -10.0).r;\n}\nelse\n{\nrealTexCoord = realTexCoord * texUVoffset.zw + texUVoffset.xy;\nif(oriTexCoord.z < -9000.0)\n{\ncolor = texture2D(curTexture, realTexCoord.xy);\n}\nelse\n{\n#ifdef GL_EXT_shader_texture_lod\ncolor = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel);\n#else\n#ifdef WEBEL2\ncolor = textureLod(curTexture, realTexCoord.xy, mipLevel);\n#else\ncolor = texture2D(curTexture, realTexCoord.xy, mipLevel);\n#endif\n#endif\n}\n#ifdef RGBTOBGR\ncolor = color.bgra;\n#endif\n}\noutTexCoord = realTexCoord;\nreturn color;\n}\nvec4 czm_getTexColorForS3M(sampler2D texture, vec2 uv, vec2 texDim, vec2 texTran, vec2 texScale, float maxMipLevel, out vec2 outTexCoord)\n{\nif(maxMipLevel < 0.0)\n{\nreturn vec4(1.0);\n}\nvec4 colorCeil = vec4(1.0);\nfloat mipLevel = 0.0;\n#ifdef GL_OES_standard_derivatives\nCalculateMipLevel(uv, texDim, maxMipLevel, mipLevel);\n#endif\nfloat ceilMipLevel = ceil(mipLevel);\nvec2 translate = vec2(texTran.x, texTran.y);\nfloat temp;\nif(ceilMipLevel > 0.0)\n{\ntranslate.x = texTran.x + texScale.x;\ntemp = pow(2.0, ceilMipLevel - 1.0);\ntranslate.y = texTran.y + texScale.y * (temp - 1.0) / temp;\n}\nfloat scale = 1.0 / pow(2.0, ceilMipLevel);\nvec2 texcoord = fract(uv);\nfloat offsetX = pow(2.0, ceilMipLevel) / texDim.x;\nfloat offsetY = pow(2.0, ceilMipLevel) / texDim.y;\ntexcoord.x = clamp(texcoord.x, 0.0 + offsetX, 1.0 - offsetX);\ntexcoord.y = clamp(texcoord.y, 0.0 + offsetY, 1.0 - offsetY);\ntexcoord.x = texcoord.x * texScale.x * scale + translate.x;\ntexcoord.y = texcoord.y * texScale.y * scale + translate.y;\n#ifdef GL_EXT_shader_texture_lod\ncolorCeil = texture2DLodEXT(texture, texcoord.xy, 0.0);\n#else\n#ifdef WEBEL2\ncolorCeil = textureLod(texture, texcoord.xy, 0.0);\n#else\ncolorCeil = texture2D(texture, texcoord.xy, -10.0);\n#endif\n#endif\nvec4 colorFloor = vec4(1.0);\nfloat floorMipLevel = floor(mipLevel);\ntranslate = vec2(texTran.x, texTran.y);\nif(floorMipLevel > 0.0)\n{\ntranslate.x = texTran.x + texScale.x;\ntemp = pow(2.0, floorMipLevel - 1.0);\ntranslate.y = texTran.y + texScale.y * (temp - 1.0) / temp;\n}\nscale = 1.0 / pow(2.0, floorMipLevel);\ntexcoord = fract(uv);\noffsetX = pow(2.0, floorMipLevel) / texDim.x;\noffsetY = pow(2.0, floorMipLevel) / texDim.y;\ntexcoord.x = clamp(texcoord.x, 0.0 + offsetX, 1.0 - offsetX);\ntexcoord.y = clamp(texcoord.y, 0.0 + offsetY, 1.0 - offsetY);\ntexcoord.x = texcoord.x * texScale.x * scale + translate.x;\ntexcoord.y = texcoord.y * texScale.y * scale + translate.y;\n#ifdef GL_EXT_shader_texture_lod\ncolorFloor = texture2DLodEXT(texture, texcoord.xy, 0.0);\n#else\n#ifdef WEBEL2\ncolorFloor = textureLod(texture, texcoord.xy, 0.0);\n#else\ncolorFloor = texture2D(texture, texcoord.xy, -10.0);\n#endif\n#endif\nvec4 color = colorCeil * 0.5 + colorFloor * 0.5;\nreturn color;\n}\n",czm_getTextureMatrixFromZValue="const int SHIFT_LEFT8 = 256;\nvoid czm_getTextureMatrixFromZValue(in int nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA)\n{\nif(nZ < 0){\nreturn ;\n}\nint nDel8 = nZ / SHIFT_LEFT8;\nint nDel16 = nDel8 / SHIFT_LEFT8;\nYTran = float(nZ - nDel8 * SHIFT_LEFT8);\nXTran = float(nDel8 - nDel16 * SHIFT_LEFT8);\nint nLevel = nDel16;\nscale = 1.0 / pow(2.0, float(nLevel));\n}\n",czm_getVolumeValue="uniform sampler2D uVolumeTexture;\n#ifdef TIME_ORDER\nuniform sampler2D uNextVolumeTexture;\nuniform float uTimeRatio;\n#endif\n#ifdef Volume\nuniform float width;\nuniform float height;\nuniform float depth;\nuniform float sideBlockCount;\nuniform float blockLength;\nuniform float texLength;\nuniform float uFilterMode;\n#endif\nfloat czm_unpackVolume(vec3 packedDepth)\n{\nreturn dot(packedDepth, vec3(1.0, 1.0 / 255.0, 1.0 / 65025.0));\n}\n#ifdef Volume\nvec2 computeVolumeTextureCoord(vec3 texCoord, float fLevel)\n{\nfloat yOffset = floor((fLevel+0.25/sideBlockCount) / sideBlockCount);\nfloat xOffset = fLevel - yOffset * sideBlockCount;\nfloat texCoordV = (texCoord.y * height + yOffset * blockLength) / texLength;\nfloat texCoordU = (texCoord.x * width + xOffset * blockLength) / texLength;\nreturn vec2(texCoordU, texCoordV);\n}\nfloat computeVolumeValue(sampler2D volumeTexture, vec2 topTexCoord, vec2 bottomTexCoord, float ratio, out float noValue)\n{\nvec4 volumeValue1 = texture2D(volumeTexture, topTexCoord);\nvec4 volumeValue2 = texture2D(volumeTexture, bottomTexCoord);\nfloat fValue1 = clamp(czm_unpackVolume(volumeValue1.xyz),0.0,1.0);\nfloat fValue2 = clamp(czm_unpackVolume(volumeValue2.xyz),0.0,1.0);\nif(uFilterMode >0.5)\n{\nif(ratio<0.5)\n{\nratio = 0.0;\n}\nelse\n{\nratio = 1.0;\n}\n}\nnoValue = mix(volumeValue1.a, volumeValue2.a, ratio);\nif(volumeValue1.a < 0.5)\n{\nfValue1 = fValue2;\n}\nif(volumeValue2.a < 0.5)\n{\nfValue2 = fValue1;\n}\nreturn mix(fValue1, fValue2, ratio);\n}\nfloat czm_getVolumeValue(vec3 texCoord, out float noValue)\n{\nfloat fLevel = (depth - 1.0) * texCoord.z;\nfloat bottomLevel= floor(fLevel);\nfloat topLevel = bottomLevel + 1.0;\nfloat ratio = topLevel - fLevel;\nvec2 topTexCoord = computeVolumeTextureCoord(texCoord, topLevel);\nvec2 bottomTexCoord = computeVolumeTextureCoord(texCoord, bottomLevel);\nfloat fResult = computeVolumeValue(uVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\n#ifdef TIME_ORDER\nfloat fNextResult = computeVolumeValue(uNextVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\nfResult = mix(fResult, fNextResult, uTimeRatio);\n#endif\nreturn fResult;\n}\nvec4 czm_getVolumeValue(vec3 texCoord)\n{\nfloat fLevel = (depth - 1.0) * texCoord.z;\nfloat bottomLevel= floor(fLevel);\nfloat topLevel = bottomLevel + 1.0;\nfloat ratio = topLevel - fLevel;\nfloat yOffset1 = floor((topLevel+0.25/sideBlockCount) / sideBlockCount);\nfloat xOffset1 = topLevel - yOffset1 * sideBlockCount;\nfloat texCoordV1 = (texCoord.y * height + yOffset1 * blockLength)/texLength;\nfloat texCoordU1 = (texCoord.x * width + xOffset1 * blockLength)/texLength;\nvec4 volumeColor1 = texture2D(uVolumeTexture, vec2(texCoordU1,texCoordV1));\nfloat yOffset2 = floor((bottomLevel+0.25/sideBlockCount) / sideBlockCount);\nfloat xOffset2 = bottomLevel - yOffset2 * sideBlockCount;\nfloat texCoordV2 = (texCoord.y * height + yOffset2 * blockLength)/texLength;\nfloat texCoordU2 = (texCoord.x * width + xOffset2 * blockLength)/texLength;\nvec4 volumeColor2 = texture2D(uVolumeTexture, vec2(texCoordU2, texCoordV2));\nif(uFilterMode >0.5)\n{\nif(ratio<0.5)\n{\nratio = 0.0;\n}\nelse\n{\nratio = 1.0;\n}\n}\nvec4 volumeColor = mix(volumeColor1, volumeColor2, ratio);\nreturn volumeColor;\n}\n#endif\n",czm_getVolumeValueMultiResolution="uniform sampler2D uVolumeTexture1;\nuniform sampler2D uVolumeTexture2;\nuniform sampler2D uVolumeTexture3;\nuniform mat4 uMultiResolutionPara1;\nuniform mat4 uMultiResolutionPara2;\nuniform mat4 uMultiResolutionPara3;\n#ifdef TIME_ORDER\nuniform sampler2D uNextVolumeTexture1;\nuniform sampler2D uNextVolumeTexture2;\nuniform sampler2D uNextVolumeTexture3;\n#endif\n#ifdef Volume\nvec2 computeVolumeTextureCoord(vec2 texCoord, float fLevel, float texWidth, float texHeight, float texSideBlockCount, float texBlockLength, float texTotalLength)\n{\nfloat yOffset = floor((fLevel+0.25/texSideBlockCount) / texSideBlockCount);\nfloat xOffset = fLevel - yOffset * texSideBlockCount;\nfloat texCoordV = (texCoord.y * texHeight + yOffset * texBlockLength) / texTotalLength;\nfloat texCoordU = (texCoord.x * texWidth + xOffset * texBlockLength) / texTotalLength;\nreturn vec2(texCoordU, texCoordV);\n}\nfloat czm_getVolumeValueMultiResolution(vec3 texCoord, out float noValue)\n{\nfloat fLevel = (depth - 1.0) * texCoord.z;\nfloat bottomLevel= floor(fLevel);\nfloat topLevel = bottomLevel + 1.0;\nfloat ratio = topLevel - fLevel;\nvec2 topTexCoord = computeVolumeTextureCoord(texCoord, topLevel);\nvec2 bottomTexCoord = computeVolumeTextureCoord(texCoord, bottomLevel);\nfloat fResult = computeVolumeValue(uVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\n#ifdef TIME_ORDER\nfloat fNextResult = computeVolumeValue(uNextVolumeTexture, topTexCoord, bottomTexCoord, ratio, noValue);\nfResult = mix(fResult, fNextResult, uTimeRatio);\n#endif\nfloat width = uMultiResolutionPara1[2].x;\nfloat height = uMultiResolutionPara1[2].y;\nfloat sideBlockCount = uMultiResolutionPara1[2].z;\nfloat blockLength = uMultiResolutionPara1[2].w;\nfloat texLength = uMultiResolutionPara1[3].x;\nvec4 uMultiResolutionTranslation = uMultiResolutionPara1[0];\nvec2 texCoord1 = (texCoord.xy - uMultiResolutionTranslation.xy) * uMultiResolutionTranslation.zw;\nvec2 topTexCoord1 = computeVolumeTextureCoord(texCoord1, topLevel, width, height, sideBlockCount, blockLength, texLength);\nvec2 bottomTexCoord1 = computeVolumeTextureCoord(texCoord1, bottomLevel, width, height, sideBlockCount, blockLength, texLength);\nfloat alpha1 = 5.0 * clamp( max(abs(texCoord1.x - 0.5), abs(texCoord1.y - 0.5)) - 0.3,0.0,0.2);\nfloat fResult1 = computeVolumeValue(uVolumeTexture1, topTexCoord1, bottomTexCoord1, ratio, noValue);\n#ifdef TIME_ORDER\nfloat fNextResult1 = computeVolumeValue(uNextVolumeTexture1, topTexCoord1, bottomTexCoord1, ratio, noValue);\nfResult1 = mix(fResult1, fNextResult1, uTimeRatio);\n#endif\nwidth = uMultiResolutionPara2[2].x;\nheight = uMultiResolutionPara2[2].y;\nsideBlockCount = uMultiResolutionPara2[2].z;\nblockLength = uMultiResolutionPara2[2].w;\ntexLength = uMultiResolutionPara2[3].x;\nuMultiResolutionTranslation = uMultiResolutionPara2[0];\nvec2 texCoord2 = (texCoord.xy - uMultiResolutionTranslation.xy) * uMultiResolutionTranslation.zw;\nvec2 topTexCoord2 = computeVolumeTextureCoord(texCoord2, topLevel, width, height, sideBlockCount, blockLength, texLength);\nvec2 bottomTexCoord2 = computeVolumeTextureCoord(texCoord2, bottomLevel, width, height, sideBlockCount, blockLength, texLength);\nfloat alpha2 = 5.0 * clamp( max(abs(texCoord2.x - 0.5), abs(texCoord2.y - 0.5)) - 0.3,0.0,0.2);\nfloat fResult2 = computeVolumeValue(uVolumeTexture2, topTexCoord2, bottomTexCoord2, ratio, noValue);\n#ifdef TIME_ORDER\nfloat fNextResult2 = computeVolumeValue(uNextVolumeTexture2, topTexCoord2, bottomTexCoord2, ratio, noValue);\nfResult2 = mix(fResult2, fNextResult2, uTimeRatio);\n#endif\nwidth = uMultiResolutionPara3[2].x;\nheight = uMultiResolutionPara3[2].y;\nsideBlockCount = uMultiResolutionPara3[2].z;\nblockLength = uMultiResolutionPara3[2].w;\ntexLength = uMultiResolutionPara3[3].x;\nuMultiResolutionTranslation = uMultiResolutionPara3[0];\nvec2 texCoord3 = (texCoord.xy - uMultiResolutionTranslation.xy) * uMultiResolutionTranslation.zw;\nvec2 topTexCoord3 = computeVolumeTextureCoord(texCoord3, topLevel, width, height, sideBlockCount, blockLength, texLength);\nvec2 bottomTexCoord3 = computeVolumeTextureCoord(texCoord3, bottomLevel, width, height, sideBlockCount, blockLength, texLength);\nfloat alpha3 = 5.0 * clamp( max(abs(texCoord3.x - 0.5), abs(texCoord3.y - 0.5)) - 0.3,0.0,0.2);\nfloat fResult3 = computeVolumeValue(uVolumeTexture3, topTexCoord3, bottomTexCoord3, ratio, noValue);\n#ifdef TIME_ORDER\nfloat fNextResult3 = computeVolumeValue(uNextVolumeTexture3, topTexCoord3, bottomTexCoord3, ratio, noValue);\nfResult3 = mix(fResult3, fNextResult3, uTimeRatio);\n#endif\nreturn mix(fResult3, mix(fResult2, mix(fResult1, fResult, alpha1), alpha2), alpha3);\n}\n#endif\n",czm_getWaterNoise="vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n",czm_getWgs84EllipsoidEC="czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6378137.0);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n",czm_HSBToRGB="const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n",czm_HSLToRGB="vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n",czm_hue="vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n",czm_inverseGamma="vec3 czm_inverseGamma(vec3 color) {\nreturn pow(color, vec3(1.0 / czm_gamma));\n}\n",czm_inverseMatrix="mat3 czm_inverseMatrix(mat3 m)\n{\nfloat Determinant =\nm[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])\n- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])\n+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\nmat3 Inverse;\nInverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);\nInverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);\nInverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);\nInverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]);\nInverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]);\nInverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]);\nInverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\nInverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]);\nInverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]);\nInverse /= Determinant;\nreturn Inverse;\n}\nmat4 czm_inverseMatrix(mat4 m)\n{\nfloat Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\nfloat Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\nfloat Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\nfloat Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\nfloat Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\nfloat Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\nfloat Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\nfloat Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\nfloat Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\nfloat Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\nfloat Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\nfloat Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\nfloat Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\nfloat Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\nfloat Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\nfloat Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\nfloat Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\nfloat Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\nconst vec4 SignA = vec4( 1.0, -1.0, 1.0, -1.0);\nconst vec4 SignB = vec4(-1.0, 1.0, -1.0, 1.0);\nvec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03);\nvec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07);\nvec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11);\nvec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15);\nvec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19);\nvec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23);\nvec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]);\nvec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]);\nvec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]);\nvec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]);\nvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\nvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\nvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\nvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\nmat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3);\nvec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\nfloat Determinant = dot(m[0], Row0);\nInverse /= Determinant;\nreturn Inverse;\n}\n",czm_isEmpty="bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n",czm_isFull="bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n",czm_latitudeToWebMercatorFraction="float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n",czm_lineDistance="float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\nreturn abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n",czm_luminance="float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n",czm_metersPerPixel="float czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight) * pixelRatio;\n}\nfloat czm_metersPerPixel(vec4 positionEC)\n{\nreturn czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n",czm_modelToWindowCoordinates="vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n",czm_multiplyWithColorBalance="vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n",czm_nearFarScalar="float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n",czm_octDecode="vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n",czm_packDepth="vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n",czm_packValue="vec4 czm_packValue(float value)\n{\nfloat SHIFT_LEFT8 = 256.0;\nfloat SHIFT_RIGHT8 = 1.0 / 256.0;\nvec4 result;\nresult.a = 255.0;\nfloat fPos = abs(value + 9000.0) * SHIFT_RIGHT8;\nresult.b = (fPos - floor(fPos)) * SHIFT_LEFT8;\nfPos = floor(fPos) * SHIFT_RIGHT8;\nresult.g = (fPos - floor(fPos)) * SHIFT_LEFT8;\nresult.r = floor(fPos);\nresult /= 255.0;\nreturn result;\n}\n",czm_phong="float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\n",czm_planeDistance="float czm_planeDistance(vec4 plane, vec3 point) {\nreturn (dot(plane.xyz, point) + plane.w);\n}\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\nreturn (dot(planeNormal, point) + planeDistance);\n}\n",czm_pointAlongRay="vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n",czm_rayEllipsoidIntersectionInterval="czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\nvec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n",czm_readDepth="float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\nreturn czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n",czm_readNonPerspective="float czm_readNonPerspective(float value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\nreturn value * oneOverW;\n}\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\nreturn value * oneOverW;\n}\n",czm_reverseLogDepth="float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nfloat log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\nreturn far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\nreturn logZ;\n}\n",czm_RGBToHSB="const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n",czm_RGBToHSL="vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\n}\n",czm_RGBToXYZ="vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n",czm_RollerShutter="void czm_RollerShutter(vec2 coord, vec4 region)\n{\nvec2 f = step(region.xw, coord);\nvec2 s = step(coord, region.zy);\nif (f.x * f.y * s.x * s.y < 1.0)\n{\ndiscard;\n};\n}\n",czm_s3mBatchOperation="void czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation)\n{\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nvertexColor *= selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\nfloat isOffset = fract(floor(right_8)* 0.5);\nif(isOffset > 0.1)\n{\nvertexPos.xyz += translation;\n}\nfloat isClip = fract(floor(right_16) * 0.5);\nif(isClip > 0.1)\n{\nvIsFiltByID.x = 1.0;\n}\n}\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation, inout float fSelected)\n{\noperationType.x += 0.001;\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nfSelected = 1.0;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\nfloat isOffset = fract(floor(right_8)* 0.5);\nif(isOffset > 0.1)\n{\nvertexPos.xyz += translation;\n}\nfloat isClip = fract(floor(right_16) * 0.5);\nif(isClip > 0.1)\n{\nvIsFiltByID.x = 1.0;\n}\n}\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation, inout float fSelected)\n{\noperationType.x += 0.001;\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\ncolor.a *= vertexColor.a;\nvertexColor = color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nfSelected = 1.0;\n#ifdef REPLACE_SELECT_TYPE\nvertexColor = selectedColor;\n#else\nvertexColor *= selectedColor;\n#endif\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\nfloat isOffset = fract(floor(right_8)* 0.5);\nif(isOffset > 0.1)\n{\nvertexPos.xyz += translation;\n}\nfloat isClip = fract(floor(right_16) * 0.5);\nif(isClip > 0.1)\n{\nvIsFiltByID.x = 1.0;\n}\n}\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor)\n{\noperationType.x += 0.001;\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nvertexColor *= color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nvertexColor *= selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\n}\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout float fSelected)\n{\noperationType.x += 0.001;\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nfSelected = 1.0;\nvertexColor = color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nfSelected = 1.0;\nvertexColor = selectedColor;\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\n}\nvoid czm_s3mBatchOperation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor, inout vec4 vertexPos, inout vec4 vIsFiltByID, vec3 translation, inout vec2 fSelected)\n{\noperationType.x += 0.001;\nfloat right_2 = operationType.x * 0.5;\nfloat right_4 = right_2 * 0.5;\nfloat right_8 = right_4 * 0.5;\nfloat right_16 = right_8 * 0.5;\nfloat isSetColor = fract(right_2);\nif(isSetColor > 0.1)\n{\nfSelected.y = 1.0;\ncolor.a *= vertexColor.a;\nvertexColor = color;\n}\nfloat isPicked = fract(floor(right_2)* 0.5);\nif(isPicked > 0.1)\n{\nfSelected.x = 1.0;\n#ifdef REPLACE_SELECT_TYPE\nvertexColor = selectedColor;\n#else\nvertexColor *= selectedColor;\n#endif\n}\nfloat isHide = fract(floor(right_4)* 0.5);\nif(isHide > 0.1)\n{\nvertexColor.a = 0.0;\n}\nfloat isOffset = fract(floor(right_8)* 0.5);\nif(isOffset > 0.1)\n{\nvertexPos.xyz += translation;\n}\nfloat isClip = fract(floor(right_16) * 0.5);\nif(isClip > 0.1)\n{\nvIsFiltByID.x = 1.0;\n}\n}\n",czm_S3MPBR="uniform float u_metallicFactor;\nuniform float u_roughnessFactor;\nuniform vec4 u_emissiveFactor;\nuniform vec4 u_baseColorFactor;\nuniform float u_alphaCutoff;\nuniform sampler2D u_baseColorTexture;\nuniform sampler2D u_metallicRoughnessTexture;\nuniform sampler2D u_normalTexture;\nuniform sampler2D u_occlusionTexture;\nuniform sampler2D u_emissiveTexture;\nuniform vec4 u_baseColorUVOffsetAndTiling;\nuniform vec4 u_emissiveUVOffsetAndTiling;\nuniform float uSunLightON;\n#if DIR_LIGHTS > 0\nuniform vec3 uDirectionalLightDirectionEC[ DIR_LIGHTS ];\nuniform vec3 uDirectionalLightColor[ DIR_LIGHTS ];\n#endif\n#if POINT_LIGHTS > 0\nuniform vec3 uPointLightPositionEC[ POINT_LIGHTS ];\nuniform vec3 uPointLightColor[ POINT_LIGHTS ];\nuniform vec2 uPointLightDistanceAndDecay[ POINT_LIGHTS ];\n#endif\n#if SPOT_LIGHTS > 0\nuniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightDirectionEC[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightDistanceDecayCos[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightExponent[ SPOT_LIGHTS ];\n#endif\nconst float M_PI = 3.141592653589793;\nvec3 lambertianDiffuse(vec3 diffuseColor)\n{\nreturn diffuseColor / M_PI;\n}\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n{\nreturn f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\nvec3 fresnelSchlick(float metalness, float VdotH)\n{\nreturn metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\nvec3 F_Schlick(float ndv, vec3 spec)\n{\nreturn spec + (vec3(1.0) - spec) * pow(1.0 - ndv, 5.0);\n}\nfloat D_Phong(float g, float ndh)\n{\nfloat a = pow(8192.0, g);\nreturn (a + 2.0) / 8.0 * pow(ndh, a);\n}\nfloat smithVisibilityG1(float NdotV, float roughness)\n{\nfloat k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n{\nreturn smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\nfloat GGX(float roughness, float NdotH)\n{\nfloat roughnessSquared = roughness * roughness;\nfloat f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\nreturn roughnessSquared / (M_PI * f * f);\n}\nvoid getLightColor(vec3 lightDir, vec3 viewDir, vec3 normal, vec3 lightColor, vec3 fresnelTerm, float roughness, out vec3 diffuseTerm, out vec3 specularTerm)\n{\nvec3 h = normalize(viewDir + lightDir);\nfloat NdotL = clamp(dot(normal, lightDir), 0.001, 1.0);\nfloat NdotH = clamp(dot(normal, h), 0.0, 1.0);\nvec3 li = lightColor * NdotL;\ndiffuseTerm = li;\nspecularTerm = li * fresnelTerm * D_Phong(1.0 - roughness, NdotH);\n}\nvec3 SRGBtoLINEAR3(vec3 srgbIn)\n{\nreturn pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\nreturn vec4(linearOut, srgbIn.a);\n}\nvec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR\nreturn pow(linearIn, vec3(1.0/2.2));\n#else\nreturn linearIn;\n#endif\n}\nfloat calcLightAttenuation(float lightDistance, float cutoffDistance, float decayExponent)\n{\nreturn pow(clamp(1.0 - lightDistance / cutoffDistance, 0.0, 1.0), decayExponent);\n}\nvec4 czm_S3MPBR(vec3 normalEC, vec3 positionEC, vec2 texCoord, vec4 vertexColor)\n{\nvec3 ng = normalize(normalEC);\nvec3 positionWC = (czm_inverseView * vec4(positionEC, 1.0)).xyz;\n#ifdef HAS_NORMAL_TEXTURE\nvec3 pos_dx = dFdx(positionEC);\nvec3 pos_dy = dFdy(positionEC);\nvec3 tex_dx = dFdx(vec3(texCoord, 0.0));\nvec3 tex_dy = dFdy(vec3(texCoord, 0.0));\nvec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\nt = normalize(t - ng * dot(ng, t));\nvec3 b = normalize(cross(ng, t));\nmat3 tbn = mat3(t, b, ng);\nvec3 n = texture2D(u_normalTexture, texCoord).rgb;\nn = normalize(tbn * (2.0 * n - 1.0));\n#else\nvec3 n = ng;\n#endif\nvec3 v = -normalize(positionEC);\n#ifdef DOUBLE_SIDED\nif (dot(n, v) < 0.0) {\nn = -n;\n}\n#endif\n#ifdef HAS_BASECOLOR_TEXTURE\nvec2 baseColorTexCoord = texCoord;\nbaseColorTexCoord = baseColorTexCoord * u_baseColorUVOffsetAndTiling.zw + u_baseColorUVOffsetAndTiling.xy;\nvec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, baseColorTexCoord));\nbaseColorWithAlpha *= u_baseColorFactor;\n#else\nvec4 baseColorWithAlpha = u_baseColorFactor;\n#endif\nbaseColorWithAlpha *= vertexColor;\nvec3 baseColor = baseColorWithAlpha.rgb;\n#ifdef HAS_METALLICROUGHNESS_TEXTURE\nvec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, texCoord).rgb;\nfloat metalness = clamp(metallicRoughness.b, 0.0, 1.0);\nfloat roughness = clamp(metallicRoughness.g, 0.04, 1.0);\nmetalness *= u_metallicFactor;\nroughness *= u_roughnessFactor;\n#else\nfloat metalness = clamp(u_metallicFactor, 0.0, 1.0);\nfloat roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n#endif\nvec3 f0 = vec3(0.04);\nvec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\nvec3 specularColor = mix(f0, baseColor, metalness);\nfloat NdotV = abs(dot(n, v)) + 0.001;\nvec3 diffuseTerm = vec3(0.0);\nvec3 specularTerm = vec3(0.0);\nvec3 fresnelTerm = F_Schlick(NdotV, specularColor);\nvec3 color = vec3(0.0);\nvec3 lightDiffuseTerm = vec3(0.0);\nvec3 lightSpecularTerm = vec3(0.0);\ngetLightColor(czm_sunDirectionEC, v, n, vec3(0.8), fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\ndiffuseTerm +=lightDiffuseTerm * uSunLightON;\nspecularTerm += lightSpecularTerm * uSunLightON;\n#if DIR_LIGHTS > 0\nfor (int i = 0; i < DIR_LIGHTS; i++) {\ngetLightColor(uDirectionalLightDirectionEC[i], v, n, uDirectionalLightColor[i], fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\ndiffuseTerm +=lightDiffuseTerm;\nspecularTerm += lightSpecularTerm;\n}\n#endif\n#if POINT_LIGHTS > 0\nfor (int i = 0; i < POINT_LIGHTS; i++) {\nvec3 lVector = uPointLightPositionEC[i] - v_positionEC;\nfloat lightDistance = length(lVector);\nfloat lightAttenuation = calcLightAttenuation(lightDistance, uPointLightDistanceAndDecay[i].x, uPointLightDistanceAndDecay[i].y);\nif(lightAttenuation < 0.001) {\ncontinue;\n}\nvec3 pointLightColor = uPointLightColor[i] * lightAttenuation;\nvec3 lightDiffuseTerm = vec3(0.0);\nvec3 lightSpecularTerm = vec3(0.0);\ngetLightColor(normalize(lVector), v, n, pointLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\ndiffuseTerm +=lightDiffuseTerm;\nspecularTerm += lightSpecularTerm;\n}\n#endif\n#if SPOT_LIGHTS > 0\nfor (int i = 0; i < SPOT_LIGHTS; i++) {\nvec3 lVector = uSpotLightPositionEC[i] - v_positionEC;\nfloat lightDistance = length(lVector);\nfloat lightAttenuation = calcLightAttenuation(lightDistance, uSpotLightDistanceDecayCos[i].x, uSpotLightDistanceDecayCos[i].y);\nif(lightAttenuation < 0.001) {\ncontinue;\n}\nfloat spotEffect = dot(uSpotLightDirectionEC[i], normalize(lVector));\nif(spotEffect > uSpotLightDistanceDecayCos[i].z) {\nvec3 spotLightColor = uSpotLightColor[i] * lightAttenuation * spotEffect;\nvec3 lightDiffuseTerm = vec3(0.0);\nvec3 lightSpecularTerm = vec3(0.0);\ngetLightColor(normalize(lVector), v, n, spotLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\ndiffuseTerm +=lightDiffuseTerm;\nspecularTerm += lightSpecularTerm;\n}\n}\n#endif\ncolor = baseColor;\ncolor *= max(diffuseTerm, vec3(0.0));\ncolor += max(specularTerm, vec3(0.0));\n#ifdef USE_IBL_LIGHTING\nvec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\nfloat vertexRadius = length(positionWC);\nfloat horizonDotNadir = 1.0 - min(1.0, 6378137.0 / vertexRadius);\nfloat reflectionDotNadir = dot(r, normalize(positionWC));\nr.x = -r.x;\nr = -normalize(czm_temeToPseudoFixed * r);\nr.x = -r.x;\nfloat inverseRoughness = 1.04 - roughness;\ninverseRoughness *= inverseRoughness;\nvec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\nfloat atmosphereHeight = 0.05;\nfloat blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\nfloat blendRegionOffset = roughness * -1.0;\nfloat farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\nfloat aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\nfloat farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\nfloat smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\nvec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\nvec3 nadirColor = belowHorizonColor * 0.5;\nvec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\nvec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\nvec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\nvec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\nfloat diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\nfloat diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\nvec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\nfloat notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\nvec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\nspecularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\nspecularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\nvec2 iblFactor = vec2(1.0);\nfloat luminanceAtZenith = 0.5;\n#ifdef USE_SUN_LUMINANCE\nfloat LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * czm_sunDirectionEC), normalize(positionWC * -1.0)), 0.001, 1.0);\nfloat S = acos(LdotZenith);\nfloat NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\nfloat sunNdotL = clamp(dot(n, czm_sunDirectionEC), 0.001, 1.0);\nfloat gamma = acos(sunNdotL);\nfloat numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(sunNdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\nfloat denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\nfloat luminance = luminanceAtZenith * (numerator / denominator);\n#endif\nvec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\nvec3 IBLColor = (diffuseIrradiance * diffuseColor * iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * iblFactor.y);\n#ifdef USE_SUN_LUMINANCE\ncolor += IBLColor * luminance;\n#else\ncolor += IBLColor;\n#endif // end of USE_SUN_LUMINANCE\n#endif // end of USE_IBL_LIGHTING\n#ifdef HAS_OCCLUSION_TEXTURE\ncolor *= texture2D(u_occlusionTexture, texCoord).r;\n#endif\n#ifdef HAS_EMISSIVE_TEXTURE\nvec2 emissiveTexCoord = texCoord;\nemissiveTexCoord = emissiveTexCoord * u_emissiveUVOffsetAndTiling.zw + u_emissiveUVOffsetAndTiling.xy;\nvec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, emissiveTexCoord).rgb);\nemissive *= u_emissiveFactor.rgb;\ncolor += emissive;\n#else\ncolor += u_emissiveFactor.rgb;\n#endif\ncolor = LINEARtoSRGB(color);\nvec4 resultColor = vec4(color, 1.0);\n#ifdef MASK\nif (baseColorWithAlpha.a < u_alphaCutoff)\n{\ndiscard;\n}\nresultColor = vec4(color, 1.0);\n#endif\n#ifdef BLEND\nresultColor = vec4(color, baseColorWithAlpha.a);\n#endif\nreturn resultColor;\n}\n",czm_sampleAndBlend="uniform float uParentMixDirection;\nuniform vec4 u_pickIDColor;\n#ifdef Apply_ImageryClip\nuniform sampler2D uModifyRasterTexture;\n#endif\nvec4 czm_sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nvec4 transparentBackColor,\nbool imageryClipEnable,\nbool flipY,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nvec2 split,\nvec4 swipe,\nfloat textureMinAlpha)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nif(flipY)\n{\ntextureCoordinates.y = 1.0 - textureCoordinates.y;\n}\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\nif(transparentBackColor.a > 0.01)\n{\nfloat rDiff = abs(transparentBackColor.r - color.r);\nfloat gDiff = abs(transparentBackColor.g - color.g);\nfloat bDiff = abs(transparentBackColor.b - color.b);\nif(rDiff < transparentBackColor.a && gDiff < transparentBackColor.a && bDiff < transparentBackColor.a)\n{\nalpha = 0.0;\n}\n}\nif(imageryClipEnable)\n{\n#ifdef Apply_ImageryClip\nif(texture2D(uModifyRasterTexture, tileTextureCoordinates).w < 0.1)\n{\nalpha = 0.0;\n}\n#else\nalpha = 0.0;\n#endif\n}\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\nvec2 splitPosition = czm_imagerySplitPosition;\nif (split.x < 0.0 && gl_FragCoord.x > splitPosition.x) {\nalpha = 0.0;\n}\nelse if (split.x > 0.0 && gl_FragCoord.x < splitPosition.x) {\nalpha = 0.0;\n}\nif(split.y < 0.0 && gl_FragCoord.y > splitPosition.y) {\nalpha = 0.0;\n}\nelse if(split.y > 0.0 && gl_FragCoord.y < splitPosition.y) {\nalpha = 0.0;\n}\n#if TEXTURE_UNITS < 2\nif(alpha == 0.0)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef APPLY_SWIPE\nif (gl_FragCoord.x < swipe.x || gl_FragCoord.y > swipe.y) {\nalpha = 0.0;\n}\nelse if (gl_FragCoord.x > swipe.z || gl_FragCoord.y < swipe.w) {\nalpha = 0.0;\n}\n#if TEXTURE_UNITS < 2\nif(alpha == 0.0)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef ALPHAFILTER\nif(alpha <= textureMinAlpha)\n{\nreturn previousColor.rgba;\n}\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 sampleAndBlendParent(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nvec4 transparentBackColor,\nbool flipY,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nvec2 split,\nvec4 swipe,\nfloat textureMinAlpha)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nif(flipY)\n{\ntextureCoordinates.y = 1.0 - textureCoordinates.y;\n}\nvec4 value = texture2D(textureToSample, textureCoordinates);\nif(uParentMixDirection > 0.0 && value.a > 0.01)\n{\nvalue.a = 0.0;\nbool blend = false;\nfloat mixDirection = uParentMixDirection;\nif( mixDirection > 7.0 )\n{\nif(tileTextureCoordinates.y <0.3)\n{\nblend = true;\n}\nmixDirection-=8.0;\n}\nelse if( mixDirection > 3.0)\n{\nif(tileTextureCoordinates.y >0.7)\n{\nblend = true;\n}\nmixDirection-=4.0;\n}\nif(blend)\n{\nfloat mixY = abs(tileTextureCoordinates.y-0.5);\nfloat mixValue = 10.0*mixY;\nmixValue = clamp((mixValue - 4.0), 0.0, 1.0);\nvalue.a = mixValue;\n}\nblend = false;\nif( mixDirection > 1.5)\n{\nif(tileTextureCoordinates.x >0.7)\n{\nblend = true;\n}\nmixDirection-=2.0;\n}\nelse if( mixDirection > 0.5)\n{\nif(tileTextureCoordinates.x <0.3)\n{\nblend = true;\n}\n}\nif(blend)\n{\nfloat mixValue = 10.0*abs(tileTextureCoordinates.x-0.5);\nmixValue = clamp((mixValue - 4.0), 0.0, 1.0);\nvalue.a = max(mixValue, value.a);\n}\n}\nvec3 color = value.rgb;\nfloat alpha = value.a;\nif(transparentBackColor.a > 0.01)\n{\nfloat rDiff = abs(transparentBackColor.r - color.r);\nfloat gDiff = abs(transparentBackColor.g - color.g);\nfloat bDiff = abs(transparentBackColor.b - color.b);\nif(rDiff < transparentBackColor.a && gDiff < transparentBackColor.a && bDiff < transparentBackColor.a)\n{\nalpha = 0.0;\n}\n}\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\nvec2 splitPosition = czm_imagerySplitPosition;\nif (split.x < 0.0 && gl_FragCoord.x > splitPosition.x) {\nalpha = 0.0;\n}\nelse if (split.x > 0.0 && gl_FragCoord.x < splitPosition.x) {\nalpha = 0.0;\n}\nif(split.y < 0.0 && gl_FragCoord.y > splitPosition.y) {\nalpha = 0.0;\n}\nelse if(split.y > 0.0 && gl_FragCoord.y < splitPosition.y) {\nalpha = 0.0;\n}\n#if TEXTURE_UNITS < 2\nif(alpha == 0.0)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef APPLY_SWIPE\nif (gl_FragCoord.x < swipe.x || gl_FragCoord.y > swipe.y) {\nalpha = 0.0;\n}\nelse if (gl_FragCoord.x > swipe.z || gl_FragCoord.y < swipe.w) {\nalpha = 0.0;\n}\n#if TEXTURE_UNITS < 2\nif(alpha == 0.0)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef ALPHAFILTER\nif(alpha <= textureMinAlpha)\n{\nreturn previousColor.rgba;\n}\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 mvtTextureSampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nsampler2D idTextureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nvec4 selectColor,\nfloat textureAlpha,\nfloat textureOneOverGamma,\nvec4 swipe)\n{\n#ifdef APPLY_SWIPE\nvec2 f = step(swipe.xw, vec2(gl_FragCoord.xy));\nvec2 s = step(vec2(gl_FragCoord.xy), swipe.zy);\nif (f.x * f.y * s.x * s.y < 1.0) {\nreturn previousColor;\n};\n#endif\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec4 idColor = texture2D(idTextureToSample, textureCoordinates);\nif(idColor.r == u_pickIDColor.r && idColor.g == u_pickIDColor.g && idColor.b == u_pickIDColor.b){\nvalue.rgb = selectColor.rgb;\n}\nvec3 color = value.rgb;\nfloat alpha = value.a;\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\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 gridTextureSampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale)\n{\nfloat textureAlpha = 1.0;\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\n",czm_sampleOctahedralProjection="vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\ndirection /= dot(vec3(1.0), abs(direction));\nvec2 rev = abs(direction.zx) - vec2(1.0);\nvec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\ndirection.z < 0.0 ? rev.y : -rev.y);\nvec2 uv = direction.y < 0.0 ? neg : direction.xz;\nvec2 coord = 0.5 * uv + vec2(0.5);\nvec2 pixel = 1.0 / textureSize;\nif (lod > 0.0)\n{\nfloat scale = 1.0 / pow(2.0, lod);\nfloat offset = ((textureSize.y + 1.0) / textureSize.x);\ncoord.x *= offset;\ncoord *= scale;\ncoord.x += offset + pixel.x;\ncoord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n}\nelse\n{\ncoord.x *= (textureSize.y / textureSize.x);\n}\n#ifndef OES_texture_float_linear\nvec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\nvec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\nvec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\nvec3 color4 = texture2D(projectedMap, coord).rgb;\nvec2 texturePosition = coord * textureSize;\nfloat fu = fract(texturePosition.x);\nfloat fv = fract(texturePosition.y);\nvec3 average1 = mix(color4, color2, fu);\nvec3 average2 = mix(color1, color3, fu);\nvec3 color = mix(average1, average2, fv);\n#else\nvec3 color = texture2D(projectedMap, coord).rgb;\n#endif\nreturn color;\n}\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\nfloat currentLod = floor(lod + 0.5);\nfloat nextLod = min(currentLod + 1.0, maxLod);\nvec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\nvec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\nreturn mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n",czm_saturation="vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n",czm_shadowDepthCompare="float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n",czm_shadowVisibility="float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n",czm_signNotZero="float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n",czm_sketchMode="uniform sampler2D uNormalDepthTexture;\nuniform int uFillStyle;\nfloat edgeDetection(float lineWidth)\n{\nvec2 center = gl_FragCoord.xy / czm_globeDepthTextureDim.xy;\nvec2 off = lineWidth / czm_globeDepthTextureDim.xy;\nvec4 tex_nw = vec4(center.x+off.x, center.y+off.y, 1.0, 1.0);\nvec4 val_nw = texture2D(uNormalDepthTexture, tex_nw.xy);\nval_nw.xyz = (val_nw.xyz * 2.0) - 1.0;\nvec4 tex_ne = vec4(center.x-off.x, center.y+off.y, 1.0, 1.0);\nvec4 val_ne = texture2D(uNormalDepthTexture, tex_ne.xy);\nval_ne.xyz = (val_ne.xyz * 2.0) - 1.0;\nvec4 tex_sw = vec4(center.x+off.x, center.y-off.y, 1.0, 1.0);\nvec4 val_sw = texture2D(uNormalDepthTexture, tex_sw.xy);\nval_sw.xyz = (val_sw.xyz * 2.0 ) - 1.0;\nvec4 tex_se = vec4(center.x-off.x, center.y-off.y, 1.0, 1.0);\nvec4 val_se = texture2D(uNormalDepthTexture, tex_se.xy);\nval_se.xyz = (val_se.xyz * 2.0) - 1.0;\nfloat discontinuity = 0.0;\nfloat dot0 = dot(val_nw.xyz, val_se.xyz);\nfloat dot1 = dot(val_ne.xyz, val_sw.xyz);\ndiscontinuity = 0.5*(dot0+dot1);\nreturn discontinuity;\n}\nvec4 czm_sketchMode(vec4 inputColor, vec4 lineColor, float lineWidth)\n{\nvec4 outputColor = inputColor;\nfloat discontinuity = edgeDetection(lineWidth);\ndiscontinuity = clamp(discontinuity, 0.0, 1.0);\nif(uFillStyle == 1)\n{\noutputColor = lineColor;\noutputColor.a = (1.0 - sign(discontinuity - 0.5)) * 0.5;\noutputColor.a *= lineColor.a;\n}\nelse\n{\nvec3 mixLineColor = mix(inputColor.rgb, vec3(lineColor.rgb), lineColor.a);\noutputColor.rgb = mix(mixLineColor, inputColor.rgb, discontinuity);\n}\nreturn outputColor;\n}\n",czm_sphericalHarmonics="vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\nconst float c1 = 0.429043;\nconst float c2 = 0.511664;\nconst float c3 = 0.743125;\nconst float c4 = 0.886227;\nconst float c5 = 0.247708;\nvec3 L00 = coefficients[0];\nvec3 L1_1 = coefficients[1];\nvec3 L10 = coefficients[2];\nvec3 L11 = coefficients[3];\nvec3 L2_2 = coefficients[4];\nvec3 L2_1 = coefficients[5];\nvec3 L20 = coefficients[6];\nvec3 L21 = coefficients[7];\nvec3 L22 = coefficients[8];\nfloat x = normal.x;\nfloat y = normal.y;\nfloat z = normal.z;\nreturn c1 * L22 * (x * x - y * y) + c3 * L20 * z * z + c4 * L00 - c5 * L20 +\n2.0 * c1 * (L2_2 * x * y + L21 * x * z + L2_1 * y * z) +\n2.0 * c2 * (L11 * x + L1_1 * y + L10 * z);\n}\n",czm_tangentToEyeSpaceMatrix="mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n",czm_transformPlane="vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) {\nvec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz);\nvec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz;\nvec4 transformedPlane;\ntransformedPlane.xyz = transformedDirection;\ntransformedPlane.w = -dot(transformedDirection, transformedPosition);\nreturn transformedPlane;\n}\n",czm_translateRelativeToEye="vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nif(length(highDifference) == 0.0) {\nhighDifference = vec3(0);\n}\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n",czm_translucentPhong="vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse * czm_lightColor;\ncolor += material.specular * specular * czm_lightColor;\nreturn vec4(color, material.alpha);\n}\n",czm_transpose="mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n",czm_unpackDepth="float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n",czm_unpackFloat="#define SHIFT_RIGHT_8 0.00390625 //1.0 / 256.0\n#define SHIFT_RIGHT_16 0.00001525878 //1.0 / 65536.0\n#define SHIFT_RIGHT_24 5.960464477539063e-8//1.0 / 16777216.0\n#define BIAS 38.0\nfloat czm_unpackFloat(vec4 packedFloat)\n{\npackedFloat *= 255.0;\nfloat temp = packedFloat.w / 2.0;\nfloat exponent = floor(temp);\nfloat sign = (temp - exponent) * 2.0;\nexponent = exponent - float(BIAS);\nsign = sign * 2.0 - 1.0;\nsign = -sign;\nfloat unpacked = sign * packedFloat.x * float(SHIFT_RIGHT_8);\nunpacked += sign * packedFloat.y * float(SHIFT_RIGHT_16);\nunpacked += sign * packedFloat.z * float(SHIFT_RIGHT_24);\nreturn unpacked * pow(10.0, exponent);\n}\n",czm_unpackValue="float czm_unpackValue(vec4 packedValue)\n{\nfloat SHIFT_LEFT16 = 65536.0;\nfloat SHIFT_LEFT8 = 256.0;\nvec4 value = packedValue * 255.0;\nreturn value.r * SHIFT_LEFT16 + value.g * SHIFT_LEFT8 + value.b - 9000.0;\n}\n",czm_vertexLogDepth="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n#ifdef SHADOW_MAP\nvec3 logPositionEC = (czm_inverseProjection * coords).xyz;\nv_logPositionEC = logPositionEC;\n#endif\ncoords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\nreturn coords;\n}\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = 1.0 - czm_currentFrustum.x + gl_Position.w;\ngl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = 1.0 - czm_currentFrustum.x + clipCoords.w;\nczm_updatePositionDepth(clipCoords);\n#endif\n}\n",czm_windowToEyeCoordinates="vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nif (!(czm_inverseProjection == mat4(0.0)))\n{\nq = czm_inverseProjection * q;\n}\nelse\n{\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n#ifdef LOG_DEPTH\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nfloat log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\nfloat depthFromNear = pow(2.0, log2Depth) - 1.0;\nfloat depthFromCamera = depthFromNear + near;\nvec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\neyeCoordinate.w = 1.0 / depthFromCamera;\nreturn eyeCoordinate;\n#else\nvec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\nreturn eyeCoordinate;\n}\n",czm_writeDepthClampedToFarPlane="#ifndef LOG_DEPTH\nvarying float v_WindowZ;\n#endif\nvoid czm_writeDepthClampedToFarPlane()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",czm_writeLogDepth="#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#endif\n#endif\nvoid czm_writeLogDepth(float depth)\n{\n#if (defined(GL_EXT_frag_depth) || defined(WEBGL2)) && defined(LOG_DEPTH)\nif (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\ndiscard;\n}\n#ifdef POLYGON_OFFSET\nfloat factor = u_polygonOffset[0];\nfloat units = u_polygonOffset[1];\n#ifdef GL_OES_standard_derivatives\nfloat x = dFdx(depth);\nfloat y = dFdy(depth);\nfloat m = sqrt(x * x + y * y);\ndepth += m * factor;\n#endif\n#endif\ngl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#ifdef POLYGON_OFFSET\ngl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n#endif\n}\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\nczm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n",czm_writeNonPerspective="float czm_writeNonPerspective(float value, float w) {\nreturn value * w;\n}\nvec2 czm_writeNonPerspective(vec2 value, float w) {\nreturn value * w;\n}\nvec3 czm_writeNonPerspective(vec3 value, float w) {\nreturn value * w;\n}\nvec4 czm_writeNonPerspective(vec4 value, float w) {\nreturn value * w;\n}\n",czm_XYZToRGB="vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n",k$14={czm_degreesPerRadian:czm_degreesPerRadian,czm_depthRange:czm_depthRange,czm_ellipsoidInverseRadii:czm_ellipsoidInverseRadii,czm_ellipsoidRadii:czm_ellipsoidRadii,czm_epsilon1:czm_epsilon1,czm_epsilon2:czm_epsilon2,czm_epsilon3:czm_epsilon3,czm_epsilon4:czm_epsilon4,czm_epsilon5:czm_epsilon5,czm_epsilon6:czm_epsilon6,czm_epsilon7:czm_epsilon7,czm_infinity:czm_infinity,czm_oneOverPi:czm_oneOverPi,czm_oneOverTwoPi:czm_oneOverTwoPi,czm_passCesium3DTile:czm_passCesium3DTile,czm_passCesium3DTileClassification:czm_passCesium3DTileClassification,czm_passCesium3DTileClassificationIgnoreShow:czm_passCesium3DTileClassificationIgnoreShow,czm_passClassification:czm_passClassification,czm_passCompute:czm_passCompute,czm_passEnvironment:czm_passEnvironment,czm_passGlobe:czm_passGlobe,czm_passGround:czm_passGround,czm_passOpaque:czm_passOpaque,czm_passOverlay:czm_passOverlay,czm_passTerrainClassification:czm_passTerrainClassification,czm_passTranslucent:czm_passTranslucent,czm_pi:czm_pi,czm_piOverFour:czm_piOverFour,czm_piOverSix:czm_piOverSix,czm_piOverThree:czm_piOverThree,czm_piOverTwo:czm_piOverTwo,czm_radiansPerDegree:czm_radiansPerDegree,czm_sceneMode2D:czm_sceneMode2D,czm_sceneMode3D:czm_sceneMode3D,czm_sceneModeColumbusView:czm_sceneModeColumbusView,czm_sceneModeMorphing:czm_sceneModeMorphing,czm_solarRadius:czm_solarRadius,czm_threePiOver2:czm_threePiOver2,czm_twoPi:czm_twoPi,czm_webMercatorMaxLatitude:czm_webMercatorMaxLatitude,czm_depthRangeStruct:czm_depthRangeStruct,czm_ellipsoid:czm_ellipsoid,czm_material:czm_material,czm_materialInput:czm_materialInput,czm_ray:czm_ray,czm_raySegment:czm_raySegment,czm_s3mMaterialInput:czm_s3mMaterialInput,czm_shadowParameters:czm_shadowParameters,czm_acesTonemapping:czm_acesTonemapping,czm_adjustColor:czm_adjustColor,czm_alphaWeight:czm_alphaWeight,czm_antialias:czm_antialias,czm_approximateSphericalCoordinates:czm_approximateSphericalCoordinates,czm_branchFreeTernary:czm_branchFreeTernary,czm_cascadeColor:czm_cascadeColor,czm_cascadeDistance:czm_cascadeDistance,czm_cascadeMatrix:czm_cascadeMatrix,czm_cascadeWeights:czm_cascadeWeights,czm_clip:czm_clip,czm_columbusViewMorph:czm_columbusViewMorph,czm_computeLightColorInFP:czm_computeLightColorInFP,czm_computeLightColorInstanceInFP:czm_computeLightColorInstanceInFP,czm_computeNormal:czm_computeNormal,czm_computePosition:czm_computePosition,czm_cosineAndSine:czm_cosineAndSine,czm_decompressTextureCoordinates:czm_decompressTextureCoordinates,czm_depthClampFarPlane:czm_depthClampFarPlane,czm_directionLight:czm_directionLight,czm_eastNorthUpToEyeCoordinates:czm_eastNorthUpToEyeCoordinates,czm_ellipsoidContainsPoint:czm_ellipsoidContainsPoint,czm_ellipsoidNew:czm_ellipsoidNew,czm_ellipsoidWgs84TextureCoordinates:czm_ellipsoidWgs84TextureCoordinates,czm_equalsEpsilon:czm_equalsEpsilon,czm_executeExcavation:czm_executeExcavation,czm_eyeOffset:czm_eyeOffset,czm_eyeToWindowCoordinates:czm_eyeToWindowCoordinates,czm_fastApproximateAtan:czm_fastApproximateAtan,czm_fog:czm_fog,czm_gammaCorrect:czm_gammaCorrect,czm_geodeticSurfaceNormal:czm_geodeticSurfaceNormal,czm_getDefaultMaterial:czm_getDefaultMaterial,czm_getEmissiveTextureColor:czm_getEmissiveTextureColor,czm_getHorizontalColor:czm_getHorizontalColor,czm_getHypsometricColor:czm_getHypsometricColor,czm_getLambertDiffuse:czm_getLambertDiffuse,czm_getSpecular:czm_getSpecular,czm_getTexColorForS3M:czm_getTexColorForS3M,czm_getTextureMatrixFromZValue:czm_getTextureMatrixFromZValue,czm_getVolumeValue:czm_getVolumeValue,czm_getVolumeValueMultiResolution:czm_getVolumeValueMultiResolution,czm_getWaterNoise:czm_getWaterNoise,czm_getWgs84EllipsoidEC:czm_getWgs84EllipsoidEC,czm_HSBToRGB:czm_HSBToRGB,czm_HSLToRGB:czm_HSLToRGB,czm_hue:czm_hue,czm_inverseGamma:czm_inverseGamma,czm_inverseMatrix:czm_inverseMatrix,czm_isEmpty:czm_isEmpty,czm_isFull:czm_isFull,czm_latitudeToWebMercatorFraction:czm_latitudeToWebMercatorFraction,czm_lineDistance:czm_lineDistance,czm_luminance:czm_luminance,czm_metersPerPixel:czm_metersPerPixel,czm_modelToWindowCoordinates:czm_modelToWindowCoordinates,czm_multiplyWithColorBalance:czm_multiplyWithColorBalance,czm_nearFarScalar:czm_nearFarScalar,czm_octDecode:czm_octDecode,czm_packDepth:czm_packDepth,czm_packValue:czm_packValue,czm_phong:czm_phong,czm_planeDistance:czm_planeDistance,czm_pointAlongRay:czm_pointAlongRay,czm_rayEllipsoidIntersectionInterval:czm_rayEllipsoidIntersectionInterval,czm_readDepth:czm_readDepth,czm_readNonPerspective:czm_readNonPerspective,czm_reverseLogDepth:czm_reverseLogDepth,czm_RGBToHSB:czm_RGBToHSB,czm_RGBToHSL:czm_RGBToHSL,czm_RGBToXYZ:czm_RGBToXYZ,czm_RollerShutter:czm_RollerShutter,czm_s3mBatchOperation:czm_s3mBatchOperation,czm_S3MPBR:czm_S3MPBR,czm_sampleAndBlend:czm_sampleAndBlend,czm_sampleOctahedralProjection:czm_sampleOctahedralProjection,czm_saturation:czm_saturation,czm_shadowDepthCompare:czm_shadowDepthCompare,czm_shadowVisibility:czm_shadowVisibility,czm_signNotZero:czm_signNotZero,czm_sketchMode:czm_sketchMode,czm_sphericalHarmonics:czm_sphericalHarmonics,czm_tangentToEyeSpaceMatrix:czm_tangentToEyeSpaceMatrix,czm_transformPlane:czm_transformPlane,czm_translateRelativeToEye:czm_translateRelativeToEye,czm_translucentPhong:czm_translucentPhong,czm_transpose:czm_transpose,czm_unpackDepth:czm_unpackDepth,czm_unpackFloat:czm_unpackFloat,czm_unpackValue:czm_unpackValue,czm_vertexLogDepth:czm_vertexLogDepth,czm_windowToEyeCoordinates:czm_windowToEyeCoordinates,czm_writeDepthClampedToFarPlane:czm_writeDepthClampedToFarPlane,czm_writeLogDepth:czm_writeLogDepth,czm_writeNonPerspective:czm_writeNonPerspective,czm_XYZToRGB:czm_XYZToRGB},e$1T="\n#ifdef HAS_RAIN\nuniform float uAnimationSpeed;\nuniform sampler2D uRippleTexture;\nuniform float uRippleScale;\nuniform float uWindIntensity;\nuniform float uRain;\nuniform float uCameraDepth;\n \nvoid getTimeInfo(float animationSpeed, out vec2 timeVec)\n{\n\tfloat time = czm_frameNumber * animationSpeed;\n\ttime = floor(30.0 * time);\n\tfloat time_diff = floor(time*0.25);\n\ttime = mod(time, 4.0);\n\ttime_diff = mod(time_diff, 4.0);\n\ttimeVec = vec2(time, time_diff);\n}\n\nvoid getPosInfo(vec4 posMC, out vec2 posMC_frac1, out vec2 posMC_frac2)\n{\n\tfloat ripple_scale = 1.0 / uRippleScale;\n\tvec2 posXY = posMC.xy * ripple_scale;\n\tposMC_frac1 = fract(posXY);\n\tvec2 posStep = vec2(0.5);\n\tposMC_frac2 = fract(posXY + posStep);\n}\n\nfloat getAlpha(vec2 posMC_frac1)\n{\n\tvec2 dist = (posMC_frac1 - vec2(0.5)) * 2.0;\n\tdist = vec2(abs(dist.x), abs(dist.y));\n\tvec2 result = pow(dist, vec2(5.0));\n\treturn result.x + result.y;\n}\n\nvec4 getRippleValue(sampler2D uRippleTexture, vec2 timeVec, vec2 posMC_frac1, vec2 posMC_frac2, float alpha)\n{\n\tvec2 rippleUV_1 = (timeVec + posMC_frac1)*0.25;\n\tvec2 rippleUV_2 = (timeVec + posMC_frac2)*0.25;\n\tvec4 rippleValue_1 = texture2D(uRippleTexture, rippleUV_1.xy);\n\tvec4 rippleValue_2 = texture2D(uRippleTexture, rippleUV_2.xy);\n\treturn mix(rippleValue_1, rippleValue_2, alpha);\n}\n\nvec3 getRippleNormal(vec4 rippleValue, float wind_intensity, float rain, float depthFade)\n{\n\tvec2 rippleValueXY = rippleValue.xy;\n\tvec2 rippleValueZW = rippleValue.zw;\n\tconst vec2 _value = vec2(0.5);\n\tvec2 part_1 = (rippleValueZW - _value) * wind_intensity * 0.13;\n\tvec2 part_2 = (rippleValueXY - _value) * 0.6;\n\tvec2 mergedValue = mix(part_1, part_2, rain) * depthFade;\n\treturn vec3(mergedValue, 1.0);\n}\n\nfloat getNormalAlpha(vec3 normalWS,float wetness)\n{\n\tfloat valueZ = normalWS.z - 0.5;\n\tfloat wet_correction = wetness * clamp(valueZ * 2.5, 0.0, 1.0);\n\treturn pow(wet_correction, 15.0);\n}\n\nvec3 rippleNormalCorrection(vec3 rippleNormal,float normalAlpha)\n{\n\tconst vec3 blueNormal = vec3(0.0, 0.0, 1.0);\n\treturn mix(blueNormal, rippleNormal, normalAlpha);\n}\n\nvec3 rippleGenerator(sampler2D uRippleTexture, float animationSpeed,vec3 normalWS,float wetness)\n{\n\tvec2 timeVec = vec2(1.0);\n\tgetTimeInfo(animationSpeed, timeVec);\n\tvec2 posMC_frac1 = vec2(1.0);\n\tvec2 posMC_frac2 = vec2(1.0);\n\tgetPosInfo(vPositionMC, posMC_frac1, posMC_frac2);\n\tfloat alpha = getAlpha(posMC_frac1);\n\tvec4 rippleValue = getRippleValue(uRippleTexture, timeVec, posMC_frac1, posMC_frac2, alpha);\n\tvec3 rippleNormal = getRippleNormal(rippleValue, uWindIntensity, uRain, uCameraDepth);\n\tfloat normalAlpha = getNormalAlpha(normalWS, wetness);\n\treturn normalize(rippleNormalCorrection(rippleNormal, normalAlpha));\n}\n#endif\n",r$14="\n#ifdef HAS_SNOW\nuniform float uSnowCoverageFactor;\nuniform sampler2D uSnowMaskTexture;\nuniform sampler2D uSnowNormalTexture;\n\nvec3 getSnowMaskValue(sampler2D uSnowMaskTexture, vec2 snowUV)\n{\n\treturn texture2D(uSnowMaskTexture, snowUV).rgb;\n}\n\nfloat getSnowCoverage(float snow_coverage, float max_snow_coverage, vec3 normalWS, float z_mask)\n{\n\tfloat normal_z = normalWS.z;\n\tnormal_z += 1.1 + z_mask;\n\tnormal_z = clamp(normal_z * 0.5, 0.0, 1.0);\n\tfloat final_snow_coverage = clamp(snow_coverage, 0.0, max_snow_coverage);\n\tfinal_snow_coverage = clamp(final_snow_coverage*normal_z, 0.0, 1.0);\n\treturn final_snow_coverage;\n}\n\nfloat getSnowCoverageWithMaskTexture(float finalSnowCoverage, float heightValue, float snow_scatter_value, float snow_scatter_alpha, float tighten_value)\n{\n\tfloat scatter_value = mix(heightValue, snow_scatter_value, snow_scatter_alpha);\n\treturn clamp((tighten_value + 1.0) * finalSnowCoverage - tighten_value * scatter_value, 0.0, 1.0);\n}\n\nfloat getSnowAlpha(vec3 normalWS, float snow_coverage, float z_mask)\n{\n\treturn clamp((normalWS.z + z_mask) * 5.0, 0.0, 1.0) * snow_coverage;\n}\n\nvec3 getFinalBaseColor(vec3 baseColor, vec3 snow_baseColor, float snowAlpha)\n{\n\treturn mix(baseColor, snow_baseColor, snowAlpha);\n}\n\nfloat getFinalRoughness(float roughness, float snow_roughness, float snowAlpha)\n{\n\treturn mix(roughness, snow_roughness, snowAlpha);\n}\n\nvec3 getFinalNormal(vec3 normalWS, vec3 snowNormal, float blendNormalValue, float snow_coverage)\n{\n\tvec3 snowNormal_part2 = vec3(snowNormal.xy - vec2(0.5), 1.0);\n\tfloat normal_alpha = (1.0 - blendNormalValue)* snow_coverage;\n\treturn mix(normalWS, snowNormal_part2, normal_alpha);\n}\n\nvoid snowGenerator(sampler2D uSnowMaskTexture, sampler2D uSnowNormalTexture, vec2 snowUV, float snow_coverage, inout vec3 normalWS, inout vec3 baseColor, inout float roughness)\n{\n\tvec3 snowMaskValue = texture2D(uSnowMaskTexture, snowUV).rgb;\n\tconst float max_snow_coverage = 1.0;\n\tconst float z_mask = 0.0;\n\tfloat snowCoverage = getSnowCoverage(snow_coverage, max_snow_coverage, normalWS, z_mask);\n\tconst float heightValue = 0.5;\n\tfloat snow_scatter_value = snowMaskValue.g;\n\tconst float snow_scatter_alpha = 0.5;\n\tconst float tighten_value = 4.0;\n snowCoverage = getSnowCoverageWithMaskTexture(snowCoverage, heightValue, snow_scatter_value, snow_scatter_alpha, tighten_value);\n\tfloat snow_alpha = getSnowAlpha(normalWS, snowCoverage, z_mask);\n\tbaseColor = getFinalBaseColor(baseColor, vec3(snowMaskValue.r), snow_alpha);\n\troughness = getFinalRoughness(roughness, snowMaskValue.b, snow_alpha);\n\tvec3 snowNormalValue = texture2D(uSnowNormalTexture, snowUV).rgb;\n\tconst float blendNormalValue = 0.3;\n\tnormalWS = getFinalNormal(normalWS, snowNormalValue, blendNormalValue, snowCoverage);\n}\n\n#endif\n",o$1f="\n#ifdef HAS_HEMISPHERE_LIGHTS\n\nuniform vec3 uSkyColor[ HEMISPHERE_LIGHTS ];\nuniform vec3 uGroundColor[ HEMISPHERE_LIGHTS ];\nuniform vec3 uHemisphereLightDirectionEC[ HEMISPHERE_LIGHTS ];\n \nstruct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n};\n\nvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n return irradiance;\n}\n\n#endif\n",t$R="\n#ifdef HAS_POINT_LIGHTS\n\nuniform vec3 uPointLightPositionEC[ POINT_LIGHTS ];\nuniform vec3 uPointLightColor[ POINT_LIGHTS ];\nuniform vec2 uPointLightDistanceAndDecay[ POINT_LIGHTS ];\n\nstruct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n};\n\nvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = ( directLight.color != vec3( 0.0 ) );\n}\n\n#endif\n",i$X="\n#ifdef HAS_SPOT_LIGHTS\n\nuniform vec3 uSpotLightColor[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightDirectionEC[ SPOT_LIGHTS ];\nuniform vec4 uSpotLightDistanceDecayCosPenumbra[ SPOT_LIGHTS ];\nuniform vec3 uSpotLightExponent[ SPOT_LIGHTS ];\n \nstruct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n};\n\nvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( angleCos > spotLight.coneCos ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n}\n\n#endif\n",c$14="\n#ifdef HAS_DIR_LIGHTS\n\nuniform vec3 uDirectionalLightDirectionEC[ DIR_LIGHTS ];\nuniform vec3 uDirectionalLightColor[ DIR_LIGHTS ];\n \n#endif\n",m$16="\n\n#ifdef HAS_DIR_LIGHTS\nfor (int i = 0; i < DIR_LIGHTS; i++) {\n directLight.color = uDirectionalLightColor[i];\n directLight.direction = uDirectionalLightDirectionEC[i];\n directLight.visible = true;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n\n#ifdef HAS_POINT_LIGHTS\nPointLight pointLight;\nfor (int i = 0; i < POINT_LIGHTS; i++) {\n pointLight.position = uPointLightPositionEC[i];\n pointLight.color = uPointLightColor[i];\n pointLight.distance = uPointLightDistanceAndDecay[i].x;\n pointLight.decay = uPointLightDistanceAndDecay[i].y;\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n if(!directLight.visible) continue;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n\n#ifdef HAS_SPOT_LIGHTS\nSpotLight spotLight;\nfor (int i = 0; i < SPOT_LIGHTS; i++) {\n spotLight.position = uSpotLightPositionEC[i];\n spotLight.color = uSpotLightColor[i];\n spotLight.direction = uSpotLightDirectionEC[i];\n spotLight.coneCos = uSpotLightDistanceDecayCosPenumbra[i].z;\n spotLight.penumbraCos = uSpotLightDistanceDecayCosPenumbra[i].w;\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n if(!directLight.visible) continue;\n directPhysical( directLight, geometry, material, reflectedLight );\n}\n#endif\n",l$17="\n#ifdef BRDF\n#define RECIPROCAL_PI 0.31830988618\n#define M_PI 3.141592653589793\n#define EPSILON 1e-6\n#define CUBEUV_MAX_MIP 8.0\n#define CUBEUV_TEXEL_WIDTH 0.0013020833333333333\n#define CUBEUV_TEXEL_HEIGHT 0.0009765625\n#define saturate(a) clamp( a, 0.0, 1.0 )\nfloat pow2( const in float x ) { return x * x; }\n\nuniform vec4 uBaseColorFactor;\nuniform vec4 uEmissiveFactor;\nuniform float uMetallicFactor;\nuniform float uRoughnessFactor;\nuniform float uAlphaCutoff;\nuniform float uEnvMapIntensity;\nuniform float uCameraReflect;\nstruct IncidentLight {\n vec3 direction;\n vec3 color;\n bool visible;\n};\n\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\n\nstruct PhysicalMaterial {\n vec3\tdiffuseColor;\n float\troughness;\n vec3\tspecularColor;\n float specularF90;\n};\n\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\n#ifdef HAS_BASE_TEXTURE\n uniform sampler2D uBaseTexture;\n#endif\n\n#ifdef HAS_NORMAL_TEXTURE\n uniform sampler2D uNormalTexture;\n uniform float uNormalTextureScale;\n#ifdef HAS_ANISOTROPY\n uniform vec4 uAnisotropy;\n#endif\n#endif\n\n#ifdef HAS_EMISSIVE_TEXTURE\n uniform sampler2D uEmissionTexture;\n uniform vec4 uEmissiveUVOffsetAndTiling;\n#endif\n\n#ifdef HAS_MetallicRoughness_TEXTURE\n uniform sampler2D uMetallicRoughnessTexture;\n#endif\n\n#ifdef HAS_OCCLUSION_TEXTURE\n uniform sampler2D uOcclusionTexture;\n#endif\n\n#ifdef REFRACTION\n uniform float uIndexOfRefraction;\n#endif\n\n#ifdef HAS_TRANSMISSION\n uniform float uTransmissionFactor;\n#endif\n\n#ifdef HAS_WETNESS\n uniform float uWetnessFactor;\n#endif\n\n#ifdef HAS_VOLUME\n uniform vec4 uTintColor;\n uniform vec4 uDiffusionDistance;\n uniform float uThickness;\n#endif\n\n#ifdef HAS_CLEARCOAT\n uniform float uClearcoatFactor;\n uniform float uClearcoatRoughnessFactor;\n#endif\n\n//��UE4.24实现计算精确光�的衰�\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n // float d = lightDistance;\n // float r = cutoffDistance;\n // float d2 = d * d;\n // float attenuation = 1.0 / (d2 + 1.0); \n // float m = saturate(1.0 - pow(d / r, 4.0));\n // float m2 = m * m;\n // return attenuation * m2;\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\n#include <hemisphereLightDecl>\n#include <directionLightDecl>\n#include <pointLightDecl>\n#include <spotLightDecl>\n#include <snowDecl>\n#include <rainDecl>\n\n#ifdef HAS_ANISOTROPY\nvec3 getAnisotropicBentNormals(const vec3 T, const vec3 B, const vec3 N, const vec3 V, float anisotropy) {\n vec3 anisotropicFrameDirection = anisotropy >= 0.0 ? B : T;\n vec3 anisotropicFrameTangent = cross(normalize(anisotropicFrameDirection), V);\n vec3 anisotropicFrameNormal = cross(anisotropicFrameTangent, anisotropicFrameDirection);\n vec3 anisotropicNormal = normalize(mix(N, anisotropicFrameNormal, abs(anisotropy)));\n return anisotropicNormal;\n}\n#endif\n\n#ifdef HAS_VOLUME\nvec3 computeColorAtDistanceInMedia(vec3 color, float distance) {\n return -log(color) / distance;\n}\nvec3 cocaLambert(vec3 alpha, float distance) {\n return exp(-alpha * distance);\n}\n#endif\n\n\nvec3 sRGBToLinear(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\nvec4 sRGBToLinear(vec4 srgbIn)\n{\n srgbIn = srgbIn ;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\nvec3 LinearTosRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\nvec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor * RECIPROCAL_PI;\n}\n\nvec3 applyTonemapping(vec3 linearIn) \n{\n vec3 color = linearIn * czm_toneMappingExposure;\n return czm_acesTonemapping(color);\n}\n\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n\nfloat GeometrySchlickGGX(float roughness, float NoV)\n{\n float k = pow(roughness + 1.0, 2.0) / 8.0;\n return NoV / (NoV * (1.0 - k) + k);\n}\n\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\n\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n float alpha = roughness * roughness;\n vec3 halfDir = normalize( lightDir + viewDir );\n float dotNL = clamp( dot( normal, lightDir ), 0.001, 1.0 );\n float dotNV = abs( dot( normal, viewDir ) ) + 0.001;\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotLH = saturate( dot( lightDir, halfDir ) );\n float dotVH = saturate( dot( viewDir, halfDir ) );\n vec3 F = F_Schlick( f0, f90, dotVH );\n float G = GeometrySchlickGGX(alpha, dotNV) * GeometrySchlickGGX(alpha, dotNL);\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D ) / (4.0 * dotNL * dotNV);\n}\n\nvoid directPhysical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n reflectedLight.directDiffuse += irradiance * lambertianDiffuse( material.diffuseColor );\n}\n\n#ifdef HAS_NORMAL_TEXTURE\nvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 uv, vec3 mapN) {\n float fNormalLength = length(mapN);\n if(fNormalLength < 0.5) {\n return surf_norm;\n }\n mapN = mapN * 2.0 - 1.0;\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( uv.st );\n vec2 st1 = dFdy( uv.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= uNormalTextureScale;\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n}\n#endif\n\n#include <cubeUV_reflection>\n\nvec3 inverseTransformDirection( in vec3 dir ) {\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n const mat3 yUpToZUp = mat3(1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);\n return normalize( yUpToZUp * fixedToENU * dir );\n}\n\nvoid indirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * lambertianDiffuse( material.diffuseColor );\n}\n\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n float dotNV = saturate( dot( normal, viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n return fab;\n}\n\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n vec2 fab = DFGApprox( normal, viewDir, roughness );\n vec3 Fr = specularColor;\n vec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n float Ess = fab.x + fab.y;\n float Ems = 1.0 - Ess;\n vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\n vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n singleScatter += FssEss;\n multiScatter += Fms * Ems;\n}\n\nvoid indirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 singleScattering = vec3( 0.0 );\n vec3 multiScattering = vec3( 0.0 );\n vec3 cosineWeightedIrradiance = irradiance;\n computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n vec3 totalScattering = singleScattering + multiScattering;\n vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n reflectedLight.indirectSpecular += radiance * singleScattering;\n reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n\nvec3 getIBLIrradiance( const in vec3 normal ) {\n vec3 worldNormal = inverseTransformDirection( normal );\n vec4 envMapColor = textureCubeUV( czm_hdrEnvMap, worldNormal, 1.0 );\n return envMapColor.rgb;\n}\n\nvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n vec3 reflectVec = reflect( - viewDir, normal );\n reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n reflectVec = inverseTransformDirection( reflectVec );\n vec4 envMapColor = textureCubeUV( czm_hdrEnvMap, reflectVec, roughness );\n return envMapColor.rgb;\n}\n\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n\nuniform float uPbrParTextureWidth;\nvoid calculateMipLevel(in vec2 inTexCoord, in vec2 vecTile, in float fMaxMip, inout float mipLevel)\n{\n\tvec2 dx = dFdx(inTexCoord * vecTile.x);\n\tvec2 dy = dFdy(inTexCoord * vecTile.y);\n\tfloat dotX = dot(dx, dx);\n\tfloat dotY = dot(dy, dy);\n\tfloat dMax = max(dotX, dotY);\n\tfloat dMin = min(dotX, dotY);\n\tfloat offset = (dMax - dMin) / (dMax + dMin);\n\toffset = clamp(offset, 0.0, 1.0);\n\tfloat d = dMax * (1.0 - offset) + dMin * offset;\n\tmipLevel = 0.5 * log2(d);\n\tmipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62);\n}\n\nvec3 getTexcoordAndMipmapLevel(vec2 uv, vec4 texMatrix, float texCoordZ) {\n vec2 translate = texMatrix.xy;\n float textureWidth = texMatrix.z * uPbrParTextureWidth;\n float scale = texMatrix.z;\n float maxMipmapLevel = texMatrix.w;\n float mipLevel = 0.0;\n calculateMipLevel(uv, vec2(textureWidth), maxMipmapLevel, mipLevel);\n vec2 texCoord;\n if(texCoordZ < -9000.0)\n {\n texCoord = vec2(uv.x, uv.y);\n }\n else\n {\n texCoord = fract(uv);\n float offset = pow(2.0, mipLevel) / textureWidth;\n texCoord = clamp(texCoord, offset, 1.0 - offset);\n texCoord.x = (texCoord.x + translate.x) * scale;\n texCoord.y = (texCoord.y + translate.y) * scale;\n }\n \n return vec3(texCoord.xy, mipLevel);\n}\n\nvec4 brdf(in vec4 baseColorWithAlpha, vec2 texCoord, vec2 oriTexCoord, vec3 posEC, vec3 posMC, vec3 vertexNormalEC, vec4 sunLightColor, float sunLightON) {\n vec2 uv = oriTexCoord;\n float mipmapLevel = 0.0;\n#ifdef USE_BatchPBR\n vec3 uvAndMiplevel = getTexcoordAndMipmapLevel(oriTexCoord, vTexMatrix, vTexCoordZ.x);\n uv = uvAndMiplevel.xy;\n mipmapLevel = uvAndMiplevel.z;\n#endif\n#ifndef USE_BatchPBR\n baseColorWithAlpha = baseColorWithAlpha * uBaseColorFactor;\n#endif\n#ifdef BaseColorReplace\n baseColorWithAlpha = uBaseColorFactor;\n#endif\n float faceDirection = (gl_FrontFacing ? 1.0 : - 1.0) * uCameraReflect;\n vec3 ng = normalize(vertexNormalEC);\n #ifndef HAS_NORMAL\n ng = normalize(czm_normal * czm_computeNormal(posMC.xyz));\n #else\n ng = ng * faceDirection;\n #endif\n \n#ifdef HAS_BASE_TEXTURE\n #ifdef USE_BatchPBR\n baseColorWithAlpha *= sRGBToLinear(texture2DLodEXT(uBaseTexture, uv * uTexUVOffset.zw + uTexUVOffset.xy, mipmapLevel));\n #else\n baseColorWithAlpha = sRGBToLinear(texture2D(uBaseTexture, oriTexCoord * uTexUVOffset.zw + uTexUVOffset.xy)) * uBaseColorFactor * vColor;\n #endif\n#endif\n#ifdef HAS_NORMAL_TEXTURE\n #ifdef USE_BatchPBR\n vec3 mapN = texture2DLodEXT( uNormalTexture, uv, mipmapLevel).xyz;\n #else\n vec3 mapN = texture2D( uNormalTexture, uv).xyz;\n #endif\n vec3 n = perturbNormal2Arb(posEC, ng, oriTexCoord, mapN);\n#ifdef HAS_ANISOTROPY\n float anisotropy = uAnisotropy.b;\n vec3 anisotropyDirection = vec3(uAnisotropy.xy, 0.0);\n vec3 anisotropicTangent = normalize(tbn * anisotropyDirection);\n vec3 anisotropicBitangent = normalize(cross(tbn[2], anisotropicTangent));\n n = getAnisotropicBentNormals(anisotropicTangent, anisotropicBitangent, n, v, anisotropy);\n#endif\n#else\n vec3 n = ng;\n#endif\n#ifdef HAS_WETNESS\n mat3 fixedToENU_wetness = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS_wetness = normalize(fixedToENU_wetness * n);\n#endif\n#ifdef HAS_RAIN\n n = rippleGenerator(uRippleTexture,uAnimationSpeed,normalWS_wetness,uWetnessFactor);\n#endif\n vec3 baseColor = baseColorWithAlpha.rgb;\n float roughness = uRoughnessFactor;\n float metalness = uMetallicFactor;\n vec4 emissiveFactor = uEmissiveFactor;\n vec2 emissiveTexCoord = texCoord.xy;\n#ifdef PBR_THEME\n int pbrIndex = int(vPBRIndex);\n if(vPBRIndex < 0.0)\n {\n return baseColorWithAlpha;\n }\n mat4 pbrPar = mat4(0.0);\n for(int i = 0;i < NUM_PBR_MATERIALS;i++)\n {\n if(i == pbrIndex)\n {\n pbrPar = uPBRMaterials[i];\n break;\n }\n }\n roughness = clamp(pbrPar[0][0], 0.04, 1.0);\n metalness = clamp(pbrPar[0][1], 0.0, 1.0);\n baseColor = (baseColorWithAlpha / uBaseColorFactor * vec4(pbrPar[0][2], pbrPar[0][3], pbrPar[1][0], pbrPar[1][1])).rgb;\n#endif\n#ifdef USE_BatchPBR\n metalness = vMetallicRoughness.x;\n roughness = vMetallicRoughness.y;\n emissiveFactor = vEmissiveFactor;\n emissiveTexCoord = texCoord.xy;\n#endif\n metalness = clamp(metalness, 0.0, 1.0);\n roughness = clamp(roughness, 0.0, 1.0);\n \n#ifdef HAS_MetallicRoughness_TEXTURE\n #ifdef USE_BatchPBR\n vec3 metallicRoughness = texture2DLodEXT(uMetallicRoughnessTexture, uv, mipmapLevel).rgb;\n #else\n vec3 metallicRoughness = texture2D(uMetallicRoughnessTexture, oriTexCoord).rgb;\n #endif\n metalness = clamp(metalness * metallicRoughness.r, 0.0, 1.0);\n roughness = clamp(roughness * metallicRoughness.g, 0.04, 1.0);\n#ifdef HAS_WETNESS\n float fWetness = clamp(uWetnessFactor,0.0,1.0);\n float fWetness_correction = pow(4.0*fWetness,2.0);\n fWetness_correction = clamp(fWetness_correction,clamp(fWetness,0.0,0.9),1.0);\n float fWerness_normalized = fWetness_correction * clamp(normalWS_wetness.z + 0.85,0.0,1.0);\n baseColor = mix(baseColor,baseColor*0.7,fWerness_normalized);\n roughness = mix(roughness,0.05,fWerness_normalized);\n#endif\n#ifdef HAS_SNOW\n mat3 fixedToENU_snow = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS_snow = normalize(fixedToENU_snow * n);\n snowGenerator(uSnowMaskTexture,uSnowNormalTexture, oriTexCoord,uSnowCoverageFactor,normalWS_snow,baseColor,roughness);\n#endif\n#endif\n\n vec3 lightColorHdr = vec3(2.0) * uSunLightON; // 太阳光\n vec3 l = normalize(czm_lightDirectionEC);\n vec3 v = -normalize(posEC);\n vec3 h = normalize(v + l);\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n vec3 specularColor = mix(f0, baseColor, metalness);\n \n float alpha = roughness * roughness;\n float dotNL = clamp( dot( n, l ), 0.001, 1.0 );\n float dotNV = abs( dot( n, v ) ) + 0.001;\n float dotNH = saturate( dot( n, h ) );\n float dotLH = saturate( dot( l, h ) );\n float dotVH = saturate( dot( v, h ) );\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n float f90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 F = F_Schlick( specularColor, f90, dotVH );\n float G = GeometrySchlickGGX(alpha, dotNV) * GeometrySchlickGGX(alpha, dotNL);\n float D = D_GGX( alpha, dotNH );\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n vec3 specularContribution = F * G * D / (4.0 * dotNL * dotNV);\n \n vec3 geometryNormal = ng;\n PhysicalMaterial material;\n material.diffuseColor = diffuseColor;\n vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\n float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\n material.roughness = max( roughness, 0.0525 );\n material.roughness += geometryRoughness;\n material.roughness = min( material.roughness, 1.0 );\n material.specularColor = specularColor;\n material.specularF90 = 1.0;\n \n GeometricContext geometry;\n geometry.position = posEC;\n geometry.normal = n;\n geometry.viewDir = v;\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n reflectedLight.directDiffuse += dotNL * lightColorHdr * diffuseContribution;\n reflectedLight.directSpecular += dotNL * lightColorHdr * specularContribution;\n \n IncidentLight directLight; \n #include <lightSourceImpl>\n \n vec3 irradiance = vec3(0.0);\n vec3 radiance = vec3(0.0);\n \n#ifdef HAS_HEMISPHERE_LIGHTS\n HemisphereLight hemiLight;\n hemiLight.skyColor = uSkyColor[0];\n hemiLight.groundColor = uGroundColor[0];\n hemiLight.direction = normalize(czm_normal * vec3(0.0, 0.0, 1.0));\n irradiance += getHemisphereLightIrradiance( hemiLight, geometry );\n#endif\n\n#ifdef IBL\n\n#ifdef KtxEnvMap\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);\n vec3 cubeDir = normalize( yUpToZUp * fixedToENU * reflect(-v, n) );\n vec3 worldNormal = normalize( yUpToZUp * fixedToENU * n );\n irradiance += czm_sphericalHarmonics(worldNormal, czm_sphericalHarmonicCoefficients);\n radiance += czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n#else\n irradiance += getIBLIrradiance( geometry.normal );\n radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n#endif\n \n#else\n vec3 positionWC = vec3(czm_inverseView * vec4(posEC, 1.0));\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n \n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * czm_sunDirectionEC), normalize(positionWC * -1.0)), 0.001, 1.0);\n float S = acos(LdotZenith);\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n float sunNdotL = clamp(dot(n, czm_sunDirectionEC), 0.001, 1.0);\n float gamma = acos(sunNdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(sunNdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = 0.2 * (numerator / denominator);\n irradiance += diffuseIrradiance * luminance;\n radiance += specularIrradiance * luminance;\n#endif\n irradiance *= uEnvMapIntensity;\n radiance *= uEnvMapIntensity;\n\n indirectSpecular_Physical(radiance, irradiance, geometry, material, reflectedLight);\n\n#ifdef HAS_OCCLUSION_TEXTURE\n #ifdef USE_BatchPBR\n float ambientOcclusion = texture2DLodEXT(uOcclusionTexture, uv, mipmapLevel).r;\n #else\n float ambientOcclusion = texture2D(uOcclusionTexture, oriTexCoord.xy).r;\n #endif\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n#ifdef IBL\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n#endif\n#endif\n\nvec3 color = reflectedLight.directDiffuse + reflectedLight.directSpecular + reflectedLight.indirectDiffuse + reflectedLight.indirectSpecular;\n\n#ifdef HAS_EMISSIVE_TEXTURE\n emissiveTexCoord = emissiveTexCoord * uEmissiveUVOffsetAndTiling.zw + uEmissiveUVOffsetAndTiling.xy;\n vec3 emissive = texture2D(uEmissionTexture, emissiveTexCoord).rgb;\n emissive *= emissiveFactor.rgb;\n color += emissive;\n#else\n color += emissiveFactor.rgb;\n#endif\n\n color = applyTonemapping(color);\n color = LinearTosRGB(color);\n \n#ifdef MASK\n if (baseColorWithAlpha.a < uAlphaCutoff)\n {\n discard;\n }\n return vec4(color.rgb, 1.0);\n#endif\n return vec4(color.rgb, baseColorWithAlpha.a);\n}\n#endif\n",p$12="\n#ifdef SERVEREXCAVATION\nuniform sampler2D uServerExcavationTexture;\nuniform float uServerExcavationMode;\nuniform vec4 uServerExcavationRect;\nvarying vec4 vServerExcavationVertexPos;\nvec2 CalculateServerExcavationPolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect)\n{\n vec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\n vec2 texCoord = vec2(vertexPos.x - rectPos.x, vertexPos.y - rectPos.y);\n texCoord.x = texCoord.x / vecRatio.x;\n texCoord.y = texCoord.y / vecRatio.y;\n ptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\n texCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\n return texCoord;\n}\nbool executeServerExcavation()\n{\n float hasExcavation = 1.0;\n vec2 vecExcavationTexCoord = CalculateServerExcavationPolyTexCoord(vServerExcavationVertexPos, uServerExcavationRect, hasExcavation);\n bool excavationInside = (uServerExcavationMode < 0.5);\n if(hasExcavation < 0.1)\n {\n return !excavationInside;\n }\n if(excavationInside)\n {\n return texture2D(uServerExcavationTexture, vecExcavationTexCoord.xy).r > 0.5;\n }\n else\n {\n return texture2D(uServerExcavationTexture, vecExcavationTexCoord.xy).r < 0.5;\n }\n}\n#endif",h$V="\n #define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\t#ifdef WEBGL2\n\t\t#define texture2DGradEXT textureGrad \n\t#endif\n\n\t// These shader functions convert between the UV coordinates of a single face of\n\t// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n\t// sampling a textureCube (not generally normalized ).\n\n\tfloat getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\n\t// RH coordinate system; PMREM face-indexing convention\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\n\t}\n\n\t// These defines must match with PMREMGenerator\n\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\n\tfloat roughnessToMip( float roughness ) {\n\n\t\tfloat mip = 0.0;\n\n\t\tif ( roughness >= cubeUV_r1 ) {\n\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\n\t\t} else {\n\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness ); // 1.16 = 1.79^0.25\n\t\t}\n\n\t\treturn mip;\n\n\t}\n\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\n\t\tfloat mipF = fract( mip );\n\n\t\tfloat mipInt = floor( mip );\n\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\n\t\tif ( mipF == 0.0 ) {\n\n\t\t\treturn vec4( color0, 1.0 );\n\n\t\t} else {\n\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\n\t\t}\n\n\t}\n";const f$13={rainDecl:e$1T,snowDecl:r$14,hemisphereLightDecl:o$1f,pointLightDecl:t$R,spotLightDecl:i$X,directionLightDecl:c$14,lightSourceImpl:m$16,brdf:l$17,executeServerExcavationDecl:p$12,cubeUV_reflection:h$V};function O$M(e){return(e=e.replace(/\/\/.*/g,"")).replace(/\/\*\*[\s\S]*?\*\//gm,(function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r<t;++r)i+="\n";return i}))}function E$19(e,t,i){for(var r,n=0;n<i.length;++n)i[n].name===e&&(r=i[n]);return e$28(r)||(r={name:e,glslSource:t=O$M(t),dependsOn:[],requiredBy:[],evaluated:!1},i.push(r)),r}function A$1b(e,t){if(!e.evaluated){e.evaluated=!0;var i=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);e$28(i)&&null!==i&&(i=i.filter((function(e,t){return i.indexOf(e)===t})),i.forEach((function(i){if(i!==e.name&&a$$._czmBuiltinsAndUniforms.hasOwnProperty(i)){var r=E$19(i,a$$._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),A$1b(r,t)}})))}}function b$19(e){for(var t=[],i=[];e.length>0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<i.length;++u)0!==i[u].requiredBy.length&&l.push(i[u]);if(0!==l.length){for(var c="A circular dependency was found in the following built-in functions/structs/constants: \n",h=0;h<l.length;++h)c=c+l[h].name+"\n";throw new t$Z(c)}}function Q$11(e,t,i){var r=[],n=E$19("main",t,r);A$1b(n,r),b$19(r);for(var o="",a=r.length-1;a>=0;--a)P$13(i,e)&&(r[a].glslSource=T$X.removeUnuseMacroCode(i,e,r[a].glslSource)),o=o+r[a].glslSource+"\n";return o.replace(n.glslSource,"")}function P$13(e,t){return!(!e$28(e)||!e$28(t)||!e.shaderPreprocess)}function I$1m(e){return e.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(e,t){var i=f$13[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return I$1m(i)}))}function D$12(e,t,i){var r,n,o,a="",s=e.sources;if(e$28(s))for(r=0,n=s.length;r<n;++r)a+="\n#line 0\n"+s[r];a=(a=O$M(a)).replace(/#version\s+(.*?)\n/gm,(function(e,t){if(e$28(o)&&o!==t)throw new t$Z("inconsistent versions found: "+o+" and "+t);return o=t,"\n"}));var l=[];a=a.replace(/#extension.*\n/gm,(function(e){return l.push(e),"\n"})),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var u=e.pickColorQualifier;e$28(u)&&(a=a$$.createPickFragmentShaderSource(a,u));var c="";e$28(o)&&(c="#version "+o+"\n");var h=l.length;for(r=0;r<h;r++)c+=l[r];t&&(c+="#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n\n");var d=e.defines;if(e$28(d))for(r=0,n=d.length;r<n;++r){var f=d[r];0!==f.length&&(c+="#define "+f+"\n")}if(i.webgl2&&(c+="#define OUTPUT_DECLARATION\n\n",c+="#define WEBGL2\n\n",c+="#define texture2DLodEXT textureLod\n\n"),a=I$1m(a),i.textureFloatLinear&&(c+="#define OES_texture_float_linear\n\n"),P$13(i,e)&&(a=T$X.removeUnuseMacroCode(i,e,a)),e.includeBuiltIns){var p=Q$11(e,a,i);for(l.length=0,p=p.replace(/#extension.*\n/gm,(function(e){return l.push(e),"\n"})),h=l.length,r=0;r<h;r++)c=l[r]+c;c+=p}return c+="\n#line 0\n",c+=a,i.webgl2&&(c=S$V(c,t)),c}function a$$(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).pickColorQualifier;if(e$28(t)&&"uniform"!==t&&"varying"!==t)throw new t$Z("options.pickColorQualifier must be 'uniform' or 'varying'.");this.defines=e$28(e.defines)?e.defines.slice(0):[],this.sources=e$28(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=u$Y(e.includeBuiltIns,!0),this.name=e$28(e.name)?e.name:void 0}for(var w$Q in a$$.prototype.clone=function(){return new a$$({sources:this.sources,defines:this.defines,name:this.name,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},a$$.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},a$$.prototype.getCacheKey=function(e){const t=this.defines.slice().sort().join(","),i=this.pickColorQualifier||"";this.includeBuiltIns;return`${t}:${i}:${this.sources.join("\n")}`},a$$.prototype.createCombinedVertexShader=function(e){return D$12(this,!1,e)},a$$.prototype.createCombinedFragmentShader=function(e){return D$12(this,!0,e)},a$$._czmBuiltinsAndUniforms={},k$14)k$14.hasOwnProperty(w$Q)&&(a$$._czmBuiltinsAndUniforms[w$Q]=k$14[w$Q]);for(var v$M in s$T)if(s$T.hasOwnProperty(v$M)){var L$1d=s$T[v$M];"function"==typeof L$1d.getDeclaration&&(a$$._czmBuiltinsAndUniforms[v$M]=L$1d.getDeclaration(v$M))}a$$.createPickVertexShaderSource=function(e){return a$$.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"},a$$.createPickFragmentShaderSource=function(e,t){return a$$.replaceMain(e,"czm_old_main")+"\n"+(t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}")},a$$.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var o=t[n],a=i.length,s=0;s<a;++s)if(-1!==i[s].indexOf(o))return o};var x$17=["v_normalEC","v_normal","aNormal"];a$$.findNormalVarying=function(e){return a$$.findVarying(e,x$17)};var F$1a=["v_positionEC"],m$15,g$U,s$R;function l$16(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function e$1S(e,t,i,r){this.red=u$Y(e,1),this.green=u$Y(t,1),this.blue=u$Y(i,1),this.alpha=u$Y(r,1)}a$$.findPositionVarying=function(e){return a$$.findVarying(e,F$1a)},e$1S.fromCartesian4=function(e,t){return o$1u.typeOf.object("cartesian",e),e$28(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new e$1S(e.x,e.y,e.z,e.w)},e$1S.fromBytes=function(e,t,i,r,n){return e=e$1S.byteToFloat(u$Y(e,255)),t=e$1S.byteToFloat(u$Y(t,255)),i=e$1S.byteToFloat(u$Y(i,255)),r=e$1S.byteToFloat(u$Y(r,255)),e$28(n)?(n.red=e,n.green=t,n.blue=i,n.alpha=r,n):new e$1S(e,t,i,r)},e$1S.fromAlpha=function(e,t,i){return o$1u.typeOf.object("color",e),o$1u.typeOf.number("alpha",t),e$28(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new e$1S(e.red,e.green,e.blue,t)},s$V.supportsTypedArrays()&&(m$15=new ArrayBuffer(4),g$U=new Uint32Array(m$15),s$R=new Uint8Array(m$15)),e$1S.fromRgba=function(e,t){return g$U[0]=e,e$1S.fromBytes(s$R[0],s$R[1],s$R[2],s$R[3],t)},e$1S.byteToRgba=function(e,t,i,r){return s$R[0]=e,s$R[1]=t,s$R[2]=i,s$R[3]=r,g$U[0]},e$1S.fromHsl=function(e,t,i,r,n){e=u$Y(e,0)%1,t=u$Y(t,0),i=u$Y(i,0),r=u$Y(r,1);var o=i,a=i,s=i;if(0!==t){var l,u=2*i-(l=i<.5?i*(1+t):i+t-i*t);o=l$16(u,l,e+1/3),a=l$16(u,l,e),s=l$16(u,l,e-1/3)}return e$28(n)?(n.red=o,n.green=a,n.blue=s,n.alpha=r,n):new e$1S(o,a,s,r)},e$1S.fromRandom=function(e,t){var i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).red;if(!e$28(i)){var r=u$Y(e.minimumRed,0),n=u$Y(e.maximumRed,1);o$1u.typeOf.number.lessThanOrEquals("minimumRed",r,n),i=r+e$27.nextRandomNumber()*(n-r)}var o=e.green;if(!e$28(o)){var a=u$Y(e.minimumGreen,0),s=u$Y(e.maximumGreen,1);o$1u.typeOf.number.lessThanOrEquals("minimumGreen",a,s),o=a+e$27.nextRandomNumber()*(s-a)}var l=e.blue;if(!e$28(l)){var u=u$Y(e.minimumBlue,0),c=u$Y(e.maximumBlue,1);o$1u.typeOf.number.lessThanOrEquals("minimumBlue",u,c),l=u+e$27.nextRandomNumber()*(c-u)}var h=e.alpha;if(!e$28(h)){var d=u$Y(e.minimumAlpha,0),f=u$Y(e.maximumAlpha,1);o$1u.typeOf.number.lessThanOrEquals("minumumAlpha",d,f),h=d+e$27.nextRandomNumber()*(f-d)}return e$28(t)?(t.red=i,t.green=o,t.blue=l,t.alpha=h,t):new e$1S(i,o,l,h)};var R$W=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,L$1c=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,B$W=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,T$W=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;function O$L(e,t,i,r){switch(t.type){case e.FLOAT:return new d$1c(e,t,i,r);case e.FLOAT_VEC2:return new p$11(e,t,i,r);case e.FLOAT_VEC3:return new m$14(e,t,i,r);case e.FLOAT_VEC4:return new y$$(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f$12(e,t,i,r);case e.SAMPLER_2D_ARRAY:return new v$L(e,t,i,r);case e.INT:case e.BOOL:return new w$P(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new x$16(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new A$1a(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new T$V(e,t,i,r);case e.FLOAT_MAT2:return new U$12(e,t,i,r);case e.FLOAT_MAT3:return new E$18(e,t,i,r);case e.FLOAT_MAT4:return new M$15(e,t,i,r);default:throw new t$U("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function d$1c(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function p$11(e,t,i,r){this.name=i,this.value=void 0,this._value=new o$1k,this._gl=e,this._location=r}function m$14(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function y$$(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f$12(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function v$L(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0,this.lastBindTextureID=void 0}function w$P(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function x$16(e,t,i,r){this.name=i,this.value=void 0,this._value=new o$1k,this._gl=e,this._location=r}function A$1a(e,t,i,r){this.name=i,this.value=void 0,this._value=new t$X,this._gl=e,this._location=r}function T$V(e,t,i,r){this.name=i,this.value=void 0,this._value=new e$25,this._gl=e,this._location=r}e$1S.fromCssColorString=function(e,t){o$1u.typeOf.string("color",e),e$28(t)||(t=new e$1S);var i=e$1S[e.toUpperCase()];if(e$28(i))return e$1S.clone(i,t),t;var r=R$W.exec(e);return null!==r?(t.red=parseInt(r[1],16)/15,t.green=parseInt(r[2],16)/15,t.blue=parseInt(r[3],16)/15,t.alpha=1,t):null!==(r=L$1c.exec(e))?(t.red=parseInt(r[1],16)/255,t.green=parseInt(r[2],16)/255,t.blue=parseInt(r[3],16)/255,t.alpha=1,t):null!==(r=B$W.exec(e))?(t.red=parseFloat(r[1])/("%"===r[1].substr(-1)?100:255),t.green=parseFloat(r[2])/("%"===r[2].substr(-1)?100:255),t.blue=parseFloat(r[3])/("%"===r[3].substr(-1)?100:255),t.alpha=parseFloat(u$Y(r[4],"1.0")),t):null!==(r=T$W.exec(e))?e$1S.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(u$Y(r[4],"1.0")),t):t=void 0},e$1S.packedLength=4,e$1S.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.red,t[i++]=e.green,t[i++]=e.blue,t[i]=e.alpha,t},e$1S.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new e$1S),i.red=e[t++],i.green=e[t++],i.blue=e[t++],i.alpha=e[t],i},e$1S.byteToFloat=function(e){return e/255},e$1S.floatToByte=function(e){return 1===e?255:256*e|0},e$1S.clone=function(e,t){if(e$28(e))return e$28(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new e$1S(e.red,e.green,e.blue,e.alpha)},e$1S.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},e$1S.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},e$1S.prototype.clone=function(e){return e$1S.clone(this,e)},e$1S.prototype.equals=function(e){return e$1S.equals(this,e)},e$1S.prototype.equalsEpsilon=function(e,t){return this===e||e$28(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},e$1S.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},e$1S.prototype.toCssColorString=function(){var e=e$1S.floatToByte(this.red),t=e$1S.floatToByte(this.green),i=e$1S.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},e$1S.prototype.toCssHexString=function(){let e=e$1S.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=e$1S.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let i=e$1S.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e$1S.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${e}${t}${i}${r}`}return`#${e}${t}${i}`},e$1S.prototype.toBytes=function(e){var t=e$1S.floatToByte(this.red),i=e$1S.floatToByte(this.green),r=e$1S.floatToByte(this.blue),n=e$1S.floatToByte(this.alpha);return e$28(e)?(e[0]=t,e[1]=i,e[2]=r,e[3]=n,e):[t,i,r,n]},e$1S.prototype.toRgba=function(){return s$R[0]=e$1S.floatToByte(this.red),s$R[1]=e$1S.floatToByte(this.green),s$R[2]=e$1S.floatToByte(this.blue),s$R[3]=e$1S.floatToByte(this.alpha),g$U[0]},e$1S.prototype.brighten=function(e,t){return o$1u.typeOf.number("magnitude",e),o$1u.typeOf.number.greaterThanOrEquals("magnitude",e,0),o$1u.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},e$1S.prototype.darken=function(e,t){return o$1u.typeOf.number("magnitude",e),o$1u.typeOf.number.greaterThanOrEquals("magnitude",e,0),o$1u.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},e$1S.prototype.withAlpha=function(e,t){return e$1S.fromAlpha(this,e,t)},e$1S.add=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},e$1S.subtract=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},e$1S.multiply=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},e$1S.divide=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},e$1S.mod=function(e,t,i){return o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),o$1u.typeOf.object("result",i),i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},e$1S.lerp=function(e,t,i,r){return o$1u.typeOf.object("start",e),o$1u.typeOf.object("end",t),o$1u.typeOf.number("t",i),o$1u.typeOf.object("result",r),r.red=e$27.lerp(e.red,t.red,i),r.green=e$27.lerp(e.green,t.green,i),r.blue=e$27.lerp(e.blue,t.blue,i),r.alpha=e$27.lerp(e.alpha,t.alpha,i),r},e$1S.multiplyByScalar=function(e,t,i){return o$1u.typeOf.object("color",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},e$1S.divideByScalar=function(e,t,i){return o$1u.typeOf.object("color",e),o$1u.typeOf.number("scalar",t),o$1u.typeOf.object("result",i),i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},e$1S.ALICEBLUE=Object.freeze(e$1S.fromCssColorString("#F0F8FF")),e$1S.ANTIQUEWHITE=Object.freeze(e$1S.fromCssColorString("#FAEBD7")),e$1S.AQUA=Object.freeze(e$1S.fromCssColorString("#00FFFF")),e$1S.AQUAMARINE=Object.freeze(e$1S.fromCssColorString("#7FFFD4")),e$1S.AZURE=Object.freeze(e$1S.fromCssColorString("#F0FFFF")),e$1S.BEIGE=Object.freeze(e$1S.fromCssColorString("#F5F5DC")),e$1S.BISQUE=Object.freeze(e$1S.fromCssColorString("#FFE4C4")),e$1S.BLACK=Object.freeze(e$1S.fromCssColorString("#000000")),e$1S.BLANCHEDALMOND=Object.freeze(e$1S.fromCssColorString("#FFEBCD")),e$1S.BLUE=Object.freeze(e$1S.fromCssColorString("#0000FF")),e$1S.BLUEVIOLET=Object.freeze(e$1S.fromCssColorString("#8A2BE2")),e$1S.BROWN=Object.freeze(e$1S.fromCssColorString("#A52A2A")),e$1S.BURLYWOOD=Object.freeze(e$1S.fromCssColorString("#DEB887")),e$1S.CADETBLUE=Object.freeze(e$1S.fromCssColorString("#5F9EA0")),e$1S.CHARTREUSE=Object.freeze(e$1S.fromCssColorString("#7FFF00")),e$1S.CHOCOLATE=Object.freeze(e$1S.fromCssColorString("#D2691E")),e$1S.CORAL=Object.freeze(e$1S.fromCssColorString("#FF7F50")),e$1S.CORNFLOWERBLUE=Object.freeze(e$1S.fromCssColorString("#6495ED")),e$1S.CORNSILK=Object.freeze(e$1S.fromCssColorString("#FFF8DC")),e$1S.CRIMSON=Object.freeze(e$1S.fromCssColorString("#DC143C")),e$1S.CYAN=Object.freeze(e$1S.fromCssColorString("#00FFFF")),e$1S.DARKBLUE=Object.freeze(e$1S.fromCssColorString("#00008B")),e$1S.DARKCYAN=Object.freeze(e$1S.fromCssColorString("#008B8B")),e$1S.DARKGOLDENROD=Object.freeze(e$1S.fromCssColorString("#B8860B")),e$1S.DARKGRAY=Object.freeze(e$1S.fromCssColorString("#A9A9A9")),e$1S.DARKGREEN=Object.freeze(e$1S.fromCssColorString("#006400")),e$1S.DARKGREY=e$1S.DARKGRAY,e$1S.DARKKHAKI=Object.freeze(e$1S.fromCssColorString("#BDB76B")),e$1S.DARKMAGENTA=Object.freeze(e$1S.fromCssColorString("#8B008B")),e$1S.DARKOLIVEGREEN=Object.freeze(e$1S.fromCssColorString("#556B2F")),e$1S.DARKORANGE=Object.freeze(e$1S.fromCssColorString("#FF8C00")),e$1S.DARKORCHID=Object.freeze(e$1S.fromCssColorString("#9932CC")),e$1S.DARKRED=Object.freeze(e$1S.fromCssColorString("#8B0000")),e$1S.DARKSALMON=Object.freeze(e$1S.fromCssColorString("#E9967A")),e$1S.DARKSEAGREEN=Object.freeze(e$1S.fromCssColorString("#8FBC8F")),e$1S.DARKSLATEBLUE=Object.freeze(e$1S.fromCssColorString("#483D8B")),e$1S.DARKSLATEGRAY=Object.freeze(e$1S.fromCssColorString("#2F4F4F")),e$1S.DARKSLATEGREY=e$1S.DARKSLATEGRAY,e$1S.DARKTURQUOISE=Object.freeze(e$1S.fromCssColorString("#00CED1")),e$1S.DARKVIOLET=Object.freeze(e$1S.fromCssColorString("#9400D3")),e$1S.DEEPPINK=Object.freeze(e$1S.fromCssColorString("#FF1493")),e$1S.DEEPSKYBLUE=Object.freeze(e$1S.fromCssColorString("#00BFFF")),e$1S.DIMGRAY=Object.freeze(e$1S.fromCssColorString("#696969")),e$1S.DIMGREY=e$1S.DIMGRAY,e$1S.DODGERBLUE=Object.freeze(e$1S.fromCssColorString("#1E90FF")),e$1S.FIREBRICK=Object.freeze(e$1S.fromCssColorString("#B22222")),e$1S.FLORALWHITE=Object.freeze(e$1S.fromCssColorString("#FFFAF0")),e$1S.FORESTGREEN=Object.freeze(e$1S.fromCssColorString("#228B22")),e$1S.FUCHSIA=Object.freeze(e$1S.fromCssColorString("#FF00FF")),e$1S.GAINSBORO=Object.freeze(e$1S.fromCssColorString("#DCDCDC")),e$1S.GHOSTWHITE=Object.freeze(e$1S.fromCssColorString("#F8F8FF")),e$1S.GOLD=Object.freeze(e$1S.fromCssColorString("#FFD700")),e$1S.GOLDENROD=Object.freeze(e$1S.fromCssColorString("#DAA520")),e$1S.GRAY=Object.freeze(e$1S.fromCssColorString("#808080")),e$1S.GREEN=Object.freeze(e$1S.fromCssColorString("#008000")),e$1S.GREENYELLOW=Object.freeze(e$1S.fromCssColorString("#ADFF2F")),e$1S.GREY=e$1S.GRAY,e$1S.HONEYDEW=Object.freeze(e$1S.fromCssColorString("#F0FFF0")),e$1S.HOTPINK=Object.freeze(e$1S.fromCssColorString("#FF69B4")),e$1S.INDIANRED=Object.freeze(e$1S.fromCssColorString("#CD5C5C")),e$1S.INDIGO=Object.freeze(e$1S.fromCssColorString("#4B0082")),e$1S.IVORY=Object.freeze(e$1S.fromCssColorString("#FFFFF0")),e$1S.KHAKI=Object.freeze(e$1S.fromCssColorString("#F0E68C")),e$1S.LAVENDER=Object.freeze(e$1S.fromCssColorString("#E6E6FA")),e$1S.LAVENDAR_BLUSH=Object.freeze(e$1S.fromCssColorString("#FFF0F5")),e$1S.LAWNGREEN=Object.freeze(e$1S.fromCssColorString("#7CFC00")),e$1S.LEMONCHIFFON=Object.freeze(e$1S.fromCssColorString("#FFFACD")),e$1S.LIGHTBLUE=Object.freeze(e$1S.fromCssColorString("#ADD8E6")),e$1S.LIGHTCORAL=Object.freeze(e$1S.fromCssColorString("#F08080")),e$1S.LIGHTCYAN=Object.freeze(e$1S.fromCssColorString("#E0FFFF")),e$1S.LIGHTGOLDENRODYELLOW=Object.freeze(e$1S.fromCssColorString("#FAFAD2")),e$1S.LIGHTGRAY=Object.freeze(e$1S.fromCssColorString("#D3D3D3")),e$1S.LIGHTGREEN=Object.freeze(e$1S.fromCssColorString("#90EE90")),e$1S.LIGHTGREY=e$1S.LIGHTGRAY,e$1S.LIGHTPINK=Object.freeze(e$1S.fromCssColorString("#FFB6C1")),e$1S.LIGHTSEAGREEN=Object.freeze(e$1S.fromCssColorString("#20B2AA")),e$1S.LIGHTSKYBLUE=Object.freeze(e$1S.fromCssColorString("#87CEFA")),e$1S.LIGHTSLATEGRAY=Object.freeze(e$1S.fromCssColorString("#778899")),e$1S.LIGHTSLATEGREY=e$1S.LIGHTSLATEGRAY,e$1S.LIGHTSTEELBLUE=Object.freeze(e$1S.fromCssColorString("#B0C4DE")),e$1S.LIGHTYELLOW=Object.freeze(e$1S.fromCssColorString("#FFFFE0")),e$1S.LIME=Object.freeze(e$1S.fromCssColorString("#00FF00")),e$1S.LIMEGREEN=Object.freeze(e$1S.fromCssColorString("#32CD32")),e$1S.LINEN=Object.freeze(e$1S.fromCssColorString("#FAF0E6")),e$1S.MAGENTA=Object.freeze(e$1S.fromCssColorString("#FF00FF")),e$1S.MAROON=Object.freeze(e$1S.fromCssColorString("#800000")),e$1S.MEDIUMAQUAMARINE=Object.freeze(e$1S.fromCssColorString("#66CDAA")),e$1S.MEDIUMBLUE=Object.freeze(e$1S.fromCssColorString("#0000CD")),e$1S.MEDIUMORCHID=Object.freeze(e$1S.fromCssColorString("#BA55D3")),e$1S.MEDIUMPURPLE=Object.freeze(e$1S.fromCssColorString("#9370DB")),e$1S.MEDIUMSEAGREEN=Object.freeze(e$1S.fromCssColorString("#3CB371")),e$1S.MEDIUMSLATEBLUE=Object.freeze(e$1S.fromCssColorString("#7B68EE")),e$1S.MEDIUMSPRINGGREEN=Object.freeze(e$1S.fromCssColorString("#00FA9A")),e$1S.MEDIUMTURQUOISE=Object.freeze(e$1S.fromCssColorString("#48D1CC")),e$1S.MEDIUMVIOLETRED=Object.freeze(e$1S.fromCssColorString("#C71585")),e$1S.MIDNIGHTBLUE=Object.freeze(e$1S.fromCssColorString("#191970")),e$1S.MINTCREAM=Object.freeze(e$1S.fromCssColorString("#F5FFFA")),e$1S.MISTYROSE=Object.freeze(e$1S.fromCssColorString("#FFE4E1")),e$1S.MOCCASIN=Object.freeze(e$1S.fromCssColorString("#FFE4B5")),e$1S.NAVAJOWHITE=Object.freeze(e$1S.fromCssColorString("#FFDEAD")),e$1S.NAVY=Object.freeze(e$1S.fromCssColorString("#000080")),e$1S.OLDLACE=Object.freeze(e$1S.fromCssColorString("#FDF5E6")),e$1S.OLIVE=Object.freeze(e$1S.fromCssColorString("#808000")),e$1S.OLIVEDRAB=Object.freeze(e$1S.fromCssColorString("#6B8E23")),e$1S.ORANGE=Object.freeze(e$1S.fromCssColorString("#FFA500")),e$1S.ORANGERED=Object.freeze(e$1S.fromCssColorString("#FF4500")),e$1S.ORCHID=Object.freeze(e$1S.fromCssColorString("#DA70D6")),e$1S.PALEGOLDENROD=Object.freeze(e$1S.fromCssColorString("#EEE8AA")),e$1S.PALEGREEN=Object.freeze(e$1S.fromCssColorString("#98FB98")),e$1S.PALETURQUOISE=Object.freeze(e$1S.fromCssColorString("#AFEEEE")),e$1S.PALEVIOLETRED=Object.freeze(e$1S.fromCssColorString("#DB7093")),e$1S.PAPAYAWHIP=Object.freeze(e$1S.fromCssColorString("#FFEFD5")),e$1S.PEACHPUFF=Object.freeze(e$1S.fromCssColorString("#FFDAB9")),e$1S.PERU=Object.freeze(e$1S.fromCssColorString("#CD853F")),e$1S.PINK=Object.freeze(e$1S.fromCssColorString("#FFC0CB")),e$1S.PLUM=Object.freeze(e$1S.fromCssColorString("#DDA0DD")),e$1S.POWDERBLUE=Object.freeze(e$1S.fromCssColorString("#B0E0E6")),e$1S.PURPLE=Object.freeze(e$1S.fromCssColorString("#800080")),e$1S.RED=Object.freeze(e$1S.fromCssColorString("#FF0000")),e$1S.ROSYBROWN=Object.freeze(e$1S.fromCssColorString("#BC8F8F")),e$1S.ROYALBLUE=Object.freeze(e$1S.fromCssColorString("#4169E1")),e$1S.SADDLEBROWN=Object.freeze(e$1S.fromCssColorString("#8B4513")),e$1S.SALMON=Object.freeze(e$1S.fromCssColorString("#FA8072")),e$1S.SANDYBROWN=Object.freeze(e$1S.fromCssColorString("#F4A460")),e$1S.SEAGREEN=Object.freeze(e$1S.fromCssColorString("#2E8B57")),e$1S.SEASHELL=Object.freeze(e$1S.fromCssColorString("#FFF5EE")),e$1S.SIENNA=Object.freeze(e$1S.fromCssColorString("#A0522D")),e$1S.SILVER=Object.freeze(e$1S.fromCssColorString("#C0C0C0")),e$1S.SKYBLUE=Object.freeze(e$1S.fromCssColorString("#87CEEB")),e$1S.SLATEBLUE=Object.freeze(e$1S.fromCssColorString("#6A5ACD")),e$1S.SLATEGRAY=Object.freeze(e$1S.fromCssColorString("#708090")),e$1S.SLATEGREY=e$1S.SLATEGRAY,e$1S.SNOW=Object.freeze(e$1S.fromCssColorString("#FFFAFA")),e$1S.SPRINGGREEN=Object.freeze(e$1S.fromCssColorString("#00FF7F")),e$1S.STEELBLUE=Object.freeze(e$1S.fromCssColorString("#4682B4")),e$1S.TAN=Object.freeze(e$1S.fromCssColorString("#D2B48C")),e$1S.TEAL=Object.freeze(e$1S.fromCssColorString("#008080")),e$1S.THISTLE=Object.freeze(e$1S.fromCssColorString("#D8BFD8")),e$1S.TOMATO=Object.freeze(e$1S.fromCssColorString("#FF6347")),e$1S.TURQUOISE=Object.freeze(e$1S.fromCssColorString("#40E0D0")),e$1S.VIOLET=Object.freeze(e$1S.fromCssColorString("#EE82EE")),e$1S.WHEAT=Object.freeze(e$1S.fromCssColorString("#F5DEB3")),e$1S.WHITE=Object.freeze(e$1S.fromCssColorString("#FFFFFF")),e$1S.WHITESMOKE=Object.freeze(e$1S.fromCssColorString("#F5F5F5")),e$1S.YELLOW=Object.freeze(e$1S.fromCssColorString("#FFFF00")),e$1S.YELLOWGREEN=Object.freeze(e$1S.fromCssColorString("#9ACD32")),e$1S.TRANSPARENT=Object.freeze(new e$1S(0,0,0,0)),d$1c.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},p$11.prototype.set=function(){var e=this.value;o$1k.equals(e,this._value)||(o$1k.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))},m$14.prototype.set=function(){var e=this.value;if(e$28(e.red))e$1S.equals(e,this._value)||(this._value=e$1S.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else{if(!e$28(e.x))throw new t$Z('Invalid vec3 value for uniform "'+this.name+'".');t$X.equals(e,this._value)||(this._value=t$X.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))}},y$$.prototype.set=function(){var e=this.value;if(e$28(e.red))e$1S.equals(e,this._value)||(this._value=e$1S.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else{if(!e$28(e.x))throw new t$Z('Invalid vec4 value for uniform "'+this.name+'".');e$25.equals(e,this._value)||(this._value=e$25.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w))}},f$12.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},f$12.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},v$L.prototype.set=function(){var e=this.value;if(!e$28(e.id)||this.lastBindTextureID!==e.id){var t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex),t.bindTexture(e._target,e._texture),this.lastBindTextureID=e.id}},v$L.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},w$P.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},x$16.prototype.set=function(){var e=this.value;o$1k.equals(e,this._value)||(o$1k.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))},A$1a.prototype.set=function(){var e=this.value;t$X.equals(e,this._value)||(t$X.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},T$V.prototype.set=function(){var e=this.value;e$25.equals(e,this._value)||(e$25.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var V$U=new Float32Array(4);function U$12(e,t,i,r){this.name=i,this.value=void 0,this._value=new f$15,this._gl=e,this._location=r}U$12.prototype.set=function(){if(!f$15.equalsArray(this.value,this._value,0)){f$15.clone(this.value,this._value);var e=f$15.toArray(this.value,V$U);this._gl.uniformMatrix2fv(this._location,!1,e)}};var C$Z=new Float32Array(9);function E$18(e,t,i,r){this.name=i,this.value=void 0,this._value=new p$1a,this._gl=e,this._location=r}E$18.prototype.set=function(){if(!p$1a.equalsArray(this.value,this._value,0)){p$1a.clone(this.value,this._value);var e=p$1a.toArray(this.value,C$Z);this._gl.uniformMatrix3fv(this._location,!1,e)}};var F$19=new Float32Array(16);function M$15(e,t,i,r){this.name=i,this.value=void 0,this._value=new y$15,this._gl=e,this._location=r}function V$T(e,t,i,r){switch(t.type){case e.FLOAT:return new A$19(e,t,i,r);case e.FLOAT_VEC2:return new p$10(e,t,i,r);case e.FLOAT_VEC3:return new w$O(e,t,i,r);case e.FLOAT_VEC4:return new m$13(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f$11(e,t,i,r);case e.INT:case e.BOOL:return new d$1b(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new F$18(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new T$U(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new U$11(e,t,i,r);case e.FLOAT_MAT2:return new x$15(e,t,i,r);case e.FLOAT_MAT3:return new E$17(e,t,i,r);case e.FLOAT_MAT4:return new I$1l(e,t,i,r);default:throw new t$U("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function A$19(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function p$10(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function w$O(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function m$13(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function f$11(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function d$1b(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function F$18(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function T$U(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function U$11(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function x$15(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function E$17(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function I$1l(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}M$15.prototype.set=function(){if(!y$15.equalsArray(this.value,this._value,0)){y$15.clone(this.value,this._value);var e=y$15.toArray(this.value,F$19);this._gl.uniformMatrix4fv(this._location,!1,e)}},A$19.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},p$10.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];o$1k.equalsArray(a,i,n)||(o$1k.pack(a,i,n),r=!0),n+=2}r&&this._gl.uniform2fv(this._location,i)},w$O.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];if(e$28(a.red))(a.red!==i[n]||a.green!==i[n+1]||a.blue!==i[n+2])&&(i[n]=a.red,i[n+1]=a.green,i[n+2]=a.blue,r=!0);else{if(!e$28(a.x))throw new t$Z("Invalid vec3 value.");t$X.equalsArray(a,i,n)||(t$X.pack(a,i,n),r=!0)}n+=3}r&&this._gl.uniform3fv(this._location,i)},m$13.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];if(e$28(a.red))e$1S.equalsArray(a,i,n)||(e$1S.pack(a,i,n),r=!0);else{if(!e$28(a.x))throw new t$Z("Invalid vec4 value.");e$25.equalsArray(a,i,n)||(e$25.pack(a,i,n),r=!0)}n+=4}r&&this._gl.uniform4fv(this._location,i)},f$11.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;n<r;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},f$11.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;r<i;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},d$1b.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},F$18.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];o$1k.equalsArray(a,i,n)||(o$1k.pack(a,i,n),r=!0),n+=2}r&&this._gl.uniform2iv(this._location,i)},T$U.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];t$X.equalsArray(a,i,n)||(t$X.pack(a,i,n),r=!0),n+=3}r&&this._gl.uniform3iv(this._location,i)},U$11.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];e$25.equalsArray(a,i,n)||(e$25.pack(a,i,n),r=!0),n+=4}r&&this._gl.uniform4iv(this._location,i)},x$15.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];f$15.equalsArray(a,i,n)||(f$15.pack(a,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},E$17.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];p$1a.equalsArray(a,i,n)||(p$1a.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},I$1l.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];y$15.equalsArray(a,i,n)||(y$15.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)};var V$S=0;function S$T(e){var t=w$N(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._varyings=e.varyings,this._bufferMode=e.bufferMode,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this._uniformBlockLocation={},this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=V$S++}function A$18(e){var t=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(e$28(i))for(var r=i.length,n=0;n<r;n++){var o=i[n].trim(),a=o.slice(o.lastIndexOf(" ")+1);t.push(a)}return t}function w$N(e,t){var i={};if(!e$1U.highpFloatSupported||!e$1U.highpIntSupported){var r,n,o,a,s=A$18(e),l=A$18(t),u=s.length,c=l.length;for(r=0;r<u;r++)for(n=0;n<c;n++)if(s[r]===l[n]){a="czm_mediump_"+(o=s[r]);var h=new RegExp(o+"\\b","g");t=t.replace(h,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}S$T.fromCache=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)},S$T.replaceCache=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)},Object.defineProperties(S$T.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return x$14(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return x$14(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return x$14(this),this._uniformsByName}}});var v$K="[Cesium WebGL] ";function B$V(e,t){var i=t._vertexShaderText,r=t._fragmentShaderText,n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,i),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,r),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o),e.deleteShader(n),e.deleteShader(o);var s=t._attributeLocations;if(e$28(s))for(var l in s)s.hasOwnProperty(l)&&e.bindAttribLocation(a,s[l],l);var u,c=t._varyings,h=t._bufferMode;if(e$28(c)&&e$28(h)&&e.transformFeedbackVaryings(a,c,h),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS)){var d=t._debugShaders;if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(u=e.getShaderInfoLog(o),console.error(v$K+"Fragment shader compile log: "+u),e$28(d)){var f=d.getTranslatedShaderSource(o);console.error(""!==f?v$K+"Translated fragment shader source:\n"+f:v$K+"Fragment shader translation failed.")}throw e.deleteProgram(a),new t$U("Fragment shader failed to compile. Compile log: "+u)}if(!e.getShaderParameter(n,e.COMPILE_STATUS)){if(u=e.getShaderInfoLog(n),console.error(v$K+"Vertex shader compile log: "+u),e$28(d)){var p=d.getTranslatedShaderSource(n);console.error(""!==p?v$K+"Translated vertex shader source:\n"+p:v$K+"Vertex shader translation failed.")}throw e.deleteProgram(a),new t$U("Vertex shader failed to compile. Compile log: "+u)}throw u=e.getProgramInfoLog(a),console.error(v$K+"Shader program link log: "+u),e$28(d)&&(console.error(v$K+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(n)),console.error(v$K+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(o))),e.deleteProgram(a),new t$U("Program failed to link. Link log: "+u)}var _=t._logShaderCompilation;return _&&(e$28(u=e.getShaderInfoLog(n))&&u.length>0&&console.log(v$K+"Vertex shader compile log: "+u)),_&&(e$28(u=e.getShaderInfoLog(o))&&u.length>0&&console.log(v$K+"Fragment shader compile log: "+u)),_&&(e$28(u=e.getProgramInfoLog(a))&&u.length>0&&console.log(v$K+"Shader program link log: "+u)),a}function M$14(e,t,i){for(var r={},n=0;n<i;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function F$17(e,t){for(var i={},r=[],n=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),a=0;a<o;++a){var s=e.getActiveUniform(t,a),l=-1!==s.name.indexOf("[0]",s.name.length-"[0]".length)?s.name.slice(0,s.name.length-3):s.name;if(0!==l.indexOf("gl_"))if(s.name.indexOf("[")<0){var u=e.getUniformLocation(t,l);if(null!==u){var c=O$L(e,s,l,u);i[l]=c,r.push(c),c._setSampler&&n.push(c)}}else{var h,d,f,p,_=l.indexOf("[");if(_>=0){if(!e$28(h=i[l.slice(0,_)]))continue;(d=h._locations).length<=1&&(f=h.value,null!==(p=e.getUniformLocation(t,l))&&(d.push(p),f.push(e.getUniform(t,p))))}else{d=[];for(var m=0;m<s.size;++m)null!==(p=e.getUniformLocation(t,l+"["+m+"]"))&&d.push(p);h=V$T(e,s,l,d),i[l]=h,r.push(h),h._setSampler&&n.push(h)}}}return{uniformsByName:i,uniforms:r,samplerUniforms:n}}function k$13(e,t){var i=[],r=[];for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=n,s=e._duplicateUniformNames[a];e$28(s)&&(o.name=s,a=s);var l=s$T[a];e$28(l)?i.push({uniform:o,automaticUniform:l}):r.push(o)}return{automaticUniforms:i,manualUniforms:r}}function R$V(e,t,i){e.useProgram(t);for(var r=0,n=i.length,o=0;o<n;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function x$14(e){if(!e$28(e._program)){var t=e._gl,i=B$V(t,e,e._debugShaders),r=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES),n=F$17(t,i),o=k$13(e,n.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=M$14(t,i,r),e._uniformsByName=n.uniformsByName,e._uniforms=n.uniforms,e._automaticUniforms=o.automaticUniforms,e._manualUniforms=o.manualUniforms,e.maximumTextureUnitIndex=R$V(t,i,n.samplerUniforms)}}S$T.prototype._bind=function(){x$14(this),this._gl.useProgram(this._program)},S$T.prototype._setUniforms=function(e,t,i){var r,n;if(e$28(e)){var o=this._manualUniforms;for(r=o.length,n=0;n<r;++n){var a=o[n];a.value=e[a.name]()}}var s=this._automaticUniforms;for(r=s.length,n=0;n<r;++n){var l=s[n];l.uniform.value=l.automaticUniform.getValue(t)}var u=this._uniforms;for(r=u.length,n=0;n<r;++n)u[n].set();if(i){var c=this._gl,h=this._program;if(c.validateProgram(h),!c.getProgramParameter(h,c.VALIDATE_STATUS))throw new t$Z("Program validation failed. Program info log: "+c.getProgramInfoLog(h))}},S$T.prototype.isDestroyed=function(){return!1},S$T.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},S$T.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),i$Z(this)};var A$17={ADD:de$y.FUNC_ADD,SUBTRACT:de$y.FUNC_SUBTRACT,REVERSE_SUBTRACT:de$y.FUNC_REVERSE_SUBTRACT,MIN:de$y.MIN,MAX:de$y.MAX},b$18=Object.freeze(A$17),_$Z={ZERO:de$y.ZERO,ONE:de$y.ONE,SOURCE_COLOR:de$y.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:de$y.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:de$y.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:de$y.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:de$y.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:de$y.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:de$y.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:de$y.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:de$y.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:de$y.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:de$y.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:de$y.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:de$y.SRC_ALPHA_SATURATE},l$15=Object.freeze(_$Z),t$Q={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.SOURCE_ALPHA,functionSourceAlpha:l$15.ONE,functionDestinationRgb:l$15.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:l$15.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.ONE,functionSourceAlpha:l$15.ONE,functionDestinationRgb:l$15.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:l$15.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.SOURCE_ALPHA,functionSourceAlpha:l$15.ONE,functionDestinationRgb:l$15.ONE,functionDestinationAlpha:l$15.ONE})},Ee$n=Object.freeze(t$Q);function f$10(e,t,i,r){this.x=u$Y(e,0),this.y=u$Y(t,0),this.width=u$Y(i,0),this.height=u$Y(r,0)}f$10.packedLength=4,f$10.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.width,t[i]=e.height,t},f$10.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new f$10),i.x=e[t++],i.y=e[t++],i.width=e[t++],i.height=e[t],i},f$10.fromPoints=function(e,t){if(e$28(t)||(t=new f$10),!e$28(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,r=e[0].x,n=e[0].y,o=e[0].x,a=e[0].y,s=1;s<i;s++){var l=e[s],u=l.x,c=l.y;r=Math.min(u,r),o=Math.max(u,o),n=Math.min(c,n),a=Math.max(c,a)}return t.x=r,t.y=n,t.width=o-r,t.height=a-n,t};var O$K=new n$1b,g$T=new t$W,r$13=new t$W;function c$13(e){if("object"!=typeof e||null===e)return e;for(var t,i=Object.keys(e),r=0;r<i.length;r++)t=i[r],e.hasOwnProperty(t)&&"_applyFunctions"!==t&&(e[t]=c$13(e[t]));return Object.freeze(e)}function L$1b(e){return e===de$y.FUNC_ADD||e===de$y.FUNC_SUBTRACT||e===de$y.FUNC_REVERSE_SUBTRACT||e===de$y.MIN||e===de$y.MAX}function k$12(e){return e===de$y.ZERO||e===de$y.ONE||e===de$y.SRC_COLOR||e===de$y.ONE_MINUS_SRC_COLOR||e===de$y.DST_COLOR||e===de$y.ONE_MINUS_DST_COLOR||e===de$y.SRC_ALPHA||e===de$y.ONE_MINUS_SRC_ALPHA||e===de$y.DST_ALPHA||e===de$y.ONE_MINUS_DST_ALPHA||e===de$y.CONSTANT_COLOR||e===de$y.ONE_MINUS_CONSTANT_COLOR||e===de$y.CONSTANT_ALPHA||e===de$y.ONE_MINUS_CONSTANT_ALPHA||e===de$y.SRC_ALPHA_SATURATE}function Y$O(e){return e===de$y.FRONT||e===de$y.BACK||e===de$y.FRONT_AND_BACK}function J$11(e){return e===de$y.NEVER||e===de$y.LESS||e===de$y.EQUAL||e===de$y.LEQUAL||e===de$y.GREATER||e===de$y.NOTEQUAL||e===de$y.GEQUAL||e===de$y.ALWAYS}function M$13(e){return e===de$y.NEVER||e===de$y.LESS||e===de$y.EQUAL||e===de$y.LEQUAL||e===de$y.GREATER||e===de$y.NOTEQUAL||e===de$y.GEQUAL||e===de$y.ALWAYS}function R$U(e){return e===de$y.ZERO||e===de$y.KEEP||e===de$y.REPLACE||e===de$y.INCR||e===de$y.DECR||e===de$y.INVERT||e===de$y.INCR_WRAP||e===de$y.DECR_WRAP}function u$R(e){var t=u$Y(e,{}),i=u$Y(t.cull,{}),r=u$Y(t.polygonOffset,{}),n=u$Y(t.scissorTest,{}),o=u$Y(n.rectangle,{}),a=u$Y(t.depthRange,{}),s=u$Y(t.depthTest,{}),l=u$Y(t.colorMask,{}),u=u$Y(t.blending,{}),c=u$Y(u.color,{}),h=u$Y(t.stencilTest,{}),d=u$Y(h.frontOperation,{}),f=u$Y(h.backOperation,{}),p=u$Y(t.sampleCoverage,{}),_=t.viewport;if(this.frontFace=u$Y(t.frontFace,_0x4a48d8.COUNTER_CLOCKWISE),this.cull={enabled:u$Y(i.enabled,!1),face:u$Y(i.face,de$y.BACK)},this.lineWidth=u$Y(t.lineWidth,1),this.polygonOffset={enabled:u$Y(r.enabled,!1),factor:u$Y(r.factor,0),units:u$Y(r.units,0)},this.scissorTest={enabled:u$Y(n.enabled,!1),rectangle:f$10.clone(o)},this.depthRange={near:u$Y(a.near,0),far:u$Y(a.far,1)},this.depthTest={enabled:u$Y(s.enabled,!1),func:u$Y(s.func,de$y.LESS)},this.colorMask={red:u$Y(l.red,!0),green:u$Y(l.green,!0),blue:u$Y(l.blue,!0),alpha:u$Y(l.alpha,!0)},this.depthMask=u$Y(t.depthMask,!0),this.stencilMask=u$Y(t.stencilMask,-1),this.blending={enabled:u$Y(u.enabled,!1),color:new e$1S(u$Y(c.red,0),u$Y(c.green,0),u$Y(c.blue,0),u$Y(c.alpha,0)),equationRgb:u$Y(u.equationRgb,de$y.FUNC_ADD),equationAlpha:u$Y(u.equationAlpha,de$y.FUNC_ADD),functionSourceRgb:u$Y(u.functionSourceRgb,de$y.ONE),functionSourceAlpha:u$Y(u.functionSourceAlpha,de$y.ONE),functionDestinationRgb:u$Y(u.functionDestinationRgb,de$y.ZERO),functionDestinationAlpha:u$Y(u.functionDestinationAlpha,de$y.ZERO)},this.stencilTest={enabled:u$Y(h.enabled,!1),frontFunction:u$Y(h.frontFunction,de$y.ALWAYS),backFunction:u$Y(h.backFunction,de$y.ALWAYS),reference:u$Y(h.reference,0),mask:u$Y(h.mask,-1),frontOperation:{fail:u$Y(d.fail,de$y.KEEP),zFail:u$Y(d.zFail,de$y.KEEP),zPass:u$Y(d.zPass,de$y.KEEP)},backOperation:{fail:u$Y(f.fail,de$y.KEEP),zFail:u$Y(f.zFail,de$y.KEEP),zPass:u$Y(f.zPass,de$y.KEEP)}},this.sampleCoverage={enabled:u$Y(p.enabled,!1),value:u$Y(p.value,1),invert:u$Y(p.invert,!1)},this.viewport=e$28(_)?new f$10(_.x,_.y,_.width,_.height):void 0,this.lineWidth<e$1U.minimumAliasedLineWidth||this.lineWidth>e$1U.maximumAliasedLineWidth)throw new t$Z("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!_0x4a48d8.validate(this.frontFace))throw new t$Z("Invalid renderState.frontFace.");if(!Y$O(this.cull.face))throw new t$Z("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new t$Z("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new t$Z("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new t$Z("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new t$Z("renderState.depthRange.far must be less than or equal to one.");if(!J$11(this.depthTest.func))throw new t$Z("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new t$Z("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!L$1b(this.blending.equationRgb))throw new t$Z("Invalid renderState.blending.equationRgb.");if(!L$1b(this.blending.equationAlpha))throw new t$Z("Invalid renderState.blending.equationAlpha.");if(!k$12(this.blending.functionSourceRgb))throw new t$Z("Invalid renderState.blending.functionSourceRgb.");if(!k$12(this.blending.functionSourceAlpha))throw new t$Z("Invalid renderState.blending.functionSourceAlpha.");if(!k$12(this.blending.functionDestinationRgb))throw new t$Z("Invalid renderState.blending.functionDestinationRgb.");if(!k$12(this.blending.functionDestinationAlpha))throw new t$Z("Invalid renderState.blending.functionDestinationAlpha.");if(!M$13(this.stencilTest.frontFunction))throw new t$Z("Invalid renderState.stencilTest.frontFunction.");if(!M$13(this.stencilTest.backFunction))throw new t$Z("Invalid renderState.stencilTest.backFunction.");if(!R$U(this.stencilTest.frontOperation.fail))throw new t$Z("Invalid renderState.stencilTest.frontOperation.fail.");if(!R$U(this.stencilTest.frontOperation.zFail))throw new t$Z("Invalid renderState.stencilTest.frontOperation.zFail.");if(!R$U(this.stencilTest.frontOperation.zPass))throw new t$Z("Invalid renderState.stencilTest.frontOperation.zPass.");if(!R$U(this.stencilTest.backOperation.fail))throw new t$Z("Invalid renderState.stencilTest.backOperation.fail.");if(!R$U(this.stencilTest.backOperation.zFail))throw new t$Z("Invalid renderState.stencilTest.backOperation.zFail.");if(!R$U(this.stencilTest.backOperation.zPass))throw new t$Z("Invalid renderState.stencilTest.backOperation.zPass.");if(e$28(this.viewport)){if(this.viewport.width<0)throw new t$Z("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new t$Z("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>e$1U.maximumViewportWidth)throw new t$Z("renderState.viewport.width must be less than or equal to the maximum viewport width ("+e$1U.maximumViewportWidth.toString()+"). Check maximumViewportWidth.");if(this.viewport.height>e$1U.maximumViewportHeight)throw new t$Z("renderState.viewport.height must be less than or equal to the maximum viewport height ("+e$1U.maximumViewportHeight.toString()+"). Check maximumViewportHeight.")}this.id=0,this._applyFunctions=[]}f$10.fromRectangle=function(e,t,i){if(e$28(i)||(i=new f$10),!e$28(e))return i.x=0,i.y=0,i.width=0,i.height=0,i;var r=(t=u$Y(t,O$K)).project(h$10.southwest(e,g$T)),n=t.project(h$10.northeast(e,r$13));return o$1k.subtract(n,r,n),i.x=r.x,i.y=r.y,i.width=n.x,i.height=n.y,i},f$10.clone=function(e,t){if(e$28(e))return e$28(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new f$10(e.x,e.y,e.width,e.height)},f$10.union=function(e,t,i){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t),e$28(i)||(i=new f$10);var r=Math.min(e.x,t.x),n=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),a=Math.max(e.y+e.height,t.y+t.height);return i.x=r,i.y=n,i.width=o-r,i.height=a-n,i},f$10.expand=function(e,t,i){o$1u.typeOf.object("rectangle",e),o$1u.typeOf.object("point",t),i=f$10.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},f$10.intersect=function(e,t){o$1u.typeOf.object("left",e),o$1u.typeOf.object("right",t);var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?pt$a.OUTSIDE:pt$a.INTERSECTING},f$10.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},f$10.prototype.clone=function(e){return f$10.clone(this,e)},f$10.prototype.intersect=function(e){return f$10.intersect(this,e)},f$10.prototype.equals=function(e){return f$10.equals(this,e)};var Z$11=0,b$17={};function C$Y(e,t,i){i?e.enable(t):e.disable(t)}function _$Y(e,t){e.frontFace(t.frontFace)}function F$16(e,t){var i=t.cull,r=i.enabled;C$Y(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function z$S(e,t){e.lineWidth(t.lineWidth)}function D$11(e,t){var i=t.polygonOffset,r=i.enabled;C$Y(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function I$1k(e,t,i){var r=t.scissorTest,n=e$28(i.scissorTest)?i.scissorTest.enabled:r.enabled;if(C$Y(e,e.SCISSOR_TEST,n),n){var o=e$28(i.scissorTest)?i.scissorTest.rectangle:r.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function P$12(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function W$Y(e,t){var i=t.depthTest,r=i.enabled;C$Y(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function U$10(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function q$14(e,t){e.depthMask(t.depthMask)}function B$U(e,t){e.stencilMask(t.stencilMask)}function X$T(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function K$U(e,t,i){var r=t.blending,n=e$28(i.blendingEnabled)?i.blendingEnabled:r.enabled;C$Y(e,e.BLEND,n),n&&(X$T(e,r.color),e.blendEquationSeparate(r.equationRgb,r.equationAlpha),e.blendFuncSeparate(r.functionSourceRgb,r.functionDestinationRgb,r.functionSourceAlpha,r.functionDestinationAlpha))}function V$R(e,t){var i=t.stencilTest,r=i.enabled;if(C$Y(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,u=l.fail,c=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,c,h);var d=i.backOperation,f=d.fail,p=d.zFail,_=d.zPass;e.stencilOpSeparate(e.BACK,f,p,_)}}function H$X(e,t){var i=t.sampleCoverage,r=i.enabled;C$Y(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}u$R.fromCache=function(e){var t=JSON.stringify(e),i=b$17[t];if(e$28(i))return++i.referenceCount,i.state;var r=new u$R(e),n=JSON.stringify(r);return e$28(i=b$17[n])||(r.id=Z$11++,i={referenceCount:0,state:r=c$13(r)},b$17[n]=i),++i.referenceCount,b$17[t]={referenceCount:1,state:i.state},i.state},u$R.removeFromCache=function(e){var t=new u$R(e),i=JSON.stringify(t),r=b$17[i],n=JSON.stringify(e),o=b$17[n];e$28(o)&&(--o.referenceCount,0===o.referenceCount&&(delete b$17[n],e$28(r)&&--r.referenceCount)),e$28(r)&&0===r.referenceCount&&delete b$17[i]},u$R.getCache=function(){return b$17},u$R.clearCache=function(){b$17={}};var j$18=new f$10;function Q$10(e,t,i){var r=u$Y(t.viewport,i.viewport);e$28(r)||((r=j$18).width=i.context.drawingBufferWidth,r.height=i.context.drawingBufferHeight),i.context.uniformState.viewport=r,e.viewport(r.x,r.y,r.width,r.height)}function $$X(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(_$Y),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&i.push(F$16),e.lineWidth!==t.lineWidth&&i.push(z$S),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&i.push(D$11),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&i.push(P$12),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&i.push(W$Y),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&i.push(U$10),e.depthMask!==t.depthMask&&i.push(q$14),e.stencilMask!==t.stencilMask&&i.push(B$U),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&i.push(V$R),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&i.push(H$X),i}u$R.apply=function(e,t,i){_$Y(e,t),F$16(e,t),z$S(e,t),D$11(e,t),P$12(e,t),W$Y(e,t),U$10(e,t),q$14(e,t),B$U(e,t),V$R(e,t),H$X(e,t),I$1k(e,t,i),K$U(e,t,i),Q$10(e,t,i)},u$R.partialApply=function(e,t,i,r,n,o,a,s){if(t!==i){var l=i._applyFunctions[t.id];e$28(l)||(l=$$X(t,i),i._applyFunctions[t.id]=l);for(var u=l.length,c=0;c<u;++c)l[c](e,i)}((e$28(r.scissorTest)?r.scissorTest:t.scissorTest)!==(e$28(n.scissorTest)?n.scissorTest:i.scissorTest)||s)&&I$1k(e,i,n);var h=e$28(r.blendingEnabled)?r.blendingEnabled:t.blending.enabled,d=e$28(n.blendingEnabled)?n.blendingEnabled:i.blending.enabled;(h!==d||d&&t.blending!==i.blending)&&K$U(e,i,n),(t!==i||r!==n||r.context!==n.context||o!==a)&&Q$10(e,i,n)},u$R.getState=function(e){if(!e$28(e))throw new t$Z("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:f$10.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:e$1S.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:e$28(e.viewport)?f$10.clone(e.viewport):void 0}};var E$16={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,S3MTiles:8,S3MTilesClampObjectStencil:9,S3MTilesClampObjectColor:10,ProjectionImage:11,OPAQUE:12,ClampObject:13,NonClampObject:14,Label_Billboard:15,Voxel_Billboard:16,Particle:17,TRANSLUCENT:18,ANALYSIS:19,LOG_DEPTH_OVERLAY:20,OVERLAY:21,OVERLAY_AGAINST_DEPTH:22,NUMBER_OF_PASSES:23},Le$p=Object.freeze(E$16),t$P={FRONT:de$y.FRONT,BACK:de$y.BACK,FRONT_AND_BACK:de$y.FRONT_AND_BACK},k$11=Object.freeze(t$P),A$16={NEVER:de$y.NEVER,LESS:de$y.LESS,EQUAL:de$y.EQUAL,LESS_OR_EQUAL:de$y.LEQUAL,GREATER:de$y.GREATER,NOT_EQUAL:de$y.NOTEQUAL,GREATER_OR_EQUAL:de$y.GEQUAL,ALWAYS:de$y.ALWAYS},m$12=Object.freeze(A$16),R$T={ZERO:de$y.ZERO,KEEP:de$y.KEEP,REPLACE:de$y.REPLACE,INCREMENT:de$y.INCR,DECREMENT:de$y.DECR,INVERT:de$y.INVERT,INCREMENT_WRAP:de$y.INCR_WRAP,DECREMENT_WRAP:de$y.DECR_WRAP},n$12=Object.freeze(R$T),t$O={CESIUM_3D_TILE_MASK:128,S3M_TILE:2,MODEL:6,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15,setCesium3DTileBit:function(){return{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},reference:t$O.CESIUM_3D_TILE_MASK,mask:t$O.CESIUM_3D_TILE_MASK}}},Fa$6=Object.freeze(t$O),m$11=[];function x$13(e,t){this.center=t$X.clone(u$Y(e,t$X.ZERO)),this.halfAxes=p$1a.clone(u$Y(t,p$1a.ZERO)),this.areaDirty=1}m$11[0]={num:0,des:"inside"},m$11[1]={num:4,data:[0,4,7,3],des:"left"},m$11[2]={num:4,data:[1,2,6,5],des:"right"},m$11[3]={num:0},m$11[4]={num:4,data:[0,1,5,4],des:"bottom"},m$11[5]={num:6,data:[0,1,5,4,7,3],des:"bottom, left"},m$11[6]={num:6,data:[0,1,2,6,5,4],des:"bottom, right"},m$11[7]={num:0},m$11[8]={num:4,data:[2,3,7,6],des:"top"},m$11[9]={num:6,data:[4,7,6,2,3,0],des:"top, left"},m$11[10]={num:6,data:[2,3,7,6,5,1],des:"top, right"},m$11[11]={num:0},m$11[12]={num:0},m$11[13]={num:0},m$11[14]={num:0},m$11[15]={num:0},m$11[16]={num:4,data:[0,3,2,1],des:"front"},m$11[17]={num:6,data:[0,4,7,3,2,1],des:"front, left"},m$11[18]={num:6,data:[0,3,2,6,5,1],des:"front, right"},m$11[19]={num:0},m$11[20]={num:6,data:[0,3,2,1,5,4],des:"front, bottom"},m$11[21]={num:6,data:[2,1,5,4,7,3],des:"front, bottom, left"},m$11[22]={num:6,data:[0,3,2,6,5,4],des:"front, bottom, right"},m$11[23]={num:0},m$11[24]={num:6,data:[0,3,7,6,2,1],des:"front, top"},m$11[25]={num:6,data:[0,4,7,6,2,1],des:"front, top, left"},m$11[26]={num:6,data:[0,3,7,6,5,1],des:"front, top, right"},m$11[27]={num:0},m$11[28]={num:0},m$11[29]={num:0},m$11[30]={num:0},m$11[31]={num:0},m$11[32]={num:4,data:[4,5,6,7],des:"back"},m$11[33]={num:6,data:[4,5,6,7,3,0],des:"back, left"},m$11[34]={num:6,data:[1,2,6,7,4,5],des:"back, right"},m$11[35]={num:0},m$11[36]={num:6,data:[0,1,5,6,7,4],des:"back, bottom"},m$11[37]={num:6,data:[0,1,5,6,7,3],des:"back, bottom, left"},m$11[38]={num:6,data:[0,1,2,6,7,4],des:"back, bottom, right"},m$11[39]={num:0},m$11[40]={num:6,data:[2,3,7,4,5,6],des:"back, top"},m$11[41]={num:6,data:[0,4,5,6,2,3],des:"back, top, left"},m$11[42]={num:6,data:[1,2,3,7,4,5],des:"back, top, right"},x$13.packedLength=t$X.packedLength+p$1a.packedLength,x$13.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t$X.pack(e.center,t,i),p$1a.pack(e.halfAxes,t,i+t$X.packedLength),t},x$13.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new x$13),t$X.unpack(e,t,i.center),p$1a.unpack(e,t+t$X.packedLength,i.halfAxes),i};var Va$5=new t$X,ja$2=new t$X,Xa$3=new t$X,Wa$4=new t$X,Fa$5=new t$X,Ka$3=new t$X,Za$4=new p$1a,Ya$5={unitary:new p$1a,diagonal:new p$1a},_$X=new t$X,S$S=new t$X,y$_=new t$X;x$13.fromPoints=function(e,t){if(e$28(t)||(t=new x$13),!e$28(e)||0===e.length)return t.halfAxes=p$1a.ZERO,t.center=t$X.ZERO,t;var i,r=e.length,n=t$X.clone(e[0],Va$5);for(i=1;i<r;i++)t$X.add(n,e[i],n);var o=1/r;t$X.multiplyByScalar(n,o,n);var a,s=0,l=0,u=0,c=0,h=0,d=0;for(i=0;i<r;i++)s+=(a=t$X.subtract(e[i],n,ja$2)).x*a.x,l+=a.x*a.y,u+=a.x*a.z,c+=a.y*a.y,h+=a.y*a.z,d+=a.z*a.z;s*=o,l*=o,u*=o,c*=o,h*=o,d*=o;var f=Za$4;f[0]=s,f[1]=l,f[2]=u,f[3]=l,f[4]=c,f[5]=h,f[6]=u,f[7]=h,f[8]=d;var p=p$1a.computeEigenDecomposition(f,Ya$5),_=p$1a.clone(p.unitary,t.halfAxes),m=p$1a.getColumn(_,0,Wa$4),$=p$1a.getColumn(_,1,Fa$5),g=p$1a.getColumn(_,2,Ka$3),v=-Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,b=Number.MAX_VALUE,w=Number.MAX_VALUE,C=Number.MAX_VALUE;for(i=0;i<r;i++)a=e[i],v=Math.max(t$X.dot(m,a),v),y=Math.max(t$X.dot($,a),y),x=Math.max(t$X.dot(g,a),x),b=Math.min(t$X.dot(m,a),b),w=Math.min(t$X.dot($,a),w),C=Math.min(t$X.dot(g,a),C);m=t$X.multiplyByScalar(m,.5*(b+v),m),$=t$X.multiplyByScalar($,.5*(w+y),$),g=t$X.multiplyByScalar(g,.5*(C+x),g);var T=t$X.add(m,$,t.center);t$X.add(T,g,T);var S=Xa$3;return S.x=v-b,S.y=y-w,S.z=x-C,t$X.multiplyByScalar(S,.5,S),p$1a.multiplyByScale(t.halfAxes,S,t.halfAxes),t};var xa$5=new t$X,Ga$5=new t$X;function ba$4(e,t,i,r,n,o,a,s,l,u,c){if(!(e$28(n)&&e$28(o)&&e$28(a)&&e$28(s)&&e$28(l)&&e$28(u)))throw new t$Z("all extents (minimum/maximum X/Y/Z) are required.");e$28(c)||(c=new x$13);var h=c.halfAxes;p$1a.setColumn(h,0,t,h),p$1a.setColumn(h,1,i,h),p$1a.setColumn(h,2,r,h);var d=xa$5;d.x=(n+o)/2,d.y=(a+s)/2,d.z=(l+u)/2;var f=Ga$5;f.x=(o-n)/2,f.y=(s-a)/2,f.z=(u-l)/2;var p=c.center;return d=p$1a.multiplyByVector(h,d,d),t$X.add(e,d,p),p$1a.multiplyByScale(h,f,h),c}var Ca$4=new t$W,Qa$4=new t$X,Ja$3=new t$W,$a$3=new t$W,Ha$4=new t$W,ar$d=new t$W,rr$d=new t$W,tr$c=new t$X,Ma$4=new t$X,er$f=new t$X,Pa$3=new t$X,nr$c=new t$X,or$a=new o$1k,ir$9=new o$1k,sr$5=new o$1k,cr$6=new o$1k,dr$6=new o$1k,hr$6=new t$X,mr$8=new t$X,ur$8=new t$X,vr$7=new t$X,fr$5=new o$1k,lr$9=new t$X,pr$7=new t$X,wr$5=new t$X,yr$5=new o$1i(t$X.UNIT_X,0);x$13.fromRectangle=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("rectangle is required");if(e.width<0||e.width>e$27.TWO_PI)throw new t$Z("Rectangle width must be between 0 and 2*pi");if(e.height<0||e.height>e$27.PI)throw new t$Z("Rectangle height must be between 0 and pi");if(e$28(r)&&!e$27.equalsEpsilon(r.radii.x,r.radii.y,e$27.EPSILON15))throw new t$Z("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");var o,a,s,l,u,c,h;if(t=u$Y(t,0),i=u$Y(i,0),r=u$Y(r,t$V.WGS84),e.width<=e$27.PI){var d=h$10.center(e,Ca$4),f=new f$16(r.cartographicToCartesian(d,Qa$4),r);h=f.plane;var p=d.longitude,_=e.south<0&&e.north>0?0:d.latitude,m=t$W.fromRadians(p,e.north,i,Ja$3),$=t$W.fromRadians(e.west,e.north,i,$a$3),g=t$W.fromRadians(e.west,_,i,Ha$4),v=t$W.fromRadians(e.west,e.south,i,ar$d),y=t$W.fromRadians(p,e.south,i,rr$d),x=r.cartographicToCartesian(m,tr$c),b=r.cartographicToCartesian($,Ma$4),w=r.cartographicToCartesian(g,er$f),C=r.cartographicToCartesian(v,Pa$3),T=r.cartographicToCartesian(y,nr$c),S=f.projectPointToNearestOnPlane(x,or$a),E=f.projectPointToNearestOnPlane(b,ir$9),A=f.projectPointToNearestOnPlane(w,sr$5),P=f.projectPointToNearestOnPlane(C,cr$6),I=f.projectPointToNearestOnPlane(T,dr$6);return a=-(o=Math.min(E.x,A.x,P.x)),l=Math.max(E.y,S.y),s=Math.min(P.y,I.y),$.height=v.height=t,b=r.cartographicToCartesian($,Ma$4),C=r.cartographicToCartesian(v,Pa$3),u=Math.min(o$1i.getPointDistance(h,b),o$1i.getPointDistance(h,C)),c=i,ba$4(f.origin,f.xAxis,f.yAxis,f.zAxis,o,a,s,l,u,c,n)}var M=e.south>0,O=e.north<0,D=M?e.south:O?e.north:0,R=h$10.center(e,Ca$4).longitude,L=t$X.fromRadians(R,D,i,r,hr$6);L.z=0;var B=Math.abs(L.x)<e$27.EPSILON10&&Math.abs(L.y)<e$27.EPSILON10?t$X.UNIT_X:t$X.normalize(L,mr$8),N=t$X.UNIT_Z,F=t$X.cross(B,N,ur$8);h=o$1i.fromPointNormal(L,B,yr$5);var z=t$X.fromRadians(R+e$27.PI_OVER_TWO,D,i,r,vr$7);o=-(a=t$X.dot(o$1i.projectPointOntoPlane(h,z,fr$5),F)),l=t$X.fromRadians(0,e.north,O?t:i,r,lr$9).z,s=t$X.fromRadians(0,e.south,M?t:i,r,pr$7).z;var k=t$X.fromRadians(e.east,D,i,r,wr$5);return ba$4(L,F,N,B,o,a,s,l,u=o$1i.getPointDistance(h,k),c=0,n)},x$13.clone=function(e,t){if(e$28(e))return e$28(t)?(t$X.clone(e.center,t.center),p$1a.clone(e.halfAxes,t.halfAxes),t.areaDirty=1,t):new x$13(e.center,e.halfAxes)},x$13.intersectPlane=function(e,t){if(!e$28(e))throw new t$Z("box is required.");if(!e$28(t))throw new t$Z("plane is required.");var i=e.center,r=t.normal,n=e.halfAxes,o=r.x,a=r.y,s=r.z,l=Math.abs(o*n[p$1a.COLUMN0ROW0]+a*n[p$1a.COLUMN0ROW1]+s*n[p$1a.COLUMN0ROW2])+Math.abs(o*n[p$1a.COLUMN1ROW0]+a*n[p$1a.COLUMN1ROW1]+s*n[p$1a.COLUMN1ROW2])+Math.abs(o*n[p$1a.COLUMN2ROW0]+a*n[p$1a.COLUMN2ROW1]+s*n[p$1a.COLUMN2ROW2]),u=t$X.dot(r,i)+t.distance;return u<=-l?pt$a.OUTSIDE:u>=l?pt$a.INSIDE:pt$a.INTERSECTING};var ia$3=new t$X,sa$3=new t$X,ca$3=new t$X,xr$6=new t$X,br$3=new t$X;x$13.distanceSquaredTo=function(e,t){if(!e$28(e))throw new t$Z("box is required.");if(!e$28(t))throw new t$Z("cartesian is required.");var i=t$X.subtract(t,e.center,xa$5),r=e.halfAxes,n=p$1a.getColumn(r,0,ia$3),o=p$1a.getColumn(r,1,sa$3),a=p$1a.getColumn(r,2,ca$3),s=t$X.magnitude(n),l=t$X.magnitude(o),u=t$X.magnitude(a);t$X.normalize(n,n),t$X.normalize(o,o),t$X.normalize(a,a);var c=xr$6;c.x=t$X.dot(i,n),c.y=t$X.dot(i,o),c.z=t$X.dot(i,a);var h,d=0;return c.x<-s?d+=(h=c.x+s)*h:c.x>s&&(d+=(h=c.x-s)*h),c.y<-l?d+=(h=c.y+l)*h:c.y>l&&(d+=(h=c.y-l)*h),c.z<-u?d+=(h=c.z+u)*h:c.z>u&&(d+=(h=c.z-u)*h),d};var Aa$6=new t$X,Cr$5=new t$X;x$13.computePlaneDistances=function(e,t,i,r){if(!e$28(e))throw new t$Z("box is required.");if(!e$28(t))throw new t$Z("position is required.");if(!e$28(i))throw new t$Z("direction is required.");e$28(r)||(r=new o$1t);var n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,l=p$1a.getColumn(s,0,ia$3),u=p$1a.getColumn(s,1,sa$3),c=p$1a.getColumn(s,2,ca$3),h=t$X.add(l,u,Aa$6);t$X.add(h,c,h),t$X.add(h,a,h);var d=t$X.subtract(h,t,Cr$5),f=t$X.dot(i,d);return n=Math.min(f,n),o=Math.max(f,o),t$X.add(a,l,h),t$X.add(h,u,h),t$X.subtract(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.add(a,l,h),t$X.subtract(h,u,h),t$X.add(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.add(a,l,h),t$X.subtract(h,u,h),t$X.subtract(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.subtract(a,l,h),t$X.add(h,u,h),t$X.add(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.subtract(a,l,h),t$X.add(h,u,h),t$X.subtract(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.subtract(a,l,h),t$X.subtract(h,u,h),t$X.add(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),t$X.subtract(a,l,h),t$X.subtract(h,u,h),t$X.subtract(h,c,h),t$X.subtract(h,t,d),f=t$X.dot(i,d),n=Math.min(f,n),o=Math.max(f,o),r.start=n,r.stop=o,r};var Mr$4=new i$19;x$13.isOccluded=function(e,t){if(!e$28(e))throw new t$Z("box is required.");if(!e$28(t))throw new t$Z("occluder is required.");var i=i$19.fromOrientedBoundingBox(e,Mr$4);return!t.isBoundingSphereVisible(i)},x$13.prototype.intersectPlane=function(e){return x$13.intersectPlane(this,e)},x$13.prototype.distanceSquaredTo=function(e){return x$13.distanceSquaredTo(this,e)},x$13.prototype.computePlaneDistances=function(e,t,i){return x$13.computePlaneDistances(this,e,t,i)},x$13.prototype.isOccluded=function(e){return x$13.isOccluded(this,e)},x$13.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&t$X.equals(e.center,t.center)&&p$1a.equals(e.halfAxes,t.halfAxes)},x$13.prototype.clone=function(e){return x$13.clone(this,e)},x$13.prototype.equals=function(e){return x$13.equals(this,e)};var Oa$4=new e$25;x$13.prototype._updateBBox=function(){if(1==this.areaDirty){var e=p$1a.getColumn(this.halfAxes,0,ia$3),t=t$X.clone(t$X.negate(e,_$X)),i=p$1a.getColumn(this.halfAxes,1,sa$3),r=t$X.clone(t$X.negate(i,_$X)),n=p$1a.getColumn(this.halfAxes,2,ca$3),o=t$X.clone(t$X.negate(n,_$X));this.bbox=[],t$X.add(this.center,i,_$X),t$X.add(_$X,o,S$S),t$X.add(S$S,t,y$_),this.bbox[0]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(S$S,e,y$_),this.bbox[1]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(_$X,n,S$S),t$X.add(S$S,e,y$_),this.bbox[2]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(S$S,t,y$_),this.bbox[3]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(this.center,r,_$X),t$X.add(_$X,o,S$S),t$X.add(S$S,t,y$_),this.bbox[4]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(S$S,e,y$_),this.bbox[5]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(_$X,n,S$S),t$X.add(S$S,e,y$_),this.bbox[6]=new t$X(y$_.x,y$_.y,y$_.z),t$X.add(S$S,t,y$_),this.bbox[7]=new t$X(y$_.x,y$_.y,y$_.z);var a=t$X.magnitude(e),s=t$X.magnitude(i),l=t$X.magnitude(n),u=new t$X(-a,-s,-l),c=new t$X(a,s,l);if(a*s*l==0)return void(this.areaDirty=-1);t$X.normalize(e,e),t$X.normalize(i,i),t$X.normalize(n,n),this.u=t$X.clone(e),this.v=t$X.clone(i),this.w=t$X.clone(n),this.posMin=u,this.posMaX=c,this.areaDirty=0}};var v$J=void 0;x$13.prototype._createDeriveZBackfaceCommand=function(e){if(e$28(this.command))return this.command;this._updateBBox();for(var t=new Float32Array(24),i=0;i<8;i++)t[3*i]=this.bbox[i].x-this.center.x,t[3*i+1]=this.bbox[i].y-this.center.y,t[3*i+2]=this.bbox[i].z-this.center.z;e$28(v$J)||((v$J=new Uint8Array(36))[0]=3,v$J[1]=2,v$J[2]=6,v$J[3]=3,v$J[4]=6,v$J[5]=7,v$J[6]=0,v$J[7]=4,v$J[8]=1,v$J[9]=1,v$J[10]=4,v$J[11]=5,v$J[12]=4,v$J[13]=6,v$J[14]=5,v$J[15]=4,v$J[16]=7,v$J[17]=6,v$J[18]=0,v$J[19]=3,v$J[20]=4,v$J[21]=3,v$J[22]=7,v$J[23]=4,v$J[24]=0,v$J[25]=1,v$J[26]=2,v$J[27]=0,v$J[28]=2,v$J[29]=3,v$J[30]=1,v$J[31]=5,v$J[32]=6,v$J[33]=1,v$J[34]=6,v$J[35]=2);var r=h$W.createIndexBuffer({context:e,typedArray:v$J,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_BYTE});r.vertexArrayDestroyable=!1,r.referenceCount=1;var n=new m$19({context:e,attributes:[{index:0,vertexBuffer:h$W.createVertexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW}),componentDatatype:S$W.FLOAT,componentsPerAttribute:3,offsetInBytes:0,strideInBytes:3*S$W.getSizeInBytes(S$W.FLOAT)}],indexBuffer:r}),o=["attribute vec4 position;","void main()","{"," gl_Position = czm_modelViewProjection * vec4(position.xyz, 1.0);","}"].join("\n"),a=["void main()","{"," gl_FragColor = vec4(1.0,0.0,0.0,0.3);","}"].join("\n"),s=new a$$({sources:[o]}),l=new a$$({sources:[a]});this.command=new r$15,this.command.cull=!1,this.command.boundingVolume=this,this.command.orientedBoundingBox=this,this.command.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:{position:0}});var u=y$15.fromTranslation(this.center);return this.command.uniformMap={},this.command.modelMatrix=u,this.command.primitiveType=W$_.TRIANGLES,this.command.vertexArray=n,this.command.count=v$J.length,this.command.pass=Le$p.S3MTilesClampObjectStencil,this.command.renderState=u$R.fromCache({cull:{enabled:!0,face:k$11.BACK},colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilMask:Fa$6.SKIP_LOD_MASK,stencilTest:{enabled:!0,backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.REPLACE,zPass:n$12.REPLACE},frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.REPLACE,zPass:n$12.REPLACE},reference:Fa$6.SKIP_LOD_MASK,mask:Fa$6.SKIP_LOD_MASK}}),this.command};var X$S=[];X$S.push(new o$1k),X$S.push(new o$1k),X$S.push(new o$1k),X$S.push(new o$1k),X$S.push(new o$1k),X$S.push(new o$1k);var Pr$5=new t$W,J$10=new t$X;x$13.prototype.calculateBoxArea=function(e,t,i,r,n,o,a,s){this._updateBBox();var l=e,u=t$X.subtract(l,this.center,br$3);if(-1==this.areaDirty){var c=n/r*(x=-1!=o?o:.5*t$X.distance(this.posMaX,this.posMin))/i;return e$27.PI*c*c}var h=t$X.fromElements(t$X.dot(u,this.u),t$X.dot(u,this.v),t$X.dot(u,this.w),Aa$6),d=(h.x<this.posMin.x?1:0)+((h.x>this.posMaX.x?1:0)<<1)+((h.z<this.posMin.z?1:0)<<2)+((h.z>this.posMaX.z?1:0)<<3)+((h.y>this.posMaX.y?1:0)<<4)+((h.y<this.posMin.y?1:0)<<5);if(d>42)return console.log("area calculation is wrong"),-100;var f=m$11[d];if(0==f.num){c=n/r*(x=-1!=o?o:.5*t$X.distance(this.posMaX,this.posMin))/i;return e$27.PI*c*c}if(0==f.num)return console.log("area calculation is wrong"),-100;for(var p,_=[],m=a,$=0;$<f.num;$++){var g=X$S[$],v=this.bbox[f.data[$]];p=!1;var y,x,b=e$27.PI;if(3===t)(y=y$15.multiplyByVector(m,e$25.fromElements(v.x,v.y,v.z,1),Oa$4)).z<0&&(p=!0,-1==x&&(b=e$27.PI_OVER_FOUR,i=t$X.magnitude(u)));else{var w=s,C=w.ellipsoid.cartesianToCartographic(v,Pr$5);e$28(C)?(w.project(C,J$10),(y=y$15.multiplyByVector(m,e$25.fromElements(J$10.z,J$10.x,J$10.y,1),Oa$4)).z<0&&(p=!0)):p=!0}if(1==p)return b*(c=n/r*(x=-1!=o?o:.5*t$X.distance(this.posMaX,this.posMin))/i)*c;g.x=y.x/y.w,g.y=n-y.y/y.w,_.push(g)}return Math.abs(A$1d.computeArea2D(_))};var F$15=1/256,M$12=256,t$N={octEncodeInRange:function(e,t,i){o$1u.defined("vector",e),o$1u.defined("result",i);var r=t$X.magnitudeSquared(e);if(Math.abs(r-1)>e$27.EPSILON6)throw new t$Z("vector must be normalized.");if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=i.x,o=i.y;i.x=(1-Math.abs(o))*e$27.signNotZero(n),i.y=(1-Math.abs(n))*e$27.signNotZero(o)}return i.x=e$27.toSNorm(i.x,t),i.y=e$27.toSNorm(i.y,t),i},octEncode:function(e,t){return t$N.octEncodeInRange(e,255,t)}},y$Z=new o$1k,w$M=new Uint8Array(1);function h$U(e){return w$M[0]=e,w$M[0]}t$N.octEncodeToCartesian4=function(e,t){return t$N.octEncodeInRange(e,65535,y$Z),t.x=h$U(y$Z.x*F$15),t.y=h$U(y$Z.x),t.z=h$U(y$Z.y*F$15),t.w=h$U(y$Z.y),t},t$N.octDecodeInRange=function(e,t,i,r){if(o$1u.defined("result",r),e<0||e>i||t<0||t>i)throw new t$Z("x and y must be unsigned normalized integers between 0 and "+i);if(r.x=e$27.fromSNorm(e,i),r.y=e$27.fromSNorm(t,i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var n=r.x;r.x=(1-Math.abs(r.y))*e$27.signNotZero(n),r.y=(1-Math.abs(n))*e$27.signNotZero(r.y)}return t$X.normalize(r,r)},t$N.octDecode=function(e,t,i){return t$N.octDecodeInRange(e,t,255,i)},t$N.octDecodeFromCartesian4=function(e,t){o$1u.typeOf.object("encoded",e),o$1u.typeOf.object("result",t);var i=e.x,r=e.y,n=e.z,o=e.w;if(i<0||i>255||r<0||r>255||n<0||n>255||o<0||o>255)throw new t$Z("x, y, z, and w must be unsigned normalized integers between 0 and 255");var a=i*M$12+r,s=n*M$12+o;return t$N.octDecodeInRange(a,s,65535,t)},t$N.octPackFloat=function(e){return o$1u.defined("encoded",e),256*e.x+e.y};var b$16=new o$1k;function g$S(e){return e>>1^-(1&e)}t$N.octEncodeFloat=function(e){return t$N.octEncode(e,b$16),t$N.octPackFloat(b$16)},t$N.octDecodeFloat=function(e,t){o$1u.defined("value",e);var i=e/256,r=Math.floor(i),n=256*(i-r);return t$N.octDecode(r,n,t)},t$N.octPack=function(e,t,i,r){o$1u.defined("v1",e),o$1u.defined("v2",t),o$1u.defined("v3",i),o$1u.defined("result",r);var n=t$N.octEncodeFloat(e),o=t$N.octEncodeFloat(t),a=t$N.octEncode(i,b$16);return r.x=65536*a.x+n,r.y=65536*a.y+o,r},t$N.octUnpack=function(e,t,i,r){o$1u.defined("packed",e),o$1u.defined("v1",t),o$1u.defined("v2",i),o$1u.defined("v3",r);var n=e.x/65536,o=Math.floor(n),a=65536*(n-o);n=e.y/65536;var s=Math.floor(n),l=65536*(n-s);t$N.octDecodeFloat(a,t),t$N.octDecodeFloat(l,i),t$N.octDecode(o,s,r)},t$N.compressTextureCoordinates=function(e){return o$1u.defined("textureCoordinates",e),4096*(4095*e.x|0)+(4095*e.y|0)},t$N.decompressTextureCoordinates=function(e,t){o$1u.defined("compressed",e),o$1u.defined("result",t);var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},t$N.zigZagDeltaDecode=function(e,t,i){o$1u.defined("uBuffer",e),o$1u.defined("vBuffer",t),o$1u.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),e$28(i)&&o$1u.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,i.length);for(var r=e.length,n=0,o=0,a=0,s=0;s<r;++s)n+=g$S(e[s]),o+=g$S(t[s]),e[s]=n,t[s]=o,e$28(i)&&(a+=g$S(i[s]),i[s]=a)},t$N.octShortToFloat=function(e){return e$27.clamp(3051850947599719e-20*e,-1,1)},t$N.octShortDecode=function(e,t,i){if(o$1u.defined("result",i),i.x=t$N.octShortToFloat(e),i.y=t$N.octShortToFloat(t),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var r=i.x;i.x=(1-Math.abs(i.y))*e$27.signNotZero(r),i.y=(1-Math.abs(r))*e$27.signNotZero(i.y)}return t$X.normalize(i,i)};var e$1R={NONE:0,BITS12:1},ye$s=Object.freeze(e$1R),N$S=new t$X,D$10=new t$X,c$12=new o$1k,M$11=new y$15,I$1j=new y$15,g$R=Math.pow(2,12);function h$T(e,t,i,r,n,o){var a,s,l,u=ye$s.NONE;if(e$28(e)&&e$28(t)&&e$28(i)&&e$28(r)){var c=e.minimum,h=e.maximum,d=t$X.subtract(h,c,D$10),f=i-t;u=Math.max(t$X.maximumComponent(d),f)<g$R-1?ye$s.BITS12:ye$s.NONE,u=ye$s.NONE,a=e.center,s=y$15.inverseTransformation(r,new y$15);var p=t$X.negate(c,N$S);y$15.multiply(y$15.fromTranslation(p,M$11),s,s);var _=N$S;_.x=1/d.x,_.y=1/d.y,_.z=1/d.z,y$15.multiply(y$15.fromScale(_,M$11),s,s),l=y$15.clone(r),y$15.setTranslation(l,t$X.ZERO,l),r=y$15.clone(r,new y$15);var m=y$15.fromTranslation(c,M$11),$=y$15.fromScale(d,I$1j),g=y$15.multiply(m,$,M$11);y$15.multiply(r,g,r),y$15.multiply(l,g,l)}this.quantization=u,this.minimumHeight=t,this.maximumHeight=i,this.center=a,this.toScaledENU=s,this.fromScaledENU=r,this.matrix=l,this.hasVertexNormals=n,this.hasWebMercatorT=u$Y(o,!1)}h$T.prototype.encode=function(e,t,i,r,n,o,a){var s=r.x,l=r.y;if(this.quantization===ye$s.BITS12){(i=y$15.multiplyByPoint(this.toScaledENU,i,N$S)).x=e$27.clamp(i.x,0,1),i.y=e$27.clamp(i.y,0,1),i.z=e$27.clamp(i.z,0,1);var u=this.maximumHeight-this.minimumHeight,c=e$27.clamp((n-this.minimumHeight)/u,0,1);o$1k.fromElements(i.x,i.y,c$12);var h=t$N.compressTextureCoordinates(c$12);o$1k.fromElements(i.z,c,c$12);var d=t$N.compressTextureCoordinates(c$12);o$1k.fromElements(s,l,c$12);var f=t$N.compressTextureCoordinates(c$12);if(e[t++]=h,e[t++]=d,e[t++]=f,this.hasWebMercatorT){o$1k.fromElements(a,0,c$12);var p=t$N.compressTextureCoordinates(c$12);e[t++]=p}}else t$X.subtract(i,this.center,N$S),e[t++]=N$S.x,e[t++]=N$S.y,e[t++]=N$S.z,e[t++]=n,e[t++]=s,e[t++]=l,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=t$N.octPackFloat(o)),t},h$T.prototype.decodePosition=function(e,t,i){if(e$28(i)||(i=new t$X),t*=this.getStride(),this.quantization===ye$s.BITS12){var r=t$N.decompressTextureCoordinates(e[t],c$12);i.x=r.x,i.y=r.y;var n=t$N.decompressTextureCoordinates(e[t+1],c$12);return i.z=n.x,y$15.multiplyByPoint(this.fromScaledENU,i,i)}return i.x=e[t],i.y=e[t+1],i.z=e[t+2],t$X.add(i,this.center,i)},h$T.prototype.decodeTextureCoordinates=function(e,t,i){return e$28(i)||(i=new o$1k),t*=this.getStride(),this.quantization===ye$s.BITS12?t$N.decompressTextureCoordinates(e[t+2],i):o$1k.fromElements(e[t+4],e[t+5],i)},h$T.prototype.decodeHeight=function(e,t){return t*=this.getStride(),this.quantization===ye$s.BITS12?t$N.decompressTextureCoordinates(e[t+1],c$12).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]},h$T.prototype.decodeWebMercatorT=function(e,t){return t*=this.getStride(),this.quantization===ye$s.BITS12?t$N.decompressTextureCoordinates(e[t+3],c$12).x:e[t+6]},h$T.prototype.getOctEncodedNormal=function(e,t,i){var r=e[t=(t+1)*this.getStride()-1]/256,n=Math.floor(r),o=256*(r-n);return o$1k.fromElements(n,o,i)},h$T.prototype.getStride=function(){var e;if(this.quantization===ye$s.BITS12)e=3;else e=6;return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var H$W={position3DAndHeight:0,textureCoordAndEncodedNormals:1},F$14={compressed0:0,compressed1:1};function t$M(e){this._ellipsoid=u$Y(e,t$V.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}h$T.prototype.getAttributes=function(e){var t,i=S$W.FLOAT,r=S$W.getSizeInBytes(i);if(this.quantization===ye$s.NONE){var n=2;this.hasWebMercatorT&&++n,this.hasVertexNormals&&++n,t=(4+n)*r;var o=[{index:H$W.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t},{index:H$W.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:n,offsetInBytes:4*r,strideInBytes:t}];return o}var a=3,s=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(t=(a+ ++s)*r,[{index:o.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:o.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s,offsetInBytes:a*r,strideInBytes:t}]):[{index:o.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a}]},h$T.prototype.getAttributeLocations=function(){return this.quantization===ye$s.NONE?H$W:F$14},h$T.clone=function(e,t){return e$28(t)||(t=new h$T),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=t$X.clone(e.center),t.toScaledENU=y$15.clone(e.toScaledENU),t.fromScaledENU=y$15.clone(e.fromScaledENU),t.matrix=y$15.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},Object.defineProperties(t$M.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),t$M.mercatorAngleToGeodeticLatitude=function(e){return e$27.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},t$M.geodeticLatitudeToMercatorAngle=function(e){e>t$M.MaximumLatitude?e=t$M.MaximumLatitude:e<-t$M.MaximumLatitude&&(e=-t$M.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},t$M.MaximumLatitude=t$M.mercatorAngleToGeodeticLatitude(Math.PI),t$M.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,n=t$M.geodeticLatitudeToMercatorAngle(e.latitude)*i,o=e.height;return e$28(t)?(t.x=r,t.y=n,t.z=o,t):new t$X(r,n,o)},t$M.prototype.unproject=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required");var i=this._oneOverSemimajorAxis,r=e.x*i,n=t$M.mercatorAngleToGeodeticLatitude(e.y*i),o=e.z;return e$28(t)?(t.longitude=r,t.latitude=n,t.height=o,t):new t$W(r,n,o)};var m$10={};m$10.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var lr$8=new t$X,sa$2=new y$15,ua$4=new t$X,Ta$5=new t$X;function p$$(){if(!e$28(i$W._canTransferArrayBuffer)){var e=new Worker(w$L("Workers/transferTypedArrayTest.js"));e.postMessage=u$Y(e.webkitPostMessage,e.postMessage);var t=new Int8Array([99]);try{e.postMessage({array:t},[t.buffer])}catch{return i$W._canTransferArrayBuffer=!1,i$W._canTransferArrayBuffer}var i=o$1q.defer();e.onmessage=function(t){var r=t.data.array,n=e$28(r)&&99===r[0];i.resolve(n),e.terminate(),i$W._canTransferArrayBuffer=n},i$W._canTransferArrayBuffer=i.promise}return i$W._canTransferArrayBuffer}m$10.computeVertices=function(e){if(!e$28(e)||!e$28(e.heightmap))throw new t$Z("options.heightmap is required.");if(!e$28(e.width)||!e$28(e.height))throw new t$Z("options.width and options.height are required.");if(!e$28(e.nativeRectangle))throw new t$Z("options.nativeRectangle is required.");if(!e$28(e.skirtHeight))throw new t$Z("options.skirtHeight is required.");var t,i,r,n,o=Math.cos,a=Math.sin,s=Math.sqrt,l=Math.atan,u=Math.exp,c=e$27.PI_OVER_TWO,h=e$27.toRadians,d=e.heightmap,f=e.width,p=e.height,_=e.skirtHeight,m=u$Y(e.isGeographic,!0),$=u$Y(e.ellipsoid,t$V.WGS84),g=1/$.maximumRadius,v=e.nativeRectangle,y=e.rectangle;e$28(y)?(t=y.west,i=y.south,r=y.east,n=y.north):m?(t=h(v.west),i=h(v.south),r=h(v.east),n=h(v.north)):(t=v.west*g,i=c-2*l(u(-v.south*g)),r=v.east*g,n=c-2*l(u(-v.north*g)));var x=e.relativeToCenter,b=e$28(x);x=b?x:t$X.ZERO;var w=u$Y(e.exaggeration,1),C=u$Y(e.includeWebMercatorT,!1),T=u$Y(e.structure,m$10.DEFAULT_STRUCTURE),S=u$Y(T.heightScale,m$10.DEFAULT_STRUCTURE.heightScale),E=u$Y(T.heightOffset,m$10.DEFAULT_STRUCTURE.heightOffset),A=u$Y(T.elementsPerHeight,m$10.DEFAULT_STRUCTURE.elementsPerHeight),P=u$Y(T.stride,m$10.DEFAULT_STRUCTURE.stride),I=u$Y(T.elementMultiplier,m$10.DEFAULT_STRUCTURE.elementMultiplier),M=u$Y(T.isBigEndian,m$10.DEFAULT_STRUCTURE.isBigEndian),O=h$10.computeWidth(v),D=h$10.computeHeight(v),R=O/(f-1),L=D/(p-1);m||(O*=g,D*=g);var B,N,F=$.radiiSquared,z=F.x,k=F.y,V=F.z,U=65536,X=-65536,H=m$1b.eastNorthUpToFixedFrame(x,$),G=y$15.inverseTransformation(H,sa$2);C&&(B=t$M.geodeticLatitudeToMercatorAngle(i),N=1/(t$M.geodeticLatitudeToMercatorAngle(n)-B));var W=ua$4;W.x=Number.POSITIVE_INFINITY,W.y=Number.POSITIVE_INFINITY,W.z=Number.POSITIVE_INFINITY;var Y=Ta$5;Y.x=Number.NEGATIVE_INFINITY,Y.y=Number.NEGATIVE_INFINITY,Y.z=Number.NEGATIVE_INFINITY;var q=Number.POSITIVE_INFINITY,j=f*p,Z=j+(_>0?2*f+2*p:0),K=new Array(Z),Q=new Array(Z),J=new Array(Z),ee=C?new Array(Z):[],te=0,ie=p,re=0,ne=f;_>0&&(--te,++ie,--re,++ne);for(var oe=1e-5,ae=te;ae<ie;++ae){var se=ae;se<0&&(se=0),se>=p&&(se=p-1);var le=v.north-L*se,ue=((le=m?h(le):c-2*l(u(-le*g)))-i)/(n-i);ue=e$27.clamp(ue,0,1);var ce=ae===te,he=ae===ie-1;_>0&&(ce?le+=oe*D:he&&(le-=oe*D));var de,fe=o(le),pe=a(le),_e=V*pe;C&&(de=(t$M.geodeticLatitudeToMercatorAngle(le)-B)*N);for(var me=re;me<ne;++me){var $e=me;$e<0&&($e=0),$e>=f&&($e=f-1);var ge,ve,ye=se*(f*P)+$e*P;if(1===A)ge=d[ye];else if(ge=0,M)for(ve=0;ve<A;++ve)ge=ge*I+d[ye+ve];else for(ve=A-1;ve>=0;--ve)ge=ge*I+d[ye+ve];ge=(ge*S+E)*w,X=Math.max(X,ge),U=Math.min(U,ge);var xe=v.west+R*$e;m?xe=h(xe):xe*=g;var be=(xe-t)/(r-t);be=e$27.clamp(be,0,1);var we=se*f+$e;if(_>0){var Ce=me===re,Te=me===ne-1,Se=ce||he||Ce||Te;if((ce||he)&&(Ce||Te))continue;Se&&(ge-=_,Ce?(we=j+(p-se-1),xe-=oe*O):he?we=j+p+(f-$e-1):Te?(we=j+p+f+se,xe+=oe*O):ce&&(we=j+p+f+p+$e))}var Ee=fe*o(xe),Ae=fe*a(xe),Pe=z*Ee,Ie=k*Ae,Me=1/s(Pe*Ee+Ie*Ae+_e*pe),Oe=Pe*Me,De=Ie*Me,Re=_e*Me,Le=new t$X;Le.x=Oe+Ee*ge,Le.y=De+Ae*ge,Le.z=Re+pe*ge,K[we]=Le,Q[we]=ge,J[we]=new o$1k(be,ue),C&&(ee[we]=de),y$15.multiplyByPoint(G,Le,lr$8),t$X.minimumByComponent(lr$8,W,W),t$X.maximumByComponent(lr$8,Y,Y),q=Math.min(q,ge)}}var Be,Ne,Fe=i$19.fromPoints(K);(e$28(y)&&(Be=x$13.fromRectangle(y,U,X,$)),b)&&(Ne=new s$W($).computeHorizonCullingPointPossiblyUnderEllipsoid(x,K,U));for(var ze=new h$T(new e$1Y(W,Y,x),q,X,H,!1,C),ke=new Float32Array(Z*ze.getStride()),Ve=0,Ue=0;Ue<Z;++Ue)Ve=ze.encode(ke,Ve,K[Ue],J[Ue],Q[Ue],void 0,ee[Ue]);return{vertices:ke,maximumHeight:X,minimumHeight:U,encoding:ze,boundingSphere3D:Fe,orientedBoundingBox:Be,occludeePointInScaledSpace:Ne}};var c$11=new o$1o,k$10;function v$I(e,t){"indexedDBWorker"===e._workerName?--e._activeIndexedDBTasks:"websocketTaskProcessor"!=e._workerName&&--e._activeTasks;var i=t.id;if(e$28(i)){var r=e._deferreds,n=r[i];if(e$28(t.error)){var o=t.error;"RuntimeError"===o.name?(o=new t$U(t.error.message)).stack=t.error.stack:"DeveloperError"===o.name&&((o=new t$Z(t.error.message)).stack=t.error.stack),c$11.raiseEvent(o),n.reject(o)}else c$11.raiseEvent(),n.resolve(t.result);delete r[i]}}function w$L(e){var t=n$17(e);if(i$16(t)){var i,r='importScripts("'+t+'");';try{i=new Blob([r],{type:"application/javascript"})}catch{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);n.append(r),i=n.getBlob("application/javascript")}t=(window.URL||window.webkitURL).createObjectURL(i)}return t}function x$12(){return e$28(k$10)||(k$10=w$L("Workers/cesiumWorkerBootstrapper.js")),k$10}function h$S(e){var t=new Worker(x$12());t.postMessage=u$Y(t.webkitPostMessage,t.postMessage);var i={loaderConfig:{paths:{Workers:n$17("Workers")},baseUrl:n$17.getCesiumBaseUrl().url},workerModule:i$W._workerModulePrefix+e._workerName};return t.postMessage(i),t.onmessage=function(t){v$I(e,t.data)},t}function P$11(e,t){var i={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};return s$V.supportsWebAssembly()?(i.modulePath=n$17(t.modulePath),i.wasmBinaryFile=n$17(t.wasmBinaryFile),t$S.fetchArrayBuffer({url:i.wasmBinaryFile}).then((function(e){return i.wasmBinary=e,i}))):(i.modulePath=n$17(t.fallbackModulePath),o$1q.resolve(i))}function i$W(e,t){this._workerName=e,this._maximumActiveTasks=u$Y(t,5),this._activeTasks=0,this._deferreds={},this._activeIndexedDBTasks=0,this._nextID=0}var D$$=[];function T$T(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g){this.center=e,this.vertices=t,this.stride=u$Y(u,6),this.indexCountWithoutSkirts=r,this.vertexCountWithoutSkirts=n,this.indices=i,this.minimumHeight=o,this.maximumHeight=a,this.boundingSphere3D=s,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=c,this.validOrientedBoundingBox=g,this.encoding=h,this.exaggeration=d,this.westIndicesSouthToNorth=f,this.southIndicesEastToWest=p,this.eastIndicesNorthToSouth=_,this.northIndicesWestToEast=m,this.invalid=u$Y($,!1)}function I$1i(){t$Z.throwInstantiationError()}i$W.prototype.scheduleTask=function(e,t){if(e$28(this._worker)||(this._worker=h$S(this)),"indexedDBWorker"===this._workerName){if(this._activeIndexedDBTasks>=this._maximumActiveTasks)return;++this._activeIndexedDBTasks}else{if(this._activeTasks>=this._maximumActiveTasks)return;"websocketTaskProcessor"!=this._workerName&&++this._activeTasks}var i=this;return o$1q(p$$(),(function(r){e$28(t)?r||(t.length=0):t=D$$;var n=i._nextID++,o=o$1q.defer();return i._deferreds[n]=o,i._worker.postMessage({id:n,parameters:e,canTransferArrayBuffer:r},t),o.promise}))},i$W.prototype.initWebAssemblyModule=function(e){e$28(this._worker)||(this._worker=h$S(this));var t=o$1q.defer(),i=this,r=this._worker;return P$11(this,e).then((function(e){return o$1q(p$$(),(function(n){var o,a=e.wasmBinary;e$28(a)&&n&&(o=[a]),r.onmessage=function(e){r.onmessage=function(e){v$I(i,e.data)},t.resolve(e.data)},r.postMessage({webAssemblyConfig:e},o)}))})),t},i$W.prototype.isDestroyed=function(){return!1},i$W.prototype.destroy=function(){return e$28(this._worker)&&this._worker.terminate(),i$Z(this)},i$W.taskCompletedEvent=c$11,i$W._defaultWorkerModulePrefix="Workers/",i$W._workerModulePrefix=i$W._defaultWorkerModulePrefix,i$W._canTransferArrayBuffer=void 0,Object.defineProperties(I$1i.prototype,{errorEvent:{get:t$Z.throwInstantiationError},credit:{get:t$Z.throwInstantiationError},tilingScheme:{get:t$Z.throwInstantiationError},ready:{get:t$Z.throwInstantiationError},readyPromise:{get:t$Z.throwInstantiationError},hasWaterMask:{get:t$Z.throwInstantiationError},hasVertexNormals:{get:t$Z.throwInstantiationError},availability:{get:t$Z.throwInstantiationError}});var A$15=[];I$1i.getRegularGridIndices=function(e,t){if(e*t>=e$27.FOUR_GIGABYTES)throw new t$Z("The total number of vertices (width * height) must be less than 4,294,967,296.");var i=A$15[e];e$28(i)||(A$15[e]=i=[]);var r=i[t];return e$28(r)||b$15(e,t,r=e*t<e$27.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6+3*(e+t-2)):i[t]=new Uint32Array((e-1)*(t-1)*6+3*(e+t-2)),0),r},I$1i.getRegularGridIndicesForReproject=function(e,t){if(e*t>=e$27.FOUR_GIGABYTES)throw new t$Z("The total number of vertices (width * height) must be less than 4,294,967,296.");var i=A$15[e];e$28(i)||(A$15[e]=i=[]);var r=i[t];return e$28(r)||b$15(e,t,r=e*t<e$27.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6):i[t]=new Uint32Array((e-1)*(t-1)*6),0),r};var U$$=[];I$1i.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=e$27.FOUR_GIGABYTES)throw new t$Z("The total number of vertices (width * height) must be less than 4,294,967,296.");var i=U$$[e];e$28(i)||(U$$[e]=i=[]);var r=i[t];if(!e$28(r)){var n=I$1i.getRegularGridIndices(e,t),o=O$J(e,t),a=o.westIndicesSouthToNorth,s=o.southIndicesEastToWest,l=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;r=i[t]={indices:n,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return r};var N$R=[];function O$J(e,t){var i,r=new Array(t),n=new Array(e),o=new Array(t),a=new Array(e);for(i=0;i<e;++i)a[i]=i,n[i]=e*t-1-i;for(i=0;i<t;++i)o[i]=(i+1)*e-1,r[i]=(t-i-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:o,northIndicesWestToEast:a}}function b$15(e,t,i,r){for(var n=0,o=0;o<t-1;++o){for(var a=0;a<e-1;++a){var s=n,l=s+e,u=l+1,c=s+1;i[r++]=s,i[r++]=l,i[r++]=c,i[r++]=c,i[r++]=l,i[r++]=u,++n}++n}var h=(t-1)/2,d=(e-1)/2;n=0;for(a=0;a<d;a++)i[r++]=n,i[r++]=n+1,i[r++]=n+2,n+=2;n=e*(t-1);for(a=0;a<d;a++)i[r++]=n+1,i[r++]=n,i[r++]=n+2,n+=2;n=0;for(a=0;a<h;a++)i[r++]=n+e,i[r++]=n,i[r++]=n+2*e,n+=2*e;n=e-1;for(a=0;a<h;a++)i[r++]=n,i[r++]=n+e,i[r++]=n+2*e,n+=2*e}function S$R(e,t,i,r,n){for(var o=e$28(n),a=e[0],s=e.length,l=1;l<s;++l){var u=e[l];!o||n[a+"_"+u]?(i[r++]=a,i[r++]=u,i[r++]=t,i[r++]=t,i[r++]=u,i[r++]=t+1,a=u,++t):(a=u,++t)}return r}function T$S(e){if(!e$28(e)||!e$28(e.buffer))throw new t$Z("options.buffer is required.");if(!e$28(e.width))throw new t$Z("options.width is required.");if(!e$28(e.height))throw new t$Z("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=u$Y(e.childTileMask,15),this._encoding=u$Y(e.encoding,T$10.NONE),this._valid=u$Y(e.valid,!0),e$28(e.childTileMaskExt)&&(this._childTileMaskExt=e.childTileMaskExt,this._level=e.level,this._x=e.x,this._y=e.y);var t=m$10.DEFAULT_STRUCTURE,i=e.structure;e$28(i)?i!==t&&(i.heightScale=u$Y(i.heightScale,t.heightScale),i.heightOffset=u$Y(i.heightOffset,t.heightOffset),i.elementsPerHeight=u$Y(i.elementsPerHeight,t.elementsPerHeight),i.stride=u$Y(i.stride,t.stride),i.elementMultiplier=u$Y(i.elementMultiplier,t.elementMultiplier),i.isBigEndian=u$Y(i.isBigEndian,t.isBigEndian)):i=t,this._structure=i,this._createdByUpsampling=u$Y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===T$10.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0,this._skirtMode=u$Y(e.skirtMode,!0),this._skirtScale=u$Y(e.skirtScale,.1),this._releaseBuffer=!0,e$28(e.releaseBuffer)&&(this._releaseBuffer=e.releaseBuffer),this._normalTexture=e.normalTexture}I$1i.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=e$27.FOUR_GIGABYTES)throw new t$Z("The total number of vertices (width * height) must be less than 4,294,967,296.");var i=N$R[e];e$28(i)||(N$R[e]=i=[]);var r=i[t];if(!e$28(r)){var n=e*t,o=(e-1)*(t-1)*6,a=2*e+2*t,s=n+a,l=3*(e+t-2),u=o+6*Math.max(0,a-4)+l,c=O$J(e,t),h=c.westIndicesSouthToNorth,d=c.southIndicesEastToWest,f=c.eastIndicesNorthToSouth,p=c.northIndicesWestToEast,_=ce$v.createTypedArray(s,u);b$15(e,t,_,0),I$1i.addSkirtIndices(h,d,f,p,n,_,o+l),r=i[t]={indices:_,westIndicesSouthToNorth:h,southIndicesEastToWest:d,eastIndicesNorthToSouth:f,northIndicesWestToEast:p,indexCountWithoutSkirts:o}}return r},I$1i.addSkirtIndices=function(e,t,i,r,n,o,a,s){var l=n;a=S$R(e,l,o,a,s),a=S$R(t,l+=e.length,o,a,s),a=S$R(i,l+=t.length,o,a,s),S$R(r,l+=i.length,o,a,s)},I$1i.heightmapTerrainQuality=.25,I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*I$1i.heightmapTerrainQuality/(t*i)},I$1i.prototype.requestTileGeometry=t$Z.throwInstantiationError,I$1i.prototype.getLevelMaximumGeometricError=t$Z.throwInstantiationError,I$1i.prototype.getTileDataAvailable=t$Z.throwInstantiationError,I$1i.prototype.loadTileDataAvailability=t$Z.throwInstantiationError,Object.defineProperties(T$S.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return e$28(this._mesh)}},normalTexture:{get:function(){return this._normalTexture}}});var Q$$=new i$W("createVerticesFromHeightmap");T$S.prototype.createMesh=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("tilingScheme is required.");if(!e$28(t))throw new t$Z("x is required.");if(!e$28(i))throw new t$Z("y is required.");if(!e$28(r))throw new t$Z("level is required.");var o=e.ellipsoid,a=e.tileXYToNativeRectangle(t,i,r),s=e.tileXYToRectangle(t,i,r);n=u$Y(n,1);var l=o.cartographicToCartesian(h$10.center(s)),u=this._structure,c=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,this._width,e.getNumberOfXTilesAtLevel(0))/(1<<r);if(this._skirtMode)if(e.isSct){var h=Math.min.apply(null,this._buffer),d=Math.max.apply(null,this._buffer);this._skirtHeight=this._skirtScale*(d-h),0===this._skirtHeight&&(this._skirtHeight=Math.min(4*c,1e3))}else this._skirtHeight=Math.min(4*c,1e3);else this._skirtHeight=0;var f=Q$$.scheduleTask({heightmap:this._buffer,structure:u,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:a,rectangle:s,relativeToCenter:l,ellipsoid:o,skirtHeight:this._skirtHeight,isGeographic:e.projection instanceof n$1b,exaggeration:n,encoding:this._encoding});if(e$28(f)){var p=this;return o$1q(f,(function(e){var t;t=p._skirtHeight>0?I$1i.getRegularGridAndSkirtIndicesAndEdgeIndices(e.gridWidth,e.gridHeight):I$1i.getRegularGridIndicesAndEdgeIndices(e.gridWidth,e.gridHeight);var i=e.gridWidth*e.gridHeight;return p._mesh=new T$T(l,new Float32Array(e.vertices),t.indices,t.indexCountWithoutSkirts,i,e.minimumHeight,e.maximumHeight,i$19.clone(e.boundingSphere3D),t$X.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,x$13.clone(e.orientedBoundingBox),h$T.clone(e.encoding),n,t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),p._buffer=void 0,p._mesh}))}},T$S.prototype._createMeshSync=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("tilingScheme is required.");if(!e$28(t))throw new t$Z("x is required.");if(!e$28(i))throw new t$Z("y is required.");if(!e$28(r))throw new t$Z("level is required.");var o=e.ellipsoid,a=e.tileXYToNativeRectangle(t,i,r),s=e.tileXYToRectangle(t,i,r);n=u$Y(n,1);var l=o.cartographicToCartesian(h$10.center(s)),u=this._structure,c=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,this._width,e.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(4*c,1e3);var h,d=m$10.computeVertices({heightmap:this._buffer,structure:u,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:a,rectangle:s,relativeToCenter:l,ellipsoid:o,skirtHeight:this._skirtHeight,isGeographic:e.projection instanceof n$1b,exaggeration:n});this._buffer=void 0,h=this._skirtHeight>0?I$1i.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):I$1i.getRegularGridIndicesAndEdgeIndices(this._width,this._height);var f=d.gridWidth*d.gridHeight;return new T$T(l,d.vertices,h.indices,h.indexCountWithoutSkirts,f,d.minimumHeight,d.maximumHeight,d.boundingSphere3D,d.occludeePointInScaledSpace,d.encoding.getStride(),d.orientedBoundingBox,d.encoding,n,h.westIndicesSouthToNorth,h.southIndicesEastToWest,h.eastIndicesNorthToSouth,h.northIndicesWestToEast)},T$S.prototype.interpolateHeight=function(e,t,i){var r,n=this._width,o=this._height,a=this._structure,s=a.stride,l=a.elementsPerHeight,u=a.elementMultiplier,c=a.isBigEndian,h=a.heightOffset,d=a.heightScale;e$28(this._mesh)?r=G$1a(this._mesh.vertices,this._mesh.encoding,h,d,e,n,o,t,i,this._mesh.exaggeration):r=(r=ee$D(this._buffer,l,u,s,c,e,n,o,t,i))*d+h;return r};var y$Y=33,$$W=new Float32Array(y$Y*y$Y);function ee$D(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,f=d+1;f>=a&&(f=a-1,d=a-2);var p=0|h,_=p+1;return _>=s&&(_=s-1,p=s-2),_=s-1-_,D$_(c-d,h-p,A$14(e,t,i,r,n,(p=s-1-p)*a+d),A$14(e,t,i,r,n,p*a+f),A$14(e,t,i,r,n,_*a+d),A$14(e,t,i,r,n,_*a+f))}function G$1a(e,t,i,r,n,o,a,s,l,u){var c=(s-n.west)*(o-1)/(n.east-n.west),h=(l-n.south)*(a-1)/(n.north-n.south),d=0|c,f=d+1;f>=o&&(f=o-1,d=o-2);var p=0|h,_=p+1;_>=a&&(_=a-1,p=a-2);var m=h-p;return p=a-1-p,_=a-1-_,D$_(c-d,m,(t.decodeHeight(e,p*o+d)/u-i)/r,(t.decodeHeight(e,p*o+f)/u-i)/r,(t.decodeHeight(e,_*o+d)/u-i)/r,(t.decodeHeight(e,_*o+f)/u-i)/r)}function D$_(e,t,i,r,n,o){return t<e?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function A$14(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;a<t;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function re$C(e,t,i,r,n,o,a,s){var l;if(a*=n,o)for(l=0;l<t-1;++l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;else for(l=t-1;l>0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}function n$11(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}T$S.prototype.upsample=function(e,t,i,r,n,o,a){if(!e$28(e))throw new t$Z("tilingScheme is required.");if(!e$28(t))throw new t$Z("thisX is required.");if(!e$28(i))throw new t$Z("thisY is required.");if(!e$28(r))throw new t$Z("thisLevel is required.");if(!e$28(n))throw new t$Z("descendantX is required.");if(!e$28(o))throw new t$Z("descendantY is required.");if(!e$28(a))throw new t$Z("descendantLevel is required.");if(a-r>1)throw new t$Z("Upsampling through more than one level at a time is not currently supported.");if(!this._valid){var s=16,l=16;return new T$S({buffer:new Uint8Array(s*l),width:s,height:l,skirtMode:this._skirtMode,skirtScale:this._skirtScale,childTileMask:0,structure:this._structure,createdByUpsampling:!0,valid:!1})}var u=this._mesh;if(e$28(u)){s=this._width,l=this._height;e$28(this._valid)&&!this._valid&&(s=Math.max(Math.floor(.5*this._width+1),y$Y),l=Math.max(Math.floor(.5*this._height+1),y$Y));for(var c=this._structure,h=c.stride,d=new this._bufferType(s*l*h),f=u.vertices,p=u.encoding,_=e.tileXYToRectangle(t,i,r),m=e.tileXYToRectangle(n,o,a),$=c.heightOffset,g=c.heightScale,v=u.exaggeration,y=c.elementsPerHeight,x=c.elementMultiplier,b=c.isBigEndian,w=Math.pow(x,y-1),C=0;C<l;++C)for(var T=e$27.lerp(m.north,m.south,C/(l-1)),S=0;S<s;++S){var E=G$1a(f,p,$,g,_,s,l,e$27.lerp(m.west,m.east,S/(s-1)),T,v);re$C(d,y,x,w,h,b,C*s+S,E=(E=E<c.lowestEncodedHeight?c.lowestEncodedHeight:E)>c.highestEncodedHeight?c.highestEncodedHeight:E)}if(!this._structure.isBigEndian){var A=!1;for(S=0;S<d.length;S++)if(Math.abs(d[S])>e$27.EPSILON3){A=!0;break}A||(l=y$Y,s=y$Y,d=$$W)}return new T$S({buffer:d,width:s,height:l,skirtMode:this._skirtMode,skirtScale:this._skirtScale,childTileMask:0,structure:this._structure,createdByUpsampling:!0,valid:this._valid})}},T$S.prototype.isChildAvailable=function(e,t,i,r){if(!e$28(e))throw new t$Z("thisX is required.");if(!e$28(t))throw new t$Z("thisY is required.");if(!e$28(i))throw new t$Z("childX is required.");if(!e$28(r))throw new t$Z("childY is required.");var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},T$S.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var l$14=new h$10;function S$Q(e,t,i,r){for(var n=r.length,o=0;o<n;++o){var a=r[o];if(a.x===t&&a.y===i&&a.level===e)return!0}return!1}n$11.prototype.addAvailableTileRange=function(e,t,i,r,n){var o=this._tilingScheme,a=this._rootNodes;if(0===e)for(var s=i;s<=n;++s)for(var l=t;l<=r;++l)S$Q(e,l,s,a)||a.push(new _$W(o,void 0,0,l,s));o.tileXYToRectangle(t,i,e,l$14);var u=l$14.west,c=l$14.north;o.tileXYToRectangle(r,n,e,l$14);for(var h=l$14.east,d=new Y$N(e,u,l$14.south,h,c),f=0;f<a.length;++f){var p=a[f];L$1a(p.extent,d)&&j$17(this._maximumLevel,p,d)}},n$11.prototype.computeMaximumLevelAtPosition=function(e){for(var t,i=0;i<this._rootNodes.length;++i){var r=this._rootNodes[i];if(m$$(r.extent,e)){t=r;break}}return e$28(t)?x$11(void 0,t,e):-1};var W$X=[],b$14=[],Q$_=new h$10,X$R=new h$10;n$11.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=W$X;t.length=0,e.east<e.west?(t.push(h$10.fromRadians(-Math.PI,e.south,e.east,e.north,Q$_)),t.push(h$10.fromRadians(e.west,e.south,Math.PI,e.north,X$R))):t.push(e);var i,r=b$14;for(r.length=0,i=0;i<this._rootNodes.length;++i)M$10(r,this._rootNodes[i],t);for(i=r.length-1;i>=0;--i)if(e$28(r[i])&&0===r[i].length)return i;return 0};var o$1e=new t$W;function _$W(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function Y$N(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function L$1a(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return r<Math.min(e.north,t.north)&&i<n}function j$17(e,t,i){for(;t.level<e;)if(A$13(t.nw.extent,i))t=t.nw;else if(A$13(t.ne.extent,i))t=t.ne;else if(A$13(t.sw.extent,i))t=t.sw;else{if(!A$13(t.se.extent,i))break;t=t.se}if(0===t.rectangles.length||t.rectangles[t.rectangles.length-1].level<=i.level)t.rectangles.push(i);else{var r=a$14(t.rectangles,i.level,I$1h);r<=0&&(r=~r),t.rectangles.splice(r,0,i)}}function I$1h(e,t){return e.level-t}function A$13(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function m$$(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function x$11(e,t,i){for(var r=0,n=!1;!n;){var o=t._nw&&m$$(t._nw.extent,i),a=t._ne&&m$$(t._ne.extent,i),s=t._sw&&m$$(t._sw.extent,i),l=t._se&&m$$(t._se.extent,i);if(o+a+s+l>1){o&&(r=Math.max(r,x$11(t,t._nw,i))),a&&(r=Math.max(r,x$11(t,t._ne,i))),s&&(r=Math.max(r,x$11(t,t._sw,i))),l&&(r=Math.max(r,x$11(t,t._se,i)));break}o?t=t._nw:a?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;c>=0&&u[c].level>r;--c){var h=u[c];m$$(h,i)&&(r=h.level)}t=t.parent}return r}function M$10(e,t,i){if(t){var r,n=!1;for(r=0;r<i.length;++r)n=n||L$1a(t.extent,i[r]);if(n){var o=t.rectangles;for(r=0;r<o.length;++r){var a=o[r];e[a.level]||(e[a.level]=i),e[a.level]=q$13(e[a.level],a)}M$10(e,t._nw,i),M$10(e,t._ne,i),M$10(e,t._sw,i),M$10(e,t._se,i)}}}function q$13(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];L$1a(n,t)?(n.west<t.west&&i.push(new h$10(n.west,n.south,t.west,n.north)),n.east>t.east&&i.push(new h$10(t.east,n.south,n.east,n.north)),n.south<t.south&&i.push(new h$10(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&i.push(new h$10(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}function f$$(e){var t,i=e.name,r=e.message;t=e$28(i)&&e$28(r)?i+": "+r:e.toString();var n=e.stack;return e$28(n)&&(t+="\n"+n),t}function l$13(e,t,i,r,n,o,a){this.provider=e,this.message=t,this.x=i,this.y=r,this.level=n,this.timesRetried=u$Y(o,0),this.retry=!1,this.error=a}function c$10(e){if(e=u$Y(e,{}),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._numberOfLevelZeroTilesX=u$Y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=u$Y(e.numberOfLevelZeroTilesY,1),this._projection=u$Y(e.projection,new t$M(this._ellipsoid)),e$28(e.rectangleSouthwestInMeters)&&e$28(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{var t=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new o$1k(-t,-t),this._rectangleNortheastInMeters=new o$1k(t,t)}var i=this._projection.unproject(this._rectangleSouthwestInMeters),r=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h$10(i.longitude,i.latitude,r.longitude,r.latitude),this._customDPI=e.customDPI,this._scaleDenominators=e.scaleDenominators,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._origin=u$Y(e.origin,void 0)}n$11.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,l$14);return h$10.center(r,o$1e),this.computeMaximumLevelAtPosition(o$1e)>=e},n$11.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(r,2*t,2*i+1)?1:0,n|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,n|=this.isTileAvailable(r,2*t,2*i)?4:0,n|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(_$W.prototype,{nw:{get:function(){return this._nw||(this._nw=new _$W(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new _$W(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new _$W(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new _$W(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),l$13.handleError=function(e,t,i,r,n,o,a,s,l){var u=e;return e$28(e)?(u.provider=t,u.message=r,u.x=n,u.y=o,u.level=a,u.retry=!1,u.error=l,++u.timesRetried):u=new l$13(t,r,n,o,a,0,l),i.numberOfListeners>0?i.raiseEvent(u):console.log('An error occurred in "'+t.constructor.name+'": '+f$$(r)),u.retry&&e$28(s)&&s(),u},l$13.handleSuccess=function(e){e$28(e)&&(e.timesRetried=-1)},Object.defineProperties(c$10.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}},origin:{get:function(){return this._origin}}}),c$10.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},c$10.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},c$10.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,r=i.project(h$10.southwest(e)),n=i.project(h$10.northeast(e));return e$28(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new h$10(r.x,r.y,n.x,n.y)},c$10.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=e$28(this._origin)?this._origin.x:this._rectangleSouthwestInMeters.x,o=e$28(this._origin)?this._origin.y:this._rectangleNortheastInMeters.y;if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var a=this.calculateResolution(i),s=n+e*this._tileWidth*a.x,l=n+(e+1)*this._tileWidth*a.x,u=o-t*this._tileHeight*a.y,c=o-(t+1)*this._tileHeight*a.y;return e$28(r)?(r.west=s,r.south=c,r.east=l,r.north=u,r):new h$10(s,c,l,u)}var h=this.getNumberOfXTilesAtLevel(i),d=this.getNumberOfYTilesAtLevel(i),f=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/h,p=(s=this._rectangleSouthwestInMeters.x+e*f,l=this._rectangleSouthwestInMeters.x+(e+1)*f,(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/d);u=this._rectangleNortheastInMeters.y-t*p,c=this._rectangleNortheastInMeters.y-(t+1)*p;return e$28(r)?(r.west=s,r.south=c,r.east=l,r.north=u,r):new h$10(s,c,l,u)},c$10.prototype.tileXYToRectangle=function(e,t,i,r){var n=this.tileXYToNativeRectangle(e,t,i,r),o=this._projection,a=o.unproject(new o$1k(n.west,n.south)),s=o.unproject(new o$1k(n.east,n.north));return n.west=a.longitude,n.south=a.latitude,n.east=s.longitude,n.north=s.latitude,n},c$10.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(h$10.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=e$28(this._origin)?this._origin.x:this._rectangleSouthwestInMeters.x,s=e$28(this._origin)?this._origin.y:this._rectangleNortheastInMeters.y,l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o;if(e$28(this._customDPI)&&e$28(this._scaleDenominators)){var c=this.calculateResolution(t);l=this._tileWidth*c.x,u=this._tileHeight*c.y}var h=this._projection.project(e),d=h.x-a,f=s-h.y;e$28(this._origin)&&(n+=this._origin.x!=this._rectangleSouthwestInMeters.x?Math.ceil((h.x-this._origin.x)/l):0,o+=this._origin.y!=this._rectangleSouthwestInMeters.y?Math.ceil((this._origin.y-h.y)/u):0);var p=d/l|0;p>=n&&(p=n-1);var _=f/u|0;return _>=o&&(_=o-1),e$28(i)?(i.x=p,i.y=_,i):new o$1k(p,_)}},c$10.prototype.calculateResolution=function(e){return new o$1k(.0254*this._scaleDenominators[e]/this._customDPI.x,.0254*this._scaleDenominators[e]/this._customDPI.y)};var j$16=15;function _$V(e){if(!e$28(e)||!e$28(e.url))throw new t$Z("options.url is required.");this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;var t=e.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};var i=this,r=u$Y(e.ellipsoid,t$V.WGS84);this._readyPromise=o$1q(e.url).then((function(e){var r=t$S.createIfNeeded(e);return r.appendForwardSlash(),e$28(t)&&(r=r.getDerivedResource({queryParameters:{token:t}})),i._resource=r,r.getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()})).then((function(e){var t=e.copyrightText;e$28(t)&&(i._credit=new r$1a(t));var n=e.spatialReference,o=u$Y(n.latestWkid,n.wkid),a=e.extent,s={ellipsoid:r};if(4326===o)s.rectangle=h$10.fromDegrees(a.xmin,a.ymin,a.xmax,a.ymax),i._tilingScheme=new g$14(s);else{if(3857!==o)return o$1q.reject(new t$U("Invalid spatial reference"));s.rectangleSouthwestInMeters=new o$1k(a.xmin,a.ymin),s.rectangleNortheastInMeters=new o$1k(a.xmax,a.ymax),i._tilingScheme=new c$10(s)}var l=e.tileInfo;return e$28(l)?(i._width=l.rows+1,i._height=l.cols+1,i._encoding="LERC"===l.format?T$10.LERC:T$10.NONE,i._lodCount=l.lods.length-1,(i._hasAvailability=-1!==e.capabilities.indexOf("Tilemap"))&&(i._tilesAvailable=new n$11(i._tilingScheme,i._lodCount),i._tilesAvailable.addAvailableTileRange(0,0,0,i._tilingScheme.getNumberOfXTilesAtLevel(0),i._tilingScheme.getNumberOfYTilesAtLevel(0)),i._tilesAvailablityLoaded=new n$11(i._tilingScheme,i._lodCount)),i._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(i._tilingScheme.ellipsoid,i._width,i._tilingScheme.getNumberOfXTilesAtLevel(0)),e.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),i._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:e.minValues[0],highestEncodedHeight:e.maxValues[0]},i._ready=!0,!0):o$1q.reject(new t$U("tileInfo is required"))})).otherwise((function(e){var t="An error occurred while accessing "+i._resource.url+".";return l$13.handleError(void 0,i,i._errorEvent,t),o$1q.reject(e)})),this._errorEvent=new o$1o}function w$K(e,t,i,r){if(e._hasAvailability){var n=e._tilesAvailablityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,i,r))return!0;if(n.isTileAvailable(t,i,r))return!1}}function H$V(e,t,i,r){for(var n=t-1,o=i-1,a=r[e.y*t+e.x],s=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new o$1k(e.x+1,e.y+1),c=!1,h=!1;!c||!h;){var d=u.x,f=h?u.y+1:u.y;if(!c){for(var p=e.y;p<f;++p)if(r[p*t+u.x]!==a){c=!0;break}c?(s.push(new o$1k(u.x,e.y)),--u.x,--d,l.endX=u.x):u.x===n?(l.endX=u.x,c=!0):++u.x}if(!h){for(var _=u.y*t,m=e.x;m<=d;++m)if(r[_+m]!==a){h=!0;break}h?(s.push(new o$1k(e.x,u.y)),--u.y,l.endY=u.y):u.y===o?(l.endY=u.y,h=!0):++u.y}}return{endingIndices:s,range:l,value:a}}function V$Q(e,t,i,r,n){var o=[],a=n.every((function(e){return e===n[0]}));if(a)return 1===n[0]&&o.push({startX:e,startY:t,endX:e+i-1,endY:t+r-1}),o;for(var s=[new o$1k(0,0)];s.length>0;){var l=H$V(s.pop(),i,r,n);if(1===l.value){var u=l.range;u.startX+=e,u.endX+=e,u.startY+=t,u.endY+=t,o.push(u)}var c=l.endingIndices;c.length>0&&(s=s.concat(c))}return o}function L$19(e,t,i,r){if(!e._hasAvailability)return{};var n=128*Math.floor(i/128),o=128*Math.floor(r/128),a=Math.min(1<<t,128),s="tilemap/"+t+"/"+o+"/"+n+"/"+a+"/"+a,l=e._availableCache;if(e$28(l[s]))return l[s];var u=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.TERRAIN}),c=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return e$28(c)?(c=c.then((function(s){var l=V$Q(n,o,a,a,s.data);e._tilesAvailablityLoaded.addAvailableTileRange(n,o,n+a,o+a);for(var u=e._tilesAvailable,c=0;c<l.length;++c){var h=l[c];u.addAvailableTileRange(t,h.startX,h.startY,h.endX,h.endY)}return w$K(e,t,i,r)})),l[s]={promise:c,request:u},c=c.always((function(e){return delete l[s],e})),{promise:c,request:u}):{}}function w$J(e){if(e=u$Y(e,{}),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._projection=u$Y(e.projection,new t$M(this._ellipsoid)),this._numberOfLevelZeroTilesX=u$Y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=u$Y(e.numberOfLevelZeroTilesY,1),e.hasOwnProperty("tileInfo")&&(this._tileInfo=e.tileInfo),e$28(e.rectangleSouthwestInMeters)&&e$28(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{var t=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new o$1k(-t,-t),this._rectangleNortheastInMeters=new o$1k(t,t)}var i=this._projection.unproject(this._rectangleSouthwestInMeters),r=this._projection.unproject(this._rectangleNortheastInMeters);if(this._rectangle=new h$10(i.longitude,i.latitude,r.longitude,r.latitude),this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._beginLevel=0,this._suggest=void 0,e$28(e.resolutions)){this._resolutions=e.resolutions;for(var n=0,o=6378137*Math.PI/this._tileWidth;o>this._resolutions[0];)o*=.5,n++;this._beginLevel=n-1,this._dataBounds=e.dataBounds,this._tileBounds=[];for(var a=this._dataBounds.east-this._tileInfo.origin.x,s=this._tileInfo.origin.y-this._dataBounds.south,l=this._dataBounds.west-this._tileInfo.origin.x,u=this._tileInfo.origin.y-this._dataBounds.north,c=0;c<this._resolutions.length;c++){var h=this._resolutions[c]*this._tileInfo.cols,d=this._resolutions[c]*this._tileInfo.rows,f=Math.floor(l/h),p=Math.floor(u/d),_=Math.floor(a/h),m=Math.floor(s/d);this._tileBounds.push(new h$10(f,m,_,p))}}}Object.defineProperties(_$V.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this.ready)throw new t$Z("credit must not be called before ready returns true.");return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new t$Z("tilingScheme must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),_$V.prototype.requestTileGeometry=function(e,t,i,r){if(!this._ready)throw new t$Z("requestTileGeometry must not be called before the terrain provider is ready.");var n,o=this._resource.getDerivedResource({url:"tile/"+i+"/"+t+"/"+e,request:r}),a=this._hasAvailability,s=o$1q.resolve(!0);if(a&&!e$28(w$K(this,i+1,2*e,2*t))){var l=L$19(this,i+1,2*e,2*t);s=l.promise,n=l.request}var u=o.fetchArrayBuffer();if(e$28(u)&&e$28(s)){var c=this,h=this._tilesAvailable;return o$1q.join(u,s).then((function(r){return new T$S({buffer:r[0],width:c._width,height:c._height,childTileMask:a?h.computeChildMaskForTile(i,e,t):j$16,structure:c._terrainDataStructure,encoding:c._encoding})})).otherwise((function(e){return e$28(n)&&n.state===W$14.CANCELLED?(r.cancel(),r.deferred.promise.always((function(){return r.state=W$14.CANCELLED,o$1q.reject(e)}))):o$1q.reject(e)}))}},_$V.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new t$Z("getLevelMaximumGeometricError must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<e)},_$V.prototype.getTileDataAvailable=function(e,t,i){if(this._hasAvailability){var r=w$K(this,i,e,t);if(e$28(r))return r;L$19(this,i,e,t)}},_$V.prototype.loadTileDataAvailability=function(e,t,i){},Object.defineProperties(w$J.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),w$J.prototype.getNumberOfXTilesAtLevel=function(e){if(e$28(this._resolutions)){if(e<this._beginLevel)return this._numberOfLevelZeroTilesX<<e;var t=this._dataBounds.east-this._tileInfo.origin.x,i=e$27.clamp(e-this._beginLevel,0,this._resolutions.length-1),r=this._resolutions[i]*this._tileInfo.cols;return Math.ceil(t/r)}if(e$28(this._tileInfo)){var n=this._tileInfo.lods.filter((function(t){return t.level===e})),o=e$27.toDegrees(this._rectangle.east)-this._tileInfo.origin.x,a=n[0].resolution;return Math.ceil(o/(this._tileInfo.rows*a))}return this._numberOfLevelZeroTilesX<<e},w$J.prototype.getNumberOfYTilesAtLevel=function(e){if(e$28(this._resolutions)){if(e<this._beginLevel)return this._numberOfLevelZeroTilesY<<e;var t=this._tileInfo.origin.y-this._dataBounds.south,i=e$27.clamp(e-this._beginLevel,0,this._resolutions.length-1),r=this._resolutions[i]*this._tileInfo.rows;return Math.ceil(t/r)}if(e$28(this._tileInfo)){var n=this._tileInfo.lods.filter((function(t){return t.level===e})),o=this._tileInfo.origin.y-e$27.toDegrees(this._rectangle.south),a=n[0].resolution;return Math.ceil(o/(this._tileInfo.cols*a))}return this._numberOfLevelZeroTilesY<<e},w$J.prototype.rectangleToNativeRectangle=function(e,t){o$1u.defined("rectangle",e);var i=this._projection,r=i.project(h$10.southwest(e)),n=i.project(h$10.northeast(e));return e$28(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new h$10(r.x,r.y,n.x,n.y)},w$J.prototype.tileXYToNativeRectangle=function(e,t,i,r){if(this._rectangle,e$28(this._resolutions)){var n=this._resolutions[i-this._beginLevel],o=this._tileInfo.origin.x,a=this._tileInfo.origin.y,s=o+e*this._tileWidth*n,l=o+(e+1)*this._tileWidth*n,u=a-t*this._tileHeight*n,c=a-(t+1)*this._tileHeight*n;return e$28(r)?(r.west=s,r.south=c,r.east=l,r.north=u,r):new h$10(s,c,l,u)}if(e$28(this._tileInfo)){n=this._tileInfo.lods[i].resolution*e$27.TWO_PI/360;o=e$27.toRadians(this._tileInfo.origin.x),a=e$27.toRadians(this._tileInfo.origin.y);s=o+e*this._tileWidth*n,l=o+(e+1)*this._tileWidth*n,u=a-t*this._tileHeight*n,c=a-(t+1)*this._tileHeight*n;return e$28(r)?(r.west=s,r.south=c,r.east=l,r.north=u,r):new h$10(s,c,l,u)}var h=this.getNumberOfXTilesAtLevel(i),d=this.getNumberOfYTilesAtLevel(i),f=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/h,p=(s=this._rectangleSouthwestInMeters.x+e*f,l=this._rectangleSouthwestInMeters.x+(e+1)*f,(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/d);u=this._rectangleNortheastInMeters.y-t*p,c=this._rectangleNortheastInMeters.y-(t+1)*p;return e$28(r)?(r.west=s,r.south=c,r.east=l,r.north=u,r):new h$10(s,c,l,u)},w$J.prototype.tileXYToRectangle=function(e,t,i,r){var n=this.tileXYToNativeRectangle(e,t,i,r),o=this._projection,a=o.unproject(new o$1k(n.west,n.south)),s=o.unproject(new o$1k(n.east,n.north));return n.west=a.longitude,n.south=a.latitude,n.east=s.longitude,n.north=s.latitude,n},w$J.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(h$10.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),o=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,s=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/o;if(e$28(this._resolutions)){var l=this._resolutions[t-this._beginLevel];a=this._tileWidth*l,s=this._tileHeight*l}else if(e$28(this._tileInfo)){l=this._tileInfo.lods[t].resolution*e$27.TWO_PI/360;a=this._tileWidth*l,s=this._tileHeight*l}var u,c=this._projection.project(e);r.east<r.west&&(longitude+=e$27.TWO_PI),u=e$28(this._resolutions)?this._tileInfo.origin.x:e$28(this._tileInfo)?e$27.toRadians(this._tileInfo.origin.x):this._rectangleSouthwestInMeters.x;var h=(c.x-u)/a|0;e$28(this._resolutions)&&(h=e$27.clamp(h,this._tileBounds[t-this._beginLevel].west,this._tileBounds[t-this._beginLevel].east)),h>=n&&(h=n-1);var d=((e$28(this._resolutions)?this._tileInfo.origin.y:e$28(this._tileInfo)?e$27.toRadians(this._tileInfo.origin.y):this._rectangleNortheastInMeters.y)-c.y)/s|0;return e$28(this._resolutions)&&(d=e$27.clamp(d,this._tileBounds[t-this._beginLevel].north,this._tileBounds[t-this._beginLevel].south)),d>=o&&(d=o-1),e$28(i)?(i.x=h,i.y=d,i):new o$1k(h,d)}};var e$1Q={NONE:0,GEODESIC:1,RHUMB:2},m$_=Object.freeze(e$1Q);function d$1a(e,t,i,r){if(o$1u.defined("array",e),o$1u.defined("value",t),e$28(i)&&o$1u.typeOf.number("start",i),e$28(r)&&o$1u.typeOf.number("end",r),"function"==typeof e.fill)return e.fill(t,i,r);for(var n=e.length>>>0,o=u$Y(i,0),a=o<0?Math.max(n+o,0):Math.min(o,n),s=u$Y(r,n),l=s<0?Math.max(n+s,0):Math.min(s,n);a<l;)e[a]=t,a++;return e}var C$X=e$27.EPSILON10;function D$Z(e,t,i,r){if(o$1u.defined("equalsEpsilon",t),e$28(e)){r=u$Y(r,C$X),i=u$Y(i,!1);var n,o,a,s=e.length;if(s<2)return e;for(n=1;n<s&&!t(o=e[n-1],a=e[n],r);++n);if(n===s)return i&&t(e[0],e[e.length-1],r)?e.slice(1):e;for(var l=e.slice(0,n);n<s;++n)t(o,a=e[n],r)||(l.push(a),o=a);return i&&l.length>1&&t(l[0],l[l.length-1],r)&&l.shift(),l}}function l$12(e,t,i){if(o$1u.defined("array",e),e$28(t)&&o$1u.typeOf.number("begin",t),e$28(i)&&o$1u.typeOf.number("end",i),"function"==typeof e.slice)return e.slice(t,i);for(var r=Array.prototype.slice.call(e,t,i),n=s$V.typedArrayTypes,o=n.length,a=0;a<o;++a)if(e instanceof n[a]){r=new n[a](r);break}return r}function e$1P(){this._array=[],this._hash={}}Object.defineProperties(e$1P.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),e$1P.prototype.contains=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new t$Z("key is required to be a string or number.");return e$28(this._hash[e])},e$1P.prototype.set=function(e,t){if("string"!=typeof e&&"number"!=typeof e)throw new t$Z("key is required to be a string or number.");t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},e$1P.prototype.get=function(e){if("string"!=typeof e&&"number"!=typeof e)throw new t$Z("key is required to be a string or number.");return this._hash[e]},e$1P.prototype.remove=function(e){if(e$28(e)&&"string"!=typeof e&&"number"!=typeof e)throw new t$Z("key is required to be a string or number.");var t=this._hash[e],i=e$28(t);if(i){var r=this._array;r.splice(r.indexOf(t),1),delete this._hash[e]}return i},e$1P.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},e$1P.clone=function(e,t){if(e$28(e)){for(var i in e$28(t)?t.removeAll():t=new e$1P,e._hash)e._hash.hasOwnProperty(i)&&t.set(i,e._hash[i]);return t}};var L$18=new t$X,O$I=new t$X,P$10=new t$X;function S$P(e,t,i,r,n){var o,a,s,l,u,c,h,d;if(o$1u.defined("point",e),o$1u.defined("p0",t),o$1u.defined("p1",i),o$1u.defined("p2",r),e$28(n)||(n=new t$X),e$28(t.z)){if(t$X.equalsEpsilon(e,t,e$27.EPSILON14))return t$X.clone(t$X.UNIT_X,n);if(t$X.equalsEpsilon(e,i,e$27.EPSILON14))return t$X.clone(t$X.UNIT_Y,n);if(t$X.equalsEpsilon(e,r,e$27.EPSILON14))return t$X.clone(t$X.UNIT_Z,n);o=t$X.subtract(i,t,L$18),a=t$X.subtract(r,t,O$I),s=t$X.subtract(e,t,P$10),l=t$X.dot(o,o),u=t$X.dot(o,a),c=t$X.dot(o,s),h=t$X.dot(a,a),d=t$X.dot(a,s)}else{if(o$1k.equalsEpsilon(e,t,e$27.EPSILON14))return t$X.clone(t$X.UNIT_X,n);if(o$1k.equalsEpsilon(e,i,e$27.EPSILON14))return t$X.clone(t$X.UNIT_Y,n);if(o$1k.equalsEpsilon(e,r,e$27.EPSILON14))return t$X.clone(t$X.UNIT_Z,n);o=o$1k.subtract(i,t,L$18),a=o$1k.subtract(r,t,O$I),s=o$1k.subtract(e,t,P$10),l=o$1k.dot(o,o),u=o$1k.dot(o,a),c=o$1k.dot(o,s),h=o$1k.dot(a,a),d=o$1k.dot(a,s)}n.y=h*c-u*d,n.z=l*d-u*c;var f=l*h-u*u;return 0!==n.y&&(n.y/=f),0!==n.z&&(n.z/=f),n.x=1-n.y-n.z,n}var e$1O={defaultKey:void 0,getKey:function(e){return e$28(e)?e:e$1O.defaultKey}},i$V="";function o$1d(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).key;this._key=e$1O.getKey(t),this._resource=new t$S({url:i$V,queryParameters:{key:this._key}})}function a$_(e){e=u$Y(e,u$Y.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}Object.defineProperties(o$1d.prototype,{url:{get:function(){return i$V}},key:{get:function(){return this._key}}}),o$1d.prototype.geocode=function(e){return o$1u.typeOf.string("query",e),this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then((function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map((function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],o=t[3];return{displayName:e.name,destination:h$10.fromDegrees(r,i,o,n)}}))}))};var e$1N={NONE:0,TOP:1,ALL:2},ee$C=Object.freeze(e$1N);function n$10(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.position=u$Y(e.position,!1),this.normal=u$Y(e.normal,!1),this.st=u$Y(e.st,!1),this.bitangent=u$Y(e.bitangent,!1),this.tangent=u$Y(e.tangent,!1),this.color=u$Y(e.color,!1)}n$10.POSITION_ONLY=Object.freeze(new n$10({position:!0})),n$10.POSITION_AND_NORMAL=Object.freeze(new n$10({position:!0,normal:!0})),n$10.POSITION_NORMAL_AND_ST=Object.freeze(new n$10({position:!0,normal:!0,st:!0})),n$10.POSITION_AND_ST=Object.freeze(new n$10({position:!0,st:!0})),n$10.POSITION_AND_COLOR=Object.freeze(new n$10({position:!0,color:!0})),n$10.ALL=Object.freeze(new n$10({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n$10.DEFAULT=n$10.POSITION_NORMAL_AND_ST,n$10.packedLength=6,n$10.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t[i++]=e.position?1:0,t[i++]=e.normal?1:0,t[i++]=e.st?1:0,t[i++]=e.tangent?1:0,t[i++]=e.bitangent?1:0,t[i]=e.color?1:0,t},n$10.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");return t=u$Y(t,0),e$28(i)||(i=new n$10),i.position=1===e[t++],i.normal=1===e[t++],i.st=1===e[t++],i.tangent=1===e[t++],i.bitangent=1===e[t++],i.color=1===e[t],i},n$10.clone=function(e,t){if(e$28(e))return e$28(t)||(t=new n$10),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var W$W=new t$X;function O$H(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).minimum,i=e.maximum;if(o$1u.typeOf.object("min",t),o$1u.typeOf.object("max",i),e$28(e.offsetAttribute)&&e.offsetAttribute===ee$C.TOP)throw new t$Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");var r=u$Y(e.vertexFormat,n$10.DEFAULT);this._minimum=t$X.clone(t),this._maximum=t$X.clone(i),this._vertexFormat=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}O$H.fromDimensions=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).dimensions;o$1u.typeOf.object("dimensions",t),o$1u.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);var i=t$X.multiplyByScalar(t,.5,new t$X);return new O$H({minimum:t$X.negate(i,new t$X),maximum:i,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},O$H.fromAxisAlignedBoundingBox=function(e){return o$1u.typeOf.object("boundingBox",e),new O$H({minimum:e.minimum,maximum:e.maximum})},O$H.packedLength=2*t$X.packedLength+n$10.packedLength+1,O$H.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t$X.pack(e._minimum,t,i),t$X.pack(e._maximum,t,i+t$X.packedLength),n$10.pack(e._vertexFormat,t,i+2*t$X.packedLength),t[i+2*t$X.packedLength+n$10.packedLength]=u$Y(e._offsetAttribute,-1),t};var N$Q=new t$X,U$_=new t$X,G$19=new n$10,S$O={minimum:N$Q,maximum:U$_,vertexFormat:G$19,offsetAttribute:void 0},u$Q;O$H.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=t$X.unpack(e,t,N$Q),n=t$X.unpack(e,t+t$X.packedLength,U$_),o=n$10.unpack(e,t+2*t$X.packedLength,G$19),a=e[t+2*t$X.packedLength+n$10.packedLength];return e$28(i)?(i._minimum=t$X.clone(r,i._minimum),i._maximum=t$X.clone(n,i._maximum),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._offsetAttribute=-1===a?void 0:a,i):(S$O.offsetAttribute=-1===a?void 0:a,new O$H(S$O))},O$H.createGeometry=function(e){var t=e._minimum,i=e._maximum,r=e._vertexFormat;if(!t$X.equals(t,i)){var n,o,a=new a$_;if(r.position&&(r.st||r.normal||r.tangent||r.bitangent)){if(r.position&&((o=new Float64Array(72))[0]=t.x,o[1]=t.y,o[2]=i.z,o[3]=i.x,o[4]=t.y,o[5]=i.z,o[6]=i.x,o[7]=i.y,o[8]=i.z,o[9]=t.x,o[10]=i.y,o[11]=i.z,o[12]=t.x,o[13]=t.y,o[14]=t.z,o[15]=i.x,o[16]=t.y,o[17]=t.z,o[18]=i.x,o[19]=i.y,o[20]=t.z,o[21]=t.x,o[22]=i.y,o[23]=t.z,o[24]=i.x,o[25]=t.y,o[26]=t.z,o[27]=i.x,o[28]=i.y,o[29]=t.z,o[30]=i.x,o[31]=i.y,o[32]=i.z,o[33]=i.x,o[34]=t.y,o[35]=i.z,o[36]=t.x,o[37]=t.y,o[38]=t.z,o[39]=t.x,o[40]=i.y,o[41]=t.z,o[42]=t.x,o[43]=i.y,o[44]=i.z,o[45]=t.x,o[46]=t.y,o[47]=i.z,o[48]=t.x,o[49]=i.y,o[50]=t.z,o[51]=i.x,o[52]=i.y,o[53]=t.z,o[54]=i.x,o[55]=i.y,o[56]=i.z,o[57]=t.x,o[58]=i.y,o[59]=i.z,o[60]=t.x,o[61]=t.y,o[62]=t.z,o[63]=i.x,o[64]=t.y,o[65]=t.z,o[66]=i.x,o[67]=t.y,o[68]=i.z,o[69]=t.x,o[70]=t.y,o[71]=i.z,a.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:o})),r.normal){var s=new Float32Array(72);s[0]=0,s[1]=0,s[2]=1,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=1,s[9]=0,s[10]=0,s[11]=1,s[12]=0,s[13]=0,s[14]=-1,s[15]=0,s[16]=0,s[17]=-1,s[18]=0,s[19]=0,s[20]=-1,s[21]=0,s[22]=0,s[23]=-1,s[24]=1,s[25]=0,s[26]=0,s[27]=1,s[28]=0,s[29]=0,s[30]=1,s[31]=0,s[32]=0,s[33]=1,s[34]=0,s[35]=0,s[36]=-1,s[37]=0,s[38]=0,s[39]=-1,s[40]=0,s[41]=0,s[42]=-1,s[43]=0,s[44]=0,s[45]=-1,s[46]=0,s[47]=0,s[48]=0,s[49]=1,s[50]=0,s[51]=0,s[52]=1,s[53]=0,s[54]=0,s[55]=1,s[56]=0,s[57]=0,s[58]=1,s[59]=0,s[60]=0,s[61]=-1,s[62]=0,s[63]=0,s[64]=-1,s[65]=0,s[66]=0,s[67]=-1,s[68]=0,s[69]=0,s[70]=-1,s[71]=0,a.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:s})}if(r.st){var l=new Float32Array(72),u=0;l[u++]=0,l[u++]=0,l[u++]=-1,l[u++]=1,l[u++]=0,l[u++]=-1,l[u++]=1,l[u++]=1,l[u++]=-1,l[u++]=0,l[u++]=1,l[u++]=-1,l[u++]=1,l[u++]=0,l[u++]=-1,l[u++]=0,l[u++]=0,l[u++]=-1,l[u++]=0,l[u++]=1,l[u++]=-1,l[u++]=1,l[u++]=1,l[u++]=-1,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=1,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=1,l[u++]=1,l[u++]=1,l[u++]=1,l[u++]=0,l[u++]=0,l[u++]=1,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=1,l[u++]=1,l[u++]=1,l[u++]=0,l[u++]=1,l[u++]=1,a.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:l})}if(r.tangent){var c=new Float32Array(72);c[0]=1,c[1]=0,c[2]=0,c[3]=1,c[4]=0,c[5]=0,c[6]=1,c[7]=0,c[8]=0,c[9]=1,c[10]=0,c[11]=0,c[12]=-1,c[13]=0,c[14]=0,c[15]=-1,c[16]=0,c[17]=0,c[18]=-1,c[19]=0,c[20]=0,c[21]=-1,c[22]=0,c[23]=0,c[24]=0,c[25]=1,c[26]=0,c[27]=0,c[28]=1,c[29]=0,c[30]=0,c[31]=1,c[32]=0,c[33]=0,c[34]=1,c[35]=0,c[36]=0,c[37]=-1,c[38]=0,c[39]=0,c[40]=-1,c[41]=0,c[42]=0,c[43]=-1,c[44]=0,c[45]=0,c[46]=-1,c[47]=0,c[48]=-1,c[49]=0,c[50]=0,c[51]=-1,c[52]=0,c[53]=0,c[54]=-1,c[55]=0,c[56]=0,c[57]=-1,c[58]=0,c[59]=0,c[60]=1,c[61]=0,c[62]=0,c[63]=1,c[64]=0,c[65]=0,c[66]=1,c[67]=0,c[68]=0,c[69]=1,c[70]=0,c[71]=0,a.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:c})}if(r.bitangent){var h=new Float32Array(72);h[0]=0,h[1]=1,h[2]=0,h[3]=0,h[4]=1,h[5]=0,h[6]=0,h[7]=1,h[8]=0,h[9]=0,h[10]=1,h[11]=0,h[12]=0,h[13]=1,h[14]=0,h[15]=0,h[16]=1,h[17]=0,h[18]=0,h[19]=1,h[20]=0,h[21]=0,h[22]=1,h[23]=0,h[24]=0,h[25]=0,h[26]=1,h[27]=0,h[28]=0,h[29]=1,h[30]=0,h[31]=0,h[32]=1,h[33]=0,h[34]=0,h[35]=1,h[36]=0,h[37]=0,h[38]=1,h[39]=0,h[40]=0,h[41]=1,h[42]=0,h[43]=0,h[44]=1,h[45]=0,h[46]=0,h[47]=1,h[48]=0,h[49]=0,h[50]=1,h[51]=0,h[52]=0,h[53]=1,h[54]=0,h[55]=0,h[56]=1,h[57]=0,h[58]=0,h[59]=1,h[60]=0,h[61]=0,h[62]=1,h[63]=0,h[64]=0,h[65]=1,h[66]=0,h[67]=0,h[68]=1,h[69]=0,h[70]=0,h[71]=1,a.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:h})}(n=new Uint16Array(36))[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else(o=new Float64Array(24))[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=i.x,o[4]=t.y,o[5]=t.z,o[6]=i.x,o[7]=i.y,o[8]=t.z,o[9]=t.x,o[10]=i.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=i.z,o[15]=i.x,o[16]=t.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=t.x,o[22]=i.y,o[23]=i.z,a.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:o}),(n=new Uint16Array(36))[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var d=t$X.subtract(i,t,W$W),f=.5*t$X.magnitude(d);if(e$28(e._offsetAttribute)){var p=o.length,_=new Uint8Array(p/3);d$1a(_,e._offsetAttribute===ee$C.NONE?0:1),a.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new I$1n({attributes:a,indices:n,primitiveType:W$_.TRIANGLES,boundingSphere:new i$19(t$X.ZERO,f),offsetAttribute:e._offsetAttribute})}},O$H.getUnitBox=function(){return e$28(u$Q)||(u$Q=O$H.createGeometry(O$H.fromDimensions({dimensions:new t$X(1,1,1),vertexFormat:n$10.POSITION_ONLY}))),u$Q};var B$T=new t$X;function o$1c(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).minimum,i=e.maximum;if(o$1u.typeOf.object("min",t),o$1u.typeOf.object("max",i),e$28(e.offsetAttribute)&&e.offsetAttribute===ee$C.TOP)throw new t$Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=t$X.clone(t),this._max=t$X.clone(i),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}o$1c.fromDimensions=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).dimensions;o$1u.typeOf.object("dimensions",t),o$1u.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);var i=t$X.multiplyByScalar(t,.5,new t$X);return new o$1c({minimum:t$X.negate(i,new t$X),maximum:i,offsetAttribute:e.offsetAttribute})},o$1c.fromAxisAlignedBoundingBox=function(e){return o$1u.typeOf.object("boundindBox",e),new o$1c({minimum:e.minimum,maximum:e.maximum})},o$1c.packedLength=2*t$X.packedLength+1,o$1c.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t$X.pack(e._min,t,i),t$X.pack(e._max,t,i+t$X.packedLength),t[i+2*t$X.packedLength]=u$Y(e._offsetAttribute,-1),t};var y$X=new t$X,A$12=new t$X,v$H={minimum:y$X,maximum:A$12,offsetAttribute:void 0},n$$;function t$L(e){n$$(e)}function N$P(){}function n$_(){this.times=void 0,this.points=void 0,t$Z.throwInstantiationError()}function r$12(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times;if(!e$28(t)||!e$28(i))throw new t$Z("points and times are required.");if(t.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new t$Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._lastTimeIndex=0}o$1c.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=t$X.unpack(e,t,y$X),n=t$X.unpack(e,t+t$X.packedLength,A$12),o=e[t+2*t$X.packedLength];return e$28(i)?(i._min=t$X.clone(r,i._min),i._max=t$X.clone(n,i._max),i._offsetAttribute=-1===o?void 0:o,i):(v$H.offsetAttribute=-1===o?void 0:o,new o$1c(v$H))},o$1c.createGeometry=function(e){var t=e._min,i=e._max;if(!t$X.equals(t,i)){var r=new a$_,n=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=i.x,o[4]=t.y,o[5]=t.z,o[6]=i.x,o[7]=i.y,o[8]=t.z,o[9]=t.x,o[10]=i.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=i.z,o[15]=i.x,o[16]=t.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=t.x,o[22]=i.y,o[23]=i.z,r.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:o}),n[0]=4,n[1]=5,n[2]=5,n[3]=6,n[4]=6,n[5]=7,n[6]=7,n[7]=4,n[8]=0,n[9]=1,n[10]=1,n[11]=2,n[12]=2,n[13]=3,n[14]=3,n[15]=0,n[16]=0,n[17]=4,n[18]=1,n[19]=5,n[20]=2,n[21]=6,n[22]=3,n[23]=7;var a=t$X.subtract(i,t,B$T),s=.5*t$X.magnitude(a);if(e$28(e._offsetAttribute)){var l=o.length,u=new Uint8Array(l/3);d$1a(u,e._offsetAttribute===ee$C.NONE?0:1),r.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new I$1n({attributes:r,indices:n,primitiveType:W$_.LINES,boundingSphere:new i$19(t$X.ZERO,s),offsetAttribute:e._offsetAttribute})}},typeof cancelAnimationFrame<"u"&&(n$$=cancelAnimationFrame),function(){if(!e$28(n$$)&&typeof window<"u")for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!e$28(n$$);)e$28(n$$=window[e[t]+"CancelAnimationFrame"])||(n$$=window[e[t]+"CancelRequestAnimationFrame"]),++t;e$28(n$$)||(n$$=clearTimeout)}(),N$P.prototype.geocode=function(e){o$1u.typeOf.string("query",e);var t=e.match(/[^\s,\n]+/g);if(2===t.length||3===t.length){var i=+t[0],r=+t[1],n=3===t.length?+t[2]:300;if(isNaN(i)&&isNaN(r))for(var o=/^(\d+.?\d*)([nsew])/i,a=0;a<t.length;++a){var s=t[a].match(o);o.test(t[a])&&3===s.length&&(/^[ns]/i.test(s[2])?r=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(i=/^[e]/i.test(s[2])?+s[1]:-s[1]))}if(!isNaN(i)&&!isNaN(r)&&!isNaN(n)){var l={displayName:e,destination:t$X.fromDegrees(i,r,n)};return o$1q.resolve([l])}}return o$1q.resolve([])},n$_.prototype.evaluate=t$Z.throwInstantiationError,n$_.prototype.findTimeInterval=function(e,t){var i,r=this.times,n=r.length;if(!e$28(e))throw new t$Z("time is required.");if(e<r[0]||e>r[n-1])throw new t$Z("time is out of range.");if(e>=r[t=u$Y(t,0)]){if(t+1<n&&e<r[t+1])return t;if(t+2<n&&e<r[t+2])return t+1}else if(t-1>=0&&e>=r[t-1])return t-1;if(e>r[t])for(i=t;i<n-1&&!(e>=r[i]&&e<r[i+1]);++i);else for(i=t-1;i>=0&&!(e>=r[i]&&e<r[i+1]);--i);return i===n-1&&(i=n-2),i},n$_.prototype.wrapTime=function(e){o$1u.typeOf.number("time",e);var t=this.times,i=t[t.length-1],r=t[0],n=i-r;return e<r&&(e+=(Math.floor((r-e)/n)+1)*n),e>i&&(e-=(Math.floor((e-i)/n)+1)*n),e},n$_.prototype.clampTime=function(e){o$1u.typeOf.number("time",e);var t=this.times;return e$27.clamp(e,t[0],t[t.length-1])},Object.defineProperties(r$12.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),r$12.prototype.findTimeInterval=n$_.prototype.findTimeInterval,r$12.prototype.wrapTime=n$_.prototype.wrapTime,r$12.prototype.clampTime=n$_.prototype.clampTime,r$12.prototype.evaluate=function(e,t){var i=this.points,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-r[n])/(r[n+1]-r[n]);return e$28(t)||(t=new t$X),t$X.lerp(i[n],i[n+1],o,t)};var m$Z={solve:function(e,t,i,r){if(!(e$28(e)&&e instanceof Array))throw new t$Z("The array lower is required.");if(!(e$28(t)&&t instanceof Array))throw new t$Z("The array diagonal is required.");if(!(e$28(i)&&i instanceof Array))throw new t$Z("The array upper is required.");if(!(e$28(r)&&r instanceof Array))throw new t$Z("The array right is required.");if(t.length!==r.length)throw new t$Z("diagonal and right must have the same lengths.");if(e.length!==i.length)throw new t$Z("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new t$Z("lower and upper must be one less than the length of diagonal.");var n,o,a=new Array(i.length),s=new Array(r.length),l=new Array(r.length);for(n=0;n<s.length;n++)s[n]=new t$X,l[n]=new t$X;for(a[0]=i[0]/t[0],s[0]=t$X.multiplyByScalar(r[0],1/t[0],s[0]),n=1;n<a.length;++n)o=1/(t[n]-a[n-1]*e[n-1]),a[n]=i[n]*o,s[n]=t$X.subtract(r[n],t$X.multiplyByScalar(s[n-1],e[n-1],s[n]),s[n]),s[n]=t$X.multiplyByScalar(s[n],o,s[n]);for(o=1/(t[n]-a[n-1]*e[n-1]),s[n]=t$X.subtract(r[n],t$X.multiplyByScalar(s[n-1],e[n-1],s[n]),s[n]),s[n]=t$X.multiplyByScalar(s[n],o,s[n]),l[l.length-1]=s[s.length-1],n=l.length-2;n>=0;--n)l[n]=t$X.subtract(s[n],t$X.multiplyByScalar(l[n+1],a[n],l[n]),l[n]);return l}},y$W=[],b$13=[],_$U=[],B$S=[];function C$W(e,t,i){var r,n=y$W,o=_$U,a=b$13,s=B$S;n.length=o.length=e.length-1,a.length=s.length=e.length,n[0]=a[0]=1,o[0]=0;var l=s[0];for(e$28(l)||(l=s[0]=new t$X),t$X.clone(t,l),r=1;r<n.length-1;++r)n[r]=o[r]=1,a[r]=4,e$28(l=s[r])||(l=s[r]=new t$X),t$X.subtract(e[r+1],e[r-1],l),t$X.multiplyByScalar(l,3,l);return n[r]=0,o[r]=1,a[r]=4,e$28(l=s[r])||(l=s[r]=new t$X),t$X.subtract(e[r+1],e[r-1],l),t$X.multiplyByScalar(l,3,l),a[r+1]=1,e$28(l=s[r+1])||(l=s[r+1]=new t$X),t$X.clone(i,l),m$Z.solve(n,a,o,s)}function q$12(e){var t,i=y$W,r=_$U,n=b$13,o=B$S;i.length=r.length=e.length-1,n.length=o.length=e.length,i[0]=r[0]=1,n[0]=2;var a=o[0];for(e$28(a)||(a=o[0]=new t$X),t$X.subtract(e[1],e[0],a),t$X.multiplyByScalar(a,3,a),t=1;t<i.length;++t)i[t]=r[t]=1,n[t]=4,e$28(a=o[t])||(a=o[t]=new t$X),t$X.subtract(e[t+1],e[t-1],a),t$X.multiplyByScalar(a,3,a);return n[t]=2,e$28(a=o[t])||(a=o[t]=new t$X),t$X.subtract(e[t],e[t-1],a),t$X.multiplyByScalar(a,3,a),m$Z.solve(i,n,r,o)}function m$Y(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times,r=e.inTangents,n=e.outTangents;if(!(e$28(t)&&e$28(i)&&e$28(r)&&e$28(n)))throw new t$Z("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new t$Z("times.length must be equal to points.length.");if(r.length!==n.length||r.length!==t.length-1)throw new t$Z("inTangents and outTangents must have a length equal to points.length - 1.");this._times=i,this._points=t,this._inTangents=r,this._outTangents=n,this._lastTimeIndex=0}Object.defineProperties(m$Y.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),m$Y.createC1=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).times,i=e.points,r=e.tangents;if(!e$28(i)||!e$28(t)||!e$28(r))throw new t$Z("points, times and tangents are required.");if(i.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(t.length!==i.length||t.length!==r.length)throw new t$Z("times, points and tangents must have the same length.");var n=r.slice(0,r.length-1);return new m$Y({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:n})},m$Y.createNaturalCubic=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).times,i=e.points;if(!e$28(i)||!e$28(t))throw new t$Z("points and times are required.");if(i.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(t.length!==i.length)throw new t$Z("times.length must be equal to points.length.");if(i.length<3)return new r$12({points:i,times:t});var r=q$12(i),n=r.slice(0,r.length-1);return new m$Y({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:n})},m$Y.createClampedCubic=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).times,i=e.points,r=e.firstTangent,n=e.lastTangent;if(!(e$28(i)&&e$28(t)&&e$28(r)&&e$28(n)))throw new t$Z("points, times, firstTangent and lastTangent are required.");if(i.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(t.length!==i.length)throw new t$Z("times.length must be equal to points.length.");if(i.length<3)return new r$12({points:i,times:t});var o=C$W(i,r,n),a=o.slice(0,o.length-1);return new m$Y({times:t,points:i,inTangents:o.slice(1,o.length),outTangents:a})},m$Y.hermiteCoefficientMatrix=new y$15(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),m$Y.prototype.findTimeInterval=n$_.prototype.findTimeInterval;var x$10=new e$25,c$$=new t$X;m$Y.prototype.wrapTime=n$_.prototype.wrapTime,m$Y.prototype.clampTime=n$_.prototype.clampTime,m$Y.prototype.evaluate=function(e,t){e$28(t)||(t=new t$X);var i=this.points,r=this.times,n=this.inTangents,o=this.outTangents,a=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),s=(e-r[a])/(r[a+1]-r[a]),l=x$10;l.z=s,l.y=s*s,l.x=l.y*s,l.w=1;var u=y$15.multiplyByVector(m$Y.hermiteCoefficientMatrix,l,l);return t=t$X.multiplyByScalar(i[a],u.x,t),t$X.multiplyByScalar(i[a+1],u.y,c$$),t$X.add(t,c$$,t),t$X.multiplyByScalar(o[a],u.z,c$$),t$X.add(t,c$$,t),t$X.multiplyByScalar(n[a],u.w,c$$),t$X.add(t,c$$,t)};var M$$=new e$25,C$V=new t$X,s$Q=new t$X;function V$P(e){var t=e.points,i=e.times;if(t.length<3){var r=i[0],n=1/(i[1]-r),o=t[0],a=t[1];return function(e,t){e$28(t)||(t=new t$X);var i=(e-r)*n;return t$X.lerp(o,a,i,t)}}return function(r,n){e$28(n)||(n=new t$X);var o,a,s,l,u,c=e._lastTimeIndex=e.findTimeInterval(r,e._lastTimeIndex),h=(r-i[c])/(i[c+1]-i[c]),d=M$$;return d.z=h,d.y=h*h,d.x=d.y*h,d.w=1,0===c?(o=t[0],a=t[1],s=e.firstTangent,l=t$X.subtract(t[2],o,C$V),t$X.multiplyByScalar(l,.5,l),u=y$15.multiplyByVector(m$Y.hermiteCoefficientMatrix,d,d)):c===t.length-2?(o=t[c],a=t[c+1],l=e.lastTangent,s=t$X.subtract(a,t[c-1],C$V),t$X.multiplyByScalar(s,.5,s),u=y$15.multiplyByVector(m$Y.hermiteCoefficientMatrix,d,d)):(o=t[c-1],a=t[c],s=t[c+1],l=t[c+2],u=y$15.multiplyByVector(c$_.catmullRomCoefficientMatrix,d,d)),n=t$X.multiplyByScalar(o,u.x,n),t$X.multiplyByScalar(a,u.y,s$Q),t$X.add(n,s$Q,n),t$X.multiplyByScalar(s,u.z,s$Q),t$X.add(n,s$Q,n),t$X.multiplyByScalar(l,u.w,s$Q),t$X.add(n,s$Q,n)}}var O$G=new t$X,E$15=new t$X;function c$_(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times,r=e.firstTangent,n=e.lastTangent;if(o$1u.defined("points",t),o$1u.defined("times",i),o$1u.typeOf.number.greaterThanOrEquals("points.length",t.length,2),o$1u.typeOf.number.equals("times.length","points.length",i.length,t.length),t.length>2&&(e$28(r)||(r=O$G,t$X.multiplyByScalar(t[1],2,r),t$X.subtract(r,t[2],r),t$X.subtract(r,t[0],r),t$X.multiplyByScalar(r,.5,r)),!e$28(n))){var o=t.length-1;n=E$15,t$X.multiplyByScalar(t[o-1],2,n),t$X.subtract(t[o],n,n),t$X.add(n,t[o-2],n),t$X.multiplyByScalar(n,.5,n)}this._times=i,this._points=t,this._firstTangent=t$X.clone(r),this._lastTangent=t$X.clone(n),this._evaluateFunction=V$P(this),this._lastTimeIndex=0}function a$Z(e,t,i,r){if(!e$28(e))throw new t$Z("uint8Array is required.");if(t<0)throw new t$Z("byteOffset cannot be negative.");if(i<0)throw new t$Z("byteLength cannot be negative.");if(t+i>e.byteLength)throw new t$Z("sub-region exceeds array bounds.");return t=u$Y(t,0),i=u$Y(i,e.byteLength-t),r=u$Y(r,"utf-8"),e=e.subarray(t,t+i),a$Z.decode(e,r)}function f$_(e,t,i){return t<=e&&e<=i}function g$Q(e){for(var t=0,i=0,r=0,n=128,o=191,a=[],s=e.length,l=0;l<s;++l){var u=e[l];if(0===r){if(f$_(u,0,127)){a.push(u);continue}if(f$_(u,194,223)){r=1,t=31&u;continue}if(f$_(u,224,239)){224===u&&(n=160),237===u&&(o=159),r=2,t=15&u;continue}if(f$_(u,240,244)){240===u&&(n=144),244===u&&(o=143),r=3,t=7&u;continue}throw new t$U("String decoding failed.")}f$_(u,n,o)?(n=128,o=191,t=t<<6|63&u,++i===r&&(a.push(t),t=r=i=0)):(t=r=i=0,n=128,o=191,--l)}return a}Object.defineProperties(c$_.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c$_.catmullRomCoefficientMatrix=new y$15(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c$_.prototype.findTimeInterval=n$_.prototype.findTimeInterval,c$_.prototype.wrapTime=n$_.prototype.wrapTime,c$_.prototype.clampTime=n$_.prototype.clampTime,c$_.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},a$Z.decodeWithTextDecoder=function(e,t){return new TextDecoder(t).decode(e)},a$Z.decodeWithFromCharCode=function(e){for(var t="",i=g$Q(e),r=i.length,n=0;n<r;++n){var o=i[n];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return t},typeof TextDecoder<"u"?a$Z.decode=a$Z.decodeWithTextDecoder:a$Z.decode=a$Z.decodeWithFromCharCode;var d$19={};function p$_(e){if(!e$28(e)||!e$28(e.quantizedVertices))throw new t$Z("options.quantizedVertices is required.");if(!e$28(e.indices))throw new t$Z("options.indices is required.");if(!e$28(e.minimumHeight))throw new t$Z("options.minimumHeight is required.");if(!e$28(e.maximumHeight))throw new t$Z("options.maximumHeight is required.");if(!e$28(e.boundingSphere))throw new t$Z("options.boundingSphere is required.");if(!e$28(e.horizonOcclusionPoint))throw new t$Z("options.horizonOcclusionPoint is required.");if(!e$28(e.westIndices))throw new t$Z("options.westIndices is required.");if(!e$28(e.southIndices))throw new t$Z("options.southIndices is required.");if(!e$28(e.eastIndices))throw new t$Z("options.eastIndices is required.");if(!e$28(e.northIndices))throw new t$Z("options.northIndices is required.");if(!e$28(e.westSkirtHeight))throw new t$Z("options.westSkirtHeight is required.");if(!e$28(e.southSkirtHeight))throw new t$Z("options.southSkirtHeight is required.");if(!e$28(e.eastSkirtHeight))throw new t$Z("options.eastSkirtHeight is required.");if(!e$28(e.northSkirtHeight))throw new t$Z("options.northSkirtHeight is required.");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 o(e,t){return i[e]-i[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=y$V(e.westIndices,n,t),this._southIndices=y$V(e.southIndices,o,t),this._eastIndices=y$V(e.eastIndices,n,t),this._northIndices=y$V(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=u$Y(e.childTileMask,15),this._createdByUpsampling=u$Y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0,this._normalTexture=e.normalTexture,this.invalid=u$Y(e.invalid,!1),0===this._maximumHeight&&(this.invalid=!0),this.rasterIndex=e.rasterIndex,this.rasterVertex=e.rasterVertex,this.modelMatrix=e.modelMatrix,this.hasInvalid=e.hasInvalid,this._validMinimumHeight=e.validMinimumHeight,this._validMaximumHeight=e.validMaximumHeight,this._validOrientedBoundingBox=e.validOrientedBoundingBox}d$19.clipTriangleAtAxisAlignedThreshold=function(e,t,i,r,n,o){if(!e$28(e))throw new t$Z("threshold is required.");if(!e$28(t))throw new t$Z("keepAbove is required.");if(!e$28(i))throw new t$Z("u0 is required.");if(!e$28(r))throw new t$Z("u1 is required.");if(!e$28(n))throw new t$Z("u2 is required.");var a,s,l;e$28(o)?o.length=0:o=[],t?(a=i<e,s=r<e,l=n<e):(a=i>e,s=r>e,l=n>e);var u,c,h,d,f,p,_=a+s+l;return 1===_?a?(u=(e-i)/(r-i),c=(e-i)/(n-i),o.push(1),o.push(2),1!==c&&(o.push(-1),o.push(0),o.push(2),o.push(c)),1!==u&&(o.push(-1),o.push(0),o.push(1),o.push(u))):s?(h=(e-r)/(n-r),d=(e-r)/(i-r),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==h&&(o.push(-1),o.push(1),o.push(2),o.push(h))):l&&(f=(e-n)/(i-n),p=(e-n)/(r-n),o.push(0),o.push(1),1!==p&&(o.push(-1),o.push(2),o.push(1),o.push(p)),1!==f&&(o.push(-1),o.push(2),o.push(0),o.push(f))):2===_?a||i===e?s||r===e?!l&&n!==e&&(c=(e-i)/(n-i),h=(e-r)/(n-r),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(c),o.push(-1),o.push(1),o.push(2),o.push(h)):(p=(e-n)/(r-n),u=(e-i)/(r-i),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(p),o.push(-1),o.push(0),o.push(1),o.push(u)):(d=(e-r)/(i-r),f=(e-n)/(i-n),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(d),o.push(-1),o.push(2),o.push(0),o.push(f)):3!==_&&(o.push(0),o.push(1),o.push(2)),o},d$19.computeBarycentricCoordinates=function(e,t,i,r,n,o,a,s,l){if(!e$28(e))throw new t$Z("x is required.");if(!e$28(t))throw new t$Z("y is required.");if(!e$28(i))throw new t$Z("x1 is required.");if(!e$28(r))throw new t$Z("y1 is required.");if(!e$28(n))throw new t$Z("x2 is required.");if(!e$28(o))throw new t$Z("y2 is required.");if(!e$28(a))throw new t$Z("x3 is required.");if(!e$28(s))throw new t$Z("y3 is required.");var u=i-a,c=a-n,h=o-s,d=r-s,f=1/(h*u+c*d),p=t-s,_=e-a,m=(h*_+c*p)*f,$=(-d*_+u*p)*f,g=1-m-$;return e$28(l)?(l.x=m,l.y=$,l.z=g,l):new t$X(m,$,g)},d$19.computeLineSegmentLineSegmentIntersection=function(e,t,i,r,n,o,a,s,l){o$1u.typeOf.number("x00",e),o$1u.typeOf.number("y00",t),o$1u.typeOf.number("x01",i),o$1u.typeOf.number("y01",r),o$1u.typeOf.number("x10",n),o$1u.typeOf.number("y10",o),o$1u.typeOf.number("x11",a),o$1u.typeOf.number("y11",s);var u=(s-o)*(i-e)-(a-n)*(r-t);if(0!==u){var c=((a-n)*(t-o)-(s-o)*(e-n))/u,h=((i-e)*(t-o)-(r-t)*(e-n))/u;if(c>=0&&c<=1&&h>=0&&h<=1)return e$28(l)||(l=new o$1k),l.x=e+c*(i-e),l.y=t+c*(r-t),l}},Object.defineProperties(p$_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return e$28(this._mesh)}},normalTexture:{get:function(){return this._normalTexture}}});var B$R=[];function y$V(e,t,i){B$R.length=e.length;for(var r=!1,n=0,o=e.length;n<o;++n)B$R[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(B$R.sort(t),ce$v.createTypedArray(i,B$R)):e}var F$13=new i$W("createVerticesFromQuantizedTerrainMesh");p$_.prototype.createMesh=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("tilingScheme is required.");if(!e$28(t))throw new t$Z("x is required.");if(!e$28(i))throw new t$Z("y is required.");if(!e$28(r))throw new t$Z("level is required.");var o=e.ellipsoid,a=e.tileXYToRectangle(t,i,r);n=u$Y(n,1);var s=F$13.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,validMinimumHeight:this._validMinimumHeight,validMaximumHeight:this._validMaximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:a,relativeToCenter:this._boundingSphere.center,ellipsoid:o,exaggeration:n,level:r});if(e$28(s)){var l=this;return o$1q(s,(function(e){var t=l._quantizedVertices.length/3,i=t+l._westIndices.length+l._southIndices.length+l._eastIndices.length+l._northIndices.length,r=ce$v.createTypedArray(i,e.indices),o=new Float32Array(e.vertices),a=e.center,s=e.minimumHeight,u=e.maximumHeight,c=u$Y(i$19.clone(e.boundingSphere),l._boundingSphere),h=u$Y(x$13.clone(e.orientedBoundingBox),l._orientedBoundingBox),d=u$Y(x$13.clone(e.validOrientedBoundingBox),l._validOrientedBoundingBox),f=u$Y(t$X.clone(e.occludeePointInScaledSpace),l._horizonOcclusionPoint),p=e.vertexStride,_=h$T.clone(e.encoding),m=0===r.length||0===u||l.invalid;return l._mesh=new T$T(a,o,r,e.indexCountWithoutSkirts,t,s,u,c,f,p,h,_,n,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast,m,d),l._quantizedVertices=void 0,l._encodedNormals=void 0,l._indices=void 0,l._uValues=void 0,l._vValues=void 0,l._heightValues=void 0,l._westIndices=void 0,l._southIndices=void 0,l._eastIndices=void 0,l._northIndices=void 0,l._mesh}))}};var X$Q=new i$W("upsampleQuantizedTerrainMesh");p$_.prototype.upsample=function(e,t,i,r,n,o,a){if(!e$28(e))throw new t$Z("tilingScheme is required.");if(!e$28(t))throw new t$Z("thisX is required.");if(!e$28(i))throw new t$Z("thisY is required.");if(!e$28(r))throw new t$Z("thisLevel is required.");if(!e$28(n))throw new t$Z("descendantX is required.");if(!e$28(o))throw new t$Z("descendantY is required.");if(!e$28(a))throw new t$Z("descendantLevel is required.");if(a-r>1)throw new t$Z("Upsampling through more than one level at a time is not currently supported.");var s=this._mesh;if(e$28(this._mesh)){var l=2*t!==n,u=2*i===o,c=e.ellipsoid,h=e.tileXYToRectangle(n,o,a),d=X$Q.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,validMinimumHeight:this._validMinimumHeight,validMaximumHeight:this._validMaximumHeight,isEastChild:l,isNorthChild:u,childRectangle:h,ellipsoid:c,exaggeration:s.exaggeration});if(e$28(d)){var f=Math.min(this._westSkirtHeight,this._eastSkirtHeight);f=Math.min(f,this._southSkirtHeight),f=Math.min(f,this._northSkirtHeight);var p=l?.5*f:this._westSkirtHeight,_=u?.5*f:this._southSkirtHeight,m=l?this._eastSkirtHeight:.5*f,$=u?this._northSkirtHeight:.5*f,g=this._credits;return o$1q(d).then((function(e){var t,i=new Uint16Array(e.vertices),r=ce$v.createTypedArray(i.length/3,e.indices);if(e$28(e.encodedNormals)&&(t=new Uint8Array(e.encodedNormals)),e$28(e.horizonOcclusionPoint))return new p$_({quantizedVertices:i,indices:r,encodedNormals:t,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:i$19.clone(e.boundingSphere),orientedBoundingBox:x$13.clone(e.orientedBoundingBox),horizonOcclusionPoint:t$X.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:p,southSkirtHeight:_,eastSkirtHeight:m,northSkirtHeight:$,childTileMask:0,credits:g,createdByUpsampling:!0,validMaximumHeight:e.validMaximumHeight,validMinimumHeight:e.validMinimumHeight,validOrientedBoundingBox:e.validOrientedBoundingBox})}))}}};var N$O=32767,E$14=new t$X;function R$S(e,t,i,r,n,o,a,s){var l=Math.min(i,n,a),u=Math.max(i,n,a),c=Math.min(r,o,s),h=Math.max(r,o,s);return e>=l&&e<=u&&t>=c&&t<=h}p$_.prototype.interpolateHeight=function(e,t,i){var r=e$27.clamp((t-e.west)/e.width,0,1),n=r*N$O,o=e$27.clamp((i-e.south)/e.height,0,1),a=o*N$O;return e$28(this._mesh)?J$$(this,r,o):K$T(this,n,a)};var Y$M=new o$1k,D$Y=new o$1k,G$18=new o$1k;function J$$(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s<l;s+=3){var u=a[s],c=a[s+1],h=a[s+2],d=o.decodeTextureCoordinates(n,u,Y$M),f=o.decodeTextureCoordinates(n,c,D$Y),p=o.decodeTextureCoordinates(n,h,G$18);if(R$S(t,i,d.x,d.y,f.x,f.y,p.x,p.y)){var _=d$19.computeBarycentricCoordinates(t,i,d.x,d.y,f.x,f.y,p.x,p.y,E$14);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var m=o.decodeHeight(n,u),$=o.decodeHeight(n,c),g=o.decodeHeight(n,h);return _.x*m+_.y*$+_.z*g}}}}function K$T(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var u=a[s],c=a[s+1],h=a[s+2],d=r[u],f=r[c],p=r[h],_=n[u],m=n[c],$=n[h];if(R$S(t,i,d,_,f,m,p,$)){var g=d$19.computeBarycentricCoordinates(t,i,d,_,f,m,p,$,E$14);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=g.x*o[u]+g.y*o[c]+g.z*o[h];return e$27.lerp(e._minimumHeight,e._maximumHeight,v/N$O)}}}}p$_.prototype.isChildAvailable=function(e,t,i,r){if(!e$28(e))throw new t$Z("thisX is required.");if(!e$28(t))throw new t$Z("thisY is required.");if(!e$28(i))throw new t$Z("childX is required.");if(!e$28(r))throw new t$Z("childY is required.");var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},p$_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var _0x2d5d2e=(_0x1dbc4a=!0,function(e,t){var i=_0x1dbc4a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1dbc4a=!1,i}),_0x296ac4=_0x2d5d2e(void 0,(function(){return _0x296ac4.toString().search("(((.+)+)+)+$").toString().constructor(_0x296ac4).search("(((.+)+)+)+$")})),_0x1dbc4a;_0x296ac4();var _0x2723f9={REST:0,KEY_VALUE:1},fi$5=Object.freeze(_0x2723f9);function n$Z(e,t,i){if(!e$28(e))throw new t$Z("first is required");if(!e$28(t))throw new t$Z("second is required");if(i=u$Y(i,!0),e instanceof h$$||(e=new h$$(e)),t instanceof h$$||(t=new h$$(t)),"data"===e.scheme)return e.toString();if("data"===t.scheme)return t.toString();e$28(t.authority)&&!e$28(t.scheme)&&(typeof document<"u"&&e$28(document.location)&&e$28(document.location.href)?t.scheme=new h$$(document.location.href).scheme:t.scheme=e.scheme);var r=e;t.isAbsolute()&&(r=t);var n="";e$28(r.scheme)&&(n+=r.scheme+":"),e$28(r.authority)&&(n+="//"+r.authority,""!==r.path&&"/"!==r.path&&(n=n.replace(/\/?$/,"/"),r.path=r.path.replace(/^\/?/g,""),""===r.authority&&(n+="/"))),n+=r===e?i?e.path.replace(/\/?$/,"/")+t.path.replace(/^\/?/g,""):e.path+t.path:t.path;var o=e$28(e.query),a=e$28(t.query);o&&a?n+="?"+e.query+"&"+t.query:o&&!a?n+="?"+e.query:!o&&a&&(n+="?"+t.query);var s=e$28(t.fragment);return e$28(e.fragment)&&!s?n+="#"+e.fragment:s&&(n+="#"+t.fragment),n}var e$1M={ISERVER_TOKEN:"token",IPORTAL_KEY:"key"},E$13=Object.freeze(e$1M);function a$Y(e,t){this._keymap={},this.addCredential(e,t)}function p$Z(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.url",e.url);var t=e.url,i=e.responseType,r=u$Y(e.method,"GET"),n=e.data,o=e.headers,a=e.overrideMimeType;t=u$Y(t,e.url);var s=e$28(e.request)?e.request:new r$1c;return s.url=t,s.requestFunction=function(e){var l=o$1q.defer(),u=p$Z.load(u$Y(e,t),i,r,n,o,l,a);return e$28(u)&&e$28(u.abort)&&(s.cancelFunction=function(){u.abort()}),l.promise},r$1b.request(s)}Object.defineProperties(a$Y.prototype,{value:{get:function(){return this._value},set:function(e){this._value=e}},name:{get:function(){return this._name},set:function(e){this._name=e}}}),a$Y.addToken=function(e){var t,i=e.substring(0,e.indexOf("/realspace")+10);if(e$28(a$Y.CREDENTIAL._keymap[i]))switch(a$Y.CREDENTIAL._keymap[i].type){case E$13.ISERVER_TOKEN:t="?"+m$1k({token:a$Y.CREDENTIAL._keymap[i].value});break;case E$13.IPORTAL_KEY:t="?"+m$1k({key:a$Y.CREDENTIAL._keymap[i].value});break;default:t=""}else switch(a$Y.CREDENTIAL.name){case E$13.ISERVER_TOKEN:t="?"+m$1k({token:a$Y.CREDENTIAL.value});break;case E$13.IPORTAL_KEY:t="?"+m$1k({key:a$Y.CREDENTIAL.value});break;default:t="?"+a$Y.CREDENTIAL.name+"="+a$Y.CREDENTIAL.value}return n$Z(e,t,!1)},a$Y.addTokenWithKey=function(e,t){var i;if(e$28(a$Y.CREDENTIAL._keymap[e])){if(a$Y.CREDENTIAL._keymap[e].type instanceof Array){var r,n=a$Y.CREDENTIAL._keymap[e].type,o=a$Y.CREDENTIAL._keymap[e].value;(s={})[n[0]]=o[0],r=n$Z(t,"?"+m$1k(s),!1);for(var a=1;a<n.length;a++){(s={})[n[a]]=o[a],r=r+"&"+m$1k(s)}return r}switch(a$Y.CREDENTIAL._keymap[e].type){case E$13.ISERVER_TOKEN:i="?"+m$1k({token:a$Y.CREDENTIAL._keymap[e].value});break;case E$13.IPORTAL_KEY:i="?"+m$1k({key:a$Y.CREDENTIAL._keymap[e].value});break;default:var s;(s={})[a$Y.CREDENTIAL._keymap[e].type]=a$Y.CREDENTIAL._keymap[e].value,i="?"+m$1k(s)}}else switch(a$Y.CREDENTIAL.name){case E$13.ISERVER_TOKEN:i="?"+m$1k({token:a$Y.CREDENTIAL.value});break;case E$13.IPORTAL_KEY:i="?"+m$1k({key:a$Y.CREDENTIAL.value});break;default:i="?"+a$Y.CREDENTIAL.name+"="+a$Y.CREDENTIAL.value}return n$Z(t,i,!1)},a$Y.prototype.addCredential=function(e,t){if(e instanceof Array){for(var i=0,r=e.length;i<r;i++)if(this._keymap[e[i].rooturl]={type:e[i].type||E$13.ISERVER_TOKEN,value:e[i].value},-1!==e[i].rooturl.indexOf("/realspace")){var n=e[i].rooturl.substring(0,e[i].rooturl.lastIndexOf("/realspace")+10);this._keymap[n]={type:e[i].type||E$13.ISERVER_TOKEN,value:e[i].value}}}else{if(this._value=u$Y(e,""),null==e)throw new t$Z("Credential.value is necessory.");this._name=u$Y(t,E$13.ISERVER_TOKEN),this._keymap.default={type:this._name,value:this._value}}},a$Y.CREDENTIAL=null;var j$15=/^data:(.*?)(;base64)?,(.*)$/;function h$R(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function b$12(e,t){for(var i=h$R(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function C$U(e,t){t=u$Y(t,"");var i=e[1],r=!!e[2],n=e[3];switch(t){case"":case"text":return h$R(r,n);case"arraybuffer":return b$12(r,n);case"blob":var o=b$12(r,n);return new Blob([o],{type:i});case"document":return(new DOMParser).parseFromString(h$R(r,n),i);case"json":return JSON.parse(h$R(r,n));default:throw new t$Z("Unhandled responseType: "+t)}}function u$P(e,t,i){return p$Z({url:e,headers:t,request:i})}p$Z.load=function(e,t,i,r,n,o,a){var s=j$15.exec(e);if(null===s){var l=new XMLHttpRequest;if(u$V.contains(e)&&(l.withCredentials=!0),e$28(a)&&e$28(l.overrideMimeType)&&l.overrideMimeType(a),l.open(i,e,!0),e$28(n))for(var u in n)n.hasOwnProperty(u)&&l.setRequestHeader(u,n[u]);e$28(t)&&(l.responseType=t);var c=!1;return"string"==typeof e&&(c=0===e.indexOf("file://")),l.onload=function(){if(!(l.status<200||l.status>=300)||c&&0===l.status){var e=l.response,i=l.responseType;if(!e$28(e)||e$28(t)&&i!==t)if("json"===t&&"string"==typeof e)try{o.resolve(JSON.parse(e))}catch(e){o.reject(e)}else(""===i||"document"===i)&&e$28(l.responseXML)&&l.responseXML.hasChildNodes()?o.resolve(l.responseXML):""!==i&&"text"!==i||!e$28(l.responseText)?o.reject(new t$U("Invalid XMLHttpRequest response type.")):o.resolve(l.responseText);else o.resolve(e)}else o.reject(new s$Y(l.status,l.response,l.getAllResponseHeaders()))},l.onerror=function(e){o.reject(new s$Y)},l.send(r),l}o.resolve(C$U(s,t))},p$Z.defaultLoad=p$Z.load;var s$P=function(){this.xmldom=null};s$P.prototype.read=function(e){var t,i=e.indexOf("<");return i>0&&(e=e.substring(i)),DOMParser?(this.xmldom||(this.xmldom=new DOMParser),(t=this.xmldom).parseFromString(e,"text/xml")):(this.xmldom||(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")),(t=this.xmldom).loadXML(e),t)},s$P.getElementsByTagNameNS=function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var n,o,a=e.getElementsByTagName("*"),s=0,l=a.length;s<l;++s)o=(n=a[s]).prefix?n.prefix+":"+i:i,("*"===i||o===n.nodeName)&&("*"===t||t===n.namespaceURI)&&r.push(n);return r},s$P.getAttributeNodeNS=function(e,t,i){var r=null;if(e.getAttributeNodeNS)r=e.getAttributeNodeNS(t,i);else for(var n,o=e.attributes,a=0,s=o.length;a<s;++a)if((n=o[a]).namespaceURI===t&&(n.prefix?n.prefix+":"+i:i)===n.nodeName){r=n;break}return r},s$P.getChildValue=function(e,t){var i=t||"";if(e)for(var r=e.firstChild;r;r=r.nextSibling)switch(r.nodeType){case 3:case 4:i+=r.nodeValue}return i},s$P.queryNumericAttribute=function(e,t){if(e$28(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}},s$P.queryStringAttribute=function(e,t){if(e$28(e)){var i=e.getAttribute(t);return null!==i?i:void 0}},s$P.queryBooleanAttribute=function(e,t){if(e$28(e)){var i=e.getAttribute(t);if("false"===(i=i.toLowerCase()))return!1;if("true"===i)return!0}},s$P.queryFirstNode=function(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(i){if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}else if(a.localName===t)return a}},s$P.queryNodes=function(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];i?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}},s$P.queryChildNodes=function(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];i?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r},s$P.queryNumericValue=function(e,t,i){var r=s$P.queryFirstNode(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}},s$P.queryStringValue=function(e,t,i){var r=s$P.queryFirstNode(e,t,i);if(e$28(r))return r.textContent.trim()},s$P.queryBooleanValue=function(e,t,i){var r=s$P.queryFirstNode(e,t,i);if(e$28(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}};var d$18={NONE:0,STORING:1,STORED:2,FAILED:3};function l$11(e){if(!e$28(e.name))throw new t$Z("options.name is required.");var t=o$1q.defer();this.dbname=e.name;var i=indexedDB.open(this.dbname),r=this;return i.onsuccess=function(e){r.db=e.target.result,r.version=r.db.version,e$28(r.cachestatus)||(r.cachestatus={}),t.resolve(r)},i.onupgradeneeded=function(e){r.db=e.target.result,r.version=r.db.version,t.resolve(r)},i.onerror=function(e){r.db=null,t.reject("create database fail, error code : "+e.target.errorcode)},this.layer=e.layer||null,this.storageType=e.storageType||"arrayBuffer",this.creatingTable=!1,this.cachestatus={},t.promise}function i$U(e,t){return 0!=(e&t)}l$11.prototype.checkObjectStoreExit=function(e){return!!e$28(this.db)&&this.db.objectStoreNames.contains(e)},l$11.prototype.createObjectStore=function(e){var t=o$1q.defer();if(this.creatingTable)t.reject(!1);else{if(this.db.objectStoreNames.contains(e))return t.reject(!1),t.promise;this.creatingTable=!0;var i=this,r=parseInt(i.db.version);i.db.close();var n=indexedDB.open(i.dbname,r+1);n.onupgradeneeded=function(n){var o=n.target.result;i.db=o;var a=o.createObjectStore(e,{keyPath:"id"});e$28(a)?(a.createIndex("value","value",{unique:!1}),e$28(i.cachestatus)||(i.cachestatus={}),i.cachestatus[e]={},indexedDB.open(i.dbname,r+2).onsuccess=function(e){i.creatingTable=!1;var r=e.target.result;i.db=r,t.resolve(!0)}):(i.creatingTable=!1,t.reject(!1))},n.onsuccess=function(e){i.creatingTable=!1,e.target.result.close(),t.resolve(!0)},n.onerror=function(e){i.creatingTable=!1,t.reject(!1)}}return t.promise},l$11.prototype.putElementInDB=function(e,t,i,r){var n=o$1q.defer();if(!e$28(this.db))return n.reject(!1),n.promise;var o,a=this;if(e$28(a.cachestatus[e])&&!e$28(r)&&e$28(a.cachestatus[e][t])&&(a.cachestatus[e][t]===d$18.STORING||a.cachestatus[e][t]===d$18.STORED))return n.resolve(!1),n.promise;if(this.db.objectStoreNames.contains(e)){var s;e$28(a.cachestatus[e])||(a.cachestatus[e]={});try{s=this.db.transaction([e],"readwrite")}catch{return n.reject(null),n.promise}if(o=s.objectStore(e),e$28(r))if(r instanceof Array){for(var l=0,u=r.length;l<u;l++)a.cachestatus[e][r[l].key]!==d$18.STORED&&(o.add({id:r[l].key,value:r[l].value}),a.cachestatus[e][r[l].key]=d$18.STORED);n.resolve(!0)}else{for(var t in r)isNaN(1*t)||o.add({id:t,value:r[t]});n.resolve(!0)}else{if(!e$28(t)||!e$28(i))return;if(t instanceof Array&&i instanceof Array){for(l=0,u=t.length;l<u;l++)a.cachestatus[e][t[l]]!==d$18.STORED&&(o.add({id:t[l],value:i[l]}),a.cachestatus[e][t[l]]=d$18.STORED);s.oncomplete=function(e){n.resolve(!0)},s.onerror=function(e){n.reject(!1)}}else{var c=o.add({id:t,value:i});a.cachestatus[e][t]=d$18.STORING,c.onsuccess=function(i){a.cachestatus[e][t]=d$18.STORED,n.resolve(!0)},c.onerror=function(i){a.cachestatus[e][t]=d$18.FAILED,n.reject(!1)}}}}else this.createObjectStore(e).then((function(s){var l=a.db.transaction([e],"readwrite");if(o=l.objectStore(e),e$28(r)){for(var u=0,c=r.length;u<c;u++)o.add({id:r[u].key,value:r[u].value});n.resolve(!0)}else{var h=o.add({id:t,value:i});h.onsuccess=function(e){n.resolve(!0)},h.onerror=function(e){n.reject(!1)}}}),(function(e){n.reject(!1)}));return n.promise},l$11.prototype.getRangeFromDB=function(e,t){var i,r,n=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return null;try{i=this.db.transaction([e])}catch{return n.reject(null),n.promise}try{r=i.objectStore(e)}catch{n.reject(null)}var o=r.openCursor(IDBKeyRange.bound(t[0],t[1])),a=[];return o.onsuccess=function(e){var t=e.target.result;e$28(t)?(a.push(t.value),t.continue()):n.resolve(a)},o.onerror=function(e){n.reject(null)},n.promise},l$11.prototype.getElementFromDB=function(e,t){var i,r,n=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return null;try{i=this.db.transaction([e])}catch{return n.reject(null),n.promise}try{r=i.objectStore(e)}catch{n.reject(null)}var o=r.get(t);return o.onsuccess=function(e){e$28(e.target.result)?n.resolve(e.target.result.value):n.reject(null)},o.onerror=function(e){n.reject(null)},n.promise},l$11.prototype.getAllElementFromDB=function(e){var t,i,r=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return null;if(null!=this.transaction)t=this.transaction;else try{t=this.db.transaction([e])}catch{return r.reject(null),r.promise}try{i=t.objectStore(e)}catch{r.reject(null)}var n=i.getAll();return n.onsuccess=function(e){e$28(e.target.result)?r.resolve(e.target.result):r.reject(null)},n.onerror=function(e){r.reject(null)},r.promise},l$11.prototype.updateElementInDB=function(e,t,i,r){var n=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return n.resolve(!1),n.promise;var o,a=this.db.transaction([e],"readwrite");try{o=a.objectStore(e)}catch{n.resolve(!1)}var s=o.get(t);return s.onsuccess=function(e){var a=e.target.result;e$28(a)||(a={id:t}),a.value=!0===r?Object.assign(a.value,i):i;var s=o.put(a);s.onsuccess=function(e){n.resolve(!0)},s.onerror=function(e){n.resolve(!1)}},s.onerror=function(e){n.resolve(!1)},n.promise},l$11.prototype.removeElementFromDB=function(e,t){var i=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return i.resolve(!1),i.promise;var r,n=this.db.transaction([e],"readwrite");try{r=n.objectStore(e)}catch{i.resolve(!1)}var o=r.delete(t);return o.onerror=function(e){i.resolve(!1)},o.onsuccess=function(e){i.resolve(!0)},i.promise},l$11.prototype.clear=function(e){var t=o$1q.defer();if(!e$28(this.db)||!this.db.objectStoreNames.contains(e))return t.resolve(!1),t.promise;var i,r=this.db.transaction([e],"readwrite");try{i=r.objectStore(e)}catch{t.resolve(!1)}var n=i.clear();return n.onerror=function(e){t.resolve(!1)},n.onsuccess=function(e){t.resolve(!0)},t.promise};var e$1L={None:0,QuadKey:1},ee$B=Object.freeze(e$1L),i$T={Accept:"application/json,*/*;q=0.01"};function u$O(e,t,i){if(!e$28(e))throw new t$Z("url is required.");e$28(t)?e$28(t.Accept)||((t=l$1e(t)).Accept=i$T.Accept):t=i$T;var r=u$P(e,t,i);if(e$28(r))return r.then((function(e){return JSON.parse(e)}))}function d$17(e,t,i){return p$Z({url:e,responseType:"document",headers:t,overrideMimeType:"text/xml",request:i})}const _$T={UNSIGNED_BYTE:de$y.UNSIGNED_BYTE,UNSIGNED_SHORT:de$y.UNSIGNED_SHORT,UNSIGNED_INT:de$y.UNSIGNED_INT,FLOAT:de$y.FLOAT,HALF_FLOAT:de$y.HALF_FLOAT_OES,UNSIGNED_INT_24_8:de$y.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:de$y.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:de$y.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:de$y.UNSIGNED_SHORT_5_6_5,toWebGLConstant:function(e,t){switch(e){case _$T.UNSIGNED_BYTE:return de$y.UNSIGNED_BYTE;case _$T.UNSIGNED_SHORT:return de$y.UNSIGNED_SHORT;case _$T.UNSIGNED_INT:return de$y.UNSIGNED_INT;case _$T.FLOAT:return de$y.FLOAT;case _$T.HALF_FLOAT:return t.webgl2?de$y.HALF_FLOAT:de$y.HALF_FLOAT_OES;case _$T.UNSIGNED_INT_24_8:return de$y.UNSIGNED_INT_24_8;case _$T.UNSIGNED_SHORT_4_4_4_4:return de$y.UNSIGNED_SHORT_4_4_4_4;case _$T.UNSIGNED_SHORT_5_5_5_1:return de$y.UNSIGNED_SHORT_5_5_5_1;case _$T.UNSIGNED_SHORT_5_6_5:return _$T.UNSIGNED_SHORT_5_6_5}},isPacked:function(e){return e===_$T.UNSIGNED_INT_24_8||e===_$T.UNSIGNED_SHORT_4_4_4_4||e===_$T.UNSIGNED_SHORT_5_5_5_1||e===_$T.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case _$T.UNSIGNED_BYTE:return 1;case _$T.UNSIGNED_SHORT:case _$T.UNSIGNED_SHORT_4_4_4_4:case _$T.UNSIGNED_SHORT_5_5_5_1:case _$T.UNSIGNED_SHORT_5_6_5:case _$T.HALF_FLOAT:return 2;case _$T.UNSIGNED_INT:case _$T.FLOAT:case _$T.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===_$T.UNSIGNED_BYTE||e===_$T.UNSIGNED_SHORT||e===_$T.UNSIGNED_INT||e===_$T.FLOAT||e===_$T.HALF_FLOAT||e===_$T.UNSIGNED_INT_24_8||e===_$T.UNSIGNED_SHORT_4_4_4_4||e===_$T.UNSIGNED_SHORT_5_5_5_1||e===_$T.UNSIGNED_SHORT_5_6_5}};var y$U=Object.freeze(_$T);const _$S={DEPTH_COMPONENT:de$y.DEPTH_COMPONENT,DEPTH_STENCIL:de$y.DEPTH_STENCIL,ALPHA:de$y.ALPHA,RGB:de$y.RGB,RGBA:de$y.RGBA,LUMINANCE:de$y.LUMINANCE,LUMINANCE_ALPHA:de$y.LUMINANCE_ALPHA,RGB_DXT1:de$y.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:de$y.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:de$y.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:de$y.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:de$y.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:de$y.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:de$y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:de$y.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:de$y.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:de$y.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:de$y.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:de$y.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:de$y.COMPRESSED_RGBA_BPTC_UNORM,componentsLength:function(e){switch(e){case _$S.RGB:return 3;case _$S.RGBA:return 4;case _$S.LUMINANCE_ALPHA:return 2;case _$S.ALPHA:case _$S.LUMINANCE:default:return 1}},validate:function(e){return e===_$S.DEPTH_COMPONENT||e===_$S.DEPTH_STENCIL||e===_$S.ALPHA||e===_$S.RGB||e===_$S.RGBA||e===_$S.LUMINANCE||e===_$S.LUMINANCE_ALPHA||e===_$S.RGB_DXT1||e===_$S.RGBA_DXT1||e===_$S.RGBA_DXT3||e===_$S.RGBA_DXT5||e===_$S.RGB_PVRTC_4BPPV1||e===_$S.RGB_PVRTC_2BPPV1||e===_$S.RGBA_PVRTC_4BPPV1||e===_$S.RGBA_PVRTC_2BPPV1||e===_$S.RGBA_ASTC||e===_$S.RGB_ETC1||e===_$S.RGB8_ETC2||e===_$S.RGBA8_ETC2_EAC||e===_$S.RGBA_BC7},isColorFormat:function(e){return e===_$S.ALPHA||e===_$S.RGB||e===_$S.RGBA||e===_$S.LUMINANCE||e===_$S.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===_$S.DEPTH_COMPONENT||e===_$S.DEPTH_STENCIL},isCompressedFormat:function(e){return e===_$S.RGB_DXT1||e===_$S.RGBA_DXT1||e===_$S.RGBA_DXT3||e===_$S.RGBA_DXT5||e===_$S.RGB_PVRTC_4BPPV1||e===_$S.RGB_PVRTC_2BPPV1||e===_$S.RGBA_PVRTC_4BPPV1||e===_$S.RGBA_PVRTC_2BPPV1||e===_$S.RGBA_ASTC||e===_$S.RGB_ETC1||e===_$S.RGB8_ETC2||e===_$S.RGBA8_ETC2_EAC||e===_$S.RGBA_BC7},isDXTFormat:function(e){return e===_$S.RGB_DXT1||e===_$S.RGBA_DXT1||e===_$S.RGBA_DXT3||e===_$S.RGBA_DXT5},isPVRTCFormat:function(e){return e===_$S.RGB_PVRTC_4BPPV1||e===_$S.RGB_PVRTC_2BPPV1||e===_$S.RGBA_PVRTC_4BPPV1||e===_$S.RGBA_PVRTC_2BPPV1},isASTCFormat:function(e){return e===_$S.RGBA_ASTC},isETC1Format:function(e){return e===_$S.RGB_ETC1},isETC2Format:function(e){return e===_$S.RGB8_ETC2||e===_$S.RGBA8_ETC2_EAC},isBC7Format:function(e){return e===_$S.RGBA_BC7},compressedTextureSizeInBytes:function(e,t,i){switch(e){case _$S.RGB_DXT1:case _$S.RGBA_DXT1:case _$S.RGB_ETC1:case _$S.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*8;case _$S.RGBA_DXT3:case _$S.RGBA_DXT5:case _$S.RGBA_ASTC:case _$S.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*16;case _$S.RGB_PVRTC_4BPPV1:case _$S.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case _$S.RGB_PVRTC_2BPPV1:case _$S.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);case _$S.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(i/4)*16;default:return 0}},textureSizeInBytes:function(e,t,i,r){let n=_$S.componentsLength(e);return y$U.isPacked(t)&&(n=1),n*y$U.sizeInBytes(t)*i*r},alignmentInBytes:function(e,t,i){const r=_$S.textureSizeInBytes(e,t,i,1)%4;return 0===r?4:2===r?2:1},createTypedArray:function(e,t,i,r){let n;const o=y$U.sizeInBytes(t);n=o===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:o===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:o===Float32Array.BYTES_PER_ELEMENT&&t===y$U.FLOAT?Float32Array:Uint32Array;return new n(_$S.componentsLength(e)*i*r)},flipY:function(e,t,i,r,n){if(1===n)return e;const o=_$S.createTypedArray(t,i,r,n),a=_$S.componentsLength(t),s=r*a;for(let t=0;t<n;++t){const i=t*r*a,l=(n-t-1)*r*a;for(let t=0;t<s;++t)o[l+t]=e[i+t]}return o},toInternalFormat:function(e,t,i){if(!i.webgl2)return e;if(e===_$S.DEPTH_STENCIL)return de$y.DEPTH24_STENCIL8;if(e===_$S.DEPTH_COMPONENT){if(t===y$U.UNSIGNED_SHORT)return de$y.DEPTH_COMPONENT16;if(t===y$U.UNSIGNED_INT)return de$y.DEPTH_COMPONENT24;if(t===y$U.FLOAT)return de$y.DEPTH_COMPONENT32F}if(e===_$S.DEPTH_COMPONENT16)return de$y.DEPTH_COMPONENT16;if(e===_$S.DEPTH_COMPONENT32F)return de$y.DEPTH_COMPONENT32F;if(t===y$U.UNSIGNED_BYTE)switch(e){case _$S.RGBA:return de$y.RGBA8;case _$S.RGB:return de$y.RGB8;case _$S.RED:return de$y.R8}if(t===y$U.FLOAT)switch(e){case _$S.RGBA:return de$y.RGBA32F;case _$S.RGB:return de$y.RGB32F;case _$S.RG:return de$y.RG32F;case _$S.RED:return de$y.R32F}if(t===y$U.HALF_FLOAT)switch(e){case _$S.RGBA:return de$y.RGBA16F;case _$S.RGB:return de$y.RGB16F;case _$S.RG:return de$y.RG16F;case _$S.RED:return de$y.R16F}return e}};var V$O=Object.freeze(_$S),_0x22e499=(_0x216ab0=!0,function(e,t){var i=_0x216ab0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x216ab0=!1,i}),_0x7cffbb=_0x22e499(void 0,(function(){return _0x7cffbb.toString().search("(((.+)+)+)+$").toString().constructor(_0x7cffbb).search("(((.+)+)+)+$")})),_0x216ab0;_0x7cffbb();var _0xea783f=8192,_0x3fc9f9=(_0x512abe=!0,function(e,t){var i=_0x512abe?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x512abe=!1,i}),_0x1821cb=_0x3fc9f9(void 0,(function(){return _0x1821cb.toString().search("(((.+)+)+)+$").toString().constructor(_0x1821cb).search("(((.+)+)+)+$")})),_0x512abe;_0x1821cb();var _0x2bd47b={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function _0x3b1bf1(e){return(e=Math.round(e))<0?0:e>255?255:e}function _0x2198b5(e){return e<0?0:e>1?1:e}function _0x2be205(e){return"%"===e[e.length-1]?_0x3b1bf1(parseFloat(e)/100*255):_0x3b1bf1(parseInt(e))}function _0x31881b(e){return"%"===e[e.length-1]?_0x2198b5(parseFloat(e)/100):_0x2198b5(parseFloat(e))}function _0x123170(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function _0xc1d9b2(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in _0x2bd47b)return _0x2bd47b[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=i.indexOf("("),n=i.indexOf(")");if(-1!==r&&n+1===i.length){var o=i.substr(0,r),a=i.substr(r+1,n-(r+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=_0x31881b(a.pop());case"rgb":return 3!==a.length?null:[_0x2be205(a[0]),_0x2be205(a[1]),_0x2be205(a[2]),s];case"hsla":if(4!==a.length)return null;s=_0x31881b(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=_0x31881b(a[1]),c=_0x31881b(a[2]),h=c<=.5?c*(u+1):c+u-c*u,d=2*c-h;return[_0x3b1bf1(255*_0x123170(d,h,l+1/3)),_0x3b1bf1(255*_0x123170(d,h,l)),_0x3b1bf1(255*_0x123170(d,h,l-1/3)),s];default:return null}}return null}const _0xf56dc2=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x13a9e0=_0xf56dc2(void 0,(function(){return _0x13a9e0.toString().search("(((.+)+)+)+$").toString().constructor(_0x13a9e0).search("(((.+)+)+)+$")}));_0x13a9e0();class _0x25bd71{constructor(e,t,i,r=1){this.r=e,this.g=t,this.b=i,this.a=r}static parse(e){if(!e)return;if(e instanceof _0x25bd71)return e;if("string"!=typeof e)return;const t=_0xc1d9b2(e);return t?new _0x25bd71(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,i,r]=this.toArray();return"rgba("+Math.round(e)+","+Math.round(t)+","+Math.round(i)+","+r+")"}toArray(){const{r:e,g:t,b:i,a:r}=this;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*i/r,r]}}_0x25bd71.black=new _0x25bd71(0,0,0,1),_0x25bd71.white=new _0x25bd71(1,1,1,1),_0x25bd71.transparent=new _0x25bd71(0,0,0,0),_0x25bd71.red=new _0x25bd71(1,0,0,1);var _0x93bcd4=(_0x43d784=!0,function(e,t){var i=_0x43d784?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x43d784=!1,i}),_0x4d2c1b=_0x93bcd4(void 0,(function(){return _0x4d2c1b.toString().search("(((.+)+)+)+$").toString().constructor(_0x4d2c1b).search("(((.+)+)+)+$")})),_0x43d784;_0x4d2c1b();var _0x4bd9c0=1029,_0xba2071=2305,_0x7eb0a6=function(e,t,i){this.enable=e,this.mode=t,this.frontFace=i};_0x7eb0a6.disabled=new _0x7eb0a6(!1,_0x4bd9c0,_0xba2071),_0x7eb0a6.backCCW=new _0x7eb0a6(!0,_0x4bd9c0,_0xba2071);var _0x4e9aa0=(_0x55a063=!0,function(e,t){var i=_0x55a063?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x55a063=!1,i}),_0x3337bd=_0x4e9aa0(void 0,(function(){return _0x3337bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x3337bd).search("(((.+)+)+)+$")})),_0x55a063;_0x3337bd();var _0x95d30e=519,_0x16a5dd=function(e,t,i){this.func=e,this.mask=t,this.range=i};_0x16a5dd.ReadOnly=!1,_0x16a5dd.ReadWrite=!0,_0x16a5dd.disabled=new _0x16a5dd(_0x95d30e,_0x16a5dd.ReadOnly,[0,1]);var _0x148d42=(_0x4234e8=!0,function(e,t){var i=_0x4234e8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4234e8=!1,i}),_0x20ba2f=_0x148d42(void 0,(function(){return _0x20ba2f.toString().search("(((.+)+)+)+$").toString().constructor(_0x20ba2f).search("(((.+)+)+)+$")})),_0x4234e8;_0x20ba2f();var _0x5765cb=519,_0x572c2c=7680,_0x1724fa=function(e,t,i,r,n,o){this.test=e,this.ref=t,this.mask=i,this.fail=r,this.depthFail=n,this.pass=o};_0x1724fa.disabled=new _0x1724fa({func:_0x5765cb,mask:0},0,0,_0x572c2c,_0x572c2c,_0x572c2c);var _0xe46c73={},_0x4b186f=function(e,t){this.gl=e.gl,this.location=t};_0xe46c73.Uniform1i=function(e){function t(t,i){e.call(this,t,i),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}(_0x4b186f),_0xe46c73.Uniform1f=function(e){function t(t,i){e.call(this,t,i),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}(_0x4b186f),_0xe46c73.Uniform2f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}(_0x4b186f),_0xe46c73.Uniform3f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}(_0x4b186f),_0xe46c73.Uniform4f=function(e){function t(t,i){e.call(this,t,i),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}(_0x4b186f),_0xe46c73.UniformColor=function(e){function t(t,i){e.call(this,t,i),this.current=_0x25bd71.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}(_0x4b186f);var _0x1b3ad3=new Float32Array(16);_0xe46c73.UniformMatrix4f=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){e.call(this,t,i),this.current=_0x1b3ad3}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.set=function(e){this.gl.uniformMatrix4fv(this.location,!1,e)},n}(_0x4b186f);var _0x2a7eb6=(_0x504a4d=!0,function(e,t){var i=_0x504a4d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x504a4d=!1,i}),_0x24107e=_0x2a7eb6(void 0,(function(){return _0x24107e.toString().search("(((.+)+)+)+$").toString().constructor(_0x24107e).search("(((.+)+)+)+$")})),_0x504a4d;function _0x19911a(e,t,i){if(e.realtime&&e$28(i)&&e$28(i.zoom)){var r=i.zoom;e$28(i.drawFillPattern)&&(r=Math.floor(r+.5));var n=i.zoom-e.level,o=t*(_0xea783f/(e.targetTileSize*Math.pow(2,n)));o*=e.targetTileSize/512;var a=i.zoom-i.finestRenderLevel;return a>0&&(o*=Math.pow(2,a)),o}return t*(_0xea783f/e.targetTileSize)}_0x24107e();var _0x498ff9=(_0xc775b3=!0,function(e,t){var i=_0xc775b3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xc775b3=!1,i}),_0x13ead6=_0x498ff9(void 0,(function(){return _0x13ead6.toString().search("(((.+)+)+)+$").toString().constructor(_0x13ead6).search("(((.+)+)+)+$")})),_0xc775b3;_0x13ead6();var _0x349419={circleUniforms:function(e,t){return{u_camera_to_center_distance:new _0xe46c73.Uniform1f(e,t.u_camera_to_center_distance),u_scale_with_map:new _0xe46c73.Uniform1i(e,t.u_scale_with_map),u_pitch_with_map:new _0xe46c73.Uniform1i(e,t.u_pitch_with_map),u_extrude_scale:new _0xe46c73.Uniform2f(e,t.u_extrude_scale),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix)}},circleUniformValues:function(e,t,i){var r,n;if(e.transform,"map"===i.paint.get("circle-pitch-alignment")){var o=_0x19911a(t,1);r=!0,n=[o,o]}else r=!1,n=_0x9c0348(t);return{u_camera_to_center_distance:1,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:_0x5b26e8(t),u_pitch_with_map:+r,u_device_pixel_ratio:1,u_extrude_scale:n}},circleUniformMap:function(e,t,i){var r,n;if("map"===i.paint.get("circle-pitch-alignment")){var o=_0x19911a(t,1);r=!0,n=[o,o]}else r=!1,n=_0x9c0348(t);var a={u_camera_to_center_distance:function(){return 1},u_scale_with_map:function(){return+("map"===i.paint.get("circle-pitch-scale"))},u_matrix:function(){return _0x5b26e8(t)},u_pitch_with_map:function(){return+r},u_device_pixel_ratio:function(){return 1},u_extrude_scale:function(){return n},u_mapbox_alpha:function(){return void 0===e.alpha?1:e.alpha}};return a}},_0x1f1643=new Float32Array(16);function _0x5b26e8(e){var t=e.viewProjection;return y$15.toArray(t,_0x1f1643)}function _0x9c0348(e){return[2/e.tileSize,-2/e.tileSize]}var _0x3ca201=(_0x43d5d5=!0,function(e,t){var i=_0x43d5d5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x43d5d5=!1,i}),_0x518765=_0x3ca201(void 0,(function(){return _0x518765.toString().search("(((.+)+)+)+$").toString().constructor(_0x518765).search("(((.+)+)+)+$")})),_0x43d5d5;_0x518765();var _0x569c28=1,_0x4b5e0e=function(e,t){var i=t.pixelRatio,r=t.version,n=t.stretchX,o=t.stretchY,a=t.content;this.paddedRect=e,this.pixelRatio=i,this.stretchX=n,this.stretchY=o,this.content=a,this.version=r},_0x30e0d6={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};_0x30e0d6.tl.get=function(){return[this.paddedRect.x+_0x569c28,this.paddedRect.y+_0x569c28]},_0x30e0d6.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-_0x569c28,this.paddedRect.y+this.paddedRect.h-_0x569c28]},_0x30e0d6.tlbr.get=function(){return this.tl.concat(this.br)},_0x30e0d6.displaySize.get=function(){return[(this.paddedRect.w-2*_0x569c28)/this.pixelRatio,(this.paddedRect.h-2*_0x569c28)/this.pixelRatio]},Object.defineProperties(_0x4b5e0e.prototype,_0x30e0d6);var _0x11894d=(_0x544f2e=!0,function(e,t){var i=_0x544f2e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x544f2e=!1,i}),_0x5842e6=_0x11894d(void 0,(function(){return _0x5842e6.toString().search("(((.+)+)+)+$").toString().constructor(_0x5842e6).search("(((.+)+)+)+$")})),_0x544f2e;_0x5842e6();var _0x1421cc=function(e,t){_0x2855c0(this,e,4,t)};function _0x2855c0(e,t,i,r){var n=t.width,o=t.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*o*i);return e.width=n,e.height=o,e.data=r,e}function _0x3d8159(e,t,i){var r=t.width,n=t.height;if(r!==e.width||n!==e.height){var o=_0x2855c0({},{width:r,height:n},i);_0x254f28(e,o,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,n)},i),e.width=r,e.height=n,e.data=o.data}}function _0x254f28(e,t,i,r,n,o){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)return console.log("out of range source coordinates for image copy"),t;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)return console.log("out of range destination coordinates for image copy"),t;for(var a=e.data,s=t.data,l=0;l<n.height;l++)for(var u=((i.y+l)*e.width+i.x)*o,c=((r.y+l)*t.width+r.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return t}function W$V(e){for(var t=0,i=0,r=0,n=e;r<n.length;r+=1){var o=n[r];t+=o.w*o.h,i=Math.max(i,o.w)}e.sort((function(e,t){return t.h-e.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}],s=0,l=0,u=0,c=e;u<c.length;u+=1)for(var h=c[u],d=a.length-1;d>=0;d--){var f=a[d];if(!(h.w>f.w||h.h>f.h)){if(h.x=f.x,h.y=f.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===f.w&&h.h===f.h){var p=a.pop();d<a.length&&(a[d]=p)}else h.h===f.h?(f.x+=h.w,f.w-=h.w):h.w===f.w?(f.y+=h.h,f.h-=h.h):(a.push({x:f.x+h.w,y:f.y,w:f.w-h.w,h:h.h}),f.y+=h.h,f.h-=h.h);break}}return{w:s,h:l,fill:t/(s*l)||0}}_0x1421cc.prototype.resize=function(e){_0x3d8159(this,e,4)},_0x1421cc.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},_0x1421cc.prototype.clone=function(){return new _0x1421cc({width:this.width,height:this.height},new Uint8Array(this.data))},_0x1421cc.copy=function(e,t,i,r,n){_0x254f28(e,t,i,r,n,4)};var _0x3dcc48=(_0x4f7320=!0,function(e,t){var i=_0x4f7320?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4f7320=!1,i}),_0x7ffbc1=_0x3dcc48(void 0,(function(){return _0x7ffbc1.toString().search("(((.+)+)+)+$").toString().constructor(_0x7ffbc1).search("(((.+)+)+)+$")})),_0x4f7320;_0x7ffbc1();var _0x5d1701=1,_0x245260=function(e,t){var i={},r={};this.haveRenderCallbacks=[];var n=[];this.addImages(e,i,n),this.addImages(t,r,n);var o=W$V(n),a=o.w,s=o.h,l=new _0x1421cc({width:a||1,height:s||1});for(var u in e){var c=e[u],h=i[u].paddedRect;_0x1421cc.copy(c.data,l,{x:0,y:0},{x:h.x+_0x5d1701,y:h.y+_0x5d1701},c.data)}for(var d in t){var f=t[d],p=r[d].paddedRect,_=p.x+_0x5d1701,m=p.y+_0x5d1701,$=f.data.width,g=f.data.height;_0x1421cc.copy(f.data,l,{x:0,y:0},{x:_,y:m},f.data),_0x1421cc.copy(f.data,l,{x:0,y:g-1},{x:_,y:m-1},{width:$,height:1}),_0x1421cc.copy(f.data,l,{x:0,y:0},{x:_,y:m+g},{width:$,height:1}),_0x1421cc.copy(f.data,l,{x:$-1,y:0},{x:_-1,y:m},{width:1,height:g}),_0x1421cc.copy(f.data,l,{x:0,y:0},{x:_+$,y:m},{width:1,height:g})}this.image=l,this.iconPositions=i,this.patternPositions=r};_0x245260.prototype.addImages=function(e,t,i){for(var r in e){var n=e[r],o={x:0,y:0,w:n.data.width+2*_0x5d1701,h:n.data.height+2*_0x5d1701};i.push(o),t[r]=new _0x4b5e0e(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},_0x245260.prototype.patchUpdatedImages=function(e,t){for(var i in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[i],e.getImage(i),t),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i),t)},_0x245260.prototype.patchUpdatedImage=function(e,t,i){if(e&&t&&e.version!==t.version){e.version=t.version;var r=e.tl,n=r[0],o=r[1];i.update(t.data,void 0,{x:n,y:o})}};var _0x2c025f={kind:"null"},_0x5384c0={kind:"number"},_0x11c664={kind:"string"},_0x19e413={kind:"boolean"},_0x25779c={kind:"color"},_0x4745bc={kind:"object"},_0x22719e={kind:"value"},_0x276afb={kind:"formatted"},_0x588d98={kind:"resolvedImage"};function _0x445fc6(e,t){var i,r=(i=!0,function(e,t){var r=i?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return i=!1,r}),n=r(this,(function(){return n.toString().search("(((.+)+)+)+$").toString().constructor(n).search("(((.+)+)+)+$")}));return n(),{kind:"array",itemType:e,N:t}}function _0xaa829a(e){if("array"===e.kind){var t=_0xaa829a(e.itemType);return"number"==typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var _0x2719cd=[_0x2c025f,_0x5384c0,_0x11c664,_0x19e413,_0x25779c,_0x276afb,_0x4745bc,_0x445fc6(_0x22719e),_0x588d98];function _0x1d8d12(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!_0x1d8d12(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var i=0,r=_0x2719cd;i<r.length;i+=1){if(!_0x1d8d12(r[i],t))return null}}return"Expected "+_0xaa829a(e)+" but found "+_0xaa829a(t)+" instead."}var _0xf95b4a=(_0x1268ae=!0,function(e,t){var i=_0x1268ae?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1268ae=!1,i}),_0x472a45=_0xf95b4a(void 0,(function(){return _0x472a45.toString().search("(((.+)+)+)+$").toString().constructor(_0x472a45).search("(((.+)+)+)+$")})),_0x1268ae;_0x472a45();var _0x19619d=function(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};_0x19619d.prototype.compare=function(e,t){return this.collator.compare(e,t)},_0x19619d.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var _0x4ac416=(_0x1b0388=!0,function(e,t){var i=_0x1b0388?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1b0388=!1,i}),_0x320875=_0x4ac416(void 0,(function(){return _0x320875.toString().search("(((.+)+)+)+$").toString().constructor(_0x320875).search("(((.+)+)+)+$")})),_0x1b0388;_0x320875();var _0x11ee07=function(e,t,i,r,n){this.text=e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=n},_0x1f22e1=(_0x4ebd48=!0,function(e,t){var i=_0x4ebd48?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4ebd48=!1,i}),_0x1139b2=_0x1f22e1(void 0,(function(){return _0x1139b2.toString().search("(((.+)+)+)+$").toString().constructor(_0x1139b2).search("(((.+)+)+)+$")})),_0x4ebd48;_0x1139b2();var _0x270dad=function(e){this.sections=e};_0x270dad.fromString=function(e){return new _0x270dad([new _0x11ee07(e,null,null,null,null)])},_0x270dad.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},_0x270dad.factory=function(e){return e instanceof _0x270dad?e:_0x270dad.fromString(e)},_0x270dad.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},_0x270dad.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];if(r.image)e.push(["image",r.image.name]);else{e.push(r.text);var n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),e.push(n)}}return e};var _0xc749eb=(_0xd6f991=!0,function(e,t){var i=_0xd6f991?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xd6f991=!1,i}),_0x3af4e8=_0xc749eb(void 0,(function(){return _0x3af4e8.toString().search("(((.+)+)+)+$").toString().constructor(_0x3af4e8).search("(((.+)+)+)+$")})),_0xd6f991;_0x3af4e8();var _0x1c80b=function(e){this.name=e.name,this.available=e.available};_0x1c80b.prototype.toString=function(){return this.name},_0x1c80b.fromString=function(e){return new _0x1c80b({name:e,available:!1})},_0x1c80b.prototype.serialize=function(){return["image",this.name]};var _0x3877df=(_0x5253ca=!0,function(e,t){var i=_0x5253ca?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5253ca=!1,i}),_0x43227b=_0x3877df(void 0,(function(){return _0x43227b.toString().search("(((.+)+)+)+$").toString().constructor(_0x43227b).search("(((.+)+)+)+$")})),_0x5253ca;_0x43227b();var _0x1c7362={kind:"null"},_0x5eece6={kind:"number"},_0x37552e={kind:"string"},_0x3b3d6e={kind:"boolean"},_0x317114={kind:"color"},_0xc66f0d={kind:"object"},_0x35bfc1={kind:"value"},_0x12656d={kind:"collator"},_0x31db55={kind:"formatted"},_0x5723a3={kind:"resolvedImage"};function _0x5d6fb8(e,t){return{kind:"array",itemType:e,N:t}}function _0x3fe53c(){}_0x3fe53c.validateRGBA=function(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[e,t,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."},_0x3fe53c.isValue=function(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof _0x25bd71)return!0;if(e instanceof _0x19619d)return!0;if(e instanceof _0x270dad)return!0;if(e instanceof _0x1c80b)return!0;if(Array.isArray(e)){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(!_0x3fe53c.isValue(r))return!1}return!0}if("object"==typeof e){for(var n in e)if(!_0x3fe53c.isValue(e[n]))return!1;return!0}return!1},_0x3fe53c.typeOf=function(e){if(null===e)return _0x1c7362;if("string"==typeof e)return _0x37552e;if("boolean"==typeof e)return _0x3b3d6e;if("number"==typeof e)return _0x5eece6;if(e instanceof _0x25bd71)return _0x317114;if(e instanceof _0x19619d)return _0x12656d;if(e instanceof _0x270dad)return _0x31db55;if(e instanceof _0x1c80b)return _0x5723a3;if(Array.isArray(e)){for(var t,i=e.length,r=0,n=e;r<n.length;r+=1){var o=n[r],a=_0x3fe53c.typeOf(o);if(t){if(t===a)continue;t=_0x35bfc1;break}t=a}return _0x5d6fb8(t||_0x35bfc1,i)}return _0xc66f0d},_0x3fe53c.toString$1=function(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof _0x25bd71||e instanceof _0x270dad||e instanceof _0x1c80b?e.toString():JSON.stringify(e)};var _0x35da8f=(_0x67e364=!0,function(e,t){var i=_0x67e364?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x67e364=!1,i}),_0x1faeb8=_0x35da8f(void 0,(function(){return _0x1faeb8.toString().search("(((.+)+)+)+$").toString().constructor(_0x1faeb8).search("(((.+)+)+)+$")})),_0x67e364;_0x1faeb8();var _0x510d3c={kind:"number"},_0x4fdd79={kind:"string"},_0x2a7554={kind:"boolean"},_0x6e8eb5={kind:"object"},_0xf8fcda={kind:"value"};function _0x500744(e,t){return{kind:"array",itemType:e,N:t}}var _0x212004={string:_0x4fdd79,number:_0x510d3c,boolean:_0x2a7554,object:_0x6e8eb5},_0x15d5eb=function(e,t){this.type=e,this.args=t};_0x15d5eb.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i,r=1,n=e[0];if("array"===n){var o,a;if(e.length>2){var s=e[1];if("string"!=typeof s||!(s in _0x212004)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=_0x212004[s],r++}else o=_0xf8fcda;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],r++}i=_0x500744(o,a)}else i=_0x212004[n];for(var l=[];r<e.length;r++){var u=t.parse(e[r],r,_0xf8fcda);if(!u)return null;l.push(u)}return new _0x15d5eb(i,l)},_0x15d5eb.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var i=this.args[t].evaluate(e);if(!_0x1d8d12(this.type,_0x3fe53c.typeOf(i)))return i;if(t===this.args.length-1)throw new RuntimeError("Expected value to be of type "+toString(this.type)+", but found "+toString(_0x3fe53c.typeOf(i))+" instead.")}return null},_0x15d5eb.prototype.eachChild=function(e){this.args.forEach(e)},_0x15d5eb.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},_0x15d5eb.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);var r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var _0x4b9bb0=(_0x2444df=!0,function(e,t){var i=_0x2444df?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2444df=!1,i}),_0x2dab7e=_0x4b9bb0(void 0,(function(){return _0x2dab7e.toString().search("(((.+)+)+)+$").toString().constructor(_0x2dab7e).search("(((.+)+)+)+$")})),_0x2444df;_0x2dab7e();var _0x3f9b5d={kind:"number"},_0x565703={kind:"value"};function _0x4d5c82(e,t){return{kind:"array",itemType:e,N:t}}var _0x1e54e2=function(e,t,i){this.type=e,this.index=t,this.input=i};_0x1e54e2.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,_0x3f9b5d),r=t.parse(e[2],2,_0x4d5c82(t.expectedType||_0x565703));if(!i||!r)return null;var n=r.type;return new _0x1e54e2(n.itemType,i,r)},_0x1e54e2.prototype.evaluate=function(e){var t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new RuntimeError("Array index out of bounds: "+t+" < 0.");if(t>=i.length)throw new RuntimeError("Array index out of bounds: "+t+" > "+(i.length-1)+".");if(t!==Math.floor(t))throw new RuntimeError("Array index must be an integer, but found "+t+" instead.");return i[t]},_0x1e54e2.prototype.eachChild=function(e){e(this.index),e(this.input)},_0x1e54e2.prototype.possibleOutputs=function(){return[void 0]},_0x1e54e2.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var _0x4c25ce=(_0x3124f8=!0,function(e,t){var i=_0x3124f8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3124f8=!1,i}),_0x27075f=_0x4c25ce(void 0,(function(){return _0x27075f.toString().search("(((.+)+)+)+$").toString().constructor(_0x27075f).search("(((.+)+)+)+$")})),_0x3124f8;_0x27075f();var _0x279ae4={kind:"boolean"},_0x24d0a2=function(e,t,i){this.type=e,this.branches=t,this.otherwise=i};_0x24d0a2.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var r=[],n=1;n<e.length-1;n+=2){var o=t.parse(e[n],n,_0x279ae4);if(!o)return null;var a=t.parse(e[n+1],n+1,i);if(!a)return null;r.push([o,a]),i=i||a.type}var s=t.parse(e[e.length-1],e.length-1,i);return s?new _0x24d0a2(i,r,s):null},_0x24d0a2.prototype.evaluate=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];if(n.evaluate(e))return o.evaluate(e)}return this.otherwise.evaluate(e)},_0x24d0a2.prototype.eachChild=function(e){for(var t=0,i=this.branches;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];e(n),e(o)}e(this.otherwise)},_0x24d0a2.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.branches.map((function(e){return e[0],e[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},_0x24d0a2.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var _0x203116=(_0x902cbd=!0,function(e,t){var i=_0x902cbd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x902cbd=!1,i}),_0x11e4c7=_0x203116(void 0,(function(){return _0x11e4c7.toString().search("(((.+)+)+)+$").toString().constructor(_0x11e4c7).search("(((.+)+)+)+$")})),_0x902cbd;_0x11e4c7();var _0x2e3a8c={kind:"value"},_0x436b79=function(e,t){this.type=e,this.args=t};_0x436b79.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var i=null,r=t.expectedType;r&&"value"!==r.kind&&(i=r);for(var n=[],o=0,a=e.slice(1);o<a.length;o+=1){var s=a[o],l=t.parse(s,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,n.push(l)}var u=r&&n.some((function(e){return _0x1d8d12(r,e.type)}));return new _0x436b79(u?_0x2e3a8c:i,n)},_0x436b79.prototype.evaluate=function(e){for(var t,i=null,r=0,n=0,o=this.args;n<o.length;n+=1){if(r++,(i=o[n].evaluate(e))&&i instanceof _0x1c80b&&!i.available&&(!t&&(t=i.name),i=null,r===this.args.length&&(i=t)),null!==i)break}return i},_0x436b79.prototype.eachChild=function(e){this.args.forEach(e)},_0x436b79.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},_0x436b79.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var _0x7b264c=(_0x19a31e=!0,function(e,t){var i=_0x19a31e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x19a31e=!1,i}),_0x997734=_0x7b264c(void 0,(function(){return _0x997734.toString().search("(((.+)+)+)+$").toString().constructor(_0x997734).search("(((.+)+)+)+$")})),_0x19a31e;_0x997734();var _0x145e87={kind:"number"},_0x57bcd3={kind:"string"},_0x46dacc={kind:"boolean"},_0x55424a={kind:"color"},_0x43352c={kind:"value"},_0x3b91ce={"to-boolean":_0x46dacc,"to-color":_0x55424a,"to-number":_0x145e87,"to-string":_0x57bcd3},_0x5651e8=function(e,t){this.type=e,this.args=t};_0x5651e8.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];if(("to-boolean"===i||"to-string"===i)&&2!==e.length)return t.error("Expected one argument.");for(var r=_0x3b91ce[i],n=[],o=1;o<e.length;o++){var a=t.parse(e[o],o,_0x43352c);if(!a)return null;n.push(a)}return new _0x5651e8(r,n)},_0x5651e8.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,i,r=0,n=this.args;r<n.length;r+=1){if(i=null,(t=n[r].evaluate(e))instanceof _0x25bd71)return t;if("string"==typeof t){var o=e.parseColor(t);if(o)return o}else if(Array.isArray(t)&&!(i=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":validateRGBA(t[0],t[1],t[2],t[3])))return new _0x25bd71(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new RuntimeError(i||"Could not parse color from value '"+("string"==typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s<l.length;s+=1){if(null===(a=l[s].evaluate(e)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new RuntimeError("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?Formatted.fromString(_0x3fe53c.toString$1(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?_0x1c80b.fromString(_0x3fe53c.toString$1(this.args[0].evaluate(e))):_0x3fe53c.toString$1(this.args[0].evaluate(e))},_0x5651e8.prototype.eachChild=function(e){this.args.forEach(e)},_0x5651e8.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.args.map((function(e){return e.possibleOutputs()})))},_0x5651e8.prototype.serialize=function(){if("formatted"===this.type.kind)return new FormatExpression([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ImageExpression(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var _0x414e59=(_0x31f64a=!0,function(e,t){var i=_0x31f64a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x31f64a=!1,i}),_0x33993e=_0x414e59(void 0,(function(){return _0x33993e.toString().search("(((.+)+)+)+$").toString().constructor(_0x33993e).search("(((.+)+)+)+$")})),_0x31f64a;_0x33993e();var _0xcfc2c4={kind:"string"},_0x40b8d1={kind:"boolean"},_0x207b1e={kind:"collator"},_0x57dfba=function(e,t,i){this.type=_0x207b1e,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t};_0x57dfba.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var i=e[1];if("object"!=typeof i||Array.isArray(i))return t.error("Collator options argument must be an object.");var r=t.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,_0x40b8d1);if(!r)return null;var n=t.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,_0x40b8d1);if(!n)return null;var o=null;return i.locale&&!(o=t.parse(i.locale,1,_0xcfc2c4))?null:new _0x57dfba(r,n,o)},_0x57dfba.prototype.evaluate=function(e){return new _0x19619d(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},_0x57dfba.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},_0x57dfba.prototype.possibleOutputs=function(){return[void 0]},_0x57dfba.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var _0x190762={kind:"boolean"},_0x1d80f4={kind:"value"},_0x3b00ad={kind:"collator"};function _0x201139(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function _0x4d7a66(e,t,i){return t===i}function _0x477450(e,t,i){return t!==i}function _0x5674bb(e,t,i){return t<i}function _0x533929(e,t,i){return t>i}function _0x5daae3(e,t,i){return t<=i}function _0x588c6a(e,t,i){return t>=i}function _0x3324c2(e,t,i,r){return 0===r.compare(t,i)}function _0x55a3f2(e,t,i,r){return!_0x3324c2(e,t,i,r)}function _0x329a59(e,t,i,r){return r.compare(t,i)<0}function _0x5bab3e(e,t,i,r){return r.compare(t,i)>0}function _0x4033b2(e,t,i,r){return r.compare(t,i)<=0}function _0x1b678d(e,t,i,r){return r.compare(t,i)>=0}function _0x3d8ca8(e,t,i){var r,n=(r=!0,function(e,t){var i=r?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return r=!1,i}),o="=="!==e&&"!="!==e;return function(){var r=n(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function a(e,t,i){this.type=_0x190762,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return r(),a.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var i=e[0],r=t.parse(e[1],1,_0x1d80f4);if(!r)return null;if(!_0x201139(i,r.type))return t.concat(1).error('"'+i+"\" comparisons are not supported for type '"+toString(r.type)+"'.");var n=t.parse(e[2],2,_0x1d80f4);if(!n)return null;if(!_0x201139(i,n.type))return t.concat(2).error('"'+i+"\" comparisons are not supported for type '"+toString(n.type)+"'.");if(r.type.kind!==n.type.kind&&"value"!==r.type.kind&&"value"!==n.type.kind)return t.error("Cannot compare types '"+toString(r.type)+"' and '"+toString(n.type)+"'.");o&&("value"===r.type.kind&&"value"!==n.type.kind?r=new _0x15d5eb(n.type,[r]):"value"!==r.type.kind&&"value"===n.type.kind&&(n=new _0x15d5eb(r.type,[n])));var s=null;if(4===e.length){if("string"!==r.type.kind&&"string"!==n.type.kind&&"value"!==r.type.kind&&"value"!==n.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,_0x3b00ad)))return null}return new a(r,n,s)},a.prototype.evaluate=function(r){var n=this.lhs.evaluate(r),a=this.rhs.evaluate(r);if(o&&this.hasUntypedArgument){var s=_0x3fe53c.typeOf(n),l=_0x3fe53c.typeOf(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new RuntimeError('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!o&&this.hasUntypedArgument){var u=_0x3fe53c.typeOf(n),c=_0x3fe53c.typeOf(a);if("string"!==u.kind||"string"!==c.kind)return t(r,n,a)}return this.collator?i(r,n,a,this.collator.evaluate(r)):t(r,n,a)},a.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},a.prototype.possibleOutputs=function(){return[!0,!1]},a.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},a}()}var _0x42939f={};_0x42939f.Equals=_0x3d8ca8("==",_0x4d7a66,_0x3324c2),_0x42939f.NotEquals=_0x3d8ca8("!=",_0x477450,_0x55a3f2),_0x42939f.LessThan=_0x3d8ca8("<",_0x5674bb,_0x329a59),_0x42939f.GreaterThan=_0x3d8ca8(">",_0x533929,_0x5bab3e),_0x42939f.LessThanOrEqual=_0x3d8ca8("<=",_0x5daae3,_0x4033b2),_0x42939f.GreaterThanOrEqual=_0x3d8ca8(">=",_0x588c6a,_0x1b678d);var _0x35e5d0=(_0x433dd2=!0,function(e,t){var i=_0x433dd2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x433dd2=!1,i}),_0x2cb7ad=_0x35e5d0(void 0,(function(){return _0x2cb7ad.toString().search("(((.+)+)+)+$").toString().constructor(_0x2cb7ad).search("(((.+)+)+)+$")})),_0x433dd2;_0x2cb7ad();var _0x49259a={kind:"number"},_0x1b3b90={kind:"string"},_0x33a4d5={kind:"color"},_0x535088={kind:"value"},_0x492508={kind:"formatted"},_0x2dde41={kind:"resolvedImage"};function _0xb78f4(e,t){return{kind:"array",itemType:e,N:t}}var _0x409fda=function(e){this.type=_0x492508,this.sections=e};_0x409fda.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");for(var r=[],n=!1,o=1;o<=e.length-1;++o){var a=e[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=t.parse(a["font-scale"],1,_0x49259a)))return null;var l=null;if(a["text-font"]&&!(l=t.parse(a["text-font"],1,_0xb78f4(_0x1b3b90))))return null;var u=null;if(a["text-color"]&&!(u=t.parse(a["text-color"],1,_0x33a4d5)))return null;var c=r[r.length-1];c.scale=s,c.font=l,c.textColor=u}else{var h=t.parse(e[o],1,_0x535088);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new _0x409fda(r)},_0x409fda.prototype.evaluate=function(e){return new _0x270dad(this.sections.map((function(t){var i=t.content.evaluate(e);return _0x3fe53c.typeOf(i)===_0x2dde41?new _0x11ee07("",i,null,null,null):new _0x11ee07(_0x3fe53c.toString$1(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},_0x409fda.prototype.eachChild=function(e){for(var t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor)}},_0x409fda.prototype.possibleOutputs=function(){return[void 0]},_0x409fda.prototype.serialize=function(){for(var e=["format"],t=0,i=this.sections;t<i.length;t+=1){var r=i[t];e.push(r.content.serialize());var n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),e.push(n)}return e};var _0xa219e5=(_0x26a162=!0,function(e,t){var i=_0x26a162?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x26a162=!1,i}),_0xf4367c=_0xa219e5(void 0,(function(){return _0xf4367c.toString().search("(((.+)+)+)+$").toString().constructor(_0xf4367c).search("(((.+)+)+)+$")})),_0x26a162;_0xf4367c();var _0x30cf15={kind:"string"},_0x2f6c80={kind:"resolvedImage"},_0x20574f=function(e){this.type=_0x2f6c80,this.input=e};_0x20574f.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,_0x30cf15);return i?new _0x20574f(i):t.error("No image name provided.")},_0x20574f.prototype.evaluate=function(e){var t=this.input.evaluate(e),i=!1;return e.availableImages&&e.availableImages.indexOf(t)>-1&&(i=!0),new _0x1c80b({name:t,available:i})},_0x20574f.prototype.eachChild=function(e){e(this.input)},_0x20574f.prototype.possibleOutputs=function(){return[void 0]},_0x20574f.prototype.serialize=function(){return["image",this.input.serialize()]};var _0x1df495=(_0x1cd452=!0,function(e,t){var i=_0x1cd452?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1cd452=!1,i}),_0x2ae6b2=_0x1df495(void 0,(function(){return _0x2ae6b2.toString().search("(((.+)+)+)+$").toString().constructor(_0x2ae6b2).search("(((.+)+)+)+$")})),_0x1cd452;_0x2ae6b2();var _0x1053c6=function(e,t,i,r,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}},_0x4a55a2={kind:"number"},_0x186e94={kind:"color"};function _0x353d3b(e,t,i,r){var n=r-i,o=e-i;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}_0x1053c6.interpolationFactor=function(e,t,i,r){var n=0;if("exponential"===e.name)n=_0x353d3b(t,e.base,i,r);else if("linear"===e.name)n=_0x353d3b(t,1,i,r);else if("cubic-bezier"===e.name){var o=e.controlPoints;n=new unitbezier(o[0],o[1],o[2],o[3]).solve(_0x353d3b(t,1,i,r))}return n},_0x1053c6.parse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e.slice(3);if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.some((function(e){return"number"!=typeof e||e<0||e>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,2,_0x4a55a2)))return null;var l=[],u=null;"interpolate-hcl"===i||"interpolate-lab"===i?u=_0x186e94:t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],d=o[c+1],f=c+3,p=c+4;if("number"!=typeof h)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var _=t.parse(d,p,u);if(!_)return null;u=u||_.type,l.push([h,_])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new _0x1053c6(u,i,r,n,l):t.error("Type "+toString(u)+" is not interpolatable.")},_0x1053c6.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);var o=findStopLessThanOrEqualTo(t,r),a=t[o],s=t[o+1],l=_0x1053c6.interpolationFactor(this.interpolation,r,a,s),u=i[o].evaluate(e),c=i[o+1].evaluate(e);return"interpolate"===this.operator?interpolate[this.type.kind.toLowerCase()](u,c,l):"interpolate-hcl"===this.operator?hcl.reverse(hcl.interpolate(hcl.forward(u),hcl.forward(c),l)):lab.reverse(lab.interpolate(lab.forward(u),lab.forward(c),l))},_0x1053c6.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},_0x1053c6.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()})))},_0x1053c6.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],i=0;i<this.labels.length;i++)t.push(this.labels[i],this.outputs[i].serialize());return t};var _0xd71b8b=(_0x2fed99=!0,function(e,t){var i=_0x2fed99?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2fed99=!1,i}),_0x417cad=_0xd71b8b(void 0,(function(){return _0x417cad.toString().search("(((.+)+)+)+$").toString().constructor(_0x417cad).search("(((.+)+)+)+$")})),_0x2fed99;_0x417cad();var _0x4ef867={kind:"boolean"},_0x3caefd={kind:"value"};function _0x25e331(e){return"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind}function _0x2f22b8(e){return"boolean"==typeof e||"string"==typeof e||"number"==typeof e}function _0x51a2cc(e){return Array.isArray(e)||"string"==typeof e}var _0x502f1d=function(e,t){this.type=_0x4ef867,this.needle=e,this.haystack=t};_0x502f1d.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1,_0x3caefd),r=t.parse(e[2],2,_0x3caefd);return i&&r?_0x25e331(i.type)?new _0x502f1d(i,r):t.error("Expected first argument to be of type boolean, string, number or null, but found "+toString(i.type)+" instead"):null},_0x502f1d.prototype.evaluate=function(e){var t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!t||!i)return!1;if(!_0x2f22b8(t))throw new RuntimeError("Expected first argument to be of type boolean, string or number, but found "+toString(typeOf(t))+" instead.");if(!_0x51a2cc(i))throw new RuntimeError("Expected second argument to be of type array or string, but found "+toString(typeOf(i))+" instead.");return i.indexOf(t)>=0},_0x502f1d.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},_0x502f1d.prototype.possibleOutputs=function(){return[!0,!1]},_0x502f1d.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var _0x588581=(_0x3caf1e=!0,function(e,t){var i=_0x3caf1e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3caf1e=!1,i}),_0x3a5a05=_0x588581(void 0,(function(){return _0x3a5a05.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a5a05).search("(((.+)+)+)+$")})),_0x3caf1e;_0x3a5a05();var _0x15b4dd=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};_0x15b4dd.prototype.evaluate=function(e){return this.result.evaluate(e)},_0x15b4dd.prototype.eachChild=function(e){for(var t=0,i=this.bindings;t<i.length;t+=1){e(i[t][1])}e(this.result)},_0x15b4dd.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var i=[],r=1;r<e.length-1;r+=2){var n=e[r];if("string"!=typeof n)return t.error("Expected string, but found "+typeof n+" instead.",r);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=t.parse(e[r+1],r+1);if(!o)return null;i.push([n,o])}var a=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return a?new _0x15b4dd(i,a):null},_0x15b4dd.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},_0x15b4dd.prototype.serialize=function(){for(var e=["let"],t=0,i=this.bindings;t<i.length;t+=1){var r=i[t],n=r[0],o=r[1];e.push(n,o.serialize())}return e.push(this.result.serialize()),e};var _0x35686c=(_0x12862e=!0,function(e,t){var i=_0x12862e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x12862e=!1,i}),_0x2f6d0b=_0x35686c(void 0,(function(){return _0x2f6d0b.toString().search("(((.+)+)+)+$").toString().constructor(_0x2f6d0b).search("(((.+)+)+)+$")})),_0x12862e;_0x2f6d0b();var _0x9e6433={kind:"number"},_0x1ee6a6=function(e){this.type=_0x9e6433,this.input=e};_0x1ee6a6.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error("Expected argument of type string or array, but found "+toString(i.type)+" instead."):new _0x1ee6a6(i):null},_0x1ee6a6.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new RuntimeError("Expected value to be of type string or array, but found "+toString(typeOf(t))+" instead.")},_0x1ee6a6.prototype.eachChild=function(e){e(this.input)},_0x1ee6a6.prototype.possibleOutputs=function(){return[void 0]},_0x1ee6a6.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var _0x44fba3=(_0x4431b3=!0,function(e,t){var i=_0x4431b3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4431b3=!1,i}),_0x4764af=_0x44fba3(void 0,(function(){return _0x4764af.toString().search("(((.+)+)+)+$").toString().constructor(_0x4764af).search("(((.+)+)+)+$")})),_0x4431b3;_0x4764af();var _0x145078=function(e,t){this.type=e,this.value=t};_0x145078.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!_0x3fe53c.isValue(e[1]))return t.error("invalid value");var i=e[1],r=_0x3fe53c.typeOf(i),n=t.expectedType;return"array"===r.kind&&0===r.N&&n&&"array"===n.kind&&("number"!=typeof n.N||0===n.N)&&(r=n),new _0x145078(r,i)},_0x145078.prototype.evaluate=function(){return this.value},_0x145078.prototype.eachChild=function(){},_0x145078.prototype.possibleOutputs=function(){return[this.value]},_0x145078.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Color?["rgba"].concat(this.value.toArray()):this.value instanceof _0x270dad?this.value.serialize():this.value};var _0x292134=(_0x53d832=!0,function(e,t){var i=_0x53d832?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x53d832=!1,i}),_0x50b018=_0x292134(void 0,(function(){return _0x50b018.toString().search("(((.+)+)+)+$").toString().constructor(_0x50b018).search("(((.+)+)+)+$")})),_0x53d832;_0x50b018();var _0x1ca3da={kind:"value"},_0x56d91b=function(e,t,i,r,n,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o};_0x56d91b.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n={},o=[],a=2;a<e.length-1;a+=2){var s=e[a],l=e[a+1];!Array.isArray(s)&&(s=[s]);var u=t.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var d=h[c];if("number"!=typeof d&&"string"!=typeof d)return u.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,_0x3fe53c.typeOf(d)))return null}else i=_0x3fe53c.typeOf(d);if(void 0!==n[String(d)])return u.error("Branch labels must be unique.");n[String(d)]=o.length}var f=t.parse(l,a,r);if(!f)return null;r=r||f.type,o.push(f)}var p=t.parse(e[1],1,_0x1ca3da);if(!p)return null;var _=t.parse(e[e.length-1],e.length-1,r);return _?"value"!==p.type.kind&&t.concat(1).checkSubtype(i,p.type)?null:new _0x56d91b(i,r,p,n,o,_):null},_0x56d91b.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(_0x3fe53c.typeOf(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},_0x56d91b.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},_0x56d91b.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},_0x56d91b.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],i=[],r={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(h=r[this.cases[a]])?(r[this.cases[a]]=i.length,i.push([this.cases[a],[a]])):i[h][1].push(a)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,u=i;l<u.length;l+=1){var c=u[l],h=c[0],d=c[1];1===d.length?t.push(s(d[0])):t.push(d.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var _0x513ce1=(_0x15a610=!0,function(e,t){var i=_0x15a610?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x15a610=!1,i}),_0x186ba3=_0x513ce1(void 0,(function(){return _0x186ba3.toString().search("(((.+)+)+)+$").toString().constructor(_0x186ba3).search("(((.+)+)+)+$")})),_0x15a610;_0x186ba3();var _0x56cc6a={kind:"number"},_0x33c68a={kind:"string"},_0x2d84ba=function(e,t,i,r,n){this.type=_0x33c68a,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n};_0x2d84ba.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,_0x56cc6a);if(!i)return null;var r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");var n=null;if(r.locale&&!(n=t.parse(r.locale,1,_0x33c68a)))return null;var o=null;if(r.currency&&!(o=t.parse(r.currency,1,_0x33c68a)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=t.parse(r["min-fraction-digits"],1,_0x56cc6a)))return null;var s=null;return r["max-fraction-digits"]&&!(s=t.parse(r["max-fraction-digits"],1,_0x56cc6a))?null:new _0x2d84ba(i,n,o,a,s)},_0x2d84ba.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},_0x2d84ba.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},_0x2d84ba.prototype.possibleOutputs=function(){return[void 0]},_0x2d84ba.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var _0xb32533=(_0x5ee52c=!0,function(e,t){var i=_0x5ee52c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5ee52c=!1,i}),_0x42f2f4=_0xb32533(void 0,(function(){return _0x42f2f4.toString().search("(((.+)+)+)+$").toString().constructor(_0x42f2f4).search("(((.+)+)+)+$")})),_0x5ee52c;function _0x3fde74(e,t){for(var i,r,n=e.length-1,o=0,a=n,s=0;o<=a;)if(i=e[s=Math.floor((o+a)/2)],r=e[s+1],i<=t){if(s===n||t<r)return s;o=s+1}else{if(!(i>t))throw new RuntimeError("Input is not a number.");a=s-1}return 0}_0x42f2f4();var _0x58238e=(_0x45cebb=!0,function(e,t){var i=_0x45cebb?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x45cebb=!1,i}),_0x14998b=_0x58238e(void 0,(function(){return _0x14998b.toString().search("(((.+)+)+)+$").toString().constructor(_0x14998b).search("(((.+)+)+)+$")})),_0x45cebb;_0x14998b();var _0x574fb2={kind:"number"},_0x3f7c1e=function(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var r=0,n=i;r<n.length;r+=1){var o=n[r],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};_0x3f7c1e.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var i=t.parse(e[1],1,_0x574fb2);if(!i)return null;var r=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var o=1;o<e.length;o+=2){var a=1===o?-1/0:e[o],s=e[o+1],l=o,u=o+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(r.length&&r[r.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var c=t.parse(s,u,n);if(!c)return null;n=n||c.type,r.push([a,c])}return new _0x3f7c1e(n,i,r)},_0x3f7c1e.prototype.evaluate=function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[_0x3fde74(t,r)].evaluate(e)},_0x3f7c1e.prototype.eachChild=function(e){e(this.input);for(var t=0,i=this.outputs;t<i.length;t+=1){e(i[t])}},_0x3f7c1e.prototype.possibleOutputs=function(){var e;return(e=[]).concat.apply(e,this.outputs.map((function(e){return e.possibleOutputs()})))},_0x3f7c1e.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var _0x2bce38=(_0x32ab9e=!0,function(e,t){var i=_0x32ab9e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x32ab9e=!1,i}),_0x1df195=_0x2bce38(void 0,(function(){return _0x1df195.toString().search("(((.+)+)+)+$").toString().constructor(_0x1df195).search("(((.+)+)+)+$")})),_0x32ab9e;_0x1df195();var _0x2663d8=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};_0x2663d8.parse=function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var i=e[1];return t.scope.has(i)?new _0x2663d8(i,t.scope.get(i)):t.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},_0x2663d8.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},_0x2663d8.prototype.eachChild=function(){},_0x2663d8.prototype.possibleOutputs=function(){return[void 0]},_0x2663d8.prototype.serialize=function(){return["var",this.name]};var _0x21530f=(_0x5e1265=!0,function(e,t){var i=_0x5e1265?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5e1265=!1,i}),_0x1babcd=_0x21530f(void 0,(function(){return _0x1babcd.toString().search("(((.+)+)+)+$").toString().constructor(_0x1babcd).search("(((.+)+)+)+$")})),_0x5e1265;_0x1babcd();var _0x3959b3={"==":_0x42939f.Equals,"!=":_0x42939f.NotEquals,">":_0x42939f.GreaterThan,"<":_0x42939f.LessThan,">=":_0x42939f.GreaterThanOrEqual,"<=":_0x42939f.LessThanOrEqual,array:_0x15d5eb,at:_0x1e54e2,boolean:_0x15d5eb,case:_0x24d0a2,coalesce:_0x436b79,collator:_0x57dfba,format:_0x409fda,image:_0x20574f,in:_0x502f1d,interpolate:_0x1053c6,"interpolate-hcl":_0x1053c6,"interpolate-lab":_0x1053c6,length:_0x1ee6a6,let:_0x15b4dd,literal:_0x145078,match:_0x56d91b,number:_0x15d5eb,"number-format":_0x2d84ba,object:_0x15d5eb,step:_0x3f7c1e,string:_0x15d5eb,"to-boolean":_0x5651e8,"to-color":_0x5651e8,"to-number":_0x5651e8,"to-string":_0x5651e8,var:_0x2663d8},_0x5bd668=(_0x53259f=!0,function(e,t){var i=_0x53259f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x53259f=!1,i}),_0x10b3c7=_0x5bd668(void 0,(function(){return _0x10b3c7.toString().search("(((.+)+)+)+$").toString().constructor(_0x10b3c7).search("(((.+)+)+)+$")})),_0x53259f;function _0x36ace8(){}_0x10b3c7();var _0x124560={};for(var _0x1bfc34 in _0x36ace8.register=function(e,t,i){void 0===i&&(i={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),_0x124560[e]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}},_0x36ace8.register("Object",Object),_0x36ace8.register("Color",_0x25bd71),_0x36ace8.register("Error",Error),_0x36ace8.register("ResolvedImage",_0x1c80b),_0x36ace8.register("ImageAtlas",_0x245260),_0x36ace8.register("ImagePosition",_0x4b5e0e),_0x36ace8.register("RGBAImage",_0x1421cc),_0x36ace8.register("Formatted",_0x270dad),_0x36ace8.register("FormattedSection",_0x11ee07),_0x3959b3)_0x3959b3[_0x1bfc34]._classRegistryKey||_0x36ace8.register("Expression_"+_0x1bfc34,_0x3959b3[_0x1bfc34]);function _0x5de830(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}_0x36ace8.serialize=function(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(_0x5de830(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var i=e;return t&&t.push(i.buffer),i}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var r=[],n=0,o=e;n<o.length;n+=1){var a=o[n];r.push(_0x36ace8.serialize(a,t))}return r}if("object"==typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var u=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var c in e)if(e.hasOwnProperty(c)&&!(_0x124560[l].omit.indexOf(c)>=0)){var h=e[c];"function"!=typeof h&&(u[c]=_0x124560[l].shallow.indexOf(c)>=0?h:_0x36ace8.serialize(h,t))}e instanceof Error&&(u.message=e.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(u.$name=l),u}throw new Error("can't serialize object of type "+typeof e)},_0x36ace8.deserialize=function(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||_0x5de830(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(_0x36ace8.deserialize);if("object"==typeof e){var t=e.$name||"Object",i=_0x124560[t].klass;if(!i)throw new Error("can't deserialize unregistered class "+t);if(i.deserialize)return i.deserialize(e);for(var r=Object.create(i.prototype),n=0,o=Object.keys(e);n<o.length;n+=1){var a=o[n];if("$name"!==a){var s=e[a];r[a]=_0x124560[t].shallow.indexOf(a)>=0?s:_0x36ace8.deserialize(s)}}return r}throw new Error("can't deserialize object of type "+typeof e)};var _0x479ee7=(_0x1d3305=!0,function(e,t){var i=_0x1d3305?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1d3305=!1,i}),_0x4d1f81=_0x479ee7(void 0,(function(){return _0x4d1f81.toString().search("(((.+)+)+)+$").toString().constructor(_0x4d1f81).search("(((.+)+)+)+$")})),_0x1d3305;_0x4d1f81();var _0x33528b=function(e){void 0===e&&(e=[]),this.segments=e};_0x33528b.prototype.prepareSegment=function(e,t,i,r){var n=this.segments[this.segments.length-1];return(!n||n.vertexLength+e>_0x33528b.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n},_0x33528b.prototype.get=function(){return this.segments},_0x33528b.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var i=t[e];for(var r in i.cesiumVaos)i.cesiumVaos[r].destroy()}},_0x33528b.simpleSegment=function(e,t,i,r){return new _0x33528b([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:r,vaos:{},cesiumVaos:{},drawCommands:{},sortKey:0}])},_0x33528b.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,_0x36ace8.register("SegmentVector",_0x33528b);var _0x3d4892=(_0xb0f202=!0,function(e,t){var i=_0xb0f202?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xb0f202=!1,i}),_0x19c0e6=_0x3d4892(void 0,(function(){return _0x19c0e6.toString().search("(((.+)+)+)+$").toString().constructor(_0x19c0e6).search("(((.+)+)+)+$")})),_0xb0f202;function _0x24da5b(){}_0x19c0e6(),_0x24da5b.toVertexBuffer=function(e,t,i,r){var n=h$W.createVertexBuffer({context:e,typedArray:t.arrayBuffer,usage:r?A$1c.DYNAMIC_DRAW:A$1c.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n.bytesPerElement=t.bytesPerElement,n.length=t.length,n.attributes=i,n.itemSize=t.bytesPerElement,n.dynamicDraw=r,!r&&delete t.arrayBuffer,n},_0x24da5b.toIndexBuffer=function(e,t,i){if(0!==t.length){var r=h$W.createIndexBuffer({context:e,typedArray:t.arrayBuffer,usage:A$1c.STATIC_DRAW,indexDatatype:void 0!==t.uint16?ce$v.UNSIGNED_SHORT:ce$v.UNSIGNED_INT});return r.vertexArrayDestroyable=!1,r.dynamicDraw=i,!r.dynamicDraw&&delete t.arrayBuffer,r}},_0x24da5b.toRenderState=function(e,t,i){var r=Ee$n.DISABLED;e.blendFunction[0]==de$y.ONE&&e.blendFunction[1]==de$y.ONE_MINUS_SRC_ALPHA&&(r=Ee$n.ALPHA_BLEND);var n={frontFace:i.frontFace,cull:{enabled:i.enable,face:i.mode},depthRange:{near:t.range[0],far:t.range[1]},depthTest:{enabled:t.func!==de$y.ALWAYS,func:t.func},depthMask:t.mask,colorMask:{red:e.mask[0],green:e.mask[1],blue:e.mask[2],alpha:e.mask[3]},blending:r};return u$R.fromCache(n)},_0x24da5b.toComponentDatatype=function(e){switch(e){case"Int8":return S$W.BYTE;case"Uint8":return S$W.UNSIGNED_BYTE;case"Int16":return S$W.SHORT;case"Uint16":return S$W.UNSIGNED_SHORT;case"Int32":return S$W.INT;case"Uint32":return S$W.UNSIGNED_INT;default:return S$W.FLOAT}},_0x24da5b.mbxAttributeToCesiumVertexArrtribute=function(e,t,i,r){var n=this.toComponentDatatype(e.type);S$W.getSizeInBytes(n);var o=t.bytesPerElement,a=e.offset+o*(r||0);return{name:e.name,index:i,vertexBuffer:t,componentsPerAttribute:e.components,componentDatatype:n,offsetInBytes:a,strideInBytes:o,normalize:!1}};var _0x599044=(_0x176f31=!0,function(e,t){var i=_0x176f31?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x176f31=!1,i}),_0xcf3917=_0x599044(void 0,(function(){return _0xcf3917.toString().search("(((.+)+)+)+$").toString().constructor(_0xcf3917).search("(((.+)+)+)+$")})),_0x176f31;function _0x13e3d7(e,t,i,r){if("translucent"===e.renderPass){var n=i.paint.get("circle-opacity"),o=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity"),s=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==o.constantOr(1)&&0!==a.constantOr(1)){var l=e.depthModeForSublayer(0,_0x16a5dd.ReadOnly),u=e.colorModeForRenderPass(),c=[],h=t.getBucket(i);if(h){var d=h.programConfigurations.get(i.id),f=e.useProgram("circle",d),p=h.layoutVertexBuffer,_=h.indexBuffer,m=_0x349419.circleUniformMap(e,t,i),$=f.cesiumProgram,g=$.allUniforms;m=d.getUniformMaps(g,i.paint,m);var v={programConfiguration:d,layoutVertexBuffer:p,indexBuffer:_,uniformMap:m};if(s)for(var y=0,x=h.segments.get();y<x.length;y+=1){var b=x[y];c.push({segments:new _0x33528b([b]),sortKey:b.sortKey,state:v})}else c.push({segments:h.segments,sortKey:0,state:v});s&&c.sort((function(e,t){return e.sortKey-t.sortKey}));for(var w=0,C=c;w<C.length;w+=1){var T=0;for(x=C[w].segments.get();T<x.length;T+=1){var S=((b=x[T]).drawCommands||(b.drawCommands={}))[i.id];if(!S){S=new r$15({cull:!1,primitiveType:W$_.TRIANGLES,count:3*b.primitiveLength,offset:3*b.primitiveOffset}),b.drawCommands[i.id]=S;for(var E=b.cesiumVaos||(b.cesiumVaos={}),A=[],P=(p=h.layoutCesiumVertexBuffer,0);P<p.attributes.length;P++){var I=p.attributes[P],M=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(I,p,P,b.vertexOffset);A.push(M)}var O=E[i.id]||(E[i.id]=new m$19({context:e.cesiumContext,attributes:A,indexBuffer:h.cesiumIndexBuffer}));S.vertexArray=O}m.u_depthRange=function(){return l.range[0]},S.uniformMap=m,S.renderState=_0x24da5b.toRenderState(u,l,_0x7eb0a6.disabled),S.shaderProgram=$,S.execute(e.cesiumContext,r.passState)}}}}}}_0xcf3917();const _0x19ae78=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x319bf6=_0x19ae78(void 0,(function(){return _0x319bf6.toString().search("(((.+)+)+)+$").toString().constructor(_0x319bf6).search("(((.+)+)+)+$")}));function _0x3a5723(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!_0x3a5723(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!_0x3a5723(e[i],t[i]))return!1;return!0}return e===t}function bezier(e,t,i,r){const n=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),o=n(this,(function(){return o.toString().search("(((.+)+)+)+$").toString().constructor(o).search("(((.+)+)+)+$")}));o()}function clamp(e,t,i){return Math.min(i,Math.max(t,e))}function wrap(e,t,i){const r=i-t,n=((e-t)%r+r)%r+t;return n===t?i:n}function asyncAll(e,t,i){if(!e.length)return i(null,[]);let r=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),n[a]=t,0==--r&&i(o,n)}))}))}function extend$1(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var o=n[r];for(var a in o)e[a]=o[a]}return e}_0x319bf6(),bezier();let _0x5a86ad=1;function uniqueId(){return _0x5a86ad++}function endsWith(e,t){return-1!==e.indexOf(t,e.length-t.length)}function mapObject(e,t,i){const r={};for(const n in e)r[n]=t.call(i||this,e[n],n,e);return r}function filterObject(e,t,i){const r={};for(const n in e)t.call(i||this,e[n],n,e)&&(r[n]=e[n]);return r}function clone(e){return Array.isArray(e)?e.map(clone):"object"==typeof e&&e?mapObject(e,clone):e}function arraysIntersect(e,t){for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>=0)return!0;return!1}const _0x303cea={};function warnOnce$1(e){_0x303cea[e]||("undefined"!=typeof console&&console.warn(e),_0x303cea[e]=!0)}function isCounterClockwise(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function isWorker(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function parseCacheControl(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,i,r,n)=>{const o=r||n;return t[i]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}var _0x1275fb=(_0x953329=!0,function(e,t){var i=_0x953329?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x953329=!1,i}),_0x2ee343=_0x1275fb(void 0,(function(){return _0x2ee343.toString().search("(((.+)+)+)+$").toString().constructor(_0x2ee343).search("(((.+)+)+)+$")})),_0x953329;_0x2ee343();var _0x1c9762={lineUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_ratio:new _0xe46c73.Uniform1f(e,t.u_ratio),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_units_to_pixels:new _0xe46c73.Uniform2f(e,t.u_units_to_pixels),u_antialiasing:new _0xe46c73.Uniform1f(e,t.u_antialiasing)}},lineGradientUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_ratio:new _0xe46c73.Uniform1f(e,t.u_ratio),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_units_to_pixels:new _0xe46c73.Uniform2f(e,t.u_units_to_pixels),u_image:new _0xe46c73.Uniform1i(e,t.u_image)}},linePatternUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_ratio:new _0xe46c73.Uniform1f(e,t.u_ratio),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_image:new _0xe46c73.Uniform1i(e,t.u_image),u_units_to_pixels:new _0xe46c73.Uniform2f(e,t.u_units_to_pixels),u_scale:new _0xe46c73.Uniform4f(e,t.u_scale),u_fade:new _0xe46c73.Uniform1f(e,t.u_fade)}},lineSDFUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_ratio:new _0xe46c73.Uniform1f(e,t.u_ratio),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_units_to_pixels:new _0xe46c73.Uniform2f(e,t.u_units_to_pixels),u_patternscale_a:new _0xe46c73.Uniform2f(e,t.u_patternscale_a),u_patternscale_b:new _0xe46c73.Uniform2f(e,t.u_patternscale_b),u_sdfgamma:new _0xe46c73.Uniform1f(e,t.u_sdfgamma),u_image:new _0xe46c73.Uniform1i(e,t.u_image),u_tex_y_a:new _0xe46c73.Uniform1f(e,t.u_tex_y_a),u_tex_y_b:new _0xe46c73.Uniform1f(e,t.u_tex_y_b),u_mix:new _0xe46c73.Uniform1f(e,t.u_mix)}},lineUniformValues:function(e,t,i,r){e.transform;var n=_0x318a35(t),o=_0x19911a(t,1,r);return{u_matrix:_0x260006(e,t),u_ratio:1/o,u_device_pixel_ratio:1,u_units_to_pixels:[1/n[0],1/n[1]],u_antialiasing:r.lineAntialiasing}},lineGradientUniformValues:function(e,t,i,r){return extend$1(_0x1c9762.lineUniformValues(e,t,i,r),{u_image:0})},linePatternUniformValues:function(e,t,i,r,n){e.transform;var o=_0x3c633c(t,n);return{u_matrix:_0x260006(e,t),u_texsize:t.imageAtlasTexture.size,u_ratio:1/_0x19911a(t,1,n),u_device_pixel_ratio:1,u_image:0,u_scale:[ref_properties.browser.devicePixelRatio,o,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:_0x318a35(t)}},lineSDFUniformValues:function(e,t,i,r,n,o){e.transform;var a=e.lineAtlas,s=_0x3c633c(t,o),l="round"===i.layout.get("line-cap"),u=a.getDash(r.from,l),c=a.getDash(r.to,l),h=u.width*n.fromScale,d=c.width*n.toScale;return extend$1(_0x1c9762.lineUniformValues(e,t,i,o),{u_patternscale_a:[s/h,-u.height/2],u_patternscale_b:[s/d,-c.height/2],u_sdfgamma:a.width/(256*Math.min(h,d))/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:c.y,u_mix:n.t})}},_0x1fd37e=new o$1k;_0x1c9762.lineUniformMap=function(e,t,i,r){e.transform;var n=_0x318a35(t),o=_0x19911a(t,1,r),a={u_matrix:function(){return _0x260006(e,t)},u_ratio:function(){return 1/o},u_device_pixel_ratio:function(){return 1},u_units_to_pixels:function(){return _0x1fd37e.x=1/n[0],_0x1fd37e.y=1/n[1],_0x1fd37e},u_antialiasing:function(){return r.lineAntialiasing}};return a},_0x1c9762.lineGradientUniformMap=function(e,t,i,r){var n=_0x1c9762.lineUniformMap(e,t,i,r);return n.u_image=function(){return r.image},n};var _0x2d0852=new e$25;_0x1c9762.linePatternUniformMap=function(e,t,i,r,n){e.transform;var o=_0x3c633c(t,n),a={u_matrix:function(){return _0x260006(e,t)},u_texsize:function(){return t.imageAtlasTexture.size},u_ratio:function(){return 1/_0x19911a(t,1,n)},u_device_pixel_ratio:function(){return 1},u_image:function(){return n.image},u_scale:function(){return _0x2d0852.x=ref_properties.browser.devicePixelRatio,_0x2d0852.y=o,_0x2d0852.z=r.fromScale,_0x2d0852.w=r.toScale,_0x2d0852},u_fade:function(){return r.t},u_units_to_pixels:function(){return _0x318a35(t)}};return a};var _0x48925f=new o$1k,_0x37de88=new o$1k;function _0x3c633c(e,t){return 1/_0x19911a(e,1,t)}function _0x318a35(e){return[2/e.tileSize,-2/e.tileSize]}_0x1c9762.lineSDFUniformMap=function(e,t,i,r,n,o){var a=_0x1c9762.lineUniformMap(e,t,i,o);e.transform;var s=e.lineAtlas,l=_0x3c633c(t,o),u="round"===i.layout.get("line-cap"),c=s.getDash(r.from,u),h=s.getDash(r.to,u),d=c.width*n.fromScale,f=h.width*n.toScale;return a.u_patternscale_a=function(){return _0x48925f.x=l/d,_0x48925f.y=-c.height/2,_0x48925f},a.u_patternscale_b=function(){return _0x37de88.x=l/f,_0x37de88.y=-h.height/2,_0x37de88},a.u_sdfgamma=function(){return s.width/(256*Math.min(d,f))/2},a.u_image=function(){return o.image},a.u_tex_y_a=function(){return c.y},a.u_tex_y_b=function(){return h.y},a.u_mix=function(){return n.t},a.u_antialiasing=function(){return e.lineAntialiasing?1:0},a};var _0x12c915=new Float32Array(16);function _0x260006(e,t,i){var r=t.viewProjection;return y$15.toArray(r,_0x12c915)}function e$1K(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var T$R={DONT_CARE:de$y.DONT_CARE,FASTEST:de$y.FASTEST,NICEST:de$y.NICEST,validate:function(e){return e===T$R.DONT_CARE||e===T$R.FASTEST||e===T$R.NICEST}},S$N=Object.freeze(T$R),e$1J={NEAREST:de$y.NEAREST,LINEAR:de$y.LINEAR,validate:function(e){return e===e$1J.NEAREST||e===e$1J.LINEAR}},rt$g=Object.freeze(e$1J),E$12={NEAREST:de$y.NEAREST,LINEAR:de$y.LINEAR,NEAREST_MIPMAP_NEAREST:de$y.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:de$y.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:de$y.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:de$y.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===E$12.NEAREST||e===E$12.LINEAR||e===E$12.NEAREST_MIPMAP_NEAREST||e===E$12.LINEAR_MIPMAP_NEAREST||e===E$12.NEAREST_MIPMAP_LINEAR||e===E$12.LINEAR_MIPMAP_LINEAR}},tt$h=Object.freeze(E$12),E$11={CLAMP_TO_EDGE:de$y.CLAMP_TO_EDGE,REPEAT:de$y.REPEAT,MIRRORED_REPEAT:de$y.MIRRORED_REPEAT,validate:function(e){return e===E$11.CLAMP_TO_EDGE||e===E$11.REPEAT||e===E$11.MIRRORED_REPEAT}},q$11=Object.freeze(E$11);function n$Y(e){e=u$Y(e,u$Y.EMPTY_OBJECT);const t=u$Y(e.wrapS,q$11.CLAMP_TO_EDGE),i=u$Y(e.wrapT,q$11.CLAMP_TO_EDGE),r=u$Y(e.minificationFilter,tt$h.LINEAR),n=u$Y(e.magnificationFilter,rt$g.LINEAR),o=e$28(e.maximumAnisotropy)?e.maximumAnisotropy:1;if(!q$11.validate(t))throw new t$Z("Invalid sampler.wrapS.");if(!q$11.validate(i))throw new t$Z("Invalid sampler.wrapT.");if(!tt$h.validate(r))throw new t$Z("Invalid sampler.minificationFilter.");if(!rt$g.validate(n))throw new t$Z("Invalid sampler.magnificationFilter.");o$1u.typeOf.number.greaterThanOrEquals("maximumAnisotropy",o,1),this._wrapS=t,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=n,this._maximumAnisotropy=o}function L$17(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context);const t=e.context;let i=e.width,r=e.height;const n=e.source;e$28(n)&&(e$28(i)||(i=u$Y(n.videoWidth,n.width)),e$28(r)||(r=u$Y(n.videoHeight,n.height)));const o=u$Y(e.pixelFormat,V$O.RGBA),a=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE),s=V$O.toInternalFormat(o,a,t),l=V$O.isCompressedFormat(s);if(!e$28(i)||!e$28(r))throw new t$Z("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(o$1u.typeOf.number.greaterThan("width",i,0),i>e$1U.maximumTextureSize)throw new t$Z(`Width must be less than or equal to the maximum texture size (${e$1U.maximumTextureSize}). Check maximumTextureSize.`);if(o$1u.typeOf.number.greaterThan("height",r,0),r>e$1U.maximumTextureSize)throw new t$Z(`Height must be less than or equal to the maximum texture size (${e$1U.maximumTextureSize}). Check maximumTextureSize.`);if(!V$O.validate(o))throw new t$Z("Invalid options.pixelFormat.");if(!l&&!y$U.validate(a))throw new t$Z("Invalid options.pixelDatatype.");if(o===V$O.DEPTH_COMPONENT&&a!==y$U.UNSIGNED_SHORT&&a!==y$U.UNSIGNED_INT)throw new t$Z("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(o===V$O.DEPTH_STENCIL&&a!==y$U.UNSIGNED_INT_24_8)throw new t$Z("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(a===y$U.FLOAT&&!t.floatingPointTexture)throw new t$Z("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(a===y$U.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new t$Z("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(V$O.isDepthFormat(o)){if(e$28(n))throw new t$Z("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new t$Z("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(l){if(!e$28(n)||!e$28(n.arrayBufferView))throw new t$Z("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(V$O.isDXTFormat(s)&&!t.s3tc)throw new t$Z("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(V$O.isPVRTCFormat(s)&&!t.pvrtc)throw new t$Z("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(V$O.isASTCFormat(s)&&!t.astc)throw new t$Z("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(V$O.isETC2Format(s)&&!t.etc)throw new t$Z("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(V$O.isETC1Format(s)&&!t.etc1)throw new t$Z("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(V$O.isBC7Format(s)&&!t.bc7)throw new t$Z("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(V$O.compressedTextureSizeInBytes(s,i,r)!==n.arrayBufferView.byteLength)throw new t$Z("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}const u=e.preMultiplyAlpha||o===V$O.RGB||o===V$O.LUMINANCE,c=u$Y(e.flipY,!0),h=u$Y(e.skipColorSpaceConversion,!1);let d=!0;const f=t._gl,p=f.TEXTURE_2D,_=f.createTexture();f.activeTexture(f.TEXTURE0),f.bindTexture(p,_);let m,$=4;if(e$28(n)&&e$28(n.arrayBufferView)&&!l&&($=V$O.alignmentInBytes(o,a,i)),f.pixelStorei(f.UNPACK_ALIGNMENT,$),h?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),e$28(n))if(e$28(n.arrayBufferView)){f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1);let e,u,h,d=n.arrayBufferView;if(l){if(f.compressedTexImage2D(p,0,s,i,r,0,d),e$28(n.mipLevels))for(u=i,h=r,e=0;e<n.mipLevels.length;++e)u=0|Math.floor(u/2),u<1&&(u=1),h=0|Math.floor(h/2),h<1&&(h=1),f.compressedTexImage2D(p,e+1,s,u,h,0,n.mipLevels[e])}else if(c&&(d=V$O.flipY(d,o,a,i,r)),f.texImage2D(p,0,s,i,r,0,o,y$U.toWebGLConstant(a,t),d),e$28(n.mipLevels))for(u=i,h=r,e=0;e<n.mipLevels.length;++e)u=0|Math.floor(u/2),u<1&&(u=1),h=0|Math.floor(h/2),h<1&&(h=1),f.texImage2D(p,e+1,s,u,h,0,o,y$U.toWebGLConstant(a,t),n.mipLevels[e])}else if(e$28(n.framebuffer))f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),n.framebuffer!==t.defaultFramebuffer&&n.framebuffer._bind(),f.copyTexImage2D(p,0,s,n.xOffset,n.yOffset,i,r,0),n.framebuffer!==t.defaultFramebuffer&&n.framebuffer._unBind();else{f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,c),f.texImage2D(p,0,s,o,y$U.toWebGLConstant(a,t),n);let i=e.mipLevels;if(e$28(i))for(var g=0,v=i.length;g<v;++g)f.texImage2D(p,g+1,s,o,y$U.toWebGLConstant(a,t),i[g])}else f.texImage2D(p,0,s,i,r,0,o,y$U.toWebGLConstant(a,t),null),d=!1;f.bindTexture(p,null),m=l?V$O.compressedTextureSizeInBytes(o,i,r):V$O.textureSizeInBytes(o,a,i,r),this._id=e$1K(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=p,this._texture=_,this._internalFormat=s,this._pixelFormat=o,this._pixelDatatype=a,this._width=i,this._height=r,this._dimensions=new o$1k(i,r),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=u,this._flipY=c,this._initialized=d,this._sampler=void 0,this.sampler=e$28(e.sampler)?e.sampler:new n$Y,t.memorySize+=m}Object.defineProperties(n$Y.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),n$Y.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy},n$Y.NEAREST=Object.freeze(new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})),L$17.create=function(e){return new L$17(e)},L$17.fromFramebuffer=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context);const t=e.context,i=t._gl,r=u$Y(e.pixelFormat,V$O.RGB),n=u$Y(e.framebufferXOffset,0),o=u$Y(e.framebufferYOffset,0),a=u$Y(e.width,i.drawingBufferWidth),s=u$Y(e.height,i.drawingBufferHeight),l=e.framebuffer;if(!V$O.validate(r))throw new t$Z("Invalid pixelFormat.");if(V$O.isDepthFormat(r)||V$O.isCompressedFormat(r))throw new t$Z("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(o$1u.defined("options.context",e.context),o$1u.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),o$1u.typeOf.number.greaterThanOrEquals("framebufferYOffset",o,0),n+a>i.drawingBufferWidth)throw new t$Z("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(o+s>i.drawingBufferHeight)throw new t$Z("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new L$17({context:t,width:a,height:s,pixelFormat:r,source:{framebuffer:e$28(l)?l:t.defaultFramebuffer,xOffset:n,yOffset:o,width:a,height:s}})},Object.defineProperties(L$17.prototype,{id:{get:function(){return this._id},set:function(e){this._id=e}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,i=e.magnificationFilter;const r=this._context,n=this._pixelFormat,o=this._pixelDatatype,a=t===tt$h.NEAREST_MIPMAP_NEAREST||t===tt$h.NEAREST_MIPMAP_LINEAR||t===tt$h.LINEAR_MIPMAP_NEAREST||t===tt$h.LINEAR_MIPMAP_LINEAR;(o===y$U.FLOAT&&!r.textureFloatLinear||o===y$U.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(t=a?tt$h.NEAREST_MIPMAP_NEAREST:tt$h.NEAREST,i=rt$g.NEAREST),r.webgl2&&V$O.isDepthFormat(n)&&(t=tt$h.NEAREST,i=rt$g.NEAREST);const s=r._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.texParameteri(l,s.TEXTURE_MIN_FILTER,t),s.texParameteri(l,s.TEXTURE_MAG_FILTER,i),s.texParameteri(l,s.TEXTURE_WRAP_S,e.wrapS),s.texParameteri(l,s.TEXTURE_WRAP_T,e.wrapT),e$28(this._textureFilterAnisotropic)&&s.texParameteri(l,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),s.bindTexture(l,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),L$17.prototype.copyFrom=function(e,t,i){if(t=u$Y(t,0),i=u$Y(i,0),o$1u.defined("source",e),V$O.isDepthFormat(this._pixelFormat))throw new t$Z("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(V$O.isCompressedFormat(this._pixelFormat))throw new t$Z("Cannot call copyFrom with a compressed texture pixel format.");o$1u.typeOf.number.greaterThanOrEquals("xOffset",t,0),o$1u.typeOf.number.greaterThanOrEquals("yOffset",i,0),o$1u.typeOf.number.lessThanOrEquals("xOffset + source.width",t+e.width,this._width),o$1u.typeOf.number.lessThanOrEquals("yOffset + source.height",i+e.height,this._height);const r=this._context;var n=r._gl,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture);var a=e.width,s=e.height,l=e.arrayBufferView,u=this._width,c=this._height,h=this._pixelFormat,d=this._pixelDatatype;const f=this._internalFormat;var p=this._preMultiplyAlpha,_=this._flipY,m=4;e$28(l)&&(m=V$O.alignmentInBytes(h,d,a)),n.pixelStorei(n.UNPACK_ALIGNMENT,m),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);var $=!1;if(!this._initialized){if(0===t&&0===i&&a===u&&s===c)e$28(l)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),_&&(l=V$O.flipY(l,h,d,u,c)),n.texImage2D(o,0,f,u,c,0,h,y$U.toWebGLConstant(d,r),l)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,_),n.texImage2D(o,0,f,h,y$U.toWebGLConstant(d,r),e)),$=!0;else{n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var g=V$O.createTypedArray(h,d,u,c);n.texImage2D(o,0,f,u,c,0,h,y$U.toWebGLConstant(d,r),g)}this._initialized=!0}$||(e$28(l)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),_&&(l=V$O.flipY(l,h,d,a,s)),n.texSubImage2D(o,0,t,i,a,s,h,y$U.toWebGLConstant(d,r),l)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,_),n.texSubImage2D(o,0,t,i,h,y$U.toWebGLConstant(d,r),e))),n.bindTexture(o,null)},L$17.prototype.copyFromFramebuffer=function(e,t,i,r,n,o){if(e=u$Y(e,0),t=u$Y(t,0),i=u$Y(i,0),r=u$Y(r,0),n=u$Y(n,this._width),o=u$Y(o,this._height),V$O.isDepthFormat(this._pixelFormat))throw new t$Z("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===y$U.FLOAT)throw new t$Z("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===y$U.HALF_FLOAT)throw new t$Z("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(V$O.isCompressedFormat(this._pixelFormat))throw new t$Z("Cannot call copyFrom with a compressed texture pixel format.");o$1u.typeOf.number.greaterThanOrEquals("xOffset",e,0),o$1u.typeOf.number.greaterThanOrEquals("yOffset",t,0),o$1u.typeOf.number.greaterThanOrEquals("framebufferXOffset",i,0),o$1u.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),o$1u.typeOf.number.lessThanOrEquals("xOffset + width",e+n,this._width),o$1u.typeOf.number.lessThanOrEquals("yOffset + height",t+o,this._height);const a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,e,t,i,r,n,o),a.bindTexture(s,null),this._initialized=!0},L$17.prototype.generateMipmap=function(e){if(e=u$Y(e,S$N.DONT_CARE),V$O.isDepthFormat(this._pixelFormat))throw new t$Z("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(V$O.isCompressedFormat(this._pixelFormat))throw new t$Z("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!e$27.isPowerOfTwo(this._width))throw new t$Z("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!e$27.isPowerOfTwo(this._height))throw new t$Z("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!S$N.validate(e))throw new t$Z("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},L$17.prototype.isDestroyed=function(){return!1},L$17.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._context.memorySize-=this._sizeInBytes,i$Z(this)};var _0x249567=(_0x25d56e=!0,function(e,t){var i=_0x25d56e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x25d56e=!1,i}),_0x10676d=_0x249567(void 0,(function(){return _0x10676d.toString().search("(((.+)+)+)+$").toString().constructor(_0x10676d).search("(((.+)+)+)+$")})),_0x25d56e;_0x10676d();var _0x3f6cef=window.HTMLImageElement,_0x549309=window.HTMLCanvasElement,_0x12f5d4=window.HTMLVideoElement,_0x27c77c=window.ImageData,_0x3651b1=function(e,t,i,r,n){this.context=e,this.cesiumContext=t,this.format=r,this.update(i,n)};_0x3651b1.prototype.update=function(e,t,i){var r=e.width,n=e.height;this.useMipmap=Boolean(t&&t.useMipmap),!(this.size&&this.size[0]===r&&this.size[1]===n||i)&&(this.size=[r,n],this.cesiumTexture&&this.cesiumTexture.destroy());var o=e;if(o=e instanceof _0x3f6cef||e instanceof _0x549309||e instanceof _0x12f5d4||e instanceof _0x27c77c?e:e.data,this.cesiumTexture){var a=i||{x:0,y:0},s=a.x,l=a.y;this.cesiumTexture.copyFrom({width:r,height:n,arrayBufferView:e},s,l)}else this.cesiumTexture=new L$17({context:this.cesiumContext,source:{arrayBufferView:o},width:r,height:n,pixelFormat:this.format,flipY:!1});this.useMipmap&&this.isSizePowerOfTwo()&&this.cesiumTexture.generateMipmap()},_0x3651b1.prototype.bind=function(e,t,i){i===tt$h.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(i=tt$h.LINEAR),(e!==this.filter||i!==this.minFilter||t!==this.wrap)&&(this.filter=e,this.minFilter=i,this.wrap=t,this.sampler&&this.sampler.destroy(),this.sampler=new n$Y({wrapS:t,wrapT:t,minificationFilter:i,magnificationFilter:e}),this.cesiumTexture.sampler=this.sampler)},_0x3651b1.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},_0x3651b1.prototype.destroy=function(){this.cesiumTexture&&(this.cesiumTexture.destroy(),this.cesiumTexture=null)};var _0x2f1f03=(_0x5d1fac=!0,function(e,t){var i=_0x5d1fac?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5d1fac=!1,i}),_0x3e584a=_0x2f1f03(void 0,(function(){return _0x3e584a.toString().search("(((.+)+)+)+$").toString().constructor(_0x3e584a).search("(((.+)+)+)+$")})),_0x5d1fac;function _0x510aba(e,t,i,r){if("translucent"===e.renderPass&&e$28(i)&&e$28(i.paint)){var n=i.paint.get("line-opacity"),o=i.paint.get("line-width");if(0!==n.constantOr(1)&&0!==o.constantOr(1)){var a=e.depthModeForSublayer(0,_0x16a5dd.ReadOnly),s=e.colorModeForRenderPass(),l=i.paint.get("line-dasharray"),u=i.paint.get("line-pattern"),c=u&&u.constantOr(1),h=i.paint.get("line-gradient"),d=i.getCrossfadeParameters(),f=l?"lineSDF":c?"linePattern":h?"lineGradient":"line",p=e.context,_=e.cesiumContext;if(h){var m=i.gradientTexture;if(!i.gradient)return;!m&&(m=i.gradientTexture=new _0x3651b1(p,_,i.gradient,de$y.RGBA)),m.bind(de$y.LINEAR,de$y.CLAMP_TO_EDGE)}var $=t.getBucket(i);if($){var g=$.programConfigurations.get(i.id),v=e.useProgram(f,g).cesiumProgram,y=u.constantOr(null);if(y&&t.imageAtlas){var x=t.imageAtlas,b=x.patternPositions[y.to.toString()],w=x.patternPositions[y.from.toString()];b&&w&&g.setConstantPatternPositions(b,w)}var C=o.value.value,T=C;T*=e._globalLineWidthScale,i.paint._values["line-width"].value.value=T,l?r.image=e.lineAtlas.getTexture(_):c&&(t.imageAtlasTexture.bind(de$y.LINEAR,de$y.CLAMP_TO_EDGE),r.image=t.imageAtlasTexture.cesiumTexture,g.updatePatternPaintBuffers(d));var S=l?_0x1c9762.lineSDFUniformMap(e,t,i,l,d,r):c?_0x1c9762.linePatternUniformMap(e,t,i,d,r):h?_0x1c9762.lineGradientUniformMap(e,t,i,r):_0x1c9762.lineUniformMap(e,t,i,r),E=v.allUniforms;S=g.getUniformMaps(E,i.paint,S);for(var A=g.getAttributeLocation(),P=0,I=$.segments.get();P<I.length;P+=1){var M=I[P],O=(M.drawCommands||(M.drawCommands={}))[i.id];if(!O){O=new r$15({cull:!1,primitiveType:W$_.TRIANGLES,count:3*M.primitiveLength,offset:3*M.primitiveOffset}),M.drawCommands[i.id]=O;for(var D=M.cesiumVaos||(M.cesiumVaos={}),R=[],L=0;L<$.layoutCesiumVertexBuffer.attributes.length;L++){var B=$.layoutCesiumVertexBuffer.attributes[L],N=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(B,$.layoutCesiumVertexBuffer,A[B.name],M.vertexOffset);R.push(N)}var F=g.getPaintVertexBuffers();if(e$28(F))for(var z=0;z<F.length;z++)for(var k=F[z],V=0;V<k.attributes.length;V++){var U=k.attributes[V];N=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(U,k,A[U.name],M.vertexOffset);R.push(N)}var X=D[i.id]||(D[i.id]=new m$19({context:_,attributes:R,indexBuffer:$.cesiumIndexBuffer}));O.vertexArray=X}S.u_depthRange=function(){return 1-a.range[0]},O.uniformMap=S,O.renderState=_0x24da5b.toRenderState(s,a,_0x7eb0a6.disabled),O.shaderProgram=v,O.execute(_,r.passState)}i.paint._values["line-width"].value.value=C}}}}_0x3e584a();var _0x2b1441=(_0x3c9ca2=!0,function(e,t){var i=_0x3c9ca2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3c9ca2=!1,i}),_0x2fd901=_0x2b1441(void 0,(function(){return _0x2fd901.toString().search("(((.+)+)+)+$").toString().constructor(_0x2fd901).search("(((.+)+)+)+$")})),_0x3c9ca2;function _0x1821b9(e,t,i,r){r.drawFillPattern=!0;var n=1/_0x19911a(i,1,r);i.realtime&&(n*=2);var o=i.targetTileSize*i.x,a=i.targetTileSize*i.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[1,n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,a>>16],u_pixel_coord_lower:[65535&o,65535&a]}}_0x2fd901();var _0x4b669c=new e$25,_0x4b5e23=new o$1k,_0x1d8c16=new o$1k,_0x2bd27d=new o$1k;function _0x46d7e2(e,t,i,r){r.drawFillPattern=!0;var n=1/_0x19911a(i,1,r);i.realtime&&(n*=2);var o=i.targetTileSize*i.x,a=i.targetTileSize*i.y;return e.u_image=function(){return r.image},e.u_texsize=function(){return _0x2bd27d.x=i.imageAtlasTexture.size[0],_0x2bd27d.y=i.imageAtlasTexture.size[1],_0x2bd27d},e.u_scale=function(){return _0x4b669c.x=1,_0x4b669c.y=n,_0x4b669c.z=t.fromScale,_0x4b669c.w=t.toScale,_0x4b669c},e.u_fade=function(){return t.t},e.u_pixel_coord_lower=function(){return _0x4b5e23.x=65535&o,_0x4b5e23.y=65535&a,_0x4b5e23},e.u_pixel_coord_upper=function(){return _0x1d8c16.x=o>>16,_0x1d8c16.y=a>>16,_0x1d8c16},e}var _0x54079d={fillUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix)}},fillPatternUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_image:new _0xe46c73.Uniform1i(e,t.u_image),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_pixel_coord_upper:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_lower),u_scale:new _0xe46c73.Uniform4f(e,t.u_scale),u_fade:new _0xe46c73.Uniform1f(e,t.u_fade)}},fillOutlineUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_world:new _0xe46c73.Uniform2f(e,t.u_world)}},fillOutlinePatternUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_world:new _0xe46c73.Uniform2f(e,t.u_world),u_image:new _0xe46c73.Uniform1i(e,t.u_image),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_pixel_coord_upper:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_lower),u_scale:new _0xe46c73.Uniform4f(e,t.u_scale),u_fade:new _0xe46c73.Uniform1f(e,t.u_fade)}},fillUniformValues:function(e){return{u_matrix:e}},fillPatternUniformValues:function(e,t,i,r,n){return extend$1(_0x54079d.fillUniformValues(e),_0x1821b9(i,t,r,n))},fillOutlineUniformValues:function(e,t){return{u_matrix:e,u_world:t}},fillOutlinePatternUniformValues:function(e,t,i,r,n,o){return extend$1(_0x54079d.fillPatternUniformValues(e,t,i,r,o),{u_world:n})},fillUniformMap:function(e){var t={u_matrix:function(){return e}};return t},fillPatternUniformMap:function(e,t,i,r,n){var o=_0x54079d.fillUniformMap(e);return o=_0x46d7e2(o,i,r,n)}},_0x14ccf4=new o$1k;_0x54079d.fillOutlineUniformMap=function(e,t){var i={u_matrix:function(){return e},u_world:function(){return _0x14ccf4.x=t[0],_0x14ccf4.y=t[1],_0x14ccf4}};return i},_0x54079d.fillOutlinePatternUniformMap=function(e,t,i,r,n,o){var a={};return(a=_0x54079d.fillPatternUniformMap(e,t,i,r,o)).u_world=function(){return _0x14ccf4.x=n[0],_0x14ccf4.y=n[1],_0x14ccf4},a};var _0x1992cc=(_0x11ae7=!0,function(e,t){var i=_0x11ae7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x11ae7=!1,i}),_0x3d255c=_0x1992cc(void 0,(function(){return _0x3d255c.toString().search("(((.+)+)+)+$").toString().constructor(_0x3d255c).search("(((.+)+)+)+$")})),_0x11ae7;_0x3d255c();var _0x400529=new Float32Array(16),_0x172b9d={};function _0x24e19c(e,t,i,r,n,o,a){var s,l,u,c,h=i.paint.get("fill-pattern"),d=h&&h.constantOr(1),f=i.getCrossfadeParameters(),p={};o?(l=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=W$_.LINES):(l=d?"fillPattern":"fill",s=W$_.TRIANGLES);var _=t.getBucket(i);if(_){var m=_.programConfigurations.get(i.id);d&&(t.imageAtlasTexture.bind(de$y.LINEAR,de$y.CLAMP_TO_EDGE),a.image=t.imageAtlasTexture.cesiumTexture,m.updatePatternPaintBuffers(f));var $=h.constantOr(null);if($&&t.imageAtlas){var g=t.imageAtlas,v=g.patternPositions[$.to.toString()],y=g.patternPositions[$.from.toString()];v&&y&&m.setConstantPatternPositions(v,y)}var x=e.useProgram(l,m).cesiumProgram,b=t.viewProjection,w=y$15.toArray(b,_0x400529);if(o){c=_.cesiumIndexBuffer2,u=_.segments2;var C=[t.tileSize,t.tileSize];p="fillOutlinePattern"===l&&d?_0x54079d.fillOutlinePatternUniformMap(w,e,f,t,C,a):_0x54079d.fillOutlineUniformMap(w,C)}else c=_.cesiumIndexBuffer,u=_.segments,p=d?_0x54079d.fillPatternUniformMap(w,e,f,t,a):_0x54079d.fillUniformMap(w);var T=x.allUniforms;p=m.getUniformMaps(T,i.paint,p);for(var S=m.getPaintVertexBuffers(),E=m.getAttributeLocation(),A=0,P=u.get();A<P.length;A+=1){var I=P[A],M=(I.drawCommands||(I.drawCommands={}))[i.id];if(!M){var O=_0x172b9d[s];M=new r$15({cull:!1,primitiveType:s,count:I.primitiveLength*O,offset:I.primitiveOffset*O}),I.drawCommands[i.id]=M;for(var D=I.cesiumVaos||(I.cesiumVaos={}),R=[],L=0;L<_.layoutCesiumVertexBuffer.attributes.length;L++){var B=_.layoutCesiumVertexBuffer.attributes[L],N=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(B,_.layoutCesiumVertexBuffer,E[B.name],I.vertexOffset);R.push(N)}R.length;for(var F=0;F<S.length;F++)for(var z=S[F],k=0;k<z.attributes.length;k++){B=z.attributes[k],N=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(B,z,E[B.name],I.vertexOffset);R.push(N)}var V=D[i.id]||(D[i.id]=new m$19({context:e.cesiumContext,attributes:R,indexBuffer:c}));M.vertexArray=V}p.u_depthRange=function(){return 1-r.range[0]},M.uniformMap=p,M.renderState=_0x24da5b.toRenderState(n,r,_0x7eb0a6.disabled),M.shaderProgram=x,M.execute(e.cesiumContext,a.passState)}}}function _0x46372a(e,t,i,r){var n=i.paint.get("fill-color"),o=i.paint.get("fill-opacity"),a=o.value.value;if(o.value.value=0!==o.value.value?.5*o.value.value+.5:0,0!==o.constantOr(1)){var s=e.colorModeForRenderPass(),l=i.paint.get("fill-pattern").constantOr(1)||1!==n.constantOr(_0x25bd71.transparent).a||1!==o.constantOr(0)?"translucent":"opaque";if(e.renderPass===l){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?_0x16a5dd.ReadWrite:_0x16a5dd.ReadOnly);_0x24e19c(e,t,i,u,s,!1,r)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){var c=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,_0x16a5dd.ReadOnly);_0x24e19c(e,t,i,c,s,!0,r)}o.value.value=a}}_0x172b9d[W$_.LINES]=2,_0x172b9d[W$_.TRIANGLES]=3,_0x172b9d[W$_.LINE_STRIP]=1;var _0x20f5eb=(_0x449c94=!0,function(e,t){var i=_0x449c94?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x449c94=!1,i}),_0x236360=_0x20f5eb(void 0,(function(){return _0x236360.toString().search("(((.+)+)+)+$").toString().constructor(_0x236360).search("(((.+)+)+)+$")})),_0x449c94;function _0x36c32e(e,t){this.x=e,this.y=t}_0x236360(),_0x36c32e.prototype={clone:function(){return new _0x36c32e(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,n=i*this.x+t*this.y;return this.x=r,this.y=n,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.x+i*(this.x-t.x)-r*(this.y-t.y),o=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=n,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},_0x36c32e.convert=function(e){return e instanceof _0x36c32e?e:Array.isArray(e)?new _0x36c32e(e[0],e[1]):e};var _0x360e96=(_0x518f85=!0,function(e,t){var i=_0x518f85?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x518f85=!1,i}),_0x2c9312=_0x360e96(void 0,(function(){return _0x2c9312.toString().search("(((.+)+)+)+$").toString().constructor(_0x2c9312).search("(((.+)+)+)+$")})),_0x518f85;_0x2c9312();var _0x21c8ba={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};const _0x3e0a00=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x395ff9=_0x3e0a00(void 0,(function(){return _0x395ff9.toString().search("(((.+)+)+)+$").toString().constructor(_0x395ff9).search("(((.+)+)+)+$")}));function allowsVerticalWritingMode(e){for(const t of e)if(charHasUprightVerticalOrientation(t.charCodeAt(0)))return!0;return!1}function charHasUprightVerticalOrientation(e){return 746===e||747===e||!(e<4352)&&(!!_0x21c8ba["Bopomofo Extended"](e)||(!!_0x21c8ba.Bopomofo(e)||(!(!_0x21c8ba["CJK Compatibility Forms"](e)||e>=65097&&e<=65103)||(!!_0x21c8ba["CJK Compatibility Ideographs"](e)||(!!_0x21c8ba["CJK Compatibility"](e)||(!!_0x21c8ba["CJK Radicals Supplement"](e)||(!!_0x21c8ba["CJK Strokes"](e)||(!(!_0x21c8ba["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||(!!_0x21c8ba["CJK Unified Ideographs Extension A"](e)||(!!_0x21c8ba["CJK Unified Ideographs"](e)||(!!_0x21c8ba["Enclosed CJK Letters and Months"](e)||(!!_0x21c8ba["Hangul Compatibility Jamo"](e)||(!!_0x21c8ba["Hangul Jamo Extended-A"](e)||(!!_0x21c8ba["Hangul Jamo Extended-B"](e)||(!!_0x21c8ba["Hangul Jamo"](e)||(!!_0x21c8ba["Hangul Syllables"](e)||(!!_0x21c8ba.Hiragana(e)||(!!_0x21c8ba["Ideographic Description Characters"](e)||(!!_0x21c8ba.Kanbun(e)||(!!_0x21c8ba["Kangxi Radicals"](e)||(!!_0x21c8ba["Katakana Phonetic Extensions"](e)||(!(!_0x21c8ba.Katakana(e)||12540===e)||(!(!_0x21c8ba["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||(!(!_0x21c8ba["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||(!!_0x21c8ba["Unified Canadian Aboriginal Syllabics"](e)||(!!_0x21c8ba["Unified Canadian Aboriginal Syllabics Extended"](e)||(!!_0x21c8ba["Vertical Forms"](e)||(!!_0x21c8ba["Yijing Hexagram Symbols"](e)||(!!_0x21c8ba["Yi Syllables"](e)||!!_0x21c8ba["Yi Radicals"](e))))))))))))))))))))))))))))))}function charInRTLScript(e){return e>=1424&&e<=2303||_0x21c8ba["Arabic Presentation Forms-A"](e)||_0x21c8ba["Arabic Presentation Forms-B"](e)}function stringContainsRTLText(e){for(const t of e)if(charInRTLScript(t.charCodeAt(0)))return!0;return!1}_0x395ff9();const _0x538c64=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x78be1e=_0x538c64(void 0,(function(){return _0x78be1e.toString().search("(((.+)+)+)+$").toString().constructor(_0x78be1e).search("(((.+)+)+)+$")}));_0x78be1e();const verticalizedCharacterMap={"!":"ï¸?","#":"ï¼?",$:"ï¼?","%":"ï¼?","&":"ï¼?","(":"ï¸?",")":"ï¸?","*":"ï¼?","+":"ï¼?",",":"ï¸?","-":"ï¸?",".":"ãƒ?","/":"ï¼?",":":"ï¸?",";":"ï¸?","<":"ï¸?","=":"ï¼?",">":"ï¹?","?":"ï¸?","@":"ï¼?","[":"ï¹?","\\":"ï¼?","]":"ï¹?","^":"ï¼?",_:"ï¸?","`":"ï½?","{":"ï¸?","|":"â€?","}":"ï¸?","~":"ï½?","¢":"ï¿?","£":"ï¿?","Â¥":"ï¿?","¦":"ï¿?","¬":"ï¿?","¯":"ï¿?","â€?":"ï¸?","â€?":"ï¸?","â€?":"ï¹?","â€?":"ï¹?","â€?":"ï¹?","â€?":"ï¹?","â€?":"ï¸?","â€?":"ãƒ?","â‚?":"ï¿?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¹?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¹?","ã€?":"ï¹?","ã€?":"ï¹?","ã€?":"ï¹?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¸?","ã€?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ãƒ?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¸?","ï¼?":"ï¹?","ï¼?":"ï¸?","ï¼?":"ï¹?","ï¼?":"ï¹?","ï¼?":"ï¸?","ï½?":"ï¸?","ï½?":"â€?","ï½?":"ï¸?","ï½?":"ï¸?","ï½?":"ï¸?","ï½?":"ï¸?","ï½?":"ï¹?","ï½?":"ï¹?"};var _0x2fffb0=function(e,t){void 0===t&&(t={}),extend$1(this,t),this.type=e};!function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){void 0===i&&(i={}),e.call(this,"error",extend$1({error:t},i))}r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n}(_0x2fffb0);const _0xe5a09e=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x713601=_0xe5a09e(void 0,(function(){return _0x713601.toString().search("(((.+)+)+)+$").toString().constructor(_0x713601).search("(((.+)+)+)+$")}));function _0x2b40a2(e,t){this._transformRequestFn=e,this._customAccessToken=t}function _0x1acf56(e){return 0===e.indexOf("mapbox:")}_0x713601(),_0x2b40a2.prototype._createSkuToken=function(){const e=createSkuToken();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},_0x2b40a2.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},_0x2b40a2.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},_0x2b40a2.prototype.normalizeStyleURL=function(e,t){if(!_0x1acf56(e))return e;const i=_0x1f638e(e);return i.path="/styles/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||t)},_0x2b40a2.prototype.normalizeGlyphsURL=function(e,t){if(!_0x1acf56(e))return e;const i=_0x1f638e(e);return i.path="/fonts/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||t)},_0x2b40a2.prototype.normalizeSourceURL=function(e,t){if(!_0x1acf56(e))return e;const i=_0x1f638e(e);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||t)},_0x2b40a2.prototype.normalizeSpriteURL=function(e,t,i,r){const n=_0x1f638e(e);return _0x1acf56(e)?(n.path="/styles/v1"+n.path+"/sprite"+t+i,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=""+t+i,_0x1ceb92(n))},_0x2b40a2.prototype.normalizeTileURL=function(e,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),!t||!_0x1acf56(t))return e;const r=_0x1f638e(e),n=browser.devicePixelRatio>=2||512===i?"@2x":"",o=webpSupported.supported?".webp":"$1";return r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+o),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path,config.REQUIRE_ACCESS_TOKEN&&(config.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,this._customAccessToken)},_0x2b40a2.prototype.canonicalizeTileURL=function(e){const t=_0x1f638e(e);if(!t.path.match(/(^\/v4\/)/)||!t.path.match(/\.[\w]+$/))return e;let i="mapbox://tiles/";i+=t.path.replace("/v4/","");const r=t.params.filter((e=>!e.match(/^access_token=/)));return r.length&&(i+="?"+r.join("&")),i},_0x2b40a2.prototype.canonicalizeTileset=function(e,t){if(!_0x1acf56(t))return e.tiles||[];const i=[];for(const t of e.tiles){const e=this.canonicalizeTileURL(t);i.push(e)}return i},_0x2b40a2.prototype._makeAPIURL=function(e,t){const i=_0x1f638e(config.API_URL);if(e.protocol=i.protocol,e.authority=i.authority,"/"!==i.path&&(e.path=""+i.path+e.path),!config.REQUIRE_ACCESS_TOKEN)return _0x1ceb92(e);if(!(t=t||config.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. ");if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ");return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push("access_token="+t),_0x1ceb92(e)};const _0x3e4d18=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function _0x45d03a(e){return _0x3e4d18.test(e)}function _0x4aefbe(e){return e.indexOf("sku=")>0&&_0x45d03a(e)}const _0x1e669b=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function _0x1f638e(e){const t=e.match(_0x1e669b);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function _0x1ceb92(e){const t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}const _0x1444c8=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x4302aa=_0x1444c8(void 0,(function(){return _0x4302aa.toString().search("(((.+)+)+)+$").toString().constructor(_0x4302aa).search("(((.+)+)+)+$")}));_0x4302aa();const _0x40a693="mapbox-tiles",_0x2c28f7=42e4;let _0x165406;function _0x2df573(e,t){if(void 0===_0x165406)try{new Response(new ReadableStream),_0x165406=!0}catch(e){_0x165406=!1}_0x165406?t(e.body):e.blob().then(t)}function cachePut(e,t,i){if(!window.caches)return;const r={status:t.status,statusText:t.statusText,headers:new window.Headers};t.headers.forEach(((e,t)=>r.headers.set(t,e)));const n=parseCacheControl(t.headers.get("Cache-Control")||"");if(n["no-store"])return;n["max-age"]&&r.headers.set("Expires",new Date(i+1e3*n["max-age"]).toUTCString());new Date(r.headers.get("Expires")).getTime()-i<_0x2c28f7||_0x2df573(t,(t=>{const i=new window.Response(t,r);window.caches.open(_0x40a693).then((t=>t.put(_0x7ffd12(e.url),i)))}))}function _0x7ffd12(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function cacheGet(e,t){if(!window.caches)return t(null);const i=_0x7ffd12(e.url);window.caches.open(_0x40a693).catch(t).then((e=>{e.match(i).catch(t).then((r=>{const n=_0x429cff(r);e.delete(i),n&&e.put(i,r.clone()),t(null,r,n)}))}))}function _0x429cff(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")),i=parseCacheControl(e.headers.get("Cache-Control")||"");return t>Date.now()&&!i["no-cache"]}const _0x20f184=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x425a9d=_0x20f184(void 0,(function(){return _0x425a9d.toString().search("(((.+)+)+)+$").toString().constructor(_0x425a9d).search("(((.+)+)+)+$")}));_0x425a9d();const _0x3c09b7={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(_0x3c09b7);class _0x5b7af2 extends Error{constructor(e,t,i){401===t&&_0x45d03a(i)&&(e+=": you may have provided an invalid Mapbox access token"),super(e),this.status=t,this.url=i,this.name=this.constructor.name,this.message=e}toString(){return this.name+": "+this.message+" ("+this.status+"): "+this.url}}const getReferrer=isWorker()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href,_0x355e3c=e=>/^file:/.test(e)||/^file:/.test(getReferrer())&&!/^\w+:/.test(e);function _0x5b9d6b(e,t){const i=isWorker()?self:window,r=new i.AbortController,n=new i.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:getReferrer(),signal:r.signal});let o=!1,a=!1;const s=_0x4aefbe(n.url);"json"===e.type&&n.headers.set("Accept","application/json");const l=(r,o,l)=>{if(a)return;if(r&&"SecurityError"!==r.message&&warnOnce$1(r),o&&l)return u(o);const c=Date.now();i.fetch(n).then((i=>{if(i.ok){const e=s?i.clone():null;return u(i,e,c)}return t(new _0x5b7af2(i.statusText,i.status,e.url))})).catch((e=>{20!==e.code&&t(new Error(e.message))}))},u=(i,r,s)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then((e=>{a||(r&&s&&cachePut(n,r,s),o=!0,t(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((e=>t(new Error(e.message))))};return s?cacheGet(n,l):l(null,null),{cancel:()=>{a=!0,o||r.abort()}}}function _0x5b53c6(e,t){const i=new((isWorker()?self:window).XMLHttpRequest);i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===e.type)try{r=JSON.parse(i.response)}catch(e){return t(e)}t(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else t(new _0x5b7af2(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}const makeRequest=function(e,t){const i=isWorker()?self:window;if(!_0x355e3c(e.url)){if(i.fetch&&i.Request&&i.AbortController&&i.Request.prototype.hasOwnProperty("signal"))return _0x5b9d6b(e,t);if(isWorker()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t)}return _0x5b53c6(e,t)},getJSON=function(e,t){return makeRequest(extend$1(e,{type:"json"}),t)},getArrayBuffer=function(e,t){return makeRequest(extend$1(e,{type:"arrayBuffer"}),t)},_0x154e65="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let _0x42c203,_0x1e9b99;const resetImageRequestQueue=()=>{_0x42c203=[],_0x1e9b99=0};resetImageRequestQueue();const _0x111e10=16,getImage=function(e,t){if(_0x1e9b99>=_0x111e10){const i={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return _0x42c203.push(i),i}_0x1e9b99++;let i=!1;const r=()=>{if(!i)for(i=!0,_0x1e9b99--;_0x42c203.length&&_0x1e9b99<_0x111e10;){const e=_0x42c203.shift(),{requestParameters:t,callback:i,cancelled:r}=e;!r&&(e.cancel=getImage(t,i).cancel)}},n=getArrayBuffer(e,((e,i,n,o)=>{if(r(),e)t(e);else if(i){const e=new window.Image,r=window.URL||window.webkitURL;e.onload=()=>{t(null,e),r.revokeObjectURL(e.src)},e.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const a=new window.Blob([new Uint8Array(i)],{type:"image/png"});e.cacheControl=n,e.expires=o,e.src=i.byteLength?r.createObjectURL(a):_0x154e65}}));return{cancel:()=>{n.cancel(),r()}}},_0x476ac4=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x229fca=_0x476ac4(void 0,(function(){return _0x229fca.toString().search("(((.+)+)+)+$").toString().constructor(_0x229fca).search("(((.+)+)+)+$")}));let _0x54660c,_0x4ea0e4;_0x229fca();const _0x173cff={getImageData(e,t){const i=window.document.createElement("canvas"),r=i.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return i.width=e.width,i.height=e.height,r.drawImage(e,0,0,e.width,e.height),r.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:e=>(_0x54660c||(_0x54660c=window.document.createElement("a")),_0x54660c.href=e,_0x54660c.href),hardwareConcurrency:window.navigator.hardwareConcurrency||4,get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==_0x4ea0e4&&(_0x4ea0e4=window.matchMedia("(prefers-reduced-motion: reduce)")),_0x4ea0e4.matches)}},_0x5bf799=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x3da967=_0x5bf799(void 0,(function(){return _0x3da967.toString().search("(((.+)+)+)+$").toString().constructor(_0x3da967).search("(((.+)+)+)+$")}));_0x3da967();var _0xdf2d54=(_0x1e863a=!0,function(e,t){var i=_0x1e863a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1e863a=!1,i}),_0x5a4604=_0xdf2d54(void 0,(function(){return _0x5a4604.toString().search("(((.+)+)+)+$").toString().constructor(_0x5a4604).search("(((.+)+)+)+$")})),_0x1e863a;_0x5a4604();var _0x43d524=(_0x42a6e3=!0,function(e,t){var i=_0x42a6e3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x42a6e3=!1,i}),_0x1e9716=_0x43d524(void 0,(function(){return _0x1e9716.toString().search("(((.+)+)+)+$").toString().constructor(_0x1e9716).search("(((.+)+)+)+$")})),_0x42a6e3;_0x1e9716();var _0x3a1cb5=function(e,t){_0x58a4d4(this,e,1,t)};function _0x58a4d4(e,t,i,r){var n=t.width,o=t.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*o*i);return e.width=n,e.height=o,e.data=r,e}function _0x412185(e,t,i){var r=t.width,n=t.height;if(r!==e.width||n!==e.height){var o=_0x58a4d4({},{width:r,height:n},i);_0x159152(e,o,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,n)},i),e.width=r,e.height=n,e.data=o.data}}function _0x159152(e,t,i,r,n,o){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=e.data,s=t.data,l=0;l<n.height;l++)for(var u=((i.y+l)*e.width+i.x)*o,c=((r.y+l)*t.width+r.x)*o,h=0;h<n.width*o;h++)s[c+h]=a[u+h];return t}_0x3a1cb5.prototype.resize=function(e){_0x412185(this,e,1)},_0x3a1cb5.prototype.clone=function(){return new _0x3a1cb5({width:this.width,height:this.height},new Uint8Array(this.data))},_0x3a1cb5.copy=function(e,t,i,r,n){_0x159152(e,t,i,r,n,1)},_0x36ace8.register("AlphaImage",_0x3a1cb5);var D$X=function(e,t,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?n-1:0,d=i?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)},y$T=function(e,t,i,r,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,h=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*l-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+f]=255&s,f+=p,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;e[i+f]=255&a,f+=p,a/=256,u-=8);e[i+f-p]|=128*_},g$P={read:D$X,write:y$T};function h$Q(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}h$Q.Varint=0,h$Q.Fixed64=1,h$Q.Bytes=2,h$Q.Fixed32=5;var B$Q=4294967296,M$_=1/B$Q;function C$T(e,t,i){var r,n,o=i.buf;if(r=(112&(n=o[i.pos++]))>>4,n<128||(r|=(127&(n=o[i.pos++]))<<3,n<128)||(r|=(127&(n=o[i.pos++]))<<10,n<128)||(r|=(127&(n=o[i.pos++]))<<17,n<128)||(r|=(127&(n=o[i.pos++]))<<24,n<128)||(r|=(1&(n=o[i.pos++]))<<31,n<128))return c$Z(e,r,t);throw new Error("Expected varint not more than 10 bytes")}function F$12(e){return e.type===h$Q.Bytes?e.readVarint()+e.pos:e.pos+1}function c$Z(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function T$Q(e,t){var i,r;if(e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),E$10(i,r,t),N$N(r,t)}function E$10(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}function N$N(e,t){var i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function k$$(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=e;n--)i.buf[n+r]=i.buf[n]}function I$1g(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function U$Z(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function A$11(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function R$R(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function H$U(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function _$R(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function m$X(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function G$17(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function j$14(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function V$N(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function p$Y(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function S$M(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function z$R(e,t,i){for(var r="",n=t;n<i;){var o,a,s,l=e[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>i)break;1===c?l<128&&(u=l):2===c?128==(192&(o=e[n+1]))&&((u=(31&l)<<6|63&o)<=127&&(u=null)):3===c?(o=e[n+1],a=e[n+2],128==(192&o)&&128==(192&a)&&(((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null))):4===c&&(o=e[n+1],a=e[n+2],s=e[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null))),null===u?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),n+=c}return r}function J$_(e,t,i){for(var r,n,o=0;o<t.length;o++){if((r=t.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}h$Q.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,e(n,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=V$N(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=S$M(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=V$N(this.buf,this.pos)+V$N(this.buf,this.pos+4)*B$Q;return this.pos+=8,e},readSFixed64:function(){var e=V$N(this.buf,this.pos)+S$M(this.buf,this.pos+4)*B$Q;return this.pos+=8,e},readFloat:function(){var e=g$P.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=g$P.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128||(t|=(127&(i=r[this.pos++]))<<7,i<128)||(t|=(127&(i=r[this.pos++]))<<14,i<128)||(t|=(127&(i=r[this.pos++]))<<21,i<128)?t:C$T(t|=(15&(i=r[this.pos]))<<28,e,this)},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=z$R(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){var i=F$12(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){var t=F$12(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===h$Q.Varint)for(;this.buf[this.pos++]>127;);else if(t===h$Q.Bytes)this.pos=this.readVarint()+this.pos;else if(t===h$Q.Fixed32)this.pos+=4;else{if(t!==h$Q.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),p$Y(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),p$Y(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),p$Y(this.buf,-1&e,this.pos),p$Y(this.buf,Math.floor(e*M$_),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),p$Y(this.buf,-1&e,this.pos),p$Y(this.buf,Math.floor(e*M$_),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?T$Q(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=J$_(this.buf,e,this.pos);var i=this.pos-t;i>=128&&k$$(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),g$P.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),g$P.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;r>=128&&k$$(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,h$Q.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){this.writeMessage(e,I$1g,t)},writePackedSVarint:function(e,t){this.writeMessage(e,U$Z,t)},writePackedBoolean:function(e,t){this.writeMessage(e,H$U,t)},writePackedFloat:function(e,t){this.writeMessage(e,A$11,t)},writePackedDouble:function(e,t){this.writeMessage(e,R$R,t)},writePackedFixed32:function(e,t){this.writeMessage(e,_$R,t)},writePackedSFixed32:function(e,t){this.writeMessage(e,m$X,t)},writePackedFixed64:function(e,t){this.writeMessage(e,G$17,t)},writePackedSFixed64:function(e,t){this.writeMessage(e,j$14,t)},writeBytesField:function(e,t){this.writeTag(e,h$Q.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,h$Q.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,h$Q.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,h$Q.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,h$Q.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,h$Q.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,h$Q.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,h$Q.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,h$Q.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,h$Q.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};const _0x2c6fb7=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x5e3225=_0x2c6fb7(void 0,(function(){return _0x5e3225.toString().search("(((.+)+)+)+$").toString().constructor(_0x5e3225).search("(((.+)+)+)+$")}));_0x5e3225();const _0x1cce12=3;function _0x4ec2b9(e,t,i){1===e&&i.readMessage(_0xf59b88,t)}function _0xf59b88(e,t,i){if(3===e){const{id:e,bitmap:r,width:n,height:o,left:a,top:s,advance:l}=i.readMessage(_0x232df4,{});t.push({id:e,bitmap:new _0x3a1cb5({width:n+2*_0x1cce12,height:o+2*_0x1cce12},r),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function _0x232df4(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}function _0x3aff4d(e){return new h$Q(e).readFields(_0x4ec2b9,[])}const _0x2d369a=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x122702=_0x2d369a(void 0,(function(){return _0x122702.toString().search("(((.+)+)+)+$").toString().constructor(_0x122702).search("(((.+)+)+)+$")}));_0x122702();const _0x4f2cfd={horizontal:1,vertical:2,horizontalOnly:3};var _0xc25226=(_0xa43d01=!0,function(e,t){var i=_0xa43d01?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xa43d01=!1,i}),_0x270fb7=_0xc25226(void 0,(function(){return _0x270fb7.toString().search("(((.+)+)+)+$").toString().constructor(_0x270fb7).search("(((.+)+)+)+$")})),_0xa43d01;function _0x1d4fb9(){}_0x270fb7();var _0x24e55d=1e-6,_0x5d9fb9="undefined"!=typeof Float32Array?Float32Array:Array,_0x5cdc79=Math.random;function _0x4b0669(e){_0x5d9fb9=e}var _0x22ee0a=Math.PI/180;function _0x26cbd2(e){return e*_0x22ee0a}function _0x595475(e,t){return Math.abs(e-t)<=_0x24e55d*Math.max(1,Math.abs(e),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var _0x351640=Object.freeze({EPSILON:_0x24e55d,get ARRAY_TYPE(){return _0x5d9fb9},RANDOM:_0x5cdc79,setMatrixArrayType:_0x4b0669,toRadian:_0x26cbd2,equals:_0x595475});function _0x1fc4a8(){var e=new _0x5d9fb9(4);return _0x5d9fb9!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function _0x4fb9dc(e){var t=new _0x5d9fb9(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _0x3af496(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _0x4ff0f1(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e}function _0x41cc03(e,t,i,r){var n=new _0x5d9fb9(4);return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n}function _0x2678b7(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function _0x167582(e,t){if(e===t){var i=t[1];e[1]=t[2],e[2]=i}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e}function _0x1a88d2(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=i*o-n*r;return a?(a=1/a,e[0]=o*a,e[1]=-r*a,e[2]=-n*a,e[3]=i*a,e):null}function _0x5b3437(e,t){var i=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=i,e}function _0x3cac36(e){return e[0]*e[3]-e[2]*e[1]}function _0x414ce6(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=i[0],l=i[1],u=i[2],c=i[3];return e[0]=r*s+o*l,e[1]=n*s+a*l,e[2]=r*u+o*c,e[3]=n*u+a*c,e}function _0x3e6a1d(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=r*l+o*s,e[1]=n*l+a*s,e[2]=r*-s+o*l,e[3]=n*-s+a*l,e}function _0x2a43e7(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=i[0],l=i[1];return e[0]=r*s,e[1]=n*s,e[2]=o*l,e[3]=a*l,e}function _0x4620a2(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e}function _0x18675d(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e}function _0x548c82(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function _0x13fb5e(e){return Math.hypot(e[0],e[1],e[2],e[3])}function _0x2c81f8(e,t,i,r){return e[2]=r[2]/r[0],i[0]=r[0],i[1]=r[1],i[3]=r[3]-e[2]*i[1],[e,t,i]}function _0x10b422(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e}function _0x39faf4(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}function _0x281b6c(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function _0x4ccaeb(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=t[0],s=t[1],l=t[2],u=t[3];return Math.abs(i-a)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-l)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-u)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(u))}function _0x46ae54(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function _0x16b5b2(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e}var _0x2a4b4b=_0x414ce6,_0x227e5a=_0x39faf4,_0x1d2736=Object.freeze({create:_0x1fc4a8,clone:_0x4fb9dc,copy:_0x3af496,identity:_0x4ff0f1,fromValues:_0x41cc03,set:_0x2678b7,transpose:_0x167582,invert:_0x1a88d2,adjoint:_0x5b3437,determinant:_0x3cac36,multiply:_0x414ce6,rotate:_0x3e6a1d,scale:_0x2a43e7,fromRotation:_0x4620a2,fromScaling:_0x18675d,str:_0x548c82,frob:_0x13fb5e,LDU:_0x2c81f8,add:_0x10b422,subtract:_0x39faf4,exactEquals:_0x281b6c,equals:_0x4ccaeb,multiplyScalar:_0x46ae54,multiplyScalarAndAdd:_0x16b5b2,mul:_0x2a4b4b,sub:_0x227e5a});function _0x547df1(){var e=new _0x5d9fb9(6);return _0x5d9fb9!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e}function _0x3b7255(e){var t=new _0x5d9fb9(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function _0x3bbd34(e,t){return 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}function _0x3dadd9(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function _0x58e2df(e,t,i,r,n,o){var a=new _0x5d9fb9(6);return a[0]=e,a[1]=t,a[2]=i,a[3]=r,a[4]=n,a[5]=o,a}function _0x3203bc(e,t,i,r,n,o,a){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e}function _0x241129(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=i*o-r*n;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*a)*l,e[5]=(r*a-i*s)*l,e):null}function _0x5097dc(e){return e[0]*e[3]-e[1]*e[2]}function _0x1b3df9(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=i[0],c=i[1],h=i[2],d=i[3],f=i[4],p=i[5];return e[0]=r*u+o*c,e[1]=n*u+a*c,e[2]=r*h+o*d,e[3]=n*h+a*d,e[4]=r*f+o*p+s,e[5]=n*f+a*p+l,e}function _0x409a07(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=Math.sin(i),c=Math.cos(i);return e[0]=r*c+o*u,e[1]=n*c+a*u,e[2]=r*-u+o*c,e[3]=n*-u+a*c,e[4]=s,e[5]=l,e}function _0x28620f(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=i[0],c=i[1];return e[0]=r*u,e[1]=n*u,e[2]=o*c,e[3]=a*c,e[4]=s,e[5]=l,e}function _0x92d5db(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=i[0],c=i[1];return e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=r*u+o*c+s,e[5]=n*u+a*c+l,e}function _0x6922a7(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=0,e[5]=0,e}function _0x5f39af(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function _0x3809cb(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function _0x313dc3(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function _0xe9076e(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)}function _0x1d10e8(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e}function _0x347737(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e}function _0x4dbe55(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e}function _0x1af58d(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e}function _0x661f24(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function _0x25e8ba(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=t[0],u=t[1],c=t[2],h=t[3],d=t[4],f=t[5];return Math.abs(i-l)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(r-u)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(o-h)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-d)<=_0x24e55d*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(s-f)<=_0x24e55d*Math.max(1,Math.abs(s),Math.abs(f))}var _0x425374=_0x1b3df9,_0x363c77=_0x347737,_0x292b40=Object.freeze({create:_0x547df1,clone:_0x3b7255,copy:_0x3bbd34,identity:_0x3dadd9,fromValues:_0x58e2df,set:_0x3203bc,invert:_0x241129,determinant:_0x5097dc,multiply:_0x1b3df9,rotate:_0x409a07,scale:_0x28620f,translate:_0x92d5db,fromRotation:_0x6922a7,fromScaling:_0x5f39af,fromTranslation:_0x3809cb,str:_0x313dc3,frob:_0xe9076e,add:_0x1d10e8,subtract:_0x347737,multiplyScalar:_0x4dbe55,multiplyScalarAndAdd:_0x1af58d,exactEquals:_0x661f24,equals:_0x25e8ba,mul:_0x425374,sub:_0x363c77});function _0x57d654(){var e=new _0x5d9fb9(9);return _0x5d9fb9!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function _0x482547(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function _0x3d71c2(e){var t=new _0x5d9fb9(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function _0xc5d379(e,t){return 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],e}function _0x12f397(e,t,i,r,n,o,a,s,l){var u=new _0x5d9fb9(9);return u[0]=e,u[1]=t,u[2]=i,u[3]=r,u[4]=n,u[5]=o,u[6]=a,u[7]=s,u[8]=l,u}function _0xa3c009(e,t,i,r,n,o,a,s,l,u){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=u,e}function _0x4d797e(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function _0x310423(e,t){if(e===t){var i=t[1],r=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=r,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function _0x5b775f(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=c*a-s*u,d=-c*o+s*l,f=u*o-a*l,p=i*h+r*d+n*f;return p?(p=1/p,e[0]=h*p,e[1]=(-c*r+n*u)*p,e[2]=(s*r-n*a)*p,e[3]=d*p,e[4]=(c*i-n*l)*p,e[5]=(-s*i+n*o)*p,e[6]=f*p,e[7]=(-u*i+r*l)*p,e[8]=(a*i-r*o)*p,e):null}function _0x1d4278(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-s*u,e[1]=n*u-r*c,e[2]=r*s-n*a,e[3]=s*l-o*c,e[4]=i*c-n*l,e[5]=n*o-i*s,e[6]=o*u-a*l,e[7]=r*l-i*u,e[8]=i*a-r*o,e}function _0x2a85b0(e){var t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*(u*o-a*l)+i*(-u*n+a*s)+r*(l*n-o*s)}function _0xe8e651(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=i[0],f=i[1],p=i[2],_=i[3],m=i[4],$=i[5],g=i[6],v=i[7],y=i[8];return e[0]=d*r+f*a+p*u,e[1]=d*n+f*s+p*c,e[2]=d*o+f*l+p*h,e[3]=_*r+m*a+$*u,e[4]=_*n+m*s+$*c,e[5]=_*o+m*l+$*h,e[6]=g*r+v*a+y*u,e[7]=g*n+v*s+y*c,e[8]=g*o+v*l+y*h,e}function _0x52943d(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=i[0],f=i[1];return e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=d*r+f*a+u,e[7]=d*n+f*s+c,e[8]=d*o+f*l+h,e}function _0x52fa87(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=Math.sin(i),f=Math.cos(i);return e[0]=f*r+d*a,e[1]=f*n+d*s,e[2]=f*o+d*l,e[3]=f*a-d*r,e[4]=f*s-d*n,e[5]=f*l-d*o,e[6]=u,e[7]=c,e[8]=h,e}function _0x2ff1ab(e,t,i){var r=i[0],n=i[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function _0x5c0b99(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function _0x5c075f(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function _0x275360(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function _0xbe5992(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function _0x4029eb(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=i+i,s=r+r,l=n+n,u=i*a,c=r*a,h=r*s,d=n*a,f=n*s,p=n*l,_=o*a,m=o*s,$=o*l;return e[0]=1-h-p,e[3]=c-$,e[6]=d+m,e[1]=c+$,e[4]=1-u-p,e[7]=f-_,e[2]=d-m,e[5]=f+_,e[8]=1-u-h,e}function _0xc9ec99(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],_=t[13],m=t[14],$=t[15],g=i*s-r*a,v=i*l-n*a,y=i*u-o*a,x=r*l-n*s,b=r*u-o*s,w=n*u-o*l,C=c*_-h*p,T=c*m-d*p,S=c*$-f*p,E=h*m-d*_,A=h*$-f*_,P=d*$-f*m,I=g*P-v*A+y*E+x*S-b*T+w*C;return I?(I=1/I,e[0]=(s*P-l*A+u*E)*I,e[1]=(l*S-a*P-u*T)*I,e[2]=(a*A-s*S+u*C)*I,e[3]=(n*A-r*P-o*E)*I,e[4]=(i*P-n*S+o*T)*I,e[5]=(r*S-i*A-o*C)*I,e[6]=(_*w-m*b+$*x)*I,e[7]=(m*y-p*w-$*v)*I,e[8]=(p*b-_*y+$*g)*I,e):null}function _0x199e0a(e,t,i){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function _0x44ca71(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function _0x3821b1(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function _0x27688f(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e}function _0x162863(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e}function _0x16358f(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e}function _0x58de4d(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e}function _0x1e4d69(e,t){return 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]}function _0x3ffda8(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=t[0],d=t[1],f=t[2],p=t[3],_=t[4],m=t[5],$=t[6],g=t[7],v=t[8];return Math.abs(i-h)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(r-d)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-f)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-p)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-_)<=_0x24e55d*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(s-m)<=_0x24e55d*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(l-$)<=_0x24e55d*Math.max(1,Math.abs(l),Math.abs($))&&Math.abs(u-g)<=_0x24e55d*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=_0x24e55d*Math.max(1,Math.abs(c),Math.abs(v))}var _0x2b137c=_0xe8e651,_0x9ff3c3=_0x162863,_0x401de7=Object.freeze({create:_0x57d654,fromMat4:_0x482547,clone:_0x3d71c2,copy:_0xc5d379,fromValues:_0x12f397,set:_0xa3c009,identity:_0x4d797e,transpose:_0x310423,invert:_0x5b775f,adjoint:_0x1d4278,determinant:_0x2a85b0,multiply:_0xe8e651,translate:_0x52943d,rotate:_0x52fa87,scale:_0x2ff1ab,fromTranslation:_0x5c0b99,fromRotation:_0x5c075f,fromScaling:_0x275360,fromMat2d:_0xbe5992,fromQuat:_0x4029eb,normalFromMat4:_0xc9ec99,projection:_0x199e0a,str:_0x44ca71,frob:_0x3821b1,add:_0x27688f,subtract:_0x162863,multiplyScalar:_0x16358f,multiplyScalarAndAdd:_0x58de4d,exactEquals:_0x1e4d69,equals:_0x3ffda8,mul:_0x2b137c,sub:_0x9ff3c3});function _0x488fde(){var e=new _0x5d9fb9(16);return _0x5d9fb9!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function _0x2ad804(e){var t=new _0x5d9fb9(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function _0x2abb55(e,t){return 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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function _0x19c185(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_){var m=new _0x5d9fb9(16);return m[0]=e,m[1]=t,m[2]=i,m[3]=r,m[4]=n,m[5]=o,m[6]=a,m[7]=s,m[8]=l,m[9]=u,m[10]=c,m[11]=h,m[12]=d,m[13]=f,m[14]=p,m[15]=_,m}function _0x36fc21(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=u,e[9]=c,e[10]=h,e[11]=d,e[12]=f,e[13]=p,e[14]=_,e[15]=m,e}function _0x5eada0(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x4d4fc8(e,t){if(e===t){var i=t[1],r=t[2],n=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=n,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function _0x4d7f37(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],_=t[13],m=t[14],$=t[15],g=i*s-r*a,v=i*l-n*a,y=i*u-o*a,x=r*l-n*s,b=r*u-o*s,w=n*u-o*l,C=c*_-h*p,T=c*m-d*p,S=c*$-f*p,E=h*m-d*_,A=h*$-f*_,P=d*$-f*m,I=g*P-v*A+y*E+x*S-b*T+w*C;return I?(I=1/I,e[0]=(s*P-l*A+u*E)*I,e[1]=(n*A-r*P-o*E)*I,e[2]=(_*w-m*b+$*x)*I,e[3]=(d*b-h*w-f*x)*I,e[4]=(l*S-a*P-u*T)*I,e[5]=(i*P-n*S+o*T)*I,e[6]=(m*y-p*w-$*v)*I,e[7]=(c*w-d*y+f*v)*I,e[8]=(a*A-s*S+u*C)*I,e[9]=(r*S-i*A-o*C)*I,e[10]=(p*b-_*y+$*g)*I,e[11]=(h*y-c*b-f*g)*I,e[12]=(s*T-a*E-l*C)*I,e[13]=(i*E-r*T+n*C)*I,e[14]=(_*v-p*x-m*g)*I,e[15]=(c*x-h*v+d*g)*I,e):null}function _0x1cd10e(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],_=t[13],m=t[14],$=t[15];return e[0]=s*(d*$-f*m)-h*(l*$-u*m)+_*(l*f-u*d),e[1]=-(r*(d*$-f*m)-h*(n*$-o*m)+_*(n*f-o*d)),e[2]=r*(l*$-u*m)-s*(n*$-o*m)+_*(n*u-o*l),e[3]=-(r*(l*f-u*d)-s*(n*f-o*d)+h*(n*u-o*l)),e[4]=-(a*(d*$-f*m)-c*(l*$-u*m)+p*(l*f-u*d)),e[5]=i*(d*$-f*m)-c*(n*$-o*m)+p*(n*f-o*d),e[6]=-(i*(l*$-u*m)-a*(n*$-o*m)+p*(n*u-o*l)),e[7]=i*(l*f-u*d)-a*(n*f-o*d)+c*(n*u-o*l),e[8]=a*(h*$-f*_)-c*(s*$-u*_)+p*(s*f-u*h),e[9]=-(i*(h*$-f*_)-c*(r*$-o*_)+p*(r*f-o*h)),e[10]=i*(s*$-u*_)-a*(r*$-o*_)+p*(r*u-o*s),e[11]=-(i*(s*f-u*h)-a*(r*f-o*h)+c*(r*u-o*s)),e[12]=-(a*(h*m-d*_)-c*(s*m-l*_)+p*(s*d-l*h)),e[13]=i*(h*m-d*_)-c*(r*m-n*_)+p*(r*d-n*h),e[14]=-(i*(s*m-l*_)-a*(r*m-n*_)+p*(r*l-n*s)),e[15]=i*(s*d-l*h)-a*(r*d-n*h)+c*(r*l-n*s),e}function _0x1f020e(e){var t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11],f=e[12],p=e[13],_=e[14],m=e[15];return(t*a-i*o)*(h*m-d*_)-(t*s-r*o)*(c*m-d*p)+(t*l-n*o)*(c*_-h*p)+(i*s-r*a)*(u*m-d*f)-(i*l-n*a)*(u*_-h*f)+(r*l-n*s)*(u*p-c*f)}function _0xf77060(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],_=t[12],m=t[13],$=t[14],g=t[15],v=i[0],y=i[1],x=i[2],b=i[3];return e[0]=v*r+y*s+x*h+b*_,e[1]=v*n+y*l+x*d+b*m,e[2]=v*o+y*u+x*f+b*$,e[3]=v*a+y*c+x*p+b*g,v=i[4],y=i[5],x=i[6],b=i[7],e[4]=v*r+y*s+x*h+b*_,e[5]=v*n+y*l+x*d+b*m,e[6]=v*o+y*u+x*f+b*$,e[7]=v*a+y*c+x*p+b*g,v=i[8],y=i[9],x=i[10],b=i[11],e[8]=v*r+y*s+x*h+b*_,e[9]=v*n+y*l+x*d+b*m,e[10]=v*o+y*u+x*f+b*$,e[11]=v*a+y*c+x*p+b*g,v=i[12],y=i[13],x=i[14],b=i[15],e[12]=v*r+y*s+x*h+b*_,e[13]=v*n+y*l+x*d+b*m,e[14]=v*o+y*u+x*f+b*$,e[15]=v*a+y*c+x*p+b*g,e}function _0x2a8cfc(e,t,i){var r,n,o,a,s,l,u,c,h,d,f,p,_=i[0],m=i[1],$=i[2];return t===e?(e[12]=t[0]*_+t[4]*m+t[8]*$+t[12],e[13]=t[1]*_+t[5]*m+t[9]*$+t[13],e[14]=t[2]*_+t[6]*m+t[10]*$+t[14],e[15]=t[3]*_+t[7]*m+t[11]*$+t[15]):(r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=r*_+s*m+h*$+t[12],e[13]=n*_+l*m+d*$+t[13],e[14]=o*_+u*m+f*$+t[14],e[15]=a*_+c*m+p*$+t[15]),e}function _0x20dd57(e,t,i){var r=i[0],n=i[1],o=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function _0x1e71e1(e,t,i,r){var n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T,S,E,A=r[0],P=r[1],I=r[2],M=Math.hypot(A,P,I);return M<_0x24e55d?null:(A*=M=1/M,P*=M,I*=M,n=Math.sin(i),a=1-(o=Math.cos(i)),s=t[0],l=t[1],u=t[2],c=t[3],h=t[4],d=t[5],f=t[6],p=t[7],_=t[8],m=t[9],$=t[10],g=t[11],v=A*A*a+o,y=P*A*a+I*n,x=I*A*a-P*n,b=A*P*a-I*n,w=P*P*a+o,C=I*P*a+A*n,T=A*I*a+P*n,S=P*I*a-A*n,E=I*I*a+o,e[0]=s*v+h*y+_*x,e[1]=l*v+d*y+m*x,e[2]=u*v+f*y+$*x,e[3]=c*v+p*y+g*x,e[4]=s*b+h*w+_*C,e[5]=l*b+d*w+m*C,e[6]=u*b+f*w+$*C,e[7]=c*b+p*w+g*C,e[8]=s*T+h*S+_*E,e[9]=l*T+d*S+m*E,e[10]=u*T+f*S+$*E,e[11]=c*T+p*S+g*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function _0x15f96a(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*n+u*r,e[5]=a*n+c*r,e[6]=s*n+h*r,e[7]=l*n+d*r,e[8]=u*n-o*r,e[9]=c*n-a*r,e[10]=h*n-s*r,e[11]=d*n-l*r,e}function _0x74a09a(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n-u*r,e[1]=a*n-c*r,e[2]=s*n-h*r,e[3]=l*n-d*r,e[8]=o*r+u*n,e[9]=a*r+c*n,e[10]=s*r+h*n,e[11]=l*r+d*n,e}function _0x359e6e(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n+u*r,e[1]=a*n+c*r,e[2]=s*n+h*r,e[3]=l*n+d*r,e[4]=u*n-o*r,e[5]=c*n-a*r,e[6]=h*n-s*r,e[7]=d*n-l*r,e}function _0x4b826a(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function _0x4e285b(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x194782(e,t,i){var r,n,o,a=i[0],s=i[1],l=i[2],u=Math.hypot(a,s,l);return u<_0x24e55d?null:(a*=u=1/u,s*=u,l*=u,r=Math.sin(t),o=1-(n=Math.cos(t)),e[0]=a*a*o+n,e[1]=s*a*o+l*r,e[2]=l*a*o-s*r,e[3]=0,e[4]=a*s*o-l*r,e[5]=s*s*o+n,e[6]=l*s*o+a*r,e[7]=0,e[8]=a*l*o+s*r,e[9]=s*l*o-a*r,e[10]=l*l*o+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function _0x355b0a(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=i,e[7]=0,e[8]=0,e[9]=-i,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x591130(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-i,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=i,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x218cc5(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=0,e[4]=-i,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x451670(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=r+r,l=n+n,u=o+o,c=r*s,h=r*l,d=r*u,f=n*l,p=n*u,_=o*u,m=a*s,$=a*l,g=a*u;return e[0]=1-(f+_),e[1]=h+g,e[2]=d-$,e[3]=0,e[4]=h-g,e[5]=1-(c+_),e[6]=p+m,e[7]=0,e[8]=d+$,e[9]=p-m,e[10]=1-(c+f),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function _0x193267(e,t){var i=new _0x5d9fb9(3),r=-t[0],n=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=r*r+n*n+o*o+a*a;return h>0?(i[0]=2*(s*a+c*r+l*o-u*n)/h,i[1]=2*(l*a+c*n+u*r-s*o)/h,i[2]=2*(u*a+c*o+s*n-l*r)/h):(i[0]=2*(s*a+c*r+l*o-u*n),i[1]=2*(l*a+c*n+u*r-s*o),i[2]=2*(u*a+c*o+s*n-l*r)),_0x451670(e,t,i),e}function _0x101107(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function _0x21ee1a(e,t){var i=t[0],r=t[1],n=t[2],o=t[4],a=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(i,r,n),e[1]=Math.hypot(o,a,s),e[2]=Math.hypot(l,u,c),e}function _0x4d1176(e,t){var i=new _0x5d9fb9(3);_0x21ee1a(i,t);var r=1/i[0],n=1/i[1],o=1/i[2],a=t[0]*r,s=t[1]*n,l=t[2]*o,u=t[4]*r,c=t[5]*n,h=t[6]*o,d=t[8]*r,f=t[9]*n,p=t[10]*o,_=a+c+p,m=0;return _>0?(m=2*Math.sqrt(_+1),e[3]=.25*m,e[0]=(h-f)/m,e[1]=(d-l)/m,e[2]=(s-u)/m):a>c&&a>p?(m=2*Math.sqrt(1+a-c-p),e[3]=(h-f)/m,e[0]=.25*m,e[1]=(s+u)/m,e[2]=(d+l)/m):c>p?(m=2*Math.sqrt(1+c-a-p),e[3]=(d-l)/m,e[0]=(s+u)/m,e[1]=.25*m,e[2]=(h+f)/m):(m=2*Math.sqrt(1+p-a-c),e[3]=(s-u)/m,e[0]=(d+l)/m,e[1]=(h+f)/m,e[2]=.25*m),e}function _0x49de55(e,t,i,r){var n=t[0],o=t[1],a=t[2],s=t[3],l=n+n,u=o+o,c=a+a,h=n*l,d=n*u,f=n*c,p=o*u,_=o*c,m=a*c,$=s*l,g=s*u,v=s*c,y=r[0],x=r[1],b=r[2];return e[0]=(1-(p+m))*y,e[1]=(d+v)*y,e[2]=(f-g)*y,e[3]=0,e[4]=(d-v)*x,e[5]=(1-(h+m))*x,e[6]=(_+$)*x,e[7]=0,e[8]=(f+g)*b,e[9]=(_-$)*b,e[10]=(1-(h+p))*b,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function _0x33bef3(e,t,i,r,n){var o=t[0],a=t[1],s=t[2],l=t[3],u=o+o,c=a+a,h=s+s,d=o*u,f=o*c,p=o*h,_=a*c,m=a*h,$=s*h,g=l*u,v=l*c,y=l*h,x=r[0],b=r[1],w=r[2],C=n[0],T=n[1],S=n[2],E=(1-(_+$))*x,A=(f+y)*x,P=(p-v)*x,I=(f-y)*b,M=(1-(d+$))*b,O=(m+g)*b,D=(p+v)*w,R=(m-g)*w,L=(1-(d+_))*w;return e[0]=E,e[1]=A,e[2]=P,e[3]=0,e[4]=I,e[5]=M,e[6]=O,e[7]=0,e[8]=D,e[9]=R,e[10]=L,e[11]=0,e[12]=i[0]+C-(E*C+I*T+D*S),e[13]=i[1]+T-(A*C+M*T+R*S),e[14]=i[2]+S-(P*C+O*T+L*S),e[15]=1,e}function _0x1aa939(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=i+i,s=r+r,l=n+n,u=i*a,c=r*a,h=r*s,d=n*a,f=n*s,p=n*l,_=o*a,m=o*s,$=o*l;return e[0]=1-h-p,e[1]=c+$,e[2]=d-m,e[3]=0,e[4]=c-$,e[5]=1-u-p,e[6]=f+_,e[7]=0,e[8]=d+m,e[9]=f-_,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function _0x3191a5(e,t,i,r,n,o,a){var s=1/(i-t),l=1/(n-r),u=1/(o-a);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(i+t)*s,e[9]=(n+r)*l,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e}function _0x5dc214(e,t,i,r,n){var o,a=1/Math.tan(t/2);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(o=1/(r-n),e[10]=(n+r)*o,e[14]=2*n*r*o):(e[10]=-1,e[14]=-2*r),e}function _0x1988d1(e,t,i,r){var n=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(n+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(a-s)*l*.5,e[9]=(n-o)*u*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function _0x10271e(e,t,i,r,n,o,a){var s=1/(t-i),l=1/(r-n),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*l,e[14]=(a+o)*u,e[15]=1,e}function _0x18b6e5(e,t,i,r){var n,o,a,s,l,u,c,h,d,f,p=t[0],_=t[1],m=t[2],$=r[0],g=r[1],v=r[2],y=i[0],x=i[1],b=i[2];return Math.abs(p-y)<_0x24e55d&&Math.abs(_-x)<_0x24e55d&&Math.abs(m-b)<_0x24e55d?_0x5eada0(e):(c=p-y,h=_-x,d=m-b,n=g*(d*=f=1/Math.hypot(c,h,d))-v*(h*=f),o=v*(c*=f)-$*d,a=$*h-g*c,(f=Math.hypot(n,o,a))?(n*=f=1/f,o*=f,a*=f):(n=0,o=0,a=0),s=h*a-d*o,l=d*n-c*a,u=c*o-h*n,(f=Math.hypot(s,l,u))?(s*=f=1/f,l*=f,u*=f):(s=0,l=0,u=0),e[0]=n,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=l,e[6]=h,e[7]=0,e[8]=a,e[9]=u,e[10]=d,e[11]=0,e[12]=-(n*p+o*_+a*m),e[13]=-(s*p+l*_+u*m),e[14]=-(c*p+h*_+d*m),e[15]=1,e)}function _0x10dea2(e,t,i,r){var n=t[0],o=t[1],a=t[2],s=r[0],l=r[1],u=r[2],c=n-i[0],h=o-i[1],d=a-i[2],f=c*c+h*h+d*d;f>0&&(c*=f=1/Math.sqrt(f),h*=f,d*=f);var p=l*d-u*h,_=u*c-s*d,m=s*h-l*c;return(f=p*p+_*_+m*m)>0&&(p*=f=1/Math.sqrt(f),_*=f,m*=f),e[0]=p,e[1]=_,e[2]=m,e[3]=0,e[4]=h*m-d*_,e[5]=d*p-c*m,e[6]=c*_-h*p,e[7]=0,e[8]=c,e[9]=h,e[10]=d,e[11]=0,e[12]=n,e[13]=o,e[14]=a,e[15]=1,e}function _0x192e9b(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function _0x28162a(e){return Math.hypot(e[0],e[1],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function _0x3e83a5(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e}function _0x2bc464(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}function _0x134ca6(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e}function _0x3d91bd(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e[9]=t[9]+i[9]*r,e[10]=t[10]+i[10]*r,e[11]=t[11]+i[11]*r,e[12]=t[12]+i[12]*r,e[13]=t[13]+i[13]*r,e[14]=t[14]+i[14]*r,e[15]=t[15]+i[15]*r,e}function _0x294d06(e,t){return 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]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function _0x57563f(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],_=e[13],m=e[14],$=e[15],g=t[0],v=t[1],y=t[2],x=t[3],b=t[4],w=t[5],C=t[6],T=t[7],S=t[8],E=t[9],A=t[10],P=t[11],I=t[12],M=t[13],O=t[14],D=t[15];return Math.abs(i-g)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(g))&&Math.abs(r-v)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-y)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(o-x)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-b)<=_0x24e55d*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(s-w)<=_0x24e55d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(l-C)<=_0x24e55d*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(u-T)<=_0x24e55d*Math.max(1,Math.abs(u),Math.abs(T))&&Math.abs(c-S)<=_0x24e55d*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(h-E)<=_0x24e55d*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(d-A)<=_0x24e55d*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(f-P)<=_0x24e55d*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(p-I)<=_0x24e55d*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(_-M)<=_0x24e55d*Math.max(1,Math.abs(_),Math.abs(M))&&Math.abs(m-O)<=_0x24e55d*Math.max(1,Math.abs(m),Math.abs(O))&&Math.abs($-D)<=_0x24e55d*Math.max(1,Math.abs($),Math.abs(D))}var _0x2822a2=_0xf77060,_0x34a21a=_0x2bc464,_0x3a85e5=Object.freeze({create:_0x488fde,clone:_0x2ad804,copy:_0x2abb55,fromValues:_0x19c185,set:_0x36fc21,identity:_0x5eada0,transpose:_0x4d4fc8,invert:_0x4d7f37,adjoint:_0x1cd10e,determinant:_0x1f020e,multiply:_0xf77060,translate:_0x2a8cfc,scale:_0x20dd57,rotate:_0x1e71e1,rotateX:_0x15f96a,rotateY:_0x74a09a,rotateZ:_0x359e6e,fromTranslation:_0x4b826a,fromScaling:_0x4e285b,fromRotation:_0x194782,fromXRotation:_0x355b0a,fromYRotation:_0x591130,fromZRotation:_0x218cc5,fromRotationTranslation:_0x451670,fromQuat2:_0x193267,getTranslation:_0x101107,getScaling:_0x21ee1a,getRotation:_0x4d1176,fromRotationTranslationScale:_0x49de55,fromRotationTranslationScaleOrigin:_0x33bef3,fromQuat:_0x1aa939,frustum:_0x3191a5,perspective:_0x5dc214,perspectiveFromFieldOfView:_0x1988d1,ortho:_0x10271e,lookAt:_0x18b6e5,targetTo:_0x10dea2,str:_0x192e9b,frob:_0x28162a,add:_0x3e83a5,subtract:_0x2bc464,multiplyScalar:_0x134ca6,multiplyScalarAndAdd:_0x3d91bd,exactEquals:_0x294d06,equals:_0x57563f,mul:_0x2822a2,sub:_0x34a21a});function _0x544ddc(){var e=new _0x5d9fb9(3);return _0x5d9fb9!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function _0x3708e8(e){var t=new _0x5d9fb9(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function _0x2161b9(e){var t=e[0],i=e[1],r=e[2];return Math.hypot(t,i,r)}function _0xdcaa72(e,t,i){var r=new _0x5d9fb9(3);return r[0]=e,r[1]=t,r[2]=i,r}function _0xac1fe3(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _0x549b11(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function _0x107c4d(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function _0x2c8c82(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function _0x519f74(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function _0x4e2193(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e}function _0x53ec0c(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function _0x43a4f6(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function _0x2576d5(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function _0x3b0a9e(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function _0x22dd3e(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}function _0x131de5(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function _0x270ebf(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e}function _0x27c7c7(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return Math.hypot(i,r,n)}function _0x5d4676(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return i*i+r*r+n*n}function _0x4d60bb(e){var t=e[0],i=e[1],r=e[2];return t*t+i*i+r*r}function _0x2a486f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function _0x32cefd(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function _0xce9a74(e,t){var i=t[0],r=t[1],n=t[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function _0x40ef43(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function _0x368314(e,t,i){var r=t[0],n=t[1],o=t[2],a=i[0],s=i[1],l=i[2];return e[0]=n*l-o*s,e[1]=o*a-r*l,e[2]=r*s-n*a,e}function _0x4d8da7(e,t,i,r){var n=t[0],o=t[1],a=t[2];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e[2]=a+r*(i[2]-a),e}function _0x141bdd(e,t,i,r,n,o){var a=o*o,s=a*(2*o-3)+1,l=a*(o-2)+o,u=a*(o-1),c=a*(3-2*o);return e[0]=t[0]*s+i[0]*l+r[0]*u+n[0]*c,e[1]=t[1]*s+i[1]*l+r[1]*u+n[1]*c,e[2]=t[2]*s+i[2]*l+r[2]*u+n[2]*c,e}function _0x166351(e,t,i,r,n,o){var a=1-o,s=a*a,l=o*o,u=s*a,c=3*o*s,h=3*l*a,d=l*o;return e[0]=t[0]*u+i[0]*c+r[0]*h+n[0]*d,e[1]=t[1]*u+i[1]*c+r[1]*h+n[1]*d,e[2]=t[2]*u+i[2]*c+r[2]*h+n[2]*d,e}function _0x4400ed(e,t){t=t||1;var i=2*_0x5cdc79()*Math.PI,r=2*_0x5cdc79()-1,n=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(i)*n,e[1]=Math.sin(i)*n,e[2]=r*t,e}function _0x56698a(e,t,i){var r=t[0],n=t[1],o=t[2],a=i[3]*r+i[7]*n+i[11]*o+i[15];return a=a||1,e[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/a,e[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/a,e[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/a,e}function _0xca4f11(e,t,i){var r=t[0],n=t[1],o=t[2];return e[0]=r*i[0]+n*i[3]+o*i[6],e[1]=r*i[1]+n*i[4]+o*i[7],e[2]=r*i[2]+n*i[5]+o*i[8],e}function _0x2837e9(e,t,i){var r=i[0],n=i[1],o=i[2],a=i[3],s=t[0],l=t[1],u=t[2],c=n*u-o*l,h=o*s-r*u,d=r*l-n*s,f=n*d-o*h,p=o*c-r*d,_=r*h-n*c,m=2*a;return c*=m,h*=m,d*=m,f*=2,p*=2,_*=2,e[0]=s+c+f,e[1]=l+h+p,e[2]=u+d+_,e}function _0x431c91(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[0],o[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),o[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e}function _0x5cff31(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),o[1]=n[1],o[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e}function _0x114dd8(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),o[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),o[2]=n[2],e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e}function _0x3aa2fe(e,t){var i=_0xdcaa72(e[0],e[1],e[2]),r=_0xdcaa72(t[0],t[1],t[2]);_0xce9a74(i,i),_0xce9a74(r,r);var n=_0x40ef43(i,r);return n>1?0:n<-1?Math.PI:Math.acos(n)}function _0x4a0015(e){return e[0]=0,e[1]=0,e[2]=0,e}function _0x4adbc2(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function _0x5c1e51(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function _0x99c6ce(e,t){var i=e[0],r=e[1],n=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(i-o)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(s))}var _0x9d500c=_0x2c8c82,_0x3ab5d5=_0x519f74,_0x4e4519=_0x4e2193,_0x2f4025=_0x27c7c7,_0x295817=_0x5d4676,_0x58c812=_0x2161b9,_0x498908=_0x4d60bb,_0x8ba3f8=(_0x565c06=_0x544ddc(),function(e,t,i,r,n,o){var a,s;for(!t&&(t=3),!i&&(i=0),s=r?Math.min(r*t+i,e.length):e.length,a=i;a<s;a+=t)_0x565c06[0]=e[a],_0x565c06[1]=e[a+1],_0x565c06[2]=e[a+2],n(_0x565c06,_0x565c06,o),e[a]=_0x565c06[0],e[a+1]=_0x565c06[1],e[a+2]=_0x565c06[2];return e}),_0x5d59c0=Object.freeze({create:_0x544ddc,clone:_0x3708e8,length:_0x2161b9,fromValues:_0xdcaa72,copy:_0xac1fe3,set:_0x549b11,add:_0x107c4d,subtract:_0x2c8c82,multiply:_0x519f74,divide:_0x4e2193,ceil:_0x53ec0c,floor:_0x43a4f6,min:_0x2576d5,max:_0x3b0a9e,round:_0x22dd3e,scale:_0x131de5,scaleAndAdd:_0x270ebf,distance:_0x27c7c7,squaredDistance:_0x5d4676,squaredLength:_0x4d60bb,negate:_0x2a486f,inverse:_0x32cefd,normalize:_0xce9a74,dot:_0x40ef43,cross:_0x368314,lerp:_0x4d8da7,hermite:_0x141bdd,bezier:_0x166351,random:_0x4400ed,transformMat4:_0x56698a,transformMat3:_0xca4f11,transformQuat:_0x2837e9,rotateX:_0x431c91,rotateY:_0x5cff31,rotateZ:_0x114dd8,angle:_0x3aa2fe,zero:_0x4a0015,str:_0x4adbc2,exactEquals:_0x5c1e51,equals:_0x99c6ce,sub:_0x9d500c,mul:_0x3ab5d5,div:_0x4e4519,dist:_0x2f4025,sqrDist:_0x295817,len:_0x58c812,sqrLen:_0x498908,forEach:_0x8ba3f8}),_0x565c06;function _0x2b9f4b(){var e=new _0x5d9fb9(4);return _0x5d9fb9!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function _0x4ff3ce(e){var t=new _0x5d9fb9(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function _0x1280e8(e,t,i,r){var n=new _0x5d9fb9(4);return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n}function _0x3b5b27(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function _0x2c6a31(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function _0x4ac64c(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e}function _0x5f00d9(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}function _0x36a627(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e[3]=t[3]*i[3],e}function _0x1dcd87(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e[3]=t[3]/i[3],e}function _0x2b2888(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function _0x1af3bc(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function _0x234c45(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e[3]=Math.min(t[3],i[3]),e}function _0x1abcb2(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e[3]=Math.max(t[3],i[3]),e}function _0x242e16(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function _0x10536f(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function _0x271145(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e}function _0x16f0f2(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return Math.hypot(i,r,n,o)}function _0x27e7da(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return i*i+r*r+n*n+o*o}function _0x2a0d4d(e){var t=e[0],i=e[1],r=e[2],n=e[3];return Math.hypot(t,i,r,n)}function _0x36fa04(e){var t=e[0],i=e[1],r=e[2],n=e[3];return t*t+i*i+r*r+n*n}function _0x2a502d(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function _0x313d58(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function _0x3ba53a(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=i*i+r*r+n*n+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=o*a,e}function _0x1dcd9a(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function _0x17953f(e,t,i,r){var n=i[0]*r[1]-i[1]*r[0],o=i[0]*r[2]-i[2]*r[0],a=i[0]*r[3]-i[3]*r[0],s=i[1]*r[2]-i[2]*r[1],l=i[1]*r[3]-i[3]*r[1],u=i[2]*r[3]-i[3]*r[2],c=t[0],h=t[1],d=t[2],f=t[3];return e[0]=h*u-d*l+f*s,e[1]=-c*u+d*a-f*o,e[2]=c*l-h*a+f*n,e[3]=-c*s+h*o-d*n,e}function _0x411424(e,t,i,r){var n=t[0],o=t[1],a=t[2],s=t[3];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e[2]=a+r*(i[2]-a),e[3]=s+r*(i[3]-s),e}function _0x1665cd(e,t){var i,r,n,o,a,s;t=t||1;do{a=(i=2*_0x5cdc79()-1)*i+(r=2*_0x5cdc79()-1)*r}while(a>=1);do{s=(n=2*_0x5cdc79()-1)*n+(o=2*_0x5cdc79()-1)*o}while(s>=1);var l=Math.sqrt((1-a)/s);return e[0]=t*i,e[1]=t*r,e[2]=t*n*l,e[3]=t*o*l,e}function _0x2e6412(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*a,e[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*a,e[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*a,e[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*a,e}function _0x4ebbf6(e,t,i){var r=t[0],n=t[1],o=t[2],a=i[0],s=i[1],l=i[2],u=i[3],c=u*r+s*o-l*n,h=u*n+l*r-a*o,d=u*o+a*n-s*r,f=-a*r-s*n-l*o;return e[0]=c*u+f*-a+h*-l-d*-s,e[1]=h*u+f*-s+d*-a-c*-l,e[2]=d*u+f*-l+c*-s-h*-a,e[3]=t[3],e}function _0x3dcf5b(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function _0x5828c1(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function _0x4dd375(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function _0x196935(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=t[0],s=t[1],l=t[2],u=t[3];return Math.abs(i-a)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-l)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-u)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(u))}var _0x9631b2=_0x5f00d9,_0x3a0eb3=_0x36a627,_0x38745c=_0x1dcd87,_0x1a77f0=_0x16f0f2,_0x4f7f96=_0x27e7da,_0x37ca4b=_0x2a0d4d,_0x2e27e1=_0x36fa04,_0x44efe3=(_0x317d2c=_0x2b9f4b(),function(e,t,i,r,n,o){var a,s;for(!t&&(t=4),!i&&(i=0),s=r?Math.min(r*t+i,e.length):e.length,a=i;a<s;a+=t)_0x317d2c[0]=e[a],_0x317d2c[1]=e[a+1],_0x317d2c[2]=e[a+2],_0x317d2c[3]=e[a+3],n(_0x317d2c,_0x317d2c,o),e[a]=_0x317d2c[0],e[a+1]=_0x317d2c[1],e[a+2]=_0x317d2c[2],e[a+3]=_0x317d2c[3];return e}),_0x27b37c=Object.freeze({create:_0x2b9f4b,clone:_0x4ff3ce,fromValues:_0x1280e8,copy:_0x3b5b27,set:_0x2c6a31,add:_0x4ac64c,subtract:_0x5f00d9,multiply:_0x36a627,divide:_0x1dcd87,ceil:_0x2b2888,floor:_0x1af3bc,min:_0x234c45,max:_0x1abcb2,round:_0x242e16,scale:_0x10536f,scaleAndAdd:_0x271145,distance:_0x16f0f2,squaredDistance:_0x27e7da,length:_0x2a0d4d,squaredLength:_0x36fa04,negate:_0x2a502d,inverse:_0x313d58,normalize:_0x3ba53a,dot:_0x1dcd9a,cross:_0x17953f,lerp:_0x411424,random:_0x1665cd,transformMat4:_0x2e6412,transformQuat:_0x4ebbf6,zero:_0x3dcf5b,str:_0x5828c1,exactEquals:_0x4dd375,equals:_0x196935,sub:_0x9631b2,mul:_0x3a0eb3,div:_0x38745c,dist:_0x1a77f0,sqrDist:_0x4f7f96,len:_0x37ca4b,sqrLen:_0x2e27e1,forEach:_0x44efe3}),_0x317d2c;function _0x4b6a86(){var e=new _0x5d9fb9(4);return _0x5d9fb9!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function _0x5348c9(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function _0xd56bd1(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function _0x552e96(e,t){var i=2*Math.acos(t[3]),r=Math.sin(i/2);return r>_0x24e55d?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),i}function _0x408eea(e,t){var i=_0x5e67ea(e,t);return Math.acos(2*i*i-1)}function _0xb32d07(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=i[0],l=i[1],u=i[2],c=i[3];return e[0]=r*c+a*s+n*u-o*l,e[1]=n*c+a*l+o*s-r*u,e[2]=o*c+a*u+r*l-n*s,e[3]=a*c-r*s-n*l-o*u,e}function _0x394192(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=r*l+a*s,e[1]=n*l+o*s,e[2]=o*l-n*s,e[3]=a*l-r*s,e}function _0x1ac373(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=r*l-o*s,e[1]=n*l+a*s,e[2]=o*l+r*s,e[3]=a*l-n*s,e}function _0x559c81(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=r*l+n*s,e[1]=n*l-r*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e}function _0x52851f(e,t){var i=t[0],r=t[1],n=t[2];return e[0]=i,e[1]=r,e[2]=n,e[3]=Math.sqrt(Math.abs(1-i*i-r*r-n*n)),e}function _0x399bbb(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=Math.sqrt(i*i+r*r+n*n),s=Math.exp(o),l=a>0?s*Math.sin(a)/a:0;return e[0]=i*l,e[1]=r*l,e[2]=n*l,e[3]=s*Math.cos(a),e}function _0x5553bd(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=Math.sqrt(i*i+r*r+n*n),s=a>0?Math.atan2(a,o)/a:0;return e[0]=i*s,e[1]=r*s,e[2]=n*s,e[3]=.5*Math.log(i*i+r*r+n*n+o*o),e}function _0x207c31(e,t,i){return _0x5553bd(e,t),_0x26a20c(e,e,i),_0x399bbb(e,e),e}function _0x25aa0d(e,t,i,r){var n,o,a,s,l,u=t[0],c=t[1],h=t[2],d=t[3],f=i[0],p=i[1],_=i[2],m=i[3];return(o=u*f+c*p+h*_+d*m)<0&&(o=-o,f=-f,p=-p,_=-_,m=-m),1-o>_0x24e55d?(n=Math.acos(o),a=Math.sin(n),s=Math.sin((1-r)*n)/a,l=Math.sin(r*n)/a):(s=1-r,l=r),e[0]=s*u+l*f,e[1]=s*c+l*p,e[2]=s*h+l*_,e[3]=s*d+l*m,e}function _0x4eb76e(e){var t=_0x5cdc79(),i=_0x5cdc79(),r=_0x5cdc79(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=o*Math.sin(2*Math.PI*r),e[3]=o*Math.cos(2*Math.PI*r),e}function _0x16070e(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=i*i+r*r+n*n+o*o,s=a?1/a:0;return e[0]=-i*s,e[1]=-r*s,e[2]=-n*s,e[3]=o*s,e}function _0xd47e79(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function _0x5435fb(e,t){var i,r=t[0]+t[4]+t[8];if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var o=(n+1)%3,a=(n+2)%3;i=Math.sqrt(t[3*n+n]-t[3*o+o]-t[3*a+a]+1),e[n]=.5*i,i=.5/i,e[3]=(t[3*o+a]-t[3*a+o])*i,e[o]=(t[3*o+n]+t[3*n+o])*i,e[a]=(t[3*a+n]+t[3*n+a])*i}return e}function _0x24f8c0(e,t,i,r){var n=.5*Math.PI/180;t*=n,i*=n,r*=n;var o=Math.sin(t),a=Math.cos(t),s=Math.sin(i),l=Math.cos(i),u=Math.sin(r),c=Math.cos(r);return e[0]=o*l*c-a*s*u,e[1]=a*s*c+o*l*u,e[2]=a*l*u-o*s*c,e[3]=a*l*c+o*s*u,e}function _0x59bf87(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}var _0x26e01b=_0x4ff3ce,_0xc24f66=_0x1280e8,_0x805506=_0x3b5b27,_0x5c229a=_0x2c6a31,_0x108bb4=_0x4ac64c,_0x1acdd2=_0xb32d07,_0x26a20c=_0x10536f,_0x5e67ea=_0x1dcd9a,_0x440cc6=_0x411424,_0x46070b=_0x2a0d4d,_0x4d3332=_0x46070b,_0x2bc1bc=_0x36fa04,_0x56565d=_0x2bc1bc,_0x583b8b=_0x3ba53a,_0x354b63=_0x4dd375,_0x47f6cf=_0x196935,_0x5d35de=(_0x3e6564=_0x544ddc(),_0x5af314=_0xdcaa72(1,0,0),_0x413340=_0xdcaa72(0,1,0),function(e,t,i){var r=_0x40ef43(t,i);return r<-.999999?(_0x368314(_0x3e6564,_0x5af314,t),_0x58c812(_0x3e6564)<1e-6&&_0x368314(_0x3e6564,_0x413340,t),_0xce9a74(_0x3e6564,_0x3e6564),_0xd56bd1(e,_0x3e6564,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(_0x368314(_0x3e6564,t,i),e[0]=_0x3e6564[0],e[1]=_0x3e6564[1],e[2]=_0x3e6564[2],e[3]=1+r,_0x583b8b(e,e))}),_0x133d9b=(_0x33ee41=_0x4b6a86(),_0x188e92=_0x4b6a86(),function(e,t,i,r,n,o){return _0x25aa0d(_0x33ee41,t,n,o),_0x25aa0d(_0x188e92,i,r,o),_0x25aa0d(e,_0x33ee41,_0x188e92,2*o*(1-o)),e}),_0x51707f=(_0x36117a=_0x57d654(),function(e,t,i,r){return _0x36117a[0]=i[0],_0x36117a[3]=i[1],_0x36117a[6]=i[2],_0x36117a[1]=r[0],_0x36117a[4]=r[1],_0x36117a[7]=r[2],_0x36117a[2]=-t[0],_0x36117a[5]=-t[1],_0x36117a[8]=-t[2],_0x583b8b(e,_0x5435fb(e,_0x36117a))}),_0xcdfba=Object.freeze({create:_0x4b6a86,identity:_0x5348c9,setAxisAngle:_0xd56bd1,getAxisAngle:_0x552e96,getAngle:_0x408eea,multiply:_0xb32d07,rotateX:_0x394192,rotateY:_0x1ac373,rotateZ:_0x559c81,calculateW:_0x52851f,exp:_0x399bbb,ln:_0x5553bd,pow:_0x207c31,slerp:_0x25aa0d,random:_0x4eb76e,invert:_0x16070e,conjugate:_0xd47e79,fromMat3:_0x5435fb,fromEuler:_0x24f8c0,str:_0x59bf87,clone:_0x26e01b,fromValues:_0xc24f66,copy:_0x805506,set:_0x5c229a,add:_0x108bb4,mul:_0x1acdd2,scale:_0x26a20c,dot:_0x5e67ea,lerp:_0x440cc6,length:_0x46070b,len:_0x4d3332,squaredLength:_0x2bc1bc,sqrLen:_0x56565d,normalize:_0x583b8b,exactEquals:_0x354b63,equals:_0x47f6cf,rotationTo:_0x5d35de,sqlerp:_0x133d9b,setAxes:_0x51707f}),_0x36117a,_0x33ee41,_0x188e92,_0x3e6564,_0x5af314,_0x413340;function _0x4b7c66(){var e=new _0x5d9fb9(8);return _0x5d9fb9!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e}function _0x27c04e(e){var t=new _0x5d9fb9(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function _0x3ac585(e,t,i,r,n,o,a,s){var l=new _0x5d9fb9(8);return l[0]=e,l[1]=t,l[2]=i,l[3]=r,l[4]=n,l[5]=o,l[6]=a,l[7]=s,l}function _0x31a8bd(e,t,i,r,n,o,a){var s=new _0x5d9fb9(8);s[0]=e,s[1]=t,s[2]=i,s[3]=r;var l=.5*n,u=.5*o,c=.5*a;return s[4]=l*r+u*i-c*t,s[5]=u*r+c*e-l*i,s[6]=c*r+l*t-u*e,s[7]=-l*e-u*t-c*i,s}function _0x10cc3f(e,t,i){var r=.5*i[0],n=.5*i[1],o=.5*i[2],a=t[0],s=t[1],l=t[2],u=t[3];return e[0]=a,e[1]=s,e[2]=l,e[3]=u,e[4]=r*u+n*l-o*s,e[5]=n*u+o*a-r*l,e[6]=o*u+r*s-n*a,e[7]=-r*a-n*s-o*l,e}function _0x13c79f(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e}function _0x464295(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function _0x2987d6(e,t){var i=_0x4b6a86();_0x4d1176(i,t);var r=new _0x5d9fb9(3);return _0x101107(r,t),_0x10cc3f(e,i,r),e}function _0x2ba8d3(e,t){return 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}function _0x4b56bc(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e}function _0x4e0081(e,t,i,r,n,o,a,s,l){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e}var _0x1f3bd3=_0x805506;function _0x34cd0c(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e}var _0x5c7f30=_0x805506;function _0x169c71(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e}function _0x3465ec(e,t){var i=t[4],r=t[5],n=t[6],o=t[7],a=-t[0],s=-t[1],l=-t[2],u=t[3];return e[0]=2*(i*u+o*a+r*l-n*s),e[1]=2*(r*u+o*s+n*a-i*l),e[2]=2*(n*u+o*l+i*s-r*a),e}function _0x48fb85(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=.5*i[0],l=.5*i[1],u=.5*i[2],c=t[4],h=t[5],d=t[6],f=t[7];return e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=a*s+n*u-o*l+c,e[5]=a*l+o*s-r*u+h,e[6]=a*u+r*l-n*s+d,e[7]=-r*s-n*l-o*u+f,e}function _0x2b2ec7(e,t,i){var r=-t[0],n=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=s*a+c*r+l*o-u*n,d=l*a+c*n+u*r-s*o,f=u*a+c*o+s*n-l*r,p=c*a-s*r-l*n-u*o;return _0x394192(e,t,i),r=e[0],n=e[1],o=e[2],a=e[3],e[4]=h*a+p*r+d*o-f*n,e[5]=d*a+p*n+f*r-h*o,e[6]=f*a+p*o+h*n-d*r,e[7]=p*a-h*r-d*n-f*o,e}function _0x24e4c0(e,t,i){var r=-t[0],n=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=s*a+c*r+l*o-u*n,d=l*a+c*n+u*r-s*o,f=u*a+c*o+s*n-l*r,p=c*a-s*r-l*n-u*o;return _0x1ac373(e,t,i),r=e[0],n=e[1],o=e[2],a=e[3],e[4]=h*a+p*r+d*o-f*n,e[5]=d*a+p*n+f*r-h*o,e[6]=f*a+p*o+h*n-d*r,e[7]=p*a-h*r-d*n-f*o,e}function _0x18295c(e,t,i){var r=-t[0],n=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],h=s*a+c*r+l*o-u*n,d=l*a+c*n+u*r-s*o,f=u*a+c*o+s*n-l*r,p=c*a-s*r-l*n-u*o;return _0x559c81(e,t,i),r=e[0],n=e[1],o=e[2],a=e[3],e[4]=h*a+p*r+d*o-f*n,e[5]=d*a+p*n+f*r-h*o,e[6]=f*a+p*o+h*n-d*r,e[7]=p*a-h*r-d*n-f*o,e}function _0x2e030a(e,t,i){var r=i[0],n=i[1],o=i[2],a=i[3],s=t[0],l=t[1],u=t[2],c=t[3];return e[0]=s*a+c*r+l*o-u*n,e[1]=l*a+c*n+u*r-s*o,e[2]=u*a+c*o+s*n-l*r,e[3]=c*a-s*r-l*n-u*o,s=t[4],l=t[5],u=t[6],c=t[7],e[4]=s*a+c*r+l*o-u*n,e[5]=l*a+c*n+u*r-s*o,e[6]=u*a+c*o+s*n-l*r,e[7]=c*a-s*r-l*n-u*o,e}function _0x3ff6f3(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=i[0],l=i[1],u=i[2],c=i[3];return e[0]=r*c+a*s+n*u-o*l,e[1]=n*c+a*l+o*s-r*u,e[2]=o*c+a*u+r*l-n*s,e[3]=a*c-r*s-n*l-o*u,s=i[4],l=i[5],u=i[6],c=i[7],e[4]=r*c+a*s+n*u-o*l,e[5]=n*c+a*l+o*s-r*u,e[6]=o*c+a*u+r*l-n*s,e[7]=a*c-r*s-n*l-o*u,e}function _0x4e1669(e,t,i,r){if(Math.abs(r)<_0x24e55d)return _0x2ba8d3(e,t);var n=Math.hypot(i[0],i[1],i[2]);r*=.5;var o=Math.sin(r),a=o*i[0]/n,s=o*i[1]/n,l=o*i[2]/n,u=Math.cos(r),c=t[0],h=t[1],d=t[2],f=t[3];e[0]=c*u+f*a+h*l-d*s,e[1]=h*u+f*s+d*a-c*l,e[2]=d*u+f*l+c*s-h*a,e[3]=f*u-c*a-h*s-d*l;var p=t[4],_=t[5],m=t[6],$=t[7];return e[4]=p*u+$*a+_*l-m*s,e[5]=_*u+$*s+m*a-p*l,e[6]=m*u+$*l+p*s-_*a,e[7]=$*u-p*a-_*s-m*l,e}function _0x18b4e7(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e}function _0x2879ff(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=i[4],l=i[5],u=i[6],c=i[7],h=t[4],d=t[5],f=t[6],p=t[7],_=i[0],m=i[1],$=i[2],g=i[3];return e[0]=r*g+a*_+n*$-o*m,e[1]=n*g+a*m+o*_-r*$,e[2]=o*g+a*$+r*m-n*_,e[3]=a*g-r*_-n*m-o*$,e[4]=r*c+a*s+n*u-o*l+h*g+p*_+d*$-f*m,e[5]=n*c+a*l+o*s-r*u+d*g+p*m+f*_-h*$,e[6]=o*c+a*u+r*l-n*s+f*g+p*$+h*m-d*_,e[7]=a*c-r*s-n*l-o*u+p*g-h*_-d*m-f*$,e}var _0x88352e=_0x2879ff;function _0x597d5d(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e}var _0x37aea6=_0x5e67ea;function _0x3193f8(e,t,i,r){var n=1-r;return _0x37aea6(t,i)<0&&(r=-r),e[0]=t[0]*n+i[0]*r,e[1]=t[1]*n+i[1]*r,e[2]=t[2]*n+i[2]*r,e[3]=t[3]*n+i[3]*r,e[4]=t[4]*n+i[4]*r,e[5]=t[5]*n+i[5]*r,e[6]=t[6]*n+i[6]*r,e[7]=t[7]*n+i[7]*r,e}function _0x6d05de(e,t){var i=_0x2cfc3(t);return e[0]=-t[0]/i,e[1]=-t[1]/i,e[2]=-t[2]/i,e[3]=t[3]/i,e[4]=-t[4]/i,e[5]=-t[5]/i,e[6]=-t[6]/i,e[7]=t[7]/i,e}function _0x2c0853(e,t){return 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}var _0x126f72=_0x46070b,_0x210625=_0x126f72,_0x2cfc3=_0x2bc1bc,_0x13d76a=_0x2cfc3;function _0x434a82(e,t){var i=_0x2cfc3(t);if(i>0){i=Math.sqrt(i);var r=t[0]/i,n=t[1]/i,o=t[2]/i,a=t[3]/i,s=t[4],l=t[5],u=t[6],c=t[7],h=r*s+n*l+o*u+a*c;e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=(s-r*h)/i,e[5]=(l-n*h)/i,e[6]=(u-o*h)/i,e[7]=(c-a*h)/i}return e}function _0x3492e8(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"}function _0x2fe887(e,t){return 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]}function _0x36c8aa(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=t[0],h=t[1],d=t[2],f=t[3],p=t[4],_=t[5],m=t[6],$=t[7];return Math.abs(i-c)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(c))&&Math.abs(r-h)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(n-d)<=_0x24e55d*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-f)<=_0x24e55d*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-p)<=_0x24e55d*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-_)<=_0x24e55d*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(l-m)<=_0x24e55d*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(u-$)<=_0x24e55d*Math.max(1,Math.abs(u),Math.abs($))}var _0x1c0b13=Object.freeze({create:_0x4b7c66,clone:_0x27c04e,fromValues:_0x3ac585,fromRotationTranslationValues:_0x31a8bd,fromRotationTranslation:_0x10cc3f,fromTranslation:_0x13c79f,fromRotation:_0x464295,fromMat4:_0x2987d6,copy:_0x2ba8d3,identity:_0x4b56bc,set:_0x4e0081,getReal:_0x1f3bd3,getDual:_0x34cd0c,setReal:_0x5c7f30,setDual:_0x169c71,getTranslation:_0x3465ec,translate:_0x48fb85,rotateX:_0x2b2ec7,rotateY:_0x24e4c0,rotateZ:_0x18295c,rotateByQuatAppend:_0x2e030a,rotateByQuatPrepend:_0x3ff6f3,rotateAroundAxis:_0x4e1669,add:_0x18b4e7,multiply:_0x2879ff,mul:_0x88352e,scale:_0x597d5d,dot:_0x37aea6,lerp:_0x3193f8,invert:_0x6d05de,conjugate:_0x2c0853,length:_0x126f72,len:_0x210625,squaredLength:_0x2cfc3,sqrLen:_0x13d76a,normalize:_0x434a82,str:_0x3492e8,exactEquals:_0x2fe887,equals:_0x36c8aa});function _0x427f12(){var e=new _0x5d9fb9(2);return _0x5d9fb9!=Float32Array&&(e[0]=0,e[1]=0),e}function _0x13f05e(e){var t=new _0x5d9fb9(2);return t[0]=e[0],t[1]=e[1],t}function _0x2b8425(e,t){var i=new _0x5d9fb9(2);return i[0]=e,i[1]=t,i}function _0x35417b(e,t){return e[0]=t[0],e[1]=t[1],e}function _0x48655e(e,t,i){return e[0]=t,e[1]=i,e}function _0x583943(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function _0x45faf0(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function _0x5091e3(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function _0x2d8aa9(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function _0x402752(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function _0x50b47f(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function _0x2154a2(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function _0x521a74(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function _0x677f81(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function _0x18b69e(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function _0x7a93ba(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e}function _0x6cf967(e,t){var i=t[0]-e[0],r=t[1]-e[1];return Math.hypot(i,r)}function _0x65bb45(e,t){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function _0x40e938(e){var t=e[0],i=e[1];return Math.hypot(t,i)}function _0x37c523(e){var t=e[0],i=e[1];return t*t+i*i}function _0x31f0a5(e,t){return e[0]=-t[0],e[1]=-t[1],e}function _0x3407e9(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function _0x4ab3a9(e,t){var i=t[0],r=t[1],n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e}function _0x20dfb9(e,t){return e[0]*t[0]+e[1]*t[1]}function _0x5234f0(e,t,i){var r=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=r,e}function _0x244047(e,t,i,r){var n=t[0],o=t[1];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e}function _0x878e89(e,t){t=t||1;var i=2*_0x5cdc79()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e}function _0x1d8452(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[2]*n,e[1]=i[1]*r+i[3]*n,e}function _0x38cac7(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[2]*n+i[4],e[1]=i[1]*r+i[3]*n+i[5],e}function _0x1d1331(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[3]*n+i[6],e[1]=i[1]*r+i[4]*n+i[7],e}function _0x32909a(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[4]*n+i[12],e[1]=i[1]*r+i[5]*n+i[13],e}function _0x5c5a69(e,t,i,r){var n=t[0]-i[0],o=t[1]-i[1],a=Math.sin(r),s=Math.cos(r);return e[0]=n*s-o*a+i[0],e[1]=n*a+o*s+i[1],e}function _0x3b1bee(e,t){var i=e[0],r=e[1],n=t[0],o=t[1],a=i*i+r*r;a>0&&(a=1/Math.sqrt(a));var s=n*n+o*o;s>0&&(s=1/Math.sqrt(s));var l=(i*n+r*o)*a*s;return l>1?0:l<-1?Math.PI:Math.acos(l)}function _0x4704be(e){return e[0]=0,e[1]=0,e}function _0x2fad7a(e){return"vec2("+e[0]+", "+e[1]+")"}function _0xd1d30b(e,t){return e[0]===t[0]&&e[1]===t[1]}function _0x40e113(e,t){var i=e[0],r=e[1],n=t[0],o=t[1];return Math.abs(i-n)<=_0x24e55d*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-o)<=_0x24e55d*Math.max(1,Math.abs(r),Math.abs(o))}var _0x421ab2=_0x40e938,_0xad9623=_0x45faf0,_0x3acac8=_0x5091e3,_0x13662c=_0x2d8aa9,_0x16d42e=_0x6cf967,_0x7d180c=_0x65bb45,_0x27b769=_0x37c523,_0x29c55d=(_0x2db310=_0x427f12(),function(e,t,i,r,n,o){var a,s;for(!t&&(t=2),!i&&(i=0),s=r?Math.min(r*t+i,e.length):e.length,a=i;a<s;a+=t)_0x2db310[0]=e[a],_0x2db310[1]=e[a+1],n(_0x2db310,_0x2db310,o),e[a]=_0x2db310[0],e[a+1]=_0x2db310[1];return e}),_0x1fc550=Object.freeze({create:_0x427f12,clone:_0x13f05e,fromValues:_0x2b8425,copy:_0x35417b,set:_0x48655e,add:_0x583943,subtract:_0x45faf0,multiply:_0x5091e3,divide:_0x2d8aa9,ceil:_0x402752,floor:_0x50b47f,min:_0x2154a2,max:_0x521a74,round:_0x677f81,scale:_0x18b69e,scaleAndAdd:_0x7a93ba,distance:_0x6cf967,squaredDistance:_0x65bb45,length:_0x40e938,squaredLength:_0x37c523,negate:_0x31f0a5,inverse:_0x3407e9,normalize:_0x4ab3a9,dot:_0x20dfb9,cross:_0x5234f0,lerp:_0x244047,random:_0x878e89,transformMat2:_0x1d8452,transformMat2d:_0x38cac7,transformMat3:_0x1d1331,transformMat4:_0x32909a,rotate:_0x5c5a69,angle:_0x3b1bee,zero:_0x4704be,str:_0x2fad7a,exactEquals:_0xd1d30b,equals:_0x40e113,len:_0x421ab2,sub:_0xad9623,mul:_0x3acac8,div:_0x13662c,dist:_0x16d42e,sqrDist:_0x7d180c,sqrLen:_0x27b769,forEach:_0x29c55d}),_0x2db310;_0x1d4fb9.glMatrix=_0x351640,_0x1d4fb9.mat2=_0x1d2736,_0x1d4fb9.mat2d=_0x292b40,_0x1d4fb9.mat3=_0x401de7,_0x1d4fb9.mat4=_0x3a85e5,_0x1d4fb9.quat=_0xcdfba,_0x1d4fb9.quat2=_0x1c0b13,_0x1d4fb9.vec2=_0x1fc550,_0x1d4fb9.vec3=_0x5d59c0,_0x1d4fb9.vec4=_0x27b37c;var _0x1e7161=(_0x4831a3=!0,function(e,t){var i=_0x4831a3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4831a3=!1,i}),_0x460c06=_0x1e7161(void 0,(function(){return _0x460c06.toString().search("(((.+)+)+)+$").toString().constructor(_0x460c06).search("(((.+)+)+)+$")})),_0x4831a3;function number(e,t,i){return e*(1-i)+t*i}_0x460c06();var _0x592673=(_0x39a351=!0,function(e,t){var i=_0x39a351?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x39a351=!1,i}),_0x107aa8=_0x592673(void 0,(function(){return _0x107aa8.toString().search("(((.+)+)+)+$").toString().constructor(_0x107aa8).search("(((.+)+)+)+$")})),_0x39a351;_0x107aa8();var _0x4b093f=function(){this.first=!0};_0x4b093f.prototype.update=function(e,t){var i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=i,!0))},_0x36ace8.register("ZoomHistory",_0x4b093f);var _0x1c336d=(_0x116429=!0,function(e,t){var i=_0x116429?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x116429=!1,i}),_0x506d4b=_0x1c336d(void 0,(function(){return _0x506d4b.toString().search("(((.+)+)+)+$").toString().constructor(_0x506d4b).search("(((.+)+)+)+$")})),_0x116429;_0x506d4b();var _0x105812=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new _0x4b093f,this.transition={})};_0x105812.prototype.isSupportedScript=function(e){return!1},_0x105812.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},_0x105812.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),i=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*t}},_0x36ace8.register("EvaluationParameters",_0x105812);const _0x3769fb=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x3de52a=_0x3769fb(void 0,(function(){return _0x3de52a.toString().search("(((.+)+)+)+$").toString().constructor(_0x3de52a).search("(((.+)+)+)+$")}));_0x3de52a();const _0x16d38d=128;function _0x314e89(e,t){const{expression:i}=t;if("constant"===i.kind){return{kind:"constant",layoutSize:i.evaluate(new _0x105812(e+1))}}if("source"===i.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=i;let n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let o=n;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[n],s=t[o];if("composite"===i.kind)return{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r};return{kind:"camera",minZoom:a,maxZoom:s,minSize:i.evaluate(new _0x105812(a)),maxSize:i.evaluate(new _0x105812(s)),interpolationType:r}}}function _0x5eaf61(e,{uSize:t,uSizeT:i},{lowerSize:r,upperSize:n}){return"source"===e.kind?r/_0x16d38d:"composite"===e.kind?number(r/_0x16d38d,n/_0x16d38d,i):t}function _0x20dc96(e,t){let i=0,r=0;if("constant"===e.kind)r=e.layoutSize;else if("source"!==e.kind){const{interpolationType:n,minZoom:o,maxZoom:a}=e,s=n?clamp(_0x1053c6.interpolationFactor(n,t,o,a),0,1):0;"camera"===e.kind?r=number(e.minSize,e.maxSize,s):i=s}return{uSizeT:i,uSize:r}}var _0x4d5f7f=(_0x413050=!0,function(e,t){var i=_0x413050?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x413050=!1,i}),_0x385901=_0x4d5f7f(void 0,(function(){return _0x385901.toString().search("(((.+)+)+)+$").toString().constructor(_0x385901).search("(((.+)+)+)+$")})),_0x413050;_0x385901();var _0x3d5a44={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};function _0x49bc87(e,t){void 0===t&&(t=1);var i=0,r=0;return{members:e.map((function(e){var n=_0x5acc92(e.type),o=i=_0x33340f(i,Math.max(t,n)),a=e.components||1;return r=Math.max(r,n),i+=n*a,{name:e.name,type:e.type,components:a,offset:o}})),size:_0x33340f(i,Math.max(r,t)),alignment:t}}function _0x5acc92(e){return _0x3d5a44[e].BYTES_PER_ELEMENT}function _0x33340f(e,t){return Math.ceil(e/t)*t}const _0x391df0=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1488c7=_0x391df0(void 0,(function(){return _0x1488c7.toString().search("(((.+)+)+)+$").toString().constructor(_0x1488c7).search("(((.+)+)+)+$")}));_0x1488c7();const symbolLayoutAttributes=_0x49bc87([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),dynamicLayoutAttributes=_0x49bc87([{name:"a_projected_pos",components:3,type:"Float32"}],4);_0x49bc87([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),_0x49bc87([{name:"a_fade_opacity",components:1,type:"Float32"}],4);const collisionVertexAttributes=_0x49bc87([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);_0x49bc87([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]);const collisionBoxLayout=_0x49bc87([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout=_0x49bc87([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function _0x526c08(e,t,i){return Math.min(i,Math.max(t,e))}function _0x10a544(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),{min:-1*Math.pow(2,e-1),max:Math.pow(2,e-1)-1}}_0x49bc87([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),_0x49bc87([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),_0x49bc87([{type:"Float32",name:"offsetX"}]),_0x49bc87([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var _0x4f0281=_0x10a544(15);function _0x3e7ee3(e){for(var t=_0xea783f/e.extent,i=e.loadGeometry(),r=0;r<i.length;r++)for(var n=i[r],o=0;o<n.length;o++){var a=n[o];a.x=Math.round(a.x*t),a.y=_0xea783f-Math.round(a.y*t),(a.x<_0x4f0281.min||a.x>_0x4f0281.max||a.y<_0x4f0281.min||a.y>_0x4f0281.max)&&(a.x=_0x526c08(a.x,_0x4f0281.min,_0x4f0281.max),a.y=_0x526c08(a.y,_0x4f0281.min,_0x4f0281.max))}return i}var _0x104c48=(_0x30d496=!0,function(e,t){var i=_0x30d496?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x30d496=!1,i}),_0x2918ce=_0x104c48(void 0,(function(){return _0x2918ce.toString().search("(((.+)+)+)+$").toString().constructor(_0x2918ce).search("(((.+)+)+)+$")})),_0x30d496;_0x2918ce();var _0x436bfd=function(e,t,i){this.property=e,this.value=t,this.parameters=i};_0x436bfd.prototype.isConstant=function(){return"constant"===this.value.kind},_0x436bfd.prototype.constantOr=function(e){return"constant"===this.value.kind?this.value.value:e},_0x436bfd.prototype.evaluate=function(e,t,i){return this.property.evaluate(this.value,this.parameters,e,t,i)};var _0x40da99=(_0x128c5a=!0,function(e,t){var i=_0x128c5a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x128c5a=!1,i}),_0x4812c4=_0x40da99(void 0,(function(){return _0x4812c4.toString().search("(((.+)+)+)+$").toString().constructor(_0x4812c4).search("(((.+)+)+)+$")})),_0x128c5a;function supportsPropertyExpression(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function supportsZoomExpression(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function supportsInterpolation(e){return!!e.expression&&e.expression.interpolated}_0x4812c4();const _0x3af94e=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x35f3b4=_0x3af94e(void 0,(function(){return _0x35f3b4.toString().search("(((.+)+)+)+$").toString().constructor(_0x35f3b4).search("(((.+)+)+)+$")}));_0x35f3b4();var _0x4bc701=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8};const _0x4c8b0f=128,_0x5c45c1=5;var _0x1a669f=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};_0x1a669f.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},_0x1a669f.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},_0x1a669f.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},_0x1a669f.prototype.clear=function(){this.length=0},_0x1a669f.prototype.resize=function(e){this.reserve(e),this.length=e},_0x1a669f.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*_0x5c45c1),_0x4c8b0f),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&(0==t.length&&console.log("oldUint8Array.length == 0"),this.uint8.set(t))}},_0x1a669f.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var _0x58a5fb=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,e},t}(_0x1a669f);_0x58a5fb.prototype.bytesPerElement=4,_0x36ace8.register("StructArrayLayout2i4",_0x58a5fb);var _0x25933c=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,e},t}(_0x1a669f);_0x25933c.prototype.bytesPerElement=8,_0x36ace8.register("StructArrayLayout4i8",_0x25933c);var _0x3d2b9d=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(_0x1a669f);_0x3d2b9d.prototype.bytesPerElement=12,_0x36ace8.register("StructArrayLayout2i4i12",_0x3d2b9d);var _0x43b0b2=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,e},t}(_0x1a669f);_0x43b0b2.prototype.bytesPerElement=8,_0x36ace8.register("StructArrayLayout2i4ub8",_0x43b0b2);var _0xbadb52=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(e,t,i,r,n,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,i,r,n,o,a,s)},n.prototype.emplace=function(e,t,i,r,n,o,a,s,l){var u=8*e;return this.uint16[u+0]=t,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=n,this.uint16[u+4]=o,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,e},n}(_0x1a669f);_0xbadb52.prototype.bytesPerElement=16,_0x36ace8.register("StructArrayLayout8ui16",_0xbadb52);var _0x3647fd=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,r,n,o,a,s,l,u,c,h)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=12*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=d,e},t}(_0x1a669f);_0x3647fd.prototype.bytesPerElement=24,_0x36ace8.register("StructArrayLayout4i4ui4i24",_0x3647fd);var _0xb4453=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.float32[n+0]=t,this.float32[n+1]=i,this.float32[n+2]=r,e},t}(_0x1a669f);_0xb4453.prototype.bytesPerElement=12,_0x36ace8.register("StructArrayLayout3f12",_0xb4453);var _0x5a12c6=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.uint32[i+0]=t,e},t}(_0x1a669f);_0x5a12c6.prototype.bytesPerElement=4,_0x36ace8.register("StructArrayLayout1ul4",_0x5a12c6);var _0xff2522=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c){var h=this.length;return this.resize(h+1),this.emplace(h,e,t,i,r,n,o,a,s,l,u,c)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=12*e,f=6*e;return this.int16[d+0]=t,this.int16[d+1]=i,this.int16[d+2]=r,this.int16[d+3]=n,this.int16[d+4]=o,this.int16[d+5]=a,this.uint32[f+3]=s,this.uint16[d+8]=l,this.uint16[d+9]=u,this.int16[d+10]=c,this.int16[d+11]=h,e},t}(_0x1a669f);_0xff2522.prototype.bytesPerElement=24,_0x36ace8.register("StructArrayLayout6i1ul2ui2i24",_0xff2522);var _0x5a5161=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(_0x1a669f);_0x5a5161.prototype.bytesPerElement=12,_0x36ace8.register("StructArrayLayout2i2i2i12",_0x5a5161);var _0x19b8be=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=i,this.float32[a+1]=r,this.float32[a+2]=n,e},t}(_0x1a669f);_0x19b8be.prototype.bytesPerElement=12,_0x36ace8.register("StructArrayLayout2ub2f12",_0x19b8be);var _0x5e76d2=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m){var $=this.length;return this.resize($+1),this.emplace($,e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$){var g=24*e,v=12*e,y=48*e;return this.int16[g+0]=t,this.int16[g+1]=i,this.uint16[g+2]=r,this.uint16[g+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[g+10]=l,this.uint16[g+11]=u,this.uint16[g+12]=c,this.float32[v+7]=h,this.float32[v+8]=d,this.uint8[y+36]=f,this.uint8[y+37]=p,this.uint8[y+38]=_,this.uint32[v+10]=m,this.int16[g+22]=$,e},t}(_0x1a669f);_0x5e76d2.prototype.bytesPerElement=48,_0x36ace8.register("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",_0x5e76d2);var _0x4c69de=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T){var S=this.length;return this.resize(S+1),this.emplace(S,e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T,S){var E=30*e,A=15*e;return this.int16[E+0]=t,this.int16[E+1]=i,this.int16[E+2]=r,this.int16[E+3]=n,this.int16[E+4]=o,this.int16[E+5]=a,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=u,this.uint16[E+9]=c,this.uint16[E+10]=h,this.uint16[E+11]=d,this.uint16[E+12]=f,this.uint16[E+13]=p,this.uint16[E+14]=_,this.uint16[E+15]=m,this.uint16[E+16]=$,this.uint16[E+17]=g,this.uint16[E+18]=v,this.uint16[E+19]=y,this.uint16[E+20]=x,this.uint16[E+21]=b,this.uint32[A+11]=w,this.float32[A+12]=C,this.float32[A+13]=T,this.float32[A+14]=S,e},t}(_0x1a669f);_0x4c69de.prototype.bytesPerElement=60,_0x36ace8.register("StructArrayLayout8i14ui1ul3f60",_0x4c69de);var _0x5294b1=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.float32[i+0]=t,e},t}(_0x1a669f);_0x5294b1.prototype.bytesPerElement=4,_0x36ace8.register("StructArrayLayout1f4",_0x5294b1);var _0x137a56=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.int16[n+0]=t,this.int16[n+1]=i,this.int16[n+2]=r,e},t}(_0x1a669f);_0x137a56.prototype.bytesPerElement=6,_0x36ace8.register("StructArrayLayout3i6",_0x137a56);var _0x5c90ec=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=2*e,o=4*e;return this.uint32[n+0]=t,this.uint16[o+2]=i,this.uint16[o+3]=r,e},t}(_0x1a669f);_0x5c90ec.prototype.bytesPerElement=8,_0x36ace8.register("StructArrayLayout1ul2ui8",_0x5c90ec);var _0x1e1a35=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,this.uint16[n+2]=r,e},t.prototype.get=function(e){var t=3*e;return[this.uint16[t+0],this.uint16[t+1],this.uint16[t+2]]},t}(_0x1a669f);_0x1e1a35.prototype.bytesPerElement=6,_0x36ace8.register("StructArrayLayout3ui6",_0x1e1a35);var _0xe091d7=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i){var r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)},t.prototype.emplace=function(e,t,i,r){var n=3*e;return this.uint32[n+0]=t,this.uint32[n+1]=i,this.uint32[n+2]=r,e},t.prototype.copyFrom3ui6=function(e){if(!(e instanceof _0x1e1a35))throw new Error("expect array to be type of StructArrayLayout3ui6");this.clear();for(let t=0;t<e.length;t++){let i=e.get(t);this.emplaceBack(i[0],i[1],i[2])}},t}(_0x1a669f);_0xe091d7.prototype.bytesPerElement=12,_0x36ace8.register("StructArrayLayout3ul12",_0xe091d7);var _0x41aa31=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,e},t.prototype.get=function(e){var t=2*e;return[this.uint16[t+0],this.uint16[t+1]]},t}(_0x1a669f);_0x41aa31.prototype.bytesPerElement=4,_0x36ace8.register("StructArrayLayout2ui4",_0x41aa31);var _0x108a02=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.uint32[r+0]=t,this.uint32[r+1]=i,e},t.prototype.copyFrom2ui4=function(e){if(!(e instanceof _0x41aa31))throw new Error("expect array to be type of StructArrayLayout2ui4");this.clear();for(let t=0;t<e.length;t++){let i=e.get(t);this.emplaceBack(i[0],i[1])}},t}(_0x1a669f);_0x108a02.prototype.bytesPerElement=8,_0x36ace8.register("StructArrayLayout2ul8",_0x108a02);var _0x5a3fb6=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var i=1*e;return this.uint16[i+0]=t,e},t}(_0x1a669f);_0x5a3fb6.prototype.bytesPerElement=2,_0x36ace8.register("StructArrayLayout1ui2",_0x5a3fb6);var _0xbdbe37=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var i=this.length;return this.resize(i+1),this.emplace(i,e,t)},t.prototype.emplace=function(e,t,i){var r=2*e;return this.float32[r+0]=t,this.float32[r+1]=i,e},t}(_0x1a669f);_0xbdbe37.prototype.bytesPerElement=8,_0x36ace8.register("StructArrayLayout2f8",_0xbdbe37);var _0x550eed=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)},t.prototype.emplace=function(e,t,i,r,n){var o=4*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,e},t}(_0x1a669f);_0x550eed.prototype.bytesPerElement=16,_0x36ace8.register("StructArrayLayout4f16",_0x550eed);var _0x355b24=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o)},t.prototype.emplace=function(e,t,i,r,n,o,a){var s=6*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=r,this.float32[s+3]=n,this.float32[s+4]=o,this.float32[s+5]=a,e},t}(_0x1a669f);_0x355b24.prototype.bytesPerElement=24,_0x36ace8.register("StructArrayLayout6f24",_0x355b24);var _0x444640=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s){var l=this.length;return this.resize(l+1),this.emplace(l,e,t,i,r,n,o,a,s)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l){var u=8*e;return this.float32[u+0]=t,this.float32[u+1]=i,this.float32[u+2]=r,this.float32[u+3]=n,this.float32[u+4]=o,this.float32[u+5]=a,this.float32[u+6]=s,this.float32[u+7]=l,e},t}(_0x1a669f);_0x444640.prototype.bytesPerElement=32,_0x36ace8.register("StructArrayLayout8f32",_0x444640);var _0x5c082b=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,r,n,o,a,s,l,u,c,h)},t.prototype.emplace=function(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=12*e;return this.float32[f+0]=t,this.float32[f+1]=i,this.float32[f+2]=r,this.float32[f+3]=n,this.float32[f+4]=o,this.float32[f+5]=a,this.float32[f+6]=s,this.float32[f+7]=l,this.float32[f+8]=u,this.float32[f+9]=c,this.float32[f+10]=h,this.float32[f+11]=d,e},t}(_0x1a669f);_0x5c082b.prototype.bytesPerElement=48,_0x36ace8.register("StructArrayLayout12f48",_0x5c082b);var _0xa0239c=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorPointY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.x1.set=function(e){this._structArray.int16[this._pos2+2]=e},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.y1.set=function(e){this._structArray.int16[this._pos2+3]=e},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.x2.set=function(e){this._structArray.int16[this._pos2+4]=e},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.y2.set=function(e){this._structArray.int16[this._pos2+5]=e},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.featureIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+8]=e},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},i.radius.get=function(){return this._structArray.int16[this._pos2+10]},i.radius.set=function(e){this._structArray.int16[this._pos2+10]=e},i.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},i.signedDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+11]=e},i.anchorPoint.get=function(){return new pointGeometry(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0xa0239c.prototype.size=24;var _0x39ec37=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new _0xa0239c(this,e)},t}(_0xff2522);_0x36ace8.register("CollisionBoxArray",_0x39ec37);var _0x20210e=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.glyphStartIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.numGlyphs.set=function(e){this._structArray.uint16[this._pos2+3]=e},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.vertexStartIndex.set=function(e){this._structArray.uint32[this._pos4+2]=e},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineStartIndex.set=function(e){this._structArray.uint32[this._pos4+3]=e},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.lineLength.set=function(e){this._structArray.uint32[this._pos4+4]=e},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.segment.set=function(e){this._structArray.uint16[this._pos2+10]=e},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.lowerSize.set=function(e){this._structArray.uint16[this._pos2+11]=e},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.upperSize.set=function(e){this._structArray.uint16[this._pos2+12]=e},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetX.set=function(e){this._structArray.float32[this._pos4+7]=e},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.lineOffsetY.set=function(e){this._structArray.float32[this._pos4+8]=e},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.writingMode.set=function(e){this._structArray.uint8[this._pos1+36]=e},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},i.associatedIconIndex.set=function(e){this._structArray.int16[this._pos2+22]=e},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0x20210e.prototype.size=48;var _0x11131b=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new _0x20210e(this,e)},t}(_0x5e76d2);_0x36ace8.register("PlacedSymbolArray",_0x11131b);var _0x2fc496=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorX.set=function(e){this._structArray.int16[this._pos2+0]=e},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.anchorY.set=function(e){this._structArray.int16[this._pos2+1]=e},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.rightJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+2]=e},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.centerJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+3]=e},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.leftJustifiedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+4]=e},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.verticalPlacedTextSymbolIndex.set=function(e){this._structArray.int16[this._pos2+5]=e},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.placedIconSymbolIndex.set=function(e){this._structArray.int16[this._pos2+6]=e},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.verticalPlacedIconSymbolIndex.set=function(e){this._structArray.int16[this._pos2+7]=e},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.key.set=function(e){this._structArray.uint16[this._pos2+8]=e},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+9]=e},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.textBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+10]=e},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+11]=e},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.verticalTextBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+12]=e},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+13]=e},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.iconBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+14]=e},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxStartIndex.set=function(e){this._structArray.uint16[this._pos2+15]=e},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.verticalIconBoxEndIndex.set=function(e){this._structArray.uint16[this._pos2+16]=e},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.featureIndex.set=function(e){this._structArray.uint16[this._pos2+17]=e},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numHorizontalGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+18]=e},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numVerticalGlyphVertices.set=function(e){this._structArray.uint16[this._pos2+19]=e},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numIconVertices.set=function(e){this._structArray.uint16[this._pos2+20]=e},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.numVerticalIconVertices.set=function(e){this._structArray.uint16[this._pos2+21]=e},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},i.crossTileID.set=function(e){this._structArray.uint32[this._pos4+11]=e},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},i.textBoxScale.set=function(e){this._structArray.float32[this._pos4+12]=e},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset0.set=function(e){this._structArray.float32[this._pos4+13]=e},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},i.textOffset1.set=function(e){this._structArray.float32[this._pos4+14]=e},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0x2fc496.prototype.size=60;var _0x599329=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new _0x2fc496(this,e)},t}(_0x4c69de);_0x36ace8.register("SymbolInstanceArray",_0x599329);var _0xe142ed=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={offsetX:{configurable:!0}};return i.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},i.offsetX.set=function(e){this._structArray.float32[this._pos4+0]=e},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0xe142ed.prototype.size=4;var _0x5bd306=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t.prototype.get=function(e){return new _0xe142ed(this,e)},t}(_0x5294b1);_0x36ace8.register("GlyphOffsetArray",_0x5bd306);var _0x47200c=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return i.x.get=function(){return this._structArray.int16[this._pos2+0]},i.x.set=function(e){this._structArray.int16[this._pos2+0]=e},i.y.get=function(){return this._structArray.int16[this._pos2+1]},i.y.set=function(e){this._structArray.int16[this._pos2+1]=e},i.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},i.tileUnitDistanceFromAnchor.set=function(e){this._structArray.int16[this._pos2+2]=e},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0x47200c.prototype.size=6;var _0x348004=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t.prototype.get=function(e){return new _0x47200c(this,e)},t}(_0x137a56);_0x36ace8.register("SymbolLineVertexArray",_0x348004);var _0x56c4fd=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.featureIndex.set=function(e){this._structArray.uint32[this._pos4+0]=e},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.sourceLayerIndex.set=function(e){this._structArray.uint16[this._pos2+2]=e},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},i.bucketIndex.set=function(e){this._structArray.uint16[this._pos2+3]=e},Object.defineProperties(t.prototype,i),t}(_0x4bc701);_0x56c4fd.prototype.size=8;var _0x53f40a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new _0x56c4fd(this,e)},t}(_0x5c90ec);_0x36ace8.register("FeatureIndexArray",_0x53f40a);var _0x43835f=(_0x154a4c=!0,function(e,t){var i=_0x154a4c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x154a4c=!1,i}),_0x1d7293=_0x43835f(void 0,(function(){return _0x1d7293.toString().search("(((.+)+)+)+$").toString().constructor(_0x1d7293).search("(((.+)+)+)+$")})),_0x154a4c;_0x1d7293();var _0x2fc30a=function(){this.ids=[],this.positions=[],this.indexed=!1};function _0x32a030(e,t,i,r){if(!(i>=r)){for(var n=e[i+r>>1],o=i-1,a=r+1;;){do{o++}while(e[o]<n);do{a--}while(e[a]>n);if(o>=a)break;_0x5dd2d1(e,o,a),_0x5dd2d1(t,3*o,3*a),_0x5dd2d1(t,3*o+1,3*a+1),_0x5dd2d1(t,3*o+2,3*a+2)}_0x32a030(e,t,i,a),_0x32a030(e,t,a+1,r)}}function _0x5dd2d1(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}_0x2fc30a.prototype.add=function(e,t,i,r){this.ids.push(e),this.positions.push(t,i,r)},_0x2fc30a.prototype.getPositions=function(e){for(var t=0,i=this.ids.length-1;t<i;){var r=t+i>>1;this.ids[r]>=e?i=r:t=r+1}for(var n=[];this.ids[t]===e;){var o=this.positions[3*t],a=this.positions[3*t+1],s=this.positions[3*t+2];n.push({index:o,start:a,end:s}),t++}return n},_0x2fc30a.serialize=function(e,t){var i=new Float64Array(e.ids),r=new Uint32Array(e.positions);return _0x32a030(i,r,0,i.length-1),t&&t.push(i.buffer,r.buffer),{ids:i,positions:r}},_0x2fc30a.deserialize=function(e){var t=new _0x2fc30a;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t},_0x36ace8.register("FeaturePositionMap",_0x2fc30a);var _0x435ad2=(_0x5a4d00=!0,function(e,t){var i=_0x5a4d00?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5a4d00=!1,i}),_0x3a41c3=_0x435ad2(void 0,(function(){return _0x3a41c3.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a41c3).search("(((.+)+)+)+$")})),_0x5a4d00;function _0xf13bc6(e,t,i){return Math.min(i,Math.max(t,e))}function _0x17e227(e,t){return 256*(e=_0xf13bc6(Math.floor(e),0,255))+(t=_0xf13bc6(Math.floor(t),0,255))}function _0xe25afc(e){return[_0x17e227(255*e.r,255*e.g),_0x17e227(255*e.b,255*e.a)]}_0x3a41c3();var _0x447da6=function(e,t,i){this.value=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e})),this.type=i,this.maxValue=-1/0};_0x447da6.prototype.defines=function(){return this.names.map((function(e){return"HAS_UNIFORM_u_"+e}))},_0x447da6.prototype.setConstantPatternPositions=function(){},_0x447da6.prototype.populatePaintArray=function(){},_0x447da6.prototype.updatePaintArray=function(){},_0x447da6.prototype.upload=function(){},_0x447da6.prototype.destroy=function(){},_0x447da6.prototype.setUniforms=function(e,t,i,r){t.set(r.constantOr(this.value))},_0x447da6.prototype.getBinding=function(e,t){return"color"===this.type?new _0xe46c73.UniformColor(e,t):new _0xe46c73.Uniform1f(e,t)},_0x447da6.prototype.setUniformMap=function(e,t,i,r){var n=this;e[t]=function(){var e=r.get(i).constantOr(n.value);return"color"===n.type&&(e.red=e.r,e.green=e.g,e.blue=e.b,e.alpha=e.a),e}},_0x447da6.serialize=function(e){var t=e.value,i=e.names,r=e.type;return{value:_0x36ace8.serialize(t),names:i,type:r}},_0x447da6.deserialize=function(e){var t=e.value,i=e.names,r=e.type;return new _0x447da6(_0x36ace8.deserialize(t),i,r)};var _0x17dbaf=function(e,t,i){this.value=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e})),this.type=i,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};_0x17dbaf.prototype.defines=function(){return this.names.map((function(e){return"HAS_UNIFORM_u_"+e}))},_0x17dbaf.prototype.populatePaintArray=function(){},_0x17dbaf.prototype.updatePaintArray=function(){},_0x17dbaf.prototype.upload=function(){},_0x17dbaf.prototype.destroy=function(){},_0x17dbaf.prototype.setConstantPatternPositions=function(e,t){this.patternPositions.patternTo=e.tlbr,this.patternPositions.patternFrom=t.tlbr},_0x17dbaf.prototype.setUniforms=function(e,t,i,r,n){var o=this.patternPositions;"u_pattern_to"===n&&o.patternTo&&t.set(e$25(o.patternTo[0],o.patternTo[1],o.patternTo[2],o.patternTo[3])),"u_pattern_from"===n&&o.patternFrom&&t.set(e$25(o.patternFrom[0],o.patternFrom[1],o.patternFrom[2],o.patternFrom[3]))},_0x17dbaf.prototype.getBinding=function(e,t){return new _0xe46c73.Uniform4f(e,t)},_0x17dbaf.prototype.setUniformMap=function(e,t,i,r){var n=this.patternPositions;e[t]=function(){return"u_pattern_to"===t&&n.patternTo?new e$25(n.patternTo[0],n.patternTo[1],n.patternTo[2],n.patternTo[3]):"u_pattern_from"===t&&n.patternFrom?new e$25(n.patternFrom[0],n.patternFrom[1],n.patternFrom[2],n.patternFrom[3]):void console.log("CrossFadedConstantBinder is not support")}};var _0x54f172=function(e,t,i,r){this.expression=e,this.names=t,this.type=i,this.uniformNames=this.names.map((function(e){return"a_"+e})),this.maxValue=-1/0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===i?2:1,offset:0}})),this.paintVertexArray=new r};_0x54f172.prototype.defines=function(){return[]},_0x54f172.prototype.setConstantPatternPositions=function(){},_0x54f172.prototype.populatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=n.length;n.reserve(e);var a=this.expression.evaluate(new _0x105812(0),t,{},[],r);if("color"===this.type)for(var s=_0xe25afc(a),l=o;l<e;l++)n.emplaceBack(s[0],s[1]);else{for(var u=o;u<e;u++)n.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},_0x54f172.prototype.updatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:0},i,r);if("color"===this.type)for(var a=_0xe25afc(o),s=e;s<t;s++)n.emplace(s,a[0],a[1]);else{for(var l=e;l<t;l++)n.emplace(l,o);this.maxValue=Math.max(this.maxValue,o)}},_0x54f172.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=_0x24da5b.toVertexBuffer(e,this.paintVertexArray,this.paintVertexAttributes))},_0x54f172.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},_0x54f172.prototype.setUniforms=function(e,t){t.set(0)},_0x54f172.prototype.getBinding=function(e,t){return new _0xe46c73.Uniform1f(e,t)},_0x54f172.prototype.setUniformMap=function(e,t,i,r){e[t]=function(){return 0}};var _0x1122d=function(e,t,i,r,n,o){this.expression=e,this.names=t,this.uniformNames=this.names.map((function(e){return"u_"+e+"_t"})),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===i?4:2,offset:0}})),this.paintVertexArray=new a};_0x1122d.prototype.defines=function(){return[]},_0x1122d.prototype.setConstantPatternPositions=function(){},_0x1122d.prototype.populatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=n.length;n.reserve(e);var a=this.expression.evaluate(new _0x105812(this.zoom),t,{},[],r),s=this.expression.evaluate(new _0x105812(this.zoom+1),t,{},[],r);if("color"===this.type)for(var l=_0xe25afc(a),u=_0xe25afc(s),c=o;c<e;c++)n.emplaceBack(l[0],l[1],u[0],u[1]);else{for(var h=o;h<e;h++)n.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},_0x1122d.prototype.updatePaintArray=function(e,t,i,r){var n=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},i,r),a=this.expression.evaluate({zoom:this.zoom+1},i,r);if("color"===this.type)for(var s=_0xe25afc(o),l=_0xe25afc(a),u=e;u<t;u++)n.emplace(u,s[0],s[1],l[0],l[1]);else{for(var c=e;c<t;c++)n.emplace(c,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},_0x1122d.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=_0x24da5b.toVertexBuffer(e,this.paintVertexArray,this.paintVertexAttributes))},_0x1122d.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},_0x1122d.prototype.interpolationFactor=function(e){return this.useIntegerZoom&&(e=Math.floor(e)),_0xf13bc6(this.expression.interpolationFactor(e,this.zoom,this.zoom+1),0,1)},_0x1122d.prototype.setUniforms=function(e,t,i){t.set(this.interpolationFactor(i.zoom))},_0x1122d.prototype.getBinding=function(e,t){return new _0xe46c73.Uniform1f(e,t)},_0x1122d.prototype.setUniformMap=function(e,t,i,r){var n=this;e[t]=function(){return n.interpolationFactor(0)}};var _0x295581=function(e,t,i,r,n,o,a){this.expression=e,this.names=t,this.type=i,this.uniformNames=this.names.map((function(e){return"u_"+e+"_t"})),this.useIntegerZoom=r,this.zoom=n,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};_0x295581.prototype.defines=function(){return[]},_0x295581.prototype.setConstantPatternPositions=function(){},_0x295581.prototype.populatePaintArray=function(e,t,i){var r=this.zoomInPaintVertexArray,n=this.zoomOutPaintVertexArray,o=this.layerId,a=r.length;if(r.reserve(e),n.reserve(e),i&&t.patterns&&t.patterns[o]){var s=t.patterns[o],l=s.min,u=s.mid,c=s.max,h=i[l],d=i[u],f=i[c];if(!h||!d||!f)return;for(var p=a;p<e;p++)r.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),n.emplaceBack(d.tl[0],d.tl[1],d.br[0],d.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1])}},_0x295581.prototype.updatePaintArray=function(e,t,i,r,n){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(n&&i.patterns&&i.patterns[s]){var l=i.patterns[s],u=l.min,c=l.mid,h=l.max,d=n[u],f=n[c],p=n[h];if(!d||!f||!p)return;for(var _=e;_<t;_++)o.emplace(_,f.tl[0],f.tl[1],f.br[0],f.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1]),a.emplace(_,f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1])}},_0x295581.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomInPaintVertexArray.length>0&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray.length>0&&(this.zoomInPaintVertexBuffer=_0x24da5b.toVertexBuffer(e,this.zoomInPaintVertexArray,this.paintVertexAttributes),this.zoomOutPaintVertexBuffer=_0x24da5b.toVertexBuffer(e,this.zoomOutPaintVertexArray,this.paintVertexAttributes))},_0x295581.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},_0x295581.prototype.setUniforms=function(e,t){t.set(0)},_0x295581.prototype.getBinding=function(e,t){return new Uniform1f(e,t)},_0x295581.prototype.setUniformMap=function(e,t,i,r){e[t]=function(){return 0}};class _0x15f87a{constructor(){this.binders={},this.cacheKey="",this._buffers=[]}static createDynamic(e,t,i){const r=new _0x15f87a,n=[];for(const o in e.paint._values){if(!i(o))continue;const a=e.paint.get(o);if(!(a instanceof _0x436bfd&&supportsPropertyExpression(a.property.specification)))continue;const s=_0x2630c4(o,e.type),l=a.property.specification.type,u=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)r.binders[o]=new _0x17dbaf(a.value.value,s,l),n.push("/u_"+o);else{const i=_0x417436(o,l,"source");r.binders[o]=new _0x295581(a.value,s,l,u,t,i,e.id),n.push("/a_"+o)}else if("constant"===a.value.kind)r.binders[o]=new _0x447da6(a.value.value,s,l),n.push("/u_"+o);else if("source"===a.value.kind){const e=_0x417436(o,l,"source");r.binders[o]=new _0x54f172(a.value,s,l,e),n.push("/a_"+o)}else{const e=_0x417436(o,l,"composite");r.binders[o]=new _0x1122d(a.value,s,l,u,t,e),n.push("/z_"+o)}}return r.cacheKey=n.sort().join(""),r}populatePaintArrays(e,t,i,r,n){for(const i in this.binders){this.binders[i].populatePaintArray(e,t,r,n)}}setConstantPatternPositions(e,t){for(const i in this.binders){this.binders[i].setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,i,r,n){let o=!1;for(const a in e){const s=t.getPositions(+a);for(const t of s){const s=i.feature(t.index);for(const i in this.binders){const l=this.binders[i];if(!(l instanceof _0x447da6||l instanceof _0x17dbaf)&&!0===l.expression.isStateDependent){const u=r.paint.get(i);l.expression=u.value,l.updatePaintArray(t.start,t.end,s,e[a],n),o=!0}}}}return o}defines(){var e=[];for(var t in this.binders)e.push.apply(e,this.binders[t].defines());return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){const i=[];for(const r in this.binders){const n=this.binders[r];for(const o of n.uniformNames)if(t[o]){const a=n.getBinding(e,t[o]);i.push({name:o,property:r,binding:a})}}return i}setUniforms(e,t,i,r){for(const{name:n,property:o,binding:a}of t)this.binders[o].setUniforms(e,a,r,i.get(o),n)}updatePatternPaintBuffers(e){const t=[];for(const i in this.binders){const r=this.binders[i];if(r instanceof _0x295581){const i=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&t.push(i)}else(r instanceof _0x54f172||r instanceof _0x1122d)&&r.paintVertexBuffer&&t.push(r.paintVertexBuffer)}this._buffers=t}upload(e){for(const t in this.binders)this.binders[t].upload(e);const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof _0x54f172||i instanceof _0x1122d)&&i.paintVertexBuffer&&t.push(i.paintVertexBuffer)}this._buffers=t}getAttributeLocation(){for(var e=0,t={},i=0;i<this.layoutAttributes.length;i++){t[this.layoutAttributes[i].name]=i,e++}for(var r=this.getPaintVertexBuffers(),n=0;r&&n<r.length;n++)for(var o=r[n],a=0;a<o.attributes.length;a++){t[o.attributes[a].name]=e++}return t}getUniformMaps(e,t,i){for(var r in this.binders)for(var n=this.binders[r],o=0,a=n.uniformNames;o<a.length;o+=1){var s=a[o];e[s]&&n.setUniformMap(i,s,r,t)}for(var l in e)!i[l]&&l.indexOf("_t")>-1&&(i[l]=function(){return 0});return i}destroy(){for(const e in this.binders)this.binders[e].destroy()}}class ProgramConfigurationSet{constructor(e,t,i,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=_0x15f87a.createDynamic(n,i,r),this.programConfigurations[n.id].layoutAttributes=e;this.needsUpload=!1,this._featureMap=new _0x2fc30a,this._bufferOffset=0}populatePaintArrays(e,t,i,r,n){for(const o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,i,r,n);void 0!==t.id&&this._featureMap.add(+t.id,i,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function _0x2630c4(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"text-show-background":["show-background"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function _0x286800(e){return{"line-pattern":{source:_0x444640,composite:_0x444640},"fill-pattern":{source:_0x444640,composite:_0x444640},"fill-extrusion-pattern":{source:_0x444640,composite:_0x444640}}[e]}function _0x417436(e,t,i){var r={color:{source:_0xbdbe37,composite:_0x550eed},number:{source:_0x5294b1,composite:_0xbdbe37}},n=_0x286800(e);return n&&n[i]||r[t][i]}_0x36ace8.register("ConstantBinder",_0x447da6),_0x36ace8.register("CrossFadedConstantBinder",_0x17dbaf),_0x36ace8.register("SourceExpressionBinder",_0x54f172),_0x36ace8.register("CrossFadedCompositeBinder",_0x295581),_0x36ace8.register("CompositeExpressionBinder",_0x1122d),_0x36ace8.register("ProgramConfiguration",_0x15f87a,{omit:["_buffers"]}),_0x36ace8.register("ProgramConfigurationSet",ProgramConfigurationSet);var _0x3f109c=(_0x44a302=!0,function(e,t){var i=_0x44a302?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x44a302=!1,i}),_0xdd1170=_0x3f109c(void 0,(function(){return _0xdd1170.toString().search("(((.+)+)+)+$").toString().constructor(_0xdd1170).search("(((.+)+)+)+$")})),_0x44a302;_0xdd1170();var _0x6408c9=(_0x1af6f0=!0,function(e,t){var i=_0x1af6f0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1af6f0=!1,i}),_0x47be2e=_0x6408c9(void 0,(function(){return _0x47be2e.toString().search("(((.+)+)+)+$").toString().constructor(_0x47be2e).search("(((.+)+)+)+$")})),_0x1af6f0;function _0x2f5562(e){var t={},i={},r=[],n=0;function o(t){r.push(e[t]),n++}function a(e,t,n){var o=i[e];return delete i[e],i[t]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function s(e,i,n){var o=t[i];return delete t[i],t[e]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function l(e,t,i){var r=i?t[0][t[0].length-1]:t[0][0];return e+":"+r.x+":"+r.y}for(var u=0;u<e.length;u++){var c=e[u],h=c.geometry,d=c.text?c.text.toString():null;if(d){var f=l(d,h),p=l(d,h,!0);if(f in i&&p in t&&i[f]!==t[p]){var _=s(f,p,h),m=a(f,p,r[_].geometry);delete t[f],delete i[p],i[l(d,r[m].geometry,!0)]=m,r[_].geometry=null}else f in i?a(f,p,h):p in t?s(f,p,h):(o(u),t[f]=n-1,i[p]=n-1)}else o(u)}return r.filter((function(e){return e.geometry}))}_0x47be2e();var _0x12283a=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i,r,n){e.call(this,t,i),this.angle=r,void 0!==n&&(this.segment=n)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)},n}(_0x36c32e);_0x36ace8.register("Anchor",_0x12283a);var _0x49fda7=(_0x3b12a7=!0,function(e,t){var i=_0x3b12a7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3b12a7=!1,i}),_0x4891bc=_0x49fda7(void 0,(function(){return _0x4891bc.toString().search("(((.+)+)+)+$").toString().constructor(_0x4891bc).search("(((.+)+)+)+$")})),_0x3b12a7;_0x4891bc();var _0x44c34e=(_0x3a0d02=!0,function(e,t){var i=_0x3a0d02?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3a0d02=!1,i}),_0x22a807=_0x44c34e(void 0,(function(){return _0x22a807.toString().search("(((.+)+)+)+$").toString().constructor(_0x22a807).search("(((.+)+)+)+$")})),_0x3a0d02;_0x22a807();var _0x1d4be4=(_0x5f43b5=!0,function(e,t){var i=_0x5f43b5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5f43b5=!1,i}),_0x2464c5=_0x1d4be4(void 0,(function(){return _0x2464c5.toString().search("(((.+)+)+)+$").toString().constructor(_0x2464c5).search("(((.+)+)+)+$")})),_0x5f43b5;_0x2464c5();var _0x17ddd8=(_0x60add5=!0,function(e,t){var i=_0x60add5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x60add5=!1,i}),_0x15879a=_0x17ddd8(void 0,(function(){return _0x15879a.toString().search("(((.+)+)+)+$").toString().constructor(_0x15879a).search("(((.+)+)+)+$")})),_0x60add5;_0x15879a();var _0x525f53=(_0x24fe87=!0,function(e,t){var i=_0x24fe87?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x24fe87=!1,i}),_0xb6927=_0x525f53(void 0,(function(){return _0xb6927.toString().search("(((.+)+)+)+$").toString().constructor(_0xb6927).search("(((.+)+)+)+$")})),_0x24fe87;_0xb6927();var _0x2cbc11=(_0x3c5855=!0,function(e,t){var i=_0x3c5855?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3c5855=!1,i}),_0x398393=_0x2cbc11(void 0,(function(){return _0x398393.toString().search("(((.+)+)+)+$").toString().constructor(_0x398393).search("(((.+)+)+)+$")})),_0x3c5855;function _0x279f3d(){}function _0xf05622(e,t,i){if(e.length>1){if(_0xe87a3b(e,t))return!0;for(var r=0;r<t.length;r++)if(_0x51d2d5(t[r],e,i))return!0}for(var n=0;n<e.length;n++)if(_0x51d2d5(e[n],t,i))return!0;return!1}function _0xe87a3b(e,t){if(0===e.length||0===t.length)return!1;for(var i=0;i<e.length-1;i++)for(var r=e[i],n=e[i+1],o=0;o<t.length-1;o++){if(_0x16759b(r,n,t[o],t[o+1]))return!0}return!1}function _0x16759b(e,t,i,r){return isCounterClockwise(e,i,r)!==isCounterClockwise(t,i,r)&&isCounterClockwise(e,t,i)!==isCounterClockwise(e,t,r)}function _0x51d2d5(e,t,i){var r=i*i;if(1===t.length)return e.distSqr(t[0])<r;for(var n=1;n<t.length;n++){var o=t[n-1],a=t[n];if(_0x279f3d.distToSegmentSquared(e,o,a)<r)return!0}return!1}function _0x16e67a(e,t){for(var i,r,n,o=!1,a=0;a<e.length;a++)for(var s=0,l=(i=e[a]).length-1;s<i.length;l=s++)r=i[s],n=i[l],r.y>t.y!=n.y>t.y&&t.x<(n.x-r.x)*(t.y-r.y)/(n.y-r.y)+r.x&&(o=!o);return o}function _0x1c5f24(e,t){for(var i=!1,r=0,n=e.length-1;r<e.length;n=r++){var o=e[r],a=e[n];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}_0x398393(),_0x279f3d.polygonIntersectsPolygon=function(e,t){for(var i=0;i<e.length;i++)if(_0x1c5f24(t,e[i]))return!0;for(var r=0;r<t.length;r++)if(_0x1c5f24(e,t[r]))return!0;return!!_0xe87a3b(e,t)},_0x279f3d.polygonIntersectsBufferedPoint=function(e,t,i){return!!_0x1c5f24(e,t)||!!_0x51d2d5(t,e,i)},_0x279f3d.polygonIntersectsMultiPolygon=function(e,t){if(1===e.length)return _0x16e67a(t,e[0]);for(var i=0;i<t.length;i++)for(var r=t[i],n=0;n<r.length;n++)if(_0x1c5f24(e,r[n]))return!0;for(var o=0;o<e.length;o++)if(_0x16e67a(t,e[o]))return!0;for(var a=0;a<t.length;a++)if(_0xe87a3b(e,t[a]))return!0;return!1},_0x279f3d.polygonIntersectsBufferedMultiLine=function(e,t,i){for(var r=0;r<t.length;r++){var n=t[r];if(e.length>=3)for(var o=0;o<n.length;o++)if(_0x1c5f24(e,n[o]))return!0;if(_0xf05622(e,n,i))return!0}return!1},_0x279f3d.distToSegmentSquared=function(e,t,i){var r=t.distSqr(i);if(0===r)return e.distSqr(t);var n=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/r;return n<0?e.distSqr(t):n>1?e.distSqr(i):e.distSqr(i.sub(t)._mult(n)._add(t))},_0x279f3d.polygonIntersectPoint=function(e,t){return _0x1c5f24(e,t)};var _0x426b24=(_0x5e5b4e=!0,function(e,t){var i=_0x5e5b4e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5e5b4e=!1,i}),_0x42caf4=_0x426b24(void 0,(function(){return _0x42caf4.toString().search("(((.+)+)+)+$").toString().constructor(_0x42caf4).search("(((.+)+)+)+$")})),_0x5e5b4e;function s$O(e,t,i,r,n){x$$(e,t,i||0,r||e.length-1,n||C$S)}function x$$(e,t,i,r,n){for(;r>i;){if(r-i>600){var o=r-i+1,a=t-i+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);x$$(e,t,Math.max(i,Math.floor(t-a*l/o+u)),Math.min(r,Math.floor(t+(o-a)*l/o+u)),n)}var c=e[t],h=i,d=r;for(e$1I(e,i,t),n(e[r],c)>0&&e$1I(e,i,r);h<d;){for(e$1I(e,h,d),h++,d--;n(e[h],c)<0;)h++;for(;n(e[d],c)>0;)d--}0===n(e[i],c)?e$1I(e,i,d):e$1I(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function e$1I(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function C$S(e,t){return e<t?-1:e>t?1:0}_0x42caf4();var _0x5e85e3=(_0x4fe61c=!0,function(e,t){var i=_0x4fe61c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4fe61c=!1,i}),_0x4fea6b=_0x5e85e3(void 0,(function(){return _0x4fea6b.toString().search("(((.+)+)+)+$").toString().constructor(_0x4fea6b).search("(((.+)+)+)+$")})),_0x4fe61c;function _0x16d073(e){for(var t=0,i=0,r=e.length,n=r-1,o=void 0,a=void 0;i<r;n=i++)o=e[i],t+=((a=e[n]).x-o.x)*(o.y+a.y);return t}function _0xf3eac0(e,t){var i=e.length;if(i<=1)return[e];for(var r,n,o=[],a=0;a<i;a++){var s=_0x16d073(e[a]);0!==s&&(e[a].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(r&&o.push(r),r=[e[a]]):r.push(e[a]))}if(r&&o.push(r),t>1)for(var l=0;l<o.length;l++)o[l].length<=t||(s$O(o[l],t,1,o[l].length-1,_0x422980),o[l]=o[l].slice(0,t));return o}function _0x422980(e,t){return t.area-e.area}_0x4fea6b();var _0x27000a=(_0x1f683a=!0,function(e,t){var i=_0x1f683a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1f683a=!1,i}),_0x59abf7=_0x27000a(void 0,(function(){return _0x59abf7.toString().search("(((.+)+)+)+$").toString().constructor(_0x59abf7).search("(((.+)+)+)+$")})),_0x1f683a;_0x59abf7();const _0x422d37=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x101196=_0x422d37(void 0,(function(){return _0x101196.toString().search("(((.+)+)+)+$").toString().constructor(_0x101196).search("(((.+)+)+)+$")}));_0x101196();const _0x3b4137=255,_0xf2ac1b=_0x3b4137*_0x16d38d;var _0xe4b3da=(_0x89f3d9=!0,function(e,t){var i=_0x89f3d9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x89f3d9=!1,i}),_0x4fd64c=_0xe4b3da(void 0,(function(){return _0x4fd64c.toString().search("(((.+)+)+)+$").toString().constructor(_0x4fd64c).search("(((.+)+)+)+$")})),_0x89f3d9;function _0x4ad595(e,t,i){var r=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),e}function _0x5852b7(e,t,i){return e.sections.forEach((function(e){e.text=_0x4ad595(e.text,t,i)})),e}_0x4fd64c();var _0x1eec49=(_0x2113f8=!0,function(e,t){var i=_0x2113f8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2113f8=!1,i}),_0x2daed0=_0x1eec49(void 0,(function(){return _0x2daed0.toString().search("(((.+)+)+)+$").toString().constructor(_0x2daed0).search("(((.+)+)+)+$")})),_0x2113f8;_0x2daed0();var _0x5ac8f5=function(e){this.specification=e};_0x5ac8f5.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},_0x5ac8f5.prototype.interpolate=function(e,t,i){var r=interpolate[this.specification.type];return r?r(e,t,i):e},_0x36ace8.register("DataConstantProperty",_0x5ac8f5);var _0x27ede3=(_0x5b9e71=!0,function(e,t){var i=_0x5b9e71?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5b9e71=!1,i}),_0x556ae6=_0x27ede3(void 0,(function(){return _0x556ae6.toString().search("(((.+)+)+)+$").toString().constructor(_0x556ae6).search("(((.+)+)+)+$")})),_0x5b9e71;_0x556ae6();var _0x237b98=function(e,t){this.specification=e,this.overrides=t};_0x237b98.prototype.possiblyEvaluate=function(e,t,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new _0x436bfd(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i)},t):new _0x436bfd(this,e.expression,t)},_0x237b98.prototype.interpolate=function(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new _0x436bfd(this,{kind:"constant",value:void 0},e.parameters);var r=interpolate[this.specification.type];return r?new _0x436bfd(this,{kind:"constant",value:r(e.value.value,t.value.value,i)},e.parameters):e},_0x237b98.prototype.evaluate=function(e,t,i,r,n){return"constant"===e.kind?e.value:e.evaluate(t,i,r,n)},_0x36ace8.register("DataDrivenProperty",_0x237b98);var _0x1a9b34=(_0x587937=!0,function(e,t){var i=_0x587937?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x587937=!1,i}),_0x415783=_0x1a9b34(void 0,(function(){return _0x415783.toString().search("(((.+)+)+)+$").toString().constructor(_0x415783).search("(((.+)+)+)+$")})),_0x587937;_0x415783();var _0x53b476=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var i=0,r=t;i<r.length;i+=1){var n=r[i],o=n[0],a=n[1];this.bindings[o]=a}};_0x53b476.prototype.concat=function(e){return new _0x53b476(this,e)},_0x53b476.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},_0x53b476.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var _0x56662f=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){e.call(this,i),this.message=i,this.key=t}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n}(Error),_0x35954d=(_0x8b200f=!0,function(e,t){var i=_0x8b200f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x8b200f=!1,i}),_0x235f4a=_0x35954d(void 0,(function(){return _0x235f4a.toString().search("(((.+)+)+)+$").toString().constructor(_0x235f4a).search("(((.+)+)+)+$")})),_0x8b200f;_0x235f4a();var _0x5b0cff=["Unknown","Point","LineString","Polygon"],_0x4b35f4=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null};_0x4b35f4.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},_0x4b35f4.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?_0x5b0cff[this.feature.type]:this.feature.type:null},_0x4b35f4.prototype.properties=function(){return this.feature&&this.feature.properties||{}},_0x4b35f4.prototype.parseColor=function(e){var t=this._parseColorCache[e];return!t&&(t=this._parseColorCache[e]=_0x25bd71.parse(e)),t},_0x36ace8.register("EvaluationContext",_0x4b35f4);var _0x205665=(_0x23e83d=!0,function(e,t){var i=_0x23e83d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x23e83d=!1,i}),_0x22c043=_0x205665(void 0,(function(){return _0x22c043.toString().search("(((.+)+)+)+$").toString().constructor(_0x22c043).search("(((.+)+)+)+$")})),_0x23e83d;function _0x5dc6ed(){}_0x22c043(),_0x5dc6ed.isFeatureConstant=function(e){if(e instanceof _0x43136a.CompoundExpression){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}var t=!0;return e.eachChild((function(e){t&&!_0x5dc6ed.isFeatureConstant(e)&&(t=!1)})),t},_0x5dc6ed.isStateConstant=function(e){if(e instanceof _0x43136a.CompoundExpression&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!_0x5dc6ed.isStateConstant(e)&&(t=!1)})),t},_0x5dc6ed.isGlobalPropertyConstant=function(e,t){if(e instanceof _0x43136a.CompoundExpression&&t.indexOf(e.name)>=0)return!1;var i=!0;return e.eachChild((function(e){i&&!_0x5dc6ed.isGlobalPropertyConstant(e,t)&&(i=!1)})),i};var _0x4d3b4b=(_0x464f51=!0,function(e,t){var i=_0x464f51?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x464f51=!1,i}),_0x17c2d2=_0x4d3b4b(void 0,(function(){return _0x17c2d2.toString().search("(((.+)+)+)+$").toString().constructor(_0x17c2d2).search("(((.+)+)+)+$")})),_0x464f51;_0x17c2d2();var _0x43136a=function(e,t,i,r,n){void 0===t&&(t=[]),void 0===r&&(r=new _0x53b476),void 0===n&&(n=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=r,this.errors=n,this.expectedType=i};function _0x184ab9(e,t){const i=t[e];return void 0===i?null:i}_0x43136a.prototype.parse=function(e,t,i,r,n){return void 0===n&&(n={}),t?this.concat(t,i,r)._parse(e,n):this._parse(e,n)},_0x43136a.prototype._parse=function(e,t){function i(e,t,i){return"assert"===i?new _0x15d5eb(t,[e]):"coerce"===i?new _0x5651e8(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var r=e[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[r];if(n){var o=n.parse(e,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=i(o,a,t.typeAnnotation||"coerce");else o=i(o,a,t.typeAnnotation||"assert")}if(!(o instanceof _0x145078)&&"resolvedImage"!==o.type.kind&&_0x5dc6ed()){var l=new _0x4b35f4;try{o=new _0x145078(o.type,o.evaluate(l))}catch(e){return this.error(e.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},_0x43136a.prototype.concat=function(e,t,i){var r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new _0x43136a(this.registry,r,t||null,n,this.errors)},_0x43136a.prototype.error=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var r=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new _0x56662f(r,e))},_0x43136a.prototype.checkSubtype=function(e,t){var i=_0x1d8d12(e,t);return i&&this.error(i),i};var _0x2dacd4=function(e,t,i,r){this.name=e,this.type=t,this._evaluate=i,this.args=r};function _0x371d1b(e){return Array.isArray(e)?"("+e.map(toString).join(", ")+")":"("+toString(e.type)+"...)"}_0x2dacd4.prototype.evaluate=function(e,t){return this._evaluate(e,this.args,t)},_0x2dacd4.prototype.eachChild=function(e){this.args.forEach(e)},_0x2dacd4.prototype.possibleOutputs=function(){return[void 0]},_0x2dacd4.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},_0x2dacd4.parse=function(e,t){var i,r=e[0],n=_0x2dacd4.definitions[r];if(!n)return t.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=a.filter((function(t){var i=t[0];return!Array.isArray(i)||i.length===e.length-1})),l=null,u=0,c=s;u<c.length;u+=1){var h=c[u],d=h[0],f=h[1];l=new _0x43136a(t.registry,t.path,null,t.scope);for(var p=[],_=!1,m=1;m<e.length;m++){var $=e[m],g=Array.isArray(d)?d[m-1]:d.type,v=l.parse($,1+p.length,g);if(!v){_=!0;break}p.push(v)}if(!_)if(Array.isArray(d)&&d.length!==p.length)l.error("Expected "+d.length+" arguments, but found "+p.length+" instead.");else{for(var y=0;y<p.length;y++){var x=Array.isArray(d)?d[y]:d.type,b=p[y];l.concat(y+1).checkSubtype(x,b.type)}if(0===l.errors.length)return new _0x2dacd4(r,o,f,p)}}if(1===s.length)(i=t.errors).push.apply(i,l.errors);else{for(var w=(s.length?s:a).map((function(e){return _0x371d1b(e[0])})).join(" | "),C=[],T=1;T<e.length;T++){var S=t.parse(e[T],1+C.length);if(!S)return null;C.push(toString(S.type))}t.error("Expected arguments of type "+w+", but found ("+C.join(", ")+") instead.")}return null},_0x2dacd4.register=function(e,t){for(var i in _0x2dacd4.definitions=t,t)e[i]=_0x2dacd4},_0x36ace8.register("CompoundExpression",_0x2dacd4);var _0x9ad28={kind:"number"},_0x455ba7={kind:"string"},_0x4e4bf1={kind:"boolean"},_0x46209b={kind:"color"},_0x288173={kind:"object"},_0x2503d5={kind:"value"},_0x1fc109={kind:"error"},_0x171a1e={kind:"collator"};function _0x4af96c(e,t){return{kind:"array",itemType:e,N:t}}function _0x581d14(e){return{type:e}}function _0xdf8623(e,t){var i=t[0],r=t[1],n=t[2],o=t[3];i=i.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);var a=o?o.evaluate(e):1,s=Values.validateRGBA(i,r,n,a);if(s)throw new RuntimeError(s);return new Color(i/255*a,r/255*a,n/255*a,a)}_0x2dacd4.register(_0x3959b3,{error:[_0x1fc109,[_0x455ba7],function(e,t){var i=t[0];throw new RuntimeError(i.evaluate(e))}],typeof:[_0x455ba7,[_0x2503d5],function(e,t){var i=t[0];return toString(Values.typeOf(i.evaluate(e)))}],"to-rgba":[_0x4af96c(_0x9ad28,4),[_0x46209b],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[_0x46209b,[_0x9ad28,_0x9ad28,_0x9ad28],_0xdf8623],rgba:[_0x46209b,[_0x9ad28,_0x9ad28,_0x9ad28,_0x9ad28],_0xdf8623],has:{type:_0x4e4bf1,overloads:[[[_0x455ba7],function(e,t){var i=t[0];return has(i.evaluate(e),e.properties())}],[[_0x455ba7,_0x288173],function(e,t){var i=t[0],r=t[1];return has(i.evaluate(e),r.evaluate(e))}]]},get:{type:_0x2503d5,overloads:[[[_0x455ba7],function(e,t){return _0x184ab9(t[0].evaluate(e),e.properties())}],[[_0x455ba7,_0x288173],function(e,t){var i=t[0],r=t[1];return _0x184ab9(i.evaluate(e),r.evaluate(e))}]]},"feature-state":[_0x2503d5,[_0x455ba7],function(e,t){return _0x184ab9(t[0].evaluate(e),e.featureState||{})}],properties:[_0x288173,[],function(e){return e.properties()}],"geometry-type":[_0x455ba7,[],function(e){return e.geometryType()}],id:[_0x2503d5,[],function(e){return e.id()}],zoom:[_0x9ad28,[],function(e){return e.globals.zoom}],"heatmap-density":[_0x9ad28,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[_0x9ad28,[],function(e){return e.globals.lineProgress||0}],accumulated:[_0x2503d5,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[_0x9ad28,_0x581d14(_0x9ad28),function(e,t){for(var i=0,r=0,n=t;r<n.length;r+=1){i+=n[r].evaluate(e)}return i}],"*":[_0x9ad28,_0x581d14(_0x9ad28),function(e,t){for(var i=1,r=0,n=t;r<n.length;r+=1){i*=n[r].evaluate(e)}return i}],"-":{type:_0x9ad28,overloads:[[[_0x9ad28,_0x9ad28],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)-r.evaluate(e)}],[[_0x9ad28],function(e,t){return-t[0].evaluate(e)}]]},"/":[_0x9ad28,[_0x9ad28,_0x9ad28],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)/r.evaluate(e)}],"%":[_0x9ad28,[_0x9ad28,_0x9ad28],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)%r.evaluate(e)}],ln2:[_0x9ad28,[],function(){return Math.LN2}],pi:[_0x9ad28,[],function(){return Math.PI}],e:[_0x9ad28,[],function(){return Math.E}],"^":[_0x9ad28,[_0x9ad28,_0x9ad28],function(e,t){var i=t[0],r=t[1];return Math.pow(i.evaluate(e),r.evaluate(e))}],sqrt:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.sqrt(i.evaluate(e))}],log10:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN10}],ln:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.log(i.evaluate(e))}],log2:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.log(i.evaluate(e))/Math.LN2}],sin:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.sin(i.evaluate(e))}],cos:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.cos(i.evaluate(e))}],tan:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.tan(i.evaluate(e))}],asin:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.asin(i.evaluate(e))}],acos:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.acos(i.evaluate(e))}],atan:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.atan(i.evaluate(e))}],min:[_0x9ad28,_0x581d14(_0x9ad28),function(e,t){return Math.min.apply(Math,t.map((function(t){return t.evaluate(e)})))}],max:[_0x9ad28,_0x581d14(_0x9ad28),function(e,t){return Math.max.apply(Math,t.map((function(t){return t.evaluate(e)})))}],abs:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.abs(i.evaluate(e))}],round:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0].evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.floor(i.evaluate(e))}],ceil:[_0x9ad28,[_0x9ad28],function(e,t){var i=t[0];return Math.ceil(i.evaluate(e))}],"filter-==":[_0x4e4bf1,[_0x455ba7,_0x2503d5],function(e,t,i){var r=t[0],n=t[1];if(i){var o,a,s=r.value,l=n.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":o=c+d;break;case"-":o=c-d}return o===(a=n.value)}if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(o="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);a="left"==$?d.substring(0,g):d.substring(d.length-g)}else a=n.value;return o===a}return e.properties()[r.value]===e.properties()[n.value]}return e.properties()[r.value]===n.value}],"filter-id-==":[_0x4e4bf1,[_0x2503d5],function(e,t){var i=t[0];return e.id()===i.value}],"filter-like":[_0x4e4bf1,[_0x455ba7,_0x455ba7],function(e,t){var i=t[0].value,r=t[1].value,n=e.properties();return i in n&&(/^%.*[^%]$/.test(r)?(r=r.replace("%",""),n[i].endsWith(r)):/^(?!%).+%$/.test(r)?(r=r.replace("%",""),n[i].startsWith(r)):(r=r.replace(/%/g,""),n[i].indexOf(r)>-1))}],"filter-type-==":[_0x4e4bf1,[_0x455ba7],function(e,t){var i=t[0];return e.geometryType()===i.value}],"filter-<":[_0x4e4bf1,[_0x455ba7,_0x2503d5],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r<n}],"filter-id-<":[_0x4e4bf1,[_0x2503d5],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[_0x4e4bf1,[_0x455ba7,_0x2503d5],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r>n}],"filter-id->":[_0x4e4bf1,[_0x2503d5],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[_0x4e4bf1,[_0x455ba7,_0x2503d5],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r<=n}],"filter-id-<=":[_0x4e4bf1,[_0x2503d5],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[_0x4e4bf1,[_0x455ba7,_0x2503d5],function(e,t,i){var r,n,o=t[0],a=t[1],s=o.value,l=a.value;if(/(\S*)\s*([+-])\s*(\S*)/.test(s)){var u=s.match(/(\S*)\s*([+-])\s*(\S*)/),c=e.properties()[u[1]],h=u[2],d=e.properties()[u[3]];switch(h){case"+":r=c+d;break;case"-":r=c-d}n=a.value}else if(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(s)){var f=s.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),p=f[1],_=(c=e.properties()[f[2]],f[3]);if(r="left"==p?c.substring(0,_):c.substring(c.length-_),/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/.test(l)){var m=l.match(/^(left|right)\s*\((.+)\s*,\s*(\d+)\)/),$=m[1],g=(d=e.properties()[m[2]],m[3]);n="left"==$?d.substring(0,g):d.substring(d.length-g)}else n=a.value}else r=e.properties()[o.value],n=a.value,i&&(n=e.properties()[n]);return"number"==typeof n&&!isNaN(Number(r))&&(r=Number(r)),typeof r==typeof n&&r>=n}],"filter-id->=":[_0x4e4bf1,[_0x2503d5],function(e,t){var i=t[0],r=e.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[_0x4e4bf1,[_0x2503d5],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[_0x4e4bf1,[],function(e){return null!==e.id()}],"filter-type-in":[_0x4e4bf1,[_0x4af96c(_0x455ba7)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[_0x4e4bf1,[_0x4af96c(_0x2503d5)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[_0x4e4bf1,[_0x455ba7,_0x4af96c(_0x2503d5)],function(e,t){var i=t[0];return t[1].value.indexOf(e.properties()[i.value])>=0}],"filter-in-large":[_0x4e4bf1,[_0x455ba7,_0x4af96c(_0x2503d5)],function(e,t){var i=t[0],r=t[1];return binarySearch(e.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:_0x4e4bf1,overloads:[[[_0x4e4bf1,_0x4e4bf1],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)&&r.evaluate(e)}],[_0x581d14(_0x4e4bf1),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(!r[i].evaluate(e))return!1}return!0}]]},crossFields:{type:_0x4e4bf1,overloads:[[[_0x4e4bf1,_0x4e4bf1],function(e,t){var i=t[0],r=t[1];return i.evaluate(e,!0)&&r.evaluate(e,!0)}],[_0x581d14(_0x4e4bf1),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(!r[i].evaluate(e,!0))return!1}return!0}]]},any:{type:_0x4e4bf1,overloads:[[[_0x4e4bf1,_0x4e4bf1],function(e,t){var i=t[0],r=t[1];return i.evaluate(e)||r.evaluate(e)}],[_0x581d14(_0x4e4bf1),function(e,t){for(var i=0,r=t;i<r.length;i+=1){if(r[i].evaluate(e))return!0}return!1}]]},"!":[_0x4e4bf1,[_0x4e4bf1],function(e,t,i){return!t[0].evaluate(e,i)}],"is-supported-script":[_0x4e4bf1,[_0x455ba7],function(e,t){var i=t[0],r=e.globals&&e.globals.isSupportedScript;return!r||r(i.evaluate(e))}],upcase:[_0x455ba7,[_0x455ba7],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[_0x455ba7,[_0x455ba7],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[_0x455ba7,_0x581d14(_0x2503d5),function(e,t){return t.map((function(t){return Values.toString$1(t.evaluate(e))})).join("")}],"resolved-locale":[_0x455ba7,[_0x171a1e],function(e,t){return t[0].evaluate(e).resolvedLocale()}]}),_0x43136a.CompoundExpression=_0x2dacd4;var _0x3e2dcc=(_0x2f4ae0=!0,function(e,t){var i=_0x2f4ae0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2f4ae0=!1,i}),_0x1d5bd8=_0x3e2dcc(void 0,(function(){return _0x1d5bd8.toString().search("(((.+)+)+)+$").toString().constructor(_0x1d5bd8).search("(((.+)+)+)+$")})),_0x2f4ae0;_0x1d5bd8();var _0x525ab0=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new _0x4b35f4,this._defaultValue=t?_0x470dd3(t):null,this._enumValues=t&&"enum"===t.type?t.values:null};function _0xa7988b(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function _0x470dd3(e){return"color"===e.type&&_0xa7988b(e.default)?new _0x25bd71(0,0,0,0):"color"===e.type?_0x25bd71.parse(e.default)||null:void 0===e.default?null:e.default}_0x525ab0.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},_0x525ab0.prototype.evaluate=function(e,t,i,r,n){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=n||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new RuntimeError("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(e){return!this._warningHistory[e.message]&&(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}},_0x36ace8.register("StyleExpression",_0x525ab0);var _0x3d398c=(_0x12d6c2=!0,function(e,t){var i=_0x12d6c2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x12d6c2=!1,i}),_0x45f5a6=_0x3d398c(void 0,(function(){return _0x45f5a6.toString().search("(((.+)+)+)+$").toString().constructor(_0x45f5a6).search("(((.+)+)+)+$")})),_0x12d6c2;function _0x384364(){}function _0x40fccc(e){return{result:"success",value:e}}function _0x232ba8(e){return{result:"error",value:e}}_0x45f5a6(),_0x384364.isExpression=function(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in _0x3959b3};var _0x5bb876={kind:"number"},_0x4ccd03={kind:"string"},_0x1c532e={kind:"boolean"},_0x293ea2={kind:"color"},_0xca8f43={kind:"value"},_0x19a14f={kind:"formatted"},_0x5e22bb={kind:"resolvedImage"};function _0x4c3d50(e,t){return{kind:"array",itemType:e,N:t}}function _0x56eb11(e){var t=null;if(e instanceof _0x15b4dd)t=_0x56eb11(e.result);else if(e instanceof _0x436b79){for(var i of e.args)if(t=_0x56eb11(i))break}else(e instanceof _0x3f7c1e||e instanceof _0x1053c6)&&e.input instanceof _0x43136a.CompoundExpression&&"zoom"===e.input.name&&(t=e);return t instanceof _0x56662f||e.eachChild((e=>{var i=_0x56eb11(e);i instanceof _0x56662f?t=i:!t&&i?t=new _0x56662f("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&i&&t!==i&&(t=new _0x56662f("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function _0x217f39(e){var t={color:_0x293ea2,string:_0x4ccd03,number:_0x5bb876,enum:_0x4ccd03,boolean:_0x1c532e,formatted:_0x19a14f,resolvedImage:_0x5e22bb};return"array"===e.type?_0x4c3d50(t[e.value]||_0xca8f43,e.length):t[e.type]}function _0x2a0848(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function _0x37d46c(e){return e}function _0x157167(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];for(var r=0,n=t;r<n.length;r+=1){var o=n[r];for(var a in o)e[a]=o[a]}return e}function _0x20079a(e,t,i){var r=void 0!==e.base?e.base:1;if("number"!==_0x507164(i))return _0x132ce4(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];var o=_0x3fde74(e.stops.map((e=>e[0])),i),a=_0x541ba3(i,r,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1],u=interpolate[t.type]||_0x37d46c;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=colorSpaces[e.colorSpace];u=(e,t)=>c.reverse(c.interpolate(c.forward(e),c.forward(t),a))}return"function"==typeof s.evaluate?{evaluate(...e){var t=s.evaluate.apply(void 0,e),i=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return u(t,i,a)}}:u(s,l,a)}function _0x22db2a(e,t,i){return"color"===t.type?i=_0x25bd71.parse(i):"formatted"===t.type?i=Formatted.fromString(i.toString()):"resolvedImage"===t.type?i=ResolvedImage.fromString(i.toString()):_0x507164(i)!==t.type&&("enum"!==t.type||!t.values[i])&&(i=void 0),_0x132ce4(i,e.default,t.default)}function _0x51220c(e,t){var i=new _0x43136a(_0x3959b3,[],t?_0x217f39(t):void 0),r=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?_0x40fccc(new _0x525ab0(r,t)):_0x232ba8(i.errors)}function _0xd3ef62(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!_0x5dc6ed.isStateConstant(t.expression)}function _0x5409e0(e,t,i,r){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!_0x5dc6ed.isStateConstant(t.expression),this.interpolationType=r}function _0x37a664(e,t){if("error"===(e=_0x51220c(e,t)).result)return e;var i=e.value.expression,r=_0x5dc6ed.isFeatureConstant(i);if(!r&&!supportsPropertyExpression(t))return _0x232ba8([new _0x56662f("","data expressions not supported")]);var n=_0x5dc6ed.isGlobalPropertyConstant(i,["zoom"]);if(!n&&!supportsZoomExpression(t))return _0x232ba8([new _0x56662f("","zoom expressions not supported")]);var o=_0x56eb11(i);if(!o&&!n)return _0x232ba8([new _0x56662f("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof _0x56662f)return _0x232ba8([o]);if(o instanceof _0x1053c6&&!supportsInterpolation(t))return _0x232ba8([new _0x56662f("",'"interpolate" expressions cannot be used with this property')]);if(!o)return _0x40fccc(new _0xd3ef62(r?"constant":"source",e.value));var a=o instanceof _0x1053c6?o.interpolation:void 0;return _0x40fccc(new _0x5409e0(r?"camera":"composite",e.value,o.labels,a))}function _0x4c6b22(e,t){var i,r,n,o="color"===t.type,a=e.stops&&"object"==typeof e.stops[0][0],s=a||void 0!==e.property,l=a||!s,u=e.type||(supportsInterpolation(t)?"exponential":"interval");if(o&&((e=_0x157167({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],_0x25bd71.parse(e[1])]}))),e.default?e.default=_0x25bd71.parse(e.default):e.default=_0x25bd71.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!colorSpaces[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===u)i=_0x20079a;else if("interval"===u)i=evaluateIntervalFunction;else if("categorical"===u){i=evaluateCategoricalFunction,r=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var d=h[c];r[d[0]]=d[1]}n=typeof e.stops[0][0]}else{if("identity"!==u)throw new Error('Unknown function type "'+u+'"');i=_0x22db2a}if(a){for(var f={},p=[],_=0;_<e.stops.length;_++){var m=e.stops[_],$=m[0].zoom;void 0===f[$]&&(f[$]={zoom:$,type:e.type,property:e.property,default:e.default,stops:[]},p.push($)),f[$].stops.push([m[0].value,m[1]])}for(var g=[],v=0,y=p;v<y.length;v+=1){var x=y[v];g.push([f[x].zoom,_0x4c6b22(f[x],t)])}var b={name:"linear"};return{kind:"composite",interpolationType:b,interpolationFactor:_0x1053c6.interpolationFactor.bind(void 0,b),zoomStops:g.map((function(e){return e[0]})),evaluate:function(i,r){var n=i.zoom;return _0x20079a({stops:g,base:e.base},t,n).evaluate(n,r)}}}if(l){var w="exponential"===u?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:_0x1053c6.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(e){return e[0]})),evaluate:function(o){var a=o.zoom;return i(e,t,a,r,n)}}}return{kind:"source",evaluate:function(o,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?_0x132ce4(e.default,t.default):i(e,t,s,r,n)}}}function _0x132ce4(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function _0x541ba3(e,t,i,r){var n=r-i,o=e-i;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}_0x384364.createExpression=function(e,t){var i=new _0x43136a(_0x3959b3,[],t?_0x217f39(t):void 0),r=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return r?_0x40fccc(new _0x525ab0(r,t)):_0x232ba8(i.errors)},_0xd3ef62.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)},_0xd3ef62.prototype.evaluate=function(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)},_0x36ace8.register("ZoomConstantExpression",_0xd3ef62),_0x5409e0.prototype.evaluateWithoutErrorHandling=function(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)},_0x5409e0.prototype.evaluate=function(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)},_0x5409e0.prototype.interpolationFactor=function(e,t,i){return this.interpolationType?_0x1053c6.interpolationFactor(this.interpolationType,e,t,i):0},_0x36ace8.register("ZoomDependentExpression",_0x5409e0);var _0xbec6d2=function(e,t){this._parameters=e,this._specification=t,_0x157167(this,_0x4c6b22(this._parameters,this._specification))};function _0x507164(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}_0xbec6d2.deserialize=function(e){return new _0xbec6d2(e._parameters,e._specification)},_0xbec6d2.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}},_0x36ace8.register("StylePropertyFunction",_0xbec6d2),_0x384364.normalizePropertyExpression=function(e,t){if(_0x2a0848(e))return new _0xbec6d2(e,t);if(_0x384364.isExpression(e)){var i=_0x37a664(e,t);if("error"===i.result)throw new Error(i.value.map((function(e){return e.key+": "+e.message})).join(", "));return i.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=_0x25bd71.parse(e)),{kind:"constant",evaluate:function(){return r}}};var _0x506a84=(_0x1e97f7=!0,function(e,t){var i=_0x1e97f7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1e97f7=!1,i}),_0x26ad36=_0x506a84(void 0,(function(){return _0x26ad36.toString().search("(((.+)+)+)+$").toString().constructor(_0x26ad36).search("(((.+)+)+)+$")})),_0x1e97f7;_0x26ad36();var _0x2b0096=function(e,t){this.property=e,this.value=t,this.expression=_0x384364.normalizePropertyExpression(void 0===t?e.specification.default:t,e.specification)};_0x2b0096.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},_0x2b0096.prototype.possiblyEvaluate=function(e,t){return this.property.possiblyEvaluate(this,e,t)};var _0x571300=(_0x21ba60=!0,function(e,t){var i=_0x21ba60?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21ba60=!1,i}),_0x54769d=_0x571300(void 0,(function(){return _0x54769d.toString().search("(((.+)+)+)+$").toString().constructor(_0x54769d).search("(((.+)+)+)+$")})),_0x21ba60;function _0x278543(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}_0x54769d();var _0x125d9f=function(e,t,i,r,n){this.property=e,this.value=t,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=i)};_0x125d9f.prototype.possiblyEvaluate=function(e,t){var i=e.now||0,r=this.value.possiblyEvaluate(e,t),n=this.prior;if(n){if(i>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(i<this.begin)return n.possiblyEvaluate(e,t);var o=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(e,t),r,_0x278543(o))}return r};var _0x1cd629=(_0x38e690=!0,function(e,t){var i=_0x38e690?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x38e690=!1,i}),_0x52cfa9=_0x1cd629(void 0,(function(){return _0x52cfa9.toString().search("(((.+)+)+)+$").toString().constructor(_0x52cfa9).search("(((.+)+)+)+$")})),_0x38e690;_0x52cfa9();var _0x29f7bb=function(e){this.property=e,this.value=new _0x2b0096(e,void 0)};_0x29f7bb.prototype.transitioned=function(e,t){return new _0x125d9f(this.property,this.value,t,extend$1({},e.transition,this.transition),e.now)},_0x29f7bb.prototype.untransitioned=function(){return new _0x125d9f(this.property,this.value,null,{},0)};var _0x1262bf=(_0x14b46e=!0,function(e,t){var i=_0x14b46e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x14b46e=!1,i}),_0x52d6cb=_0x1262bf(void 0,(function(){return _0x52d6cb.toString().search("(((.+)+)+)+$").toString().constructor(_0x52d6cb).search("(((.+)+)+)+$")})),_0x14b46e;_0x52d6cb();var _0x5a6206=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var i=e[t];i.specification.overridable&&this.overridableProperties.push(t);var r=this.defaultPropertyValues[t]=new _0x2b0096(i,void 0),n=this.defaultTransitionablePropertyValues[t]=new _0x29f7bb(i);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}},_0x4301a7=(_0xb55d26=!0,function(e,t){var i=_0xb55d26?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xb55d26=!1,i}),_0x50582b=_0x4301a7(void 0,(function(){return _0x50582b.toString().search("(((.+)+)+)+$").toString().constructor(_0x50582b).search("(((.+)+)+)+$")})),_0xb55d26;_0x50582b();var _0x55f3af=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};_0x55f3af.prototype.get=function(e){return this._values[e]};var _0x404e74=(_0x3cc313=!0,function(e,t){var i=_0x3cc313?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3cc313=!1,i}),_0x5af031=_0x404e74(void 0,(function(){return _0x5af031.toString().search("(((.+)+)+)+$").toString().constructor(_0x5af031).search("(((.+)+)+)+$")})),_0x3cc313;_0x5af031();var _0x4549c5=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};_0x4549c5.prototype.getValue=function(e){return clone(this._values[e].value)},_0x4549c5.prototype.setValue=function(e,t){this._values[e]=new _0x2b0096(this._values[e].property,null===t?void 0:clone(t))},_0x4549c5.prototype.serialize=function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n)}return e},_0x4549c5.prototype.possiblyEvaluate=function(e,t){for(var i=new _0x55f3af(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].possiblyEvaluate(e,t)}return i};var _0x1829e1=(_0x22deb1=!0,function(e,t){var i=_0x22deb1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x22deb1=!1,i}),_0x8367c8=_0x1829e1(void 0,(function(){return _0x8367c8.toString().search("(((.+)+)+)+$").toString().constructor(_0x8367c8).search("(((.+)+)+)+$")})),_0x22deb1;_0x8367c8();var _0x18bd6f=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};_0x18bd6f.prototype.possiblyEvaluate=function(e,t){for(var i=new _0x55f3af(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].possiblyEvaluate(e,t)}return i},_0x18bd6f.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var i=t[e];if(this._values[i].prior)return!0}return!1};var _0x3b60c6=(_0x47688d=!0,function(e,t){var i=_0x47688d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x47688d=!1,i}),_0x525aa6=_0x3b60c6(void 0,(function(){return _0x525aa6.toString().search("(((.+)+)+)+$").toString().constructor(_0x525aa6).search("(((.+)+)+)+$")})),_0x47688d;_0x525aa6();var _0x4deea9=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};_0x4deea9.prototype.getValue=function(e){return clone(this._values[e].value.value)},_0x4deea9.prototype.setValue=function(e,t){!this._values.hasOwnProperty(e)&&(this._values[e]=new _0x29f7bb(this._values[e].property)),this._values[e].value=new _0x2b0096(this._values[e].property,null===t?void 0:clone(t))},_0x4deea9.prototype.getTransition=function(e){return clone(this._values[e].transition)},_0x4deea9.prototype.setTransition=function(e,t){!this._values.hasOwnProperty(e)&&(this._values[e]=new _0x29f7bb(this._values[e].property)),this._values[e].transition=clone(t)||void 0},_0x4deea9.prototype.serialize=function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n);var o=this.getTransition(r);void 0!==o&&(e[r+"-transition"]=o)}return e},_0x4deea9.prototype.transitioned=function(e,t){for(var i=new _0x18bd6f(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var o=n[r];i._values[o]=this._values[o].transitioned(e,t._values[o])}return i},_0x4deea9.prototype.untransitioned=function(){for(var e=new _0x18bd6f(this._properties),t=0,i=Object.keys(this._values);t<i.length;t+=1){var r=i[t];e._values[r]=this._values[r].untransitioned()}return e};var _0x19fc54=(_0x1cc295=!0,function(e,t){var i=_0x1cc295?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1cc295=!1,i}),_0x51189e=_0x19fc54(void 0,(function(){return _0x51189e.toString().search("(((.+)+)+)+$").toString().constructor(_0x51189e).search("(((.+)+)+)+$")})),_0x1cc295;_0x51189e();var _0x50af33="-transition";function _0x5ad949(e,t){if(this.id=e.id,this.type=e.type,"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new _0x4549c5(t.layout)),t.paint)){for(var i in this._transitionablePaint=new _0x4deea9(t.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}}_0x5ad949.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},_0x5ad949.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},_0x5ad949.prototype.setLayoutProperty=function(e,t,i){if(null!=t)this.id;if("visibility"===e)return this.visibility=t,void(this.config&&this.config.layout&&(this.config.layout.visibility=t));this._unevaluatedLayout.setValue(e,t)},_0x5ad949.prototype.getPaintProperty=function(e){return endsWith(e,_0x50af33)?this._transitionablePaint.getTransition(e.slice(0,-_0x50af33.length)):this._transitionablePaint.getValue(e)},_0x5ad949.prototype.setPaintProperty=function(e,t,i){if(null!=t)this.id;if(endsWith(e,_0x50af33))return this._transitionablePaint.setTransition(e.slice(0,-_0x50af33.length),t||void 0),!1;var r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var s=this._transitionablePaint._values[e].value;return s.isDataDriven()||o||n||this._handleOverridablePaintPropertyUpdate(e,a,s)},_0x5ad949.prototype._handleSpecialPaintPropertyUpdate=function(e){},_0x5ad949.prototype._handleOverridablePaintPropertyUpdate=function(e,t,i){return!1},_0x5ad949.prototype.isHidden=function(e){return!!(this.minzoom&&e<this.minzoom)||(!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility)},_0x5ad949.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},_0x5ad949.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},_0x5ad949.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,t)},_0x5ad949.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),filterObject(e,(function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)}))},_0x5ad949.prototype._validate=function(e,t,i,r,n){return!0},_0x5ad949.prototype.is3D=function(){return!1},_0x5ad949.prototype.isTileClipped=function(){return!1},_0x5ad949.prototype.hasOffscreenPass=function(){return!1},_0x5ad949.prototype.resize=function(){},_0x5ad949.prototype.isStateDependent=function(){return!0};var _0x2af4b3=(_0x4edf48=!0,function(e,t){var i=_0x4edf48?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4edf48=!1,i}),_0x37f67b=_0x2af4b3(void 0,(function(){return _0x37f67b.toString().search("(((.+)+)+)+$").toString().constructor(_0x37f67b).search("(((.+)+)+)+$")})),_0x4edf48;_0x37f67b();var _0x33bb0a=8,_0x53f62e={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},_0x3b2971={"*":{type:"source"}},_0x24bdba=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],_0x37933e={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},_0x315d3e={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},_0x1270ca={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},_0x2360d5={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},_0x800ec9={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},_0x1c5b6d={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},_0x4718a3={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},_0x2295a0=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],_0x193ded={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x4858e0={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0xd90aea={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x13cafa={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x26310b={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x1148af={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x4ff95c={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x40cb98={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},_0x595b03={type:"array",value:"*"},_0x5d130d={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},_0x40e94d={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},_0x4e6292={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},_0x33663b={type:"array",value:"*",minimum:1},_0x418f3b={type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},_0x51c680={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},_0x59923e=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],_0x25b067={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},_0x405477={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},_0x42b581={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},_0x5264f8={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_0x4871a2={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-show-background":{type:"boolean",default:!1,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},_0x75ddf5={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_0x1cb968={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_0x58a786={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},_0x462904={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},_0x337989={$version:_0x33bb0a,$root:_0x53f62e,sources:_0x3b2971,source:_0x24bdba,source_vector:_0x37933e,source_raster:_0x315d3e,source_raster_dem:_0x1270ca,source_geojson:_0x2360d5,source_video:_0x800ec9,source_image:_0x1c5b6d,layer:_0x4718a3,layout:_0x2295a0,layout_background:_0x193ded,layout_fill:_0x4858e0,layout_circle:_0xd90aea,layout_heatmap:_0x13cafa,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:_0x26310b,layout_symbol:_0x1148af,layout_raster:_0x4ff95c,layout_hillshade:_0x40cb98,filter:_0x595b03,filter_operator:_0x5d130d,geometry_type:_0x40e94d,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:_0x4e6292,expression:_0x33663b,expression_name:_0x418f3b,light:_0x51c680,paint:_0x59923e,paint_fill:_0x25b067,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:_0x405477,paint_circle:_0x42b581,paint_heatmap:_0x5264f8,paint_symbol:_0x4871a2,paint_raster:_0x75ddf5,paint_hillshade:_0x1cb968,paint_background:_0x58a786,transition:_0x462904,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},_0x2b2718=(_0x328f35=!0,function(e,t){var i=_0x328f35?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x328f35=!1,i}),_0x4440f5=_0x2b2718(void 0,(function(){return _0x4440f5.toString().search("(((.+)+)+)+$").toString().constructor(_0x4440f5).search("(((.+)+)+)+$")})),_0x328f35;function _0x554422(e,t){return t.replace(/{([^{}]+)}/g,((t,i)=>i in e?String(e[i]):""))}_0x4440f5();var _0x214e8e={kind:"color"},_0x3b0716={kind:"formatted"},_0x246146=new _0x5a6206({"symbol-placement":new _0x5ac8f5(_0x337989.layout_symbol["symbol-placement"]),"symbol-spacing":new _0x5ac8f5(_0x337989.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new _0x5ac8f5(_0x337989.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new _0x237b98(_0x337989.layout_symbol["symbol-sort-key"]),"symbol-z-order":new _0x5ac8f5(_0x337989.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new _0x5ac8f5(_0x337989.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new _0x5ac8f5(_0x337989.layout_symbol["icon-ignore-placement"]),"icon-optional":new _0x5ac8f5(_0x337989.layout_symbol["icon-optional"]),"icon-rotation-alignment":new _0x5ac8f5(_0x337989.layout_symbol["icon-rotation-alignment"]),"icon-size":new _0x237b98(_0x337989.layout_symbol["icon-size"]),"icon-text-fit":new _0x5ac8f5(_0x337989.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new _0x5ac8f5(_0x337989.layout_symbol["icon-text-fit-padding"]),"icon-image":new _0x237b98(_0x337989.layout_symbol["icon-image"]),"icon-rotate":new _0x237b98(_0x337989.layout_symbol["icon-rotate"]),"icon-padding":new _0x5ac8f5(_0x337989.layout_symbol["icon-padding"]),"icon-keep-upright":new _0x5ac8f5(_0x337989.layout_symbol["icon-keep-upright"]),"icon-offset":new _0x237b98(_0x337989.layout_symbol["icon-offset"]),"icon-anchor":new _0x237b98(_0x337989.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new _0x5ac8f5(_0x337989.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new _0x5ac8f5(_0x337989.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new _0x5ac8f5(_0x337989.layout_symbol["text-rotation-alignment"]),"text-field":new _0x237b98(_0x337989.layout_symbol["text-field"]),"text-font":new _0x237b98(_0x337989.layout_symbol["text-font"]),"text-size":new _0x237b98(_0x337989.layout_symbol["text-size"]),"text-max-width":new _0x237b98(_0x337989.layout_symbol["text-max-width"]),"text-line-height":new _0x5ac8f5(_0x337989.layout_symbol["text-line-height"]),"text-letter-spacing":new _0x237b98(_0x337989.layout_symbol["text-letter-spacing"]),"text-justify":new _0x237b98(_0x337989.layout_symbol["text-justify"]),"text-radial-offset":new _0x237b98(_0x337989.layout_symbol["text-radial-offset"]),"text-variable-anchor":new _0x5ac8f5(_0x337989.layout_symbol["text-variable-anchor"]),"text-anchor":new _0x237b98(_0x337989.layout_symbol["text-anchor"]),"text-max-angle":new _0x5ac8f5(_0x337989.layout_symbol["text-max-angle"]),"text-writing-mode":new _0x5ac8f5(_0x337989.layout_symbol["text-writing-mode"]),"text-rotate":new _0x237b98(_0x337989.layout_symbol["text-rotate"]),"text-padding":new _0x5ac8f5(_0x337989.layout_symbol["text-padding"]),"text-keep-upright":new _0x5ac8f5(_0x337989.layout_symbol["text-keep-upright"]),"text-transform":new _0x237b98(_0x337989.layout_symbol["text-transform"]),"text-offset":new _0x237b98(_0x337989.layout_symbol["text-offset"]),"text-allow-overlap":new _0x5ac8f5(_0x337989.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new _0x5ac8f5(_0x337989.layout_symbol["text-ignore-placement"]),"text-optional":new _0x5ac8f5(_0x337989.layout_symbol["text-optional"])}),_0x4de9f4=new _0x5a6206({"icon-opacity":new _0x237b98(_0x337989.paint_symbol["icon-opacity"]),"icon-color":new _0x237b98(_0x337989.paint_symbol["icon-color"]),"icon-halo-color":new _0x237b98(_0x337989.paint_symbol["icon-halo-color"]),"icon-halo-width":new _0x237b98(_0x337989.paint_symbol["icon-halo-width"]),"icon-halo-blur":new _0x237b98(_0x337989.paint_symbol["icon-halo-blur"]),"icon-translate":new _0x5ac8f5(_0x337989.paint_symbol["icon-translate"]),"icon-translate-anchor":new _0x5ac8f5(_0x337989.paint_symbol["icon-translate-anchor"]),"text-opacity":new _0x237b98(_0x337989.paint_symbol["text-opacity"]),"text-color":new _0x237b98(_0x337989.paint_symbol["text-color"],{runtimeType:_0x214e8e,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new _0x237b98(_0x337989.paint_symbol["text-halo-color"]),"text-halo-width":new _0x237b98(_0x337989.paint_symbol["text-halo-width"]),"text-halo-blur":new _0x237b98(_0x337989.paint_symbol["text-halo-blur"]),"text-show-background":new _0x237b98(_0x337989.paint_symbol["text-show-background"]),"text-translate":new _0x5ac8f5(_0x337989.paint_symbol["text-translate"]),"text-translate-anchor":new _0x5ac8f5(_0x337989.paint_symbol["text-translate-anchor"])}),_0x176065={paint:_0x4de9f4,layout:_0x246146},_0x53295d=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,_0x176065)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.recalculate=function(t,i){if(e.prototype.recalculate.call(this,t,i),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"line"==this.layout.get("symbol-placement")&&"viewport"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],o=0,a=r;o<a.length;o+=1){var s=a[o];n.indexOf(s)<0&&n.push(s)}this.layout._values["text-writing-mode"]=n}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},n.prototype.getValueAndResolveTokens=function(e,t,i){var r=this.layout.get(e).evaluate(t,{},i),n=this._unevaluatedLayout._values[e];return n.isDataDriven()||_0x384364.isExpression(n.value)||!r?r:_0x554422(t.properties,r)},n.prototype.createBucket=function(e){return new _0x132061(e)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a){return _0x279f3d.polygonIntersectPoint(e,r[0][0])},n.prototype._setPaintOverrides=function(){for(var e=0,t=_0x176065.paint.overridableProperties;e<t.length;e+=1){var i=t[e];if(n.hasPaintOverride(this.layout,i)){var r=this.paint.get(i);new FormatSectionOverride(r);"constant"===r.value.kind||r.value.kind,this.paint._values[i]=new PossiblyEvaluatedPropertyValue(r.property,null,r.parameters)}}},n.prototype._handleOverridablePaintPropertyUpdate=function(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&n.hasPaintOverride(this.layout,e)},n.hasPaintOverride=function(e,t){var i=e.get("text-field"),r=_0x176065.paint.properties[t],n=!1,o=function(e){for(var t=0,i=e;t<i.length;t+=1){var o=i[t];if(r.overrides&&r.overrides.hasOverride(o))return void(n=!0)}};if("constant"===i.value.kind&&i.value.value instanceof _0x270dad)o(i.value.value.sections);else if("source"===i.value.kind){var a=function(e){if(!n)if(e instanceof _0x145078&&_0x3fe53c.typeOf(e.value)===_0x3b0716){var t=e.value;o(t.sections)}else e instanceof _0x409fda?o(e.sections):e.eachChild(a)},s=i.value;s._styleExpression&&a(s._styleExpression.expression)}return n},n.hasPaintOverrides=function(e){for(var t=0,i=_0x176065.paint.overridableProperties;t<i.length;t+=1){var r=i[t];if(n.hasPaintOverride(e,r))return!0}return!1},n}(_0x5ad949),_0x56a0e6=(_0x4a3100=!0,function(e,t){var i=_0x4a3100?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4a3100=!1,i}),_0x22649d=_0x56a0e6(void 0,(function(){return _0x22649d.toString().search("(((.+)+)+)+$").toString().constructor(_0x22649d).search("(((.+)+)+)+$")})),_0x4a3100;_0x22649d();var _0xd36bf4=["Unknown","Point","LineString","Polygon"],_0x5c4214=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function _0x374951(e,t,i,r,n,o,a,s,l,u,c,h,d){var f=s?Math.min(_0xf2ac1b,Math.round(s[0])):0,p=s?Math.min(_0xf2ac1b,Math.round(s[1])):0;e.emplaceBack(t,i,Math.round(32*r),Math.round(32*n),o,a,(f<<1)+(l?1:0),p,16*u,16*c,256*h,256*d)}function _0x2a28fa(e,t,i){e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i)}function _0x3ee4d6(e){for(var t=0,i=e.sections;t<i.length;t+=1){if(stringContainsRTLText(i[t].text))return!0}return!1}var _0x4638e1=function(e){this.layoutVertexArray=new _0x3647fd,this.indexArray=new _0x1e1a35,this.programConfigurations=e,this.segments=new _0x33528b,this.dynamicLayoutVertexArray=new _0xb4453,this.opacityVertexArray=new _0x5a12c6,this.placedSymbolArray=new _0x11131b};_0x4638e1.prototype.upload=function(e,t,i,r){i&&(this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=_0x24da5b.toVertexBuffer(e,this.layoutVertexArray,symbolLayoutAttributes.members)),this.indexArray.length>0&&(this.indexBuffer=_0x24da5b.toIndexBuffer(e,this.indexArray,t)),this.dynamicLayoutVertexArray.length>0&&(this.dynamicLayoutVertexBuffer=_0x24da5b.toVertexBuffer(e,this.dynamicLayoutVertexArray,dynamicLayoutAttributes.members,!0)),this.opacityVertexArray.length>0&&(this.opacityVertexBuffer=_0x24da5b.toVertexBuffer(e,this.opacityVertexArray,_0x5c4214,!0),this.opacityVertexBuffer.itemSize=1)),(i||r)&&this.programConfigurations.upload(e)},_0x4638e1.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.layoutVertexBuffer=null),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=null),this.dynamicLayoutVertexBuffer&&(this.dynamicLayoutVertexBuffer.destroy(),this.dynamicLayoutVertexBuffer=null),this.opacityVertexBuffer&&(this.opacityVertexBuffer.destroy(),this.opacityVertexBuffer=null),this.programConfigurations.destroy(),this.segments.destroy()},_0x4638e1.prototype.clear=function(){},_0x36ace8.register("SymbolBuffers",_0x4638e1);var _0x519d14=function(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new _0x33528b,this.collisionVertexArray=new _0x19b8be};_0x519d14.prototype.upload=function(e){this.layoutVertexArray.length>0&&(this.layoutVertexBuffer=_0x24da5b.toVertexBuffer(e,this.layoutVertexArray,this.layoutAttributes)),this.indexArray.length>0&&(this.indexBuffer=_0x24da5b.toIndexBuffer(e,this.indexArray)),this.collisionVertexArray.length>0&&(this.collisionVertexBuffer=_0x24da5b.toVertexBuffer(e,this.collisionVertexArray,collisionVertexAttributes.members,!0))},_0x519d14.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.layoutVertexBuffer=null),this.collisionVertexBuffer&&(this.collisionVertexBuffer.destroy(),this.collisionVertexBuffer=null),this.indexBuffer&&(this.indexBuffer.destroy(),this.indexBuffer=null),this.segments.destroy()},_0x36ace8.register("CollisionBuffers",_0x519d14);var _0x2a7e81=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasPaintOverrides=!1,this.hasRTLText=!1;var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=_0x314e89(this.zoom,t["text-size"]),this.iconSizeData=_0x314e89(this.zoom,t["icon-size"]);var i=this.layers[0].layout,r=i.get("symbol-sort-key"),n=i.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==n&&void 0!==r.constantOr(1);var o="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")),"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((function(e){return _0x4f2cfd[e]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=e.sourceID,this.overscaling=1};_0x2a7e81.prototype.createArrays=function(){const e=this.layers[0].layout;this.hasPaintOverrides=_0x53295d.hasPaintOverrides(e);var t=symbolLayoutAttributes.members;this.text=new _0x4638e1(new ProgramConfigurationSet(t,this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new _0x4638e1(new ProgramConfigurationSet(t,this.layers,this.zoom,(e=>/^icon/.test(e)))),this.textCollisionBox=new _0x519d14(_0x5a5161,collisionBoxLayout.members,_0x41aa31),this.iconCollisionBox=new _0x519d14(_0x5a5161,collisionBoxLayout.members,_0x41aa31),this.textCollisionCircle=new _0x519d14(_0x5a5161,collisionCircleLayout.members,_0x1e1a35),this.iconCollisionCircle=new _0x519d14(_0x5a5161,collisionCircleLayout.members,_0x1e1a35),this.glyphOffsetArray=new _0x5bd306,this.lineVertexArray=new _0x348004,this.symbolInstances=new _0x599329},_0x2a7e81.prototype.calculateGlyphDependencies=function(e,t,i,r,n){for(let o=0;o<e.length;o++)if(t[e.charCodeAt(o)]=!0,(i||r)&&n){const i=verticalizedCharacterMap[e.charAt(o)];i&&(t[i.charCodeAt(0)]=!0)}},_0x2a7e81.prototype.populate=function(e,t){var i=this.layers[0],r=i.layout,n=r.get("text-font"),o=r.get("text-field"),a=r.get("icon-image"),s=("constant"!==o.value.kind||o.value.value instanceof _0x270dad&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==n.value.kind||n.value.value.length>0),l=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],s||l){for(var c=t.iconDependencies,h=t.glyphDependencies,d=t.availableImages,f=new _0x105812(this.zoom),p=0,_=e;p<_.length;p+=1){var m=_[p],$=m.feature,g=m.index,v=m.sourceLayerIndex;if(i._featureFilter(f,$)){var y=void 0;if(s){var x=i.getValueAndResolveTokens("text-field",$,d),b=_0x270dad.factory(x);_0x3ee4d6(b)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===getRTLTextPluginStatus()||this.hasRTLText&&plugin.isParsed())&&(y=_0x5852b7(b,i,$))}var w=void 0;if(l){var C=i.getValueAndResolveTokens("icon-image",$,d);w=C instanceof _0x1c80b?C:_0x1c80b.fromString(C)}if(y||w){var T=this.sortFeaturesByKey?u.evaluate($,{}):void 0,S={text:y,icon:w,index:g,sourceLayerIndex:v,geometry:_0x3e7ee3($),properties:$.properties,type:_0xd36bf4[$.type],sortKey:T};if(void 0!==$.id&&(S.id=$.id),this.features.push(S),w&&(c[w.name]=!0),y){var E=n.evaluate($,{}).join(","),A="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(_0x4f2cfd.vertical)>=0;for(var P=0,I=y.sections;P<I.length;P+=1){var M=I[P];if(M.image)c[M.image.name]=!0;else{var O=allowsVerticalWritingMode(y.toString()),D=M.fontStack||E,R=h[D]=h[D]||{};this.calculateGlyphDependencies(M.text,R,A,this.allowVerticalPlacement,O)}}}}}}if("point"===r.get("symbol-placement"))for(p=0,_=this.features;p<_.length;p+=1){var L=_[p],B=L.geometry,N=L.index,F=L.sourceLayerIndex,z=e[N].feature;t.featureIndex.insert(z,B,N,F,this.index)}"line"===r.get("symbol-placement")&&(this.features=_0x2f5562(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}},_0x2a7e81.prototype.update=function(e,t,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,i),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,i))},_0x2a7e81.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},_0x2a7e81.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},_0x2a7e81.prototype.upload=function(e){this.text&&(!this.uploaded&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e),this.textCollisionCircle.upload(e),this.iconCollisionCircle.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0)},_0x2a7e81.prototype.destroy=function(){this.text&&(this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy())},_0x2a7e81.prototype.clear=function(){},_0x2a7e81.prototype.addToLineVertexArray=function(e,t){var i=this.lineVertexArray.length;if(void 0!==e.segment){for(var r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),o={},a=e.segment+1;a<t.length;a++)o[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:r},a<t.length-1&&(r+=t[a+1].dist(t[a]));for(var s=e.segment||0;s>=0;s--)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},s>0&&(n+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var u=o[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},_0x2a7e81.prototype.addSymbols=function(e,t,i,r,n,o,a,s,l,u,c){var h=this,d=e.indexArray,f=e.layoutVertexArray,p=e.dynamicLayoutVertexArray,_=e.segments.prepareSegment(4*t.length,e.layoutVertexArray,e.indexArray,o.sortKey),m=this.glyphOffsetArray.length,$=_.vertexLength,g=this.allowVerticalPlacement&&a===_0x4f2cfd.vertical?Math.PI/2:0,v=function(e){var t=e.tl,r=e.tr,o=e.bl,l=e.br,u=e.tex,c=e.pixelOffsetTL,m=e.pixelOffsetBR,$=e.minFontScaleX,v=e.minFontScaleY,y=_.vertexLength,x=e.glyphOffset[1];n&&a!==_0x4f2cfd.horizontal?(_0x374951(f,s.x,s.y,t.x,x+t.y,u.x+u.w,u.y,i,e.isSDF,c.x,c.y,$,v),_0x374951(f,s.x,s.y,r.x,x+r.y,u.x,u.y,i,e.isSDF,m.x,c.y,$,v),_0x374951(f,s.x,s.y,o.x,x+o.y,u.x+u.w,u.y+u.h,i,e.isSDF,c.x,m.y,$,v),_0x374951(f,s.x,s.y,l.x,x+l.y,u.x,u.y+u.h,i,e.isSDF,m.x,m.y,$,v)):(_0x374951(f,s.x,s.y,t.x,x+t.y,u.x,u.y+u.h,i,e.isSDF,c.x,c.y,$,v),_0x374951(f,s.x,s.y,r.x,x+r.y,u.x+u.w,u.y+u.h,i,e.isSDF,m.x,c.y,$,v),_0x374951(f,s.x,s.y,o.x,x+o.y,u.x,u.y,i,e.isSDF,c.x,m.y,$,v),_0x374951(f,s.x,s.y,l.x,x+l.y,u.x+u.w,u.y,i,e.isSDF,m.x,m.y,$,v)),_0x2a28fa(p,s,g),d.emplaceBack(y,y+1,y+2),d.emplaceBack(y+1,y+2,y+3),_.vertexLength+=4,_.primitiveLength+=2,h.glyphOffsetArray.emplaceBack(e.glyphOffset[0])};if(o.text&&o.text.sections){var y=o.text.sections;if(this.hasPaintOverrides){for(var x,b=function(t,i){void 0!==x&&(x!==t||i)&&e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{},y[x]),x=t},w=0,C=t;w<C.length;w+=1){var T=C[w];b(T.sectionIndex,!1),v(T)}b(x,!0)}else{for(var S=0,E=t;S<E.length;S+=1){v(E[S])}e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{},y[0])}}else{for(var A=0,P=t;A<P.length;A+=1){v(P[A])}e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,o,o.index,{})}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,$,l,u,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],a,0,!1,0,c)},_0x2a7e81.prototype._addCollisionDebugVertex=function(e,t,i,r,n,o){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,r,n,Math.round(o.x),Math.round(o.y))},_0x2a7e81.prototype.addCollisionDebugVertices=function(e,t,i,r,n,o,a,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),u=l.vertexLength,c=n.layoutVertexArray,h=n.collisionVertexArray,d=a.anchorX,f=a.anchorY;if(this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(e,t)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(i,t)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(i,r)),this._addCollisionDebugVertex(c,h,o,d,f,new pointGeometry(e,r)),l.vertexLength+=4,s){var p=n.indexArray;p.emplaceBack(u,u+1,u+2),p.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var _=n.indexArray;_.emplaceBack(u,u+1),_.emplaceBack(u+1,u+2),_.emplaceBack(u+2,u+3),_.emplaceBack(u+3,u),l.primitiveLength+=4}},_0x2a7e81.prototype.addDebugCollisionBoxes=function(e,t,i,r){for(var n=e;n<t;n++){var o=this.collisionBoxArray.get(n),a=o.x1,s=o.y1,l=o.x2,u=o.y2,c=o.radius>0;this.addCollisionDebugVertices(a,s,l,u,c?r?this.textCollisionCircle:this.iconCollisionCircle:r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,i,c)}},_0x2a7e81.prototype.generateCollisionDebugBuffers=function(){for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},_0x2a7e81.prototype._deserializeCollisionBoxesForSymbol=function(e,t,i,r,n,o,a,s,l){for(var u={},c=t;c<i;c++){var h=e.get(c);if(0===h.radius){u.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},u.textFeatureIndex=h.featureIndex;break}!u.textCircles&&(u.textCircles=[],u.textFeatureIndex=h.featureIndex);u.textCircles.push(h.anchorPointX,h.anchorPointY,h.radius,h.signedDistanceFromAnchor,1)}for(var d=r;d<n;d++){var f=e.get(d);if(0===f.radius){u.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},u.verticalTextFeatureIndex=f.featureIndex;break}}for(var p=o;p<a;p++){var _=e.get(p);if(0===_.radius){u.iconBox={x1:_.x1,y1:_.y1,x2:_.x2,y2:_.y2,anchorPointX:_.anchorPointX,anchorPointY:_.anchorPointY},u.iconFeatureIndex=_.featureIndex;break}}for(var m=s;m<l;m++){var $=e.get(m);if(0===$.radius){u.verticalIconBox={x1:$.x1,y1:$.y1,x2:$.x2,y2:$.y2,anchorPointX:$.anchorPointX,anchorPointY:$.anchorPointY},u.verticalIconFeatureIndex=$.featureIndex;break}}return u},_0x2a7e81.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}},_0x2a7e81.prototype.hasTextData=function(){return this.text.segments.get().length>0},_0x2a7e81.prototype.hasIconData=function(){return this.icon.segments.get().length>0},_0x2a7e81.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},_0x2a7e81.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},_0x2a7e81.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},_0x2a7e81.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},_0x2a7e81.prototype.addIndicesForPlacedSymbol=function(e,t){for(var i=e.placedSymbolArray.get(t),r=i.vertexStartIndex+4*i.numGlyphs,n=i.vertexStartIndex;n<r;n+=4)e.indexArray.emplaceBack(n,n+1,n+2),e.indexArray.emplaceBack(n+1,n+2,n+3)},_0x2a7e81.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),i=Math.cos(e),r=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);r.push(0|Math.round(t*s.anchorX+i*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(e,t){return r[e]-r[t]||n[t]-n[e]})),o},_0x2a7e81.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var i=0,r=this.symbolInstanceIndexes;i<r.length;i+=1){var n=r[i],o=this.symbolInstances.get(n);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(e,i,r){e>=0&&r.indexOf(e)===i&&t.addIndicesForPlacedSymbol(t.text,e)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},_0x36ace8.register("SymbolBucket",_0x2a7e81,{omit:["layers","collisionBoxArray","compareText"]}),_0x2a7e81.MAX_GLYPHS=65535,_0x2a7e81.addDynamicAttributes=_0x2a28fa;var _0x132061=_0x2a7e81;const _0x5a0f99=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x35c6a1=_0x5a0f99(void 0,(function(){return _0x35c6a1.toString().search("(((.+)+)+)+$").toString().constructor(_0x35c6a1).search("(((.+)+)+)+$")}));function _0x5d12ed(e,t,i,r,n){const o=_0x1d4fb9.mat4.create();return t?(_0x1d4fb9.mat4.scale(o,o,[1/n,1/n,1]),!i&&_0x1d4fb9.mat4.rotateZ(o,o,r.angle)):_0x1d4fb9.mat4.multiply(o,r.labelPlaneMatrix,e),o}function _0x2755d9(e,t,i,r,n){if(t){const t=_0x1d4fb9.mat4.clone(e);return _0x1d4fb9.mat4.scale(t,t,[n,n,1]),!i&&_0x1d4fb9.mat4.rotateZ(t,t,-r.angle),t}return r.glCoordMatrix}function _0x5d873d(e,t){const i=[e.x,e.y,0,1];_0x22af7e(i,i,t);const r=i[3];return{point:new _0x36c32e(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function _0x53426f(e,t){const i=e[0]/e[3],r=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&r>=-t[1]&&r<=t[1]}function _0x6cb90c(e,t,i,r,n,o,a,s){const l=r?e.textSizeData:e.iconSizeData,u=_0x20dc96(l,i.transform.zoom),c=[256/i.width*2+1,256/i.height*2+1],h=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;h.clear();const d=e.lineVertexArray,f=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,p=i.transform.width/i.transform.height;let _=!1;for(let r=0;r<f.length;r++){const a=f.get(r);if(a.hidden||a.writingMode===_0x4f2cfd.vertical&&!_){_0x44f668(a.numGlyphs,h);continue}_=!1;const m=[a.anchorX,a.anchorY,0,1];if(_0x1d4fb9.vec4.transformMat4(m,m,t),!_0x53426f(m,c)){_0x44f668(a.numGlyphs,h);continue}m[3];i.transform.cameraToCenterDistance;const $=1.5*_0x5eaf61(l,u,a),g=new _0x36c32e(a.anchorX,a.anchorY),v=_0x5d873d(g,n).point,y={},x=_0x48e13d(a,$,!1,s,t,n,o,e.glyphOffsetArray,d,h,v,g,y,p);_=x.useVertical,(x.notEnoughRoom||_||x.needsFlipping&&_0x48e13d(a,$,!0,s,t,n,o,e.glyphOffsetArray,d,h,v,g,y,p).notEnoughRoom)&&_0x44f668(a.numGlyphs,h)}r?e.text.dynamicLayoutVertexBuffer.copyFromArrayView(h.arrayBuffer):e.icon.dynamicLayoutVertexBuffer.copyFromArrayView(h.arrayBuffer)}function _0x4a9a06(e,t,i,r,n,o,a,s,l,u,c,h){const d=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,_=t.getoffsetX(s.glyphStartIndex),m=t.getoffsetX(d-1),$=_0x429f06(e*_,i,r,n,o,a,s.segment,f,p,l,u,c,h);if(!$)return null;const g=_0x429f06(e*m,i,r,n,o,a,s.segment,f,p,l,u,c,h);return g?{first:$,last:g}:null}function _0x59b3b5(e,t,i,r){if(e===_0x4f2cfd.horizontal){if(Math.abs(i.y-t.y)>Math.abs(i.x-t.x)*r)return{useVertical:!0}}return(e===_0x4f2cfd.vertical?t.y<i.y:t.x>i.x)?{needsFlipping:!0}:null}function _0x48e13d(e,t,i,r,n,o,a,s,l,u,c,h,d,f){const p=t/24,_=e.lineOffsetX*p,m=e.lineOffsetY*p;let $;if(e.numGlyphs>1){const t=e.glyphStartIndex+e.numGlyphs,n=e.lineStartIndex,u=e.lineStartIndex+e.lineLength,g=_0x4a9a06(p,s,_,m,i,c,h,e,l,o,d,!1);if(!g)return{notEnoughRoom:!0};const v=_0x5d873d(g.first.point,a).point,y=_0x5d873d(g.last.point,a).point;if(r&&!i){const t=_0x59b3b5(e.writingMode,v,y,f);if(t)return t}$=[g.first];for(let r=e.glyphStartIndex+1;r<t-1;r++)$.push(_0x429f06(p*s.getoffsetX(r),_,m,i,c,h,e.segment,n,u,l,o,d,!1));$.push(g.last)}else{if(r&&!i){const t=_0x5d873d(h,n).point,i=e.lineStartIndex+e.segment+1,r=new _0x36c32e(l.getx(i),l.gety(i)),o=_0x5d873d(r,n),a=o.signedDistanceFromCamera>0?o.point:_0x4b4ae9(h,r,t,1,n),s=_0x59b3b5(e.writingMode,t,a,f);if(s)return s}const t=_0x429f06(p*s.getoffsetX(e.glyphStartIndex),_,m,i,c,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,o,d,!1);if(!t)return{notEnoughRoom:!0};$=[t]}for(const e of $){_0x2a28fa(u,_0x5d873d(e.point,a).point,e.angle)}return{}}function _0x4b4ae9(e,t,i,r,n){const o=_0x5d873d(e.add(e.sub(t)._unit()),n).point,a=i.sub(o);return i.add(a._mult(r/a.mag()))}function _0x429f06(e,t,i,r,n,o,a,s,l,u,c,h,d){const f=r?e-t:e+t;let p=f>0?1:-1,_=0;r&&(p*=-1,_=Math.PI),p<0&&(_+=Math.PI);let m=p>0?s+a:s+a+1;const $=m;let g=n,v=n,y=0,x=0;const b=Math.abs(f);for(;y+x<=b;){if(m+=p,m<s||m>=l)return null;if(v=g,g=h[m],void 0===g){const e=new _0x36c32e(u.getx(m),u.gety(m)),t=_0x5d873d(e,c);if(t.signedDistanceFromCamera>0)g=h[m]=t.point;else{const t=m-p;g=_0x4b4ae9(0===y?o:new _0x36c32e(u.getx(t),u.gety(t)),e,v,b-y+1,c)}}y+=x,x=v.dist(g)}const w=(b-y)/x,C=g.sub(v),T=C.mult(w)._add(v);T._add(C._unit()._perp()._mult(i*p));return{point:T,angle:_+Math.atan2(g.y-v.y,g.x-v.x),tileDistance:d?{prevTileDistance:m-p===$?0:u.gettileUnitDistanceFromAnchor(m-p),lastSegmentViewportDistance:b-y}:null}}_0x35c6a1();const _0x563276=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function _0x44f668(e,t){for(let i=0;i<e;i++){const e=t.length;t.resize(e+4),t.float32.set(_0x563276,3*e)}}function _0x22af7e(e,t,i){const r=t[0],n=t[1];return e[0]=i[0]*r+i[4]*n+i[12],e[1]=i[1]*r+i[5]*n+i[13],e[3]=i[3]*r+i[7]*n+i[15],e}var _0x3afb5b=(_0x29bfc7=!0,function(e,t){var i=_0x29bfc7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x29bfc7=!1,i}),_0x15116a=_0x3afb5b(void 0,(function(){return _0x15116a.toString().search("(((.+)+)+)+$").toString().constructor(_0x15116a).search("(((.+)+)+)+$")})),_0x29bfc7;_0x15116a();var _0x3d853a={symbolIconUniforms:function(e,t){return{u_is_size_zoom_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_feature_constant),u_size_t:new _0xe46c73.Uniform1f(e,t.u_size_t),u_size:new _0xe46c73.Uniform1f(e,t.u_size),u_camera_to_center_distance:new _0xe46c73.Uniform1f(e,t.u_camera_to_center_distance),u_pitch:new _0xe46c73.Uniform1f(e,t.u_pitch),u_rotate_symbol:new _0xe46c73.Uniform1i(e,t.u_rotate_symbol),u_aspect_ratio:new _0xe46c73.Uniform1f(e,t.u_aspect_ratio),u_fade_change:new _0xe46c73.Uniform1f(e,t.u_fade_change),u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_label_plane_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_label_plane_matrix),u_coord_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_coord_matrix),u_is_text:new _0xe46c73.Uniform1f(e,t.u_is_text),u_pitch_with_map:new _0xe46c73.Uniform1i(e,t.u_pitch_with_map),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_texture:new _0xe46c73.Uniform1i(e,t.u_texture)}},symbolSDFUniforms:function(e,t){return{u_is_size_zoom_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_feature_constant),u_size_t:new _0xe46c73.Uniform1f(e,t.u_size_t),u_size:new _0xe46c73.Uniform1f(e,t.u_size),u_camera_to_center_distance:new _0xe46c73.Uniform1f(e,t.u_camera_to_center_distance),u_pitch:new _0xe46c73.Uniform1f(e,t.u_pitch),u_rotate_symbol:new _0xe46c73.Uniform1i(e,t.u_rotate_symbol),u_aspect_ratio:new _0xe46c73.Uniform1f(e,t.u_aspect_ratio),u_fade_change:new _0xe46c73.Uniform1f(e,t.u_fade_change),u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_label_plane_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_label_plane_matrix),u_coord_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_coord_matrix),u_is_text:new _0xe46c73.Uniform1f(e,t.u_is_text),u_pitch_with_map:new _0xe46c73.Uniform1i(e,t.u_pitch_with_map),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_texture:new _0xe46c73.Uniform1i(e,t.u_texture),u_gamma_scale:new _0xe46c73.Uniform1f(e,t.u_gamma_scale),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_is_halo:new _0xe46c73.Uniform1f(e,t.u_is_halo)}},symbolTextAndIconUniforms:function(e,t){return{u_is_size_zoom_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new _0xe46c73.Uniform1i(e,t.u_is_size_feature_constant),u_size_t:new _0xe46c73.Uniform1f(e,t.u_size_t),u_size:new _0xe46c73.Uniform1f(e,t.u_size),u_camera_to_center_distance:new _0xe46c73.Uniform1f(e,t.u_camera_to_center_distance),u_pitch:new _0xe46c73.Uniform1f(e,t.u_pitch),u_rotate_symbol:new _0xe46c73.Uniform1i(e,t.u_rotate_symbol),u_aspect_ratio:new _0xe46c73.Uniform1f(e,t.u_aspect_ratio),u_fade_change:new _0xe46c73.Uniform1f(e,t.u_fade_change),u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_label_plane_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_label_plane_matrix),u_coord_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_coord_matrix),u_is_text:new _0xe46c73.Uniform1f(e,t.u_is_text),u_pitch_with_map:new _0xe46c73.Uniform1i(e,t.u_pitch_with_map),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_texsize_icon:new _0xe46c73.Uniform2f(e,t.u_texsize_icon),u_texture:new _0xe46c73.Uniform1i(e,t.u_texture),u_texture_icon:new _0xe46c73.Uniform1i(e,t.u_texture_icon),u_gamma_scale:new _0xe46c73.Uniform1f(e,t.u_gamma_scale),u_device_pixel_ratio:new _0xe46c73.Uniform1f(e,t.u_device_pixel_ratio),u_is_halo:new _0xe46c73.Uniform1f(e,t.u_is_halo)}},symbolIconUniformValues:function(e,t,i,r,n,o,a,s,l,u){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:c.width/c.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:u,u_texture:0}},symbolSDFUniformValues:function(e,t,i,r,n,o,a,s,l,u,c){var h=n.transform;return extend$1(_0x3d853a.symbolIconUniformValues(e,t,i,r,n,o,a,s,l,u),{u_gamma_scale:r?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:1,u_is_halo:+c})},symbolTextAndIconUniformValues:function(e,t,i,r,n,o,a,s,l,u){return extend$1(_0x3d853a.symbolSDFUniformValues(e,t,i,r,n,o,a,s,!0,l,!0),{u_texsize_icon:u,u_texture_icon:1})}},_0x275871=new o$1k;_0x3d853a.symbolIconUniformMap=function(e,t,i,r,n,o,a,s,l,u){var c={},h=n.transform;return c.u_is_size_zoom_constant=function(){return+("constant"===e||"source"===e)},c.u_is_size_feature_constant=function(){return+("constant"===e||"camera"===e)},c.u_size_t=function(){return t?t.uSizeT:0},c.u_size=function(){return t?t.uSize:0},c.u_camera_to_center_distance=function(){return h.cameraToCenterDistance},c.u_pitch=function(){return h.pitch/360*2*Math.PI},c.u_rotate_symbol=function(){return+i},c.u_aspect_ratio=function(){return h.width/h.height},c.u_fade_change=function(){return n.options.fadeDuration?n.symbolFadeChange:1},c.u_matrix=function(){return o},c.u_label_plane_matrix=function(){return a},c.u_coord_matrix=function(){return s},c.u_is_text=function(){return+l},c.u_pitch_with_map=function(){return+r},c.u_texsize=function(){return _0x275871.x=u[0],_0x275871.y=u[1],_0x275871},c.u_texture=function(){return 0},c},_0x3d853a.symbolSDFUniformMap=function(e,t,i,r,n,o,a,s,l,u,c){var h=_0x3d853a.symbolIconUniformMap(e,t,i,r,n,o,a,s,l,u),d=n.transform;return h.u_gamma_scale=function(){return r?Math.cos(d._pitch)*d.cameraToCenterDistance:1},h.u_device_pixel_ratio=function(){return 1},h.u_is_halo=function(){return+c},h},_0x3d853a.symbolTextAndIconUniformMap=function(e,t,i,r,n,o,a,s,l,u){var c=_0x3d853a.symbolIconUniformMap(e,t,i,r,n,o,a,s,!0,l,!0);return c.u_texsize_icon=function(){return u},c.u_texture_icon=function(){return 1},c};var _0x2bc869=_0x17feab(new Float32Array(16)),_0x5ca5d8=new Float32Array(16);function _0x178b84(e,t,i,r){if("translucent"===e.renderPass){var n=_0x1724fa.disabled,o=e.colorModeForRenderPass();i.layout.get("text-variable-anchor"),0!==i.paint.get("icon-opacity").constantOr(1)&&_0x1960fa(e,t,i,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),n,o,r),0!==i.paint.get("text-opacity").constantOr(1)&&_0x1960fa(e,t,i,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),n,o,r)}}function _0x191827(e,t,i){return i.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function _0x1960fa(e,t,i,r,n,o,a,s,l,u,c,h){var d="map"===a,f="map"===s,p=d&&"point"!==i.layout.get("symbol-placement");if(p){var _,m=d&&!f&&!p,$=void 0!==i.layout.get("symbol-sort-key").constantOr(1),g=e.depthModeForSublayer(0,_0x16a5dd.ReadOnly),v=i.layout.get("text-variable-anchor"),y=[],x=t.getBucket(i);if(x){var b=r?x.text:x.icon;if(b&&b.segments.get().length){for(var w=b.programConfigurations.get(i.id),C=w.getAttributeLocation(),T=Object.keys(C).length,S=0;S<b.dynamicLayoutVertexBuffer.attributes.length;S++){C[b.dynamicLayoutVertexBuffer.attributes[S].name]=T++}var E=r||x.sdfIcons,A=r?x.textSizeData:x.iconSizeData,P=e.useProgram(_0x191827(E,r,x),w,C).cesiumProgram;_=_0x20dc96(A,t.level);var I=void 0,M=[0,0],O=void 0,D=void 0,R=null,L=void 0;if(r){if(O=t.glyphAtlasTexture,D=de$y.LINEAR,I=t.glyphAtlasTexture.size,x.iconsInText){M=t.imageAtlasTexture.size,R=t.imageAtlasTexture;var B="composite"===A.kind||"camera"===A.kind;L=e.options.rotating||e.options.zooming||B?de$y.LINEAR:de$y.NEAREST}}else{var N=1!==i.layout.get("icon-size").constantOr(0)||x.iconsNeedLinear;O=t.imageAtlasTexture,D=E||e.options.rotating||e.options.zooming||N?de$y.LINEAR:de$y.NEAREST,I=t.imageAtlasTexture.size}var F=_0x19911a(t,1,t.level),z=y$15.toArray(t.viewProjection,_0x5ca5d8);_0x5d12ed(z,f,d,e.transform,F);var k=_0x2755d9(z,f,d,e.transform,F),V=v&&x.hasTextData();if("none"!==i.layout.get("icon-text-fit")&&V&&x.hasIconData(),p)_0x6cb90c(x,z,e,r,_0x5d12ed(_0x2bc869,f,d,e.transform,F),_0x2755d9(_0x2bc869,f,d,e.transform,F),f,l);var U=y$15.toArray(z,_0x5ca5d8),X=_0x2bc869,H=e.translatePosMatrix(k,t,n,o,!0),G=E&&0!==i.paint.get(r?"text-halo-width":"icon-halo-width").constantOr(1);_.uSize=512*_.uSize/t.targetTileSize,_.uSizeT=512*_.uSizeT/t.targetTileSize;var W={},Y={program:P,buffers:b,uniformMap:W=E?x.iconsInText?_0x3d853a.symbolTextAndIconUniformMap(A.kind,_,m,f,e,U,X,H,I,M):_0x3d853a.symbolSDFUniformMap(A.kind,_,m,f,e,U,X,H,r,I,!0):_0x3d853a.symbolIconUniformMap(A.kind,_,m,f,e,U,X,H,r,I),atlasTexture:O,atlasTextureIcon:R,atlasInterpolation:D,atlasInterpolationIcon:L,isSDF:E,hasHalo:G};if($){S=0;for(var q=b.segments.get();S<q.length;S+=1){var j=q[S];y.push({segments:new _0x33528b([j]),sortKey:j.sortKey,state:Y})}}else y.push({segments:b.segments,sortKey:0,state:Y});$&&y.sort((function(e,t){return e.sortKey-t.sortKey}));for(var Z=0,K=y;Z<K.length;Z+=1){var Q=K[Z],J=Q.state;if(J.atlasTexture.bind(J.atlasInterpolation,de$y.CLAMP_TO_EDGE),W.u_texture=function(){return J.atlasTexture.cesiumTexture},J.atlasTextureIcon&&(J.atlasTextureIcon.bind(J.atlasInterpolationIcon,de$y.CLAMP_TO_EDGE),W.u_texture_icon=function(){return J.atlasInterpolationIcon.cesiumTexture}),J.isSDF){W=J.uniformMap;J.hasHalo&&(W.u_is_halo=function(){return 1},_0x16676f(J.buffers,Q.segments,i,e,J.program,g,u,c,W,h.passState,C)),W.u_is_halo=function(){return 0}}_0x16676f(J.buffers,Q.segments,i,e,J.program,g,u,c,J.uniformMap,h.passState,C)}}}}else t._MVTLabel.drawLayerSymbols(t,i,r)}function _0x16676f(e,t,i,r,n,o,a,s,l,u,c){var h=e.programConfigurations.get(i.id),d=n.allUniforms;l=h.getUniformMaps(d,i.paint,l);for(var f=h.getPaintVertexBuffers(),p=0,_=t.get();p<_.length;p+=1){var m=_[p],$=(m.drawCommands||(m.drawCommands={}))[i.id];if(!$){$=new r$15({cull:!1,primitiveType:de$y.TRIANGLES,count:3*m.primitiveLength,offset:3*m.primitiveOffset}),m.drawCommands[i.id]=$;for(var g=m.cesiumVaos||(m.cesiumVaos={}),v=[],y=0;y<e.layoutVertexBuffer.attributes.length;y++){var x=e.layoutVertexBuffer.attributes[y],b=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(x,e.layoutVertexBuffer,c[x.name],m.vertexOffset);v.push(b)}for(y=0;y<e.dynamicLayoutVertexBuffer.attributes.length;y++){x=e.dynamicLayoutVertexBuffer.attributes[y],b=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(x,e.dynamicLayoutVertexBuffer,c[x.name],m.vertexOffset);v.push(b)}for(var w=0;w<f.length;w++)for(var C=f[w],T=0;T<C.attributes.length;T++){x=C.attributes[T],b=_0x24da5b.mbxAttributeToCesiumVertexArrtribute(x,C,c[x.name],m.vertexOffset);v.push(b)}var S=g[i.id]||(g[i.id]=new m$19({context:r.cesiumContext,attributes:v,indexBuffer:e.indexBuffer}));$.vertexArray=S}l.u_depthRange=function(){return 1-o.range[0]},$.uniformMap=l,$.renderState=_0x24da5b.toRenderState(s,o,_0x7eb0a6.disabled),$.shaderProgram=n,$.execute(r.cesiumContext,u)}}function _0x17feab(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var _0x421b3f=(_0x2cd4ac=!0,function(e,t){var i=_0x2cd4ac?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2cd4ac=!1,i}),_0x432742=_0x421b3f(void 0,(function(){return _0x432742.toString().search("(((.+)+)+)+$").toString().constructor(_0x432742).search("(((.+)+)+)+$")})),_0x2cd4ac;_0x432742();var _0x2b4209=(_0x4f2105=!0,function(e,t){var i=_0x4f2105?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4f2105=!1,i}),_0x57e201=_0x2b4209(void 0,(function(){return _0x57e201.toString().search("(((.+)+)+)+$").toString().constructor(_0x57e201).search("(((.+)+)+)+$")})),_0x4f2105;_0x57e201();var _0x268bc0="\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n",_0x11a7af=(_0x3a3930=!0,function(e,t){var i=_0x3a3930?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3a3930=!1,i}),_0x49ce4e=_0x11a7af(void 0,(function(){return _0x49ce4e.toString().search("(((.+)+)+)+$").toString().constructor(_0x49ce4e).search("(((.+)+)+)+$")})),_0x3a3930;_0x49ce4e();var _0x58f57f="\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x1ea3f8=(_0x4cce6d=!0,function(e,t){var i=_0x4cce6d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4cce6d=!1,i}),_0x35d51c=_0x1ea3f8(void 0,(function(){return _0x35d51c.toString().search("(((.+)+)+)+$").toString().constructor(_0x35d51c).search("(((.+)+)+)+$")})),_0x4cce6d;_0x35d51c();var _0x3535a2="\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n",_0x53d8b4=(_0x5487b8=!0,function(e,t){var i=_0x5487b8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5487b8=!1,i}),_0x33d74d=_0x53d8b4(void 0,(function(){return _0x33d74d.toString().search("(((.+)+)+)+$").toString().constructor(_0x33d74d).search("(((.+)+)+)+$")})),_0x5487b8;_0x33d74d();var _0xaa15e0="\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x371cd7=(_0x3209fa=!0,function(e,t){var i=_0x3209fa?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3209fa=!1,i}),_0x566c72=_0x371cd7(void 0,(function(){return _0x566c72.toString().search("(((.+)+)+)+$").toString().constructor(_0x566c72).search("(((.+)+)+)+$")})),_0x3209fa;_0x566c72();var _0x4067a5="\nattribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\nattribute vec2 a_shift;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += (a_extrude + a_shift) * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n",_0x2bfc58=(_0x25bc1c=!0,function(e,t){var i=_0x25bc1c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x25bc1c=!1,i}),_0x25d42f=_0x2bfc58(void 0,(function(){return _0x25d42f.toString().search("(((.+)+)+)+$").toString().constructor(_0x25d42f).search("(((.+)+)+)+$")})),_0x25bc1c;_0x25d42f();var _0x49e300="\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}\n",_0x50d5e5=(_0x596f5d=!0,function(e,t){var i=_0x596f5d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x596f5d=!1,i}),_0x5478a2=_0x50d5e5(void 0,(function(){return _0x5478a2.toString().search("(((.+)+)+)+$").toString().constructor(_0x5478a2).search("(((.+)+)+)+$")})),_0x596f5d;_0x5478a2();var _0x19aa0c="\nattribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n",_0x4ed2ad=(_0x1b9f07=!0,function(e,t){var i=_0x1b9f07?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1b9f07=!1,i}),_0x4969af=_0x4ed2ad(void 0,(function(){return _0x4969af.toString().search("(((.+)+)+)+$").toString().constructor(_0x4969af).search("(((.+)+)+)+$")})),_0x1b9f07;_0x4969af();var _0x1f24df="\nuniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",_0x45a63b=(_0x542b48=!0,function(e,t){var i=_0x542b48?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x542b48=!1,i}),_0x15ae76=_0x45a63b(void 0,(function(){return _0x15ae76.toString().search("(((.+)+)+)+$").toString().constructor(_0x15ae76).search("(((.+)+)+)+$")})),_0x542b48;_0x15ae76();var _0x15de00="uniform mat4 u_matrix;\n uniform bool u_scale_with_map;\n uniform bool u_pitch_with_map;\n uniform vec2 u_extrude_scale;\n uniform lowp float u_device_pixel_ratio;\n uniform highp float u_camera_to_center_distance;\n\n attribute vec2 a_pos;\n\n varying vec3 v_data;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\n void main(void) {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n\n vec2 corner_position = circle_center;\n \n corner_position += extrude * (radius + stroke_width) * 16.0;\n gl_Position = u_matrix * vec4(corner_position, 0.0, 1.0);\n \n // if (u_pitch_with_map) {\n // vec2 corner_position = circle_center;\n // if (u_scale_with_map) {\n // corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n // } else {\n // // Pitching the circle with the map effectively scales it with the map\n // // To counteract the effect for pitch-scale: viewport, we rescale the\n // // whole circle based on the pitch scaling effect at its central point\n // vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n // corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n // }\n\n // gl_Position = u_matrix * vec4(circle_center, 0, 1);\n // } else {\n // gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n // if (u_scale_with_map) {\n // gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n // } else {\n // gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n // }\n // }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n }\n",_0x5c67be=(_0x5a9a54=!0,function(e,t){var i=_0x5a9a54?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5a9a54=!1,i}),_0x340199=_0x5c67be(void 0,(function(){return _0x340199.toString().search("(((.+)+)+)+$").toString().constructor(_0x340199).search("(((.+)+)+)+$")})),_0x5a9a54;_0x340199();var _0x565f0b="varying vec3 v_data;\nuniform float u_mapbox_alpha;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius * 16.0 / (radius * 16.0 + stroke_width * 16.0)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t) * u_mapbox_alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x23cdc8=(_0x4afee0=!0,function(e,t){var i=_0x4afee0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4afee0=!1,i}),_0xa8220f=_0x23cdc8(void 0,(function(){return _0xa8220f.toString().search("(((.+)+)+)+$").toString().constructor(_0xa8220f).search("(((.+)+)+)+$")})),_0x4afee0;_0xa8220f();var _0x7b92c3="\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n",_0x43d6d9=(_0x2d1a59=!0,function(e,t){var i=_0x2d1a59?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2d1a59=!1,i}),_0x22abab=_0x43d6d9(void 0,(function(){return _0x22abab.toString().search("(((.+)+)+)+$").toString().constructor(_0x22abab).search("(((.+)+)+)+$")})),_0x2d1a59;_0x22abab();var _0x2fd75="\nvoid main() {\n gl_FragColor = vec4(1.0);\n}\n",_0x38e035=(_0x138aa3=!0,function(e,t){var i=_0x138aa3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x138aa3=!1,i}),_0x185f57=_0x38e035(void 0,(function(){return _0x185f57.toString().search("(((.+)+)+)+$").toString().constructor(_0x185f57).search("(((.+)+)+)+$")})),_0x138aa3;_0x185f57();var _0x24e3c5="\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n",_0x396a6d=(_0x5d00cb=!0,function(e,t){var i=_0x5d00cb?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5d00cb=!1,i}),_0x22ff36=_0x396a6d(void 0,(function(){return _0x22ff36.toString().search("(((.+)+)+)+$").toString().constructor(_0x22ff36).search("(((.+)+)+)+$")})),_0x5d00cb;_0x22ff36();var _0x552f8f="\nuniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",_0x52afe9=(_0x350c75=!0,function(e,t){var i=_0x350c75?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x350c75=!1,i}),_0x2be468=_0x52afe9(void 0,(function(){return _0x2be468.toString().search("(((.+)+)+)+$").toString().constructor(_0x2be468).search("(((.+)+)+)+$")})),_0x350c75;_0x2be468();var _0x1e5e9b="\n#ifdef WEBGPU\n attribute ivec2 a_pos;\n#else\n attribute vec2 a_pos;\n#endif\n uniform mat4 u_matrix;\n uniform float u_depthRange;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\n gl_Position = u_matrix * vec4(float(a_pos.x), float(a_pos.y), u_depthRange, 1);\n }\n",_0x56b0cf=(_0x39654e=!0,function(e,t){var i=_0x39654e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x39654e=!1,i}),_0x4da9fd=_0x56b0cf(void 0,(function(){return _0x4da9fd.toString().search("(((.+)+)+)+$").toString().constructor(_0x4da9fd).search("(((.+)+)+)+$")})),_0x39654e;_0x4da9fd();var _0x5640e7="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n gl_FragColor = color * opacity;\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x2ef2e4=(_0x1b5431=!0,function(e,t){var i=_0x1b5431?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1b5431=!1,i}),_0x39843f=_0x2ef2e4(void 0,(function(){return _0x39843f.toString().search("(((.+)+)+)+$").toString().constructor(_0x39843f).search("(((.+)+)+)+$")})),_0x1b5431;_0x39843f();var _0xb4fb06="\nuniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform float u_vertical_gradient;\nuniform lowp float u_opacity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize highp float base\n #pragma mapbox: initialize highp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n // and otherwise calculates the gradient based on base + height\n directional *= (\n (1.0 - u_vertical_gradient) +\n (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n v_color *= u_opacity;\n}\n",_0x381ab1=(_0x4224a4=!0,function(e,t){var i=_0x4224a4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4224a4=!1,i}),_0xfe3287=_0x381ab1(void 0,(function(){return _0xfe3287.toString().search("(((.+)+)+)+$").toString().constructor(_0xfe3287).search("(((.+)+)+)+$")})),_0x4224a4;_0xfe3287();var _0x21ce53="\nvarying vec4 v_color;\n\nvoid main() {\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x70c34a=(_0x3cc34b=!0,function(e,t){var i=_0x3cc34b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3cc34b=!1,i}),_0x12cc86=_0x70c34a(void 0,(function(){return _0x12cc86.toString().search("(((.+)+)+)+$").toString().constructor(_0x12cc86).search("(((.+)+)+)+$")})),_0x3cc34b;_0x12cc86();var _0x5290b4="\nuniform mat4 u_matrix;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_height_factor;\nuniform vec4 u_scale;\nuniform float u_vertical_gradient;\nuniform lowp float u_opacity;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n // and otherwise calculates the gradient based on base + height\n directional *= (\n (1.0 - u_vertical_gradient) +\n (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n v_lighting *= u_opacity;\n}\n",_0x17eff6=(_0x4f40b3=!0,function(e,t){var i=_0x4f40b3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4f40b3=!1,i}),_0x460db0=_0x17eff6(void 0,(function(){return _0x460db0.toString().search("(((.+)+)+)+$").toString().constructor(_0x460db0).search("(((.+)+)+)+$")})),_0x4f40b3;_0x460db0();var _0x42b191="\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_fade);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x579ec0=(_0x219e9d=!0,function(e,t){var i=_0x219e9d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x219e9d=!1,i}),_0x379c63=_0x579ec0(void 0,(function(){return _0x379c63.toString().search("(((.+)+)+)+$").toString().constructor(_0x379c63).search("(((.+)+)+)+$")})),_0x219e9d;_0x379c63();var _0x458cc9="\n#ifdef WEBGPU\n attribute ivec2 a_pos;\n#else\n attribute vec2 a_pos;\n#endif\n uniform mat4 u_matrix;\n uniform vec2 u_world;\n uniform float u_depthRange;\n varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n void main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n gl_Position = u_matrix * vec4(vec2(a_pos), u_depthRange, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n }\n",_0x463f5a=(_0x440d5=!0,function(e,t){var i=_0x440d5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x440d5=!1,i}),_0x5c80f4=_0x463f5a(void 0,(function(){return _0x5c80f4.toString().search("(((.+)+)+)+$").toString().constructor(_0x5c80f4).search("(((.+)+)+)+$")})),_0x440d5;_0x5c80f4();var _0x35ac2b="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n void main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x485952=(_0x21e6e9=!0,function(e,t){var i=_0x21e6e9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21e6e9=!1,i}),_0x357fda=_0x485952(void 0,(function(){return _0x357fda.toString().search("(((.+)+)+)+$").toString().constructor(_0x357fda).search("(((.+)+)+)+$")})),_0x21e6e9;_0x357fda();var _0x59e935="uniform mat4 u_matrix;\n uniform vec2 u_pixel_coord_upper;\n uniform vec2 u_pixel_coord_lower;\n uniform vec4 u_scale;\n uniform float u_depthRange;\n\n#ifdef WEBGPU\n attribute ivec2 a_pos;\n#else\n attribute vec2 a_pos;\n#endif\n\n varying vec2 v_pos_a;\n varying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\n void main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = vec2(pattern_from.xy);\n vec2 pattern_br_a = vec2(pattern_from.zw);\n vec2 pattern_tl_b = vec2(pattern_to.xy);\n vec2 pattern_br_b = vec2(pattern_to.zw);\n\n float pixelRatio = u_scale.x;\n float tileZoomRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n gl_Position = u_matrix * vec4(vec2(a_pos), u_depthRange, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, vec2(a_pos));\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, vec2(a_pos));\n }\n",_0x15d5ba=(_0x4a7721=!0,function(e,t){var i=_0x4a7721?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4a7721=!1,i}),_0x40896a=_0x15d5ba(void 0,(function(){return _0x40896a.toString().search("(((.+)+)+)+$").toString().constructor(_0x40896a).search("(((.+)+)+)+$")})),_0x4a7721;_0x40896a();var _0x148b05="uniform vec2 u_texsize;\n uniform float u_fade;\n\n uniform sampler2D u_image;\n\n varying vec2 v_pos_a;\n varying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\n void main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_fade) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0xa56a8a=(_0x586f62=!0,function(e,t){var i=_0x586f62?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x586f62=!1,i}),_0x3294ed=_0xa56a8a(void 0,(function(){return _0x3294ed.toString().search("(((.+)+)+)+$").toString().constructor(_0x3294ed).search("(((.+)+)+)+$")})),_0x586f62;_0x3294ed();var _0x519afb="uniform mat4 u_matrix;\n uniform vec2 u_world;\n uniform vec2 u_pixel_coord_upper;\n uniform vec2 u_pixel_coord_lower;\n uniform vec4 u_scale;\n uniform float u_depthRange;\n\n#ifdef WEBGPU\n attribute ivec2 a_pos;\n#else\n attribute vec2 a_pos;\n#endif\n\n varying vec2 v_pos_a;\n varying vec2 v_pos_b;\n varying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\n void main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n gl_Position = u_matrix * vec4(vec2(a_pos), u_depthRange, 1);\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, vec2(a_pos));\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, vec2(a_pos));\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n }\n",_0x405c26=(_0x58f94e=!0,function(e,t){var i=_0x58f94e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x58f94e=!1,i}),_0x5279d8=_0x405c26(void 0,(function(){return _0x5279d8.toString().search("(((.+)+)+)+$").toString().constructor(_0x5279d8).search("(((.+)+)+)+$")})),_0x58f94e;_0x5279d8();var _0x2b464d="uniform vec2 u_texsize;\n uniform sampler2D u_image;\n uniform float u_fade;\n\n varying vec2 v_pos_a;\n varying vec2 v_pos_b;\n varying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\n void main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = mix(color1, color2, u_fade) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x53451e=(_0x14514c=!0,function(e,t){var i=_0x14514c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x14514c=!1,i}),_0x383f27=_0x53451e(void 0,(function(){return _0x383f27.toString().search("(((.+)+)+)+$").toString().constructor(_0x383f27).search("(((.+)+)+)+$")})),_0x14514c;_0x383f27();var _0xd79a76="\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n #pragma mapbox: initialize mediump float radius\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n",_0x437cfc=(_0x7d0be2=!0,function(e,t){var i=_0x7d0be2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x7d0be2=!1,i}),_0x3e1102=_0x437cfc(void 0,(function(){return _0x3e1102.toString().search("(((.+)+)+)+$").toString().constructor(_0x3e1102).search("(((.+)+)+)+$")})),_0x7d0be2;_0x3e1102();var _0x353d96="\nuniform highp float u_intensity;\n\nvarying vec2 v_extrude;\n\n#pragma mapbox: define highp float weight\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x419e49=(_0x12adc7=!0,function(e,t){var i=_0x12adc7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x12adc7=!1,i}),_0xed4c84=_0x419e49(void 0,(function(){return _0xed4c84.toString().search("(((.+)+)+)+$").toString().constructor(_0xed4c84).search("(((.+)+)+)+$")})),_0x12adc7;_0xed4c84();var _0x30673f="\nuniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n",_0x4f6d8e=(_0x124bd2=!0,function(e,t){var i=_0x124bd2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x124bd2=!1,i}),_0x410c0b=_0x4f6d8e(void 0,(function(){return _0x410c0b.toString().search("(((.+)+)+)+$").toString().constructor(_0x410c0b).search("(((.+)+)+)+$")})),_0x124bd2;_0x410c0b();var _0x2161dd="\nuniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",_0x2311cb=(_0x405e37=!0,function(e,t){var i=_0x405e37?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x405e37=!1,i}),_0xa30823=_0x2311cb(void 0,(function(){return _0xa30823.toString().search("(((.+)+)+)+$").toString().constructor(_0xa30823).search("(((.+)+)+)+$")})),_0x405e37;_0xa30823();var _0x25969c="\nuniform mat4 u_matrix;\nuniform vec2 u_dimension;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n highp vec2 epsilon = 1.0 / u_dimension;\n float scale = (u_dimension.x - 2.0) / u_dimension.x;\n v_pos = (a_texture_pos / 8192.0) * scale + epsilon;\n}\n",_0x5b5196=(_0x3e92e4=!0,function(e,t){var i=_0x3e92e4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3e92e4=!1,i}),_0xb8a707=_0x5b5196(void 0,(function(){return _0xb8a707.toString().search("(((.+)+)+)+$").toString().constructor(_0xb8a707).search("(((.+)+)+)+$")})),_0x3e92e4;_0xb8a707();var _0x4becdf="\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\nuniform vec4 u_unpack;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n data.a = -1.0;\n return dot(data, u_unpack) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x53fa81=(_0x52a437=!0,function(e,t){var i=_0x52a437?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x52a437=!1,i}),_0x52c4af=_0x53fa81(void 0,(function(){return _0x52c4af.toString().search("(((.+)+)+)+$").toString().constructor(_0x52c4af).search("(((.+)+)+)+$")})),_0x52a437;_0x52c4af();var _0x2463ac="\nuniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n",_0x26e5ec=(_0x5523c8=!0,function(e,t){var i=_0x5523c8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5523c8=!1,i}),_0x4dce13=_0x26e5ec(void 0,(function(){return _0x4dce13.toString().search("(((.+)+)+)+$").toString().constructor(_0x4dce13).search("(((.+)+)+)+$")})),_0x5523c8;_0x4dce13();var _0x18397b="\nuniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x15811c=(_0x5ab803=!0,function(e,t){var i=_0x5ab803?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5ab803=!1,i}),_0x2040b9=_0x15811c(void 0,(function(){return _0x2040b9.toString().search("(((.+)+)+)+$").toString().constructor(_0x2040b9).search("(((.+)+)+)+$")})),_0x5ab803;_0x2040b9();var _0x767874="// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also special normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n #define scale 0.015873016\n\n#ifdef WEBGPU\n attribute ivec2 a_pos_normal;\n attribute uvec4 a_data;\n#else\n attribute vec2 a_pos_normal;\n attribute vec4 a_data;\n#endif\n\n uniform mat4 u_matrix;\n uniform mediump float u_ratio;\n uniform vec2 u_units_to_pixels;\n uniform lowp float u_device_pixel_ratio;\n uniform float u_depthRange;\n\n varying vec2 v_normal;\n varying vec2 v_width2;\n varying float v_gamma_scale;\n varying highp float v_linesofar;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n // the distance over which the line edge fades out.\n // Retina devices need a smaller distance to avoid aliasing.\n float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;\n\n vec2 a_extrude = vec2(a_data.xy) - 128.0;\n float a_direction = mod(float(a_data.z), 4.0) - 1.0;\n\n v_linesofar = (floor(float(a_data.z) / 4.0) + float(a_data.w) * 64.0) * 2.0;\n\n vec2 pos = floor(vec2(a_pos_normal) * 0.5);\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n // We store these in the least significant bit of a_pos_normal\n mediump vec2 normal = vec2(a_pos_normal) - 2.0 * pos;\n normal.y = normal.y * 2.0 - 1.0;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, u_depthRange, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n }\n",_0x382009=(_0x281c55=!0,function(e,t){var i=_0x281c55?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x281c55=!1,i}),_0x485f4d=_0x382009(void 0,(function(){return _0x485f4d.toString().search("(((.+)+)+)+$").toString().constructor(_0x485f4d).search("(((.+)+)+)+$")})),_0x281c55;_0x485f4d();var _0x47e667="uniform lowp float u_device_pixel_ratio;\n\n varying vec2 v_width2;\n varying vec2 v_normal;\n varying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nuniform lowp float u_antialiasing;\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / u_device_pixel_ratio) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n alpha = max(1.0 - u_antialiasing, alpha);\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x4aad95=(_0x191fc1=!0,function(e,t){var i=_0x191fc1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x191fc1=!1,i}),_0x40d98f=_0x4aad95(void 0,(function(){return _0x40d98f.toString().search("(((.+)+)+)+$").toString().constructor(_0x40d98f).search("(((.+)+)+)+$")})),_0x191fc1;_0x40d98f();var _0x7b801="// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also special normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n #define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n #define LINE_DISTANCE_SCALE 2.0\n\n#ifdef WEBGPU\n attribute ivec2 a_pos_normal;\n attribute uvec4 a_data;\n#else\n attribute vec2 a_pos_normal;\n attribute vec4 a_data;\n#endif\n\n uniform mat4 u_matrix;\n uniform mediump float u_ratio;\n uniform lowp float u_device_pixel_ratio;\n uniform vec2 u_patternscale_a;\n uniform float u_tex_y_a;\n uniform vec2 u_patternscale_b;\n uniform float u_tex_y_b;\n uniform vec2 u_units_to_pixels;\n uniform float u_depthRange;\n\n varying vec2 v_normal;\n varying vec2 v_width2;\n varying vec2 v_tex_a;\n varying vec2 v_tex_b;\n varying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // the distance over which the line edge fades out.\n // Retina devices need a smaller distance to avoid aliasing.\n float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;\n\n vec2 a_extrude = vec2(a_data.xy) - 128.0;\n float a_direction = mod(float(a_data.z), 4.0) - 1.0;\n float a_linesofar = (floor(float(a_data.z) / 4.0) + float(a_data.w) * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = floor(vec2(a_pos_normal) * 0.5);\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n // We store these in the least significant bit of a_pos_normal\n mediump vec2 normal = vec2(a_pos_normal) - 2.0 * pos;\n normal.y = normal.y * 2.0 - 1.0;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, u_depthRange, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n #ifndef WEBGPU\n v_tex_a.y = 1.0 - v_tex_a.y;\n v_tex_b.y = 1.0 - v_tex_b.y;\n#endif\n\n v_width2 = vec2(outset, inset);\n }\n",_0x1548b5=(_0x5e41d8=!0,function(e,t){var i=_0x5e41d8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5e41d8=!1,i}),_0x1a760f=_0x1548b5(void 0,(function(){return _0x1a760f.toString().search("(((.+)+)+)+$").toString().constructor(_0x1a760f).search("(((.+)+)+)+$")})),_0x5e41d8;_0x1a760f();var _0x1e425b="uniform lowp float u_device_pixel_ratio;\n uniform sampler2D u_image;\n uniform float u_sdfgamma;\n uniform float u_mix;\n uniform lowp float u_antialiasing;\n\n varying vec2 v_normal;\n varying vec2 v_width2;\n varying vec2 v_tex_a;\n varying vec2 v_tex_b;\n varying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\n void main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / u_device_pixel_ratio) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n if(alpha > 0.1){\n alpha = max(1.0 - u_antialiasing, alpha);\n }\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n }\n",_0x38153a=(_0x15e4db=!0,function(e,t){var i=_0x15e4db?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x15e4db=!1,i}),_0x6a0a3f=_0x38153a(void 0,(function(){return _0x6a0a3f.toString().search("(((.+)+)+)+$").toString().constructor(_0x6a0a3f).search("(((.+)+)+)+$")})),_0x15e4db;_0x6a0a3f();var _0x530167="\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec2 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform lowp float u_device_pixel_ratio;\nuniform vec2 u_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n // the distance over which the line edge fades out.\n // Retina devices need a smaller distance to avoid aliasing.\n float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = floor(a_pos_normal * 0.5);\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n // We store these in the least significant bit of a_pos_normal\n mediump vec2 normal = a_pos_normal - 2.0 * pos;\n normal.y = normal.y * 2.0 - 1.0;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n",_0x1c4b79=(_0x2f74ef=!0,function(e,t){var i=_0x2f74ef?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2f74ef=!1,i}),_0x163e35=_0x1c4b79(void 0,(function(){return _0x163e35.toString().search("(((.+)+)+)+$").toString().constructor(_0x163e35).search("(((.+)+)+)+$")})),_0x2f74ef;_0x163e35();var _0x32b8b0="\nuniform lowp float u_device_pixel_ratio;\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / u_device_pixel_ratio) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0xaed8ea=(_0x4ac4c6=!0,function(e,t){var i=_0x4ac4c6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4ac4c6=!1,i}),_0x283202=_0xaed8ea(void 0,(function(){return _0x283202.toString().search("(((.+)+)+)+$").toString().constructor(_0x283202).search("(((.+)+)+)+$")})),_0x4ac4c6;_0x283202();var _0x5a6965="\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n#ifdef WEBGPU\n attribute ivec2 a_pos_normal;\n attribute uvec4 a_data;\n#else\n attribute vec2 a_pos_normal;\n attribute vec4 a_data;\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_units_to_pixels;\nuniform mediump float u_ratio;\nuniform lowp float u_device_pixel_ratio;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n // the distance over which the line edge fades out.\n // Retina devices need a smaller distance to avoid aliasing.\n float ANTIALIASING = 1.0 / u_device_pixel_ratio / 2.0;\n\n vec2 a_extrude = vec2(a_data.xy) - 128.0;\n float a_direction = mod(float(a_data.z), 4.0) - 1.0;\n float a_linesofar = (floor(float(a_data.z) / 4.0) + float(a_data.w) * 64.0) * LINE_DISTANCE_SCALE;\n // float tileRatio = u_scale.y;\n vec2 pos = floor(vec2(a_pos_normal) * 0.5);\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n // We store these in the least significant bit of a_pos_normal\n mediump vec2 normal = vec2(a_pos_normal) - 2.0 * pos;\n normal.y = normal.y * 2.0 - 1.0;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n",_0x984232=(_0x21650f=!0,function(e,t){var i=_0x21650f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21650f=!1,i}),_0x4b6114=_0x984232(void 0,(function(){return _0x4b6114.toString().search("(((.+)+)+)+$").toString().constructor(_0x4b6114).search("(((.+)+)+)+$")})),_0x21650f;_0x4b6114();var _0x206d61="\nuniform lowp float u_device_pixel_ratio;\nuniform vec2 u_texsize;\nuniform float u_fade;\nuniform mediump vec4 u_scale;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileZoomRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n vec2 pattern_size_a = vec2(display_size_a.x * fromScale / tileZoomRatio, display_size_a.y);\n vec2 pattern_size_b = vec2(display_size_b.x * toScale / tileZoomRatio, display_size_b.y);\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / u_device_pixel_ratio) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_a.y + 2.0) / 2.0) / pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_b.y + 2.0) / 2.0) / pattern_size_b.y);\n vec2 pos_a = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x5d02ac=(_0x153a9c=!0,function(e,t){var i=_0x153a9c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x153a9c=!1,i}),_0x2cb167=_0x5d02ac(void 0,(function(){return _0x2cb167.toString().search("(((.+)+)+)+$").toString().constructor(_0x2cb167).search("(((.+)+)+)+$")})),_0x153a9c;_0x2cb167();var _0x2f6c65="\nconst float PI = 3.141592653589793;\n\n#ifdef WEBGPU\nattribute ivec4 a_pos_offset;\nattribute uvec4 a_data;\nattribute ivec4 a_pixeloffset;\n#else\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec4 a_pixeloffset;\n#endif\nattribute vec3 a_projected_pos;\n//attribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\nuniform float u_depthRange;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = vec2(a_pos_offset.xy);\n vec2 a_offset = vec2(a_pos_offset.zw);\n\n vec2 a_tex = vec2(a_data.xy);\n vec2 a_size = vec2(a_data.zw);\n\n float a_size_min = floor(a_size[0] * 0.5);\n vec2 a_pxoffset = vec2(a_pixeloffset.xy);\n vec2 a_minFontScale = vec2(a_pixeloffset.zw) / 256.0;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size_min, a_size[1], u_size_t) / 128.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size_min / 128.0;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n //gl_Position = u_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * max(a_minFontScale, fontScale) + a_pxoffset / 16.0), 0.0, 1.0);\n gl_Position = u_matrix * vec4(a_projected_pos.xy + rotation_matrix * (a_offset / 32.0 * u_size + a_pxoffset), u_depthRange, 1.0);\n\n v_tex = a_tex / u_texsize;\n // vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n // float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n // v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n v_fade_opacity = 1.0;\n}\n",_0x3d4f6d=(_0x49cb32=!0,function(e,t){var i=_0x49cb32?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x49cb32=!1,i}),_0x33cf80=_0x3d4f6d(void 0,(function(){return _0x33cf80.toString().search("(((.+)+)+)+$").toString().constructor(_0x33cf80).search("(((.+)+)+)+$")})),_0x49cb32;_0x33cf80();var _0x2c9a28="\nuniform sampler2D u_texture;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n //lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, vec2(v_tex.x, 1.0 - v_tex.y)) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x396196=(_0xe474ce=!0,function(e,t){var i=_0xe474ce?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xe474ce=!1,i}),_0x23fa7b=_0x396196(void 0,(function(){return _0x23fa7b.toString().search("(((.+)+)+)+$").toString().constructor(_0x23fa7b).search("(((.+)+)+)+$")})),_0xe474ce;_0x23fa7b();var _0x4a697c="\nconst float PI = 3.141592653589793;\n\n#ifdef WEBGPU\nattribute ivec4 a_pos_offset;\nattribute uvec4 a_data;\nattribute ivec4 a_pixeloffset;\n#else\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec4 a_pixeloffset;\n#endif\nattribute vec3 a_projected_pos;\n//attribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_coord_matrix;\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\nuniform vec2 u_texsize;\nuniform float u_depthRange;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = vec2(a_pos_offset.xy);\n vec2 a_offset = vec2(a_pos_offset.zw);\n\n vec2 a_tex = vec2(a_data.xy);\n vec2 a_size = vec2(a_data.zw);\n\n float a_size_min = floor(a_size[0] * 0.5);\n vec2 a_pxoffset = vec2(a_pixeloffset.xy);\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size_min, a_size[1], u_size_t) / 128.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size_min / 128.0;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n // size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n //vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n //gl_Position = u_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale + a_pxoffset), 0.0, 1.0);\n gl_Position = u_matrix * vec4(a_projected_pos.xy + rotation_matrix * (a_offset / 32.0 * u_size + a_pxoffset), u_depthRange, 1.0);\n float gamma_scale = gl_Position.w;\n\n //vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n //float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n //float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = a_tex / u_texsize;\n v_data1 = vec3(gamma_scale, size, 1.0);\n}\n",_0x3b09ad=(_0x543ded=!0,function(e,t){var i=_0x543ded?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x543ded=!1,i}),_0x2ead0b=_0x3b09ad(void 0,(function(){return _0x2ead0b.toString().search("(((.+)+)+)+$").toString().constructor(_0x2ead0b).search("(((.+)+)+)+$")})),_0x543ded;_0x2ead0b();var _0x553d37="\n#define SDF_PX 8.0\n\nuniform bool u_is_halo;\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform lowp float u_device_pixel_ratio;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n#ifdef WEBGPU\n float dist = texture2D(u_texture, tex).r;\n#else\n float dist = texture2D(u_texture, tex).a;\n#endif\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n //gl_FragColor = color * (alpha * opacity * fade_opacity);\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x21cd3c=(_0x1d4b11=!0,function(e,t){var i=_0x1d4b11?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1d4b11=!1,i}),_0x404888=_0x21cd3c(void 0,(function(){return _0x404888.toString().search("(((.+)+)+)+$").toString().constructor(_0x404888).search("(((.+)+)+)+$")})),_0x1d4b11;_0x404888();var _0x43cde0="\nconst float PI = 3.141592653589793;\n\n#ifdef WEBGPU\nattribute ivec4 a_pos_offset;\nattribute uvec4 a_data;\n#else\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\n#endif\n\nattribute vec3 a_projected_pos;\n//attribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_coord_matrix;\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\nuniform vec2 u_texsize;\nuniform vec2 u_texsize_icon;\nuniform float u_depthRange;\n\nvarying vec4 v_data0;\nvarying vec4 v_data1;\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = vec2(a_pos_offset.xy);\n vec2 a_offset = vec2(a_pos_offset.zw);\n\n vec2 a_tex = vec2(a_data.xy);\n vec2 a_size = vec2(a_data.zw);\n\n float a_size_min = floor(a_size[0] * 0.5);\n float is_sdf = a_size[0] - 2.0 * a_size_min;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size_min, a_size[1], u_size_t) / 128.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size_min / 128.0;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = size / 24.0;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n //gl_Position = u_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n gl_Position = u_matrix * vec4(a_projected_pos.xy + rotation_matrix * (a_offset / 32.0 * u_size + a_pxoffset), u_depthRange, 1.0);\n float gamma_scale = gl_Position.w;\n\n // vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n // float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n // float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0.xy = a_tex / u_texsize;\n v_data0.zw = a_tex / u_texsize_icon;\n //v_data1 = vec4(gamma_scale, size, interpolated_fade_opacity, is_sdf);\n v_data1 = vec4(gamma_scale, size, 1.0, is_sdf); \n}\n",_0x4ffa1e=(_0x22550a=!0,function(e,t){var i=_0x22550a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x22550a=!1,i}),_0xce0477=_0x4ffa1e(void 0,(function(){return _0xce0477.toString().search("(((.+)+)+)+$").toString().constructor(_0xce0477).search("(((.+)+)+)+$")})),_0x22550a;_0xce0477();var _0x277c83="\n#define SDF_PX 8.0\n\n#define SDF 1.0\n#define ICON 0.0\n\nuniform bool u_is_halo;\nuniform sampler2D u_texture;\nuniform sampler2D u_texture_icon;\nuniform highp float u_gamma_scale;\nuniform lowp float u_device_pixel_ratio;\n\nvarying vec4 v_data0;\nvarying vec4 v_data1;\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n// float fade_opacity = v_data1[2];\n\n// if (v_data1.w == ICON) {\n// vec2 tex_icon = v_data0.zw;\n// lowp float alpha = opacity * fade_opacity;\n// gl_FragColor = texture2D(u_texture_icon, tex_icon) * alpha;\n\n// #ifdef OVERDRAW_INSPECTOR\n// gl_FragColor = vec4(1.0);\n// #endif\n// return;\n// }\n\n// vec2 tex = v_data0.xy;\n\n// float EDGE_GAMMA = 0.105 / u_device_pixel_ratio;\n\n// float gamma_scale = v_data1.x;\n// float size = v_data1.y;\n\n// float fontScale = size / 24.0;\n\n// lowp vec4 color = fill_color;\n// highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n// lowp float buff = (256.0 - 64.0) / 256.0;\n// if (u_is_halo) {\n// color = halo_color;\n// gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n// buff = (6.0 - halo_width / fontScale) / SDF_PX;\n// }\n\n// lowp float dist = texture2D(u_texture, tex).a;\n// highp float gamma_scaled = gamma * gamma_scale;\n// highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n// gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x378319=(_0x23873f=!0,function(e,t){var i=_0x23873f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x23873f=!1,i}),_0x35b996=_0x378319(void 0,(function(){return _0x35b996.toString().search("(((.+)+)+)+$").toString().constructor(_0x35b996).search("(((.+)+)+)+$")})),_0x23873f;_0x35b996();var _0xe40dbc="\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_color(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n",_0x20a777=(_0x373e4d=!0,function(e,t){var i=_0x373e4d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x373e4d=!1,i}),_0x1e5b4e=_0x20a777(void 0,(function(){return _0x1e5b4e.toString().search("(((.+)+)+)+$").toString().constructor(_0x1e5b4e).search("(((.+)+)+)+$")})),_0x373e4d;_0x1e5b4e();var _0x2a3dfc="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",_0x3a67f3=(_0x259d5d=!0,function(e,t){var i=_0x259d5d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x259d5d=!1,i}),_0x266c9f=_0x3a67f3(void 0,(function(){return _0x266c9f.toString().search("(((.+)+)+)+$").toString().constructor(_0x266c9f).search("(((.+)+)+)+$")})),_0x259d5d;_0x266c9f();var _0x388b67="\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n",_0x589c5b=(_0x2967d3=!0,function(e,t){var i=_0x2967d3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2967d3=!1,i}),_0x4e3f00=_0x589c5b(void 0,(function(){return _0x4e3f00.toString().search("(((.+)+)+)+$").toString().constructor(_0x4e3f00).search("(((.+)+)+)+$")})),_0x2967d3;_0x4e3f00();var _0x4f9d38="\nuniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",_0x2f3750=(_0x4956ae=!0,function(e,t){var i=_0x4956ae?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4956ae=!1,i}),_0x5d0ef7=_0x2f3750(void 0,(function(){return _0x5d0ef7.toString().search("(((.+)+)+)+$").toString().constructor(_0x5d0ef7).search("(((.+)+)+)+$")})),_0x4956ae;_0x5d0ef7(),_0x49bc87([{name:"a_pos",type:"Int16",components:2}]);var _0x39c0f3=_0xbe3c05(_0x2a3dfc,_0xe40dbc),_0x3d53e0=_0xbe3c05(_0x58f57f,_0x268bc0),_0x48b53f=_0xbe3c05(_0xaa15e0,_0x3535a2),_0x139a6f=_0xbe3c05(_0x565f0b,_0x15de00),_0x5b79fc=_0xbe3c05(_0x2fd75,_0x7b92c3),_0x645d3a=_0xbe3c05(_0x353d96,_0xd79a76),_0x35475e=_0xbe3c05(_0x2161dd,_0x30673f),_0x35bf81=_0xbe3c05(_0x49e300,_0x4067a5),_0x43a220=_0xbe3c05(_0x1f24df,_0x19aa0c),_0x4878b5=_0xbe3c05(_0x552f8f,_0x24e3c5),_0x4b90d9=_0xbe3c05(_0x5640e7,_0x1e5e9b),_0x55e9ee=_0xbe3c05(_0x35ac2b,_0x458cc9),_0x5f37c3=_0xbe3c05(_0x2b464d,_0x519afb),_0x19813e=_0xbe3c05(_0x148b05,_0x59e935),_0x4af88f=_0xbe3c05(_0x21ce53,_0xb4fb06),_0x2be78a=_0xbe3c05(_0x42b191,_0x5290b4),_0x18f2a0=_0xbe3c05(_0x4becdf,_0x25969c),_0x59098b=_0xbe3c05(_0x18397b,_0x2463ac),_0x176d81=_0xbe3c05(_0x47e667,_0x767874),_0x24a034=_0xbe3c05(_0x32b8b0,_0x530167),_0x3764aa=_0xbe3c05(_0x206d61,_0x5a6965),_0x380026=_0xbe3c05(_0x1e425b,_0x7b801),_0x4aa5bd=_0xbe3c05(_0x4f9d38,_0x388b67),_0x2c1fc6=_0xbe3c05(_0x2c9a28,_0x2f6c65),_0x397928=_0xbe3c05(_0x553d37,_0x4a697c),_0x3cf508=_0xbe3c05(_0x277c83,_0x43cde0);function _0xbe3c05(e,t){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return{fragmentSource:e=e.replace(i,(function(e,t,i,n,o){return r[o]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:t=t.replace(i,(function(e,t,i,n,o){var a="float"===n?"vec2":"vec4",s=o.match(/color/)?"color":a;return r[o]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\nvarying "+i+" "+n+" "+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+i+" "+a+" a_"+o+";\n#else\nuniform "+i+" "+n+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = a_"+o+";\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+i+" "+n+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+i+" "+n+" "+o+" = u_"+o+";\n#endif\n"}))}}var _0x47605a=Object.freeze({__proto__:null,prelude:_0x39c0f3,background:_0x3d53e0,backgroundPattern:_0x48b53f,circle:_0x139a6f,clippingMask:_0x5b79fc,heatmap:_0x645d3a,heatmapTexture:_0x35475e,collisionBox:_0x35bf81,collisionCircle:_0x43a220,debug:_0x4878b5,fill:_0x4b90d9,fillOutline:_0x55e9ee,fillOutlinePattern:_0x5f37c3,fillPattern:_0x19813e,fillExtrusion:_0x4af88f,fillExtrusionPattern:_0x2be78a,hillshadePrepare:_0x18f2a0,hillshade:_0x59098b,line:_0x176d81,lineGradient:_0x24a034,linePattern:_0x3764aa,lineSDF:_0x380026,raster:_0x4aa5bd,symbolIcon:_0x2c1fc6,symbolSDF:_0x397928,symbolTextAndIcon:_0x3cf508}),_0x20beee=(_0x9d8be2=!0,function(e,t){var i=_0x9d8be2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x9d8be2=!1,i}),_0x56e09c=_0x20beee(void 0,(function(){return _0x56e09c.toString().search("(((.+)+)+)+$").toString().constructor(_0x56e09c).search("(((.+)+)+)+$")})),_0x9d8be2;_0x56e09c();var _0x3e7eba=(_0x14e2bd=!0,function(e,t){var i=_0x14e2bd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x14e2bd=!1,i}),_0x38d1b6=_0x3e7eba(void 0,(function(){return _0x38d1b6.toString().search("(((.+)+)+)+$").toString().constructor(_0x38d1b6).search("(((.+)+)+)+$")})),_0x14e2bd;_0x38d1b6();var _0x10f141={clippingMaskUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix)}},clippingMaskUniformValues:function(e){return{u_matrix:e}}},_0x36d554=(_0x367a1d=!0,function(e,t){var i=_0x367a1d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x367a1d=!1,i}),_0x248b14=_0x36d554(void 0,(function(){return _0x248b14.toString().search("(((.+)+)+)+$").toString().constructor(_0x248b14).search("(((.+)+)+)+$")})),_0x367a1d;_0x248b14();var _0x3723a1={backgroundUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_opacity:new _0xe46c73.Uniform1f(e,t.u_opacity),u_color:new _0xe46c73.UniformColor(e,t.u_color)}},backgroundPatternUniforms:function(e,t){return{u_matrix:new _0xe46c73.UniformMatrix4f(e,t.u_matrix),u_opacity:new _0xe46c73.Uniform1f(e,t.u_opacity),u_image:new _0xe46c73.Uniform1i(e,t.u_image),u_pattern_tl_a:new _0xe46c73.Uniform2f(e,t.u_pattern_tl_a),u_pattern_br_a:new _0xe46c73.Uniform2f(e,t.u_pattern_br_a),u_pattern_tl_b:new _0xe46c73.Uniform2f(e,t.u_pattern_tl_b),u_pattern_br_b:new _0xe46c73.Uniform2f(e,t.u_pattern_br_b),u_texsize:new _0xe46c73.Uniform2f(e,t.u_texsize),u_mix:new _0xe46c73.Uniform1f(e,t.u_mix),u_pattern_size_a:new _0xe46c73.Uniform2f(e,t.u_pattern_size_a),u_pattern_size_b:new _0xe46c73.Uniform2f(e,t.u_pattern_size_b),u_scale_a:new _0xe46c73.Uniform1f(e,t.u_scale_a),u_scale_b:new _0xe46c73.Uniform1f(e,t.u_scale_b),u_pixel_coord_upper:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _0xe46c73.Uniform2f(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new _0xe46c73.Uniform1f(e,t.u_tile_units_to_pixels)}},backgroundUniformValues:function(e,t,i){return{u_matrix:e,u_opacity:t,u_color:i}},backgroundPatternUniformValues:function(e,t,i,r,n,o){return extend$1(bgPatternUniformValues(r,o,i,n),{u_matrix:e,u_opacity:t})}},_0x28746c=(_0x43a587=!0,function(e,t){var i=_0x43a587?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x43a587=!1,i}),_0x369244=_0x28746c(void 0,(function(){return _0x369244.toString().search("(((.+)+)+)+$").toString().constructor(_0x369244).search("(((.+)+)+)+$")})),_0x43a587;_0x369244(),_0x54079d.fillUniforms,_0x54079d.fillPatternUniforms,_0x54079d.fillOutlineUniforms,_0x54079d.fillOutlinePatternUniforms,_0x349419.circleUniforms,_0x10f141.clippingMaskUniforms,_0x1c9762.lineUniforms,_0x1c9762.lineGradientUniforms,_0x1c9762.linePatternUniforms,_0x1c9762.lineSDFUniforms,_0x3d853a.symbolIconUniforms,_0x3d853a.symbolSDFUniforms,_0x3d853a.symbolTextAndIconUniforms,_0x3723a1.backgroundUniforms,_0x3723a1.backgroundPatternUniforms;var _0x34d9bc=(_0x19009c=!0,function(e,t){var i=_0x19009c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x19009c=!1,i}),_0x2d58b5=_0x34d9bc(void 0,(function(){return _0x2d58b5.toString().search("(((.+)+)+)+$").toString().constructor(_0x2d58b5).search("(((.+)+)+)+$")})),_0x19009c;_0x2d58b5();var _0x21299a=0,_0x583db1=1,_0x340542=771,_0x5ca3f1=function(e,t,i){this.blendFunction=e,this.blendColor=t,this.mask=i};_0x5ca3f1.Replace=[_0x583db1,_0x21299a],_0x5ca3f1.disabled=new _0x5ca3f1(_0x5ca3f1.Replace,_0x25bd71.transparent,[!1,!1,!1,!1]),_0x5ca3f1.unblended=new _0x5ca3f1(_0x5ca3f1.Replace,_0x25bd71.transparent,[!0,!0,!0,!0]),_0x5ca3f1.alphaBlended=new _0x5ca3f1([_0x583db1,_0x340542],_0x25bd71.transparent,[!0,!0,!0,!0]);var _0x39aa5f=(_0x2e9fe6=!0,function(e,t){var i=_0x2e9fe6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2e9fe6=!1,i}),_0xb1cf31=_0x39aa5f(void 0,(function(){return _0xb1cf31.toString().search("(((.+)+)+)+$").toString().constructor(_0xb1cf31).search("(((.+)+)+)+$")})),_0x2e9fe6;_0xb1cf31();var _0x1cbdc6=function(e,t,i){this.context=e;var r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),!this.dynamicDraw&&delete t.arrayBuffer};_0x1cbdc6.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},_0x1cbdc6.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},_0x1cbdc6.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var _0x4da95a=(_0x12b06a=!0,function(e,t){var i=_0x12b06a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x12b06a=!1,i}),_0x47c975=_0x4da95a(void 0,(function(){return _0x47c975.toString().search("(((.+)+)+)+$").toString().constructor(_0x47c975).search("(((.+)+)+)+$")})),_0x12b06a;_0x47c975();var _0x5710ed={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},_0x4860f7=function(e,t,i,r){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;var n=e.gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),!this.dynamicDraw&&delete t.arrayBuffer};_0x4860f7.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},_0x4860f7.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},_0x4860f7.prototype.enableAttributes=function(e,t){for(var i=0;i<this.attributes.length;i++){var r=this.attributes[i],n=t.attributes[r.name];void 0!==n&&e.enableVertexAttribArray(n)}},_0x4860f7.prototype.setVertexAttribPointers=function(e,t,i){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],o=t.attributes[n.name];void 0!==o&&e.vertexAttribPointer(o,n.components,e[_0x5710ed[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}},_0x4860f7.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var _0x492790=function(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};_0x492790.prototype.get=function(){return this.current},_0x492790.prototype.set=function(e){},_0x492790.prototype.getDefault=function(){return this.default},_0x492790.prototype.setDefault=function(){this.set(this.default)};var _0xe37941={};_0xe37941.ClearColor=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return _0x25bd71.transparent},t.prototype.set=function(e){this.current,this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1},t}(_0x492790),_0xe37941.ClearDepth=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 1},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.ClearStencil=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.ColorMask=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[!0,!0,!0,!0]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.DepthMask=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.StencilMask=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 255},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.StencilFunc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return{func:de$y.ALWAYS,ref:0,mask:255}},t.prototype.set=function(e){var t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.StencilOp=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl,[de$y.KEEP,de$y.KEEP,de$y.KEEP]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.StencilTest=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(de$y.STENCIL_TEST):t.disable(de$y.STENCIL_TEST),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.DepthRange=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[0,1]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.DepthTest=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(de$y.DEPTH_TEST):t.disable(de$y.DEPTH_TEST),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.DepthFunc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return de$y.LESS},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.Blend=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getDefault=function(){return!1},n.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(de$y.BLEND):t.disable(de$y.BLEND),this.current=e,this.dirty=!1}},n}(_0x492790),_0xe37941.BlendFunc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[de$y.ONE,de$y.ZERO]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.BlendColor=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return _0x25bd71.transparent},t.prototype.set=function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.BlendEquation=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return de$y.FUNC_ADD},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.CullFace=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(de$y.CULL_FACE):t.disable(de$y.CULL_FACE),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.CullFaceSide=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return de$y.BACK},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.FrontFace=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return de$y.CCW},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.Program=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.ActiveTextureUnit=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return de$y.TEXTURE0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.Viewport=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[0,0,1,1]},t.prototype.set=function(e){this.current,this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1},t}(_0x492790),_0xe37941.BindFramebuffer=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.BindRenderbuffer=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.BindTexture=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.BindVertexBuffer=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.BindElementBuffer=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1},t}(_0x492790),_0xe37941.BindVertexArrayOES=function(e){function t(t){e.call(this,t),this.vao=t.extVertexArrayObject}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.BindVertexArray=function(e){function t(t){e.call(this,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)},t}(_0x492790),_0xe37941.PixelStoreUnpack=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 4},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.PixelStoreUnpackPremultiplyAlpha=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.PixelStoreUnpackFlipY=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},t}(_0x492790),_0xe37941.FramebufferAttachment=function(e){function t(t,i){e.call(this,t),this.context=t,this.parent=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t}(_0x492790),_0xe37941.ColorAttachment=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setDirty=function(){this.dirty=!0},t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},t}(_0xe37941.FramebufferAttachment),_0xe37941.DepthAttachment=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(_0xe37941.FramebufferAttachment);var _0x5be4b1=(_0x25ec3a=!0,function(e,t){var i=_0x25ec3a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x25ec3a=!1,i}),_0x3e540f=_0x5be4b1(void 0,(function(){return _0x3e540f.toString().search("(((.+)+)+)+$").toString().constructor(_0x3e540f).search("(((.+)+)+)+$")})),_0x25ec3a;_0x3e540f();var _0x291f53=function(e){var t=e._gl;this.webgl2=e.webgl2,this.gl=t,this.clearColor=new _0xe37941.ClearColor(this),this.clearDepth=new _0xe37941.ClearDepth(this),this.clearStencil=new _0xe37941.ClearStencil(this),this.colorMask=new _0xe37941.ColorMask(this),this.depthMask=new _0xe37941.DepthMask(this),this.stencilMask=new _0xe37941.StencilMask(this),this.stencilFunc=new _0xe37941.StencilFunc(this),this.stencilOp=new _0xe37941.StencilOp(this),this.stencilTest=new _0xe37941.StencilTest(this),this.depthRange=new _0xe37941.DepthRange(this),this.depthTest=new _0xe37941.DepthTest(this),this.depthFunc=new _0xe37941.DepthFunc(this),this.blend=new _0xe37941.Blend(this),this.blendFunc=new _0xe37941.BlendFunc(this),this.blendColor=new _0xe37941.BlendColor(this),this.blendEquation=new _0xe37941.BlendEquation(this),this.cullFace=new _0xe37941.CullFace(this),this.cullFaceSide=new _0xe37941.CullFaceSide(this),this.frontFace=new _0xe37941.FrontFace(this),this.program=new _0xe37941.Program(this),this.activeTexture=new _0xe37941.ActiveTextureUnit(this),this.viewport=new _0xe37941.Viewport(this),this.bindFramebuffer=new _0xe37941.BindFramebuffer(this),this.bindRenderbuffer=new _0xe37941.BindRenderbuffer(this),this.bindTexture=new _0xe37941.BindTexture(this),this.bindVertexBuffer=new _0xe37941.BindVertexBuffer(this),this.bindElementBuffer=new _0xe37941.BindElementBuffer(this),this.webgl2?this.bindVertexArray=new _0xe37941.BindVertexArray(this):this.bindVertexArray=this.extVertexArrayObject&&new _0xe37941.BindVertexArrayOES(this),this.pixelStoreUnpack=new _0xe37941.PixelStoreUnpack(this),this.pixelStoreUnpackPremultiplyAlpha=new _0xe37941.PixelStoreUnpackPremultiplyAlpha(this),this.pixelStoreUnpackFlipY=new _0xe37941.PixelStoreUnpackFlipY(this),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTimerQuery=!1};function _0xce6557(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!_0xce6557(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(!_0xce6557(e[r],t[r]))return!1;return!0}return e===t}function r$11(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}_0x291f53.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},_0x291f53.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray&&(this.bindVertexArray.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},_0x291f53.prototype.createIndexBuffer=function(e,t){return new _0x1cbdc6(this,e,t)},_0x291f53.prototype.createVertexBuffer=function(e,t,i){return new _0x4860f7(this,e,t,i)},_0x291f53.prototype.createRenderbuffer=function(e,t,i){var r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),n},_0x291f53.prototype.createFramebuffer=function(e,t){return new Framebuffer(this,e,t)},_0x291f53.prototype.clear=function(e){var t=e.color,i=e.depth,r=this.gl,n=0;t&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(n)},_0x291f53.prototype.setCullFace=function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))},_0x291f53.prototype.setDepthMode=function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)},_0x291f53.prototype.setStencilMode=function(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)},_0x291f53.prototype.setColorMode=function(e){_0xce6557(e.blendFunction,_0x5ca3f1.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},_0x291f53.prototype.unbindVAO=function(){this.bindVertexArray&&this.bindVertexArray.set(null)},r$11.ALL=Object.freeze(new r$11({color:new e$1S(0,0,0,0),depth:1,stencil:0})),r$11.prototype.execute=function(e,t){e.clear(this,t)};var _0x1db01f=(_0x4f0066=!0,function(e,t){var i=_0x4f0066?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4f0066=!1,i}),_0x58f757=_0x1db01f(void 0,(function(){return _0x58f757.toString().search("(((.+)+)+)+$").toString().constructor(_0x58f757).search("(((.+)+)+)+$")})),_0x4f0066;_0x58f757();var _0x5064a3={circle:_0x13e3d7,line:_0x510aba,fill:_0x46372a,symbol:_0x178b84},_0x321b84=_0x49bc87([{name:"a_pos",type:"Int16",components:2}]),_0x2db5de=function(e,t,i){this.cesiumContext=e,this.context=new _0x291f53(e),this.width=i,this.height=i,this.transform=t,this.transform.resize(this.width,this.height),this._globalLineWidthScale=1,this.setup(),this.numSublayers=1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new _0x15f87a,this.clearCommand=new r$11({color:new e$1S(0,0,0,0),depth:1})};function _0x230fd2(){var e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function _0xabc9fc(e,t,i,r,n,o,a){var s=1/(t-i),l=1/(r-n),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*l,e[14]=(a+o)*u,e[15]=1,e}function _0x45bef6(e,t,i){var r=i[0],n=i[1],o=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}_0x2db5de.prototype.resize=function(e,t){var i=this.context.gl;if(this.width=e,this.height=t,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var r=0,n=this.style._order;r<n.length;r+=1){var o=n[r];this.style._layers[o].resize()}this.depthRbo&&(i.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},_0x2db5de.prototype.setup=function(){this.context;var e=new _0x58a5fb;e.emplaceBack(0,0),e.emplaceBack(_0xea783f,0),e.emplaceBack(0,_0xea783f),e.emplaceBack(_0xea783f,_0xea783f),this.tileExtentBuffer=_0x24da5b.toVertexBuffer(this.cesiumContext,e,_0x321b84.members),this.tileExtentSegments=_0x33528b.simpleSegment(0,0,4,2);var t=new _0x58a5fb;t.emplaceBack(0,0),t.emplaceBack(_0xea783f,0),t.emplaceBack(0,_0xea783f),t.emplaceBack(_0xea783f,_0xea783f),this.debugBuffer=_0x24da5b.toVertexBuffer(this.cesiumContext,t,_0x321b84.members),this.debugSegments=_0x33528b.simpleSegment(0,0,4,5);var i=new _0x58a5fb;i.emplaceBack(0,0),i.emplaceBack(1,0),i.emplaceBack(0,1),i.emplaceBack(1,1),this.viewportBuffer=_0x24da5b.toVertexBuffer(this.cesiumContext,i,_0x321b84.members),this.viewportSegments=_0x33528b.simpleSegment(0,0,4,2);var r=new _0x5a3fb6;r.emplaceBack(0),r.emplaceBack(1),r.emplaceBack(3),r.emplaceBack(2),r.emplaceBack(0),this.tileBorderIndexBuffer=_0x24da5b.toIndexBuffer(this.cesiumContext,r);var n=new _0x1e1a35;n.emplaceBack(0,1,2),n.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=_0x24da5b.toIndexBuffer(this.cesiumContext,n),this.context.gl,this.stencilClearMode=new _0x1724fa({func:de$y.ALWAYS,mask:0},0,255,de$y.ZERO,de$y.ZERO,de$y.ZERO)},_0x2db5de.prototype.clearStencil=function(){var e=this.context,t=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=_0x230fd2();_0xabc9fc(i,0,this.width,this.height,0,0,1),_0x45bef6(i,i,[this.width,this.height,0]),this.useProgram("clippingMask").draw(e,t.TRIANGLES,_0x16a5dd.disabled,this.stencilClearMode,_0x5ca3f1.disabled,_0x7eb0a6.disabled,_0x10f141.clippingMaskUniformValues(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},_0x2db5de.prototype._renderTileClippingMasks=function(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var i=this.context,r=i.gl;this.nextStencilID+t.length>256&&this.clearStencil(),i.setColorMode(_0x5ca3f1.disabled),i.setDepthMode(_0x16a5dd.disabled);var n=this.useProgram("clippingMask").program;this._tileClippingMaskIDs={};for(var o=0,a=t;o<a.length;o+=1){var s=a[o],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(i,r.TRIANGLES,_0x16a5dd.disabled,new _0x1724fa({func:r.ALWAYS,mask:0},l,255,r.KEEP,r.KEEP,r.REPLACE),_0x5ca3f1.disabled,_0x7eb0a6.disabled,_0x10f141.clippingMaskUniformValues(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},_0x2db5de.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new _0x1724fa({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},_0x2db5de.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new _0x1724fa({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},_0x2db5de.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){var t=1/8;return new _0x5ca3f1([e.CONSTANT_COLOR,e.ONE],new _0x25bd71(t,t,t,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?_0x5ca3f1.unblended:_0x5ca3f1.alphaBlended},_0x2db5de.prototype.depthModeForSublayer=function(e,t,i){if(!this.opaquePassEnabledForLayer())return _0x16a5dd.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new _0x16a5dd(i||de$y.LEQUAL,t,[r,r])},_0x2db5de.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},_0x2db5de.prototype.renderOneTile=function(e,t,i){this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager;var r=this.style._order;for(this.clearCommand.execute(this.cesiumContext,i.passState),this._showOverdrawInspector=!1,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.opaquePassCutoff=1/0,this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var n=this.style._layers[r[this.currentLayer]];this.renderLayerForOneTile(this,t,n,i)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var o=this.style._layers[r[this.currentLayer]];this.renderLayerForOneTile(this,t,o,i)}},_0x2db5de.prototype.render=function(e,t){this.style=e,this.options=t,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(ref_properties.browser.now()),this.imageManager.beginFrame();var i=this.style._order,r=this.style.sourceCaches;for(var n in r){var o=r[n];o.used&&o.prepare(this.context)}var a={},s={},l={};for(var u in r){var c=r[u];a[u]=c.getVisibleCoordinates(),s[u]=a[u].slice().reverse(),l[u]=c.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var h=0;h<i.length;h++){var d=i[h];if(this.style._layers[d].is3D()){this.opaquePassCutoff=h;break}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:t.showOverdrawInspector?_0x25bd71.black:_0x25bd71.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=t.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var f=this.style._layers[i[this.currentLayer]],p=r[f.source],_=a[f.source];this._renderTileClippingMasks(f,_),this.renderLayer(this,p,f,_)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var m=this.style._layers[i[this.currentLayer]],$=r[m.source],g=("symbol"===m.type?l:s)[m.source];this._renderTileClippingMasks(m,a[m.source]),this.renderLayer(this,$,m,g)}this.context.setDefault()},_0x2db5de.prototype.setupOffscreenDepthRenderbuffer=function(){var e=this.context;!this.depthRbo&&(this.depthRbo=e.createRenderbuffer(e.gl.DEPTH_COMPONENT16,this.width,this.height))},_0x2db5de.prototype.renderLayerForOneTile=function(e,t,i,r){null!=i&&(i.isHidden(t.requestZ)||(this.id=i.id,_0x5064a3[i.type](e,t,i,r)))},_0x2db5de.prototype.renderLayer=function(e,t,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||r.length)&&(this.id=i.id,_0x5064a3[i.type](e,t,i,r,this.style.placement.variableOffsets))},_0x2db5de.prototype.translatePosMatrix=function(e,t,i,r,n){if(!i[0]&&!i[1])return e;var o=n?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(o){var a=Math.sin(o),s=Math.cos(o);i=[i[0]*s-i[1]*a,i[0]*a+i[1]*s]}var l=[n?i[0]:pixelsToTileUnits(t,i[0],this.transform.zoom),n?i[1]:pixelsToTileUnits(t,i[1],this.transform.zoom),0],u=new Float32Array(16);return _0x1d4fb9.mat4.translate(u,e,l),u},_0x2db5de.prototype.isPatternMissing=function(e){if(!e)return!1;var t=this.imageManager.getPattern(e.from.toString()),i=this.imageManager.getPattern(e.to.toString());return!t||!i},_0x2db5de.prototype.useProgram=function(e,t,i){void 0===t&&(t=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+e+(t.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");if(!this.cache[r]){var n=_0x47605a[e];this.cache[r]={};var o=t.defines(),a=_0x47605a.prelude.vertexSource.concat(n.vertexSource),s=_0x47605a.prelude.fragmentSource.concat(n.fragmentSource),l=new a$$({name:e+"_vp",defines:o,sources:[a]}),u=new a$$({name:e+"_fp",defines:o,sources:[s]}),c=i||t.getAttributeLocation(),h=S$T.fromCache({name:r,context:this.cesiumContext,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c});this.cache[r].cesiumProgram=h}return this.cache[r]},_0x2db5de.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_0x2db5de.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)};var _0x34c27d=(_0xe0308d=!0,function(e,t){var i=_0xe0308d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xe0308d=!1,i}),_0x3f334d=_0x34c27d(void 0,(function(){return _0x3f334d.toString().search("(((.+)+)+)+$").toString().constructor(_0x3f334d).search("(((.+)+)+)+$")})),_0xe0308d;_0x3f334d();var _0x5a7a91=_0x49bc87([{name:"a_pos",components:2,type:"Int16"}],4),_0x35d25f=_0x5a7a91.members,_0x4c0a5e=_0x49bc87([{name:"a_pos",components:2,type:"Float32"}],4),_0x9b4e0f=_0x4c0a5e.members;function _0x4de5f4(e,t,i,r,n){e.emplaceBack(2*t+(r+1)/2,2*i+(n+1)/2)}var _0x3e4f7f=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this._sourceLayerIds={};var t=this;this.layerIds=this.layers.map((function(e,i){return t._sourceLayerIds[e.sourceLayer]=i,e.sourceLayer})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new _0x58a5fb,this.indexArray=new _0x1e1a35,this.segments=new _0x33528b,this.programConfigurations=new ProgramConfigurationSet(_0x35d25f,e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};_0x3e4f7f.prototype.populate=function(e,t){var i=this.layers[0],r=[],n=null;"circle"===i.type&&(n=i.layout.get("circle-sort-key"));for(var o=0,a=e;o<a.length;o+=1){var s=a[o],l=s.feature,u=s.index,c=s.sourceLayerIndex,h=s.sourceLayerId,d=this._sourceLayerIds[h],f=this.layers[d];if(f){var p=_0xea783f/512,_=f.paint.get("circle-radius").value.value*p;if(this.layers[0]._featureFilter(new _0x105812(0),l)){var m=_0x3e7ee3(l),$=n?n.evaluate(l,{}):void 0,g={id:l.id,properties:l.properties,type:l.type,sourceLayerIndex:c,index:u,geometry:m,patterns:{},sortKey:$,circleRadius:_};r.push(g)}}}n&&r.sort((function(e,t){return e.sortKey-t.sortKey}));for(var v=0,y=r;v<y.length;v+=1){var x=y[v],b=x,w=b.geometry,C=b.index,T=b.sourceLayerIndex,S=e[C].feature;this.addFeature(x,w,C),t.featureIndex.insert(S,w,C,T,this.index,void 0,b.circleRadius)}},_0x3e4f7f.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},_0x3e4f7f.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_0x3e4f7f.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_0x3e4f7f.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=e.webgpu?_0x9b4e0f:_0x35d25f;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=_0x24da5b.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=_0x24da5b.toIndexBuffer(e,this.indexArray))}this.programConfigurations.upload(e),this.uploaded=!0},_0x3e4f7f.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},_0x3e4f7f.prototype.clear=function(){e$28(this.layoutVertexArray)&&(this.layoutVertexArray=null),e$28(this.indexArray)&&(this.indexArray=null)},_0x3e4f7f.prototype.addFeature=function(e,t,i){for(var r=0,n=t;r<n.length;r+=1)for(var o=0,a=n[r];o<a.length;o+=1){var s=a[o],l=s.x,u=s.y;if(!(l<0||l>=_0xea783f||u<0||u>=_0xea783f)){var c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),h=c.vertexLength;_0x4de5f4(this.layoutVertexArray,l,u,-1,-1),_0x4de5f4(this.layoutVertexArray,l,u,1,-1),_0x4de5f4(this.layoutVertexArray,l,u,1,1),_0x4de5f4(this.layoutVertexArray,l,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),c.vertexLength+=4,c.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{})},_0x36ace8.register("CircleBucket",_0x3e4f7f,{omit:["layers"]});var _0x462ac8=(_0xcc0375=!0,function(e,t){var i=_0xcc0375?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xcc0375=!1,i}),_0x2734c9=_0x462ac8(void 0,(function(){return _0x2734c9.toString().search("(((.+)+)+)+$").toString().constructor(_0x2734c9).search("(((.+)+)+)+$")})),_0xcc0375;function _0x561451(){}_0x2734c9(),_0x561451.getMaximumPaintValue=function(e,t,i){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:i.programConfigurations.get(t.id).binders[e].maxValue},_0x561451.translateDistance=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},_0x561451.translate=function(e,t,i,r,n){if(!t||!t[0]&&!t[1])return e;var o=_0x36c32e.convert(t)._mult(n);"viewport"===i&&o._rotate(-r);for(var a=[],s=0;s<e.length;s++){var l=e[s];a.push(l.sub(o))}return a};var _0x477125=new _0x5a6206({"circle-sort-key":new _0x237b98(_0x337989.layout_circle["circle-sort-key"])}),_0x9493ad=new _0x5a6206({"circle-radius":new _0x237b98(_0x337989.paint_circle["circle-radius"]),"circle-color":new _0x237b98(_0x337989.paint_circle["circle-color"]),"circle-blur":new _0x237b98(_0x337989.paint_circle["circle-blur"]),"circle-opacity":new _0x237b98(_0x337989.paint_circle["circle-opacity"]),"circle-translate":new _0x5ac8f5(_0x337989.paint_circle["circle-translate"]),"circle-translate-anchor":new _0x5ac8f5(_0x337989.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new _0x5ac8f5(_0x337989.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new _0x5ac8f5(_0x337989.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new _0x237b98(_0x337989.paint_circle["circle-stroke-width"]),"circle-stroke-color":new _0x237b98(_0x337989.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new _0x237b98(_0x337989.paint_circle["circle-stroke-opacity"])}),_0x4c59f1={paint:_0x9493ad,layout:_0x477125},_0x30f994=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,_0x4c59f1)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.createBucket=function(e){return new _0x3e4f7f(e)},n.prototype.queryRadius=function(e){var t=e;return _0x561451.getMaximumPaintValue("circle-radius",this,t)+_0x561451.getMaximumPaintValue("circle-stroke-width",this,t)+_0x561451.translateDistance(this.paint.get("circle-translate"))},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a,s,l){s=_0x135b1();for(var u=_0x561451.translate(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),0,a),c=this.paint.get("circle-radius"),h=this.paint.get("circle-stroke-width"),d=(void 0===c?void 0:c.evaluate(t,i))+(void 0===h?void 0:h.evaluate(t,i)),f="map"===this.paint.get("circle-pitch-alignment"),p=f?u:_0x5208c5(u,s),_=f?d*a:d,m=0,$=r;m<$.length;m+=1)for(var g=0,v=$[m];g<v.length;g+=1){var y=v[g],x=f?y:_0x3d405a(y,s),b=_;if(_0x2f0f81([],[y.x,y.y,0,1],s),"viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")||"map"===this.paint.get("circle-pitch-scale")&&this.paint.get("circle-pitch-alignment"),l=e$28(l)?l:10,_0x279f3d.polygonIntersectsBufferedPoint(p,x,b*l))return!0}return!1},n}(_0x5ad949);function _0x3d405a(e,t){var i=_0x2f0f81([],[e.x,e.y,0,1],t);return new _0x36c32e(i[0],i[1])}function _0x5208c5(e,t){return e.map((function(e){return _0x3d405a(e,t)}))}function _0x135b1(){var e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function _0x2f0f81(e,t,i){var r=t[0],n=t[1],o=t[2],a=i[3]*r+i[7]*n+i[11]*o+i[15];return a=a||1,e[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/a,e[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/a,e[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/a,e}var _0x1a161d=(_0x406b7e=!0,function(e,t){var i=_0x406b7e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x406b7e=!1,i}),_0x1391bf=_0x1a161d(void 0,(function(){return _0x1391bf.toString().search("(((.+)+)+)+$").toString().constructor(_0x1391bf).search("(((.+)+)+)+$")})),_0x406b7e;function _0x5b9303(e,t,i,r,n){for(var o=n.patternDependencies,a=0,s=t;a<s.length;a+=1){var l=s[a],u=l.paint.get(e+"-pattern").value;if("constant"!==u.kind){var c=u.evaluate({zoom:r-1},i,{},n.availableImages),h=u.evaluate({zoom:r},i,{},n.availableImages),d=u.evaluate({zoom:r+1},i,{},n.availableImages);c=c&&c.name?c.name:c,h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,o[c]=!0,o[h]=!0,o[d]=!0,i.patterns[l.id]={min:c,mid:h,max:d}}}return i}_0x1391bf();var _0x5874e1=(_0x16773d=!0,function(e,t){var i=_0x16773d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x16773d=!1,i}),_0x4fac7b=_0x5874e1(void 0,(function(){return _0x4fac7b.toString().search("(((.+)+)+)+$").toString().constructor(_0x4fac7b).search("(((.+)+)+)+$")})),_0x16773d;function _0x55525d(e,t,i){for(var r=i.patternDependencies,n=!1,o=0,a=t;o<a.length;o+=1){var s=a[o].paint.get(e+"-pattern");!s.isConstant()&&(n=!0);var l=s.constantOr(null);l&&(n=!0,r[l.to]=!0,r[l.from]=!0)}return n}_0x4fac7b();var _0x5d9e48=(_0x154afd=!0,function(e,t){var i=_0x154afd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x154afd=!1,i}),_0x302e9c=_0x5d9e48(void 0,(function(){return _0x302e9c.toString().search("(((.+)+)+)+$").toString().constructor(_0x302e9c).search("(((.+)+)+)+$")})),_0x154afd;_0x302e9c();var _0x168139=_0x49bc87([{name:"a_pos",components:2,type:"Int16"}],4),_0x243e2f=_0x168139.members,_0xa965ad=500,_0x3ff42f=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _0x58a5fb,this.indexArray=new _0x1e1a35,this.indexArray2=new _0x41aa31,this.programConfigurations=new ProgramConfigurationSet(_0x243e2f,e.layers,e.zoom),this.segments=new _0x33528b,this.segments2=new _0x33528b,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};_0x3ff42f.prototype.populate=function(e,t){this.hasPattern=_0x55525d("fill",this.layers,t);for(var i=[],r=0,n=e;r<n.length;r+=1){var o=n[r],a=o.feature,s=o.index,l=o.sourceLayerIndex;if(this.layers[0]._featureFilter(new _0x105812(0),a)){var u=_0x3e7ee3(a),c={id:a.id,properties:a.properties,type:a.type,sourceLayerIndex:l,index:s,geometry:u,patterns:{},sortKey:undefined};i.push(c)}}for(var h=0,d=i;h<d.length;h+=1){var f=d[h],p=f,_=p.geometry,m=p.index,$=p.sourceLayerIndex;if(this.hasPattern){var g=_0x5b9303("fill",this.layers,f,this.zoom,t);this.patternFeatures.push(g)}else this.addFeature(f,_,m,{},t.indexData);var v=e[m].feature;t.featureIndex.insert(v,_,m,$,this.index)}},_0x3ff42f.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},_0x3ff42f.prototype.addFeatures=function(e,t){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var n=r[i];this.addFeature(n,n.geometry,n.index,t)}},_0x3ff42f.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_0x3ff42f.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_0x3ff42f.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=_0x243e2f;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=_0x24da5b.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=_0x24da5b.toIndexBuffer(e,this.indexArray),this.cesiumIndexBuffer2=_0x24da5b.toIndexBuffer(e,this.indexArray2))}this.programConfigurations.upload(e),this.uploaded=!0},_0x3ff42f.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer&&this.cesiumIndexBuffer.destroy(),this.cesiumIndexBuffer2&&this.cesiumIndexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},_0x3ff42f.prototype.clear=function(){e$28(this.layoutVertexArray)&&(this.layoutVertexArray=null),e$28(this.indexArray)&&(this.indexArray=null),e$28(this.indexArray2)&&(this.indexArray2=null)},_0x3ff42f.prototype.addFeature=function(e,t,i,r,n){for(var o=0,a=_0xf3eac0(t,_0xa965ad);o<a.length;o+=1){for(var s=a[o],l=0,u=0,c=s;u<c.length;u+=1){var h=c[u];l+=h.length}for(var d,f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=f.vertexLength,_=[],m=[],$=0,g=s;$<g.length;$+=1){var v=g[$];if(0!==v.length){if(v!==s[0]&&m.push(_.length/2),h.length>_0x33528b.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof _0x1e1a35){let e=this.indexArray,t=this.indexArray2;this.indexArray=new _0xe091d7,this.indexArray2=new _0x108a02,this.indexArray.copyFrom3ui6(e),this.indexArray2.copyFrom2ui4(t)}var y=this.segments2.prepareSegment(v.length,this.layoutVertexArray,this.indexArray2),x=y.vertexLength;this.layoutVertexArray.emplaceBack(v[0].x,v[0].y),this.indexArray2.emplaceBack(x+v.length-1,x),_.push(v[0].x),_.push(v[0].y);for(var b=1;b<v.length;b++)this.layoutVertexArray.emplaceBack(v[b].x,v[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),_.push(v[b].x),_.push(v[b].y);y.vertexLength+=v.length,y.primitiveLength+=v.length}}d=e$28(n)&&e$28(n[e.id])?n[e.id]:z$W(_,m);for(var w=0;w<d.length;w+=3)this.indexArray.emplaceBack(p+d[w],p+d[w+1],p+d[w+2]);f.vertexLength+=l,f.primitiveLength+=d.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,r)},_0x36ace8.register("FillBucket",_0x3ff42f,{omit:["layers","patternFeatures"]});var _0x775f24=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.possiblyEvaluate=function(e,t,i){if(void 0===e.value)return new _0x436bfd(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var r=e.expression.evaluate(t,null,{},i),n="resolvedImage"===e.property.specification.type&&"string"!=typeof r?r.name:r,o=this._calculate(n,n,n,t);return new _0x436bfd(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){var a=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new _0x436bfd(this,{kind:"constant",value:a},t)}return new _0x436bfd(this,e.expression,t)},n.prototype.evaluate=function(e,t,i,r,n){if("source"===e.kind){var o=e.evaluate(t,i,r,n);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},i,r),e.evaluate({zoom:Math.floor(t.zoom)},i,r),e.evaluate({zoom:Math.floor(t.zoom)+1},i,r),t):e.value},n.prototype._calculate=function(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}},n.prototype.interpolate=function(e){return e},n}(_0x237b98);_0x36ace8.register("DataDrivenProperty",_0x237b98);var _0x1b1733=new _0x5a6206({"fill-sort-key":new _0x237b98(_0x337989.layout_fill["fill-sort-key"])}),_0x249b81=new _0x5a6206({"fill-antialias":new _0x5ac8f5(_0x337989.paint_fill["fill-antialias"]),"fill-opacity":new _0x237b98(_0x337989.paint_fill["fill-opacity"]),"fill-color":new _0x237b98(_0x337989.paint_fill["fill-color"]),"fill-outline-color":new _0x237b98(_0x337989.paint_fill["fill-outline-color"]),"fill-translate":new _0x5ac8f5(_0x337989.paint_fill["fill-translate"]),"fill-translate-anchor":new _0x5ac8f5(_0x337989.paint_fill["fill-translate-anchor"]),"fill-pattern":new _0x775f24(_0x337989.paint_fill["fill-pattern"])}),_0x1fbe5a={paint:_0x249b81,layout:_0x1b1733},_0x40369e=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t){e.call(this,t,_0x1fbe5a)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.recalculate=function(t,i){e.prototype.recalculate.call(this,t,i);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},n.prototype.createBucket=function(e){return new _0x3ff42f(e)},n.prototype.queryRadius=function(){return _0x561451.translateDistance(this.paint.get("fill-translate"))},n.prototype.queryIntersectsFeature=function(e,t,i,r,n,o,a){var s=_0x561451.translate(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),0,a);return _0x279f3d.polygonIntersectsMultiPolygon(s,r)},n.prototype.isTileClipped=function(){return!0},n}(_0x5ad949),_0x57e133=(_0x29d849=!0,function(e,t){var i=_0x29d849?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x29d849=!1,i}),_0x37e96c=_0x57e133(void 0,(function(){return _0x37e96c.toString().search("(((.+)+)+)+$").toString().constructor(_0x37e96c).search("(((.+)+)+)+$")})),_0x29d849;_0x37e96c();var _0x1704c0=["Unknown","Point","LineString","Polygon"],_0x2aa0fa=_0x49bc87([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),_0x2fa0e0=_0x2aa0fa.members,_0x15a60a=63,_0x5095ee=Math.cos(Math.PI/180*37.5),_0x17bfd1=15,_0x1516c5=20,_0xfd03e7=15,_0x3efb61=.5,_0x212286=Math.pow(2,_0xfd03e7-1)/_0x3efb61,_0x476614=function(e){this.zoom=e.zoom,this.overscaling=1,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _0x43b0b2,this.indexArray=new _0x1e1a35,this.programConfigurations=new ProgramConfigurationSet(_0x2fa0e0,e.layers,e.zoom),this.segments=new _0x33528b,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};_0x476614.prototype.populate=function(e,t){this.hasPattern=!1;for(var i=this.layers[0].layout.get("line-sort-key"),r=[],n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.feature,l=a.index,u=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new _0x105812(0),s)){var c=_0x3e7ee3(s),h=i?i.evaluate(s,{}):void 0,d={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:c,patterns:{},sortKey:h};r.push(d)}}i&&r.sort((function(e,t){return e.sortKey-t.sortKey}));for(var f=0,p=r;f<p.length;f+=1){var _=p[f],m=_,$=m.geometry,g=m.index,v=m.sourceLayerIndex;if(this.hasPattern){var y=_0x5b9303("line",this.layers,_,this.zoom,t);this.patternFeatures.push(y)}else this.addFeature(_,$,g,{});var x=e[g].feature;t.featureIndex.insert(x,$,g,v,this.index)}},_0x476614.prototype.update=function(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)},_0x476614.prototype.addFeatures=function(e,t){for(var i=0,r=this.patternFeatures;i<r.length;i+=1){var n=r[i];this.addFeature(n,n.geometry,n.index,t)}},_0x476614.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},_0x476614.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},_0x476614.prototype.upload=function(e){if(!this.uploaded){if(null==this.layoutVertexArray)return;var t=_0x2fa0e0;this.layoutVertexArray.length>0&&(this.layoutCesiumVertexBuffer=_0x24da5b.toVertexBuffer(e,this.layoutVertexArray,t),this.cesiumIndexBuffer=_0x24da5b.toIndexBuffer(e,this.indexArray))}this.programConfigurations.upload(e),this.uploaded=!0},_0x476614.prototype.destroy=function(){this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer&&(this.layoutCesiumVertexBuffer.destroy(),this.cesiumIndexBuffer.destroy()),this.programConfigurations.destroy(),this.segments.destroy())},_0x476614.prototype.clear=function(){e$28(this.layoutVertexArray)&&(this.layoutVertexArray=null),e$28(this.indexArray)&&(this.indexArray=null)},_0x476614.prototype.addFeature=function(e,t,i,r){for(var n=this.layers[0].layout,o=n.get("line-join").evaluate(e,{}),a=n.get("line-cap"),s=n.get("line-miter-limit"),l=n.get("line-round-limit"),u=0,c=t;u<c.length;u+=1){var h=c[u];this.addLine(h,e,o,a,s,l,i,r)}},_0x476614.prototype.addLine=function(e,t,i,r,n,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+t.properties.mapbox_clip_start,this.clipEnd=+t.properties.mapbox_clip_end;for(var l=0;l<e.length-1;l++)this.totalDistance+=e[l].dist(e[l+1])}for(var u="Polygon"===_0x1704c0[t.type],c=e.length;c>=2&&e[c-1].equals(e[c-2]);)c--;for(var h=0;h<c-1&&e[h].equals(e[h+1]);)h++;if(!(c<(u?3:2))){"bevel"===i&&(n=1.05);var d=this.overscaling<=16?_0x17bfd1*_0xea783f/(512*this.overscaling):0;if(10*c>_0x33528b.MAX_VERTEX_ARRAY_LENGTH&&this.indexArray instanceof _0x1e1a35){let e=this.indexArray;this.indexArray=new _0xe091d7,this.indexArray.copyFrom3ui6(e)}var f,p=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray),_=void 0,m=void 0,$=void 0,g=void 0;this.e1=this.e2=-1,u&&(f=e[c-2],g=e[h].sub(f)._unit()._perp());for(var v=h;v<c;v++)if(!(m=u&&v===c-1?e[h+1]:e[v+1])||!e[v].equals(m)){g&&($=g),f&&(_=f),f=e[v],g=m?m.sub(f)._unit()._perp():$;var y=($=$||g).add(g);(0!==y.x||0!==y.y)&&y._unit();var x=$.x*g.x+$.y*g.y,b=y.x*g.x+y.y*g.y,w=0!==b?1/b:1/0,C=2*Math.sqrt(2-2*b),T=b<_0x5095ee&&_&&m,S=$.x*g.y-$.y*g.x>0;if(T&&v>h){var E=f.dist(_);if(E>2*d){var A=f.sub(f.sub(_)._mult(d/E)._round());this.updateDistance(_,A),this.addCurrentVertex(A,$,0,0,p),_=A}}var P=_&&m,I=P?i:u?"butt":r;if(P&&"round"===I&&(w<o?I="miter":w<=2&&(I="fakeround")),"miter"===I&&w>n&&(I="bevel"),"bevel"===I&&(w>2&&(I="flipbevel"),w<n&&(I="miter")),_&&this.updateDistance(_,f),"miter"===I)y._mult(w),this.addCurrentVertex(f,y,0,0,p);else if("flipbevel"===I){if(w>100)y=g.mult(-1);else{var M=w*$.add(g).mag()/$.sub(g).mag();y._perp()._mult(M*(S?-1:1))}this.addCurrentVertex(f,y,0,0,p),this.addCurrentVertex(f,y.mult(-1),0,0,p)}else if("bevel"===I||"fakeround"===I){var O=-Math.sqrt(w*w-1),D=S?O:0,R=S?0:O;if(_&&this.addCurrentVertex(f,$,D,R,p),"fakeround"===I)for(var L=Math.round(180*C/Math.PI/_0x1516c5),B=1;B<L;B++){var N=B/L;if(.5!==N){var F=N-.5;N+=N*F*(N-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*F*F+(.848013+x*(.215638*x-1.06021)))}var z=g.sub($)._mult(N)._add($)._unit()._mult(S?-1:1);this.addHalfVertex(f,z.x,z.y,!1,S,0,p)}m&&this.addCurrentVertex(f,g,-D,-R,p)}else if("butt"===I)this.addCurrentVertex(f,y,0,0,p);else if("square"===I){var k=_?1:-1;this.addCurrentVertex(f,y,k,k,p)}else"round"===I&&(_&&(this.addCurrentVertex(f,$,0,0,p),this.addCurrentVertex(f,$,1,1,p,!0)),m&&(this.addCurrentVertex(f,g,-1,-1,p,!0),this.addCurrentVertex(f,g,0,0,p)));if(T&&v<c-1){var V=f.dist(m);if(V>2*d){var U=f.add(m.sub(f)._mult(d/V)._round());this.updateDistance(f,U),this.addCurrentVertex(U,g,0,0,p),f=U}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,s)}},_0x476614.prototype.addCurrentVertex=function(e,t,i,r,n,o){void 0===o&&(o=!1);var a=t.x+t.y*i,s=t.y-t.x*i,l=-t.x+t.y*r,u=-t.y-t.x*r;this.addHalfVertex(e,a,s,o,!1,i,n),this.addHalfVertex(e,l,u,o,!0,-r,n),this.distance>_0x212286/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,i,r,n,o))},_0x476614.prototype.addHalfVertex=function(e,t,i,r,n,o,a){var s=e.x,l=e.y,u=this.scaledDistance*_0x3efb61;this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(l<<1)+(n?1:0),Math.round(_0x15a60a*t)+128,Math.round(_0x15a60a*i)+128,1+(0===o?0:o<0?-1:1)|(63&u)<<2,u>>6);var c=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),n?this.e2=c:this.e1=c},_0x476614.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(_0x212286-1):this.distance},_0x36ace8.register("LineBucket",_0x476614,{omit:["layers","patternFeatures"]});var _0x54ee6a=(_0x27d086=!0,function(e,t){var i=_0x27d086?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x27d086=!1,i}),_0x4a3d47=_0x54ee6a(void 0,(function(){return _0x4a3d47.toString().search("(((.+)+)+)+$").toString().constructor(_0x4a3d47).search("(((.+)+)+)+$")})),_0x27d086;_0x4a3d47();var _0x37f02d=function(e){this.specification=e};_0x37f02d.prototype.possiblyEvaluate=function(e,t,i){if(void 0!==e.value){if("constant"===e.expression.kind){var r=e.expression.evaluate(t,null,{},i);return this._calculate(r,r,r,t)}return this._calculate(e.expression.evaluate(new _0x105812(Math.floor(t.zoom-1),t)),e.expression.evaluate(new _0x105812(Math.floor(t.zoom),t)),e.expression.evaluate(new _0x105812(Math.floor(t.zoom+1),t)),t)}},_0x37f02d.prototype._calculate=function(e,t,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}},_0x37f02d.prototype.interpolate=function(e){return e},_0x36ace8.register("CrossFadedProperty",_0x37f02d);var _0x31c94f=(_0x7145e8=!0,function(e,t){var i=_0x7145e8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x7145e8=!1,i}),_0x397304=_0x31c94f(void 0,(function(){return _0x397304.toString().search("(((.+)+)+)+$").toString().constructor(_0x397304).search("(((.+)+)+)+$")})),_0x7145e8;_0x397304();var _0x180db5=function(e){this.specification=e};_0x180db5.prototype.possiblyEvaluate=function(e,t,i){return!!e.expression.evaluate(t,null,{},i)},_0x180db5.prototype.interpolate=function(){return!1},_0x36ace8.register("ColorRampProperty",_0x180db5);var _0x48f09f=new _0x5a6206({"line-cap":new _0x5ac8f5(_0x337989.layout_line["line-cap"]),"line-join":new _0x237b98(_0x337989.layout_line["line-join"]),"line-miter-limit":new _0x5ac8f5(_0x337989.layout_line["line-miter-limit"]),"line-round-limit":new _0x5ac8f5(_0x337989.layout_line["line-round-limit"]),"line-sort-key":new _0x237b98(_0x337989.layout_line["line-sort-key"])}),_0x48df03=new _0x5a6206({"line-opacity":new _0x237b98(_0x337989.paint_line["line-opacity"]),"line-color":new _0x237b98(_0x337989.paint_line["line-color"]),"line-translate":new _0x5ac8f5(_0x337989.paint_line["line-translate"]),"line-translate-anchor":new _0x5ac8f5(_0x337989.paint_line["line-translate-anchor"]),"line-width":new _0x237b98(_0x337989.paint_line["line-width"]),"line-gap-width":new _0x237b98(_0x337989.paint_line["line-gap-width"]),"line-offset":new _0x237b98(_0x337989.paint_line["line-offset"]),"line-blur":new _0x237b98(_0x337989.paint_line["line-blur"]),"line-dasharray":new _0x37f02d(_0x337989.paint_line["line-dasharray"]),"line-pattern":new _0x775f24(_0x337989.paint_line["line-pattern"]),"line-gradient":new _0x180db5(_0x337989.paint_line["line-gradient"])}),_0x2c2e3a={paint:_0x48df03,layout:_0x48f09f},_0x50b75d=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(){e.apply(this,arguments)}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.possiblyEvaluate=function(t,i){return i=new _0x105812(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),e.prototype.possiblyEvaluate.call(this,t,i)},n.prototype.evaluate=function(t,i,r,n){return i=extend({},i,{zoom:Math.floor(i.zoom)}),e.prototype.evaluate.call(this,t,i,r,n)},n}(_0x237b98),_0x57b047=new _0x50b75d(_0x2c2e3a.paint.properties["line-width"].specification);_0x57b047.useIntegerZoom=!0;var _0x3fe6a2=function(e){function t(t){e.call(this,t,_0x2c2e3a)}function i(e,t){return t>0?t+2*e:e}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){"line-gradient"===e&&this._updateGradient()},t.prototype._updateGradient=function(){var e=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=renderColorRamp(e,"lineProgress"),this.gradientTexture=null},t.prototype.recalculate=function(t,i){e.prototype.recalculate.call(this,t,i),this.paint._values["line-floorwidth"]=_0x57b047.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new _0x476614(e)},t.prototype.queryRadius=function(e){var t=e,r=i(_0x561451.getMaximumPaintValue("line-width",this,t),_0x561451.getMaximumPaintValue("line-gap-width",this,t)),n=_0x561451.getMaximumPaintValue("line-offset",this,t);return r/2+Math.abs(n)+_0x561451.translateDistance(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,o,a,s){var l=_0x561451.translate(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),0,s),u=this.paint.get("line-width"),c=this.paint.get("line-gap-width"),h=i(void 0===u?void 0:u.evaluate(t,r),void 0===c?void 0:c.evaluate(t,r)),d=s/2*(h=Math.max(h,5)),f=this.paint.get("line-offset"),p=void 0===f?void 0:f.evaluate(t,r);return p&&(n=function(e,t){for(var i=[],r=new _0x36c32e(0,0),n=0;n<e.length;n++){for(var o=e[n],a=[],s=0;s<o.length;s++){var l=o[s-1],u=o[s],c=o[s+1],h=0===s?r:u.sub(l)._unit()._perp(),d=s===o.length-1?r:c.sub(u)._unit()._perp(),f=h._add(d)._unit(),p=f.x*d.x+f.y*d.y;f._mult(1/p),a.push(f._mult(t)._add(u))}i.push(a)}return i}(n,p*s)),_0x279f3d.polygonIntersectsBufferedMultiLine(l,n,d)},t.prototype.isTileClipped=function(){return!0},t}(_0x5ad949),_0x1322b6=(_0x170146=!0,function(e,t){var i=_0x170146?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x170146=!1,i}),_0x34560b=_0x1322b6(void 0,(function(){return _0x34560b.toString().search("(((.+)+)+)+$").toString().constructor(_0x34560b).search("(((.+)+)+)+$")})),_0x170146;_0x34560b();var _0x3232f9={circle:_0x30f994,fill:_0x40369e,line:_0x3fe6a2,symbol:_0x53295d};function _0x10c42b(e){return _0x3232f9[e.type]?new _0x3232f9[e.type](e):null}const _0x4c2ac0=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x5831bd=_0x4c2ac0(void 0,(function(){return _0x5831bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x5831bd).search("(((.+)+)+)+$")}));function _0x1f4db5(e,t,i){let r,n,o;const a=_0x173cff.devicePixelRatio>1?"@2x":"";let s=getJSON(t.transformRequest(t.normalizeSpriteURL(e,a,".json"),_0x3c09b7.SpriteJSON),((e,t)=>{s=null,!o&&(o=e,r=t,u())})),l=getImage(t.transformRequest(t.normalizeSpriteURL(e,a,".png"),_0x3c09b7.SpriteImage),((e,t)=>{l=null,!o&&(o=e,n=t,u())}));function u(){if(o)i(o);else if(r&&n){const e=_0x173cff.getImageData(n,0),t={};for(const i in r){const{width:n,height:o,x:a,y:s,sdf:l,pixelRatio:u,stretchX:c,stretchY:h,content:d}=r[i],f=new _0x1421cc({width:n,height:o});_0x1421cc.copy(e,f,{x:a,y:s},{x:0,y:0},{width:n,height:o}),t[i]={data:f,pixelRatio:u,sdf:l,stretchX:c,stretchY:h,content:d}}i(null,t)}}return{cancel(){s&&(s.cancel(),s=null),l&&(l.cancel(),l=null)}}}_0x5831bd();var _0x29b439=(_0x2bceab=!0,function(e,t){var i=_0x2bceab?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2bceab=!1,i}),_0x86b941=_0x29b439(void 0,(function(){return _0x86b941.toString().search("(((.+)+)+)+$").toString().constructor(_0x86b941).search("(((.+)+)+)+$")})),_0x2bceab;_0x86b941();var _0x155afd=1;function _0x187c3b(){this.images={},this.imageCount=0,this.imageList=[],this.imagesCanvas={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new _0x1421cc({width:1,height:1}),this.dirty=!0}_0x187c3b.prototype.isLoaded=function(){return this.loaded},_0x187c3b.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,i=this.requestors;t<i.length;t+=1){var r=i[t],n=r.ids,o=r.callback;this._notify(n,o)}this.requestors=[]}},_0x187c3b.prototype.getImage=function(e){return this.images[e]},_0x187c3b.prototype.addImage=function(e,t){this._validate(e,t)&&(this.images[e]=t,this.imageCount++)},_0x187c3b.prototype.getImageCanvas=function(e){if(!e$28(this.images[e]))return null;if(!e$28(this.imagesCanvas[e])){var t=document.createElement("canvas"),i=this.images[e].data;t.width=i.width,t.height=i.height;for(var r=t.getContext("2d"),n=r.createImageData(i.width,i.height),o=i.width*i.height,a=0;a<o;a++)n.data[4*a]=i.data[4*a],n.data[4*a+1]=i.data[4*a+1],n.data[4*a+2]=i.data[4*a+2],n.data[4*a+3]=i.data[4*a+3];r.putImageData(n,0,0),this.imagesCanvas[e]=t}return this.imagesCanvas[e]},_0x187c3b.prototype._validate=function(e,t){var i=!0;return!this._validateStretch(t.stretchX,t.data&&t.data.width)&&(i=!1),!this._validateStretch(t.stretchY,t.data&&t.data.height)&&(i=!1),!this._validateContent(t.content,t)&&(i=!1),i},_0x187c3b.prototype._validateStretch=function(e,t){if(!e)return!0;for(var i=0,r=0,n=e;r<n.length;r+=1){var o=n[r];if(o[0]<i||o[1]<o[0]||t<o[1])return!1;i=o[1]}return!0},_0x187c3b.prototype._validateContent=function(e,t){return!e||4===e.length&&(!(e[0]<0||t.data.width<e[0])&&(!(e[1]<0||t.data.height<e[1])&&(!(e[2]<0||t.data.width<e[2])&&(!(e[3]<0||t.data.height<e[3])&&(!(e[2]<e[0])&&!(e[3]<e[1]))))))},_0x187c3b.prototype.updateImage=function(e,t){var i=this.images[e];t.version=i.version+1,this.images[e]=t,this.updatedImages[e]=!0},_0x187c3b.prototype.removeImage=function(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],this.imageCount--,this.imageCount<0&&(this.imageCount=0),t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()},_0x187c3b.prototype.listImages=function(){return this.imageList.length!=this.imageCount&&(this.imageList=Object.keys(this.images)),this.imageList},_0x187c3b.prototype.getImages=function(e,t){var i=!0;if(!this.isLoaded())for(var r=0,n=e;r<n.length;r+=1){var o=n[r];!this.images[o]&&(i=!1)}this.isLoaded()||i?this._notify(e,t):this.requestors.push({ids:e,callback:t})},_0x187c3b.prototype._notify=function(e,t){for(var i={},r=0,n=e;r<n.length;r+=1){var o=n[r];!this.images[o]&&console.log("styleimagemissing",{id:o});var a=this.images[o];a?i[o]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:console.warn('Image "'+o+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}t(null,i)},_0x187c3b.prototype.getAllImages=function(e){var t={};for(var i in this.images){var r=this.images[i],n=r.data.clone();e.push(n.data.buffer),t[i]={data:n,pixelRatio:r.pixelRatio,hasRenderCallback:Boolean(r.userImage&&r.userImage.render)}}return t},_0x187c3b.prototype.getPixelSize=function(){var e=this.atlasImage;return{width:e.width,height:e.height}},_0x187c3b.prototype.getPattern=function(e){var t=this.patterns[e],i=this.getImage(e);if(!i)return null;if(t&&t.position.version===i.version)return t.position;if(t)t.position.version=i.version;else{var r={w:i.data.width+2*_0x155afd,h:i.data.height+2*_0x155afd,x:0,y:0},n=new _0x4b5e0e(r,i);this.patterns[e]={bin:r,position:n}}return this._updatePatternAtlas(),this.patterns[e].position},_0x187c3b.prototype.bind=function(e){e.gl,this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):(console.log("ImageManager.prototype.bind"),this.atlasTexture=new _0x3651b1(e,this.atlasImage,de$y.RGBA)),this.atlasTexture.bind(de$y.LINEAR,de$y.CLAMP_TO_EDGE)},_0x187c3b.prototype._updatePatternAtlas=function(){var e=[];for(var t in this.patterns)e.push(this.patterns[t].bin);var i=W$V(e),r=i.w,n=i.h,o=this.atlasImage;for(var a in o.resize({width:r||1,height:n||1}),this.patterns){var s=this.patterns[a].bin,l=s.x+_0x155afd,u=s.y+_0x155afd,c=this.images[a].data,h=c.width,d=c.height;_0x1421cc.copy(c,o,{x:0,y:0},{x:l,y:u},{width:h,height:d}),_0x1421cc.copy(c,o,{x:0,y:d-1},{x:l,y:u-1},{width:h,height:1}),_0x1421cc.copy(c,o,{x:0,y:0},{x:l,y:u+d},{width:h,height:1}),_0x1421cc.copy(c,o,{x:h-1,y:0},{x:l-1,y:u},{width:1,height:d}),_0x1421cc.copy(c,o,{x:0,y:0},{x:l+h,y:u},{width:1,height:d})}this.dirty=!0},_0x187c3b.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},_0x187c3b.prototype.dispatchRenderCallbacks=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var n=this.images[r];renderStyleImage(n)&&this.updateImage(r,n)}}};const _0x4bf85b=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1c784a=_0x4bf85b(void 0,(function(){return _0x1c784a.toString().search("(((.+)+)+)+$").toString().constructor(_0x1c784a).search("(((.+)+)+)+$")}));function _0x5df6bd(e,t,i,r,n){const o=256*t,a=o+255,s=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",o+"-"+a),_0x3c09b7.Glyphs);getArrayBuffer(s,((e,t)=>{if(e)n(e);else if(t){const e={};for(const i of _0x3aff4d(t))e[i.id]=i;n(null,e)}}))}_0x1c784a();var _0x4db3ce=(_0x4e9aac=!0,function(e,t){var i=_0x4e9aac?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4e9aac=!1,i}),_0x177004=_0x4db3ce(void 0,(function(){return _0x177004.toString().search("(((.+)+)+)+$").toString().constructor(_0x177004).search("(((.+)+)+)+$")})),_0x4e9aac;_0x177004();var _0x7529ef=1e20;function _0x26f214(e,t,i,r,n,o){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function _0x4a0245(e,t,i,r,n,o,a){for(var s=0;s<t;s++){for(var l=0;l<i;l++)r[l]=e[l*t+s];for(_0x4eea7e(r,n,o,a,i),l=0;l<i;l++)e[l*t+s]=n[l]}for(l=0;l<i;l++){for(s=0;s<t;s++)r[s]=e[l*t+s];for(_0x4eea7e(r,n,o,a,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(n[s])}}function _0x4eea7e(e,t,i,r,n){i[0]=0,r[0]=-_0x7529ef,r[1]=+_0x7529ef;for(var o=1,a=0;o<n;o++){for(var s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);s<=r[a];)a--,s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);i[++a]=o,r[a]=s,r[a+1]=+_0x7529ef}for(o=0,a=0;o<n;o++){for(;r[a+1]<o;)a++;t[o]=(o-i[a])*(o-i[a])+e[i[a]]}}_0x26f214.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var n=t.data[4*r+3]/255;this.gridOuter[r]=1===n?0:0===n?_0x7529ef:Math.pow(Math.max(0,.5-n),2),this.gridInner[r]=1===n?_0x7529ef:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(_0x4a0245(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),_0x4a0245(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var o=this.gridOuter[r]-this.gridInner[r];i[r]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return i};const _0x352ce2=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x3a0ea5=_0x352ce2(void 0,(function(){return _0x3a0ea5.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a0ea5).search("(((.+)+)+)+$")}));function _0x4c2413(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}_0x3a0ea5(),_0x4c2413.prototype.setURL=function(e){this.url=e},_0x4c2413.prototype.getGlyphs=function(e,t){const i=[];for(const t in e)for(const r of e[t])i.push({stack:t,id:r});asyncAll(i,(({stack:e,id:t},i)=>{let r=this.entries[e];!r&&(r=this.entries[e]={glyphs:{},requests:{}});let n=r.glyphs[t];if(void 0!==n)return void i(null,{stack:e,id:t,glyph:n});if(n=this._tinySDF(r,e,t),n)return r.glyphs[t]=n,void i(null,{stack:e,id:t,glyph:n});const o=Math.floor(t/256);if(256*o>65535)return void i(new Error("glyphs > 65535 not supported"));let a=r.requests[o];!a&&(a=r.requests[o]=[],_0x4c2413.loadGlyphRange(e,o,this.url,this.requestManager,((e,t)=>{if(t)for(const e in t)!this._doesCharSupportLocalGlyph(+e)&&(r.glyphs[+e]=t[+e]);for(const i of a)i(e,t);delete r.requests[o]}))),a.push(((r,n)=>{r?i(r):n&&i(null,{stack:e,id:t,glyph:n[t]||null})}))}),((e,i)=>{if(e)t(e);else if(i){const e={};for(const{stack:t,id:r,glyph:n}of i)(e[t]||(e[t]={}))[r]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};t(null,e)}}))},_0x4c2413.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(_0x21c8ba["CJK Unified Ideographs"](e)||_0x21c8ba["Hangul Syllables"](e)||_0x21c8ba.Hiragana(e)||_0x21c8ba.Katakana(e))},_0x4c2413.prototype._tinySDF=function(e,t,i){const r=this.localIdeographFontFamily;if(!r)return;if(!this._doesCharSupportLocalGlyph(i))return;let n=e.tinySDF;if(!n){let i="400";/bold/i.test(t)?i="900":/medium/i.test(t)?i="500":/light/i.test(t)&&(i="200"),n=e.tinySDF=new _0x4c2413.TinySDF(24,3,8,.25,r,i)}return{id:i,bitmap:new _0x3a1cb5({width:30,height:30},n.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}},_0x4c2413.loadGlyphRange=_0x5df6bd,_0x4c2413.TinySDF=_0x26f214;var _0x4f7fb9=(_0x4fdbc1=!0,function(e,t){var i=_0x4fdbc1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4fdbc1=!1,i}),_0x1192d8=_0x4f7fb9(void 0,(function(){return _0x1192d8.toString().search("(((.+)+)+)+$").toString().constructor(_0x1192d8).search("(((.+)+)+)+$")})),_0x4fdbc1;_0x1192d8();var _0x13dfbf=function(e,t){this.width=e,this.height=t,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};_0x13dfbf.prototype.getDash=function(e,t){var i=e.join(",")+String(t);return!this.positions[i]&&(this.positions[i]=this.addDash(e,t)),this.positions[i]},_0x13dfbf.prototype.addDash=function(e,t){var i=t?7:0,r=2*i+1;if(this.nextRow+r>this.height)return null;for(var n=0,o=0;o<e.length;o++)n+=e[o];for(var a=this.width/n,s=a/2,l=e.length%2==1,u=-i;u<=i;u++)for(var c=this.nextRow+i+u,h=this.width*c,d=l?-e[e.length-1]:0,f=e[0],p=1,_=0;_<this.width;_++){for(;f<_/a;)d=f,f+=e[p],l&&p===e.length-1&&(f+=e[0]),p++;var m=Math.abs(_-d*a),$=Math.abs(_-f*a),g=Math.min(m,$),v=p%2==1,y=void 0;if(t){var x=i?u/i*(s+1):0;if(v){var b=s-Math.abs(x);y=Math.sqrt(g*g+b*b)}else y=s-Math.sqrt(g*g+x*x)}else y=(v?1:-1)*g;this.data[3+4*(h+_)]=Math.max(0,Math.min(255,y+128))}var w={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:n};return this.nextRow+=r,this.dirty=!0,w},_0x13dfbf.prototype.bind=function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))},_0x13dfbf.prototype.getTexture=function(e){return this.cesiumTexture?this.dirty&&(this.dirty=!1,this.cesiumTexture.copyFrom({width:this.width,height:this.height,arrayBufferView:this.data})):this.cesiumTexture=new L$17({context:e,source:{arrayBufferView:this.data},width:this.width,height:this.height,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT})}),this.cesiumTexture};var _0x59b275=(_0x415547=!0,function(e,t){var i=_0x415547?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x415547=!1,i}),_0x1787f2=_0x59b275(void 0,(function(){return _0x1787f2.toString().search("(((.+)+)+)+$").toString().constructor(_0x1787f2).search("(((.+)+)+)+$")})),_0x415547;function _0x461a14(){}_0x1787f2(),_0x461a14.isExpressionFilter=function(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&Array.isArray(e[2]);case"!in":case"!has":case"none":case"crossFields":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":case"like":case"!like":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,i=e.slice(1);t<i.length;t+=1){var r=i[t];if(!_0x461a14.isExpressionFilter(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}};var _0x5cc9fc={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function _0x505d0d(e,t){return e<t?-1:e>t?1:0}function _0x1fa23f(e){if(!e)return!0;var t=e[0];return e.length<=1?"any"!==t:"=="===t?_0x1a7506(e[1],e[2],"=="):"!="===t?_0x4b9d8b(_0x1a7506(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?_0x1a7506(e[1],e[2],t):"any"===t?_0x29a6db(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(_0x1fa23f)):"crossFields"===t?["crossFields"].concat(e.slice(1).map(_0x1fa23f)):"none"===t?["all"].concat(e.slice(1).map(_0x1fa23f).map(_0x4b9d8b)):"in"===t?_0x38e513(e[1],e.slice(2)):"!in"===t?_0x4b9d8b(_0x38e513(e[1],e.slice(2))):"has"===t?_0x4f03a2(e[1]):"!has"===t?_0x4b9d8b(_0x4f03a2(e[1])):"like"===t?_0x1a7506(e[1],e[2],"like"):"!like"!==t||_0x4b9d8b(_0x1a7506(e[1],e[2],"like"))}function _0x1a7506(e,t,i){switch(e){case"$type":return["filter-type-"+i,t];case"$id":return["filter-id-"+i,t];default:return["filter-"+i,e,t]}}function _0x29a6db(e){return["any"].concat(e.map(_0x1fa23f))}function _0x38e513(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!=typeof t[0]}))?["filter-in-large",e,["literal",t.sort(_0x505d0d)]]:["filter-in-small",e,["literal",t]]}}function _0x4f03a2(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _0x4b9d8b(e){return["!",e]}_0x461a14.createFilter=function(e){if(null==e)return function(){return!0};!_0x461a14.isExpressionFilter(e)&&(e=_0x1fa23f(e));var t=_0x384364.createExpression(e,_0x5cc9fc);if("error"===t.result)throw new Error(t.value.map((function(e){return e.key+": "+e.message})).join(", "));return function(e,i){return t.value.evaluate(e,i)}};var _0x3e3d5a=(_0x36349b=!0,function(e,t){var i=_0x36349b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x36349b=!1,i}),_0x4710f0=_0x3e3d5a(void 0,(function(){return _0x4710f0.toString().search("(((.+)+)+)+$").toString().constructor(_0x4710f0).search("(((.+)+)+)+$")})),_0x36349b;_0x4710f0();const _0x558c7d=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function _0x7b149d(e){var t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i="[",r=0,n=e;r<n.length;r+=1){i+=_0x7b149d(n[r])+","}return i+"]"}for(var o=Object.keys(e).sort(),a="{",s=0;s<o.length;s++)a+=JSON.stringify(o[s])+":"+_0x7b149d(e[o[s]])+",";return a+"}"}function _0x54d5e6(e){for(var t="",i=0,r=_0x558c7d;i<r.length;i+=1){t+="/"+_0x7b149d(e[r[i]])}return t}function _0x528b27(e,t){for(var i={},r=0;r<e.length;r++){var n=t&&t[e[r].id]||_0x54d5e6(e[r]);t&&(t[e[r].id]=n);var o=i[n];!o&&(o=i[n]=[]),o.push(e[r])}var a=[];for(var s in i)a.push(i[s]);return a}var _0xa0d22d=(_0x482bc6=!0,function(e,t){var i=_0x482bc6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x482bc6=!1,i}),_0x1f48cf=_0xa0d22d(void 0,(function(){return _0x1f48cf.toString().search("(((.+)+)+)+$").toString().constructor(_0x1f48cf).search("(((.+)+)+)+$")})),_0x482bc6;_0x1f48cf();var _0x24b7d3=function(e){this.keyCache={},e&&this.replace(e)};function _0x306e06(e){var t=[];for(var i in e)t.push(e[i]);return t}_0x24b7d3.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},_0x24b7d3.prototype.update=function(e,t){for(var i=this,r=0,n=e;r<n.length;r+=1){var o=n[r];this._layerConfigs[o.id]=o;var a=_0x10c42b(o);null!=a&&(this._layers[o.id]=a,a._featureFilter=_0x461a14.createFilter(a.filter),this.keyCache[o.id]&&delete this.keyCache[o.id])}for(var s=0,l=t;s<l.length;s+=1){var u=l[s];delete this.keyCache[u],delete this._layerConfigs[u],delete this._layers[u]}this.familiesBySource={};for(var c=0,h=_0x528b27(_0x306e06(this._layerConfigs),this.keyCache);c<h.length;c+=1){var d=h[c].map((function(e){return i._layers[e.id]})),f=d[0];if(null!=f&&"none"!==f.visibility){var p=f.source||"",_=this.familiesBySource[p];!_&&(_=this.familiesBySource[p]={});var m=f.sourceLayer,$=_[m];!$&&($=_[m]=[]),$.push(d)}}};var _0xe3e2db=(_0x2a1ee7=!0,function(e,t){var i=_0x2a1ee7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2a1ee7=!1,i}),_0x4bc767=_0xe3e2db(void 0,(function(){return _0x4bc767.toString().search("(((.+)+)+)+$").toString().constructor(_0x4bc767).search("(((.+)+)+)+$")})),_0x2a1ee7;function _0x270f64(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}_0x4bc767(),_0x270f64.prototype.trigger=function(){!this._triggered&&(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))};const _0x14bf85=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1cf890=_0x14bf85(void 0,(function(){return _0x1cf890.toString().search("(((.+)+)+)+$").toString().constructor(_0x1cf890).search("(((.+)+)+)+$")}));function _0x287e91(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function _0x4c12aa(e,t,i){this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},_0x287e91(["receive","process"],this),this.invoker=new _0x270f64(this.process),this.target.addEventListener("message",this.receive,!1)}_0x1cf890(),_0x4c12aa.prototype.send=function(e,t,i,r){const n=++_0x4c12aa.taskId;i&&(this.callbacks[n]=i);const o=[];return this.target.postMessage({id:n,type:e,hasCallback:!!i,targetMapId:r,sourceMapId:this.mapId,data:_0x36ace8.serialize(t,o)},o),{cancel:()=>{i&&delete this.callbacks[n],this.target.postMessage({id:n,type:"<cancel>",targetMapId:r,sourceMapId:this.mapId})}}},_0x4c12aa.prototype.receive=function(e){const t=e.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[i];const e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e()}else this.tasks[i]=t,this.taskQueue.push(i),this.invoker.trigger()},_0x4c12aa.prototype.process=function(){if(!this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t)if("<response>"===t.type){const i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(_0x36ace8.deserialize(t.error)):i(null,_0x36ace8.deserialize(t.data)))}else{let i=!1;const r=t.hasCallback?(t,r)=>{i=!0,delete this.cancelCallbacks[e];const n=[];this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?_0x36ace8.serialize(t):null,data:_0x36ace8.serialize(r,n)},n)}:e=>{i=!0};let n=null;const o=_0x36ace8.deserialize(t.data);if(this.parent[t.type])n=this.parent[t.type](t.sourceMapId,o,r);else if(this.parent.getWorkerSource){const e=t.type.split(".");n=this.parent.getWorkerSource(t.sourceMapId,e[0],o.source)[e[1]](o,r)}else r(new Error("Could not find function "+t.type));!i&&n&&n.cancel&&(this.cancelCallbacks[e]=n.cancel)}},_0x4c12aa.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},_0x4c12aa.taskId=0;const _0xea039a=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x2fc3e1=_0xea039a(void 0,(function(){return _0x2fc3e1.toString().search("(((.+)+)+)+$").toString().constructor(_0x2fc3e1).search("(((.+)+)+)+$")}));function _0xb7578d(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=uniqueId();const i=this.workerPool.acquire(this.id);for(let e=0;e<i.length;e++){const r=i[e],n=new _0xb7578d.Actor(r,t,this.id);n.name="Worker "+e,this.actors.push(n)}}_0x2fc3e1(),_0xb7578d.prototype.broadcast=function(e,t,i){i=i||function(){},asyncAll(this.actors,((i,r)=>{i.send(e,t,r)}),i)},_0xb7578d.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},_0xb7578d.prototype.remove=function(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)},_0xb7578d.Actor=_0x4c12aa;const _0x3ddafa=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x505892=_0x3ddafa(void 0,(function(){return _0x505892.toString().search("(((.+)+)+)+$").toString().constructor(_0x505892).search("(((.+)+)+)+$")}));function _0x2cc668(){this.active={}}_0x505892(),_0x2cc668.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length<_0x2cc668.workerCount;)this.workers.push(new window.Worker(window.mvtWorkerUrl));return this.active[e]=!0,this.workers.slice()},_0x2cc668.prototype.release=function(e){delete this.active[e],0===Object.keys(this.active).length&&(this.workers.forEach((e=>{e.terminate()})),this.workers=[])};const _0x5308f2=Math.floor(s$V.hardwareConcurrency/2);_0x2cc668.workerCount=Math.max(Math.min(_0x5308f2,6),1);const _0x3705bf=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x223f2a=_0x3705bf(void 0,(function(){return _0x223f2a.toString().search("(((.+)+)+)+$").toString().constructor(_0x223f2a).search("(((.+)+)+)+$")}));let _0x2a0b5b;function _0x1fada7(){return!_0x2a0b5b&&(_0x2a0b5b=new _0x2cc668),_0x2a0b5b}function r$10(e,t){e=u$Y(e,0),this._near=e,t=u$Y(t,Number.MAX_VALUE),this._far=t}function o$1b(e,t,i,r){this.near=u$Y(e,0),this.nearValue=u$Y(t,0),this.far=u$Y(i,1),this.farValue=u$Y(r,0)}_0x223f2a(),Object.defineProperties(r$10.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),r$10.packedLength=2,r$10.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t[i++]=e.near,t[i]=e.far,t},r$10.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");return t=u$Y(t,0),e$28(i)||(i=new r$10),i.near=e[t++],i.far=e[t],i},r$10.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.near===t.near&&e.far===t.far},r$10.clone=function(e,t){if(e$28(e))return e$28(t)||(t=new r$10),t.near=e.near,t.far=e.far,t},r$10.prototype.clone=function(e){return r$10.clone(this,e)},r$10.prototype.equals=function(e){return r$10.equals(this,e)},o$1b.clone=function(e,t){if(e$28(e))return e$28(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new o$1b(e.near,e.nearValue,e.far,e.farValue)},o$1b.packedLength=4,o$1b.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},o$1b.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");return t=u$Y(t,0),e$28(i)||(i=new o$1b),i.near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},o$1b.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},o$1b.prototype.clone=function(e){return o$1b.clone(this,e)},o$1b.prototype.equals=function(e){return o$1b.equals(this,e)};var e$1H={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},k$_=Object.freeze(e$1H),e$1G={CENTER:0,LEFT:1,RIGHT:-1},j$13=Object.freeze(e$1G),e$1F={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(e){return e===e$1F.SCENE3D?1:e===e$1F.MORPHING?void 0:0}},P$$=Object.freeze(e$1F);function i$S(e){this.planes=u$Y(e,[])}var T$P=[new t$X,new t$X,new t$X];t$X.clone(t$X.UNIT_X,T$P[0]),t$X.clone(t$X.UNIT_Y,T$P[1]),t$X.clone(t$X.UNIT_Z,T$P[2]);var I$1f=new t$X,y$S=new t$X,l$10=new o$1i(new t$X(1,0,0),0);function l$$(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=u$Y(e.near,1),this._near=this.near,this.far=u$Y(e.far,5e8),this._far=this.far,this._cullingVolume=new i$S,this._orthographicMatrix=new y$15}function q$10(e){if(!(e$28(e.right)&&e$28(e.left)&&e$28(e.top)&&e$28(e.bottom)&&e$28(e.near)&&e$28(e.far)))throw new t$Z("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new t$Z("right must be greater than left.");if(e.bottom>e.top)throw new t$Z("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new t$Z("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=y$15.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}i$S.fromBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("boundingSphere is required.");e$28(t)||(t=new i$S);var i=T$P.length,r=t.planes;r.length=2*i;for(var n=e.center,o=e.radius,a=0,s=0;s<i;++s){var l=T$P[s],u=r[a],c=r[a+1];e$28(u)||(u=r[a]=new e$25),e$28(c)||(c=r[a+1]=new e$25),t$X.multiplyByScalar(l,-o,I$1f),t$X.add(n,I$1f,I$1f),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-t$X.dot(l,I$1f),t$X.multiplyByScalar(l,o,I$1f),t$X.add(n,I$1f,I$1f),c.x=-l.x,c.y=-l.y,c.z=-l.z,c.w=-t$X.dot(t$X.negate(l,y$S),I$1f),a+=2}return t},i$S.prototype.computeVisibility=function(e){if(!e$28(e))throw new t$Z("boundingVolume is required.");for(var t=this.planes,i=!1,r=0,n=t.length;r<n;++r){var o=e.intersectPlane(o$1i.fromCartesian4(t[r],l$10));if(o===pt$a.OUTSIDE)return pt$a.OUTSIDE;o===pt$a.INTERSECTING&&(i=!0)}return i?pt$a.INTERSECTING:pt$a.INSIDE},i$S.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!e$28(e))throw new t$Z("boundingVolume is required.");if(!e$28(t))throw new t$Z("parentPlaneMask is required.");if(t===i$S.MASK_OUTSIDE||t===i$S.MASK_INSIDE)return t;for(var i=i$S.MASK_INSIDE,r=this.planes,n=0,o=r.length;n<o;++n){var a=n<31?1<<n:0;if(!(n<31&&0==(t&a))){var s=e.intersectPlane(o$1i.fromCartesian4(r[n],l$10));if(s===pt$a.OUTSIDE)return i$S.MASK_OUTSIDE;s===pt$a.INTERSECTING&&(i|=a)}}return i},i$S.MASK_OUTSIDE=4294967295,i$S.MASK_INSIDE=0,i$S.MASK_INDETERMINATE=2147483647,Object.defineProperties(l$$.prototype,{projectionMatrix:{get:function(){return q$10(this),this._orthographicMatrix}}});var B$P=new t$X,M$Z=new t$X,P$_=new t$X,s$N=new t$X;function a$X(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._offCenterFrustum=new l$$,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=u$Y(e.near,1),this._near=this.near,this.far=u$Y(e.far,5e8),this._far=this.far}function o$1a(e){if(!(e$28(e.width)&&e$28(e.aspectRatio)&&e$28(e.near)&&e$28(e.far)))throw new t$Z("width, aspectRatio, near, or far parameters are not set.");var t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new t$Z("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new t$Z("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;var i=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=i*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}l$$.prototype.computeCullingVolume=function(e,t,i){if(!e$28(e))throw new t$Z("position is required.");if(!e$28(t))throw new t$Z("direction is required.");if(!e$28(i))throw new t$Z("up is required.");var r=this._cullingVolume.planes,n=this.top,o=this.bottom,a=this.right,s=this.left,l=this.near,u=this.far,c=t$X.cross(t,i,B$P);t$X.normalize(c,c);var h=M$Z;t$X.multiplyByScalar(t,l,h),t$X.add(e,h,h);var d=P$_;t$X.multiplyByScalar(c,s,d),t$X.add(h,d,d);var f=r[0];return e$28(f)||(f=r[0]=new e$25),f.x=c.x,f.y=c.y,f.z=c.z,f.w=-t$X.dot(c,d),t$X.multiplyByScalar(c,a,d),t$X.add(h,d,d),e$28(f=r[1])||(f=r[1]=new e$25),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-t$X.dot(t$X.negate(c,s$N),d),t$X.multiplyByScalar(i,o,d),t$X.add(h,d,d),e$28(f=r[2])||(f=r[2]=new e$25),f.x=i.x,f.y=i.y,f.z=i.z,f.w=-t$X.dot(i,d),t$X.multiplyByScalar(i,n,d),t$X.add(h,d,d),e$28(f=r[3])||(f=r[3]=new e$25),f.x=-i.x,f.y=-i.y,f.z=-i.z,f.w=-t$X.dot(t$X.negate(i,s$N),d),e$28(f=r[4])||(f=r[4]=new e$25),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-t$X.dot(t,h),t$X.multiplyByScalar(t,u,d),t$X.add(e,d,d),e$28(f=r[5])||(f=r[5]=new e$25),f.x=-t.x,f.y=-t.y,f.z=-t.z,f.w=-t$X.dot(t$X.negate(t,s$N),d),this._cullingVolume},l$$.prototype.getPixelDimensions=function(e,t,i,r,n){if(q$10(this),!e$28(e)||!e$28(t))throw new t$Z("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new t$Z("drawingBufferWidth must be greater than zero.");if(t<=0)throw new t$Z("drawingBufferHeight must be greater than zero.");if(!e$28(i))throw new t$Z("distance is required.");if(!e$28(r))throw new t$Z("pixelRatio is required.");if(r<=0)throw new t$Z("pixelRatio must be greater than zero.");if(!e$28(n))throw new t$Z("A result object is required.");var o=r*(this.right-this.left)/e,a=r*(this.top-this.bottom)/t;return n.x=o,n.y=a,n},l$$.prototype.clone=function(e){return e$28(e)||(e=new l$$),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l$$.prototype.equals=function(e){return e$28(e)&&e instanceof l$$&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l$$.prototype.equalsEpsilon=function(e,t,i){return e===this||e$28(e)&&e instanceof l$$&&e$27.equalsEpsilon(this.right,e.right,t,i)&&e$27.equalsEpsilon(this.left,e.left,t,i)&&e$27.equalsEpsilon(this.top,e.top,t,i)&&e$27.equalsEpsilon(this.bottom,e.bottom,t,i)&&e$27.equalsEpsilon(this.near,e.near,t,i)&&e$27.equalsEpsilon(this.far,e.far,t,i)},a$X.packedLength=4,a$X.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.width,t[i++]=e.aspectRatio,t[i++]=e.near,t[i]=e.far,t},a$X.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new a$X),i.width=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t],i},Object.defineProperties(a$X.prototype,{projectionMatrix:{get:function(){return o$1a(this),this._offCenterFrustum.projectionMatrix}}}),a$X.prototype.computeCullingVolume=function(e,t,i){return o$1a(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},a$X.prototype.getPixelDimensions=function(e,t,i,r,n){return o$1a(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r,n)},a$X.prototype.clone=function(e){return e$28(e)||(e=new a$X),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},a$X.prototype.equals=function(e){return!!(e$28(e)&&e instanceof a$X)&&(o$1a(this),o$1a(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},a$X.prototype.equalsEpsilon=function(e,t,i){return!!(e$28(e)&&e instanceof a$X)&&(o$1a(this),o$1a(e),e$27.equalsEpsilon(this.width,e.width,t,i)&&e$27.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))};var m$W={},Z$10=new e$25(0,0,0,1),u$N=new e$25,J$Z=new f$10,j$12=new o$1k,z$Q=new o$1k;m$W.wgs84ToWindowCoordinates=function(e,t,i){return m$W.wgs84WithEyeOffsetToWindowCoordinates(e,t,t$X.ZERO,i)};var F$11=new e$25,L$16=new t$X;function P$Z(e,t,i,r){var n=i._scene.context.curFusionViewMatrix||i.viewMatrix,o=y$15.multiplyByVector(n,e$25.fromElements(e.x,e.y,e.z,1,F$11),F$11),a=t$X.multiplyComponents(t,t$X.normalize(o,L$16),L$16);return o.x+=t.x+a.x,o.y+=t.y+a.y,o.z+=a.z,y$15.multiplyByVector(i.frustum.projectionMatrix,o,r)}var K$S=new t$W(Math.PI,e$27.PI_OVER_TWO),Q$Z=new t$X,X$P=new t$X;m$W.wgs84WithEyeOffsetToWindowCoordinates=function(e,t,i,r){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("position is required.");var n=e.frameState,o=m$W.computeActualWgs84Position(n,t,Z$10);if(e$28(o)){var a=e.canvas,s=J$Z;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;var l=e.camera,u=!1;if(n.mode===P$$.SCENE2D){var c=e.mapProjection,h=K$S,d=c.project(h,Q$Z),f=t$X.clone(l.position,X$P),p=l.frustum.clone(),_=y$15.computeViewportTransformation(s,0,1,new y$15),m=l.frustum.projectionMatrix,$=l.positionWC.y,g=t$X.fromElements(e$27.sign($)*d.x-$,0,-l.positionWC.x),v=m$1b.pointToGLWindowCoordinates(m,_,g);if(0===$||v.x<=0||v.x>=a.clientWidth)u=!0;else{if(v.x>.5*a.clientWidth){s.width=v.x,l.frustum.right=d.x-$,u$N=P$Z(o,i,l,u$N),m$W.clipToGLWindowCoordinates(s,u$N,j$12),s.x+=v.x,l.position.x=-l.position.x;var y=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-y,u$N=P$Z(o,i,l,u$N),m$W.clipToGLWindowCoordinates(s,u$N,z$Q)}else{s.x+=v.x,s.width-=v.x,l.frustum.left=-d.x-$,u$N=P$Z(o,i,l,u$N),m$W.clipToGLWindowCoordinates(s,u$N,j$12),s.x=s.x-s.width,l.position.x=-l.position.x;var x=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-x,u$N=P$Z(o,i,l,u$N),m$W.clipToGLWindowCoordinates(s,u$N,z$Q)}t$X.clone(f,l.position),l.frustum=p.clone(),((r=o$1k.clone(j$12,r)).x<0||r.x>a.clientWidth)&&(r.x=z$Q.x)}}if(n.mode!==P$$.SCENE2D||u){if((u$N=P$Z(o,i,l,u$N)).z<0&&!(l.frustum instanceof a$X)&&!(l.frustum instanceof l$$))return;r=m$W.clipToGLWindowCoordinates(s,u$N,r)}return r.y=a.clientHeight-r.y,r}},m$W.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(e$28(i=m$W.wgs84ToWindowCoordinates(e,t,i)))return m$W.transformWindowToDrawingBuffer(e,i,i)};var w$I=new t$X,Y$L=new t$W;m$W.computeActualWgs84Position=function(e,t,i){var r=e.mode;if(r===P$$.SCENE3D)return t$X.clone(t,i);var n=e.mapProjection,o=n.ellipsoid.cartesianToCartographic(t,Y$L);if(e$28(o)){if(n.project(o,w$I),r===P$$.COLUMBUS_VIEW)return t$X.fromElements(w$I.z,w$I.x,w$I.y,i);if(r===P$$.SCENE2D)return t$X.fromElements(0,w$I.x,w$I.y,i);var a=e.morphTime;return t$X.fromElements(e$27.lerp(w$I.z,t.x,a),e$27.lerp(w$I.x,t.y,a),e$27.lerp(w$I.y,t.z,a),i)}};var N$M=new t$X,_$Q=new t$X,G$16=new y$15;m$W.clipToGLWindowCoordinates=function(e,t,i){return t$X.divideByScalar(t,t.w,N$M),y$15.computeViewportTransformation(e,0,1,G$16),y$15.multiplyByPoint(G$16,N$M,_$Q),o$1k.fromCartesian3(_$Q,i)},m$W.transformWindowToDrawingBuffer=function(e,t,i){var r=e.canvas,n=e.drawingBufferWidth/r.clientWidth,o=e.drawingBufferHeight/r.clientHeight;return o$1k.fromElements(t.x*n,t.y*o,i)};var $$V=new e$25,O$F=new e$25;m$W.drawingBufferToWgs84Coordinates=function(e,t,i,r){var n=e.context.uniformState,o=n.currentFrustum,a=o.x,s=o.y;if(e.frameState.useLogDepth){var l=i*n.log2FarDepthFromNearPlusOne;i=s*(1-a/(Math.pow(2,l)-1+a))/(s-a)}var u=e._view.passState.viewport,c=e$25.clone(e$25.UNIT_W,$$V);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*i-1,c.w=1;var h,d=e.camera.frustum;if(e$28(d.fovy)){var f=1/(h=y$15.multiplyByVector(n.inverseViewProjection,c,O$F)).w;t$X.multiplyByScalar(h,f,h)}else e$28(d._offCenterFrustum)&&(d=d._offCenterFrustum),(h=O$F).x=.5*(c.x*(d.right-d.left)+d.left+d.right),h.y=.5*(c.y*(d.top-d.bottom)+d.bottom+d.top),h.z=.5*(c.z*(a-s)-a-s),h.w=1,h=y$15.multiplyByVector(n.inverseView,h,h);return t$X.fromCartesian4(h,r)},m$W.convert2DToCartesian=function(e,t){if(t){var i=t.x,r=t.y;i>20037508.342789244&&(i-=20037508.342789244*Math.floor(i/20037508.342789244)),r>10018754.171394622&&(r-=20037508.342789244*Math.floor((r+10018754.171394622)/20037508.342789244)),t.x=i,t.y=r}var n=e.mapProjection,o=n.ellipsoid,a=new t$X,s=new t$W,l=n.unproject(t,s);return o.cartographicToCartesian(l,a),a};var e$1E={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},S$L=Object.freeze(e$1E);function n$X(e,t){if(e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).billboardStyle)){var i=e.billboardStyle;e.image=u$Y(i.image,void 0)}if(e$28(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new t$Z("disableDepthTestDistance must be greater than or equal to 0.0.");var r=e.translucencyByDistance,n=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(e$28(r)){if(r.far<=r.near)throw new t$Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");r=o$1b.clone(r)}if(e$28(n)){if(n.far<=n.near)throw new t$Z("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");n=o$1b.clone(n)}if(e$28(o)){if(o.far<=o.near)throw new t$Z("scaleByDistance.far must be greater than scaleByDistance.near.");o=o$1b.clone(o)}if(e$28(a)){if(a.far<=a.near)throw new t$Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=r$10.clone(a)}this._show=u$Y(e.show,!0),this._position=t$X.clone(u$Y(e.position,t$X.ZERO)),this._actualPosition=t$X.clone(this._position),this._volTexCoord=t$X.clone(u$Y(e.volTexCoord,t$X.ZERO)),this._pixelOffset=o$1k.clone(u$Y(e.pixelOffset,o$1k.ZERO)),this._translate=new o$1k(0,0),this._eyeOffset=t$X.clone(u$Y(e.eyeOffset,t$X.ZERO)),this._heightReference=u$Y(e.heightReference,k$_.NONE),this._verticalOrigin=u$Y(e.verticalOrigin,S$L.CENTER),this._horizontalOrigin=u$Y(e.horizontalOrigin,j$13.CENTER),this._scale=u$Y(e.scale,1),this._color=e$1S.clone(u$Y(e.color,e$1S.WHITE)),this._rotation=u$Y(e.rotation,0),this._alignedAxis=t$X.clone(u$Y(e.alignedAxis,t$X.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=r,this._pixelOffsetScaleByDistance=n,this._sizeInMeters=u$Y(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=u$Y(e.collection,t),this._pickId=void 0,this._pickPrimitive=u$Y(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=u$Y(e.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,this._mvtLayerID=e.mvtLayerID,this._mapName=e.mapName,this._mvtProperties=e.mvtProperties,this._associativeMvtLabel=void 0;var s=e.image,l=e.imageId;e$28(s)&&(e$28(l)||(l="string"==typeof s?s:e$28(s.src)?s.src:e$1K()),this._imageId=l,this._image=s),e$28(e.imageSubRegion)&&(this._imageId=l,this._imageSubRegion=e.imageSubRegion),e$28(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=P$$.SCENE3D,this._clusterShow=!0,this._outlineColor=e$1S.clone(u$Y(e.outlineColor,e$1S.BLACK)),this._outlineWidth=u$Y(e.outlineWidth,0),this._updateClamping(),this._screenSpacePosition=new o$1k,this._opacityState={opacity:0,placed:!1}}var L$15=n$X.SHOW_INDEX=0,T$O=n$X.POSITION_INDEX=1,F$10=n$X.PIXEL_OFFSET_INDEX=2,Z$$=n$X.EYE_OFFSET_INDEX=3,U$Y=n$X.HORIZONTAL_ORIGIN_INDEX=4,j$11=n$X.VERTICAL_ORIGIN_INDEX=5,J$Y=n$X.SCALE_INDEX=6,w$H=n$X.IMAGE_INDEX_INDEX=7,z$P=n$X.COLOR_INDEX=8,K$R=n$X.ROTATION_INDEX=9,Q$Y=n$X.ALIGNED_AXIS_INDEX=10,$$U=n$X.SCALE_BY_DISTANCE_INDEX=11,ii$7=n$X.TRANSLUCENCY_BY_DISTANCE_INDEX=12,ei$6=n$X.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,ti$6=n$X.DISTANCE_DISPLAY_CONDITION=14,ni$7=n$X.DISABLE_DEPTH_DISTANCE=15;n$X.TEXTURE_COORDINATE_BOUNDS=16;var si$5=n$X.VOL_TEXCOORD_INDEX=17,W$U=n$X.SDF_INDEX=18,ai$6=n$X.OPACITY_STATE_INDEX=19;function o$19(e,t){var i=e._billboardCollection;e$28(i)&&(i._updateBillboard(e,t),e._dirty=!0)}n$X.NUMBER_OF_PROPERTIES=20,Object.defineProperties(n$X.prototype,{show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._show!==e&&(this._show=e,o$19(this,L$15))}},position:{get:function(){return this._position},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._position;t$X.equals(t,e)||(t$X.clone(e,t),t$X.clone(e,this._actualPosition),this._updateClamping(),o$19(this,T$O))}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!e$28(e))throw new t$Z("value is required.");e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),o$19(this,T$O))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._pixelOffset;o$1k.equals(t,e)||(o$1k.clone(e,t),o$19(this,F$10))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._scaleByDistance;o$1b.equals(t,e)||(this._scaleByDistance=o$1b.clone(e,t),o$19(this,$$U))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._translucencyByDistance;o$1b.equals(t,e)||(this._translucencyByDistance=o$1b.clone(e,t),o$19(this,ii$7))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._pixelOffsetScaleByDistance;o$1b.equals(t,e)||(this._pixelOffsetScaleByDistance=o$1b.clone(e,t),o$19(this,ei$6))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._eyeOffset;t$X.equals(t,e)||(t$X.clone(e,t),o$19(this,Z$$))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,o$19(this,U$Y))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._verticalOrigin!==e&&(this._verticalOrigin=e,o$19(this,j$11))}},scale:{get:function(){return this._scale},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._scale!==e&&(this._scale=e,o$19(this,J$Y))}},color:{get:function(){return this._color},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._color;e$1S.equals(t,e)||(e$1S.clone(e,t),o$19(this,z$P))}},rotation:{get:function(){return this._rotation},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._rotation!==e&&(this._rotation=e,o$19(this,K$R))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._alignedAxis;t$X.equals(t,e)||(t$X.clone(e,t),o$19(this,Q$Y))}},width:{get:function(){return u$Y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,o$19(this,w$H))}},height:{get:function(){return u$Y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,o$19(this,w$H))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,o$19(this,z$P))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!r$10.equals(e,this._distanceDisplayCondition)){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");this._distanceDisplayCondition=r$10.clone(e,this._distanceDisplayCondition),o$19(this,ti$6)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(e$28(e)&&e<0)throw new t$Z("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,o$19(this,ni$7)}}},volTextureCoord:{get:function(){return this._volTexCoord},set:function(e){this._volTexCoord!==e&&(this._volTexCoord=e,o$19(this,si$5))}},id:{get:function(){return this._id},set:function(e){this._id=e,e$28(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,e$28(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){e$28(e)?"string"==typeof e?this.setImage(e,e):e instanceof t$S?this.setImage(e.url,e):e$28(e.src)?this.setImage(e.src,e):this.setImage(e$1K(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,o$19(this,w$H))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=t$X.clone(e,this._actualClampedPosition),o$19(this,T$O)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,o$19(this,L$15))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._outlineColor;e$1S.equals(t,e)||(e$1S.clone(e,t),o$19(this,W$U))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,o$19(this,W$U))}},opacityState:{get:function(){return this._opacityState},set:function(e){(this._opacityState.opacity!==e.opacity||this._opacityState.placed!==e.placed)&&(this._opacityState={opacity:e.opacity,placed:e.placed},o$19(this,ai$6))}}}),n$X.prototype.getPickId=function(e){return e$28(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},n$X.prototype._updateClamping=function(){n$X._updateClamping(this._billboardCollection,this)};var C$R=new t$W,b$11=new t$X;n$X._updateClamping=function(e,t){var i=e._scene;if(e$28(i)&&e$28(i.globe)){var r=i.globe,n=r.ellipsoid,o=r._surface,a=i.frameState.mode,s=a!==t._mode;if(t._mode=a,(t._heightReference===k$_.NONE||s)&&e$28(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==k$_.NONE&&e$28(t._position)){var l=n.cartesianToCartographic(t._position);if(e$28(l)){e$28(t._removeCallbackFunc)&&t._removeCallbackFunc();e=u$Y(t._labelCollection,t._billboardCollection);t._removeCallbackFunc=o.updateHeight(l,c,e$28(e)&&e._isMVT?void 0:i),t$W.clone(l,C$R);var u=r.getHeight(l);e$28(u)&&(C$R.height=u),n.cartographicToCartesian(C$R,b$11),a!==P$$.SCENE3D&&(b$11=m$1b.convertToColumbusCartesian(b$11)),c(b$11)}else t._actualClampedPosition=void 0}}else if(t._heightReference!==k$_.NONE)throw new t$Z("Height reference is not supported without a scene and globe.");function c(e){if(t._heightReference===k$_.RELATIVE_TO_GROUND)if(t._mode===P$$.SCENE3D){var i=n.cartesianToCartographic(e,C$R);i.height+=l.height,n.cartographicToCartesian(i,e)}else e.x+=l.height;t._clampedPosition=t$X.clone(e,t._clampedPosition)}},n$X.prototype._loadImage=function(){var e,t=this._billboardCollection._textureAtlas,i=this._imageId,r=this._image,n=this._imageSubRegion;if(e$28(r)&&(e=t.addImage(i,r)),e$28(n)&&(e=t.addSubRegion(i,n)),this._imageIndexPromise=e,e$28(e)){var o=this;e.then((function(e){if(o._imageId===i&&o._image===r&&f$10.equals(o._imageSubRegion,n)){var a=t.textureCoordinates[e];o._imageWidth=t.texture.width*a.width,o._imageHeight=t.texture.height*a.height,o._imageIndex=e,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,o$19(o,w$H)}})).otherwise((function(e){console.error("Error loading image for billboard: "+e),o._imageIndexPromise=void 0}))}},n$X.prototype.setImage=function(e,t){if(!e$28(e))throw new t$Z("id is required.");if(!e$28(t))throw new t$Z("image is required.");this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,e$28(this._billboardCollection._textureAtlas)&&this._loadImage())},n$X.prototype.setImageSubRegion=function(e,t){if(!e$28(e))throw new t$Z("id is required.");if(!e$28(t))throw new t$Z("subRegion is required.");this._imageId===e&&f$10.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=f$10.clone(t),e$28(this._billboardCollection._textureAtlas)&&this._loadImage())},n$X.prototype._setTranslate=function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._translate;o$1k.equals(t,e)||(o$1k.clone(e,t),o$19(this,F$10))},n$X.prototype._getActualPosition=function(){return e$28(this._clampedPosition)?this._clampedPosition:this._actualPosition},n$X.prototype._setActualPosition=function(e){e$28(this._clampedPosition)||t$X.clone(e,this._actualPosition),o$19(this,T$O)};var H$T=new e$25;n$X._computeActualPosition=function(e,t,i,r){return e$28(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===P$$.SCENE3D?t:(y$15.multiplyByPoint(r,t,H$T),m$W.computeActualWgs84Position(i,H$T))};var M$Y=new t$X;n$X._computeScreenSpacePosition=function(e,t,i,r,n,o){var a=y$15.multiplyByPoint(e,t,M$Y),s=m$W.wgs84WithEyeOffsetToWindowCoordinates(n,a,i,o);if(e$28(s))return o$1k.add(s,r,s),s};var v$G=new o$1k(0,0);n$X.prototype.computeScreenSpacePosition=function(e,t){var i=this._billboardCollection;if(e$28(t)||(t=this._screenSpacePosition),!e$28(i))throw new t$Z("Billboard must be in a collection. Was it removed?");if(!e$28(e))throw new t$Z("scene is required.");o$1k.clone(this._pixelOffset,v$G),o$1k.add(v$G,this._translate,v$G);var r=i.modelMatrix,n=this._position;if(e$28(this._clampedPosition)&&(n=this._clampedPosition,e.mode!==P$$.SCENE3D)){var o=e.mapProjection,a=o.ellipsoid,s=o.unproject(n,C$R);n=a.cartographicToCartesian(s,M$Y),r=y$15.IDENTITY}return n$X._computeScreenSpacePosition(r,n,this._eyeOffset,v$G,e,t)},n$X.getScreenSpaceBoundingBox=function(e,t,i){var r=e.width,n=e.height,o=e.scale;r*=o,n*=o;var a=t.x;e.horizontalOrigin===j$13.RIGHT?a-=r:e.horizontalOrigin===j$13.CENTER&&(a-=.5*r);var s=t.y;return e.verticalOrigin===S$L.BOTTOM||e.verticalOrigin===S$L.BASELINE?s-=n:e.verticalOrigin===S$L.CENTER&&(s-=.5*n),e$28(i)||(i=new f$10),i.x=a,i.y=s,i.width=r,i.height=n,i},n$X.prototype.equals=function(e){return this===e||e$28(e)&&this._id===e._id&&t$X.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&&f$10.equals(this._imageSubRegion,e._imageSubRegion)&&e$1S.equals(this._color,e._color)&&o$1k.equals(this._pixelOffset,e._pixelOffset)&&o$1k.equals(this._translate,e._translate)&&t$X.equals(this._eyeOffset,e._eyeOffset)&&o$1b.equals(this._scaleByDistance,e._scaleByDistance)&&o$1b.equals(this._translucencyByDistance,e._translucencyByDistance)&&o$1b.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&r$10.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},n$X.prototype._destroy=function(){e$28(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),e$28(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},n$X.prototype.setBillboardStyle=function(e){!e$28(e)||(this.image=u$Y(e.image,this._image))};const _0x5b5172=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x8885df=_0x5b5172(void 0,(function(){return _0x8885df.toString().search("(((.+)+)+)+$").toString().constructor(_0x8885df).search("(((.+)+)+)+$")}));_0x8885df();class _0x316db4{constructor(e,t,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,i,r,n){this._forEachCell(t,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}insertCircle(e,t,i,r){this._forEachCell(t-r,i-r,t+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(r)}_insertBoxCell(e,t,i,r,n,o){this.boxCells[n].push(o)}_insertCircleCell(e,t,i,r,n,o){this.circleCells[n].push(o)}_query(e,t,i,r,n,o){if(i<0||e>this.width||r<0||t>this.height)return!n&&[];const a=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=r){if(n)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],i=this.circles[3*e+1],r=this.circles[3*e+2];a.push({key:this.circleKeys[e],x1:t-r,y1:i-r,x2:t+r,y2:i+r})}return o?a.filter(o):a}{const s={hitTest:n,seenUids:{box:{},circle:{}}};return this._forEachCell(e,t,i,r,this._queryCell,a,s,o),n?a.length>0:a}}_queryCircle(e,t,i,r,n){const o=e-i,a=e+i,s=t-i,l=t+i;if(a<0||o>this.width||l<0||s>this.height)return!r&&[];const u=[],c={hitTest:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,l,this._queryCellCircle,u,c,n),r?u.length>0:u}query(e,t,i,r,n){return this._query(e,t,i,r,!1,n)}hitTest(e,t,i,r,n){return this._query(e,t,i,r,!0,n)}hitTestCircle(e,t,i,r){return this._queryCircle(e,t,i,!0,r)}_queryCell(e,t,i,r,n,o,a,s){const l=a.seenUids,u=this.boxCells[n];if(null!==u){const n=this.bboxes;for(const c of u)if(!l.box[c]){l.box[c]=!0;const u=4*c;if(e<=n[u+2]&&t<=n[u+3]&&i>=n[u+0]&&r>=n[u+1]&&(!s||s(this.boxKeys[c]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[c],x1:n[u],y1:n[u+1],x2:n[u+2],y2:n[u+3]})}}}const c=this.circleCells[n];if(null!==c){const n=this.circles;for(const u of c)if(!l.circle[u]){l.circle[u]=!0;const c=3*u;if(this._circleAndRectCollide(n[c],n[c+1],n[c+2],e,t,i,r)&&(!s||s(this.circleKeys[u]))){if(a.hitTest)return o.push(!0),!0;{const e=n[c],t=n[c+1],i=n[c+2];o.push({key:this.circleKeys[u],x1:e-i,y1:t-i,x2:e+i,y2:t+i})}}}}}_queryCellCircle(e,t,i,r,n,o,a,s){const l=a.circle,u=a.seenUids,c=this.boxCells[n];if(null!==c){const e=this.bboxes;for(const t of c)if(!u.box[t]){u.box[t]=!0;const i=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const h=this.circleCells[n];if(null!==h){const e=this.circles;for(const t of h)if(!u.circle[t]){u.circle[t]=!0;const i=3*t;if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,i,r,n,o,a,s){const l=this._convertToXCellCoord(e),u=this._convertToYCellCoord(t),c=this._convertToXCellCoord(i),h=this._convertToYCellCoord(r);for(let d=l;d<=c;d++)for(let l=u;l<=h;l++){const u=this.xCellCount*l+d;if(n.call(this,e,t,i,r,u,o,a,s))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,i,r,n,o){const a=r-e,s=n-t,l=i+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,i,r,n,o,a){const s=(o-r)/2,l=Math.abs(e-(r+s));if(l>s+i)return!1;const u=(a-n)/2,c=Math.abs(t-(n+u));if(c>u+i)return!1;if(l<=s||c<=u)return!0;const h=l-s,d=c-u;return h*h+d*d<=i*i}}const _0x5aa9f1=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x5df1b5=_0x5aa9f1(void 0,(function(){return _0x5df1b5.toString().search("(((.+)+)+)+$").toString().constructor(_0x5df1b5).search("(((.+)+)+)+$")}));_0x5df1b5();const _0x4cbcfd=100;class _0x2ee188{constructor(e,t,i,r,n){this.transform=i,this.grid=r||new _0x316db4(e+2*_0x4cbcfd,t+2*_0x4cbcfd,25),this.ignoredGrid=n||new _0x316db4(e+2*_0x4cbcfd,t+2*_0x4cbcfd,25),this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=e+_0x4cbcfd,this.screenBottomBoundary=t+_0x4cbcfd,this.gridRightBoundary=e+2*_0x4cbcfd,this.gridBottomBoundary=t+2*_0x4cbcfd}placeCollisionBox(e,t,i){const r=e.x1,n=e.y1,o=e.x2,a=e.y2;return!this.isInsideGrid(r,n,o,a)||!t&&this.grid.hitTest(r,n,o,a,i)?{box:[],offscreen:!1}:{box:[r,n,o,a],offscreen:this.isOffscreen(r,n,o,a)}}approximateTileDistance(e,t,i,r,n){const o=n?1:r/this.pitchfactor,a=e.lastSegmentViewportDistance*i;return e.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(t))}placeCollisionCircles(e,t,i,r,n,o,a,s,l,u,c,h,d){const f=[],p=this.projectAnchor(l,n.anchorX,n.anchorY),_=s/24,m=n.lineOffsetX*s,$=n.lineOffsetY*s,g=new Point(n.anchorX,n.anchorY),v=projection.project(g,u).point,y=projection.placeFirstAndLastGlyph(_,a,m,$,!1,v,g,n,o,u,{},!0);let x=!1,b=!1,w=!0;const C=p.perspectiveRatio*r,T=1/(r*i);let S=0,E=0;y&&(S=this.approximateTileDistance(y.first.tileDistance,y.first.angle,T,p.cameraDistance,h),E=this.approximateTileDistance(y.last.tileDistance,y.last.angle,T,p.cameraDistance,h));for(let i=0;i<e.length;i+=5){const r=e[i],n=e[i+1],o=e[i+2],a=e[i+3];if(!y||a<-S||a>E){_0x40a136(e,i,!1);continue}const s=this.projectPoint(l,r,n),u=o*C;if(f.length>0){const t=s.x-f[f.length-4],r=s.y-f[f.length-3];if(u*u*2>t*t+r*r){if(i+8<e.length){const t=e[i+8];if(t>-S&&t<E){_0x40a136(e,i,!1);continue}}}}const h=i/5;f.push(s.x,s.y,u,h),_0x40a136(e,i,!0);const p=s.x-u,_=s.y-u,m=s.x+u,$=s.y+u;if(w=w&&this.isOffscreen(p,_,m,$),b=b||this.isInsideGrid(p,_,m,$),!t&&this.grid.hitTestCircle(s.x,s.y,u,d)){if(!c)return{circles:[],offscreen:!1};x=!0}}return{circles:x||!b?[]:f,offscreen:w}}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const t=[];let i=1/0,r=1/0,n=-1/0,o=-1/0;for(const a of e){const e=new Point(a.x+_0x4cbcfd,a.y+_0x4cbcfd);i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),o=Math.max(o,e.y),t.push(e)}const a=this.grid.query(i,r,n,o).concat(this.ignoredGrid.query(i,r,n,o)),s={},l={};for(const e of a){const i=e.key;if(void 0===s[i.bucketInstanceId]&&(s[i.bucketInstanceId]={}),s[i.bucketInstanceId][i.featureIndex])continue;(void 0)(t,[new Point(e.x1,e.y1),new Point(e.x2,e.y1),new Point(e.x2,e.y2),new Point(e.x1,e.y2)])&&(s[i.bucketInstanceId][i.featureIndex]=!0,void 0===l[i.bucketInstanceId]&&(l[i.bucketInstanceId]=[]),l[i.bucketInstanceId].push(i.featureIndex))}return l}insertCollisionBox(e,t,i,r,n){const o={bucketInstanceId:i,featureIndex:r,collisionGroupID:n};(t?this.ignoredGrid:this.grid).insert(o,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,r,n){const o=t?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:r,collisionGroupID:n};for(let t=0;t<e.length;t+=4)o.insertCircle(a,e[t],e[t+1],e[t+2])}projectAnchor(e,t,i){const r=[t,i,0,1];return projection.xyTransformMat4(r,r,e),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}}projectPoint(e,t,i){const r=[t,i,0,1];return projection.xyTransformMat4(r,r,e),new Point((r[0]/r[3]+1)/2*this.transform.width+_0x4cbcfd,(-r[1]/r[3]+1)/2*this.transform.height+_0x4cbcfd)}projectAndGetPerspectiveRatio(e,t,i){const r=[t,i,0,1];projection.xyTransformMat4(r,r,e);return{point:new Point((r[0]/r[3]+1)/2*this.transform.width+_0x4cbcfd,(-r[1]/r[3]+1)/2*this.transform.height+_0x4cbcfd),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}}isOffscreen(e,t,i,r){return i<_0x4cbcfd||e>=this.screenRightBoundary||r<_0x4cbcfd||t>this.screenBottomBoundary}isInsideGrid(e,t,i,r){return i>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}}function _0x40a136(e,t,i){e[t+4]=i?1:0}var _0x2e8631=(_0x2105b9=!0,function(e,t){var i=_0x2105b9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2105b9=!1,i}),_0x5cff21=_0x2e8631(void 0,(function(){return _0x5cff21.toString().search("(((.+)+)+)+$").toString().constructor(_0x5cff21).search("(((.+)+)+)+$")})),_0x2105b9;_0x5cff21(),new e$1S;class _0x4d3dc4{constructor(e,t,i,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class _0x4cd76a{constructor(e,t,i,r,n){this.text=new _0x4d3dc4(e?e.text:null,t,i,n),this.icon=new _0x4d3dc4(e?e.icon:null,t,r,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class _0x3c33e0{constructor(e,t,i){this.text=e,this.icon=t,this.skipFade=i}}class Placement{constructor(e,t,i,r,n){this.scene=e,this.transform=t.clone(),this.collisionIndex=new _0x2ee188(e.drawingBufferWidth,e.drawingBufferHeight,this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.isOverlapDisplayed=n,this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}}placeLayerTile(e,t){var i=this,r=t._MVTLabel._billboardsByLayers[e.id],n=this.isOverlapDisplayed,o=this.scene.frameState.frameNumber;for(var a in r){for(var s=r[a],l=void 0,u=0;u<s.length;u++){var c=s[u];if(c.collisionFrameNumber!==o){c.collisionFrameNumber=o;var h=c.computeScreenSpacePosition(i.scene);if(h)if(l){var d=n$X.getScreenSpaceBoundingBox(c,h);f$10.union(l,d,l)}else l=new f$10,n$X.getScreenSpaceBoundingBox(c,h,l)}}if(!l)continue;var f={x1:l.x,y1:l.y,x2:l.x+l.width,y2:l.y+l.height,anchorPointX:0,anchorPointY:0};const e=i.collisionIndex.placeCollisionBox(f,n);if(e.box&&e.box.length>0&&t._visible){i.collisionIndex.insertCollisionBox(e.box,!1,a),this.placements[a]=new _0x3c33e0(!0,!1,e.offscreen)}}}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const r=t?t.symbolFadeChange(e):1,n=t?t.opacities:{};for(const e in this.placements){const t=this.placements[e],o=n[e];o?(this.opacities[e]=new _0x4cd76a(o,r,t.text,t.icon),i=i||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new _0x4cd76a(null,r,t.text,t.icon,t.skipFade),i=i||t.text||t.icon)}for(const e in n){const t=n[e];if(!this.opacities[e]){const n=new _0x4cd76a(t,r,!1,!1);!n.isHidden()&&(this.opacities[e]=n,i=i||t.text.placed||t.icon.placed)}}i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const i=new _0x4cd76a(null,0,!1,!1,!0);for(var r=0;r<t.length;r++){var n=t[r]._MVTLabel._billboardsByLayers[e.id];if(n)for(var o in n){var a=n[o];let e=this.opacities[o];!e&&(e=i,this.opacities[o]=e);for(var s=0;s<a.length;s++){a[s].opacityState=e.text}}}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let i;if(this.zoomAtLastRecencyCheck===t){i=1-this.zoomAdjustment(t)}else i=1;this.zoomAtLastRecencyCheck=t;return this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0}}const _0x40835b=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x53de6f=_0x40835b(void 0,(function(){return _0x53de6f.toString().search("(((.+)+)+)+$").toString().constructor(_0x53de6f).search("(((.+)+)+)+$")}));_0x53de6f();class _0x1666d7{constructor(){this._currentTileIndex=0}continuePlacement(e,t,i,r){for(;this._currentTileIndex<e.length;){const n=e[this._currentTileIndex];if(t.placeLayerTile(i,n),this._currentTileIndex++,r())return!0}}}class _0x48cc6a{constructor(e,t,i,r,n,o,a){this.placement=new Placement(e,t,n,o,a),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._done=!1}isDone(){return this._done}continuePlacement(e,t,i){const r=performance.now(),n=()=>{const e=performance.now()-r;return!this._forceFullPlacement&&e>2};for(;this._currentPlacementIndex>=0;){const r=t[e[this._currentPlacementIndex]];if(r){if(this.placement.collisionIndex.transform.zoom,"symbol"===r.type){if("point"!==r.layout.get("symbol-placement")){this._currentPlacementIndex--;continue}!this._inProgressLayer&&(this._inProgressLayer=new _0x1666d7);if(this._inProgressLayer.continuePlacement(i,this.placement,r,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}else this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}var _0x220fb6=(_0x52009c=!0,function(e,t){var i=_0x52009c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x52009c=!1,i}),_0x30bc7e=_0x220fb6(void 0,(function(){return _0x30bc7e.toString().search("(((.+)+)+)+$").toString().constructor(_0x30bc7e).search("(((.+)+)+)+$")})),_0x52009c;function _0x5ceb95(e){this.dispatcher=new _0xb7578d(_0x1fada7(),this),this._layers={},this._order=[],this.sourceCaches={},this._loaded=!1,this.highLighting=!1,this.imageManager=new _0x187c3b,this.glyphManager=new _0x4c2413(e._requestManager,e._localIdeographFontFamily),this.lineAtlas=new _0x13dfbf(256,512),this.map=e,this._resetUpdates()}_0x30bc7e(),_0x5ceb95.prototype._load=function(e){for(var t in this._loaded=!0,this.stylesheet=e,e.sources);var i;e$28(e.sprite)?i=e.sprite.slice(0,e.sprite.indexOf("/sprites/sprite")):e$28(e.glyphs)&&(i=e.glyphs.slice(0,e.glyphs.indexOf("/fonts/{fontstack}/{range}"))),e$28(a$Y.CREDENTIAL)&&(e$28(a$Y.CREDENTIAL._keymap[i])?(e.sprite=a$Y.addTokenWithKey(i,e.sprite),e.glyphs=a$Y.addTokenWithKey(i,e.glyphs)):(e.sprite=a$Y.addToken(e.sprite),e.glyphs=a$Y.addToken(e.glyphs))),e.sprite?this._spriteRequest=_0x1f4db5(e.sprite,this.map._requestManager,((e,t)=>{if(this._spriteRequest=null,e);else if(t)for(const e in t)this.imageManager.addImage(e,t[e]);this.imageManager.setLoaded(!0),this.dispatcher.broadcast("setImages",this.imageManager.listImages()),this.map._resourceReady=!0})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var r=this.stylesheet.layers;this._order=r.map((function(e){return e.id})),this._layers={};for(var n=0,o=r;n<o.length;n+=1){var a=f=o[n];if(null!=(f=_0x10c42b(f))){f.config=a,f.config.originalFilter=clone(f.filter);var s=new _0x105812(0);f.recalculate(s),this._layers[f.id]=f}}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order));var l=this._layers,u=new _0x24b7d3(r);for(var c in u.familiesBySource){var h=u.familiesBySource[c];for(var d in h)for(n=0,o=h[d];n<o.length;n+=1){var f,p=o[n],_=(f=p[0]).id;p.map((function(e){l[e.id].bucketName=_}))}}},_0x5ceb95.prototype.update=function(e){if(this._loaded){var t=new _0x105812(0);if(this._changed,this._changed){var i=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var n in(i.length||r.length)&&this._updateWorkerLayers(e,i,r),this._updatedPaintProps)this._layers[n].updateTransitions(t);this._resetUpdates()}for(var o in this.sourceCaches)this.sourceCaches[o].used=!1;for(var a=0,s=this._order;a<s.length;a+=1){var l=s[a],u=this._layers[l];null!=u&&null!=u&&u.recalculate(t,this.imageManager.listImages())}}},_0x5ceb95.prototype._updateWorkerLayers=function(e,t,i){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:i});for(var r=[],n=0;n<t.length;n++){var o=t[n],a=this._layers[o];e$28(a)&&r.push(a.config)}for(var s in e){e[s].addRepaintTask(r,i,this.highLighting)}this.highLighting=!1},_0x5ceb95.prototype.addLayer=function(e,t,i){var r=e.id;if(this.getLayer(r))console.log('Layer with id "'+r+'" already exists on this map');else{var n=_0x10c42b(e);n.config=e;var o=t?this._order.indexOf(t):this._order.length;t&&-1===o?console.log('Layer with id "'+t+'" does not exist on this map.'):(this._order.splice(o,0,r),this._layerOrderChanged=!0,this._layers[r]=n,this._updateLayer(n))}},_0x5ceb95.prototype.moveLayer=function(e,t){if(this._changed=!0,this._layers[e]){if(e!==t){var i=this._order.indexOf(e);this._order.splice(i,1);var r=t?this._order.indexOf(t):this._order.length;t&&-1===r?console.log('Layer with id "'+t+'" does not exist on this map.'):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}}else console.log("The layer '"+e+"' does not exist in the map's style and cannot be moved.")},_0x5ceb95.prototype.loaded=function(){if(!this._loaded)return!1;if(id!==before){var e=this._order.indexOf(id);this._order.splice(e,1);var t=before?this._order.indexOf(before):this._order.length;before&&-1===t||(this._order.splice(t,0,id),this._layerOrderChanged=!0)}},_0x5ceb95.prototype.removeLayer=function(e){var t=this._layers[e];if(t){var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],t.onRemove&&t.onRemove(this.map)}else console.log("The layer '"+e+"' does not exist in the map's style and cannot be removed.")},_0x5ceb95.prototype.getLayer=function(e){return this._layers[e]},_0x5ceb95.prototype.setFilter=function(e,t,i){var r=this.getLayer(e);if(r){if(!_0x3a5723(r.filter,t)){if(null==t)e$28(r.config.originalFilter)?(r.filter=clone(r.config.originalFilter),r.config.filter=clone(r.config.originalFilter)):(r.filter=void 0,r.config.filter=null);else if(e$28(r.filter)&&Array.isArray(r.filter)&&"all"===r.filter[0]){var n=!1;if("in"===t[0])for(var o=0;o<r.filter.length;o++)"in"===r.filter[o][0]&&(r.filter[o]=t,n=!0);!n&&(r.filter.push(t),r.config.filter=r.filter)}else r.filter=clone(t),r.config.filter=clone(r.filter);this._updateLayer(r)}}else console.log("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")},_0x5ceb95.prototype.getFilter=function(e){return clone(this.getLayer(e).filter)},_0x5ceb95.prototype.setLayoutProperty=function(e,t,i,r){void 0===r&&(r={});var n=this.getLayer(e);n?_0x3a5723(n.getLayoutProperty(t),i)||(n.setLayoutProperty(t,i,r),this._updateLayer(n)):console.log("The layer '"+e+"' does not exist in the map's style and cannot be styled.")},_0x5ceb95.prototype.getLayoutProperty=function(e,t){var i=this.getLayer(e);if(i)return i.getLayoutProperty(t);console.log("The layer '"+e+"' does not exist in the map's style.")},_0x5ceb95.prototype.setPaintProperty=function(e,t,i,r){void 0===r&&(r={});var n=this.getLayer(e);n?_0x3a5723(n.getPaintProperty(t),i)||(n.setPaintProperty(t,i,r),this._updateLayer(n),this._changed=!0,this._updatedPaintProps[e]=!0):console.log("The layer '"+e+"' does not exist in the map's style and cannot be styled.")},_0x5ceb95.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},_0x5ceb95.prototype._serializeLayers=function(e){for(var t=[],i=0,r=e;i<r.length;i+=1){var n=r[i],o=this._layers[n];e$28(o)&&("custom"!==o.type&&t.push(o.serialize()))}return t},_0x5ceb95.prototype.serialize=function(){return filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},_0x5ceb95.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}},_0x5ceb95.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,this._changed=!0},_0x5ceb95.prototype.setHighLight=function(e,t){var i=this._findHighLightFeature(e);if(!e$28(i))return e$28(this.lastHighLightLayerID)&&(this.removeLayer(this.lastHighLightLayerID),this.lastHighLightLayerID=null,this.highLighting=!0),void(t._currentPickID=void 0);e.featureID=i.id,e.layerID=i.layer.id;var r=i.layer,n=r["source-layer"]+"_"+r.type+"_highlight",o=this._layers[n];if(t._currentPickID=n+e.featureID,!e$28(o)){var a={};a["source-layer"]=r["source-layer"],a.source=r.source,a.id=n;var s=r.paint["fill-color"]&&0===e$1S.fromCssColorString(r.paint["fill-color"]).alpha||0===r.paint["fill-opacity"],l={};"circle"==r.type?(a.type="circle",l["circle-color"]=t._selectedColor.toCssColorString(),l["circle-radius"]=r.paint["circle-radius"]||5):"fill"!=r.type||s?(a.type="line",l["line-color"]=t._selectedColor.toCssColorString(),l["line-width"]=2):(a.type="fill",l["fill-color"]=t._selectedColor.toCssColorString()),a.paint=l,this.addLayer(a)}var u=["in","$id",i.id];this.setFilter(n,u),e$28(this.lastHighLightLayerID)&&this.lastHighLightLayerID!==n&&this.removeLayer(this.lastHighLightLayerID),this.lastHighLightLayerID=n,this.highLighting=!0},_0x5ceb95.prototype.cancelHighLight=function(e){e$28(this.lastHighLightLayerID)&&(this.removeLayer(this.lastHighLightLayerID),this.lastHighLightLayerID=null,this.highLighting=!0),e._currentPickID=void 0},_0x5ceb95.prototype._findHighLightFeature=function(e){for(var t={},i=0;i<this._order.length;i++){t[this._order[i]]=i}var r=null,n=0;for(var o in e)for(var a=e[o],s=0;s<a.length;s++){var l=a[s].feature;if(1==l.type||2==l.type||3==l.type){var u=t[l.layer.id];u>=n&&(r=l,n=u)}}return r},_0x5ceb95.prototype._updatePlacement=function(e,t,i){let r=!1;var n=this.map.innerLayer._imageryCache,o=[];for(var a in n)o.push(n[a]);o.sort((function(e,t){return t.level-e.level||(e.isTileIDLessThan(t)?-1:1)}));const s=this._layerOrderChanged||0===i;if((s||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(window.performance.now(),t.zoom))&&(this.pauseablePlacement=new _0x48cc6a(e,t,this._order,s,i,this.placement,this.map._isOverlapDisplayed),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,o),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(window.performance.now()),r=!0)),r)for(const e of this._order){const t=this._layers[e];t&&"symbol"===t.type&&this.placement.updateLayerOpacities(t,o)}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(performance.now())},_0x5ceb95.prototype.getImages=function(e,t,i){this.imageManager.getImages(t.icons,i)},_0x5ceb95.prototype.getGlyphs=function(e,t,i){this.glyphManager.getGlyphs(t.stacks,i)},_0x5ceb95.prototype.getResource=function(e,t,i){return makeRequest(t,i)};const _0x5afcc1=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x4e0a8b=_0x5afcc1(void 0,(function(){return _0x4e0a8b.toString().search("(((.+)+)+)+$").toString().constructor(_0x4e0a8b).search("(((.+)+)+)+$")}));_0x4e0a8b();class _0x1c0601{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof _0xa1d598?new _0xa1d598(e.lng,e.lat):_0xa1d598.convert(e),this}setSouthWest(e){return this._sw=e instanceof _0xa1d598?new _0xa1d598(e.lng,e.lat):_0xa1d598.convert(e),this}extend(e){const t=this._sw,i=this._ne;let r,n;if(e instanceof _0xa1d598)r=e,n=e;else{if(!(e instanceof _0x1c0601))return Array.isArray(e)?e.every(Array.isArray)?this.extend(_0x1c0601.convert(e)):this.extend(_0xa1d598.convert(e)):this;if(r=e._sw,n=e._ne,!r||!n)return this}return t||i?(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new _0xa1d598(r.lng,r.lat),this._ne=new _0xa1d598(n.lng,n.lat)),this}getCenter(){return new _0xa1d598((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new _0xa1d598(this.getWest(),this.getNorth())}getSouthEast(){return new _0xa1d598(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:i}=_0xa1d598.convert(e),r=this._sw.lat<=i&&i<=this._ne.lat;let n=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=t&&t>=this._ne.lng),r&&n}static convert(e){return!e||e instanceof _0x1c0601?e:new _0x1c0601(e)}}const _0x2467a0=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x3d22ea=_0x2467a0(void 0,(function(){return _0x3d22ea.toString().search("(((.+)+)+)+$").toString().constructor(_0x3d22ea).search("(((.+)+)+)+$")}));_0x3d22ea();class _0xa1d598{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new _0xa1d598(wrap(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat("+this.lng+", "+this.lat+")"}toBounds(e){const t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new _0x1c0601(new _0xa1d598(this.lng-i,this.lat-t),new _0xa1d598(this.lng+i,this.lat+t))}static convert(e){if(e instanceof _0xa1d598)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new _0xa1d598(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new _0xa1d598(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const _0x1595cf=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1a561b=_0x1595cf(void 0,(function(){return _0x1a561b.toString().search("(((.+)+)+)+$").toString().constructor(_0x1a561b).search("(((.+)+)+)+$")}));_0x1a561b();const _0x237987=2*Math.PI*6378137;function _0x4e29c3(e){return _0x237987*Math.cos(e*Math.PI/180)}function mercatorXfromLng(e){return(180+e)/360}function mercatorYfromLat(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function mercatorZfromAltitude(e,t){return e/_0x4e29c3(t)}function lngFromMercatorX(e){return 360*e-180}function latFromMercatorY(e){const t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function altitudeFromMercatorZ(e,t){return e*_0x4e29c3(latFromMercatorY(t))}function mercatorScale(e){return 1/Math.cos(e*Math.PI/180)}class _0x303a1f{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(e,t=0){const i=_0xa1d598.convert(e);return new _0x303a1f(mercatorXfromLng(i.lng),mercatorYfromLat(i.lat),mercatorZfromAltitude(t,i.lat))}toLngLat(){return new _0xa1d598(lngFromMercatorX(this.x),latFromMercatorY(this.y))}toAltitude(){return altitudeFromMercatorZ(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/_0x237987*mercatorScale(latFromMercatorY(this.y))}}const _0x3b1a78=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x279339=_0x3b1a78(void 0,(function(){return _0x279339.toString().search("(((.+)+)+)+$").toString().constructor(_0x279339).search("(((.+)+)+)+$")}));_0x279339();class _0x40b0d6{constructor(e,t,i,r,n){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===n||n,this._minZoom=e||0,this._maxZoom=t||26,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new _0xa1d598(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const e=new _0x40b0d6(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._calcMatrices(),e}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerPoint(){return this.size._div(2)}get size(){return new _0x36c32e(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const t=-wrap(e,-180,180)*Math.PI/180;this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=mat2.create(),mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const t=clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){const t=[new UnwrappedTileID(0,e)];if(this._renderWorldCopies){const i=this.pointCoordinate(new _0x36c32e(0,0)),r=this.pointCoordinate(new _0x36c32e(this.width,0)),n=this.pointCoordinate(new _0x36c32e(this.width,this.height)),o=this.pointCoordinate(new _0x36c32e(0,this.height)),a=Math.floor(Math.min(i.x,r.x,n.x,o.x)),s=Math.floor(Math.max(i.x,r.x,n.x,o.x)),l=1;for(let i=a-l;i<=s+l;i++)0!==i&&t.push(new UnwrappedTileID(i,e))}return t}coveringTiles(e){let t=this.coveringZoomLevel(e);const i=t;if(void 0!==e.minzoom&&t<e.minzoom)return[];void 0!==e.maxzoom&&t>e.maxzoom&&(t=e.maxzoom);const r=_0x303a1f.fromLngLat(this.center),n=Math.pow(2,t),o=new _0x36c32e(n*r.x-.5,n*r.y-.5),a=[this.pointCoordinate(new _0x36c32e(0,0)),this.pointCoordinate(new _0x36c32e(this.width,0)),this.pointCoordinate(new _0x36c32e(this.width,this.height)),this.pointCoordinate(new _0x36c32e(0,this.height))];return tileCover(t,a,e.reparseOverscaled?i:t,this._renderWorldCopies).sort(((e,t)=>o.dist(e.canonical)-o.dist(t.canonical)))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const t=clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new _0x36c32e(mercatorXfromLng(e.lng)*this.worldSize,mercatorYfromLat(t)*this.worldSize)}unproject(e){return new _0x303a1f(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(e,t){const i=this.pointCoordinate(t),r=this.pointCoordinate(this.centerPoint),n=this.locationCoordinate(e),o=new _0x303a1f(n.x-(i.x-r.x),n.y-(i.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e){return this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}locationCoordinate(e){return _0x303a1f.fromLngLat(e)}coordinateLocation(e){return e.toLngLat()}pointCoordinate(e){const t=[e.x,e.y,0,1],i=[e.x,e.y,1,1];vec4.transformMat4(t,t,this.pixelMatrixInverse),vec4.transformMat4(i,i,this.pixelMatrixInverse);const r=t[3],n=i[3],o=t[1]/r,a=i[1]/n,s=t[2]/r,l=i[2]/n,u=s===l?0:(0-s)/(l-s);return new _0x303a1f(interpolate(t[0]/r,i[0]/n,u)/this.worldSize,interpolate(o,a,u)/this.worldSize)}coordinatePoint(e){const t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return vec4.transformMat4(t,t,this.pixelMatrix),new _0x36c32e(t[0]/t[3],t[1]/t[3])}getBounds(){return(new _0x1c0601).extend(this.pointLocation(new _0x36c32e(0,0))).extend(this.pointLocation(new _0x36c32e(this.width,0))).extend(this.pointLocation(new _0x36c32e(this.width,this.height))).extend(this.pointLocation(new _0x36c32e(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new _0x1c0601([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(e,t=!1){const i=e.key,r=t?this._alignedPosMatrixCache:this._posMatrixCache;if(r[i])return r[i];const n=e.canonical,o=this.worldSize/this.zoomScale(n.z),a=n.x+Math.pow(2,n.z)*e.wrap,s=_0x1d4fb9.mat4.identity(new Float64Array(16));return _0x1d4fb9.mat4.translate(s,s,[a*o,n.y*o,0]),_0x1d4fb9.mat4.scale(s,s,[o/_0xea783f,o/_0xea783f,1]),_0x1d4fb9.mat4.multiply(s,t?this.alignedProjMatrix:this.projMatrix,s),r[i]=new Float32Array(s),r[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e,t,i,r,n=-90,o=90,a=-180,s=180;const l=this.size,u=this._unmodified;if(this.latRange){const t=this.latRange;n=mercatorYfromLat(t[1])*this.worldSize,o=mercatorYfromLat(t[0])*this.worldSize,e=o-n<l.y?l.y/(o-n):0}if(this.lngRange){const e=this.lngRange;a=mercatorXfromLng(e[0])*this.worldSize,s=mercatorXfromLng(e[1])*this.worldSize,t=s-a<l.x?l.x/(s-a):0}const c=this.point,h=Math.max(t||0,e||0);if(h)return this.center=this.unproject(new _0x36c32e(t?(s+a)/2:c.x,e?(o+n)/2:c.y)),this.zoom+=this.scaleZoom(h),this._unmodified=u,void(this._constraining=!1);if(this.latRange){const e=c.y,t=l.y/2;e-t<n&&(r=n+t),e+t>o&&(r=o-t)}if(this.lngRange){const e=c.x,t=l.x/2;e-t<a&&(i=a+t),e+t>s&&(i=s-t)}(void 0!==i||void 0!==r)&&(this.center=this.unproject(new _0x36c32e(void 0!==i?i:c.x,void 0!==r?r:c.y))),this._unmodified=u,this._constraining=!1}_calcMatrices(){if(!this.height)return;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;const e=this._fov/2,t=Math.PI/2+this._pitch,i=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-t-e),r=this.point,n=r.x,o=r.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),s=this.height/50;let l=new Float64Array(16);_0x1d4fb9.mat4.perspective(l,this._fov,this.width/this.height,s,a),_0x1d4fb9.mat4.scale(l,l,[1,-1,1]),_0x1d4fb9.mat4.translate(l,l,[0,0,-this.cameraToCenterDistance]),_0x1d4fb9.mat4.rotateX(l,l,this._pitch),_0x1d4fb9.mat4.rotateZ(l,l,this.angle),_0x1d4fb9.mat4.translate(l,l,[-n,-o,0]),this.mercatorMatrix=_0x1d4fb9.mat4.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),_0x1d4fb9.mat4.scale(l,l,[1,1,mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l;const u=this.width%2/2,c=this.height%2/2,h=Math.cos(this.angle),d=Math.sin(this.angle),f=n-Math.round(n)+h*u+d*c,p=o-Math.round(o)+h*c+d*u,_=new Float64Array(l);if(_0x1d4fb9.mat4.translate(_,_,[f>.5?f-1:f,p>.5?p-1:p,0]),this.alignedProjMatrix=_,l=_0x1d4fb9.mat4.create(),_0x1d4fb9.mat4.scale(l,l,[this.width/2,-this.height/2,1]),_0x1d4fb9.mat4.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=_0x1d4fb9.mat4.create(),_0x1d4fb9.mat4.scale(l,l,[1,-1,1]),_0x1d4fb9.mat4.translate(l,l,[-1,-1,0]),_0x1d4fb9.mat4.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=_0x1d4fb9.mat4.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),l=_0x1d4fb9.mat4.invert(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new _0x36c32e(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return vec4.transformMat4(t,t,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=this._pitch,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new _0x36c32e(0,t))}getCameraQueryGeometry(e){const t=this.getCameraPoint();if(1===e.length)return[e[0],t];{let i=t.x,r=t.y,n=t.x,o=t.y;for(const t of e)i=Math.min(i,t.x),r=Math.min(r,t.y),n=Math.max(n,t.x),o=Math.max(o,t.y);return[new _0x36c32e(i,r),new _0x36c32e(n,r),new _0x36c32e(n,o),new _0x36c32e(i,o),new _0x36c32e(i,r)]}}}var e$1D={None:0,FixedZ:1,FixedXYZ:2,FIXED_ROTATE_ANGLE:3},$r$4=Object.freeze(e$1D),ke$g=[1.690163571602655e-9,3.3803271432053056e-9,6.760654286410611e-9,1.3521308572821242e-8,2.7042617145642478e-8,5.408523429128511e-8,1.0817046858256998e-7,2.1634093716513974e-7,4.3268187433028044e-7,8.653637486605571e-7,17307274973211203e-22,34614549946422405e-22,69229099892844565e-22,13845819978568952e-21,27691639957137904e-21,553832799142758e-19,.0001107665598285516,.0002215331196571032,.0004430662393142064,.0008861324786284128,.001772264957256826,.003544529914513652],B$O=0;function M$X(e,t){t=u$Y(t,{}),this._name=t.name,this._tilingScheme=t.tilingScheme,this._owner=void 0,this._hasTileWith=!1,e$28(t.tileWidth)&&e$28(t.tileHeight)&&(this._hasTileWith=!0),this._tileWidth=u$Y(parseInt(t.tileWidth)||void 0,512),this._tileHeight=u$Y(parseInt(t.tileHeight)||void 0,512),this._canvasWidth=u$Y(parseInt(t.canvasWidth)||void 0,512),this._canvasWidth=e$27.clamp(this._canvasWidth,128,1024),e$28(t.minimumLevel)&&e$28(t.maximumLevel)&&(this._hasLevel=!0),this._minimumLevel=u$Y(parseInt(t.minimumLevel)||void 0,0),this._maximumLevel=parseInt(t.maximumLevel)||void 0,this.minimumTerrainLevel=parseInt(t.minimumTerrainLevel)||void 0,this.maximumTerrainLevel=parseInt(t.maximumTerrainLevel)||void 0,this._styleName=u$Y(t.styleName,""),this._mapboxStyle=t.mapboxStyle,this._colDiff=0,this._rowDiff=0,this._ready=!1,this._resourceReady=!1,this._requestMetadataSuccess=!1,this._requestStyleSuccess=!1,this._readyPromise=o$1q.defer(),this._layers={},this._selectEnabled=u$Y(t.selectEnabled,!0),this._selectedColor=u$Y(t.selectedColor,e$1S.fromCssColorString("#00FFFF")),this._overlapDisplayedThreshold=0,this._localIdeographFontFamily=u$Y(t.localIdeographFontFamily,!1),this._key=u$Y(t.key,""),this._url=u$Y(t.url,""),this._url.length>0&&0===this._url.indexOf("//")&&(this._url=window.location.protocol+this._url),this._labelScaleByDistance=t.labelScaleByDistance,this._resource=t$S.createIfNeeded(this._url),this._context=e,this._transform=new _0x40b0d6(0,22,0,60),this._painter=new _0x2db5de(e,this._transform,this._canvasWidth),this._painter.lineAntialiasing=t.lineAntialiasing,this._requestManager=new _0x2b40a2((e=>({url:e,headers:t.customRequestHeaders}))),this._MVTStyle=new _0x5ceb95(this),this._viewer=t.viewer,this._iswmts=-1!==this._url.indexOf("wmts"),this._isgeoserver=-1!==this._url.indexOf("/geoserver/"),this._isRealspace=-1!==this._url.indexOf("rest/realspace"),this._isTdt=u$Y(t.isTdt,!1),this._packingRequest=this._isRealspace?t.packingRequest:void 0,this._hasIndex=t.hasIndex||!1,this._isTdt?(this._urlTiles=this._url+"?t=vt&z={z}&x={x}&y={y}",this.tablename=this._url):this._iswmts?(this._layer=u$Y(t.layer,""),this._format=u$Y(t.format,"mvt"),this._tilematrixset=u$Y(t.tilematrixset,""),this._minimumLevel=u$Y(parseInt(t.minimumLevel)||void 0,0),this._maximumLevel=u$Y(parseInt(t.maximumLevel)||void 0,0),this.tablename=this._layer+this._tilematrixset):this._isRealspace?(this._urlTiles=this._url+"/data/index/{y}/{x}.mvt?level={z}&returnAttributes=true",this.tablename=this._url):(this._urlTiles=this._url+"/tiles/{z}/{x}/{y}.mvt?returnAttributes=true",this.tablename=this._url),this._tileCache={},this._scales=u$Y(t.scales,ke$g),this._id=-1,this._errorEvent=new o$1o,this._pausing=!1,this._selectEnabled=!0,this._maxImageCacheLevel=0,this.minificationFilter=t.minificationFilter,this.magnificationFilter=t.magnificationFilter,this._renderTextureList={"512_512":new L$17({context:e,width:512,height:512,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8})},this._isOverlapDisplayed=u$Y(t.isOverlapDisplayed,!1),this._enableMorphing=!1,this.realtime=u$Y(t.realtime,!1),this._billboardMode=u$Y(t.billboardMode,$r$4.None),this.selectTolerance=.2,this._customRequestHeaders=t.customRequestHeaders;var i=this;function r(){if(i._iswmts){var e=t.url+"?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities";e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,e):a$Y.addToken(e)),o$1q(d$17(e,i._customRequestHeaders),a,u)}else if(i._isRealspace){e=t.url+"/config";e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,e):a$Y.addToken(e)),o$1q(u$P(e,i._customRequestHeaders),n,u)}else{var r=t.url+".json";e$28(a$Y.CREDENTIAL)&&(r=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,r):a$Y.addToken(r)),o$1q(u$O(r,i._customRequestHeaders),l,u)}}function n(e){var t=function(e){e=o.parseFromString(e,"application/xml");for(var t="http://www.supermap.com/SuperMapCache/sci3d",r=e.childNodes[0],n=Qe$f(j$10(r,"Levels",t),"Level",t),a=[],s=0,l=n.length;s<l;s++)a.push(parseInt(n[s].textContent,10));var u=j$10(r,"Bounds",t),c=D$W(u,"Left",t),h=D$W(u,"Right",t),d=D$W(u,"Top",t),f=D$W(u,"Bottom",t),p=de$x(r,"FileExtentName",t),_=D$W(r,"CellWidth",t),m=D$W(r,"CellHeight",t),$=de$x(r,"CacheName",t);return i._name||(i._name=$||""),{left:c,right:h,top:d,bottom:f,fileExtentName:p,levels:a,imageSizeWidth:_,imageSizeHeight:m}}(e);i._fileExtension=u$Y(t.fileExtentName,"mvt"),i._tileWidth=u$Y(t.imageSizeWidth,256),i._tileHeight=u$Y(t.imageSizeHeight,256),i._coordUnit="DEGREE";var r=t.levels,n=r.length;i._minimumLevel=u$Y(r[0],0),i._maximumLevel=u$Y(r[n-1],n-1),e$28(i._tilingScheme)||(i._tilingScheme=new g$14);var a,s,l,u,c=i._tilingScheme;e$28(i._rectangle)||t.left&&t.right&&t.top&&t.bottom&&(a=e$27.toRadians(t.left),l=e$27.toRadians(t.right),s=e$27.toRadians(t.bottom),u=e$27.toRadians(t.top),i._rectangle=new h$10(a,s,l,u));i._rectangle.west<c.rectangle.west&&(i._rectangle.west=c.rectangle.west),i._rectangle.east>c.rectangle.east&&(i._rectangle.east=c.rectangle.east),i._rectangle.south<c.rectangle.south&&(i._rectangle.south=c.rectangle.south),i._rectangle.north>c.rectangle.north&&(i._rectangle.north=c.rectangle.north),i._tilingScheme=c,i._urlTemplate=i._url+"data/index/{y}/{x}.{fileExtension}?level={level}",i._ready=!0,i._requestMetadataSuccess=!0,i._requestMetadataSuccess&&i._requestStyleSuccess&&i._readyPromise.resolve(!0)}this._subdomains=t.subdomains,e$28(this._subdomains)&&(t.url=t.url.replace(/({.*?})/g,(function(e,t){if(!e$28(i._subdomains.length))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");return"{s}"===t?i._subdomains[0]:e}))),this._isTdt?function(e){if(!e._hasLevel){var t=30,i=-1;if(!e$28(e._mapboxStyle))throw new t$Z("tdt mapbox style should be passed.");for(var r in e._mapboxStyle.sources){var n=e._mapboxStyle.sources[r];t=Math.min(n.minZoom,t),i=Math.max(n.maxZoom,i)}e._minimumLevel=t,e._maximumLevel=i}e$28(e._tilingScheme)||(e._tilingScheme=new g$14),e._coordUnit=e._tilingScheme instanceof g$14?"DEGREE":"METER",e._rectangle=h$10.clone(e._tilingScheme._rectangle),e._urlTemplate=e._url+"?t=vt&z={z}&x={x}&y={y}",e._requestMetadataSuccess=!0,A$10(e,e._mapboxStyle),e._requestStyleSuccess=!0,e._readyPromise.resolve(!0)}(this):(r(),this._isgeoserver||function(){var e;if(e$28(i._mapboxStyle))A$10(i,i._mapboxStyle);else if(i._isRealspace)e=t.url+"/data/path/style.json",e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,e):a$Y.addToken(e)),r=u$O(e,i._customRequestHeaders);else{var r;e=i._iswmts?t.url+"?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetStyle&STYLENAME="+i._styleName:t.url+"/style.json",e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,e):a$Y.addToken(e)),r=u$O(e,i._customRequestHeaders)}o$1q(r,(function(e){e$28(e)?(i._mapboxStyle=e,A$10(i,e),i._requestStyleSuccess=!0,i._requestMetadataSuccess&&i._requestStyleSuccess&&i._readyPromise.resolve(!0)):console.log("style request failed")}),(function(r){e=t.url+"/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true",e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._url])?a$Y.addTokenWithKey(i._url,e):a$Y.addToken(e)),u$O(e,i._customRequestHeaders).then((function(e){i._mapboxStyle=e,A$10(i,e),i._tileFeature=!0,i._urlTiles=i._url+"/tileFeature.mvt?returnAttributes=true&x={x}&y={y}&width=512&height=512&scale={scale}&origin={'x':-180,'y':90}"})),u()}))}());var o=new DOMParser;function a(e){var r=function(e){var t,r,n=e.firstChild,o=n.namespace,a=s$P.queryFirstNode(n,"Contents",o),s=s$P.queryNodes(a,"Layer",o);if(s.length>0)for(var l=0,u=s.length;l<u;l++){var c=s$P.queryFirstNode(s[l],"Title",o),h=s$P.queryStringValue(c),d=s$P.queryFirstNode(s[l],"Identifier",o),f=s$P.queryStringValue(d);if(h===i._layer||f===i._layer){t=s[l],r=h;break}}else t=s$P.queryFirstNode(a,"Layer",o);var p,_,m,$,g=s$P.queryFirstNode(t,"WGS84BoundingBox",o),v=s$P.queryStringValue(g,"LowerCorner",o),y=s$P.queryStringValue(g,"UpperCorner",o),x=v.split(" "),b=y.split(" ");m=parseFloat(b[0]),$=parseFloat(b[1]),p=parseFloat(x[0]),_=parseFloat(x[1]);var w=s$P.queryFirstNode(a,"TileMatrixSet",o),C=s$P.queryFirstNode(w,"TileMatrix",o),T=s$P.queryNumericValue(C,"TileWidth",o),S=s$P.queryNumericValue(C,"TileHeight",o);return{left:p,right:m,top:$,bottom:_,width:T,height:S,styleName:r}}(e);e$28(i._tilingScheme)||(i._tilingScheme=new g$14);var n={};n.left=e$27.clamp(r.left,-180,180),n.bottom=e$27.clamp(r.bottom,-90,90),n.right=e$27.clamp(r.right,-180,180),n.top=e$27.clamp(r.top,-90,90),i._rectangle=h$10.fromDegrees(n.left,n.bottom,n.right,n.top),i._hasTileWith||(i._tileWidth=r.width,i._tileHeight=r.height),i._urlTiles=i._url+"?RETURNATTRIBUTES=true&REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+i._layer+"&FORMAT="+i._format+"&TILEMATRIXSET="+i._tilematrixset+"&WIDTH="+i._tileWidth+"&HEIGHT="+i._tileHeight+"&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}",i._rectangle||(i._rectangle=u$Y(t.rectangle,i._tilingScheme.rectangle)),i._ready=!0,i._requestMetadataSuccess=!0,i._isgeoserver&&(e$28(i._mapboxStyle)||(i._mapboxStyle={version:8,name:r.styleName,layers:[{id:r.styleName+"_fill",source:r.styleName,"source-layer":r.styleName,type:"fill",layout:{visibility:"visible"},paint:{"fill-color":"rgba(224,207,226,1.00)","fill-antialias":!0},filter:["all",["==","$type","Polygon"]],metadata:{"layer:name":r.styleName,"layer:caption":r.styleName}},{id:r.styleName+"_outline",source:r.styleName,"source-layer":r.styleName,type:"line",layout:{visibility:"visible"},paint:{"line-width":1,"line-color":"rgba(102,102,102,1.00)"},filter:["all",["==","$type","Polygon"]],metadata:{"layer:name":r.styleName,"layer:caption":r.styleName}},{id:r.styleName+"line",source:r.styleName,"source-layer":r.styleName,type:"line",layout:{visibility:"visible"},paint:{"line-width":.38,"line-color":"rgba(149,55,52,1.00)"},filter:["all",["==","$type","LineString"]],metadata:{"layer:name":r.styleName,"layer:caption":r.styleName}},{id:r.styleName+"point",source:r.styleName,"source-layer":r.styleName,type:"circle",layout:{visibility:"visible"},paint:{"circle-radius":2.27,"circle-color":"rgba(54,96,146,1.00)"},filter:["all",["==","$type","Point"]],metadata:{"layer:name":r.styleName,"layer:caption":r.styleName}}]}),A$10(i,i._mapboxStyle),i._requestStyleSuccess=!0,i._urlTiles=i._url+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+i._layer+"&FORMAT="+i._format+"&TILEMATRIXSET="+i._tilematrixset+"&WIDTH="+i._tileWidth+"&HEIGHT="+i._tileHeight+"&TILEMATRIX=EPSG:4326:{z}&TILEROW={y}&TILECOL={x}&&STYLE=",i._resourceReady=!0),i._requestMetadataSuccess&&i._requestStyleSuccess&&i._readyPromise.resolve(!0)}function s(e,t){var i=[],r=Math.abs(e)/512;r=function(e,t,i){var r=e*t*39.37007874015748*Xe$d(i);return 1/r}(r,96,t);for(var n=0;n<22;n++)0!=n?(r*=2,i[n]=r):i[n]=r;return i}function l(e){var r=e.prjCoordSys.coordUnit;i._coordUnit=r;var n=e.bounds,o=e.viewer.width,a=e.viewer.height;if(i._hasTileWith||(i._tileWidth=o,i._tileHeight=a),i._hasLevel||function(e,t){e._minimumLevel=0,e._maximumLevel=22;var i,r=[];if(i=3857==t.prjCoordSys.epsgCode?[1/295829355.454566,1/147914677.727283,1/73957338.8636414,1/36978669.4318207,1/18489334.7159103,1/9244667.35795517,1/4622333.67897759,1/2311166.83948879,1/1155583.4197444,1/577791.709872198,1/288895.854936099,1/144447.92746805,1/72223.9637340248,1/36111.9818670124,1/18055.9909335062,1/9027.9954667531,1/4513.99773337655,1/2256.99886668828,1/1128.49943334414,1/564.249716672069,1/282.124858336034,1/141.062429168017]:"DEGREE"==t.prjCoordSys.coordUnit?s(360,t.prjCoordSys.coordUnit):s(40075016.6855785,t.prjCoordSys.coordUnit),t.visibleScales&&t.visibleScales.length>0){for(var n,o=null,a=null,l=0;l<t.visibleScales.length;l++){for(var u=0;u<=i.length-1;u++)if(0!=u){if(!(a>(n=Math.abs(t.visibleScales[l]-i[u]))))break;a=n,o=u}else a=Math.abs(t.visibleScales[l]-i[u]),o=0;o>=0&&r.push(o)}e._minimumLevel=r[0],e._maximumLevel=r[r.length-1]}}(i,e),"DEGREE"==r)e$28(i._tilingScheme)||(i._tilingScheme=new g$14),n.left=e$27.clamp(n.left,-180,180),n.bottom=e$27.clamp(n.bottom,-90,90),n.right=e$27.clamp(n.right,-180,180),n.top=e$27.clamp(n.top,-90,90),i._rectangle=h$10.fromDegrees(n.left,n.bottom,n.right,n.top),i._urlTemplate=i._url+"/tiles/{z}/{x}/{y}.mvt";else{var l=new t$X(n.left,n.bottom,0);l.x=Math.max(-20037508.342789244,l.x),l.y=Math.max(-20037508.342789244,l.y);var u=new t$X(n.right,n.top,0);if(u.x=Math.min(20037508.342789244,u.x),u.y=Math.min(20037508.342789244,u.y),!e$28(i._tilingScheme)){var c=e$28(e.prjCoordSys)&&(3857==e.prjCoordSys.epsgCode||e$28(e.prjCoordSys.projection)&&("PRJ_SPHERE_MERCATOR"===e.prjCoordSys.projection.type||"PRJ_TRANSVERSE_MERCATOR"===e.prjCoordSys.projection.type));i._tilingScheme=new c$10({rectangleSouthwestInMeters:c?void 0:l,rectangleNortheastInMeters:c?void 0:u})}var h=i._tilingScheme._projection.unproject(l),d=i._tilingScheme._projection.unproject(u);i._rectangle=new h$10(h.longitude,h.latitude,d.longitude,d.latitude),i._urlTemplate=i._url+"/tiles/{z}/{x}/{y}.mvt"}i._rectangle||(i._rectangle=u$Y(t.rectangle,i._tilingScheme.rectangle)),i._ready=!0,i._requestMetadataSuccess=!0,i._requestMetadataSuccess&&i._requestStyleSuccess&&i._readyPromise.resolve(!0)}function u(e){var t,n="An error occurred while accessing "+i._url+".";t=l$13.handleError(t,i,i._errorEvent,n,void 0,void 0,void 0,r),i._readyPromise.reject(new RuntimeError(n))}}function Oe$n(e,t){if(e$28(t.metadata)&&e$28(t.metadata.indexbounds)){var i=-180,r=90,n=360;e$28(t.metadata.epsgcode)&&("3857"==t.metadata.epsgcode||t.metadata.indexbounds[0]<-180)&&(i=-20037508.3427892,r="METER"==e._coordUnit?20037508.3427892:30056262.5141838,n=40075016.6855784);var o=t.metadata.indexbounds,a=(o[0]-i)/n,s=(o[3]-r)/n;e._colDiff=a,e._rowDiff=s}}function A$10(e,t){e._MVTStyle._load(t),Oe$n(e,t)}function he$t(e,t,i){var r=Math.pow(2,t);return e+Math.round(r*i)}function He$f(e){e.priority=B$O,e.throttle=!0,(B$O+=.001)>100&&(B$O=0)}function fe$w(e,t,i){return{mvt:!0,colorTexture:new L$17({context:e._context,width:e._canvasWidth,height:e._canvasWidth,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,generateMipmap:!0,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:u$Y(e.minificationFilter,tt$h.LINEAR_MIPMAP_LINEAR),magnificationFilter:u$Y(e.magnificationFilter,rt$g.LINEAR)})}),rawData:t,indexData:i}}Object.defineProperties(M$X.prototype,{name:{get:function(){return this._name}},proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel>18?this._maximumLevel:18}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},isOverlapDisplayed:{get:function(){return this._isOverlapDisplayed},set:function(e){this._isOverlapDisplayed=e}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready&&this._resourceReady}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},mapboxStyle:{get:function(){return this._mapboxStyle},set:function(e){this._mapboxStyle=e,e$28(this._mapboxStyle)&&A$10(this,this._mapboxStyle)}},subdomains:{get:function(){return this._subdomains},set:function(e){if(e$28(e)&&!e$28(e.length))throw new t$Z("Excepted MvtProvider.subdomains to be type of Array.");this._subdomains=e}},globalLineWidthScale:{get:function(){return this._painter._globalLineWidthScale},set:function(e){this._painter._globalLineWidthScale=e}},lineAntialiasing:{get:function(){return this._painter._lineAntialiasing},set:function(e){this._painter._lineAntialiasing=e}},enableMorphing:{get:function(){return this._enableMorphing},set:function(e){this._enableMorphing=e}},billboardMode:{get:function(){return this._billboardMode}},selectedColor:{get:function(){return this._selectedColor},set:function(e){this._selectedColor=e}}}),M$X.prototype.getTileCredits=function(e,t,i){},M$X.prototype.resetVisible=function(){var e=this.innerLayer._imageryCache;for(var t in e)e[t]._visible=!1},M$X.prototype.update=function(e,t,i){var r=this.innerLayer._imageryCache;this._MVTStyle.update(r);var n=[];for(var o in r)n.push(r[o]);n.sort((function(e,t){return e.level<t.level?1:e.level>t.level?-1:0})),this._maxImageCacheLevel=0;for(var a=[],s=[],l=n.length,u=0;u<l;u++){var c=n[u];if(this._maxImageCacheLevel=Math.max(this._maxImageCacheLevel,c.level),c.update(),c._visible&&this.realtime&&(c.realtimeRender(),a.push(c)),t.passes.pick||c._visible){var h=c._MVTLabel;h._textCollection&&s.push(h._textCollection),h._iconCollection&&s.push(h._iconCollection)}}var d=1;t.passes.pick||(this._transform.zoom=this._viewer.scene.camera.zoomLevel,this._MVTStyle._updatePlacement(this._viewer.scene,this._transform,500),d=this._MVTStyle.placement.symbolFadeChange(performance.now()));for(u=0;u<s.length;u++)t.passes.pick||(s[u].fadeChage=d),s[u].update(t,e,i)},M$X.prototype.removeTile=function(e,t,i){},M$X.prototype.requestImage=function(e,t,i,r,n,o){He$f(r);var a=this,s=i+1;return this.tilingScheme instanceof c$10&&(s=i),this._tileFeature&&(s+=1),this._isgeoserver&&(s-=1),i>a._maximumLevel?(o.hasRawData=!1,fe$w(a,null)):(o.hasRawData=!0,Ue$o(o,r,e,t,s,a),fe$w(a))};var Ve$l=/({.*?})/g;function Ue$o(e,t,i,r,n,o){var a=o._urlTiles;if(-1===a.indexOf("http://")&&-1===a.indexOf("https://")&&(a=a.startsWith("/")?window.origin+a:window.origin+"/"+a),o.tilingScheme instanceof c$10||(i=he$t(i,n,o._colDiff),r=he$t(r,n,o._rowDiff)),e.requestX=i,e.requestY=r,e.requestZ=n,t.quadKey=Ye$g(i,r,n),o._packingRequest===ee$B.QuadKey&&(t.type=$$13.PACK,t.providerName=o._name,t.throttle=!0),o._tileFeature){var s=o._scales[n];a=a.replace("{x}",i).replace("{y}",r).replace("{scale}",s)}else a=a.replace("{x}",i).replace("{y}",r).replace("{z}",n);if(e$28(o._subdomains)){var l=o._subdomains,u=l[(i+r+n)%l.length];a=a.replace(Ve$l,(function(e,t){return"{s}"===t?u:e}))}e$28(a$Y.CREDENTIAL)&&(e$28(a$Y.CREDENTIAL._keymap[o._url])?o._isTdt?a+="&tk="+a$Y.CREDENTIAL._keymap[o._url]:a=a$Y.addTokenWithKey(o._url,a):o._isTdt?a+="&tk="+a$Y.CREDENTIAL._value:a=a$Y.addToken(a)),e.requestUrl=a}function ze$f(e,t){for(var i=!1,r=0,n=e.length-1;r<e.length;n=r++){var o=e[r],a=e[n];o.latitude>t.latitude!=a.latitude>t.latitude&&t.longitude<(a.longitude-o.longitude)*(t.latitude-o.latitude)/(a.latitude-o.latitude)+o.longitude&&(i=!i)}return i}function Be$o(e,t,i){var r=i[0],n=i[2];if(e.longitude<r.longitude&&t.longitude<r.longitude||e.longitude>n.longitude&&t.longitude>n.longitude||e.latitude<r.latitude&&t.latitude<r.latitude||e.latitude>n.latitude&&t.latitude>n.latitude)return!1;var o=G$15(e,t,i[0]);return o!==G$15(e,t,i[1])||o!==G$15(e,t,i[2])||o!==G$15(e,t,i[3])}function Ge$j(e,t){for(var i=0,r=e;i<r.length;i+=1){var n=r[i];if(t.south<=n.latitude&&t.west<=n.longitude&&t.north>=n.latitude&&t.east>=n.longitude)return!0}var o=[new t$W(t.west,t.north),new t$W(t.east,t.north),new t$W(t.east,t.south),new t$W(t.west,t.south)];if(e.length>2)for(var a=0,s=o;a<s.length;a+=1){if(ze$f(e,s[a]))return!0}for(var l=0;l<e.length-1;l++){if(Be$o(e[l],e[l+1],o))return!0}}function G$15(e,t,i){return(i.latitude-e.latitude)*(t.longitude-e.longitude)>(t.latitude-e.latitude)*(i.longitude-e.longitude)}function je$j(e,t,i){var r=[];for(var n in t){var o=t[n];o.level==i._maxImageCacheLevel&&Ge$j(e,o.rectangle)&&e$28(o.featureIndex)&&r.push(o)}return r}function Ke$f(e,t){Array.isArray(e)||(e=[e]);var i=null;for(var r in t){for(var n=t[r],o=!0,a=0;a<e.length;a++)if(!h$10.contains(n.rectangle,e[a])){o=!1;break}if(o)if(null==i)i=n;else{var s=i.rectangle.width;n.rectangle.width<s&&(i=n)}}for(;e$28(i)&&!e$28(i.featureIndex);)i=i.parent;return i}function ce$u(e,t,i){var r=i.rectangle;return new _0x36c32e((e-r.west)/r.width*_0xea783f,(t-r.south)/r.height*_0xea783f)}function Xe$d(e){var t;return"METER"==e?t=1:"DEGREE"==e?t=2*Math.PI*6378137/360:"KILOMETER"==e?t=.001:"INCH"==e?t=1/.025399999918:"FOOT"==e&&(t=.3048),t}function Ye$g(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function j$10(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function Qe$f(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function D$W(e,t,i){var r=j$10(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function de$x(e,t,i){var r=j$10(e,t,i);if(e$28(r))return r.textContent.trim()}M$X.prototype.pick=function(e){var t=Ke$f(e,this.innerLayer._imageryCache);if(null!=t&&e$28(t.featureIndex)){var i=[];i.push(ce$u(e.longitude,e.latitude,t));var r={};for(var n in this._MVTStyle._layers){var o=this._MVTStyle._layers[n];e$28(o)&&(e$28(o.visibility)?"none"!=o.visibility&&(r[n]=o):r[n]=o)}var a=null;if(e$28(t.frameState)){var s=t.frameState.camera;e$28(s)&&e$28(s.zoomLevel)&&s.zoomLevel!=1/0&&(a=s.zoomLevel)}var l={realtime:this.realtime,zoom:a,selectTolerance:this.selectTolerance},u=t.queryRenderedFeatures(r,i,l);if(this._MVTStyle.setHighLight(u,this),e$28(u))return Object.keys(u).length>0?u:void 0}},M$X.prototype.queryRenderedFeatures=function(e,t){var i=[],r=je$j(e,this.innerLayer._imageryCache,this);if(!e$28(r))return i;for(var n,o,a,s=0;s<r.length;s++){var l=r[s],u=[];for(n=0,a=e.length;n<a;n++)u.push(ce$u(e[n].longitude,e[n].latitude,l));i.push(l.queryRenderedFeatures(this._MVTStyle._layers,u,t))}var c=[],h=[];for(n=0,a=i.length;n<a;n++){var d=i[n];for(var f in d){var p=d[f];for(o=0;o<p.length;o++)-1==h.indexOf(p[o].feature.id)&&(c.push(p[o]),h.push(p[o].feature.id))}}return c},M$X.prototype.onAlphaChanged=function(){this._painter.alpha=this.innerLayer.alpha;let e=this.innerLayer._imageryCache;for(let t in e)e[t].onAlphaChanged()},M$X.prototype.querySourceFeatures=function(e){var t=[];if("string"==typeof e.filter[2]&&e.filter[2].indexOf("%")>-1){var i=this._viewer.scene.camera.computeViewRectangle();if(!e$28(i))return t;for(var r=h$10.southwest(i),n=h$10.southeast(i),o=h$10.northeast(i),a=h$10.northwest(i),s=this.queryRenderedFeatures([r,n,o,a],{layers:[e.sourceLayer]}),l=_0x461a14.createFilter(e&&e.filter),u=0;u<s.length;u++){var c=s[u].feature;l(new _0x105812(0),c)&&t.push(c)}}else{var h=this.innerLayer._imageryCache;for(var d in h){h[d].querySourceFeatures(e,t)}}return t};var e$1C={START:0,LOADING:1,DONE:2,FAILED:3},re$B=Object.freeze(e$1C);function i$R(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function d$16(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 r$$(){this.head=void 0,this.tail=void 0,this.count=0}function t$K(e,t){var i=t.previous,r=t.next;t===e.head?e.head=r:i.next=r,t===e.tail?e.tail=i:r.previous=i,t.previous=void 0,t.next=void 0,--e.count}function e$1B(e,t,i,r){this.quadKey=t,this.data=i,this.provider=e,this.promise=r}i$R.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},i$R.prototype.trimTiles=function(e,t){for(var i=this.tail,r=!0;r&&e$28(this._lastBeforeStartOfFrame)&&this.count>e&&e$28(i);){r=i!==this._lastBeforeStartOfFrame;var n=i.replacementPrevious;i.eligibleForUnloading&&(i.freeResources(),d$16(this,i)),i=n}for(this._lastBeforeStartOfFrame&&(i=this._lastBeforeStartOfFrame.replacementNext);t&&i;)i=i.replacementNext;for(;i;){if(i&&i.data)for(var o=i.data.imagery,a=0,s=o.length;a<s;++a){var l=o[a];l.readyImagery&&l.readyImagery.imageryLayer._imageryProvider instanceof M$X&&e$28(l.readyImagery)&&(l.imageryLayer=l.readyImagery.imageryLayer,l.readyImagery.releaseReference(),l.readyImagery=void 0,i.state=re$B.LOADING)}i=i.replacementNext}},i$R.prototype.markTileRendered=function(e){var t=this.head;if(t!==e)return++this.count,e$28(t)?((e$28(e.replacementPrevious)||e$28(e.replacementNext))&&d$16(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,void(this.head=e)):(e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e));e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)},r$$.prototype.trim=function(e){for(var t=this.tail;this.count>e&&e$28(t);){var i=t.previous;t.free(),t$K(this,t),t=i}},r$$.prototype.touch=function(e){var t=this.head;if(t!==e){if(++this.count,!e$28(t))return e.previous=void 0,e.next=void 0,this.head=e,void(this.tail=e);(e$28(e.previous)||e$28(e.next))&&t$K(this,e),e.previous=void 0,e.next=t,t.previous=e,this.head=e}},e$1B.prototype.free=function(){delete this.provider.blockCache[this.quadKey]};var ISERVER_BASIC=!1;function LicenseChecker(){this.urlMap=Object.create(null),this.pendingRequest=Object.create(null)}LicenseChecker.functionMap=Object.freeze({ViewShed3D:"å�¯è§†åŸŸåˆ†æž?",SpatialQuery3D:"空间查询",ShadowQueryPoints:"阴影分æž�",Sightline:"通视分æž�",Skyline:"天际线分æž?",ViewDome:"å¼?敞度分æž�",DirectionalLight:"平行光æº�",ParticleSystem:"ç²’å�系统",Profile:"剖é�¢åˆ†æž�",SpotLight:"è�šå…‰æº?",PointLight:"点光æº?",Scene_bloomEffect:"泛光",Scene_hdrEnabled:"HDRå¼?å…?",Scene_scanEffect:"扫æ��çº?",Scene_addLightSource:"æ·»åŠ å…‰æº�",S3MTilesLayer_hypsometricSetting:"分层设色",DynamicLayer3D:"动æ?�图å±?",Globe_SlopeSetting:"地形å�¡åº¦å�¡å�‘",Globe_setPBRMaterial:"地形PBRæ��è´¨",CloudBox:"云层",SkyBox:"天空ç›?",S3MTilesLayer_setPBRMaterial:"PBRæ��è´¨"}),LicenseChecker.prototype.getLicense=function(e){var t,i=o$1q.defer();if(!e$28(e)||0===e.length)return i.resolve(null),i.promise;var r=e.indexOf("/iserver");t=-1!==r?r+8:e.indexOf("/services/");var n=e.substring(0,t);if(e$28(this.urlMap[n]))return i.resolve(this.urlMap[n]),i.promise;if(e$28(this.pendingRequest[n]))return i.reject(null),i.promise;var o=n+"/manager/license.json",a=this;return a.pendingRequest[n]=!0,u$O(o).then((function(t){a.urlMap[e]=t,delete a.pendingRequest[n],i.resolve(t)})).otherwise((function(){i.reject(null)})),i.promise},LicenseChecker.prototype.check=function(e){e$28(e)&&(!0!==e.iServerBasic&&!0!==e.iServerBasicSpace||(e$28(e.productType)?"iServerBasic"===e.productType&&(ISERVER_BASIC=!0):ISERVER_BASIC=!0))},LicenseChecker.prototype.isBasciServer=function(){return ISERVER_BASIC},LicenseChecker.prototype.verify=function(e){if(ISERVER_BASIC)throw e="iServerBasic版本,"+LicenseChecker.functionMap[e]+"ä¸�å�¯ç”?",console.warn(e),new t$Z(e)},LicenseChecker.LICENSECHECKER=new LicenseChecker;var Fe$j=-1;function $e$c(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.availabilityPromiseCache={},this.subLevel=e.subLevel}function se$x(e){if(!e$28(e)||!e$28(e.url))throw new t$Z("options.url is required.");var t=-1;if(this._isSct=u$Y(e.isSct,!0),"string"==typeof e.url){this._baseUrl=e.url;var i=e.url;t=i.indexOf("wmts100");var r=i.substring(0,i.indexOf("/datas"));this.tablename=i.substring(i.indexOf("datas/")+6,i.length);var n=this;new l$11({name:r+this.tablename}).then((function(e){e.checkObjectStoreExit(n.tablename)?n._indexedDBScheduler=e:e.createObjectStore(n.tablename).then((function(){n._indexedDBScheduler=e}))})),this._indexedDBSetting={isOpen:!1,clear:function(){e$28(n._indexedDBScheduler)&&n._indexedDBScheduler.clear(n.tablename)},cache:[]}}else this._isSct=!1;this._tilingScheme=new g$14({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._packingRequest=e.packingRequest,this._isBlock=!1,this._extrudeTileBoundingBox=!1,this._blockCache={},this._blockCacheQueue=new r$$,this._blockCacheSize=100,this._blockScale=0,this._subdomains=e.subdomains,this._requestVertexNormals=u$Y(e.requestVertexNormals,!1),this._requestWaterMask=u$Y(e.requestWaterMask,!1),this._requestMetadata=u$Y(e.requestMetadata,!0),this._cacheKey=u$Y(e.cacheKey,""),this._originOffset=u$Y(e.originOffset,new o$1k(0,0)),this._errorEvent=new o$1o;var o=e.credit;"string"==typeof o&&(o=new r$1a(o)),this._credit=o,this._availability=void 0;var a=o$1q.defer();this._ready=!1,this._readyPromise=a,this._tileCredits=void 0,this._bounds=null,this._isCreateSkirt=u$Y(e.isCreateSkirt,!0),this._urlType=u$Y(e.urlType,fi$5.REST),this._isShowGlobe=!0,this._isTerrainZ=!1,this._hasNormalBuffer=!1,this._currentVersion=null,this._needRefresh=!1,this._isSct&&(this._isShowGlobe=u$Y(e.isShowGlobe,!0)),this._isSkirtDirty=!1,this._customRequestHeaders=e.customRequestHeaders,this._invisibility=u$Y(e.invisibility,!1),this._visible=!0,this._offset={_x:0,_y:0,_level:0},this._enablePrjArea=u$Y(e.enablePrjArea,!1);var s,l,u;n=this;e$28(this._subdomains)&&(i=i.replace(/({.*?})/g,(function(e,t){if(!e$28(n._subdomains.length))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");return"{s}"===t?n._subdomains[0]:e})));var c=this._layers=[],h="",d=[],f=0;if(this._isSct&&-1===t){var p;if(n._hasWaterMask=!0,n._urlType===fi$5.KEY_VALUE){var _=e.url,m=_.replace(_.substring(_.indexOf("datas")+5,_.indexOf("scene3DName")),"?");n._tileUrlTemplates=[m+"&tile1={z}&tile2={x}&tile3={y}&ext=terrainz&v=1.16389.0"],p=_}else{n._tileUrlTemplates=[e.url+"/data/path/{z}/{x}/{y}.terrain?v=1.16389.0"];var $=e.url.split("/");$[$.length-1],p=n$Z(i,"config")}e$28(a$Y.CREDENTIAL)&&(p=e$28(a$Y.CREDENTIAL._keymap[n._baseUrl])?a$Y.addTokenWithKey(n._baseUrl,p):a$Y.addToken(p)),LicenseChecker.LICENSECHECKER.getLicense(p).then((function(e){LicenseChecker.LICENSECHECKER.check(e)})),o$1q(u$P(p,this._customRequestHeaders),(function(t){t=t.replace("<SuperMapCache>",'<SuperMapCache xmlns:sml="http://www.supermap.com/SuperMapCache">');var i=(new s$P).read(t).documentElement;if(2===s$P.queryNumericValue(i,"Version",void 0)){var r=s$P.queryFirstNode(i,"StoreType",void 0);n._blockScale=s$P.queryNumericAttribute(r,"BlockScale",void 0),e$28(n._blockScale)&&n._blockScale>0&&(n._isBlock=!0)}var o,a=s$P.queryStringValue(i,"FileExtentName",void 0);if(a=a.toLowerCase(),n._isTerrainZ="terrainz"===a,n._urlType===fi$5.KEY_VALUE){var s=e.url;o=s.replace(s.substring(s.indexOf("datas")+5,s.indexOf("scene3DName")),"?"),o+="&tile1={z}&tile2={x}&tile3={y}&ext={fileExtent}&v=1.16389.0"}else o=e.url+"/data/path/{z}/{x}/{y}.{fileExtent}?v=1.16389.0";o=o.replace("{fileExtent}",a),n._tileUrlTemplates=[o];var l=s$P.queryFirstNode(i,"HeightRange",void 0),u=s$P.queryNumericValue(l,"MaxHeight",void 0),h=s$P.queryNumericValue(l,"MinHeight",void 0);n._maxHeight=u,n._minHeight=h;var f=s$P.queryFirstNode(i,"Bounds",void 0),p=s$P.queryNumericValue(f,"Left",void 0),_=s$P.queryNumericValue(f,"Right",void 0),m=s$P.queryNumericValue(f,"Bottom",void 0),$=s$P.queryNumericValue(f,"Top",void 0),g=s$P.queryFirstNode(i,"PlaneBounds",void 0);if(e$28(g)){p>180&&(n._offset._x=Math.floor(p/180)),$>90&&(n._offset._y=Math.floor(($+90)/180));var v=n._offset._x*Math.PI*e$27.Radius,y=n._offset._y*Math.PI*e$27.Radius;p=s$P.queryNumericValue(g,"Left",void 0),p-=v,_=s$P.queryNumericValue(g,"Right",void 0),_-=v,m=s$P.queryNumericValue(g,"Bottom",void 0),m-=y,$=s$P.queryNumericValue(g,"Top",void 0),$-=y;var x=new t$X(p,m,0),b=new t$X(_,$,0),w=new n$1b,C=w.unproject(x),T=w.unproject(b);p=e$27.toDegrees(C.longitude),_=e$27.toDegrees(T.longitude),m=e$27.toDegrees(C.latitude),$=e$27.toDegrees(T.latitude),Math.abs(v)>e$27.EPSILON1&&(t$X.globalOffset.x=v),Math.abs(y)>e$27.EPSILON1&&(t$X.globalOffset.y=y)}p&&_&&m&&$&&(n._bounds=new h$10(p,m,_,$),n._boundsRadians=h$10.fromDegrees(p,m,_,$));for(var S=s$P.queryFirstNode(i,"Levels",void 0),E=s$P.queryChildNodes(S,"Level",void 0),A=[],P=0,I=E.length;P<I;P++){var M=parseInt(E[P].textContent);A.push(M)}var O=s$P.queryFirstNode(i,"History",void 0);if(null!=O){var D=s$P.queryChildNodes(O,"Version",void 0),R=[];for(P=0,I=D.length;P<I;P++){M=D[P].textContent;R.push(M)}n._historyVersions=R}var L=A[0],B=A[A.length-1],N=s$P.queryFirstNode(i,"Available",void 0);if(e$28(N)){var F=s$P.queryChildNodes(N,"TilesBounds",void 0),z=L>0?A.length+1:A.length,k=new Array(z);for(P=0;P<L;P++)k[P]=[];for(P=0,I=F.length;P<I;P++){var V=F[P],U=[];k[te=s$P.queryNumericAttribute(V,"level",void 0)]=U;for(var X=s$P.queryChildNodes(V,"TileBounds",void 0),H=0,G=X.length;H<G;H++){var W=X[H],Y=s$P.queryNumericValue(W,"StartCol",void 0),q=s$P.queryNumericValue(W,"StartRow",void 0),j=s$P.queryNumericValue(W,"EndCol",void 0),Z=s$P.queryNumericValue(W,"EndRow",void 0);if(te>=n._offset._level){var K=1<<te-n._offset._level,Q=n._offset._x*K;Y-=Q,j-=Q;var J=n._offset._y*K;q-=J,Z-=J}U.push({startX:Y,startY:q,endX:j,endY:Z})}}k[0]=[{startX:0,startY:0,endX:1,endY:1}];for(var ee=new n$11(n._tilingScheme,B),te=0;te<k.length;++te){var ie=k[te],re=n._tilingScheme.getNumberOfYTilesAtLevel(te);if(e$28(d[te])||(d[te]=[]),e$28(ie))for(var ne=0;ne<ie.length;++ne){var oe=ie[ne],ae=re-oe.endY-1,se=re-oe.startY-1;d[te].push([oe.startX,ae,oe.endX,se]),ee.addAvailableTileRange(te,oe.startX,ae,oe.endX,se)}}n._availability=ee}c.push(new $e$c({resource:t$S.createIfNeeded(e.url),version:"",isHeightmap:!1,tileUrlTemplates:n._tileUrlTemplates,availability:ee,hasVertexNormals:!1,hasWaterMask:!0,hasMetadata:!1,availabilityLevels:0,availabilityTilesLoaded:!1,littleEndianExtensionSize:!0})),n._levels=A,n._ready=!0,n._readyPromise.resolve(!0)}),(function(){n._readyPromise.reject(!1)}))}else if(t>-1){var g=i+"/1.0.0/WMTSCapabilities.xml";n._wmtslayer=e.layer||null,n._wmtsformat=e.format||"binary",n._wmtstileMatrixSet=e.tilematrixset||null,e.blockscale>0&&(n._blockScale=1*e.blockscale,n._isBlock=!0),o$1q(u$P(g),(function(t){var i=(new s$P).read(t).documentElement,r=s$P.queryFirstNode(i,"Contents",void 0),o=s$P.queryFirstNode(r,"Layer",void 0);n._tempLayerName=s$P.queryStringValue(o,"Title",void 0);var a=s$P.queryFirstNode(r,"TileMatrixSet",void 0);n._wmtstileMatrixSet=s$P.queryStringValue(a,"Identifier",void 0),n._tileUrlTemplates=[e.url+"?tilematrix={z}&layer="+(n._wmtslayer||n._tempLayerName)+"&tilerow={y}&tilecol={x}&tilematrixset="+n._wmtstileMatrixSet+"&service=WMTS&request=GetTile"];var s=s$P.queryFirstNode(o,"BoundingBox",void 0),l=s$P.queryStringValue(s,"LowerCorner",void 0),u=s$P.queryStringValue(s,"UpperCorner",void 0),h=l.split(" "),d=u.split(" "),f=parseFloat(h[0]),p=parseFloat(d[0]),_=parseFloat(h[1]),m=parseFloat(d[1]);f&&p&&_&&m&&(n._bounds=new h$10(f,_,p,m),n._boundsRadians=h$10.fromDegrees(f,_,p,m));var $=s$P.queryFirstNode(r,"TileMatrixSet",void 0),g=(a=s$P.queryChildNodes($,"TileMatrix",void 0),s$P.queryNumericValue(a[0],"ScaleDenominator",void 0)),v=s$P.queryNumericValue(a[a.length-1],"ScaleDenominator",void 0),y=s$P.queryNumericValue(a[0],"Identifier",void 0);g=1/g,v=1/v;var x=[1.690163571602655e-9,3.3803271432053056e-9,6.760654286410611e-9,1.3521308572821242e-8,2.7042617145642484e-8,5.408523429128511e-8,1.0817046858256998e-7,2.1634093716513974e-7,4.3268187433028044e-7,8.653637486605571e-7,17307274973211203e-22,34614549946422405e-22,69229099892844565e-22,13845819978568952e-21,27691639957137904e-21,553832799142758e-19,.0001107665598285516,.0002215331196571032,.0004430662393142064,.0008861324786284128,.001772264957256826,.003544529914513652],b=x.indexOf(g),w=x.indexOf(v);for(let e=0;e<x.length;e++)g>x[e]&&x[e+1]&&g<x[e+1]&&(b=e-1),v>x[e]&&x[e+1]&&v<x[e+1]&&(w=e-1);for(var C=u$Y((b=Math.max(b,0))-y,0),T=[],S=b;S<=w;S++)T.push(S);n._isTerrainZ="terrainz",c.push(new $e$c({resource:t$S.createIfNeeded(e.url),version:"",isHeightmap:!1,tileUrlTemplates:n._tileUrlTemplates,hasVertexNormals:!1,hasWaterMask:!0,hasMetadata:!1,availabilityLevels:0,availabilityTilesLoaded:!1,littleEndianExtensionSize:!0,subLevel:C})),n._levels=T,n._ready=!0,n._readyPromise.resolve(!0)}),(function(){n._readyPromise.reject(!1)}))}else o$1q(e.url).then((function(e){var t=t$S.createIfNeeded(e);t.appendForwardSlash(),l=(s=t).getDerivedResource({url:"layer.json"}),n._tileCredits=t.credits,w()})).otherwise((function(e){a.reject(e)}));function v(e){var t;if(!e.format)return t="The tile format is not specified in the layer.json file.",void(u=l$13.handleError(u,n,n._errorEvent,t,void 0,void 0,void 0,w));if(!e.tiles||0===e.tiles.length)return t="The layer.json file does not specify any tile URL templates.",void(u=l$13.handleError(u,n,n._errorEvent,t,void 0,void 0,void 0,w));var i=!1,r=!1,o=!1,a=!0,p=!1;if("heightmap-1.0"===e.format)p=!0,e$28(n._heightmapStructure)||(n._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),r=!0,n._requestWaterMask=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return t='The tile format "'+e.format+'" is invalid or not supported.',void(u=l$13.handleError(u,n,n._errorEvent,t,void 0,void 0,void 0,w));var _,m=e.tiles,$=e.maxzoom;f=Math.max(f,$),e$28(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?i=!0:e$28(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(i=!0,a=!1),e$28(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(r=!0),e$28(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(o=!0);var g,x=e.metadataAvailability,b=e.available;if(e$28(b)&&!e$28(x)){g=new n$11(n._tilingScheme,b.length);for(var C=0;C<b.length;++C){var T=b[C],S=n._tilingScheme.getNumberOfYTilesAtLevel(C);e$28(d[C])||(d[C]=[]);for(var E=0;E<T.length;++E){var A=S-(I=T[E]).endY-1,P=S-I.startY-1;d[C].push([I.startX,A,I.endX,P]),g.addAvailableTileRange(C,I.startX,A,I.endX,P)}}}else if(e$28(x))if(_=new n$11(n._tilingScheme,$),g=new n$11(n._tilingScheme,$),e$28(b))for(C=0;C<b.length;++C){T=b[C],S=n._tilingScheme.getNumberOfYTilesAtLevel(C);e$28(d[C])||(d[C]=[]);for(E=0;E<T.length;++E){var I;A=S-(I=T[E]).endY-1,P=S-I.startY-1;d[C].push([I.startX,A,I.endX,P]),g.addAvailableTileRange(C,I.startX,A,I.endX,P)}}else d[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0);n._hasWaterMask=n._hasWaterMask||r,n._hasVertexNormals=n._hasVertexNormals||i,n._hasMetadata=n._hasMetadata||o,e$28(e.attribution)&&(h.length>0&&(h+=" "),h+=e.attribution),c.push(new $e$c({resource:s,version:e.version,isHeightmap:p,tileUrlTemplates:m,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:x,availabilityTilesLoaded:_,littleEndianExtensionSize:a}));var M=e.parentUrl;return e$28(M)?e$28(g)?((s=s.getDerivedResource({url:M})).appendForwardSlash(),o$1q((l=s.getDerivedResource({url:"layer.json"})).fetchJson(),v,y)):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),o$1q.resolve()):o$1q.resolve()}function y(e){var t="An error occurred while accessing "+l.url+".";u=l$13.handleError(u,n,n._errorEvent,t,void 0,void 0,void 0,w)}function x(e){v(e).then((function(){if(!e$28(u)){var e=d.length;if(e>0)for(var t=n._availability=new n$11(n._tilingScheme,f),i=0;i<e;++i)for(var r=d[i],o=0;o<r.length;++o){var a=r[o];t.addAvailableTileRange(i,a[0],a[1],a[2],a[3])}if(h.length>0){var s=new r$1a(h);e$28(n._tileCredits)?n._tileCredits.push(s):n._tileCredits=[s]}n._ready=!0,n._readyPromise.resolve(!0)}}))}function b(e){e$28(e)&&404===e.statusCode?x({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}):y()}function w(){o$1q(l.fetchJson()).then(x).otherwise(b)}}var ze$e={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4,INVALID_FLAG:127};function mt$8(e){return e$28(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function et$d(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new T$S({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function We$l(e,t,i,r,n,o,a,s){var l=a.littleEndianExtensionSize,u=0,c=3*Float64Array.BYTES_PER_ELEMENT,h=4*Float64Array.BYTES_PER_ELEMENT,d=3*Uint16Array.BYTES_PER_ELEMENT,f=Uint16Array.BYTES_PER_ELEMENT,p=3*f,_=new DataView(t),m=new t$X(_.getFloat64(u,!0),_.getFloat64(u+8,!0),_.getFloat64(u+16,!0));u+=c;var $=_.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var g=_.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var v=g,y=$,x=new i$19(new t$X(_.getFloat64(u,!0),_.getFloat64(u+8,!0),_.getFloat64(u+16,!0)),_.getFloat64(u+c,!0));u+=h;var b=new t$X(_.getFloat64(u,!0),_.getFloat64(u+8,!0),_.getFloat64(u+16,!0));u+=c;var w=_.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var C=new Uint16Array(t,u,3*w);u+=w*d,w>65536&&(p=3*(f=Uint32Array.BYTES_PER_ELEMENT));var T=C.subarray(0,w),S=C.subarray(w,2*w),E=C.subarray(2*w,3*w);t$N.zigZagDeltaDecode(T,S,E),u%f!=0&&(u+=f-u%f);var A=_.getUint32(u,!0),P=u+=Uint32Array.BYTES_PER_ELEMENT,I=ce$v.createTypedArrayFromArrayBuffer(w,t,u,3*A);u+=A*p;for(var M=0,O=I.length,D=0;D<O;++D){var R=I[D];I[D]=M-R,0===R&&++M}var L=_.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var B=ce$v.createTypedArrayFromArrayBuffer(w,t,u,L);u+=L*f;var N=_.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var F=ce$v.createTypedArrayFromArrayBuffer(w,t,u,N);u+=N*f;var z=_.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var k=ce$v.createTypedArrayFromArrayBuffer(w,t,u,z);u+=z*f;var V=_.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var U=ce$v.createTypedArrayFromArrayBuffer(w,t,u,V);u+=V*f;var X,H,G,W,Y=!1,q=!1,j=void 0,Z=void 0;!1===e._isShowGlobe&&(0===g||u>=_.byteLength)&&(Y=!0);for(var K=0;u<_.byteLength;){var Q=_.getUint8(u,!0);if(0!==Q){u+=Uint8Array.BYTES_PER_ELEMENT;var J=_.getUint32(u,l);if(u+=Uint32Array.BYTES_PER_ELEMENT,Q===ze$e.OCT_VERTEX_NORMALS&&e._requestVertexNormals)X=new Uint8Array(t,u,2*w);else if(Q===ze$e.WATER_MASK&&e._requestWaterMask)H=new Uint8Array(t,u,J);else if(Q===ze$e.METADATA&&e._requestMetadata&&!e._isSct){var ee=_.getUint32(u,!0);if(ee>0){var te=a$Z(new Uint8Array(t),u+Uint32Array.BYTES_PER_ELEMENT,ee),ie=JSON.parse(te).available;if(e$28(ie))for(var re=0;re<ie.length;++re)for(var ne=i+re+1,oe=ie[re],ae=e._tilingScheme.getNumberOfYTilesAtLevel(ne),se=0;se<oe.length;++se){var le=oe[se],ue=ae-le.endY-1,ce=ae-le.startY-1;e.availability.addAvailableTileRange(ne,le.startX,ue,le.endX,ce),a.availability.addAvailableTileRange(ne,le.startX,ue,le.endX,ce)}}a.availabilityTilesLoaded.addAvailableTileRange(i,r,n,r,n)}else if(Q===ze$e.INVALID_FLAG){if((K=_.getUint32(u,!0))>0){var he=0,de=32767;for(D=0;D<K;D++)he=Math.max(he,E[I[D]]),de=Math.min(de,E[I[D]]);he<32767&&(v=$+(g-$)*he/32767),de>0&&(y=$+(g-$)*de/32767)}(!1===e._isShowGlobe||e$28(s))&&(!1===e._isShowGlobe&&(0===K?Y=!0:I=ce$v.createTypedArrayFromArrayBuffer(w,t,P,K)),(3*A!=K||0==K)&&(q=!0),e$28(s)&&K>0&&(0===(j=ce$v.createTypedArrayFromArrayBuffer(w,t,P,K)).length&&(j=void 0)))}else if(125===Q){var fe=J/4;G=new Uint8Array(3*fe);var pe=u,_e=new t$X;for(D=0;D<fe;D++){var me=_.getInt16(pe,!0);pe+=Int16Array.BYTES_PER_ELEMENT;var $e=_.getInt16(pe,!0);pe+=Int16Array.BYTES_PER_ELEMENT,t$N.octShortDecode(me,$e,_e),G[3*D]=255*(.5*_e.x+.5),G[3*D+1]=255*(.5*_e.y+.5),G[3*D+2]=255*(.5*_e.z+.5)}}u+=J}else u+=1}if(e$28(j)){Z=new Uint16Array(3*w);for(D=0;D<w;D++)Z[3*D]=C[D],Z[3*D+1]=C[w+D],Z[3*D+2]=C[2*w+D]}!1===e._isShowGlobe&&(W=0);var ge,ve,ye=e._tilingScheme.tileXYToRectangle(r,n,i);return ye.width<e$27.PI_OVER_TWO+e$27.EPSILON5&&(ge=x$13.fromRectangle(ye,$,g,e._tilingScheme.ellipsoid),ve=x$13.fromRectangle(ye,y,v,e._tilingScheme.ellipsoid)),W=e._isCreateSkirt?5*e.getLevelMaximumGeometricError(i):0,e._hasNormalBuffer=e$28(G),new p$_({center:m,minimumHeight:$,maximumHeight:g,boundingSphere:x,orientedBoundingBox:ge,validMinimumHeight:y,validMaximumHeight:v,validOrientedBoundingBox:ve,horizonOcclusionPoint:b,quantizedVertices:C,encodedNormals:X,indices:I,westIndices:B,southIndices:F,eastIndices:k,northIndices:U,westSkirtHeight:W,southSkirtHeight:W,eastSkirtHeight:W,northSkirtHeight:W,childTileMask:e._isSct||!e$28(e.availability)?15:e.availability.computeChildMaskForTile(i,r,n),waterMask:H,credits:e._tileCredits,normalTexture:G,invalid:Y,rasterIndex:j,rasterVertex:Z,hasInvalid:q})}function pe$C(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function vt$a(e,t,i,r){var n=Math.min(e._blockScale,r),o=Math.pow(2,n),a=t%o;return{x:Math.floor(t/o),y:Math.floor(i/o),col:a,row:i%o,level:r,blockSize:o}}se$x.prototype.requestTileGeometry=function(e,t,i,r,n){if(!this._ready)throw new t$Z("requestTileGeometry must not be called before the terrain provider is ready.");if(0===i&&this._isSct){for(var o=new Uint16Array(12288),a=0;a<64;a++)for(var s=0;s<64;s++)o[64*a+s]=Math.floor(32767*a/63),o[4096+64*a+s]=Math.floor(32767*s/63),o[8192+64*a+s]=0;var l=new Uint16Array(23814);for(a=0;a<63;a++)for(s=0;s<63;s++)l[6*(63*a+s)]=64*a+s,l[6*(63*a+s)+1]=64*(a+1)+s+1,l[6*(63*a+s)+2]=64*a+s+1,l[6*(63*a+s)+3]=64*(a+1)+s,l[6*(63*a+s)+4]=64*(a+1)+s+1,l[6*(63*a+s)+5]=64*a+s;var u=new Uint16Array(0),c=new t$X(NaN,-1/0,NaN),h=new t$X(0,-3189068.5,0);1===e&&(h.y=3189068.5,c.y=1/0);var d=this;return o$1q.resolve(new p$_({center:h,minimumHeight:0,maximumHeight:0,boundingSphere:new i$19(h,9567205.5),horizonOcclusionPoint:c,quantizedVertices:o,indices:l,westIndices:u,southIndices:u,eastIndices:u,northIndices:u,westSkirtHeight:0,southSkirtHeight:0,eastSkirtHeight:0,northSkirtHeight:0,childTileMask:d._isSct||!e$28(d.availability)?15:d.availability.computeChildMaskForTile(i,e,t),invalid:!1,hasInvalid:!1}))}var f,p=this._layers,_=p.length;if(1===_)f=p[0];else for(a=0;a<_;++a){var m=p[a];if(!e$28(m.availability)||m.availability.isTileAvailable(i,e,t)){f=m;break}}return _t$a(this,e,t,i,f,r,n)};var qt$7=/({.*?})/g;function _t$a(e,t,i,r,n,o,a){if(!e$28(n))return o$1q.reject(new t$U("Terrain tile doesn't exist"));var s=n.tileUrlTemplates;if(0!==s.length){var l=e._tilingScheme.getNumberOfYTilesAtLevel(r)-i-1,u=[];e._requestVertexNormals&&n.hasVertexNormals&&u.push(n.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&n.hasWaterMask&&u.push("watermask"),e._requestMetadata&&n.hasMetadata&&u.push("metadata");var c,h,d=s[(t+l+r)%s.length];e$28(e._currentVersion)&&(d+="&dataVersion="+e._currentVersion),e._isSct&&0===r&&(d=n$17("Assets/Terrain/"+r+"/"+t+"/"+i+".terrain"));var f,p=n.resource;if(e$28(p._ionEndpoint)&&!e$28(p._ionEndpoint.externalType)?(0!==u.length&&(h={extensions:u.join("-")}),c=mt$8(void 0)):(c=mt$8(u),e$28(e._customRequestHeaders)&&(c=p$17(c,e._customRequestHeaders))),0!==r&&(e$28(e._packingRequest)||e._isBlock))if(e._isBlock&&e$28(e._packingRequest)&&e._packingRequest===ee$B.QuadKey&&!a){if(o.type=$$13.BLOCKPACK,o.throttle=!0,o.providerName=e.tablename,f=vt$a(e,t,l,r),o.quadKey=pe$C(f.x,f.y,f.level),o.blockInfo=f,e$28(g=e.blockCache[o.quadKey])&&e$28(g.data))return e.blockCacheQueue.touch(g),e$28(_=Pe$m(g.data,f))?{buffer:_,layerToUse:n,level:r,x:t,y:i,tmsY:l}:"cacheInvalid"}else if(e._packingRequest!==ee$B.QuadKey||a){if(e._isBlock){var _;if(o.type=$$13.BLOCK,o.providerName=e.tablename,f=vt$a(e,t,l,r),o.quadKey=pe$C(f.x,f.y,f.level),o.blockInfo=f,e$28(g=e.blockCache[o.quadKey])&&e$28(g.data)&&!a)return e.blockCacheQueue.touch(g),e$28(_=Pe$m(g.data,f))?{buffer:_,layerToUse:n,level:r,x:t,y:i,tmsY:l}:"cacheInvalid";if(!0===e._indexedDBSetting.isOpen&&e$28(e._indexedDBScheduler)&&!0===o.cacheEnable)return e$28(y=e._indexedDBScheduler.getElementFromDB(e.tablename,o.quadKey))?y.then((function(a){if(e$28(a)){if(a===Fe$j)return"cacheInvalid";var s=new e$1B(e,o.quadKey,a);e.blockCache[o.quadKey]=s;var u=Pe$m(a,f);return e$28(u)?e._isTerrainZ&&0!==r?{buffer:u,layerToUse:n,level:r,x:t,y:i,tmsY:l}:e$28(e._heightmapStructure)?et$d(e,u):We$l(e,u,r,t,i,l,n):"cacheError"}return"cacheError"}),(function(e){return"cacheError"})):"cacheError"}}else o.type=$$13.PACK,o.providerName=e.tablename,o.quadKey=pe$C(t,l,r),o.throttle=!0;if(!e$28(e._indexedDBSetting)||!0!==e._indexedDBSetting.isOpen||!0!==o.cacheEnable){let s=function(s){var u;if(e$28(u=0!==e._cacheKey.length?Pt$7(s,e._cacheKey):s)){if(0!==r&&(e$28(e._packingRequest)||e._isBlock)){if(e._isBlock&&e$28(e._packingRequest)&&e._packingRequest===ee$B.QuadKey&&!a){!e$28(o.quadKeyIndex)&&e$28(o.blockRequest)&&(o.quadKeyIndex=o.blockRequest.quadKeyIndex);var c=gt$8(s,o.quadKeyIndex);e$28(h=e.blockCache[o.quadKey])&&(h.data=s),e.blockCacheQueue.touch(h),e.blockCacheQueue.trim(e.blockCacheSize),u=Pe$m(c,o.blockInfo)}else if(e._packingRequest!==ee$B.QuadKey||a){if(e._isBlock){var h;if(!e$28((h=e.blockCache[o.quadKey]).data)&&(h.data=s,!0===e._indexedDBSetting.isOpen&&e$28(e._indexedDBScheduler)&&!o.cacheEnable)){var d=o.quadKey,f={blob:s.slice(0),key:d,tablename:e.tablename,dbname:e._indexedDBScheduler.dbname,cacheSize:5};Ge$i.scheduleTask(f,[])}e.blockCacheQueue.touch(h),e.blockCacheQueue.trim(e.blockCacheSize),u=Pe$m(s,o.blockInfo)}}else u=gt$8(s,o.quadKeyIndex);if(!e$28(u))return;if(u===Fe$j){d=pe$C(t,l,r),f={blob:Fe$j,key:d,tablename:e.tablename,dbname:e._indexedDBScheduler.dbname};return void Ge$i.scheduleTask(f,[])}}if(e$28(e._indexedDBSetting)&&!0===e._indexedDBSetting.isOpen&&!e._isBlock&&e$28(e._indexedDBScheduler)&&e$28(u)){d=pe$C(t,l,r),f={blob:u.slice(0),key:d,tablename:e.tablename,dbname:e._indexedDBScheduler.dbname};Ge$i.scheduleTask(f,[])}return e._isTerrainZ&&0!==r?{buffer:u,layerToUse:n,level:r,x:t,y:i,tmsY:l}:e$28(e._heightmapStructure)?et$d(e,u):We$l(e,u,r,t,i,l,n)}};if(e$28(e._subdomains)&&0!==r){var m=e._subdomains,$=m[(t+i+r)%m.length];d=d.replace(qt$7,(function(e,t){return"{s}"===t?$:e}))}var g,v;return e._isBlock?e$28(g=e.blockCache[o.quadKey||r+""+t+i])?g.promise.then(s):(v=yt$7(p,d,n,r,t,i,l,h,c,o,e,a,f))?(g=new e$1B(e,o.quadKey||r+""+t+i),e.blockCache[o.quadKey]=g,g.promise=v,v.then(s)):void 0:(v=yt$7(p,d,n,r,t,i,l,h,c,o,e,a,f))?v.then(s):void 0}if(e$28(e._indexedDBScheduler)){var y,x=pe$C(t,l,r);return e$28(y=e._indexedDBScheduler.getElementFromDB(e.tablename,x))?y.then((function(o){return e$28(o)?o===Fe$j?"cacheInvalid":e._isTerrainZ&&0!==r?{buffer:o,layerToUse:n,level:r,x:t,y:i,tmsY:l}:e$28(e._heightmapStructure)?et$d(e,o):We$l(e,o,r,t,i,l,n):"cacheError"}),(function(e){return"cacheError"})):"cacheError"}}}function gt$8(e,t){var i=new DataView(e),r=0,n=i.getUint32(r,!0);if(t>n-1)throw new t$Z("pack imagery index invalid");r+=4;var o,a,s=[];for(o=0;o<n;o++)a=i.getUint32(r,!0),s.push(a),r+=4;for(o=0;o<n;o++){if(a=s[o],o===t)return 0===a?Fe$j:new Uint8Array(e).slice(r,r+a).buffer;r+=a}}function Pe$m(e,t){var i=new DataView(e),r=0;i.getUint32(r,!0),r+=4;var n=i.getUint32(r,!0);r+=4;for(var o=t.col,a=t.row*t.blockSize+o,s=0,l=0,u=0;u<n;u++){if(u<a)s+=i.getUint32(r,!0);else if(u===a){l=i.getUint32(r,!0),r+=4;break}r+=4}if(r=8+4*n,0!==l)return r+=s,new Uint8Array(e).slice(r,r+l).buffer}var Ge$i=new i$W("indexedDBWorker");function yt$7(e,t,i,r,n,o,a,s,l,u,c,h,d){var f,p=t.substring(0,t.lastIndexOf("/realspace/")+10);if(e$28(a$Y.CREDENTIAL)&&(t=e$28(a$Y.CREDENTIAL._keymap[p])?a$Y.addTokenWithKey(p,t):a$Y.addToken(t)),e$28(d)){var _=d.x,m=d.y;if(r>=c._offset._level){var $=1<<r-c._offset._level;_+=c._offset._x*$/d.blockSize,m+=c._offset._y*$/d.blockSize}f=e.getDerivedResource({url:t,templateValues:{version:i.version,z:r,x:_,y:m},queryParameters:s,headers:l,request:u}).fetchArrayBuffer()}else{var g=u$Y(i.subLevel,0);f=e.getDerivedResource({url:t,templateValues:{version:i.version,z:r-g,x:n,y:a},queryParameters:s,headers:l,request:u}).fetchArrayBuffer()}return f}var Dt$a=new i$W("UnZipTerrainData");se$x.prototype.unzip=function(e){return Dt$a.scheduleTask({data:e},[e])},se$x.prototype.createTerrainData=function(e,t,i){return We$l(this,t,e.level,e.x,e.y,e.tmsY,e.layerToUse,i)},Object.defineProperties(se$x.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this._ready)throw new t$Z("credit must not be called before the terrain provider is ready.");return this._credit}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the terrain provider is ready.");return this._tilingScheme}},isCreateSkirt:{get:function(){return this._isCreateSkirt},set:function(e){e!==this._isCreateSkirt&&(this._isSkirtDirty=!0),this._isCreateSkirt=e}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){if(!this._ready)throw new t$Z("hasWaterMask must not be called before the terrain provider is ready.");return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){if(!this._ready)throw new t$Z("hasVertexNormals must not be called before the terrain provider is ready.");return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){if(!this._ready)throw new t$Z("hasMetadata must not be called before the terrain provider is ready.");return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){if(!this._ready)throw new t$Z("availability must not be called before the terrain provider is ready.");return this._availability}},isShowGlobe:{get:function(){return this._isShowGlobe}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}},indexedDBSetting:{get:function(){return this._indexedDBSetting},set:function(e){e$28(e)&&"boolean"==typeof e.isOpen&&(this._indexedDBSetting.isOpen=e.isOpen)}},hasNormalBuffer:{get:function(){return this._hasNormalBuffer}},blockCache:{get:function(){return this._blockCache}},blockCacheQueue:{get:function(){return this._blockCacheQueue}},blockCacheSize:{get:function(){return this._blockCacheSize}},subdomains:{get:function(){return this._subdomains},set:function(e){if(e$28(e)&&!e$28(e.length))throw new t$Z("Excepted CesiumTerrainProvider.subdomains to be type of Array.");this._subdomains=e}},currentVersion:{get:function(){return this._currentVersion},set:function(e){this._currentVersion=e,this._blockCache={},this._needRefresh=!0}},historyVersions:{get:function(){return this._historyVersions}},visible:{get:function(){return this._visible},set:function(e){this._visible=e}},extrudeTileBoundingBox:{get:function(){return this._extrudeTileBoundingBox},set:function(e){this._extrudeTileBoundingBox=e}}}),se$x.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var Ft$6=new h$10;function tt$g(e,t,i,r){if(0!==r){var n=e.availabilityLevels,o=r%n==0?r-n:(r/n|0)*n,a=1<<r-o;return{level:o,x:t/a|0,y:i/a|0}}}function bt$6(e,t,i,r,n,o){if(!e$28(n.availabilityLevels))return{result:!1};for(var a,s=function(){delete n.availabilityPromiseCache[a]},l=n.availabilityTilesLoaded,u=n.availability,c=tt$g(n,t,i,r);e$28(c);){if(u.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){var h;if(!o&&(a=c.level+"-"+c.x+"-"+c.y,!e$28(h=n.availabilityPromiseCache[a]))){var d=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.TERRAIN});e$28(h=_t$a(e,c.x,c.y,c.level,n,d))&&(n.availabilityPromiseCache[a]=h,h.then(s))}return{result:!0,promise:h}}c=tt$g(n,c.x,c.y,c.level)}return{result:!1}}function Pt$7(e,t){var i=new Int8Array(e);for(var r=t.split("").map((function(e){return e.charCodeAt(0)})),n=0;n<r.length;n++)i[n]=i[n]^r[n];return i.buffer}se$x.prototype.getTileDataAvailable=function(e,t,i){if(e$28(this._availability)){if(i>this._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,o=0;o<n;++o){if(bt$6(this,e,t,i,r[o],0===o).result)return}return!1}if(this._isSct&&0!==i){if(-1!==this._levels.indexOf(i)){var a=this._tilingScheme.tileXYToRectangle(e,t,i);return e$28(h$10.intersection(this._boundsRadians,a,Ft$6))}return!1}},se$x.prototype.loadTileDataAvailability=function(e,t,i){if(!(!e$28(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,o=0;o<n;++o){var a=bt$6(this,e,t,i,r[o],0===o);if(e$28(a.promise))return a.promise}},se$x.prototype.saveLocalCache=function(){if(e$28(this._indexedDBSetting)&&!0===this._indexedDBSetting.isOpen&&e$28(this._indexedDBScheduler)){var e={tablename:this.tablename,dbname:this._indexedDBScheduler.dbname};Ge$i.scheduleTask(e,[])}},se$x._getAvailabilityTile=tt$g;var C$Q={},b$10=new t$X,Q$X=new t$X,G$14=new n$14,N$L=new p$1a;function W$T(e,t,i,r,n,o,a,s,l,u){var c=e+t;t$X.multiplyByScalar(r,Math.cos(c),b$10),t$X.multiplyByScalar(i,Math.sin(c),Q$X),t$X.add(b$10,Q$X,b$10);var h=Math.cos(e);h*=h;var d=Math.sin(e);d*=d;var f=o/Math.sqrt(a*h+n*d)/s;return n$14.fromAxisAngle(b$10,f,G$14),p$1a.fromQuaternion(G$14,N$L),p$1a.multiplyByVector(N$L,l,u),t$X.normalize(u,u),t$X.multiplyByScalar(u,s,u),u}var U$X=new t$X,Z$_=new t$X,j$$=new t$X,D$V=new t$X;C$Q.raisePositionsToHeight=function(e,t,i){for(var r=t.ellipsoid,n=t.height,o=t.extrudedHeight,a=i?e.length/3*2:e.length/3,s=new Float64Array(3*a),l=e.length,u=i?l:0,c=0;c<l;c+=3){var h=c+1,d=c+2,f=t$X.fromArray(e,c,U$X);r.scaleToGeodeticSurface(f,f);var p=t$X.clone(f,Z$_),_=r.geodeticSurfaceNormal(f,D$V),m=t$X.multiplyByScalar(_,n,j$$);t$X.add(f,m,f),i&&(t$X.multiplyByScalar(_,o,m),t$X.add(p,m,p),s[c+u]=p.x,s[h+u]=p.y,s[d+u]=p.z),s[c]=f.x,s[h]=f.y,s[d]=f.z}return s};var J$X=new t$X,K$Q=new t$X,X$O=new t$X;function d$15(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).geometry))throw new t$Z("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=u$Y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}function i$Q(){this.high=t$X.clone(t$X.ZERO),this.low=t$X.clone(t$X.ZERO)}C$Q.computeEllipsePositions=function(e,t,i){var r=e.semiMinorAxis,n=e.semiMajorAxis,o=e.rotation,a=e.center,s=8*e.granularity,l=r*r,u=n*n,c=n*r,h=t$X.magnitude(a),d=t$X.normalize(a,J$X),f=t$X.cross(t$X.UNIT_Z,a,K$Q);f=t$X.normalize(f,f);var p=t$X.cross(d,f,X$O),_=1+Math.ceil(e$27.PI_OVER_TWO/s),m=e$27.PI_OVER_TWO/(_-1),$=e$27.PI_OVER_TWO-_*m;$<0&&(_-=Math.ceil(Math.abs($)/m));var g,v,y,x,b,w=t?new Array(3*(_*(_+2)*2)):void 0,C=0,T=U$X,S=Z$_,E=4*_*3,A=E-1,P=0,I=i?new Array(E):void 0;for(T=W$T($=e$27.PI_OVER_TWO,o,p,f,l,c,u,h,d,T),t&&(w[C++]=T.x,w[C++]=T.y,w[C++]=T.z),i&&(I[A--]=T.z,I[A--]=T.y,I[A--]=T.x),$=e$27.PI_OVER_TWO-m,g=1;g<_+1;++g){if(T=W$T($,o,p,f,l,c,u,h,d,T),S=W$T(Math.PI-$,o,p,f,l,c,u,h,d,S),t){for(w[C++]=T.x,w[C++]=T.y,w[C++]=T.z,y=2*g+2,v=1;v<y-1;++v)x=v/(y-1),b=t$X.lerp(T,S,x,j$$),w[C++]=b.x,w[C++]=b.y,w[C++]=b.z;w[C++]=S.x,w[C++]=S.y,w[C++]=S.z}i&&(I[A--]=T.z,I[A--]=T.y,I[A--]=T.x,I[P++]=S.x,I[P++]=S.y,I[P++]=S.z),$=e$27.PI_OVER_TWO-(g+1)*m}for(g=_;g>1;--g){if(T=W$T(-($=e$27.PI_OVER_TWO-(g-1)*m),o,p,f,l,c,u,h,d,T),S=W$T($+Math.PI,o,p,f,l,c,u,h,d,S),t){for(w[C++]=T.x,w[C++]=T.y,w[C++]=T.z,y=2*(g-1)+2,v=1;v<y-1;++v)x=v/(y-1),b=t$X.lerp(T,S,x,j$$),w[C++]=b.x,w[C++]=b.y,w[C++]=b.z;w[C++]=S.x,w[C++]=S.y,w[C++]=S.z}i&&(I[A--]=T.z,I[A--]=T.y,I[A--]=T.x,I[P++]=S.x,I[P++]=S.y,I[P++]=S.z)}T=W$T(-($=e$27.PI_OVER_TWO),o,p,f,l,c,u,h,d,T);var M={};return t&&(w[C++]=T.x,w[C++]=T.y,w[C++]=T.z,M.positions=w,M.numPts=_),i&&(I[A--]=T.z,I[A--]=T.y,I[A--]=T.x,M.outerPositions=I),M},i$Q.encode=function(e,t){var i;return o$1u.typeOf.number("value",e),e$28(t)||(t={high:0,low:0}),e>=0?(i=65536*Math.floor(e/65536),t.high=i,t.low=e-i):(i=65536*Math.floor(-e/65536),t.high=-i,t.low=e+i),t};var n$W={high:0,low:0};i$Q.fromCartesian=function(e,t){o$1u.typeOf.object("cartesian",e),e$28(t)||(t=new i$Q);var i=t.high,r=t.low;return i$Q.encode(e.x,n$W),i.x=n$W.high,r.x=n$W.low,i$Q.encode(e.y,n$W),i.y=n$W.high,r.y=n$W.low,i$Q.encode(e.z,n$W),i.z=n$W.high,r.z=n$W.low,t};var t$J=new i$Q;i$Q.writeElements=function(e,t,i){o$1u.defined("cartesianArray",t),o$1u.typeOf.number("index",i),o$1u.typeOf.number.greaterThanOrEquals("index",i,0),i$Q.fromCartesian(e,t$J);var r=t$J.high,n=t$J.low;t[i]=r.x,t[i+1]=r.y,t[i+2]=r.z,t[i+3]=n.x,t[i+4]=n.y,t[i+5]=n.z};var D$U={calculateACMR:function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=u$Y(e.cacheSize,24);if(!e$28(t))throw new t$Z("indices is required.");var n=t.length;if(n<3||n%3!=0)throw new t$Z("indices length must be a multiple of three.");if(i<=0)throw new t$Z("maximumIndex must be greater than zero.");if(r<3)throw new t$Z("cacheSize must be greater than two.");if(!e$28(i)){i=0;for(var o=0,a=t[o];o<n;)a>i&&(i=a),a=t[++o]}for(var s=[],l=0;l<i+1;l++)s[l]=0;for(var u=r+1,c=0;c<n;++c)u-s[t[c]]>r&&(s[t[c]]=u,++u);return(u-r+1)/(n/3)}};D$U.tipsify=function(e){var t,i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).indices,r=e.maximumIndex,n=u$Y(e.cacheSize,24);function o(e,i,r,n,o,a,s){for(var l,u=-1,c=-1,h=0;h<r.length;){var d=r[h];n[d].numLiveTriangles&&(l=0,o-n[d].timeStamp+2*n[d].numLiveTriangles<=i&&(l=o-n[d].timeStamp),(l>c||-1===c)&&(c=l,u=d)),++h}return-1===u?function(e,i,r,n){for(;i.length>=1;){var o=i[i.length-1];if(i.splice(i.length-1,1),e[o].numLiveTriangles>0)return o}for(;t<n;){if(e[t].numLiveTriangles>0)return++t-1;++t}return-1}(n,a,0,s):u}if(!e$28(i))throw new t$Z("indices is required.");var a=i.length;if(a<3||a%3!=0)throw new t$Z("indices length must be a multiple of three.");if(r<=0)throw new t$Z("maximumIndex must be greater than zero.");if(n<3)throw new t$Z("cacheSize must be greater than two.");var s=0,l=0,u=i[l],c=a;if(e$28(r))s=r+1;else{for(;l<c;)u>s&&(s=u),u=i[++l];if(-1===s)return 0;++s}var h,d=[];for(h=0;h<s;h++)d[h]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};l=0;for(var f=0;l<c;)d[i[l]].vertexTriangles.push(f),++d[i[l]].numLiveTriangles,d[i[l+1]].vertexTriangles.push(f),++d[i[l+1]].numLiveTriangles,d[i[l+2]].vertexTriangles.push(f),++d[i[l+2]].numLiveTriangles,++f,l+=3;var p=0,_=n+1;t=1;var m,$,g,v,y=[],x=[],b=0,w=[],C=a/3,T=[];for(h=0;h<C;h++)T[h]=!1;for(;-1!==p;){y=[],v=($=d[p]).vertexTriangles.length;for(var S=0;S<v;++S)if(!T[f=$.vertexTriangles[S]]){T[f]=!0,l=f+f+f;for(var E=0;E<3;++E)g=i[l],y.push(g),x.push(g),w[b]=g,++b,--(m=d[g]).numLiveTriangles,_-m.timeStamp>n&&(m.timeStamp=_,++_),++l}p=o(0,n,y,d,_,x,s)}return w};var k$Z={};function gr$8(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function ma$4(e){for(var t=e.length,i=t/3*6,r=ce$v.createTypedArray(t,i),n=0,o=0;o<t;o+=3,n+=6)gr$8(r,n,e[o],e[o+1],e[o+2]);return r}function pa$2(e){var t=e.length;if(t>=3){var i=6*(t-2),r=ce$v.createTypedArray(t,i);gr$8(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)gr$8(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function ya$4(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=ce$v.createTypedArray(t,i),n=e[0],o=0,a=1;a<t;++a,o+=6)gr$8(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function Yr$1(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&e$28(e[i])&&e$28(e[i].values)){var r=e[i];t[i]=new o$1g({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function wa$4(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&e$28(t[r])&&e$28(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}k$Z.toWireframe=function(e){if(!e$28(e))throw new t$Z("geometry is required.");var t=e.indices;if(e$28(t)){switch(e.primitiveType){case W$_.TRIANGLES:e.indices=ma$4(t);break;case W$_.TRIANGLE_STRIP:e.indices=pa$2(t);break;case W$_.TRIANGLE_FAN:e.indices=ya$4(t);break;default:throw new t$Z("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=W$_.LINES}return e},k$Z.createLineSegmentsForVectors=function(e,t,i){if(t=u$Y(t,"normal"),!e$28(e))throw new t$Z("geometry is required.");if(!e$28(e.attributes.position))throw new t$Z("geometry.attributes.position is required.");if(!e$28(e.attributes[t]))throw new t$Z("geometry.attributes must have an attribute with the same name as the attributeName parameter, "+t+".");i=u$Y(i,1e4);for(var r=e.attributes.position.values,n=e.attributes[t].values,o=r.length,a=new Float64Array(2*o),s=0,l=0;l<o;l+=3)a[s++]=r[l],a[s++]=r[l+1],a[s++]=r[l+2],a[s++]=r[l]+n[l]*i,a[s++]=r[l+1]+n[l+1]*i,a[s++]=r[l+2]+n[l+2]*i;var u,c=e.boundingSphere;return e$28(c)&&(u=new i$19(c.center,c.radius+i)),new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:W$_.LINES,boundingSphere:u})},k$Z.createAttributeLocations=function(e){if(!e$28(e))throw new t$Z("geometry is required.");var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;t<a;++t){var s=i[t];e$28(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!e$28(n[l])&&(n[l]=o++);return n},k$Z.reorderForPreVertexCache=function(e){if(!e$28(e))throw new t$Z("geometry is required.");var t=I$1n.computeNumberOfVertices(e),i=e.indices;if(e$28(i)){for(var r=new Int32Array(t),n=0;n<t;n++)r[n]=-1;for(var o,a=i,s=a.length,l=ce$v.createTypedArray(t,s),u=0,c=0,h=0;u<s;)-1!==(o=r[a[u]])?l[c]=o:(r[o=a[u]]=h,l[c]=h,++h),++u,++c;e.indices=l;var d=e.attributes;for(var f in d)if(d.hasOwnProperty(f)&&e$28(d[f])&&e$28(d[f].values)){for(var p=d[f],_=p.values,m=0,$=p.componentsPerAttribute,g=S$W.createTypedArray(p.componentDatatype,h*$);m<t;){var v=r[m];if(-1!==v)for(var y=0;y<$;y++)g[$*v+y]=_[$*m+y];++m}p.values=g}}return e},k$Z.reorderForPostVertexCache=function(e,t){if(!e$28(e))throw new t$Z("geometry is required.");var i=e.indices;if(e.primitiveType===W$_.TRIANGLES&&e$28(i)){for(var r=i.length,n=0,o=0;o<r;o++)i[o]>n&&(n=i[o]);e.indices=D$U.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},k$Z.fitToUnsignedShortIndices=function(e){if(!e$28(e))throw new t$Z("geometry is required.");if(e$28(e.indices)&&e.primitiveType!==W$_.TRIANGLES&&e.primitiveType!==W$_.LINES&&e.primitiveType!==W$_.POINTS)throw new t$Z("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");var t=[],i=I$1n.computeNumberOfVertices(e);if(e$28(e.indices)&&i>=e$27.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=Yr$1(e.attributes),l=e.indices,u=l.length;e.primitiveType===W$_.TRIANGLES?r=3:e.primitiveType===W$_.LINES?r=2:e.primitiveType===W$_.POINTS&&(r=1);for(var c=0;c<u;c+=r){for(var h=0;h<r;++h){var d=l[c+h],f=n[d];e$28(f)||(f=a++,n[d]=f,wa$4(s,e.attributes,d)),o.push(f)}a+r>=e$27.SIXTY_FOUR_KILOBYTES&&(t.push(new I$1n({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=Yr$1(e.attributes))}0!==o.length&&t.push(new I$1n({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Hr$2=new t$X,da$3=new t$W;k$Z.projectTo2D=function(e,t,i,r,n){if(!e$28(e))throw new t$Z("geometry is required.");if(!e$28(t))throw new t$Z("attributeName is required.");if(!e$28(i))throw new t$Z("attributeName3D is required.");if(!e$28(r))throw new t$Z("attributeName2D is required.");if(!e$28(e.attributes[t]))throw new t$Z("geometry must have attribute matching the attributeName argument: "+t+".");if(e.attributes[t].componentDatatype!==S$W.DOUBLE)throw new t$Z("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");for(var o=e.attributes[t],a=(n=e$28(n)?n:new n$1b).ellipsoid,s=o.values,l=new Float64Array(s.length),u=0,c=0;c<s.length;c+=3){var h=t$X.fromArray(s,c,Hr$2),d=a.cartesianToCartographic(h,da$3);if(!e$28(d))throw new t$Z("Could not project point ("+h.x+", "+h.y+", "+h.z+") to 2D.");var f=n.project(d,Hr$2);l[u++]=f.x,l[u++]=f.y,l[u++]=f.z}return e.attributes[i]=o,e.attributes[r]=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var xr$5={high:0,low:0};k$Z.encodeAttribute=function(e,t,i,r){if(!e$28(e))throw new t$Z("geometry is required.");if(!e$28(t))throw new t$Z("attributeName is required.");if(!e$28(i))throw new t$Z("attributeHighName is required.");if(!e$28(r))throw new t$Z("attributeLowName is required.");if(!e$28(e.attributes[t]))throw new t$Z("geometry must have attribute matching the attributeName argument: "+t+".");if(e.attributes[t].componentDatatype!==S$W.DOUBLE)throw new t$Z("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");for(var n=e.attributes[t],o=n.values,a=o.length,s=new Float32Array(a),l=new Float32Array(a),u=0;u<a;++u)i$Q.encode(o[u],xr$5),s[u]=xr$5.high,l[u]=xr$5.low;var c=n.componentsPerAttribute;return e.attributes[i]=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:c,values:s}),e.attributes[r]=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:c,values:l}),delete e.attributes[t],e};var W$S=new t$X;function Vr$4(e,t){if(e$28(t))for(var i=t.values,r=i.length,n=0;n<r;n+=3)t$X.unpack(i,n,W$S),y$15.multiplyByPoint(e,W$S,W$S),t$X.pack(W$S,i,n)}function qr$2(e,t){if(e$28(t))for(var i=t.values,r=i.length,n=0;n<r;n+=3)t$X.unpack(i,n,W$S),p$1a.multiplyByVector(e,W$S,W$S),W$S=t$X.normalize(W$S,W$S),t$X.pack(W$S,i,n)}var Er$4=new y$15,Lr$5=new p$1a;function Sa$2(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&e$28(o[i])&&e$28(o[i].values)){for(var a=o[i],s=a.values.length,l=!0,u=1;u<r;++u){var c=e[u][t].attributes[i];if(!e$28(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){l=!1;break}s+=c.values.length}l&&(n[i]=new o$1g({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:S$W.createTypedArray(a.componentDatatype,s)}),a.isInstanceAttribute&&(n[i].isInstanceAttribute=!0))}return n}k$Z.transformToWorldCoordinates=function(e){if(!e$28(e))throw new t$Z("instance is required.");var t=e.modelMatrix;if(y$15.equals(t,y$15.IDENTITY))return e;var i=e.geometry.attributes;Vr$4(t,i.position),Vr$4(t,i.prevPosition),Vr$4(t,i.nextPosition),(e$28(i.normal)||e$28(i.tangent)||e$28(i.bitangent))&&(y$15.inverse(t,Er$4),y$15.transpose(Er$4,Er$4),y$15.getRotation(Er$4,Lr$5),qr$2(Lr$5,i.normal),qr$2(Lr$5,i.tangent),qr$2(Lr$5,i.bitangent));var r=e.geometry.boundingSphere;return e$28(r)&&(e.geometry.boundingSphere=i$19.transform(r,t,r)),e.modelMatrix=y$15.clone(y$15.IDENTITY),e};var Ta$4=new t$X;function Gr$4(e,t){var i,r,n,o,a=e.length,s=e[0].modelMatrix,l=e$28(e[0][t].indices),u=e[0][t].primitiveType;for(r=1;r<a;++r){if(!y$15.equals(e[r].modelMatrix,s))throw new t$Z("All instances must have the same modelMatrix.");if(e$28(e[r][t].indices)!==l)throw new t$Z("All instance geometries must have an indices or not have one.");if(e[r][t].primitiveType!==u)throw new t$Z("All instance geometries must have the same primitiveType.")}var c,h,d,f,p=Sa$2(e,t);for(i in p)if(p.hasOwnProperty(i))for(c=p[i].values,o=0,r=0;r<a;++r)for(d=(h=e[r][t].attributes[i].values).length,n=0;n<d;++n)c[o++]=h[n];if(l){var _=0;for(r=0;r<a;++r)_+=e[r][t].indices.length;var m=I$1n.computeNumberOfVertices(new I$1n({attributes:p,primitiveType:W$_.POINTS})),$=ce$v.createTypedArray(m,_),g=0,v=0;for(r=0;r<a;++r){var y=e[r][t].indices,x=y.length;for(o=0;o<x;++o)$[g++]=v+y[o];v+=I$1n.computeNumberOfVertices(e[r][t])}f=$}var b,w=new t$X,C=0;for(r=0;r<a;++r){if(!e$28(b=e[r][t].boundingSphere)){w=void 0;break}t$X.add(b.center,w,w)}if(e$28(w))for(t$X.divideByScalar(w,a,w),r=0;r<a;++r){b=e[r][t].boundingSphere;var T=t$X.magnitude(t$X.subtract(b.center,w,Ta$4))+b.radius;T>C&&(C=T)}return new I$1n({attributes:p,indices:f,primitiveType:u,boundingSphere:e$28(w)?new i$19(w,C):void 0})}k$Z.combineInstances=function(e){if(!e$28(e)||e.length<1)throw new t$Z("instances is required and must have length greater than zero.");for(var t=[],i=[],r=e.length,n=0;n<r;++n){var o=e[n];e$28(o.geometry)?t.push(o):e$28(o.westHemisphereGeometry)&&e$28(o.eastHemisphereGeometry)&&i.push(o)}var a=[];return t.length>0&&a.push(Gr$4(t,"geometry")),i.length>0&&(a.push(Gr$4(i,"westHemisphereGeometry")),a.push(Gr$4(i,"eastHemisphereGeometry"))),a};var U$W=new t$X,mr$7=new t$X,or$9=new t$X,sr$4=new t$X;k$Z.computeNormal=function(e){if(!e$28(e))throw new t$Z("geometry is required.");if(!e$28(e.attributes.position)||!e$28(e.attributes.position.values))throw new t$Z("geometry.attributes.position.values is required.");if(!e$28(e.indices))throw new t$Z("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!=0)throw new t$Z("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==W$_.TRIANGLES)throw new t$Z("geometry.primitiveType must be PrimitiveType.TRIANGLES.");var t,i=e.indices,r=e.attributes,n=r.position.values,o=r.position.values.length/3,a=i.length,s=new Array(o),l=new Array(a/3),u=new Array(a);for(t=0;t<o;t++)s[t]={indexOffset:0,count:0,currentCount:0};var c=0;for(t=0;t<a;t+=3){var h=i[t],d=i[t+1],f=i[t+2],p=3*h,_=3*d,m=3*f;mr$7.x=n[p],mr$7.y=n[p+1],mr$7.z=n[p+2],or$9.x=n[_],or$9.y=n[_+1],or$9.z=n[_+2],sr$4.x=n[m],sr$4.y=n[m+1],sr$4.z=n[m+2],s[h].count++,s[d].count++,s[f].count++,t$X.subtract(or$9,mr$7,or$9),t$X.subtract(sr$4,mr$7,sr$4),l[c]=t$X.cross(or$9,sr$4,new t$X),c++}var $,g=0;for(t=0;t<o;t++)s[t].indexOffset+=g,g+=s[t].count;for(c=0,t=0;t<a;t+=3){var v=($=s[i[t]]).indexOffset+$.currentCount;u[v]=c,$.currentCount++,u[v=($=s[i[t+1]]).indexOffset+$.currentCount]=c,$.currentCount++,u[v=($=s[i[t+2]]).indexOffset+$.currentCount]=c,$.currentCount++,c++}var y=new Float32Array(3*o);for(t=0;t<o;t++){var x=3*t;if($=s[t],t$X.clone(t$X.ZERO,U$W),$.count>0){for(c=0;c<$.count;c++)t$X.add(U$W,l[u[$.indexOffset+c]],U$W);t$X.equalsEpsilon(t$X.ZERO,U$W,e$27.EPSILON10)&&t$X.clone(l[u[$.indexOffset]],U$W)}t$X.equalsEpsilon(t$X.ZERO,U$W,e$27.EPSILON10)&&(U$W.z=1),t$X.normalize(U$W,U$W),y[x]=U$W.x,y[x+1]=U$W.y,y[x+2]=U$W.z}return e.attributes.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:y}),e};var ba$3=new t$X,Wr$2=new t$X,ga$3=new t$X;k$Z.computeTangentAndBitangent=function(e){if(!e$28(e))throw new t$Z("geometry is required.");var t=e.attributes,i=e.indices;if(!e$28(t.position)||!e$28(t.position.values))throw new t$Z("geometry.attributes.position.values is required.");if(!e$28(t.normal)||!e$28(t.normal.values))throw new t$Z("geometry.attributes.normal.values is required.");if(!e$28(t.st)||!e$28(t.st.values))throw new t$Z("geometry.attributes.st.values is required.");if(!e$28(i))throw new t$Z("geometry.indices is required.");if(i.length<2||i.length%3!=0)throw new t$Z("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==W$_.TRIANGLES)throw new t$Z("geometry.primitiveType must be PrimitiveType.TRIANGLES.");var r,n,o,a,s=e.attributes.position.values,l=e.attributes.normal.values,u=e.attributes.st.values,c=e.attributes.position.values.length/3,h=i.length,d=new Array(3*c);for(r=0;r<d.length;r++)d[r]=0;for(r=0;r<h;r+=3){var f=i[r],p=i[r+1],_=i[r+2];o=3*p,a=3*_;var m=2*f,$=2*p,g=2*_,v=s[n=3*f],y=s[n+1],x=s[n+2],b=u[m],w=u[m+1],C=u[$+1]-w,T=u[g+1]-w,S=1/((u[$]-b)*T-(u[g]-b)*C),E=(T*(s[o]-v)-C*(s[a]-v))*S,A=(T*(s[o+1]-y)-C*(s[a+1]-y))*S,P=(T*(s[o+2]-x)-C*(s[a+2]-x))*S;d[n]+=E,d[n+1]+=A,d[n+2]+=P,d[o]+=E,d[o+1]+=A,d[o+2]+=P,d[a]+=E,d[a+1]+=A,d[a+2]+=P}var I=new Float32Array(3*c),M=new Float32Array(3*c);for(r=0;r<c;r++){o=(n=3*r)+1,a=n+2;var O=t$X.fromArray(l,n,ba$3),D=t$X.fromArray(d,n,ga$3),R=t$X.dot(O,D);t$X.multiplyByScalar(O,R,Wr$2),t$X.normalize(t$X.subtract(D,Wr$2,D),D),I[n]=D.x,I[o]=D.y,I[a]=D.z,t$X.normalize(t$X.cross(O,D,D),D),M[n]=D.x,M[o]=D.y,M[a]=D.z}return e.attributes.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:I}),e.attributes.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:M}),e};var pr$6=new o$1k,X$N=new t$X,Xr$2=new t$X,Kr$3=new t$X,Or$3=new o$1k;function Ea$4(e){if(e$28(e.indices))return e;var t=I$1n.computeNumberOfVertices(e);if(t<3)throw new t$Z("The number of vertices must be at least three.");if(t%3!=0)throw new t$Z("The number of vertices must be a multiple of three.");for(var i=ce$v.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function La$4(e){var t=I$1n.computeNumberOfVertices(e);if(t<3)throw new t$Z("The number of vertices must be at least three.");var i=ce$v.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;n<t;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=W$_.TRIANGLES,e}function Oa$3(e){var t=I$1n.computeNumberOfVertices(e);if(t<3)throw new t$Z("The number of vertices must be at least 3.");var i=ce$v.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;n<t-1;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,n+2<t&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=W$_.TRIANGLES,e}function Aa$5(e){if(e$28(e.indices))return e;var t=I$1n.computeNumberOfVertices(e);if(t<2)throw new t$Z("The number of vertices must be at least two.");if(t%2!=0)throw new t$Z("The number of vertices must be a multiple of 2.");for(var i=ce$v.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function Pa$2(e){var t=I$1n.computeNumberOfVertices(e);if(t<2)throw new t$Z("The number of vertices must be at least two.");var i=ce$v.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=W$_.LINES,e}function za$3(e){var t=I$1n.computeNumberOfVertices(e);if(t<2)throw new t$Z("The number of vertices must be at least two.");var i=ce$v.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=W$_.LINES,e}function Na$4(e){switch(e.primitiveType){case W$_.TRIANGLE_FAN:return La$4(e);case W$_.TRIANGLE_STRIP:return Oa$3(e);case W$_.TRIANGLES:return Ea$4(e);case W$_.LINE_STRIP:return Pa$2(e);case W$_.LINE_LOOP:return za$3(e);case W$_.LINES:return Aa$5(e)}return e}function ar$c(e,t){Math.abs(e.y)<e$27.EPSILON6&&(e.y=t?-e$27.EPSILON6:e$27.EPSILON6)}function Da$4(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return ar$c(e,e.y<0),ar$c(t,t.y<0),void ar$c(i,i.y<0);var r=Math.abs(e.y),n=Math.abs(t.y),o=Math.abs(i.y),a=(r>n?r>o?e$27.sign(e.y):e$27.sign(i.y):n>o?e$27.sign(t.y):e$27.sign(i.y))<0;ar$c(e,a),ar$c(t,a),ar$c(i,a)}k$Z.compressVertices=function(e){if(!e$28(e))throw new t$Z("geometry is required.");var t,i,r=e.attributes.extrudeDirection;if(e$28(r)){var n=r.values;i=n.length/3;var o=new Float32Array(2*i),a=0;for(t=0;t<i;++t)t$X.fromArray(n,3*t,X$N),t$X.equals(X$N,t$X.ZERO)?a+=2:(Or$3=t$N.octEncodeInRange(X$N,65535,Or$3),o[a++]=Or$3.x,o[a++]=Or$3.y);return e.attributes.compressedAttributes=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:o}),delete e.attributes.extrudeDirection,e}var s=e.attributes.normal,l=e.attributes.st,u=e$28(s),c=e$28(l);if(!u&&!c)return e;var h,d,f,p,_=e.attributes.tangent,m=e.attributes.bitangent,$=e$28(_),g=e$28(m);u&&(h=s.values),c&&(d=l.values),$&&(f=_.values),g&&(p=m.values);var v=i=(u?h.length:d.length)/(u?3:2),y=c&&u?2:1;y+=$||g?1:0;var x=new Float32Array(v*=y),b=0;for(t=0;t<i;++t){c&&(o$1k.fromArray(d,2*t,pr$6),x[b++]=t$N.compressTextureCoordinates(pr$6));var w=3*t;u&&e$28(f)&&e$28(p)?(t$X.fromArray(h,w,X$N),t$X.fromArray(f,w,Xr$2),t$X.fromArray(p,w,Kr$3),t$N.octPack(X$N,Xr$2,Kr$3,pr$6),x[b++]=pr$6.x,x[b++]=pr$6.y):(u&&(t$X.fromArray(h,w,X$N),x[b++]=t$N.octEncodeFloat(X$N)),$&&(t$X.fromArray(f,w,X$N),x[b++]=t$N.octEncodeFloat(X$N)),g&&(t$X.fromArray(p,w,X$N),x[b++]=t$N.octEncodeFloat(X$N)))}return e.attributes.compressedAttributes=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:y,values:x}),u&&delete e.attributes.normal,c&&delete e.attributes.st,g&&delete e.attributes.bitangent,$&&delete e.attributes.tangent,e};var Jr$2=new t$X;function Z$Z(e,t,i,r){t$X.add(e,t$X.multiplyByScalar(t$X.subtract(t,e,Jr$2),e.y/(e.y-t.y),Jr$2),i),t$X.clone(i,r),ar$c(i,!0),ar$c(r,!1)}var er$e=new t$X,nr$b=new t$X,vr$6=new t$X,tr$b=new t$X,Rr$3={positions:new Array(7),indices:new Array(9)};function xa$4(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){Da$4(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=Rr$3.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(Z$Z(e,t,er$e,vr$6),Z$Z(e,i,nr$b,tr$b),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(Z$Z(t,i,er$e,vr$6),Z$Z(t,e,nr$b,tr$b),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(Z$Z(i,e,er$e,vr$6),Z$Z(i,t,nr$b,tr$b),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(Z$Z(i,e,er$e,vr$6),Z$Z(i,t,nr$b,tr$b),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(Z$Z(t,i,er$e,vr$6),Z$Z(t,e,nr$b,tr$b),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(Z$Z(e,t,er$e,vr$6),Z$Z(e,i,nr$b,tr$b),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Rr$3.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,(1===a||2===a)&&(l[3]=er$e,l[4]=nr$b,l[5]=vr$6,l[6]=tr$b,l.length=7),Rr$3}}function Qr$1(e,t){var i=e.attributes;if(0!==i.position.values.length){for(var r in i)if(i.hasOwnProperty(r)&&e$28(i[r])&&e$28(i[r].values)){var n=i[r];n.values=S$W.createTypedArray(n.componentDatatype,n.values)}var o=I$1n.computeNumberOfVertices(e);return e.indices=ce$v.createTypedArray(o,e.indices),t&&(e.boundingSphere=i$19.fromVertices(i.position.values)),e}}function ur$7(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&e$28(t[r])&&e$28(t[r].values)){var n=t[r];i[r]=new o$1g({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new I$1n({attributes:i,indices:[],primitiveType:e.primitiveType})}function Br$3(e,t,i){var r=e$28(e.geometry.boundingSphere);t=Qr$1(t,r),e$28(i=Qr$1(i,r))&&!e$28(t)?e.geometry=i:!e$28(i)&&e$28(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Fr$3(e,t){var i=new e,r=new e,n=new e;return function(o,a,s,l,u,c,h,d){var f=e.fromArray(u,o*t,i),p=e.fromArray(u,a*t,r),_=e.fromArray(u,s*t,n);e.multiplyByScalar(f,l.x,f),e.multiplyByScalar(p,l.y,p),e.multiplyByScalar(_,l.z,_);var m=e.add(f,p,f);e.add(m,_,m),d&&e.normalize(m,m),e.pack(m,c,h*t)}}var Va$4=Fr$3(e$25,4),Ar$5=Fr$3(t$X,3),$r$3=Fr$3(o$1k,2),qa$3=function(e,t,i,r,n,o,a){var s=n[e]*r.x,l=n[t]*r.y,u=n[i]*r.z;o[a]=s+l+u>e$27.EPSILON6?1:0},yr$4=new t$X,kr$5=new t$X,Ir$5=new t$X,Ga$4=new t$X;function Pr$4(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_){if(e$28(o)||e$28(a)||e$28(s)||e$28(l)||e$28(u)||0!==f){var m=S$P(r,t$X.fromArray(n,3*e,yr$4),t$X.fromArray(n,3*t,kr$5),t$X.fromArray(n,3*i,Ir$5),Ga$4);if(e$28(o)&&Ar$5(e,t,i,m,o,h.normal.values,_,!0),e$28(u)){var $,g=t$X.fromArray(u,3*e,yr$4),v=t$X.fromArray(u,3*t,kr$5),y=t$X.fromArray(u,3*i,Ir$5);t$X.multiplyByScalar(g,m.x,g),t$X.multiplyByScalar(v,m.y,v),t$X.multiplyByScalar(y,m.z,y),t$X.equals(g,t$X.ZERO)&&t$X.equals(v,t$X.ZERO)&&t$X.equals(y,t$X.ZERO)?(($=yr$4).x=0,$.y=0,$.z=0):($=t$X.add(g,v,g),t$X.add($,y,$),t$X.normalize($,$)),t$X.pack($,h.extrudeDirection.values,3*_)}if(e$28(c)&&qa$3(e,t,i,m,c,h.applyOffset.values,_),e$28(a)&&Ar$5(e,t,i,m,a,h.tangent.values,_,!0),e$28(s)&&Ar$5(e,t,i,m,s,h.bitangent.values,_,!0),e$28(l)&&$r$3(e,t,i,m,l,h.st.values,_),f>0)for(var x=0;x<f;x++){var b=d[x];Ra$5(e,t,i,m,_,p[b],h[b])}}}function Ra$5(e,t,i,r,n,o,a){var s=o.componentsPerAttribute,l=o.values,u=a.values;switch(s){case 4:Va$4(e,t,i,r,l,u,n,!1);break;case 3:Ar$5(e,t,i,r,l,u,n,!1);break;case 2:$r$3(e,t,i,r,l,u,n,!1);break;default:u[n]=l[e]*r.x+l[t]*r.y+l[i]*r.z}}function Q$W(e,t,i,r,n,o){var a=e.position.values.length/3;if(-1!==n){var s=r[n],l=i[s];return-1===l?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}var Ba$4={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function jr$6(e){var t=e.geometry,i=t.attributes,r=i.position.values,n=e$28(i.normal)?i.normal.values:void 0,o=e$28(i.bitangent)?i.bitangent.values:void 0,a=e$28(i.tangent)?i.tangent.values:void 0,s=e$28(i.st)?i.st.values:void 0,l=e$28(i.extrudeDirection)?i.extrudeDirection.values:void 0,u=e$28(i.applyOffset)?i.applyOffset.values:void 0,c=t.indices,h=[];for(var d in i)i.hasOwnProperty(d)&&!Ba$4[d]&&e$28(i[d])&&h.push(d);var f,p,_,m,$=h.length,g=ur$7(t),v=ur$7(t),y=[];y.length=r.length/3;var x=[];for(x.length=r.length/3,m=0;m<y.length;++m)y[m]=-1,x[m]=-1;var b=c.length;for(m=0;m<b;m+=3){var w=c[m],C=c[m+1],T=c[m+2],S=t$X.fromArray(r,3*w),E=t$X.fromArray(r,3*C),A=t$X.fromArray(r,3*T),P=xa$4(S,E,A);if(e$28(P)&&P.positions.length>3)for(var I=P.positions,M=P.indices,O=M.length,D=0;D<O;++D){var R=M[D],L=I[R];L.y<0?(f=v.attributes,p=v.indices,_=y):(f=g.attributes,p=g.indices,_=x),Pr$4(w,C,T,L,r,n,a,o,s,l,u,f,h,$,i,Q$W(f,p,_,c,R<3?m+R:-1,L))}else e$28(P)&&(S=P.positions[0],E=P.positions[1],A=P.positions[2]),S.y<0?(f=v.attributes,p=v.indices,_=y):(f=g.attributes,p=g.indices,_=x),Pr$4(w,C,T,S,r,n,a,o,s,l,u,f,h,$,i,Q$W(f,p,_,c,m,S)),Pr$4(w,C,T,E,r,n,a,o,s,l,u,f,h,$,i,Q$W(f,p,_,c,m+1,E)),Pr$4(w,C,T,A,r,n,a,o,s,l,u,f,h,$,i,Q$W(f,p,_,c,m+2,A))}Br$3(e,v,g)}var ra$3=o$1i.fromPointNormal(t$X.ZERO,t$X.UNIT_Y),Fa$4=new t$X,ka$3=new t$X;function lr$7(e,t,i,r,n,o,a){if(e$28(a)){var s=t$X.fromArray(r,3*e,yr$4);t$X.equalsEpsilon(s,i,e$27.EPSILON10)?o.applyOffset.values[n]=a[e]:o.applyOffset.values[n]=a[t]}}function aa$3(e){var t,i=e.geometry,r=i.attributes,n=r.position.values,o=e$28(r.applyOffset)?r.applyOffset.values:void 0,a=i.indices,s=ur$7(i),l=ur$7(i),u=a.length,c=[];c.length=n.length/3;var h=[];for(h.length=n.length/3,t=0;t<c.length;++t)c[t]=-1,h[t]=-1;for(t=0;t<u;t+=2){var d=a[t],f=a[t+1],p=t$X.fromArray(n,3*d,yr$4),_=t$X.fromArray(n,3*f,kr$5);Math.abs(p.y)<e$27.EPSILON6&&(p.y<0?p.y=-e$27.EPSILON6:p.y=e$27.EPSILON6),Math.abs(_.y)<e$27.EPSILON6&&(_.y<0?_.y=-e$27.EPSILON6:_.y=e$27.EPSILON6);var m=s.attributes,$=s.indices,g=h,v=l.attributes,y=l.indices,x=c,b=g$10.lineSegmentPlane(p,_,ra$3,Ir$5);if(e$28(b)){var w=t$X.multiplyByScalar(t$X.UNIT_Y,5*e$27.EPSILON9,Fa$4);p.y<0&&(t$X.negate(w,w),m=l.attributes,$=l.indices,g=c,v=s.attributes,y=s.indices,x=h);var C=t$X.add(b,w,ka$3);lr$7(d,f,p,n,Q$W(m,$,g,a,t,p),m,o),lr$7(d,f,C,n,Q$W(m,$,g,a,-1,C),m,o),t$X.negate(w,w),t$X.add(b,w,C),lr$7(d,f,C,n,Q$W(v,y,x,a,-1,C),v,o),lr$7(d,f,_,n,Q$W(v,y,x,a,t+1,_),v,o)}else{var T,S,E;p.y<0?(T=l.attributes,S=l.indices,E=c):(T=s.attributes,S=s.indices,E=h),lr$7(d,f,p,n,Q$W(T,S,E,a,t,p),T,o),lr$7(d,f,_,n,Q$W(T,S,E,a,t+1,_),T,o)}}Br$3(e,l,s)}var ea$3=new o$1k,Ia$4=new o$1k,na$2=new t$X,va$3=new t$X,Cr$4=new t$X,Ca$3=new t$X,_a$4=new t$X,Ma$3=new t$X,ta$2=new t$X,ia$2=new e$25;function oa$2(e){for(var t=e.attributes,i=t.position.values,r=t.prevPosition.values,n=t.nextPosition.values,o=i.length,a=0;a<o;a+=3){var s=t$X.unpack(i,a,na$2);if(!(s.x>0)){var l=t$X.unpack(r,a,va$3);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(a-3>0?(r[a]=i[a-3],r[a+1]=i[a-2],r[a+2]=i[a-1]):t$X.pack(s,r,a));var u=t$X.unpack(n,a,Cr$4);(s.y<0&&u.y>0||s.y>0&&u.y<0)&&(a+3<o?(n[a]=i[a+3],n[a+1]=i[a+4],n[a+2]=i[a+5]):t$X.pack(s,n,a))}}}var Ua$5=5*e$27.EPSILON9,zr$6=e$27.EPSILON6;function Za$3(e){var t,i,r,n=e.geometry,o=n.attributes,a=o.position.values,s=o.prevPosition.values,l=o.nextPosition.values,u=o.expandAndWidth.values,c=e$28(o.st)?o.st.values:void 0,h=e$28(o.color)?o.color.values:void 0,d=e$28(o.dist)?o.dist.values:void 0,f=ur$7(n),p=ur$7(n),_=!1,m=a.length/3;for(t=0;t<m;t+=4){var $=t,g=t+2,v=t$X.fromArray(a,3*$,na$2),y=t$X.fromArray(a,3*g,va$3);if(Math.abs(v.y)<zr$6)for(v.y=zr$6*(y.y<0?-1:1),a[3*t+1]=v.y,a[3*(t+1)+1]=v.y,i=3*$;i<3*$+12;i+=3)s[i]=a[3*t],s[i+1]=a[3*t+1],s[i+2]=a[3*t+2];if(Math.abs(y.y)<zr$6)for(y.y=zr$6*(v.y<0?-1:1),a[3*(t+2)+1]=y.y,a[3*(t+3)+1]=y.y,i=3*$;i<3*$+12;i+=3)l[i]=a[3*(t+2)],l[i+1]=a[3*(t+2)+1],l[i+2]=a[3*(t+2)+2];var x=f.attributes,b=f.indices,w=p.attributes,C=p.indices,T=g$10.lineSegmentPlane(v,y,ra$3,Ca$3);if(e$28(T)){_=!0;var S=t$X.multiplyByScalar(t$X.UNIT_Y,Ua$5,_a$4);v.y<0&&(t$X.negate(S,S),x=p.attributes,b=p.indices,w=f.attributes,C=f.indices);var E=t$X.add(T,S,Ma$3);x.position.values.push(v.x,v.y,v.z,v.x,v.y,v.z),x.position.values.push(E.x,E.y,E.z),x.position.values.push(E.x,E.y,E.z),x.prevPosition.values.push(s[3*$],s[3*$+1],s[3*$+2]),x.prevPosition.values.push(s[3*$+3],s[3*$+4],s[3*$+5]),x.prevPosition.values.push(v.x,v.y,v.z,v.x,v.y,v.z),x.nextPosition.values.push(E.x,E.y,E.z),x.nextPosition.values.push(E.x,E.y,E.z),x.nextPosition.values.push(E.x,E.y,E.z),x.nextPosition.values.push(E.x,E.y,E.z),t$X.negate(S,S),t$X.add(T,S,E),w.position.values.push(E.x,E.y,E.z),w.position.values.push(E.x,E.y,E.z),w.position.values.push(y.x,y.y,y.z,y.x,y.y,y.z),w.prevPosition.values.push(E.x,E.y,E.z),w.prevPosition.values.push(E.x,E.y,E.z),w.prevPosition.values.push(E.x,E.y,E.z),w.prevPosition.values.push(E.x,E.y,E.z),w.nextPosition.values.push(y.x,y.y,y.z,y.x,y.y,y.z),w.nextPosition.values.push(l[3*g],l[3*g+1],l[3*g+2]),w.nextPosition.values.push(l[3*g+3],l[3*g+4],l[3*g+5]);var A=o$1k.fromArray(u,2*$,ea$3),P=Math.abs(A.y);x.expandAndWidth.values.push(-1,P,1,P),x.expandAndWidth.values.push(-1,-P,1,-P),w.expandAndWidth.values.push(-1,P,1,P),w.expandAndWidth.values.push(-1,-P,1,-P);var I=t$X.magnitudeSquared(t$X.subtract(T,v,Cr$4));if(I/=t$X.magnitudeSquared(t$X.subtract(y,v,Cr$4)),e$28(h)){var M=e$25.fromArray(h,4*$,ia$2),O=e$25.fromArray(h,4*g,ia$2),D=e$27.lerp(M.x,O.x,I),R=e$27.lerp(M.y,O.y,I),L=e$27.lerp(M.z,O.z,I),B=e$27.lerp(M.w,O.w,I);for(i=4*$;i<4*$+8;++i)x.color.values.push(h[i]);for(x.color.values.push(D,R,L,B),x.color.values.push(D,R,L,B),w.color.values.push(D,R,L,B),w.color.values.push(D,R,L,B),i=4*g;i<4*g+8;++i)w.color.values.push(h[i])}if(e$28(c)){var N=o$1k.fromArray(c,2*$,ea$3),F=o$1k.fromArray(c,2*(t+3),Ia$4),z=e$27.lerp(N.x,F.x,I);for(i=2*$;i<2*$+4;++i)x.st.values.push(c[i]);for(x.st.values.push(z,N.y),x.st.values.push(z,F.y),w.st.values.push(z,N.y),w.st.values.push(z,F.y),i=2*g;i<2*g+4;++i)w.st.values.push(c[i])}if(e$28(d)){var k=t$X.fromArray(d,3*$,ta$2),V=t$X.fromArray(d,3*g,ta$2),U=e$27.lerp(k.x,V.x,I);for(i=3*$;i<3*$+6;++i)x.dist.values.push(d[i]);for(x.dist.values.push(U,k.y,k.z),x.dist.values.push(U,k.y,k.z),w.dist.values.push(U,V.y,V.z),w.dist.values.push(U,V.y,V.z),i=3*g;i<3*g+6;++i)w.dist.values.push(d[i])}r=x.position.values.length/3-4,b.push(r,r+2,r+1),b.push(r+1,r+2,r+3),r=w.position.values.length/3-4,C.push(r,r+2,r+1),C.push(r+1,r+2,r+3)}else{var X,H;for(v.y<0?(X=p.attributes,H=p.indices):(X=f.attributes,H=f.indices),X.position.values.push(v.x,v.y,v.z),X.position.values.push(v.x,v.y,v.z),X.position.values.push(y.x,y.y,y.z),X.position.values.push(y.x,y.y,y.z),i=3*t;i<3*t+12;++i)X.prevPosition.values.push(s[i]),X.nextPosition.values.push(l[i]);for(i=2*t;i<2*t+8;++i)X.expandAndWidth.values.push(u[i]),e$28(c)&&X.st.values.push(c[i]);if(e$28(h))for(i=4*t;i<4*t+16;++i)X.color.values.push(h[i]);if(e$28(d))for(i=3*t;i<3*t+12;++i)X.dist.values.push(d[i]);r=X.position.values.length/3-4,H.push(r,r+2,r+1),H.push(r+1,r+2,r+3)}}_&&(oa$2(p),oa$2(f)),Br$3(e,p,f)}k$Z.splitLongitude=function(e){if(!e$28(e))throw new t$Z("instance is required.");var t=e.geometry,i=t.boundingSphere;if(e$28(i)&&(i.center.x-i.radius>0||i$19.intersectPlane(i,o$1i.ORIGIN_ZX_PLANE)!==pt$a.INTERSECTING))return e;if(t.geometryType!==Me$r.NONE)switch(t.geometryType){case Me$r.POLYLINES:Za$3(e);break;case Me$r.TRIANGLES:jr$6(e);break;case Me$r.LINES:aa$3(e)}else Na$4(t),t.primitiveType===W$_.TRIANGLES?jr$6(e):t.primitiveType===W$_.LINES&&aa$3(e);return e};var te$H=new t$X,xe$s=new t$X,pe$B=new t$X,Me$q=new t$X,p$X=new o$1k,Te$p=new p$1a,Ye$f=new p$1a,_e$r=new n$14,Ee$m=new t$X,Ne$e=new t$X,Fe$i=new t$X,le$w=new t$W,Se$g=new t$X,Oe$m=new o$1k,Ce$n=new o$1k;function Pe$l(e,t,i){var r=t.vertexFormat,n=t.center,o=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,l=t.stRotation,u=i?e.length/3*2:e.length/3,c=t.shadowVolume,h=r.st?new Float32Array(2*u):void 0,d=r.normal?new Float32Array(3*u):void 0,f=r.tangent?new Float32Array(3*u):void 0,p=r.bitangent?new Float32Array(3*u):void 0,_=c?new Float32Array(3*u):void 0,m=0,$=Ee$m,g=Ne$e,v=Fe$i,y=new n$1b(s),x=y.project(s.cartesianToCartographic(n,le$w),Se$g),b=s.scaleToGeodeticSurface(n,te$H);s.geodeticSurfaceNormal(b,b);var w=Te$p,C=Ye$f;if(0!==l){var T=n$14.fromAxisAngle(b,l,_e$r);w=p$1a.fromQuaternion(T,w),T=n$14.fromAxisAngle(b,-l,_e$r),C=p$1a.fromQuaternion(T,C)}else w=p$1a.clone(p$1a.IDENTITY,w),C=p$1a.clone(p$1a.IDENTITY,C);for(var S=o$1k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Oe$m),E=o$1k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ce$n),A=e.length,P=i?A:0,I=P/3*2,M=0;M<A;M+=3){var O=M+1,D=M+2,R=t$X.fromArray(e,M,te$H);if(r.st){var L=p$1a.multiplyByVector(w,R,xe$s),B=y.project(s.cartesianToCartographic(L,le$w),pe$B);t$X.subtract(B,x,B),p$X.x=(B.x+o)/(2*o),p$X.y=(B.y+a)/(2*a),S.x=Math.min(p$X.x,S.x),S.y=Math.min(p$X.y,S.y),E.x=Math.max(p$X.x,E.x),E.y=Math.max(p$X.y,E.y),i&&(h[m+I]=p$X.x,h[m+1+I]=p$X.y),h[m++]=p$X.x,h[m++]=p$X.y}(r.normal||r.tangent||r.bitangent||c)&&($=s.geodeticSurfaceNormal(R,$),c&&(_[M+P]=-$.x,_[O+P]=-$.y,_[D+P]=-$.z),(r.normal||r.tangent||r.bitangent)&&((r.tangent||r.bitangent)&&(g=t$X.normalize(t$X.cross(t$X.UNIT_Z,$,g),g),p$1a.multiplyByVector(C,g,g)),r.normal&&(d[M]=$.x,d[O]=$.y,d[D]=$.z,i&&(d[M+P]=-$.x,d[O+P]=-$.y,d[D+P]=-$.z)),r.tangent&&(f[M]=g.x,f[O]=g.y,f[D]=g.z,i&&(f[M+P]=-g.x,f[O+P]=-g.y,f[D+P]=-g.z)),r.bitangent&&(v=t$X.normalize(t$X.cross($,g,v),v),p[M]=v.x,p[O]=v.y,p[D]=v.z,i&&(p[M+P]=v.x,p[O+P]=v.y,p[D+P]=v.z))))}if(r.st){A=h.length;for(var N=0;N<A;N+=2)h[N]=(h[N]-S.x)/(E.x-S.x),h[N+1]=(h[N+1]-S.y)/(E.y-S.y)}var F=new a$_;if(r.position){var z=C$Q.raisePositionsToHeight(e,t,i);F.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:z})}if(r.st&&(F.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:h})),r.normal&&(F.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(F.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:f})),r.bitangent&&(F.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:p})),c&&(F.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:_})),i&&e$28(t.offsetAttribute)){var k=new Uint8Array(u);if(t.offsetAttribute===ee$C.TOP)k=d$1a(k,1,0,u/2);else k=d$1a(k,t.offsetAttribute===ee$C.NONE?0:1);F.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return F}function Ie$p(e){var t,i,r,n,o,a=new Array(e*(e+1)*12-6),s=0;for(t=0,r=1,n=0;n<3;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;n<e+1;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;n<i-1;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}var $$T=new t$X;function ke$f(e){var t=e.center;$$T=t$X.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$$T),e.height,$$T);var i=new i$19($$T=t$X.add(t,$$T,$$T),e.semiMajorAxis),r=C$Q.computeEllipsePositions(e,!0,!1),n=r.positions,o=r.numPts,a=Pe$l(n,e,!1),s=Ie$p(o);return{boundingSphere:i,attributes:a,indices:s=ce$v.createTypedArray(n.length/3,s)}}function Ue$n(e,t){var i=t.vertexFormat,r=t.center,n=t.semiMajorAxis,o=t.semiMinorAxis,a=t.ellipsoid,s=t.height,l=t.extrudedHeight,u=t.stRotation,c=e.length/3*2,h=new Float64Array(3*c),d=i.st?new Float32Array(2*c):void 0,f=i.normal?new Float32Array(3*c):void 0,p=i.tangent?new Float32Array(3*c):void 0,_=i.bitangent?new Float32Array(3*c):void 0,m=t.shadowVolume,$=m?new Float32Array(3*c):void 0,g=0,v=Ee$m,y=Ne$e,x=Fe$i,b=new n$1b(a),w=b.project(a.cartesianToCartographic(r,le$w),Se$g),C=a.scaleToGeodeticSurface(r,te$H);a.geodeticSurfaceNormal(C,C);for(var T=n$14.fromAxisAngle(C,u,_e$r),S=p$1a.fromQuaternion(T,Te$p),E=o$1k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Oe$m),A=o$1k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ce$n),P=e.length,I=P/3*2,M=0;M<P;M+=3){var O,D=M+1,R=M+2,L=t$X.fromArray(e,M,te$H);if(i.st){var B=p$1a.multiplyByVector(S,L,xe$s),N=b.project(a.cartesianToCartographic(B,le$w),pe$B);t$X.subtract(N,w,N),p$X.x=(N.x+n)/(2*n),p$X.y=(N.y+o)/(2*o),E.x=Math.min(p$X.x,E.x),E.y=Math.min(p$X.y,E.y),A.x=Math.max(p$X.x,A.x),A.y=Math.max(p$X.y,A.y),d[g+I]=p$X.x,d[g+1+I]=p$X.y,d[g++]=p$X.x,d[g++]=p$X.y}L=a.scaleToGeodeticSurface(L,L),O=t$X.clone(L,xe$s),v=a.geodeticSurfaceNormal(L,v),m&&($[M+P]=-v.x,$[D+P]=-v.y,$[R+P]=-v.z);var F=t$X.multiplyByScalar(v,s,Me$q);if(L=t$X.add(L,F,L),F=t$X.multiplyByScalar(v,l,F),O=t$X.add(O,F,O),i.position&&(h[M+P]=O.x,h[D+P]=O.y,h[R+P]=O.z,h[M]=L.x,h[D]=L.y,h[R]=L.z),i.normal||i.tangent||i.bitangent){x=t$X.clone(v,x);var z=t$X.fromArray(e,(M+3)%P,Me$q);t$X.subtract(z,L,z);var k=t$X.subtract(O,L,pe$B);v=t$X.normalize(t$X.cross(k,z,v),v),i.normal&&(f[M]=v.x,f[D]=v.y,f[R]=v.z,f[M+P]=v.x,f[D+P]=v.y,f[R+P]=v.z),i.tangent&&(y=t$X.normalize(t$X.cross(x,v,y),y),p[M]=y.x,p[D]=y.y,p[R]=y.z,p[M+P]=y.x,p[M+1+P]=y.y,p[M+2+P]=y.z),i.bitangent&&(_[M]=x.x,_[D]=x.y,_[R]=x.z,_[M+P]=x.x,_[D+P]=x.y,_[R+P]=x.z)}}if(i.st){P=d.length;for(var V=0;V<P;V+=2)d[V]=(d[V]-E.x)/(A.x-E.x),d[V+1]=(d[V+1]-E.y)/(A.y-E.y)}var U=new a$_;if(i.position&&(U.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:h})),i.st&&(U.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(U.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:f})),i.tangent&&(U.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:p})),i.bitangent&&(U.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:_})),m&&(U.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:$})),e$28(t.offsetAttribute)){var X=new Uint8Array(c);if(t.offsetAttribute===ee$C.TOP)X=d$1a(X,1,0,c/2);else X=d$1a(X,t.offsetAttribute===ee$C.NONE?0:1);U.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:X})}return U}function We$k(e){for(var t=e.length/3,i=ce$v.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}var de$w=new i$19,Ae$p=new i$19;function qe$h(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=t$X.multiplyByScalar(i.geodeticSurfaceNormal(t,te$H),e.height,te$H);de$w.center=t$X.add(t,n,de$w.center),de$w.radius=r,n=t$X.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),Ae$p.center=t$X.add(t,n,Ae$p.center),Ae$p.radius=r;var o=C$Q.computeEllipsePositions(e,!0,!0),a=o.positions,s=o.numPts,l=o.outerPositions,u=i$19.union(de$w,Ae$p),c=Pe$l(a,e,!0),h=Ie$p(s),d=h.length;h.length=2*d;for(var f=a.length/3,p=0;p<d;p+=3)h[p+d]=h[p+2]+f,h[p+1+d]=h[p+1]+f,h[p+2+d]=h[p]+f;var _=new I$1n({attributes:c,indices:ce$v.createTypedArray(2*f/3,h),primitiveType:W$_.TRIANGLES}),m=Ue$n(l,e);h=We$k(l);var $=new I$1n({attributes:m,indices:ce$v.createTypedArray(2*l.length/3,h),primitiveType:W$_.TRIANGLES}),g=k$Z.combineInstances([new d$15({geometry:_}),new d$15({geometry:$})]);return{boundingSphere:u,attributes:g[0].attributes,indices:g[0].indices}}function Re$m(e,t,i,r,n,o,a){for(var s=C$Q.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:i,rotation:r,granularity:n},!1,!0).outerPositions,l=s.length/3,u=new Array(l),c=0;c<l;++c)u[c]=t$X.fromArray(s,3*c);var h=h$10.fromCartesianArray(u,o,a);return h.width>e$27.PI&&(h.north=h.north>0?e$27.PI_OVER_TWO-e$27.EPSILON7:h.north,h.south=h.south<0?e$27.EPSILON7-e$27.PI_OVER_TWO:h.south,h.east=e$27.PI,h.west=-e$27.PI),h}function Y$K(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).center,i=u$Y(e.ellipsoid,t$V.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,o=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),a=u$Y(e.vertexFormat,n$10.DEFAULT);if(o$1u.defined("options.center",t),o$1u.typeOf.number("options.semiMajorAxis",r),o$1u.typeOf.number("options.semiMinorAxis",n),r<n)throw new t$Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new t$Z("granularity must be greater than zero.");var s=u$Y(e.height,0),l=u$Y(e.extrudedHeight,s);this._center=t$X.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=t$V.clone(i),this._rotation=u$Y(e.rotation,0),this._stRotation=u$Y(e.stRotation,0),this._height=Math.max(l,s),this._granularity=o,this._vertexFormat=n$10.clone(a),this._extrudedHeight=Math.min(l,s),this._shadowVolume=u$Y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Y$K.packedLength=t$X.packedLength+t$V.packedLength+n$10.packedLength+9,Y$K.pack=function(e,t,i){return o$1u.defined("value",e),o$1u.defined("array",t),i=u$Y(i,0),t$X.pack(e._center,t,i),i+=t$X.packedLength,t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=u$Y(e._offsetAttribute,-1),t};var je$i=new t$X,De$p=new t$V,Ve$k=new n$10,k$Y={center:je$i,ellipsoid:De$p,vertexFormat:Ve$k,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};function Qe$e(e){var t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];for(var i=C$Q.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,n=new Array(r),o=0;o<r;++o)n[o]=t$X.fromArray(i,3*o);var a=e._ellipsoid,s=e.rectangle;return I$1n._textureCoordinateRotationPoints(n,t,a,s)}function n$V(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).radius;o$1u.typeOf.number("radius",t);var i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Y$K(i),this._workerName="createCircleGeometry"}Y$K.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=t$X.unpack(e,t,je$i);t+=t$X.packedLength;var n=t$V.unpack(e,t,De$p);t+=t$V.packedLength;var o=n$10.unpack(e,t,Ve$k);t+=n$10.packedLength;var a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t++],f=1===e[t++],p=e[t];return e$28(i)?(i._center=t$X.clone(r,i._center),i._ellipsoid=t$V.clone(n,i._ellipsoid),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._semiMajorAxis=a,i._semiMinorAxis=s,i._rotation=l,i._stRotation=u,i._height=c,i._granularity=h,i._extrudedHeight=d,i._shadowVolume=f,i._offsetAttribute=-1===p?void 0:p,i):(k$Y.height=c,k$Y.extrudedHeight=d,k$Y.granularity=h,k$Y.stRotation=u,k$Y.rotation=l,k$Y.semiMajorAxis=a,k$Y.semiMinorAxis=s,k$Y.shadowVolume=f,k$Y.offsetAttribute=-1===p?void 0:p,new Y$K(k$Y))},Y$K.computeRectangle=function(e,t){var i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).center,r=u$Y(e.ellipsoid,t$V.WGS84),n=e.semiMajorAxis,o=e.semiMinorAxis,a=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),s=u$Y(e.rotation,0);if(o$1u.defined("options.center",i),o$1u.typeOf.number("options.semiMajorAxis",n),o$1u.typeOf.number("options.semiMinorAxis",o),n<o)throw new t$Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(a<=0)throw new t$Z("granularity must be greater than zero.");return Re$m(i,n,o,s,a,r,t)},Y$K.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!e$27.equalsEpsilon(t,i,0,e$27.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};if(r)o.extrudedHeight=i,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,n=qe$h(o);else if(n=ke$f(o),e$28(e._offsetAttribute)){var a=n.attributes.position.values.length,s=new Uint8Array(a/3);d$1a(s,e._offsetAttribute===ee$C.NONE?0:1),n.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new I$1n({attributes:n.attributes,indices:n.indices,primitiveType:W$_.TRIANGLES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},Y$K.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new Y$K({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:n$10.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(Y$K.prototype,{rectangle:{get:function(){return e$28(this._rectangle)||(this._rectangle=Re$m(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e$28(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Qe$e(this)),this._textureCoordinateRotationPoints}}}),n$V.packedLength=Y$K.packedLength,n$V.pack=function(e,t,i){return o$1u.typeOf.object("value",e),Y$K.pack(e._ellipseGeometry,t,i)};var x$_=new Y$K({center:new t$X,semiMajorAxis:1,semiMinorAxis:1}),t$I={center:new t$X,radius:void 0,ellipsoid:t$V.clone(t$V.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new n$10,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};n$V.unpack=function(e,t,i){var r=Y$K.unpack(e,t,x$_);return t$I.center=t$X.clone(r._center,t$I.center),t$I.ellipsoid=t$V.clone(r._ellipsoid,t$I.ellipsoid),t$I.height=r._height,t$I.extrudedHeight=r._extrudedHeight,t$I.granularity=r._granularity,t$I.vertexFormat=n$10.clone(r._vertexFormat,t$I.vertexFormat),t$I.stRotation=r._stRotation,t$I.shadowVolume=r._shadowVolume,e$28(i)?(t$I.semiMajorAxis=r._semiMajorAxis,t$I.semiMinorAxis=r._semiMinorAxis,i._ellipseGeometry=new Y$K(t$I),i):(t$I.radius=r._semiMajorAxis,new n$V(t$I))},n$V.createGeometry=function(e){return Y$K.createGeometry(e._ellipseGeometry)},n$V.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new n$V({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:n$10.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(n$V.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var B$N=new t$X,g$O=new t$X;function F$$(e){var t=e.center;g$O=t$X.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,g$O),e.height,g$O);var i=new i$19(g$O=t$X.add(t,g$O,g$O),e.semiMajorAxis),r=C$Q.computeEllipsePositions(e,!1,!0).outerPositions;r.push(r[0],r[1],r[2]);var n=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:C$Q.raisePositionsToHeight(r,e,!1)})});n.sideness=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:new Float32Array([0,0,0,1,1,1,1,0])}),n.sideness.isInstanceAttribute=!0;for(var o=r.length/3,a=ce$v.createTypedArray(o,2*o),s=0,l=0;l<o;++l)a[s++]=l,a[s++]=(l+1)%o;return{boundingSphere:i,attributes:n,indices:a}}var N$K=new i$19,j$_=new i$19;function Y$J(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=t$X.multiplyByScalar(i.geodeticSurfaceNormal(t,B$N),e.height,B$N);N$K.center=t$X.add(t,n,N$K.center),N$K.radius=r,n=t$X.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),j$_.center=t$X.add(t,n,j$_.center),j$_.radius=r;var o=C$Q.computeEllipsePositions(e,!1,!0).outerPositions,a=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:C$Q.raisePositionsToHeight(o,e,!0)})});o=a.position.values;var s=i$19.union(N$K,j$_),l=o.length/3;if(e$28(e.offsetAttribute)){var u=new Uint8Array(l);if(e.offsetAttribute===ee$C.TOP)u=d$1a(u,1,0,l/2);else u=d$1a(u,e.offsetAttribute===ee$C.NONE?0:1);a.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}var c=u$Y(e.numberOfVerticalLines,16);c=e$27.clamp(c,0,l/2);var h=ce$v.createTypedArray(l,2*l+2*c);l/=2;var d,f,p=0;for(d=0;d<l;++d)h[p++]=d,h[p++]=(d+1)%l,h[p++]=d+l,h[p++]=(d+1)%l+l;if(c>0){var _=Math.min(c,l);f=Math.round(l/_);var m=Math.min(f*c,l);for(d=0;d<m;d+=f)h[p++]=d,h[p++]=d+l}return{boundingSphere:s,attributes:a,indices:h}}function M$W(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).center,i=u$Y(e.ellipsoid,t$V.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,o=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE);if(!e$28(t))throw new t$Z("center is required.");if(!e$28(r))throw new t$Z("semiMajorAxis is required.");if(!e$28(n))throw new t$Z("semiMinorAxis is required.");if(r<n)throw new t$Z("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(o<=0)throw new t$Z("granularity must be greater than zero.");var a=u$Y(e.height,0),s=u$Y(e.extrudedHeight,a);this._center=t$X.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=t$V.clone(i),this._rotation=u$Y(e.rotation,0),this._height=Math.max(s,a),this._granularity=o,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(u$Y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._outlineWidth=u$Y(e.outlineWidth,1),this._workerName="createEllipseOutlineGeometry"}M$W.packedLength=t$X.packedLength+t$V.packedLength+9,M$W.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t$X.pack(e._center,t,i),i+=t$X.packedLength,t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i++]=u$Y(e._offsetAttribute,-1),t[i]=e._outlineWidth,t};var W$R=new t$X,q$$=new t$V,m$V={center:W$R,ellipsoid:q$$,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0,outlineWidth:void 0};function a$W(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).radius;o$1u.typeOf.number("radius",t);var i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new M$W(i),this._workerName="createCircleOutlineGeometry"}M$W.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r=t$X.unpack(e,t,W$R);t+=t$X.packedLength;var n=t$V.unpack(e,t,q$$);t+=t$V.packedLength;var o=e[t++],a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t++],f=e[t];return e$28(i)?(i._center=t$X.clone(r,i._center),i._ellipsoid=t$V.clone(n,i._ellipsoid),i._semiMajorAxis=o,i._semiMinorAxis=a,i._rotation=s,i._height=l,i._granularity=u,i._extrudedHeight=c,i._numberOfVerticalLines=h,i._offsetAttribute=-1===d?void 0:d,i._outlineWidth=f,i):(m$V.height=l,m$V.extrudedHeight=c,m$V.granularity=u,m$V.rotation=s,m$V.semiMajorAxis=o,m$V.semiMinorAxis=a,m$V.numberOfVerticalLines=h,m$V.offsetAttribute=-1===d?void 0:d,m$V.outlineWidth=f,new M$W(m$V))},M$W.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!e$27.equalsEpsilon(t,i,0,e$27.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,outlineWidth:e._outlineWidth,numberOfVerticalLines:e._numberOfVerticalLines};if(r)o.extrudedHeight=i,o.offsetAttribute=e._offsetAttribute,n=Y$J(o);else if(n=F$$(o),e$28(e._offsetAttribute)){var a=n.attributes.position.values.length,s=new Uint8Array(a/3);d$1a(s,e._offsetAttribute===ee$C.NONE?0:1),n.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new I$1n({attributes:n.attributes,indices:n.indices,primitiveType:r?W$_.LINES:W$_.TRIANGLES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},a$W.packedLength=M$W.packedLength,a$W.pack=function(e,t,i){return o$1u.typeOf.object("value",e),M$W.pack(e._ellipseGeometry,t,i)};var c$Y=new M$W({center:new t$X,semiMajorAxis:1,semiMinorAxis:1}),i$P={center:new t$X,radius:void 0,ellipsoid:t$V.clone(t$V.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};a$W.unpack=function(e,t,i){var r=M$W.unpack(e,t,c$Y);return i$P.center=t$X.clone(r._center,i$P.center),i$P.ellipsoid=t$V.clone(r._ellipsoid,i$P.ellipsoid),i$P.height=r._height,i$P.extrudedHeight=r._extrudedHeight,i$P.granularity=r._granularity,i$P.numberOfVerticalLines=r._numberOfVerticalLines,e$28(i)?(i$P.semiMajorAxis=r._semiMajorAxis,i$P.semiMinorAxis=r._semiMinorAxis,i._ellipseGeometry=new M$W(i$P),i):(i$P.radius=r._semiMajorAxis,new a$W(i$P))},a$W.createGeometry=function(e){return M$W.createGeometry(e._ellipseGeometry)};var e$1A={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},tt$f=Object.freeze(e$1A),e$1z={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},g$N=Object.freeze(e$1z);function u$M(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).currentTime,i=e.startTime,r=e.stopTime;if(t=e$28(t)?a$12.clone(t):e$28(i)?a$12.clone(i):e$28(r)?a$12.addDays(r,-1,new a$12):a$12.now(),i=e$28(i)?a$12.clone(i):a$12.clone(t),r=e$28(r)?a$12.clone(r):a$12.addDays(i,1,new a$12),a$12.greaterThan(i,r))throw new t$Z("startTime must come before stopTime.");this.startTime=i,this.stopTime=r,this.clockRange=u$Y(e.clockRange,tt$f.UNBOUNDED),this.canAnimate=u$Y(e.canAnimate,!0),this.onTick=new o$1o,this.onStop=new o$1o,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=kt$7(),this.currentTime=t,this.multiplier=u$Y(e.multiplier,1),this.shouldAnimate=u$Y(e.shouldAnimate,!1),this.clockStep=u$Y(e.clockStep,g$N.SYSTEM_CLOCK_MULTIPLIER)}function o$18(e,t,i,r){e=u$Y(e,1),t=u$Y(t,1),i=u$Y(i,1),r=u$Y(r,1),this.value=new Uint8Array([e$1S.floatToByte(e),e$1S.floatToByte(t),e$1S.floatToByte(i),e$1S.floatToByte(r)])}function i$O(){this._dictTable=new e$1P,this._imageBuffer=new Uint8Array(262144),this._sortKey=[]}function d$14(e,t){return e-t}function e$1y(e,t,i,r,n){this._format=e,this._width=t,this._height=i,this._buffer=r,this._datatype=n}Object.defineProperties(u$M.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){a$12.equals(this._currentTime,e)||(this._clockStep===g$N.SYSTEM_CLOCK&&(this._clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===g$N.SYSTEM_CLOCK&&(this._clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===g$N.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=a$12.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===g$N.SYSTEM_CLOCK&&(this._clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u$M.prototype.tick=function(){var e=kt$7(),t=a$12.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var i=this._clockStep;if(i===g$N.SYSTEM_CLOCK)t=a$12.now(t);else{var r=this._multiplier;if(i===g$N.TICK_DEPENDENT)t=a$12.addSeconds(t,r,t);else{var n=e-this._lastSystemTime;t=a$12.addSeconds(t,r*(n/1e3),t)}var o=this.clockRange,a=this.startTime,s=this.stopTime;if(o===tt$f.CLAMPED)a$12.lessThan(t,a)?t=a$12.clone(a,t):a$12.greaterThan(t,s)&&(t=a$12.clone(s,t),this.onStop.raiseEvent(this));else if(o===tt$f.LOOP_STOP)for(a$12.lessThan(t,a)&&(t=a$12.clone(a,t));a$12.greaterThan(t,s);)t=a$12.addSeconds(a,a$12.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t},Object.defineProperties(o$18.prototype,{componentDatatype:{get:function(){return S$W.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),o$18.fromColor=function(e){if(!e$28(e))throw new t$Z("color is required.");return new o$18(e.red,e.green,e.blue,e.alpha)},o$18.toValue=function(e,t){if(!e$28(e))throw new t$Z("color is required.");return e$28(t)?e.toBytes(t):new Uint8Array(e.toBytes())},o$18.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},i$O.prototype.destroy=function(){this._dictTable.removeAll(),this._imageBuffer=null,this._sortKey=null},i$O.prototype.getItem=function(e){if(e>this._dictTable.values.length-1)return null;var t=[];for(var i in this._dictTable._hash)t.push(parseFloat(i));t.sort(d$14);var r=t[e];return e$28(r)?{altitude:r,color:this._dictTable.get(r)}:null},i$O.prototype.count=function(){return this._dictTable.values.length},i$O.prototype.insert=function(e,t){if(!e$28(this._dictTable.get(e))){var i=e$1S.clone(t,i);this._dictTable.set(e,i)}},i$O.prototype.remove=function(e){return this._dictTable.remove(e)},i$O.prototype.clear=function(){this._dictTable.values.length=0},i$O.clone=function(e,t){if(e$28(e)){e$28(t)||(t=new i$O),e$1P.clone(e._dictTable,t._dictTable);for(var i=0;i<e._imageBuffer.length;i++)t._imageBuffer[i]=e._imageBuffer[i];return t}},i$O.prototype.generateBuffer=function(){var e=[],t=0;for(var i in this._dictTable._hash)if(e$28(i)){var r=this._dictTable.get(i);e[t++]={value:parseFloat(i),color:r}}if(!(e.length<2)){for(t=0;t<e.length-1;t++)for(var n=e[t],o=t+1;o<e.length;o++){var a=e[o];if(n.value>a.value){var s=l$1e(e[t],!0);e[t]=l$1e(e[o],!0),e[o]=s,n=e[t]}}var l=e[0].value,u=e[e.length-1].value-l,c=document.createElement("canvas");c.width=16384,c.height=1;var h=c.getContext("2d");h.beginPath();var d=h.createLinearGradient(0,0,16384,0);for(t=0;t<e.length;t++)d.addColorStop((e[t].value-l)/u,e[t].color.toCssColorString());h.fillStyle=d,h.rect(0,0,c.width,c.height),h.fill();var f=h.getImageData(0,0,c.width,1).data;for(o=0;o<16;o++)for(t=0;t<4096;t++)this._imageBuffer[t+1024*o*4*4]=f[t+1024*o*4],this._imageBuffer[t+1024*o*4*4+4096]=f[t+1024*o*4],this._imageBuffer[t+1024*o*4*4+8192]=f[t+1024*o*4],this._imageBuffer[t+1024*o*4*4+12288]=f[t+1024*o*4];for(var i in this._dictTable._hash)this._sortKey.push(parseFloat(i));return this._sortKey.sort(d$14),c}},i$O.prototype.getColor=function(e){for(var t=0;t<this._sortKey.length;t++)if(this._sortKey[t]>=e||Math.abs(this._sortKey[t]-e)<e$27.EPSILON6)return this._dictTable.get(this._sortKey[t])},Object.defineProperties(e$1y.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},pixelDatatype:{get:function(){return this._datatype}}}),e$1y.clone=function(e){if(e$28(e))return new e$1y(e._format,e._width,e._height,e._buffer,e._datatype)},e$1y.prototype.clone=function(){return e$1y.clone(this)};var g$M={},B$M=new t$X,C$P=new t$X,y$R=new t$X,P$Y=new t$X,M$V=new x$13;function w$G(e,t,i,r,n){var o=t$X.subtract(e,t,B$M),a=t$X.dot(i,o),s=t$X.dot(r,o);return o$1k.fromElements(a,s,n)}function r$_(){this._array=[],this._offset=0,this._length=0}g$M.validOutline=function(e){o$1u.defined("positions",e);var t=x$13.fromPoints(e,M$V).halfAxes,i=p$1a.getColumn(t,0,C$P),r=p$1a.getColumn(t,1,y$R),n=p$1a.getColumn(t,2,P$Y),o=t$X.magnitude(i),a=t$X.magnitude(r),s=t$X.magnitude(n);return!(0===o&&(0===a||0===s)||0===a&&0===s)},g$M.computeProjectTo2DArguments=function(e,t,i,r){o$1u.defined("positions",e),o$1u.defined("centerResult",t),o$1u.defined("planeAxis1Result",i),o$1u.defined("planeAxis2Result",r);var n,o,a=x$13.fromPoints(e,M$V),s=a.halfAxes,l=p$1a.getColumn(s,0,C$P),u=p$1a.getColumn(s,1,y$R),c=p$1a.getColumn(s,2,P$Y),h=t$X.magnitude(l),d=t$X.magnitude(u),f=t$X.magnitude(c),p=Math.min(h,d,f);return(0!==h||0!==d&&0!==f)&&(0!==d||0!==f)&&((p===d||p===f)&&(n=l),p===h?n=u:p===f&&(o=u),(p===h||p===d)&&(o=c),t$X.normalize(n,i),t$X.normalize(o,r),t$X.clone(a.center,t),!0)},g$M.createProjectPointsTo2DFunction=function(e,t,i){return function(r){for(var n=new Array(r.length),o=0;o<r.length;o++)n[o]=w$G(r[o],e,t,i);return n}},g$M.createProjectPointTo2DFunction=function(e,t,i){return function(r,n){return w$G(r,e,t,i,n)}},Object.defineProperties(r$_.prototype,{length:{get:function(){return this._length}}}),r$_.prototype.enqueue=function(e){this._array.push(e),this._length++},r$_.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,++t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},r$_.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},r$_.prototype.contains=function(e){return-1!==this._array.indexOf(e)},r$_.prototype.clear=function(){this._array.length=this._offset=this._length=0},r$_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var y$Q={computeHierarchyPackedLength:function(e){for(var t=0,i=[e];i.length>0;){var r=i.pop();if(e$28(r)){t+=2;var n=r.positions,o=r.holes;if(e$28(n)&&(t+=n.length*t$X.packedLength),e$28(o))for(var a=o.length,s=0;s<a;++s)i.push(o[s])}}return t},packPolygonHierarchy:function(e,t,i){for(var r=[e];r.length>0;){var n=r.pop();if(e$28(n)){var o=n.positions,a=n.holes;if(t[i++]=e$28(o)?o.length:0,t[i++]=e$28(a)?a.length:0,e$28(o))for(var s=o.length,l=0;l<s;++l,i+=3)t$X.pack(o[l],t,i);if(e$28(a))for(var u=a.length,c=0;c<u;++c)r.push(a[c])}}return i},unpackPolygonHierarchy:function(e,t){for(var i=e[t++],r=e[t++],n=new Array(i),o=r>0?new Array(r):void 0,a=0;a<i;++a,t+=t$X.packedLength)n[a]=t$X.unpack(e,t);for(var s=0;s<r;++s)o[s]=y$Q.unpackPolygonHierarchy(e,t),t=o[s].startingIndex,delete o[s].startingIndex;return{positions:n,holes:o,startingIndex:t}}},T$N=new t$X;function P$X(e,t,i,r){return t$X.subtract(t,e,T$N),t$X.multiplyByScalar(T$N,i/r,T$N),t$X.add(e,T$N,T$N),[T$N.x,T$N.y,T$N.z]}y$Q.subdivideLineCount=function(e,t,i){var r=t$X.distance(e,t)/i,n=Math.max(0,Math.ceil(e$27.log2(r)));return Math.pow(2,n)};var _$P=new t$W,Q$V=new t$W,j$Z=new t$W,rr$c=new t$X;y$Q.subdivideRhumbLineCount=function(e,t,i,r){var n=new P$17(e.cartesianToCartographic(t,_$P),e.cartesianToCartographic(i,Q$V),e).surfaceDistance/r,o=Math.max(0,Math.ceil(e$27.log2(n)));return Math.pow(2,o)},y$Q.subdivideLine=function(e,t,i,r){var n=y$Q.subdivideLineCount(e,t,i),o=t$X.distance(e,t),a=o/n;e$28(r)||(r=[]);var s=r;s.length=3*n;for(var l=0,u=0;u<n;u++){var c=P$X(e,t,u*a,o);s[l++]=c[0],s[l++]=c[1],s[l++]=c[2]}return s},y$Q.subdivideRhumbLine=function(e,t,i,r,n){var o=new P$17(e.cartesianToCartographic(t,_$P),e.cartesianToCartographic(i,Q$V),e),a=o.surfaceDistance/r,s=Math.max(0,Math.ceil(e$27.log2(a))),l=Math.pow(2,s),u=o.surfaceDistance/l;e$28(n)||(n=[]);var c=n;c.length=3*l;for(var h=0,d=0;d<l;d++){var f=o.interpolateUsingSurfaceDistance(d*u,j$Z),p=e.cartographicToCartesian(f,rr$c);c[h++]=p.x,c[h++]=p.y,c[h++]=p.z}return c};var ar$b=new t$X,er$d=new t$X,tr$a=new t$X,nr$a=new t$X;y$Q.scaleToGeodeticHeightExtruded=function(e,t,i,r,n){r=u$Y(r,t$V.WGS84);var o=ar$b,a=er$d,s=tr$a,l=nr$a;if(e$28(e)&&e$28(e.attributes)&&e$28(e.attributes.position))for(var u=e.attributes.position.values,c=u.length/2,h=0;h<c;h+=3)t$X.fromArray(u,h,s),r.geodeticSurfaceNormal(s,o),l=r.scaleToGeodeticSurface(s,l),a=t$X.multiplyByScalar(o,i,a),a=t$X.add(l,a,a),u[h+c]=a.x,u[h+1+c]=a.y,u[h+2+c]=a.z,n&&(l=t$X.clone(s,l)),a=t$X.multiplyByScalar(o,t,a),a=t$X.add(l,a,a),u[h]=a.x,u[h+1]=a.y,u[h+2]=a.z;return e},y$Q.polygonOutlinesFromHierarchy=function(e,t,i){var r,n,o,a=[],s=new r$_;for(s.enqueue(e);0!==s.length;){var l=s.dequeue(),u=l.positions;if(t)for(o=u.length,r=0;r<o;r++)i.scaleToGeodeticSurface(u[r],u[r]);if(!((u=D$Z(u,t$X.equalsEpsilon,!0)).length<3)){var c=l.holes?l.holes.length:0;for(r=0;r<c;r++){var h=l.holes[r],d=h.positions;if(t)for(o=d.length,n=0;n<o;++n)i.scaleToGeodeticSurface(d[n],d[n]);if(!((d=D$Z(d,t$X.equalsEpsilon,!0)).length<3)){a.push(d);var f=0;for(e$28(h.holes)&&(f=h.holes.length),n=0;n<f;n++)s.enqueue(h.holes[n])}}a.push(u)}}return a};var vr$5=new t$X(6378137,6378137,6378137);y$Q.polygonsFromHierarchy=function(e,t,i,r){var n=[],o=[],a=new r$_;for(a.enqueue(e);0!==a.length;){var s,l,u,c=a.dequeue(),h=c.positions,d=c.holes,f=h.slice();if(i)for(l=h.length,s=0;s<l;s++)r.scaleToGeodeticSurface(h[s],f[s]);if(e$28(r)&&!t$X.equals(r._radii,vr$5)&&(u=e$27.EPSILON7),!((h=D$Z(f,t$X.equalsEpsilon,!0,u)).length<3)){var p=t(h);if(e$28(p)){var _=[],m=A$1d.computeWindingOrder2D(p);m===_0x4a48d8.CLOCKWISE&&(p.reverse(),h=h.slice().reverse());var $,g=h.slice(),v=e$28(d)?d.length:0,y=[];for(s=0;s<v;s++){var x=d[s],b=x.positions;if(i)for(l=b.length,$=0;$<l;++$)r.scaleToGeodeticSurface(b[$],b[$]);if(!((b=D$Z(b,t$X.equalsEpsilon,!0,e$27.EPSILON7)).length<3)){var w=t(b);if(e$28(w)){(m=A$1d.computeWindingOrder2D(w))===_0x4a48d8.CLOCKWISE&&(w.reverse(),b=b.slice().reverse()),y.push(b),_.push(g.length),g=g.concat(b),p=p.concat(w);var C=0;for(e$28(x.holes)&&(C=x.holes.length),$=0;$<C;$++)a.enqueue(x.holes[$])}}}n.push({outerRing:h,holes:y}),o.push({positions:g,positions2D:p,holes:_})}}}return{hierarchy:n,polygons:o}};var cr$5=new o$1k,ur$6=new t$X,fr$4=new n$14,ir$8=new p$1a;y$Q.computeBoundingRectangle=function(e,t,i,r,n){for(var o=n$14.fromAxisAngle(e,r,fr$4),a=p$1a.fromQuaternion(o,ir$8),s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=i.length,d=0;d<h;++d){var f=t$X.clone(i[d],ur$6);p$1a.multiplyByVector(a,f,f);var p=t(f,cr$5);e$28(p)&&(s=Math.min(s,p.x),l=Math.max(l,p.x),u=Math.min(u,p.y),c=Math.max(c,p.y))}return n.x=s,n.y=u,n.width=l-s,n.height=c-u,n},y$Q.createGeometryFromPositions=function(e,t,i,r,n,o){var a=A$1d.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);var s=t.positions;if(r){for(var l=s.length,u=new Array(3*l),c=0,h=0;h<l;h++){var d=s[h];u[c++]=d.x,u[c++]=d.y,u[c++]=d.z}var f=new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:u})},indices:a,primitiveType:W$_.TRIANGLES});return n.normal?k$Z.computeNormal(f):f}return o===m$_.GEODESIC?A$1d.computeSubdivision(e,s,a,i):o===m$_.RHUMB?A$1d.computeRhumbLineSubdivision(e,s,a,i):void 0};var K$P=[],mr$6=new t$X,or$8=new t$X;y$Q.computeWallGeometry=function(e,t,i,r,n,o){var a,s,l,u,c,h=o?1:0,d=e.length,f=0;if(r)for(s=3*(d-h)*2,a=new Array(2*s),l=0;l<d-h;l++)u=e[l],c=e[(l+1)%d],a[f]=a[f+s]=u.x,a[++f]=a[f+s]=u.y,a[++f]=a[f+s]=u.z,a[++f]=a[f+s]=c.x,a[++f]=a[f+s]=c.y,a[++f]=a[f+s]=c.z,++f;else{var p=e$27.chordLength(i,t.maximumRadius),_=0;if(n===m$_.GEODESIC)for(l=0;l<d;l++)_+=y$Q.subdivideLineCount(e[l],e[(l+1)%d],p);else if(n===m$_.RHUMB)for(l=0;l<d;l++)_+=y$Q.subdivideRhumbLineCount(t,e[l],e[(l+1)%d],p);for(s=3*(_+d),a=new Array(2*s),l=0;l<d;l++){var m;u=e[l],c=e[(l+1)%d],n===m$_.GEODESIC?m=y$Q.subdivideLine(u,c,p,K$P):n===m$_.RHUMB&&(m=y$Q.subdivideRhumbLine(t,u,c,p,K$P));for(var $=m.length,g=0;g<$;++g,++f)a[f]=m[g],a[f+s]=m[g];a[f]=c.x,a[f+s]=c.x,a[++f]=c.y,a[f+s]=c.y,a[++f]=c.z,a[f+s]=c.z,++f}}d=a.length;var v=ce$v.createTypedArray(d/3,d-6*(e.length-h)),y=0;for(d/=6,l=0;l<d;l++){var x=l,b=x+1,w=x+d,C=w+1;u=t$X.fromArray(a,3*x,mr$6),c=t$X.fromArray(a,3*b,or$8),!t$X.equalsEpsilon(u,c,e$27.EPSILON10,e$27.EPSILON10)&&(v[y++]=x,v[y++]=w,v[y++]=b,v[y++]=b,v[y++]=w,v[y++]=C)}return new I$1n({attributes:new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:a})}),indices:v,primitiveType:W$_.TRIANGLES})};var ce$t=new t$X,pe$A=new f$10,se$w=new o$1k,me$A=new o$1k,le$v=new t$X,ve$q=new t$X,fe$v=new t$X,C$O=new t$X,ye$r=new t$X,he$s=new t$X,W$Q=new n$14,ue$w=new p$1a,de$v=new p$1a,ge$q=new t$X;function we$o(e,t,i,r,n,o,a,s){var l=e.positions,u=A$1d.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);var c=ce$v.createTypedArray(l.length,u.length);c.set(u);var h=ue$w;if(0!==r){var d=n$14.fromAxisAngle(o,r,W$Q);if(h=p$1a.fromQuaternion(d,h),t.tangent||t.bitangent){d=n$14.fromAxisAngle(o,-r,W$Q);var f=p$1a.fromQuaternion(d,de$v);a=t$X.normalize(p$1a.multiplyByVector(f,a,a),a),t.bitangent&&(s=t$X.normalize(t$X.cross(o,a,s),s))}}else h=p$1a.clone(p$1a.IDENTITY,h);var p=me$A;t.st&&(p.x=i.x,p.y=i.y);for(var _=l.length,m=3*_,$=new Float64Array(m),g=t.normal?new Float32Array(m):void 0,v=t.tangent?new Float32Array(m):void 0,y=t.bitangent?new Float32Array(m):void 0,x=t.st?new Float32Array(2*_):void 0,b=0,w=0,C=0,T=0,S=0,E=0;E<_;E++){var A=l[E];if($[b++]=A.x,$[b++]=A.y,$[b++]=A.z,t.st){var P=n(p$1a.multiplyByVector(h,A,ce$t),se$w);o$1k.subtract(P,p,P);var I=e$27.clamp(P.x/i.width,0,1),M=e$27.clamp(P.y/i.height,0,1);x[S++]=I,x[S++]=M}t.normal&&(g[w++]=o.x,g[w++]=o.y,g[w++]=o.z),t.tangent&&(v[T++]=a.x,v[T++]=a.y,v[T++]=a.z),t.bitangent&&(y[C++]=s.x,y[C++]=s.y,y[C++]=s.z)}var O=new a$_;return t.position&&(O.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:$})),t.normal&&(O.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:g})),t.tangent&&(O.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:v})),t.bitangent&&(O.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:y})),t.st&&(O.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:x})),new I$1n({attributes:O,indices:c,primitiveType:W$_.TRIANGLES})}function P$W(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).polygonHierarchy;o$1u.defined("options.polygonHierarchy",t);var i=u$Y(e.vertexFormat,n$10.DEFAULT);this._vertexFormat=n$10.clone(i),this._polygonHierarchy=t,this._stRotation=u$Y(e.stRotation,0),this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=y$Q.computeHierarchyPackedLength(t)+n$10.packedLength+t$V.packedLength+2}P$W.fromPositions=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.positions",e.positions),new P$W({polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},P$W.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),i=y$Q.packPolygonHierarchy(e._polygonHierarchy,t,i),t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._stRotation,t[i]=e.packedLength,t};var Pe$k=t$V.clone(t$V.UNIT_SPHERE),Ae$o=new n$10,be$t={polygonHierarchy:{}};function T$M(e){for(var t=e.length,i=new Float64Array(3*t),r=ce$v.createTypedArray(t,2*t),n=0,o=0,a=0;a<t;a++){var s=e[a];i[n++]=s.x,i[n++]=s.y,i[n++]=s.z,r[o++]=a,r[o++]=(a+1)%t}return new I$1n({attributes:new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:i})}),indices:r,primitiveType:W$_.LINES})}function a$V(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).polygonHierarchy;o$1u.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=y$Q.computeHierarchyPackedLength(t)+1}P$W.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=y$Q.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=t$V.unpack(e,t,Pe$k);t+=t$V.packedLength;var o=n$10.unpack(e,t,Ae$o);t+=n$10.packedLength;var a=e[t++],s=e[t];return e$28(i)||(i=new P$W(be$t)),i._polygonHierarchy=r,i._ellipsoid=t$V.clone(n,i._ellipsoid),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._stRotation=a,i.packedLength=s,i},P$W.createGeometry=function(e){var t=e._vertexFormat,i=e._polygonHierarchy,r=e._stRotation,n=i.positions;if(!((n=D$Z(n,t$X.equalsEpsilon,!0)).length<3)){var o=le$v,a=ve$q,s=fe$v,l=ye$r,u=he$s;if(g$M.computeProjectTo2DArguments(n,C$O,l,u)){if(o=t$X.cross(l,u,o),o=t$X.normalize(o,o),!t$X.equalsEpsilon(C$O,t$X.ZERO,e$27.EPSILON6)){var c=e._ellipsoid.geodeticSurfaceNormal(C$O,ge$q);t$X.dot(o,c)<0&&(o=t$X.negate(o,o),l=t$X.negate(l,l))}var h=g$M.createProjectPointsTo2DFunction(C$O,l,u),d=g$M.createProjectPointTo2DFunction(C$O,l,u);t.tangent&&(a=t$X.clone(l,a)),t.bitangent&&(s=t$X.clone(u,s));var f=y$Q.polygonsFromHierarchy(i,h,!1),p=f.hierarchy,_=f.polygons;if(0!==p.length){n=p[0].outerRing;for(var m=i$19.fromPoints(n),$=y$Q.computeBoundingRectangle(o,d,n,r,pe$A),g=[],v=0;v<_.length;v++){var y=new d$15({geometry:we$o(_[v],t,$,r,d,o,a,s)});g.push(y)}var x=k$Z.combineInstances(g)[0];x.attributes.position.values=new Float64Array(x.attributes.position.values),x.indices=ce$v.createTypedArray(x.attributes.position.values.length/3,x.indices);var b=x.attributes;return t.position||delete b.position,new I$1n({attributes:b,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:m})}}}},a$V.fromPositions=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.positions",e.positions),new a$V({polygonHierarchy:{positions:e.positions}})},a$V.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i=y$Q.packPolygonHierarchy(e._polygonHierarchy,t,i)]=e.packedLength,t};var C$N={polygonHierarchy:{}};a$V.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=y$Q.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=e[t];return e$28(i)||(i=new a$V(C$N)),i._polygonHierarchy=r,i.packedLength=n,i},a$V.createGeometry=function(e){var t=e._polygonHierarchy,i=t.positions;if(!((i=D$Z(i,t$X.equalsEpsilon,!0)).length<3)&&g$M.validOutline(i)){var r=y$Q.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],o=0;o<r.length;o++){var a=new d$15({geometry:T$M(r[o])});n.push(a)}var s=k$Z.combineInstances(n)[0],l=i$19.fromPoints(t.positions);return new I$1n({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:l})}}};var e$1x={ROUNDED:0,MITERED:1,BEVELED:2},ar$a=Object.freeze(e$1x);function Y$I(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,f=1-d,p=Math.sqrt(f),_=t/4,m=_*_,$=m*_,g=m*m,v=1+_-3*m/4+5*$/4-175*g/64,y=1-_+15*m/8-35*$/8,x=1-3*_+35*m/4,b=1-5*_,w=v*c-y*Math.sin(2*c)*_/2-x*Math.sin(4*c)*m/16-b*Math.sin(6*c)*$/48-5*Math.sin(8*c)*g/512,C=e._constants;C.a=i,C.b=r,C.f=n,C.cosineHeading=o,C.sineHeading=a,C.tanU=s,C.cosineU=l,C.sineU=u,C.sigma=c,C.sineAlpha=h,C.sineSquaredAlpha=d,C.cosineSquaredAlpha=f,C.cosineAlpha=p,C.u2Over4=_,C.u4Over16=m,C.u6Over64=$,C.u8Over256=g,C.a0=v,C.a1=y,C.a2=x,C.a3=b,C.distanceRatio=w}function Z$Y(e,t){return e*t*(4+e*(4-3*t))/16}function B$L(e,t,i,r,n,o,a){var s=Z$Y(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function $$S(e,t,i,r,n,o,a){var s,l,u,c,h,d=(t-i)/t,f=o-r,p=Math.atan((1-d)*Math.tan(n)),_=Math.atan((1-d)*Math.tan(a)),m=Math.cos(p),$=Math.sin(p),g=Math.cos(_),v=Math.sin(_),y=m*g,x=m*v,b=$*v,w=$*g,C=f,T=e$27.TWO_PI,S=Math.cos(C),E=Math.sin(C);do{S=Math.cos(C),E=Math.sin(C);var A,P=x-w*S;u=Math.sqrt(g*g*E*E+P*P),l=b+y*S,s=Math.atan2(u,l),0===u?(A=0,c=1):c=1-(A=y*E/u)*A,T=C,h=l-2*b/c,isNaN(h)&&(h=0),C=f+B$L(d,A,c,s,u,l,h)}while(Math.abs(C-T)>e$27.EPSILON12);var I=c*(t*t-i*i)/(i*i),M=I*(256+I*(I*(74-47*I)-128))/1024,O=h*h,D=i*(1+I*(4096+I*(I*(320-175*I)-768))/16384)*(s-M*u*(h+M*(l*(2*O-1)-M*h*(4*u*u-3)*(4*O-3)/6)/4)),R=Math.atan2(g*E,x-w*S),L=Math.atan2(m*E,x*S-w);e._distance=D,e._startHeading=R,e._endHeading=L,e._uSquared=I}var j$Y=new t$X,L$14=new t$X;function F$_(e,t,i,r){var n=t$X.normalize(r.cartographicToCartesian(t,L$14),j$Y),o=t$X.normalize(r.cartographicToCartesian(i,L$14),L$14);o$1u.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(t$X.angleBetween(n,o))-Math.PI),.0125),$$S(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=t$W.clone(t,e._start),e._end=t$W.clone(i,e._end),e._start.height=0,e._end.height=0,Y$I(e)}function E$$(e,t,i){var r=u$Y(i,t$V.WGS84);this._ellipsoid=r,this._start=new t$W,this._end=new t$W,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,e$28(e)&&e$28(t)&&F$_(this,e,t,r)}Object.defineProperties(E$$.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return o$1u.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return o$1u.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return o$1u.defined("distance",this._distance),this._endHeading}}}),E$$.prototype.setEndPoints=function(e,t){o$1u.defined("start",e),o$1u.defined("end",t),F$_(this,e,t,this._ellipsoid)},E$$.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},E$$.prototype.interpolateUsingSurfaceDistance=function(e,t){o$1u.defined("distance",this._distance);var i=this._constants,r=i.distanceRatio+e/i.b,n=Math.cos(2*r),o=Math.cos(4*r),a=Math.cos(6*r),s=Math.sin(2*r),l=Math.sin(4*r),u=Math.sin(6*r),c=Math.sin(8*r),h=r*r,d=r*h,f=i.u8Over256,p=i.u2Over4,_=i.u6Over64,m=i.u4Over16,$=2*d*f*n/3+r*(1-p+7*m/4-15*_/4+579*f/64-(m-15*_/4+187*f/16)*n-(5*_/4-115*f/16)*o-29*f*a/16)+(p/2-m+71*_/32-85*f/16)*s+(5*m/16-5*_/4+383*f/96)*l-h*((_-11*f/2)*s+5*f*l/2)+(29*_/96-29*f/16)*u+539*f*c/1536,g=Math.asin(Math.sin($)*i.cosineAlpha),v=Math.atan(i.a/i.b*Math.tan(g));$-=i.sigma;var y=Math.cos(2*i.sigma+$),x=Math.sin($),b=Math.cos($),w=i.cosineU*b,C=i.sineU*x,T=Math.atan2(x*i.sineHeading,w-C*i.cosineHeading)-B$L(i.f,i.sineAlpha,i.cosineSquaredAlpha,$,x,b,y);return e$28(t)?(t.longitude=this._start.longitude+T,t.latitude=v,t.height=0,t):new t$W(this._start.longitude+T,v,0)};var m$U={numberOfPoints:function(e,t,i){var r=t$X.distance(e,t);return Math.ceil(r/i)},numberOfPointsRhumbLine:function(e,t,i){var r=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.ceil(Math.sqrt(r/(i*i)))}},F$Z=new t$W;m$U.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,F$Z).height}return r};var j$X=new y$15,J$W=new t$X,M$U=new t$X,K$O=new o$1i(t$X.UNIT_X,0),X$M=new t$X,Q$U=new o$1i(t$X.UNIT_X,0),$$R=new t$X,rr$b=new t$X,G$13=[];function Z$X(e,t,i){var r,n=G$13;if(n.length=e,t===i){for(r=0;r<e;r++)n[r]=t;return n}var o=(i-t)/e;for(r=0;r<e;r++){var a=t+r*o;n[r]=a}return n}function ar$9(e,t){var i=G$13;i.length=e;for(var r=0;r<e;r++)i[r]+=t*Math.sin(Math.PI*r/e);return i}var I$1e=new t$W,N$J=new t$W,T$L=new t$X,B$K=new t$X,V$M=new t$X,H$S=new E$$,E$_=new P$17;function er$c(e,t,i,r,n,o,a,s,l){var u=r.scaleToGeodeticSurface(e,B$K),c=r.scaleToGeodeticSurface(t,V$M),h=m$U.numberOfPoints(e,t,i),d=r.cartesianToCartographic(u,I$1e),f=r.cartesianToCartographic(c,N$J),p=Z$X(h,n,o);l>0&&(p=ar$9(h,l)),H$S.setEndPoints(d,f);var _=H$S.surfaceDistance/h,m=s;d.height=n;var $=r.cartographicToCartesian(d,T$L);t$X.pack($,a,m),m+=3;for(var g=1;g<h;g++){var v=H$S.interpolateUsingSurfaceDistance(g*_,N$J);v.height=p[g],$=r.cartographicToCartesian(v,T$L),t$X.pack($,a,m),m+=3}return m}function tr$9(e,t,i,r,n,o,a,s){var l=r.scaleToGeodeticSurface(e,B$K),u=r.scaleToGeodeticSurface(t,V$M),c=r.cartesianToCartographic(l,I$1e),h=r.cartesianToCartographic(u,N$J),d=m$U.numberOfPointsRhumbLine(c,h,i),f=Z$X(d,n,o);E$_.ellipsoid.equals(r)||(E$_=new P$17(void 0,void 0,r)),E$_.setEndPoints(c,h);var p=E$_.surfaceDistance/d,_=s;c.height=n;var m=r.cartographicToCartesian(c,T$L);t$X.pack(m,a,_),_+=3;for(var $=1;$<d;$++){var g=E$_.interpolateUsingSurfaceDistance($*p,N$J);g.height=f[$],m=r.cartographicToCartesian(g,T$L),t$X.pack(m,a,_),_+=3}return _}m$U.wrapLongitude=function(e,t){var i=[],r=[];if(e$28(e)&&e.length>0){t=u$Y(t,y$15.IDENTITY);var n=y$15.inverseTransformation(t,j$X),o=y$15.multiplyByPoint(n,t$X.ZERO,J$W),a=t$X.normalize(y$15.multiplyByPointAsVector(n,t$X.UNIT_Y,M$U),M$U),s=o$1i.fromPointNormal(o,a,K$O),l=t$X.normalize(y$15.multiplyByPointAsVector(n,t$X.UNIT_X,X$M),X$M),u=o$1i.fromPointNormal(o,l,Q$U),c=1;i.push(t$X.clone(e[0]));for(var h=i[0],d=e.length,f=1;f<d;++f){var p=e[f];if(o$1i.getPointDistance(u,h)<0||o$1i.getPointDistance(u,p)<0){var _=g$10.lineSegmentPlane(h,p,s,$$R);if(e$28(_)){var m=t$X.multiplyByScalar(a,5e-9,rr$b);o$1i.getPointDistance(s,h)<0&&t$X.negate(m,m),i.push(t$X.add(_,m,new t$X)),r.push(c+1),t$X.negate(m,m),i.push(t$X.add(_,m,new t$X)),c=1}}i.push(t$X.clone(e[f])),c++,h=p}r.push(c)}return{positions:i,lengths:r}},m$U.generateArc=function(e){e$28(e)||(e={});var t=e.positions;if(!e$28(t))throw new t$Z("options.positions is required.");var i=t.length,r=u$Y(e.ellipsoid,t$V.WGS84),n=u$Y(e.height,0),o=Array.isArray(n);if(i<1)return[];if(1===i){var a=r.scaleToGeodeticSurface(t[0],B$K);if(0!==(n=o?n[0]:n)){var s=r.geodeticSurfaceNormal(a,T$L);t$X.multiplyByScalar(s,n,s),t$X.add(a,s,a)}return[a.x,a.y,a.z]}var l=e.minDistance;if(!e$28(l)){var u=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE);l=e$27.chordLength(u,r.maximumRadius)}var c,h=0;for(c=0;c<i-1;c++)h+=m$U.numberOfPoints(t[c],t[c+1],l);var d=e.hMax,f=3*(h+1),p=new Array(f),_=0;for(c=0;c<i-1;c++){_=er$c(t[c],t[c+1],l,r,o?n[c]:n,o?n[c+1]:n,p,_,d)}G$13.length=0;var m=t[i-1],$=r.cartesianToCartographic(m,I$1e);$.height=o?n[i-1]:n;var g=r.cartographicToCartesian($,T$L);return t$X.pack(g,p,f-3),p};var Y$H=new t$W,nr$9=new t$W;m$U.generateRhumbArc=function(e){e$28(e)||(e={});var t=e.positions;if(!e$28(t))throw new t$Z("options.positions is required.");var i=t.length,r=u$Y(e.ellipsoid,t$V.WGS84),n=u$Y(e.height,0),o=Array.isArray(n);if(i<1)return[];if(1===i){var a=r.scaleToGeodeticSurface(t[0],B$K);if(0!==(n=o?n[0]:n)){var s=r.geodeticSurfaceNormal(a,T$L);t$X.multiplyByScalar(s,n,s),t$X.add(a,s,a)}return[a.x,a.y,a.z]}var l,u,c=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),h=0,d=r.cartesianToCartographic(t[0],Y$H);for(l=0;l<i-1;l++)u=r.cartesianToCartographic(t[l+1],nr$9),h+=m$U.numberOfPointsRhumbLine(d,u,c),d=t$W.clone(u,Y$H);var f=3*(h+1),p=new Array(f),_=0;for(l=0;l<i-1;l++){_=tr$9(t[l],t[l+1],c,r,o?n[l]:n,o?n[l+1]:n,p,_)}G$13.length=0;var m=t[i-1],$=r.cartesianToCartographic(m,I$1e);$.height=o?n[i-1]:n;var g=r.cartographicToCartesian($,T$L);return t$X.pack(g,p,f-3),p},m$U.generateCartesianArc=function(e){for(var t=m$U.generateArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=t$X.unpack(t,3*n);return r},m$U.generateCartesianRhumbArc=function(e){for(var t=m$U.generateRhumbArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=t$X.unpack(t,3*n);return r};var g$L=[new t$X,new t$X],hr$5=new t$X,gr$7=new t$X,dr$5=new t$X,pr$5=new t$X,wr$4=new t$X,Sr$3=new t$X,Br$2=new t$X,xr$4=new t$X,Er$3=new t$X,X$L=new t$X,er$b=new t$X,J$V={},ur$5=new t$W;function Tr$3(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];ur$5=t.cartesianToCartographic(n,ur$5),i[r]=ur$5.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function $$Q(e,t,i,r){var n,o=e[0],a=e[1],s=t$X.angleBetween(o,a),l=Math.ceil(s/r),u=new Array(l);if(t===i){for(n=0;n<l;n++)u[n]=t;return u.push(i),u}var c=(i-t)/l;for(n=1;n<l;n++){var h=t+n*c;u[n]=h}return u[0]=t,u.push(i),u}var nr$8=new t$X,tr$8=new t$X;function zr$5(e,t,i,r){var n=new f$16(i,r),o=n.projectPointOntoPlane(t$X.add(i,e,nr$8),nr$8),a=n.projectPointOntoPlane(t$X.add(i,t,tr$8),tr$8),s=o$1k.angleBetween(o,a);return a.x*o.y-a.y*o.x>=0?-s:s}var Ar$4=new t$X(-1,0,0),D$T=y$15.clone(y$15.IDENTITY),Cr$3=new y$15,R$Q=new p$1a,Nr$4=p$1a.IDENTITY.clone(),Fr$2=new t$X,Lr$4=new e$25,vr$4=new t$X;function I$1d(e,t,i,r,n,o,a,s){var l=Fr$2,u=Lr$4;D$T=m$1b.eastNorthUpToFixedFrame(e,n,D$T),l=y$15.multiplyByPointAsVector(D$T,Ar$4,l);var c=zr$5(l=t$X.normalize(l,l),t,e,n);R$Q=p$1a.fromRotationZ(c,R$Q),vr$4.z=o,D$T=y$15.multiplyTransformation(D$T,y$15.fromRotationTranslation(R$Q,vr$4,Cr$3),D$T);var h=Nr$4;h[0]=a;for(var d=0;d<s;d++)for(var f=0;f<i.length;f+=3)u=t$X.fromArray(i,f,u),u=p$1a.multiplyByVector(h,u,u),u=y$15.multiplyByPoint(D$T,u,u),r.push(u.x,u.y,u.z);return r}function k$X(e,t,i,r,n,o,a,s,l){var u=Fr$2,c=Lr$4;D$T=m$1b.eastNorthUpToFixedFrame(e,n,D$T),u=y$15.multiplyByPointAsVector(D$T,Ar$4,u);var h=zr$5(u=t$X.normalize(u,u),t,e,n);R$Q=p$1a.fromRotationZ(h,R$Q),vr$4.z=o,D$T=y$15.multiplyTransformation(D$T,y$15.fromRotationTranslation(R$Q,vr$4,Cr$3),D$T);var d=Nr$4;d[0]=a;for(var f=0;f<s;f++)for(var p=0;p<i.length;p+=3)c=t$X.fromArray(i,p,c),c=p$1a.multiplyByVector(d,c,c),c=y$15.multiplyByPoint(D$T,c,c),c=y$15.multiplyByPoint(l,c,c),r.push(c.x,c.y,c.z);return r}var Dr$2=new t$X;function rr$a(e,t,i,r,n,o,a){for(var s=0;s<e.length;s+=3){r=I$1d(t$X.fromArray(e,s,Dr$2),t,i,r,n,o[s/3],a,1)}return r}function Ir$4(e,t,i,r,n,o,a,s){for(var l=0;l<e.length;l+=3){r=k$X(t$X.fromArray(e,l,Dr$2),t,i,r,n,o[l/3],a,1,s)}return r}function Vr$3(e,t){var i=e.length,r=new Array(6*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a;for(var l=1;l<i;l++){var u=(s=e[l]).x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function lr$6(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}var Mr$3=new n$14,Or$2=new t$X,Gr$3=new p$1a;function or$7(e,t,i,r,n,o,a,s,l,u){var c,h,d=t$X.angleBetween(t$X.subtract(t,e,X$L),t$X.subtract(i,e,er$b)),f=r===ar$a.BEVELED?0:Math.ceil(d/e$27.toRadians(5));if(c=n?p$1a.fromQuaternion(n$14.fromAxisAngle(t$X.negate(e,X$L),d/(f+1),Mr$3),Gr$3):p$1a.fromQuaternion(n$14.fromAxisAngle(e,d/(f+1),Mr$3),Gr$3),t=t$X.clone(t,Or$2),f>0)for(var p=u?2:1,_=0;_<f;_++)t=p$1a.multiplyByVector(c,t,t),h=t$X.subtract(t,e,X$L),h=t$X.normalize(h,h),n||(h=t$X.negate(h,h)),a=I$1d(o.scaleToGeodeticSurface(t,er$b),h,s,a,o,l,1,p);else h=t$X.subtract(t,e,X$L),h=t$X.normalize(h,h),n||(h=t$X.negate(h,h)),a=I$1d(o.scaleToGeodeticSurface(t,er$b),h,s,a,o,l,1,1),i=t$X.clone(i,Or$2),h=t$X.subtract(i,e,X$L),h=t$X.normalize(h,h),n||(h=t$X.negate(h,h)),a=I$1d(o.scaleToGeodeticSurface(i,er$b),h,s,a,o,l,1,1);return a}J$V.removeDuplicatesFromShape=function(e){for(var t=e.length,i=[],r=t-1,n=0;n<t;r=n++){var o=e[r],a=e[n];o$1k.equals(o,a)||i.push(a)}return i},J$V.angleIsGreaterThanPi=function(e,t,i,r){var n=new f$16(i,r),o=n.projectPointOntoPlane(t$X.add(i,e,nr$8),nr$8),a=n.projectPointOntoPlane(t$X.add(i,t,tr$8),tr$8);return a.x*o.y-a.y*o.x>=0};var Ur$4=new t$X,_r$4=new t$X;J$V.computePositions=function(e,t,i,r,n){var o=r._ellipsoid,a=Tr$3(e,o),s=r._granularity,l=r._cornerType,u=n?Vr$3(t,i):lr$6(t,i),c=n?lr$6(t,i):void 0,h=i.height/2,d=i.width/2,f=e.length,p=[],_=n?[]:void 0,m=hr$5,$=gr$7,g=dr$5,v=pr$5,y=wr$4,x=Sr$3,b=Br$2,w=xr$4,C=Er$3,T=e[0],S=e[1];v=o.geodeticSurfaceNormal(T,v),m=t$X.subtract(S,T,m),m=t$X.normalize(m,m),w=t$X.cross(v,m,w),w=t$X.normalize(w,w);var E=a[0],A=a[1];n&&(_=I$1d(T,w,c,_,o,E+h,1,1)),C=t$X.clone(T,C),T=S,$=t$X.negate(m,$);for(var P,I=1;I<f-1;I++){var M=n?2:1;S=e[I+1],m=t$X.subtract(S,T,m),m=t$X.normalize(m,m),g=t$X.add(m,$,g),g=t$X.normalize(g,g),v=o.geodeticSurfaceNormal(T,v);var O=t$X.multiplyByScalar(v,t$X.dot(m,v),Ur$4);t$X.subtract(m,O,O),t$X.normalize(O,O);var D=t$X.multiplyByScalar(v,t$X.dot($,v),_r$4);if(t$X.subtract($,D,D),t$X.normalize(D,D),!e$27.equalsEpsilon(Math.abs(t$X.dot(O,D)),1,e$27.EPSILON7)){g=t$X.cross(g,v,g),g=t$X.cross(v,g,g),g=t$X.normalize(g,g);var R=1/Math.max(.25,t$X.magnitude(t$X.cross(g,$,X$L))),L=J$V.angleIsGreaterThanPi(m,$,T,o);L?(y=t$X.add(T,t$X.multiplyByScalar(g,R*d,g),y),x=t$X.add(y,t$X.multiplyByScalar(w,d,x),x),g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(x,g$L[1]),P=$$Q(g$L,E+h,A+h,s),p=rr$a(m$U.generateArc({positions:g$L,granularity:s,ellipsoid:o}),w,u,p,o,P,1),w=t$X.cross(v,m,w),w=t$X.normalize(w,w),b=t$X.add(y,t$X.multiplyByScalar(w,d,b),b),l===ar$a.ROUNDED||l===ar$a.BEVELED?or$7(y,x,b,l,L,o,p,u,A+h,n):p=I$1d(T,g=t$X.negate(g,g),u,p,o,A+h,R,M),C=t$X.clone(b,C)):(y=t$X.add(T,t$X.multiplyByScalar(g,R*d,g),y),x=t$X.add(y,t$X.multiplyByScalar(w,-d,x),x),g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(x,g$L[1]),P=$$Q(g$L,E+h,A+h,s),p=rr$a(m$U.generateArc({positions:g$L,granularity:s,ellipsoid:o}),w,u,p,o,P,1),w=t$X.cross(v,m,w),w=t$X.normalize(w,w),b=t$X.add(y,t$X.multiplyByScalar(w,-d,b),b),l===ar$a.ROUNDED||l===ar$a.BEVELED?or$7(y,x,b,l,L,o,p,u,A+h,n):p=I$1d(T,g,u,p,o,A+h,R,M),C=t$X.clone(b,C)),$=t$X.negate(m,$)}else p=I$1d(C,w,u,p,o,E+h,1,1),C=T;E=A,A=a[I+1],T=S}g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(T,g$L[1]),P=$$Q(g$L,E+h,A+h,s),p=rr$a(m$U.generateArc({positions:g$L,granularity:s,ellipsoid:o}),w,u,p,o,P,1),n&&(_=I$1d(T,w,c,_,o,A+h,1,1)),f=p.length;var B=n?f+_.length:f,N=new Float64Array(B);return N.set(p),n&&N.set(_,f),N},J$V.computeLocalPositions=function(e,t,i,r,n,o){var a=r._ellipsoid,s=Tr$3(e,a),l=r._granularity,u=r._cornerType,c=n?Vr$3(t,i):lr$6(t,i),h=n?lr$6(t,i):void 0,d=i.width/2,f=e.length,p=[],_=n?[]:void 0,m=hr$5,$=gr$7,g=dr$5,v=pr$5,y=wr$4,x=Sr$3,b=Br$2,w=xr$4,C=Er$3,T=m$1b.eastNorthUpToFixedFrame(o,a,new y$15),S=y$15.inverse(T,new y$15),E=e[0],A=e[1];v=a.geodeticSurfaceNormal(E,v),m=t$X.subtract(A,E,m),m=t$X.normalize(m,m),w=t$X.cross(v,m,w),w=t$X.normalize(w,w);var P=s[0],I=s[1];n&&(_=k$X(E,w,h,_,a,P+0,1,1,S)),C=t$X.clone(E,C),E=A,$=t$X.negate(m,$);for(var M,O=1;O<f-1;O++){var D=n?2:1;A=e[O+1],m=t$X.subtract(A,E,m),m=t$X.normalize(m,m),g=t$X.add(m,$,g),g=t$X.normalize(g,g),v=a.geodeticSurfaceNormal(E,v);var R=t$X.multiplyByScalar(v,t$X.dot(m,v),Ur$4);t$X.subtract(m,R,R),t$X.normalize(R,R);var L=t$X.multiplyByScalar(v,t$X.dot($,v),_r$4);if(t$X.subtract($,L,L),t$X.normalize(L,L),!e$27.equalsEpsilon(Math.abs(t$X.dot(R,L)),1,e$27.EPSILON7)){g=t$X.cross(g,v,g),g=t$X.cross(v,g,g),g=t$X.normalize(g,g);var B=1/Math.max(.25,t$X.magnitude(t$X.cross(g,$,X$L))),N=J$V.angleIsGreaterThanPi(m,$,E,a);N?(y=t$X.add(E,t$X.multiplyByScalar(g,B*d,g),y),x=t$X.add(y,t$X.multiplyByScalar(w,d,x),x),g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(x,g$L[1]),M=$$Q(g$L,P+0,I+0,l),p=rr$a(m$U.generateArc({positions:g$L,granularity:l,ellipsoid:a}),w,c,p,a,M,1,fromEnu),w=t$X.cross(v,m,w),w=t$X.normalize(w,w),b=t$X.add(y,t$X.multiplyByScalar(w,d,b),b),u===ar$a.ROUNDED||u===ar$a.BEVELED?or$7(y,x,b,u,N,a,p,c,I+0,n):p=k$X(E,g=t$X.negate(g,g),c,p,a,I+0,B,D,S),C=t$X.clone(b,C)):(y=t$X.add(E,t$X.multiplyByScalar(g,B*d,g),y),x=t$X.add(y,t$X.multiplyByScalar(w,-d,x),x),g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(x,g$L[1]),M=$$Q(g$L,P+0,I+0,l),p=rr$a(m$U.generateArc({positions:g$L,granularity:l,ellipsoid:a}),w,c,p,a,M,1),w=t$X.cross(v,m,w),w=t$X.normalize(w,w),b=t$X.add(y,t$X.multiplyByScalar(w,-d,b),b),u===ar$a.ROUNDED||u===ar$a.BEVELED?or$7(y,x,b,u,N,a,p,c,I+0,n):p=k$X(E,g,c,p,a,I+0,B,D,S),C=t$X.clone(b,C)),$=t$X.negate(m,$)}else p=k$X(C,w,c,p,a,P+0,1,1,S),C=E;P=I,I=s[O+1],E=A}g$L[0]=t$X.clone(C,g$L[0]),g$L[1]=t$X.clone(E,g$L[1]),M=$$Q(g$L,P+0,I+0,l),p=Ir$4(m$U.generateArc({positions:g$L,granularity:l,ellipsoid:a}),w,c,p,a,M,1,S),n&&(_=k$X(E,w,h,_,a,I+0,1,1,S)),f=p.length;var F=n?f+_.length:f,z=new Float64Array(F);return z.set(p),n&&z.set(_,f),z};var b$$={},A$$=new t$X,H$R=new t$X,P$V=new t$X,I$1c=new t$X,g$K=[new t$X,new t$X],J$U=new t$X,K$N=new t$X,W$P=new t$X,rr$9=new t$X,ar$8=new t$X,er$a=new t$X,nr$7=new t$X,ir$7=new t$X,lr$5=new t$X,tr$7=new t$X,X$K=new n$14,Y$G=new p$1a;function V$L(e,t,i,r,n){var o,a=t$X.angleBetween(t$X.subtract(t,e,A$$),t$X.subtract(i,e,H$R)),s=r===ar$a.BEVELED?1:Math.ceil(a/e$27.toRadians(5))+1,l=3*s,u=new Array(l);u[l-3]=i.x,u[l-2]=i.y,u[l-1]=i.z,o=n?p$1a.fromQuaternion(n$14.fromAxisAngle(t$X.negate(e,A$$),a/s,X$K),Y$G):p$1a.fromQuaternion(n$14.fromAxisAngle(e,a/s,X$K),Y$G);var c=0;t=t$X.clone(t,A$$);for(var h=0;h<s;h++)t=p$1a.multiplyByVector(o,t,t),u[c++]=t.x,u[c++]=t.y,u[c++]=t.z;return u}function or$6(e){var t=J$U,i=K$N,r=W$P,n=e[1];i=t$X.fromArray(e[1],n.length-3,i),r=t$X.fromArray(e[0],0,r);var o=V$L(t=t$X.midpoint(i,r,t),i,r,ar$a.ROUNDED,!1),a=e.length-1,s=e[a-1];return n=e[a],i=t$X.fromArray(s,s.length-3,i),r=t$X.fromArray(n,0,r),[o,V$L(t=t$X.midpoint(i,r,t),i,r,ar$a.ROUNDED,!1)]}function Z$W(e,t,i,r){var n=A$$;return r||(t=t$X.negate(t,t)),[(n=t$X.add(e,t,n)).x,n.y,n.z,i.x,i.y,i.z]}function q$_(e,t,i,r){for(var n=new Array(e.length),o=new Array(e.length),a=t$X.multiplyByScalar(t,i,A$$),s=t$X.negate(a,H$R),l=0,u=e.length-1,c=0;c<e.length;c+=3){var h=t$X.fromArray(e,c,P$V),d=t$X.add(h,s,I$1c);n[l++]=d.x,n[l++]=d.y,n[l++]=d.z;var f=t$X.add(h,a,I$1c);o[u--]=f.z,o[u--]=f.y,o[u--]=f.x}return r.push(n,o),r}b$$.addAttribute=function(e,t,i,r){var n=t.x,o=t.y,a=t.z;e$28(i)&&(e[i]=n,e[i+1]=o,e[i+2]=a),e$28(r)&&(e[r]=a,e[r-1]=o,e[r-2]=n)};var vr$3=new t$X,sr$3=new t$X;b$$.computePositions=function(e){var t=e.granularity,i=e.positions,r=e.ellipsoid,n=e.width/2,o=e.cornerType,a=e.saveAttributes,s=J$U,l=K$N,u=W$P,c=rr$9,h=ar$8,d=er$a,f=nr$7,p=ir$7,_=lr$5,m=tr$7,$=[],g=a?[]:void 0,v=a?[]:void 0,y=i[0],x=i[1];l=t$X.normalize(t$X.subtract(x,y,l),l),s=r.geodeticSurfaceNormal(y,s),c=t$X.normalize(t$X.cross(s,l,c),c),a&&(g.push(c.x,c.y,c.z),v.push(s.x,s.y,s.z)),f=t$X.clone(y,f),y=x,u=t$X.negate(l,u);var b,w,C=[],T=i.length;for(b=1;b<T-1;b++){s=r.geodeticSurfaceNormal(y,s),x=i[b+1],l=t$X.normalize(t$X.subtract(x,y,l),l),h=t$X.normalize(t$X.add(l,u,h),h);var S=t$X.multiplyByScalar(s,t$X.dot(l,s),vr$3);t$X.subtract(l,S,S),t$X.normalize(S,S);var E=t$X.multiplyByScalar(s,t$X.dot(u,s),sr$3);if(t$X.subtract(u,E,E),t$X.normalize(E,E),!e$27.equalsEpsilon(Math.abs(t$X.dot(S,E)),1,e$27.EPSILON7)){h=t$X.cross(h,s,h),h=t$X.cross(s,h,h),h=t$X.normalize(h,h);var A=n/Math.max(.25,t$X.magnitude(t$X.cross(h,u,A$$))),P=J$V.angleIsGreaterThanPi(l,u,y,r);h=t$X.multiplyByScalar(h,A,h),P?(p=t$X.add(y,h,p),m=t$X.add(p,t$X.multiplyByScalar(c,n,m),m),_=t$X.add(p,t$X.multiplyByScalar(c,2*n,_),_),g$K[0]=t$X.clone(f,g$K[0]),g$K[1]=t$X.clone(m,g$K[1]),$=q$_(m$U.generateArc({positions:g$K,granularity:t,ellipsoid:r}),c,n,$),a&&(g.push(c.x,c.y,c.z),v.push(s.x,s.y,s.z)),d=t$X.clone(_,d),c=t$X.normalize(t$X.cross(s,l,c),c),_=t$X.add(p,t$X.multiplyByScalar(c,2*n,_),_),f=t$X.add(p,t$X.multiplyByScalar(c,n,f),f),o===ar$a.ROUNDED||o===ar$a.BEVELED?C.push({leftPositions:V$L(p,d,_,o,P)}):C.push({leftPositions:Z$W(y,t$X.negate(h,h),_,P)})):(_=t$X.add(y,h,_),m=t$X.add(_,t$X.negate(t$X.multiplyByScalar(c,n,m),m),m),p=t$X.add(_,t$X.negate(t$X.multiplyByScalar(c,2*n,p),p),p),g$K[0]=t$X.clone(f,g$K[0]),g$K[1]=t$X.clone(m,g$K[1]),$=q$_(m$U.generateArc({positions:g$K,granularity:t,ellipsoid:r}),c,n,$),a&&(g.push(c.x,c.y,c.z),v.push(s.x,s.y,s.z)),d=t$X.clone(p,d),c=t$X.normalize(t$X.cross(s,l,c),c),p=t$X.add(_,t$X.negate(t$X.multiplyByScalar(c,2*n,p),p),p),f=t$X.add(_,t$X.negate(t$X.multiplyByScalar(c,n,f),f),f),o===ar$a.ROUNDED||o===ar$a.BEVELED?C.push({rightPositions:V$L(_,d,p,o,P)}):C.push({rightPositions:Z$W(y,h,p,P)})),u=t$X.negate(l,u)}y=x}return s=r.geodeticSurfaceNormal(y,s),g$K[0]=t$X.clone(f,g$K[0]),g$K[1]=t$X.clone(y,g$K[1]),$=q$_(m$U.generateArc({positions:g$K,granularity:t,ellipsoid:r}),c,n,$),a&&(g.push(c.x,c.y,c.z),v.push(s.x,s.y,s.z)),o===ar$a.ROUNDED&&(w=or$6($)),{positions:$,corners:C,lefts:g,normals:v,endPositions:w}};var Be$n=new t$X,Ye$e=new t$X,Le$o=new t$X,Ne$d=new t$X,Pe$j=new t$X,We$j=new t$X,fe$u=new t$X,me$z=new t$X;function Ge$h(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function j$W(e,t,i,r,n,o){var a=e.normals,s=e.tangents,l=e.bitangents,u=t$X.normalize(t$X.cross(i,t,fe$u),fe$u);o.normal&&b$$.addAttribute(a,t,r,n),o.tangent&&b$$.addAttribute(s,u,r,n),o.bitangent&&b$$.addAttribute(l,i,r,n)}function qe$g(e,t,i){var r,n,o,a=e.positions,s=e.corners,l=e.endPositions,u=e.lefts,c=e.normals,h=new a$_,d=0,f=0,p=0;for(n=0;n<a.length;n+=2)d+=o=a[n].length-3,p+=2*o,f+=a[n+1].length-3;for(d+=3,f+=3,n=0;n<s.length;n++){r=s[n];var _=s[n].leftPositions;e$28(_)?(d+=o=_.length,p+=o):(f+=o=s[n].rightPositions.length,p+=o)}var m,$=e$28(l);$&&(d+=m=l[0].length-3,f+=m,p+=6*(m/=3));var g,v,y,x,b,w,C=d+f,T=new Float64Array(C),S={normals:t.normal?new Float32Array(C):void 0,tangents:t.tangent?new Float32Array(C):void 0,bitangents:t.bitangent?new Float32Array(C):void 0},E=0,A=C-1,P=Be$n,I=Ye$e,M=m/2,O=ce$v.createTypedArray(C/3,p),D=0;if($){w=Le$o,b=Ne$d;var R=l[0];for(P=t$X.fromArray(c,0,P),I=t$X.fromArray(u,0,I),n=0;n<M;n++)w=t$X.fromArray(R,3*(M-1-n),w),b=t$X.fromArray(R,3*(M+n),b),b$$.addAttribute(T,b,E),b$$.addAttribute(T,w,void 0,A),j$W(S,P,I,E,A,t),x=(v=E/3)+1,y=(g=(A-2)/3)-1,O[D++]=g,O[D++]=v,O[D++]=y,O[D++]=y,O[D++]=v,O[D++]=x,E+=3,A-=3}var L,B,N=0,F=0,z=a[N++],k=a[N++];for(T.set(z,E),T.set(k,A-k.length+1),I=t$X.fromArray(u,F,I),o=k.length-3,n=0;n<o;n+=3)L=i.geodeticSurfaceNormal(t$X.fromArray(z,n,fe$u),fe$u),B=i.geodeticSurfaceNormal(t$X.fromArray(k,o-n,me$z),me$z),j$W(S,P=t$X.normalize(t$X.add(L,B,P),P),I,E,A,t),x=(v=E/3)+1,y=(g=(A-2)/3)-1,O[D++]=g,O[D++]=v,O[D++]=y,O[D++]=y,O[D++]=v,O[D++]=x,E+=3,A-=3;for(L=i.geodeticSurfaceNormal(t$X.fromArray(z,o,fe$u),fe$u),B=i.geodeticSurfaceNormal(t$X.fromArray(k,o,me$z),me$z),P=t$X.normalize(t$X.add(L,B,P),P),F+=3,n=0;n<s.length;n++){var V,U,X,H=(r=s[n]).leftPositions,G=r.rightPositions,W=We$j,Y=Le$o,q=Ne$d;if(P=t$X.fromArray(c,F,P),e$28(H)){for(j$W(S,P,I,void 0,A,t),A-=3,U=x,X=y,V=0;V<H.length/3;V++)W=t$X.fromArray(H,3*V,W),O[D++]=U,O[D++]=X-V-1,O[D++]=X-V,b$$.addAttribute(T,W,void 0,A),Y=t$X.fromArray(T,3*(X-V-1),Y),q=t$X.fromArray(T,3*U,q),j$W(S,P,I=t$X.normalize(t$X.subtract(Y,q,I),I),void 0,A,t),A-=3;W=t$X.fromArray(T,3*U,W),Y=t$X.subtract(t$X.fromArray(T,3*X,Y),W,Y),q=t$X.subtract(t$X.fromArray(T,3*(X-V),q),W,q),j$W(S,P,I=t$X.normalize(t$X.add(Y,q,I),I),E,void 0,t),E+=3}else{for(j$W(S,P,I,E,void 0,t),E+=3,U=y,X=x,V=0;V<G.length/3;V++)W=t$X.fromArray(G,3*V,W),O[D++]=U,O[D++]=X+V,O[D++]=X+V+1,b$$.addAttribute(T,W,E),Y=t$X.fromArray(T,3*U,Y),q=t$X.fromArray(T,3*(X+V),q),j$W(S,P,I=t$X.normalize(t$X.subtract(Y,q,I),I),E,void 0,t),E+=3;W=t$X.fromArray(T,3*U,W),Y=t$X.subtract(t$X.fromArray(T,3*(X+V),Y),W,Y),q=t$X.subtract(t$X.fromArray(T,3*X,q),W,q),j$W(S,P,I=t$X.normalize(t$X.negate(t$X.add(q,Y,I),I),I),void 0,A,t),A-=3}for(z=a[N++],k=a[N++],z.splice(0,3),k.splice(k.length-3,3),T.set(z,E),T.set(k,A-k.length+1),o=k.length-3,F+=3,I=t$X.fromArray(u,F,I),V=0;V<k.length;V+=3)L=i.geodeticSurfaceNormal(t$X.fromArray(z,V,fe$u),fe$u),B=i.geodeticSurfaceNormal(t$X.fromArray(k,o-V,me$z),me$z),j$W(S,P=t$X.normalize(t$X.add(L,B,P),P),I,E,A,t),v=(x=E/3)-1,g=(y=(A-2)/3)+1,O[D++]=g,O[D++]=v,O[D++]=y,O[D++]=y,O[D++]=v,O[D++]=x,E+=3,A-=3;E-=3,A+=3}if(j$W(S,P=t$X.fromArray(c,c.length-3,P),I,E,A,t),$){E+=3,A-=3,w=Le$o,b=Ne$d;var j=l[1];for(n=0;n<M;n++)w=t$X.fromArray(j,3*(m-n-1),w),b=t$X.fromArray(j,3*n,b),b$$.addAttribute(T,w,void 0,A),b$$.addAttribute(T,b,E),j$W(S,P,I,E,A,t),v=(x=E/3)-1,g=(y=(A-2)/3)+1,O[D++]=g,O[D++]=v,O[D++]=y,O[D++]=y,O[D++]=v,O[D++]=x,E+=3,A-=3}if(h.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:T}),t.st){var Z,K,Q=new Float32Array(C/3*2),J=0;if($){d/=3,f/=3;var ee=Math.PI/(m+1);K=1/(d-m+1),Z=1/(f-m+1);var te,ie=m/2;for(n=ie+1;n<m+1;n++)te=e$27.PI_OVER_TWO+ee*n,Q[J++]=Z*(1+Math.cos(te)),Q[J++]=.5*(1+Math.sin(te));for(n=1;n<f-m+1;n++)Q[J++]=n*Z,Q[J++]=0;for(n=m;n>ie;n--)te=e$27.PI_OVER_TWO-n*ee,Q[J++]=1-Z*(1+Math.cos(te)),Q[J++]=.5*(1+Math.sin(te));for(n=ie;n>0;n--)te=e$27.PI_OVER_TWO-ee*n,Q[J++]=1-K*(1+Math.cos(te)),Q[J++]=.5*(1+Math.sin(te));for(n=d-m;n>0;n--)Q[J++]=n*K,Q[J++]=1;for(n=1;n<ie+1;n++)te=e$27.PI_OVER_TWO+ee*n,Q[J++]=K*(1+Math.cos(te)),Q[J++]=.5*(1+Math.sin(te))}else{for(K=1/((d/=3)-1),Z=1/((f/=3)-1),n=0;n<f;n++)Q[J++]=n*Z,Q[J++]=0;for(n=d;n>0;n--)Q[J++]=(n-1)*K,Q[J++]=1}h.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:Q})}return t.normal&&(h.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:S.normals})),t.tangent&&(h.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:S.tangents})),t.bitangent&&(h.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:S.bitangents})),{attributes:h,indices:O}}function xe$r(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,r,n=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);var o,a=e.position.values.length/18,s=3*a,l=2*a,u=2*s;if(t.normal||t.bitangent||t.tangent){var c=t.normal?new Float32Array(6*s):void 0,h=t.tangent?new Float32Array(6*s):void 0,d=t.bitangent?new Float32Array(6*s):void 0,f=Be$n,p=Ye$e,_=Le$o,m=Ne$d,$=Pe$j,g=We$j,v=u;for(o=0;o<s;o+=3){var y=v+u;f=t$X.fromArray(n,o,f),p=t$X.fromArray(n,o+s,p),_=t$X.fromArray(n,(o+3)%s,_),p=t$X.subtract(p,f,p),_=t$X.subtract(_,f,_),m=t$X.normalize(t$X.cross(p,_,m),m),t.normal&&(b$$.addAttribute(c,m,y),b$$.addAttribute(c,m,y+3),b$$.addAttribute(c,m,v),b$$.addAttribute(c,m,v+3)),(t.tangent||t.bitangent)&&(g=t$X.fromArray(i,o,g),t.bitangent&&(b$$.addAttribute(d,g,y),b$$.addAttribute(d,g,y+3),b$$.addAttribute(d,g,v),b$$.addAttribute(d,g,v+3)),t.tangent&&($=t$X.normalize(t$X.cross(g,m,$),$),b$$.addAttribute(h,$,y),b$$.addAttribute(h,$,y+3),b$$.addAttribute(h,$,v),b$$.addAttribute(h,$,v+3))),v+=6}if(t.normal){for(c.set(i),o=0;o<s;o+=3)c[o+s]=-i[o],c[o+s+1]=-i[o+1],c[o+s+2]=-i[o+2];e.normal.values=c}else e.normal=void 0;if(t.bitangent?(d.set(r),d.set(r,s),e.bitangent.values=d):e.bitangent=void 0,t.tangent){var x=e.tangent.values;h.set(x),h.set(x,s),e.tangent.values=h}}if(t.st){var b=e.st.values,w=new Float32Array(6*l);w.set(b),w.set(b,l);for(var C=2*l,T=0;T<2;T++){for(w[C++]=b[0],w[C++]=b[1],o=2;o<l;o+=2){var S=b[o],E=b[o+1];w[C++]=S,w[C++]=E,w[C++]=S,w[C++]=E}w[C++]=b[0],w[C++]=b[1]}e.st.values=w}return e}function Oe$l(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],o=e[r+1],a=e[r+2];i[t++]=n,i[t++]=o,i[t++]=a,i[t++]=n,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function er$9(e,t){var i=new n$10({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,n=qe$g(b$$.computePositions(e),i,r),o=e.height,a=e.extrudedHeight,s=n.attributes,l=n.indices,u=s.position.values,c=u.length,h=new Float64Array(6*c),d=new Float64Array(c);d.set(u);var f=new Float64Array(4*c);f=Oe$l(u=A$1d.scaleToGeodeticHeight(u,o,r),0,f),f=Oe$l(d=A$1d.scaleToGeodeticHeight(d,a,r),2*c,f),h.set(u),h.set(d,c),h.set(f,2*c),s.position.values=h,s=xe$r(s,t);var p,_=c/3;if(e.shadowVolume){var m=s.normal.values;c=m.length;var $=new Float32Array(6*c);for(p=0;p<c;p++)m[p]=-m[p];$.set(m,c),$=Oe$l(m,4*c,$),s.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:$}),t.normal||(s.normal=void 0)}if(e$28(e.offsetAttribute)){var g=new Uint8Array(6*_);if(e.offsetAttribute===ee$C.TOP)g=d$1a(g,1,0,_),g=d$1a(g,1,2*_,4*_);else g=d$1a(g,e.offsetAttribute===ee$C.NONE?0:1);s.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}var v=l.length,y=_+_,x=ce$v.createTypedArray(h.length/3,2*v+3*y);x.set(l);var b,w,C,T,S=v;for(p=0;p<v;p+=3){var E=l[p],A=l[p+1],P=l[p+2];x[S++]=P+_,x[S++]=A+_,x[S++]=E+_}for(p=0;p<y;p+=2)C=(b=p+y)+1,T=(w=b+y)+1,x[S++]=b,x[S++]=w,x[S++]=C,x[S++]=C,x[S++]=w,x[S++]=T;return{attributes:s,indices:x}}var Je$a=new t$X,pe$z=new t$X,X$J=new t$W;function Ke$e(e,t,i,r,n,o){var a=t$X.subtract(t,e,Je$a);t$X.normalize(a,a);var s=i.geodeticSurfaceNormal(e,pe$z),l=t$X.cross(a,s,Je$a);t$X.multiplyByScalar(l,r,l);var u=n.latitude,c=n.longitude,h=o.latitude,d=o.longitude;t$X.add(e,l,pe$z),i.cartesianToCartographic(pe$z,X$J);var f=X$J.latitude,p=X$J.longitude;u=Math.min(u,f),c=Math.min(c,p),h=Math.max(h,f),d=Math.max(d,p),t$X.subtract(e,l,pe$z),i.cartesianToCartographic(pe$z,X$J),f=X$J.latitude,p=X$J.longitude,u=Math.min(u,f),c=Math.min(c,p),h=Math.max(h,f),d=Math.max(d,p),n.latitude=u,n.longitude=c,o.latitude=h,o.longitude=d}var Z$V=new t$X,_e$q=new t$X,G$12=new t$W,q$Z=new t$W;function Qe$d(e,t,i,r,n){var o=D$Z(e=Ge$h(e,t),t$X.equalsEpsilon),a=o.length;if(a<2||i<=0)return new h$10;var s,l,u=.5*i;if(G$12.latitude=Number.POSITIVE_INFINITY,G$12.longitude=Number.POSITIVE_INFINITY,q$Z.latitude=Number.NEGATIVE_INFINITY,q$Z.longitude=Number.NEGATIVE_INFINITY,r===ar$a.ROUNDED){var c=o[0];t$X.subtract(c,o[1],Z$V),t$X.normalize(Z$V,Z$V),t$X.multiplyByScalar(Z$V,u,Z$V),t$X.add(c,Z$V,_e$q),t.cartesianToCartographic(_e$q,X$J),s=X$J.latitude,l=X$J.longitude,G$12.latitude=Math.min(G$12.latitude,s),G$12.longitude=Math.min(G$12.longitude,l),q$Z.latitude=Math.max(q$Z.latitude,s),q$Z.longitude=Math.max(q$Z.longitude,l)}for(var h=0;h<a-1;++h)Ke$e(o[h],o[h+1],t,u,G$12,q$Z);var d=o[a-1];t$X.subtract(d,o[a-2],Z$V),t$X.normalize(Z$V,Z$V),t$X.multiplyByScalar(Z$V,u,Z$V),t$X.add(d,Z$V,_e$q),Ke$e(d,_e$q,t,u,G$12,q$Z),r===ar$a.ROUNDED&&(t.cartesianToCartographic(_e$q,X$J),s=X$J.latitude,l=X$J.longitude,G$12.latitude=Math.min(G$12.latitude,s),G$12.longitude=Math.min(G$12.longitude,l),q$Z.latitude=Math.max(q$Z.latitude,s),q$Z.longitude=Math.max(q$Z.longitude,l));var f=e$28(n)?n:new h$10;return f.north=q$Z.latitude,f.south=G$12.latitude,f.east=q$Z.longitude,f.west=G$12.longitude,f}function P$U(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.width;o$1u.defined("options.positions",t),o$1u.defined("options.width",i);var r=u$Y(e.height,0),n=u$Y(e.extrudedHeight,r);this._positions=t,this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._vertexFormat=n$10.clone(u$Y(e.vertexFormat,n$10.DEFAULT)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=u$Y(e.cornerType,ar$a.ROUNDED),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._shadowVolume=u$Y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*t$X.packedLength+t$V.packedLength+n$10.packedLength+7}P$U.pack=function(e,t,i){o$1u.defined("value",e),o$1u.defined("array",t),i=u$Y(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var o=0;o<n;++o,i+=t$X.packedLength)t$X.pack(r[o],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i++]=e._shadowVolume?1:0,t[i]=u$Y(e._offsetAttribute,-1),t};var Xe$c=t$V.clone(t$V.UNIT_SPHERE),Ze$9=new n$10,x$Z={positions:void 0,ellipsoid:Xe$c,vertexFormat:Ze$9,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};P$U.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);for(var r=e[t++],n=new Array(r),o=0;o<r;++o,t+=t$X.packedLength)n[o]=t$X.unpack(e,t);var a=t$V.unpack(e,t,Xe$c);t+=t$V.packedLength;var s=n$10.unpack(e,t,Ze$9);t+=n$10.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t++],f=1===e[t++],p=e[t];return e$28(i)?(i._positions=n,i._ellipsoid=t$V.clone(a,i._ellipsoid),i._vertexFormat=n$10.clone(s,i._vertexFormat),i._width=l,i._height=u,i._extrudedHeight=c,i._cornerType=h,i._granularity=d,i._shadowVolume=f,i._offsetAttribute=-1===p?void 0:p,i):(x$Z.positions=n,x$Z.width=l,x$Z.height=u,x$Z.extrudedHeight=c,x$Z.cornerType=h,x$Z.granularity=d,x$Z.shadowVolume=f,x$Z.offsetAttribute=-1===p?void 0:p,new P$U(x$Z))},P$U.computeRectangle=function(e,t){var i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,r=e.width;return o$1u.defined("options.positions",i),o$1u.defined("options.width",r),Qe$d(i,u$Y(e.ellipsoid,t$V.WGS84),r,u$Y(e.cornerType,ar$a.ROUNDED),t)},P$U.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=D$Z(t=Ge$h(t,r),t$X.equalsEpsilon);if(!(n.length<2||i<=0)){var o,a=e._height,s=e._extrudedHeight,l=!e$27.equalsEpsilon(a,s,0,e$27.EPSILON2),u=e._vertexFormat,c={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(l)c.height=a,c.extrudedHeight=s,c.shadowVolume=e._shadowVolume,c.offsetAttribute=e._offsetAttribute,o=er$9(c,u);else if((o=qe$g(b$$.computePositions(c),u,r)).attributes.position.values=A$1d.scaleToGeodeticHeight(o.attributes.position.values,a,r),e$28(e._offsetAttribute)){var h=e._offsetAttribute===ee$C.NONE?0:1,d=o.attributes.position.values.length,f=new Uint8Array(d/3);d$1a(f,h),o.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}var p=o.attributes,_=i$19.fromVertices(p.position.values,void 0,3);return u.position||(o.attributes.position.values=void 0),new I$1n({attributes:p,indices:o.indices,primitiveType:W$_.TRIANGLES,boundingSphere:_,offsetAttribute:e._offsetAttribute})}},P$U.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P$U({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:n$10.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(P$U.prototype,{rectangle:{get:function(){return e$28(this._rectangle)||(this._rectangle=Qe$d(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var te$G=new t$X,ie$C=new t$X,pe$y=new t$X;function ue$v(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function re$A(e,t){var i,r,n,o=[],a=e.positions,s=e.corners,l=e.endPositions,u=new a$_,c=0,h=0,d=0;for(r=0;r<a.length;r+=2)c+=n=a[r].length-3,d+=n/3*4,h+=a[r+1].length-3;for(c+=3,h+=3,r=0;r<s.length;r++){i=s[r];var f=s[r].leftPositions;e$28(f)?(c+=n=f.length,d+=n/3*2):(h+=n=s[r].rightPositions.length,d+=n/3*2)}var p,_=e$28(l);_&&(c+=p=l[0].length-3,h+=p,d+=4*(p/=3));var m,$,g,v,y,x,b=c+h,w=new Float64Array(b),C=0,T=b-1,S=p/2,E=ce$v.createTypedArray(b/3,d+4),A=0;if(E[A++]=C/3,E[A++]=(T-2)/3,_){o.push(C/3),x=te$G,y=ie$C;var P=l[0];for(r=0;r<S;r++)x=t$X.fromArray(P,3*(S-1-r),x),y=t$X.fromArray(P,3*(S+r),y),b$$.addAttribute(w,y,C),b$$.addAttribute(w,x,void 0,T),v=($=C/3)+1,g=(m=(T-2)/3)-1,E[A++]=m,E[A++]=g,E[A++]=$,E[A++]=v,C+=3,T-=3}var I=0,M=a[I++],O=a[I++];for(w.set(M,C),w.set(O,T-O.length+1),n=O.length-3,o.push(C/3,(T-2)/3),r=0;r<n;r+=3)v=($=C/3)+1,g=(m=(T-2)/3)-1,E[A++]=m,E[A++]=g,E[A++]=$,E[A++]=v,C+=3,T-=3;for(r=0;r<s.length;r++){var D,R,L=(i=s[r]).leftPositions,B=i.rightPositions,N=pe$y;if(e$28(L)){for(T-=3,R=g,o.push(v),D=0;D<L.length/3;D++)N=t$X.fromArray(L,3*D,N),E[A++]=R-D-1,E[A++]=R-D,b$$.addAttribute(w,N,void 0,T),T-=3;o.push(R-Math.floor(L.length/6)),t===ar$a.BEVELED&&o.push((T-2)/3+1),C+=3}else{for(C+=3,R=v,o.push(g),D=0;D<B.length/3;D++)N=t$X.fromArray(B,3*D,N),E[A++]=R+D,E[A++]=R+D+1,b$$.addAttribute(w,N,C),C+=3;o.push(R+Math.floor(B.length/6)),t===ar$a.BEVELED&&o.push(C/3-1),T-=3}for(M=a[I++],O=a[I++],M.splice(0,3),O.splice(O.length-3,3),w.set(M,C),w.set(O,T-O.length+1),n=O.length-3,D=0;D<O.length;D+=3)$=(v=C/3)-1,m=(g=(T-2)/3)+1,E[A++]=m,E[A++]=g,E[A++]=$,E[A++]=v,C+=3,T-=3;C-=3,T+=3,o.push(C/3,(T-2)/3)}if(_){C+=3,T-=3,x=te$G,y=ie$C;var F=l[1];for(r=0;r<S;r++)x=t$X.fromArray(F,3*(p-r-1),x),y=t$X.fromArray(F,3*r,y),b$$.addAttribute(w,x,void 0,T),b$$.addAttribute(w,y,C),$=(v=C/3)-1,m=(g=(T-2)/3)+1,E[A++]=m,E[A++]=g,E[A++]=$,E[A++]=v,C+=3,T-=3;o.push(C/3)}else o.push(C/3,(T-2)/3);return E[A++]=C/3,E[A++]=(T-2)/3,u.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:w}),{attributes:u,indices:E,wallIndices:o}}function de$u(e){var t=e.ellipsoid,i=re$A(b$$.computePositions(e),e.cornerType),r=i.wallIndices,n=e.height,o=e.extrudedHeight,a=i.attributes,s=i.indices,l=a.position.values,u=l.length,c=new Float64Array(u);c.set(l);var h=new Float64Array(2*u);if(l=A$1d.scaleToGeodeticHeight(l,n,t),c=A$1d.scaleToGeodeticHeight(c,o,t),h.set(l),h.set(c,u),a.position.values=h,u/=3,e$28(e.offsetAttribute)){var d=new Uint8Array(2*u);if(e.offsetAttribute===ee$C.TOP)d=d$1a(d,1,0,u);else d=d$1a(d,e.offsetAttribute===ee$C.NONE?0:1);a.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}var f,p=s.length,_=ce$v.createTypedArray(h.length/3,2*(p+r.length));_.set(s);var m,$,g=p;for(f=0;f<p;f+=2){var v=s[f],y=s[f+1];_[g++]=v+u,_[g++]=y+u}for(f=0;f<r.length;f++)$=(m=r[f])+u,_[g++]=m,_[g++]=$;return{attributes:a,indices:_}}function V$K(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.width;o$1u.typeOf.object("options.positions",t),o$1u.typeOf.number("options.width",i);var r=u$Y(e.height,0),n=u$Y(e.extrudedHeight,r);this._positions=t,this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=u$Y(e.cornerType,ar$a.ROUNDED),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*t$X.packedLength+t$V.packedLength+6}V$K.pack=function(e,t,i){o$1u.typeOf.object("value",e),o$1u.typeOf.object("array",t),i=u$Y(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var o=0;o<n;++o,i+=t$X.packedLength)t$X.pack(r[o],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=u$Y(e._offsetAttribute,-1),t};var oe$x=t$V.clone(t$V.UNIT_SPHERE),R$P={positions:void 0,ellipsoid:oe$x,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};V$K.unpack=function(e,t,i){o$1u.typeOf.object("array",e),t=u$Y(t,0);for(var r=e[t++],n=new Array(r),o=0;o<r;++o,t+=t$X.packedLength)n[o]=t$X.unpack(e,t);var a=t$V.unpack(e,t,oe$x);t+=t$V.packedLength;var s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return e$28(i)?(i._positions=n,i._ellipsoid=t$V.clone(a,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=u,i._cornerType=c,i._granularity=h,i._offsetAttribute=-1===d?void 0:d,i):(R$P.positions=n,R$P.width=s,R$P.height=l,R$P.extrudedHeight=u,R$P.cornerType=c,R$P.granularity=h,R$P.offsetAttribute=-1===d?void 0:d,new V$K(R$P))},V$K.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=D$Z(t=ue$v(t,r),t$X.equalsEpsilon);if(!(n.length<2||i<=0)){var o,a=e._height,s=e._extrudedHeight,l=!e$27.equalsEpsilon(a,s,0,e$27.EPSILON2),u={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};if(l)u.height=a,u.extrudedHeight=s,u.offsetAttribute=e._offsetAttribute,o=de$u(u);else if((o=re$A(b$$.computePositions(u),u.cornerType)).attributes.position.values=A$1d.scaleToGeodeticHeight(o.attributes.position.values,a,r),e$28(e._offsetAttribute)){var c=o.attributes.position.values.length,h=new Uint8Array(c/3);d$1a(h,e._offsetAttribute===ee$C.NONE?0:1),o.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}var d=o.attributes,f=i$19.fromVertices(d.position.values,void 0,3);return new I$1n({attributes:d,indices:o.indices,primitiveType:W$_.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})}};var n$U,o$17="",e$1w={};function n$T(e,t){o$1u.defined("endpoint",e),o$1u.defined("endpointResource",t);var i,r=e.externalType,n=e$28(r);if(n){if("3DTILES"!==r&&"STK_TERRAIN_SERVER"!==r)throw new t$U("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");i={url:e.options.url}}else i={url:e.url,retryAttempts:1,retryCallback:_$O};t$S.call(this,i),this._ionEndpoint=e,this._ionEndpointDomain=n?void 0:new h$$(e.url).authority,this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=n}function _$O(e,t){var i=u$Y(e._ionRoot,e),r=i._ionEndpointResource;return e$28(t)&&(401===t.statusCode||t.target instanceof Image)?(e$28(i._pendingPromise)||(i._pendingPromise=r.fetchJson().then((function(e){return i._ionEndpoint=e,e})).always((function(e){return i._pendingPromise=void 0,e}))),i._pendingPromise.then((function(t){return e._ionEndpoint=t,!0}))):o$1q.resolve(!1)}function u$L(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),new se$x({url:n$T.fromAssetId(1),requestVertexNormals:u$Y(e.requestVertexNormals,!1),requestWaterMask:u$Y(e.requestWaterMask,!1)})}e$1w.defaultAccessToken=o$17,e$1w.defaultServer=new t$S({url:""}),e$1w.getDefaultTokenCredit=function(e){if(e===o$17){if(!e$28(n$U)){n$U=new r$1a("<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at .</b>",!0)}return n$U}},e$28(Object.create)&&(n$T.prototype=Object.create(t$S.prototype),n$T.prototype.constructor=n$T),n$T.fromAssetId=function(e,t){var i=n$T._createEndpointResource(e,t);return i.fetchJson().then((function(e){return new n$T(e,i)}))},Object.defineProperties(n$T.prototype,{credits:{get:function(){return e$28(this._ionRoot)?this._ionRoot.credits:(e$28(this._credits)||(this._credits=n$T.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),n$T.getCreditsFromEndpoint=function(e,t){var i=e.attributions.map(r$1a.getIonCredit),r=e$1w.getDefaultTokenCredit(t.queryParameters.access_token);return e$28(r)&&i.push(r$1a.clone(r)),i},n$T.prototype.clone=function(e){var t=u$Y(this._ionRoot,this);return e$28(e)||(e=new n$T(t._ionEndpoint,t._ionEndpointResource)),(e=t$S.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},n$T.prototype.fetchImage=function(e){if(!this._isExternal){var t=e;e={preferBlob:!0},e$28(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return t$S.prototype.fetchImage.call(this,e)},n$T.prototype._makeRequest=function(e){return this._isExternal||new h$$(this.url).authority!==this._ionEndpointDomain||(e$28(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),t$S.prototype._makeRequest.call(this,e)},n$T._createEndpointResource=function(e,t){o$1u.defined("assetId",e),t=u$Y(t,u$Y.EMPTY_OBJECT);var i=u$Y(t.server,e$1w.defaultServer),r=u$Y(t.accessToken,e$1w.defaultAccessToken);i=t$S.createIfNeeded(i);var n={url:"v1/assets/"+e+"/endpoint"};return e$28(r)&&(n.queryParameters={access_token:r}),i.getDerivedResource(n)};var Pa$1=function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]},Y$F=1,tt$e=2,wa$3=4,Ot$5=5,ot$a=484813681109536e-20,m$T=Math.PI/2,Sa$1=.16666666666666666,Ia$3=.04722222222222222,Ra$4=.022156084656084655,_$N=1e-10,$$P=.017453292519943295,H$Q=57.29577951308232,w$F=Math.PI/4,qt$6=2*Math.PI,R$O=3.14159265359,z$O={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},Oa$2={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Ft$5=/[\s_\-\/\(\)]/g;function X$I(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),n=t.toLowerCase().replace(Ft$5,""),o=-1;++o<r.length;)if((i=r[o]).toLowerCase().replace(Ft$5,"")===n)return e[i]}var Tt$7=function(e){var t,i,r,n={},o=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var i=t.split("=");return i.push(!0),e[i[0].toLowerCase()]=i[1],e}),{}),a={proj:"projName",datum:"datumCode",rf:function(e){n.rf=parseFloat(e)},lat_0:function(e){n.lat0=e*$$P},lat_1:function(e){n.lat1=e*$$P},lat_2:function(e){n.lat2=e*$$P},lat_ts:function(e){n.lat_ts=e*$$P},lon_0:function(e){n.long0=e*$$P},lon_1:function(e){n.long1=e*$$P},lon_2:function(e){n.long2=e*$$P},alpha:function(e){n.alpha=parseFloat(e)*$$P},lonc:function(e){n.longc=e*$$P},x_0:function(e){n.x0=parseFloat(e)},y_0:function(e){n.y0=parseFloat(e)},k_0:function(e){n.k0=parseFloat(e)},k:function(e){n.k0=parseFloat(e)},a:function(e){n.a=parseFloat(e)},b:function(e){n.b=parseFloat(e)},r_a:function(){n.R_A=!0},zone:function(e){n.zone=parseInt(e,10)},south:function(){n.utmSouth=!0},towgs84:function(e){n.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){n.to_meter=parseFloat(e)},units:function(e){n.units=e;var t=X$I(Oa$2,e);t&&(n.to_meter=t.to_meter)},from_greenwich:function(e){n.from_greenwich=e*$$P},pm:function(e){var t=X$I(z$O,e);n.from_greenwich=(t||parseFloat(e))*$$P},nadgrids:function(e){"@null"===e?n.datumCode="none":n.nadgrids=e},axis:function(e){var t="ewnsud";3===e.length&&-1!==t.indexOf(e.substr(0,1))&&-1!==t.indexOf(e.substr(1,1))&&-1!==t.indexOf(e.substr(2,1))&&(n.axis=e)}};for(t in o)i=o[t],t in a?"function"==typeof(r=a[t])?r(i):n[r]=i:n[t]=i;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n},lt$9=1,jt$4=2,Qt$4=3,xt$5=4,Wt$7=5,$t$6=-1,qa$2=/\s/,Ta$3=/[A-Za-z]/,$a$2=/[A-Za-z84]/,bt$5=/[,\]]/,Ht$5=/[\d\.E\-\+]/;function Q$T(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=lt$9}function La$3(e){return new Q$T(e).output()}function Xt$5(e,t,i){Array.isArray(t)&&(i.unshift(t),t=null);var r=t?{}:e,n=i.reduce((function(e,t){return at$e(t,e),e}),r);t&&(e[t]=n)}function at$e(e,t){if(Array.isArray(e)){var i=e.shift();if("PARAMETER"===i&&(i=e.shift()),1===e.length)return Array.isArray(e[0])?(t[i]={},void at$e(e[0],t[i])):void(t[i]=e[0]);if(e.length)if("TOWGS84"!==i){if("AXIS"===i)return i in t||(t[i]=[]),void t[i].push(e);var r;switch(Array.isArray(i)||(t[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[i]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&at$e(e[2],t[i]));case"SPHEROID":case"ELLIPSOID":return t[i]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&at$e(e[3],t[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void Xt$5(t,i,e);default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return at$e(e,t[i]);return Xt$5(t,i,e)}}else t[i]=e;else t[i]=!0}else t[e]=!0}Q$T.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==xt$5)for(;qa$2.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case lt$9:return this.neutral(e);case jt$4:return this.keyword(e);case xt$5:return this.quoted(e);case Wt$7:return this.afterquote(e);case Qt$4:return this.number(e);case $t$6:return}},Q$T.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=xt$5);if(bt$5.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},Q$T.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=lt$9)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=lt$9,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=$t$6))):void 0},Q$T.prototype.number=function(e){if(!Ht$5.test(e)){if(bt$5.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},Q$T.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=Wt$7},Q$T.prototype.keyword=function(e){if($a$2.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=lt$9)}if(!bt$5.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},Q$T.prototype.neutral=function(e){if(Ta$3.test(e))return this.word=e,void(this.state=jt$4);if('"'===e)return this.word="",void(this.state=xt$5);if(Ht$5.test(e))return this.word=e,void(this.state=Qt$4);if(!bt$5.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},Q$T.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===$t$6)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Ga$3=.017453292519943295;function za$2(e,t){var i=t[0],r=t[1];!(i in e)&&r in e&&(e[i]=e[r],3===t.length&&(e[i]=t[2](e[i])))}function W$O(e){return e*Ga$3}function Da$3(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",i=0,r=e.AXIS.length;i<r;++i){var n=e.AXIS[i][0].toLowerCase();-1!==n.indexOf("north")?t+="n":-1!==n.indexOf("south")?t+="s":-1!==n.indexOf("east")?t+="e":-1!==n.indexOf("west")&&(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;function a(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),("new_zealand_geodetic_datum_1949"===e.datumCode||"new_zealand_1949"===e.datumCode)&&(e.datumCode="nzgd49"),("wgs_1984"===e.datumCode||"world_geodetic_system_1984"===e.datumCode)&&("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",W$O],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",W$O],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",W$O],["lat0","latitude_of_origin",W$O],["lat0","standard_parallel_1",W$O],["lat1","standard_parallel_1",W$O],["lat2","standard_parallel_2",W$O],["azimuth","Azimuth"],["alpha","azimuth",W$O],["srsCode","name"]].forEach((function(t){return za$2(e,t)})),!e.long0&&e.longc&&("Albers_Conic_Equal_Area"===e.projName||"Lambert_Azimuthal_Equal_Area"===e.projName)&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&("Stereographic_South_Pole"===e.projName||"Polar Stereographic (variant B)"===e.projName)&&(e.lat0=W$O(e.lat1>0?90:-90),e.lat_ts=e.lat1)}var Kt$6=function(e){var t=La$3(e),i=t.shift(),r=t.shift();t.unshift(["name",r]),t.unshift(["type",i]);var n={};return at$e(t,n),Da$3(n),n};function L$13(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?L$13[e]=Tt$7(arguments[1]):L$13[e]=Kt$6(arguments[1]):L$13[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?L$13.apply(t,e):L$13(e)}));if("string"==typeof e){if(e in L$13)return L$13[e]}else"EPSG"in e?L$13["EPSG:"+e.EPSG]=e:"ESRI"in e?L$13["ESRI:"+e.ESRI]=e:"IAU2000"in e?L$13["IAU2000:"+e.IAU2000]=e:console.log(e);return}}function ka$2(e){return"string"==typeof e}function pa$1(e){return e in L$13}Pa$1(L$13);var Ua$4=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Ba$3(e){return Ua$4.some((function(t){return e.indexOf(t)>-1}))}var Fa$3=["3857","900913","3785","102113"];function ja$1(e){var t=X$I(e,"authority");if(t){var i=X$I(t,"epsg");return i&&Fa$3.indexOf(i)>-1}}function Qa$3(e){var t=X$I(e,"extension");if(t)return X$I(t,"proj4")}function Wa$3(e){return"+"===e[0]}function Ha$3(e){if(!ka$2(e))return e;if(pa$1(e))return L$13[e];if(Ba$3(e)){var t=Kt$6(e);if(ja$1(t))return L$13["EPSG:3857"];var i=Qa$3(t);return i?Tt$7(i):t}return Wa$3(e)?Tt$7(e):void 0}var Jt$6=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},F$Y=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},ft$9=function(e){return e<0?-1:1},g$J=function(e){return Math.abs(e)<=R$O?e:e-ft$9(e)*qt$6},U$V=function(e,t,i){var r=e*i,n=.5*e;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(m$T-t))/r},Mt$5=function(e,t){for(var i,r,n=.5*e,o=m$T-2*Math.atan(t),a=0;a<=15;a++)if(i=e*Math.sin(o),o+=r=m$T-2*Math.atan(t*Math.pow((1-i)/(1+i),n))-o,Math.abs(r)<=1e-10)return o;return-9999};function Xa$2(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=F$Y(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function Ka$2(e){var t,i,r=e.x,n=e.y;if(n*H$Q>90&&n*H$Q<-90&&r*H$Q>180&&r*H$Q<-180)return null;if(Math.abs(Math.abs(n)-m$T)<=_$N)return null;if(this.sphere)t=this.x0+this.a*this.k0*g$J(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(w$F+.5*n));else{var o=Math.sin(n),a=U$V(this.e,n,o);t=this.x0+this.a*this.k0*g$J(r-this.long0),i=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=i,e}function Ja$2(e){var t,i,r=e.x-this.x0,n=e.y-this.y0;if(this.sphere)i=m$T-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var o=Math.exp(-n/(this.a*this.k0));if(-9999===(i=Mt$5(this.e,o)))return null}return t=g$J(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e}var Za$2=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],Va$3={init:Xa$2,forward:Ka$2,inverse:Ja$2,names:Za$2};function Ya$4(){}function Zt$6(e){return e}var ts=["longlat","identity"],as={init:Ya$4,forward:Zt$6,inverse:Zt$6,names:ts},ss=[Va$3,as],Ct$5={},Et$6=[];function Vt$8(e,t){var i=Et$6.length;return e.names?(Et$6[i]=e,e.names.forEach((function(e){Ct$5[e.toLowerCase()]=i})),this):(console.log(t),!0)}function is(e){if(!e)return!1;var t=e.toLowerCase();return typeof Ct$5[t]<"u"&&Et$6[Ct$5[t]]?Et$6[Ct$5[t]]:void 0}function hs(){ss.forEach(Vt$8)}var es={start:hs,add:Vt$8,get:is},b$_={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},rs=b$_.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};function ns(e,t,i,r){var n=e*e,o=t*t,a=(n-o)/n,s=0;return r?(n=(e*=1-a*(Sa$1+a*(Ia$3+a*Ra$4)))*e,a=0):s=Math.sqrt(a),{es:a,e:s,ep2:(n-o)/o}}function os(e,t,i,r,n){if(!e){var o=X$I(b$_,r);o||(o=rs),e=o.a,t=o.b,i=o.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||Math.abs(e-t)<_$N)&&(n=!0,t=e),{a:e,b:t,rf:i,sphere:n}}b$_.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var q$Y={};function ls(e,t,i,r,n,o){var a={};return a.datum_type=void 0===e||"none"===e?Ot$5:wa$3,t&&(a.datum_params=t.map(parseFloat),(0!==a.datum_params[0]||0!==a.datum_params[1]||0!==a.datum_params[2])&&(a.datum_type=Y$F),a.datum_params.length>3&&(0!==a.datum_params[3]||0!==a.datum_params[4]||0!==a.datum_params[5]||0!==a.datum_params[6])&&(a.datum_type=tt$e,a.datum_params[3]*=ot$a,a.datum_params[4]*=ot$a,a.datum_params[5]*=ot$a,a.datum_params[6]=a.datum_params[6]/1e6+1)),a.a=i,a.b=r,a.es=n,a.ep2=o,a}function j$V(e,t){if(!(this instanceof j$V))return new j$V(e);t=t||function(e){if(e)throw e};var i=Ha$3(e);if("object"==typeof i){var r=j$V.projections.get(i.projName);if(r){if(i.datumCode&&"none"!==i.datumCode){var n=X$I(q$Y,i.datumCode);n&&(i.datum_params=n.towgs84?n.towgs84.split(","):null,i.ellps=n.ellipse,i.datumName=n.datumName?n.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84";var o=os(i.a,i.b,i.rf,i.ellps,i.sphere),a=ns(o.a,o.b,o.rf,i.R_A),s=i.datum||ls(i.datumCode,i.datum_params,o.a,o.b,a.es,a.ep2);Jt$6(this,i),Jt$6(this,r),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=s,this.init(),t(null,this)}else t(e)}else t(e)}function fs$1(e,t){return!(e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===Y$F?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==tt$e||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}function Yt$5(e,t,i){var r,n,o,a,s=e.x,l=e.y,u=e.z?e.z:0;if(l<-m$T&&l>-1.001*m$T)l=-m$T;else if(l>m$T&&l<1.001*m$T)l=m$T;else{if(l<-m$T)return{x:-1/0,y:-1/0,z:e.z};if(l>m$T)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(l),a=Math.cos(l),o=n*n,{x:((r=i/Math.sqrt(1-t*o))+u)*a*Math.cos(s),y:(r+u)*a*Math.sin(s),z:(r*(1-t)+u)*n}}function ta$1(e,t,i,r){var n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v=1e-12,y=e.x,x=e.y,b=e.z?e.z:0;if(n=Math.sqrt(y*y+x*x),o=Math.sqrt(y*y+x*x+b*b),n/i<v){if($=0,o/i<v)return m$T,g=-r,{x:e.x,y:e.y,z:e.z}}else $=Math.atan2(x,y);a=b/o,h=(s=n/o)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),d=a*l,m=0;do{m++,u=t*(c=i/Math.sqrt(1-t*d*d))/(c+(g=n*h+b*d-c*(1-t*d*d))),_=(p=a*(l=1/Math.sqrt(1-u*(2-u)*s*s)))*h-(f=s*(1-u)*l)*d,h=f,d=p}while(_*_>1e-24&&m<30);return{x:$,y:Math.atan(p/Math.abs(f)),z:g}}function Ms(e,t,i){if(t===Y$F)return{x:e.x+i[0],y:e.y+i[1],z:e.z+i[2]};if(t===tt$e){var r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],u=i[6];return{x:u*(e.x-l*e.y+s*e.z)+r,y:u*(l*e.x+e.y-a*e.z)+n,z:u*(-s*e.x+a*e.y+e.z)+o}}}function vs(e,t,i){if(t===Y$F)return{x:e.x-i[0],y:e.y-i[1],z:e.z-i[2]};if(t===tt$e){var r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],l=i[5],u=i[6],c=(e.x-r)/u,h=(e.y-n)/u,d=(e.z-o)/u;return{x:c+l*h-s*d,y:-l*c+h+a*d,z:s*c-a*h+d}}}function At$6(e){return e===Y$F||e===tt$e}q$Y.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},q$Y.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},q$Y.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},q$Y.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},q$Y.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},q$Y.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},q$Y.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},q$Y.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},q$Y.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},q$Y.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},q$Y.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},q$Y.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},q$Y.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},q$Y.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},q$Y.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},q$Y.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},q$Y.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},j$V.projections=es,j$V.projections.start();var us=function(e,t,i){return fs$1(e,t)||e.datum_type===Ot$5||t.datum_type===Ot$5||e.es===t.es&&e.a===t.a&&!At$6(e.datum_type)&&!At$6(t.datum_type)?i:(i=Yt$5(i,e.es,e.a),At$6(e.datum_type)&&(i=Ms(i,e.datum_type,e.datum_params)),At$6(t.datum_type)&&(i=vs(i,t.datum_type,t.datum_params)),ta$1(i,t.es,t.a,t.b))},aa$2=function(e,t,i){var r,n,o,a=i.x,s=i.y,l=i.z||0,u={};for(o=0;o<3;o++)if(!t||2!==o||void 0!==i.z)switch(0===o?(r=a,n=-1!=="ew".indexOf(e.axis[o])?"x":"y"):1===o?(r=s,n=-1!=="ns".indexOf(e.axis[o])?"y":"x"):(r=l,n="z"),e.axis[o]){case"e":case"w":case"n":case"s":u[n]=r;break;case"u":void 0!==i[n]&&(u.z=r);break;case"d":void 0!==i[n]&&(u.z=-r);break;default:return null}return u},sa$1=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},cs=function(e){ia$1(e.x),ia$1(e.y)};function ia$1(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function ms(e,t){return(e.datum.datum_type===Y$F||e.datum.datum_type===tt$e)&&"WGS84"!==t.datumCode||(t.datum.datum_type===Y$F||t.datum.datum_type===tt$e)&&"WGS84"!==e.datumCode}function Nt$6(e,t,i){var r;return Array.isArray(i)&&(i=sa$1(i)),cs(i),e.datum&&t.datum&&ms(e,t)&&(i=Nt$6(e,r=new j$V("WGS84"),i),e=r),"enu"!==e.axis&&(i=aa$2(e,!1,i)),"longlat"===e.projName?i={x:i.x*$$P,y:i.y*$$P,z:i.z||0}:(e.to_meter&&(i={x:i.x*e.to_meter,y:i.y*e.to_meter,z:i.z||0}),i=e.inverse(i)),e.from_greenwich&&(i.x+=e.from_greenwich),i=us(e.datum,t.datum,i),t.from_greenwich&&(i={x:i.x-t.from_greenwich,y:i.y,z:i.z||0}),"longlat"===t.projName?i={x:i.x*H$Q,y:i.y*H$Q,z:i.z||0}:(i=t.forward(i),t.to_meter&&(i={x:i.x/t.to_meter,y:i.y/t.to_meter,z:i.z||0})),"enu"!==t.axis?aa$2(t,!0,i):i}var ha$3=j$V("WGS84");function Lt$7(e,t,i){var r,n,o;return Array.isArray(i)?(r=Nt$6(e,t,i)||{x:NaN,y:NaN},i.length>2?typeof e.name<"u"&&"geocent"===e.name||typeof t.name<"u"&&"geocent"===t.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(i.splice(3)):[r.x,r.y,i[2]].concat(i.splice(3)):[r.x,r.y].concat(i.splice(2)):[r.x,r.y]):(n=Nt$6(e,t,i),2===(o=Object.keys(i)).length||o.forEach((function(r){if(typeof e.name<"u"&&"geocent"===e.name||typeof t.name<"u"&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;n[r]=i[r]})),n)}function ea$2(e){return e instanceof j$V?e:e.oProj?e.oProj:j$V(e)}function k$W(e,t,i){e=ea$2(e);var r,n=!1;return typeof t>"u"?(t=e,e=ha$3,n=!0):(typeof t.x<"u"||Array.isArray(t))&&(i=t,t=e,e=ha$3,n=!0),t=ea$2(t),i?Lt$7(e,t,i):(r={forward:function(i){return Lt$7(e,t,i)},inverse:function(i){return Lt$7(t,e,i)}},n&&(r.oProj=t),r)}var ra$2=6,na$1="AJSAJS",oa$1="AFAFAF",st$7=65,D$S=73,p$W=79,vt$9=86,ut$a=90,ds={forward:la$2,inverse:ys,toPoint:fa$2};function la$2(e,t){return t=t||5,xs(_s({lat:e[1],lon:e[0]}),t)}function ys(e){var t=zt$5(ua$3(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function fa$2(e){var t=zt$5(ua$3(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Gt$5(e){return e*(Math.PI/180)}function Ma$2(e){return e/Math.PI*180}function _s(e){var t,i,r,n,o,a,s,l=e.lat,u=e.lon,c=6378137,h=.00669438,d=.9996,f=Gt$5(l),p=Gt$5(u);s=Math.floor((u+180)/6)+1,180===u&&(s=60),l>=56&&l<64&&u>=3&&u<12&&(s=32),l>=72&&l<84&&(u>=0&&u<9?s=31:u>=9&&u<21?s=33:u>=21&&u<33?s=35:u>=33&&u<42&&(s=37)),a=Gt$5(6*(s-1)-180+3),t=h/(1-h),i=c/Math.sqrt(1-h*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=t*Math.cos(f)*Math.cos(f);var _=d*i*((o=Math.cos(f)*(p-a))+(1-r+n)*o*o*o/6+(5-18*r+r*r+72*n-58*t)*o*o*o*o*o/120)+5e5,m=d*(c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-35*h*h*h/3072*Math.sin(6*f))+i*Math.tan(f)*(o*o/2+(5-r+9*n+4*n*n)*o*o*o*o/24+(61-58*r+r*r+600*n-330*t)*o*o*o*o*o*o/720));return l<0&&(m+=1e7),{northing:Math.round(m),easting:Math.round(_),zoneNumber:s,zoneLetter:gs(l)}}function zt$5(e){var t=e.northing,i=e.easting,r=e.zoneLetter,n=e.zoneNumber;if(n<0||n>60)return null;var o,a,s,l,u,c,h,d,f,p=.9996,_=6378137,m=.00669438,$=(1-Math.sqrt(1-m))/(1+Math.sqrt(1-m)),g=i-5e5,v=t;r<"N"&&(v-=1e7),h=6*(n-1)-180+3,o=m/(1-m),f=(d=v/p/6367449.145945056)+(3*$/2-27*$*$*$/32)*Math.sin(2*d)+(21*$*$/16-55*$*$*$*$/32)*Math.sin(4*d)+151*$*$*$/96*Math.sin(6*d),a=_/Math.sqrt(1-m*Math.sin(f)*Math.sin(f)),s=Math.tan(f)*Math.tan(f),l=o*Math.cos(f)*Math.cos(f),u=_*(1-m)/Math.pow(1-m*Math.sin(f)*Math.sin(f),1.5),c=g/(a*p);var y=f-a*Math.tan(f)/u*(c*c/2-(5+3*s+10*l-4*l*l-9*o)*c*c*c*c/24+(61+90*s+298*l+45*s*s-252*o-3*l*l)*c*c*c*c*c*c/720);y=Ma$2(y);var x,b=(c-(1+2*s+l)*c*c*c/6+(5-2*l+28*s-3*l*l+8*o+24*s*s)*c*c*c*c*c/120)/Math.cos(f);if(b=h+Ma$2(b),e.accuracy){var w=zt$5({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});x={top:w.lat,right:w.lon,bottom:y,left:b}}else x={lat:y,lon:b};return x}function gs(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function xs(e,t){var i="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+bs(e.easting,e.northing,e.zoneNumber)+i.substr(i.length-5,t)+r.substr(r.length-5,t)}function bs(e,t,i){var r=va$2(i);return Cs(Math.floor(e/1e5),Math.floor(t/1e5)%20,r)}function va$2(e){var t=e%ra$2;return 0===t&&(t=ra$2),t}function Cs(e,t,i){var r=i-1,n=na$1.charCodeAt(r),o=oa$1.charCodeAt(r),a=n+e-1,s=o+t,l=!1;return a>ut$a&&(a=a-ut$a+st$7-1,l=!0),(a===D$S||n<D$S&&a>D$S||(a>D$S||n<D$S)&&l)&&a++,(a===p$W||n<p$W&&a>p$W||(a>p$W||n<p$W)&&l)&&(++a===D$S&&a++),a>ut$a&&(a=a-ut$a+st$7-1),s>vt$9?(s=s-vt$9+st$7-1,l=!0):l=!1,(s===D$S||o<D$S&&s>D$S||(s>D$S||o<D$S)&&l)&&s++,(s===p$W||o<p$W&&s>p$W||(s>p$W||o<p$W)&&l)&&(++s===D$S&&s++),s>vt$9&&(s=s-vt$9+st$7-1),String.fromCharCode(a)+String.fromCharCode(s)}function ua$3(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,n="",o=0;!/[A-Z]/.test(t=e.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+e;n+=t,o++}var a=parseInt(n,10);if(0===o||o+3>i)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(o,o+=2);for(var l=va$2(a),u=Es(r.charAt(0),l),c=As(r.charAt(1),l);c<Ns(s);)c+=2e6;var h=i-o;if(h%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var d,f,p,_=h/2,m=0,$=0;return _>0&&(d=1e5/Math.pow(10,_),f=e.substring(o,o+_),m=parseFloat(f)*d,p=e.substring(o+_),$=parseFloat(p)*d),{easting:m+u,northing:$+c,zoneLetter:s,zoneNumber:a,accuracy:d}}function Es(e,t){for(var i=na$1.charCodeAt(t-1),r=1e5,n=!1;i!==e.charCodeAt(0);){if(++i===D$S&&i++,i===p$W&&i++,i>ut$a){if(n)throw"Bad character: "+e;i=st$7,n=!0}r+=1e5}return r}function As(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var i=oa$1.charCodeAt(t-1),r=0,n=!1;i!==e.charCodeAt(0);){if(++i===D$S&&i++,i===p$W&&i++,i>vt$9){if(n)throw"Bad character: "+e;i=st$7,n=!0}r+=1e5}return r}function Ns(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function it$9(e,t,i){if(!(this instanceof it$9))return new it$9(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&typeof t>"u"){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}it$9.fromMGRS=function(e){return new it$9(fa$2(e))},it$9.prototype.toMGRS=function(e){return la$2([this.x,this.y],e)};var Ps=1,ws=.25,ca$2=.046875,ma$3=.01953125,da$2=.01068115234375,Ss=.75,Is=.46875,Rs=.013020833333333334,Os=.007120768229166667,qs=.3645833333333333,Ts=.005696614583333333,$s=.3076171875,ya$3=function(e){var t=[];t[0]=Ps-e*(ws+e*(ca$2+e*(ma$3+e*da$2))),t[1]=e*(Ss-e*(ca$2+e*(ma$3+e*da$2)));var i=e*e;return t[2]=i*(Is-e*(Rs+e*Os)),i*=e,t[3]=i*(qs-e*Ts),t[4]=i*e*$s,t},Pt$6=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},Ls=20,_a$3=function(e,t,i){for(var r=1/(1-t),n=e,o=Ls;o;--o){var a=Math.sin(n),s=1-t*a*a;if(n-=s=(Pt$6(n,a,Math.cos(n),i)-e)*(s*Math.sqrt(s))*r,Math.abs(s)<_$N)return n}return n};function Gs(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ya$3(this.es),this.ml0=Pt$6(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function zs(e){var t,i,r,n=e.x,o=e.y,a=g$J(n-this.long0),s=Math.sin(o),l=Math.cos(o);if(this.es){var u=l*a,c=Math.pow(u,2),h=this.ep2*Math.pow(l,2),d=Math.pow(h,2),f=Math.abs(l)>_$N?Math.tan(o):0,p=Math.pow(f,2),_=Math.pow(p,2);t=1-this.es*Math.pow(s,2),u/=Math.sqrt(t);var m=Pt$6(o,s,l,this.en);i=this.a*(this.k0*u*(1+c/6*(1-p+h+c/20*(5-18*p+_+14*h-58*p*h+c/42*(61+179*_-_*p-479*p)))))+this.x0,r=this.a*(this.k0*(m-this.ml0+s*a*u/2*(1+c/12*(5-p+9*h+4*d+c/30*(61+_-58*p+270*h-330*p*h+c/56*(1385+543*_-_*p-3111*p))))))+this.y0}else{var $=l*Math.sin(a);if(Math.abs(Math.abs($)-1)<_$N)return 93;if(i=.5*this.a*this.k0*Math.log((1+$)/(1-$))+this.x0,r=l*Math.cos(a)/Math.sqrt(1-Math.pow($,2)),($=Math.abs(r))>=1){if($-1>_$N)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e}function Ds(e){var t,i,r,n,o=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,i=_a$3(t,this.es,this.en),Math.abs(i)<m$T){var s=Math.sin(i),l=Math.cos(i),u=Math.abs(l)>_$N?Math.tan(i):0,c=this.ep2*Math.pow(l,2),h=Math.pow(c,2),d=Math.pow(u,2),f=Math.pow(d,2);t=1-this.es*Math.pow(s,2);var p=o*Math.sqrt(t)/this.k0,_=Math.pow(p,2);r=i-(t*=u)*_/(1-this.es)*.5*(1-_/12*(5+3*d-9*c*d+c-4*h-_/30*(61+90*d-252*c*d+45*f+46*c-_/56*(1385+3633*d+4095*f+1574*f*d)))),n=g$J(this.long0+p*(1-_/6*(1+2*d+c-_/20*(5+28*d+24*f+8*c*d+6*c-_/42*(61+662*d+1320*f+720*f*d))))/l)}else r=m$T*ft$9(a),n=0;else{var m=Math.exp(o/this.k0),$=.5*(m-1/m),g=this.lat0+a/this.k0,v=Math.cos(g);t=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow($,2))),r=Math.asin(t),a<0&&(r=-r),n=0===$&&0===v?0:g$J(Math.atan2($,v)+this.long0)}return e.x=n,e.y=r,e}var ks=["Transverse_Mercator","Transverse Mercator","tmerc"],ps={init:Gs,forward:zs,inverse:Ds,names:ks},ga$2=function(e){var t=Math.exp(e);return t=(t-1/t)/2},Dt$9=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},Us=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i},Bs=function(e){var t=Math.abs(e);return t=Us(t*(1+t/(Dt$9(1,t)+1))),e<0?-t:t},kt$6=function(e,t){for(var i,r=2*Math.cos(2*t),n=e.length-1,o=e[n],a=0;--n>=0;)i=r*o-a+e[n],a=o,o=i;return t+i*Math.sin(2*t)},Fs=function(e,t){for(var i,r=2*Math.cos(t),n=e.length-1,o=e[n],a=0;--n>=0;)i=r*o-a+e[n],a=o,o=i;return Math.sin(t)*i},js=function(e){var t=Math.exp(e);return t=(t+1/t)/2},xa$3=function(e,t,i){for(var r,n,o=Math.sin(t),a=Math.cos(t),s=ga$2(i),l=js(i),u=2*a*l,c=-2*o*s,h=e.length-1,d=e[h],f=0,p=0,_=0;--h>=0;)r=p,n=f,d=u*(p=d)-r-c*(f=_)+e[h],_=c*p-n+u*f;return[(u=o*l)*d-(c=a*s)*_,u*_+c*d]};function Qs(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var r=kt$6(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Fs(this.gtu,2*r))}function Ws(e){var t=g$J(e.x-this.long0),i=e.y;i=kt$6(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),o=Math.sin(t),a=Math.cos(t);i=Math.atan2(r,a*n),t=Math.atan2(o*n,Dt$9(r,n*a)),t=Bs(Math.tan(t));var s,l,u=xa$3(this.gtu,2*i,2*t);return i+=u[0],t+=u[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e}function Hs(e){var t,i,r=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);if(n=(n-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var o=xa$3(this.utg,2*n,2*r);n+=o[0],r+=o[1],r=Math.atan(ga$2(r));var a=Math.sin(n),s=Math.cos(n),l=Math.sin(r),u=Math.cos(r);n=Math.atan2(a*u,Dt$9(l,u*s)),r=Math.atan2(l,u*s),t=g$J(r+this.long0),i=kt$6(this.cgb,n)}else t=1/0,i=1/0;return e.x=t,e.y=i,e}var Xs=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"],wt$8={init:Qs,forward:Ws,inverse:Hs,names:Xs},Ks=function(e,t){if(void 0===e){if((e=Math.floor(30*(g$J(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e},Js="etmerc";function Zs(){var e=Ks(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*$$P,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,wt$8.init.apply(this),this.forward=wt$8.forward,this.inverse=wt$8.inverse}var Vs=["Universal Transverse Mercator System","utm"],Ys={init:Zs,names:Vs,dependsOn:Js},pt$9=function(e,t){return Math.pow((1-e)/(1+e),t)},ti$5=20;function ai$5(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+w$F)/(Math.pow(Math.tan(.5*this.lat0+w$F),this.C)*pt$9(this.e*e,this.ratexp))}function si$4(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+w$F),this.C)*pt$9(this.e*Math.sin(i),this.ratexp))-m$T,e.x=this.C*t,e}function ii$6(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+w$F)/this.K,1/this.C),n=ti$5;n>0&&(i=2*Math.atan(r*pt$9(this.e*Math.sin(e.y),-.5*this.e))-m$T,!(Math.abs(i-e.y)<1e-14));--n)e.y=i;return n?(e.x=t,e.y=i,e):null}var hi$6=["gauss"],Ut$3={init:ai$5,forward:si$4,inverse:ii$6,names:hi$6};function ei$5(){Ut$3.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function ri$4(e){var t,i,r,n;return e.x=g$J(e.x-this.long0),Ut$3.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),n=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=n*i*Math.sin(e.x),e.y=n*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function ni$6(e){var t,i,r,n,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(o,this.R2);t=Math.sin(a),i=Math.cos(a),n=Math.asin(i*this.sinc0+e.y*t*this.cosc0/o),r=Math.atan2(e.x*t,o*this.cosc0*i-e.y*this.sinc0*t)}else n=this.phic0,r=0;return e.x=r,e.y=n,Ut$3.inverse.apply(this,[e]),e.x=g$J(e.x+this.long0),e}var oi$4=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],li$5={init:ei$5,forward:ri$4,inverse:ni$6,names:oi$4};function fi$4(e,t,i){return t*=i,Math.tan(.5*(m$T+e))*Math.pow((1-t)/(1+t),.5*i)}function Mi$4(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_$N&&(this.k0=.5*(1+ft$9(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=_$N&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=_$N&&(this.k0=.5*this.cons*F$Y(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/U$V(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=F$Y(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-m$T,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function vi$6(e){var t,i,r,n,o,a,s=e.x,l=e.y,u=Math.sin(l),c=Math.cos(l),h=g$J(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=_$N&&Math.abs(l+this.lat0)<=_$N?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*u+this.coslat0*c*Math.cos(h)),e.x=this.a*t*c*Math.sin(h)+this.x0,e.y=this.a*t*(this.coslat0*u-this.sinlat0*c*Math.cos(h))+this.y0,e):(i=2*Math.atan(this.ssfn_(l,u,this.e))-m$T,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=_$N?(o=U$V(this.e,l*this.con,this.con*u),a=2*this.a*this.k0*o/this.cons,e.x=this.x0+a*Math.sin(s-this.long0),e.y=this.y0-this.con*a*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<_$N?(t=2*this.a*this.k0/(1+n*Math.cos(h)),e.y=t*r):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(h))),e.y=t*(this.cosX0*r-this.sinX0*n*Math.cos(h))+this.y0),e.x=t*n*Math.sin(h)+this.x0,e))}function ui$5(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,n,o,a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,i=this.lat0,a<=_$N?(e.x=t,e.y=i,e):(i=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),t=Math.abs(this.coslat0)<_$N?this.lat0>0?g$J(this.long0+Math.atan2(e.x,-1*e.y)):g$J(this.long0+Math.atan2(e.x,e.y)):g$J(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=_$N){if(a<=_$N)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=a*this.cons/(2*this.a*this.k0),i=this.con*Mt$5(this.e,r),t=this.con*g$J(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else n=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=_$N?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+e.y*Math.sin(n)*this.cosX0/a),t=g$J(this.long0+Math.atan2(e.x*Math.sin(n),a*this.cosX0*Math.cos(n)-e.y*this.sinX0*Math.sin(n)))),i=-1*Mt$5(this.e,Math.tan(.5*(m$T+o)));return e.x=t,e.y=i,e}var ci$6=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],mi$6={init:Mi$4,forward:vi$6,inverse:ui$5,names:ci$6,ssfn_:fi$4};function di$5(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,n=2*r-Math.pow(r,2),o=this.e=Math.sqrt(n);this.R=this.k0*i*Math.sqrt(1-n)/(1-n*Math.pow(t,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+o*t)/(1-o*t));this.K=a-this.alpha*s+this.alpha*o/2*l}function yi$5(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e}function _i$7(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),s=this.lambda0+a/this.alpha,l=0,u=o,c=-1e3,h=0;Math.abs(u-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(u))/2)),c=u,u=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=u,e}var gi$6=["somerc"],xi$4={init:di$5,forward:yi$5,inverse:_i$7,names:gi$6};function bi$4(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var e=Math.sin(this.lat0),t=Math.cos(this.lat0),i=this.e*e;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(t,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var r,n,o=U$V(this.e,this.lat0,e),a=this.bl/t*Math.sqrt((1-this.es)/(1-i*i));if(a*a<1&&(a=1),isNaN(this.longc)){var s=U$V(this.e,this.lat1,Math.sin(this.lat1)),l=U$V(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(a+Math.sqrt(a*a-1))*Math.pow(o,this.bl):this.el=(a-Math.sqrt(a*a-1))*Math.pow(o,this.bl);var u=Math.pow(s,this.bl),c=Math.pow(l,this.bl);n=.5*((r=this.el/u)-1/r);var h=(this.el*this.el-c*u)/(this.el*this.el+c*u),d=(c-u)/(c+u),f=g$J(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(h*Math.tan(.5*this.bl*f)/d)/this.bl,this.long0=g$J(this.long0);var p=g$J(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/n),this.alpha=Math.asin(a*Math.sin(this.gamma0))}else r=this.lat0>=0?a+Math.sqrt(a*a-1):a-Math.sqrt(a*a-1),this.el=r*Math.pow(o,this.bl),n=.5*(r-1/r),this.gamma0=Math.asin(Math.sin(this.alpha)/a),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha))}function Ci$5(e){var t,i,r,n=e.x,o=e.y,a=g$J(n-this.long0);if(Math.abs(Math.abs(o)-m$T)<=_$N)r=o>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(w$F+r*this.gamma0*.5)),t=-1*r*m$T*this.al/this.bl;else{var s=U$V(this.e,o,Math.sin(o)),l=this.el/Math.pow(s,this.bl),u=.5*(l-1/l),c=.5*(l+1/l),h=Math.sin(this.bl*a),d=(u*Math.sin(this.gamma0)-h*Math.cos(this.gamma0))/c;i=Math.abs(Math.abs(d)-1)<=_$N?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,t=Math.abs(Math.cos(this.bl*a))<=_$N?this.al*this.bl*a:this.al*Math.atan2(u*Math.cos(this.gamma0)+h*Math.sin(this.gamma0),Math.cos(this.bl*a))/this.bl}return this.no_rot?(e.x=this.x0+t,e.y=this.y0+i):(t-=this.uc,e.x=this.x0+i*Math.cos(this.alpha)+t*Math.sin(this.alpha),e.y=this.y0+t*Math.cos(this.alpha)-i*Math.sin(this.alpha)),e}function Ei$4(e){var t,i;this.no_rot?(i=e.y-this.y0,t=e.x-this.x0):(i=(e.x-this.x0)*Math.cos(this.alpha)-(e.y-this.y0)*Math.sin(this.alpha),t=(e.y-this.y0)*Math.cos(this.alpha)+(e.x-this.x0)*Math.sin(this.alpha),t+=this.uc);var r=Math.exp(-1*this.bl*i/this.al),n=.5*(r-1/r),o=.5*(r+1/r),a=Math.sin(this.bl*t/this.al),s=(a*Math.cos(this.gamma0)+n*Math.sin(this.gamma0))/o,l=Math.pow(this.el/Math.sqrt((1+s)/(1-s)),1/this.bl);return Math.abs(s-1)<_$N?(e.x=this.long0,e.y=m$T):Math.abs(s+1)<_$N?(e.x=this.long0,e.y=-1*m$T):(e.y=Mt$5(this.e,l),e.x=g$J(this.long0-Math.atan2(n*Math.cos(this.gamma0)-a*Math.sin(this.gamma0),Math.cos(this.bl*t/this.al))/this.bl)),e}var Ai$3=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"],Ni$4={init:bi$4,forward:Ci$5,inverse:Ei$4,names:Ai$3};function Pi$6(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<_$N)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),i=Math.cos(this.lat1),r=F$Y(this.e,t,i),n=U$V(this.e,this.lat1,t),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=F$Y(this.e,o,a),l=U$V(this.e,this.lat2,o),u=U$V(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>_$N?this.ns=Math.log(r/s)/Math.log(n/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function wi$5(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=_$N&&(i=ft$9(i)*(m$T-2*_$N));var r,n,o=Math.abs(Math.abs(i)-m$T);if(o>_$N)r=U$V(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((o=i*this.ns)<=0)return null;n=0}var a=this.ns*g$J(t-this.long0);return e.x=this.k0*(n*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-n*Math.cos(a))+this.y0,e}function Si$5(e){var t,i,r,n,o,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),i=1):(t=-Math.sqrt(a*a+s*s),i=-1);var l=0;if(0!==t&&(l=Math.atan2(i*a,i*s)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(n=Mt$5(this.e,r)))return null}else n=-m$T;return o=g$J(l/this.ns+this.long0),e.x=o,e.y=n,e}var Ii$4=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"],Ri$4={init:Pi$6,forward:wi$5,inverse:Si$5,names:Ii$4};function Oi$3(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function qi$3(e){var t,i,r,n,o,a,s,l=e.x,u=e.y,c=g$J(l-this.long0);return t=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/t)-this.s45),r=-c*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),o=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e}function Ti$4(e){var t,i,r,n,o,a,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),o=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x)/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(t)),e.x=this.long0-i/this.alfa,a=t,s=0;var u=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(s=1),a=e.y,u+=1}while(0===s&&u<15);return u>=15?null:e}var $i$3=["Krovak","krovak"],Li$3={init:Oi$3,forward:qi$3,inverse:Ti$4,names:$i$3},G$11=function(e,t,i,r,n){return e*n-t*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},ct$a=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},mt$7=function(e){return.375*e*(1+.25*e*(1+.46875*e))},dt$b=function(e){return.05859375*e*e*(1+.75*e)},yt$6=function(e){return e*e*e*(35/3072)},ht$9=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},et$c=function(e){return Math.abs(e)<m$T?e:e-ft$9(e)*Math.PI},St$5=function(e,t,i,r,n){var o,a;o=e/t;for(var s=0;s<15;s++)if(o+=a=(e-(t*o-i*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)))/(t-2*i*Math.cos(2*o)+4*r*Math.cos(4*o)-6*n*Math.cos(6*o)),Math.abs(a)<=1e-10)return o;return NaN};function Gi$3(){this.sphere||(this.e0=ct$a(this.es),this.e1=mt$7(this.es),this.e2=dt$b(this.es),this.e3=yt$6(this.es),this.ml0=this.a*G$11(this.e0,this.e1,this.e2,this.e3,this.lat0))}function zi$4(e){var t,i,r=e.x,n=e.y;if(r=g$J(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var o=Math.sin(n),a=Math.cos(n),s=ht$9(this.a,this.e,o),l=Math.tan(n)*Math.tan(n),u=r*Math.cos(n),c=u*u,h=this.es*a*a/(1-this.es);t=s*u*(1-c*l*(1/6-(8-l+8*h)*c/120)),i=this.a*G$11(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*o/a*c*(.5+(5-l+6*h)*c/24)}return e.x=t+this.x0,e.y=i+this.y0,e}function Di$6(e){e.x-=this.x0,e.y-=this.y0;var t,i,r=e.x/this.a,n=e.y/this.a;if(this.sphere){var o=n+this.lat0;t=Math.asin(Math.sin(o)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(o))}else{var a=this.ml0/this.a+n,s=St$5(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-m$T)<=_$N)return e.x=this.long0,e.y=m$T,n<0&&(e.y*=-1),e;var l=ht$9(this.a,this.e,Math.sin(s)),u=l*l*l/this.a/this.a*(1-this.es),c=Math.pow(Math.tan(s),2),h=r*this.a/l,d=h*h;t=s-l*Math.tan(s)/u*h*h*(.5-(1+3*c)*h*h/24),i=h*(1-d*(c/3+(1+3*c)*c*d/15))/Math.cos(s)}return e.x=g$J(i+this.long0),e.y=et$c(t),e}var ki$5=["Cassini","Cassini_Soldner","cass"],pi$5={init:Gi$3,forward:zi$4,inverse:Di$6,names:ki$5},K$M=function(e,t){var i;return e>1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t},Ui$4=1,Bi$3=2,Fi$3=3,ji$5=4;function Qi$2(){var e,t=Math.abs(this.lat0);if(Math.abs(t-m$T)<_$N?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<_$N?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=K$M(this.e,1),this.mmf=.5/(1-this.es),this.apa=th(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=K$M(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Wi$3(e){var t,i,r,n,o,a,s,l,u,c,h=e.x,d=e.y;if(h=g$J(h-this.long0),this.sphere){if(o=Math.sin(d),c=Math.cos(d),r=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*r:1+this.sinph0*o+this.cosph0*c*r)<=_$N)return null;t=(i=Math.sqrt(2/i))*c*Math.sin(h),i*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*c*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.phi0)<_$N)return null;i=w$F-.5*d,t=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(h),i*=r}}else{switch(s=0,l=0,u=0,r=Math.cos(h),n=Math.sin(h),o=Math.sin(d),a=K$M(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:u=1+this.sinb1*s+this.cosb1*l*r;break;case this.EQUIT:u=1+l*r;break;case this.N_POLE:u=m$T+d,a=this.qp-a;break;case this.S_POLE:u=d-m$T,a=this.qp+a}if(Math.abs(u)<_$N)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),i=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*s-this.sinb1*l*r):(u=Math.sqrt(2/(1+l*r)))*s*this.ymf,t=this.xmf*u*l*n;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(u=Math.sqrt(a))*n,i=r*(this.mode===this.S_POLE?u:-u)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e}function Hi$3(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,n,o,a,s,l=e.x/this.a,u=e.y/this.a;if(this.sphere){var c,h=0,d=0;if((i=.5*(c=Math.sqrt(l*l+u*u)))>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(d=Math.sin(i),h=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=_$N?0:Math.asin(u*d/c),l*=d,u=h*c;break;case this.OBLIQ:i=Math.abs(c)<=_$N?this.phi0:Math.asin(h*this.sinph0+u*d*this.cosph0/c),l*=d*this.cosph0,u=(h-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:u=-u,i=m$T-i;break;case this.S_POLE:i-=m$T}t=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,u):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,u*=this.dd,(a=Math.sqrt(l*l+u*u))<_$N)return e.x=0,e.y=this.phi0,e;n=2*Math.asin(.5*a/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(s=r*this.sinb1+u*n*this.cosb1/a,o=this.qp*s,u=a*this.cosb1*r-u*this.sinb1*n):(s=u*n/a,o=this.qp*s,u=a*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(o=l*l+u*u))return e.x=0,e.y=this.phi0,e;s=1-o/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(l,u),i=ah(Math.asin(s),this.apa)}return e.x=g$J(this.long0+t),e.y=i,e}var Xi$3=.3333333333333333,Ki$3=.17222222222222222,Ji$3=.10257936507936508,Zi$3=.06388888888888888,Vi$4=.0664021164021164,Yi$2=.016415012942191543;function th(e){var t,i=[];return i[0]=e*Xi$3,t=e*e,i[0]+=t*Ki$3,i[1]=t*Zi$3,t*=e,i[0]+=t*Ji$3,i[1]+=t*Vi$4,i[2]=t*Yi$2,i}function ah(e,t){var i=e+e;return e+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}var sh=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],ih={init:Qi$2,forward:Wi$3,inverse:Hi$3,names:sh,S_POLE:Ui$4,N_POLE:Bi$3,EQUIT:Fi$3,OBLIQ:ji$5},J$T=function(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)};function hh(){Math.abs(this.lat1+this.lat2)<_$N||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=F$Y(this.e3,this.sin_po,this.cos_po),this.qs1=K$M(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=F$Y(this.e3,this.sin_po,this.cos_po),this.qs2=K$M(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=K$M(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>_$N?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function eh(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=K$M(this.e3,this.sin_phi,this.cos_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*g$J(t-this.long0),a=n*Math.sin(o)+this.x0,s=this.rh-n*Math.cos(o)+this.y0;return e.x=a,e.y=s,e}function rh(e){var t,i,r,n,o,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),n=0,0!==t&&(n=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),o=g$J(n/this.ns0+this.long0),e.x=o,e.y=a,e}function nh(e,t){var i,r,n,o,a=J$T(.5*t);if(e<_$N)return a;for(var s=e*e,l=1;l<=25;l++)if(a+=o=.5*(n=1-(r=e*(i=Math.sin(a)))*r)*n/Math.cos(a)*(t/(1-s)-i/n+.5/e*Math.log((1-r)/(1+r))),Math.abs(o)<=1e-7)return a;return null}var oh=["Albers_Conic_Equal_Area","Albers","aea"],lh={init:hh,forward:eh,inverse:rh,names:oh,phi1z:nh};function fh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Mh(e){var t,i,r,n,o,a,s,l=e.x,u=e.y;return r=g$J(l-this.long0),t=Math.sin(u),i=Math.cos(u),n=Math.cos(r),1,(o=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(o)<=_$N?(a=this.x0+1*this.a*i*Math.sin(r)/o,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)/o):(a=this.x0+this.infinity_dist*i*Math.sin(r),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*n)),e.x=a,e.y=s,e}function vh(e){var t,i,r,n,o,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(n=Math.atan2(t,this.rc),i=Math.sin(n),r=Math.cos(n),a=J$T(r*this.sin_p14+e.y*i*this.cos_p14/t),o=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),o=g$J(this.long0+o)):(a=this.phic0,o=0),e.x=o,e.y=a,e}var uh=["gnom"],ch={init:fh,forward:Mh,inverse:vh,names:uh},mh=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*m$T:m$T;for(var r,n,o,a,s=Math.asin(.5*t),l=0;l<30;l++)if(n=Math.sin(s),o=Math.cos(s),a=e*n,s+=r=Math.pow(1-a*a,2)/(2*o)*(t/(1-e*e)-n/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(r)<=1e-10)return s;return NaN};function dh(){this.sphere||(this.k0=F$Y(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function yh(e){var t,i,r=e.x,n=e.y,o=g$J(r-this.long0);if(this.sphere)t=this.x0+this.a*o*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var a=K$M(this.e,Math.sin(n));t=this.x0+this.a*this.k0*o,i=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=i,e}function _h(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=g$J(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=mh(this.e,2*e.y*this.k0/this.a),t=g$J(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e}var gh=["cea"],xh={init:dh,forward:yh,inverse:_h,names:gh};function bh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Ch(e){var t=e.x,i=e.y,r=g$J(t-this.long0),n=et$c(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*n,e}function Eh(e){var t=e.x,i=e.y;return e.x=g$J(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=et$c(this.lat0+(i-this.y0)/this.a),e}var Ah=["Equirectangular","Equidistant_Cylindrical","eqc"],Nh={init:bh,forward:Ch,inverse:Eh,names:Ah},ba$2=20;function Ph(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct$a(this.es),this.e1=mt$7(this.es),this.e2=dt$b(this.es),this.e3=yt$6(this.es),this.ml0=this.a*G$11(this.e0,this.e1,this.e2,this.e3,this.lat0)}function wh(e){var t,i,r,n=e.x,o=e.y,a=g$J(n-this.long0);if(r=a*Math.sin(o),this.sphere)Math.abs(o)<=_$N?(t=this.a*a,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(o),i=this.a*(et$c(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=_$N)t=this.a*a,i=-1*this.ml0;else{var s=ht$9(this.a,this.e,Math.sin(o))/Math.tan(o);t=s*Math.sin(r),i=this.a*G$11(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e}function Sh(e){var t,i,r,n,o,a,s,l,u;if(r=e.x-this.x0,n=e.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=_$N)t=g$J(r/this.a+this.long0),i=0;else{var c;for(a=this.lat0+n/this.a,s=r*r/this.a/this.a+a*a,l=a,o=ba$2;o;--o)if(l+=u=-1*(a*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-a)/c-1),Math.abs(u)<=_$N){i=l;break}t=g$J(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=_$N)i=0,t=g$J(this.long0+r/this.a);else{var h,d,f,p,_;for(a=(this.ml0+n)/this.a,s=r*r/this.a/this.a+a*a,l=a,o=ba$2;o;--o)if(_=this.e*Math.sin(l),h=Math.sqrt(1-_*_)*Math.tan(l),d=this.a*G$11(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=u=(a*(h*(p=d/this.a)+1)-p-.5*h*(p*p+s))/(this.es*Math.sin(2*l)*(p*p+s-2*a*p)/(4*h)+(a-p)*(h*f-2/Math.sin(2*l))-f),Math.abs(u)<=_$N){i=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=g$J(this.long0+Math.asin(r*h/this.a)/Math.sin(i))}return e.x=t,e.y=i,e}var Ih=["Polyconic","poly"],Rh={init:Ph,forward:wh,inverse:Sh,names:Ih};function Oh(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function qh(e){var t,i=e.x,r=e.y-this.lat0,n=i-this.long0,o=r/ot$a*1e-5,a=n,s=1,l=0;for(t=1;t<=10;t++)s*=o,l+=this.A[t]*s;var u,c=l,h=a,d=1,f=0,p=0,_=0;for(t=1;t<=6;t++)u=f*c+d*h,d=d*c-f*h,f=u,p=p+this.B_re[t]*d-this.B_im[t]*f,_=_+this.B_im[t]*d+this.B_re[t]*f;return e.x=_*this.a+this.x0,e.y=p*this.a+this.y0,e}function Th(e){var t,i,r=e.x,n=e.y,o=r-this.x0,a=(n-this.y0)/this.a,s=o/this.a,l=1,u=0,c=0,h=0;for(t=1;t<=6;t++)i=u*a+l*s,l=l*a-u*s,u=i,c=c+this.C_re[t]*l-this.C_im[t]*u,h=h+this.C_im[t]*l+this.C_re[t]*u;for(var d=0;d<this.iterations;d++){var f,p=c,_=h,m=a,$=s;for(t=2;t<=6;t++)f=_*c+p*h,p=p*c-_*h,_=f,m+=(t-1)*(this.B_re[t]*p-this.B_im[t]*_),$+=(t-1)*(this.B_im[t]*p+this.B_re[t]*_);p=1,_=0;var g=this.B_re[1],v=this.B_im[1];for(t=2;t<=6;t++)f=_*c+p*h,p=p*c-_*h,_=f,g+=t*(this.B_re[t]*p-this.B_im[t]*_),v+=t*(this.B_im[t]*p+this.B_re[t]*_);var y=g*g+v*v;c=(m*g+$*v)/y,h=($*g-m*v)/y}var x=c,b=h,w=1,C=0;for(t=1;t<=9;t++)w*=x,C+=this.D[t]*w;var T=this.lat0+C*ot$a*1e5,S=this.long0+b;return e.x=S,e.y=T,e}var $h=["New_Zealand_Map_Grid","nzmg"],Lh={init:Oh,forward:qh,inverse:Th,names:$h};function Gh(){}function zh(e){var t=e.x,i=e.y,r=g$J(t-this.long0),n=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return e.x=n,e.y=o,e}function Dh(e){e.x-=this.x0,e.y-=this.y0;var t=g$J(this.long0+e.x/this.a),i=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=i,e}var kh=["Miller_Cylindrical","mill"],ph={init:Gh,forward:zh,inverse:Dh,names:kh},Uh=20;function Bh(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=ya$3(this.es)}function Fh(e){var t,i,r=e.x,n=e.y;if(r=g$J(r-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(n),a=Uh;a;--a){var s=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=s,Math.abs(s)<_$N)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;t=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),u=Math.cos(n);i=this.a*Pt$6(n,l,u,this.en),t=this.a*r*u/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=i,e}function jh(e){var t,i,r,n;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+Math.cos(t)),this.m?t=J$T((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=J$T(Math.sin(t)/this.n)),r=g$J(r+this.long0),t=et$c(t)):(t=_a$3(e.y/this.a,this.es,this.en),(n=Math.abs(t))<m$T?(n=Math.sin(t),i=this.long0+e.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(t)),r=g$J(i)):n-_$N<m$T&&(r=this.long0)),e.x=r,e.y=t,e}var Qh=["Sinusoidal","sinu"],Wh={init:Bh,forward:Fh,inverse:jh,names:Qh};function Hh(){}function Xh(e){for(var t=e.x,i=e.y,r=g$J(t-this.long0),n=i,o=Math.PI*Math.sin(i);;){var a=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=a,Math.abs(a)<_$N)break}n/=2,Math.PI/2-Math.abs(i)<_$N&&(r=0);var s=.900316316158*this.a*r*Math.cos(n)+this.x0,l=1.4142135623731*this.a*Math.sin(n)+this.y0;return e.x=s,e.y=l,e}function Kh(e){var t,i;e.x-=this.x0,e.y-=this.y0,i=e.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),t=Math.asin(i);var r=g$J(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return e.x=r,e.y=n,e}var Jh=["Mollweide","moll"],Zh={init:Hh,forward:Xh,inverse:Kh,names:Jh};function Vh(){Math.abs(this.lat1+this.lat2)<_$N||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct$a(this.es),this.e1=mt$7(this.es),this.e2=dt$b(this.es),this.e3=yt$6(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=F$Y(this.e,this.sinphi,this.cosphi),this.ml1=G$11(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<_$N?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=F$Y(this.e,this.sinphi,this.cosphi),this.ml2=G$11(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=G$11(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Yh(e){var t,i=e.x,r=e.y;if(this.sphere)t=this.a*(this.g-r);else{var n=G$11(this.e0,this.e1,this.e2,this.e3,r);t=this.a*(this.g-n)}var o=this.ns*g$J(i-this.long0),a=this.x0+t*Math.sin(o),s=this.y0+this.rh-t*Math.cos(o);return e.x=a,e.y=s,e}function te$F(e){var t,i,r,n;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(0!==i&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return n=g$J(this.long0+o/this.ns),r=et$c(this.g-i/this.a),e.x=n,e.y=r,e;var a=this.g-i/this.a;return r=St$5(a,this.e0,this.e1,this.e2,this.e3),n=g$J(this.long0+o/this.ns),e.x=n,e.y=r,e}var ae$z=["Equidistant_Conic","eqdc"],se$v={init:Vh,forward:Yh,inverse:te$F,names:ae$z};function ie$B(){this.R=this.a}function he$r(e){var t,i,r=e.x,n=e.y,o=g$J(r-this.long0);Math.abs(n)<=_$N&&(t=this.x0+this.R*o,i=this.y0);var a=J$T(2*Math.abs(n/Math.PI));(Math.abs(o)<=_$N||Math.abs(Math.abs(n)-m$T)<=_$N)&&(t=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),l=s*s,u=Math.sin(a),c=Math.cos(a),h=c/(u+c-1),d=h*h,f=h*(2/u-1),p=f*f,_=Math.PI*this.R*(s*(h-p)+Math.sqrt(l*(h-p)*(h-p)-(p+l)*(d-p)))/(p+l);o<0&&(_=-_),t=this.x0+_;var m=l+h;return _=Math.PI*this.R*(f*m-s*Math.sqrt((p+l)*(l+1)-m*m))/(p+l),i=n>=0?this.y0+_:this.y0-_,e.x=t,e.y=i,e}function ee$A(e){var t,i,r,n,o,a,s,l,u,c,h,d;return e.x-=this.x0,e.y-=this.y0,h=Math.PI*this.R,o=(r=e.x/h)*r+(n=e.y/h)*n,h=3*(n*n/(l=-2*(a=-Math.abs(n)*(1+o))+1+2*n*n+o*o)+(2*(s=a-2*n*n+r*r)*s*s/l/l/l-9*a*s/l/l)/27)/(u=(a-s*s/3/l)/l)/(c=2*Math.sqrt(-u/3)),Math.abs(h)>1&&(h=h>=0?1:-1),d=Math.acos(h)/3,i=e.y>=0?(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(r)<_$N?this.long0:g$J(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-n*n)+o*o))/2/r),e.x=t,e.y=i,e}var re$z=["Van_der_Grinten_I","VanDerGrinten","vandg"],ne$G={init:ie$B,forward:he$r,inverse:ee$A,names:re$z};function oe$w(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function le$u(e){var t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w=e.x,C=e.y,T=Math.sin(e.y),S=Math.cos(e.y),E=g$J(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=_$N?(e.x=this.x0+this.a*(m$T-C)*Math.sin(E),e.y=this.y0-this.a*(m$T-C)*Math.cos(E),e):Math.abs(this.sin_p12+1)<=_$N?(e.x=this.x0+this.a*(m$T+C)*Math.sin(E),e.y=this.y0+this.a*(m$T+C)*Math.cos(E),e):(g=this.sin_p12*T+this.cos_p12*S*Math.cos(E),$=(m=Math.acos(g))/Math.sin(m),e.x=this.x0+this.a*$*S*Math.sin(E),e.y=this.y0+this.a*$*(this.cos_p12*T-this.sin_p12*S*Math.cos(E)),e):(t=ct$a(this.es),i=mt$7(this.es),r=dt$b(this.es),n=yt$6(this.es),Math.abs(this.sin_p12-1)<=_$N?(o=this.a*G$11(t,i,r,n,m$T),a=this.a*G$11(t,i,r,n,C),e.x=this.x0+(o-a)*Math.sin(E),e.y=this.y0-(o-a)*Math.cos(E),e):Math.abs(this.sin_p12+1)<=_$N?(o=this.a*G$11(t,i,r,n,m$T),a=this.a*G$11(t,i,r,n,C),e.x=this.x0+(o+a)*Math.sin(E),e.y=this.y0+(o+a)*Math.cos(E),e):(s=T/S,l=ht$9(this.a,this.e,this.sin_p12),u=ht$9(this.a,this.e,T),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(u*S)),v=0===(h=Math.atan2(Math.sin(E),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(E)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(h)-Math.PI)<=_$N?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(E)*Math.cos(c)/Math.sin(h)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),m=l*v*(1-(y=v*v)*(_=(f=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*f)*(1-_)/6+(x=y*v)/8*(p=d*f)*(1-2*_)+(b=x*v)/120*(_*(4-7*_)-3*d*d*(1-7*_))-b*v/48*p),e.x=this.x0+m*Math.sin(h),e.y=this.y0+m*Math.cos(h),e))}function fe$t(e){var t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y))>2*m$T*this.a?void 0:(i=t/this.a,r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(t)<=_$N?a=this.lat0:(a=J$T(n*this.sin_p12+e.y*r*this.cos_p12/t),s=Math.abs(this.lat0)-m$T,o=Math.abs(s)<=_$N?this.lat0>=0?g$J(this.long0+Math.atan2(e.x,-e.y)):g$J(this.long0-Math.atan2(-e.x,e.y)):g$J(this.long0+Math.atan2(e.x*r,t*this.cos_p12*n-e.y*this.sin_p12*r))),e.x=o,e.y=a,e):(l=ct$a(this.es),u=mt$7(this.es),c=dt$b(this.es),h=yt$6(this.es),Math.abs(this.sin_p12-1)<=_$N?(d=this.a*G$11(l,u,c,h,m$T),t=Math.sqrt(e.x*e.x+e.y*e.y),a=St$5((d-t)/this.a,l,u,c,h),o=g$J(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=a,e):Math.abs(this.sin_p12+1)<=_$N?(d=this.a*G$11(l,u,c,h,m$T),t=Math.sqrt(e.x*e.x+e.y*e.y),a=St$5((t-d)/this.a,l,u,c,h),o=g$J(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),_=Math.atan2(e.x,e.y),f=ht$9(this.a,this.e,this.sin_p12),m=Math.cos(_),g=-($=this.e*this.cos_p12*m)*$/(1-this.es),v=3*this.es*(1-g)*this.sin_p12*this.cos_p12*m/(1-this.es),b=1-g*(x=(y=t/f)-g*(1+g)*Math.pow(y,3)/6-v*(1+3*g)*Math.pow(y,4)/24)*x/2-y*x*x*x/6,p=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*m),o=g$J(this.long0+Math.asin(Math.sin(_)*Math.sin(x)/Math.cos(p))),a=Math.atan((1-this.es*b*this.sin_p12/Math.sin(p))*Math.tan(p)/(1-this.es)),e.x=o,e.y=a,e))}var Me$p=["Azimuthal_Equidistant","aeqd"],ve$p={init:oe$w,forward:le$u,inverse:fe$t,names:Me$p};function ue$u(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function ce$s(e){var t,i,r,n,o,a,s,l=e.x,u=e.y;return r=g$J(l-this.long0),t=Math.sin(u),i=Math.cos(u),n=Math.cos(r),1,((o=this.sin_p14*t+this.cos_p14*i*n)>0||Math.abs(o)<=_$N)&&(a=1*this.a*i*Math.sin(r),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*n)),e.x=a,e.y=s,e}function me$y(e){var t,i,r,n,o,a,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=J$T(t/this.a),r=Math.sin(i),n=Math.cos(i),a=this.long0,Math.abs(t)<=_$N?(s=this.lat0,e.x=a,e.y=s,e):(s=J$T(n*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.abs(this.lat0)-m$T,Math.abs(o)<=_$N?(a=this.lat0>=0?g$J(this.long0+Math.atan2(e.x,-e.y)):g$J(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=g$J(this.long0+Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r)),e.x=a,e.y=s,e))}var de$t=["ortho"],ye$q={init:ue$u,forward:ce$s,inverse:me$y,names:de$t},I$1b={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},P$T={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function _e$p(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=m$T-w$F/2?this.face=I$1b.TOP:this.lat0<=-(m$T-w$F/2)?this.face=I$1b.BOTTOM:Math.abs(this.long0)<=w$F?this.face=I$1b.FRONT:Math.abs(this.long0)<=m$T+w$F?this.face=this.long0>0?I$1b.RIGHT:I$1b.LEFT:this.face=I$1b.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function ge$p(e){var t,i,r,n,o,a,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===I$1b.TOP)n=m$T-t,i>=w$F&&i<=m$T+w$F?(l.value=P$T.AREA_0,r=i-m$T):i>m$T+w$F||i<=-(m$T+w$F)?(l.value=P$T.AREA_1,r=i>0?i-R$O:i+R$O):i>-(m$T+w$F)&&i<=-w$F?(l.value=P$T.AREA_2,r=i+m$T):(l.value=P$T.AREA_3,r=i);else if(this.face===I$1b.BOTTOM)n=m$T+t,i>=w$F&&i<=m$T+w$F?(l.value=P$T.AREA_0,r=-i+m$T):i<w$F&&i>=-w$F?(l.value=P$T.AREA_1,r=-i):i<-w$F&&i>=-(m$T+w$F)?(l.value=P$T.AREA_2,r=-i-m$T):(l.value=P$T.AREA_3,r=i>0?-i+R$O:-i-R$O);else{var u,c,h,d,f,p;this.face===I$1b.RIGHT?i=rt$f(i,+m$T):this.face===I$1b.BACK?i=rt$f(i,+R$O):this.face===I$1b.LEFT&&(i=rt$f(i,-m$T)),d=Math.sin(t),f=Math.cos(t),p=Math.sin(i),u=f*Math.cos(i),c=f*p,h=d,this.face===I$1b.FRONT?r=It$a(n=Math.acos(u),h,c,l):this.face===I$1b.RIGHT?r=It$a(n=Math.acos(c),h,-u,l):this.face===I$1b.BACK?r=It$a(n=Math.acos(-u),h,-c,l):this.face===I$1b.LEFT?r=It$a(n=Math.acos(-c),h,u,l):(n=r=0,l.value=P$T.AREA_0)}return a=Math.atan(12/R$O*(r+Math.acos(Math.sin(r)*Math.cos(w$F))-m$T)),o=Math.sqrt((1-Math.cos(n))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(r))))),l.value===P$T.AREA_1?a+=m$T:l.value===P$T.AREA_2?a+=R$O:l.value===P$T.AREA_3&&(a+=1.5*R$O),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e}function xe$q(e){var t,i,r,n,o,a,s,l,u,c,h,d,f={lam:0,phi:0},p={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?p.value=P$T.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(p.value=P$T.AREA_1,t-=m$T):e.x<0&&-e.x>=Math.abs(e.y)?(p.value=P$T.AREA_2,t=t<0?t+R$O:t-R$O):(p.value=P$T.AREA_3,t+=m$T),u=R$O/12*Math.tan(t),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(r=Math.cos(t))*r*(n=Math.tan(i))*n*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===I$1b.TOP)l=Math.acos(s),f.phi=m$T-l,p.value===P$T.AREA_0?f.lam=a+m$T:p.value===P$T.AREA_1?f.lam=a<0?a+R$O:a-R$O:p.value===P$T.AREA_2?f.lam=a-m$T:f.lam=a;else if(this.face===I$1b.BOTTOM)l=Math.acos(s),f.phi=l-m$T,p.value===P$T.AREA_0?f.lam=-a+m$T:p.value===P$T.AREA_1?f.lam=-a:p.value===P$T.AREA_2?f.lam=-a-m$T:f.lam=a<0?-a-R$O:-a+R$O;else{var _,m,$;u=(_=s)*_,m=(u+=($=u>=1?0:Math.sqrt(1-u)*Math.sin(a))*$)>=1?0:Math.sqrt(1-u),p.value===P$T.AREA_1?(u=m,m=-$,$=u):p.value===P$T.AREA_2?(m=-m,$=-$):p.value===P$T.AREA_3&&(u=m,m=$,$=-u),this.face===I$1b.RIGHT?(u=_,_=-m,m=u):this.face===I$1b.BACK?(_=-_,m=-m):this.face===I$1b.LEFT&&(u=_,_=m,m=-u),f.phi=Math.acos(-$)-m$T,f.lam=Math.atan2(m,_),this.face===I$1b.RIGHT?f.lam=rt$f(f.lam,-m$T):this.face===I$1b.BACK?f.lam=rt$f(f.lam,-R$O):this.face===I$1b.LEFT&&(f.lam=rt$f(f.lam,+m$T))}0!==this.es&&(c=f.phi<0?1:0,h=Math.tan(f.phi),d=this.b/Math.sqrt(h*h+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),c&&(f.phi=-f.phi));return f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e}function It$a(e,t,i,r){var n;return e<_$N?(r.value=P$T.AREA_0,n=0):(n=Math.atan2(t,i),Math.abs(n)<=w$F?r.value=P$T.AREA_0:n>w$F&&n<=m$T+w$F?(r.value=P$T.AREA_1,n-=m$T):n>m$T+w$F||n<=-(m$T+w$F)?(r.value=P$T.AREA_2,n=n>=0?n-R$O:n+R$O):(r.value=P$T.AREA_3,n+=m$T)),n}function rt$f(e,t){var i=e+t;return i<-R$O?i+=qt$6:i>+R$O&&(i-=qt$6),i}var be$s=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Ce$m={init:_e$p,forward:ge$p,inverse:xe$q,names:be$s},Bt$7=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],_t$9=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ca$2=.8487,Ea$3=1.3523,Aa$4=H$Q/5,Ee$l=1/Aa$4,nt$d=18,Rt$6=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},Ae$n=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};function Ne$c(e,t,i,r){for(var n=t;r;--r){var o=e(n);if(n-=o,Math.abs(o)<i)break}return n}function Pe$i(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function we$n(e){var t=g$J(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*Aa$4);r<0?r=0:r>=nt$d&&(r=nt$d-1),i=H$Q*(i-Ee$l*r);var n={x:Rt$6(Bt$7[r],i)*t,y:Rt$6(_t$9[r],i)};return e.y<0&&(n.y=-n.y),n.x=n.x*this.a*Ca$2+this.x0,n.y=n.y*this.a*Ea$3+this.y0,n}function Se$f(e){var t={x:(e.x-this.x0)/(this.a*Ca$2),y:Math.abs(e.y-this.y0)/(this.a*Ea$3)};if(t.y>=1)t.x/=Bt$7[nt$d][0],t.y=e.y<0?-m$T:m$T;else{var i=Math.floor(t.y*nt$d);for(i<0?i=0:i>=nt$d&&(i=nt$d-1);;)if(_t$9[i][0]>t.y)--i;else{if(!(_t$9[i+1][0]<=t.y))break;++i}var r=_t$9[i],n=5*(t.y-r[0])/(_t$9[i+1][0]-r[0]);n=Ne$c((function(e){return(Rt$6(r,e)-t.y)/Ae$n(r,e)}),n,_$N,100),t.x/=Rt$6(Bt$7[i],n),t.y=(5*i+n)*$$P,e.y<0&&(t.y=-t.y)}return t.x=g$J(t.x+this.long0),t}var Ie$o=["Robinson","robin"],Re$l={init:Pe$i,forward:we$n,inverse:Se$f,names:Ie$o};function Oe$k(){this.name="geocent"}function qe$f(e){return Yt$5(e,this.es,this.a)}function Te$o(e){return ta$1(e,this.es,this.a,this.b)}var $e$b=["Geocentric","geocentric","geocent","Geocent"],Le$n={init:Oe$k,forward:qe$f,inverse:Te$o,names:$e$b},Ge$g=function(e){e.Proj.projections.add(ps),e.Proj.projections.add(wt$8),e.Proj.projections.add(Ys),e.Proj.projections.add(li$5),e.Proj.projections.add(mi$6),e.Proj.projections.add(xi$4),e.Proj.projections.add(Ni$4),e.Proj.projections.add(Ri$4),e.Proj.projections.add(Li$3),e.Proj.projections.add(pi$5),e.Proj.projections.add(ih),e.Proj.projections.add(lh),e.Proj.projections.add(ch),e.Proj.projections.add(xh),e.Proj.projections.add(Nh),e.Proj.projections.add(Rh),e.Proj.projections.add(Lh),e.Proj.projections.add(ph),e.Proj.projections.add(Wh),e.Proj.projections.add(Zh),e.Proj.projections.add(se$v),e.Proj.projections.add(ne$G),e.Proj.projections.add(ve$p),e.Proj.projections.add(ye$q),e.Proj.projections.add(Ce$m),e.Proj.projections.add(Re$l),e.Proj.projections.add(Le$n)};function p$V(e){e=u$Y(e,{});var t=u$Y(e.name,"tmerc"),i=u$Y(e.centralMeridian,117),r=u$Y(e.primeMeridian,0),n=u$Y(e.standardParallel_1,0),o=u$Y(e.standardParallel_2,0),a=u$Y(e.eastFalse,5e5),s=u$Y(e.northFalse,0),l=u$Y(e.semimajorAxis,6378137),u=u$Y(e.inverseFlattening,298.257222101),c=(1-1/u)*l,h=e.ellps;if(e$28(h))d="+proj={name} +lon_0={lon_0} +lat_0={lat_0} +lat_1={lat_1} +lat_2={lat_2} +x_0={x_0} +y_0={y_0} +ellps={ellps}",this._projection=d.replace("{name}",t).replace("{lon_0}",i).replace("{lat_0}",r).replace("{lat_1}",n).replace("{lat_2}",o).replace("{x_0}",a).replace("{y_0}",s).replace("{ellps}",h);else{var d="+proj={name} +lon_0={lon_0} +lat_0={lat_0} +lat_1={lat_1} +lat_2={lat_2} +x_0={x_0} +y_0={y_0} +a={a} +b={b} +rf={rf}";this._projection=d.replace("{name}",t).replace("{lon_0}",i).replace("{lat_0}",r).replace("{lat_1}",n).replace("{lat_2}",o).replace("{x_0}",a).replace("{y_0}",s).replace("{a}",l).replace("{b}",c).replace("{rf}",u)}}k$W.defaultDatum="WGS84",k$W.Proj=j$V,k$W.WGS84=new k$W.Proj("WGS84"),k$W.Point=it$9,k$W.toPoint=sa$1,k$W.defs=L$13,k$W.transform=Nt$6,k$W.mgrs=ds,k$W.version="2.6.1",Ge$g(k$W),Object.defineProperties(p$V.prototype,{projection:{get:function(){return this._projection}}}),p$V.prototype.project=function(e,t){var i=k$W(this._projection,[e$27.toDegrees(e.longitude),e$27.toDegrees(e.latitude)]);return e$28(t)?(t.x=i[0],t.y=i[1],t.z=e.height,t):new t$X(i[0],i[1],e.height)},p$V.prototype.unproject=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required");var i=k$W(this._projection).inverse([e.x,e.y]),r=e$27.toRadians(i[0]),n=e$27.toRadians(i[1]);return e$28(t)?(t.longitude=r,t.latitude=n,t):new t$W(r,n)};var I$1a={computePositions:function(e,t,i,r,n){var o,a=.5*e,s=-a,l=r+r,u=new Float64Array(3*(n?2*l:l)),c=0,h=0,d=n?3*l:0,f=n?3*(l+r):3*r;for(o=0;o<r;o++){var p=o/r*e$27.TWO_PI,_=Math.cos(p),m=Math.sin(p),$=_*i,g=m*i,v=_*t,y=m*t;u[h+d]=$,u[h+d+1]=g,u[h+d+2]=s,u[h+f]=v,u[h+f+1]=y,u[h+f+2]=a,h+=3,n&&(u[c++]=$,u[c++]=g,u[c++]=s,u[c++]=v,u[c++]=y,u[c++]=a)}return u}},M$T=new o$1k,at$d=new t$X,ut$9=new t$X,mt$6=new t$X,vt$8=new t$X;function l$_(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=u$Y(e.vertexFormat,n$10.DEFAULT),o=u$Y(e.slices,128);if(!e$28(t))throw new t$Z("options.length must be defined.");if(!e$28(i))throw new t$Z("options.topRadius must be defined.");if(!e$28(r))throw new t$Z("options.bottomRadius must be defined.");if(o<3)throw new t$Z("options.slices must be greater than or equal to 3.");if(e$28(e.offsetAttribute)&&e.offsetAttribute===ee$C.TOP)throw new t$Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=n$10.clone(n),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}l$_.packedLength=n$10.packedLength+5,l$_.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=u$Y(e._offsetAttribute,-1),t};var H$P=new n$10,E$Z={vertexFormat:H$P,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0},G$10;l$_.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r=n$10.unpack(e,t,H$P);t+=n$10.packedLength;var n=e[t++],o=e[t++],a=e[t++],s=e[t++],l=e[t];return e$28(i)?(i._vertexFormat=n$10.clone(r,i._vertexFormat),i._length=n,i._topRadius=o,i._bottomRadius=a,i._slices=s,i._offsetAttribute=-1===l?void 0:l,i):(E$Z.length=n,E$Z.topRadius=o,E$Z.bottomRadius=a,E$Z.slices=s,E$Z.offsetAttribute=-1===l?void 0:l,new l$_(E$Z))},l$_.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._vertexFormat,o=e._slices;if(!(t<=0||i<0||r<0||0===i&&0===r)){var a,s=o+o,l=o+s,u=s+s,c=I$1a.computePositions(t,i,r,o,!0),h=n.st?new Float32Array(2*u):void 0,d=n.normal?new Float32Array(3*u):void 0,f=n.tangent?new Float32Array(3*u):void 0,p=n.bitangent?new Float32Array(3*u):void 0,_=n.normal||n.tangent||n.bitangent;if(_){var m=n.tangent||n.bitangent,$=0,g=0,v=0,y=Math.atan2(r-i,t),x=at$d;x.z=Math.sin(y);var b=Math.cos(y),w=mt$6,C=ut$9;for(a=0;a<o;a++){var T=a/o*e$27.TWO_PI,S=b*Math.cos(T),E=b*Math.sin(T);_&&(x.x=S,x.y=E,m&&(w=t$X.normalize(t$X.cross(t$X.UNIT_Z,x,w),w)),n.normal&&(d[$++]=x.x,d[$++]=x.y,d[$++]=x.z,d[$++]=x.x,d[$++]=x.y,d[$++]=x.z),n.tangent&&(f[g++]=w.x,f[g++]=w.y,f[g++]=w.z,f[g++]=w.x,f[g++]=w.y,f[g++]=w.z),n.bitangent&&(C=t$X.normalize(t$X.cross(x,w,C),C),p[v++]=C.x,p[v++]=C.y,p[v++]=C.z,p[v++]=C.x,p[v++]=C.y,p[v++]=C.z))}for(a=0;a<o;a++)n.normal&&(d[$++]=0,d[$++]=0,d[$++]=-1),n.tangent&&(f[g++]=1,f[g++]=0,f[g++]=0),n.bitangent&&(p[v++]=0,p[v++]=-1,p[v++]=0);for(a=0;a<o;a++)n.normal&&(d[$++]=0,d[$++]=0,d[$++]=1),n.tangent&&(f[g++]=1,f[g++]=0,f[g++]=0),n.bitangent&&(p[v++]=0,p[v++]=1,p[v++]=0)}var A=12*o-12,P=ce$v.createTypedArray(u,A),I=0,M=0;for(a=0;a<o-1;a++)P[I++]=M,P[I++]=M+2,P[I++]=M+3,P[I++]=M,P[I++]=M+3,P[I++]=M+1,M+=2;for(P[I++]=s-2,P[I++]=0,P[I++]=1,P[I++]=s-2,P[I++]=1,P[I++]=s-1,a=1;a<o-1;a++)P[I++]=s+a+1,P[I++]=s+a,P[I++]=s;for(a=1;a<o-1;a++)P[I++]=l,P[I++]=l+a,P[I++]=l+a+1;var O=0;if(n.st){var D=Math.max(i,r);for(a=0;a<u;a++){var R=t$X.fromArray(c,3*a,vt$8);h[O++]=(R.x+D)/(2*D),h[O++]=(R.y+D)/(2*D)}}var L=new a$_;n.position&&(L.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:c})),n.normal&&(L.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:d})),n.tangent&&(L.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(L.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:p})),n.st&&(L.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:h})),M$T.x=.5*t,M$T.y=Math.max(r,i);var B=new i$19(t$X.ZERO,o$1k.magnitude(M$T));if(e$28(e._offsetAttribute)){t=c.length;var N=new Uint8Array(t/3);d$1a(N,e._offsetAttribute===ee$C.NONE?0:1),L.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return new I$1n({attributes:L,indices:P,primitiveType:W$_.TRIANGLES,boundingSphere:B,offsetAttribute:e._offsetAttribute})}},l$_.getUnitCylinder=function(){return e$28(G$10)||(G$10=l$_.createGeometry(new l$_({topRadius:1,bottomRadius:1,length:1,vertexFormat:n$10.POSITION_ONLY}))),G$10};var l$Z=new o$1k;function d$13(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=u$Y(e.slices,128),o=Math.max(u$Y(e.numberOfVerticalLines,16),0);if(o$1u.typeOf.number("options.positions",t),o$1u.typeOf.number("options.topRadius",i),o$1u.typeOf.number("options.bottomRadius",r),o$1u.typeOf.number.greaterThanOrEquals("options.slices",n,3),e$28(e.offsetAttribute)&&e.offsetAttribute===ee$C.TOP)throw new t$Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}d$13.packedLength=6,d$13.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=u$Y(e._offsetAttribute,-1),t};var b$Z={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};d$13.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=e[t++],n=e[t++],o=e[t++],a=e[t++],s=e[t++],l=e[t];return e$28(i)?(i._length=r,i._topRadius=n,i._bottomRadius=o,i._slices=a,i._numberOfVerticalLines=s,i._offsetAttribute=-1===l?void 0:l,i):(b$Z.length=r,b$Z.topRadius=n,b$Z.bottomRadius=o,b$Z.slices=a,b$Z.numberOfVerticalLines=s,b$Z.offsetAttribute=-1===l?void 0:l,new d$13(b$Z))},d$13.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._slices,o=e._numberOfVerticalLines;if(!(t<=0||i<0||r<0||0===i&&0===r)){var a,s=2*n,l=I$1a.computePositions(t,i,r,n,!1),u=2*n;if(o>0){var c=Math.min(o,n);a=Math.round(n/c),u+=c}var h,d=ce$v.createTypedArray(s,2*u),f=0;for(h=0;h<n-1;h++)d[f++]=h,d[f++]=h+1,d[f++]=h+n,d[f++]=h+1+n;if(d[f++]=n-1,d[f++]=0,d[f++]=n+n-1,d[f++]=n,o>0)for(h=0;h<n;h+=a)d[f++]=h,d[f++]=h+n;var p=new a$_;p.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:l}),l$Z.x=.5*t,l$Z.y=Math.max(r,i);var _=new i$19(t$X.ZERO,o$1k.magnitude(l$Z));if(e$28(e._offsetAttribute)){t=l.length;var m=new Uint8Array(t/3);d$1a(m,e._offsetAttribute===ee$C.NONE?0:1),p.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return new I$1n({attributes:p,indices:d,primitiveType:W$_.LINES,boundingSphere:_,offsetAttribute:e._offsetAttribute})}};var w$E=1953029805,c$X=2917034100;function f$Z(e,t){if(f$Z.passThroughDataForTesting)return t;o$1u.typeOf.object("key",e),o$1u.typeOf.object("data",t);var i=e.byteLength;if(0===i||i%4!=0)throw new t$U("The length of key must be greater than 0 and a multiple of 4.");var r=new DataView(t),n=r.getUint32(0,!0);if(n===w$E||n===c$X)return t;for(var o,a=new DataView(e),s=0,l=t.byteLength,u=l-l%8,c=i,h=8;s<u;)for(o=h=(h+8)%24;s<u&&o<c;)r.setUint32(s,r.getUint32(s,!0)^a.getUint32(o,!0),!0),r.setUint32(s+4,r.getUint32(s+4,!0)^a.getUint32(o+4,!0),!0),s+=8,o+=24;if(s<l)for(o>=c&&(o=h=(h+8)%24);s<l;)r.setUint8(s,r.getUint8(s)^a.getUint8(o)),s++,o++}function o$16(e){this.proxy=e}function t$H(e,t){if(e=u$Y(e,0),(t=u$Y(t,Number.MAX_VALUE))<=e)throw new t$Z("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}function h$P(){this.head=void 0,this.tail=void 0,this._length=0}function r$Z(e,t,i){this.item=e,this.previous=t,this.next=i}function n$S(e,t){e$28(t.previous)&&e$28(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):e$28(t.previous)?(t.previous.next=void 0,e.tail=t.previous):e$28(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}f$Z.passThroughDataForTesting=!1,o$16.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)},Object.defineProperties(t$H.prototype,{componentDatatype:{get:function(){return S$W.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),t$H.fromDistanceDisplayCondition=function(e){if(!e$28(e))throw new t$Z("distanceDisplayCondition is required.");if(e.far<=e.near)throw new t$Z("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new t$H(e.near,e.far)},t$H.toValue=function(e,t){if(!e$28(e))throw new t$Z("distanceDisplayCondition is required.");return e$28(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},Object.defineProperties(h$P.prototype,{length:{get:function(){return this._length}}}),h$P.prototype.add=function(e){var t=new r$Z(e,this.tail,void 0);return e$28(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t},h$P.prototype.addToHead=function(e){var t=new r$Z(e,void 0,this.head);return e$28(this.head)?(this.head.previous=t,this.head=t):(this.head=t,this.tail=t),++this._length,t},h$P.prototype.remove=function(e){!e$28(e)||(n$S(this,e),--this._length)},h$P.prototype.splice=function(e,t){if(e!==t&&e$28(e)){n$S(this,t);var i=e.next;e.next=t,this.tail===e?this.tail=t:e$28(i)&&(i.previous=t),t.next=i,t.previous=e}},h$P.prototype.moveNodeBefore=function(e,t){if(e!==t){n$S(this,t);var i=e.previous;e.previous=t,this.head===e?this.head=t:i.next=t,t.next=e,t.previous=i}};var _0x399d29=(_0x2ee19d=!0,function(e,t){var i=_0x2ee19d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2ee19d=!1,i}),_0x52d3db=_0x399d29(void 0,(function(){return _0x52d3db.toString().search("(((.+)+)+)+$").toString().constructor(_0x52d3db).search("(((.+)+)+)+$")})),_0x2ee19d;_0x52d3db();var _0x1eacce={LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21,CRN_DXT5:26,STANDARD_CRN:27,KTX2:31},_0x493d0c=Object.freeze(_0x1eacce),y$P=1,l$Y=2,B$J=4,P$S=32;function H$O(e,t,i,r){var n=e|t<<8,o=n>>11&31,a=n>>5&63,s=31&n;return i[r+0]=o<<3|o>>2,i[r+1]=a<<2|a>>4,i[r+2]=s<<3|s>>2,i[r+3]=255,n}function M$S(e,t,i,r){for(var n=new Uint8Array(16),o=H$O(t[i+0],t[i+1],n,0),a=H$O(t[i+2],t[i+3],n,4),s=0;s<3;s++){var l=n[s],u=n[4+s];r&&o<=a?(n[8+s]=(l+u)/2,n[12+s]=0):(n[8+s]=(2*l+u)/3,n[12+s]=(l+2*u)/3)}n[11]=255,n[15]=r&&o<=a?0:255;var c=new Uint8Array(16);for(s=0;s<4;++s){var h=t[i+4+s];c[4*s+0]=3&h,c[4*s+1]=h>>2&3,c[4*s+2]=h>>4&3,c[4*s+3]=h>>6&3}for(s=0;s<16;++s)for(var d=4*c[s],f=0;f<4;++f)e[4*s+f]=n[d+f]}function N$I(e,t,i){for(var r=0;r<8;++r){var n=bytes[i+r],o=15&n,a=240&n;e[8*r+3]=o|o<<4,e[8*r+7]=a|a>>4}}function W$N(e,t,i){var r=t[i+0],n=t[i+1],o=new Uint8Array(8);if(o[0]=r,o[1]=n,r<=n){for(var a=1;a<5;++a)o[1+a]=((5-a)*r+a*n)/5;o[6]=0,o[7]=255}else for(a=1;a<7;++a)o[1+a]=((7-a)*r+a*n)/7;var s=new Uint8Array(16),l=(i=i+2,0);for(a=0;a<2;++a){for(var u=0,c=0;c<3;++c){u|=t[i++]<<8*c}for(c=0;c<8;++c){var h=u>>3*c&7;s[l++]=h}}for(a=0;a<16;++a)e[4*a+3]=o[s[a]]}function E$Y(e,t,i,r){var n=0;0!=(r&(l$Y|B$J))&&(n=8),M$S(e,t,i+n,0!=(r&y$P)),0!=(r&l$Y)?N$I(e,t,i):0!=(r&B$J)&&W$N(e,t,i)}function G$$(e,t,i,r){for(var n=new Uint16Array(4),o=e,a=0,s=0,l=0,u=0,c=0,h=0,d=0,f=0,p=0,_=t/4,m=i/4,$=0;$<m;$++)for(var g=0;g<_;g++)l=4*((m-$)*_+g),n[0]=r[l],n[1]=r[l+1],u=31&n[0],c=2016&n[0],h=63488&n[0],d=31&n[1],f=2016&n[1],p=63488&n[1],n[2]=5*u+3*d>>3|5*c+3*f>>3&2016|5*h+3*p>>3&63488,n[3]=5*d+3*u>>3|5*f+3*c>>3&2016|5*p+3*h>>3&63488,a=r[l+2],o[s=4*$*t+4*g]=n[3&a],o[s+1]=n[a>>2&3],o[s+2]=n[a>>4&3],o[s+3]=n[a>>6&3],o[s+=t]=n[a>>8&3],o[s+1]=n[a>>10&3],o[s+2]=n[a>>12&3],o[s+3]=n[a>>14],a=r[l+3],o[s+=t]=n[3&a],o[s+1]=n[a>>2&3],o[s+2]=n[a>>4&3],o[s+3]=n[a>>6&3],o[s+=t]=n[a>>8&3],o[s+1]=n[a>>10&3],o[s+2]=n[a>>12&3],o[s+3]=n[a>>14];return o}function R$N(e,t,i,r,n){for(var o=0!=(n&y$P)?8:16,a=0,s=0;s<i;s+=4)for(var l=0;l<t;l+=4){var u=new Uint8Array(64);E$Y(u,r,a,n);for(var c=0,h=0;h<4;++h)for(var d=0;d<4;++d){var f=l+d,p=s+h;if(f<t&&p<i)for(var _=4*(t*(i-p)+f),m=0;m<4;++m)e[_++]=u[c++];else c+=4}a+=o}}function L$12(e){}L$12.decode=function(e,t,i,r,n){if(null!=e&&null!=r&&0!=i&&0!=t){var o=0;(o=n>_0x493d0c.BGR||n===_0x493d0c.LUMINANCE_ALPHA?B$J:y$P|P$S)&y$P&&o&P$S?G$$(e,t,i,r):R$N(e,t,i,r,o)}},void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var f$Y=f$Y||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:typeof window<"u"&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();f$Y.Tween=function(e){var t=e,i={},r={},n={},o=1e3,a=0,s=!1,l=!1,u=0,c=null,h=f$Y.Easing.Linear.None,d=f$Y.Interpolation.Linear,f=[],p=null,_=!1,m=null,$=null,g=null,v=0,y=0;for(var x in e)i[x]=parseFloat(e[x],10);this.to=function(e,t){return void 0!==t&&(o=t),r=e,this},this.start=function(e){for(var o in f$Y.add(this),l=!0,_=!1,c=void 0!==e?e:typeof window<"u"&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),c+=u,r){if(r[o]instanceof Array){if(0===r[o].length)continue;r[o]=[t[o]].concat(r[o])}i[o]=t[o],i[o]instanceof Array||(i[o]*=1),n[o]=i[o]||0}return this},this.stop=function(){return l?(f$Y.remove(this),l=!1,null!==g&&g.call(t),this.stopChainedTweens(),this):this},this.pause=function(){return l?(l=!1,v=typeof window<"u"&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),this):this},this.endPause=function(){return l||(l=!0,v=(typeof window<"u"&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now())-v,y+=v),this},this.stopChainedTweens=function(){for(var e=0,t=f.length;e<t;e++)f[e].stop()},this.delay=function(e){return u=e,this},this.repeat=function(e){return a=e,this},this.yoyo=function(e){return s=e,this},this.easing=function(e){return h=e,this},this.interpolation=function(e){return d=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return p=e,this},this.onUpdate=function(e){return m=e,this},this.onComplete=function(e){return $=e,this},this.onStop=function(e){return g=e,this},this.update=function(e){var g;if(e<c||!l)return!0;!1===_&&(null!==p&&p.call(t),_=!0);var v=(e-c-y)/o,x=h(v=v>1?1:v);for(g in r){var b=i[g]||0,w=r[g];w instanceof Array?t[g]=d(w,x):("string"==typeof w&&(w=b+parseFloat(w,10)),"number"==typeof w&&(t[g]=b+(w-b)*x))}if(null!==m&&m.call(t,x),1==v){if(y=0,a>0){for(g in isFinite(a)&&a--,n){if("string"==typeof r[g]&&(n[g]=n[g]+parseFloat(r[g],10)),s){var C=n[g];n[g]=r[g],r[g]=C}i[g]=n[g]}return c=e+u,!0}null!==$&&$.call(t);for(var T=0,S=f.length;T<S;T++)f[T].start(e);return!1}return!0}},f$Y.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},Out:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-f$Y.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*f$Y.Easing.Bounce.In(2*e):.5*f$Y.Easing.Bounce.Out(2*e-1)+.5}}},f$Y.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),o=f$Y.Interpolation.Utils.Linear;return t<0?o(e[0],e[1],r):t>1?o(e[i],e[i-1],i-r):o(e[n],e[n+1>i?i:n+1],r-n)},Bezier:function(e,t){var i,r=0,n=e.length-1,o=Math.pow,a=f$Y.Interpolation.Utils.Bernstein;for(i=0;i<=n;i++)r+=o(1-t,n-i)*o(t,i)*e[i]*a(n,i);return r},CatmullRom:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),o=f$Y.Interpolation.Utils.CatmullRom;return e[0]===e[i]?(t<0&&(n=Math.floor(r=i*(1+t))),o(e[(n-1+i)%i],e[n],e[(n+1)%i],e[(n+2)%i],r-n)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[i]-(o(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):o(e[n?n-1:0],e[n],e[i<n+1?i:n+1],e[i<n+2?i:n+2],r-n)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=f$Y.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n;return(2*t-2*i+o+a)*(n*s)+(-3*t+3*i-2*o-a)*s+o*n+t}}};var I$19={LINEAR_NONE:f$Y.Easing.Linear.None,QUADRACTIC_IN:f$Y.Easing.Quadratic.In,QUADRACTIC_OUT:f$Y.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:f$Y.Easing.Quadratic.InOut,CUBIC_IN:f$Y.Easing.Cubic.In,CUBIC_OUT:f$Y.Easing.Cubic.Out,CUBIC_IN_OUT:f$Y.Easing.Cubic.InOut,QUARTIC_IN:f$Y.Easing.Quartic.In,QUARTIC_OUT:f$Y.Easing.Quartic.Out,QUARTIC_IN_OUT:f$Y.Easing.Quartic.InOut,QUINTIC_IN:f$Y.Easing.Quintic.In,QUINTIC_OUT:f$Y.Easing.Quintic.Out,QUINTIC_IN_OUT:f$Y.Easing.Quintic.InOut,SINUSOIDAL_IN:f$Y.Easing.Sinusoidal.In,SINUSOIDAL_OUT:f$Y.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:f$Y.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:f$Y.Easing.Exponential.In,EXPONENTIAL_OUT:f$Y.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:f$Y.Easing.Exponential.InOut,CIRCULAR_IN:f$Y.Easing.Circular.In,CIRCULAR_OUT:f$Y.Easing.Circular.Out,CIRCULAR_IN_OUT:f$Y.Easing.Circular.InOut,ELASTIC_IN:f$Y.Easing.Elastic.In,ELASTIC_OUT:f$Y.Easing.Elastic.Out,ELASTIC_IN_OUT:f$Y.Easing.Elastic.InOut,BACK_IN:f$Y.Easing.Back.In,BACK_OUT:f$Y.Easing.Back.Out,BACK_IN_OUT:f$Y.Easing.Back.InOut,BOUNCE_IN:f$Y.Easing.Bounce.In,BOUNCE_OUT:f$Y.Easing.Bounce.Out,BOUNCE_IN_OUT:f$Y.Easing.Bounce.InOut},m$S=Object.freeze(I$19),Ni$3=new t$X,zi$3=new t$X,Di$5=new t$X,Si$4=new t$X,Ui$3=new t$X(1,1,1),_i$6=Math.cos,Ci$4=Math.sin;function b$Y(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.radii,Ui$3),i=u$Y(e.innerRadii,t),r=u$Y(e.minimumClock,0),n=u$Y(e.maximumClock,e$27.TWO_PI),o=u$Y(e.minimumCone,0),a=u$Y(e.maximumCone,e$27.PI),s=Math.round(u$Y(e.stackPartitions,64)),l=Math.round(u$Y(e.slicePartitions,64)),u=u$Y(e.vertexFormat,n$10.DEFAULT);if(l<3)throw new t$Z("options.slicePartitions cannot be less than three.");if(s<3)throw new t$Z("options.stackPartitions cannot be less than three.");this._radii=t$X.clone(t),this._innerRadii=t$X.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=l,this._vertexFormat=n$10.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}b$Y.packedLength=2*t$X.packedLength+n$10.packedLength+7,b$Y.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t$X.pack(e._radii,t,i),i+=t$X.packedLength,t$X.pack(e._innerRadii,t,i),i+=t$X.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i]=u$Y(e._offsetAttribute,-1),t};var ki$4=new t$X,li$4=new t$X,Pi$5=new n$10,O$E={radii:ki$4,innerRadii:li$4,vertexFormat:Pi$5,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0},ni$5;b$Y.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r=t$X.unpack(e,t,ki$4);t+=t$X.packedLength;var n=t$X.unpack(e,t,li$4);t+=t$X.packedLength;var o=n$10.unpack(e,t,Pi$5);t+=n$10.packedLength;var a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return e$28(i)?(i._radii=t$X.clone(r,i._radii),i._innerRadii=t$X.clone(n,i._innerRadii),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._minimumClock=a,i._maximumClock=s,i._minimumCone=l,i._maximumCone=u,i._stackPartitions=c,i._slicePartitions=h,i._offsetAttribute=-1===d?void 0:d,i):(O$E.minimumClock=a,O$E.maximumClock=s,O$E.minimumCone=l,O$E.maximumCone=u,O$E.stackPartitions=c,O$E.slicePartitions=h,O$E.offsetAttribute=-1===d?void 0:d,new b$Y(O$E))},b$Y.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r=e._minimumClock,n=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._vertexFormat,l=e._slicePartitions+1,u=e._stackPartitions+1;(l=Math.round(l*Math.abs(n-r)/e$27.TWO_PI))<2&&(l=2),(u=Math.round(u*Math.abs(a-o)/e$27.PI))<2&&(u=2);var c,h,d=0,f=[o],p=[r];for(c=0;c<u;c++)f.push(o+c*(a-o)/(u-1));for(f.push(a),h=0;h<l;h++)p.push(r+h*(n-r)/(l-1));p.push(n);var _=f.length,m=p.length,$=0,g=1,v=i.x!==t.x||i.y!==t.y||i.z!==t.z,y=!1,x=!1,b=!1;v&&(g=2,o>0&&(y=!0,$+=l-1),a<Math.PI&&(x=!0,$+=l-1),(n-r)%e$27.TWO_PI?(b=!0,$+=2*(u-1)+1):$+=1);var w=m*_*g,C=new Float64Array(3*w),T=d$1a(new Array(w),!1),S=d$1a(new Array(w),!1),E=l*u*g,A=6*(E+$+1-(l+u)*g),P=ce$v.createTypedArray(E,A),I=s.normal?new Float32Array(3*w):void 0,M=s.tangent?new Float32Array(3*w):void 0,O=s.bitangent?new Float32Array(3*w):void 0,D=s.st?new Float32Array(2*w):void 0,R=new Array(_),L=new Array(_);for(c=0;c<_;c++)R[c]=Ci$4(f[c]),L[c]=_i$6(f[c]);var B=new Array(m),N=new Array(m);for(h=0;h<m;h++)N[h]=_i$6(p[h]),B[h]=Ci$4(p[h]);for(c=0;c<_;c++)for(h=0;h<m;h++)C[d++]=t.x*R[c]*N[h],C[d++]=t.y*R[c]*B[h],C[d++]=t.z*L[c];var F,z,k,V,U=w/2;if(v)for(c=0;c<_;c++)for(h=0;h<m;h++)C[d++]=i.x*R[c]*N[h],C[d++]=i.y*R[c]*B[h],C[d++]=i.z*L[c],T[U]=!0,c>0&&c!==_-1&&0!==h&&h!==m-1&&(S[U]=!0),U++;for(d=0,c=1;c<_-2;c++)for(F=c*m,z=(c+1)*m,h=1;h<m-2;h++)P[d++]=z+h,P[d++]=z+h+1,P[d++]=F+h+1,P[d++]=z+h,P[d++]=F+h+1,P[d++]=F+h;if(v){var X=_*m;for(c=1;c<_-2;c++)for(F=X+c*m,z=X+(c+1)*m,h=1;h<m-2;h++)P[d++]=z+h,P[d++]=F+h,P[d++]=F+h+1,P[d++]=z+h,P[d++]=F+h+1,P[d++]=z+h+1}if(v){if(y)for(V=_*m,c=1;c<m-2;c++)P[d++]=c,P[d++]=c+1,P[d++]=V+c+1,P[d++]=c,P[d++]=V+c+1,P[d++]=V+c;if(x)for(k=_*m-m,V=_*m*g-m,c=1;c<m-2;c++)P[d++]=k+c+1,P[d++]=k+c,P[d++]=V+c,P[d++]=k+c+1,P[d++]=V+c,P[d++]=V+c+1}if(b){for(c=1;c<_-2;c++)V=m*_+m*c,k=m*c,P[d++]=V,P[d++]=k+m,P[d++]=k,P[d++]=V,P[d++]=V+m,P[d++]=k+m;for(c=1;c<_-2;c++)V=m*_+m*(c+1)-1,k=m*(c+1)-1,P[d++]=k+m,P[d++]=V,P[d++]=k,P[d++]=k+m,P[d++]=V+m,P[d++]=V}var H=new a$_;s.position&&(H.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:C}));var G,W=0,Y=0,q=0,j=0,Z=w/2,K=t$V.fromCartesian3(t),Q=t$V.fromCartesian3(i);if(s.st||s.normal||s.tangent||s.bitangent){for(c=0;c<w;c++){G=T[c]?Q:K;var J=t$X.fromArray(C,3*c,Ni$3),ee=G.geodeticSurfaceNormal(J,zi$3);if(s.st){var te=Math.atan2(ee.y,ee.x);te<0&&(te+=e$27.TWO_PI),D[W++]=te/e$27.TWO_PI,D[W++]=Math.asin(ee.z)/Math.PI+.5}if(s.normal&&(S[c]&&t$X.negate(ee,ee),I[Y++]=ee.x,I[Y++]=ee.y,I[Y++]=ee.z),s.tangent||s.bitangent){var ie,re=Di$5,ne=0;if(T[c]&&(ne=Z),ie=!y&&c>=ne&&c<ne+2*m?t$X.UNIT_X:t$X.UNIT_Z,t$X.cross(ie,ee,re),t$X.normalize(re,re),s.tangent&&(M[q++]=re.x,M[q++]=re.y,M[q++]=re.z),s.bitangent){var oe=t$X.cross(ee,re,Si$4);t$X.normalize(oe,oe),O[j++]=oe.x,O[j++]=oe.y,O[j++]=oe.z}}}s.st&&(H.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:D})),s.normal&&(H.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:I})),s.tangent&&(H.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:M})),s.bitangent&&(H.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:O}))}if(e$28(e._offsetAttribute)){var ae=C.length,se=new Uint8Array(ae/3);d$1a(se,e._offsetAttribute===ee$C.NONE?0:1),H.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:se})}return new I$1n({attributes:H,indices:P,primitiveType:W$_.TRIANGLES,boundingSphere:i$19.fromEllipsoid(K),offsetAttribute:e._offsetAttribute})}}},b$Y.getUnitEllipsoid=function(){return e$28(ni$5)||(ni$5=b$Y.createGeometry(new b$Y({radii:new t$X(1,1,1),vertexFormat:n$10.POSITION_ONLY}))),ni$5};var mi$5=new t$X(1,1,1),B$I=Math.cos,S$K=Math.sin;function x$Y(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.radii,mi$5),i=u$Y(e.innerRadii,t),r=u$Y(e.minimumClock,0),n=u$Y(e.maximumClock,e$27.TWO_PI),o=u$Y(e.minimumCone,0),a=u$Y(e.maximumCone,e$27.PI),s=Math.round(u$Y(e.stackPartitions,10)),l=Math.round(u$Y(e.slicePartitions,8)),u=Math.round(u$Y(e.subdivisions,128));if(s<1)throw new t$Z("options.stackPartitions cannot be less than 1");if(l<0)throw new t$Z("options.slicePartitions cannot be less than 0");if(u<0)throw new t$Z("options.subdivisions must be greater than or equal to zero.");if(e$28(e.offsetAttribute)&&e.offsetAttribute===ee$C.TOP)throw new t$Z("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=t$X.clone(t),this._innerRadii=t$X.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=o,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=l,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}x$Y.packedLength=2*t$X.packedLength+8,x$Y.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),t$X.pack(e._radii,t,i),i+=t$X.packedLength,t$X.pack(e._innerRadii,t,i),i+=t$X.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i++]=e._subdivisions,t[i]=u$Y(e._offsetAttribute,-1),t};var K$L=new t$X,Q$S=new t$X,b$X={radii:K$L,innerRadii:Q$S,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};function t$G(e){e=u$Y(e,{}),this._tilingScheme=e.tilingScheme,e$28(this._tilingScheme)||(this._tilingScheme=new g$14({ellipsoid:u$Y(e.ellipsoid,t$V.WGS84)})),this._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o$1o,this._isCreateSkirt=e.isCreateSkirt,this._isSkirtDirty=!1,this._readyPromise=o$1q.resolve(!0)}function n$R(){this._removalFunctions=[]}x$Y.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r=t$X.unpack(e,t,K$L);t+=t$X.packedLength;var n=t$X.unpack(e,t,Q$S);t+=t$X.packedLength;var o=e[t++],a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return e$28(i)?(i._radii=t$X.clone(r,i._radii),i._innerRadii=t$X.clone(n,i._innerRadii),i._minimumClock=o,i._maximumClock=a,i._minimumCone=s,i._maximumCone=l,i._stackPartitions=u,i._slicePartitions=c,i._subdivisions=h,i._offsetAttribute=-1===d?void 0:d,i):(b$X.minimumClock=o,b$X.maximumClock=a,b$X.minimumCone=s,b$X.maximumCone=l,b$X.stackPartitions=u,b$X.slicePartitions=c,b$X.subdivisions=h,b$X.offsetAttribute=-1===d?void 0:d,new x$Y(b$X))},x$Y.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r=e._minimumClock,n=e._maximumClock,o=e._minimumCone,a=e._maximumCone,s=e._subdivisions,l=t$V.fromCartesian3(t),u=e._slicePartitions+1,c=e._stackPartitions+1;(u=Math.round(u*Math.abs(n-r)/e$27.TWO_PI))<2&&(u=2),(c=Math.round(c*Math.abs(a-o)/e$27.PI))<2&&(c=2);var h=0,d=1,f=i.x!==t.x||i.y!==t.y||i.z!==t.z,p=!1,_=!1;f&&(d=2,o>0&&(p=!0,h+=u),a<Math.PI&&(_=!0,h+=u));var m,$,g,v,y=s*d*(c+u),x=new Float64Array(3*y),b=2*(y+h-(u+c)*d),w=ce$v.createTypedArray(y,b),C=0,T=new Array(c),S=new Array(c);for(m=0;m<c;m++)v=o+m*(a-o)/(c-1),T[m]=S$K(v),S[m]=B$I(v);var E=new Array(s),A=new Array(s);for(m=0;m<s;m++)g=r+m*(n-r)/(s-1),E[m]=S$K(g),A[m]=B$I(g);for(m=0;m<c;m++)for($=0;$<s;$++)x[C++]=t.x*T[m]*A[$],x[C++]=t.y*T[m]*E[$],x[C++]=t.z*S[m];if(f)for(m=0;m<c;m++)for($=0;$<s;$++)x[C++]=i.x*T[m]*A[$],x[C++]=i.y*T[m]*E[$],x[C++]=i.z*S[m];for(T.length=s,S.length=s,m=0;m<s;m++)v=o+m*(a-o)/(s-1),T[m]=S$K(v),S[m]=B$I(v);for(E.length=u,A.length=u,m=0;m<u;m++)g=r+m*(n-r)/(u-1),E[m]=S$K(g),A[m]=B$I(g);for(m=0;m<s;m++)for($=0;$<u;$++)x[C++]=t.x*T[m]*A[$],x[C++]=t.y*T[m]*E[$],x[C++]=t.z*S[m];if(f)for(m=0;m<s;m++)for($=0;$<u;$++)x[C++]=i.x*T[m]*A[$],x[C++]=i.y*T[m]*E[$],x[C++]=i.z*S[m];for(C=0,m=0;m<c*d;m++){var P=m*s;for($=0;$<s-1;$++)w[C++]=P+$,w[C++]=P+$+1}var I=c*s*d;for(m=0;m<u;m++)for($=0;$<s-1;$++)w[C++]=I+m+$*u,w[C++]=I+m+($+1)*u;if(f)for(I=c*s*d+u*s,m=0;m<u;m++)for($=0;$<s-1;$++)w[C++]=I+m+$*u,w[C++]=I+m+($+1)*u;if(f){var M=c*s*d,O=M+s*u;if(p)for(m=0;m<u;m++)w[C++]=M+m,w[C++]=O+m;if(_)for(M+=s*u-u,O+=s*u-u,m=0;m<u;m++)w[C++]=M+m,w[C++]=O+m}var D=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:x})});if(e$28(e._offsetAttribute)){var R=x.length,L=new Uint8Array(R/3);d$1a(L,e._offsetAttribute===ee$C.NONE?0:1),D.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}return new I$1n({attributes:D,indices:w,primitiveType:W$_.LINES,boundingSphere:i$19.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})}}},Object.defineProperties(t$G.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},isCreateSkirt:{get:function(){return this._isCreateSkirt},set:function(e){e!==this._isCreateSkirt&&(this._isSkirtDirty=!0),this._isCreateSkirt=e}}}),t$G.prototype.requestTileGeometry=function(e,t,i,r){return o$1q.resolve(new T$S({buffer:new Uint8Array(256),width:16,height:16,skirtMode:this._isCreateSkirt}))},t$G.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},t$G.prototype.getTileDataAvailable=function(e,t,i){},t$G.prototype.loadTileDataAvailability=function(e,t,i){},n$R.prototype.add=function(e,t,i){if(!e$28(e))throw new t$Z("event is required");var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},n$R.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0};var e$1v={NONE:0,HOLD:1,EXTRAPOLATE:2},_0x33054b=Object.freeze(e$1v);function f$X(){this._bounds=new e$25,this._command=void 0,this._geometry=void 0,this.heightBuffer=void 0,this.colorBuffer=void 0}function l$X(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=u$Y(e.near,1),this._near=this.near,this.far=u$Y(e.far,5e8),this._far=this.far,this._cullingVolume=new i$S,this._perspectiveMatrix=new y$15,this._infinitePerspective=new y$15}function z$N(e){if(!(e$28(e.right)&&e$28(e.left)&&e$28(e.top)&&e$28(e.bottom)&&e$28(e.near)&&e$28(e.far)))throw new t$Z("right, left, top, bottom, near, or far parameters are not set.");var t=e.top,i=e.bottom,r=e.right,n=e.left,o=e.near,a=e.far;if(t!==e._top||i!==e._bottom||n!==e._left||r!==e._right||o!==e._near||a!==e._far){if(e.near<=0||e.near>e.far)throw new t$Z("near must be greater than zero and less than far.");e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=o,e._far=a,e._perspectiveMatrix=y$15.computePerspectiveOffCenter(n,r,i,t,o,a,e._perspectiveMatrix),e._infinitePerspective=y$15.computeInfinitePerspectiveOffCenter(n,r,i,t,o,e._infinitePerspective)}}f$X.prototype.destroy=function(){delete this._bounds,this._bounds=null,e$28(this._command)&&(this._command.vertexArray=this._command.vertexArray&&!this._command.vertexArray.isDestroyed()&&this._command.vertexArray.destroy(),this._command.shaderProgram=this._command.shaderProgram&&!this._command.shaderProgram.isDestroyed()&&this._command.shaderProgram.destroy(),this._command=null);var e=this.colorBuffer;e$28(e)&&e.destroy(),this.colorBuffer=void 0;var t=this.heightBuffer;e$28(t)&&t.destroy(),this.heightBuffer=void 0,this._geometry=null},f$X.updateGeometry=function(e,t,i,r){if(e$28(e))for(var n=new n$1b,o=n.ellipsoid,a=new t$W,s=e.attributes.position,l=new t$X,u=s.values,c=0;c<u.length;c+=3)l.x=u[c],l.y=u[c+1],l.z=u[c+2],r&&(o.cartesianToCartographic(l,a),n.project(a,l),l=t$X.fromElements(l.z,l.x,l.y)),y$15.multiplyByPoint(i,l,l),u[c]=l.x,u[c+1]=l.y,u[c+2]=l.z},f$X.updateGeoBounds=function(e){for(var t=e.attributes.position.values,i=new e$25(Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),r=0;r<t.length;r+=3){var n=t[r],o=t[r+1];i.x=Math.min(n,i.x),i.y=Math.min(o,i.y),i.z=Math.max(n,i.z),i.w=Math.max(o,i.w)}return i},Object.defineProperties(l$X.prototype,{projectionMatrix:{get:function(){return z$N(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return z$N(this),this._infinitePerspective}}});var B$H=new t$X,O$D=new t$X,S$J=new t$X,V$J=new t$X;function o$15(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._offCenterFrustum=new l$X,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=u$Y(e.near,1),this._near=this.near,this.far=u$Y(e.far,5e8),this._far=this.far,this.xOffset=u$Y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=u$Y(e.yOffset,0),this._yOffset=this.yOffset,this.reflect=!1}function f$W(e){if(!(e$28(e.fov)&&e$28(e.aspectRatio)&&e$28(e.near)&&e$28(e.far)))throw new t$Z("fov, aspectRatio, near, or far parameters are not set.");var t=e._offCenterFrustum;if(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset){if(e.fov<0||e.fov>=Math.PI)throw new t$Z("fov must be in the range [0, PI).");if(e.aspectRatio<0)throw new t$Z("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new t$Z("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset}}l$X.prototype.resetProjectionMatrix=function(){if(!(e$28(this.right)&&e$28(this.left)&&e$28(this.top)&&e$28(this.bottom)&&e$28(this.near)&&e$28(this.far)))throw new t$Z("right, left, top, bottom, near, or far parameters are not set.");var e=this.top,t=this.bottom,i=this.right,r=this.left,n=this.near,o=this.far;if(this.near<=0||this.near>this.far)throw new t$Z("near must be greater than zero and less than far.");this._left=r,this._right=i,this._top=e,this._bottom=t,this._near=n,this._far=o,this._perspectiveMatrix=y$15.computePerspectiveOffCenter(r,i,t,e,n,o,this._perspectiveMatrix),this._infinitePerspective=y$15.computeInfinitePerspectiveOffCenter(r,i,t,e,n,this._infinitePerspective)},l$X.prototype.computeCullingVolume=function(e,t,i,r){if(!e$28(e))throw new t$Z("position is required.");if(!e$28(t))throw new t$Z("direction is required.");if(!e$28(i))throw new t$Z("up is required.");var n=this._cullingVolume.planes,o=u$Y(r,0);o=Math.min(o,.5),o=Math.max(o,0);var a=this.top+this.top*o,s=this.bottom-this.top*o,l=this.right+this.right*o,u=this.left-this.right*o,c=this.near,h=this.far,d=t$X.cross(t,i,B$H),f=O$D;t$X.multiplyByScalar(t,c,f),t$X.add(e,f,f);var p=S$J;t$X.multiplyByScalar(t,h,p),t$X.add(e,p,p);var _=V$J;t$X.multiplyByScalar(d,u,_),t$X.add(f,_,_),t$X.subtract(_,e,_),t$X.normalize(_,_),t$X.cross(_,i,_),t$X.normalize(_,_);var m=n[0];return e$28(m)||(m=n[0]=new e$25),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-t$X.dot(_,e),t$X.multiplyByScalar(d,l,_),t$X.add(f,_,_),t$X.subtract(_,e,_),t$X.cross(i,_,_),t$X.normalize(_,_),e$28(m=n[1])||(m=n[1]=new e$25),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-t$X.dot(_,e),t$X.multiplyByScalar(i,s,_),t$X.add(f,_,_),t$X.subtract(_,e,_),t$X.cross(d,_,_),t$X.normalize(_,_),e$28(m=n[2])||(m=n[2]=new e$25),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-t$X.dot(_,e),t$X.multiplyByScalar(i,a,_),t$X.add(f,_,_),t$X.subtract(_,e,_),t$X.cross(_,d,_),t$X.normalize(_,_),e$28(m=n[3])||(m=n[3]=new e$25),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-t$X.dot(_,e),e$28(m=n[4])||(m=n[4]=new e$25),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-t$X.dot(t,f),t$X.negate(t,_),e$28(m=n[5])||(m=n[5]=new e$25),m.x=_.x,m.y=_.y,m.z=_.z,m.w=-t$X.dot(_,p),this._cullingVolume},l$X.prototype.getPixelDimensions=function(e,t,i,r,n){if(z$N(this),!e$28(e)||!e$28(t))throw new t$Z("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new t$Z("drawingBufferWidth must be greater than zero.");if(t<=0)throw new t$Z("drawingBufferHeight must be greater than zero.");if(!e$28(i))throw new t$Z("distance is required.");if(!e$28(r))throw new t$Z("pixelRatio is required");if(r<=0)throw new t$Z("pixelRatio must be greater than zero.");if(!e$28(n))throw new t$Z("A result object is required.");var o=1/this.near,a=this.top*o,s=2*r*i*a/t,l=2*r*i*(a=this.right*o)/e;return n.x=l,n.y=s,n},l$X.prototype.clone=function(e){return e$28(e)||(e=new l$X),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},l$X.prototype.equals=function(e){return e$28(e)&&e instanceof l$X&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},l$X.prototype.equalsEpsilon=function(e,t,i){return e===this||e$28(e)&&e instanceof l$X&&e$27.equalsEpsilon(this.right,e.right,t,i)&&e$27.equalsEpsilon(this.left,e.left,t,i)&&e$27.equalsEpsilon(this.top,e.top,t,i)&&e$27.equalsEpsilon(this.bottom,e.bottom,t,i)&&e$27.equalsEpsilon(this.near,e.near,t,i)&&e$27.equalsEpsilon(this.far,e.far,t,i)},o$15.packedLength=6,o$15.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),t[i++]=e.fov,t[i++]=e.aspectRatio,t[i++]=e.near,t[i++]=e.far,t[i++]=e.xOffset,t[i]=e.yOffset,t},o$15.unpack=function(e,t,i){return o$1u.defined("array",e),t=u$Y(t,0),e$28(i)||(i=new o$15),i.fov=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t++],i.xOffset=e[t++],i.yOffset=e[t],i},Object.defineProperties(o$15.prototype,{projectionMatrix:{get:function(){return f$W(this),this.reflect&&x$X(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return f$W(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return f$W(this),this._fovy}},sseDenominator:{get:function(){return f$W(this),this._sseDenominator}}}),o$15.prototype.resetProjectionMatrix=function(){return this._offCenterFrustum.resetProjectionMatrix()},o$15.prototype.computeCullingVolume=function(e,t,i,r){return f$W(this),this._offCenterFrustum.computeCullingVolume(e,t,i,r)},o$15.prototype.getPixelDimensions=function(e,t,i,r,n){return f$W(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r,n)},o$15.prototype.clone=function(e){return e$28(e)||(e=new o$15),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e.reflect=this.reflect,e.clipPlane=this.clipPlane,e.currentViewMatrix=this.currentViewMatrix,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},o$15.prototype.equals=function(e){return!!(e$28(e)&&e instanceof o$15)&&(f$W(this),f$W(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},o$15.prototype.equalsEpsilon=function(e,t,i){return!!(e$28(e)&&e instanceof o$15)&&(f$W(this),f$W(e),e$27.equalsEpsilon(this.fov,e.fov,t,i)&&e$27.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))};var r$Y=new o$1i(t$X.UNIT_Z,1),h$O=new e$25,c$W=new e$25,s$M=new e$25;function x$X(e){if(e$28(e.clipPlane)&&e$28(e.currentViewMatrix)){var t=e.currentViewMatrix,i=e._offCenterFrustum.projectionMatrix;y$15.multiplyByPlane(t,e.clipPlane,r$Y),h$O.x=(e$27.sign(r$Y.normal.x)+i[8])/i[0],h$O.y=(e$27.sign(r$Y.normal.y)+i[9])/i[5],h$O.z=-1,h$O.w=(1+i[10])/i[14],c$W.x=r$Y.normal.x,c$W.y=r$Y.normal.y,c$W.z=r$Y.normal.z,c$W.w=r$Y.distance,e$25.multiplyByScalar(c$W,2/e$25.dot(c$W,h$O),s$M),i[2]=s$M.x,i[6]=s$M.y,i[10]=s$M.z+1,i[14]=s$M.w}}var j$U=0,I$18=1;function z$M(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.frustum",e.frustum),o$1u.typeOf.object("options.origin",e.origin),o$1u.typeOf.object("options.orientation",e.orientation);var t,i,r=e.frustum,n=e.orientation,o=e.origin,a=u$Y(e.vertexFormat,n$10.DEFAULT),s=u$Y(e._drawNearPlane,!0);r instanceof o$15?(t=j$U,i=o$15.packedLength):r instanceof a$X&&(t=I$18,i=a$X.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=t$X.clone(o),this._orientation=n$14.clone(n),this._drawNearPlane=s,this._vertexFormat=a,this._workerName="createFrustumGeometry",this.packedLength=2+i+t$X.packedLength+n$14.packedLength+n$10.packedLength}z$M.pack=function(e,t,i){o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0);var r=e._frustumType,n=e._frustum;return t[i++]=r,r===j$U?(o$15.pack(n,t,i),i+=o$15.packedLength):(a$X.pack(n,t,i),i+=a$X.packedLength),t$X.pack(e._origin,t,i),i+=t$X.packedLength,n$14.pack(e._orientation,t,i),i+=n$14.packedLength,n$10.pack(e._vertexFormat,t,i),t[i+=n$10.packedLength]=e._drawNearPlane?1:0,t};var ee$z=new o$15,re$y=new a$X,ae$y=new n$14,te$E=new t$X,oe$v=new n$10;function R$M(e,t,i,r,n,o,a,s){for(var l=e/3*2,u=0;u<4;++u)e$28(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),e$28(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e$28(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),e+=3;n[l]=0,n[l+1]=0,n[l+2]=1,n[l+3]=0,n[l+4]=1,n[l+5]=1,n[l+6]=0,n[l+7]=1}z$M.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r,n=e[t++];n===j$U?(r=o$15.unpack(e,t,ee$z),t+=o$15.packedLength):(r=a$X.unpack(e,t,re$y),t+=a$X.packedLength);var o=t$X.unpack(e,t,te$E);t+=t$X.packedLength;var a=n$14.unpack(e,t,ae$y);t+=n$14.packedLength;var s=n$10.unpack(e,t,oe$v),l=1===e[t+=n$10.packedLength];if(!e$28(i))return new z$M({frustum:r,origin:o,orientation:a,vertexFormat:s,_drawNearPlane:l});var u=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(u),i._frustumType=n,i._origin=t$X.clone(o,i._origin),i._orientation=n$14.clone(a,i._orientation),i._vertexFormat=n$10.clone(s,i._vertexFormat),i._drawNearPlane=l,i};var ie$A=new p$1a,ve$o=new y$15,q$X=new y$15,K$K=new t$X,W$M=new t$X,Z$U=new t$X,pe$x=new t$X,ce$r=new t$X,me$x=new t$X,C$M=new Array(3),Y$E=new Array(4);Y$E[0]=new e$25(-1,-1,1,1),Y$E[1]=new e$25(1,-1,1,1),Y$E[2]=new e$25(1,1,1,1),Y$E[3]=new e$25(-1,1,1,1);for(var $$O=new Array(4),J$S=0;J$S<4;++J$S)$$O[J$S]=new e$25;z$M._computeNearFarPlanes=function(e,t,i,r,n,o,a,s){var l=p$1a.fromQuaternion(t,ie$A),u=u$Y(o,K$K),c=u$Y(a,W$M),h=u$Y(s,Z$U);u=p$1a.getColumn(l,0,u),c=p$1a.getColumn(l,1,c),h=p$1a.getColumn(l,2,h),t$X.normalize(u,u),t$X.normalize(c,c),t$X.normalize(h,h),t$X.negate(u,u);var d,f,p=y$15.computeView(e,h,c,u,ve$o);if(i===j$U){var _=r.projectionMatrix,m=y$15.multiply(_,p,q$X);f=y$15.inverse(m,q$X)}else d=y$15.inverseTransformation(p,q$X);e$28(f)?(C$M[0]=r.near,C$M[1]=r.far):(C$M[0]=0,C$M[1]=r.near,C$M[2]=r.far);for(var $=0;$<2;++$)for(var g=0;g<4;++g){var v=e$25.clone(Y$E[g],$$O[g]);if(e$28(f)){var y=1/(v=y$15.multiplyByVector(f,v,v)).w;t$X.multiplyByScalar(v,y,v),t$X.subtract(v,e,v),t$X.normalize(v,v);var x=t$X.dot(h,v);t$X.multiplyByScalar(v,C$M[$]/x,v),t$X.add(v,e,v)}else{e$28(r._offCenterFrustum)&&(r=r._offCenterFrustum);var b=C$M[$],w=C$M[$+1];v.x=.5*(v.x*(r.right-r.left)+r.left+r.right),v.y=.5*(v.y*(r.top-r.bottom)+r.bottom+r.top),v.z=.5*(v.z*(b-w)-b-w),v.w=1,y$15.multiplyByVector(d,v,v)}n[12*$+3*g]=v.x,n[12*$+3*g+1]=v.y,n[12*$+3*g+2]=v.z}},z$M.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,o=e._drawNearPlane,a=e._vertexFormat,s=o?6:5,l=new Float64Array(72);z$M._computeNearFarPlanes(r,n,t,i,l);var u=24;l[u]=l[12],l[u+1]=l[13],l[u+2]=l[14],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[9],l[u+7]=l[10],l[u+8]=l[11],l[u+9]=l[21],l[u+10]=l[22],l[u+11]=l[23],l[u+=12]=l[15],l[u+1]=l[16],l[u+2]=l[17],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[12],l[u+10]=l[13],l[u+11]=l[14],l[u+=12]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[15],l[u+4]=l[16],l[u+5]=l[17],l[u+6]=l[18],l[u+7]=l[19],l[u+8]=l[20],l[u+9]=l[6],l[u+10]=l[7],l[u+11]=l[8],l[u+=12]=l[6],l[u+1]=l[7],l[u+2]=l[8],l[u+3]=l[18],l[u+4]=l[19],l[u+5]=l[20],l[u+6]=l[21],l[u+7]=l[22],l[u+8]=l[23],l[u+9]=l[9],l[u+10]=l[10],l[u+11]=l[11],o||(l=l.subarray(12));var c=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:l})});if(e$28(a.normal)||e$28(a.tangent)||e$28(a.bitangent)||e$28(a.st)){var h=e$28(a.normal)?new Float32Array(12*s):void 0,d=e$28(a.tangent)?new Float32Array(12*s):void 0,f=e$28(a.bitangent)?new Float32Array(12*s):void 0,p=e$28(a.st)?new Float32Array(8*s):void 0,_=K$K,m=W$M,$=Z$U,g=t$X.negate(_,pe$x),v=t$X.negate(m,ce$r),y=t$X.negate($,me$x);u=0,o&&(R$M(u,h,d,f,p,y,_,m),u+=12),R$M(u,h,d,f,p,$,g,m),R$M(u+=12,h,d,f,p,g,y,m),R$M(u+=12,h,d,f,p,v,y,g),R$M(u+=12,h,d,f,p,_,$,m),R$M(u+=12,h,d,f,p,m,$,g),e$28(h)&&(c.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:h})),e$28(d)&&(c.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:d})),e$28(f)&&(c.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:f})),e$28(p)&&(c.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:p}))}for(var x=new Uint16Array(6*s),b=0;b<s;++b){var w=6*b,C=4*b;x[w]=C,x[w+1]=C+1,x[w+2]=C+2,x[w+3]=C,x[w+4]=C+2,x[w+5]=C+3}return new I$1n({attributes:c,indices:x,primitiveType:W$_.TRIANGLES,boundingSphere:i$19.fromVertices(l)})};var d$12=0,A$_=1;function s$L(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.frustum",e.frustum),o$1u.typeOf.object("options.origin",e.origin),o$1u.typeOf.object("options.orientation",e.orientation);var t,i,r=e.frustum,n=e.orientation,o=e.origin,a=u$Y(e._drawNearPlane,!0);r instanceof o$15?(t=d$12,i=o$15.packedLength):r instanceof a$X&&(t=A$_,i=a$X.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=t$X.clone(o),this._orientation=n$14.clone(n),this._drawNearPlane=a,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+t$X.packedLength+n$14.packedLength}s$L.pack=function(e,t,i){o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0);var r=e._frustumType,n=e._frustum;return t[i++]=r,r===d$12?(o$15.pack(n,t,i),i+=o$15.packedLength):(a$X.pack(n,t,i),i+=a$X.packedLength),t$X.pack(e._origin,t,i),i+=t$X.packedLength,n$14.pack(e._orientation,t,i),t[i+=n$14.packedLength]=e._drawNearPlane?1:0,t};var j$T=new o$15,C$L=new a$X,E$X=new n$14,G$_=new t$X;function o$14(){}s$L.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r,n=e[t++];n===d$12?(r=o$15.unpack(e,t,j$T),t+=o$15.packedLength):(r=a$X.unpack(e,t,C$L),t+=a$X.packedLength);var o=t$X.unpack(e,t,G$_);t+=t$X.packedLength;var a=n$14.unpack(e,t,E$X),s=1===e[t+=n$14.packedLength];if(!e$28(i))return new s$L({frustum:r,origin:o,orientation:a,_drawNearPlane:s});var l=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(l),i._frustumType=n,i._origin=t$X.clone(o,i._origin),i._orientation=n$14.clone(a,i._orientation),i._drawNearPlane=s,i},s$L.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,o=e._drawNearPlane,a=new Float64Array(24);z$M._computeNearFarPlanes(r,n,t,i,a);for(var s,l,u=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:a})}),c=o?2:1,h=new Uint16Array(8*(c+1)),d=o?0:1;d<2;++d)l=4*d,h[s=o?8*d:0]=l,h[s+1]=l+1,h[s+2]=l+1,h[s+3]=l+2,h[s+4]=l+2,h[s+5]=l+3,h[s+6]=l+3,h[s+7]=l;for(d=0;d<2;++d)l=4*d,h[s=8*(c+d)]=l,h[s+1]=l+4,h[s+2]=l+1,h[s+3]=l+5,h[s+4]=l+2,h[s+5]=l+6,h[s+6]=l+3,h[s+7]=l+7;return new I$1n({attributes:u,indices:h,primitiveType:W$_.LINES,boundingSphere:i$19.fromVertices(a)})},o$14.prototype.geocode=t$Z.throwInstantiationError;var e$1u={SEARCH:0,AUTOCOMPLETE:1},c$V=Object.freeze(e$1u);function o$13(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).componentDatatype))throw new t$Z("options.componentDatatype is required.");if(!e$28(e.componentsPerAttribute))throw new t$Z("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new t$Z("options.componentsPerAttribute must be between 1 and 4.");if(!e$28(e.value))throw new t$Z("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=u$Y(e.normalize,!1),this.value=e.value}function f$V(e){if(!e$28(e))throw new t$Z("uri is required.");var t=new h$$(e);t.normalize();var i=t.path,r=i.lastIndexOf("/");return-1!==r&&(i=i.substr(r+1)),i}var c$U={};function d$11(e,t,i){e$28(t)||(t=e.width),e$28(i)||(i=e.height);var r=c$U[t];e$28(r)||(r={},c$U[t]=r);var n=r[i];if(!e$28(n)){var o=document.createElement("canvas");o.width=t,o.height=i,(n=o.getContext("2d")).globalCompositeOperation="copy",r[i]=n}return n.drawImage(e,0,0,t,i),n.getImageData(0,0,t,i).data}function a$U(e,t){return a$Z(e,t=u$Y(t,0),Math.min(4,e.length))}function g$I(){this.PI=3.14159265358979,this.param_a=0,this.param_d=1e-12,this.p=206264.8062471,this.a=6378137,this.b=6356752.31414036,this.alpha=.003352810681182319,this.e2=.0066943800229,this.e21=.00673949677548,this.c=6399593.62586,this.K0=1.57048761144159e-7,this.K1=.00505250178820567,this.K2=298472900956587e-19,this.K3=2.41626669230084e-7,this.K4=2.22241238938534e-9,this.alpha=1/298.257222101,this.e4=Math.pow(this.e2,2),this.e6=Math.pow(this.e2,3),this.e8=Math.pow(this.e2,4),this.A=1+.5*this.e2+.375*this.e4+.3125*this.e6+630/2304*this.e8,this.B=1/6*this.e2+15/80*this.e4+.1875*this.e6+420/2304*this.e8,this.C=3/80*this.e4+7/112*this.e6+.078125*this.e8,this.D=1/112*this.e6+45/2304*this.e8,this.E=5/2304*this.e8}function x$W(){this.PI=3.14159265358979,this.param_a=0,this.param_d=1e-12,this.p=206264.8062471,this.a=6378140,this.b=6356755.288157528,this.alpha=.0033528131778969143,this.e2=.00669438499958795,this.e21=.00673950181947292,this.c=6399596.65198801,this.K0=1.57048687472752e-7,this.K1=.00505250559291393,this.K2=298473350966158e-19,this.K3=2.41627215981336e-7,this.K4=2.22241909461273e-9,this.e4=Math.pow(this.e2,2),this.e6=Math.pow(this.e2,3),this.e8=Math.pow(this.e2,4),this.A=1+.5*this.e2+.375*this.e4+.3125*this.e6+630/2304*this.e8,this.B=1/6*this.e2+15/80*this.e4+.1875*this.e6+420/2304*this.e8,this.C=3/80*this.e4+7/112*this.e6+.078125*this.e8,this.D=1/112*this.e6+45/2304*this.e8,this.E=5/2304*this.e8}function E$W(e,t,i,r,n,o){var a=0;a=t>1e6?t-5e5-1e6*n:t-5e5;var s=o.K0*e,l=Math.sin(s),u=s+Math.cos(s)*(o.K1*l-o.K2*Math.pow(l,3)+o.K3*Math.pow(l,5)-o.K4*Math.pow(l,7)),c=Math.tan(u),h=o.e21*Math.pow(Math.cos(u),2),d=Math.sqrt(1+h),f=a/(o.c/d),p=Math.pow(d,2)*c,_=Math.pow(c,2);i.B=u-p*Math.pow(f,2)/2+(5+3*_+h-9*h*_)*p*Math.pow(f,4)/24-(61+90*_+45*Math.pow(_,2))*p*Math.pow(f,6)/720;var m=1/Math.cos(u);i.L=m*f-(1+2*_+h)*m*Math.pow(f,3)/6+(5+28*_+24*Math.pow(_,2)+6*h+8*h*_)*m*Math.pow(f,5)/120+r}function G$Z(e,t,i,r,n,o){var a=(t-e)/2,s=(t+e)/2,l=(r+i)/2,u=2*o.b*o.b*l,c=Math.cos(s),h=Math.sin(a),d=[];return d[0]=u*o.A*h*c,d[1]=u*o.B*Math.sin(3*a)*Math.cos(3*s),d[2]=u*o.C*Math.sin(5*a)*Math.cos(5*s),d[3]=u*o.D*Math.sin(7*a)*Math.cos(7*s),d[4]=u*o.E*Math.sin(9*a)*Math.cos(9*s),d[0]-d[1]+d[2]-d[3]+d[4]}function q$W(e,t,i,r){for(var n=0,o=0;o<e.length-1;o++)for(var a=e[o],s=e[o+1],l=a.x,u=a.y,c=s.x,h=s.y,d=s.x-a.x,f=s.y-a.y,p=Math.pow(Math.abs(d),2),_=Math.pow(Math.abs(f),2),m=Math.sqrt(p+_),$=Math.floor(m/70),g=1;g<=$+1;g++){var v=0,y=0;g<$+1?(v=a.x+d*g/($+1),y=a.y+f*g/($+1)):(v=c,y=h);var x={B:0,L:0},b={B:0,L:0};E$W(u,l,x,t,i,r),E$W(y,v,b,t,i,r),n+=G$Z(x.B,b.B,x.L,b.L,t,r),l=v,u=y}return Math.abs(n)}function I$17(e,t,i,r){for(var n=0,o=0;o<e.length-1;o++){var a={B:0,L:0},s={B:0,L:0};E$W(e[o].y,e[o].x,a,t,i,r),E$W(e[o+1].y,e[o+1].x,s,t,i,r);var l=[],u=(s.B-a.B)/2,c=(s.B+a.B)/2,h=(s.L+a.L)/2,d=2*r.b*r.b*h,f=Math.cos(c),p=Math.sin(u);l[0]=d*r.A*f*p,l[1]=d*r.B*Math.sin(3*u)*Math.cos(3*c),l[2]=d*r.C*Math.sin(5*u)*Math.cos(5*c),l[3]=d*r.D*Math.sin(7*u)*Math.cos(7*c),l[4]=d*r.E*Math.sin(9*u)*Math.cos(9*c),n+=l[0]-l[1]+l[2]-l[3]+l[4]}return Math.abs(n)}function R$L(e,t,i,r,n){var o=0,a=e$27.toRadians(i);if("China2000"===t)o=q$W(e,a,r,new g$I);else if("Xian1980"===t){o=I$17(e,a,r,new x$W)}return o}var tmp$1={};(function(global,undefined$1){!function(e,t,i){global.protobuf=function i(r){var n=t[r];return n||e[r][0].call(n=t[r]={exports:{}},i,n,n.exports),n.exports}(7)}({1:[function(e,t,i){t.exports=function(e,t){for(var i=[],r=2;r<arguments.length;)i.push(arguments[r++]);var n=!0;return new Promise((function(r,o){i.push((function(e){if(n)if(n=!1,e)o(e);else{for(var t=[],i=1;i<arguments.length;)t.push(arguments[i++]);r.apply(null,t)}}));try{e.apply(t||this,i)}catch(e){n&&(n=!1,o(e))}}))}},{}],2:[function(e,t,i){var r=i;r.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;--t%4>1&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;r.encode=function(e,t,i){for(var r,o=[],a=0,s=0;t<i;){var l=e[t++];switch(s){case 0:o[a++]=n[l>>2],r=(3&l)<<4,s=1;break;case 1:o[a++]=n[r|l>>4],r=(15&l)<<2,s=2;break;case 2:o[a++]=n[r|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[r],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};var s="invalid encoding";r.decode=function(e,t,i){for(var r,n=i,a=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&a>1)break;if((u=o[u])===undefined$1)throw Error(s);switch(a){case 0:r=u,a=1;break;case 1:t[i++]=r<<2|(48&u)>>4,r=u,a=2;break;case 2:t[i++]=(15&r)<<4|(60&u)>>2,r=u,a=3;break;case 3:t[i++]=(3&r)<<6|u,a=0}}if(1===a)throw Error(s);return i-n},r.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,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<i.length;)i[r].fn===t?i.splice(r,1):++r;return this},r.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,i)}return this}},{}],4:[function(require,module,exports){function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},{}],5:[function(e,t,i){t.exports=function(e,t,i){var r=i||8192,n=r>>>1,o=null,a=r;return function(i){if(i<1||i>n)return e(i);a+i>r&&(o=e(r),a=0);var s=t.call(o,a,a+=i);return 7&a&&(a=1+(7|a)),s}}},{}],6:[function(e,t,i){var r=i;r.length=function(e){for(var t=0,i=0,r=0;r<e.length;++r)(i=e.charCodeAt(r))<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},r.read=function(e,t,i){if(i-t<1)return"";for(var r,n=null,o=[],a=0;t<i;)(r=e[t++])<128?o[a++]=r:r>191&&r<224?o[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),a=0);return n?(a&&n.push(String.fromCharCode.apply(String,o.slice(0,a))),n.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,i){for(var r,n,o=i,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[i++]=r:r<2048?(t[i++]=r>>6|192,t[i++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&n),++a,t[i++]=r>>18|240,t[i++]=r>>12&63|128,t[i++]=r>>6&63|128,t[i++]=63&r|128):(t[i++]=r>>12|224,t[i++]=r>>6&63|128,t[i++]=63&r|128);return i-o}},{}],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),o=n.LongBits,a=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 u=typeof Uint8Array<"u"?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 c(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=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,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw 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 d(){if(this.pos+8>this.len)throw s(this,8);return new o(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=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),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 f=typeof Float32Array<"u"?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(i,r){return t[0]=i[r],t[1]=i[r+1],t[2]=i[r+2],t[3]=i[r+3],e[0]}:function(i,r){return t[0]=i[r+3],t[1]=i[r+2],t[2]=i[r+1],t[3]=i[r],e[0]}}():function(e,t){var i=h(e,t+4),r=2*(i>>31)+1,n=i>>>23&255,o=8388607&i;return 255===n?o?NaN:r*(1/0):0===n?1401298464324817e-60*r*o:r*Math.pow(2,n-150)*(o+8388608)};l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=f(this.buf,this.pos);return this.pos+=4,e};var p=typeof Float64Array<"u"?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(i,r){return t[0]=i[r],t[1]=i[r+1],t[2]=i[r+2],t[3]=i[r+3],t[4]=i[r+4],t[5]=i[r+5],t[6]=i[r+6],t[7]=i[r+7],e[0]}:function(i,r){return t[0]=i[r+7],t[1]=i[r+6],t[2]=i[r+5],t[3]=i[r+4],t[4]=i[r+3],t[5]=i[r+2],t[6]=i[r+1],t[7]=i[r],e[0]}}():function(e,t){var i=h(e,t+4),r=h(e,t+8),n=2*(r>>31)+1,o=r>>>20&2047,a=4294967296*(1048575&r)+i;return 2047===o?a?NaN:n*(1/0):0===o?5e-324*n*a:n*Math.pow(2,o-1075)*(a+4503599627370496)};l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=p(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 a.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 c.call(this)[t](!1)},uint64:function(){return c.call(this)[t](!0)},sint64:function(){return c.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){t.exports=o;var r=e(8);(o.prototype=Object.create(r.prototype)).constructor=o;var n=e(13);function o(e){r.call(this,e)}n.Buffer&&(o.prototype._slice=n.Buffer.prototype.slice),o.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=n;var r=e(13);function n(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}(n.prototype=Object.create(r.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,i,n,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(e,s,t,i,n,o);if(!s.rpcImpl)return setTimeout((function(){a(Error("already ended"))}),0),undefined$1;try{return s.rpcImpl(t,i[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,i){if(e)return s.emit("error",e,t),a(e);if(null===i)return s.end(!0),undefined$1;if(!(i instanceof n))try{i=n[s.responseDelimited?"decodeDelimited":"decode"](i)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",i,t),a(null,i)}))}catch(e){return s.emit("error",e,t),setTimeout((function(){a(e)}),0),undefined$1}},n.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 o=n.zero=new n(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var i=e>>>0,r=(e-i)/4294967296>>>0;return t&&(r=~r>>>0,i=~i>>>0,++i>4294967295&&(i=0,++r>4294967295&&(r=0))),new n(i,r)},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):o},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}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 s=String.prototype.charCodeAt;n.fromHash=function(e){return e===a?o:new n((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},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<r.length;++n)(e[r[n]]===undefined$1||!i)&&(e[r[n]]=t[r[n]]);return e}function o(e){function t(e,i){if(!(this instanceof t))return new t(e,i);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),i&&n(this,i)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}r.asPromise=e(1),r.base64=e(2),r.EventEmitter=e(3),r.inquire=e(4),r.utf8=e(6),r.pool=e(5),r.LongBits=e(12),r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch{return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)},r.Array=typeof Uint8Array<"u"?Uint8Array:Array,r.Long=global.dcodeIO&&global.dcodeIO.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var i=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=1;return function(){for(var e=Object.keys(this),i=e.length-1;i>-1;--i)if(1===t[e[i]]&&this[e[i]]!==undefined$1&&null!==this[e[i]])return e[i]}},r.oneOfSetter=function(e){return function(t){for(var i=0;i<e.length;++i)e[i]!==t&&delete this[e[i]]}},r.lazyResolve=function(e,t){for(var i=0;i<t.length;++i)for(var r=Object.keys(t[i]),n=0;n<r.length;++n){for(var o=t[i][r[n]].split("."),a=e;o.length;)a=a[o.shift()];t[i][r[n]]=a}},r.toJSONOptions={longs:String,enums:String,bytes:String},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,i){return new e(t,i)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,i){t.exports=h;var r,n=e(13),o=n.LongBits,a=n.base64,s=n.utf8;function l(e,t,i){this.fn=e,this.len=t,this.next=undefined$1,this.val=i}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function h(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}function d(e,t,i){t[i]=255&e}function f(e,t){this.len=e,this.next=undefined$1,this.val=t}function p(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function _(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}h.create=n.Buffer?function(){return(h.create=function(){return new r})()}:function(){return new h},h.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(h.alloc=n.pool(h.alloc,n.Array.prototype.subarray)),h.prototype.push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},f.prototype=Object.create(l.prototype),f.prototype.fn=function(e,t,i){for(;e>127;)t[i++]=127&e|128,e>>>=7;t[i]=e},h.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},h.prototype.int32=function(e){return e<0?this.push(p,10,o.fromNumber(e)):this.uint32(e)},h.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},h.prototype.uint64=function(e){var t=o.from(e);return this.push(p,t.length(),t)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this.push(p,t.length(),t)},h.prototype.bool=function(e){return this.push(d,1,e?1:0)},h.prototype.fixed32=function(e){return this.push(_,4,e>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(e){var t=o.from(e);return this.push(_,4,t.lo).push(_,4,t.hi)},h.prototype.sfixed64=h.prototype.fixed64;var m=typeof Float32Array<"u"?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(i,r,n){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n]=t[3]}:function(i,r,n){e[0]=i,r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)_(1/e>0?0:2147483648,t,i);else if(isNaN(e))_(2147483647,t,i);else if(e>34028234663852886e22)_((r<<31|2139095040)>>>0,t,i);else if(e<11754943508222875e-54)_((r<<31|Math.round(e/1401298464324817e-60))>>>0,t,i);else{var n=Math.floor(Math.log(e)/Math.LN2);_((r<<31|n+127<<23|8388607&Math.round(e*Math.pow(2,-n)*8388608))>>>0,t,i)}};h.prototype.float=function(e){return this.push(m,4,e)};var $=typeof Float64Array<"u"?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(i,r,n){e[0]=i,r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3],r[n++]=t[4],r[n++]=t[5],r[n++]=t[6],r[n]=t[7]}:function(i,r,n){e[0]=i,r[n++]=t[7],r[n++]=t[6],r[n++]=t[5],r[n++]=t[4],r[n++]=t[3],r[n++]=t[2],r[n++]=t[1],r[n]=t[0]}}():function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)_(0,t,i),_(1/e>0?0:2147483648,t,i+4);else if(isNaN(e))_(4294967295,t,i),_(2147483647,t,i+4);else if(e>17976931348623157e292)_(0,t,i),_((r<<31|2146435072)>>>0,t,i+4);else{var n;if(e<22250738585072014e-324)_((n=e/5e-324)>>>0,t,i),_((r<<31|n/4294967296)>>>0,t,i+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),_(4503599627370496*(n=e*Math.pow(2,-o))>>>0,t,i),_((r<<31|o+1023<<20|1048576*n&1048575)>>>0,t,i+4)}}};h.prototype.double=function(e){return this.push($,8,e)};var g=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r<e.length;++r)t[i+r]=e[r]};h.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(d,1,0);if(n.isString(e)){var i=h.alloc(t=a.length(e));a.decode(e,i,0),e=i}return this.uint32(t).push(g,t,e)},h.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).push(s.write,t,e):this.push(d,1,0)},h.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},h.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(u,0,0),this.len=0),this},h.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},h.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},h._configure=function(e){r=e}},{13:13}],15:[function(e,t,i){t.exports=a;var r=e(14);(a.prototype=Object.create(r.prototype)).constructor=a;var n=e(13),o=n.Buffer;function a(){r.call(this)}a.alloc=function(e){return(a.alloc=n._Buffer_allocUnsafe)(e)};var s=o&&o.prototype instanceof Uint8Array&&"set"===o.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<e.length;)t[i++]=e[r++]};function l(e,t,i){e.length<40?n.utf8.write(e,t,i):t.utf8Write(e,i)}a.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(s,t,e),this},a.prototype.string=function(e){var t=o.byteLength(e);return this.uint32(t),t&&this.push(l,t,e),this}},{13:13,14:14}]},{})})(tmp$1);var R$K=tmp$1.protobuf,d$10=[1,2,4,8],a$T=15,m$R=16,p$U=64,y$O=128;function e$1t(e,t,i,r,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}function U$U(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;n<t;++n)r[n]=e.charCodeAt(n);return i}e$1t.clone=function(e,t){return e$28(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new e$1t(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},e$1t.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},e$1t.prototype.hasSubtree=function(){return i$U(this._bits,m$R)},e$1t.prototype.hasImagery=function(){return i$U(this._bits,p$U)},e$1t.prototype.hasTerrain=function(){return i$U(this._bits,y$O)},e$1t.prototype.hasChildren=function(){return i$U(this._bits,a$T)},e$1t.prototype.hasChild=function(e){return i$U(this._bits,d$10[e])},e$1t.prototype.getChildBitmask=function(){return this._bits&a$T};var X$H=U$U('Eô½\vyâjE"Â’,Ã�qøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½Nuà A[ß@V\fÙ»r›Â�|3SîOlÔq°{ÀEVZÂwUe\v3Â’*¬l5Ã…0sø3>mF8J´Ã�ð.Ã�uڌDt"úa"\f3"So¯9D\vÂŒ9Ù9L¹¿«\\ÂŒP_Ÿ"uxéq‘h;Ã�ěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Â�Pú[/F›n5/\'C.ë\n\f^Â¥se4Ã¥l.jC\'c#U©?q{gC}:¯Ã�âTUœýKÆâŸ/(ÃË\\Æ-fˆ§;/*"N°k.Ã�\r•}}GºC²²+>Mª>}æÎI䮾x\fa1-¤OÂ¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©ÂS+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ã�1²&/çÃu-6,rt°#G·ÓÑ&Â…7râ\0ÂŒDÃ�Ú3-Þ`†i#i*|Ã�KQ\r•T9w.)ê¦P¢jÂ�oP™\\>TûïP[\vE‰m(w7ێJfJo™ Ã¥pâ¹q~\fmI-zþrÇòY0Â�»]såÉ êxì Â�ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÃ�\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1Â’;µoÜl\r’ˆÑžÛ?âéÚ_ԄâFaZÞUÃ�¤\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÃ�KW>\'\'Ç`Û;ÚSD>?Â�Â’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj Ã¥*x°ÖÂ�prª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ã�8i¯ðVldIœ\'ÂxtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Ã�\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)Â…{IIÂ¥wy¾IV.6ç\v:»Ob{Ã’M1•/½8{¨O!áìFpv•})"xˆ\nÂ�Ã�Â�\\ÚÞQÃ�ðüYRe|3ßóHÚ»*uÛ`²ÔüÃì5¨ÿ(1-È܈F|Š["');function c$T(e){o$1u.defined("resourceOrUrl",e);var t=e;"string"!=typeof t&&!(t instanceof t$S)&&(o$1u.typeOf.string("resourceOrUrl.url",e.url),t=e.url);var i=t$S.createIfNeeded(t);i.appendForwardSlash(),this._resource=i,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=e$27.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var r=this;this._readyPromise=z$L(this).then((function(){return r.getQuadTreePacket("",r._quadPacketVersion)})).then((function(){return!0})).otherwise((function(e){var t="An error occurred while accessing "+B$G(r,"",1).url+".";return o$1q.reject(new t$U(t))}))}Object.defineProperties(c$T.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}}}),c$T.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r},c$T.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];i$U(a,2)?i$U(a,1)||(t|=o):(i|=o,i$U(a,1)&&(t|=o))}return{x:t,y:i,level:r}},c$T.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(e$28(t))return null!==t;for(var i,r=!0,n=e;n.length>1;){if(i=n.substring(n.length-1),n=n.substring(0,n.length-1),e$28(t=this.getTileInformationFromQuadKey(n))){!t.hasSubtree()&&!t.hasChild(parseInt(i))&&(r=!1);break}if(null===t){r=!1;break}}return r};var k$V=new i$W("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY),w$D,I$16;function P$R(e,t,i){var r=e._tileInfo,n=t,o=r[n];if(e$28(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;void 0===o&&n.length>1;)o=r[n=n.substring(0,n.length-1)];var a,s=e._subtreePromises,l=s[n];return e$28(l)?l.then((function(){return a=new r$1c({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),P$R(e,t,a)})):e$28(o)&&o.hasSubtree()?e$28(l=e.getQuadTreePacket(n,o.cnodeVersion,i))?(s[n]=l,l.then((function(){return a=new r$1c({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),P$R(e,t,a)})).always((function(){delete s[n]}))):void 0:o$1q.reject(new t$U("Couldn't load metadata for tile "+t))}function B$G(e,t,i,r){return e._resource.getDerivedResource({url:"flatfile?q2-0"+t+"-q."+i.toString(),request:r})}function z$L(e){var t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!e$28(I$16)){var i=n$17("ThirdParty/google-earth-dbroot-parser.js"),r=window.cesiumGoogleEarthDbRootParser;I$16=a$16(i).then((function(){w$D=window.cesiumGoogleEarthDbRootParser(R$K),e$28(r)?window.cesiumGoogleEarthDbRootParser=r:delete window.cesiumGoogleEarthDbRootParser}))}return I$16.then((function(){return t.fetchArrayBuffer()})).then((function(t){var i=w$D.EncryptedDbRootProto.decode(new Uint8Array(t)),r=i.encryptionData,n=r.byteOffset,o=n+r.byteLength,a=e.key=r.buffer.slice(n,o);o=(n=(r=i.dbrootData).byteOffset)+r.byteLength;var s=r.buffer.slice(n,o);return k$V.scheduleTask({buffer:s,type:"DbRoot",key:a},[s])})).then((function(t){var i=w$D.DbRootProto.decode(new Uint8Array(t.buffer));if(e.imageryPresent=u$Y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=u$Y(i.terrainPresent,e.terrainPresent),e$28(i.endSnippet)&&e$28(i.endSnippet.model)){var r=i.endSnippet.model;e.negativeAltitudeExponentBias=u$Y(r.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=u$Y(r.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}e$28(i.databaseVersion)&&(e._quadPacketVersion=u$Y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));for(var n=e.providers,o=u$Y(i.providerInfo,[]),a=o.length,s=0;s<a;++s){var l=o[s],u=l.copyrightString;e$28(u)&&(n[l.providerId]=new r$1a(u.value))}})).otherwise((function(){console.log("Failed to retrieve "+t.url+". Using defaults."),e.key=X$H}))}function T$K(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.typeOf.object("options.buffer",e.buffer),o$1u.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),o$1u.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=u$Y(e.childTileMask,15),i=3&t;i|=4&t?8:0,i|=8&t?4:0,this._childTileMask=i,this._createdByUpsampling=u$Y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}c$T.prototype.getQuadTreePacket=function(e,t,i){t=u$Y(t,1);var r=B$G(this,e=u$Y(e,""),t,i).fetchArrayBuffer();if(e$28(r)){var n=this._tileInfo,o=this.key;return r.then((function(t){return k$V.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:o},[t]).then((function(t){var i,r=-1;if(""!==e){r=e.length+1;var o=t[e];(i=n[e])._bits|=o._bits,delete t[e]}var a=Object.keys(t);a.sort((function(e,t){return e.length-t.length}));for(var s=a.length,l=0;l<s;++l){var u=a[l];if(null!==t[u]){var c=e$1t.clone(t[u]),h=u.length;if(h===r)c.setParent(i);else if(h>1){var d=n[u.substring(0,u.length-1)];c.setParent(d)}n[u]=c}else n[u]=null}}))}))}},c$T.prototype.populateSubtree=function(e,t,i,r){return P$R(this,c$T.tileXYToQuadKey(e,t,i),r)},c$T.prototype.getTileInformation=function(e,t,i){var r=c$T.tileXYToQuadKey(e,t,i);return this._tileInfo[r]},c$T.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},Object.defineProperties(T$K.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var te$D=new i$W("createVerticesFromGoogleEarthEnterpriseBuffer"),F$X=new h$10,z$K=new h$10;T$K.prototype.createMesh=function(e,t,i,r,n){o$1u.typeOf.object("tilingScheme",e),o$1u.typeOf.number("x",t),o$1u.typeOf.number("y",i),o$1u.typeOf.number("level",r);var o=e.ellipsoid;e.tileXYToNativeRectangle(t,i,r,F$X),e.tileXYToRectangle(t,i,r,z$K),n=u$Y(n,1);var a=o.cartographicToCartesian(h$10.center(z$K)),s=40075.16/(1<<r);this._skirtHeight=Math.min(8*s,1e3);var l=te$D.scheduleTask({buffer:this._buffer,nativeRectangle:F$X,rectangle:z$K,relativeToCenter:a,ellipsoid:o,skirtHeight:this._skirtHeight,exaggeration:n,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(e$28(l)){var u=this;return l.then((function(e){return u._mesh=new T$T(a,new Float32Array(e.vertices),new Uint16Array(e.indices),e.indexCountWithoutSkirts,e.vertexCountWithoutSkirts,e.minimumHeight,e.maximumHeight,i$19.clone(e.boundingSphere3D),t$X.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,x$13.clone(e.orientedBoundingBox),h$T.clone(e.encoding),n,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),u._minimumHeight=e.minimumHeight,u._maximumHeight=e.maximumHeight,u._buffer=void 0,u._mesh}))}},T$K.prototype.interpolateHeight=function(e,t,i){var r=e$27.clamp((t-e.west)/e.width,0,1),n=e$27.clamp((i-e.south)/e.height,0,1);return e$28(this._mesh)?oe$u(this,r,n):de$s(this,r,n,e)};var ie$z=new i$W("upsampleQuantizedTerrainMesh");T$K.prototype.upsample=function(e,t,i,r,n,o,a){if(o$1u.typeOf.object("tilingScheme",e),o$1u.typeOf.number("thisX",t),o$1u.typeOf.number("thisY",i),o$1u.typeOf.number("thisLevel",r),o$1u.typeOf.number("descendantX",n),o$1u.typeOf.number("descendantY",o),o$1u.typeOf.number("descendantLevel",a),a-r>1)throw new t$Z("Upsampling through more than one level at a time is not currently supported.");var s=this._mesh;if(e$28(this._mesh)){var l=2*t!==n,u=2*i===o,c=e.ellipsoid,h=e.tileXYToRectangle(n,o,a),d=ie$z.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:l,isNorthChild:u,childRectangle:h,ellipsoid:c,exaggeration:s.exaggeration});if(e$28(d)){var f=this;return d.then((function(e){var t=new Uint16Array(e.vertices),i=ce$v.createTypedArray(t.length/3,e.indices),r=f._skirtHeight;return new p$_({quantizedVertices:t,indices:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:i$19.clone(e.boundingSphere),orientedBoundingBox:x$13.clone(e.orientedBoundingBox),horizonOcclusionPoint:t$X.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:r,southSkirtHeight:r,eastSkirtHeight:r,northSkirtHeight:r,childTileMask:0,createdByUpsampling:!0,credits:f._credits})}))}}},T$K.prototype.isChildAvailable=function(e,t,i,r){o$1u.typeOf.number("thisX",e),o$1u.typeOf.number("thisY",t),o$1u.typeOf.number("childX",i),o$1u.typeOf.number("childY",r);var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},T$K.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var re$x=new o$1k,ne$F=new o$1k,ae$x=new o$1k,Y$D=new t$X;function oe$u(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s<l;s+=3){var u=a[s],c=a[s+1],h=a[s+2],d=o.decodeTextureCoordinates(n,u,re$x),f=o.decodeTextureCoordinates(n,c,ne$F),p=o.decodeTextureCoordinates(n,h,ae$x),_=d$19.computeBarycentricCoordinates(t,i,d.x,d.y,f.x,f.y,p.x,p.y,Y$D);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var m=o.decodeHeight(n,u),$=o.decodeHeight(n,c),g=o.decodeHeight(n,h);return _.x*m+_.y*$+_.z*g}}}var se$u=Uint16Array.BYTES_PER_ELEMENT,L$11=Uint32Array.BYTES_PER_ELEMENT,P$Q=Int32Array.BYTES_PER_ELEMENT,he$q=Float32Array.BYTES_PER_ELEMENT,U$T=Float64Array.BYTES_PER_ELEMENT;function de$s(e,t,i,r){var n=e._buffer,o=0,a=0,s=0;i>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),u=0,c=0;c<o;++c)u+=l.getUint32(u,!0),u+=L$11;u+=L$11,u+=2*U$T;var h=e$27.toRadians(180*l.getFloat64(u,!0));u+=U$T;var d=e$27.toRadians(180*l.getFloat64(u,!0));u+=U$T;var f=r.width/h/2,p=r.height/d/2,_=l.getInt32(u,!0);u+=P$Q;var m=3*l.getInt32(u,!0);u+=P$Q,u+=P$Q;var $,g=new Array(_),v=new Array(_),y=new Array(_);for($=0;$<_;++$)g[$]=a+l.getUint8(u++)*f,v[$]=s+l.getUint8(u++)*p,y[$]=6371010*l.getFloat32(u,!0),u+=he$q;var x=new Array(m);for($=0;$<m;++$)x[$]=l.getUint16(u,!0),u+=se$u;for($=0;$<m;$+=3){var b=x[$],w=x[$+1],C=x[$+2],T=g[b],S=g[w],E=g[C],A=v[b],P=v[w],I=v[C],M=d$19.computeBarycentricCoordinates(t,i,T,A,S,P,E,I,Y$D);if(M.x>=-1e-15&&M.y>=-1e-15&&M.z>=-1e-15)return M.x*y[b]+M.y*y[w]+M.z*y[C]}}var d$$={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},S$I=new a$12;function I$15(){this._terrainCache={},this._lastTidy=a$12.now()}function _$M(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url)&&!e$28(e.metadata))throw new t$Z("options.url or options.metadata is required.");var t;if(e$28(e.metadata))t=e.metadata;else{var i=t$S.createIfNeeded(e.url);t=new c$T(i)}this._metadata=t,this._tilingScheme=new g$14({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h$10(-e$27.PI,-e$27.PI,e$27.PI,e$27.PI),ellipsoid:e.ellipsoid});var r=e.credit;"string"==typeof r&&(r=new r$1a(r)),this._credit=r,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new I$15,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new o$1o,this._ready=!1;var n,o=this;this._readyPromise=t.readyPromise.then((function(e){if(!t.terrainPresent){var i=new t$U("The server "+t.url+" doesn't have terrain");return n=l$13.handleError(n,o,o._errorEvent,i.message,void 0,void 0,void 0,i),o$1q.reject(i)}return l$13.handleSuccess(n),o._ready=e,e})).otherwise((function(e){return n=l$13.handleError(n,o,o._errorEvent,e.message,void 0,void 0,void 0,e),o$1q.reject(e)}))}I$15.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:a$12.now()}},I$15.prototype.get=function(e){var t=this._terrainCache[e];if(e$28(t))return delete this._terrainCache[e],t.buffer},I$15.prototype.tidy=function(){if(a$12.now(S$I),a$12.secondsDifference(S$I,this._lastTidy)>10){for(var e=this._terrainCache,t=Object.keys(e),i=t.length,r=0;r<i;++r){var n=t[r],o=e[n];a$12.secondsDifference(S$I,o.timestamp)>10&&delete e[n]}a$12.clone(S$I,this._lastTidy)}},Object.defineProperties(_$M.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var z$J=new i$W("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);function G$Y(e,t,i){var r=t.getChildBitmask();if(t.terrainState===d$$.PARENT){r=0;for(var n=0;n<4;++n){var o=i.getTileInformationFromQuadKey(e+n.toString());e$28(o)&&o.hasTerrain()&&(r|=1<<n)}}return r}function $$N(e,t,i,r){return i=e$28(i)&&i>0?i:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1c-0"+t+"-t."+i.toString(),request:r})}_$M.prototype.requestTileGeometry=function(e,t,i,r){if(!this._ready)throw new t$Z("requestTileGeometry must not be called before the terrain provider is ready.");var n=c$T.tileXYToQuadKey(e,t,i),o=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(n);if(!e$28(s))return o$1q.reject(new t$U("Terrain tile doesn't exist"));var l=s.terrainState;e$28(l)||(l=s.terrainState=d$$.UNKNOWN);var u=o.get(n);if(e$28(u)){var c=a.providers[s.terrainProvider];return o$1q.resolve(new T$K({buffer:u,childTileMask:G$Y(n,s,a),credits:e$28(c)?[c]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(o.tidy(),!s.ancestorHasTerrain)return o$1q.resolve(new T$S({buffer:new Uint8Array(256),width:16,height:16}));if(l===d$$.NONE)return o$1q.reject(new t$U("Terrain tile doesn't exist"));var h,d=n,f=-1;switch(l){case d$$.SELF:f=s.terrainVersion;break;case d$$.PARENT:d=d.substring(0,d.length-1),f=(h=a.getTileInformationFromQuadKey(d)).terrainVersion;break;case d$$.UNKNOWN:s.hasTerrain()?f=s.terrainVersion:(d=d.substring(0,d.length-1),e$28(h=a.getTileInformationFromQuadKey(d))&&h.hasTerrain()&&(f=h.terrainVersion))}if(f<0)return o$1q.reject(new t$U("Terrain tile doesn't exist"));var p,_,m=this._terrainPromises,$=this._terrainRequests;if(e$28(m[d]))p=m[d],_=$[d];else{var g=$$N(this,d,f,_=r).fetchArrayBuffer();if(!e$28(g))return;p=g.then((function(e){return e$28(e)?z$J.scheduleTask({buffer:e,type:"Terrain",key:a.key},[e]).then((function(e){var t=a.getTileInformationFromQuadKey(d);t.terrainState=d$$.SELF,o.add(d,e[0]);for(var i=t.terrainProvider,r=e.length-1,n=0;n<r;++n){var s=d+n.toString(),l=a.getTileInformationFromQuadKey(s);e$28(l)&&(o.add(s,e[n+1]),l.terrainState=d$$.PARENT,0===l.terrainProvider&&(l.terrainProvider=i))}})):o$1q.reject(new t$U("Failed to load terrain."))})),m[d]=p,$[d]=_,p=p.always((function(){delete m[d],delete $[d]}))}return p.then((function(){var e=o.get(n);if(e$28(e)){var t=a.providers[s.terrainProvider];return new T$K({buffer:e,childTileMask:G$Y(n,s,a),credits:e$28(t)?[t]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return o$1q.reject(new t$U("Failed to load terrain."))})).otherwise((function(e){return _.state===W$14.CANCELLED?(r.state=_.state,o$1q.reject(e)):(s.terrainState=d$$.NONE,o$1q.reject(e))}))},_$M.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},_$M.prototype.getTileDataAvailable=function(e,t,i){var r=this._metadata,n=c$T.tileXYToQuadKey(e,t,i),o=r.getTileInformation(e,t,i);if(null===o)return!1;if(e$28(o)){if(!o.ancestorHasTerrain)return!0;var a=o.terrainState;if(a===d$$.NONE)return!1;if(!(e$28(a)&&a!==d$$.UNKNOWN||(o.terrainState=d$$.UNKNOWN,o.hasTerrain()))){n=n.substring(0,n.length-1);var s=r.getTileInformationFromQuadKey(n);if(!e$28(s)||!s.hasTerrain())return!1}return!0}if(r.isValid(n)){var l=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.TERRAIN});r.populateSubtree(e,t,i,l)}return!1},_$M.prototype.loadTileDataAvailability=function(e,t,i){};var Ua$3=[n$1b,t$M],Gr$2=Ua$3.length,ur$4=Math.cos(e$27.toRadians(30)),Sr$2=Math.cos(e$27.toRadians(150)),wr$3=0,gr$6=1e3;function aa$1(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions;if(!e$28(t)||t.length<2)throw new t$Z("At least two positions are required.");if(e$28(e.arcType)&&e.arcType!==m$_.GEODESIC&&e.arcType!==m$_.RHUMB)throw new t$Z("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=u$Y(e.width,1),this._positions=t,this.granularity=u$Y(e.granularity,9999),this.loop=u$Y(e.loop,!1),this.arcType=u$Y(e.arcType,m$_.GEODESIC),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(aa$1.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+t$V.packedLength+1+1}}}),aa$1.setProjectionAndEllipsoid=function(e,t){for(var i=0,r=0;r<Gr$2;r++)if(t instanceof Ua$3[r]){i=r;break}e._projectionIndex=i,e._ellipsoid=t.ellipsoid};var jr$5=new t$X,Er$2=new t$X,dr$4=new t$X;function Xa$1(e,t,i,r,n){var o=N$H(r,e,0,jr$5),a=N$H(r,e,i,Er$2),s=N$H(r,t,0,dr$4),l=H$N(a,o,Er$2),u=H$N(s,o,dr$4);return t$X.cross(u,l,n),t$X.normalize(n,n)}var an$4=new t$W,rn$5=new t$X,nn$4=new t$X,en$5=new t$X;function Ya$3(e,t,i,r,n,o,a,s,l,u,c){if(0!==n){var h;o===m$_.GEODESIC?h=new E$$(e,t,a):o===m$_.RHUMB&&(h=new P$17(e,t,a));var d=h.surfaceDistance;if(!(d<n))for(var f=Xa$1(e,t,r,a,en$5),p=Math.ceil(d/n),_=d/p,m=_,$=p-1,g=s.length,v=0;v<$;v++){var y=h.interpolateUsingSurfaceDistance(m,an$4),x=N$H(a,y,i,rn$5),b=N$H(a,y,r,nn$4);t$X.pack(f,s,g),t$X.pack(x,l,g),t$X.pack(b,u,g),c.push(y.latitude),c.push(y.longitude),g+=3,m+=_}}}var Da$2=new t$W;function N$H(e,t,i,r){return t$W.clone(t,Da$2),Da$2.height=i,t$W.toCartesian(Da$2,e,r)}function H$N(e,t,i){return t$X.subtract(e,t,i),t$X.normalize(i,i),i}function mr$5(e,t,i,r){return r=H$N(e,t,r),r=t$X.cross(r,i,r),r=t$X.normalize(r,r),r=t$X.cross(i,r,r)}aa$1.pack=function(e,t,i){o$1u.typeOf.object("value",e),o$1u.defined("array",t);var r=u$Y(i,0),n=e._positions,o=n.length;t[r++]=o;for(var a=0;a<o;++a){var s=n[a];t$X.pack(s,t,r),r+=3}return t[r++]=e.granularity,t[r++]=e.loop?1:0,t[r++]=e.arcType,t$V.pack(e._ellipsoid,t,r),r+=t$V.packedLength,t[r++]=e._projectionIndex,t[r++]=e._scene3DOnly?1:0,t},aa$1.unpack=function(e,t,i){o$1u.defined("array",e);for(var r=u$Y(t,0),n=e[r++],o=new Array(n),a=0;a<n;a++)o[a]=t$X.unpack(e,r),r+=3;var s=e[r++],l=1===e[r++],u=e[r++],c=t$V.unpack(e,r);r+=t$V.packedLength;var h=e[r++],d=1===e[r++];if(!e$28(i)){var f=new aa$1({positions:o,granularity:s,loop:l,arcType:u,ellipsoid:c});return f._projectionIndex=h,f._scene3DOnly=d,f}return i._positions=o,i.granularity=s,i.loop=l,i.arcType=u,i._ellipsoid=c,i._projectionIndex=h,i._scene3DOnly=d,i};var cn$3=new t$X,tn$5=new t$X,on$3=new t$X,Or$1=new t$X,vn$3=0,pn$3=-1;function Ja$1(e,t,i,r,n){var o=H$N(i,t,Or$1),a=mr$5(e,t,o,cn$3),s=mr$5(r,t,o,tn$5);if(e$27.equalsEpsilon(t$X.dot(a,s),pn$3,e$27.EPSILON5))return n=t$X.cross(o,a,n),n=t$X.normalize(n,n);n=t$X.add(s,a,n),n=t$X.normalize(n,n);var l=t$X.cross(o,n,on$3);return t$X.dot(s,l)<vn$3&&(n=t$X.negate(n,n)),n}var ka$1=o$1i.fromPointNormal(t$X.ZERO,t$X.UNIT_Y),sn$3=new t$X,fn$3=new t$X,hn$3=new t$X,ln$4=new t$X,un$3=new t$X,Aa$3=new t$X,Ra$3=new t$W,Cr$2=new t$W,Ir$3=new t$W;aa$1.createGeometry=function(e){var t,i,r=!e._scene3DOnly,n=e.loop,o=e._ellipsoid,a=e.granularity,s=e.arcType,l=new Ua$3[e._projectionIndex](o),u=wr$3,c=gr$6,h=e._positions,d=h.length;2===d&&(n=!1);var f,p,_,m,$,g,v,y=new P$17(void 0,void 0,o),x=[h[0]];for(i=0;i<d-1;i++)f=h[i],p=h[i+1],e$28($=g$10.lineSegmentPlane(f,p,ka$1,Aa$3))&&!t$X.equalsEpsilon($,f,e$27.EPSILON7)&&!t$X.equalsEpsilon($,p,e$27.EPSILON7)&&(e.arcType===m$_.GEODESIC?x.push(t$X.clone($)):e.arcType===m$_.RHUMB&&(v=o.cartesianToCartographic($,Ra$3).longitude,_=o.cartesianToCartographic(f,Ra$3),m=o.cartesianToCartographic(p,Cr$2),y.setEndPoints(_,m),g=y.findIntersectionWithLongitude(v,Ir$3),e$28($=o.cartographicToCartesian(g,Aa$3))&&!t$X.equalsEpsilon($,f,e$27.EPSILON7)&&!t$X.equalsEpsilon($,p,e$27.EPSILON7)&&x.push(t$X.clone($)))),x.push(p);n&&(f=h[d-1],p=h[0],e$28($=g$10.lineSegmentPlane(f,p,ka$1,Aa$3))&&!t$X.equalsEpsilon($,f,e$27.EPSILON7)&&!t$X.equalsEpsilon($,p,e$27.EPSILON7)&&(e.arcType===m$_.GEODESIC?x.push(t$X.clone($)):e.arcType===m$_.RHUMB&&(v=o.cartesianToCartographic($,Ra$3).longitude,_=o.cartesianToCartographic(f,Ra$3),m=o.cartesianToCartographic(p,Cr$2),y.setEndPoints(_,m),g=y.findIntersectionWithLongitude(v,Ir$3),e$28($=o.cartographicToCartesian(g,Aa$3))&&!t$X.equalsEpsilon($,f,e$27.EPSILON7)&&!t$X.equalsEpsilon($,p,e$27.EPSILON7)&&x.push(t$X.clone($)))));var b=x.length,w=new Array(b);for(i=0;i<b;i++){var C=t$W.fromCartesian(x[i],o);C.height=0,w[i]=C}if(!((b=(w=D$Z(w,t$W.equalsEpsilon)).length)<2)){var T=[],S=[],E=[],A=[],P=sn$3,I=fn$3,M=hn$3,O=ln$4,D=un$3,R=w[0],L=w[1];for(P=N$H(o,w[b-1],u,P),O=N$H(o,L,u,O),I=N$H(o,R,u,I),M=N$H(o,R,c,M),D=n?Ja$1(P,I,M,O,D):Xa$1(R,L,c,o,D),t$X.pack(D,S,0),t$X.pack(I,E,0),t$X.pack(M,A,0),T.push(R.latitude),T.push(R.longitude),Ya$3(R,L,u,c,a,s,o,S,E,A,T),i=1;i<b-1;++i){P=t$X.clone(I,P),I=t$X.clone(O,I);var B=w[i];N$H(o,B,c,M),N$H(o,w[i+1],u,O),Ja$1(P,I,M,O,D),t=S.length,t$X.pack(D,S,t),t$X.pack(I,E,t),t$X.pack(M,A,t),T.push(B.latitude),T.push(B.longitude),Ya$3(w[i],w[i+1],u,c,a,s,o,S,E,A,T)}var N=w[b-1],F=w[b-2];if(I=N$H(o,N,u,I),M=N$H(o,N,c,M),n){var z=w[0];D=Ja$1(P=N$H(o,F,u,P),I,M,O=N$H(o,z,u,O),D)}else D=Xa$1(F,N,c,o,D);if(t=S.length,t$X.pack(D,S,t),t$X.pack(I,E,t),t$X.pack(M,A,t),T.push(N.latitude),T.push(N.longitude),n){for(Ya$3(N,R,u,c,a,s,o,S,E,A,T),t=S.length,i=0;i<3;++i)S[t+i]=S[i],E[t+i]=E[i],A[t+i]=A[i];T.push(R.latitude),T.push(R.longitude)}return Wn$2(n,l,E,A,S,T,r)}};var Sn$4=new t$X,wn$2=new p$1a,gn$3=new n$14;function Tr$2(e,t,i,r){var n=H$N(i,t,Sn$4),o=t$X.dot(n,e);if(o>ur$4||o<Sr$2){var a=H$N(r,i,Or$1),s=o<Sr$2?e$27.PI_OVER_TWO:-e$27.PI_OVER_TWO,l=n$14.fromAxisAngle(a,s,gn$3),u=p$1a.fromQuaternion(l,wn$2);return p$1a.multiplyByVector(u,e,e),!0}return!1}var Lr$3=new t$W,En$4=new t$X,_r$3=new t$X;function da$1(e,t,i,r,n){var o=t$W.toCartesian(t,e._ellipsoid,En$4),a=t$X.add(o,i,_r$3),s=!1,l=e._ellipsoid,u=l.cartesianToCartographic(a,Lr$3);Math.abs(t.longitude-u.longitude)>e$27.PI_OVER_TWO&&(s=!0,a=t$X.subtract(o,i,_r$3),u=l.cartesianToCartographic(a,Lr$3)),u.height=0;var c=e.project(u,n);return(n=t$X.subtract(c,r,n)).z=0,n=t$X.normalize(n,n),s&&t$X.negate(n,n),n}var dn$3=new t$X,kr$4=new t$X;function Ar$3(e,t,i,r,n,o){var a=t$X.subtract(t,e,dn$3);t$X.normalize(a,a);var s=i-wr$3,l=t$X.multiplyByScalar(a,s,kr$4);t$X.add(e,l,n);var u=r-gr$6;l=t$X.multiplyByScalar(a,u,kr$4),t$X.add(t,l,o)}var mn$3=new t$X;function Na$3(e,t){var i=o$1i.getPointDistance(ka$1,e),r=o$1i.getPointDistance(ka$1,t),n=mn$3;e$27.equalsEpsilon(i,0,e$27.EPSILON2)?(n=H$N(t,e,n),t$X.multiplyByScalar(n,e$27.EPSILON2,n),t$X.add(e,n,e)):e$27.equalsEpsilon(r,0,e$27.EPSILON2)&&(n=H$N(e,t,n),t$X.multiplyByScalar(n,e$27.EPSILON2,n),t$X.add(t,n,t))}function On$4(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(e$27.equalsEpsilon(i,e$27.PI,e$27.EPSILON11)){var n=e$27.sign(t.longitude);return e.longitude=n*(i-e$27.EPSILON11),1}if(e$27.equalsEpsilon(r,e$27.PI,e$27.EPSILON11)){var o=e$27.sign(e.longitude);return t.longitude=o*(r-e$27.EPSILON11),2}return 0}var Rr$2=new t$W,Nr$3=new t$W,Pr$3=new t$X,Ka$1=new t$X,Fr$1=new t$X,br$2=new t$X,Cn$1=new t$X,Mr$2=new t$X,In$2=[Rr$2,Nr$3],Tn$4=new h$10,Ln$4=new t$X,_n$3=new t$X,kn$3=new t$X,An$3=new t$X,Rn$3=new t$X,Nn$3=new t$X,Qa$2=new t$X,$a$1=new t$X,Pn$2=new t$X,Fn$2=new t$X,bn$3=new t$X,xr$3=new t$X,Mn$3=new t$X,xn$3=new t$X,zn$2=new i$Q,qn$1=new i$Q,zr$4=new t$X,yn=new t$X,qr$1=new t$X,Vn$2=[new i$19,new i$19],yr$3=[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],Vr$2=yr$3.length;function Wn$2(e,t,i,r,n,o,a){var s,l,u,c,h,d,f=t._ellipsoid,p=i.length/3-1,_=8*p,m=4*_,$=36*p,g=_>65535?new Uint32Array($):new Uint16Array($),v=new Float64Array(3*_),y=new Float32Array(m),x=new Float32Array(m),b=new Float32Array(m),w=new Float32Array(m),C=new Float32Array(m);a&&(u=new Float32Array(m),c=new Float32Array(m),h=new Float32Array(m),d=new Float32Array(2*_));var T=o.length/2,S=0,E=Rr$2;E.height=0;var A=Nr$3;A.height=0;var P=Pr$3,I=Ka$1;if(a)for(l=0,s=1;s<T;s++)E.latitude=o[l],E.longitude=o[l+1],A.latitude=o[l+2],A.longitude=o[l+3],P=t.project(E,P),I=t.project(A,I),S+=t$X.distance(P,I),l+=2;var M=r.length/3;I=t$X.unpack(r,0,I);var O,D=0;for(l=3,s=1;s<M;s++)P=t$X.clone(I,P),I=t$X.unpack(r,l,I),D+=t$X.distance(P,I),l+=3;l=3;var R=0,L=0,B=0,N=0,F=!1,z=t$X.unpack(i,0,br$2),k=t$X.unpack(r,0,Ka$1),V=t$X.unpack(n,0,Mr$2);e&&(Tr$2(V,t$X.unpack(i,i.length-6,Fr$1),z,k)&&(V=t$X.negate(V,V)));var U=0,X=0,H=0;for(s=0;s<p;s++){var G,W,Y,q,j=t$X.clone(z,Fr$1),Z=t$X.clone(k,Pr$3),K=t$X.clone(V,Cn$1);if(F&&(K=t$X.negate(K,K)),z=t$X.unpack(i,l,br$2),k=t$X.unpack(r,l,Ka$1),F=Tr$2(V=t$X.unpack(n,l,Mr$2),j,z,k),E.latitude=o[R],E.longitude=o[R+1],A.latitude=o[R+2],A.longitude=o[R+3],a){var Q=On$4(E,A);G=t.project(E,Rn$3);var J=H$N(W=t.project(A,Nn$3),G,zr$4);J.y=Math.abs(J.y),Y=Qa$2,q=$a$1,0===Q||t$X.dot(J,t$X.UNIT_Y)>ur$4?(Y=da$1(t,E,K,G,Qa$2),q=da$1(t,A,V,W,$a$1)):1===Q?(q=da$1(t,A,V,W,$a$1),Y.x=0,Y.y=e$27.sign(E.longitude-Math.abs(A.longitude)),Y.z=0):(Y=da$1(t,E,K,G,Qa$2),q.x=0,q.y=e$27.sign(E.longitude-A.longitude),q.z=0)}var ee=t$X.distance(Z,k),te=i$Q.fromCartesian(j,zn$2),ie=t$X.subtract(z,j,Pn$2),re=t$X.normalize(ie,xr$3),ne=t$X.subtract(Z,j,Fn$2);ne=t$X.normalize(ne,ne);var oe=t$X.cross(re,ne,xr$3);oe=t$X.normalize(oe,oe);var ae=t$X.cross(ne,K,Mn$3);ae=t$X.normalize(ae,ae);var se=t$X.subtract(k,z,bn$3);se=t$X.normalize(se,se);var le=t$X.cross(V,se,xn$3);le=t$X.normalize(le,le);var ue,ce,he,de=ee/D,fe=U/D,pe=0,_e=0,me=0;if(a){pe=t$X.distance(G,W),ue=i$Q.fromCartesian(G,qn$1),ce=t$X.subtract(W,G,zr$4);var $e=(he=t$X.normalize(ce,yn)).x;he.x=he.y,he.y=-$e,_e=pe/S,me=X/S}for(O=0;O<8;O++){var ge=N+4*O,ve=L+2*O,ye=ge+3,xe=O<4?1:-1,be=2===O||3===O||6===O||7===O?1:-1;t$X.pack(te.high,y,ge),y[ye]=ie.x,t$X.pack(te.low,x,ge),x[ye]=ie.y,t$X.pack(ae,b,ge),b[ye]=ie.z,t$X.pack(le,w,ge),w[ye]=de*xe,t$X.pack(oe,C,ge);var we=fe*be;0===we&&be<0&&(we=Number.POSITIVE_INFINITY),C[ye]=we,a&&(u[ge]=ue.high.x,u[ge+1]=ue.high.y,u[ge+2]=ue.low.x,u[ge+3]=ue.low.y,h[ge]=-Y.y,h[ge+1]=Y.x,h[ge+2]=q.y,h[ge+3]=-q.x,c[ge]=ce.x,c[ge+1]=ce.y,c[ge+2]=he.x,c[ge+3]=he.y,d[ve]=_e*xe,0===(we=me*be)&&be<0&&(we=Number.POSITIVE_INFINITY),d[ve+1]=we)}var Ce=kn$3,Te=An$3,Se=Ln$4,Ee=_n$3,Ae=h$10.fromCartographicArray(In$2,Tn$4),Pe=e$1_.getMinimumMaximumHeights(Ae,f),Ie=Pe.minimumTerrainHeight,Me=Pe.maximumTerrainHeight;H+=Ie,H+=Me,Ar$3(j,Z,Ie,Me,Ce,Se),Ar$3(z,k,Ie,Me,Te,Ee);var Oe=t$X.multiplyByScalar(oe,e$27.EPSILON5,qr$1);t$X.add(Ce,Oe,Ce),t$X.add(Te,Oe,Te),t$X.add(Se,Oe,Se),t$X.add(Ee,Oe,Ee),Na$3(Ce,Te),Na$3(Se,Ee),t$X.pack(Ce,v,B),t$X.pack(Te,v,B+3),t$X.pack(Ee,v,B+6),t$X.pack(Se,v,B+9),Oe=t$X.multiplyByScalar(oe,-2*e$27.EPSILON5,qr$1),t$X.add(Ce,Oe,Ce),t$X.add(Te,Oe,Te),t$X.add(Se,Oe,Se),t$X.add(Ee,Oe,Ee),Na$3(Ce,Te),Na$3(Se,Ee),t$X.pack(Ce,v,B+12),t$X.pack(Te,v,B+15),t$X.pack(Ee,v,B+18),t$X.pack(Se,v,B+21),R+=2,l+=3,L+=16,B+=24,N+=32,U+=ee,X+=pe}l=0;var De=0;for(s=0;s<p;s++){for(O=0;O<Vr$2;O++)g[l+O]=yr$3[O]+De;De+=8,l+=Vr$2}var Re=Vn$2;i$19.fromVertices(i,t$X.ZERO,3,Re[0]),i$19.fromVertices(r,t$X.ZERO,3,Re[1]);var Le=i$19.fromBoundingSpheres(Re);Le.radius+=H/(2*p);var Be={position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,normalize:!1,values:v}),startHiAndForwardOffsetX:ra$1(y),startLoAndForwardOffsetY:ra$1(x),startNormalAndForwardOffsetZ:ra$1(b),endNormalAndTextureCoordinateNormalizationX:ra$1(w),rightNormalAndTextureCoordinateNormalizationY:ra$1(C)};return a&&(Be.startHiLo2D=ra$1(u),Be.offsetAndRight2D=ra$1(c),Be.startEndNormals2D=ra$1(h),Be.texcoordNormalization2D=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,normalize:!1,values:d})),new I$1n({attributes:Be,indices:g,boundingSphere:Le})}function ra$1(e){return new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}function a$S(e,t,i){this.heading=u$Y(e,0),this.pitch=u$Y(t,0),this.range=u$Y(i,0)}aa$1._projectNormal=da$1,a$S.clone=function(e,t){if(e$28(e))return e$28(t)||(t=new a$S),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var K$J=e$27.factorial;function k$U(e,t,i,r,n,o){var a,s,l,u=0;if(r>0){for(s=0;s<n;s++){for(a=!1,l=0;l<o.length&&!a;l++)s===o[l]&&(a=!0);a||(o.push(s),u+=k$U(e,t,i,r-1,n,o),o.splice(o.length-1,1))}return u}for(u=1,s=0;s<n;s++){for(a=!1,l=0;l<o.length&&!a;l++)s===o[l]&&(a=!0);a||(u*=e-i[t[s]])}return u}var E$V={type:"Hermite",getRequiredDataPoints:function(e,t){if(t=u$Y(t,0),!e$28(e))throw new t$Z("degree is required.");if(e<0)throw new t$Z("degree must be 0 or greater.");if(t<0)throw new t$Z("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)},interpolateOrderZero:function(e,t,i,r,n){e$28(n)||(n=new Array(r));var o,a,s,l,u,c=t.length,h=new Array(r);for(o=0;o<r;o++){n[o]=0;var d=new Array(c);for(h[o]=d,a=0;a<c;a++)d[a]=[]}var f=c,p=new Array(f);for(o=0;o<f;o++)p[o]=o;var _=c-1;for(l=0;l<r;l++){for(a=0;a<f;a++)u=p[a]*r+l,h[l][0].push(i[u]);for(o=1;o<f;o++){var m=!1;for(a=0;a<f-o;a++){var $,g=t[p[a]],v=t[p[a+o]];v-g<=0?($=i[u=p[a]*r+r*o+l],h[l][o].push($/K$J(o))):($=h[l][o-1][a+1]-h[l][o-1][a],h[l][o].push($/(v-g))),m=m||0!==$}m||(_=o-1)}}for(s=0,0;s<=0;s++)for(o=s;o<=_;o++){var y=k$U(e,p,t,s,o,[]);for(l=0;l<r;l++){var x=h[l][o][0];n[l+s*r]+=x*y}}return n}},Q$R=[];function U$S(e,t,i,r,n,o){for(var a,s,l=-1,u=t.length,c=u*(u+1)/2,h=0;h<n;h++){var d=Math.floor(h*c);for(a=0;a<u;a++)s=t[a]*n*(o+1)+h,e[d+a]=r[s];for(var f=1;f<u;f++){var p=0,_=Math.floor(f*(1-f)/2)+u*f,m=!1;for(a=0;a<u-f;a++){var $,g,v=i[t[a]],y=i[t[a+f]];if(y-v<=0)g=($=r[s=t[a]*n*(o+1)+n*f+h])/e$27.factorial(f),e[d+_+p]=g,p++;else{var x=Math.floor((f-1)*(2-f)/2)+u*(f-1);g=($=e[d+x+a+1]-e[d+x+a])/(y-v),e[d+_+p]=g,p++}m=m||0!==$}m&&(l=Math.max(l,f))}}return l}E$V.interpolate=function(e,t,i,r,n,o,a){var s=r*(o+1);e$28(a)||(a=new Array(s));for(var l=0;l<s;l++)a[l]=0;var u,c=t.length,h=new Array(c*(n+1));for(u=0;u<c;u++)for(var d=0;d<n+1;d++)h[u*(n+1)+d]=u;for(var f=h.length,p=Q$R,_=U$S(p,h,t,i,r,n),m=[],$=f*(f+1)/2,g=Math.min(_,o),v=0;v<=g;v++)for(u=v;u<=_;u++){m.length=0;for(var y=k$U(e,h,t,v,u,m),x=Math.floor(u*(1-u)/2)+f*u,b=0;b<r;b++){var w=p[Math.floor(b*$)+x];a[b+v*r]+=w*y}}return a};var e$1s={DisplayMode:{NONE:0,FACE:1,LINE:2,FACE_AND_LINE:3},AnalysisRegionMode:{ARM_NONE:0,ARM_ALL:1,ARM_REGION:2},FilterMode:{LINEAR:0,NEAREST:1}},k$T=Object.freeze(e$1s);function u$K(){this._maxVisibleValue=17976931348623157e292,this._minVisibleValue=-17976931348623157e292,this._floor=0,this._ceiling=0,this._opacity=1,this._updateColorDictTable=!1,this._coverageArea=[],this._linesInterval=100,this._updatePolygon=!0,this._lineColor=new e$1S(0,1,1,1),this._displayMode=k$T.DisplayMode.FACE,this._dictColorTable=void 0,this._emissionTextureUrl="",this._emissionTextureChanged=!1,this._emissionTexCoordSpeed=new t$X(0,0),this._emissionTexCoordScale=new t$X(50,50),this._emissionTextureArray=[],this._loadedEmissionTexture=0,this._noValueColor=new e$1S(1,1,1,1),this._textureFilterMode=k$T.FilterMode.LINEAR,this._visibleDistanceMax=Number.MAX_VALUE,this._visibleDistanceMin=0,this._minVisibleAltitude=0,this._maxVisibleAltitude=Number.MAX_VALUE}u$K.prototype.destroy=function(){this._coverageArea.length=0,e$28(this._dictColorTable)&&this._dictColorTable.destroy()},Object.defineProperties(u$K.prototype,{MinVisibleValue:{get:function(){return this._minVisibleValue},set:function(e){this._minVisibleValue=e}},MaxVisibleValue:{get:function(){return this._maxVisibleValue},set:function(e){this._maxVisibleValue=e}},ColorTableMaxKey:{get:function(){return this._ceiling},set:function(e){this._ceiling=e}},ColorTableMinKey:{get:function(){return this._floor},set:function(e){this._floor=e}},ColorTable:{get:function(){return this._dictColorTable},set:function(e){if(e$28(e)){this._dictColorTable=i$O.clone(e,this._dictColorTable),this._updateColorDictTable=!0;var t=this._dictColorTable.count();if(!(t<1)){new e$1S;var i=0,r=0,n=this._dictColorTable.getItem(0);e$28(n)&&e$28(n.altitude)&&(i=parseFloat(n.altitude)),e$28(n=this._dictColorTable.getItem(t-1))&&e$28(n.altitude)&&(r=parseFloat(n.altitude)),this._ceiling=Math.max(i,r),this._floor=Math.min(i,r)}}else e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null)}},Opacity:{get:function(){return this._opacity},set:function(e){this._opacity=e}},CoverageArea:{get:function(){return this._coverageArea},set:function(e){if(this._updatePolygon=!0,this._coverageArea.length=0,e$28(e))for(var t=0;t<e.length;t++)this._coverageArea[t]=e[t]}},DisplayMode:{get:function(){return this._displayMode},set:function(e){this._displayMode=e}},LineColor:{get:function(){return this._lineColor},set:function(e){e$1S.clone(e,this._lineColor)}},LineInterval:{get:function(){return this._linesInterval},set:function(e){this._linesInterval=e}},UpdateColorDictTable:{get:function(){return this._updateColorDictTable},set:function(e){this._updateColorDictTable=e}},UpdatePolygonRegion:{get:function(){return this._updatePolygon},set:function(e){this._updatePolygon=e}},emissionTextureUrl:{get:function(){return this._emissionTextureUrl},set:function(e){this._emissionTextureUrl=e,this._emissionTextureArray=[];var t={url:e,USpeed:this._emissionTexCoordSpeed.x,VSpeed:this._emissionTexCoordSpeed.y,UTiling:this._emissionTexCoordScale.x,VTiling:this._emissionTexCoordScale.y};this._emissionTextureArray.push(t),this._emissionTextureChanged=!0,this._loadedEmissionTexture=0}},emissionTexCoordUSpeed:{get:function(){return this._emissionTexCoordSpeed.x},set:function(e){e$28(this._emissionTextureArray)&&this._emissionTextureArray.length>0&&(this._emissionTextureArray[0].USpeed=e),this._emissionTexCoordSpeed.x=e}},emissionTexCoordVSpeed:{get:function(){return this._emissionTexCoordSpeed.y},set:function(e){e$28(this._emissionTextureArray)&&this._emissionTextureArray.length>0&&(this._emissionTextureArray[0].VSpeed=e),this._emissionTexCoordSpeed.y=e}},emissionTexCoordScale:{get:function(){return this._emissionTexCoordScale},set:function(e){e$28(this._emissionTextureArray)&&this._emissionTextureArray.length>0&&(this._emissionTextureArray[0].UTiling=e.x,this._emissionTextureArray[0].VTiling=e.y),this._emissionTexCoordScale=e}},emissionTextureArray:{get:function(){return this._emissionTextureArray},set:function(e){this._emissionTextureArray=e,this._emissionTextureChanged=!0,this._loadedEmissionTexture=0}},noValueColor:{get:function(){return this._noValueColor},set:function(e){!e$28(e)||(this._noValueColor=e$1S.clone(e,this._noValueColor))}},filterMode:{get:function(){return this._textureFilterMode},set:function(e){this._textureFilterMode=e}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(e){this._visibleDistanceMax=e}},visibleDistanceMin:{get:function(){return this._visibleDistanceMin},set:function(e){this._visibleDistanceMin=e}},minVisibleAltitude:{get:function(){return this._minVisibleAltitude},set:function(e){this._minVisibleAltitude=e}},maxVisibleAltitude:{get:function(){return this._maxVisibleAltitude},set:function(e){this._maxVisibleAltitude=e}}}),u$K.clone=function(e,t){if(e$28(e)){e$28(t)||(t=new u$K),t._maxVisibleValue=e._maxVisibleValue,t._minVisibleValue=e._minVisibleValue,t._floor=e._floor,t._ceiling=e._ceiling,t._opacity=e._opacity,t._updateColorDictTable=e._updateColorDictTable,t._linesInterval=e._linesInterval,t._updatePolygon=e._updatePolygon,t._displayMode=e._displayMode,t._lineColor=e$1S.clone(e._lineColor,t._lineColor),t._dictColorTable=i$O.clone(e._dictColorTable,t._dictColorTable),t._emissionTexCoordSpeed=t$X.clone(e._emissionTexCoordSpeed,t._emissionTexCoordSpeed),t._emissionTexCoordScale=t$X.clone(e._emissionTexCoordScale,t._emissionTexCoordScale),t._emissionTextureUrl=e._emissionTextureUrl,t._emissionTextureArray=e._emissionTextureArray,t._loadedEmissionTexture=e._loadedEmissionTexture,t._noValueColor=e$1S.clone(e._noValueColor,t._noValueColor),t._coverageArea.length=0;for(var i=0;i<e._coverageArea.length;i++)t._coverageArea[i]=e._coverageArea[i];return t._textureFilterMode=e._textureFilterMode,t._visibleDistanceMax=e._visibleDistanceMax,t._visibleDistanceMin=e._visibleDistanceMin,t._maxVisibleAltitude=e._maxVisibleAltitude,t._minVisibleAltitude=e._minVisibleAltitude,t}};var r$X=[];u$K.prototype._getEmissionAtlasTextureRects=function(){var e=this._emissionTextureAtlas;if(!e$28(e))return r$X;var t,i=this._emissionTextureArray.length;if(r$X.length!=i)for(r$X=[],t=0;t<i;t++)r$X.push(new e$25);for(t=0;t<i;t++){var r=this._emissionTextureArray[t],n=e.textureCoordinates[r.textureAtlasID];e$28(n)&&(r$X[t].x=n.x,r$X[t].y=n.y,r$X[t].z=n.x+n.width,r$X[t].w=n.y+n.height)}return r$X};var l$W=[];function o$12(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}u$K.prototype._getEmissionTexAtlasTilingAndOffset=function(){if(!e$28(this._emissionTextureArray))return l$W;var e,t=this._emissionTextureArray.length;if(l$W.length!=t)for(l$W=[],e=0;e<t;e++)l$W.push(new e$25);var i=performance.now()/1e3;for(e=0;e<t;e++){var r=this._emissionTextureArray[e];l$W[e].x=r.UTiling,l$W[e].y=r.VTiling,l$W[e].z=r.USpeed*i,l$W[e].w=r.VSpeed*i}return l$W};var y$N={},_0=32.184,h0$1=2451545,L$10=-.0529921,b$W=-.1059842,j$S=13.0120009,k$S=13.3407154,q$V=.9856003,z$I=26.4057084,B$F=13.064993,F$W=.3287146,H$M=1.7484877,K$I=-.1589763,Q$Q=.0036096,V$I=.1643573,W$L=12.9590088,s$K=new a$12;function h$N(e){(!e$28(e)||"function"!=typeof e)&&(e=y$N.ComputeMoon),this._computeFunction=e}y$N.ComputeMoon=function(e,t){e$28(e)||(e=a$12.now()),s$K=a$12.addSeconds(e,_0,s$K);var i=a$12.totalDays(s$K)-h0$1,r=i/h$Z.DAYS_PER_JULIAN_CENTURY,n=(125.045+L$10*i)*e$27.RADIANS_PER_DEGREE,o=(250.089+b$W*i)*e$27.RADIANS_PER_DEGREE,a=(260.008+j$S*i)*e$27.RADIANS_PER_DEGREE,s=(176.625+k$S*i)*e$27.RADIANS_PER_DEGREE,l=(357.529+q$V*i)*e$27.RADIANS_PER_DEGREE,u=(311.589+z$I*i)*e$27.RADIANS_PER_DEGREE,c=(134.963+B$F*i)*e$27.RADIANS_PER_DEGREE,h=(276.617+F$W*i)*e$27.RADIANS_PER_DEGREE,d=(34.226+H$M*i)*e$27.RADIANS_PER_DEGREE,f=(15.134+K$I*i)*e$27.RADIANS_PER_DEGREE,p=(119.743+Q$Q*i)*e$27.RADIANS_PER_DEGREE,_=(239.961+V$I*i)*e$27.RADIANS_PER_DEGREE,m=(25.053+W$L*i)*e$27.RADIANS_PER_DEGREE,$=Math.sin(n),g=Math.sin(o),v=Math.sin(a),y=Math.sin(s),x=Math.sin(l),b=Math.sin(u),w=Math.sin(c),C=Math.sin(h),T=Math.sin(d),S=Math.sin(f),E=Math.sin(p),A=Math.sin(_),P=Math.sin(m),I=Math.cos(n),M=Math.cos(o),O=Math.cos(a),D=Math.cos(s),R=Math.cos(l),L=Math.cos(u),B=Math.cos(c),N=Math.cos(h),F=Math.cos(d),z=Math.cos(f),k=Math.cos(p),V=Math.cos(_),U=Math.cos(m),X=(269.9949+.0031*r-3.8787*$-.1204*g+.07*v-.0172*y+.0072*b-.0052*S+.0043*P)*e$27.RADIANS_PER_DEGREE,H=(66.5392+.013*r+1.5419*I+.0239*M-.0278*O+.0068*D-.0029*L+9e-4*B+8e-4*z-9e-4*U)*e$27.RADIANS_PER_DEGREE,G=(38.3213+13.17635815*i-14e-13*i*i+3.561*$+.1208*g-.0642*v+.0158*y+.0252*x-.0066*b-.0047*w-.0046*C+.0028*T+.0052*S+.004*E+.0019*A-.0044*P)*e$27.RADIANS_PER_DEGREE,W=(13.17635815-2*i*14e-13+3.561*I*L$10+.1208*M*b$W-.0642*O*j$S+.0158*D*k$S+.0252*R*q$V-.0066*L*z$I-.0047*B*B$F-.0046*N*F$W+.0028*F*H$M+.0052*z*K$I+.004*k*Q$Q+.0019*V*V$I-.0044*U*W$L)/86400*e$27.RADIANS_PER_DEGREE;return e$28(t)||(t=new o$12),t.rightAscension=X,t.declination=H,t.rotation=G,t.rotationRate=W,t};var y$M=new t$X,A$Z=new t$X,w$C=new t$X;function z$H(e,t,i){var r=y$M;r.x=Math.cos(e+e$27.PI_OVER_TWO),r.y=Math.sin(e+e$27.PI_OVER_TWO),r.z=0;var n=Math.cos(t),o=w$C;o.x=n*Math.cos(e),o.y=n*Math.sin(e),o.z=Math.sin(t);var a=t$X.cross(o,r,A$Z);return e$28(i)||(i=new p$1a),i[0]=r.x,i[1]=a.x,i[2]=o.x,i[3]=r.y,i[4]=a.y,i[5]=o.y,i[6]=r.z,i[7]=a.z,i[8]=o.z,i}var u$J=new p$1a,_$L=new n$14;h$N.prototype.evaluate=function(e,t){e$28(e)||(e=a$12.now());var i=this._computeFunction(e),r=z$H(i.rightAscension,i.declination,t),n=e$27.zeroToTwoPi(i.rotation),o=n$14.fromAxisAngle(t$X.UNIT_Z,n,_$L),a=p$1a.fromQuaternion(n$14.conjugate(o,o),u$J);return p$1a.multiply(a,r,r)};var r$W={};function i$N(e){o$1u.defined("url",e),this._url=t$S.createIfNeeded(e),this._url.appendForwardSlash()}function s$J(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.typeOf.object("options.scene",e.scene);var t=u$Y(e.accessToken,e$1w.defaultAccessToken),i=t$S.createIfNeeded(u$Y(e.server,e$1w.defaultServer));i.appendForwardSlash();var r=e$1w.getDefaultTokenCredit(t);e$28(r)&&e.scene.frameState.creditDisplay.addDefaultCredit(r$1a.clone(r));var n=i.getDerivedResource({url:"v1/geocode"});e$28(t)&&n.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=i,this._pelias=new i$N(n)}function d$_(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.start=e$28(e.start)?a$12.clone(e.start):new a$12,this.stop=e$28(e.stop)?a$12.clone(e.stop):new a$12,this.data=e.data,this.isStartIncluded=u$Y(e.isStartIncluded,!0),this.isStopIncluded=u$Y(e.isStopIncluded,!0)}r$W.type=void 0,r$W.getRequiredDataPoints=t$Z.throwInstantiationError,r$W.interpolateOrderZero=t$Z.throwInstantiationError,r$W.interpolate=t$Z.throwInstantiationError,Object.defineProperties(i$N.prototype,{url:{get:function(){return this._url}}}),i$N.prototype.geocode=function(e,t){return o$1u.typeOf.string("query",e),this._url.getDerivedResource({url:t===c$V.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then((function(e){return e.features.map((function(e){var t,i=e.bbox;if(e$28(i))t=h$10.fromDegrees(i[0],i[1],i[2],i[3]);else{var r=e.geometry.coordinates[0],n=e.geometry.coordinates[1];t=t$X.fromDegrees(r,n)}return{displayName:e.properties.label,destination:t}}))}))},s$J.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)},Object.defineProperties(d$_.prototype,{isEmpty:{get:function(){var e=a$12.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var I$14={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};d$_.fromIso8601=function(e,t){o$1u.typeOf.object("options",e),o$1u.typeOf.string("options.iso8601",e.iso8601);var i=e.iso8601.split("/");if(2!==i.length)throw new t$Z("options.iso8601 is an invalid ISO 8601 interval.");var r=a$12.fromIso8601(i[0]),n=a$12.fromIso8601(i[1]),o=u$Y(e.isStartIncluded,!0),a=u$Y(e.isStopIncluded,!0),s=e.data;return e$28(t)?(t.start=r,t.stop=n,t.isStartIncluded=o,t.isStopIncluded=a,t.data=s,t):(I$14.start=r,I$14.stop=n,I$14.isStartIncluded=o,I$14.isStopIncluded=a,I$14.data=s,new d$_(I$14))},d$_.toIso8601=function(e,t){return o$1u.typeOf.object("timeInterval",e),a$12.toIso8601(e.start,t)+"/"+a$12.toIso8601(e.stop,t)},d$_.clone=function(e,t){if(e$28(e))return e$28(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new d$_(e)},d$_.equals=function(e,t,i){return e===t||e$28(e)&&e$28(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&a$12.equals(e.start,t.start)&&a$12.equals(e.stop,t.stop)&&(e.data===t.data||e$28(i)&&i(e.data,t.data)))},d$_.equalsEpsilon=function(e,t,i,r){return o$1u.typeOf.number("epsilon",i),e===t||e$28(e)&&e$28(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&a$12.equalsEpsilon(e.start,t.start,i)&&a$12.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||e$28(r)&&r(e.data,t.data)))},d$_.intersect=function(e,t,i,r){if(o$1u.typeOf.object("left",e),o$1u.typeOf.object("result",i),!e$28(t))return d$_.clone(d$_.EMPTY,i);var n=e.start,o=e.stop,a=t.start,s=t.stop,l=a$12.greaterThanOrEquals(a,n)&&a$12.greaterThanOrEquals(o,a),u=!l&&a$12.lessThanOrEquals(a,n)&&a$12.lessThanOrEquals(n,s);if(!l&&!u)return d$_.clone(d$_.EMPTY,i);var c=e.isStartIncluded,h=e.isStopIncluded,d=t.isStartIncluded,f=t.isStopIncluded,p=a$12.lessThan(o,s);return i.start=l?a:n,i.isStartIncluded=c&&d||!a$12.equals(a,n)&&(l&&d||u&&c),i.stop=p?o:s,i.isStopIncluded=p?h:h&&f||!a$12.equals(s,o)&&f,i.data=e$28(r)?r(e.data,t.data):e.data,i},d$_.contains=function(e,t){if(o$1u.typeOf.object("timeInterval",e),o$1u.typeOf.object("julianDate",t),e.isEmpty)return!1;var i=a$12.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=a$12.compare(t,e.stop);return 0===r?e.isStopIncluded:i<0&&r<0},d$_.prototype.clone=function(e){return d$_.clone(this,e)},d$_.prototype.equals=function(e,t){return d$_.equals(this,e,t)},d$_.prototype.equalsEpsilon=function(e,t,i){return d$_.equalsEpsilon(this,e,t,i)},d$_.prototype.toString=function(){return d$_.toIso8601(this)},d$_.EMPTY=Object.freeze(new d$_({start:new a$12,stop:new a$12,isStartIncluded:!1,isStopIncluded:!1}));var M$R=Object.freeze(a$12.fromIso8601("0000-01-01T00:00:00Z")),r$V=Object.freeze(a$12.fromIso8601("9999-12-31T24:00:00Z")),t$F=Object.freeze(new d$_({start:M$R,stop:r$V})),o$11={MINIMUM_VALUE:M$R,MAXIMUM_VALUE:r$V,MAXIMUM_INTERVAL:t$F},e$1r={SHIFT:0,CTRL:1,ALT:2},Na$2=Object.freeze(e$1r);function o$10(){}function P$P(){var e=o$10._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then((function(){return o$10._transcodeTaskProcessor}));o$10._readyPromise=e}o$10._transcodeTaskProcessor=new i$W("transcodeKTX2",Number.POSITIVE_INFINITY),o$10._readyPromise=void 0,o$10.transcode=function(e,t,i){return o$1u.defined("supportedTargetFormats",t),e$28(o$10._readyPromise)||P$P(),o$10._readyPromise.then((function(r){var n;if(e instanceof ArrayBuffer){var o=new Uint8Array(e);return n={supportedTargetFormats:t,ktx2Buffer:o,testId:i},r.scheduleTask(n,[e])}return n={supportedTargetFormats:t,ktx2Buffer:e},r.scheduleTask(n)})).then((function(e){var t,i=e.length,r=Object.keys(e[0]),n=r.length;for(t=0;t<i;t++)for(var o=e[t],a=0;a<n;a++){var s=o[r[a]];o[r[a]]=new e$1y(s.internalFormat,s.width,s.height,s.levelBuffer,s.datatype)}if(1===n){for(t=0;t<i;++t)e[t]=e[t][r[0]];1===i&&(e=e[0])}return e})).otherwise((function(e){throw e}))};var i$M={type:"Lagrange",getRequiredDataPoints:function(e){return Math.max(e+1,2)},interpolateOrderZero:function(e,t,i,r,n){e$28(n)||(n=new Array(r));var o,a,s=t.length;for(o=0;o<r;o++)n[o]=0;for(o=0;o<s;o++){var l=1;for(a=0;a<s;a++)if(a!==o){var u=t[o]-t[a];l*=(e-t[a])/u}for(a=0;a<r;a++)n[a]+=l*i[o*r+a]}return n}},v$F={type:"Linear"};function o$$(e,t,i){return p$Z({url:e,responseType:"arraybuffer",headers:t,request:i})}function l$V(e,t,i){return p$Z({url:e,responseType:"blob",headers:t,request:i})}v$F.getRequiredDataPoints=function(e){return 2},v$F.interpolateOrderZero=function(e,t,i,r,n){if(2!==t.length)throw new t$Z("The xTable provided to the linear interpolator must have exactly two elements.");if(r<=0)throw new t$Z("There must be at least 1 dependent variable for each independent variable.");e$28(n)||(n=new Array(r));var o,a,s,l=t[0],u=t[1];if(l===u)throw new t$Z("Divide by zero error: xTable[0] and xTable[1] are equal");for(o=0;o<r;o++)a=i[o],s=i[o+r],n[o]=((s-a)*e+u*a-l*s)/(u-l);return n};var t$E,p$T=!1,I$13=new i$W("transcodeCRNToDXTprevious",Number.POSITIVE_INFINITY);function a$R(e,t,i){if(i){if(!e$28(e))throw new t$Z("resourceOrUrlOrBuffer is required.");if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=o$1q.resolve(e);else r=t$S.createIfNeeded(e).fetchArrayBuffer();return e$28(r)?r.then((function(e){if(e$28(e)){var t=[];return e instanceof ArrayBuffer?t.push(e):(0===e.byteOffset&&e.byteLength===e.buffer.byteLength||(e=e.slice(0,e.length)),t.push(e.buffer)),I$13.scheduleTask(e,t)}})).then((function(e){return e$1y.clone(e)})):void 0}if(e$28(t$E)||(t$E=new i$W("transcodeCRNToDXT",Number.POSITIVE_INFINITY)).initWebAssemblyModule({modulePath:"ThirdParty/crunch.js",wasmBinaryFile:"ThirdParty/crunch.wasm"}).then((function(){p$T=!0})),p$T){if(!e$28(e))throw new t$Z("resourceOrUrlOrBuffer is required.");var r;return e$28(r=e instanceof ArrayBuffer||ArrayBuffer.isView(e)?o$1q.resolve(e):t$S.createIfNeeded(e).fetchArrayBuffer())?r.then((function(e){if(e$28(e)){var i=[];e instanceof ArrayBuffer?i.push(e):(0===e.byteOffset&&e.byteLength===e.buffer.byteLength||(e=e.slice(0,e.length)),i.push(e.buffer));var r=u$Y(t,!1);return t$E.scheduleTask({data:e,bMipMap:r},i)}})).then((function(e){return e$1y.clone(e)})):void 0}}function h$M(e,t,i){if(!e$28(t))throw new t$Z("resourceOrUrlOrBuffer is required.");var r;t instanceof ArrayBuffer||ArrayBuffer.isView(t)?r=o$1q.resolve(t):r=t$S.createIfNeeded(t).fetchArrayBuffer();if(e$28(r))return r.then((function(t){if(e$28(t)){var r=[];t instanceof ArrayBuffer?r.push(t):(0===t.byteOffset&&t.byteLength===t.buffer.byteLength||(t=t.slice(0,t.length)),r.push(t.buffer));var n=u$Y(i,!1);return e.scheduleTask({data:t,bMipMap:n},r)}})).then((function(e){return e$1y.clone(e)}))}var tmp={};tmp=function e(t,i,r){function n(a,s){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=i[a]={exports:{}};t[a][0].call(c.exports,(function(e){var i=t[a][1][e];return n(i||e)}),c,c.exports,e,t,i,r)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(e,t,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,i,r,n){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+r),n);else for(var o=0;o<r;o++)e[n+o]=t[i+o]},flattenChunks:function(e){var t,i,r,n,o,a;for(r=0,t=0,i=e.length;t<i;t++)r+=e[t].length;for(a=new Uint8Array(r),n=0,t=0,i=e.length;t<i;t++)o=e[t],a.set(o,n),n+=o.length;return a}},o={arraySet:function(e,t,i,r,n){for(var o=0;o<r;o++)e[n+o]=t[i+o]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,o))},i.setTyped(r)},{}],2:[function(e,t,i){var r=e("./common"),n=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var i="",a=0;a<t;a++)i+=String.fromCharCode(e[a]);return i}a[254]=a[254]=1,i.string2buf=function(e){var t,i,n,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(n-56320),o++),l+=i<128?1:i<2048?2:i<65536?3:4;for(t=new r.Buf8(l),a=0,o=0;a<l;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(n-56320),o++),i<128?t[a++]=i:i<2048?(t[a++]=192|i>>>6,t[a++]=128|63&i):i<65536?(t[a++]=224|i>>>12,t[a++]=128|i>>>6&63,t[a++]=128|63&i):(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63,t[a++]=128|i>>>6&63,t[a++]=128|63&i);return t},i.buf2binstring=function(e){return l(e,e.length)},i.binstring2buf=function(e){for(var t=new r.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,r,n,o,s=t||e.length,u=new Array(2*s);for(r=0,i=0;i<s;)if((n=e[i++])<128)u[r++]=n;else if((o=a[n])>4)u[r++]=65533,i+=o-1;else{for(n&=2===o?31:3===o?15:7;o>1&&i<s;)n=n<<6|63&e[i++],o--;o>1?u[r++]=65533:n<65536?u[r++]=n:(n-=65536,u[r++]=55296|n>>10&1023,u[r++]=56320|1023&n)}return l(u,r)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+a[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){function r(e,t,i,r){for(var n=65535&e|0,o=e>>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{o=o+(n=n+t[r++]|0)|0}while(--a);n%=65521,o%=65521}return n|o<<16|0}t.exports=r},{}],4:[function(e,t,i){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){function r(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}var n=r();function o(e,t,i,r){var o=n,a=r+i;e^=-1;for(var s=r;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}t.exports=o},{}],6:[function(e,t,i){function r(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=r},{}],7:[function(e,t,i){var r=30,n=12;t.exports=function(e,t){var i,o,a,s,l,u,c,h,d,f,p,_,m,$,g,v,y,x,b,w,C,T,S,E,A;i=e.state,o=e.next_in,E=e.input,a=o+(e.avail_in-5),s=e.next_out,A=e.output,l=s-(t-e.avail_out),u=s+(e.avail_out-257),c=i.dmax,h=i.wsize,d=i.whave,f=i.wnext,p=i.window,_=i.hold,m=i.bits,$=i.lencode,g=i.distcode,v=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;e:do{m<15&&(_+=E[o++]<<m,m+=8,_+=E[o++]<<m,m+=8),x=$[_&v];t:for(;;){if(_>>>=b=x>>>24,m-=b,0==(b=x>>>16&255))A[s++]=65535&x;else{if(!(16&b)){if(0==(64&b)){x=$[(65535&x)+(_&(1<<b)-1)];continue t}if(32&b){i.mode=n;break e}e.msg="invalid literal/length code",i.mode=r;break e}w=65535&x,(b&=15)&&(m<b&&(_+=E[o++]<<m,m+=8),w+=_&(1<<b)-1,_>>>=b,m-=b),m<15&&(_+=E[o++]<<m,m+=8,_+=E[o++]<<m,m+=8),x=g[_&y];i:for(;;){if(_>>>=b=x>>>24,m-=b,!(16&(b=x>>>16&255))){if(0==(64&b)){x=g[(65535&x)+(_&(1<<b)-1)];continue i}e.msg="invalid distance code",i.mode=r;break e}if(C=65535&x,m<(b&=15)&&(_+=E[o++]<<m,(m+=8)<b&&(_+=E[o++]<<m,m+=8)),(C+=_&(1<<b)-1)>c){e.msg="invalid distance too far back",i.mode=r;break e}if(_>>>=b,m-=b,C>(b=s-l)){if((b=C-b)>d&&i.sane){e.msg="invalid distance too far back",i.mode=r;break e}if(T=0,S=p,0===f){if(T+=h-b,b<w){w-=b;do{A[s++]=p[T++]}while(--b);T=s-C,S=A}}else if(f<b){if(T+=h+f-b,(b-=f)<w){w-=b;do{A[s++]=p[T++]}while(--b);if(T=0,f<w){w-=b=f;do{A[s++]=p[T++]}while(--b);T=s-C,S=A}}}else if(T+=f-b,b<w){w-=b;do{A[s++]=p[T++]}while(--b);T=s-C,S=A}for(;w>2;)A[s++]=S[T++],A[s++]=S[T++],A[s++]=S[T++],w-=3;w&&(A[s++]=S[T++],w>1&&(A[s++]=S[T++]))}else{T=s-C;do{A[s++]=A[T++],A[s++]=A[T++],A[s++]=A[T++],w-=3}while(w>2);w&&(A[s++]=A[T++],w>1&&(A[s++]=A[T++]))}break}}break}}while(o<a&&s<u);o-=w=m>>3,_&=(1<<(m-=w<<3))-1,e.next_in=o,e.next_out=s,e.avail_in=o<a?a-o+5:5-(o-a),e.avail_out=s<u?u-s+257:257-(s-u),i.hold=_,i.bits=m}},{}],8:[function(e,t,i){var r=e("../utils/common"),n=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),l=0,u=1,c=2,h=4,d=5,f=6,p=0,_=1,m=2,$=-2,g=-3,v=-4,y=-5,x=8,b=1,w=2,C=3,T=4,S=5,E=6,A=7,P=8,I=9,M=10,O=11,D=12,R=13,L=14,B=15,N=16,F=17,z=18,k=19,V=20,U=21,X=22,H=23,G=24,W=25,Y=26,q=27,j=28,Z=29,K=30,Q=31,J=852,ee=592,te=15;function ie(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function re(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ne(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=b,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(J),t.distcode=t.distdyn=new r.Buf32(ee),t.sane=1,t.back=-1,p):$}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ne(e)):$}function ae(e,t){var i,r;return e&&e.state?(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?$:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,oe(e))):$}function se(e,t){var i,r;return e?(r=new re,e.state=r,r.window=null,(i=ae(e,t))!==p&&(e.state=null),i):$}function le(e){return se(e,te)}var ue,ce,he=!0;function de(e){if(he){var t;for(ue=new r.Buf32(512),ce=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(u,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),he=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function fe(e,t,i,n){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),n>=a.wsize?(r.arraySet(a.window,t,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>n&&(o=n),r.arraySet(a.window,t,i-n,o,a.wnext),(n-=o)?(r.arraySet(a.window,t,i-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}function pe(e,t){var i,J,ee,te,re,ne,oe,ae,se,le,ue,ce,he,pe,_e,me,$e,ge,ve,ye,xe,be,we,Ce,Te=0,Se=new r.Buf8(4),Ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return $;(i=e.state).mode===D&&(i.mode=R),re=e.next_out,ee=e.output,oe=e.avail_out,te=e.next_in,J=e.input,ne=e.avail_in,ae=i.hold,se=i.bits,le=ne,ue=oe,be=p;e:for(;;)switch(i.mode){case b:if(0===i.wrap){i.mode=R;break}for(;se<16;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(2&i.wrap&&35615===ae){i.check=0,Se[0]=255&ae,Se[1]=ae>>>8&255,i.check=o(i.check,Se,2,0),ae=0,se=0,i.mode=w;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&ae)<<8)+(ae>>8))%31){e.msg="incorrect header check",i.mode=K;break}if((15&ae)!==x){e.msg="unknown compression method",i.mode=K;break}if(se-=4,xe=8+(15&(ae>>>=4)),0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg="invalid window size",i.mode=K;break}i.dmax=1<<xe,e.adler=i.check=1,i.mode=512&ae?M:D,ae=0,se=0;break;case w:for(;se<16;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(i.flags=ae,(255&i.flags)!==x){e.msg="unknown compression method",i.mode=K;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=K;break}i.head&&(i.head.text=ae>>8&1),512&i.flags&&(Se[0]=255&ae,Se[1]=ae>>>8&255,i.check=o(i.check,Se,2,0)),ae=0,se=0,i.mode=C;case C:for(;se<32;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.head&&(i.head.time=ae),512&i.flags&&(Se[0]=255&ae,Se[1]=ae>>>8&255,Se[2]=ae>>>16&255,Se[3]=ae>>>24&255,i.check=o(i.check,Se,4,0)),ae=0,se=0,i.mode=T;case T:for(;se<16;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.head&&(i.head.xflags=255&ae,i.head.os=ae>>8),512&i.flags&&(Se[0]=255&ae,Se[1]=ae>>>8&255,i.check=o(i.check,Se,2,0)),ae=0,se=0,i.mode=S;case S:if(1024&i.flags){for(;se<16;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.length=ae,i.head&&(i.head.extra_len=ae),512&i.flags&&(Se[0]=255&ae,Se[1]=ae>>>8&255,i.check=o(i.check,Se,2,0)),ae=0,se=0}else i.head&&(i.head.extra=null);i.mode=E;case E:if(1024&i.flags&&((ce=i.length)>ne&&(ce=ne),ce&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,J,te,ce,xe)),512&i.flags&&(i.check=o(i.check,J,ce,te)),ne-=ce,te+=ce,i.length-=ce),i.length))break e;i.length=0,i.mode=A;case A:if(2048&i.flags){if(0===ne)break e;ce=0;do{xe=J[te+ce++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe))}while(xe&&ce<ne);if(512&i.flags&&(i.check=o(i.check,J,ce,te)),ne-=ce,te+=ce,xe)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=P;case P:if(4096&i.flags){if(0===ne)break e;ce=0;do{xe=J[te+ce++],i.head&&xe&&i.length<65536&&(i.head.comment+=String.fromCharCode(xe))}while(xe&&ce<ne);if(512&i.flags&&(i.check=o(i.check,J,ce,te)),ne-=ce,te+=ce,xe)break e}else i.head&&(i.head.comment=null);i.mode=I;case I:if(512&i.flags){for(;se<16;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(ae!==(65535&i.check)){e.msg="header crc mismatch",i.mode=K;break}ae=0,se=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=D;break;case M:for(;se<32;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}e.adler=i.check=ie(ae),ae=0,se=0,i.mode=O;case O:if(0===i.havedict)return e.next_out=re,e.avail_out=oe,e.next_in=te,e.avail_in=ne,i.hold=ae,i.bits=se,m;e.adler=i.check=1,i.mode=D;case D:if(t===d||t===f)break e;case R:if(i.last){ae>>>=7&se,se-=7&se,i.mode=q;break}for(;se<3;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}switch(i.last=1&ae,se-=1,3&(ae>>>=1)){case 0:i.mode=L;break;case 1:if(de(i),i.mode=V,t===f){ae>>>=2,se-=2;break e}break;case 2:i.mode=F;break;case 3:e.msg="invalid block type",i.mode=K}ae>>>=2,se-=2;break;case L:for(ae>>>=7&se,se-=7&se;se<32;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if((65535&ae)!=(ae>>>16^65535)){e.msg="invalid stored block lengths",i.mode=K;break}if(i.length=65535&ae,ae=0,se=0,i.mode=B,t===f)break e;case B:i.mode=N;case N:if(ce=i.length){if(ce>ne&&(ce=ne),ce>oe&&(ce=oe),0===ce)break e;r.arraySet(ee,J,te,ce,re),ne-=ce,te+=ce,oe-=ce,re+=ce,i.length-=ce;break}i.mode=D;break;case F:for(;se<14;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(i.nlen=257+(31&ae),ae>>>=5,se-=5,i.ndist=1+(31&ae),ae>>>=5,se-=5,i.ncode=4+(15&ae),ae>>>=4,se-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=K;break}i.have=0,i.mode=z;case z:for(;i.have<i.ncode;){for(;se<3;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.lens[Ee[i.have++]]=7&ae,ae>>>=3,se-=3}for(;i.have<19;)i.lens[Ee[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,we={bits:i.lenbits},be=s(l,i.lens,0,19,i.lencode,0,i.work,we),i.lenbits=we.bits,be){e.msg="invalid code lengths set",i.mode=K;break}i.have=0,i.mode=k;case k:for(;i.have<i.nlen+i.ndist;){for(;me=(Te=i.lencode[ae&(1<<i.lenbits)-1])>>>16&255,$e=65535&Te,!((_e=Te>>>24)<=se);){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if($e<16)ae>>>=_e,se-=_e,i.lens[i.have++]=$e;else{if(16===$e){for(Ce=_e+2;se<Ce;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(ae>>>=_e,se-=_e,0===i.have){e.msg="invalid bit length repeat",i.mode=K;break}xe=i.lens[i.have-1],ce=3+(3&ae),ae>>>=2,se-=2}else if(17===$e){for(Ce=_e+3;se<Ce;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}se-=_e,xe=0,ce=3+(7&(ae>>>=_e)),ae>>>=3,se-=3}else{for(Ce=_e+7;se<Ce;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}se-=_e,xe=0,ce=11+(127&(ae>>>=_e)),ae>>>=7,se-=7}if(i.have+ce>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=K;break}for(;ce--;)i.lens[i.have++]=xe}}if(i.mode===K)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=K;break}if(i.lenbits=9,we={bits:i.lenbits},be=s(u,i.lens,0,i.nlen,i.lencode,0,i.work,we),i.lenbits=we.bits,be){e.msg="invalid literal/lengths set",i.mode=K;break}if(i.distbits=6,i.distcode=i.distdyn,we={bits:i.distbits},be=s(c,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,we),i.distbits=we.bits,be){e.msg="invalid distances set",i.mode=K;break}if(i.mode=V,t===f)break e;case V:i.mode=U;case U:if(ne>=6&&oe>=258){e.next_out=re,e.avail_out=oe,e.next_in=te,e.avail_in=ne,i.hold=ae,i.bits=se,a(e,ue),re=e.next_out,ee=e.output,oe=e.avail_out,te=e.next_in,J=e.input,ne=e.avail_in,ae=i.hold,se=i.bits,i.mode===D&&(i.back=-1);break}for(i.back=0;me=(Te=i.lencode[ae&(1<<i.lenbits)-1])>>>16&255,$e=65535&Te,!((_e=Te>>>24)<=se);){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(me&&0==(240&me)){for(ge=_e,ve=me,ye=$e;me=(Te=i.lencode[ye+((ae&(1<<ge+ve)-1)>>ge)])>>>16&255,$e=65535&Te,!(ge+(_e=Te>>>24)<=se);){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}ae>>>=ge,se-=ge,i.back+=ge}if(ae>>>=_e,se-=_e,i.back+=_e,i.length=$e,0===me){i.mode=Y;break}if(32&me){i.back=-1,i.mode=D;break}if(64&me){e.msg="invalid literal/length code",i.mode=K;break}i.extra=15&me,i.mode=X;case X:if(i.extra){for(Ce=i.extra;se<Ce;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.length+=ae&(1<<i.extra)-1,ae>>>=i.extra,se-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=H;case H:for(;me=(Te=i.distcode[ae&(1<<i.distbits)-1])>>>16&255,$e=65535&Te,!((_e=Te>>>24)<=se);){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(0==(240&me)){for(ge=_e,ve=me,ye=$e;me=(Te=i.distcode[ye+((ae&(1<<ge+ve)-1)>>ge)])>>>16&255,$e=65535&Te,!(ge+(_e=Te>>>24)<=se);){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}ae>>>=ge,se-=ge,i.back+=ge}if(ae>>>=_e,se-=_e,i.back+=_e,64&me){e.msg="invalid distance code",i.mode=K;break}i.offset=$e,i.extra=15&me,i.mode=G;case G:if(i.extra){for(Ce=i.extra;se<Ce;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}i.offset+=ae&(1<<i.extra)-1,ae>>>=i.extra,se-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=K;break}i.mode=W;case W:if(0===oe)break e;if(ce=ue-oe,i.offset>ce){if((ce=i.offset-ce)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=K;break}ce>i.wnext?(ce-=i.wnext,he=i.wsize-ce):he=i.wnext-ce,ce>i.length&&(ce=i.length),pe=i.window}else pe=ee,he=re-i.offset,ce=i.length;ce>oe&&(ce=oe),oe-=ce,i.length-=ce;do{ee[re++]=pe[he++]}while(--ce);0===i.length&&(i.mode=U);break;case Y:if(0===oe)break e;ee[re++]=i.length,oe--,i.mode=U;break;case q:if(i.wrap){for(;se<32;){if(0===ne)break e;ne--,ae|=J[te++]<<se,se+=8}if(ue-=oe,e.total_out+=ue,i.total+=ue,ue&&(e.adler=i.check=i.flags?o(i.check,ee,ue,re-ue):n(i.check,ee,ue,re-ue)),ue=oe,(i.flags?ae:ie(ae))!==i.check){e.msg="incorrect data check",i.mode=K;break}ae=0,se=0}i.mode=j;case j:if(i.wrap&&i.flags){for(;se<32;){if(0===ne)break e;ne--,ae+=J[te++]<<se,se+=8}if(ae!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=K;break}ae=0,se=0}i.mode=Z;case Z:be=_;break e;case K:be=g;break e;case Q:return v;default:return $}return e.next_out=re,e.avail_out=oe,e.next_in=te,e.avail_in=ne,i.hold=ae,i.bits=se,(i.wsize||ue!==e.avail_out&&i.mode<K&&(i.mode<q||t!==h))&&fe(e,e.output,e.next_out,ue-e.avail_out),le-=e.avail_in,ue-=e.avail_out,e.total_in+=le,e.total_out+=ue,i.total+=ue,i.wrap&&ue&&(e.adler=i.check=i.flags?o(i.check,ee,ue,e.next_out-ue):n(i.check,ee,ue,e.next_out-ue)),e.data_type=i.bits+(i.last?64:0)+(i.mode===D?128:0)+(i.mode===V||i.mode===B?256:0),(0===le&&0===ue||t===h)&&be===p&&(be=y),be}function _e(e){if(!e||!e.state)return $;var t=e.state;return t.window&&(t.window=null),e.state=null,p}function me(e,t){var i;return e&&e.state?0==(2&(i=e.state).wrap)?$:(i.head=t,t.done=!1,p):$}function $e(e,t){var i,r=t.length;return e&&e.state?0!==(i=e.state).wrap&&i.mode!==O?$:i.mode===O&&n(1,t,r,0)!==i.check?g:fe(e,t,r,r)?(i.mode=Q,v):(i.havedict=1,p):$}i.inflateReset=oe,i.inflateReset2=ae,i.inflateResetKeep=ne,i.inflateInit=le,i.inflateInit2=se,i.inflate=pe,i.inflateEnd=_e,i.inflateGetHeader=me,i.inflateSetDictionary=$e,i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var r=e("../utils/common"),n=15,o=852,a=592,s=0,l=1,u=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,p,_,m,$,g){var v,y,x,b,w,C,T,S,E,A=g.bits,P=0,I=0,M=0,O=0,D=0,R=0,L=0,B=0,N=0,F=0,z=null,k=0,V=new r.Buf16(n+1),U=new r.Buf16(n+1),X=null,H=0;for(P=0;P<=n;P++)V[P]=0;for(I=0;I<p;I++)V[t[i+I]]++;for(D=A,O=n;O>=1&&0===V[O];O--);if(D>O&&(D=O),0===O)return _[m++]=20971520,_[m++]=20971520,g.bits=1,0;for(M=1;M<O&&0===V[M];M++);for(D<M&&(D=M),B=1,P=1;P<=n;P++)if(B<<=1,(B-=V[P])<0)return-1;if(B>0&&(e===s||1!==O))return-1;for(U[1]=0,P=1;P<n;P++)U[P+1]=U[P]+V[P];for(I=0;I<p;I++)0!==t[i+I]&&($[U[t[i+I]]++]=I);if(e===s?(z=X=$,C=19):e===l?(z=c,k-=257,X=h,H-=257,C=256):(z=d,X=f,C=-1),F=0,I=0,P=M,w=m,R=D,L=0,x=-1,b=(N=1<<D)-1,e===l&&N>o||e===u&&N>a)return 1;for(;;){T=P-L,$[I]<C?(S=0,E=$[I]):$[I]>C?(S=X[H+$[I]],E=z[k+$[I]]):(S=96,E=0),v=1<<P-L,M=y=1<<R;do{_[w+(F>>L)+(y-=v)]=T<<24|S<<16|E|0}while(0!==y);for(v=1<<P-1;F&v;)v>>=1;if(0!==v?(F&=v-1,F+=v):F=0,I++,0==--V[P]){if(P===O)break;P=t[i+$[I]]}if(P>D&&(F&b)!==x){for(0===L&&(L=D),w+=M,B=1<<(R=P-L);R+L<O&&!((B-=V[R+L])<=0);)R++,B<<=1;if(N+=1<<R,e===l&&N>o||e===u&&N>a)return 1;_[x=F&b]=D<<24|R<<16|w-m|0}}return 0!==F&&(_[w+F]=P-L<<24|64<<16|0),g.bits=D,0}},{"../utils/common":1}],10:[function(e,t,i){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=r},{}],"/lib/inflate.js":[function(e,t,i){var r=e("./zlib/inflate"),n=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,t.windowBits);if(i!==a.Z_OK)throw new Error(s[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function d(e,t){var i=new h(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}function f(e,t){return(t=t||{}).raw=!0,d(e,t)}h.prototype.push=function(e,t){var i,s,l,u,h,d,f=this.strm,p=this.options.chunkSize,_=this.options.dictionary,m=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?f.input=o.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new n.Buf8(p),f.next_out=0,f.avail_out=p),(i=r.inflate(f,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&_&&(d="string"==typeof _?o.string2buf(_):"[object ArrayBuffer]"===c.call(_)?new Uint8Array(_):_,i=r.inflateSetDictionary(this.strm,d)),i===a.Z_BUF_ERROR&&!0===m&&(i=a.Z_OK,m=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&i!==a.Z_STREAM_END&&(0!==f.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(f.output,f.next_out),u=f.next_out-l,h=o.buf2string(f.output,l),f.next_out=u,f.avail_out=p-u,u&&n.arraySet(f.output,f.output,l,u,0),this.onData(h)):this.onData(n.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),f.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=h,i.inflate=d,i.inflateRaw=f,i.ungzip=d},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js");var nt$c=tmp;function B$E(e){var t;(o$1u.defined("resourceOrUrlOrBuffer",e),e instanceof ArrayBuffer||ArrayBuffer.isView(e))?t=o$1q.resolve(e):t=t$S.createIfNeeded(e).fetchArrayBuffer();if(e$28(t))return t.then((function(e){if(e$28(e))return U$R(e)}))}function U$R(e){var t=new DataView(e),i=0,r=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT,t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var n=32===r?V$O.RGBA_DXT5:V$O.RGB_DXT1,o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var a=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT,t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=new Uint8Array(e,i,s),u=nt$c.inflate(l).buffer;return new e$1y(n,o,a,new Uint8Array(u))}function t$D(e,t,i){return o$1u.defined("url",e),t=u$Y(t,!0),(i=e$28(i)?i:new r$1c).url=e,i.requestFunction=function(){var i;i=!(e$23(e)||!t)&&i$16(e);var r=o$1q.defer();return t$D.createImage(e,i,r),r.promise},r$1b.request(i)}function w$B(e){var t=e.uint8Array,i=e.format,r=e.request,n=u$Y(e.flipY,!1);o$1u.typeOf.object("uint8Array",t),o$1u.typeOf.string("format",i);var o,a=new Blob([t],{type:i});return t$S.supportsImageBitmapOptions().then((function(e){return e?o$1q(t$S.createImageBitmapFromBlob(a,{flipY:n,premultiplyAlpha:!1})):new t$S({url:o=window.URL.createObjectURL(a),request:r}).fetchImage({flipY:n})})).then((function(e){return e$28(o)&&window.URL.revokeObjectURL(o),e})).otherwise((function(e){return e$28(o)&&window.URL.revokeObjectURL(o),o$1q.reject(e)}))}t$D.createImage=function(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(u$V.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},t$D.defaultCreateImage=t$D.createImage;var p$S=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch{return!1}}();function c$S(e,t){if(!p$S||e$23(e))return t$D(e,void 0,t);var i=l$V(e,void 0,t);return e$28(i)?i.then((function(e){var t=window.URL.createObjectURL(e);return t$D(t,!1).then((function(i){return i.blob=e,window.URL.revokeObjectURL(t),i}),(function(e){return window.URL.revokeObjectURL(t),o$1q.reject(e)}))})):void 0}function d$Z(e,t,i){if(!e$28(e))throw new t$Z("url is required.");var r;t=u$Y(t,u$Y.EMPTY_OBJECT);do{r="loadJsonp"+Math.random().toString().substring(2,8)}while(e$28(window[r]));var n=new h$$(e),o=m$1j(u$Y(n.query,""));e$28(t.parameters)&&(o=p$17(t.parameters,o)),o[u$Y(t.callbackParameterName,"callback")]=r,n.query=m$1k(o),e=n.toString();var a=t.proxy;return e$28(a)&&(e=a.getURL(e)),(i=e$28(i)?i:new r$1c).url=e,i.requestFunction=function(){var t=o$1q.defer();return window[r]=function(e){t.resolve(e);try{delete window[r]}catch{window[r]=void 0}},d$Z.loadAndExecuteScript(e,r,t),t.promise},r$1b.request(i)}function k$R(e){var t;(o$1u.defined("resourceOrUrlOrBuffer",e),e instanceof ArrayBuffer||ArrayBuffer.isView(e))?t=o$1q.resolve(e):t=t$S.createIfNeeded(e).fetchArrayBuffer();if(e$28(t))return t.then((function(e){if(e$28(e))return P$O(e)}))}d$Z.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},d$Z.defaultLoadAndExecuteScript=d$Z.loadAndExecuteScript;var c$R=[171,75,84,88,32,49,49,187,13,10,26,10],L$$=67305985,F$V=["positiveX","negativeX","positiveY","negativeY","positiveZ","negativeZ"],n$Q=4,n$P;function P$O(e){var t,i,r,n=new Uint8Array(e),o=!0;for(t=0;t<c$R.length;++t)if(c$R[t]!==n[t]){o=!1;break}if(!o)throw new t$U("Invalid KTX file.");e$28(e.buffer)?(i=new DataView(e.buffer),r=e.byteOffset):(i=new DataView(e),r=0),r+=12;var a=i.getUint32(r,!0);if(r+=n$Q,a!==L$$)throw new t$U("File is the wrong endianness.");var s=i.getUint32(r,!0);r+=n$Q;var l=i.getUint32(r,!0);r+=n$Q;var u=i.getUint32(r,!0);r+=n$Q;var c=i.getUint32(r,!0);r+=n$Q;var h=i.getUint32(r,!0);r+=n$Q;var d=i.getUint32(r,!0);r+=n$Q;var f=i.getUint32(r,!0);r+=n$Q;var p=i.getUint32(r,!0);r+=n$Q;var _=i.getUint32(r,!0);r+=n$Q;var m=i.getUint32(r,!0);r+=n$Q;var $=i.getUint32(r,!0);r+=n$Q;var g=i.getUint32(r,!0);r+=n$Q,r+=g;var v,y=i.getUint32(r,!0);if(r+=n$Q,v=e$28(e.buffer)?new Uint8Array(e.buffer,r,y):new Uint8Array(e,r,y),c===de$y.RGB8?c=V$O.RGB:c===de$y.RGBA8&&(c=V$O.RGBA),!V$O.validate(c))throw new t$U("glInternalFormat is not a valid format.");if(V$O.isCompressedFormat(c)){if(0!==s)throw new t$U("glType must be zero when the texture is compressed.");if(1!==l)throw new t$U("The type size for compressed textures must be 1.");if(0!==u)throw new t$U("glFormat must be zero when the texture is compressed.")}else{if(s!==de$y.UNSIGNED_BYTE)throw new t$U("Only unsigned byte buffers are supported.");if(h!==u)throw new t$U("The base internal format must be the same as the format for uncompressed textures.")}if(0!==p)throw new t$U("3D textures are unsupported.");if(0!==_)throw new t$U("Texture arrays are unsupported.");var x=v.byteOffset,b=new Array($);for(t=0;t<$;++t){for(var w=b[t]={},C=0;C<m;++C){var T=d>>t,S=f>>t,E=V$O.isCompressedFormat(c)?V$O.compressedTextureSizeInBytes(c,T,S):V$O.textureSizeInBytes(c,s,T,S),A=new Uint8Array(v.buffer,x,E);w[F$V[C]]=new e$1y(c,T,S,A),x+=E}x+=3-(x+3)%4+4}var P=b;if(1===m)for(t=0;t<$;++t)P[t]=P[t][F$V[0]];return 1===$&&(P=P[0]),P}function f$U(e,t){var i;(o$1u.defined("resourceOrUrlOrBuffer",e),e instanceof ArrayBuffer||ArrayBuffer.isView(e))?i=o$1q.resolve(e):i=t$S.createIfNeeded(e).fetchArrayBuffer();return i.then((function(e){return o$10.transcode(e,n$P,t)}))}function r$U(e){e=u$Y(e,0),this._array=new Array(e),this._length=e}f$U.setKTX2SupportedFormats=function(e,t,i,r,n,o){n$P={s3tc:e,pvrtc:t,astc:i,etc:r,etc1:n,bc7:o}},Object.defineProperties(r$U.prototype,{length:{get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},values:{get:function(){return this._array}}}),r$U.prototype.get=function(e){return o$1u.typeOf.number.lessThan("index",e,this._array.length),this._array[e]},r$U.prototype.set=function(e,t){o$1u.typeOf.number("index",e),e>=this.length&&(this.length=e+1),this._array[e]=t},r$U.prototype.peek=function(){return this._array[this._length-1]},r$U.prototype.push=function(e){var t=this.length++;this._array[t]=e},r$U.prototype.pop=function(){return this._array[--this.length]},r$U.prototype.reserve=function(e){o$1u.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)},r$U.prototype.resize=function(e){o$1u.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e},r$U.prototype.trim=function(e){e=u$Y(e,this.length),this._array.length=e};var e$1q={defaultAccessToken:void 0},n$O=!1,o$_,i$L="<b>This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment , and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.</b>";function r$T(){t$Z.throwInstantiationError()}e$1q.getAccessToken=function(e){return e$28(e)?e:e$28(e$1q.defaultAccessToken)?e$1q.defaultAccessToken:(n$O||(console.log(i$L),n$O=!0),"")},e$1q.getErrorCredit=function(e){if(!e$28(e)&&!e$28(e$1q.defaultAccessToken))return e$28(o$_)||(o$_=new r$1a(i$L,!0)),o$_},Object.defineProperties(r$T.prototype,{ellipsoid:{get:t$Z.throwInstantiationError}}),r$T.prototype.project=t$Z.throwInstantiationError,r$T.prototype.unproject=t$Z.throwInstantiationError;var l$U=[],c$Q=[];function M$Q(e,t,i,r,n,o){var a,s,l=n-r+1,u=o-n,c=l$U,h=c$Q;for(a=0;a<l;++a)c[a]=e[r+a];for(s=0;s<u;++s)h[s]=e[n+s+1];a=0,s=0;for(var d=r;d<=o;++d){var f=c[a],p=h[s];a<l&&(s>=u||t(f,p,i)<=0)?(e[d]=f,++a):s<u&&(e[d]=p,++s)}}function u$I(e,t,i,r,n){if(!(r>=n)){var o=Math.floor(.5*(r+n));u$I(e,t,i,r,o),u$I(e,t,i,o+1,n),M$Q(e,t,i,r,o,n)}}function m$Q(e,t,i){if(!e$28(e))throw new t$Z("array is required.");if(!e$28(t))throw new t$Z("comparator is required.");var r=e.length,n=Math.ceil(.5*r);l$U.length=n,c$Q.length=n,u$I(e,t,i,0,r-1),l$U.length=0,c$Q.length=0}var e$1p={NONE:-1,PARTIAL:0,FULL:1},fe$s=Object.freeze(e$1p);function d$Y(e,t){if(!e$28(e))throw new t$Z("occluderBoundingSphere is required.");if(!e$28(t))throw new t$Z("camera position is required.");this._occluderPosition=t$X.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 m$P=new t$X;Object.defineProperties(d$Y.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!e$28(e))throw new t$Z("cameraPosition is required.");e=t$X.clone(e,this._cameraPosition);var t,i,r,n=t$X.subtract(this._occluderPosition,e,m$P),o=t$X.magnitudeSquared(n),a=this._occluderRadius*this._occluderRadius;if(o>a){t=Math.sqrt(o-a),o=1/Math.sqrt(o),i=t$X.multiplyByScalar(n,o,m$P);var s=t*t*o;r=t$X.add(e,t$X.multiplyByScalar(i,s,m$P),m$P)}else t=Number.MAX_VALUE;this._horizonDistance=t,this._horizonPlaneNormal=i,this._horizonPlanePosition=r,this._cameraPosition=e}}}),d$Y.fromBoundingSphere=function(e,t,i){if(!e$28(e))throw new t$Z("occluderBoundingSphere is required.");if(!e$28(t))throw new t$Z("camera position is required.");return e$28(i)?(t$X.clone(e.center,i._occluderPosition),i._occluderRadius=e.radius,i.cameraPosition=t,i):new d$Y(e,t)};var L$_=new t$X;d$Y.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var t=t$X.subtract(e,this._occluderPosition,L$_),i=this._occluderRadius;if((i=t$X.magnitudeSquared(t)-i*i)>0)return i=Math.sqrt(i)+this._horizonDistance,t=t$X.subtract(e,this._cameraPosition,t),i*i>t$X.magnitudeSquared(t)}return!1};var X$G=new t$X;d$Y.prototype.isBoundingSphereVisible=function(e){var t=t$X.clone(e.center,X$G),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var r=t$X.subtract(t,this._occluderPosition,L$_),n=this._occluderRadius-i;if(n=t$X.magnitudeSquared(r)-n*n,i<this._occluderRadius)return n>0&&(n=Math.sqrt(n)+this._horizonDistance,r=t$X.subtract(t,this._cameraPosition,r),n*n+i*i>t$X.magnitudeSquared(r));if(n>0){r=t$X.subtract(t,this._cameraPosition,r);var o=t$X.magnitudeSquared(r),a=this._occluderRadius*this._occluderRadius,s=i*i;return(this._horizonDistance*this._horizonDistance+a)*s>o*a||(n=Math.sqrt(n)+this._horizonDistance)*n+s>o}return!0}return!1};var j$R=new t$X;d$Y.prototype.computeVisibility=function(e){if(!e$28(e))throw new t$Z("occludeeBS is required.");var t=t$X.clone(e.center),i=e.radius;if(i>this._occluderRadius)return fe$s.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var r=t$X.subtract(t,this._occluderPosition,j$R),n=this._occluderRadius-i,o=t$X.magnitudeSquared(r);if((n=o-n*n)>0){n=Math.sqrt(n)+this._horizonDistance,r=t$X.subtract(t,this._cameraPosition,r);var a=t$X.magnitudeSquared(r);return n*n+i*i<a?fe$s.NONE:(n=o-(n=this._occluderRadius+i)*n)>0?a<(n=Math.sqrt(n)+this._horizonDistance)*n+i*i?fe$s.FULL:fe$s.PARTIAL:(r=t$X.subtract(t,this._horizonPlanePosition,r),t$X.dot(r,this._horizonPlaneNormal)>-i?fe$s.PARTIAL:fe$s.FULL)}}return fe$s.NONE};var b$V=new t$X;d$Y.computeOccludeePoint=function(e,t,i){if(!e$28(e))throw new t$Z("occluderBoundingSphere is required.");if(!e$28(i))throw new t$Z("positions is required.");if(0===i.length)throw new t$Z("positions must contain at least one element");var r=t$X.clone(t),n=t$X.clone(e.center),o=e.radius,a=i.length;if(t$X.equals(n,t))throw new t$Z("occludeePosition must be different than occluderBoundingSphere.center");var s=t$X.normalize(t$X.subtract(r,n,b$V),b$V),l=-t$X.dot(s,n),u=d$Y._anyRotationVector(n,s,l),c=d$Y._horizonToPlaneNormalDotProduct(e,s,l,u,i[0]);if(c){for(var h,d=1;d<a;++d){if(!(h=d$Y._horizonToPlaneNormalDotProduct(e,s,l,u,i[d])))return;h<c&&(c=h)}if(!(c<.0017453283658983088)){var f=o/c;return t$X.add(n,t$X.multiplyByScalar(s,f,b$V),b$V)}}};var B$D=[];d$Y.computeOccludeePointFromRectangle=function(e,t){if(!e$28(e))throw new t$Z("rectangle is required.");t=u$Y(t,t$V.WGS84);var i=h$10.subsample(e,t,0,B$D),r=i$19.fromPoints(i),n=t$X.ZERO;if(!t$X.equals(n,r.center))return d$Y.computeOccludeePoint(new i$19(n,t.minimumRadius),r.center,i)};var Z$T=new t$X;d$Y._anyRotationVector=function(e,t,i){var r=t$X.abs(t,Z$T),n=r.x>r.y?0:1;(0===n&&r.z>r.x||1===n&&r.z>r.y)&&(n=2);var o,a=new t$X;0===n?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,o=t$X.UNIT_X):1===n?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,o=t$X.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,o=t$X.UNIT_Z);var s=(t$X.dot(t,r)+i)/-t$X.dot(t,o);return t$X.normalize(t$X.subtract(t$X.add(r,t$X.multiplyByScalar(o,s,a),r),e,r),r)};var G$X=new t$X;d$Y._rotationVector=function(e,t,i,r,n){var o=t$X.subtract(r,e,G$X);if(o=t$X.normalize(o,o),t$X.dot(t,o)<.9999999847691291){var a=t$X.cross(t,o,o);if(t$X.magnitude(a)>e$27.EPSILON13)return t$X.normalize(a,new t$X)}return n};var S$H=new t$X,W$K=new t$X,q$U=new t$X,T$J=new t$X;function e$1o(e,t,i){e=u$Y(e,0),t=u$Y(t,0),i=u$Y(i,0),this.value=new Float32Array([e,t,i])}function s$I(e,t,i){o$1u.defined("url",e),o$1u.defined("apiKey",t),e$28(i)&&o$1u.typeOf.object("params",i),(e=t$S.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=u$Y(i,{})}d$Y._horizonToPlaneNormalDotProduct=function(e,t,i,r,n){var o=t$X.clone(n,S$H),a=t$X.clone(e.center,W$K),s=e.radius,l=t$X.subtract(a,o,q$U),u=t$X.magnitudeSquared(l),c=s*s;if(u<c)return!1;var h=u-c,d=Math.sqrt(h),f=d*(1/Math.sqrt(u))*d;l=t$X.normalize(l,l);var p=t$X.add(o,t$X.multiplyByScalar(l,f,T$J),T$J),_=Math.sqrt(h-f*f),m=this._rotationVector(a,t,i,o,r),$=t$X.fromElements(m.x*m.x*l.x+(m.x*m.y-m.z)*l.y+(m.x*m.z+m.y)*l.z,(m.x*m.y+m.z)*l.x+m.y*m.y*l.y+(m.y*m.z-m.x)*l.z,(m.x*m.z-m.y)*l.x+(m.y*m.z+m.x)*l.y+m.z*m.z*l.z,S$H);$=t$X.normalize($,$);var g=t$X.multiplyByScalar($,_,S$H);m=t$X.normalize(t$X.subtract(t$X.add(p,g,q$U),a,q$U),q$U);var v=t$X.dot(t,m);m=t$X.normalize(t$X.subtract(t$X.subtract(p,g,m),a,m),m);var y=t$X.dot(t,m);return v<y?v:y},Object.defineProperties(e$1o.prototype,{componentDatatype:{get:function(){return S$W.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}}),e$1o.fromCartesian3=function(e){return o$1u.defined("offset",e),new e$1o(e.x,e.y,e.z)},e$1o.toValue=function(e,t){return o$1u.defined("offset",e),e$28(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t},Object.defineProperties(s$I.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}}),s$I.prototype.geocode=function(e){return o$1u.typeOf.string("query",e),this._url.getDerivedResource({url:"json",queryParameters:p$17(this._params,{q:e})}).fetchJson().then((function(e){return e.results.map((function(e){var t,i=e.bounds;if(e$28(i))t=h$10.fromDegrees(i.southwest.lng,i.southwest.lat,i.northeast.lng,i.northeast.lat);else{var r=e.geometry.lat,n=e.geometry.lng;t=t$X.fromDegrees(r,n)}return{displayName:e.formatted,destination:t}}))}))};var t$C={packedLength:void 0,pack:t$Z.throwInstantiationError,unpack:t$Z.throwInstantiationError},o$Z={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:t$Z.throwInstantiationError,unpackInterpolationResult:t$Z.throwInstantiationError},e$1n={BASECOLOR_UV_OFFSET_AND_TILING:0,EMISSIVE_UV_OFFSET_AND_TILING:1},ie$y=Object.freeze(e$1n),u$H=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},F$U=function(e,t,i,r){var n=e.measureText(t),o=u$H(e.canvas,"font-family"),a=u$H(e.canvas,"font-size").replace("px",""),s=u$H(e.canvas,"font-style"),l=u$H(e.canvas,"font-weight"),u=!/\S/.test(t);n.fontsize=a;var c=document.createElement("div");c.style.position="absolute",c.style.opacity=0,c.style.font=s+" "+l+" "+a+"px "+o,c.innerHTML=t+"<br/>"+t,document.body.appendChild(c),n.leading=1.2*a;var h=u$H(c,"height");if((h=h.replace("px",""))>=2*a&&(n.leading=h/2|0),document.body.removeChild(c),u)n.ascent=0,n.descent=0,n.bounds={minx:0,maxx:n.width,miny:0,maxy:0},n.height=0;else{var d=document.createElement("canvas"),f=100;d.width=n.width+f,d.height=3*a,d.style.opacity=1,d.style.fontFamily=o,d.style.fontSize=a,d.style.fontStyle=s,d.style.fontWeight=l;var p=d.getContext("2d");p.font=s+" "+l+" "+a+"px "+o;var _=d.width,m=d.height,$=m/2;p.fillStyle="white",p.fillRect(-1,-1,_+2,m+2),i&&(p.strokeStyle="black",p.lineWidth=e.lineWidth,p.strokeText(t,50,$)),r&&(p.fillStyle="black",p.fillText(t,50,$));for(var g=p.getImageData(0,0,_,m).data,v=0,y=4*_,x=g.length;++v<x&&255===g[v];);var b=v/y|0;for(v=x-1;--v>0&&255===g[v];);var w=v/y|0;for(v=0;v<x&&255===g[v];)(v+=y)>=x&&(v=v-x+4);var C=v%y/4|0,T=1;for(v=x-3;v>=0&&255===g[v];)(v-=y)<0&&(v=x-3-4*T++);var S=v%y/4+1|0;n.ascent=$-b,n.descent=w-$,n.bounds={minx:C-50,maxx:S-50,miny:0,maxy:w-b},n.height=w-b+1}return n},o$Y;function x$V(e,t){if(!e$28(e))throw new t$Z("text is required.");if(""!==e){t=u$Y(t,u$Y.EMPTY_OBJECT);var i=u$Y(t.font,"10px sans-serif"),r=u$Y(t.stroke,!1),n=u$Y(t.fill,!0),o=u$Y(t.strokeWidth,1),a=u$Y(t.backgroundColor,e$1S.TRANSPARENT),s=u$Y(t.padding,0),l=2*s,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=i;var c=u.getContext("2d");e$28(o$Y)||(e$28(c.imageSmoothingEnabled)?o$Y="imageSmoothingEnabled":e$28(c.mozImageSmoothingEnabled)?o$Y="mozImageSmoothingEnabled":e$28(c.webkitImageSmoothingEnabled)?o$Y="webkitImageSmoothingEnabled":e$28(c.msImageSmoothingEnabled)&&(o$Y="msImageSmoothingEnabled")),c.font=i,c.lineJoin="round",c.lineWidth=o,c[o$Y]=!1,c.textBaseline=u$Y(t.textBaseline,"bottom"),u.style.visibility="hidden",document.body.appendChild(u);var h=F$U(c,e,r,n);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";var d=-h.bounds.minx,f=Math.ceil(h.width)+d+l,p=h.height+l,_=p-(p-h.ascent+s)+l;if(u.width=f,u.height=p,c.font=i,c.lineJoin="round",c.lineWidth=o,c[o$Y]=!1,a!==e$1S.TRANSPARENT&&(c.fillStyle=a.toCssColorString(),c.fillRect(0,0,u.width,u.height)),r){var m=u$Y(t.strokeColor,e$1S.BLACK);c.strokeStyle=m.toCssColorString(),c.strokeText(e,d+s,_)}if(n){var $=u$Y(t.fillColor,e$1S.WHITE);c.fillStyle=$.toCssColorString(),c.fillText(e,d+s,_)}return u}}function s$H(){this._cache={}}s$H.prototype.fromColor=function(e,t){if(!e$28(e))throw new t$Z("color is required");if(!e$28(t))throw new t$Z("size is required");return h$L(void 0,void 0,e,t,this._cache)},s$H.prototype.fromUrl=function(e,t,i){if(!e$28(e))throw new t$Z("url is required");if(!e$28(t))throw new t$Z("color is required");if(!e$28(i))throw new t$Z("size is required");return h$L(e,void 0,t,i,this._cache)},s$H.prototype.fromMakiIconId=function(e,t,i){if(!e$28(e))throw new t$Z("id is required");if(!e$28(t))throw new t$Z("color is required");if(!e$28(i))throw new t$Z("size is required");return h$L(n$17("Assets/Textures/maki/"+encodeURIComponent(e)+".png"),void 0,t,i,this._cache)},s$H.prototype.fromText=function(e,t,i){if(!e$28(e))throw new t$Z("text is required");if(!e$28(t))throw new t$Z("color is required");if(!e$28(i))throw new t$Z("size is required");return h$L(void 0,e,t,i,this._cache)};var q$T=new e$1S;function b$U(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,q$T).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function C$K(e,t,i){var r=i/2.5,n=r,o=r;t.width>t.height?o=r*(t.height/t.width):t.width<t.height&&(n=r*(t.width/t.height));var a=Math.round((i-n)/2),s=Math.round(7/24*i-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,n,o),e.drawImage(t,a,s-1,n,o),e.drawImage(t,a+1,s,n,o),e.drawImage(t,a,s+1,n,o),e.globalCompositeOperation="destination-over",e.fillStyle=e$1S.BLACK.toCssColorString(),e.fillRect(a-1,s-1,n+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,n,o),e.globalCompositeOperation="destination-over",e.fillStyle=e$1S.WHITE.toCssColorString(),e.fillRect(a-1,s-2,n+2,o+2)}var l$T=new Array(4);function h$L(e,t,i,r,n){l$T[0]=e,l$T[1]=t,l$T[2]=i,l$T[3]=r;var o=JSON.stringify(l$T),a=n[o];if(e$28(a))return a;var s=document.createElement("canvas");s.width=r,s.height=r;var l=s.getContext("2d");if(b$U(l,i,r),e$28(e)){var u=t$S.createIfNeeded(e).fetchImage().then((function(e){return C$K(l,e,r),n[o]=s,s}));return n[o]=u,u}if(e$28(t)){var c=x$V(t,{font:"bold "+r+"px sans-serif"});C$K(l,c,r)}return n[o]=s,s}function f$T(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.vertexFormat,n$10.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}f$T.packedLength=n$10.packedLength,f$T.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),n$10.pack(e._vertexFormat,t,i),t};var T$I=new n$10,G$W={vertexFormat:T$I};f$T.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=n$10.unpack(e,t,T$I);return e$28(i)?(i._vertexFormat=n$10.clone(r,i._vertexFormat),i):new f$T(G$W)};var w$A=new t$X(-.5,-.5,0),A$Y=new t$X(.5,.5,0);function i$K(){this._workerName="createPlaneOutlineGeometry"}f$T.createGeometry=function(e){var t,i,r=e._vertexFormat,n=new a$_;if(r.position){if((i=new Float64Array(12))[0]=w$A.x,i[1]=w$A.y,i[2]=0,i[3]=A$Y.x,i[4]=w$A.y,i[5]=0,i[6]=A$Y.x,i[7]=A$Y.y,i[8]=0,i[9]=w$A.x,i[10]=A$Y.y,i[11]=0,n.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:i}),r.normal){var o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:o})}if(r.st){var a=new Float32Array(8);a[0]=0,a[1]=0,a[2]=1,a[3]=0,a[4]=1,a[5]=1,a[6]=0,a[7]=1,n.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:a})}if(r.tangent){var s=new Float32Array(12);s[0]=1,s[1]=0,s[2]=0,s[3]=1,s[4]=0,s[5]=0,s[6]=1,s[7]=0,s[8]=0,s[9]=1,s[10]=0,s[11]=0,n.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:s})}if(r.bitangent){var l=new Float32Array(12);l[0]=0,l[1]=1,l[2]=0,l[3]=0,l[4]=1,l[5]=0,l[6]=0,l[7]=1,l[8]=0,l[9]=0,l[10]=1,l[11]=0,n.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:l})}(t=new Uint16Array(6))[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3}return new I$1n({attributes:n,indices:t,primitiveType:W$_.TRIANGLES,boundingSphere:new i$19(t$X.ZERO,Math.sqrt(2))})},i$K.packedLength=0,i$K.pack=function(e,t){return o$1u.defined("value",e),o$1u.defined("array",t),t},i$K.unpack=function(e,t,i){return o$1u.defined("array",e),e$28(i)?i:new i$K};var r$S=new t$X(-.5,-.5,0),o$X=new t$X(.5,.5,0);i$K.createGeometry=function(){var e=new a$_,t=new Uint16Array(8),i=new Float64Array(12);return i[0]=r$S.x,i[1]=r$S.y,i[2]=r$S.z,i[3]=o$X.x,i[4]=r$S.y,i[5]=r$S.z,i[6]=o$X.x,i[7]=o$X.y,i[8]=r$S.z,i[9]=r$S.x,i[10]=o$X.y,i[11]=r$S.z,e.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:i}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new I$1n({attributes:e,indices:t,primitiveType:W$_.LINES,boundingSphere:new i$19(t$X.ZERO,Math.sqrt(2))})};var r$R=new t$X;function c$P(e,t,i,r){return S$P(e,t,i,r,r$R),r$R.x>0&&r$R.y>0&&r$R.z>0}var ke$e=new t$W,Ne$b=new t$W;function ze$d(e,t,i,r){var n=r.cartesianToCartographic(e,ke$e).height,o=r.cartesianToCartographic(t,Ne$b);o.height=n,r.cartographicToCartesian(o,t);var a=r.cartesianToCartographic(i,Ne$b);a.height=n-100,r.cartographicToCartesian(a,i)}var Ue$m=new f$10,We$i=new t$X,Ye$d=new t$X,je$h=new t$X,Me$o=new t$X,Qe$c=new t$X,qe$e=new t$X,me$w=new t$X,j$Q=new t$X,ee$y=new t$X,Ke$d=new o$1k,Ze$8=new o$1k,Je$9=new t$X,Fe$h=new n$14,Xe$b=new p$1a,$e$a=new p$1a;function we$m(e){var t=e.vertexFormat,i=e.geometry,r=e.shadowVolume,n=i.attributes.position.values,o=n.length,a=e.wall,s=e.top,l=e.bottom;if(t.st||t.normal||t.tangent||t.bitangent||r){var u=e.boundingRectangle,c=e.tangentPlane,h=e.ellipsoid,d=e.stRotation,f=e.perPositionHeight,p=Ke$d;p.x=u.x,p.y=u.y;var _,m=e.isComputeTexCoord?new Float32Array(o):new Float32Array(o/3*2),$=t.st?m:void 0;t.normal&&(_=f&&s&&!a?i.attributes.normal.values:new Float32Array(o));var g=t.tangent?new Float32Array(o):void 0,v=t.bitangent?new Float32Array(o):void 0,y=r?new Float32Array(o):void 0,x=0,b=0,w=Ye$d,C=je$h,T=Me$o,S=!0,E=Xe$b,A=$e$a;if(0!==d){var P=n$14.fromAxisAngle(c._plane.normal,d,Fe$h);E=p$1a.fromQuaternion(P,E),P=n$14.fromAxisAngle(c._plane.normal,-d,Fe$h),A=p$1a.fromQuaternion(P,A)}else E=p$1a.clone(p$1a.IDENTITY,E),A=p$1a.clone(p$1a.IDENTITY,A);var I=0;(s&&l||a)&&(I=o/2,o/=2);var M=1,O=[];if(t.st&&a&&e.isComputeTexCoord){let t=[...e.outerPositions,e.outerPositions[0]];for(let e=1;e<t.length;e++){M+=t$X.distance(t[e-1],t[e]),O.push(M)}}for(var D=0;D<o;D+=3){var R=t$X.fromArray(n,D,Je$9);if(t.st){var L=p$1a.multiplyByVector(E,R,We$i);L=h.scaleToGeodeticSurface(L,L);var B=c.projectPointOntoPlane(L,Ze$8);o$1k.subtract(B,p,B);var N=e$27.clamp(B.x/u.width,0,1),F=e$27.clamp(B.y/u.height,0,1);if(a&&M>1){let e=Math.ceil(D/6)-1;N=O[e]?O[e]/M:0,$[x]=1-N,$[x+1]=1,$[x+2]=0,$[x+I]=1-N,$[x+1+I]=0,$[x+2+I]=0}l&&($[x+I]=N,$[x+1+I]=F,e.isComputeTexCoord&&($[x+2+I]=-1)),s&&($[x]=N,$[x+1]=F,e.isComputeTexCoord&&($[x+2]=1)),e.isComputeTexCoord?x+=3:x+=2}if(t.normal||t.tangent||t.bitangent||r){var z=b+1,k=b+2;if(a){if(D+3<o){var V=t$X.fromArray(n,D+3,Qe$c);if(S){var U=t$X.fromArray(n,D+o,qe$e);f&&ze$d(R,V,U,h),t$X.subtract(V,R,V),t$X.subtract(U,R,U),w=t$X.normalize(t$X.cross(U,V,w),w),S=!1}t$X.equalsEpsilon(V,R,e$27.EPSILON10)&&(S=!0)}(t.tangent||t.bitangent)&&(T=h.geodeticSurfaceNormal(R,T),t.tangent&&(C=t$X.normalize(t$X.cross(T,w,C),C)))}else w=h.geodeticSurfaceNormal(R,w),(t.tangent||t.bitangent)&&(f&&(me$w=t$X.fromArray(_,b,me$w),j$Q=t$X.cross(t$X.UNIT_Z,me$w,j$Q),j$Q=t$X.normalize(p$1a.multiplyByVector(A,j$Q,j$Q),j$Q),t.bitangent&&(ee$y=t$X.normalize(t$X.cross(me$w,j$Q,ee$y),ee$y))),C=t$X.cross(t$X.UNIT_Z,w,C),C=t$X.normalize(p$1a.multiplyByVector(A,C,C),C),t.bitangent&&(T=t$X.normalize(t$X.cross(w,C,T),T)));t.normal&&(e.wall?(_[b+I]=w.x,_[z+I]=w.y,_[k+I]=w.z):l&&(_[b+I]=-w.x,_[z+I]=-w.y,_[k+I]=-w.z),(s&&!f||a)&&(_[b]=w.x,_[z]=w.y,_[k]=w.z)),r&&(a&&(w=h.geodeticSurfaceNormal(R,w)),y[b+I]=-w.x,y[z+I]=-w.y,y[k+I]=-w.z),t.tangent&&(e.wall?(g[b+I]=C.x,g[z+I]=C.y,g[k+I]=C.z):l&&(g[b+I]=-C.x,g[z+I]=-C.y,g[k+I]=-C.z),s&&(f?(g[b]=j$Q.x,g[z]=j$Q.y,g[k]=j$Q.z):(g[b]=C.x,g[z]=C.y,g[k]=C.z))),t.bitangent&&(l&&(v[b+I]=T.x,v[z+I]=T.y,v[k+I]=T.z),s&&(f?(v[b]=ee$y.x,v[z]=ee$y.y,v[k]=ee$y.z):(v[b]=T.x,v[z]=T.y,v[k]=T.z))),b+=3}}t.st&&(i.attributes.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:e.isComputeTexCoord?3:2,values:$})),t.normal&&(i.attributes.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:_})),t.tangent&&(i.attributes.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:g})),t.bitangent&&(i.attributes.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:v})),r&&(i.attributes.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:y}))}if(e.extrude&&e$28(e.offsetAttribute)){var X=n.length/3,H=new Uint8Array(X);if(e.offsetAttribute===ee$C.TOP)s&&l||a?H=d$1a(H,1,0,X/2):s&&(H=d$1a(H,1));else H=d$1a(H,e.offsetAttribute===ee$C.NONE?0:1);i.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}return i}var Ge$f=new t$W,xe$p=new t$W,Z$S={west:0,east:0},re$w=new E$$;function be$r(e,t,i,r,n){if(n=u$Y(n,new h$10),!e$28(e)||e.length<3)return n.west=0,n.north=0,n.south=0,n.east=0,n;if(i===m$_.RHUMB)return h$10.fromCartesianArray(e,t,n);re$w.ellipsoid.equals(t)||(re$w=new E$$(void 0,void 0,t)),n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,Z$S.west=Number.POSITIVE_INFINITY,Z$S.east=Number.NEGATIVE_INFINITY;for(var o,a=1/e$27.chordLength(r,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],xe$p),u=Ge$f,c=1;c<s;c++)o=u,u=l,l=t.cartesianToCartographic(e[c],o),re$w.setEndPoints(u,l),Re$k(re$w,a,n,Z$S);return o=u,u=l,l=t.cartesianToCartographic(e[0],o),re$w.setEndPoints(u,l),Re$k(re$w,a,n,Z$S),n.east-n.west>Z$S.west-Z$S.east&&(n.east=Z$S.east,n.west=Z$S.west),n}var Ie$n=new t$W;function Re$k(e,t,i,r){for(var n=e.surfaceDistance,o=Math.ceil(n*t),a=o>0?n/(o-1):Number.POSITIVE_INFINITY,s=0,l=0;l<o;l++){var u=e.interpolateUsingSurfaceDistance(s,Ie$n);s+=a;var c=u.longitude,h=u.latitude;i.west=Math.min(i.west,c),i.east=Math.max(i.east,c),i.south=Math.min(i.south,h),i.north=Math.max(i.north,h),r.west=c>0?Math.min(c,r.west):r.west,r.east=c<0?Math.max(c,r.east):r.east}}var Se$e=[];function er$8(e,t,i,r,n,o,a,s,l,u,c){var h,d={walls:[]};if(o||a){var f,p,_=y$Q.createGeometryFromPositions(e,t,i,n,s,l),m=_.attributes.position.values,$=_.indices;if(o&&a){var g=m.concat(m);f=g.length/3,(p=ce$v.createTypedArray(f,2*$.length)).set($);var v=$.length,y=f/2;for(h=0;h<v;h+=3){var x=p[h]+y,b=p[h+1]+y,w=p[h+2]+y;p[h+v]=w,p[h+1+v]=b,p[h+2+v]=x}if(_.attributes.position.values=g,n&&s.normal){var C=_.attributes.normal.values;_.attributes.normal.values=new Float32Array(g.length),_.attributes.normal.values.set(C)}_.indices=p}else if(a){for(f=m.length/3,p=ce$v.createTypedArray(f,$.length),h=0;h<$.length;h+=3)p[h]=$[h+2],p[h+1]=$[h+1],p[h+2]=$[h];_.indices=p}d.topAndBottom=new d$15({geometry:_})}var T,S=r.outerRing,E=f$16.fromPoints(S,e),A=E.projectPointsOntoPlane(S,Se$e),P=A$1d.computeWindingOrder2D(A);P===_0x4a48d8.CLOCKWISE&&(S=S.slice().reverse()),u&&(T=y$Q.computeWallGeometry(S,e,i,n,l,c),d.walls.push(new d$15({geometry:T})));var I=r.holes;for(h=0;h<I.length;h++){var M=I[h];A=(E=f$16.fromPoints(M,e)).projectPointsOntoPlane(M,Se$e),(P=A$1d.computeWindingOrder2D(A))===_0x4a48d8.COUNTER_CLOCKWISE&&(M=M.slice().reverse()),T=y$Q.computeWallGeometry(M,e,i,n,l),d.walls.push(new d$15({geometry:T}))}return d}function U$Q(e){if(o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e$28(e.perPositionHeight)&&e.perPositionHeight&&e$28(e.height))throw new t$Z("Cannot use both options.perPositionHeight and options.height");if(e$28(e.arcType)&&e.arcType!==m$_.GEODESIC&&e.arcType!==m$_.RHUMB)throw new t$Z("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");var t=e.polygonHierarchy,i=u$Y(e.vertexFormat,n$10.DEFAULT),r=u$Y(e.ellipsoid,t$V.WGS84),n=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),o=u$Y(e.stRotation,0),a=u$Y(e.perPositionHeight,!1),s=a&&e$28(e.extrudedHeight),l=u$Y(e.height,0),u=u$Y(e.extrudedHeight,l);if(!s){var c=Math.max(l,u);u=Math.min(l,u),l=c}this._vertexFormat=n$10.clone(i),this._ellipsoid=t$V.clone(r),this._granularity=n,this._stRotation=o,this._height=l,this._extrudedHeight=u,this._closeTop=u$Y(e.closeTop,!0),this._closeBottom=u$Y(e.closeBottom,!0),this._extrudeOutering=u$Y(e.extrudeOutering,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=s,this._shadowVolume=u$Y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=u$Y(e.arcType,m$_.GEODESIC),this._groundBottomAltitude=u$Y(e.groundBottomAltitude,0),this._groundExtrudedHeight=u$Y(e.groundExtrudedHeight,0),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._isComputeTexCoord=e.isComputeTexCoord,this._isWall=u$Y(e.isWall,!1),this.packedLength=y$Q.computeHierarchyPackedLength(t)+t$V.packedLength+n$10.packedLength+12}U$Q.fromPositions=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.positions",e.positions),new U$Q({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,isComputeTexCoord:e.isComputeTexCoord,isWall:e.isWall})},U$Q.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),i=y$Q.packPolygonHierarchy(e._polygonHierarchy,t,i),t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i++]=u$Y(e._offsetAttribute,-1),t[i++]=e._arcType,t[i]=e.packedLength,t};var rr$8=t$V.clone(t$V.UNIT_SPHERE),ar$7=new n$10,ir$6={polygonHierarchy:{}};function tr$6(e){var t=-e._stRotation;if(0===t)return[0,0,0,1,1,0];var i=e._ellipsoid,r=e._polygonHierarchy.positions,n=e.rectangle;return I$1n._textureCoordinateRotationPoints(r,t,i,n)}function e$1m(e,t){this.positions=e$28(e)?e:[],this.holes=e$28(t)?t:[]}U$Q.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=y$Q.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=t$V.unpack(e,t,rr$8);t+=t$V.packedLength;var o=n$10.unpack(e,t,ar$7);t+=n$10.packedLength;var a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=1===e[t++],h=1===e[t++],d=1===e[t++],f=1===e[t++],p=1===e[t++],_=e[t++],m=e[t++],$=e[t];return e$28(i)||(i=new U$Q(ir$6)),i._polygonHierarchy=r,i._ellipsoid=t$V.clone(n,i._ellipsoid),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._height=a,i._extrudedHeight=s,i._granularity=l,i._stRotation=u,i._perPositionHeightExtrude=c,i._perPositionHeight=h,i._closeTop=d,i._closeBottom=f,i._shadowVolume=p,i._offsetAttribute=-1===_?void 0:_,i._arcType=m,i.packedLength=$,i},U$Q.computeRectangle=function(e,t){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.polygonHierarchy",e.polygonHierarchy);var i=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),r=u$Y(e.arcType,m$_.GEODESIC);if(r!==m$_.GEODESIC&&r!==m$_.RHUMB)throw new t$Z("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");var n=e.polygonHierarchy,o=u$Y(e.ellipsoid,t$V.WGS84);return be$r(n.positions,o,r,i,t)},U$Q.createGeometry=function(e){var t=e._vertexFormat,i=e._ellipsoid,r=e._granularity,n=e._stRotation,o=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType,c=o.positions;if(!(c.length<3)){var h=f$16.fromPoints(c,i),d=y$Q.polygonsFromHierarchy(o,h.projectPointsOntoPlane.bind(h),!a,i),f=d.hierarchy,p=d.polygons;if(0!==f.length){c=f[0].outerRing;var _,m=y$Q.computeBoundingRectangle(h.plane.normal,h.projectPointOntoPlane.bind(h),c,n,Ue$m),$=[],g=e._height,v=e._extrudedHeight,y=e._perPositionHeightExtrude||!e$27.equalsEpsilon(g,v,0,e$27.EPSILON2),x={perPositionHeight:a,vertexFormat:t,geometry:void 0,tangentPlane:h,boundingRectangle:m,ellipsoid:i,stRotation:n,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u,outerPositions:c,isComputeTexCoord:e._isComputeTexCoord};if(y)for(x.extrude=!0,x.top=s,x.bottom=l,x.shadowVolume=e._shadowVolume,x.offsetAttribute=e._offsetAttribute,_=0;_<p.length;_++){var b,w=er$8(i,p[_],r,f[_],a,s,l,t,u,e._extrudeOutering,e._isWall);s&&l?(b=w.topAndBottom,x.geometry=y$Q.scaleToGeodeticHeightExtruded(b.geometry,g,v,i,a)):s?((b=w.topAndBottom).geometry.attributes.position.values=A$1d.scaleToGeodeticHeight(b.geometry.attributes.position.values,g,i,!a),x.geometry=b.geometry):l&&((b=w.topAndBottom).geometry.attributes.position.values=A$1d.scaleToGeodeticHeight(b.geometry.attributes.position.values,v,i,!0),x.geometry=b.geometry),(s||l)&&(x.wall=!1,b.geometry=we$m(x),$.push(b));var C=w.walls;x.wall=!0;for(var T=0;T<C.length;T++){var S=C[T];x.top=!1,x.bottom=!1,x.geometry=y$Q.scaleToGeodeticHeightExtruded(S.geometry,g,v,i,a),S.geometry=we$m(x),$.push(S)}}else for(_=0;_<p.length;_++){var E=new d$15({geometry:y$Q.createGeometryFromPositions(i,p[_],r,a,t,u)});if(E.geometry.attributes.position.values=A$1d.scaleToGeodeticHeight(E.geometry.attributes.position.values,g,i,!a),x.geometry=E.geometry,E.geometry=we$m(x),e$28(e._offsetAttribute)){var A=E.geometry.attributes.position.values.length,P=new Uint8Array(A/3);d$1a(P,e._offsetAttribute===ee$C.NONE?0:1),E.geometry.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}$.push(E)}var I=k$Z.combineInstances($)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=ce$v.createTypedArray(I.attributes.position.values.length/3,I.indices);var M=I.attributes,O=i$19.fromVertices(M.position.values);return t.position||delete M.position,new I$1n({attributes:M,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:O,offsetAttribute:e._offsetAttribute})}}},U$Q.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=e._groundBottomAltitude+e._groundExtrudedHeight,a=e._groundBottomAltitude?e._groundBottomAltitude:t(r,n),s=o!==e._groundBottomAltitude?o:i(r,n);return new U$Q({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:a,height:s,vertexFormat:n$10.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(U$Q.prototype,{rectangle:{get:function(){if(!e$28(this._rectangle)){var e=this._polygonHierarchy.positions;this._rectangle=be$r(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return e$28(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=tr$6(this)),this._textureCoordinateRotationPoints}}});var j$P=[],D$R=[];function Q$P(e,t,i,r,n){var o=f$16.fromPoints(t,e).projectPointsOntoPlane(t,j$P);A$1d.computeWindingOrder2D(o)===_0x4a48d8.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var a,s,l=t.length,u=0;if(r)for(a=new Float64Array(2*l*3),s=0;s<l;s++){var c=t[s],h=t[(s+1)%l];a[u++]=c.x,a[u++]=c.y,a[u++]=c.z,a[u++]=h.x,a[u++]=h.y,a[u++]=h.z}else{var d=0;if(n===m$_.GEODESIC)for(s=0;s<l;s++)d+=y$Q.subdivideLineCount(t[s],t[(s+1)%l],i);else if(n===m$_.RHUMB)for(s=0;s<l;s++)d+=y$Q.subdivideRhumbLineCount(e,t[s],t[(s+1)%l],i);for(a=new Float64Array(3*d),s=0;s<l;s++){var f;n===m$_.GEODESIC?f=y$Q.subdivideLine(t[s],t[(s+1)%l],i,D$R):n===m$_.RHUMB&&(f=y$Q.subdivideRhumbLine(e,t[s],t[(s+1)%l],i,D$R));for(var p=f.length,_=0;_<p;++_)a[u++]=f[_]}}var m=2*(l=a.length/3),$=ce$v.createTypedArray(l,m);for(u=0,s=0;s<l-1;s++)$[u++]=s,$[u++]=s+1;return $[u++]=l-1,$[u++]=0,new d$15({geometry:new I$1n({attributes:new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:a})}),indices:$,primitiveType:W$_.LINES})})}function V$H(e,t,i,r,n){var o=f$16.fromPoints(t,e).projectPointsOntoPlane(t,j$P);A$1d.computeWindingOrder2D(o)===_0x4a48d8.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var a,s,l=t.length,u=new Array(l),c=0;if(r)for(a=new Float64Array(2*l*3*2),s=0;s<l;++s){u[s]=c/3;var h=t[s],d=t[(s+1)%l];a[c++]=h.x,a[c++]=h.y,a[c++]=h.z,a[c++]=d.x,a[c++]=d.y,a[c++]=d.z}else{var f=0;if(n===m$_.GEODESIC)for(s=0;s<l;s++)f+=y$Q.subdivideLineCount(t[s],t[(s+1)%l],i);else if(n===m$_.RHUMB)for(s=0;s<l;s++)f+=y$Q.subdivideRhumbLineCount(e,t[s],t[(s+1)%l],i);for(a=new Float64Array(3*f*2),s=0;s<l;++s){var p;u[s]=c/3,n===m$_.GEODESIC?p=y$Q.subdivideLine(t[s],t[(s+1)%l],i,D$R):n===m$_.RHUMB&&(p=y$Q.subdivideRhumbLine(e,t[s],t[(s+1)%l],i,D$R));for(var _=p.length,m=0;m<_;++m)a[c++]=p[m]}}l=a.length/6;var $=u.length,g=2*(2*l+$),v=ce$v.createTypedArray(l,g);for(c=0,s=0;s<l;++s)v[c++]=s,v[c++]=(s+1)%l,v[c++]=s+l,v[c++]=(s+1)%l+l;for(s=0;s<$;s++){var y=u[s];v[c++]=y,v[c++]=y+l}return new d$15({geometry:new I$1n({attributes:new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:a})}),indices:v,primitiveType:W$_.LINES})})}function A$X(e){if(o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&e$28(e.height))throw new t$Z("Cannot use both options.perPositionHeight and options.height");if(e$28(e.arcType)&&e.arcType!==m$_.GEODESIC&&e.arcType!==m$_.RHUMB)throw new t$Z("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");var t=e.polygonHierarchy,i=u$Y(e.ellipsoid,t$V.WGS84),r=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),n=u$Y(e.perPositionHeight,!1),o=n&&e$28(e.extrudedHeight),a=u$Y(e.arcType,m$_.GEODESIC),s=u$Y(e.height,0),l=u$Y(e.extrudedHeight,s);if(!o){var u=Math.max(s,l);l=Math.min(s,l),s=u}this._ellipsoid=t$V.clone(i),this._granularity=r,this._height=s,this._extrudedHeight=l,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=n,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=y$Q.computeHierarchyPackedLength(t)+t$V.packedLength+8}A$X.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),i=y$Q.packPolygonHierarchy(e._polygonHierarchy,t,i),t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=u$Y(e._offsetAttribute,-1),t[i]=e.packedLength,t};var X$F=t$V.clone(t$V.UNIT_SPHERE),Z$R={polygonHierarchy:{}};A$X.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=y$Q.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=t$V.unpack(e,t,X$F);t+=t$V.packedLength;var o=e[t++],a=e[t++],s=e[t++],l=1===e[t++],u=1===e[t++],c=e[t++],h=e[t++],d=e[t];return e$28(i)||(i=new A$X(Z$R)),i._polygonHierarchy=r,i._ellipsoid=t$V.clone(n,i._ellipsoid),i._height=o,i._extrudedHeight=a,i._granularity=s,i._perPositionHeight=u,i._perPositionHeightExtrude=l,i._arcType=c,i._offsetAttribute=-1===h?void 0:h,i.packedLength=d,i},A$X.fromPositions=function(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.positions",e.positions),new A$X({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},A$X.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,n=e._perPositionHeight,o=e._arcType,a=y$Q.polygonOutlinesFromHierarchy(r,!n,t);if(0!==a.length){var s,l,u=[],c=e$27.chordLength(i,t.maximumRadius),h=e._height,d=e._extrudedHeight;if(e._perPositionHeightExtrude||!e$27.equalsEpsilon(h,d,0,e$27.EPSILON2))for(l=0;l<a.length;l++){if((s=V$H(t,a[l],c,n,o)).geometry=y$Q.scaleToGeodeticHeightExtruded(s.geometry,h,d,t,n),e$28(e._offsetAttribute)){var f=s.geometry.attributes.position.values.length/3,p=new Uint8Array(f);e._offsetAttribute===ee$C.TOP?p=d$1a(p,1,0,f/2):p=d$1a(p,e._offsetAttribute===ee$C.NONE?0:1),s.geometry.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}u.push(s)}else for(l=0;l<a.length;l++){if((s=Q$P(t,a[l],c,n,o)).geometry.attributes.position.values=A$1d.scaleToGeodeticHeight(s.geometry.attributes.position.values,h,t,!n),e$28(e._offsetAttribute)){var _=s.geometry.attributes.position.values.length,m=new Uint8Array(_/3);d$1a(m,e._offsetAttribute===ee$C.NONE?0:1),s.geometry.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}u.push(s)}var $=k$Z.combineInstances(u)[0],g=i$19.fromVertices($.attributes.position.values);return new I$1n({attributes:$.attributes,indices:$.indices,primitiveType:$.primitiveType,boundingSphere:g,offsetAttribute:e._offsetAttribute})}};var fe$r=[];function xe$o(e,t,i,r,n){var o=fe$r;o.length=n;var a,s=i.red,l=i.green,u=i.blue,c=i.alpha,h=r.red,d=r.green,f=r.blue,p=r.alpha;if(e$1S.equals(i,r)){for(a=0;a<n;a++)o[a]=e$1S.clone(i);return o}var _=(h-s)/n,m=(d-l)/n,$=(f-u)/n,g=(p-c)/n;for(a=0;a<n;a++)o[a]=new e$1S(s+a*_,l+a*m,u+a*$,c+a*g);return o}function R$J(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.colors,r=u$Y(e.width,1),n=u$Y(e.hMax,-1),o=u$Y(e.colorsPerVertex,!1);if(!e$28(t)||t.length<2)throw new t$Z("At least two positions are required.");if("number"!=typeof r)throw new t$Z("width must be a number");if(e$28(i)&&(o&&i.length<t.length||!o&&i.length<t.length-1))throw new t$Z("colors has an invalid length.");this._positions=t,this._colors=i,this._width=r,this._hMax=n,this._colorsPerVertex=o,this._dist=e.dist,this._period=e.period,this._vertexFormat=n$10.clone(u$Y(e.vertexFormat,n$10.DEFAULT)),this._followSurface=u$Y(e.followSurface,!0),e$28(e.followSurface)&&(t$T("PolylineGeometry.followSurface","PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead."),e.arcType=e.followSurface?m$_.GEODESIC:m$_.NONE),this._arcType=u$Y(e.arcType,m$_.GEODESIC),this._followSurface=this._arcType!==m$_.NONE,this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._workerName="createPolylineGeometry";var a=1+t.length*t$X.packedLength;a+=e$28(i)?1+i.length*e$1S.packedLength:1,this.packedLength=a+t$V.packedLength+n$10.packedLength+4+2}R$J.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._colors;for(o=e$28(a)?a.length:0,t[i++]=o,r=0;r<o;++r,i+=e$1S.packedLength)e$1S.pack(a[r],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._width,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i++]=e._granularity,t[i++]=e._hMax,t[i++]=e._dist,t[i]=e._period,t};var le$t=t$V.clone(t$V.UNIT_SPHERE),se$t=new n$10,P$N={positions:void 0,colors:void 0,ellipsoid:le$t,vertexFormat:se$t,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};R$J.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n=e[t++],o=new Array(n);for(r=0;r<n;++r,t+=t$X.packedLength)o[r]=t$X.unpack(e,t);var a=(n=e[t++])>0?new Array(n):void 0;for(r=0;r<n;++r,t+=e$1S.packedLength)a[r]=e$1S.unpack(e,t);var s=t$V.unpack(e,t,le$t);t+=t$V.packedLength;var l=n$10.unpack(e,t,se$t);t+=n$10.packedLength;var u=e[t++],c=1===e[t++],h=e[t++],d=e[t++],f=e[t++],p=1==e[t++],_=e[t];return e$28(i)?(i._positions=o,i._colors=a,i._ellipsoid=t$V.clone(s,i._ellipsoid),i._vertexFormat=n$10.clone(l,i._vertexFormat),i._width=u,i._colorsPerVertex=c,i._arcType=h,i._granularity=d,i._hMax=f,i._dist=p,i._period=_,i):(P$N.positions=o,P$N.colors=a,P$N.width=u,P$N.colorsPerVertex=c,P$N.arcType=h,P$N.granularity=d,P$N.hMax=f,P$N.dist=p,P$N.period=_,new R$J(P$N))};var de$r=new t$X,me$v=new t$X,_e$o=new t$X,ue$t=new t$X;function ae$w(e,t,i,r){var n=e.combinedPositions,o=e.combinedLocalPositions,a=new a$_;r.position&&(a.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:n}));var s,l,u,c,h,d,f=t.length,p=n.length/3,_=(p-2*f)/(2*f),m=A$1d.triangulate(t),$=(_-1)*f*6+2*m.length,g=ce$v.createTypedArray(p,$),v=2*f,y=0;for(s=0;s<_-1;s++){for(l=0;l<f-1;l++)d=(u=2*l+s*f*2)+v,h=(c=u+1)+v,g[y++]=c,g[y++]=u,g[y++]=h,g[y++]=h,g[y++]=u,g[y++]=d;h=(c=(u=2*f-2+s*f*2)+1)+v,d=u+v,g[y++]=c,g[y++]=u,g[y++]=h,g[y++]=h,g[y++]=u,g[y++]=d}if(r.st||r.tangent||r.bitangent){var x,b,w=new Float32Array(2*p),C=1/(_-1),T=1/i.height,S=i.height/2,E=0;for(s=0;s<_;s++){for(x=s*C,b=T*(t[0].y+S),w[E++]=x,w[E++]=b,l=1;l<f;l++)b=T*(t[l].y+S),w[E++]=x,w[E++]=b,w[E++]=x,w[E++]=b;b=T*(t[0].y+S),w[E++]=x,w[E++]=b}for(l=0;l<f;l++)x=0,b=T*(t[l].y+S),w[E++]=x,w[E++]=b;for(l=0;l<f;l++)x=(_-1)*C,b=T*(t[l].y+S),w[E++]=x,w[E++]=b;a.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:new Float32Array(w)})}var A=p-2*f;for(s=0;s<m.length;s+=3){var P=m[s]+A,I=m[s+1]+A,M=m[s+2]+A;g[y++]=P,g[y++]=I,g[y++]=M,g[y++]=M+f,g[y++]=I+f,g[y++]=P+f}var O=new I$1n({attributes:a,indices:g,boundingSphere:i$19.fromVertices(n),primitiveType:W$_.TRIANGLES});if(r.normal&&(O=k$Z.computeNormal(O)),r.tangent||r.bitangent){try{O=k$Z.computeTangentAndBitangent(O)}catch{e$1$("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}r.tangent||(O.attributes.tangent=void 0),r.bitangent||(O.attributes.bitangent=void 0),r.st||(O.attributes.st=void 0)}return e$28(o)&&(O.attributes.position.values=o,O.attributes.position.componentDatatype=S$W.FLOAT),O}function N$G(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;if(!e$28(t))throw new t$Z("options.polylinePositions is required.");if(!e$28(i))throw new t$Z("options.shapePositions is required.");this._positions=t,this._shape=i,this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._cornerType=u$Y(e.cornerType,ar$a.ROUNDED),this._vertexFormat=n$10.clone(u$Y(e.vertexFormat,n$10.DEFAULT)),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry",this.enuCenter=u$Y(e.enuCenter,t$X.ZERO);var r=1+t.length*t$X.packedLength;r+=1+i.length*o$1k.packedLength+t$X.packedLength,this.packedLength=r+t$V.packedLength+n$10.packedLength+2}R$J.createGeometry=function(e){var t,i,r,n=e._width,o=e._hMax,a=e._vertexFormat,s=e._colors,l=e._colorsPerVertex,u=e._arcType,c=e._granularity,h=e._ellipsoid,d=e._dist,f=e._period,p=D$Z(e._positions,t$X.equalsEpsilon),_=p.length;if(!(_<2||n<=0)){if(u===m$_.GEODESIC||u===m$_.RHUMB){var m,$;u===m$_.GEODESIC?(m=e$27.chordLength(c,h.maximumRadius),$=m$U.numberOfPoints):(m=c,$=m$U.numberOfPointsRhumbLine);var g=m$U.extractHeights(p,h);if(e$28(s)){var v=1;for(t=0;t<_-1;++t)v+=$(p[t],p[t+1],m);var y=new Array(v),x=0;for(t=0;t<_-1;++t){var b=p[t],w=p[t+1],C=s[t],T=$(b,w,m);if(l&&t<v){var S=xe$o(b,w,C,s[t+1],T),E=S.length;for(i=0;i<E;++i)y[x++]=S[i]}else for(i=0;i<T;++i)y[x++]=e$1S.clone(C)}y[x]=e$1S.clone(s[s.length-1]),s=y,fe$r.length=0}p=u===m$_.GEODESIC?m$U.generateCartesianArc({positions:p,minDistance:m,ellipsoid:h,height:g,hMax:o}):m$U.generateCartesianRhumbArc({positions:p,granularity:m,ellipsoid:h,height:g})}var A,P=4*(_=p.length)-4,I=new Float64Array(3*P),M=new Float64Array(3*P),O=new Float64Array(3*P),D=new Float32Array(2*P),R=a.st?new Float32Array(2*P):void 0,L=e$28(s)?new Uint8Array(4*P):void 0,B=d?new Float32Array(3*P):void 0,N=0,F=0,z=0,k=0,V=0,U=0;for(i=0;i<_;++i){var X,H;0===i?(A=de$r,t$X.subtract(p[0],p[1],A),t$X.add(p[0],A,A)):A=p[i-1],t$X.clone(A,_e$o),t$X.clone(p[i],me$v),i===_-1?(A=de$r,t$X.subtract(p[_-1],p[_-2],A),t$X.add(p[_-1],A,A)):A=p[i+1],t$X.clone(A,ue$t),e$28(L)&&(X=0===i||l?s[i]:s[i-1],i!==_-1&&(H=s[i]));var G=i===_-1?2:4;for(r=0===i?2:0;r<G;++r){t$X.pack(me$v,I,N),t$X.pack(_e$o,M,N),t$X.pack(ue$t,O,N),N+=3;var W=r-2<0?-1:1,Y=r%2*2-1,q=Y*i/_;if(D[F++]=o>0?q:Y,D[F++]=W*n,a.st&&(R[z++]=i/(_-1),R[z++]=Math.max(D[F-2],0)),e$28(L)){var j=r<2?X:H;L[k++]=e$1S.floatToByte(j.red),L[k++]=e$1S.floatToByte(j.green),L[k++]=e$1S.floatToByte(j.blue),L[k++]=e$1S.floatToByte(j.alpha)}d&&(B[3*V]=U,V++)}U+=t$X.distance(A,p[i])}if(d){var Z=U,K=Math.random()*(f>0?f:Z);for(i=0;i<P;i++)B[3*i+1]=Z,B[3*i+2]=K}var Q=new a$_;Q.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:I}),Q.prevPosition=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:M}),Q.nextPosition=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:O}),Q.expandAndWidth=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:D}),a.st&&(Q.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:R})),e$28(L)&&(Q.color=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,values:L,normalize:!0})),d&&(Q.dist=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:B}));var J=ce$v.createTypedArray(P,6*_-6),ee=0,te=0,ie=_-1;for(i=0;i<ie;++i)J[te++]=ee,J[te++]=ee+2,J[te++]=ee+1,J[te++]=ee+1,J[te++]=ee+2,J[te++]=ee+3,ee+=4;return new I$1n({attributes:Q,indices:J,primitiveType:W$_.TRIANGLES,boundingSphere:i$19.fromPoints(p),geometryType:Me$r.POLYLINES})}},N$G.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._shape;for(o=a.length,t[i++]=o,r=0;r<o;++r,i+=o$1k.packedLength)o$1k.pack(a[r],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._cornerType,t[i++]=e._granularity,t$X.pack(e.enuCenter,t,i),t};var z$G=t$V.clone(t$V.UNIT_SPHERE),Q$O=new n$10,C$J={polylinePositions:void 0,shapePositions:void 0,ellipsoid:z$G,vertexFormat:Q$O,cornerType:void 0,granularity:void 0,enuCenter:void 0};N$G.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n=e[t++],o=new Array(n);for(r=0;r<n;++r,t+=t$X.packedLength)o[r]=t$X.unpack(e,t);n=e[t++];var a=new Array(n);for(r=0;r<n;++r,t+=o$1k.packedLength)a[r]=o$1k.unpack(e,t);var s=t$V.unpack(e,t,z$G);t+=t$V.packedLength;var l=n$10.unpack(e,t,Q$O);t+=n$10.packedLength;var u,c=e[t++],h=e[t++];return u=t$X.unpack(e,t),e$28(i)?(i._positions=o,i._shape=a,i._ellipsoid=t$V.clone(s,i._ellipsoid),i._vertexFormat=n$10.clone(l,i._vertexFormat),i._cornerType=c,i._granularity=h,i.enuCenter=u,i):(C$J.polylinePositions=o,C$J.shapePositions=a,C$J.cornerType=c,C$J.granularity=h,C$J.enuCenter=u,new N$G(C$J))};var pe$w=new f$10;function U$P(e,t){var i=new a$_;i.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:e});var r,n,o=t.length,a=i.position.values.length/3,s=e.length/3/o,l=ce$v.createTypedArray(a,2*o*(s+1)),u=0,c=(r=0)*o;for(n=0;n<o-1;n++)l[u++]=n+c,l[u++]=n+c+1;for(l[u++]=o-1+c,l[u++]=c,c=(r=s-1)*o,n=0;n<o-1;n++)l[u++]=n+c,l[u++]=n+c+1;for(l[u++]=o-1+c,l[u++]=c,r=0;r<s-1;r++){var h=o*r,d=h+o;for(n=0;n<o;n++)l[u++]=n+h,l[u++]=n+d}return new I$1n({attributes:i,indices:ce$v.createTypedArray(a,l),boundingSphere:i$19.fromVertices(e),primitiveType:W$_.LINES})}function _$K(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;if(!e$28(t))throw new t$Z("options.polylinePositions is required.");if(!e$28(i))throw new t$Z("options.shapePositions is required.");this._positions=t,this._shape=i,this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._cornerType=u$Y(e.cornerType,ar$a.ROUNDED),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var r=1+t.length*t$X.packedLength;r+=1+i.length*o$1k.packedLength,this.packedLength=r+t$V.packedLength+2}N$G.createGeometry=function(e){for(var t=D$Z(e._positions,t$X.equalsEpsilon),i=t.length,r=new Array(i),n=0;n<i;n++)r[n]=t$X.clone(t[n]);var o=e._shape;if(o=J$V.removeDuplicatesFromShape(o),!(t.length<2||o.length<3)){A$1d.computeWindingOrder2D(o)===_0x4a48d8.CLOCKWISE&&o.reverse();var a=f$10.fromPoints(o,pe$w),s={};if(s.combinedPositions=J$V.computePositions(r,o,a,e,!0),!t$X.equals(e.enuCenter,t$X.ZERO)){var l=new Array(i);for(n=0;n<i;n++)l[n]=t$X.clone(t[n]);s.combinedLocalPositions=J$V.computeLocalPositions(l,o,a,e,!0,e.enuCenter)}return ae$w(s,o,a,e._vertexFormat)}},_$K.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._shape;for(o=a.length,t[i++]=o,r=0;r<o;++r,i+=o$1k.packedLength)o$1k.pack(a[r],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var L$Z=t$V.clone(t$V.UNIT_SPHERE),P$M={polylinePositions:void 0,shapePositions:void 0,ellipsoid:L$Z,height:void 0,cornerType:void 0,granularity:void 0};_$K.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n=e[t++],o=new Array(n);for(r=0;r<n;++r,t+=t$X.packedLength)o[r]=t$X.unpack(e,t);n=e[t++];var a=new Array(n);for(r=0;r<n;++r,t+=o$1k.packedLength)a[r]=o$1k.unpack(e,t);var s=t$V.unpack(e,t,L$Z);t+=t$V.packedLength;var l=e[t++],u=e[t];return e$28(i)?(i._positions=o,i._shape=a,i._ellipsoid=t$V.clone(s,i._ellipsoid),i._cornerType=l,i._granularity=u,i):(P$M.polylinePositions=o,P$M.shapePositions=a,P$M.cornerType=l,P$M.granularity=u,new _$K(P$M))};var V$G=new f$10;_$K.createGeometry=function(e){var t=D$Z(e._positions,t$X.equalsEpsilon),i=e._shape;if(i=J$V.removeDuplicatesFromShape(i),!(t.length<2||i.length<3)){A$1d.computeWindingOrder2D(i)===_0x4a48d8.CLOCKWISE&&i.reverse();var r=f$10.fromPoints(i,V$G);return U$P(J$V.computePositions(t,i,r,e,!1),i)}};var e$1l={TMERC:"tmerc",ALBERS:"aea",LCC:"lcc",UTM:"utm"},ProjectionName=Object.freeze(e$1l);function c$O(e){var t=e.points,i=e.times;return function(r,n){e$28(n)||(n=new n$14);var o=e._lastTimeIndex=e.findTimeInterval(r,e._lastTimeIndex),a=(r-i[o])/(i[o+1]-i[o]),s=t[o],l=t[o+1];return n$14.fastSlerp(s,l,a,n)}}function r$Q(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times;if(!e$28(t)||!e$28(i))throw new t$Z("points and times are required.");if(t.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new t$Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._evaluateFunction=c$O(this),this._lastTimeIndex=0}function B$C(e,t){if(!(this instanceof B$C))return new B$C(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function w$z(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function u$G(e,t){x$U(e,0,e.children.length,t,e)}function x$U(e,t,i,r,n){n||(n=m$O(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o,a=t;a<i;a++)o=e.children[a],p$R(n,e.leaf?r(o):o);return n}function p$R(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function g$H(e,t){return e.minX-t.minX}function v$E(e,t){return e.minY-t.minY}function X$E(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d$X(e){return e.maxX-e.minX+(e.maxY-e.minY)}function S$G(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function A$W(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,o-r)}function Y$C(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function M$P(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m$O(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y$L(e,t,i,r,n){for(var o,a=[t,i];a.length;)!((i=a.pop())-(t=a.pop())<=r)&&(s$O(e,o=t+Math.ceil((i-t)/r/2)*r,t,i,n),a.push(t,o,o,i))}function r$P(){this._tree=B$C()}function n$N(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function d$W(e,t){return e.id===t.id}Object.defineProperties(r$Q.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),r$Q.prototype.findTimeInterval=n$_.prototype.findTimeInterval,r$Q.prototype.wrapTime=n$_.prototype.wrapTime,r$Q.prototype.clampTime=n$_.prototype.clampTime,r$Q.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},B$C.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!M$P(e,t))return i;for(var n,o,a,s,l=[];t;){for(n=0,o=t.children.length;n<o;n++)a=t.children[n],M$P(e,s=t.leaf?r(a):a)&&(t.leaf?i.push(a):Y$C(e,s)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!M$P(e,t))return!1;for(var r,n,o,a,s=[];t;){for(r=0,n=t.children.length;r<n;r++)if(o=t.children[r],M$P(e,a=t.leaf?i(o):o)){if(t.leaf||Y$C(e,a))return!0;s.push(o)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=m$O([]),this},remove:function(e,t){if(!e)return this;for(var i,r,n,o,a=this.data,s=this.toBBox(e),l=[],u=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=u.pop(),o=!0),a.leaf&&-1!==(n=w$z(e,a.children,t)))return a.children.splice(n,1),l.push(a),this._condense(l),this;o||a.leaf||!Y$C(a,s)?r?(i++,a=r.children[i],o=!1):a=null:(l.push(a),u.push(i),i=0,r=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:g$H,compareMinY:v$E,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var n,o=i-t+1,a=this._maxEntries;if(o<=a)return u$G(n=m$O(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(n=m$O([])).leaf=!1,n.height=r;var s,l,u,c,h=Math.ceil(o/a),d=h*Math.ceil(Math.sqrt(a));for(y$L(e,t,i,d,this.compareMinX),s=t;s<=i;s+=d)for(y$L(e,s,u=Math.min(s+d-1,i),h,this.compareMinY),l=s;l<=u;l+=h)c=Math.min(l+h-1,u),n.children.push(this._build(e,l,c,r-1));return u$G(n,this.toBBox),n},_chooseSubtree:function(e,t,i,r){for(var n,o,a,s,l,u,c,h;r.push(t),!t.leaf&&r.length-1!==i;){for(c=h=1/0,n=0,o=t.children.length;n<o;n++)l=X$E(a=t.children[n]),(u=S$G(e,a)-l)<h?(h=u,c=l<c?l:c,s=a):u===h&&l<c&&(c=l,s=a);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,n=i?e:r(e),o=[],a=this._chooseSubtree(n,this.data,t,o);for(a.children.push(e),p$R(a,n);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)},_split:function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),a=m$O(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,u$G(i,this.toBBox),u$G(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=m$O([e,t]),this.data.height=e.height+1,this.data.leaf=!1,u$G(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,n,o,a,s,l,u,c;for(l=u=1/0,r=t;r<=i-t;r++)a=A$W(n=x$U(e,0,r,this.toBBox),o=x$U(e,r,i,this.toBBox)),s=X$E(n)+X$E(o),a<l?(l=a,c=r,u=s<u?s:u):a===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:g$H,n=e.leaf?this.compareMinY:v$E;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var n,o,a=this.toBBox,s=x$U(e,0,t,a),l=x$U(e,i-t,i,a),u=d$X(s)+d$X(l);for(n=t;n<i-t;n++)o=e.children[n],p$R(s,e.leaf?a(o):o),u+=d$X(s);for(n=i-t-1;n>=t;n--)o=e.children[n],p$R(l,e.leaf?a(o):o),u+=d$X(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)p$R(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():u$G(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}},n$N.fromRectangleAndId=function(e,t,i){return i.minX=t.west,i.minY=t.south,i.maxX=t.east,i.maxY=t.north,i.id=e,i},r$P.prototype.insert=function(e,t){o$1u.typeOf.string("id",e),o$1u.typeOf.object("rectangle",t);var i=n$N.fromRectangleAndId(e,t,new n$N);this._tree.insert(i)};var h$K=new n$N;r$P.prototype.remove=function(e,t){o$1u.typeOf.string("id",e),o$1u.typeOf.object("rectangle",t);var i=n$N.fromRectangleAndId(e,t,h$K);this._tree.remove(i,d$W)};var m$N=new n$N;r$P.prototype.collides=function(e){o$1u.typeOf.object("rectangle",e);var t=n$N.fromRectangleAndId("",e,m$N);return this._tree.collides(t)};var k$Q=Math.cos,z$F=Math.sin,H$L=Math.sqrt,j$O={computePosition:function(e,t,i,r,n,o,a){var s=t.radiiSquared,l=e.nwCorner,u=e.boundingRectangle,c=l.latitude-e.granYCos*r+n*e.granXSin,h=k$Q(c),d=z$F(c),f=s.z*d,p=l.longitude+r*e.granYSin+n*e.granXCos,_=h*k$Q(p),m=h*z$F(p),$=s.x*_,g=s.y*m,v=H$L($*_+g*m+f*d);if(o.x=$/v,o.y=g/v,o.z=f/v,i){var y=e.stNwCorner;e$28(y)?(c=y.latitude-e.stGranYCos*r+n*e.stGranXSin,p=y.longitude+r*e.stGranYSin+n*e.stGranXCos,a.x=(p-e.stWest)*e.lonScalar,a.y=(c-e.stSouth)*e.latScalar):(a.x=(p-u.west)*e.lonScalar,a.y=(c-u.south)*e.latScalar)}}},J$R=new f$15,h$J=new t$X,K$H=new t$W,E$U=new t$X,q$S=new n$1b;function Z$Q(e,t,i,r,n,o,a){var s=Math.cos(t),l=r*s,u=i*s,c=Math.sin(t),h=r*c,d=i*c;h$J=q$S.project(e,h$J),h$J=t$X.subtract(h$J,E$U,h$J);var f=f$15.fromRotation(t,J$R);h$J=f$15.multiplyByVector(f,h$J,h$J),h$J=t$X.add(h$J,E$U,h$J),o-=1,a-=1;var p=(e=q$S.unproject(h$J,e)).latitude,_=p+o*d,m=p-l*a,$=p-l*a+o*d,g=Math.max(p,_,m,$),v=Math.min(p,_,m,$),y=e.longitude,x=y+o*u,b=y+a*h,w=y+a*h+o*u;return{north:g,south:v,east:Math.max(y,x,b,w),west:Math.min(y,x,b,w),granYCos:l,granYSin:h,granXCos:u,granXSin:d,nwCorner:e}}j$O.computeOptions=function(e,t,i,r,n,o,a){var s=e.east,l=e.west,u=e.north,c=e.south,h=!1,d=!1;u===e$27.PI_OVER_TWO&&(h=!0),c===-e$27.PI_OVER_TWO&&(d=!0);var f,p,_,m,$,g=u-c;_=($=l>s?e$27.TWO_PI-l+s:s-l)/((f=Math.ceil($/t)+1)-1),m=g/((p=Math.ceil(g/t)+1)-1);var v=h$10.northwest(e,o),y=h$10.center(e,K$H);(0!==i||0!==r)&&(y.longitude<v.longitude&&(y.longitude+=e$27.TWO_PI),E$U=q$S.project(y,E$U));var x=m,b=_,w=h$10.clone(e,n),C={granYCos:x,granYSin:0,granXCos:b,granXSin:0,nwCorner:v,boundingRectangle:w,width:f,height:p,northCap:h,southCap:d};if(0!==i){var T=Z$Q(v,i,_,m,y,f,p);if(u=T.north,c=T.south,s=T.east,l=T.west,u<-e$27.PI_OVER_TWO||u>e$27.PI_OVER_TWO||c<-e$27.PI_OVER_TWO||c>e$27.PI_OVER_TWO)throw new t$Z("Rotated rectangle is invalid. It crosses over either the north or south pole.");C.granYCos=T.granYCos,C.granYSin=T.granYSin,C.granXCos=T.granXCos,C.granXSin=T.granXSin,w.north=u,w.south=c,w.east=s,w.west=l}if(0!==r){i-=r;var S=h$10.northwest(w,a),E=Z$Q(S,i,_,m,y,f,p);C.stGranYCos=E.granYCos,C.stGranXCos=E.granXCos,C.stGranYSin=E.granYSin,C.stGranXSin=E.granXSin,C.stNwCorner=S,C.stWest=E.west,C.stSouth=E.south}return C};var Lt$6=new t$X,Bt$6=new t$X,Yt$4=new t$X,qt$5=new t$X,Xt$4=new h$10,ne$E=new o$1k,ie$x=new i$19,oe$t=new i$19;function Wt$6(e,t){var i=new I$1n({attributes:new a$_,primitiveType:W$_.TRIANGLES});return i.attributes.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function ue$s(e,t,i,r){var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=qt$5,c=Yt$4,h=Bt$6;if(t.normal||t.tangent||t.bitangent)for(var d=0;d<n;d+=3){var f=t$X.fromArray(e,d,Lt$6),p=l+1,_=l+2;h=i.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(t$X.cross(t$X.UNIT_Z,h,c),p$1a.multiplyByVector(r,c,c),t$X.normalize(c,c),t.bitangent&&t$X.normalize(t$X.cross(h,c,u),u)),t.normal&&(o[l]=h.x,o[p]=h.y,o[_]=h.z),t.tangent&&(a[l]=c.x,a[p]=c.y,a[_]=c.z),t.bitangent&&(s[l]=u.x,s[p]=u.y,s[_]=u.z),l+=3}return Wt$6(t,{positions:e,normals:o,tangents:a,bitangents:s})}var Tt$6=new t$X,jt$3=new t$X;function se$s(e,t,i){var r=e.length,n=t.normal?new Float32Array(r):void 0,o=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,h=qt$5,d=Yt$4,f=Bt$6;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<r;p+=6){var _=t$X.fromArray(e,p,Lt$6),m=t$X.fromArray(e,(p+6)%r,Tt$6);if(c){var $=t$X.fromArray(e,(p+3)%r,jt$3);t$X.subtract(m,_,m),t$X.subtract($,_,$),f=t$X.normalize(t$X.cross($,m,f),f),c=!1}t$X.equalsEpsilon(m,_,e$27.EPSILON10)&&(c=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(_,h),t.tangent&&(d=t$X.normalize(t$X.cross(h,f,d),d))),t.normal&&(n[s++]=f.x,n[s++]=f.y,n[s++]=f.z,n[s++]=f.x,n[s++]=f.y,n[s++]=f.z),t.tangent&&(o[l++]=d.x,o[l++]=d.y,o[l++]=d.z,o[l++]=d.x,o[l++]=d.y,o[l++]=d.z),t.bitangent&&(a[u++]=h.x,a[u++]=h.y,a[u++]=h.z,a[u++]=h.x,a[u++]=h.y,a[u++]=h.z)}return Wt$6(t,{positions:e,normals:n,tangents:o,bitangents:a})}function Jt$5(e,t){var i=e._vertexFormat,r=e._ellipsoid,n=t.height,o=t.width,a=t.northCap,s=t.southCap,l=0,u=n,c=n,h=0;a&&(l=1,c-=1,h+=1),s&&(u-=1,c-=1,h+=1),h+=o*c;for(var d=i.position?new Float64Array(3*h):void 0,f=i.st?new Float32Array(2*h):void 0,p=0,_=0,m=Lt$6,$=ne$E,g=Number.MAX_VALUE,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,x=-Number.MAX_VALUE,b=l;b<u;++b)for(var w=0;w<o;++w)j$O.computePosition(t,r,i.st,b,w,m,$),d[p++]=m.x,d[p++]=m.y,d[p++]=m.z,i.st&&(f[_++]=$.x,f[_++]=$.y,g=Math.min(g,$.x),v=Math.min(v,$.y),y=Math.max(y,$.x),x=Math.max(x,$.y));if(a&&(j$O.computePosition(t,r,i.st,0,0,m,$),d[p++]=m.x,d[p++]=m.y,d[p++]=m.z,i.st&&(f[_++]=$.x,f[_++]=$.y,g=$.x,v=$.y,y=$.x,x=$.y)),s&&(j$O.computePosition(t,r,i.st,n-1,0,m,$),d[p++]=m.x,d[p++]=m.y,d[p]=m.z,i.st&&(f[_++]=$.x,f[_]=$.y,g=Math.min(g,$.x),v=Math.min(v,$.y),y=Math.max(y,$.x),x=Math.max(x,$.y))),i.st&&(g<0||v<0||y>1||x>1))for(var C=0;C<f.length;C+=2)f[C]=(f[C]-g)/(y-g),f[C+1]=(f[C+1]-v)/(x-v);var T=ue$s(d,i,r,t.tangentRotationMatrix),S=6*(o-1)*(c-1);a&&(S+=3*(o-1)),s&&(S+=3*(o-1));var E,A=ce$v.createTypedArray(h,S),P=0,I=0;for(E=0;E<c-1;++E){for(var M=0;M<o-1;++M){var O=P,D=O+o,R=D+1,L=O+1;A[I++]=O,A[I++]=D,A[I++]=L,A[I++]=L,A[I++]=D,A[I++]=R,++P}++P}if(a||s){var B,N,F=h-1,z=h-1;if(a&&s&&(F=h-2),P=0,a)for(E=0;E<o-1;E++)N=(B=P)+1,A[I++]=F,A[I++]=B,A[I++]=N,++P;if(s)for(P=(c-1)*o,E=0;E<o-1;E++)N=(B=P)+1,A[I++]=B,A[I++]=z,A[I++]=N,++P}return T.indices=A,i.st&&(T.attributes.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:f})),T}function ct$9(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t]=n[i+2],e}function ht$8(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t]=r[i+1],e}var Ht$4=new n$10;function fe$q(e,t){var i,r=e._shadowVolume,n=e._offsetAttribute,o=e._vertexFormat,a=e._extrudedHeight,s=e._surfaceHeight,l=e._ellipsoid,u=t.height,c=t.width;if(r){var h=n$10.clone(o,Ht$4);h.normal=!0,e._vertexFormat=h}var d=Jt$5(e,t);r&&(e._vertexFormat=o);var f=A$1d.scaleToGeodeticHeight(d.attributes.position.values,s,l,!1),p=(f=new Float64Array(f)).length,_=2*p,m=new Float64Array(_);m.set(f);var $=A$1d.scaleToGeodeticHeight(d.attributes.position.values,a,l);m.set($,p),d.attributes.position.values=m;var g,v,y=o.normal?new Float32Array(_):void 0,x=o.tangent?new Float32Array(_):void 0,b=o.bitangent?new Float32Array(_):void 0,w=o.st?new Float32Array(_/3*2):void 0;if(o.normal){for(v=d.attributes.normal.values,y.set(v),i=0;i<p;i++)v[i]=-v[i];y.set(v,p),d.attributes.normal.values=y}if(r){v=d.attributes.normal.values,o.normal||(d.attributes.normal=void 0);var C=new Float32Array(_);for(i=0;i<p;i++)v[i]=-v[i];C.set(v,p),d.attributes.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:C})}var T=e$28(n);if(T){var S=p/3*2,E=new Uint8Array(S);n===ee$C.TOP?E=d$1a(E,1,0,S/2):E=d$1a(E,n===ee$C.NONE?0:1),d.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}if(o.tangent){var A=d.attributes.tangent.values;for(x.set(A),i=0;i<p;i++)A[i]=-A[i];x.set(A,p),d.attributes.tangent.values=x}if(o.bitangent){var P=d.attributes.bitangent.values;b.set(P),b.set(P,p),d.attributes.bitangent.values=b}o.st&&(g=d.attributes.st.values,w.set(g),w.set(g,p/3*2),d.attributes.st.values=w);var I=d.indices,M=I.length,O=p/3,D=ce$v.createTypedArray(_/3,2*M);for(D.set(I),i=0;i<M;i+=3)D[i+M]=I[i+2]+O,D[i+1+M]=I[i+1]+O,D[i+2+M]=I[i]+O;d.indices=D;var R=t.northCap,L=t.southCap,B=u,N=2,F=0,z=4,k=4;R&&(N-=1,B-=1,F+=1,z-=2,k-=1),L&&(N-=1,B-=1,F+=1,z-=2,k-=1);var V=2*((F+=N*c+2*B-z)+k),U=new Float64Array(3*V),X=r?new Float32Array(3*V):void 0,H=T?new Uint8Array(V):void 0,G=o.st?new Float32Array(2*V):void 0,W=n===ee$C.TOP;T&&!W&&(H=d$1a(H,n===ee$C.ALL?1:0));var Y,q=0,j=0,Z=0,K=0,Q=c*B;for(i=0;i<Q;i+=c)U=ct$9(U,q,Y=3*i,f,$),q+=6,o.st&&(G=ht$8(G,j,2*i,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1);if(L){var J=R?Q+1:Q;for(Y=3*J,i=0;i<2;i++)U=ct$9(U,q,Y,f,$),q+=6,o.st&&(G=ht$8(G,j,2*J,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1)}else for(i=Q-c;i<Q;i++)U=ct$9(U,q,Y=3*i,f,$),q+=6,o.st&&(G=ht$8(G,j,2*i,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1);for(i=Q-1;i>0;i-=c)U=ct$9(U,q,Y=3*i,f,$),q+=6,o.st&&(G=ht$8(G,j,2*i,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1);if(R){var ee=Q;for(Y=3*ee,i=0;i<2;i++)U=ct$9(U,q,Y,f,$),q+=6,o.st&&(G=ht$8(G,j,2*ee,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1)}else for(i=c-1;i>=0;i--)U=ct$9(U,q,Y=3*i,f,$),q+=6,o.st&&(G=ht$8(G,j,2*i,g),j+=4),r&&(Z+=3,X[Z++]=v[Y],X[Z++]=v[Y+1],X[Z++]=v[Y+2]),W&&(H[K++]=1,K+=1);var te=se$s(U,o,l);o.st&&(te.attributes.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:G})),r&&(te.attributes.extrudeDirection=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:X})),T&&(te.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:H}));var ie,re,ne,oe,ae=ce$v.createTypedArray(V,6*F);p=U.length/3;var se=0;for(i=0;i<p-1;i+=2){oe=((ie=i)+2)%p;var le=t$X.fromArray(U,3*ie,Tt$6),ue=t$X.fromArray(U,3*oe,jt$3);t$X.equalsEpsilon(le,ue,e$27.EPSILON10)||(ne=((re=(ie+1)%p)+2)%p,ae[se++]=ie,ae[se++]=re,ae[se++]=oe,ae[se++]=oe,ae[se++]=re,ae[se++]=ne)}return te.indices=ae,(te=k$Z.combineInstances([new d$15({geometry:d}),new d$15({geometry:te})]))[0]}var ve$n=[new t$X,new t$X,new t$X,new t$X],Qt$3=new t$W,le$s=new t$W;function Ot$4(e,t,i,r,n){if(0===i)return h$10.clone(e,n);var o=j$O.computeOptions(e,t,i,0,Xt$4,Qt$3),a=o.height,s=o.width,l=ve$n;return j$O.computePosition(o,r,!1,0,0,l[0]),j$O.computePosition(o,r,!1,0,s-1,l[1]),j$O.computePosition(o,r,!1,a-1,0,l[2]),j$O.computePosition(o,r,!1,a-1,s-1,l[3]),h$10.fromCartesianArray(l,r,n)}function j$N(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).rectangle;if(o$1u.typeOf.object("rectangle",t),h$10.validate(t),t.north<t.south)throw new t$Z("options.rectangle.north must be greater than or equal to options.rectangle.south");var i=u$Y(e.height,0),r=u$Y(e.extrudedHeight,i);this._rectangle=h$10.clone(t),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._ellipsoid=t$V.clone(u$Y(e.ellipsoid,t$V.WGS84)),this._surfaceHeight=Math.max(i,r),this._rotation=u$Y(e.rotation,0),this._stRotation=u$Y(e.stRotation,0),this._vertexFormat=n$10.clone(u$Y(e.vertexFormat,n$10.DEFAULT)),this._extrudedHeight=Math.min(i,r),this._shadowVolume=u$Y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}j$N.packedLength=h$10.packedLength+t$V.packedLength+n$10.packedLength+7,j$N.pack=function(e,t,i){return o$1u.typeOf.object("value",e),o$1u.defined("array",t),i=u$Y(i,0),h$10.pack(e._rectangle,t,i),i+=h$10.packedLength,t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=u$Y(e._offsetAttribute,-1),t};var Zt$5=new h$10,Kt$5=t$V.clone(t$V.UNIT_SPHERE),tt$d={rectangle:Zt$5,ellipsoid:Kt$5,vertexFormat:Ht$4,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};j$N.unpack=function(e,t,i){o$1u.defined("array",e),t=u$Y(t,0);var r=h$10.unpack(e,t,Zt$5);t+=h$10.packedLength;var n=t$V.unpack(e,t,Kt$5);t+=t$V.packedLength;var o=n$10.unpack(e,t,Ht$4);t+=n$10.packedLength;var a=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=e[t];return e$28(i)?(i._rectangle=h$10.clone(r,i._rectangle),i._ellipsoid=t$V.clone(n,i._ellipsoid),i._vertexFormat=n$10.clone(o,i._vertexFormat),i._granularity=a,i._surfaceHeight=s,i._rotation=l,i._stRotation=u,i._extrudedHeight=c,i._shadowVolume=h,i._offsetAttribute=-1===d?void 0:d,i):(tt$d.granularity=a,tt$d.height=s,tt$d.rotation=l,tt$d.stRotation=u,tt$d.extrudedHeight=c,tt$d.shadowVolume=h,tt$d.offsetAttribute=-1===d?void 0:d,new j$N(tt$d))},j$N.computeRectangle=function(e,t){var i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).rectangle;if(o$1u.typeOf.object("rectangle",i),h$10.validate(i),i.north<i.south)throw new t$Z("options.rectangle.north must be greater than or equal to options.rectangle.south");var r=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),n=u$Y(e.ellipsoid,t$V.WGS84);return Ot$4(i,r,u$Y(e.rotation,0),n,t)};var ce$q=new p$1a,$t$5=new n$14,he$p=new t$W;j$N.createGeometry=function(e){if(!e$27.equalsEpsilon(e._rectangle.north,e._rectangle.south,e$27.EPSILON10)&&!e$27.equalsEpsilon(e._rectangle.east,e._rectangle.west,e$27.EPSILON10)){var t=e._rectangle,i=e._ellipsoid,r=e._rotation,n=e._stRotation,o=e._vertexFormat,a=j$O.computeOptions(t,e._granularity,r,n,Xt$4,Qt$3,le$s),s=ce$q;if(0!==n||0!==r){var l=h$10.center(t,he$p),u=i.geodeticSurfaceNormalCartographic(l,Tt$6);n$14.fromAxisAngle(u,-n,$t$5),p$1a.fromQuaternion($t$5,s)}else p$1a.clone(p$1a.IDENTITY,s);var c,h,d=e._surfaceHeight,f=e._extrudedHeight,p=!e$27.equalsEpsilon(d,f,0,e$27.EPSILON2);if(a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s,t=e._rectangle,p){c=fe$q(e,a);var _=i$19.fromRectangle3D(t,i,d,oe$t),m=i$19.fromRectangle3D(t,i,f,ie$x);h=i$19.union(_,m)}else{if((c=Jt$5(e,a)).attributes.position.values=A$1d.scaleToGeodeticHeight(c.attributes.position.values,d,i,!1),e$28(e._offsetAttribute)){var $=c.attributes.position.values.length,g=new Uint8Array($/3);d$1a(g,e._offsetAttribute===ee$C.NONE?0:1),c.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}h=i$19.fromRectangle3D(t,i,d)}return o.position||delete c.attributes.position,new I$1n({attributes:c.attributes,indices:c.indices,primitiveType:c.primitiveType,boundingSphere:h,offsetAttribute:e._offsetAttribute})}},j$N.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new j$N({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,vertexFormat:n$10.POSITION_ONLY,shadowVolume:!0})};var It$9=new h$10,de$q=[new o$1k,new o$1k,new o$1k],me$u=new f$15,ge$o=new t$W;function pe$v(e){if(0===e._stRotation)return[0,0,0,1,1,0];var t=h$10.clone(e._rectangle,It$9),i=e._granularity,r=e._ellipsoid,n=Ot$4(t,i,e._rotation-e._stRotation,r,It$9),o=de$q;o[0].x=n.west,o[0].y=n.south,o[1].x=n.west,o[1].y=n.north,o[2].x=n.east,o[2].y=n.south;for(var a=e.rectangle,s=f$15.fromRotation(e._stRotation,me$u),l=h$10.center(a,ge$o),u=0;u<3;++u){var c=o[u];c.x-=l.longitude,c.y-=l.latitude,f$15.multiplyByVector(s,c,c),c.x+=l.longitude,c.y+=l.latitude,c.x=(c.x-a.west)/a.width,c.y=(c.y-a.south)/a.height}var h=o[0],d=o[1],f=o[2],p=new Array(6);return o$1k.pack(h,p),o$1k.pack(d,p,2),o$1k.pack(f,p,4),p}Object.defineProperties(j$N.prototype,{rectangle:{get:function(){return e$28(this._rotatedRectangle)||(this._rotatedRectangle=Ot$4(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return e$28(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=pe$v(this)),this._textureCoordinateRotationPoints}}});var Q$N=new i$19,X$D=new i$19,Z$P=new t$X,$$M=new h$10;function Y$B(e,t){var i=e._ellipsoid,r=t.height,n=t.width,o=t.northCap,a=t.southCap,s=r,l=2,u=0,c=4;o&&(l-=1,s-=1,u+=1,c-=2),a&&(l-=1,s-=1,u+=1,c-=2),u+=l*n+2*s-c;var h,d=new Float64Array(3*u),f=0,p=0,_=Z$P;if(o)j$O.computePosition(t,i,!1,p,0,_),d[f++]=_.x,d[f++]=_.y,d[f++]=_.z;else for(h=0;h<n;h++)j$O.computePosition(t,i,!1,p,h,_),d[f++]=_.x,d[f++]=_.y,d[f++]=_.z;for(h=n-1,p=1;p<r;p++)j$O.computePosition(t,i,!1,p,h,_),d[f++]=_.x,d[f++]=_.y,d[f++]=_.z;if(p=r-1,!a)for(h=n-2;h>=0;h--)j$O.computePosition(t,i,!1,p,h,_),d[f++]=_.x,d[f++]=_.y,d[f++]=_.z;for(h=0,p=r-2;p>0;p--)j$O.computePosition(t,i,!1,p,h,_),d[f++]=_.x,d[f++]=_.y,d[f++]=_.z;for(var m=d.length/3*2,$=ce$v.createTypedArray(d.length/3,m),g=0,v=0;v<d.length/3-1;v++)$[g++]=v,$[g++]=v+1;$[g++]=d.length/3-1,$[g++]=0;var y=new I$1n({attributes:new a$_,primitiveType:W$_.LINES});return y.attributes.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:d}),y.indices=$,y}function G$V(e,t){var i=e._surfaceHeight,r=e._extrudedHeight,n=e._ellipsoid,o=r,a=i,s=Y$B(e,t),l=t.height,u=t.width,c=A$1d.scaleToGeodeticHeight(s.attributes.position.values,a,n,!1),h=c.length,d=new Float64Array(2*h);d.set(c);var f=A$1d.scaleToGeodeticHeight(s.attributes.position.values,o,n);d.set(f,h),s.attributes.position.values=d;var p=t.northCap,_=t.southCap,m=4;p&&(m-=1),_&&(m-=1);var $,g=2*(d.length/3+m),v=ce$v.createTypedArray(d.length/3,g);h=d.length/6;for(var y=0,x=0;x<h-1;x++)v[y++]=x,v[y++]=x+1,v[y++]=x+h,v[y++]=x+h+1;if(v[y++]=h-1,v[y++]=0,v[y++]=h+h-1,v[y++]=h,v[y++]=0,v[y++]=h,p)$=l-1;else{var b=u-1;v[y++]=b,v[y++]=b+h,$=u+l-2}if(v[y++]=$,v[y++]=$+h,!_){var w=u+$-1;v[y++]=w,v[y]=w+h}return s.indices=v,s}function k$P(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).rectangle,i=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),r=u$Y(e.ellipsoid,t$V.WGS84),n=u$Y(e.rotation,0);if(!e$28(t))throw new t$Z("rectangle is required.");if(h$10.validate(t),t.north<t.south)throw new t$Z("options.rectangle.north must be greater than options.rectangle.south");var o=u$Y(e.height,0),a=u$Y(e.extrudedHeight,o);this._rectangle=h$10.clone(t),this._granularity=i,this._ellipsoid=r,this._surfaceHeight=Math.max(o,a),this._rotation=n,this._extrudedHeight=Math.min(o,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}k$P.packedLength=h$10.packedLength+t$V.packedLength+5,k$P.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return i=u$Y(i,0),h$10.pack(e._rectangle,t,i),i+=h$10.packedLength,t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=u$Y(e._offsetAttribute,-1),t};var V$F=new h$10,J$Q=t$V.clone(t$V.UNIT_SPHERE),D$Q={rectangle:V$F,ellipsoid:J$Q,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};k$P.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r=h$10.unpack(e,t,V$F);t+=h$10.packedLength;var n=t$V.unpack(e,t,J$Q);t+=t$V.packedLength;var o=e[t++],a=e[t++],s=e[t++],l=e[t++],u=e[t];return e$28(i)?(i._rectangle=h$10.clone(r,i._rectangle),i._ellipsoid=t$V.clone(n,i._ellipsoid),i._surfaceHeight=a,i._rotation=s,i._extrudedHeight=l,i._offsetAttribute=-1===u?void 0:u,i):(D$Q.granularity=o,D$Q.height=a,D$Q.rotation=s,D$Q.extrudedHeight=l,D$Q.offsetAttribute=-1===u?void 0:u,new k$P(D$Q))};var I$12=new t$W;k$P.createGeometry=function(e){var t,i,r=e._rectangle,n=e._ellipsoid,o=j$O.computeOptions(r,e._granularity,e._rotation,0,$$M,I$12);if(!e$27.equalsEpsilon(r.north,r.south,e$27.EPSILON10)&&!e$27.equalsEpsilon(r.east,r.west,e$27.EPSILON10)){var a=e._surfaceHeight,s=e._extrudedHeight;if(!e$27.equalsEpsilon(a,s,0,e$27.EPSILON2)){if(t=G$V(e,o),e$28(e._offsetAttribute)){var l=t.attributes.position.values.length/3,u=new Uint8Array(l);e._offsetAttribute===ee$C.TOP?u=d$1a(u,1,0,l/2):u=d$1a(u,e._offsetAttribute===ee$C.NONE?0:1),t.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}var c=i$19.fromRectangle3D(r,n,a,X$D),h=i$19.fromRectangle3D(r,n,s,Q$N);i=i$19.union(c,h)}else{if((t=Y$B(e,o)).attributes.position.values=A$1d.scaleToGeodeticHeight(t.attributes.position.values,a,n,!1),e$28(e._offsetAttribute)){var d=t.attributes.position.values.length,f=new Uint8Array(d/3);d$1a(f,e._offsetAttribute===ee$C.NONE?0:1),t.attributes.applyOffset=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}i=i$19.fromRectangle3D(r,n,a)}return new I$1n({attributes:t.attributes,indices:t.indices,primitiveType:W$_.LINES,boundingSphere:i,offsetAttribute:e._offsetAttribute})}};var e$1k={FIXED:0,INERTIAL:1},Re$j=Object.freeze(e$1k),e$1j;function p$Q(e){return e$1j(e)}function y$K(e,t,i){return o$1u.typeOf.object("terrainProvider",e),o$1u.typeOf.number("level",t),o$1u.defined("positions",i),e.readyPromise.then((function(){return b$T(e,t,i)}))}function b$T(e,t,i){var r,n=e.tilingScheme,o=[],a={};for(r=0;r<i.length;++r){var s=n.positionToTileXY(i[r],t),l=s.toString();if(!a.hasOwnProperty(l)){var u={x:s.x,y:s.y,level:t,tilingScheme:n,terrainProvider:e,positions:[]};a[l]=u,o.push(u)}a[l].positions.push(i[r])}var c=[];for(r=0;r<o.length;++r){var h=o[r],d=new r$1c({throttle:!1,throttleByServer:!1,type:$$13.TERRAIN}),f=h.terrainProvider.requestTileGeometry(h.x,h.y,h.level,d,!0).then(w$y(h,e)).otherwise(x$T(h));c.push(f)}return o$1q.all(c,(function(){return i}))}function w$y(e,t){var i=e.positions,r=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){if(t._isSct&&t._isTerrainZ)for(var n=nt$c.inflate(e.buffer).buffer,o=t.createTerrainData(e,n),a=0;a<i.length;++a){(s=i[a]).height=o.interpolateHeight(r,s.longitude,s.latitude)}else for(a=0;a<i.length;++a){var s;(s=i[a]).height=e.interpolateHeight(r,s.longitude,s.latitude)}}}function x$T(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){t[e].height=void 0}}}typeof requestAnimationFrame<"u"&&(e$1j=requestAnimationFrame),function(){if(!e$28(e$1j)&&typeof window<"u")for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!e$28(e$1j);)e$1j=window[e[t]+"RequestAnimationFrame"],++t;if(!e$28(e$1j)){var r=0;e$1j=function(e){var t=kt$7(),i=Math.max(16.666666666666668-(t-r),0);return r=t+i,setTimeout((function(){e(r)}),i)}}}();var o$W=new o$1k;function y$J(e,t){if(!e$28(e))throw new t$Z("terrainProvider is required.");if(!e$28(t))throw new t$Z("positions is required.");return e.readyPromise.then((function(){var i=[],r=[],n=e.availability;if(!e$28(n)&&!e._isSct)throw new t$Z("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");for(var o=[],a=0;a<t.length;++a){var s=t[a],l=e$28(n)?n.computeMaximumLevelAtPosition(s):e._levels[e._levels.length-1];if(r[a]=l,0===l){e.tilingScheme.positionToTileXY(s,1,o$W);var u=e.loadTileDataAvailability(o$W.x,o$W.y,1);e$28(u)&&o.push(u)}var c=i[l];e$28(c)||(i[l]=c=[]),c.push(s)}return o$1q.all(o).then((function(){return o$1q.all(i.map((function(t,i){if(e$28(t))return y$K(e,i,t)})))})).then((function(){for(var i=[],o=0;o<t.length;++o){var a=t[o];(e$28(n)?n.computeMaximumLevelAtPosition(a):e._levels[e._levels.length-1])!==r[o]&&i.push(a)}if(i.length>0)return y$J(e,i)})).then((function(){return t}))}))}var E$T={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},J$P=Object.freeze(E$T);function w$x(e,t,i){let r=e._element,n=r.offsetWidth/r.getBoundingClientRect().width,o=r.offsetHeight/r.getBoundingClientRect().height;if(r===document)return i.x=t.clientX*n,i.y=t.clientY*o,i;var a=r.getBoundingClientRect();return i.x=(t.clientX-a.left)*n,i.y=(t.clientY-a.top)*o,i}function R$I(e,t){var i=e;return e$28(t)&&(i+="+"+t),i}function y$I(e){return e.shiftKey?Na$2.SHIFT:e.ctrlKey?Na$2.CTRL:e.altKey?Na$2.ALT:void 0}var l$S={LEFT:0,MIDDLE:1,RIGHT:2};function T$H(e,t,i,r){function n(t){r(e,t)}i.addEventListener(t,n,!1),e._removalFunctions.push((function(){i.removeEventListener(t,n,!1)}))}function ho$1(e){var t=e._element,i=e$28(t.disableRootEvents)?t:document;s$V.supportsPointerEvents()?(T$H(e,"pointerdown",t,go$1),T$H(e,"pointerup",t,W$J),T$H(e,"pointermove",t,ao),T$H(e,"pointercancel",t,W$J)):(T$H(e,"mousedown",t,j$M),T$H(e,"mouseup",i,K$G),T$H(e,"mousemove",i,Q$M),T$H(e,"touchstart",t,To$1),T$H(e,"touchend",i,$$L),T$H(e,"touchmove",i,Po$1),T$H(e,"touchcancel",i,$$L)),T$H(e,"dblclick",t,lo),T$H(e,"onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",t,mo$1)}function _o$1(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}var Y$A={position:new o$1k};function O$C(e){e._lastSeenTouchEvent=kt$7()}function k$O(e){return kt$7()-e._lastSeenTouchEvent>g$G.mouseEmulationIgnoreMilliseconds}function d$V(e,t,i){var r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)<i}function j$M(e,t){if(k$O(e)){var i,r=t.button;if(e._buttonDown[r]=!0,r===l$S.LEFT)i=J$P.LEFT_DOWN;else if(r===l$S.MIDDLE)i=J$P.MIDDLE_DOWN;else{if(r!==l$S.RIGHT)return;i=J$P.RIGHT_DOWN}var n=w$x(e,t,e._primaryPosition);o$1k.clone(n,e._primaryStartPosition),o$1k.clone(n,e._primaryPreviousPosition);var o=y$I(t),a=e.getInputAction(i,o);e$28(a)&&(o$1k.clone(n,Y$A.position),a(Y$A),t.preventDefault())}}var z$E={position:new o$1k},J$O={position:new o$1k};function G$U(e,t,i,r){var n=y$I(r),o=e.getInputAction(t,n),a=e.getInputAction(i,n);if(e$28(o)||e$28(a)){var s=w$x(e,r,e._primaryPosition);if(e$28(o)&&(o$1k.clone(s,z$E.position),o(z$E)),e$28(a))d$V(e._primaryStartPosition,s,e._clickPixelTolerance)&&(o$1k.clone(s,J$O.position),a(J$O))}}function K$G(e,t){if(k$O(e)){var i=t.button;i!==l$S.LEFT&&i!==l$S.MIDDLE&&i!==l$S.RIGHT||(e._buttonDown[l$S.LEFT]&&(G$U(e,J$P.LEFT_UP,J$P.LEFT_CLICK,t),e._buttonDown[l$S.LEFT]=!1),e._buttonDown[l$S.MIDDLE]&&(G$U(e,J$P.MIDDLE_UP,J$P.MIDDLE_CLICK,t),e._buttonDown[l$S.MIDDLE]=!1),e._buttonDown[l$S.RIGHT]&&(G$U(e,J$P.RIGHT_UP,J$P.RIGHT_CLICK,t),e._buttonDown[l$S.RIGHT]=!1))}}var U$O={startPosition:new o$1k,endPosition:new o$1k};function Q$M(e,t){if(k$O(e)){var i=y$I(t),r=w$x(e,t,e._primaryPosition),n=e._primaryPreviousPosition,o=e.getInputAction(J$P.MOUSE_MOVE,i);e$28(o)&&(o$1k.clone(n,U$O.startPosition),o$1k.clone(r,U$O.endPosition),o(U$O,t)),o$1k.clone(r,n),(e._buttonDown[l$S.LEFT]||e._buttonDown[l$S.MIDDLE]||e._buttonDown[l$S.RIGHT])&&t.preventDefault()}}var Z$O={position:new o$1k};function lo(e,t){var i;if(t.button===l$S.LEFT){i=J$P.LEFT_DOUBLE_CLICK;var r=y$I(t),n=e.getInputAction(i,r);e$28(n)&&(w$x(e,t,Z$O.position),n(Z$O))}}function mo$1(e,t){var i;if(e$28(t.deltaY)){var r=t.deltaMode;i=r===t.DOM_DELTA_PIXEL?-t.deltaY:r===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?-120*t.detail:t.wheelDelta;if(e$28(i)){var n=y$I(t),o=e.getInputAction(J$P.WHEEL,n);e$28(o)&&(o(i),t.preventDefault())}}function To$1(e,t){O$C(e);var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;i<a;++i)n=(r=o[i]).identifier,s.set(n,w$x(e,r,new o$1k));p$P(e,t);var l=e._previousPositions;for(i=0;i<a;++i)n=(r=o[i]).identifier,l.set(n,o$1k.clone(s.get(n)))}function $$L(e,t){O$C(e);var i,r,n=t.changedTouches,o=n.length,a=e._positions;for(i=0;i<o;++i)r=n[i].identifier,a.remove(r);p$P(e,t);var s=e._previousPositions;for(i=0;i<o;++i)r=n[i].identifier,s.remove(r)}var X$C={position:new o$1k},N$F={position1:new o$1k,position2:new o$1k},e$1i={position:new o$1k},E$S={position:new o$1k},H$K={position:new o$1k};function p$P(e,t){var i,r,n=y$I(t),o=e._positions,a=o.length,s=e._isPinching;if(1!==a&&e._buttonDown[l$S.LEFT]){if(e._buttonDown[l$S.LEFT]=!1,e$28(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),e$28(i=e.getInputAction(J$P.LEFT_UP,n))&&(o$1k.clone(e._primaryPosition,e$1i.position),i(e$1i)),0===a&&!e._isTouchHolding&&e$28(r=e.getInputAction(J$P.LEFT_CLICK,n)))d$V(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(o$1k.clone(e._primaryPosition,E$S.position),r(E$S));e._isTouchHolding=!1}if(0===a&&s&&(e._isPinching=!1,e$28(i=e.getInputAction(J$P.PINCH_END,n))&&i()),1===a&&!s){var l=o.values[0];o$1k.clone(l,e._primaryPosition),o$1k.clone(l,e._primaryStartPosition),o$1k.clone(l,e._primaryPreviousPosition),e._buttonDown[l$S.LEFT]=!0,e$28(i=e.getInputAction(J$P.LEFT_DOWN,n))&&(o$1k.clone(l,X$C.position),i(X$C)),e._touchHoldTimer=setTimeout((function(){!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,e$28(r=e.getInputAction(J$P.RIGHT_CLICK,n)))&&(d$V(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(o$1k.clone(e._primaryPosition,H$K.position),r(H$K)))}),g$G.touchHoldDelayMilliseconds),t.preventDefault()}2===a&&!s&&(e._isPinching=!0,e$28(i=e.getInputAction(J$P.PINCH_START,n))&&(o$1k.clone(o.values[0],N$F.position1),o$1k.clone(o.values[1],N$F.position2),i(N$F),t.preventDefault()))}function Po$1(e,t){O$C(e);var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;i<a;++i){n=(r=o[i]).identifier;var l=s.get(n);e$28(l)&&w$x(e,r,l)}S$F(e,t);var u=e._previousPositions;for(i=0;i<a;++i)n=(r=o[i]).identifier,o$1k.clone(s.get(n),u.get(n))}var c$N={startPosition:new o$1k,endPosition:new o$1k},L$Y={distance:{startPosition:new o$1k,endPosition:new o$1k},angleAndHeight:{startPosition:new o$1k,endPosition:new o$1k}};function S$F(e,t){var i,r=y$I(t),n=e._positions,o=e._previousPositions,a=n.length;if(1===a&&e._buttonDown[l$S.LEFT]){var s=n.values[0];o$1k.clone(s,e._primaryPosition);var l=e._primaryPreviousPosition;e$28(i=e.getInputAction(J$P.MOUSE_MOVE,r))&&(o$1k.clone(l,c$N.startPosition),o$1k.clone(s,c$N.endPosition),i(c$N,t)),o$1k.clone(s,l),t.preventDefault()}else if(2===a&&e._isPinching&&e$28(i=e.getInputAction(J$P.PINCH_MOVE,r))){var u=n.values[0],c=n.values[1],h=o.values[0],d=o.values[1],f=c.x-u.x,p=c.y-u.y,_=.25*Math.sqrt(f*f+p*p),m=d.x-h.x,$=d.y-h.y,g=.25*Math.sqrt(m*m+$*$),v=.125*(c.y+u.y),y=.125*(d.y+h.y),x=Math.atan2(p,f),b=Math.atan2($,m);o$1k.fromElements(0,g,L$Y.distance.startPosition),o$1k.fromElements(0,_,L$Y.distance.endPosition),o$1k.fromElements(b,y,L$Y.angleAndHeight.startPosition),o$1k.fromElements(x,v,L$Y.angleAndHeight.endPosition),i(L$Y)}}function go$1(e,t){if(t.target.setPointerCapture(t.pointerId),"touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.set(r,w$x(e,t,new o$1k)),p$P(e,t),e._previousPositions.set(r,o$1k.clone(i.get(r)))}else j$M(e,t)}function W$J(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),p$P(e,t),e._previousPositions.remove(r)}else K$G(e,t)}function ao(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId,n=i.get(r);if(!e$28(n))return;w$x(e,t,n),S$F(e,t);var o=e._previousPositions;o$1k.clone(i.get(r),o.get(r))}else Q$M(e,t)}function g$G(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-g$G.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new o$1k,this._primaryPosition=new o$1k,this._primaryPreviousPosition=new o$1k,this._positions=new e$1P,this._previousPositions=new e$1P,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=u$Y(e,document),ho$1(this)}function se$r(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).urls))throw new t$Z("options.urls is required.");this._urls=e.urls;for(var t=0;t<this._urls.length;t++)this._urls[t].length>0&&"/"!==this._urls[t][this._urls[t].length-1]&&(this._urls[t]+="/");var i=e.urls[0].indexOf("wmts100");this._useConfigFile=u$Y(e.useConfigFile,!0),this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer(),this._isCreateSkirt=e.isCreateSkirt,this._skirtScale=e.skirtScale,this._isSkirtDirty=!1,this._proxy=e.proxy,this._terrainDataStructure={heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1};var r=e.credit;"string"==typeof r&&(r=new r$1a({text:r})),this._credit=r,this._tilingScheme=void 0,this._rectangles=[],this._levels=[],this._compressType="NONE",this._quadtree=void 0,this._packingRequest=e.packingRequest,this._combiInfo={},this._isBlock=!1,this._blockCache={},this._blockCacheQueue=new r$$,this._blockCacheSize=100,this._blockScale=0;var n,o=this,a=u$Y(e.ellipsoid,t$V.WGS84);this._hasNormalBuffer=!1,this._requestVertexNormals=u$Y(e.requestVertexNormals,!1);var s=0;function l(e){if(1===parseFloat(e.getElementsByTagName("sml:Version")[0].textContent)){var t=e.getElementsByTagName("sml:StoreType",void 0);o._blockScale=t[0].getAttribute("BlockScale"),e$28(o._blockScale)&&o._blockScale>0&&(o._isBlock=!0)}o._compressType=e.getElementsByTagName("sml:CompressType")[0].textContent,o._heightmapWidth=parseInt(e.getElementsByTagName("sml:CellWidth")[0].textContent),o._heightmapHeight=parseInt(e.getElementsByTagName("sml:CellHeight")[0].textContent),o._tilingScheme=new g$14({ellipsoid:a}),o._tilingScheme.isSct=!0,o._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,2*Math.min(o._heightmapWidth,o._heightmapHeight),o._tilingScheme.getNumberOfXTilesAtLevel(0));var i=e.getElementsByTagName("sml:Bounds")[0],r=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Left")[0].textContent)),n=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Bottom")[0].textContent)),u=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Right")[0].textContent)),h=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Top")[0].textContent));o._rectangles.push(new h$10(r,n,u,h));for(var d=e.getElementsByTagName("sml:Levels")[0].getElementsByTagName("sml:Level"),f=[],p=0;p<d.length;++p){var _=d[p];f.push(parseInt(_.textContent))}if(o._levels.push(f),o._ready=!0,o._readyPromise.resolve(!0),s<o._urls.length){var m=o._urls[s++],$=m.substring(0,m.length-1),g=m+"config";e$28(a$Y.CREDENTIAL)&&(g=e$28(a$Y.CREDENTIAL._keymap[$])?a$Y.addTokenWithKey($,g):a$Y.addToken(g)),o$1q(d$17(g),l,c)}}function u(t){var i=(new s$P).read(t).documentElement,r=s$P.queryFirstNode(i,"Contents",void 0),n=s$P.queryFirstNode(r,"Layer",void 0);o._tempLayerName=s$P.queryStringValue(n,"Title",void 0);var h=s$P.queryFirstNode(r,"TileMatrixSet",void 0);o._wmtstileMatrixSet=s$P.queryStringValue(h,"Identifier",void 0);var d=s$P.queryFirstNode(n,"BoundingBox",void 0),f=s$P.queryStringValue(d,"LowerCorner",void 0),p=s$P.queryStringValue(d,"UpperCorner",void 0),_=f.split(" "),m=p.split(" "),$=parseFloat(_[0]),g=parseFloat(m[0]),v=parseFloat(_[1]),y=parseFloat(m[1]);$&&g&&v&&y&&o._rectangles.push(new h$10($,v,g,y));var x=s$P.queryFirstNode(r,"TileMatrixSet",void 0),b=(h=s$P.queryChildNodes(x,"TileMatrix",void 0),s$P.queryNumericValue(h[0],"ScaleDenominator",void 0)),w=s$P.queryNumericValue(h[h.length-1],"ScaleDenominator",void 0),C=s$P.queryNumericValue(h[0],"Identifier",void 0);b=1/b,w=1/w;var T=[1.690163571602655e-9,3.3803271432053056e-9,6.760654286410611e-9,1.3521308572821242e-8,2.7042617145642484e-8,5.408523429128511e-8,1.0817046858256998e-7,2.1634093716513974e-7,4.3268187433028044e-7,8.653637486605571e-7,17307274973211203e-22,34614549946422405e-22,69229099892844565e-22,13845819978568952e-21,27691639957137904e-21,553832799142758e-19,.0001107665598285516,.0002215331196571032,.0004430662393142064,.0008861324786284128,.001772264957256826,.003544529914513652],S=T.indexOf(b),E=T.indexOf(w);for(let e=0;e<T.length;e++)b>T[e]&&T[e+1]&&b<T[e+1]&&(S=e-1),w>T[e]&&T[e+1]&&w<T[e+1]&&(E=e-1);S=Math.max(S,0),o.wmts_sub=u$Y(S-C,0);for(var A=[],P=S;P<=E;P++)A.push(P);if(o._levels.push(A),e.blockscale>0&&(o._blockScale=1*e.blockscale,o._isBlock=!0),o._compressType="ZIP",o._heightmapWidth=e.cellWidth||32,o._heightmapHeight=e.cellHeight||32,o._tilingScheme=new g$14({ellipsoid:a}),o._tilingScheme.isSct=!0,o._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,2*Math.min(o._heightmapWidth,o._heightmapHeight),o._tilingScheme.getNumberOfXTilesAtLevel(0)),o._ready=!0,o._readyPromise.resolve(!0),s<o._urls.length){var I=o._urls[s++];if(-1!==I.indexOf("wmts100")){o$1q(u$P(O=I+"1.0.0/WMTSCapabilities.xml"),u,c)}else{var M=I.substring(0,I.length-1),O=I+"config";e$28(a$Y.CREDENTIAL)&&(O=e$28(a$Y.CREDENTIAL._keymap[M])?a$Y.addTokenWithKey(M,O):a$Y.addToken(O)),o$1q(d$17(O),l,c)}}}function c(e){var t=u$Y(e,"An error occurred while accessing "+o._url+".");n=l$13.handleError(n,o,o._errorEvent,t,void 0,void 0,void 0,h)}function h(){if(!e$28(e.rectangles)||!e$28(e.levels))throw new t$Z("options.rectangles,options.levels is required.");o._compressType=u$Y(e.compressType,"ZIP"),o._heightmapWidth=u$Y(e.heightmapWidth,32),o._heightmapHeight=u$Y(e.heightmapHeight,32),o._tilingScheme=new g$14({ellipsoid:a}),o._tilingScheme.isSct=!0,o._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,Math.min(o._heightmapWidth,o._heightmapHeight),o._tilingScheme.getNumberOfXTilesAtLevel(0)),o._rectangles=e.rectangles,o._levels=e.levels,o._ready=!0,o._readyPromise.resolve(!0)}this._useConfigFile?function(){if(-1!==i){o$1q(u$P(r=(e=o._urls[s++])+"1.0.0/WMTSCapabilities.xml"),u,c)}else{var e,t=(e=o._urls[s++]).substring(0,e.length-1),r=e+"config";e$28(a$Y.CREDENTIAL)&&(r=e$28(a$Y.CREDENTIAL._keymap[t])?a$Y.addTokenWithKey(t,r):a$Y.addToken(r)),o$1q(d$17(r),l,c)}}():h()}function qe$d(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function Me$n(e,t){var i=new DataView(e),r=0,n=i.getUint32(r,!0);if(t>n-1)throw new t$Z("pack imagery index invalid");r+=4;var o,a,s=[];for(o=0;o<n;o++)a=i.getUint32(r,!0),s.push(a),r+=4;for(o=0;o<n;o++){if(a=s[o],o===t)return 0===a?void 0:new Uint8Array(e,r,a);r+=a}}function Re$i(e,t,i,r){var n=Math.min(e._blockScale,r),o=Math.pow(2,n),a=t%o;return{x:Math.floor(t/o),y:Math.floor(i/o),col:a,row:i%o,level:r,blockSize:o}}function We$h(e,t){var i=new DataView(e),r=0;i.getUint32(r,!0),r+=4;var n=i.getUint32(r,!0);r+=4;for(var o=t.col,a=t.row*t.blockSize+o,s=0,l=0,u=0;u<n;u++){if(u<a)s+=i.getUint32(r,!0);else if(u===a){l=i.getUint32(r,!0),r+=4;break}r+=4}if(r=8+4*n,0!==l)return r+=s,new Uint8Array(e).slice(r,r+l).buffer}g$G.prototype.setInputAction=function(e,t,i){if(!e$28(e))throw new t$Z("action is required.");if(!e$28(t))throw new t$Z("type is required.");var r=R$I(t,i);this._inputEvents[r]=e},g$G.prototype.getInputAction=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=R$I(e,t);return this._inputEvents[i]},g$G.prototype.removeInputAction=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=R$I(e,t);delete this._inputEvents[i]},g$G.prototype.registerListenersForWindowTop=function(){var e=window.top,t=e$28(e.disableRootEvents)?e:document;s$V.supportsPointerEvents()?T$H(this,"pointerup",e,W$J):T$H(this,"mouseup",t,K$G)},g$G.prototype.isDestroyed=function(){return!1},g$G.prototype.destroy=function(){return _o$1(this),i$Z(this)},g$G.mouseEmulationIgnoreMilliseconds=800,g$G.touchHoldDelayMilliseconds=1500,Object.defineProperties(se$r.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},isCreateSkirt:{get:function(){return this._isCreateSkirt},set:function(e){e!==this._isCreateSkirt&&(this._isSkirtDirty=!0),this._isCreateSkirt=e}},skirtScale:{get:function(){return this._skirtScale},set:function(e){e!==this._skirtScale&&(this._isSkirtDirty=!0),this._skirtScale=e}},hasNormalBuffer:{get:function(){return this._hasNormalBuffer}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},blockCache:{get:function(){return this._blockCache}},blockCacheQueue:{get:function(){return this._blockCacheQueue}},blockCacheSize:{get:function(){return this._blockCacheSize}}}),se$r.prototype.division=function(e,t,i,r,n){for(var o=[],a=0;a<n;a++)for(var s=0;s<n;s++){var l=(i+r*(n-1-a)/(n-1))*(n-1),u=(t+r*s/(n-1))*(n-1),c=Math.floor(l),h=Math.ceil(l),d=Math.floor(u),f=Math.ceil(u),p=e[(n-1-c)*n+d],_=e[(n-1-c)*n+f],m=e[(n-1-h)*n+d],$=e[(n-1-h)*n+f],g=m*(l-c)+p*(h-l),v=$*(l-c)+_*(h-l);c===h&&(g=m,v=$);var y=v*(u-d)+g*(f-u);d===f&&(y=v),o[a*n+s]=y}return o};var ue$r=new h$10;function Qe$b(e,t,i,r,n){if(null!=e){for(var o=new Uint8Array(t*i*3),a=6378137,s=r.width,l=r.height,u=e,c=0;c<t;c++)for(var h=0;h<i;h++){var d=h*t+c;u[h*t+c];var f=c,p=h;n>13&&(c=(c=0==c?c+1:c)==t-1?t-2:c,h=(h=0==h?h+1:h)==i-1?i-2:h);var _=Math.max(c-1,0),m=h,$=u[m*t+_],g=u[(m=h)*t+(_=Math.min(c+1,t-1))];_=c;var v=u[(m=Math.min(h+1,i-1))*t+_];_=c;var y=u[(m=Math.max(h-1,0))*t+_];c=f,h=p;var x=r.south+l*(512-2*h-1)/512,b=new t$X(($-g)/(a*Math.cos(x)*s/t),(y-v)/(a*l/i),2);t$X.normalize(b,b),o[3*d+0]=255*(.5*b.x+.5),o[3*d+1]=255*(.5*b.y+.5),o[3*d+2]=255*(.5*b.z+.5)}return o}}se$r.prototype.requestTileGeometry=function(e,t,i,r,n){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");if(0===i){var o=new Array(this._heightmapWidth*this._heightmapHeight);return o.fill(0),this._hasNormalBuffer=!1,new T$S({buffer:o,width:this._heightmapWidth,height:this._heightmapHeight,skirtMode:this._isCreateSkirt,skirtScale:this._skirtScale,childTileMask:Ie$m(this,e,t,i),structure:this._terrainDataStructure,valid:!1})}var a=[],s=this._tilingScheme.tileXYToRectangle(e,t,i),l=this,u=!1,c=this._rectangles.length-1,h=this._levels[c][this._levels[c].length-1];c=0;var d=this._levels[c][this._levels[c].length-1];if(e$28(n)||!(i>d)){var f=this,p=!1;(e$28(f._packingRequest)&&f._packingRequest===ee$B.QuadKey||f._isBlock)&&(p=!0);for(var _=0;_<this._rectangles.length;_++){var m=h$10.intersection(this._rectangles[_],s,ue$r);if(e$28(n)&&!p){var $=n[this._urls[_]];if(e$28($)&&(1===$&&(u=!0),0===$||2===$))continue}if(0===a.length&&_===this._rectangles.length-1&&i>h)break;if(e$28(m)){var g=this._levels[_][0],v=this._levels[_][this._levels[_].length-1],y=!1;if(i>=g&&i<=d&&(y=!0),y){var x=0,b=0,w=1,C=e,T=t,S=i;S>v&&(w=1/Math.pow(2,S-v));for(var E=w;S>v;)C%2==1&&(x+=E),T%2==0&&(b+=E),E*=2,S--,C=Math.floor(.5*C),T=Math.floor(.5*T);var A={srcX:x,srcY:b,width:w,dataName:l._urls[_]},P=i+"_"+e+"_"+t;e$28(l._combiInfo[P])?l._combiInfo[P].push(A):l._combiInfo[P]=[A],function(e){var t,i=l._urls[e];if(-1!==i.indexOf("wmts100")){var r=S-l.wmts_sub;t=i.substring(0,i.lastIndexOf("/"))+"?tilematrix="+r+"&layer="+l._tempLayerName+"&tilerow="+T+"&tilecol="+C+"&tilematrixset="+l._wmtstileMatrixSet+"&service=WMTS&request=GetTile"}else{var n=i.substring(0,i.length-1);t=l._urls[e]+"data/index/"+T+"/"+C+".bil?level="+S}var o=l._proxy;e$28(o)&&(t=o.getURL(t));var s=new r$1c({throttle:!0,throttleByServer:!1,type:$$13.TERRAIN}),u=void 0;if(e$28(f._packingRequest)&&f._packingRequest===ee$B.QuadKey&&f._isBlock){s.type=$$13.BLOCKPACK;var c=Re$i(f,C,T,S);s.quadKey=qe$d(c.x,c.y,c.level),s.blockInfo=c,s.providerName=t.substring(t.indexOf("datas/")+6,t.indexOf("/data/")),e$28(h=f.blockCache[s.quadKey+"_"+s.providerName])&&(f.blockCacheQueue.touch(h),u={buffer:h.data})}else if(e$28(f._packingRequest)&&f._packingRequest===ee$B.QuadKey)s.type=$$13.PACK,s.quadKey=qe$d(C,T,S),s.providerName=t.substring(t.indexOf("datas/")+6,t.indexOf("/data/"));else if(f._isBlock){s.type=$$13.BLOCK;var h;c=Re$i(f,C,T,S);s.quadKey=qe$d(c.x,c.y,c.level),s.blockInfo=c,s.providerName=t.substring(t.indexOf("datas/")+6,t.indexOf("/data/")),e$28(h=f.blockCache[s.quadKey+"_"+s.providerName])&&(f.blockCacheQueue.touch(h),u={buffer:h.data})}if(!e$28(u)){e$28(a$Y.CREDENTIAL)&&(t=e$28(a$Y.CREDENTIAL._keymap[n])?a$Y.addTokenWithKey(n,t):a$Y.addToken(t));var d=t$S.createIfNeeded(t),p=t;e$28(s.blockInfo)&&(p=l._urls[e]+"data/index/"+c.y+"/"+c.x+".bil?level="+S),u=d.getDerivedResource({url:p,request:s}).fetchArrayBuffer()}e$28(u)&&(u.id=e,u.url=t,u.subRequest=s),a.push(u)}(_)}if(u)break}}if(!(a.indexOf(void 0)>-1))return this._hasNormalBuffer=!0,o$1q.allSettled(a,(function(r){if(!(r.length<1)){for(var n=[],o=0;o<r.length;o++){var u=r[o];if(e$28(u)){if(e$28(u.buffer)&&(u=u.buffer),0!==i){if(f._isBlock&&e$28(f._packingRequest)&&f._packingRequest===ee$B.QuadKey)!e$28(a[o].subRequest.quadKeyIndex)&&e$28(a[o].subRequest.blockRequest)&&(a[o].subRequest.quadKeyIndex=a[o].subRequest.blockRequest.quadKeyIndex),e$28(a[o].subRequest.quadKeyIndex)&&(u=Me$n(u,a[o].subRequest.quadKeyIndex),u=new Uint8Array(u).buffer),e$28(c=f.blockCache[a[o].subRequest.quadKey])||(c=new e$1B(f,a[o].subRequest.quadKey,u),f.blockCache[a[o].subRequest.quadKey+"_"+a[o].subRequest.providerName]=c),f.blockCacheQueue.touch(c),f.blockCacheQueue.trim(f.blockCacheSize),u=We$h(u,a[o].subRequest.blockInfo);else if(e$28(f._packingRequest)&&f._packingRequest===ee$B.QuadKey)u=Me$n(u,a[o].subRequest.quadKeyIndex);else if(f._isBlock){var c;e$28(c=f.blockCache[a[o].subRequest.quadKey])||(c=new e$1B(f,a[o].subRequest.quadKey,u),f.blockCache[a[o].subRequest.quadKey+"_"+a[o].subRequest.providerName]=c),f.blockCacheQueue.touch(c),f.blockCacheQueue.trim(f.blockCacheSize),u=We$h(u,a[o].subRequest.blockInfo)}if(!e$28(u)){if(0===o&&r.length>1){var h=i+"_"+e+"_"+t;if(1!=($=l._combiInfo[h])[o+1].width)return void delete l._combiInfo[h]}continue}}var d,p;if(2===(d="ZIP"===l._compressType?nt$c.inflate(u).buffer:u).byteLength/(l._heightmapWidth*l._heightmapHeight)){var _=new Int16Array(d,0,l._heightmapWidth*l._heightmapHeight);p=[];for(var m=0;m<_.length;m++)p.push(parseFloat(_[m]))}else p=new Float32Array(d,0,l._heightmapWidth*l._heightmapHeight);n.push(p)}else n.push(void 0)}h=i+"_"+e+"_"+t;var $=l._combiInfo[h];if(delete l._combiInfo[h],n.length>1)for(o=0;o<n.length;o++)if(e$28(n[o])&&(0!=$[o].srcX||0!=$[o].srcY||1!=$[o].width)){_=l.division(n[o],$[o].srcX,$[o].srcY,$[o].width,l._heightmapWidth);n[o]=_}var g=[{},{},{},{}];for(o=0;o<n.length;o++)if(e$28(n[o])){var v=$[o].dataName,y=-1,x=-1,b=-1,w=-1;y=0==n[o][0]?2:1,x=0==n[o][l._heightmapWidth-1]?2:1,b=0==n[o][(l._heightmapHeight-1)*l._heightmapWidth]?2:1,w=0==n[o][l._heightmapHeight*l._heightmapWidth-1]?2:1;for(var C=.5*l._heightmapWidth,T=.5*l._heightmapHeight,S=0;S<n[o].length;S++){var E=Math.floor(S/l._heightmapWidth),A=S%l._heightmapWidth;if(E<T&&A<C){var P=n[o][S];if(1===y){if(0==P){y=3;break}}else if(0!=P){y=3;break}}}g[0][v]=y;for(S=0;S<n[o].length;S++){E=Math.floor(S/l._heightmapWidth),A=S%l._heightmapWidth;if(E<T&&A>=C){P=n[o][S];if(1===x){if(0==P){x=3;break}}else if(0!=P){x=3;break}}}g[1][v]=x;for(S=0;S<n[o].length;S++){E=Math.floor(S/l._heightmapWidth),A=S%l._heightmapWidth;if(E>=T&&A<C){P=n[o][S];if(1===b){if(0==P){b=3;break}}else if(0!=P){b=3;break}}}g[2][v]=b;for(S=0;S<n[o].length;S++){E=Math.floor(S/l._heightmapWidth),A=S%l._heightmapWidth;if(E>=T&&A>=C){P=n[o][S];if(1===w){if(0==P){w=3;break}}else if(0!=P){w=3;break}}}if(g[3][v]=w,1===y&&1===x&&1===b&&1===w)break}var I=[];for(o=0;o<n.length;o++)e$28(n[o])&&I.push(n[o]);if(0!==I.length){var M=I[0];if(I.length>1)for(S=0;S<M.length;S++)if(0==M[S])for(o=1;o<I.length;o++)if(0!=I[o][S]){M[S]=I[o][S];break}var O=!1;for(o=0;o<M.length;o++)if(Math.abs(M[o])>e$27.EPSILON3){O=!0;break}var D=l._heightmapWidth,R=l._heightmapHeight,L=void 0;return l._requestVertexNormals&&(L=Qe$b(M,D,R,s,i)),new T$S({buffer:M,width:D,height:R,skirtMode:l._isCreateSkirt,skirtScale:l._skirtScale,childTileMask:Ie$m(l,e,t,i),structure:l._terrainDataStructure,valid:O,childTileMaskExt:g,normalTexture:L,level:i,x:e,y:t})}}}),(function(e){return o$1q.reject(e)}))}},se$r.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var ue$r=new h$10;function Ie$m(e,t,i,r){for(var n=e._tilingScheme,o=n.tileXYToRectangle(t,i,r),a=0,s=0;s<e._rectangles.length;s++){var l=e._rectangles[s];e$28(h$10.intersection(l,o,ue$r))&&(ge$n(n,l,2*t,2*i,r+1)&&(a|=4),ge$n(n,l,2*t+1,2*i,r+1)&&(a|=8),ge$n(n,l,2*t,2*i+1,r+1)&&(a|=1),ge$n(n,l,2*t+1,2*i+1,r+1)&&(a|=2))}return a}function ge$n(e,t,i,r,n){var o=e.tileXYToRectangle(i,r,n);return e$28(h$10.intersection(o,t,ue$r))}function e$1h(e){e=u$Y(e,!0),this.value=e$1h.toValue(e)}se$r.prototype.getTileDataAvailable=function(e,t,i){if(0===i)return!0;for(var r=this._tilingScheme.tileXYToRectangle(e,t,i),n=0;n<this._rectangles.length;n++){if(e$28(h$10.intersection(this._rectangles[n],r,ue$r))&&i>=this._levels[n][0]&&i<=this._levels[n][this._levels[n].length-1])return!0}return!1},se$r.prototype.loadTileDataAvailability=function(e,t,i){},Object.defineProperties(e$1h.prototype,{componentDatatype:{get:function(){return S$W.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),e$1h.toValue=function(e,t){if(!e$28(e))throw new t$Z("show is required.");return e$28(t)?(t[0]=e,t):new Uint8Array([e])};var F$T={};function wa$2(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}var Ta$2=32.184,la$1=2451545;function K$F(e,t){t=a$12.addSeconds(e,Ta$2,t);var i=a$12.totalDays(t)-la$1;return t=a$12.addSeconds(t,wa$2(i),t)}var B$B=new a$12(2451545,0,H$12.TAI),ga$1=1e3,S$E=e$27.RADIANS_PER_DEGREE,p$O=e$27.RADIANS_PER_ARCSECOND,f$S=14959787e4,X$B=new p$1a;function k$N(e,t,i,r,n,o,a){if(i<0&&(i=-i,n+=e$27.PI),i<0||i>e$27.PI)throw new t$Z("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");var s=e*(1-t),l=r-n,u=n,c=Aa$2(o-r,t);if("Hyperbolic"===Ea$2(t,0)&&Math.abs(e$27.negativePiToPi(c))>=Math.acos(-1/t))throw new t$Z("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");ba$1(l,i,u,X$B);var h=s*(1+t),d=Math.cos(c),f=Math.sin(c),p=1+t*d;if(p<=e$27.Epsilon10)throw new t$Z("elements cannot be converted to cartesian");var _=h/p;return e$28(a)?(a.x=_*d,a.y=_*f,a.z=0):a=new t$X(_*d,_*f,0),p$1a.multiplyByVector(X$B,a,a)}function Ea$2(e,t){if(e<0)throw new t$Z("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function Aa$2(e,t){if(t<0||t>=1)throw new t$Z("eccentricity out of range.");return _a$2(Oa$1(e,t),t)}var G$T=50,Ia$2=e$27.EPSILON8;function Oa$1(e,t){if(t<0||t>=1)throw new t$Z("eccentricity out of range.");var i,r=Math.floor(e/e$27.TWO_PI),n=(e-=r*e$27.TWO_PI)+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE;for(i=0;i<G$T&&Math.abs(o-n)>Ia$2;++i){n=(o=n)-(o-t*Math.sin(o)-e)/(1-t*Math.cos(o))}if(i>=G$T)throw new t$Z("Kepler equation did not converge");return o=n+r*e$27.TWO_PI}function _a$2(e,t){if(t<0||t>=1)throw new t$Z("eccentricity out of range.");var i=Math.floor(e/e$27.TWO_PI);e-=i*e$27.TWO_PI;var r=Math.cos(e)-t,n=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(n,r);return o=e$27.zeroToTwoPi(o),e<0&&(o-=e$27.TWO_PI),o+=i*e$27.TWO_PI}function ba$1(e,t,i,r){if(t<0||t>e$27.PI)throw new t$Z("inclination out of range");var n=Math.cos(e),o=Math.sin(e),a=Math.cos(t),s=Math.sin(t),l=Math.cos(i),u=Math.sin(i);return e$28(r)?(r[0]=l*n-u*o*a,r[1]=u*n+l*o*a,r[2]=o*s,r[3]=-l*o-u*n*a,r[4]=-u*o+l*n*a,r[5]=n*s,r[6]=u*s,r[7]=-l*s,r[8]=a):r=new p$1a(l*n-u*o*a,-l*o-u*n*a,u*s,u*n+l*o*a,-u*o+l*n*a,-l*s,o*s,n*s,a),r}var Da$1=1.0000010178*f$S,Na$1=100.46645683*S$E,ya$2=1295977422.83429*p$O,Q$L=16002,Z$N=21863,$$K=32004,j$L=10931,aa=14529,ra=16368,ta=15318,oa=32794,Ra$2=64*1e-7*f$S,qa$1=1e-7*-152*f$S,xa$2=62*1e-7*f$S,La$2=-8e-7*f$S,Wa$2=32*1e-7*f$S,Ya$2=1e-7*-41*f$S,Ua$2=19*1e-7*f$S,Ba$2=1e-7*-11*f$S,Va$2=1e-7*-150*f$S,Fa$2=1e-7*-46*f$S,Ja=68*1e-7*f$S,za$1=54*1e-7*f$S,Ha$2=14*1e-7*f$S,Ka=24*1e-7*f$S,Xa=1e-7*-28*f$S,ka=22*1e-7*f$S,na=10,ea$1=16002,ia=21863,sa=10931,ha$2=1473,va$1=32004,Ma$1=4387,ca$1=73,Ga$2=1e-7*-325,Qa$1=1e-7*-322,Za$1=1e-7*-79,$a=232*1e-7,ja=1e-7*-52,a0=97*1e-7,r0=55*1e-7,t0$1=1e-7*-41,o0=1e-7*-105,n0=1e-7*-137,e0=258*1e-7,i0=35*1e-7,s0=1e-7*-116,h0=1e-7*-88,v0=1e-7*-112,M0=1e-7*-80,b$S=new a$12(0,0,H$12.TAI);function c0(e,t){K$F(e,b$S);var i=(b$S.dayNumber-B$B.dayNumber+(b$S.secondsOfDay-B$B.secondsOfDay)/h$Z.SECONDS_PER_DAY)/(10*h$Z.DAYS_PER_JULIAN_CENTURY),r=.3595362*i,n=Da$1+Ra$2*Math.cos(Q$L*r)+Va$2*Math.sin(Q$L*r)+qa$1*Math.cos(Z$N*r)+Fa$2*Math.sin(Z$N*r)+xa$2*Math.cos($$K*r)+Ja*Math.sin($$K*r)+La$2*Math.cos(j$L*r)+za$1*Math.sin(j$L*r)+Wa$2*Math.cos(aa*r)+Ha$2*Math.sin(aa*r)+Ya$2*Math.cos(ra*r)+Ka*Math.sin(ra*r)+Ua$2*Math.cos(ta*r)+Xa*Math.sin(ta*r)+Ba$2*Math.cos(oa*r)+ka*Math.sin(oa*r),o=Na$1+ya$2*i+Ga$2*Math.cos(na*r)+o0*Math.sin(na*r)+Qa$1*Math.cos(ea$1*r)+n0*Math.sin(ea$1*r)+Za$1*Math.cos(ia*r)+e0*Math.sin(ia*r)+$a*Math.cos(sa*r)+i0*Math.sin(sa*r)+ja*Math.cos(ha$2*r)+s0*Math.sin(ha$2*r)+a0*Math.cos(va$1*r)+h0*Math.sin(va$1*r)+r0*Math.cos(Ma$1*r)+v0*Math.sin(Ma$1*r)+t0$1*Math.cos(ca$1*r)+M0*Math.sin(ca$1*r);return k$N(n,.0167086342-.0004203654*i,469.97289*p$O*i,102.93734808*S$E+11612.3529*p$O*i,174.87317577*S$E-8679.27034*p$O*i,o,t)}function fa$1(e,t){K$F(e,b$S);var i=(b$S.dayNumber-B$B.dayNumber+(b$S.secondsOfDay-B$B.secondsOfDay)/h$Z.SECONDS_PER_DAY)/h$Z.DAYS_PER_JULIAN_CENTURY,r=i*i,n=r*i,o=n*i,a=383397.7725+.004*i,s=.055545526-16e-9*i,l=5.15668983*S$E,u=-8e-5*i+.02966*r-42e-6*n-13e-8*o,c=83.35324312*S$E,h=14643420.2669*i-38.2702*r-.045047*n+21301e-8*o,d=125.04455501*S$E,f=-6967919.3631*i+6.3602*r+.007625*n-3586e-8*o,p=218.31664563*S$E,_=1732559343.4847*i-6.391*r+.006588*n-3169e-8*o,m=297.85019547*S$E+p$O*(1602961601.209*i-6.3706*r+.006593*n-3169e-8*o),$=134.96340251*S$E+p$O*(1717915923.2178*i+31.8792*r+.051635*n-2447e-7*o),g=357.52910918*S$E+p$O*(129596581.0481*i-.5532*r+136e-6*n-1149e-8*o),v=310.17137918*S$E-p$O*(6967051.436*i+6.2068*r+.007618*n-3219e-8*o),y=2*m,x=4*m,b=6*m,w=2*$,C=3*$,T=4*$,S=2*(93.27209062*S$E+p$O*(1739527262.8478*i-12.7512*r-.001037*n+417e-8*o));a+=3400.4*Math.cos(y)-635.6*Math.cos(y-$)-235.6*Math.cos($)+218.1*Math.cos(y-g)+181*Math.cos(y+$),s+=.014216*Math.cos(y-$)+.008551*Math.cos(y-w)-.001383*Math.cos($)+.001356*Math.cos(y+$)-.001147*Math.cos(x-C)-914e-6*Math.cos(x-w)+869e-6*Math.cos(y-g-$)-627e-6*Math.cos(y)-394e-6*Math.cos(x-T)+282e-6*Math.cos(y-g-w)-279e-6*Math.cos(m-$)-236e-6*Math.cos(w)+231e-6*Math.cos(x)+229e-6*Math.cos(b-T)-201e-6*Math.cos(w-S),u+=486.26*Math.cos(y-S)-40.13*Math.cos(y)+37.51*Math.cos(S)+25.73*Math.cos(w-S)+19.97*Math.cos(y-g-S),h+=-55609*Math.sin(y-$)-34711*Math.sin(y-w)-9792*Math.sin($)+9385*Math.sin(x-C)+7505*Math.sin(x-w)+5318*Math.sin(y+$)+3484*Math.sin(x-T)-3417*Math.sin(y-g-$)-2530*Math.sin(b-T)-2376*Math.sin(y)-2075*Math.sin(y-C)-1883*Math.sin(w)-1736*Math.sin(b-5*$)+1626*Math.sin(g)-1370*Math.sin(b-C),f+=-5392*Math.sin(y-S)-540*Math.sin(g)-441*Math.sin(y)+423*Math.sin(S)-288*Math.sin(w-S),_+=-3332.9*Math.sin(y)+1197.4*Math.sin(y-$)-662.5*Math.sin(g)+396.3*Math.sin($)-218*Math.sin(y-g);var E=2*v,A=3*v;u+=46.997*Math.cos(v)*i-.614*Math.cos(y-S+v)*i+.614*Math.cos(y-S-v)*i-.0297*Math.cos(E)*r-.0335*Math.cos(v)*r+.0012*Math.cos(y-S+E)*r-16e-5*Math.cos(v)*n+4e-5*Math.cos(A)*n+4e-5*Math.cos(E)*n;var P=2.116*Math.sin(v)*i-.111*Math.sin(y-S-v)*i-.0015*Math.sin(v)*r;return h+=P,_+=P,f+=-520.77*Math.sin(v)*i+13.66*Math.sin(y-S+v)*i+1.12*Math.sin(y-v)*i-1.06*Math.sin(S-v)*i+.66*Math.sin(E)*r+.371*Math.sin(v)*r-.035*Math.sin(y-S+E)*r-.015*Math.sin(y-S+v)*r+.0014*Math.sin(v)*n-.0011*Math.sin(A)*n-9e-4*Math.sin(E)*n,k$N(a*=ga$1,s,l+u*p$O,c+h*p$O,d+f*p$O,p+_*p$O,t)}var ua$2=.012300034,f0=ua$2/(ua$2+1)*-1;function u0(e,t){return t=fa$1(e,t),t$X.multiplyByScalar(t,f0,t)}var ma$2=new p$1a(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),R$H=new t$X;function ae$v(e,t,i,r,n,o,a){var s,l=m$U.numberOfPoints(e,t,n),u=i.red,c=i.green,h=i.blue,d=i.alpha,f=r.red,p=r.green,_=r.blue,m=r.alpha;if(e$1S.equals(i,r)){for(s=0;s<l;s++)o[a++]=e$1S.floatToByte(u),o[a++]=e$1S.floatToByte(c),o[a++]=e$1S.floatToByte(h),o[a++]=e$1S.floatToByte(d);return a}var $=(f-u)/l,g=(p-c)/l,v=(_-h)/l,y=(m-d)/l,x=a;for(s=0;s<l;s++)o[x++]=e$1S.floatToByte(u+s*$),o[x++]=e$1S.floatToByte(c+s*g),o[x++]=e$1S.floatToByte(h+s*v),o[x++]=e$1S.floatToByte(d+s*y);return x}function S$D(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.colors,r=u$Y(e.colorsPerVertex,!1);if(!e$28(t)||t.length<2)throw new t$Z("At least two positions are required.");if(e$28(i)&&(r&&i.length<t.length||!r&&i.length<t.length-1))throw new t$Z("colors has an invalid length.");this._positions=t,this._colors=i,this._colorsPerVertex=r,this._arcType=u$Y(e.arcType,m$_.GEODESIC),this._granularity=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._workerName="createSimplePolylineGeometry";var n=1+t.length*t$X.packedLength;n+=e$28(i)?1+i.length*e$1S.packedLength:1,this.packedLength=n+t$V.packedLength+3}F$T.computeSunPositionInEarthInertialFrame=function(e,t){return e$28(e)||(e=a$12.now()),e$28(t)||(t=new t$X),R$H=c0(e,R$H),t=t$X.negate(R$H,t),u0(e,R$H),t$X.subtract(t,R$H,t),p$1a.multiplyByVector(ma$2,t,t),t},F$T.computeMoonPositionInEarthInertialFrame=function(e,t){return e$28(e)||(e=a$12.now()),t=fa$1(e,t),p$1a.multiplyByVector(ma$2,t,t),t},S$D.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._colors;for(o=e$28(a)?a.length:0,t[i++]=o,r=0;r<o;++r,i+=e$1S.packedLength)e$1S.pack(a[r],t,i);return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t},S$D.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n=e[t++],o=new Array(n);for(r=0;r<n;++r,t+=t$X.packedLength)o[r]=t$X.unpack(e,t);var a=(n=e[t++])>0?new Array(n):void 0;for(r=0;r<n;++r,t+=e$1S.packedLength)a[r]=e$1S.unpack(e,t);var s=t$V.unpack(e,t);t+=t$V.packedLength;var l=1===e[t++],u=e[t++],c=e[t];return e$28(i)?(i._positions=o,i._colors=a,i._ellipsoid=s,i._colorsPerVertex=l,i._arcType=u,i._granularity=c,i):new S$D({positions:o,colors:a,ellipsoid:s,colorsPerVertex:l,arcType:u,granularity:c})};var U$N=new Array(2),q$R=new Array(2),te$C={positions:U$N,height:q$R,ellipsoid:void 0,minDistance:void 0,granularity:void 0};S$D.createGeometry=function(e){var t,i,r,n,o,a=e._positions,s=e._colors,l=e._colorsPerVertex,u=e._arcType,c=e._granularity,h=e._ellipsoid,d=e$27.chordLength(c,h.maximumRadius),f=e$28(s)&&!l,p=a.length,_=0;if(u===m$_.GEODESIC||u===m$_.RHUMB){var m,$,g;u===m$_.GEODESIC?(m=e$27.chordLength(c,h.maximumRadius),$=m$U.numberOfPoints,g=m$U.generateArc):(m=c,$=m$U.numberOfPointsRhumbLine,g=m$U.generateRhumbArc);var v=m$U.extractHeights(a,h),y=te$C;if(u===m$_.GEODESIC?y.minDistance=d:y.granularity=c,y.ellipsoid=h,f){var x=0;for(t=0;t<p-1;t++)x+=$(a[t],a[t+1],m)+1;i=new Float64Array(3*x),n=new Uint8Array(4*x),y.positions=U$N,y.height=q$R;var b=0;for(t=0;t<p-1;++t){U$N[0]=a[t],U$N[1]=a[t+1],q$R[0]=v[t],q$R[1]=v[t+1];var w=g(y);if(e$28(s)){var C=w.length/3;o=s[t];for(var T=0;T<C;++T)n[b++]=e$1S.floatToByte(o.red),n[b++]=e$1S.floatToByte(o.green),n[b++]=e$1S.floatToByte(o.blue),n[b++]=e$1S.floatToByte(o.alpha)}i.set(w,_),_+=w.length}}else if(y.positions=a,y.height=v,i=new Float64Array(g(y)),e$28(s)){for(n=new Uint8Array(i.length/3*4),t=0;t<p-1;++t){_=ae$v(a[t],a[t+1],s[t],s[t+1],d,n,_)}var S=s[p-1];n[_++]=e$1S.floatToByte(S.red),n[_++]=e$1S.floatToByte(S.green),n[_++]=e$1S.floatToByte(S.blue),n[_++]=e$1S.floatToByte(S.alpha)}}else{r=f?2*p-2:p,i=new Float64Array(3*r),n=e$28(s)?new Uint8Array(4*r):void 0;var E=0,A=0;for(t=0;t<p;++t){var P=a[t];if(f&&t>0&&(t$X.pack(P,i,E),E+=3,o=s[t-1],n[A++]=e$1S.floatToByte(o.red),n[A++]=e$1S.floatToByte(o.green),n[A++]=e$1S.floatToByte(o.blue),n[A++]=e$1S.floatToByte(o.alpha)),f&&t===p-1)break;t$X.pack(P,i,E),E+=3,e$28(s)&&(o=s[t],n[A++]=e$1S.floatToByte(o.red),n[A++]=e$1S.floatToByte(o.green),n[A++]=e$1S.floatToByte(o.blue),n[A++]=e$1S.floatToByte(o.alpha))}}var I=new a$_;I.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:i}),e$28(s)&&(I.color=new o$1g({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,values:n,normalize:!0}));var M=2*((r=i.length/3)-1),O=ce$v.createTypedArray(r,M),D=0;for(t=0;t<r-1;++t)O[D++]=t,O[D++]=t+1;return new I$1n({attributes:I,indices:O,primitiveType:W$_.LINES,boundingSphere:i$19.fromPoints(a)})};var e$1g={DisplayMode:{NONE:0,FACE:1,ARROW:2,FACE_AND_ARROW:3}},Vi$3=Object.freeze(e$1g);function l$R(){this._maxVisibleValue=17976931348623157e292,this._minVisibleValue=-17976931348623157e292,this._floor=0,this._ceiling=0,this._opacity=1,this._updateColorDictTable=!1,this._coverageArea=[],this._updatePolygon=!0,this._displayMode=Vi$3.DisplayMode.FACE,this._dictColorTable=void 0,this._slopeArrowsColor=new e$1S(1,1,1,1)}function r$O(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times;if(!e$28(t)||!e$28(i))throw new t$Z("points and times are required.");if(t.length<2)throw new t$Z("points.length must be greater than or equal to 2.");if(i.length!==t.length)throw new t$Z("times.length must be equal to points.length.");this._times=i,this._points=t,this._lastTimeIndex=0}function n$M(e){var t=u$Y(e.radius,1),i={radii:new t$X(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new b$Y(i),this._workerName="createSphereGeometry"}l$R.prototype.destroy=function(){this._coverageArea.length=0,e$28(this._dictColorTable)&&this._dictColorTable.destroy()},Object.defineProperties(l$R.prototype,{MinVisibleValue:{get:function(){return this._minVisibleValue},set:function(e){this._minVisibleValue=e}},MaxVisibleValue:{get:function(){return this._maxVisibleValue},set:function(e){this._maxVisibleValue=e}},ColorTableMaxKey:{get:function(){return this._ceiling},set:function(e){this._ceiling=e}},ColorTableMinKey:{get:function(){return this._floor},set:function(e){this._floor=e}},ColorTable:{get:function(){return this._dictColorTable},set:function(e){if(e$28(e)){this._dictColorTable=i$O.clone(e,this._dictColorTable),this._updateColorDictTable=!0;var t=this._dictColorTable.count();if(!(t<1)){new e$1S;var i=0,r=0,n=this._dictColorTable.getItem(0);e$28(n)&&e$28(n.altitude)&&(i=parseFloat(n.altitude)),e$28(n=this._dictColorTable.getItem(t-1))&&e$28(n.altitude)&&(r=parseFloat(n.altitude)),this._ceiling=Math.max(i,r),this._floor=Math.min(i,r)}}else e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null)}},Opacity:{get:function(){return this._opacity},set:function(e){this._opacity=e}},CoverageArea:{get:function(){return this._coverageArea},set:function(e){if(this._updatePolygon=!0,this._coverageArea.length=0,e$28(e))for(var t=0;t<e.length;t++)this._coverageArea[t]=e[t]}},DisplayMode:{get:function(){return this._displayMode},set:function(e){this._displayMode=e}},UpdateColorDictTable:{get:function(){return this._updateColorDictTable},set:function(e){this._updateColorDictTable=e}},UpdatePolygonRegion:{get:function(){return this._updatePolygon},set:function(e){this._updatePolygon=e}},SlopeArrowsColor:{get:function(){return this._slopeArrowsColor},set:function(e){this._slopeArrowsColor=e}}}),l$R.clone=function(e,t){if(e$28(e)){e$28(t)||(t=new l$R),t._maxVisibleValue=e._maxVisibleValue,t._minVisibleValue=e._minVisibleValue,t._floor=e._floor,t._ceiling=e._ceiling,t._opacity=e._opacity,t._updateColorDictTable=e._updateColorDictTable,t._updatePolygon=e._updatePolygon,t._displayMode=e._displayMode,t._dictColorTable=i$O.clone(e._dictColorTable,t._dictColorTable),t._slopeArrowsColor=e._slopeArrowsColor,t._coverageArea.length=0;for(var i=0;i<e._coverageArea.length;i++)t._coverageArea[i]=e._coverageArea[i];return t}},Object.defineProperties(r$O.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),r$O.prototype.findTimeInterval=n$_.prototype.findTimeInterval,r$O.prototype.wrapTime=n$_.prototype.wrapTime,r$O.prototype.clampTime=n$_.prototype.clampTime,r$O.prototype.evaluate=function(e,t){var i=this.points,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-r[n])/(r[n+1]-r[n]);return o*=(3-2*o)*o,e$28(t)||(t=new t$X),t$X.lerp(i[n],i[n+1],o,t)},n$M.packedLength=b$Y.packedLength,n$M.pack=function(e,t,i){return o$1u.typeOf.object("value",e),b$Y.pack(e._ellipsoidGeometry,t,i)};var p$N=new b$Y,r$N={radius:void 0,radii:new t$X,vertexFormat:new n$10,stackPartitions:void 0,slicePartitions:void 0};function a$Q(e){var t=u$Y(e.radius,1),i={radii:new t$X(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new x$Y(i),this._workerName="createSphereOutlineGeometry"}n$M.unpack=function(e,t,i){var r=b$Y.unpack(e,t,p$N);return r$N.vertexFormat=n$10.clone(r._vertexFormat,r$N.vertexFormat),r$N.stackPartitions=r._stackPartitions,r$N.slicePartitions=r._slicePartitions,e$28(i)?(t$X.clone(r._radii,r$N.radii),i._ellipsoidGeometry=new b$Y(r$N),i):(r$N.radius=r._radii.x,new n$M(r$N))},n$M.createGeometry=function(e){return b$Y.createGeometry(e._ellipsoidGeometry)},a$Q.packedLength=x$Y.packedLength,a$Q.pack=function(e,t,i){return o$1u.typeOf.object("value",e),x$Y.pack(e._ellipsoidGeometry,t,i)};var l$Q=new x$Y,s$G={radius:void 0,radii:new t$X,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};function c$M(e,t,i){this.clock=u$Y(e,0),this.cone=u$Y(t,0),this.magnitude=u$Y(i,1)}function u$F(e,t){if(!e$28(e))throw new t$Z("array is required.");if(!e$28(t)||t<1)throw new t$Z("numberOfArrays must be greater than 0.");for(var i=[],r=e.length,n=0;n<r;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}function f$R(e){this.url=u$Y(e.url,"")}function o$V(){this._fProgress=0,this._nLocation=-1,this._changeZValue=!0}function r$M(){t$Z.throwInstantiationError()}a$Q.unpack=function(e,t,i){var r=x$Y.unpack(e,t,l$Q);return s$G.stackPartitions=r._stackPartitions,s$G.slicePartitions=r._slicePartitions,s$G.subdivisions=r._subdivisions,e$28(i)?(t$X.clone(r._radii,s$G.radii),i._ellipsoidGeometry=new x$Y(s$G),i):(s$G.radius=r._radii.x,new a$Q(s$G))},a$Q.createGeometry=function(e){return x$Y.createGeometry(e._ellipsoidGeometry)},c$M.fromCartesian3=function(e,t){o$1u.typeOf.object("cartesian3",e);var i=e.x,r=e.y,n=e.z,o=i*i+r*r;return e$28(t)||(t=new c$M),t.clock=Math.atan2(r,i),t.cone=Math.atan2(Math.sqrt(o),n),t.magnitude=Math.sqrt(o+n*n),t},c$M.clone=function(e,t){if(e$28(e))return e$28(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new c$M(e.clock,e.cone,e.magnitude)},c$M.normalize=function(e,t){return o$1u.typeOf.object("spherical",e),e$28(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new c$M(e.clock,e.cone,1)},c$M.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},c$M.equalsEpsilon=function(e,t,i){return i=u$Y(i,0),e===t||e$28(e)&&e$28(t)&&Math.abs(e.clock-t.clock)<=i&&Math.abs(e.cone-t.cone)<=i&&Math.abs(e.magnitude-t.magnitude)<=i},c$M.prototype.equals=function(e){return c$M.equals(this,e)},c$M.prototype.clone=function(e){return c$M.clone(this,e)},c$M.prototype.equalsEpsilon=function(e,t){return c$M.equalsEpsilon(this,e,t)},c$M.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},f$R.checkSptialLicense=function(e){if(!e$28(e))throw new t$Z("url is required");if("string"!=typeof e)throw new t$Z("url must be a string");var t=e.lastIndexOf("realspace");if(-1===t)return o$1q.resolve(!1).then((function(){return!1})).otherwise((function(){return!1}));var i=e.substring(0,t);return e=i+"realspace/spatiallicense.xml",e$28(a$Y.CREDENTIAL)&&(e=a$Y.addToken(e)),p$Z({url:e,responseType:"text"}).then((function(e){return-1!==e.indexOf("<boolean>true</boolean>")})).otherwise((function(e){return!1}))},Object.defineProperties(o$V.prototype,{progress:{get:function(){return this._fProgress},set:function(e){this._fProgress=e}},location:{get:function(){return this._nLocation},set:function(e){this._nLocation=e}},changeZValue:{get:function(){return this._changeZValue},set:function(e){this._changeZValue=e}}}),o$V.clone=function(e,t){if(e$28(e))return e$28(t)||(t=new o$V),t._fTemporalPercentage=e._fTemporalPercentage,t._nTemporalPos=e._nTemporalPos,t},Object.defineProperties(r$M.prototype,{credits:{get:t$Z.throwInstantiationError},waterMask:{get:t$Z.throwInstantiationError}}),r$M.prototype.interpolateHeight=t$Z.throwInstantiationError,r$M.prototype.isChildAvailable=t$Z.throwInstantiationError,r$M.prototype.createMesh=t$Z.throwInstantiationError,r$M.prototype.upsample=t$Z.throwInstantiationError,r$M.prototype.wasCreatedByUpsampling=t$Z.throwInstantiationError;var n$L={},v$D=typeof document<"u"?new h$$(document.location.href):new h$$;function f$Q(e){var t=new h$$(e).resolve(v$D);t.normalize();var i=t.authority;return/:/.test(i)||(i=i+":"+("https"===t.scheme?"443":"80")),i}function o$U(e,t){var i=f$Q(e),r=u$Y(n$L[i],0);if(!(r>=o$U.maximumRequestsPerServer))return n$L[i]=r+1,o$1q(t(e),(function(e){return n$L[i]--,e})).otherwise((function(e){return n$L[i]--,o$1q.reject(e)}))}o$U.maximumRequestsPerServer=6;var T$G={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7};function o$T(e){throw new t$Z("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}function D$P(e,t){return a$12.compare(e.start,t.start)}function c$L(e){if(this._intervals=[],this._changedEvent=new o$1o,e$28(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}Object.defineProperties(o$T.prototype,{ellipsoid:{get:t$Z.throwInstantiationError},rectangle:{get:t$Z.throwInstantiationError},projection:{get:t$Z.throwInstantiationError}}),o$T.prototype.getNumberOfXTilesAtLevel=t$Z.throwInstantiationError,o$T.prototype.getNumberOfYTilesAtLevel=t$Z.throwInstantiationError,o$T.prototype.rectangleToNativeRectangle=t$Z.throwInstantiationError,o$T.prototype.tileXYToNativeRectangle=t$Z.throwInstantiationError,o$T.prototype.tileXYToRectangle=t$Z.throwInstantiationError,o$T.prototype.positionToTileXY=t$Z.throwInstantiationError,Object.defineProperties(c$L.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),c$L.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof c$L))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;o++)if(!d$_.equals(i[o],r[o],t))return!1;return!0},c$L.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._intervals[e]},c$L.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},c$L.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},c$L.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},c$L.prototype.contains=function(e){return this.indexOf(e)>=0};var q$Q=new d$_;c$L.prototype.indexOf=function(e){if(!e$28(e))throw new t$Z("date is required");var t=this._intervals;q$Q.start=e,q$Q.stop=e;var i=a$14(t,q$Q,D$P);return i>=0?t[i].isStartIncluded?i:i>0&&t[i-1].stop.equals(e)&&t[i-1].isStopIncluded?i-1:~i:(i=~i)>0&&i-1<t.length&&d$_.contains(t[i-1],e)?i-1:~i},c$L.prototype.findInterval=function(e){for(var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).start,i=e.stop,r=e.isStartIncluded,n=e.isStopIncluded,o=this._intervals,a=0,s=o.length;a<s;a++){var l=o[a];if((!e$28(t)||l.start.equals(t))&&(!e$28(i)||l.stop.equals(i))&&(!e$28(r)||l.isStartIncluded===r)&&(!e$28(n)||l.isStopIncluded===n))return o[a]}},c$L.prototype.addInterval=function(e,t){if(!e$28(e))throw new t$Z("interval is required");if(!e.isEmpty){var i=this._intervals;if(0===i.length||a$12.greaterThan(e.start,i[i.length-1].stop))return i.push(e),void this._changedEvent.raiseEvent(this);var r,n=a$14(i,e,D$P);for(n<0?n=~n:n>0&&e.isStartIncluded&&i[n-1].isStartIncluded&&i[n-1].start.equals(e.start)?--n:n<i.length&&!e.isStartIncluded&&i[n].isStartIncluded&&i[n].start.equals(e.start)&&++n,n>0&&(((r=a$12.compare(i[n-1].stop,e.start))>0||0===r&&(i[n-1].isStopIncluded||e.isStartIncluded))&&((e$28(t)?t(i[n-1].data,e.data):i[n-1].data===e.data)?(e=a$12.greaterThan(e.stop,i[n-1].stop)?new d$_({start:i[n-1].start,stop:e.stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):new d$_({start:i[n-1].start,stop:i[n-1].stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:i[n-1].isStopIncluded||e.stop.equals(i[n-1].stop)&&e.isStopIncluded,data:e.data}),i.splice(n-1,1),--n):(((r=a$12.compare(i[n-1].stop,e.stop))>0||0===r&&i[n-1].isStopIncluded&&!e.isStopIncluded)&&i.splice(n,0,new d$_({start:e.stop,stop:i[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n-1].isStopIncluded,data:i[n-1].data})),i[n-1]=new d$_({start:i[n-1].start,stop:e.start,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:i[n-1].data}))));n<i.length&&((r=a$12.compare(e.stop,i[n].start))>0||0===r&&(e.isStopIncluded||i[n].isStartIncluded));)if(e$28(t)?t(i[n].data,e.data):i[n].data===e.data)e=new d$_({start:e.start,stop:a$12.greaterThan(i[n].stop,e.stop)?i[n].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:a$12.greaterThan(i[n].stop,e.stop)?i[n].isStopIncluded:e.isStopIncluded,data:e.data}),i.splice(n,1);else{if(i[n]=new d$_({start:e.stop,stop:i[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n].isStopIncluded,data:i[n].data}),!i[n].isEmpty)break;i.splice(n,1)}i.splice(n,0,e),this._changedEvent.raiseEvent(this)}},c$L.prototype.removeInterval=function(e){if(!e$28(e))throw new t$Z("interval is required");if(e.isEmpty)return!1;var t=this._intervals,i=a$14(t,e,D$P);i<0&&(i=~i);var r=!1;for(i>0&&(a$12.greaterThan(t[i-1].stop,e.start)||t[i-1].stop.equals(e.start)&&t[i-1].isStopIncluded&&e.isStartIncluded)&&(r=!0,(a$12.greaterThan(t[i-1].stop,e.stop)||t[i-1].isStopIncluded&&!e.isStopIncluded&&t[i-1].stop.equals(e.stop))&&t.splice(i,0,new d$_({start:e.stop,stop:t[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i-1].isStopIncluded,data:t[i-1].data})),t[i-1]=new d$_({start:t[i-1].start,stop:e.start,isStartIncluded:t[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[i-1].data})),i<t.length&&!e.isStartIncluded&&t[i].isStartIncluded&&e.start.equals(t[i].start)&&(r=!0,t.splice(i,0,new d$_({start:t[i].start,stop:t[i].start,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data})),++i);i<t.length&&a$12.greaterThan(e.stop,t[i].stop);)r=!0,t.splice(i,1);return i<t.length&&e.stop.equals(t[i].stop)&&(r=!0,!e.isStopIncluded&&t[i].isStopIncluded?i+1<t.length&&t[i+1].start.equals(e.stop)&&t[i].data===t[i+1].data?(t.splice(i,1),t[i]=new d$_({start:t[i].start,stop:t[i].stop,isStartIncluded:!0,isStopIncluded:t[i].isStopIncluded,data:t[i].data})):t[i]=new d$_({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data}):t.splice(i,1)),i<t.length&&(a$12.greaterThan(e.stop,t[i].start)||e.stop.equals(t[i].start)&&e.isStopIncluded&&t[i].isStartIncluded)&&(r=!0,t[i]=new d$_({start:e.stop,stop:t[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i].isStopIncluded,data:t[i].data})),r&&this._changedEvent.raiseEvent(this),r},c$L.prototype.intersect=function(e,t,i){if(!e$28(e))throw new t$Z("other is required.");for(var r=new c$L,n=0,o=0,a=this._intervals,s=e._intervals;n<a.length&&o<s.length;){var l=a[n],u=s[o];if(a$12.lessThan(l.stop,u.start))++n;else if(a$12.lessThan(u.stop,l.start))++o;else{if(e$28(i)||e$28(t)&&t(l.data,u.data)||!e$28(t)&&u.data===l.data){var c=d$_.intersect(l,u,new d$_,i);c.isEmpty||r.addInterval(c,t)}a$12.lessThan(l.stop,u.stop)||l.stop.equals(u.stop)&&!l.isStopIncluded&&u.isStopIncluded?++n:++o}}return r},c$L.fromJulianDateArray=function(e,t){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.julianDates))throw new t$Z("options.iso8601Array is required.");e$28(t)||(t=new c$L);var i,r=e.julianDates,n=r.length,o=e.dataCallback,a=u$Y(e.isStartIncluded,!0),s=u$Y(e.isStopIncluded,!0),l=u$Y(e.leadingInterval,!1),u=u$Y(e.trailingInterval,!1),c=0;l&&(++c,(i=new d$_({start:o$11.MINIMUM_VALUE,stop:r[0],isStartIncluded:!0,isStopIncluded:!a})).data=e$28(o)?o(i,t.length):t.length,t.addInterval(i));for(var h=0;h<n-1;++h){var d=r[h],f=r[h+1];(i=new d$_({start:d,stop:f,isStartIncluded:t.length!==c||a,isStopIncluded:h===n-2&&s})).data=e$28(o)?o(i,t.length):t.length,t.addInterval(i),d=f}return u&&((i=new d$_({start:r[n-1],stop:o$11.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0})).data=e$28(o)?o(i,t.length):t.length,t.addInterval(i)),t};var I$11=new d$1e,m$M=[0,31,28,31,30,31,30,31,31,30,31,30,31];function _$J(e,t,i){e$28(i)||(i=new a$12),a$12.toGregorianDate(e,I$11);var r=I$11.millisecond+t.millisecond,n=I$11.second+t.second,o=I$11.minute+t.minute,a=I$11.hour+t.hour,s=I$11.day+t.day,l=I$11.month+t.month,u=I$11.year+t.year;for(r>=1e3&&(n+=Math.floor(r/1e3),r%=1e3),n>=60&&(o+=Math.floor(n/60),n%=60),o>=60&&(a+=Math.floor(o/60),o%=60),a>=24&&(s+=Math.floor(a/24),a%=24),m$M[2]=i$11(u)?29:28;s>m$M[l]||l>=13;)s>m$M[l]&&(s-=m$M[l],++l),l>=13&&(--l,u+=Math.floor(l/12),l%=12,++l),m$M[2]=i$11(u)?29:28;return I$11.millisecond=r,I$11.second=n,I$11.minute=o,I$11.hour=a,I$11.day=s,I$11.month=l,I$11.year=u,a$12.fromGregorianDate(I$11,i)}var k$M=new a$12,N$E=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function A$V(e,t){if(!e$28(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){var i=e.match(N$E);if(!e$28(i))return!1;if(e$28(i[1])&&(t.year=Number(i[1].replace(",","."))),e$28(i[2])&&(t.month=Number(i[2].replace(",","."))),e$28(i[3])&&(t.day=7*Number(i[3].replace(",","."))),e$28(i[4])&&(t.day+=Number(i[4].replace(",","."))),e$28(i[5])&&(t.hour=Number(i[5].replace(",","."))),e$28(i[6])&&(t.minute=Number(i[6].replace(",","."))),e$28(i[7])){var r=Number(i[7].replace(",","."));t.second=Math.floor(r),t.millisecond=r%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),a$12.toGregorianDate(a$12.fromIso8601(e,k$M),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var w$w=new d$1e;c$L.fromIso8601=function(e,t){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.iso8601))throw new t$Z("options.iso8601 is required.");var i=e.iso8601.split("/"),r=a$12.fromIso8601(i[0]),n=a$12.fromIso8601(i[1]),o=[];if(A$V(i[2],w$w)){var a=a$12.clone(r);for(o.push(a);a$12.compare(a,n)<0;){a=_$J(a,w$w),a$12.compare(n,a)<=0&&a$12.clone(n,a),o.push(a)}}else o.push(r,n);return c$L.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},c$L.fromIso8601DateArray=function(e,t){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.iso8601Dates))throw new t$Z("options.iso8601Dates is required.");return c$L.fromJulianDateArray({julianDates:e.iso8601Dates.map((function(e){return a$12.fromIso8601(e)})),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},c$L.fromIso8601DurationArray=function(e,t){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.epoch))throw new t$Z("options.epoch is required.");if(!e$28(e.iso8601Durations))throw new t$Z("options.iso8601Durations is required.");for(var i,r,n=e.epoch,o=e.iso8601Durations,a=u$Y(e.relativeToPrevious,!1),s=[],l=o.length,u=0;u<l;++u)(A$V(o[u],w$w)||0===u)&&(i=a&&e$28(r)?_$J(r,w$w):_$J(n,w$w),s.push(i),r=i);return c$L.fromJulianDateArray({julianDates:s,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var s$F=new t$X(1,1,1),u$E=t$X.ZERO,f$P=n$14.IDENTITY,e$1f=function(e,t,i){this.translation=t$X.clone(u$Y(e,u$E)),this.rotation=n$14.clone(u$Y(t,f$P)),this.scale=t$X.clone(u$Y(i,s$F))};function n$K(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).points,i=e.times;if(!e$28(t)||!e$28(i))throw new t$Z("points and times are required.");if(2!==i.length)throw new t$Z("times.length must be equal to 2.");if(2!==t.length)throw new t$Z("points.length must be equal to 2.");this._mode=u$Y(e.mode,0),this._acceleration=2*t$X.distance(t[1],t[0])/((i[1]-i[0])*(i[1]-i[0])),this._points=t,this._times=i,this._direction=t$X.subtract(t[1],t[0],new t$X),this._duration=this._times[1]-this._times[0],t$X.normalize(this._direction,this._direction)}function n$J(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=u$Y(e.epoch,o$11.MINIMUM_VALUE),this.tolerance=u$Y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function p$M(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}function B$A(e,t){this.rectangle=e,this.maxLevel=t}function l$P(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");var t=t$S.createIfNeeded(e.url);this._resource=t,this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer(),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var i=e.credit;"string"==typeof i&&(i=new r$1a(i)),this._credit=i,this._tilingScheme=void 0,this._rectangles=[];var r,n=this,o=u$Y(e.ellipsoid,t$V.WGS84);function a(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"===t){n._tilingScheme=new g$14({ellipsoid:o});var i=e.getElementsByTagName("TileFormat")[0];n._heightmapWidth=parseInt(i.getAttribute("width"),10),n._heightmapHeight=parseInt(i.getAttribute("height"),10),n._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(o,Math.min(n._heightmapWidth,n._heightmapHeight),n._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),a=0;a<r.length;++a){var l=r[a],u=e$27.toRadians(parseFloat(l.getAttribute("minx"))),c=e$27.toRadians(parseFloat(l.getAttribute("miny"))),h=e$27.toRadians(parseFloat(l.getAttribute("maxx"))),d=e$27.toRadians(parseFloat(l.getAttribute("maxy"))),f=parseInt(l.getAttribute("maxlevel"),10);n._rectangles.push(new B$A(new h$10(u,c,h,d),f))}n._ready=!0,n._readyPromise.resolve(!0)}else s("SRS "+t+" is not supported.")}function s(e){var t=u$Y(e,"An error occurred while accessing "+n._resource.url+".");r=l$13.handleError(r,n,n._errorEvent,t,void 0,void 0,void 0,l)}function l(){o$1q(n._resource.fetchXML(),a,s)}l()}e$1f.prototype.equals=function(e){return this===e||e$28(e)&&t$X.equals(this.translation,e.translation)&&n$14.equals(this.rotation,e.rotation)&&t$X.equals(this.scale,e.scale)},Object.defineProperties(n$K.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),n$K.prototype.clampTime=function(e){return e},n$K.prototype.evaluate=function(e,t){e$28(t)||(t=new t$X);var i,r=this._points;(e-=this._times[0],0===this._mode)?i=.5*this._acceleration*e*e:i=this._acceleration*this._duration*e-.5*this._acceleration*e*e;return t$X.multiplyByScalar(this._direction,i,t),t$X.add(r[0],t,t),t},Object.defineProperties(n$J.prototype,{clock:{get:function(){return this._clock},set:function(e){var t=this._clock;t!==e&&(e$28(t)&&(this._clockSubscription(),this._clockSubscription=void 0),e$28(e)&&(this._clockSubscription=e.onTick.addEventListener(n$J.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var t=this._element;t!==e&&(e$28(t)&&t.removeEventListener("seeked",this._seekFunction,!1),e$28(e)&&(this._seeking=!1,this._seekFunction=p$M(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),n$J.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,i$Z(this)},n$J.prototype.isDestroyed=function(){return!1},n$J.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate!==e.multiplier){var t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier}},n$J.prototype._onTick=function(e){var t=this._element;if(e$28(t)&&!(t.readyState<2)){var i=t.paused,r=e.shouldAnimate;if(r===i&&(r?t.play():t.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);this._trySetPlaybackRate(e);var n,o=e.currentTime,a=u$Y(this.epoch,o$11.MINIMUM_VALUE),s=a$12.secondsDifference(o,a),l=t.duration,u=t.currentTime;t.loop?((s%=l)<0&&(s=l-s),n=s):n=s>l?l:s<0?0:s;var c=r?u$Y(this.tolerance,1):.001;Math.abs(n-u)>c&&(this._seeking=!0,t.currentTime=n)}},Object.defineProperties(l$P.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),l$P.prototype.requestTileGeometry=function(e,t,i,r){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");var n=this._tilingScheme.getNumberOfYTilesAtLevel(i),o=this._resource.getDerivedResource({url:i+"/"+e+"/"+(n-t-1)+".tif",queryParameters:{cesium:!0},request:r}).fetchImage({preferImageBitmap:!0});if(e$28(o)){var a=this;return o$1q(o).then((function(r){return new T$S({buffer:d$11(r),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:W$I(a,e,t,i),structure:a._terrainDataStructure})}))}},l$P.prototype.getLevelMaximumGeometricError=function(e){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");return this._levelZeroMaximumGeometricError/(1<<e)};var S$C=new h$10;function W$I(e,t,i,r){for(var n=e._tilingScheme,o=e._rectangles,a=n.tileXYToRectangle(t,i,r),s=0,l=0;l<o.length&&15!==s;++l){var u=o[l];if(!(u.maxLevel<=r)){var c=u.rectangle;e$28(h$10.intersection(c,a,S$C))&&(y$H(n,c,2*t,2*i,r+1)&&(s|=4),y$H(n,c,2*t+1,2*i,r+1)&&(s|=8),y$H(n,c,2*t,2*i+1,r+1)&&(s|=1),y$H(n,c,2*t+1,2*i+1,r+1)&&(s|=2))}}return s}function y$H(e,t,i,r,n){var o=e.tileXYToRectangle(i,r,n);return e$28(h$10.intersection(o,t,S$C))}l$P.prototype.getTileDataAvailable=function(e,t,i){},l$P.prototype.loadTileDataAvailability=function(e,t,i){};var _$I={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},VulkanConstants=Object.freeze(_$I),D$O={};function x$S(e,t){return e$27.equalsEpsilon(e.latitude,t.latitude,e$27.EPSILON10)&&e$27.equalsEpsilon(e.longitude,t.longitude,e$27.EPSILON10)}var M$O=new t$W,R$G=new t$W;function U$M(e,t,i,r){var n=(t=D$Z(t,t$X.equalsEpsilon)).length;if(!(n<2)){var o=e$28(r),a=e$28(i),s=!0,l=new Array(n),u=new Array(n),c=new Array(n),h=t[0];l[0]=h;var d=e.cartesianToCartographic(h,M$O);a&&(d.height=i[0]),s=s&&0==d.height,u[0]=d.height,c[0]=o?r[0]:0;for(var f=1,p=1;p<n;++p){var _=t[p],m=e.cartesianToCartographic(_,R$G);a&&(m.height=i[p]),s=s&&0==m.height,x$S(d,m)?d.height<m.height&&(u[f-1]=m.height):(l[f]=_,u[f]=m.height,c[f]=o?r[p]:0,t$W.clone(m,d),++f)}if(!(s||f<2))return l.length=f,u.length=f,c.length=f,{positions:l,topHeights:u,bottomHeights:c}}}var z$D=new Array(2),G$S=new Array(2),W$H={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};function O$B(e,t){for(var i=new Array(e.length),r=0;r<e.length;r+=3){var n=new t$X(e[r],e[r+1],e[r+2]);y$15.multiplyByPoint(t,n,n),i[r]=n.x,i[r+1]=n.y,i[r+2]=n.z}return i}D$O.computePositions=function(e,t,i,r,n,o,a){var s=U$M(e,t,i,r);if(e$28(s)){var l=m$1b.eastNorthUpToFixedFrame(s.positions[0],e,new y$15),u=y$15.inverse(l,new y$15);t=s.positions,i=s.topHeights,r=s.bottomHeights;var c,h,d,f,p=t.length,_=p-2,m=e$27.chordLength(n,e.maximumRadius),$=W$H;if($.minDistance=m,$.ellipsoid=e,o){var g,v=0;for(g=0;g<p-1;g++)v+=m$U.numberOfPoints(t[g],t[g+1],m)+1;c=new Float64Array(3*v),h=new Float64Array(3*v),e$28(a)&&(d=new Float64Array(3*v),f=new Float64Array(3*v));var y=z$D,x=G$S;$.positions=y,$.height=x;var b=0;for(g=0;g<p-1;g++){y[0]=t[g],y[1]=t[g+1],x[0]=i[g],x[1]=i[g+1];var w=m$U.generateArc($);c.set(w,b),e$28(a)&&d.set(O$B(w,u),b),x[0]=r[g],x[1]=r[g+1],h.set(m$U.generateArc($),b),e$28(a)&&f.set(O$B(m$U.generateArc($),u),b),b+=w.length}}else $.positions=t,$.height=i,c=new Float64Array(m$U.generateArc($)),e$28(a)&&(d=new Float64Array(O$B(m$U.generateArc($)))),$.height=r,h=new Float64Array(m$U.generateArc($)),e$28(a)&&(f=new Float64Array(O$B(m$U.generateArc($))));var C={pos:{bottomPositions:h,topPositions:c,numCorners:_}};return e$28(a)&&(C.localPos={bottomPositions:f,topPositions:d,numCorners:_}),C}};var $$J=new t$X,U$L=new t$X,re$v=new t$X,ye$p=new t$X,ne$D=new t$X,be$q=new t$X,Fe$g=new t$X,Ce$l=new t$X;function E$R(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights;if(!e$28(t))throw new t$Z("options.positions is required.");if(e$28(i)&&i.length!==t.length)throw new t$Z("options.positions and options.maximumHeights must have the same length.");if(e$28(r)&&r.length!==t.length)throw new t$Z("options.positions and options.minimumHeights must have the same length.");var n=u$Y(e.vertexFormat,n$10.DEFAULT),o=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),a=u$Y(e.ellipsoid,t$V.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._vertexFormat=n$10.clone(n),this._granularity=o,this._ellipsoid=t$V.clone(a),this._enuCenter=e.enuCenter,this._workerName="createWallGeometry";var s=1+t.length*t$X.packedLength+2;e$28(r)&&(s+=r.length),e$28(i)&&(s+=i.length),this.packedLength=s+t$V.packedLength+n$10.packedLength+1,this.packedLength+=t$X.packedLength}E$R.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._minimumHeights;if(o=e$28(a)?a.length:0,t[i++]=o,e$28(a))for(r=0;r<o;++r)t[i++]=a[r];var s=e._maximumHeights;if(o=e$28(s)?s.length:0,t[i++]=o,e$28(s))for(r=0;r<o;++r)t[i++]=s[r];return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,n$10.pack(e._vertexFormat,t,i),i+=n$10.packedLength,t[i++]=e._granularity,e$28(e._enuCenter)?t$X.pack(e._enuCenter,t,i):t$X.pack(t$X.ZERO,t,i),t};var ae$u=t$V.clone(t$V.UNIT_SPHERE),oe$s=new n$10,N$D={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ae$u,vertexFormat:oe$s,granularity:void 0,enuCenter:void 0};E$R.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n,o,a=e[t++],s=new Array(a);for(r=0;r<a;++r,t+=t$X.packedLength)s[r]=t$X.unpack(e,t);if((a=e[t++])>0)for(n=new Array(a),r=0;r<a;++r)n[r]=e[t++];if((a=e[t++])>0)for(o=new Array(a),r=0;r<a;++r)o[r]=e[t++];var l=t$V.unpack(e,t,ae$u);t+=t$V.packedLength;var u=n$10.unpack(e,t,oe$s);t+=n$10.packedLength;var c=e[t++],h=t$X.unpack(e,t);return t$X.equals(h,t$X.ZERO)&&(h=void 0),e$28(i)?(i._positions=s,i._minimumHeights=n,i._maximumHeights=o,i._ellipsoid=t$V.clone(l,i._ellipsoid),i._vertexFormat=n$10.clone(u,i._vertexFormat),i._granularity=c,i._enuCenter=h,i):(N$D.positions=s,N$D.minimumHeights=n,N$D.maximumHeights=o,N$D.granularity=c,N$D.enuCenter=h,new E$R(N$D))},E$R.fromConstantHeights=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions;if(!e$28(t))throw new t$Z("options.positions is required.");var i,r,n=e.minimumHeight,o=e.maximumHeight,a=e$28(n),s=e$28(o);if(a||s){var l=t.length;i=a?new Array(l):void 0,r=s?new Array(l):void 0;for(var u=0;u<l;++u)a&&(i[u]=n),s&&(r[u]=o)}return new E$R({positions:t,maximumHeights:r,minimumHeights:i,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},E$R.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._vertexFormat,o=e._granularity,a=e._ellipsoid,s=e._enuCenter,l=D$O.computePositions(a,t,r,i,o,!0,s);if(e$28(l.pos)){var u;e$28(s)&&(u=m$1b.eastNorthUpToFixedFrame(s));var c,h=l.pos.bottomPositions,d=l.pos.topPositions,f=l.pos.numCorners,p=d.length,_=2*p,m=n.position?new Float64Array(_):void 0,$=n.normal?new Float32Array(_):void 0,g=n.tangent?new Float32Array(_):void 0,v=n.bitangent?new Float32Array(_):void 0,y=n.st?new Float32Array(_/3*2):void 0,x=0,b=0,w=0,C=0,T=0,S=Ce$l,E=Fe$g,A=be$q,P=!0,I=0,M=1/((p/=3)-t.length+1);for(c=0;c<p;++c){var O=3*c,D=t$X.fromArray(d,O,$$J),R=t$X.fromArray(h,O,U$L);if(n.position&&(m[x++]=R.x,m[x++]=R.y,m[x++]=R.z,m[x++]=D.x,m[x++]=D.y,m[x++]=D.z),n.st&&(y[T++]=I,y[T++]=0,y[T++]=I,y[T++]=1),n.normal||n.tangent||n.bitangent){var L,B=t$X.clone(t$X.ZERO,ne$D),N=a.scaleToGeodeticSurface(t$X.fromArray(d,O,U$L),U$L);if(c+1<p&&(L=a.scaleToGeodeticSurface(t$X.fromArray(d,O+3,re$v),re$v),B=t$X.fromArray(d,O+3,ne$D)),P){var F=t$X.subtract(B,D,ye$p),z=t$X.subtract(N,D,$$J);S=t$X.normalize(t$X.cross(z,F,S),S),P=!1}t$X.equalsEpsilon(L,N,e$27.EPSILON10)?P=!0:(I+=M,n.tangent&&(E=t$X.normalize(t$X.subtract(L,N,E),E)),n.bitangent&&(A=t$X.normalize(t$X.cross(S,E,A),A))),n.normal&&(e$28(s)&&(y$15.multiplyByPoint(u,S,S),t$X.normalize(S,S)),$[b++]=S.x,$[b++]=S.y,$[b++]=S.z,$[b++]=S.x,$[b++]=S.y,$[b++]=S.z),n.tangent&&(g[C++]=E.x,g[C++]=E.y,g[C++]=E.z,g[C++]=E.x,g[C++]=E.y,g[C++]=E.z),n.bitangent&&(v[w++]=A.x,v[w++]=A.y,v[w++]=A.z,v[w++]=A.x,v[w++]=A.y,v[w++]=A.z)}}var k=new a$_;n.position&&(k.position=new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:m})),n.normal&&(k.normal=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:$})),n.tangent&&(k.tangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:g})),n.bitangent&&(k.bitangent=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:v})),n.st&&(k.st=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:y}));var V=_/3;_-=6*(f+1);var U=ce$v.createTypedArray(V,_),X=0;for(c=0;c<V-2;c+=2){var H=c,G=c+2,W=t$X.fromArray(m,3*H,$$J),Y=t$X.fromArray(m,3*G,U$L);if(!t$X.equalsEpsilon(W,Y,e$27.EPSILON10)){var q=c+1,j=c+3;U[X++]=q,U[X++]=H,U[X++]=j,U[X++]=j,U[X++]=H,U[X++]=G}}var Z=new I$1n({attributes:k,indices:U,primitiveType:W$_.TRIANGLES,boundingSphere:new i$19.fromVertices(m)});return e$28(e._enuCenter)&&(Z.attributes.position.values.set(l.localPos.topPositions,0),Z.attributes.position.values.set(l.localPos.bottomPositions,Z.attributes.position.values.length/2),Z.attributes.position.componentDatatype=S$W.FLOAT),Z}};var z$C=new t$X,C$I=new t$X;function P$L(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights;if(!e$28(t))throw new t$Z("options.positions is required.");if(e$28(i)&&i.length!==t.length)throw new t$Z("options.positions and options.maximumHeights must have the same length.");if(e$28(r)&&r.length!==t.length)throw new t$Z("options.positions and options.minimumHeights must have the same length.");var n=u$Y(e.granularity,e$27.RADIANS_PER_DEGREE),o=u$Y(e.ellipsoid,t$V.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._granularity=n,this._ellipsoid=t$V.clone(o),this._workerName="createWallOutlineGeometry",this._outlineWidth=u$Y(e.outlineWidth,1);var a=1+t.length*t$X.packedLength+2;e$28(r)&&(a+=r.length),e$28(i)&&(a+=i.length),this.packedLength=a+t$V.packedLength+2}P$L.pack=function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");i=u$Y(i,0);var r,n=e._positions,o=n.length;for(t[i++]=o,r=0;r<o;++r,i+=t$X.packedLength)t$X.pack(n[r],t,i);var a=e._minimumHeights;if(o=e$28(a)?a.length:0,t[i++]=o,e$28(a))for(r=0;r<o;++r)t[i++]=a[r];var s=e._maximumHeights;if(o=e$28(s)?s.length:0,t[i++]=o,e$28(s))for(r=0;r<o;++r)t[i++]=s[r];return t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,t[i++]=e._granularity,t[i]=e._outlineWidth,t};var M$N=t$V.clone(t$V.UNIT_SPHERE),k$L={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:M$N,granularity:void 0,outlineWidth:void 0};function t$B(e){switch(e){case de$y.FLOAT:return"float";case de$y.FLOAT_VEC2:return"vec2";case de$y.FLOAT_VEC3:return"vec3";case de$y.FLOAT_VEC4:return"vec4";case de$y.FLOAT_MAT2:return"mat2";case de$y.FLOAT_MAT3:return"mat3";case de$y.FLOAT_MAT4:return"mat4";case de$y.SAMPLER_2D:return"sampler2D";case de$y.BOOL:return"bool"}}P$L.unpack=function(e,t,i){if(!e$28(e))throw new t$Z("array is required");t=u$Y(t,0);var r,n,o,a=e[t++],s=new Array(a);for(r=0;r<a;++r,t+=t$X.packedLength)s[r]=t$X.unpack(e,t);if((a=e[t++])>0)for(n=new Array(a),r=0;r<a;++r)n[r]=e[t++];if((a=e[t++])>0)for(o=new Array(a),r=0;r<a;++r)o[r]=e[t++];var l=t$V.unpack(e,t,M$N);t+=t$V.packedLength;var u=e[t++],c=e[t];return e$28(i)?(i._positions=s,i._minimumHeights=n,i._maximumHeights=o,i._ellipsoid=t$V.clone(l,i._ellipsoid),i._granularity=u,i._outlineWidth=c,i):(k$L.positions=s,k$L.minimumHeights=n,k$L.maximumHeights=o,k$L.granularity=u,k$L.outlineWidth=c,new P$L(k$L))},P$L.fromConstantHeights=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).positions;if(!e$28(t))throw new t$Z("options.positions is required.");var i,r,n=e.minimumHeight,o=e.maximumHeight,a=e$28(n),s=e$28(o);if(a||s){var l=t.length;i=a?new Array(l):void 0,r=s?new Array(l):void 0;for(var u=0;u<l;++u)a&&(i[u]=n),s&&(r[u]=o)}return new P$L({positions:t,maximumHeights:r,minimumHeights:i,ellipsoid:e.ellipsoid})},P$L.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._granularity,o=e._ellipsoid,a=D$O.computePositions(o,t,r,i,n,!1);if(!e$28(a))return;var s=a.pos.bottomPositions,l=a.pos.topPositions,u=l.length;let c=u/3;var h=3*(2*(2*c-2)+1),d=new Float64Array(h),f=0;let p,_,m;for(u=c,p=0;p<u;++p){var $=3*p;_=t$X.fromArray(l,$,z$C),m=t$X.fromArray(s,$,C$I),0!==p&&(d[f++]=_.x,d[f++]=_.y,d[f++]=_.z),d[f++]=m.x,d[f++]=m.y,d[f++]=m.z,d[f++]=_.x,d[f++]=_.y,d[f++]=_.z}for(f-=3,p=u-2;p>=0;--p){$=3*p;m=t$X.fromArray(s,$,C$I),d[f++]=m.x,d[f++]=m.y,d[f++]=m.z}let g=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:d})});g.sideness=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:new Float32Array([0,0,0,1,1,1,1,0])}),g.sideness.isInstanceAttribute=!0;var v=h/3;h=2*v-4+v;var y=ce$v.createTypedArray(v,h),x=0;for(p=0;p<v-2;p+=2){var b=p,w=p+2,C=t$X.fromArray(d,3*b,z$C),T=t$X.fromArray(d,3*w,C$I);if(!t$X.equalsEpsilon(C,T,e$27.EPSILON10)){var S=p+1,E=p+3;y[x++]=S,y[x++]=b,y[x++]=S,y[x++]=E,y[x++]=b,y[x++]=w}}return y[x++]=v-2,y[x++]=v-1,new I$1n({attributes:g,indices:y,primitiveType:W$_.TRIANGLES,boundingSphere:new i$19.fromVertices(d)})};var u$D={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3};function l$O(e,t,i){this._url=e,this._maximumActiveTasks=u$Y(i.maximumActiveTasks,100),this._activeTasks=0,this._deferreds={},this._nextID=0,this._event=t,this._enableHeartCheck=u$Y(i.enableHeartCheck,!1),this._heartTimeOut=u$Y(i.heartTimeOut,1e4),this._createWS(t)}function x$R(e,t){if(t instanceof ArrayBuffer){--e._activeTasks;var i=new DataView(t).getInt32(0,!0);if(!e$28(i))return;var r=e._deferreds,n=r[i];if(e$28(n)){if("blob"===n.binaryType)4===t.byteLength?n.reject(404):n.resolve(new Blob([t.slice(4,t.byteLength)]));else if("arraybuffer"===n.binaryType)if(4===t.byteLength)n.reject(404);else{var o=t.slice(4,t.byteLength);n.extratiles?n.progress(o):n.resolve(o)}else{t=t.slice(4,t.byteLength);var a=a$Z(new Uint8Array(t));if("json"===n.binaryType){var s=JSON.parse(a);n.resolve(s)}else n.resolve(a)}!0!==n.extratiles&&delete r[i]}}}function m$L(e,t,i,r){var n;return-1!==t.indexOf("extratiles=")?(r.extratiles=!0,n={id:e,binaryType:u$Y(i,"blob"),tileName:t.substring(0,t.indexOf("?")),extraTiles:t.substring(t.indexOf("extratiles=")+11)}):(r.extratiles=!1,n={id:e,binaryType:u$Y(i,"blob"),tileName:t}),JSON.stringify(n)}function r$L(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).weights,i=e.times;if(o$1u.defined("weights",t),o$1u.defined("times",i),o$1u.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%i.length!=0)throw new t$Z("times.length must be a factor of weights.length.");this._times=i,this._weights=t,this._count=t.length/i.length,this._lastTimeIndex=0}function e$1e(e,t,i){if("function"!=typeof t)throw new t$Z("oldFunction is required to be a function.");if("function"!=typeof i)throw new t$Z("oldFunction is required to be a function.");return function(){i.apply(e,arguments),t.apply(e,arguments)}}function e$1d(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new o$1o,this.setValue(e)}function u$C(e,t,i,r,n){return{configurable:r,get:function(){return this[t]},set:function(r){var o=this[t],a=this[i];e$28(a)&&(a(),this[i]=void 0),void 0!==r&&(!e$28(r)||!e$28(r.getValue))&&e$28(n)&&(r=n(r)),o!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,o)),e$28(r)&&e$28(r.definitionChanged)&&(this[i]=r.definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this,e,r,r)}),this))}}}function p$L(e){return new e$1d(e)}function C$H(e,t,i){return u$C(e,"_"+e.toString(),"_"+e.toString()+"Subscription",u$Y(t,!1),u$Y(i,p$L))}function n$I(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}l$O.prototype.scheduleTask=function(e,t){var i=this;if(!this.isOpened()){var r=o$1q.defer();return this._event.addEventListener((function(n){if(n===u$D.OPEN){++i._activeTasks;var o=i,a=o._nextID++;o._deferreds[a]=r,r.binaryType=t;var s=m$L(a,e,t,r);o._ws.send(s)}})),r.promise}if(!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this,o=n._nextID++;r=o$1q.defer();n._deferreds[o]=r,r.binaryType=t;var a=m$L(o,e,t,r);return n._ws.send(a),r.promise}},l$O.prototype._createWS=function(e){this._ws=new WebSocket(this._url),this._ws.binaryType="arraybuffer";var t=this;this._ws.onopen=function(){e.raiseEvent(u$D.OPEN)},this._ws.onclose=function(){e.raiseEvent(u$D.CLOSED)},this._ws.onerror=function(){error=new t$U("open failure"),e.raiseEvent(error)},this._ws.onmessage=function(e){x$R(t,e.data)}},l$O.prototype.isOpened=function(){return this._ws&&this._ws.readyState===u$D.OPEN},l$O.prototype.close=function(){this._ws.close()},Object.defineProperties(r$L.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),r$L.prototype.findTimeInterval=n$_.prototype.findTimeInterval,r$L.prototype.wrapTime=n$_.prototype.wrapTime,r$L.prototype.clampTime=n$_.prototype.clampTime,r$L.prototype.evaluate=function(e,t){var i=this.weights,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-r[n])/(r[n+1]-r[n]);e$28(t)||(t=new Array(this._count));for(var a=0;a<this._count;a++){var s=n*this._count+a;t[a]=i[s]*(1-o)+i[s+this._count]*o}return t},Object.defineProperties(e$1d.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),e$1d.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},e$1d.prototype.setValue=function(e){var t=this._value;if(t!==e){var i=e$28(e),r=i&&"function"==typeof e.clone,n=i&&"function"==typeof e.equals;(!n||!e.equals(t))&&(this._hasClone=r,this._hasEquals=n,this._value=r?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}},e$1d.prototype.equals=function(e){return this===e||e instanceof e$1d&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},e$1d.prototype.valueOf=function(){return this._value},e$1d.prototype.toString=function(){return String(this._value)},Object.defineProperties(n$I.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),image:C$H("image"),scale:C$H("scale"),pixelOffset:C$H("pixelOffset"),eyeOffset:C$H("eyeOffset"),horizontalOrigin:C$H("horizontalOrigin"),verticalOrigin:C$H("verticalOrigin"),heightReference:C$H("heightReference"),color:C$H("color"),rotation:C$H("rotation"),alignedAxis:C$H("alignedAxis"),sizeInMeters:C$H("sizeInMeters"),width:C$H("width"),height:C$H("height"),scaleByDistance:C$H("scaleByDistance"),translucencyByDistance:C$H("translucencyByDistance"),pixelOffsetScaleByDistance:C$H("pixelOffsetScaleByDistance"),imageSubRegion:C$H("imageSubRegion"),distanceDisplayCondition:C$H("distanceDisplayCondition"),disableDepthTestDistance:C$H("disableDepthTestDistance")}),n$I.prototype.clone=function(e){return e$28(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new n$I(this)},n$I.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this._show,e.show),this.image=u$Y(this._image,e.image),this.scale=u$Y(this._scale,e.scale),this.pixelOffset=u$Y(this._pixelOffset,e.pixelOffset),this.eyeOffset=u$Y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=u$Y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=u$Y(this._verticalOrigin,e.verticalOrigin),this.heightReference=u$Y(this._heightReference,e.heightReference),this.color=u$Y(this._color,e.color),this.rotation=u$Y(this._rotation,e.rotation),this.alignedAxis=u$Y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=u$Y(this._sizeInMeters,e.sizeInMeters),this.width=u$Y(this._width,e.width),this.height=u$Y(this._height,e.height),this.scaleByDistance=u$Y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=u$Y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=u$Y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=u$Y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=u$Y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=u$Y(this._disableDepthTestDistance,e.disableDepthTestDistance)};var e$1c={DONE:0,PENDING:1,FAILED:2},A$U=Object.freeze(e$1c);function r$K(){t$Z.throwInstantiationError()}Object.defineProperties(r$K.prototype,{isConstant:{get:t$Z.throwInstantiationError},definitionChanged:{get:t$Z.throwInstantiationError}}),r$K.prototype.getValue=t$Z.throwInstantiationError,r$K.prototype.equals=t$Z.throwInstantiationError,r$K.equals=function(e,t){return e===t||e$28(e)&&e.equals(t)},r$K.arrayEquals=function(e,t){if(e===t)return!0;if(!e$28(e)||!e$28(t)||e.length!==t.length)return!1;for(var i=e.length,r=0;r<i;r++)if(!r$K.equals(e[r],t[r]))return!1;return!0},r$K.isConstant=function(e){return!e$28(e)||e.isConstant},r$K.getValueOrUndefined=function(e,t,i){return e$28(e)?e.getValue(t,i):void 0},r$K.getValueOrDefault=function(e,t,i,r){return e$28(e)?u$Y(e.getValue(t,r),i):i},r$K.getValueOrClonedDefault=function(e,t,i,r){var n;return e$28(e)&&(n=e.getValue(t,r)),e$28(n)||(n=i.clone(n)),n};var U$K=e$1S.WHITE,z$B=t$X.ZERO,A$T=k$_.NONE,I$10=o$1k.ZERO,P$K=1,q$P=0,H$J=t$X.ZERO,T$F=j$13.CENTER,L$X=S$L.CENTER,M$M=!1,Z$M=new t$X,F$S=new e$1S,j$K=new t$X,W$G=new o$1k,k$K=new o$1b,J$N=new o$1b,K$E=new o$1b,Q$K=new f$10,X$A=new r$10;function C$G(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function g$F(e,t){if(!e$28(e))throw new t$Z("entityCluster is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(g$F.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new e$1P,this._onCollectionChanged(t,t.values,[],[])}function p$K(e,t,i){e$28(e)&&(e.billboard=void 0,i.removeBillboard(t))}g$F.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var o,a,s=t[r],l=s.entity,u=l._billboard,c=s.billboard,h=l.isShowing&&l.isAvailable(e)&&r$K.getValueOrDefault(u._show,e,!0);if(h&&(a=r$K.getValueOrUndefined(l._position,e,Z$M),o=r$K.getValueOrUndefined(u._image,e),h=e$28(a)&&e$28(o)),h){r$K.isConstant(l._position)||(i._clusterDirty=!0),e$28(c)||((c=i.getBillboard(l)).id=l,c.image=void 0,s.billboard=c),c.show=h,(!e$28(c.image)||s.textureValue!==o)&&(c.image=o,s.textureValue=o),c.position=a,c.color=r$K.getValueOrDefault(u._color,e,U$K,F$S),c.eyeOffset=r$K.getValueOrDefault(u._eyeOffset,e,z$B,j$K),c.heightReference=r$K.getValueOrDefault(u._heightReference,e,A$T),c.pixelOffset=r$K.getValueOrDefault(u._pixelOffset,e,I$10,W$G),c.scale=r$K.getValueOrDefault(u._scale,e,P$K),c.rotation=r$K.getValueOrDefault(u._rotation,e,q$P),c.alignedAxis=r$K.getValueOrDefault(u._alignedAxis,e,H$J),c.horizontalOrigin=r$K.getValueOrDefault(u._horizontalOrigin,e,T$F),c.verticalOrigin=r$K.getValueOrDefault(u._verticalOrigin,e,L$X),c.width=r$K.getValueOrUndefined(u._width,e),c.height=r$K.getValueOrUndefined(u._height,e),c.scaleByDistance=r$K.getValueOrUndefined(u._scaleByDistance,e,k$K),c.translucencyByDistance=r$K.getValueOrUndefined(u._translucencyByDistance,e,J$N),c.pixelOffsetScaleByDistance=r$K.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,K$E),c.sizeInMeters=r$K.getValueOrDefault(u._sizeInMeters,e,M$M),c.distanceDisplayCondition=r$K.getValueOrUndefined(u._distanceDisplayCondition,e,X$A),c.disableDepthTestDistance=r$K.getValueOrUndefined(u._disableDepthTestDistance,e);var d=r$K.getValueOrUndefined(u._imageSubRegion,e,Q$K);e$28(d)&&c.setImageSubRegion(c._imageId,d)}else p$K(s,l,i)}return!0},g$F.prototype.getBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(t))throw new t$Z("result is required.");var i=this._items.get(e.id);if(!e$28(i)||!e$28(i.billboard))return A$U.FAILED;var r=i.billboard;if(r.heightReference===k$_.NONE)t.center=t$X.clone(r.position,t.center);else{if(!e$28(r._clampedPosition))return A$U.PENDING;t.center=t$X.clone(r._clampedPosition,t.center)}return t.radius=0,A$U.DONE},g$F.prototype.isDestroyed=function(){return!1},g$F.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g$F.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return i$Z(this)},g$F.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a=this._items,s=this._cluster;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._billboard)&&e$28(o._position)&&a.set(o.id,new C$G(o));for(n=r.length-1;n>-1;n--)e$28((o=r[n])._billboard)&&e$28(o._position)?a.contains(o.id)||a.set(o.id,new C$G(o)):(p$K(a.get(o.id),o,s),a.remove(o.id));for(n=i.length-1;n>-1;n--)o=i[n],p$K(a.get(o.id),o,s),a.remove(o.id)};var f$O="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",d$U="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",i$J="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",l$N="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",m$K="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",h$I="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",_$H="attribute vec3 position;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = vec4(position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjection * p;\n}\n",g$E="attribute vec3 position;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = vec4(position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjection * p;\n}\n";function a$P(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.material=e.material,this.translucent=u$Y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=u$Y(e.closed,!1)}function P$J(e,t,i,r,n,o,a,s,l,u,c){this._context=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelDatatype=a,this._internalFormat=n,this._pixelFormat=o,this._size=s,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=c}function X$z(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context);const t=e.context,i=e.source;let r,n;if(e$28(i)){const e=[i.positiveX,i.negativeX,i.positiveY,i.negativeY,i.positiveZ,i.negativeZ];if(!(e[0]&&e[1]&&e[2]&&e[3]&&e[4]&&e[5]))throw new t$Z("options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.");r=e[0].width,n=e[0].height;for(let t=1;t<6;++t)if(Number(e[t].width)!==r||Number(e[t].height)!==n)throw new t$Z("Each face in options.source must have the same width and height.")}else r=e.width,n=e.height;const o=r,a=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE),s=u$Y(e.pixelFormat,V$O.RGBA),l=V$O.toInternalFormat(s,a,t);if(!e$28(r)||!e$28(n))throw new t$Z("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(r!==n)throw new t$Z("Width must equal height.");if(o<=0)throw new t$Z("Width and height must be greater than zero.");if(o>e$1U.maximumCubeMapSize)throw new t$Z(`Width and height must be less than or equal to the maximum cube map size (${e$1U.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!V$O.validate(s))throw new t$Z("Invalid options.pixelFormat.");if(V$O.isDepthFormat(s))throw new t$Z("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!y$U.validate(a))throw new t$Z("Invalid options.pixelDatatype.");if(a===y$U.FLOAT&&!t.floatingPointTexture)throw new t$Z("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(a===y$U.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new t$Z("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");const u=6*V$O.textureSizeInBytes(s,a,o,o),c=e.preMultiplyAlpha||s===V$O.RGB||s===V$O.LUMINANCE,h=u$Y(e.flipY,!0),d=u$Y(e.skipColorSpaceConversion,!1),f=t._gl,p=f.TEXTURE_CUBE_MAP,_=f.createTexture();function m(e,i,n,u,c){let h=i.arrayBufferView;e$28(h)||(h=i.bufferView);let d=4;e$28(h)&&(d=V$O.alignmentInBytes(s,a,r)),f.pixelStorei(f.UNPACK_ALIGNMENT,d),c?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),e$28(h)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),u&&(h=V$O.flipY(h,s,a,o,o)),f.texImage2D(e,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),h)):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,u),f.texImage2D(e,0,l,s,y$U.toWebGLConstant(a,t),i))}f.activeTexture(f.TEXTURE0),f.bindTexture(p,_),e$28(i)?(m(f.TEXTURE_CUBE_MAP_POSITIVE_X,i.positiveX,c,h,d),m(f.TEXTURE_CUBE_MAP_NEGATIVE_X,i.negativeX,c,h,d),m(f.TEXTURE_CUBE_MAP_POSITIVE_Y,i.positiveY,c,h,d),m(f.TEXTURE_CUBE_MAP_NEGATIVE_Y,i.negativeY,c,h,d),m(f.TEXTURE_CUBE_MAP_POSITIVE_Z,i.positiveZ,c,h,d),m(f.TEXTURE_CUBE_MAP_NEGATIVE_Z,i.negativeZ,c,h,d)):(f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_X,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_Y,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null),f.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_Z,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null),f.texImage2D(f.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,l,o,o,0,s,y$U.toWebGLConstant(a,t),null)),f.bindTexture(p,null),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=p,this._texture=_,this._pixelFormat=s,this._pixelDatatype=a,this._size=o,this._hasMipmap=!1,this._sizeInBytes=u,this._preMultiplyAlpha=c,this._flipY=h,this._sampler=void 0;const $=e$28(i);this._positiveX=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_POSITIVE_X,l,s,a,o,c,h,$),this._negativeX=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_NEGATIVE_X,l,s,a,o,c,h,$),this._positiveY=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_POSITIVE_Y,l,s,a,o,c,h,$),this._negativeY=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_NEGATIVE_Y,l,s,a,o,c,h,$),this._positiveZ=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_POSITIVE_Z,l,s,a,o,c,h,$),this._negativeZ=new P$J(t,_,p,f.TEXTURE_CUBE_MAP_NEGATIVE_Z,l,s,a,o,c,h,$),this.sampler=e$28(e.sampler)?e.sampler:new n$Y}Object.defineProperties(a$P.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),a$P.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),e$28(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},a$P.prototype.isTranslucent=function(){return e$28(this.material)&&this.material.isTranslucent()||!e$28(this.material)&&this.translucent},a$P.prototype.getRenderState=function(){var e=this.isTranslucent(),t=l$1e(this.renderState,!1);return e?(t.depthMask=!1,t.blending=Ee$n.ALPHA_BLEND):t.depthMask=!0,t},a$P.getDefaultRenderState=function(e,t,i){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=Ee$n.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:k$11.BACK}),e$28(i)&&(r=p$17(i,r,!0)),r},Object.defineProperties(P$J.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),P$J.prototype.copyFrom=function(e){o$1u.defined("options",e);const t=u$Y(e.xOffset,0),i=u$Y(e.yOffset,0);if(o$1u.defined("options.source",e.source),o$1u.typeOf.number.greaterThanOrEquals("xOffset",t,0),o$1u.typeOf.number.greaterThanOrEquals("yOffset",i,0),t+e.source.width>this._size)throw new t$Z("xOffset + options.source.width must be less than or equal to width.");if(i+e.source.height>this._size)throw new t$Z("yOffset + options.source.height must be less than or equal to height.");const r=e.source,n=this._context._gl,o=this._textureTarget,a=this._targetFace;n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture);const s=r.width,l=r.height;let u=r.arrayBufferView;const c=this._size,h=this._pixelFormat,d=this._internalFormat,f=this._pixelDatatype,p=this._preMultiplyAlpha,_=this._flipY,m=u$Y(e.skipColorSpaceConversion,!1);let $=4;e$28(u)&&($=V$O.alignmentInBytes(h,f,s)),n.pixelStorei(n.UNPACK_ALIGNMENT,$),m?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);let g=!1;if(!this._initialized){if(0===t&&0===i&&s===c&&l===c)e$28(u)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=V$O.flipY(u,h,f,c,c)),n.texImage2D(a,0,d,c,c,0,h,y$U.toWebGLConstant(f,this._context),u)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,_),n.texImage2D(a,0,d,h,y$U.toWebGLConstant(f,this._context),r)),g=!0;else{n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const e=V$O.createTypedArray(h,f,c,c);n.texImage2D(a,0,d,c,c,0,h,y$U.toWebGLConstant(f,this._context),e)}this._initialized=!0}g||(e$28(u)?(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=V$O.flipY(u,h,f,s,l)),n.texSubImage2D(a,0,t,i,s,l,h,y$U.toWebGLConstant(f,this._context),u)):(n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,p),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,_),n.texSubImage2D(a,0,t,i,h,y$U.toWebGLConstant(f,this._context),r))),n.bindTexture(o,null)},P$J.prototype.copyFromFramebuffer=function(e,t,i,r,n,o){if(e=u$Y(e,0),t=u$Y(t,0),i=u$Y(i,0),r=u$Y(r,0),n=u$Y(n,this._size),o=u$Y(o,this._size),o$1u.typeOf.number.greaterThanOrEquals("xOffset",e,0),o$1u.typeOf.number.greaterThanOrEquals("yOffset",t,0),o$1u.typeOf.number.greaterThanOrEquals("framebufferXOffset",i,0),o$1u.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),e+n>this._size)throw new t$Z("xOffset + source.width must be less than or equal to width.");if(t+o>this._size)throw new t$Z("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===y$U.FLOAT)throw new t$Z("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===y$U.HALF_FLOAT)throw new t$Z("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");const a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,i,r,n,o),a.bindTexture(s,null),this._initialized=!0},Object.defineProperties(X$z.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){let t=e.minificationFilter,i=e.magnificationFilter;const r=t===tt$h.NEAREST_MIPMAP_NEAREST||t===tt$h.NEAREST_MIPMAP_LINEAR||t===tt$h.LINEAR_MIPMAP_NEAREST||t===tt$h.LINEAR_MIPMAP_LINEAR,n=this._context,o=this._pixelDatatype;(o===y$U.FLOAT&&!n.textureFloatLinear||o===y$U.HALF_FLOAT&&!n.textureHalfFloatLinear)&&(t=r?tt$h.NEAREST_MIPMAP_NEAREST:tt$h.NEAREST,i=rt$g.NEAREST);const a=n._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,t),a.texParameteri(s,a.TEXTURE_MAG_FILTER,i),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),e$28(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),X$z.prototype.generateMipmap=function(e){if(e=u$Y(e,S$N.DONT_CARE),this._size>1&&!e$27.isPowerOfTwo(this._size))throw new t$Z("width and height must be a power of two to call generateMipmap().");if(!S$N.validate(e))throw new t$Z("hint is invalid.");this._hasMipmap=!0;const t=this._context._gl,i=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i),t.bindTexture(i,null)},X$z.prototype.isDestroyed=function(){return!1},X$z.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=i$Z(this._positiveX),this._negativeX=i$Z(this._negativeX),this._positiveY=i$Z(this._positiveY),this._negativeY=i$Z(this._negativeY),this._positiveZ=i$Z(this._positiveZ),this._negativeZ=i$Z(this._negativeZ),i$Z(this)};var Z$L="uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",j$J="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n",J$M="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",$$I="uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",q$O="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat distanceToContour = mod(materialInput.height, spacing);\n#ifdef GL_OES_standard_derivatives\nfloat dxc = abs(dFdx(materialInput.height));\nfloat dyc = abs(dFdy(materialInput.height));\nfloat dF = max(dxc, dyc) * czm_pixelRatio * width;\nfloat alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\nfloat alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n#endif\nvec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha));\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",K$D="uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\nvec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",U$J="uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\ncolor = czm_gammaCorrect(color);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",Q$J="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec4 halfColor;\nhalfColor.rgb = color.rgb * 0.5;\nhalfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nhalfColor = czm_gammaCorrect(halfColor);\nmaterial.diffuse = halfColor.rgb;\nmaterial.emission = halfColor.rgb;\nmaterial.alpha = halfColor.a;\nreturn material;\n}\n",V$E="uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n",ee$x="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n#else\nfloat base = 0.975;\n#endif\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\noutColor = czm_gammaCorrect(outColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",te$B="uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n",ae$t="uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nif (taperPower <= 0.99999) {\nglow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n}\nglow = clamp(0.0, 2.0, glow);\nvec4 fragColor;\nfragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nfragColor.a = clamp(0.0, 1.0, glow) * color.a;\nfragColor = czm_gammaCorrect(fragColor);\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n",R$F="uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\noutColor = czm_gammaCorrect(outColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n",re$u="uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nvec4 outColor = czm_gammaCorrect(color);\nvec4 outRimColor = czm_gammaCorrect(rimColor);\nmaterial.diffuse = outColor.rgb;\nmaterial.emission = outRimColor.rgb * s;\nmaterial.alpha = mix(outColor.a, outRimColor.a, s);\nreturn material;\n}\n",ie$w="uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\nrampColor = czm_gammaCorrect(rampColor);\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n",ne$C="uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\ncolor = czm_gammaCorrect(color);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n",le$r="uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.diffuse = material.diffuse;\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n",fe$p="uniform vec4 color;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = 1.0;\nreturn material;\n}\n";function a$O(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=u$Y(e.minificationFilter,tt$h.LINEAR),this._magnificationFilter=u$Y(e.magnificationFilter,rt$g.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._wrapS=q$11.CLAMP_TO_EDGE,this._wrapT=q$11.CLAMP_TO_EDGE,pe$u(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),e$28(a$O._uniformList[this.type])||(a$O._uniformList[this.type]=Object.keys(this._uniforms))}function pe$u(e,t){e=u$Y(e,u$Y.EMPTY_OBJECT),t._strict=u$Y(e.strict,!1),t._count=u$Y(e.count,0),t._template=l$1e(u$Y(e.fabric,u$Y.EMPTY_OBJECT)),t._template.uniforms=l$1e(u$Y(t._template.uniforms,u$Y.EMPTY_OBJECT)),t._template.materials=l$1e(u$Y(t._template.materials,u$Y.EMPTY_OBJECT)),t.type=e$28(t._template.type)?t._template.type:e$1K(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];var i,r=a$O._materialCache.getMaterial(t.type);if(e$28(r)){var n=l$1e(r.fabric,!0);t._template=p$17(t._template,n,!0),i=r.translucent}he$o(t),e$28(r)||a$O._materialCache.addMaterial(t.type,t),ye$o(t),Me$m(t),Ce$k(t);var o=0===t._translucentFunctions.length||void 0;if(i=u$Y(i,o),e$28(i=u$Y(e.translucent,i)))if("function"==typeof i){t._translucentFunctions.push((function(){return i(t)}))}else t._translucentFunctions.push(i)}function E$Q(e,t,i,r){if(e$28(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(r&&!o||!r&&o)&&i(n,t)}}function k$J(e,t){for(var i="fabric: property name '"+e+"' is not valid. It should be ",r=0;r<t.length;r++){var n="'"+t[r]+"'";i+=r===t.length-1?"or "+n+".":n+", "}throw new t$Z(i)}function ue$q(e,t){throw new t$Z("fabric: uniforms and materials cannot share the same property '"+e+"'")}a$O._uniformList={},a$O.fromType=function(e,t){if(!e$28(a$O._materialCache.getMaterial(e)))throw new t$Z("material with type '"+e+"' does not exist.");var i=new a$O({fabric:{type:e}});if(e$28(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},a$O.prototype.isTranslucent=function(){if(e$28(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r<i;++r){var n=t[r];if(!(e="function"==typeof n?e&&n():e&&n))break}return e},a$O.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;t<n;++t){var o=r[t];i=o.id;var a,s=o.image,l=new n$Y({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter,wrapS:this._wrapS,wrapT:this._wrapT});a=e$28(s.internalFormat)?new L$17({context:e,pixelFormat:s.internalFormat,width:s.width,height:s.height,source:{arrayBufferView:s.bufferView},sampler:l}):new L$17({context:e,source:s,sampler:l}),this._textures[i]=a;var u=i+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=a._width,c.y=a._height}}r.length=0;var h=this._loadedCubeMaps;for(n=h.length,t=0;t<n;++t){var d=h[t];i=d.id;var f=d.images,p=new X$z({context:e,source:{positiveX:f[0],negativeX:f[1],positiveY:f[2],negativeY:f[3],positiveZ:f[4],negativeZ:f[5]},sampler:new n$Y({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[i]=p}h.length=0;var _=this._updateFunctions;for(n=_.length,t=0;t<n;++t)_[t](this,e);var m=this.materials;for(var $ in m)m.hasOwnProperty($)&&m[$].update(e)},a$O.prototype.isDestroyed=function(){return!1},a$O.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return i$Z(this)};var ce$p=["type","materials","uniforms","components","source"],me$t=["diffuse","specular","shininess","normal","emission","alpha"];function he$o(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;if(e$28(n)&&e$28(t.source))throw new t$Z("fabric: cannot have source and components in the same template.");E$Q(t,ce$p,k$J,!0),E$Q(n,me$t,k$J,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);E$Q(i,o,ue$q,!1)}function de$p(e,t){var i=t._template.materials;for(var r in i)if(i.hasOwnProperty(r)&&e.indexOf(r)>-1)return!0;return!1}function ye$o(e){var t=e._template.components,i=e._template.source;if(e$28(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",e$28(t)){var r=Object.keys(e._template.materials).length>0;for(var n in t)if(t.hasOwnProperty(n))if("diffuse"===n||"emission"===n){var o=r&&de$p(t[n],e)?t[n]:"czm_gammaCorrect("+t[n]+")";e.shaderSource+="material."+n+" = "+o+"; \n"}else e.shaderSource+="alpha"===n?"material.alpha = "+t.alpha+"; \n":"material."+n+" = "+t[n]+";\n"}e.shaderSource+="return material;\n}\n"}}var L$W={mat2:f$15,mat3:p$1a,mat4:y$15},_e$n=/\.ktx$/i,ve$m=/\.crn$/i;function Te$n(e){var t;return function(i,r){var n=i.uniforms,o=n[e],a=t!==o;t=o;var s,l,u=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(a&&e$28(u)&&(u!==r.defaultTexture&&u.destroy(),u=void 0),!e$28(u)||u===r.defaultTexture)return u=new L$17({context:r,source:o,sampler:new n$Y({minificationFilter:i._minificationFilter,magnificationFilter:i._magnificationFilter})}),void(i._textures[e]=u);u.copyFrom(o)}else e$28(u)||(i._textures[e]=r.defaultTexture);else{if(o instanceof L$17&&o!==u){i._texturePaths[e]=void 0;var c=i._textures[e];return c!==i._defaultTexture&&c.destroy(),i._textures[e]=o,s=e+"Dimensions",void(n.hasOwnProperty(s)&&(l=n[s],l.x=o._width,l.y=o._height))}if(e$28(u)||(i._texturePaths[e]=void 0,e$28(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),u=i._textures[e]=i._defaultTexture,s=e+"Dimensions",n.hasOwnProperty(s)&&((l=n[s]).x=u._width,l.y=u._height)),o!==a$O.DefaultImageId){var h=o instanceof t$S;if(!e$28(i._texturePaths[e])||h&&o.url!==i._texturePaths[e].url||!h&&o!==i._texturePaths[e]){if("string"==typeof o||h){var d=h?o:t$S.createIfNeeded(o);o$1q(_e$n.test(d.url)?k$R(d):ve$m.test(d.url)?a$R(d):d.fetchImage(),(function(t){i._loadedImages.push({id:e,image:t})}))}else(o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)&&i._loadedImages.push({id:e,image:o});i._texturePaths[e]=o}}}}}function ge$m(e){return function(t,i){var r=t.uniforms[e];if(r instanceof X$z){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(e$28(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==a$O.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var a=[t$S.createIfNeeded(r.positiveX).fetchImage(),t$S.createIfNeeded(r.negativeX).fetchImage(),t$S.createIfNeeded(r.positiveY).fetchImage(),t$S.createIfNeeded(r.negativeY).fetchImage(),t$S.createIfNeeded(r.positiveZ).fetchImage(),t$S.createIfNeeded(r.negativeZ).fetchImage()];o$1q.all(a).then((function(i){t._loadedCubeMaps.push({id:e,images:i})})),t._texturePaths[e]=o}}}}function Me$m(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&G$R(e,i)}function G$R(e,t){var i=e._strict,r=e._template.uniforms,n=r[t],o=we$l(n);if(!e$28(o))throw new t$Z("fabric: uniform '"+t+"' has invalid type.");if("channels"===o){if(0===C$F(e,t,n,!1)&&i)throw new t$Z("strict: shader source does not use channels '"+t+"'.")}else{if("sampler2D"===o){var a=t+"Dimensions";be$p(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},G$R(e,a))}if(!new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;").test(e.shaderSource)){var s="uniform "+o+" "+t+";";e.shaderSource=s+e.shaderSource}var l=t+"_"+e._count++;if(1===C$F(e,t,l)&&i)throw new t$Z("strict: shader source does not use uniform '"+t+"'.");if(e.uniforms[t]=n,"sampler2D"===o)e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(Te$n(t));else if("samplerCube"===o)e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(ge$m(t));else if(-1!==o.indexOf("mat")){var u=new L$W[o];e._uniforms[l]=function(){return L$W[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function we$l(e){var t=e.type;if(!e$28(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof L$17||e instanceof t$S||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===a$O.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(Array.isArray(e))(4===e.length||9===e.length||16===e.length)&&(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function Ce$k(e){var t=e._strict,i=e._template.materials;for(var r in i)if(i.hasOwnProperty(r)){var n=new a$O({strict:t,fabric:i[r],count:e._count});e._count=n._count,e._uniforms=p$17(e._uniforms,n._uniforms,!0),e.materials[r]=n,e._translucentFunctions=e._translucentFunctions.concat(n._translucentFunctions);var o="czm_getMaterial",a=o+"_"+e._count++;if(C$F(n,o,a),e.shaderSource=n.shaderSource+e.shaderSource,0===C$F(e,r,a+"(materialInput)")&&t)throw new t$Z("strict: shader source does not use material '"+r+"'.")}}function C$F(e,t,i,r){r=u$Y(r,!0);var n=0,o=new RegExp("([\\w"+(r?".":"")+"])?"+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(o,(function(e,t,r){return t||r?e:(n+=1,i)})),n}function be$p(e,t,i){return C$F(e,t,t,i)}function t$A(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.translucent,!0),i=u$Y(e.closed,!1),r=u$Y(e.materialSupport,t$A.MaterialSupport.TEXTURED);this.material=e$28(e.material)?e.material:a$O.fromType(a$O.ColorType),this.translucent=t,this._vertexShaderSource=u$Y(e.vertexShaderSource,r.vertexShaderSource),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,r.fragmentShaderSource),this._renderState=a$P.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._materialSupport=r,this._vertexFormat=r.vertexFormat,this._flat=u$Y(e.flat,!1),this._faceForward=u$Y(e.faceForward,!i)}a$O._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},a$O.DefaultImageId="czm_defaultImage",a$O.DefaultCubeMapId="czm_defaultCubeMap",a$O.ColorType="Color",a$O._materialCache.addMaterial(a$O.ColorType,{fabric:{type:a$O.ColorType,uniforms:{color:new e$1S(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),a$O.ImageType="Image",a$O._materialCache.addMaterial(a$O.ImageType,{fabric:{type:a$O.ImageType,uniforms:{image:a$O.DefaultImageId,repeat:new o$1k(1,1),color:new e$1S(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),a$O.DiffuseMapType="DiffuseMap",a$O._materialCache.addMaterial(a$O.DiffuseMapType,{fabric:{type:a$O.DiffuseMapType,uniforms:{image:a$O.DefaultImageId,channels:"rgb",repeat:new o$1k(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),a$O.AlphaMapType="AlphaMap",a$O._materialCache.addMaterial(a$O.AlphaMapType,{fabric:{type:a$O.AlphaMapType,uniforms:{image:a$O.DefaultImageId,channel:"a",repeat:new o$1k(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),a$O.SpecularMapType="SpecularMap",a$O._materialCache.addMaterial(a$O.SpecularMapType,{fabric:{type:a$O.SpecularMapType,uniforms:{image:a$O.DefaultImageId,channel:"r",repeat:new o$1k(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),a$O.EmissionMapType="EmissionMap",a$O._materialCache.addMaterial(a$O.EmissionMapType,{fabric:{type:a$O.EmissionMapType,uniforms:{image:a$O.DefaultImageId,channels:"rgb",repeat:new o$1k(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),a$O.BumpMapType="BumpMap",a$O._materialCache.addMaterial(a$O.BumpMapType,{fabric:{type:a$O.BumpMapType,uniforms:{image:a$O.DefaultImageId,channel:"r",strength:.8,repeat:new o$1k(1,1)},source:j$J},translucent:!1}),a$O.NormalMapType="NormalMap",a$O._materialCache.addMaterial(a$O.NormalMapType,{fabric:{type:a$O.NormalMapType,uniforms:{image:a$O.DefaultImageId,channels:"rgb",strength:.8,repeat:new o$1k(1,1)},source:V$E},translucent:!1}),a$O.GridType="Grid",a$O._materialCache.addMaterial(a$O.GridType,{fabric:{type:a$O.GridType,uniforms:{color:new e$1S(0,1,0,1),cellAlpha:.1,lineCount:new o$1k(8,8),lineThickness:new o$1k(1,1),lineOffset:new o$1k(0,0)},source:Q$J},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),a$O.StripeType="Stripe",a$O._materialCache.addMaterial(a$O.StripeType,{fabric:{type:a$O.StripeType,uniforms:{horizontal:!0,evenColor:new e$1S(1,1,1,.5),oddColor:new e$1S(0,0,1,.5),offset:0,repeat:5},source:ne$C},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),a$O.CheckerboardType="Checkerboard",a$O._materialCache.addMaterial(a$O.CheckerboardType,{fabric:{type:a$O.CheckerboardType,uniforms:{lightColor:new e$1S(1,1,1,.5),darkColor:new e$1S(0,0,0,.5),repeat:new o$1k(5,5)},source:J$M},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),a$O.DotType="Dot",a$O._materialCache.addMaterial(a$O.DotType,{fabric:{type:a$O.DotType,uniforms:{lightColor:new e$1S(1,1,0,.75),darkColor:new e$1S(0,1,1,.75),repeat:new o$1k(5,5)},source:$$I},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),a$O.WaterType="Water",a$O._materialCache.addMaterial(a$O.WaterType,{fabric:{type:a$O.WaterType,uniforms:{baseWaterColor:new e$1S(.2,.3,.6,1),blendColor:new e$1S(0,1,.699,1),specularMap:a$O.DefaultImageId,normalMap:a$O.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:le$r},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),a$O.RimLightingType="RimLighting",a$O._materialCache.addMaterial(a$O.RimLightingType,{fabric:{type:a$O.RimLightingType,uniforms:{color:new e$1S(1,0,0,.7),rimColor:new e$1S(1,1,1,.4),width:.3},source:re$u},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),a$O.FadeType="Fade",a$O._materialCache.addMaterial(a$O.FadeType,{fabric:{type:a$O.FadeType,uniforms:{fadeInColor:new e$1S(1,0,0,1),fadeOutColor:new e$1S(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new o$1k(.5,.5)},source:U$J},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),a$O.PolylineArrowType="PolylineArrow",a$O._materialCache.addMaterial(a$O.PolylineArrowType,{fabric:{type:a$O.PolylineArrowType,uniforms:{color:new e$1S(1,1,1,1)},source:ee$x},translucent:!0}),a$O.PolylineDashType="PolylineDash",a$O._materialCache.addMaterial(a$O.PolylineDashType,{fabric:{type:a$O.PolylineDashType,uniforms:{color:new e$1S(1,0,1,1),gapColor:new e$1S(0,0,0,0),dashLength:16,dashPattern:255},source:te$B},translucent:!0}),a$O.PolylineGlowType="PolylineGlow",a$O._materialCache.addMaterial(a$O.PolylineGlowType,{fabric:{type:a$O.PolylineGlowType,uniforms:{color:new e$1S(0,.5,1,1),glowPower:.25,taperPower:1},source:ae$t},translucent:!0}),a$O.PolylineOutlineType="PolylineOutline",a$O._materialCache.addMaterial(a$O.PolylineOutlineType,{fabric:{type:a$O.PolylineOutlineType,uniforms:{color:new e$1S(1,1,1,1),outlineColor:new e$1S(1,0,0,1),outlineWidth:1},source:R$F},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),a$O.ElevationContourType="ElevationContour",a$O._materialCache.addMaterial(a$O.ElevationContourType,{fabric:{type:a$O.ElevationContourType,uniforms:{spacing:100,color:new e$1S(1,0,0,1),width:1},source:q$O},translucent:!1}),a$O.ElevationRampType="ElevationRamp",a$O._materialCache.addMaterial(a$O.ElevationRampType,{fabric:{type:a$O.ElevationRampType,uniforms:{image:a$O.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:K$D},translucent:!1}),a$O.SlopeRampMaterialType="SlopeRamp",a$O._materialCache.addMaterial(a$O.SlopeRampMaterialType,{fabric:{type:a$O.SlopeRampMaterialType,uniforms:{image:a$O.DefaultImageId},source:ie$w},translucent:!1}),a$O.AspectRampMaterialType="AspectRamp",a$O._materialCache.addMaterial(a$O.AspectRampMaterialType,{fabric:{type:a$O.AspectRampMaterialType,uniforms:{image:a$O.DefaultImageId},source:Z$L},translucent:!1}),a$O.EmissionColorType="EmissionColor",a$O._materialCache.addMaterial(a$O.EmissionColorType,{fabric:{type:a$O.EmissionColorType,uniforms:{color:new e$1S(1,1,1,1)},source:fe$p},translucent:function(e){return e.uniforms.color.alpha<1}}),a$O.PolylineDynamicType="PolylineDynamic",a$O._materialCache.addMaterial(a$O.PolylineDynamicType,{fabric:{type:a$O.PolylineDynamicType,uniforms:{color:new e$1S(1,1,1,1),outlineColor:new e$1S(1,0,0,1),outlineWidth:0,v_time:1,bAsy:1},source:R$F},translucent:function(e){return!0}}),a$O.PolylineTrailType="PolylineTrail",a$O._materialCache.addMaterial(a$O.PolylineTrailType,{fabric:{type:a$O.PolylineTrailType,uniforms:{color:new e$1S(1,0,0,.5),trailTime:0,spotSize:1,trailLength:.03,spotIntensity:5,constantSpeed:0,period:1e3,startTime:0},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return!0}}),Object.defineProperties(t$A.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),t$A.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,t$A.prototype.isTranslucent=a$P.prototype.isTranslucent,t$A.prototype.getRenderState=a$P.prototype.getRenderState,t$A.MaterialSupport={BASIC:Object.freeze({vertexFormat:n$10.POSITION_AND_NORMAL,vertexShaderSource:l$N,fragmentShaderSource:i$J}),BASICMODEL:Object.freeze({vertexFormat:n$10.POSITION_AND_NORMAL,vertexShaderSource:_$H,fragmentShaderSource:i$J}),TEXTURED:Object.freeze({vertexFormat:n$10.POSITION_NORMAL_AND_ST,vertexShaderSource:h$I,fragmentShaderSource:m$K}),TEXTUREDMODEL:Object.freeze({vertexFormat:n$10.POSITION_NORMAL_AND_ST,vertexShaderSource:g$E,fragmentShaderSource:m$K}),ALL:Object.freeze({vertexFormat:n$10.ALL,vertexShaderSource:d$U,fragmentShaderSource:f$O})};var i$I="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nvec4 color = czm_gammaCorrect(v_color);\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n",s$E="attribute vec3 position;\nattribute vec3 normal;\nattribute float batchId;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = vec4(position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjection * p;\n}\n",h$H="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",d$T="varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = czm_gammaCorrect(v_color);\n}\n",l$M="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",_$G="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position03DHigh;\nattribute vec3 position03DLow;\nattribute vec3 position13DHigh;\nattribute vec3 position13DLow;\nattribute vec2 sideness;\n#ifdef APPLY_SIDENESS\nuniform float uLineWidth;\nattribute float batchId1;\n#endif\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\n#ifdef APPLY_SIDENESS\nvec4 resolvePosition(vec4 viewPosV0, vec4 viewPosV1, vec2 sidenessNorm) {\nvec2 sideness = sidenessNorm * 2.0 - 1.0;\nvec4 viewPos = mix(viewPosV0, viewPosV1, sidenessNorm.y);\nviewPos.z = viewPos.z * 0.995;\nvec4 projPosV0 = czm_projection * viewPosV0;\nvec4 projPosV1 = czm_projection * viewPosV1;\nvec4 projPos = czm_projection * viewPos;\nvec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w);\nvec2 uNDCToPixel = vec2(czm_viewport.z / 2.0, czm_viewport.w / 2.0);\nvec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * uNDCToPixel;\nfloat lineLengthPixels = length(screenSpaceLinePixels);\nfloat dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels;\nvec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels;\nvec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x;\nvec2 uPixelToNDC = vec2(2.0 / czm_viewport.z, 2.0 / czm_viewport.w);\nfloat halfLineWidth = max(uLineWidth, 1.0) * 0.5;\nvec2 halfLineWidthNDC = halfLineWidth * uPixelToNDC;\nvec2 ndcOffset = screenSpaceDirection * halfLineWidthNDC + perpendicularScreenSpaceDirection * halfLineWidthNDC;\nprojPos.xy += ndcOffset * projPos.w;\nprojPos.z += (dzPerPixel * halfLineWidth) * sideness.y * projPos.w;\nreturn projPos;\n}\n#endif\nvoid main()\n{\n#ifdef APPLY_SIDENESS\nvec4 p0 = czm_computePosition0();\nvec4 p1 = czm_computePosition1();\nvec4 viewPosV0 = czm_inverseProjection * czm_modelViewProjectionRelativeToEye * p0;\nvec4 viewPosV1 = czm_inverseProjection * czm_modelViewProjectionRelativeToEye * p1;\ngl_Position = resolvePosition(viewPosV0, viewPosV1, sideness) * float(batchId1 == batchId);\n#else\nvec4 p = czm_computePosition();\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n#endif\nv_color = color;\n}\n";function r$J(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.translucent,!0),i=u$Y(e.closed,!1),r=u$Y(e.flat,!1),n=u$Y(e.materialSupport,r$J.MaterialSupport.BASIC),o=n.vertexShaderSource,a=n.fragmentShaderSource,s=n.vertexFormat;r&&(o=l$M,e.hasSideness&&(o=_$G),a=d$T,s=r$J.FLAT_VERTEX_FORMAT),this.material=void 0,this.translucent=t,this._vertexShaderSource=u$Y(e.vertexShaderSource,o),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,a),this._renderState=a$P.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._vertexFormat=s,this._flat=r,this._faceForward=u$Y(e.faceForward,!i)}function t$z(e){this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(r$J.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),r$J.VERTEX_FORMAT=n$10.POSITION_AND_NORMAL,r$J.FLAT_VERTEX_FORMAT=n$10.POSITION_ONLY,r$J.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,r$J.prototype.isTranslucent=a$P.prototype.isTranslucent,r$J.prototype.getRenderState=a$P.prototype.getRenderState,r$J.MaterialSupport={BASIC:Object.freeze({vertexFormat:n$10.POSITION_AND_NORMAL,vertexShaderSource:h$H,fragmentShaderSource:i$I}),FLAT:Object.freeze({vertexFormat:n$10.POSITION_ONLY,vertexShaderSource:l$M,fragmentShaderSource:d$T}),FLOAT_POSITION:Object.freeze({vertexFormat:n$10.POSITION_AND_NORMAL,vertexShaderSource:s$E,fragmentShaderSource:i$I})},Object.defineProperties(t$z.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color")}),t$z.prototype.getType=function(e){return"Color"},t$z.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,e$1S.WHITE,t.color),t},t$z.prototype.equals=function(e){return this===e||e instanceof t$z&&r$K.equals(this._color,e._color)};var X$y="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#if defined(TEXTURE_COORDINATES) && !defined(SPHERICAL) && defined(UINT8_PACKING)\nvec4 clampAndMagnitude(vec4 sd)\n{\nvec4 d = sd;\nd.x = czm_branchFreeTernary(sd.x < 128.0, d.x, (255.0 - sd.x));\nd.x = floor(0.5 + d.x);\nd.y = floor(0.5 + d.y);\nd.z = floor(0.5 + d.z);\nd.w = floor(0.5 + d.w);\nreturn d;\n}\nfloat unpackLowLessThan100k(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (1000.0 * d.x + 10.0 * d.y + 0.1 * d.z + 0.001 * d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 southwest_LOW(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackLowLessThan100k(x);\nvalue.y = unpackLowLessThan100k(y);\nvalue.z = unpackLowLessThan100k(z);\nreturn value;\n}\nfloat unpackHighMagLessThan100Million(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (1000000.0 * d.x + 10000.0 * d.y + 100.0 * d.z + d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 southwest_HIGH(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackHighMagLessThan100Million(x);\nvalue.y = unpackHighMagLessThan100Million(y);\nvalue.z = unpackHighMagLessThan100Million(z);\nreturn value;\n}\n#ifdef COLUMBUS_VIEW_2D\nvec4 unpackPlanes2D_HIGH(vec4 x, vec4 y, vec4 z, vec4 w)\n{\nvec4 value;\nvalue.x = unpackHighMagLessThan100Million(x);\nvalue.y = unpackHighMagLessThan100Million(y);\nvalue.z = unpackHighMagLessThan100Million(z);\nvalue.w = unpackHighMagLessThan100Million(w);\nreturn value;\n}\nvec4 unpackPlanes2D_LOW(vec4 x, vec4 y, vec4 z, vec4 w)\n{\nvec4 value;\nvalue.x = unpackLowLessThan100k(x);\nvalue.y = unpackLowLessThan100k(y);\nvalue.z = unpackLowLessThan100k(z);\nvalue.w = unpackLowLessThan100k(w);\nreturn value;\n}\n#else\nfloat unpackLowLessThan1000k(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (10000.0 * d.x + 100.0 * d.y + d.z + 0.01 * d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 unpackExtent(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackLowLessThan1000k(x);\nvalue.y = unpackLowLessThan1000k(y);\nvalue.z = unpackLowLessThan1000k(z);\nreturn value;\n}\n#endif\n#endif\nvoid main()\n{\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\n#ifdef UINT8_PACKING\nvec4 planes2D_high = unpackPlanes2D_HIGH(czm_batchTable_planes2D_HIGH_x(batchId),\nczm_batchTable_planes2D_HIGH_y(batchId),\nczm_batchTable_planes2D_HIGH_z(batchId),\nczm_batchTable_planes2D_HIGH_w(batchId));\nvec4 planes2D_low = unpackPlanes2D_LOW(czm_batchTable_planes2D_LOW_x(batchId),\nczm_batchTable_planes2D_LOW_y(batchId),\nczm_batchTable_planes2D_LOW_z(batchId),\nczm_batchTable_planes2D_LOW_w(batchId));\n#else // UINT8_PACKING\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\n#endif // UINT8_PACKING\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\n#ifdef UINT8_PACKING\nvec3 low = southwest_LOW(czm_batchTable_southWest_LOW_x(batchId), czm_batchTable_southWest_LOW_y(batchId), czm_batchTable_southWest_LOW_z(batchId));\nvec3 high = southwest_HIGH(czm_batchTable_southWest_HIGH_x(batchId), czm_batchTable_southWest_HIGH_y(batchId), czm_batchTable_southWest_HIGH_z(batchId));\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(high, low)).xyz;\nvec3 northWestCorner = czm_normal * unpackExtent(\nczm_batchTable_northward_x(batchId),\nczm_batchTable_northward_y(batchId),\nczm_batchTable_northward_z(batchId)) + southWestCorner;\nvec3 southEastCorner = czm_normal * unpackExtent(\nczm_batchTable_eastward_x(batchId),\nczm_batchTable_eastward_y(batchId),\nczm_batchTable_eastward_z(batchId)) + southWestCorner;\n#else // UINT8_PACKING\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // UINT8_PACKING\n#endif // COLUMBUS_VIEW_2D\nvec3 eastWard = southEastCorner - southWestCorner;\nfloat eastExtent = length(eastWard);\neastWard /= eastExtent;\nvec3 northWard = northWestCorner - southWestCorner;\nfloat northExtent = length(northWard);\nnorthWard /= northExtent;\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\nv_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\nv_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif\ngl_Position = czm_depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n",Q$I="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvoid main(void)\n{\n#ifdef VECTOR_TILE\ngl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\ngl_FragColor = vec4(1.0);\n#endif\nczm_writeDepthClampedToFarPlane();\n}\n",e$1b={TERRAIN:0,CESIUM_3D_TILE:1,S3M_TILE:2,BOTH:3,NUMBER_OF_CLASSIFICATION_TYPES:4},L$V=Object.freeze(e$1b),A$S={NEVER:de$y.NEVER,LESS:de$y.LESS,EQUAL:de$y.EQUAL,LESS_OR_EQUAL:de$y.LEQUAL,GREATER:de$y.GREATER,NOT_EQUAL:de$y.NOTEQUAL,GREATER_OR_EQUAL:de$y.GEQUAL,ALWAYS:de$y.ALWAYS},Me$l=Object.freeze(A$S);function x$Q(e,t,i){if(!e$28(e))throw new t$Z("context is required");if(!e$28(t))throw new t$Z("attributes is required");if(!e$28(i))throw new t$Z("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=i,0!==t.length){var r=G$Q(t),n=e.floatingPointTexture,o=r===y$U.FLOAT&&!n,a=I$$(t,o),s=U$I(a,t,o),l=Math.floor(e$1U.maximumTextureSize/s),u=Math.min(i,l),c=s*u,h=Math.ceil(i/u),d=1/c,f=.5*d,p=1/h,_=.5*p;this._textureDimensions=new o$1k(c,h),this._textureStep=new e$25(d,f,p,_),this._pixelDatatype=o?y$U.UNSIGNED_BYTE:r,this._packFloats=o,this._offsets=a,this._stride=s,this._texture=void 0;var m=4*c*h;this._batchValues=r!==y$U.FLOAT||o?new Uint8Array(m):new Float32Array(m),this._batchValuesDirty=!1,this._suffix=""}}function G$Q(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==S$W.UNSIGNED_BYTE){t=!0;break}return t?y$U.FLOAT:y$U.UNSIGNED_BYTE}function S$B(e,t){var i=e[t].componentsPerAttribute;return 2===i?o$1k:3===i?t$X:4===i?e$25:Number}function I$$(e,t){for(var i=new Array(e.length),r=0,n=e.length,o=0;o<n;++o){var a=e[o].componentDatatype;i[o]=r,a!==S$W.UNSIGNED_BYTE&&t?r+=4:++r}return i}function U$I(e,t,i){var r=e.length,n=e[r-1];return t[r-1].componentDatatype!==S$W.UNSIGNED_BYTE&&i?n+4:n+1}Object.defineProperties(x$Q.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}},suffix:{get:function(){return this._suffix},set:function(e){this._suffix=e}}});var b$R=new e$25;function P$I(e,t,i){var r=e$25.unpack(e,t,b$R),n=e$25.unpackFloat(r);r=e$25.unpack(e,t+4,b$R);var o=e$25.unpackFloat(r);r=e$25.unpack(e,t+8,b$R);var a=e$25.unpackFloat(r);r=e$25.unpack(e,t+12,b$R);var s=e$25.unpackFloat(r);return e$25.fromElements(n,o,a,s,i)}function X$x(e,t,i){var r=e$25.packFloat(e.x,b$R);e$25.pack(r,t,i),r=e$25.packFloat(e.y,r),e$25.pack(r,t,i+4),r=e$25.packFloat(e.z,r),e$25.pack(r,t,i+8),r=e$25.packFloat(e.w,r),e$25.pack(r,t,i+12)}var F$R=new e$25;x$Q.prototype.getBatchedAttribute=function(e,t,i){if(e<0||e>=this._numberOfInstances)throw new t$Z("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new t$Z("attributeIndex is out of range");var r,n=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o;r=this._packFloats&&n[t].componentDatatype!==y$U.UNSIGNED_BYTE?P$I(this._batchValues,a,F$R):e$25.unpack(this._batchValues,a,F$R);var s=S$B(n,t);return e$28(s.fromCartesian4)?s.fromCartesian4(r,i):e$28(s.clone)?s.clone(r,i):r.x};var q$N=[void 0,void 0,new o$1k,new t$X,new e$25],L$U=new e$25;function M$L(e,t){var i=e._textureDimensions;e._texture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),flipY:!1})}function R$E(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function j$I(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep{suffix}; \nvec2 computeSt{suffix}(float batchId) \n{ \n float stepX = batchTextureStep{suffix}.x; \n float centerX = batchTextureStep{suffix}.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep{suffix}; \nuniform vec2 batchTextureDimensions{suffix}; \nvec2 computeSt{suffix}(float batchId) \n{ \n float stepX = batchTextureStep{suffix}.x; \n float centerX = batchTextureStep{suffix}.y; \n float stepY = batchTextureStep{suffix}.z; \n float centerY = batchTextureStep{suffix}.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions{suffix}.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions{suffix}.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function W$F(e){return 1===e?"float":"vec"+e}function H$I(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function J$L(e,t){var i=e._attributes[t],r=i.componentsPerAttribute,n=i.functionName,o=W$F(r),a=H$I(r),s=o+" "+n+"(float batchId) \n{ \n vec2 st = computeSt{suffix}(batchId); \n st.x += batchTextureStep{suffix}.x * float("+e._offsets[t]+"); \n";return e._packFloats&&i.componentDatatype!==y$U.UNSIGNED_BYTE?s+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture{suffix}, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture{suffix}, st + vec2(batchTextureStep{suffix}.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture{suffix}, st + vec2(batchTextureStep{suffix}.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture{suffix}, st + vec2(batchTextureStep{suffix}.x * 3.0, 0.0))); \n":s+=" vec4 textureValue = texture2D(batchTexture{suffix}, st); \n",s+=" "+o+" value = textureValue"+a+"; \n",e._pixelDatatype!==y$U.UNSIGNED_BYTE||i.componentDatatype!==S$W.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===y$U.FLOAT&&i.componentDatatype===S$W.UNSIGNED_BYTE&&i.normalize&&(s+="value /= 255.0; \n"):s+="value *= 255.0; \n",s+=" return value; \n} \n"}function Q$H(e,t,i){var r,n=!i,o=e.length;if(!n&&o>1){var a=e[0].modelMatrix;for(r=1;r<o;++r)if(!y$15.equals(a,e[r].modelMatrix)){n=!0;break}}if(n)for(r=0;r<o;++r)e$28(e[r].geometry)&&k$Z.transformToWorldCoordinates(e[r]);else y$15.multiplyTransformation(t,e[0].modelMatrix,t)}function V$D(e,t){var i=e.attributes,r=i.position,n=r.values.length/r.componentsPerAttribute;i.batchId=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:1,values:new Float32Array(n)});for(var o=i.batchId.values,a=0;a<n;++a)o[a]=t}function X$w(e){for(var t=e.length,i=0;i<t;++i){var r=e[i];e$28(r.geometry)?V$D(r.geometry,i):e$28(r.westHemisphereGeometry)&&e$28(r.eastHemisphereGeometry)&&(V$D(r.westHemisphereGeometry,i),V$D(r.eastHemisphereGeometry,i))}}function Y$z(e){var t,i,r,n=e.instances,o=e.projection,a=e.elementIndexUintSupported,s=e.scene3DOnly,l=e.vertexCacheOptimize,u=e.compressVertices,c=e.modelMatrix,h=n.length;for(t=0;t<h;++t)if(e$28(n[t].geometry)){r=n[t].geometry.primitiveType;break}for(t=1;t<h;++t)if(e$28(n[t].geometry)&&n[t].geometry.primitiveType!==r)throw new t$Z("All instance geometries must have the same primitiveType.");if(Q$H(n,c,s),!s)for(t=0;t<h;++t)e$28(n[t].geometry)&&k$Z.splitLongitude(n[t]);if(X$w(n),l)for(t=0;t<h;++t){var d=n[t];e$28(d.geometry)?(k$Z.reorderForPostVertexCache(d.geometry),k$Z.reorderForPreVertexCache(d.geometry)):e$28(d.westHemisphereGeometry)&&e$28(d.eastHemisphereGeometry)&&(k$Z.reorderForPostVertexCache(d.westHemisphereGeometry),k$Z.reorderForPreVertexCache(d.westHemisphereGeometry),k$Z.reorderForPostVertexCache(d.eastHemisphereGeometry),k$Z.reorderForPreVertexCache(d.eastHemisphereGeometry))}var f=k$Z.combineInstances(n);for(h=f.length,t=0;t<h;++t){var p,_=(i=f[t]).attributes;if(s)for(p in _)_.hasOwnProperty(p)&&_[p].componentDatatype===S$W.DOUBLE&&k$Z.encodeAttribute(i,p,p+"3DHigh",p+"3DLow");else for(p in _)if(_.hasOwnProperty(p)&&_[p].componentDatatype===S$W.DOUBLE){var m=p+"3D",$=p+"2D";k$Z.projectTo2D(i,p,m,$,o),e$28(i.boundingSphere)&&"position"===p&&(i.boundingSphereCV=i$19.fromVertices(i.attributes.position2D.values)),k$Z.encodeAttribute(i,m,m+"High",m+"Low"),k$Z.encodeAttribute(i,$,$+"High",$+"Low")}u&&k$Z.compressVertices(i)}if(!a){var g=[];for(h=f.length,t=0;t<h;++t)i=f[t],g=g.concat(k$Z.fitToUnsignedShortIndices(i));f=g}return f}function I$_(e,t,i,r){var n,o,a,s=r.length-1;if(s>=0){var l=r[s];n=l.offset+l.count,o=i[a=l.index].indices.length}else n=0,o=i[a=0].indices.length;for(var u=e.length,c=0;c<u;++c){var h=e[c][t];if(e$28(h)){var d=h.indices.length;n+d>o&&(n=0,o=i[++a].indices.length),r.push({index:a,offset:n,count:d}),n+=d}}}function Z$K(e,t){var i=[];return I$_(e,"geometry",t,i),I$_(e,"westHemisphereGeometry",t,i),I$_(e,"eastHemisphereGeometry",t,i),i}x$Q.prototype.setBatchedAttribute=function(e,t,i){if(e<0||e>=this._numberOfInstances)throw new t$Z("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new t$Z("attributeIndex is out of range");if(!e$28(i))throw new t$Z("value is required.");var r=this._attributes,n=q$N[r[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,n),a=S$B(this._attributes,t);if(!(e$28(a.equals)?a.equals(o,i):o===i)){var s=L$U;s.x=e$28(i.x)?i.x:i,s.y=e$28(i.y)?i.y:0,s.z=e$28(i.z)?i.z:0,s.w=e$28(i.w)?i.w:0;var l=this._offsets[t],u=4*this._stride*e+4*l;this._packFloats&&r[t].componentDatatype!==y$U.UNSIGNED_BYTE?X$x(s,this._batchValues,u):e$25.pack(s,this._batchValues,u),this._batchValuesDirty=!0}},x$Q.prototype.update=function(e){e$28(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,e$28(this._texture)||M$L(this,e.context),R$E(this))},x$Q.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={};return""===e._suffix?p$17(t,i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}}):(i["batchTexture"+e._suffix]=function(){return e._texture},i["batchTextureDimensions"+e._suffix]=function(){return e._textureDimensions},i["batchTextureStep"+e._suffix]=function(){return e._textureStep},p$17(t,i))}},x$Q.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform highp sampler2D batchTexture{suffix}; \n";s$V.isPCBroswer()&&(t="uniform sampler2D batchTexture{suffix}; \n"),t+=j$I(this)+"\n";for(var i=e.length,r=0;r<i;++r)t+=J$L(this,r);return t=t.replace(/\{suffix\}/g,this._suffix),function(e){var i=e.indexOf("void main"),r=e.substring(0,i),n=e.substring(i);return r+"\n"+t+"\n"+n}},x$Q.prototype.isDestroyed=function(){return!1},x$Q.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),i$Z(this)};var k$I={};function _$F(e,t){var i=e.attributes;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];e$28(n)&&e$28(n.values)&&t.push(n.values.buffer)}e$28(e.indices)&&t.push(e.indices.buffer)}function $$H(e,t){for(var i=e.length,r=0;r<i;++r)_$F(e[r],t)}function q$M(e){for(var t=1,i=e.length,r=0;r<i;r++){var n=e[r];if(++t,e$28(n)){var o=n.attributes;for(var a in t+=7+2*i$19.packedLength+(e$28(n.indices)?n.indices.length:0),o)if(o.hasOwnProperty(a)&&e$28(o[a])){t+=6+o[a].values.length}}}return t}function ee$w(e,t){var i=e.length,r=new Float64Array(1+19*i),n=0;r[n++]=i;for(var o=0;o<i;o++){var a=e[o];if(y$15.pack(a.modelMatrix,r,n),n+=y$15.packedLength,e$28(a.attributes)&&e$28(a.attributes.offset)){var s=a.attributes.offset.value;r[n]=s[0],r[n+1]=s[1],r[n+2]=s[2]}n+=3}return t.push(r.buffer),r}function re$t(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var o,a=y$15.unpack(t,n);e$28(t[n+=y$15.packedLength])&&(o={offset:new e$1o(t[n],t[n+1],t[n+2])}),n+=3,i[r++]={modelMatrix:a,attributes:o}}return i}function M$K(e){var t=e.length,i=1+(i$19.packedLength+1)*t,r=new Float32Array(i),n=0;r[n++]=t;for(var o=0;o<t;++o){e$28(e[o])?(r[n++]=1,i$19.pack(e[o],r,n)):r[n++]=0,n+=i$19.packedLength}return r}function T$E(e){for(var t=new Array(e[0]),i=0,r=1;r<e.length;)1===e[r++]&&(t[i]=i$19.unpack(e,r)),++i,r+=i$19.packedLength;return t}k$I.combineGeometry=function(e){var t,i,r,n,o=e.instances,a=o.length,s=!1;a>0&&((t=Y$z(e)).length>0&&(i=k$Z.createAttributeLocations(t[0]),e.createPickOffsets&&(r=Z$K(o,t))),e$28(o[0].attributes)&&e$28(o[0].attributes.offset)&&(n=new Array(a),s=!0));for(var l=new Array(a),u=new Array(a),c=0;c<a;++c){var h=o[c],d=h.geometry;e$28(d)&&(l[c]=d.boundingSphere,u[c]=d.boundingSphereCV,s&&(n[c]=h.geometry.offsetAttribute));var f=h.eastHemisphereGeometry,p=h.westHemisphereGeometry;e$28(f)&&e$28(p)&&(e$28(f.boundingSphere)&&e$28(p.boundingSphere)&&(l[c]=i$19.union(f.boundingSphere,p.boundingSphere)),e$28(f.boundingSphereCV)&&e$28(p.boundingSphereCV)&&(u[c]=i$19.union(f.boundingSphereCV,p.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,pickOffsets:r,offsetInstanceExtend:n,boundingSpheres:l,boundingSpheresCV:u}},k$I.packCreateGeometryResults=function(e,t){var i=new Float64Array(q$M(e)),r=[],n={},o=e.length,a=0;i[a++]=o;for(var s=0;s<o;s++){var l=e[s],u=e$28(l);if(i[a++]=u?1:0,u){i[a++]=l.primitiveType,i[a++]=l.geometryType,i[a++]=u$Y(l.offsetAttribute,-1);var c=e$28(l.boundingSphere)?1:0;i[a++]=c,c&&i$19.pack(l.boundingSphere,i,a),a+=i$19.packedLength;var h=e$28(l.boundingSphereCV)?1:0;i[a++]=h,h&&i$19.pack(l.boundingSphereCV,i,a),a+=i$19.packedLength;var d=l.attributes,f=[];for(var p in d)d.hasOwnProperty(p)&&e$28(d[p])&&(f.push(p),e$28(n[p])||(n[p]=r.length,r.push(p)));i[a++]=f.length;for(var _=0;_<f.length;_++){var m=f[_],$=d[m];i[a++]=n[m],i[a++]=$.componentDatatype,i[a++]=$.componentsPerAttribute,i[a++]=$.normalize?1:0,i[a++]=$.isInstanceAttribute?1:0,i[a++]=$.values.length,i.set($.values,a),a+=$.values.length}var g=e$28(l.indices)?l.indices.length:0;i[a++]=g,g>0&&(i.set(l.indices,a),a+=g)}}return t.push(i.buffer),{stringTable:r,packedData:i}},k$I.unpackCreateGeometryResults=function(e){for(var t,i=e.stringTable,r=e.packedData,n=new Array(r[0]),o=0,a=1;a<r.length;){if(1===r[a++]){var s,l,u=r[a++],c=r[a++],h=r[a++];-1===h&&(h=void 0),1===r[a++]&&(s=i$19.unpack(r,a)),a+=i$19.packedLength,1===r[a++]&&(l=i$19.unpack(r,a)),a+=i$19.packedLength;var d,f,p,_,m=new a$_,$=r[a++];for(t=0;t<$;t++){var g=i[r[a++]],v=r[a++];p=r[a++];var y=0!==r[a++],x=0!==r[a++];d=r[a++],f=S$W.createTypedArray(v,d);for(var b=0;b<d;b++)f[b]=r[a++];m[g]=new o$1g({componentDatatype:v,componentsPerAttribute:p,normalize:y,values:f}),x&&(m[g].isInstanceAttribute=!0)}if((d=r[a++])>0){var w=f.length/p;for(_=ce$v.createTypedArray(w,d),t=0;t<d;t++)_[t]=r[a++]}n[o++]=new I$1n({primitiveType:u,geometryType:c,boundingSphere:s,boundingSphereCV:l,indices:_,attributes:m,offsetAttribute:h})}else n[o++]=void 0}return n},k$I.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:ee$w(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof n$1b,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},k$I.unpackCombineGeometryParameters=function(e){for(var t=re$t(e.packedInstances),i=e.createGeometryResults,r=i.length,n=0,o=0;o<r;o++)for(var a=k$I.unpackCreateGeometryResults(i[o]),s=a.length,l=0;l<s;l++){var u=a[l];t[n].geometry=u,++n}var c=t$V.clone(e.ellipsoid);return{instances:t,ellipsoid:c,projection:e.isGeographic?new n$1b(c):new t$M(c),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:y$15.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},k$I.packCombineGeometryResults=function(e,t){e$28(e.geometries)&&$$H(e.geometries,t);var i=M$K(e.boundingSpheres),r=M$K(e.boundingSpheresCV);return t.push(i.buffer,r.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:i,boundingSpheresCV:r}},k$I.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:T$E(e.boundingSpheres),boundingSpheresCV:T$E(e.boundingSpheresCV)}};var e$1a={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},ce$o=Object.freeze(e$1a),E$P={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4,castShadows:function(e){return e===E$P.ENABLED||e===E$P.CAST_ONLY},receiveShadows:function(e){return e===E$P.ENABLED||e===E$P.RECEIVE_ONLY},fromCastReceive:function(e,t){return e&&t?E$P.ENABLED:e?E$P.CAST_ONLY:t?E$P.RECEIVE_ONLY:E$P.DISABLED}},q$L=Object.freeze(E$P),E$O={NORMAL:0,REFLECT:1,DEPTH:2,NORMAL_AND_DEPTH:3,POSTEFFECT_FILTER:4,RASTER:5,CLAMP:6,PICKRECT:7,SQRESULT:8},L$T=Object.freeze(E$O),f$N=new o$1k(1,1),d$S=!1,l$L=e$1S.WHITE;function a$N(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this._unique=!1,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent,this._unique=e.unique}function a$M(e){if(e instanceof e$1S)return new t$z(e);if("string"==typeof e||e instanceof t$S||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof L$17){var t=new a$N;return t.image=e,t}throw new t$Z("Unable to infer material type: "+e)}function c$K(e,t){return C$H(e,t,a$M)}Object.defineProperties(a$N.prototype,{isConstant:{get:function(){return r$K.isConstant(this._image)&&r$K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:C$H("image"),repeat:C$H("repeat"),color:C$H("color"),transparent:C$H("transparent")}),a$N.prototype.getType=function(e){return"Image"},a$N.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.image=r$K.getValueOrUndefined(this._image,e),t.repeat=r$K.getValueOrClonedDefault(this._repeat,e,f$N,t.repeat),t.color=r$K.getValueOrClonedDefault(this._color,e,l$L,t.color),r$K.getValueOrDefault(this._transparent,e,d$S)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},a$N.prototype.equals=function(e){return this===e||e instanceof a$N&&r$K.equals(this._image,e._image)&&r$K.equals(this._repeat,e._repeat)&&r$K.equals(this._color,e._color)&&r$K.equals(this._transparent,e._transparent)&&!this._unique&&!e._unique};var Z$J="void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane,\nout vec4 clippedPositionEC)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p0ToP1 = p1 - p0;\nfloat magnitude = length(p0ToP1);\nvec3 direction = normalize(p0ToP1);\nfloat endPoint0Distance = czm_currentFrustum.x + p0.z;\nfloat denominator = -direction.z;\nif (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance > 0.0)\n{\nfloat t = endPoint0Distance / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\np0.z = min(p0.z, -czm_currentFrustum.x);\nclipped = true;\n}\n}\nclippedPositionEC = vec4(p0, 1.0);\npositionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n}\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\n#ifdef POLYLINE_DASH\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\nvec4 clippedPrevWC, clippedPrevEC;\nbool prevSegmentClipped, prevSegmentCulled;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\nvec4 clippedNextWC, clippedNextEC;\nbool nextSegmentClipped, nextSegmentCulled;\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\nbool segmentClipped, segmentCulled;\nvec4 clippedPositionWC, clippedPositionEC;\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\nif (segmentCulled)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\nvec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\nif (prevSegmentCulled)\n{\ndirectionToPrevWC = -directionToNextWC;\n}\nelse if (nextSegmentCulled)\n{\ndirectionToNextWC = -directionToPrevWC;\n}\nvec2 thisSegmentForwardWC, otherSegmentForwardWC;\nif (usePrevious)\n{\nthisSegmentForwardWC = -directionToPrevWC;\notherSegmentForwardWC = directionToNextWC;\n}\nelse\n{\nthisSegmentForwardWC = directionToNextWC;\notherSegmentForwardWC = -directionToPrevWC;\n}\nvec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\nvec2 leftWC = thisSegmentLeftWC;\nfloat expandWidth = width * 0.5;\nif (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n{\nvec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\nvec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\nfloat leftSumLength = length(leftSumWC);\nleftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\nvec2 u = -thisSegmentForwardWC;\nvec2 v = leftWC;\nfloat sinAngle = abs(u.x * v.y - u.y * v.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\nreturn vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nreturn getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n",p$J="#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying vec2 v_st;\nvarying float v_alpha;\n#ifdef TRAIL\nuniform float spotIntensity;\nvarying vec3 v_dist;\nvarying float v_SpotPercent;\n#endif\nvoid main()\n{\nczm_materialInput materialInput;\nvec2 st = v_st;\nst.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = vec3(st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\ngl_FragColor *= u_highlightColor;\n#endif\n#ifdef ENABLE_DYNAMIC\nfloat alpha = v_alpha;\nif(bAsy_4 != 1.0){\nalpha = 0.0;\n}\ngl_FragColor.a = pow(max(0.0, sin(3.14159 * (alpha + (1.0 - 2.0*v_time_3)))), 3.5);\n#endif\n#ifdef TRAIL\nfloat elapsedTime = trailTime_1 - startTime_7;\nfloat t = mod(elapsedTime, period_6) / period_6;\nfloat x = 0.0;\nfloat s1 = t * v_dist.y;\nfloat s2 = (t - trailLength_3) * v_dist.y;\nfloat trailLen = trailLength_3 * v_dist.y;\nif(t < trailLength_3 && v_dist.x > t * v_dist.y){\nx = v_dist.x - v_dist.y;\n}else{\nx = v_dist.x;\n}\nfloat percent = (x - s2) / trailLen;\nif(percent > 1.0 || percent < 0.0)\n{\ndiscard;\n}\nfloat fade = percent;\nif(percent > (1.0 - v_SpotPercent))\n{\ngl_FragColor.rgb *= spotIntensity_4;\n}\ngl_FragColor.a *= fade;\n#endif\n}\n",tr$5="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 v_pickColor;\nvarying float v_polylineAngle;\nvarying float v_alpha;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nfloat polylineAngle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st.s = texCoord;\nv_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\nv_width = width;\nv_pickColor = pickColor;\nv_polylineAngle = polylineAngle;\nv_alpha = abs(texCoord);\n}\n";function e$19(e,t){e=u$Y(e,u$Y.EMPTY_OBJECT),this._show=u$Y(e.show,!0),this._width=u$Y(e.width,1),this._loop=u$Y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,e$28(this._material)||(this._material=a$O.fromType(a$O.ColorType,{color:new e$1S(1,1,1,1)}));var i,r=e.positions;e$28(r)||(r=[]),this._positions=r,this._actualPositions=D$Z(r,t$X.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=r.slice()),this._actualPositions.push(t$X.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id,e$28(t)&&(i=y$15.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=m$U.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(P$H),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=i$19.fromPoints(this._actualPositions),this._boundingVolumeWC=i$19.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new i$19}var I$Z=e$19.POSITION_INDEX=0,w$v=e$19.SHOW_INDEX=1,y$G=e$19.WIDTH_INDEX=2,E$N=e$19.MATERIAL_INDEX=3,d$R=e$19.POSITION_SIZE_INDEX=4,N$C=e$19.DISTANCE_DISPLAY_CONDITION=5,P$H=e$19.NUMBER_OF_PROPERTIES=6;function n$H(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;e$28(i)&&(i._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(e$19.prototype,{show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");e!==this._show&&(this._show=e,n$H(this,w$v))}},positions:{get:function(){return this._positions},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=D$Z(e,t$X.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(t$X.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&n$H(this,d$R),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=i$19.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=i$19.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),n$H(this,I$Z),this.update()}},material:{get:function(){return this._material},set:function(e){if(!e$28(e))throw new t$Z("material is required.");this._material!==e&&(this._material=e,n$H(this,E$N))}},width:{get:function(){return this._width},set:function(e){if(!e$28(e))throw new t$Z("value is required.");e!==this._width&&(this._width=e,n$H(this,y$G))}},loop:{get:function(){return this._loop},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!t$X.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(t$X.clone(t[0]))):t.length>2&&t$X.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,n$H(this,d$R)}}},id:{get:function(){return this._id},set:function(e){this._id=e,e$28(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");r$10.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=r$10.clone(e,this._distanceDisplayCondition),n$H(this,N$C))}}}),e$19.prototype.update=function(){var e=y$15.IDENTITY;e$28(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var t=this._segments.positions.length,i=this._segments.lengths,r=this._propertiesChanged[I$Z]>0||this._propertiesChanged[d$R]>0;if((!y$15.equals(e,this._modelMatrix)||r)&&(this._segments=m$U.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=i$19.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=y$15.clone(e,this._modelMatrix),this._segments.positions.length!==t)n$H(this,d$R);else for(var n=i.length,o=0;o<n;++o)if(i[o]!==this._segments.lengths[o]){n$H(this,d$R);break}},e$19.prototype.getPickId=function(e){return e$28(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},e$19.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<P$H-1;++t)e[t]=0},e$19.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var e$18={OCCLUDED:0,OCCLUDED_TRANSLUCENT:1,NON_OCCLUDED:2},Q$G=Object.freeze(e$18),hr$4=e$19.SHOW_INDEX,ir$5=e$19.WIDTH_INDEX,Te$m=e$19.POSITION_INDEX,nr$6=e$19.MATERIAL_INDEX,be$o=e$19.POSITION_SIZE_INDEX,lr$4=e$19.DISTANCE_DISPLAY_CONDITION,Se$d=e$19.NUMBER_OF_PROPERTIES,L$S={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function X$v(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(y$15.IDENTITY),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._opaqueRS=e.opaqueRS,this._translucentRS=e.translucentRS,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(Se$d),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:A$1c.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=e$1S.clone(e$1S.WHITE);var t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}},this._lineDisplayType=e.lineDisplayType,this._canAlwaysPick=!1}function or$5(e,t){e$28(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:S$W.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:S$W.FLOAT,componentsPerAttribute:2}];e._batchTable=new x$Q(t,i,e._polylines.length)}Object.defineProperties(X$v.prototype,{length:{get:function(){return ye$n(this),this._polylines.length}},lineDisplayType:{get:function(){return this._lineDisplayType},set:function(e){if(o$1u.typeOf.number.greaterThanOrEquals("PolylineCollection.lineDisplayType",e,0),o$1u.typeOf.number.lessThanOrEquals("PolylineCollection.lineDisplayType",e,2),this._lineDisplayType!==e){this._lineDisplayType=e;for(var t,i=this._polylines.length,r=0;r<i;r++){t=void 0;var n=this._polylines[r];if(e$28(n)){for(var o=r+1;o<i;o++){var a=this._polylines[o];if(e$28(a)&&a.id&&a.id===n._index+"-alpha"){t=a;break}}if(e$28(t)||this._lineDisplayType!==Q$G.OCCLUDED_TRANSLUCENT)e$28(t)&&this._lineDisplayType!==Q$G.OCCLUDED_TRANSLUCENT&&this.remove(t);else{var s={show:n.show,positions:n.positions,width:n.width,loop:n.loop,distanceDisplayCondition:n._distanceDisplayCondition},l=a$O.fromType(a$O.ColorType,{color:e$1S.clone(n.material.uniforms.color,new e$1S).withAlpha(.2)});l.uniforms.color.alpha=.2,s.material=l;var u=new e$19(s,this);u.material=l,u._index=this._polylines.length,u.id=n._index+"-alpha",this._polylines.push(u),this._createVertexArray=!0,this._createBatchTable=!0}}}this._lineDisplayType===Q$G.OCCLUDED_TRANSLUCENT?(this._opaqueRS=u$R.fromCache({depthMask:!0,depthTest:{enabled:!0}}),this._translucentRS=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1}})):this._lineDisplayType===Q$G.NON_OCCLUDED?this._opaqueRS=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1}}):this._lineDisplayType===Q$G.OCCLUDED&&(this._opaqueRS=u$R.fromCache({depthMask:!0,depthTest:{enabled:!0}}))}}}}),X$v.prototype.add=function(e){var t=new e$19(e,this);if(t._index=this._polylines.length,this._polylines.push(t),this._lineDisplayType===Q$G.OCCLUDED_TRANSLUCENT){this._opaqueRS=u$R.fromCache({depthMask:!0,depthTest:{enabled:!0}}),this._translucentRS=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1}});var i=a$O.fromType(a$O.ColorType,{color:e$1S.clone(e.material.uniforms.color,new e$1S).withAlpha(.2)});i.uniforms.color.alpha=.2;var r=new e$19(e,this);r.material=i,r._index=this._polylines.length,r.id=t._index+"-alpha",this._polylines.push(r)}else this._lineDisplayType===Q$G.NON_OCCLUDED?this._opaqueRS=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1}}):this._lineDisplayType===Q$G.OCCLUDED&&(this._opaqueRS=u$R.fromCache({depthMask:!0,depthTest:{enabled:!0}}));return this._createVertexArray=!0,this._createBatchTable=!0,t},X$v.prototype.remove=function(e){if(this.contains(e)){this._polylines[e._index]=void 0;var t=this._polylinesToUpdate.indexOf(e);if(-1!==t&&this._polylinesToUpdate.splice(t,1),this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,e$28(e._bucket)){var i=e._bucket;i.shaderProgram=i.shaderProgram&&i.shaderProgram.destroy()}e._destroy();for(var r,n=0,o=this._polylines.length;n<o;n++){var a=this._polylines[n];a&&a.id&&a.id===e._index+"-alpha"&&(r=a)}if(e$28(r)){this._polylines[r._index]=void 0;var s=this._polylinesToUpdate.indexOf(e);-1!==s&&this._polylinesToUpdate.splice(s,1),r._destroy()}return!0}return!1},X$v.prototype.removeAll=function(){Ee$k(this),Ie$l(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},X$v.prototype.contains=function(e){return e$28(e)&&e._polylineCollection===this},X$v.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return ye$n(this),this._polylines[e]};var Ce$j=new i$Q,xe$n=new e$25,Be$m=new o$1k;X$v.prototype.update=function(e){if(ye$n(this),0!==this._polylines.length){mr$4(this,e);var t,i=e.context,r=e.mapProjection,n=this._propertiesChanged;if(this._createBatchTable){if(0===e$1U.maximumVertexTextureImageUnits)throw new t$U("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");or$5(this,i),this._createBatchTable=!1}if(this._createVertexArray||vr$2(this))Re$h(this,i,r);else if(this._polylinesUpdated){var o=this._polylinesToUpdate;if(this._mode!==P$$.SCENE3D)for(var a=o.length,s=0;s<a;++s)(t=o[s]).update();if(n[be$o]||n[nr$6])Re$h(this,i,r);else for(var l=o.length,u=this._polylineBuckets,c=0;c<l;++c){n=(t=o[c])._propertiesChanged;var h=t._bucket,d=0;for(var f in u)if(u.hasOwnProperty(f)){if(u[f]===h){n[Te$m]&&h.writeUpdate(d,t,this._positionBuffer,r);break}d+=u[f].lengthOfPositions}if((n[hr$4]||n[ir$5])&&this._batchTable.setBatchedAttribute(t._index,0,new o$1k(t._width,t._show)),this._batchTable.attributes.length>2){if(n[Te$m]||n[be$o]){var p=e.mode===P$$.SCENE2D?t._boundingVolume2D:t._boundingVolumeWC,_=i$Q.fromCartesian(p.center,Ce$j),m=e$25.fromElements(_.low.x,_.low.y,_.low.z,p.radius,xe$n);this._batchTable.setBatchedAttribute(t._index,2,_.high),this._batchTable.setBatchedAttribute(t._index,3,m)}if(n[lr$4]){var $=Be$m;$.x=0,$.y=Number.MAX_VALUE;var g=t.distanceDisplayCondition;e$28(g)&&($.x=g.near,$.y=g.far),this._batchTable.setBatchedAttribute(t._index,4,$)}}t._clean()}o.length=0,this._polylinesUpdated=!1}n=this._propertiesChanged;for(var v=0;v<Se$d;++v)n[v]=0;var y=y$15.IDENTITY;e.mode===P$$.SCENE3D&&(y=this.modelMatrix);var x=e.passes,b=0!==e.morphTime;if(e$28(this._opaqueRS)||(this._opaqueRS=u$R.fromCache({depthMask:b,depthTest:{enabled:b}})),e$28(this._translucentRS)||(this._translucentRS=u$R.fromCache({blending:Ee$n.ALPHA_BLEND,depthMask:!b,depthTest:{enabled:b}})),this._batchTable.update(e),x.render||x.pick)fr$3(this,e,this._colorCommands,y)}};var ve$l=new i$19,Oe$j=new i$19;function fr$3(e,t,i,r){for(var n=t.context,o=t.commandList,a=i.length,s=0,l=!0,u=e._vertexArrays,c=e.debugShowBoundingVolume,h=e._batchTable.getUniformMapCallback(),d=u.length,f=0;f<d;++f)for(var p=u[f],_=p.buckets,m=_.length,$=0;$<m;++$){for(var g,v,y,x,b=_[$],w=b.offset,C=b.bucket.shaderProgram,T=b.bucket.polylines,S=T.length,E=0,A=0;A<S;++A){var P,I=T[A],M=ur$3(I._material);if(M!==g){if(e$28(g)&&E>0){var O=v.isTranslucent();s>=a?(y=new r$15({owner:e}),i.push(y)):y=i[s],++s,x=p$17(h(v._uniforms),e._uniformMap),y.boundingVolume=i$19.clone(ve$l,y.boundingVolume),y.modelMatrix=r,y.shaderProgram=C,y.vertexArray=p.va,y.renderState=O?e._translucentRS:e._opaqueRS,y.pass=v.isTranslucent()?Le$p.TRANSLUCENT:Le$p.OPAQUE,y.debugShowBoundingVolume=c,y.pickId="v_pickColor",y.uniformMap=x,y.count=E,y.offset=w,w+=E,E=0,l=!0,t.passes.pick&&e._canAlwaysPick&&(y.pass=Le$p.OVERLAY_AGAINST_DEPTH),o.push(y)}(v=I._material).update(n),g=M}for(var D=I._locatorBuckets,R=D.length,L=0;L<R;++L){var B=D[L];B.locator===b&&(E+=B.count)}t.mode===P$$.SCENE3D?P=I._boundingVolumeWC:t.mode===P$$.COLUMBUS_VIEW?P=I._boundingVolume2D:t.mode===P$$.SCENE2D?e$28(I._boundingVolume2D)&&((P=i$19.clone(I._boundingVolume2D,Oe$j)).center.x=0):e$28(I._boundingVolumeWC)&&e$28(I._boundingVolume2D)&&(P=i$19.union(I._boundingVolumeWC,I._boundingVolume2D,Oe$j)),l?(l=!1,i$19.clone(P,ve$l)):i$19.union(P,ve$l,ve$l)}e$28(g)&&E>0&&(s>=a?(y=new r$15({owner:e}),i.push(y)):y=i[s],++s,x=p$17(h(v._uniforms),e._uniformMap),y.boundingVolume=i$19.clone(ve$l,y.boundingVolume),y.modelMatrix=r,y.shaderProgram=C,y.vertexArray=p.va,y.renderState=v.isTranslucent()?e._translucentRS:e._opaqueRS,y.pass=v.isTranslucent()?Le$p.TRANSLUCENT:Le$p.OPAQUE,y.debugShowBoundingVolume=c,y.pickId="v_pickColor",y.uniformMap=x,y.count=E,y.offset=w,t.passes.pick&&e._canAlwaysPick&&(y.pass=Le$p.OVERLAY_AGAINST_DEPTH),l=!0,o.push(y)),g=void 0}i.length=s}function vr$2(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[Te$m]?(r.bufferUsage!==A$1c.STREAM_DRAW&&(t=!0,r.bufferUsage=A$1c.STREAM_DRAW),r.frameCount=100):r.bufferUsage!==A$1c.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=A$1c.STATIC_DRAW):r.frameCount--),t}X$v.prototype.isDestroyed=function(){return!1},X$v.prototype.destroy=function(){return Ue$l(this),Ee$k(this),Ie$l(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)};var Le$m=[0,0,0];function Re$h(e,t,i){e._createVertexArray=!1,Ee$k(e),Ue$l(e),dr$3(e);var r,n,o=[[]],a=o[0],s=e._batchTable,l=e._useHighlightColor,u=[0],c=0,h=[[]],d=0,f=e._polylineBuckets;for(r in f)f.hasOwnProperty(r)&&((n=f[r]).updateShader(t,s,l),d+=n.lengthOfPositions);if(d>0){var p,_=e._mode,m=new Float32Array(6*d*3),$=new Float32Array(4*d),g=0,v=0,y=0;for(r in f)if(f.hasOwnProperty(r)){(n=f[r]).write(m,$,g,v,y,s,t,i),_===P$$.MORPHING&&(e$28(p)||(p=new Float32Array(6*d*3)),n.writeForMorph(p,g));var x=n.lengthOfPositions;g+=6*x*3,v+=4*x,y+=4*x,c=n.updateIndices(o,u,h,c)}var b,w=e._positionBufferUsage.bufferUsage,C=A$1c.STATIC_DRAW;e._positionBuffer=h$W.createVertexBuffer({context:t,typedArray:m,usage:w}),e$28(p)&&(b=h$W.createVertexBuffer({context:t,typedArray:p,usage:w})),e._texCoordExpandAndBatchIndexBuffer=h$W.createVertexBuffer({context:t,typedArray:$,usage:C});for(var T=3*Float32Array.BYTES_PER_ELEMENT,S=4*Float32Array.BYTES_PER_ELEMENT,E=0,A=o.length,P=0;P<A;++P)if((a=o[P]).length>0){var I=new Uint16Array(a),M=h$W.createIndexBuffer({context:t,typedArray:I,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});E+=u[P];var O,D,R,L,B=6*(P*(T*e$27.SIXTY_FOUR_KILOBYTES)-E*T),N=T+B,F=T+N,z=T+F,k=T+z,V=T+k,U=P*(S*e$27.SIXTY_FOUR_KILOBYTES)-E*S,X=[{index:L$S.position3DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:B,strideInBytes:6*T},{index:L$S.position3DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:N,strideInBytes:6*T},{index:L$S.position2DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:B,strideInBytes:6*T},{index:L$S.position2DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:N,strideInBytes:6*T},{index:L$S.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:F,strideInBytes:6*T},{index:L$S.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:z,strideInBytes:6*T},{index:L$S.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:F,strideInBytes:6*T},{index:L$S.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:z,strideInBytes:6*T},{index:L$S.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:k,strideInBytes:6*T},{index:L$S.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:V,strideInBytes:6*T},{index:L$S.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:k,strideInBytes:6*T},{index:L$S.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:V,strideInBytes:6*T},{index:L$S.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:U}];_===P$$.SCENE3D?(O=e._positionBuffer,D="vertexBuffer",R=Le$m,L="value"):_===P$$.SCENE2D||_===P$$.COLUMBUS_VIEW?(O=Le$m,D="value",R=e._positionBuffer,L="vertexBuffer"):(O=b,D="vertexBuffer",R=e._positionBuffer,L="vertexBuffer"),X[0][D]=O,X[1][D]=O,X[2][L]=R,X[3][L]=R,X[4][D]=O,X[5][D]=O,X[6][L]=R,X[7][L]=R,X[8][D]=O,X[9][D]=O,X[10][L]=R,X[11][L]=R;var H=new m$19({context:t,attributes:X,indexBuffer:M});e._vertexArrays.push({va:H,buckets:h[P]})}}}function _r$2(e,t){return t instanceof L$17?t.id:t}var me$s=[];function ur$3(e){var t=a$O._uniformList[e.type],i=t.length;me$s.length=2*i;for(var r=0,n=0;n<i;++n){var o=t[n];me$s[r]=o,me$s[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(me$s,_r$2)}function dr$3(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var l=s.material,u=r[l.type];e$28(u)||(u=r[l.type]=new Q$F(l,t,i)),u.addPolyline(s)}}}function mr$4(e,t){var i=t.mode;(e._mode!==i||!y$15.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=i,e._modelMatrix=y$15.clone(e.modelMatrix),e._createVertexArray=!0)}function ye$n(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r<i;++r){var o=e._polylines[r];e$28(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function Ee$k(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)if(e$28(t[r])){var n=t[r]._bucket;e$28(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function Ue$l(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function Ie$l(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)e$28(t[r])&&t[r]._destroy()}function De$o(e,t,i){this.count=e,this.offset=t,this.bucket=i}function Q$F(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=i}function Ve$j(e){return t$X.dot(t$X.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(o$1i.ORIGIN_ZX_PLANE)===pt$a.INTERSECTING}X$v.prototype._updatePolyline=function(e,t){if("string"!=typeof e.id||"alpha"!==e.id.slice(-5)){if(this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),this._lineDisplayType===Q$G.OCCLUDED_TRANSLUCENT)for(var i=0;i<this._polylines.length;i++){var r=this._polylines[i];r.id&&r.id===e._index+"-alpha"&&(r._dirty||this._polylinesToUpdate.push(r),r.positions=e.positions,++this._propertiesChanged[t])}++this._propertiesChanged[t]}},Q$F.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Q$F.prototype.updateShader=function(e,t,i){if(!e$28(this.shaderProgram)){var r=["DISTANCE_DISPLAY_CONDITION"];i&&r.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&r.push("POLYLINE_DASH"),"PolylineDynamic"===this.material.type&&r.push("ENABLE_DYNAMIC"),s$V.isInternetExplorer()||r.push("CLIP_POLYLINE");var n=new a$$({defines:r,sources:["varying vec4 v_pickColor;\n",this.material.shaderSource,p$J]}),o=t.getVertexShaderCallback()(tr$5),a=new a$$({defines:r,sources:[Z$J,o]});this.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:n,attributeLocations:L$S})}},Q$F.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===P$$.SCENE3D||!Ve$j(e))return 4*(t=e._actualPositions.length)-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;n<t;++n)i+=4*r[n]-4;return i};var b$Q=new t$X,k$H=new t$X,W$E=new t$X,ce$n=new t$X,cr$4=new e$25,pr$4=new o$1k;Q$F.prototype.write=function(e,t,i,r,n,o,a,s){for(var l=this.mode,u=s.ellipsoid.maximumRadius*e$27.PI,c=this.polylines,h=c.length,d=0;d<h;++d){for(var f,p=c[d],_=p.width,m=p.show&&_>0,$=p._index,g=this.getSegments(p,s),v=g.positions,y=g.lengths,x=v.length,b=p.getPickId(a).color,w=0,C=0,T=0;T<x;++T){0===T?p._loop?f=v[x-2]:(f=ce$n,t$X.subtract(v[0],v[1],f),t$X.add(v[0],f,f)):f=v[T-1],t$X.clone(f,k$H),t$X.clone(v[T],b$Q),T===x-1?p._loop?f=v[1]:(f=ce$n,t$X.subtract(v[x-1],v[x-2],f),t$X.add(v[x-1],f,f)):f=v[T+1],t$X.clone(f,W$E);var S=y[w];T===C+S&&(C+=S,++w);var E=T-C==0,A=T===C+y[w]-1;l===P$$.SCENE2D&&(k$H.z=0,b$Q.z=0,W$E.z=0),(l===P$$.SCENE2D||l===P$$.MORPHING)&&(E||A)&&u-Math.abs(b$Q.x)<1&&((b$Q.x<0&&k$H.x>0||b$Q.x>0&&k$H.x<0)&&t$X.clone(b$Q,k$H),(b$Q.x<0&&W$E.x>0||b$Q.x>0&&W$E.x<0)&&t$X.clone(b$Q,W$E));for(var P=A?2:4,I=E?2:0;I<P;++I){i$Q.writeElements(b$Q,e,i),i$Q.writeElements(k$H,e,i+6),i$Q.writeElements(W$E,e,i+12);var M=I-2<0?-1:1;t[n]=T/(x-1),t[n+1]=I%2*2-1,t[n+2]=M,t[n+3]=$,i+=18,n+=4}}var O=cr$4;O.x=e$1S.floatToByte(b.red),O.y=e$1S.floatToByte(b.green),O.z=e$1S.floatToByte(b.blue),O.w=e$1S.floatToByte(b.alpha);var D=pr$4;D.x=_,D.y=m?1:0;var R=l===P$$.SCENE2D?p._boundingVolume2D:p._boundingVolumeWC,L=i$Q.fromCartesian(R.center,Ce$j),B=L.high,N=e$25.fromElements(L.low.x,L.low.y,L.low.z,R.radius,xe$n),F=Be$m;F.x=0,F.y=Number.MAX_VALUE;var z=p.distanceDisplayCondition;e$28(z)&&(F.x=z.near,F.y=z.far),o.setBatchedAttribute($,0,D),o.setBatchedAttribute($,1,O),o.attributes.length>2&&(o.setBatchedAttribute($,2,B),o.setBatchedAttribute($,3,N),o.setBatchedAttribute($,4,F))}};var gr$5=new t$X,Tr$1=new t$X,yr$2=new t$X,Me$k=new t$X;Q$F.prototype.writeForMorph=function(e,t){for(var i=this.modelMatrix,r=this.polylines,n=r.length,o=0;o<n;++o)for(var a=r[o],s=a._segments.positions,l=a._segments.lengths,u=s.length,c=0,h=0,d=0;d<u;++d){var f;0===d?a._loop?f=s[u-2]:(f=Me$k,t$X.subtract(s[0],s[1],f),t$X.add(s[0],f,f)):f=s[d-1],f=y$15.multiplyByPoint(i,f,Tr$1);var p,_=y$15.multiplyByPoint(i,s[d],gr$5);d===u-1?a._loop?p=s[1]:(p=Me$k,t$X.subtract(s[u-1],s[u-2],p),t$X.add(s[u-1],p,p)):p=s[d+1],p=y$15.multiplyByPoint(i,p,yr$2);var m=l[c];d===h+m&&(h+=m,++c);for(var $=d-h==0,g=d===h+l[c]-1?2:4,v=$?2:0;v<g;++v)i$Q.writeElements(_,e,t),i$Q.writeElements(f,e,t+6),i$Q.writeElements(p,e,t+12),t+=18}};var Er$1=new Array(1);Q$F.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new De$o(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;h<c;++h){var d,f=u[h];if(f._locatorBuckets=[],this.mode===P$$.SCENE3D){d=Er$1;var p=f._actualPositions.length;if(!(p>0))continue;d[0]=p}else d=f._segments.lengths;var _=d.length;if(_>0){for(var m=0,$=0;$<_;++$)for(var g=d[$]-1,v=0;v<g;++v)l+4>e$27.SIXTY_FOUR_KILOBYTES&&(f._locatorBuckets.push({locator:o,count:m}),m=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new De$o(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),m+=6,a+=6,r+=6,l+=4;f._locatorBuckets.push({locator:o,count:m}),l+4>e$27.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new De$o(0,0,this),i[++n]=[o])}f._clean()}return o.count=a,r},Q$F.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var oe$r={positions:void 0,lengths:void 0},Fe$f=new Array(1),Dr$1=new t$X,Ar$2=new t$W,ke$d;Q$F.prototype.getSegments=function(e,t){var i=e._actualPositions;if(this.mode===P$$.SCENE3D)return Fe$f[0]=i.length,oe$r.positions=i,oe$r.lengths=Fe$f,oe$r;Ve$j(e)&&(i=e._segments.positions);for(var r,n=t.ellipsoid,o=[],a=this.modelMatrix,s=i.length,l=Dr$1,u=0;u<s;++u)r=i[u],l=y$15.multiplyByPoint(a,r,l),o.push(t.project(n.cartesianToCartographic(l,Ar$2)));if(o.length>0){e._boundingVolume2D=i$19.fromPoints(o,e._boundingVolume2D);var c=e._boundingVolume2D.center;e._boundingVolume2D.center=new t$X(c.z,c.x,c.y)}return oe$r.positions=o,oe$r.lengths=e._segments.lengths,oe$r},Q$F.prototype.writeUpdate=function(e,t,i,r){var n=this.mode,o=r.ellipsoid.maximumRadius*e$27.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);var s=ke$d,l=6*a*3;!e$28(s)||s.length<l?s=ke$d=new Float32Array(l):s.length>l&&(s=new Float32Array(s.buffer,0,l));var u,c=this.getSegments(t,r),h=c.positions,d=c.lengths,f=0,p=0,_=0;a=h.length;for(var m=0;m<a;++m){0===m?t._loop?u=h[a-2]:(u=ce$n,t$X.subtract(h[0],h[1],u),t$X.add(h[0],u,u)):u=h[m-1],t$X.clone(u,k$H),t$X.clone(h[m],b$Q),m===a-1?t._loop?u=h[1]:(u=ce$n,t$X.subtract(h[a-1],h[a-2],u),t$X.add(h[a-1],u,u)):u=h[m+1],t$X.clone(u,W$E);var $=d[p];m===_+$&&(_+=$,++p);var g=m-_==0,v=m===_+d[p]-1;n===P$$.SCENE2D&&(k$H.z=0,b$Q.z=0,W$E.z=0),(n===P$$.SCENE2D||n===P$$.MORPHING)&&(g||v)&&o-Math.abs(b$Q.x)<1&&((b$Q.x<0&&k$H.x>0||b$Q.x>0&&k$H.x<0)&&t$X.clone(b$Q,k$H),(b$Q.x<0&&W$E.x>0||b$Q.x>0&&W$E.x<0)&&t$X.clone(b$Q,W$E));for(var y=v?2:4,x=g?2:0;x<y;++x)i$Q.writeElements(b$Q,s,f),i$Q.writeElements(k$H,s,f+6),i$Q.writeElements(W$E,s,f+12),f+=18}i.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Q$E="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main(void)\n{\nfloat logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_globeDepthTextureDim.xy)));\nvec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\nif (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\nfloat widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\nfloat distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\nfloat distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\nif (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\ngl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\nreturn;\n#else // DEBUG_SHOW_VOLUME\ndiscard;\n#endif // DEBUG_SHOW_VOLUME\n}\nvec3 alignedPlaneNormal;\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\nalignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\nalignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\ndistanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\ns = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\nfloat t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, t);\nmaterialInput.str = vec3(s, t, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClampedToFarPlane();\n}\n",W$D="varying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\nreturn (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\nvoid main(void)\n{\nvec4 eyeCoordinate = gl_FragCoord;\neyeCoordinate /= eyeCoordinate.w;\n#ifdef PER_INSTANCE_COLOR\ngl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\nfloat distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\nfloat distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\ndistanceFromStart = max(0.0, distanceFromStart);\ndistanceFromEnd = max(0.0, distanceFromEnd);\nfloat s = distanceFromStart / (distanceFromStart + distanceFromEnd);\ns = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\nczm_materialInput materialInput;\nmaterialInput.s = s;\nmaterialInput.st = vec2(s, v_texcoordT);\nmaterialInput.str = vec3(s, v_texcoordT, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n",Y$y="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\nattribute float batchId;\nvarying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\nvoid main()\n{\nv_batchId = batchId;\nvec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));\nvec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);\nvec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nvec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nvec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec4 startPlane2D;\nvec4 startPlane3D;\nstartPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlane2D.w = -dot(startPlane2D.xyz, posEc2D);\nstartPlane3D.w = -dot(startPlane3D.xyz, posEc3D);\nvec4 rightPlane2D;\nvec4 rightPlane3D;\nrightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nrightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nrightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);\nrightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);\nposRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);\nposRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);\nposRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);\nposEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;\nposEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;\nvec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;\nvec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));\nvec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));\nvec4 endPlane2D;\nvec4 endPlane3D;\nendPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlane2D.w = -dot(endPlane2D.xyz, posEc2D);\nendPlane3D.w = -dot(endPlane3D.xyz, posEc3D);\nv_forwardDirectionEC = normalize(endEC - startEC);\nvec2 cleanTexcoordNormalization2D;\ncleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);\ncleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));\nvec2 cleanTexcoordNormalization3D;\ncleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\ncleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;\ncleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));\nv_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#else // PER_INSTANCE_COLOR\nv_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);\nv_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);\n#endif // PER_INSTANCE_COLOR\n#ifdef WIDTH_VARYING\nfloat width = czm_batchTable_width(batchId);\nfloat halfWidth = width * 0.5;\nv_width = width;\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#else\nfloat halfWidth = 0.5 * czm_batchTable_width(batchId);\nv_texcoordNormalizationAndHalfWidth.z = halfWidth;\n#endif\nvec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);\nvec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nvec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));\ngeodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc3D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\npositionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;\nvec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nabsStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));\nabsEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));\nplaneDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);\nupOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));\nnormalEC = normalize(cross(planeDirection, upOrDown));\ngeodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));\ngeodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);\ngeodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;\npositionEc2D.xyz += geodeticSurfaceNormal;\nnormalEC *= sign(texcoordNormalization2D.x);\n#ifndef PER_INSTANCE_COLOR\nv_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);\n#endif\npositionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;\ngl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n",q$K="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n#ifndef COLUMBUS_VIEW_2D\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n#endif\nattribute float batchId;\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\nvec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\nvec3 ecEnd = forwardDirectionEC + ecStart;\nforwardDirectionEC = normalize(forwardDirectionEC);\nv_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\nv_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n#else // COLUMBUS_VIEW_2D\nvec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\nvec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\nvec3 ecEnd = ecStart + offset;\nvec3 forwardDirectionEC = normalize(offset);\nvec4 startPlaneEC;\nstartPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\nstartPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\nvec4 endPlaneEC;\nendPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\nendPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\nv_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\nv_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\nv_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\nv_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n#endif // COLUMBUS_VIEW_2D\nv_endEcAndStartEcX.xyz = ecEnd;\nv_endEcAndStartEcX.w = ecStart.x;\nv_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\nvec4 positionRelativeToEye = czm_computePosition();\nvec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;\nfloat absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\nfloat absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\nvec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\nvec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));\nvec3 normalEC = normalize(cross(planeDirection, upOrDown));\nupOrDown = cross(forwardDirectionEC, normalEC);\nupOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\nupOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\nupOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\npositionEC.xyz += upOrDown;\nv_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\nfloat width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\nv_width = width;\n#endif\nv_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\nv_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\nv_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\nv_endPlaneNormalEcAndBatchId.w = batchId;\nwidth = width * max(0.0, czm_metersPerPixel(positionEC));\nwidth = width / dot(normalEC, v_rightPlaneEC.xyz);\n#ifdef COLUMBUS_VIEW_2D\nnormalEC *= sign(texcoordNormalization2D.x);\n#else\nnormalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\npositionEC.xyz += width * normalEC;\ngl_Position = czm_depthClampFarPlane(czm_projection * positionEC);\n#ifdef ANGLE_VARYING\nvec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\napproxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\nv_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n",m$J="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\nv_color = color;\n}\n",o$S=Z$J+"\n"+m$J,f$M=d$T;function e$17(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.translucent,!0),i=e$17.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=u$Y(e.vertexShaderSource,o$S),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,f$M),this._renderState=a$P.getDefaultRenderState(t,false,e.renderState),this._closed=false,this._vertexFormat=i}s$V.isInternetExplorer()||(o$S="#define CLIP_POLYLINE \n"+o$S),Object.defineProperties(e$17.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),e$17.VERTEX_FORMAT=n$10.POSITION_ONLY,e$17.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,e$17.prototype.isTranslucent=a$P.prototype.isTranslucent,e$17.prototype.getRenderState=a$P.prototype.getRenderState;var S$A="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\n#ifdef TRAIL\nuniform float spotSize_2;\nattribute vec3 dist;\nvarying vec3 v_dist;\nvarying float v_SpotPercent;\n#endif\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvarying float v_alpha;\nvoid main()\n{\nfloat u = abs(expandAndWidth.x);\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\nv_width = width;\nv_st.s = st.s;\nv_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\nv_polylineAngle = angle;\nv_alpha = u;\n#ifdef TRAIL\nfloat t = 0.0;\nv_dist = dist;\nv_SpotPercent = spotSize_2 / dist.y;\n#endif\n}\n",i$H=Z$J+"\n"+S$A,h$G=p$J;function r$I(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.translucent,!0),i=r$I.VERTEX_FORMAT;this.material=e$28(e.material)?e.material:a$O.fromType(a$O.ColorType),this.translucent=t,this._vertexShaderSource=u$Y(e.vertexShaderSource,i$H),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,h$G),this._renderState=a$P.getDefaultRenderState(t,false,e.renderState),this._closed=false,this._vertexFormat=i}function g$D(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;var t=e.appearance;e$28(t)||(t=new r$I),this.appearance=t,this.show=u$Y(e.show,!0),this.classificationType=u$Y(e.classificationType,L$V.BOTH),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=u$Y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:u$Y(e.interleave,!1),releaseGeometryInstances:u$Y(e.releaseGeometryInstances,!0),allowPicking:u$Y(e.allowPicking,!0),asynchronous:u$Y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=V$C(0),this._renderState3DTiles=V$C(1),this._renderStateS3M=V$C(2),this._renderStateMorph=u$R.fromCache({cull:{enabled:!0,face:k$11.FRONT},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND,depthMask:!1})}function Z$I(e,t,i){var r=t.context,n=e._primitive,o=n._attributeLocations,a=n._batchTable.getVertexShaderCallback()(q$K);a=v$C._appendShowToShader(n,a),a=v$C._appendDistanceDisplayConditionToShader(n,a),a=v$C._modifyShaderPosition(e,a,t.scene3DOnly);var s=n._batchTable.getVertexShaderCallback()(Y$y);s=v$C._appendShowToShader(n,s),s=v$C._appendDistanceDisplayConditionToShader(n,s),s=v$C._modifyShaderPosition(e,s,t.scene3DOnly);var l=n._batchTable.getVertexShaderCallback()(Q$E),u=["GLOBE_MINIMUM_ALTITUDE "+t.mapProjection.ellipsoid.minimumRadius.toFixed(1)],c="",h="";e$28(i.material)?(-1!==(h=e$28(i.material)?i.material.shaderSource:"").search(/varying\s+float\s+v_polylineAngle;/g)&&u.push("ANGLE_VARYING"),-1!==h.search(/varying\s+float\s+v_width;/g)&&u.push("WIDTH_VARYING")):c="PER_INSTANCE_COLOR",u.push(c);var d=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",c]:[c],f=new a$$({defines:u,sources:[a]}),p=new a$$({defines:d,sources:[h,l]});e._sp=S$T.replaceCache({context:r,shaderProgram:n._sp,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:o});var _=r.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!e$28(_)){var m=new a$$({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});_=r.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:r,shaderProgram:e._sp2D,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:o})}e._sp2D=_;var $=r.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!e$28($)){var g=new a$$({defines:u.concat(["MAX_TERRAIN_HEIGHT "+e$1_._defaultMaxTerrainHeight.toFixed(1)]),sources:[s]}),v=new a$$({defines:d,sources:[h,l=n._batchTable.getVertexShaderCallback()(W$D)]});$=r.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:r,shaderProgram:e._spMorph,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:o})}e._spMorph=$}function V$C(e){return u$R.fromCache({cull:{enabled:!0},blending:Ee$n.ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e>0,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.KEEP},backFunction:m$12.EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.KEEP},reference:2===e?Fa$6.S3M_TILE:Fa$6.CESIUM_3D_TILE_MASK,mask:Fa$6.CLASSIFICATION_MASK}})}function $$G(e,t,i,r,n,o){var a=e._primitive,s=a._va.length;n.length=s,o.length=s;for(var l=t instanceof e$17?{}:i._uniforms,u=a._batchTable.getUniformMapCallback()(l),c=0;c<s;c++){var h=a._va[c],d=n[c];e$28(d)||(d=n[c]=new r$15({owner:e,primitiveType:a._primitiveType})),d.vertexArray=h,d.renderState=e._renderState,d.shaderProgram=e._sp,d.uniformMap=u,d.pass=Le$p.TERRAIN_CLASSIFICATION,d.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";var f=r$15.shallowClone(d,d.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=f;var p=r$15.shallowClone(d,d.derivedCommands.S3M);p.renderState=e._renderStateS3M,p.pass=Le$p.ClampObject,d.derivedCommands.S3M=p;var _=r$15.shallowClone(d,d.derivedCommands.color2D);_.shaderProgram=e._sp2D,d.derivedCommands.color2D=_;var m=r$15.shallowClone(f,f.derivedCommands.color2D);m.shaderProgram=e._sp2D,f.derivedCommands.color2D=m;var $=r$15.shallowClone(p,p.derivedCommands.color2D);$.shaderProgram=e._sp2D,p.derivedCommands.color2D=$;var g=r$15.shallowClone(d,d.derivedCommands.colorMorph);g.renderState=e._renderStateMorph,g.shaderProgram=e._spMorph,g.pickId="czm_batchTable_pickColor(v_batchId)",d.derivedCommands.colorMorph=g}}function L$R(e,t,i,r,n,o,a){i.mode===P$$.MORPHING?t=t.derivedCommands.colorMorph:i.mode!==P$$.SCENE3D&&(t=t.derivedCommands.color2D),t&&(t.modelMatrix=r,t.boundingVolume=o,t.cull=n,t.debugShowBoundingVolume=a,i.commandList.push(t))}function ee$v(e,t,i,r,n,o,a){var s,l=e._primitive;v$C._updateBoundingVolumes(l,t,n),t.mode===P$$.SCENE3D?s=l._boundingSphereWC:t.mode===P$$.COLUMBUS_VIEW?s=l._boundingSphereCV:t.mode===P$$.SCENE2D&&e$28(l._boundingSphere2D)?s=l._boundingSphere2D:e$28(l._boundingSphereMorph)&&(s=l._boundingSphereMorph);var u=t.mode===P$$.MORPHING,c=e.classificationType,h=c===L$V.TERRAIN,d=c===L$V.S3M_TILE,f=c===L$V.CESIUM_3D_TILE&&!u;c===L$V.BOTH&&(h=!0,d=!0,f=!0);var p=t.passes;if(p.render||p.pick&&l.allowPicking)for(var _=i.length,m=0;m<_;++m){var $=s[m];h&&L$R(e,i[m],t,n,o,$,a),f&&L$R(e,i[m].derivedCommands.tileset,t,n,o,$,a),d&&L$R(e,i[m].derivedCommands.S3M,t,n,o,$,a)}}function n$G(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new o$1o,this.setCallback(e,t)}function q$J(e){return Array.isArray(e)&&(e=new e$1m(e)),new e$1d(e)}function u$B(e){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._definitionChanged=new o$1o,this._fromDataSource=!1,this.groundBottomAltitude=void 0,this.groundExtrudedHeight=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function E$M(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}s$V.isInternetExplorer()||(i$H="#define CLIP_POLYLINE \n"+i$H),Object.defineProperties(r$I.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e="#define POLYLINE_DASH\n"+e),"PolylineDynamic"==this.material.type&&(e="#define ENABLE_DYNAMIC\n"+e),"PolylineTrail"==this.material.type&&(e="#define TRAIL\n"+e),e}},fragmentShaderSource:{get:function(){var e=this._fragmentShaderSource;return"PolylineDynamic"==this.material.type&&(e="#define ENABLE_DYNAMIC\n"+e),"PolylineTrail"==this.material.type&&(e="#define TRAIL\n"+e),e}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),r$I.VERTEX_FORMAT=n$10.POSITION_AND_ST,r$I.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,r$I.prototype.isTranslucent=a$P.prototype.isTranslucent,r$I.prototype.getRenderState=a$P.prototype.getRenderState,Object.defineProperties(g$D.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),g$D.initializeTerrainHeights=function(){return e$1_.initialize()},g$D.prototype.update=function(e){if(e$28(this._primitive)||e$28(this.geometryInstances)){if(!e$1_.initialized){if(!this.asynchronous)throw new t$Z("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");return void g$D.initializeTerrainHeights()}var t,i=this,r=this._primitiveOptions;if(!e$28(this._primitive)){var n,o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],a=o.length,s=new Array(a);for(t=0;t<a;++t)if(!e$28(n=o[t].attributes)||!e$28(n.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<a;++t){var l=o[t];n={};var u=l.attributes;for(var c in u)u.hasOwnProperty(c)&&(n[c]=u[c]);e$28(n.width)||(n.width=new o$13({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,aa$1.setProjectionAndEllipsoid(l.geometry,e.mapProjection),s[t]=new d$15({geometry:l.geometry,attributes:n,id:l.id,pickPrimitive:i})}r.geometryInstances=s,r.appearance=this.appearance,r._createShaderProgramFunction=function(e,t,r){Z$I(i,t,r)},r._createCommandsFunction=function(e,t,r,n,o,a,s){$$G(i,t,r,n,a,s)},r._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){ee$v(i,t,r,n,o,a,s)},this._primitive=new v$C(r),this._primitive.readyPromise.then((function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;e$28(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)}))}if(this.appearance instanceof e$17&&!this._hasPerInstanceColors)throw new t$Z("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},g$D.prototype.getGeometryInstanceAttributes=function(e){if(!e$28(this._primitive))throw new t$Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},g$D.isSupported=function(e){return e.frameState.context.depthTexture},g$D.prototype.isDestroyed=function(){return!1},g$D.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,i$Z(this)},Object.defineProperties(n$G.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n$G.prototype.getValue=function(e,t){return this._callback(e,t)},n$G.prototype.setCallback=function(e,t){if(!e$28(e))throw new t$Z("callback is required.");if(!e$28(t))throw new t$Z("isConstant is required.");var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n$G.prototype.equals=function(e){return this===e||e instanceof n$G&&this._callback===e._callback&&this._isConstant===e._isConstant},Object.defineProperties(u$B.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),material:c$K("material"),hierarchy:C$H("hierarchy",void 0,q$J),height:C$H("height"),heightReference:C$H("heightReference"),extrudedHeight:C$H("extrudedHeight"),extrudedHeightReference:C$H("extrudedHeightReference"),granularity:C$H("granularity"),stRotation:C$H("stRotation"),fill:C$H("fill"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),perPositionHeight:C$H("perPositionHeight"),closeTop:C$H("closeTop"),closeBottom:C$H("closeBottom"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),classificationType:C$H("classificationType"),arcType:C$H("arcType"),zIndex:C$H("zIndex"),groundBottomAltitude:C$H("groundBottomAltitude"),groundExtrudedHeight:C$H("groundExtrudedHeight")}),u$B.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.arcType=this.arcType,e.zIndex=this.zIndex,e):new u$B(this)},u$B.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.material=u$Y(this.material,e.material),this.hierarchy=u$Y(this.hierarchy,e.hierarchy),this.height=u$Y(this.height,e.height),this.heightReference=u$Y(this.heightReference,e.heightReference),this.extrudedHeight=u$Y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=u$Y(this.extrudedHeightReference,e.extrudedHeightReference),this.granularity=u$Y(this.granularity,e.granularity),this.stRotation=u$Y(this.stRotation,e.stRotation),this.fill=u$Y(this.fill,e.fill),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=u$Y(this.perPositionHeight,e.perPositionHeight),this.closeTop=u$Y(this.closeTop,e.closeTop),this.closeBottom=u$Y(this.closeBottom,e.closeBottom),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=u$Y(this.classificationType,e.classificationType),this.arcType=u$Y(this.arcType,e.arcType),this.zIndex=u$Y(this.zIndex,e.zIndex),this.groundBottomAltitude=u$Y(this.groundBottomAltitude,e.groundBottomAltitude),this.groundExtrudedHeight=u$Y(this.groundExtrudedHeight,e.groundExtrudedHeight)},u$B.processWideOutline=function(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r._polygon;if(n instanceof u$B){if(r.show&&e$28(n._outline)&&n._outline._value&&n._outlineWidth>1&&!e$28(n.outlines)){var o,a={width:n._outlineWidth._value,material:void 0,positions:[],loop:!0,distanceDisplayCondition:new r$10(0,5e4)};if(n.definitionChanged.addEventListener((function(e,t,i,r){e$28(n.outlines)&&n.outlines.removeAll(),n.outlines=void 0})),n.outlines=e.primitives.add(new X$v),o=e$28(n._hierarchy._value)?Array.isArray(n._hierarchy._value)?n._hierarchy._value:n._hierarchy._value.positions:n._hierarchy instanceof n$G?n._hierarchy.getValue(e.frameState.time).positions:n._hierarchy.polygon._positions._value,!n.perPositionHeight||n._height>0)for(var s=0;s<o.length;s++){(h=t$W.fromCartesian(o[s])).height=e$28(n._height)?n._height._value:0,o[s]=t$W.toCartesian(h)}if(Math.abs(n._extrudedHeight)>0){var l=[];for(s=0;s<o.length;s++){(h=t$W.fromCartesian(o[s])).height=n._extrudedHeight._value;var u=t$W.toCartesian(h);l.push(u),n.outlines.add(p$17({positions:[o[s],u],loop:!1,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a))}n.outlines.add(p$17({positions:l,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a))}if(n.outlines.add(p$17({positions:o,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a)),e$28(n._hierarchy._value.holes))for(var c=0;c<n._hierarchy._value.holes.length;c++){if(o=n._hierarchy._value.holes[c].positions,!n.perPositionHeight||n._height>0)for(s=0;s<o.length;s++){(h=t$W.fromCartesian(o[s])).height=e$28(n._height)?n._height._value:0,o[s]=t$W.toCartesian(h)}if(Math.abs(n._extrudedHeight)>0){for(l=[],s=0;s<o.length;s++){var h;(h=t$W.fromCartesian(o[s])).height=n._extrudedHeight._value;u=t$W.toCartesian(h);l.push(u),n.outlines.add(p$17({positions:[o[s],u],loop:!1,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a))}n.outlines.add(p$17({positions:l,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a))}n.outlines.add(p$17({positions:o,material:a$O.fromType(a$O.ColorType,{color:n._outlineColor._value})},a))}}if(e$28(n.outlines))for(let e=0;e<n.outlines._polylines.length;e++)n.outlines._polylines[e].show=r.show,e$28(r.geometry)&&(e$28(r.geometry.outlineWidth)&&!isNaN(r.geometry.outlineWidth)&&(n.outlines._polylines[e].width=r.geometry.outlineWidth),e$28(r.geometry.outlineColor)&&r.geometry.outlineColor instanceof e$1S&&(n.outlines._polylines[e].material.uniforms.color=r.geometry.outlineColor))}}},u$B.processClampWideOutline=function(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r._polygon;if(!(n instanceof u$B))return;let u=e.frameState.time;if(r.show&&e$28(n._outline)&&n._outline._value&&n._outlineWidth>1&&!e$28(n.clampOutlines)){var o;e$28(n.outlineColor)||(n.outlineColor=e$1S.BLACK),n.definitionChanged.addEventListener((function(t,i,r,o){e$28(n.clampOutlines)&&e.primitives.remove(n.clampOutlines),n.clampOutlines=void 0})),o=e$28(n._hierarchy._value)?Array.isArray(n._hierarchy._value)?n._hierarchy._value:n._hierarchy._value.positions:n._hierarchy.polygon._positions._value;var a=new E$M;a.positions=o,t$X.equals(o[0],o[o.length-1])||(a.loop=!0),a.width=n._outlineWidth._value||1;var s={show:new e$1h(!0),color:o$18.fromColor(n._outlineColor._value),width:new o$13({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:1,value:[a.width]})},l=new d$15({id:r,geometry:new aa$1(a),attributes:s});n.clampOutlines=new g$D({show:!0,asynchronous:!0,geometryInstances:l,classificationType:n._classificationType?n._classificationType._value:L$V.BOTH,appearance:new e$17}),e.primitives.add(n.clampOutlines)}if(e$28(n.clampOutlines)){let e=!e$28(n.show)||n.show.getValue(u);n.clampOutlines.show=e&&r.isShowing}}};var _0x729d77=(_0x2d6195=!0,function(e,t){var i=_0x2d6195?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2d6195=!1,i}),_0x480f1c=_0x729d77(void 0,(function(){return _0x480f1c.toString().search("(((.+)+)+)+$").toString().constructor(_0x480f1c).search("(((.+)+)+)+$")})),_0x2d6195;function _0x17966c(){}function v$C(e){if(e=u$Y(e,u$Y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.swipeEnabled=!1,this._swipeEnabled=!1,this._swipeRegion=new e$25(0,0,1,1),this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=new y$15,this.updateBoundingSphere=u$Y(e.updateBoundingSphere,!0),this.show=u$Y(e.show,!0),this._vertexCacheOptimize=u$Y(e.vertexCacheOptimize,!1),this._interleave=u$Y(e.interleave,!1),this._releaseGeometryInstances=u$Y(e.releaseGeometryInstances,!0),this._allowPicking=u$Y(e.allowPicking,!0),this._asynchronous=u$Y(e.asynchronous,!0),this._compressVertices=u$Y(e.compressVertices,!0),this.cull=u$Y(e.cull,!0),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,e$28(this.rtcCenter)&&(!e$28(this.geometryInstances)||Array.isArray(this.geometryInstances)&&1!==this.geometryInstances))throw new t$Z("Relative-to-center rendering only supports one geometry instance.");this.shadows=u$Y(e.shadows,q$L.DISABLED),this._translucent=void 0,this._state=ce$o.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0,this._twoPasses=e.twoPasses,this._polygonOffset={enabled:!1,value:new o$1k(0,0)}}function Ge$e(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)&&e$28(n[t])){for(var o=n[t],a=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!e$28(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&r.push(t)}return r}_0x480f1c(),_0x17966c.createClampGroundColorRenderState=function(){return{cull:{enabled:!1},depthTest:{enabled:!1},depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.ZERO},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.ZERO},reference:0,mask:-1},blending:Ee$n.ALPHA_BLEND}},_0x17966c.createClampGroundAndObjectLineRenderState=function(){return{cull:{enabled:!0},depthMask:!1}},_0x17966c.createClampGroundStencilRenderState=function(){return{depthMask:!1,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0,func:Me$l.GREATER},stencilTest:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.INCREMENT_WRAP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:-1}}},_0x17966c.createClampObjectColorRenderState=function(){return{cull:{enabled:!1},depthTest:{enabled:!1},depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:3,mask:3},blending:Ee$n.ALPHA_BLEND}},_0x17966c.createClampObjectStencilRenderState=function(){return{cull:{enabled:!1},depthMask:!1,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0},stencilTest:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},reference:0,mask:1},stencilMask:1}},_0x17966c.createClampPickStencilRenderState=function(e){var t=e?this.createClampGroundStencilRenderState():this.createClampObjectStencilRenderState();return t.blending={enabled:!1},t.polygonOffset={enabled:!0,factor:1,units:1},t},_0x17966c.createClampPickColorRenderState=function(e){var t=e?this.createClampGroundColorRenderState():this.createClampObjectColorRenderState();return t.blending={enabled:!1},t.depthTest={enabled:!0},t.polygonOffset={enabled:!0,factor:1,units:1},t},_0x17966c.createReceiveClampObjectStencilTest=function(e){return{enabled:e,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},reference:2,mask:2}},_0x17966c.createNormalColorRenderState=function(e){return{cull:{enabled:e!==_0x4a48d8.NONE},depthTest:{enabled:!0,func:Me$l.LESS_OR_EQUAL},blending:Ee$n.ALPHA_BLEND,frontFace:e!==_0x4a48d8.NONE?e:_0x4a48d8.COUNTER_CLOCKWISE}},Object.defineProperties(v$C.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var Ue$k=new o$1k,We$g=new t$X,ue$p=new e$25;function de$o(e){var t=e.length;return 1===t?e[0]:2===t?o$1k.unpack(e,0,Ue$k):3===t?t$X.unpack(e,0,We$g):4===t?e$25.unpack(e,0,ue$p):void 0}function qe$c(e,t){var i=e.geometryInstances,r=Array.isArray(i)?i:[i],n=r.length;if(0!==n){var o,a,s,l,u=Ge$e(r),c=u.length,h=[],d={},f={},p=r[0].attributes;for(a=0;a<c;++a)l=p[s=u[a]],d[s]=a,h.push({functionName:"czm_batchTable_"+s,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize});-1!==u.indexOf("distanceDisplayCondition")&&(h.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:S$W.FLOAT,componentsPerAttribute:1}),f.center3DHigh=h.length-5,f.center3DLow=h.length-4,f.center2DHigh=h.length-3,f.center2DLow=h.length-2,f.radius=h.length-1),-1!==u.indexOf("offset")&&(h.push({functionName:"czm_batchTable_offset2D",componentDatatype:S$W.FLOAT,componentsPerAttribute:3}),o=h.length-1),h.push({functionName:"czm_batchTable_pickColor",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var _=h.length,m=new x$Q(t,h,n);for(a=0;a<n;++a){var $=r[a];p=$.attributes;for(var g=0;g<c;++g){var v=de$o((l=p[s=u[g]]).value),y=d[s];m.setBatchedAttribute(a,y,v)}var x={primitive:u$Y($.pickPrimitive,e)};e$28($.id)&&(x.id=$.id);var b=t.createPickId(x);e._pickIds.push(b);var w=e$28(b)?b.color:e$1S.BLACK,C=ue$p;C.x=e$1S.floatToByte(w.red),C.y=e$1S.floatToByte(w.green),C.z=e$1S.floatToByte(w.blue),C.w=e$1S.floatToByte(w.alpha),m.setBatchedAttribute(a,_-1,C)}e._batchTable=m,e._batchTableAttributeIndices=d,e._batchTableBoundingSphereAttributeIndices=f,e._batchTableOffsetAttribute2DIndex=o}}function je$g(e){var t;return t=Array.isArray(e.values)?e.values.slice(0):new e.values.constructor(e.values),new o$1g({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function Ye$c(e){var t,i=e.attributes,r=new a$_;for(var n in i)i.hasOwnProperty(n)&&e$28(i[n])&&(r[n]=je$g(i[n]));if(e$28(e.indices)){var o=e.indices;t=Array.isArray(o)?o.slice(0):new o.constructor(o)}return new I$1n({attributes:r,indices:t,primitiveType:e.primitiveType,boundingSphere:i$19.clone(e.boundingSphere)})}function $e$9(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:y$15.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var Ze$7=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;function fe$o(e){return a$$.replaceMain(e,"czm_non_pick_main")+"\nvarying vec4 v_pickColor; \nvoid main() \n{ \n czm_non_pick_main(); \n v_pickColor = czm_batchTable_pickColor(batchId); \n}"}function le$q(e){return"varying vec4 v_pickColor;\n"+e}function pe$t(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),a=r&&i?2:1,s="compressedAttributes",l="attribute "+((a+=n||o?1:0)>1?"vec"+a:"float")+" "+s+";",u="",c="";r&&(u+="vec2 st;\n",c+=" st = czm_decompressTextureCoordinates("+(a>1?s+".x":s)+");\n");i&&n&&o?(u+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",c+=" czm_octDecode("+s+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(u+="vec3 normal;\n",c+=" normal = czm_octDecode("+s+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(u+="vec3 tangent;\n",c+=" tangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"),o&&(u+="vec3 bitangent;\n",c+=" bitangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"));var h=t;return h=(h=(h=(h=h.replace(/attribute\s+vec3\s+normal;/g,"")).replace(/attribute\s+vec2\s+st;/g,"")).replace(/attribute\s+vec3\s+tangent;/g,"")).replace(/attribute\s+vec3\s+bitangent;/g,""),[l,u,h=a$$.replaceMain(h,"czm_non_compressed_main"),"void main() \n{ \n"+c+" czm_non_compressed_main(); \n}"].join("\n")}function Qe$a(e){var t=a$$.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n vec4 position = gl_Position;\n v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n position.z = min(position.z, position.w);\n gl_Position = position;\n}\n"}function Xe$a(e){var t=a$$.replaceMain(e,"czm_non_depth_clamp_main");return t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+(t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n")}function _e$m(e,t){var i=e.vertexAttributes;for(var r in i)if(i.hasOwnProperty(r)&&!e$28(t[r]))throw new t$Z("Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '"+r+"', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.")}function Ke$c(e,t){return function(){return e[t]}}v$C._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=Ze$7.exec(t));){var s=r[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),e$28(e.rtcCenter)?(n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=(t=(t=(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,"")).replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,"")).replace(/czm_modelViewRelativeToEye\s+\*\s+/g,"")).replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=l+"\n{\n return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=l+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,o,t,a].join("\n")},v$C._appendShowToShader=function(e,t){if(!e$28(e._batchTableAttributeIndices.show))return t;return a$$.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}"},v$C._updateColorAttribute=function(e,t,i){if(!e$28(e._batchTableAttributeIndices.color)&&!e$28(e._batchTableAttributeIndices.depthFailColor)||-1===t.search(/attribute\s+vec4\s+color;/g))return t;if(i&&!e$28(e._batchTableAttributeIndices.depthFailColor))throw new t$Z("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");var r=t;return r=r.replace(/attribute\s+vec4\s+color;/g,""),r=i?r.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):r.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},v$C._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},v$C._appendOffsetToShader=function(e,t){if(!e$28(e._batchTableAttributeIndices.offset))return t;var i=t.replace(/attribute\s+float\s+batchId;/g,"attribute float batchId;\nattribute float applyOffset;");return" if (czm_sceneMode == czm_sceneMode3D)\n"," {\n"," $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);"," }\n"," else\n"," {\n"," $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);"," }\n",i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,"vec4 $1 = czm_computePosition();\n if (czm_sceneMode == czm_sceneMode3D)\n {\n $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0); }\n else\n {\n $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0); }\n")},v$C._appendDistanceDisplayConditionToShader=function(e,t,i){if(!e$28(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r=a$$.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return e.updateBoundingSphere?n+=i?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n":n+=" vec4 centerRTE = czm_view * vec4(boundingSphereCenter3DHigh + boundingSphereCenter3DLow, 1.0);\n",r+"\n"+(n+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}")};var te$A=Math.max(s$V.hardwareConcurrency-1,1),Y$x,Je$8=new i$W("combineGeometry",Number.POSITIVE_INFINITY);function et$b(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===ce$o.READY){i=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s,l=e._numberOfInstances=i.length,u=[],c=[];for(n=0;n<l;++n){if(r=i[n].geometry,a.push(i[n].id),!e$28(r._workerName))throw new t$Z("_workerName must be defined for asynchronous geometry.");c.push({moduleName:r._workerName,geometry:r})}if(!e$28(Y$x))for(Y$x=new Array(te$A),n=0;n<te$A;n++)Y$x[n]=new i$W("createGeometry",Number.POSITIVE_INFINITY);for(c=u$F(c,te$A),n=0;n<c.length;n++){var h,d=0,f=c[n],p=f.length;for(o=0;o<p;++o)e$28((r=(s=f[o]).geometry).constructor.pack)&&(s.offset=d,d+=u$Y(r.constructor.packedLength,r.packedLength));if(d>0){var _=new Float64Array(d);for(h=[_.buffer],o=0;o<p;++o)e$28((r=(s=f[o]).geometry).constructor.pack)&&(r.constructor.pack(r,_,s.offset),s.geometry=_)}u.push(Y$x[n].scheduleTask({subTasks:c[n]},h))}e._state=ce$o.CREATING,o$1q.all(u,(function(t){e._createGeometryResults=t,e._state=ce$o.CREATED})).otherwise((function(i){H$H(e,t,ce$o.FAILED,i)}))}else if(e._state===ce$o.CREATED){var m=[];i=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var $=t.scene3DOnly,g=t.mapProjection,v=Je$8.scheduleTask(k$I.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:g.ellipsoid,projection:g,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:$,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},m),m);e._createGeometryResults=void 0,e._state=ce$o.COMBINING,o$1q(v,(function(i){var r=k$I.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e.modelMatrix=y$15.clone(r.modelMatrix,e.modelMatrix),e._pickOffsets=r.pickOffsets,e._offsetInstanceExtend=r.offsetInstanceExtend,e._instanceBoundingSpheres=r.boundingSpheres,e._instanceBoundingSpheresCV=r.boundingSpheresCV,e$28(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=ce$o.COMBINED):H$H(e,t,ce$o.FAILED,void 0)})).otherwise((function(i){H$H(e,t,ce$o.FAILED,i)}))}}function tt$c(e,t){var i,r,n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r<o;r++){var u,c=(i=n[r]).geometry;u=e$28(c.attributes)&&e$28(c.primitiveType)?Ye$c(c):c.constructor.createGeometry(c),a[l++]=$e$9(i,u),s.push(i.id)}a.length=l;var h=t.scene3DOnly,d=t.mapProjection,f=k$I.combineGeometry({instances:a,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=y$15.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._offsetInstanceExtend=f.offsetInstanceExtend,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,e$28(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=ce$o.COMBINED):H$H(e,t,ce$o.FAILED,void 0)}function nt$b(e,t){var i=e._batchTableAttributeIndices.offset;if(e._recomputeBoundingSpheres&&e$28(i)){var r,n=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,a=o.length,s=e._tempBoundingSpheres;if(!e$28(s)){for(s=new Array(a),r=0;r<a;r++)s[r]=new i$19;e._tempBoundingSpheres=s}for(r=0;r<a;++r){var l=s[r],u=e._batchTable.getBatchedAttribute(r,i,new t$X);Te$l(l=o[r].clone(l),u,n[r])}var c=[],h=[],d=[];for(r=0;r<a;++r){var f=s[r];f.center.x-f.radius>0||i$19.intersectPlane(f,o$1i.ORIGIN_ZX_PLANE)!==pt$a.INTERSECTING?c.push(f):(h.push(f),d.push(f))}var p=c[0],_=d[0],m=h[0];for(r=1;r<c.length;r++)p=i$19.union(p,c[r]);for(r=1;r<d.length;r++)_=i$19.union(_,d[r]);for(r=1;r<h.length;r++)m=i$19.union(m,h[r]);var $=[];for(e$28(p)&&$.push(p),e$28(_)&&$.push(_),e$28(m)&&$.push(m),r=0;r<$.length;r++){var g=$[r].clone(e._boundingSpheres[r]);e._boundingSpheres[r]=g,e._boundingSphereCV[r]=i$19.projectTo2D(g,t.mapProjection,e._boundingSphereCV[r])}v$C._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}else e._recomputeBoundingSpheres=!1}var be$n=new i$Q,ge$l=new t$W,ye$m=new t$X,me$r=new i$19;function at$c(e,t){if(e$28(e._batchTableAttributeIndices.distanceDisplayCondition)&&!e._batchTableBoundingSpheresUpdated){for(var i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,n=i.center3DLow,o=i.center2DHigh,a=i.center2DLow,s=i.radius,l=t.mapProjection,u=l.ellipsoid,c=e._batchTable,h=e._instanceBoundingSpheres,d=h.length,f=0;f<d;++f){var p=h[f];if(e$28(p)){var _=e.modelMatrix;e$28(_)&&e.updateBoundingSphere&&(p=i$19.transform(p,_,me$r));var m=p.center,$=p.radius,g=i$Q.fromCartesian(m,be$n);if(c.setBatchedAttribute(f,r,g.high),c.setBatchedAttribute(f,n,g.low),!t.scene3DOnly){var v=u.cartesianToCartographic(m,ge$l),y=l.project(v,ye$m);g=i$Q.fromCartesian(y,be$n),c.setBatchedAttribute(f,o,g.high),c.setBatchedAttribute(f,a,g.low)}c.setBatchedAttribute(f,s,$)}}e._batchTableBoundingSpheresUpdated=!0}}var ne$B=new t$X,rt$e=new t$X;function ve$k(e,t){if(e$28(e._batchTableAttributeIndices.offset)&&!e._batchTableOffsetsUpdated&&!t.scene3DOnly){for(var i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,n=r.ellipsoid,o=e._batchTable,a=e._instanceBoundingSpheres,s=a.length,l=0;l<s;++l){var u=a[l];if(e$28(u)){var c=o.getBatchedAttribute(l,e._batchTableAttributeIndices.offset);if(t$X.equals(c,t$X.ZERO)){o.setBatchedAttribute(l,i,t$X.ZERO);continue}var h=e.modelMatrix;e$28(h)&&(u=i$19.transform(u,h,me$r));var d=u.center;d=n.scaleToGeodeticSurface(d,rt$e);var f=n.cartesianToCartographic(d,ge$l),p=r.project(f,ye$m),_=t$X.add(c,d,ne$B);f=n.cartesianToCartographic(_,f);var m=r.project(f,ne$B),$=t$X.subtract(m,p,ne$B),g=$.x;$.x=$.z,$.z=$.y,$.y=g,o.setBatchedAttribute(l,i,$)}}e._batchTableOffsetsUpdated=!0}}function st$6(e,t){for(var i=e._attributeLocations,r=e._geometries,n=t.scene3DOnly,o=t.context,a=[],s=r.length,l=0;l<s;++l){var u=r[l];if(De$n(e)){var c=V$B(o,u.attributes.batchId),h=ot$9(o),d=V$B(o,u.attributes.position2DHigh),f=V$B(o,u.attributes.position2DLow),p=V$B(o,u.attributes.position3DHigh),_=V$B(o,u.attributes.position3DLow),m=[];(i={}).sideness=0,m.push({index:i.sideness,vertexBuffer:h,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1}),i.position02DHigh=1,m.push({index:i.position02DHigh,vertexBuffer:d,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position12DHigh=2,m.push({index:i.position12DHigh,vertexBuffer:d,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:12,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position02DLow=3,m.push({index:i.position02DLow,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position12DLow=4,m.push({index:i.position12DLow,vertexBuffer:f,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:12,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position03DHigh=5,m.push({index:i.position03DHigh,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position13DHigh=6,m.push({index:i.position13DHigh,vertexBuffer:p,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:12,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position03DLow=7,m.push({index:i.position03DLow,vertexBuffer:_,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.position13DLow=8,m.push({index:i.position13DLow,vertexBuffer:_,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:12,strideInBytes:12,normalize:!1,instanceDivisor:1}),i.batchId=9,m.push({index:i.batchId,vertexBuffer:c,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:4,instanceDivisor:1}),i.batchId1=10,m.push({index:i.batchId1,vertexBuffer:c,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:4,strideInBytes:4,instanceDivisor:1});var $=new m$19({context:o,attributes:m,indexBuffer:ct$8(o)});$._instanceCount=u.attributes.position3DHigh.values.length/u.attributes.position3DHigh.componentsPerAttribute-1,e._attributeLocations=i,a.push($)}else a.push(m$19.fromGeometry({context:o,geometry:u,attributeLocations:i,bufferUsage:A$1c.STATIC_DRAW,interleave:e._interleave}));if(e$28(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(i$19.clone(u.boundingSphere)),e._boundingSphereWC.push(new i$19),!n&&e$28(u.boundingSphereCV)){var g=u.boundingSphereCV.center,v=g.x,y=g.y,x=g.z;g.x=x,g.y=v,g.z=y,e._boundingSphereCV.push(i$19.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new i$19),e._boundingSphereMorph.push(new i$19)}}e._va=a,e._primitiveType=r[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,H$H(e,t,ce$o.COMPLETE,void 0)}function De$n(e){return e$28(e._attributeLocations.sideness)}var ae$s=null;function ot$9(e){var t=new Float32Array(8),i=0;return t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=0,(ae$s=h$W.createVertexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW})).vertexArrayDestroyable=!1,ae$s}function V$B(e,t){return h$W.createVertexBuffer({context:e,typedArray:t.values,usage:A$1c.STATIC_DRAW})}function it$8(){var e=new Uint16Array(6),t=0;return e[t++]=2,e[t++]=1,e[t++]=0,e[t++]=3,e[t++]=2,e[t++]=0,e}var k$G=null;function ct$8(e){return e$28(k$G)||((k$G=h$W.createIndexBuffer({context:e,typedArray:it$8(),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1),k$G}function ht$7(e,t,i,r,n){var o,a=i.getRenderState();e$28(n)&&n&&(a.stencilTest=_0x17966c.createReceiveClampObjectStencilTest(!0)),r?((o=l$1e(a,!1)).cull={enabled:!0,face:k$11.BACK},e._frontFaceRS=u$R.fromCache(o),o.cull.face=k$11.FRONT,e._backFaceRS=u$R.fromCache(o)):(e._frontFaceRS=u$R.fromCache(a),e._backFaceRS=e._frontFaceRS),o=l$1e(a,!1),e$28(e._depthFailAppearance)&&(o.depthTest.enabled=!1),e$28(e._depthFailAppearance)&&((o=l$1e(a=e._depthFailAppearance.getRenderState(),!1)).depthTest.func=Me$l.GREATER,r?(o.cull={enabled:!0,face:k$11.BACK},e._frontFaceDepthFailRS=u$R.fromCache(o),o.cull.face=k$11.FRONT,e._backFaceDepthFailRS=u$R.fromCache(o)):(e._frontFaceDepthFailRS=u$R.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function ut$8(e,t,i){var r=t.context,n=e._attributeLocations,o=De$n(e),a=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);a=v$C._appendOffsetToShader(e,a),a=v$C._appendShowToShader(e,a),a=fe$o(a=v$C._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=pe$t(e,a=v$C._updateColorAttribute(e,a,!1)),a=v$C._modifyShaderPosition(e,a,t.scene3DOnly);var s=i.getFragmentShaderSource();s=le$q(s);var l,u=[];e._polygonOffset.enabled&&u.push("POLYGON_OFFSET"),s=new a$$({sources:[s],defines:u}),e._swipeEnabled&&s.defines.push("APPLY_SWIPE"),o&&(l=new a$$({sources:[a],defines:["APPLY_SIDENESS"]})),e._sp=S$T.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o?l:a,fragmentShaderSource:s,attributeLocations:n}),_e$m(e._sp,n),e$28(e._depthFailAppearance)&&(a=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),a=v$C._appendShowToShader(e,a),a=fe$o(a=v$C._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=pe$t(e,a=v$C._updateColorAttribute(e,a,!0)),a=Qe$a(a=v$C._modifyShaderPosition(e,a,t.scene3DOnly)),s=Xe$a(s=le$q(s=e._depthFailAppearance.getFragmentShaderSource())),e._spDepthFail=S$T.replaceCache({context:r,shaderProgram:e._spDepthFail,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:n}),_e$m(e._spDepthFail,n))}var N$B=new y$15,Ie$k=new t$X;function Ae$m(e,t,i,r){var n=e$28(i)?i._uniforms:void 0,o={},a=t.uniforms;if(e$28(a))for(var s in a)if(a.hasOwnProperty(s)){if(e$28(n)&&e$28(n[s]))throw new t$Z("Appearance and material have a uniform with the same name: "+s);o[s]=Ke$c(a,s)}var l=p$17(o,n);return(l=e._batchTable.getUniformMapCallback()(l)).u_polygonOffset=function(){return e._polygonOffset.value},l.uLineWidth=function(){return u$Y(e._outlineWidth,1)},l.uSwipeRegion=function(){var t=e._swipeRegion,i=new e$25;return e$25.fromElements(t.x,t.y,t.x+t.z,t.y+t.w,i),i.x=i.x*r.context.drawingBufferWidth,i.y=(1-i.y)*r.context.drawingBufferHeight,i.z=i.z*r.context.drawingBufferWidth,i.w=(1-i.w)*r.context.drawingBufferHeight,i},e$28(e.rtcCenter)&&(l.u_modifiedModelView=function(){var t=r.context.uniformState.view;return y$15.multiply(t,e._modelMatrix,N$B),y$15.multiplyByPoint(N$B,e.rtcCenter,Ie$k),y$15.setTranslation(N$B,Ie$k,N$B),N$B}),l}function dt$a(e,t,i,r,n,o,a,s){var l,u=Ae$m(e,t,i,s);e$28(e._depthFailAppearance)&&(l=Ae$m(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var c=r?Le$p.TRANSLUCENT:Le$p.OPAQUE,h=n?2:1;h*=e$28(e._depthFailAppearance)?2:1,o.length=e._va.length*h;for(var d=o.length,f=0,p=0;p<d;++p){var _;n&&(e$28(_=o[p])||(_=o[p]=new r$15({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=c,++p),e$28(_=o[p])||(_=o[p]=new r$15({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=c,_.instanceCount=u$Y(_.vertexArray._instanceCount,0),e$28(e._depthFailAppearance)&&(n&&(e$28(_=o[++p])||(_=o[p]=new r$15({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=c),e$28(_=o[++p])||(_=o[p]=new r$15({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[f],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=c),++f}}function ft$8(e,t,i,r,n,o,a,s){if(t.mode!==P$$.SCENE3D&&!y$15.equals(n,y$15.IDENTITY))throw new t$Z("Primitive.modelMatrix is only supported in 3D mode.");var l;v$C._updateBoundingVolumes(e,t,n),t.mode===P$$.SCENE3D?l=e.updateBoundingSphere?e._boundingSphereWC:e._boundingSpheres:t.mode===P$$.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===P$$.SCENE2D&&e$28(e._boundingSphere2D)?l=e._boundingSphere2D:e$28(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var u=!0;t._fboState.frameBufferType===L$T.NORMAL_AND_DEPTH&&(u=!1);var c=t.commandList,h=t.passes;if(u&&(h.render||h.pick)){var d=e.allowPicking,f=q$L.castShadows(e.shadows),p=q$L.receiveShadows(e.shadows),_=i.length,m=s?2:1;m*=e$28(e._depthFailAppearance)?2:1;for(var $=0;$<_;++$){var g=Math.floor($/m),v=i[$];v.modelMatrix=n,v.boundingVolume=l[g],v.cull=o,v.debugShowBoundingVolume=a,v.castShadows=f,v.receiveShadows=p,v.pickId=d?"v_pickColor":void 0,c.push(v)}}}v$C._updateBoundingVolumes=function(e,t,i,r){if(e.updateBoundingSphere){var n,o,a;if(r||!y$15.equals(i,e._modelMatrix))for(y$15.clone(i,e._modelMatrix),o=e._boundingSpheres.length,n=0;n<o;++n)e$28(a=e._boundingSpheres[n])&&(e._boundingSphereWC[n]=i$19.transform(a,i,e._boundingSphereWC[n]),t.scene3DOnly||(e._boundingSphere2D[n]=i$19.clone(e._boundingSphereCV[n],e._boundingSphere2D[n]),e._boundingSphere2D[n].center.x=0,e._boundingSphereMorph[n]=i$19.union(e._boundingSphereWC[n],e._boundingSphereCV[n])));var s=e.appearance.pixelSize;if(e$28(s))for(o=e._boundingSpheres.length,n=0;n<o;++n){a=e._boundingSpheres[n];var l=e._boundingSphereWC[n],u=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;l.radius=a.radius+u}}},v$C.prototype.update=function(e){if(!e._fboState||!0!==e._fboState.enabled||6!==e._fboState.frameBufferType){if(e.multiViewportIndex>-1&&this._instanceIds.length>0&&e$28(this._instanceIds[0])&&e$28(this._instanceIds[0].entityCollection)&&e$28(this._instanceIds[0].entityCollection.owner)){var t=this._instanceIds[0].entityCollection.owner;if(typeof t.getVisibleInViewport<"u")if(!t.getVisibleInViewport(e.multiViewportIndex))return}if(!(!e$28(this.geometryInstances)&&0===this._va.length||e$28(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!e$28(this.appearance)||e.mode!==P$$.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(e$28(this._error))throw this._error;if(e$28(this.rtcCenter)&&!e.scene3DOnly)throw new t$Z("RTC rendering is only available for 3D only scenes.");if(this._state!==ce$o.FAILED){var i=e.context;if(e$28(this._batchTable)||qe$c(this,i),this._batchTable.attributes.length>0){if(0===e$1U.maximumVertexTextureImageUnits)throw new t$U("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==ce$o.COMPLETE&&this._state!==ce$o.COMBINED&&(this.asynchronous?et$b(this,e):tt$c(this,e)),this._state===ce$o.COMBINED&&(at$c(this,e),ve$k(this,e),st$6(this,e)),this.show&&this._state===ce$o.COMPLETE){this._batchTableOffsetsUpdated||ve$k(this,e),this._recomputeBoundingSpheres&&nt$b(this,e);var r=this.appearance,n=r.material,o=!1,a=!1;this._appearance!==r?(this._appearance=r,this._material=n,o=!0,a=!0):this._material!==n?(this._material=n,a=!0):this._swipeEnabled!==this.swipeEnabled&&(this._swipeEnabled=this.swipeEnabled,a=!0);var s=this.depthFailAppearance,l=e$28(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=l,o=!0,a=!0):this._depthFailMaterial!==l&&(this._depthFailMaterial=l,a=!0);var u=this._appearance.isTranslucent();this._translucent!==u&&(this._translucent=u,o=!0),e$28(this._material)&&this._material.update(i);var c=e$28(this._twoPasses)?this._twoPasses:r.closed&&u,h=!1;if(e$28(this._instanceIds[0])&&e$28(this._instanceIds[0].receiveObjectClamp)&&this._instanceIds[0].receiveObjectClamp&&(h=!0),o)u$Y(this._createRenderStatesFunction,ht$7)(this,i,r,c,h);if(a)u$Y(this._createShaderProgramFunction,ut$8)(this,e,r);if(o||a)u$Y(this._createCommandsFunction,dt$a)(this,r,n,u,c,this._colorCommands,this._pickCommands,e);e$28(this._instanceIds[0])&&(!e$28(this._instanceIds[0].polygon)||e$28(this._instanceIds[0].polygon._perPositionHeight)&&(!e$28(this._instanceIds[0].polygon._perPositionHeight)||this._instanceIds[0].polygon._perPositionHeight._value)||e$28(this._instanceIds[0].polygon._height)&&0!=this._instanceIds[0].polygon._height._value?u$B.processWideOutline(e.camera._scene,this._instanceIds):u$B.processClampWideOutline(e.camera._scene,this._instanceIds)),u$Y(this._updateAndQueueCommandsFunction,ft$8)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,c)}}}}};var lt$8=new i$19,pt$8=new i$19;function Te$l(e,t,i){if(i===ee$C.TOP){var r=i$19.clone(e,lt$8),n=i$19.clone(e,pt$8);n.center=t$X.add(n.center,t,n.center),e=i$19.union(r,n,e)}else i===ee$C.ALL&&(e.center=t$X.add(e.center,t,e.center));return e}function _t$8(e,t,i){return function(){var r=e.getBatchedAttribute(t,i),n=e.attributes[i],o=n.componentsPerAttribute,a=S$W.createTypedArray(n.componentDatatype,o);return e$28(r.constructor.pack)?r.constructor.pack(r,a,0):a[0]=r,a}}function bt$4(e,t,i,r,n){return function(o){if(!e$28(o)||!e$28(o.length)||o.length<1||o.length>4)throw new t$Z("value must be and array with length between 1 and 4.");var a=de$o(o);e.setBatchedAttribute(t,i,a),"offset"===n&&(r._recomputeBoundingSpheres=!0,r._batchTableOffsetsUpdated=!1)}}var gt$7=new t$X;function yt$5(e,t,i){t.boundingSphere={get:function(){var r=e._instanceBoundingSpheres[i];if(e$28(r)&&e.updateBoundingSphere){r=r.clone();var n=e.modelMatrix,o=t.offset;e$28(o)&&Te$l(r,t$X.fromArray(o.get(),0,gt$7),e._offsetInstanceExtend[i]),e$28(n)&&(r=i$19.transform(r,n))}return r}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[i]}}}function mt$5(e,t,i){t.pickId={get:function(){return e._pickIds[i]}}}function H$H(e,t,i,r){e._error=r,e._state=i,e._ready=e._state===ce$o.COMPLETE||e._state===ce$o.FAILED,e$28(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)}v$C.prototype.getGeometryInstanceAttributes=function(e){if(!e$28(e))throw new t$Z("id is required");if(!e$28(this._batchTable))throw new t$Z("must call update before calling getGeometryInstanceAttributes");for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o<n;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(-1!==t){var s=this._perInstanceAttributeCache[t];if(e$28(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var c={};for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];c[h]={get:_t$8(l,t,d)};var f=!0,p=this._readOnlyInstanceAttributes;if(f&&e$28(p)){n=p.length;for(var _=0;_<n;++_)if(h===p[_]){f=!1;break}}f&&(c[h].set=bt$4(l,t,d,this,h))}return yt$5(this,c,t),mt$5(this,c,t),Object.defineProperties(s,c),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},v$C.prototype.isDestroyed=function(){return!1},v$C.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;t<e;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;t<e;++t)r[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,i$Z(this)},v$C.prototype.setPolygonOffset=function(e,t){0!=e||0!=t?(this._polygonOffset.enabled=!0,o$1k.fromElements(e,t,this._polygonOffset.value)):(this._polygonOffset.enabled=!1,o$1k.fromElements(0,0,this._polygonOffset.value))};var V$A="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth)\n{\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\nreturn eyeCoordinate.xyz / eyeCoordinate.w;\n}\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset)\n{\nvec2 glFragCoordXY = gl_FragCoord.xy;\nfloat upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\nfloat downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\nbvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\nfloat useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\nfloat useDownOrLeft = float(useUpOrRight == 0.0);\nvec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\nvec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\nreturn (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\nvoid main(void)\n{\n#ifdef REQUIRES_EC\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_globeDepthTextureDim.xy));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n#ifdef REQUIRES_WC\nvec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\nvec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n#ifdef TEXTURE_COORDINATES\nvec2 uv;\n#ifdef SPHERICAL\nvec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\nsphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\nsphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\nuv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\nuv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\nuv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\nuv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\nif (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0)\n{\ngl_FragColor.a = 1.0;\nczm_writeDepthClampedToFarPlane();\n}\n#else // CULL_FRAGMENTS\ngl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n#ifdef CULL_FRAGMENTS\nif (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y)\n{\ndiscard;\n}\n#endif\n#ifdef NORMAL_EC\nvec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\nvec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\nvec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n#ifdef PER_INSTANCE_COLOR\nvec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\ngl_FragColor = color;\n#else // FLAT\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n#else // PER_INSTANCE_COLOR\nczm_materialInput materialInput;\n#ifdef USES_NORMAL_EC\nmaterialInput.normalEC = normalEC;\n#endif\n#ifdef USES_POSITION_TO_EYE_EC\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n#ifdef USES_TANGENT_TO_EYE\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n#ifdef USES_ST\nmaterialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\nmaterialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClampedToFarPlane();\n#endif // PICK\n}\n";function y$F(e,t,i,r){o$1u.typeOf.bool("extentsCulling",e),o$1u.typeOf.bool("planarExtents",t),o$1u.typeOf.object("appearance",i),o$1u.typeOf.bool("useFloatBatchTable",r),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""},this._useFloatBatchTable=r;var n=new Y$w;n.requiresTextureCoordinates=e,n.requiresEC=!i.flat;var o=new Y$w;if(o.requiresTextureCoordinates=e,i instanceof r$J)n.requiresNormalEC=!i.flat;else{var a=i.material.shaderSource+"\n"+i.fragmentShaderSource;n.normalEC=-1!==a.indexOf("materialInput.normalEC")||-1!==a.indexOf("czm_getDefaultMaterial"),n.positionToEyeEC=-1!==a.indexOf("materialInput.positionToEyeEC"),n.tangentToEyeMatrix=-1!==a.indexOf("materialInput.tangentToEyeMatrix"),n.st=-1!==a.indexOf("materialInput.st")}this._colorShaderDependencies=n,this._pickShaderDependencies=o,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}y$F.prototype.createFragmentShader=function(e){o$1u.typeOf.bool("columbusView2D",e);var t=this._appearance,i=this._colorShaderDependencies,r=[];!e&&!this._planarExtents&&r.push("SPHERICAL"),i.requiresEC&&r.push("REQUIRES_EC"),i.requiresWC&&r.push("REQUIRES_WC"),i.requiresTextureCoordinates&&r.push("TEXTURE_COORDINATES"),this._extentsCulling&&r.push("CULL_FRAGMENTS"),i.requiresNormalEC&&r.push("NORMAL_EC"),t instanceof r$J&&r.push("PER_INSTANCE_COLOR"),i.normalEC&&r.push("USES_NORMAL_EC"),i.positionToEyeEC&&r.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&r.push("USES_TANGENT_TO_EYE"),i.st&&r.push("USES_ST"),t.flat&&r.push("FLAT");var n="";return t instanceof r$J||(n=t.material.shaderSource),new a$$({defines:r,sources:[n,V$A]})},y$F.prototype.createPickFragmentShader=function(e){o$1u.typeOf.bool("columbusView2D",e);var t=this._pickShaderDependencies,i=["PICK"];return!e&&!this._planarExtents&&i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new a$$({defines:i,sources:[V$A],pickColorQualifier:"varying"})},y$F.prototype.createVertexShader=function(e,t,i,r){return o$1u.defined("defines",e),o$1u.typeOf.string("vertexShaderSource",t),o$1u.typeOf.bool("columbusView2D",i),o$1u.defined("mapProjection",r),K$C(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,r,this._useFloatBatchTable,this._projectionExtentDefines)},y$F.prototype.createPickVertexShader=function(e,t,i,r){return o$1u.defined("defines",e),o$1u.typeOf.string("vertexShaderSource",t),o$1u.typeOf.bool("columbusView2D",i),o$1u.defined("mapProjection",r),K$C(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,r,this._useFloatBatchTable,this._projectionExtentDefines)};var B$z=new t$X,j$H=new t$W,Q$D={high:0,low:0};function K$C(e,t,i,r,n,o,a,s,l){var u=r.slice();if(""===l.eastMostYhighDefine){var c=j$H;c.longitude=e$27.PI,c.latitude=0,c.height=0;var h=a.project(c,B$z),d=i$Q.encode(h.x,Q$D);l.eastMostYhighDefine="EAST_MOST_X_HIGH "+d.high.toFixed((d.high+"").length+1),l.eastMostYlowDefine="EAST_MOST_X_LOW "+d.low.toFixed((d.low+"").length+1);var f=j$H;f.longitude=-e$27.PI,f.latitude=0,f.height=0;var p=a.project(f,B$z);d=i$Q.encode(p.x,Q$D),l.westMostYhighDefine="WEST_MOST_X_HIGH "+d.high.toFixed((d.high+"").length+1),l.westMostYlowDefine="WEST_MOST_X_LOW "+d.low.toFixed((d.low+"").length+1)}return i&&(u.push(l.eastMostYhighDefine),u.push(l.eastMostYlowDefine),u.push(l.westMostYhighDefine),u.push(l.westMostYlowDefine)),e$28(o)&&o instanceof r$J&&u.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(u.push("TEXTURE_COORDINATES"),t||i||u.push("SPHERICAL"),i&&u.push("COLUMBUS_VIEW_2D")),s||u.push("UINT8_PACKING"),new a$$({defines:u,sources:[n]})}function Y$w(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function J$K(e,t,i){return Math.abs((t.y-e.y)*i.x-(t.x-e.x)*i.y+t.x*e.y-t.y*e.x)/o$1k.distance(t,e)}Object.defineProperties(Y$w.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});var se$q=[new o$1k,new o$1k,new o$1k,new o$1k];function Z$H(e,t){var i=se$q,r=o$1k.unpack(t,0,i[0]),n=o$1k.unpack(t,2,i[1]),o=o$1k.unpack(t,4,i[2]);e.uMaxVmax=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,value:[n.x,n.y,o.x,o.y]});var a=1/J$K(r,n,o),s=1/J$K(r,o,n);e.uvMinAndExtents=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,a,s]})}function g$C(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e3);r-=1e3*n;var o=Math.floor(r/10);r-=10*o;var a=Math.floor(10*r);r-=.1*a;var s=Math.floor(1e3*r);e<0&&(n=255-n),i[t]=new o$13({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,o,a,s]})}function L$Q(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e6);r-=1e6*n;var o=Math.floor(r/1e4);r-=1e4*o;var a=Math.floor(r/100);r-=100*a;var s=Math.floor(r);e<0&&(n=255-n),i[t]=new o$13({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,o,a,s]})}function N$A(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e4);r-=1e4*n;var o=Math.floor(r/100);r-=100*o;var a=Math.floor(r);r-=a;var s=Math.floor(r/.001);e<0&&(n=255-n),i[t]=new o$13({componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,o,a,s]})}var $$F=new t$W,b$P=new t$X,ie$v=new t$X,he$n=new t$X,S$z={high:0,low:0};function U$H(e,t,i,r){var n=$$F;n.height=0,n.longitude=e.west,n.latitude=e.south;var o=t.project(n,b$P);n.latitude=e.north;var a=t.project(n,ie$v);n.longitude=e.east,n.latitude=e.south;var s,l=t.project(n,he$n);if(!r)return L$Q((s=i$Q.encode(o.x,S$z)).high,"planes2D_HIGH_x",i),g$C(s.low,"planes2D_LOW_x",i),L$Q((s=i$Q.encode(o.y,S$z)).high,"planes2D_HIGH_y",i),g$C(s.low,"planes2D_LOW_y",i),L$Q((s=i$Q.encode(a.y,S$z)).high,"planes2D_HIGH_z",i),g$C(s.low,"planes2D_LOW_z",i),L$Q((s=i$Q.encode(l.x,S$z)).high,"planes2D_HIGH_w",i),void g$C(s.low,"planes2D_LOW_w",i);var u=[0,0,0,0],c=[0,0,0,0];s=i$Q.encode(o.x,S$z),u[0]=s.high,c[0]=s.low,s=i$Q.encode(o.y,S$z),u[1]=s.high,c[1]=s.low,s=i$Q.encode(a.y,S$z),u[2]=s.high,c[2]=s.low,s=i$Q.encode(l.x,S$z),u[3]=s.high,c[3]=s.low,i.planes2D_HIGH=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,value:u}),i.planes2D_LOW=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var ue$o=new y$15,le$p=new y$15,ee$u=new t$X,_e$l=new t$W,pe$s=[new t$W,new t$W,new t$W,new t$W,new t$W,new t$W,new t$W,new t$W];function fe$n(e,t,i,r,n,o){var a=h$10.center(e,_e$l);a.height=i;var s=t$W.toCartesian(a,t,ee$u),l=m$1b.eastNorthUpToFixedFrame(s,t,ue$o),u=y$15.inverse(l,le$p),c=e.west,h=e.east,d=e.north,f=e.south,p=pe$s;p[0].latitude=f,p[0].longitude=c,p[1].latitude=d,p[1].longitude=c,p[2].latitude=d,p[2].longitude=h,p[3].latitude=f,p[3].longitude=h;var _=.5*(c+h),m=.5*(d+f);p[4].latitude=f,p[4].longitude=_,p[5].latitude=d,p[5].longitude=_,p[6].latitude=m,p[6].longitude=c,p[7].latitude=m,p[7].longitude=h;for(var $=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,x=0;x<8;x++){p[x].height=i;var b=t$W.toCartesian(p[x],t,ee$u);y$15.multiplyByPoint(u,b,b),b.z=0,$=Math.min($,b.x),g=Math.max(g,b.x),v=Math.min(v,b.y),y=Math.max(y,b.y)}var w=r;w.x=$,w.y=v,w.z=0,y$15.multiplyByPoint(l,w,w);var C=n;C.x=g,C.y=v,C.z=0,y$15.multiplyByPoint(l,C,C),t$X.subtract(C,w,n);var T=o;T.x=$,T.y=y,T.z=0,y$15.multiplyByPoint(l,T,T),t$X.subtract(T,w,o)}var ce$m=new t$X,de$n=new t$X,Ee$j=new i$Q;y$F.getPlanarTextureCoordinateAttributes=function(e,t,i,r,n,o){o$1u.typeOf.object("boundingRectangle",e),o$1u.defined("textureCoordinateRotationPoints",t),o$1u.typeOf.object("ellipsoid",i),o$1u.typeOf.object("projection",r),o$1u.typeOf.bool("useFloatBatchTable",n);var a=b$P,s=ce$m,l=de$n;fe$n(e,i,u$Y(o,0),a,s,l);var u={};Z$H(u,t);var c=i$Q.fromCartesian(a,Ee$j);if(!n){var h=c.high;L$Q(h.x,"southWest_HIGH_x",u),L$Q(h.y,"southWest_HIGH_y",u),L$Q(h.z,"southWest_HIGH_z",u);var d=c.low;return g$C(d.x,"southWest_LOW_x",u),g$C(d.y,"southWest_LOW_y",u),g$C(d.z,"southWest_LOW_z",u),N$A(s.x,"eastward_x",u),N$A(s.y,"eastward_y",u),N$A(s.z,"eastward_z",u),N$A(l.x,"northward_x",u),N$A(l.y,"northward_y",u),N$A(l.z,"northward_z",u),U$H(e,r,u,!1),u}return u.southWest_HIGH=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!1,value:t$X.pack(c.high,[0,0,0])}),u.southWest_LOW=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!1,value:t$X.pack(c.low,[0,0,0])}),u.eastward=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!1,value:t$X.pack(s,[0,0,0])}),u.northward=new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!1,value:t$X.pack(l,[0,0,0])}),U$H(e,r,u,!0),u};var me$q=new t$X;function te$z(e,t,i,r){var n=$$F;n.latitude=e,n.longitude=t,n.height=0;var o=t$W.toCartesian(n,i,me$q),a=Math.sqrt(o.x*o.x+o.y*o.y),s=e$27.fastApproximateAtan2(a,o.z),l=e$27.fastApproximateAtan2(o.x,o.y);return r.x=s,r.y=l,r}var re$s=new o$1k;function ve$j(e){return Math.max(e.width,e.height)>y$F.MAX_WIDTH_FOR_PLANAR_EXTENTS}function x$P(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).geometryInstances;if(this.geometryInstances=t,this.show=u$Y(e.show,!0),this.classificationType=u$Y(e.classificationType,L$V.BOTH),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=u$Y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=u$Y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._readyPromise=o$1q.defer(),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:u$Y(e.vertexCacheOptimize,!1),interleave:u$Y(e.interleave,!1),releaseGeometryInstances:u$Y(e.releaseGeometryInstances,!0),allowPicking:u$Y(e.allowPicking,!0),asynchronous:u$Y(e.asynchronous,!0),compressVertices:u$Y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0},e.geometryInstances&&e.geometryInstances.length){var i=e.geometryInstances[0].id;e$28(i)&&i._clampToS3M&&(this.classificationType=L$V.S3M_TILE)}}function M$J(e,t){var i=t?m$12.EQUAL:m$12.ALWAYS,r=Fa$6.CESIUM_3D_TILE_MASK;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},backFunction:i,backOperation:{fail:n$12.KEEP,zFail:n$12.INCREMENT_WRAP,zPass:n$12.KEEP},reference:r,mask:r},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Me$l.LESS_OR_EQUAL},depthMask:!1}}function te$y(){return{cull:{enabled:!1},depthMask:!1,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0},stencilTest:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},reference:0,mask:1},stencilMask:1}}function U$G(e,t){var i=t?m$12.EQUAL:m$12.NOT_EQUAL,r=t?Fa$6.S3M_TILE+1:0;return{stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:n$12.ZERO,zFail:n$12.ZERO,zPass:n$12.ZERO},backFunction:i,backOperation:{fail:n$12.ZERO,zFail:n$12.ZERO,zPass:n$12.ZERO},reference:r,mask:Fa$6.CLASSIFICATION_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Ee$n.ALPHA_BLEND}}function ae$r(){return{cull:{enabled:!1},depthTest:{enabled:!1},depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:3,mask:3},blending:Ee$n.ALPHA_BLEND}}y$F.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,r,n){o$1u.typeOf.object("boundingRectangle",e),o$1u.defined("textureCoordinateRotationPoints",t),o$1u.typeOf.object("ellipsoid",i),o$1u.typeOf.object("projection",r),o$1u.typeOf.bool("useFloatBatchTable",n);var o=te$z(e.south,e.west,i,re$s),a=o.x,s=o.y,l=te$z(e.north,e.east,i,re$s),u=l.x,c=l.y,h=0;s>c&&(h=e$27.PI-s,s=-e$27.PI,c+=h),a-=e$27.EPSILON5,s-=e$27.EPSILON5,u+=e$27.EPSILON5;var d=1/((c+=e$27.EPSILON5)-s),f=1/(u-a),p={sphericalExtents:new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:4,normalize:!1,value:[a,s,f,d]}),longitudeRotation:new o$13({componentDatatype:S$W.FLOAT,componentsPerAttribute:1,normalize:!1,value:[h]})};return Z$H(p,t),U$H(e,r,p,n),p},y$F.hasAttributesForTextureCoordinatePlanes=function(e){var t=e$28(e.southWest_HIGH)&&e$28(e.southWest_LOW)&&e$28(e.northward)&&e$28(e.eastward)&&e$28(e.planes2D_HIGH)&&e$28(e.planes2D_LOW)&&e$28(e.uMaxVmax)&&e$28(e.uvMinAndExtents),i=e$28(e.southWest_HIGH_x)&&e$28(e.southWest_LOW_x)&&e$28(e.southWest_HIGH_y)&&e$28(e.southWest_LOW_y)&&e$28(e.southWest_HIGH_z)&&e$28(e.southWest_LOW_z)&&e$28(e.northward_x)&&e$28(e.eastward_x)&&e$28(e.northward_y)&&e$28(e.eastward_y)&&e$28(e.northward_z)&&e$28(e.eastward_z)&&e$28(e.planes2D_HIGH_x)&&e$28(e.planes2D_LOW_x)&&e$28(e.planes2D_HIGH_y)&&e$28(e.planes2D_LOW_y)&&e$28(e.planes2D_HIGH_z)&&e$28(e.planes2D_LOW_z)&&e$28(e.planes2D_HIGH_w)&&e$28(e.planes2D_LOW_w)&&e$28(e.uMaxVmax)&&e$28(e.uvMinAndExtents);return t||i},y$F.hasAttributesForSphericalExtents=function(e){var t=e$28(e.sphericalExtents)&&e$28(e.longitudeRotation)&&e$28(e.planes2D_HIGH)&&e$28(e.planes2D_LOW)&&e$28(e.uMaxVmax)&&e$28(e.uvMinAndExtents),i=e$28(e.sphericalExtents)&&e$28(e.longitudeRotation)&&e$28(e.planes2D_HIGH_x)&&e$28(e.planes2D_LOW_x)&&e$28(e.planes2D_HIGH_y)&&e$28(e.planes2D_LOW_y)&&e$28(e.planes2D_HIGH_z)&&e$28(e.planes2D_LOW_z)&&e$28(e.planes2D_HIGH_w)&&e$28(e.planes2D_LOW_w)&&e$28(e.uMaxVmax)&&e$28(e.uvMinAndExtents);return t||i},y$F.shouldUseSphericalCoordinates=function(e){return o$1u.typeOf.object("rectangle",e),ve$j(e)},y$F.MAX_WIDTH_FOR_PLANAR_EXTENTS=e$27.toRadians(1),Object.defineProperties(x$P.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}}),x$P.isSupported=function(e){return e.context.stencilBuffer};var ne$A={stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.ZERO,zFail:n$12.ZERO,zPass:n$12.ZERO},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.ZERO,zFail:n$12.ZERO,zPass:n$12.ZERO},reference:0,mask:Fa$6.CLASSIFICATION_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function se$p(e,t,i,r){if(!e$28(e._rsColorPass)){var n=!e.debugShowShadowVolume;e._rsStencilDepthPass=u$R.fromCache(M$J(n,!1)),e._rsStencilDepthPass3DTiles=u$R.fromCache(M$J(n,!0)),e._rsStencilDepthPassS3M=u$R.fromCache(te$y()),e._rsColorPass=u$R.fromCache(U$G(n,!1)),e._rsColorPassS3M=u$R.fromCache(ae$r()),e._rsPickPass=u$R.fromCache(ne$A)}}function oe$q(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){var i="compressedAttributes",r="attribute vec2 "+i+";",n="vec3 extrudeDirection;\n",o=t;return o=o.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),[r,n,o=a$$.replaceMain(o,"czm_non_compressed_main"),"void main() \n{ \n extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);\n czm_non_compressed_main(); \n}"].join("\n")}}function ie$u(e,t){var i=t.context,r=e._primitive,n=X$y;n=e._primitive._batchTable.getVertexShaderCallback()(n),n=v$C._appendDistanceDisplayConditionToShader(r,n),n=v$C._modifyShaderPosition(e,n,t.scene3DOnly),n=v$C._updateColorAttribute(r,n);var o=e._hasPlanarExtentsAttributes,a=o||e._hasSphericalExtentsAttribute;e._extruded&&(n=oe$q(r,n));var s=e._extruded?"EXTRUDED_GEOMETRY":"",l=new a$$({defines:[s],sources:[n]}),u=new a$$({sources:[Q$I]});e._primitive._swipeEnabled&&u.defines.push("APPLY_SWIPE");var c=e._primitive._attributeLocations,h=new y$F(a,o,e.appearance,i.floatTextureSixPlaces);if(e._spStencil=S$T.replaceCache({context:i,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c}),e._primitive.allowPicking){var d=a$$.createPickVertexShaderSource(n);d=v$C._appendShowToShader(r,d),d=v$C._updatePickColorAttribute(d);var f=h.createPickFragmentShader(!1),p=h.createPickVertexShader([s],d,!1,t.mapProjection);if(e._spPick=S$T.replaceCache({context:i,shaderProgram:e._spPick,vertexShaderSource:p,fragmentShaderSource:f,attributeLocations:c}),a){var _=i.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!e$28(_)){var m=h.createPickFragmentShader(!0),$=h.createPickVertexShader([s],d,!0,t.mapProjection);_=i.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:$,fragmentShaderSource:m,attributeLocations:c})}e._spPick2D=_}}else e._spPick=S$T.fromCache({context:i,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c});l=new a$$({defines:[s],sources:[n=v$C._appendShowToShader(r,n)]}),e._sp=S$T.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c});var g=h.createFragmentShader(!1),v=h.createVertexShader([s],n,!1,t.mapProjection);if(e._spColor=S$T.replaceCache({context:i,shaderProgram:e._spColor,vertexShaderSource:v,fragmentShaderSource:g,attributeLocations:c}),a){var y=i.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!e$28(y)){var x=h.createFragmentShader(!0),b=h.createVertexShader([s],n,!0,t.mapProjection);y=i.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:c})}e._spColor2D=y}}function de$m(e,t,i){var r=e._primitive,n=2*r._va.length;t.length=n;var o,a,s,l=0,u=r._batchTable.getUniformMapCallback()(e._uniformMap);u.uSwipeRegion=function(){var t=e._primitive._swipeRegion,r=new e$25;return e$25.fromElements(t.x,t.y,t.x+t.z,t.y+t.w,r),r.x=r.x*i.context.drawingBufferWidth,r.y=(1-r.y)*i.context.drawingBufferHeight,r.z=r.z*i.context.drawingBufferWidth,r.w=(1-r.w)*i.context.drawingBufferHeight,r};var c=e._needs2DShader;for(o=0;o<n;o+=2){var h=r._va[l++];e$28(a=t[o])||(a=t[o]=new r$15({owner:e,primitiveType:r._primitiveType})),a.vertexArray=h,a.renderState=e._rsStencilDepthPass,a.shaderProgram=e._sp,a.uniformMap=u,a.pass=Le$p.TERRAIN_CLASSIFICATION,(s=r$15.shallowClone(a,a.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,s.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=s,(s=r$15.shallowClone(a,a.derivedCommands.s3mtiles)).renderState=e._rsStencilDepthPassS3M,s.pass=Le$p.ClampObject,a.derivedCommands.s3mtiles=s,e$28(a=t[o+1])||(a=t[o+1]=new r$15({owner:e,primitiveType:r._primitiveType})),a.vertexArray=h,a.renderState=e._rsColorPass,a.shaderProgram=e._spColor,a.pass=Le$p.TERRAIN_CLASSIFICATION;var d=e.appearance.material;if(e$28(d)&&(u=p$17(u,d._uniforms)),a.uniformMap=u,(s=r$15.shallowClone(a,a.derivedCommands.tileset)).pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,a.derivedCommands.tileset=s,(s=r$15.shallowClone(a,a.derivedCommands.s3mtiles)).pass=Le$p.ClampObject,s.renderState=e._rsColorPassS3M,a.derivedCommands.s3mtiles=s,c){var f=r$15.shallowClone(a,a.derivedCommands.appearance2D);f.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=f,(f=r$15.shallowClone(s,s.derivedCommands.appearance2D)).shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=f}}var p=e._commandsIgnoreShow,_=e._spStencil,m=0;n=p.length=n/2;for(var $=0;$<n;++$){var g=p[$]=r$15.shallowClone(t[m],p[$]);g.shaderProgram=_,g.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,m+=2}}function ue$n(e,t){var i,r,n=e._usePickOffsets,o=Le$p.TERRAIN_CLASSIFICATION,a=Le$p.CESIUM_3D_TILE_CLASSIFICATION,s=Le$p.ClampObject,l=e._primitive,u=2*l._va.length,c=0;n&&(u=2*(i=l._pickOffsets).length),t.length=u;var h,d,f,p=0,_=l._batchTable.getUniformMapCallback()(e._uniformMap),m=e._needs2DShader;for(h=0;h<u;h+=2){var $,g=l._va[p++];if(n&&(r=i[c++],g=l._va[r.index]),e$28(d=t[h])||(d=t[h]=new r$15({owner:e,primitiveType:l._primitiveType,pickOnly:!0})),d.vertexArray=g,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=_,d.pass=o,n&&(d.offset=r.offset,d.count=r.count),(f=r$15.shallowClone(d,d.derivedCommands.tileset)).renderState=e._rsStencilDepthPass3DTiles,f.pass=a,d.derivedCommands.tileset=f,(f=r$15.shallowClone(d,d.derivedCommands.s3mtiles)).renderState=e._rsStencilDepthPassS3M,f.pass=s,d.derivedCommands.s3mtiles=f,e$28(d=t[h+1])||(d=t[h+1]=new r$15({owner:e,primitiveType:l._primitiveType,pickOnly:!0})),d.vertexArray=g,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=_,d.pass=o,n&&(d.offset=r.offset,d.count=r.count),(f=r$15.shallowClone(d,d.derivedCommands.tileset)).pass=a,d.derivedCommands.tileset=f,m)($=r$15.shallowClone(d,d.derivedCommands.pick2D)).shaderProgram=e._spPick2D,d.derivedCommands.pick2D=$,($=r$15.shallowClone(f,f.derivedCommands.pick2D)).shaderProgram=e._spPick2D,f.derivedCommands.pick2D=$;if((f=r$15.shallowClone(d,d.derivedCommands.s3mtiles)).pass=s,d.derivedCommands.s3mtiles=f,m)($=r$15.shallowClone(d,d.derivedCommands.pick2D)).shaderProgram=e._spPick2D,d.derivedCommands.pick2D=$,($=r$15.shallowClone(f,f.derivedCommands.pick2D)).shaderProgram=e._spPick2D,f.derivedCommands.pick2D=$}}function pe$r(e,t,i,r,n,o,a,s){de$m(e,o,s),ue$n(e,a)}function Z$G(e,t){return Math.floor(e%t/3)}function K$B(e,t,i,r,n,o){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,e.debugShowBoundingVolume=o,t.commandList.push(e)}function j$G(e,t,i,r,n){e.modelMatrix=i,e.boundingVolume=n,e.cull=r,t.commandList.push(e)}function he$m(e,t,i,r,n,o,a,s){var l,u=e._primitive;v$C._updateBoundingVolumes(u,t,n),t.mode===P$$.SCENE3D?l=u._boundingSphereWC:t.mode===P$$.COLUMBUS_VIEW?l=u._boundingSphereCV:t.mode===P$$.SCENE2D&&e$28(u._boundingSphere2D)?l=u._boundingSphere2D:e$28(u._boundingSphereMorph)&&(l=u._boundingSphereMorph);var c,h,d=e.classificationType,f=d!==L$V.CESIUM_3D_TILE,p=d!==L$V.TERRAIN,_=t.passes;if(_.render){var m=i.length;for(c=0;c<m;++c)h=l[Z$G(c,m)],f&&K$B(i[c],t,n,o,h,a),p&&K$B(i[c].derivedCommands.tileset,t,n,o,h,a);if(t.invertClassification){var $=e._commandsIgnoreShow,g=$.length;for(c=0;c<g;++c)h=l[Math.floor(c/2)],K$B($[c],t,n,o,h,a)}}if(_.pick){var v=r.length,y=u._pickOffsets;for(c=0;c<v;++c){h=l[y[Z$G(c,v)].index],f&&j$G(r[c],t,n,o,h),p&&j$G(r[c].derivedCommands.tileset,t,n,o,h)}}}x$P.prototype.update=function(e){if(e$28(this._primitive)||e$28(this.geometryInstances)){var t=this.appearance;e$28(t)&&e$28(t.material)&&t.material.update(e.context);var i=this,r=this._primitiveOptions;if(!e$28(this._primitive)){var n,o,a,s,l=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],u=l.length,c=!1,h=!0,d=!1,f=!1;for(u>0&&(a=l[0].attributes,d=y$F.hasAttributesForSphericalExtents(a),f=y$F.hasAttributesForTextureCoordinatePlanes(a),s=a.color),n=0;n<u;n++){var p=(o=l[n]).attributes.color;if(e$28(p))c=!0;else if(c)throw new t$Z("All GeometryInstances must have color attributes to use per-instance color.");h=h&&e$28(p)&&o$18.equals(s,p)}if(!h&&!d&&!f)throw new t$Z("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(c&&!e$28(t)&&(t=new r$J({flat:!0}),this.appearance=t),!c&&t instanceof r$J)throw new t$Z("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(e$28(t.material)&&!d&&!f)throw new t$Z("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!d&&!f,this._hasSphericalExtentsAttribute=d,this._hasPlanarExtentsAttributes=f,this._hasPerColorAttribute=c;var _=new Array(u);for(n=0;n<u;++n)o=l[n],_[n]=new d$15({geometry:o.geometry,attributes:o.attributes,modelMatrix:o.modelMatrix,id:o.id,pickPrimitive:u$Y(this._pickPrimitive,i)});r.appearance=t,r.geometryInstances=_,e$28(this._createBoundingVolumeFunction)&&(r._createBoundingVolumeFunction=function(e,t){i._createBoundingVolumeFunction(e,t)}),r._createRenderStatesFunction=function(e,t,r,n){se$p(i)},r._createShaderProgramFunction=function(e,t,r){ie$u(i,t)},r._createCommandsFunction=function(e,t,r,n,o,a,s,l){pe$r(i,void 0,void 0,!0,!1,a,s,l)},e$28(this._updateAndQueueCommandsFunction)?r._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){i._updateAndQueueCommandsFunction(e,t,r,n,o,a,s,l)}:r._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){he$m(i,t,r,n,o,a,s)},this._primitive=new v$C(r),this._primitive.readyPromise.then((function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;e$28(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)}))}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=u$R.fromCache(M$J(!1,!1)),this._rsStencilDepthPass3DTiles=u$R.fromCache(M$J(!1,!0)),this._rsColorPass=u$R.fromCache(U$G(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=u$R.fromCache(M$J(!0,!1)),this._rsStencilDepthPass3DTiles=u$R.fromCache(M$J(!0,!0)),this._rsColorPass=u$R.fromCache(U$G(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&e$28(t.material))throw new t$Z("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof r$J)throw new t$Z("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},x$P.prototype.getGeometryInstanceAttributes=function(e){if(!e$28(this._primitive))throw new t$Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},x$P.prototype.isDestroyed=function(){return!1},x$P.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,i$Z(this)};var te$x={u_globeMinimumAltitude:function(){return 55e3}};function d$Q(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).appearance,i=e.geometryInstances;if(!e$28(t)&&e$28(i))for(var r=Array.isArray(i)?i:[i],n=r.length,o=0;o<n;o++){var a=r[o].attributes;if(e$28(a)&&e$28(a.color)){t=new r$J({flat:!0});break}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=u$Y(e.show,!0),this.classificationType=u$Y(e.classificationType,L$V.BOTH),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=u$Y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=o$1q.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=e$1_._defaultMaxTerrainHeight,this._minTerrainHeight=e$1_._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:u$Y(e.vertexCacheOptimize,!1),interleave:u$Y(e.interleave,!1),releaseGeometryInstances:u$Y(e.releaseGeometryInstances,!0),allowPicking:u$Y(e.allowPicking,!0),asynchronous:u$Y(e.asynchronous,!0),compressVertices:u$Y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:this,_extruded:!0,_uniformMap:te$x,classificationType:this.classificationType}}function z$A(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function L$P(e){return function(t,i){return e._minHeight}}Object.defineProperties(d$Q.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),d$Q.isSupported=x$P.isSupported;var se$o=new t$X,ae$q=new t$X,ne$z=new t$X,oe$p=new t$W,ue$m=new h$10;function G$P(e,t){var i=e.mapProjection.ellipsoid;if(!e$28(t.attributes)||!e$28(t.attributes.position3DHigh))return e$28(t.rectangle)?t.rectangle:void 0;for(var r=t.attributes.position3DHigh.values,n=t.attributes.position3DLow.values,o=r.length,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=0;c<o;c+=3){var h=t$X.unpack(r,c,se$o),d=t$X.unpack(n,c,ae$q),f=t$X.add(h,d,ne$z),p=i.cartesianToCartographic(f,oe$p),_=p.latitude,m=p.longitude;a=Math.min(a,_),s=Math.min(s,m),l=Math.max(l,_),u=Math.max(u,m)}var $=ue$m;return $.north=l,$.south=a,$.east=u,$.west=s,$}function he$l(e,t,i){var r=e$1_.getMinimumMaximumHeights(t,i);e._minTerrainHeight=r.minimumTerrainHeight,e._maxTerrainHeight=r.maximumTerrainHeight}function pe$q(e,t,i){var r=t.mapProjection.ellipsoid,n=G$P(t,i);if(e.geometryInstances){var o=Number.MIN_VALUE,a=Number.MAX_VALUE,s=!1;for(let t=0;t<e.geometryInstances.length>0;t++){var l=e.geometryInstances[t].geometry._groundBottomAltitude,u=e.geometryInstances[t].geometry._groundExtrudedHeight;if(e$28(l)&&e$28(u)&&(0!==l||0!==u)){var c=l+u;o=Math.max(o,c),a=Math.min(a,l),s=!0}}e._maxHeight=s?o:e._maxHeight,e._minHeight=s?a:e._minHeight}var h=(Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances])[0].geometry._granularity,d=x$13.fromRectangle(n,L$P(e)(h,r),z$A(e)(h,r),r);if(e._boundingVolumes.push(d),!t.scene3DOnly){var f=t.mapProjection,p=i$19.fromRectangleWithHeights2D(n,f,e._maxHeight,e._minHeight);t$X.fromElements(p.center.z,p.center.x,p.center.y,p.center),e._boundingVolumes2D.push(p)}}function j$F(e,t){return Math.floor(e%t/3)}function O$A(e,t,i,r,n,o,a){var s=e._primitive;i.mode!==P$$.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&t.derivedCommands&&t.derivedCommands.appearance2D&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=r,t.boundingVolume=o,t.cull=n,t.debugShowBoundingVolume=a,i.commandList.push(t)}function R$D(e,t,i,r,n,o){var a=e._primitive;i.mode!==P$$.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=r,t.boundingVolume=o,t.cull=n,i.commandList.push(t)}function me$p(e,t,i,r,n,o,a,s){var l;l=t.mode===P$$.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;var u,c,h=e.classificationType,d=h!==L$V.CESIUM_3D_TILE&&h!==L$V.S3M_TILE,f=h!==L$V.TERRAIN&&h!==L$V.S3M_TILE,p=h!==L$V.TERRAIN&&h!==L$V.CESIUM_3D_TILE,_=t.passes,m=e._primitive;if(_.render){var $=i.length;for(u=0;u<$;++u)c=l[j$F(u,$)],d&&O$A(e,i[u],t,n,o,c,a),f&&O$A(e,i[u].derivedCommands.tileset,t,n,o,c,a),p&&O$A(e,i[u].derivedCommands.s3mtiles,t,n,o,c,a);if(t.invertClassification){var g=m._commandsIgnoreShow,v=g.length;for(u=0;u<v;++u)c=l[Math.floor(u/2)],O$A(e,g[u],t,n,o,c,a)}}if(_.pick){var y,x=r.length;for(e._useFragmentCulling||(y=m._primitive._pickOffsets),u=0;u<x;++u){if(c=l[j$F(u,x)],!e._useFragmentCulling)c=l[y[j$F(u,x)].index];d&&R$D(e,r[u],t,n,o,c),f&&R$D(e,r[u].derivedCommands.tileset,t,n,o,c),p&&O$A(e,r[u].derivedCommands.s3mtiles,t,n,o,c,a)}}}function r$H(){t$Z.throwInstantiationError()}function a$L(e,t,i){o$1u.defined("geometryUpdater",e),o$1u.defined("primitives",t),o$1u.defined("orderedGroundPrimitives",i),this._primitives=t,this._orderedGroundPrimitives=i,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}function n$F(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function t$y(){t$Z.throwInstantiationError()}d$Q.initializeTerrainHeights=function(){return e$1_.initialize()},d$Q.prototype.update=function(e){if(e$28(this._primitive)||e$28(this.geometryInstances)){if(!e$1_.initialized){if(!this.asynchronous)throw new t$Z("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");return void d$Q.initializeTerrainHeights()}var t=this,i=this._classificationPrimitiveOptions;if(!e$28(this._primitive)){var r,n,o,a,s,l=e.mapProjection.ellipsoid,u=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=u.length,h=new Array(c);for(a=0;a<c;++a){var d=G$P(e,n=(r=u[a]).geometry);e$28(s)?e$28(d)&&h$10.union(s,d,s):s=h$10.clone(d);var f=r.id;if(e$28(f)&&e$28(d)){var p=e$1_.getBoundingSphere(d,l);this._boundingSpheresKeys.push(f),this._boundingSpheres.push(p)}if(!e$28(o=n.constructor)||!e$28(o.createShadowVolume))throw new t$Z("Not all of the geometry instances have GroundPrimitive support.")}he$l(this,s,l);var _=e.terrainExaggeration;this._minHeight=this._minTerrainHeight*_,this._maxHeight=this._maxTerrainHeight*_;var m=d$Q._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){var $,g=!0;for(a=0;a<c;++a)if(s=G$P(e,n=(r=u[a]).geometry),y$F.shouldUseSphericalCoordinates(s)){g=!1;break}for(a=0;a<c;++a){o=(n=(r=u[a]).geometry).constructor;var v=G$P(e,n),y=n.textureCoordinateRotationPoints,x=e.context.floatTextureSixPlaces;$=g?y$F.getPlanarTextureCoordinateAttributes(v,y,l,e.mapProjection,x,this._maxHeight):y$F.getSphericalExtentGeometryInstanceAttributes(v,y,l,e.mapProjection,x);var b=r.attributes;for(var w in b)b.hasOwnProperty(w)&&($[w]=b[w]);r.created?h[a]=new d$15({geometry:r._groundGeometry,attributes:$,id:r.id}):(h[a]=new d$15({geometry:o.createShadowVolume(n,L$P(this),z$A(this)),attributes:$,id:r.id}),r._groundGeometry=h[a].geometry,r.created=!0)}}else for(a=0;a<c;++a)o=(n=(r=u[a]).geometry).constructor,r.created?h[a]=new d$15({geometry:n,attributes:r.attributes,id:r.id}):(h[a]=new d$15({geometry:o.createShadowVolume(n,L$P(this),z$A(this)),attributes:r.attributes,id:r.id}),r._groundGeometry=h[a].geometry,r.created=!0);i.geometryInstances=h,i.appearance=this.appearance,i._createBoundingVolumeFunction=function(e,i){pe$q(t,e,i)},i._updateAndQueueCommandsFunction=function(e,i,r,n,o,a,s,l){me$p(t,i,r,n,o,a,s)},this._primitive=new x$P(i),this._primitive.readyPromise.then((function(e){t._ready=!0,t.releaseGeometryInstances&&(t.geometryInstances=void 0);var i=e._error;e$28(i)?t._readyPromise.reject(i):t._readyPromise.resolve(t)}))}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},d$Q.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},d$Q.prototype.getGeometryInstanceAttributes=function(e){if(!e$28(this._primitive))throw new t$Z("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)},d$Q.prototype.isDestroyed=function(){return!1},d$Q.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i$Z(this)},d$Q._supportsMaterials=function(e){return e.depthTexture},d$Q.supportsMaterials=function(e){return o$1u.typeOf.object("scene",e),d$Q._supportsMaterials(e.frameState.context)},Object.defineProperties(r$H.prototype,{isConstant:{get:t$Z.throwInstantiationError},definitionChanged:{get:t$Z.throwInstantiationError}}),r$H.prototype.getType=t$Z.throwInstantiationError,r$H.prototype.getValue=t$Z.throwInstantiationError,r$H.prototype.equals=t$Z.throwInstantiationError,r$H.getValue=function(e,t,i){var r;return e$28(t)&&e$28(r=t.getType(e))?((!e$28(i)||i.type!==r)&&(i=a$O.fromType(r)),t.getValue(e,i.uniforms),i):((!e$28(i)||i.type!==a$O.ColorType)&&(i=a$O.fromType(a$O.ColorType)),e$1S.clone(e$1S.WHITE,i.uniforms.color),i)},a$L.prototype._isHidden=function(e,t,i){return!e.isShowing||!e.isAvailable(i)||!r$K.getValueOrDefault(t.show,i,!0)},a$L.prototype._setOptions=t$Z.throwInstantiationError,a$L.prototype.update=function(e){o$1u.defined("time",e);var t=this._geometryUpdater,i=t._onTerrain,r=this._primitives,n=this._orderedGroundPrimitives;n.remove(this._primitive),r.removeAndDestroy(this._primitive),r.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0,this._primitive=void 0;var o=this._entity,a=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,a,e),!this._isHidden(o,a,e)){var s=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options;if(!e$28(a.fill)||a.fill.getValue(e)){var u,c=t.fillMaterialProperty,h=c instanceof t$z,d=t._getIsClosed(l);if(h)u=new r$J({closed:d,flat:i&&!t._supportsMaterialsforEntitiesOnTerrain});else{var f=r$H.getValue(e,c,this._material);this._material=f,u=new t$A({material:f,translucent:f.isTranslucent(),closed:d})}if(i)l.vertexFormat=r$J.VERTEX_FORMAT,this._primitive=n.add(new d$Q({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:u,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),r$K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=u.vertexFormat;var p=this._geometryUpdater.createFillGeometryInstance(e);h&&(u.translucent=255!==p.attributes.color.value[3]),this._primitive=r.add(new v$C({geometryInstances:p,appearance:u,asynchronous:!1,shadows:s}))}}if(!i&&e$28(a.outline)&&a.outline.getValue(e)){var _=this._geometryUpdater.createOutlineGeometryInstance(e),m=r$K.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=r.add(new v$C({geometryInstances:_,appearance:new r$J({flat:!0,translucent:255!==_.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(m)}}),asynchronous:!1,shadows:s}))}}},a$L.prototype.getBoundingSphere=function(e){if(!e$28(e))throw new t$Z("result is required.");var t,i=this._entity,r=this._primitive,n=this._outlinePrimitive;return e$28(r)&&r.show&&r.ready&&(e$28(t=r.getGeometryInstanceAttributes(i))&&e$28(t.boundingSphere))||e$28(n)&&n.show&&n.ready&&(e$28(t=n.getGeometryInstanceAttributes(i))&&e$28(t.boundingSphere))?(i$19.clone(t.boundingSphere,e),A$U.DONE):e$28(r)&&!r.ready||e$28(n)&&!n.ready?A$U.PENDING:A$U.FAILED},a$L.prototype.isDestroyed=function(){return!1},a$L.prototype.destroy=function(){var e=this._primitives;this._orderedGroundPrimitives.remove(this._primitive),e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),i$Z(this)},Object.defineProperties(n$F.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),dimensions:C$H("dimensions"),heightReference:C$H("heightReference"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition")}),n$F.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new n$F(this)},n$F.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.dimensions=u$Y(this.dimensions,e.dimensions),this.heightReference=u$Y(this.heightReference,e.heightReference),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(t$y.prototype,{isConstant:{get:t$Z.throwInstantiationError},definitionChanged:{get:t$Z.throwInstantiationError},referenceFrame:{get:t$Z.throwInstantiationError}}),t$y.prototype.getValue=t$Z.throwInstantiationError,t$y.prototype.getValueInReferenceFrame=t$Z.throwInstantiationError,t$y.prototype.equals=t$Z.throwInstantiationError;var p$I=new p$1a;function r$G(e,t){this._definitionChanged=new o$1o,this._value=t$X.clone(e),this._referenceFrame=u$Y(t,Re$j.FIXED)}function n$E(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function o$R(e){return e}function c$J(e,t){return C$H(e,t,o$R)}function n$D(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function n$C(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function e$16(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function n$B(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}t$y.convertToReferenceFrame=function(e,t,i,r,n){if(!e$28(t))return t;if(e$28(n)||(n=new t$X),i===r)return t$X.clone(t,n);var o=m$1b.computeIcrfToFixedMatrix(e,p$I);return e$28(o)||(o=m$1b.computeTemeToPseudoFixedMatrix(e,p$I)),i===Re$j.INERTIAL?p$1a.multiplyByVector(o,t,n):i===Re$j.FIXED?p$1a.multiplyByVector(p$1a.transpose(o,p$I),t,n):void 0},Object.defineProperties(r$G.prototype,{isConstant:{get:function(){return!e$28(this._value)||this._referenceFrame===Re$j.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),r$G.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},r$G.prototype.setValue=function(e,t){var i=!1;t$X.equals(this._value,e)||(i=!0,this._value=t$X.clone(e)),e$28(t)&&this._referenceFrame!==t&&(i=!0,this._referenceFrame=t),i&&this._definitionChanged.raiseEvent(this)},r$G.prototype.getValueInReferenceFrame=function(e,t,i){if(!e$28(e))throw new t$Z("time is required.");if(!e$28(t))throw new t$Z("referenceFrame is required.");return t$y.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},r$G.prototype.equals=function(e){return this===e||e instanceof r$G&&t$X.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame},Object.defineProperties(n$E.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),positions:C$H("positions"),width:C$H("width"),height:C$H("height"),heightReference:C$H("heightReference"),extrudedHeight:C$H("extrudedHeight"),extrudedHeightReference:C$H("extrudedHeightReference"),cornerType:C$H("cornerType"),granularity:C$H("granularity"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),classificationType:C$H("classificationType"),zIndex:C$H("zIndex")}),n$E.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new n$E(this)},n$E.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.positions=u$Y(this.positions,e.positions),this.width=u$Y(this.width,e.width),this.height=u$Y(this.height,e.height),this.heightReference=u$Y(this.heightReference,e.heightReference),this.extrudedHeight=u$Y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=u$Y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=u$Y(this.cornerType,e.cornerType),this.granularity=u$Y(this.granularity,e.granularity),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=u$Y(this.classificationType,e.classificationType),this.zIndex=u$Y(this.zIndex,e.zIndex)},Object.defineProperties(n$D.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),length:C$H("length"),topRadius:C$H("topRadius"),bottomRadius:C$H("bottomRadius"),heightReference:C$H("heightReference"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),numberOfVerticalLines:C$H("numberOfVerticalLines"),slices:C$H("slices"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition")}),n$D.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new n$D(this)},n$D.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.length=u$Y(this.length,e.length),this.topRadius=u$Y(this.topRadius,e.topRadius),this.bottomRadius=u$Y(this.bottomRadius,e.bottomRadius),this.heightReference=u$Y(this.heightReference,e.heightReference),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=u$Y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=u$Y(this.slices,e.slices),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(n$C.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),semiMajorAxis:C$H("semiMajorAxis"),semiMinorAxis:C$H("semiMinorAxis"),height:C$H("height"),heightReference:C$H("heightReference"),extrudedHeight:C$H("extrudedHeight"),extrudedHeightReference:C$H("extrudedHeightReference"),rotation:C$H("rotation"),stRotation:C$H("stRotation"),granularity:C$H("granularity"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),numberOfVerticalLines:C$H("numberOfVerticalLines"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),classificationType:C$H("classificationType"),zIndex:C$H("zIndex")}),n$C.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new n$C(this)},n$C.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.semiMajorAxis=u$Y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=u$Y(this.semiMinorAxis,e.semiMinorAxis),this.height=u$Y(this.height,e.height),this.heightReference=u$Y(this.heightReference,e.heightReference),this.extrudedHeight=u$Y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=u$Y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=u$Y(this.rotation,e.rotation),this.stRotation=u$Y(this.stRotation,e.stRotation),this.granularity=u$Y(this.granularity,e.granularity),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=u$Y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=u$Y(this.classificationType,e.classificationType),this.zIndex=u$Y(this.zIndex,e.zIndex)},Object.defineProperties(e$16.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),radii:C$H("radii"),innerRadii:C$H("innerRadii"),minimumClock:C$H("minimumClock"),maximumClock:C$H("maximumClock"),minimumCone:C$H("minimumCone"),maximumCone:C$H("maximumCone"),heightReference:C$H("heightReference"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),stackPartitions:C$H("stackPartitions"),slicePartitions:C$H("slicePartitions"),subdivisions:C$H("subdivisions"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition")}),e$16.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new e$16(this)},e$16.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.radii=u$Y(this.radii,e.radii),this.innerRadii=u$Y(this.innerRadii,e.innerRadii),this.minimumClock=u$Y(this.minimumClock,e.minimumClock),this.maximumClock=u$Y(this.maximumClock,e.maximumClock),this.minimumCone=u$Y(this.minimumCone,e.minimumCone),this.maximumCone=u$Y(this.maximumCone,e.maximumCone),this.heightReference=u$Y(this.heightReference,e.heightReference),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.stackPartitions=u$Y(this.stackPartitions,e.stackPartitions),this.slicePartitions=u$Y(this.slicePartitions,e.slicePartitions),this.subdivisions=u$Y(this.subdivisions,e.subdivisions),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(n$B.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),text:C$H("text"),font:C$H("font"),style:C$H("style"),scale:C$H("scale"),showBackground:C$H("showBackground"),backgroundColor:C$H("backgroundColor"),backgroundPadding:C$H("backgroundPadding"),pixelOffset:C$H("pixelOffset"),eyeOffset:C$H("eyeOffset"),horizontalOrigin:C$H("horizontalOrigin"),verticalOrigin:C$H("verticalOrigin"),heightReference:C$H("heightReference"),fillColor:C$H("fillColor"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),translucencyByDistance:C$H("translucencyByDistance"),pixelOffsetScaleByDistance:C$H("pixelOffsetScaleByDistance"),scaleByDistance:C$H("scaleByDistance"),distanceDisplayCondition:C$H("distanceDisplayCondition"),disableDepthTestDistance:C$H("disableDepthTestDistance")}),n$B.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new n$B(this)},n$B.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.text=u$Y(this.text,e.text),this.font=u$Y(this.font,e.font),this.style=u$Y(this.style,e.style),this.scale=u$Y(this.scale,e.scale),this.showBackground=u$Y(this.showBackground,e.showBackground),this.backgroundColor=u$Y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=u$Y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=u$Y(this.pixelOffset,e.pixelOffset),this.eyeOffset=u$Y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=u$Y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=u$Y(this.verticalOrigin,e.verticalOrigin),this.heightReference=u$Y(this.heightReference,e.heightReference),this.fillColor=u$Y(this.fillColor,e.fillColor),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=u$Y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=u$Y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=u$Y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=u$Y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var e$15=new e$1f,a$K=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale};Object.defineProperties(a$K.prototype,{isConstant:{get:function(){return r$K.isConstant(this._translation)&&r$K.isConstant(this._rotation)&&r$K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:C$H("translation"),rotation:C$H("rotation"),scale:C$H("scale")}),a$K.prototype.getValue=function(e,t){return e$28(t)||(t=new e$1f),t.translation=r$K.getValueOrClonedDefault(this._translation,e,e$15.translation,t.translation),t.rotation=r$K.getValueOrClonedDefault(this._rotation,e,e$15.rotation,t.rotation),t.scale=r$K.getValueOrClonedDefault(this._scale,e,e$15.scale,t.scale),t},a$K.prototype.equals=function(e){return this===e||e instanceof a$K&&r$K.equals(this._translation,e._translation)&&r$K.equals(this._rotation,e._rotation)&&r$K.equals(this._scale,e._scale)};var f$L=function(e,t){this._propertyNames=[],this._definitionChanged=new o$1o,e$28(e)&&this.merge(e,t)};function g$B(e){return new e$1d(e)}function _$E(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;++o){var a=i[o];if(-1===r.indexOf(a)||!r$K.equals(e[a],t[a]))return!1}return!0}function a$J(e){return new a$K(e)}function c$I(e){return new f$L(e,a$J)}function t$x(e){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._clampAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._definitionChanged=new o$1o,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function i$G(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function n$A(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function e$14(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function n$z(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function a$I(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function e$13(e){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._enuCenter=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new o$1o,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function n$y(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}function e$12(e){this._definitionChanged=new o$1o,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._enuCenter=void 0,this.merge(u$Y(e,u$Y.EMPTY_OBJECT))}Object.defineProperties(f$L.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;t<i;t++)if(!r$K.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),f$L.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},f$L.prototype.addProperty=function(e,t,i){var r=this._propertyNames;if(!e$28(e))throw new t$Z("propertyName is required.");if(-1!==r.indexOf(e))throw new t$Z(e+" is already a registered property.");r.push(e),Object.defineProperty(this,e,C$H(e,!0,u$Y(i,g$B))),e$28(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)},f$L.prototype.removeProperty=function(e){var t=this._propertyNames.indexOf(e);if(!e$28(e))throw new t$Z("propertyName is required.");if(-1===t)throw new t$Z(e+" is not a registered property.");this._propertyNames.splice(t,1),delete this[e],this._definitionChanged.raiseEvent(this)},f$L.prototype.getValue=function(e,t){if(!e$28(e))throw new t$Z("time is required.");e$28(t)||(t={});for(var i=this._propertyNames,r=0,n=i.length;r<n;r++){var o=i[r];t[o]=r$K.getValueOrUndefined(this[o],e,t[o])}return t},f$L.prototype.merge=function(e,t){if(!e$28(e))throw new t$Z("source is required.");for(var i=this._propertyNames,r=e$28(e._propertyNames)?e._propertyNames:Object.keys(e),n=0,o=r.length;n<o;n++){var a=r[n],s=this[a],l=e[a];void 0===s&&-1===i.indexOf(a)&&this.addProperty(a,void 0,t),void 0!==l&&(void 0!==s?e$28(s)&&e$28(s.merge)&&s.merge(l):e$28(l)&&e$28(l.merge)&&e$28(l.clone)?this[a]=l.clone():this[a]=l)}},f$L.prototype.equals=function(e){return this===e||e instanceof f$L&&_$E(this,e)},Object.defineProperties(t$x.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),scale:C$H("scale"),minimumPixelSize:C$H("minimumPixelSize"),maximumScale:C$H("maximumScale"),incrementallyLoadTextures:C$H("incrementallyLoadTextures"),shadows:C$H("shadows"),uri:C$H("uri"),runAnimations:C$H("runAnimations"),clampAnimations:C$H("clampAnimations"),nodeTransformations:C$H("nodeTransformations",void 0,c$I),heightReference:C$H("heightReference"),distanceDisplayCondition:C$H("distanceDisplayCondition"),silhouetteColor:C$H("silhouetteColor"),silhouetteSize:C$H("silhouetteSize"),color:C$H("color"),colorBlendMode:C$H("colorBlendMode"),colorBlendAmount:C$H("colorBlendAmount"),clippingPlanes:C$H("clippingPlanes"),imageBasedLightingFactor:C$H("imageBasedLightingFactor"),lightColor:C$H("lightColor")}),t$x.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.clippingPlanes=this.clippingPlanes,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e):new t$x(this)},t$x.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.scale=u$Y(this.scale,e.scale),this.minimumPixelSize=u$Y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=u$Y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=u$Y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.shadows=u$Y(this.shadows,e.shadows),this.uri=u$Y(this.uri,e.uri),this.runAnimations=u$Y(this.runAnimations,e.runAnimations),this.clampAnimations=u$Y(this.clampAnimations,e.clampAnimations),this.heightReference=u$Y(this.heightReference,e.heightReference),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.silhouetteColor=u$Y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=u$Y(this.silhouetteSize,e.silhouetteSize),this.color=u$Y(this.color,e.color),this.colorBlendMode=u$Y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=u$Y(this.colorBlendAmount,e.colorBlendAmount),this.clippingPlanes=u$Y(this.clippingPlanes,e.clippingPlanes),this.imageBasedLightingFactor=u$Y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=u$Y(this.lightColor,e.lightColor);var t=e.nodeTransformations;if(e$28(t)){var i=this.nodeTransformations;e$28(i)?i.merge(t):this.nodeTransformations=new f$L(t,a$J)}},Object.defineProperties(i$G.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),uri:C$H("uri"),maximumScreenSpaceError:C$H("maximumScreenSpaceError")}),i$G.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new i$G(this)},i$G.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.uri=u$Y(this.uri,e.uri),this.maximumScreenSpaceError=u$Y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)},Object.defineProperties(n$A.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),leadTime:C$H("leadTime"),trailTime:C$H("trailTime"),width:C$H("width"),resolution:C$H("resolution"),material:c$K("material"),distanceDisplayCondition:C$H("distanceDisplayCondition")}),n$A.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new n$A(this)},n$A.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.leadTime=u$Y(this.leadTime,e.leadTime),this.trailTime=u$Y(this.trailTime,e.trailTime),this.width=u$Y(this.width,e.width),this.resolution=u$Y(this.resolution,e.resolution),this.material=u$Y(this.material,e.material),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(e$14.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),plane:C$H("plane"),dimensions:C$H("dimensions"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition")}),e$14.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new e$14(this)},e$14.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.plane=u$Y(this.plane,e.plane),this.dimensions=u$Y(this.dimensions,e.dimensions),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition)},Object.defineProperties(n$z.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),pixelSize:C$H("pixelSize"),heightReference:C$H("heightReference"),color:C$H("color"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),scaleByDistance:C$H("scaleByDistance"),translucencyByDistance:C$H("translucencyByDistance"),distanceDisplayCondition:C$H("distanceDisplayCondition"),disableDepthTestDistance:C$H("disableDepthTestDistance")}),n$z.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new n$z(this)},n$z.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.pixelSize=u$Y(this.pixelSize,e.pixelSize),this.heightReference=u$Y(this.heightReference,e.heightReference),this.color=u$Y(this.color,e.color),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=u$Y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=u$Y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=u$Y(this.disableDepthTestDistance,e.disableDepthTestDistance)},Object.defineProperties(a$I.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),positions:C$H("positions"),width:C$H("width"),hMax:C$H("hMax"),granularity:C$H("granularity"),material:c$K("material"),depthFailMaterial:c$K("depthFailMaterial"),arcType:C$H("arcType"),clampToGround:C$H("clampToGround"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),classificationType:C$H("classificationType"),zIndex:C$H("zIndex")}),a$I.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.hMax=this.hMax,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new a$I(this)},a$I.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.positions=u$Y(this.positions,e.positions),this.width=u$Y(this.width,e.width),this.granularity=u$Y(this.granularity,e.granularity),this.material=u$Y(this.material,e.material),this.depthFailMaterial=u$Y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=u$Y(this.arcType,e.arcType),this.clampToGround=u$Y(this.clampToGround,e.clampToGround),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=u$Y(this.classificationType,e.classificationType),this.zIndex=u$Y(this.zIndex,e.zIndex),this.hMax=u$Y(this.hMax,e.hMax)},Object.defineProperties(e$13.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),material:c$K("material"),positions:C$H("positions"),shape:C$H("shape"),granularity:C$H("granularity"),fill:C$H("fill"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),cornerType:C$H("cornerType"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),enuCenter:C$H("enuCenter")}),e$13.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.enuCenter=this.enuCenter,e):new e$13(this)},e$13.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.material=u$Y(this.material,e.material),this.positions=u$Y(this.positions,e.positions),this.shape=u$Y(this.shape,e.shape),this.granularity=u$Y(this.granularity,e.granularity),this.fill=u$Y(this.fill,e.fill),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.cornerType=u$Y(this.cornerType,e.cornerType),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.enuCenter=u$Y(this.enuCenter,e.enuCenter)},Object.defineProperties(n$y.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),coordinates:C$H("coordinates"),height:C$H("height"),heightReference:C$H("heightReference"),extrudedHeight:C$H("extrudedHeight"),extrudedHeightReference:C$H("extrudedHeightReference"),rotation:C$H("rotation"),stRotation:C$H("stRotation"),granularity:C$H("granularity"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),classificationType:C$H("classificationType"),zIndex:C$H("zIndex")}),n$y.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new n$y(this)},n$y.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.coordinates=u$Y(this.coordinates,e.coordinates),this.height=u$Y(this.height,e.height),this.heightReference=u$Y(this.heightReference,e.heightReference),this.extrudedHeight=u$Y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=u$Y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=u$Y(this.rotation,e.rotation),this.stRotation=u$Y(this.stRotation,e.stRotation),this.granularity=u$Y(this.granularity,e.granularity),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=u$Y(this.classificationType,e.classificationType),this.zIndex=u$Y(this.zIndex,e.zIndex)},Object.defineProperties(e$12.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:C$H("show"),positions:C$H("positions"),minimumHeights:C$H("minimumHeights"),maximumHeights:C$H("maximumHeights"),granularity:C$H("granularity"),fill:C$H("fill"),material:c$K("material"),outline:C$H("outline"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth"),shadows:C$H("shadows"),distanceDisplayCondition:C$H("distanceDisplayCondition"),enuCenter:C$H("enuCenter")}),e$12.prototype.clone=function(e){return e$28(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.enuCenter=this.enuCenter,e):new e$12(this)},e$12.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.show=u$Y(this.show,e.show),this.positions=u$Y(this.positions,e.positions),this.minimumHeights=u$Y(this.minimumHeights,e.minimumHeights),this.maximumHeights=u$Y(this.maximumHeights,e.maximumHeights),this.granularity=u$Y(this.granularity,e.granularity),this.fill=u$Y(this.fill,e.fill),this.material=u$Y(this.material,e.material),this.outline=u$Y(this.outline,e.outline),this.outlineColor=u$Y(this.outlineColor,e.outlineColor),this.outlineWidth=u$Y(this.outlineWidth,e.outlineWidth),this.shadows=u$Y(this.shadows,e.shadows),this.distanceDisplayCondition=u$Y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.enuCenter=u$Y(this.enuCenter,e.enuCenter)};var $$E=new t$W;function ii$5(e){return new r$G(e)}function ei$4(e){return C$H(e,void 0,ii$5)}function o$Q(e,t){return C$H(e,void 0,(function(e){return e instanceof t?e:new t(e)}))}function h$F(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).id;e$28(t)||(t=e$1K()),this._availability=void 0,this._id=t,this._definitionChanged=new o$1o,this._name=e.name,this._show=u$Y(e.show,!0),this._depthTestEnabled=u$Y(e.depthTestEnabled,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._scale=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this._polygonOffset={enabled:!1,value:new o$1k(0,0)},this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function v$B(e,t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n],a=i;o._show!==a&&(o.show=a,v$B(o,o._children,i))}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}Object.defineProperties(h$F.prototype,{availability:c$J("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:c$J("name"),show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&v$B(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!e$28(this.entityCollection)||this.entityCollection.show)&&(!e$28(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(e$28(t)){var r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,e$28(e)&&e._children.push(this);var n=this.isShowing;i!==n&&v$B(this,this._children,n),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},children:{get:function(){return this._children},set:function(e){this._children=e}},propertyNames:{get:function(){return this._propertyNames}},billboard:o$Q("billboard",n$I),box:o$Q("box",n$F),corridor:o$Q("corridor",n$E),cylinder:o$Q("cylinder",n$D),description:C$H("description"),ellipse:o$Q("ellipse",n$C),ellipsoid:o$Q("ellipsoid",e$16),label:o$Q("label",n$B),model:o$Q("model",t$x),orientation:C$H("orientation"),scale:C$H("scale"),path:o$Q("path",n$A),plane:o$Q("plane",e$14),point:o$Q("point",n$z),polygon:o$Q("polygon",u$B),polyline:o$Q("polyline",a$I),polylineVolume:o$Q("polylineVolume",e$13),properties:o$Q("properties",f$L),position:ei$4("position"),rectangle:o$Q("rectangle",n$y),viewFrom:C$H("viewFrom"),wall:o$Q("wall",e$12)}),h$F.prototype.isAvailable=function(e){if(!e$28(e))throw new t$Z("time is required.");var t=this._availability;return!e$28(t)||t.contains(e)},h$F.prototype.addProperty=function(e){var t=this._propertyNames;if(!e$28(e))throw new t$Z("propertyName is required.");if(-1!==t.indexOf(e))throw new t$Z(e+" is already a registered property.");if(e in this)throw new t$Z(e+" is a reserved property name.");t.push(e),Object.defineProperty(this,e,c$J(e,!0))},h$F.prototype.removeProperty=function(e){var t=this._propertyNames.indexOf(e);if(!e$28(e))throw new t$Z("propertyName is required.");if(-1===t)throw new t$Z(e+" is not a registered property.");this._propertyNames.splice(t,1),delete this[e]},h$F.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.name=u$Y(this.name,e.name),this.availability=u$Y(e.availability,this.availability);for(var t=this._propertyNames,i=e$28(e._propertyNames)?e._propertyNames:Object.keys(e),r=i.length,n=0;n<r;n++){var o=i[n];if("parent"!==o){var a=this[o],s=e[o];!e$28(a)&&-1===t.indexOf(o)&&this.addProperty(o),e$28(s)&&(e$28(a)?e$28(a.merge)&&a.merge(s):e$28(s.merge)&&e$28(s.clone)?this[o]=s.clone():this[o]=s)}}};var P$G=new p$1a,G$O=new t$X,x$O=new n$14;h$F.prototype.computeModelMatrix=function(e,t){o$1u.typeOf.object("time",e);var i=r$K.getValueOrUndefined(this._position,e,G$O);if(e$28(i)){var r=r$K.getValueOrUndefined(this._orientation,e,x$O);return t=e$28(r)?y$15.fromRotationTranslation(p$1a.fromQuaternion(r,P$G),i,t):m$1b.eastNorthUpToFixedFrame(i,void 0,t)}},h$F.prototype.computeModelMatrixForHeightReference=function(e,t,i,r,n){o$1u.typeOf.object("time",e);var o=r$K.getValueOrDefault(t,e,k$_.NONE),a=r$K.getValueOrUndefined(this._position,e,G$O);if(o===k$_.NONE||!e$28(a)||t$X.equalsEpsilon(a,t$X.ZERO,e$27.EPSILON8))return this.computeModelMatrix(e,n);var s=r.cartesianToCartographic(a,$$E);o===k$_.CLAMP_TO_GROUND?s.height=i:s.height+=i,a=r.cartographicToCartesian(s,a);var l=r$K.getValueOrUndefined(this._orientation,e,x$O);return n=e$28(l)?y$15.fromRotationTranslation(p$1a.fromQuaternion(l,P$G),a,n):m$1b.eastNorthUpToFixedFrame(a,void 0,n)},h$F.supportsMaterialsforEntitiesOnTerrain=function(e){return d$Q.supportsMaterials(e)},h$F.supportsPolylinesOnTerrain=function(e){return g$D.isSupported(e)},h$F.prototype.setPolygonOffset=function(e,t){0!=e||0!=t?(this._polygonOffset.enabled=!0,o$1k.fromElements(e,t,this._polygonOffset.value)):(this._polygonOffset.enabled=!1,o$1k.fromElements(0,0,this._polygonOffset.value))};var M$I=new t$z(e$1S.WHITE),D$N=new e$1d(!0),V$z=new e$1d(!0),N$z=new e$1d(!1),U$F=new e$1d(e$1S.BLACK),A$R=new e$1d(q$L.DISABLED),L$O=new e$1d(new r$10),S$y=new e$1d(L$V.BOTH);function i$F(e){o$1u.defined("options.entity",e.entity),o$1u.defined("options.scene",e.scene),o$1u.defined("options.geometryOptions",e.geometryOptions),o$1u.defined("options.geometryPropertyName",e.geometryPropertyName),o$1u.defined("options.observedPropertyNames",e.observedPropertyNames);var t=e.entity,i=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new o$1o,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=i,this._id=i+"-"+t.id,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=h$F.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(i$F.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!e$28(this._entity.availability)&&r$K.isConstant(this._showProperty)&&r$K.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!e$28(this._entity.availability)&&r$K.isConstant(this._showProperty)&&r$K.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),i$F.prototype.isOutlineVisible=function(e){var t=this._entity;return u$Y(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e),!1)},i$F.prototype.isFilled=function(e){var t=this._entity;return u$Y(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e),!1)},i$F.prototype.createFillGeometryInstance=t$Z.throwInstantiationError,i$F.prototype.createOutlineGeometryInstance=t$Z.throwInstantiationError,i$F.prototype.isDestroyed=function(){return!1},i$F.prototype.destroy=function(){i$Z(this)},i$F.prototype._isHidden=function(e,t){var i=t.show;return e$28(i)&&i.isConstant&&!i.getValue(o$11.MINIMUM_VALUE)},i$F.prototype._isOnTerrain=function(e,t){return!1},i$F.prototype._getIsClosed=function(e){return!0},i$F.prototype._isDynamic=t$Z.throwInstantiationError,i$F.prototype._setStaticOptions=t$Z.throwInstantiationError,i$F.prototype._onEntityPropertyChanged=function(e,t,i,r){if(-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(!e$28(n))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var o=n.fill,a=!e$28(o)||!o.isConstant||o.getValue(o$11.MINIMUM_VALUE),s=n.outline,l=e$28(s);if(l&&s.isConstant&&(l=s.getValue(o$11.MINIMUM_VALUE)),!a&&!l)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=n.show;if(this._isHidden(e,n))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));this._materialProperty=u$Y(n.material,M$I),this._fillProperty=u$Y(o,V$z),this._showProperty=u$Y(u,D$N),this._showOutlineProperty=u$Y(n.outline,N$z),this._outlineColorProperty=l?u$Y(n.outlineColor,U$F):void 0,this._shadowsProperty=u$Y(n.shadows,A$R),this._distanceDisplayConditionProperty=u$Y(n.distanceDisplayCondition,L$O),this._classificationTypeProperty=u$Y(n.classificationType,S$y),this._fillEnabled=a;var c=this._isOnTerrain(e,n)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof t$z);if(l&&c&&(e$1$(e$1$.geometryOutlines),l=!1),this._onTerrain=c,this._outlineEnabled=l,this._isDynamic(e,n))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,n),this._isClosed=this._getIsClosed(this._options);var h=n.outlineWidth;this._outlineWidth=e$28(h)?h.getValue(o$11.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}}},i$F.prototype.createDynamicUpdater=function(e,t){if(o$1u.defined("primitives",e),o$1u.defined("groundPrimitives",t),!this._dynamic)throw new t$Z("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var m$I=new t$X,H$G=new t$W;function h$E(e,t,i,r){o$1u.defined("scene",e),o$1u.defined("positionProperty",t),this._scene=e,this._heightReference=i,this._extrudedHeightReference=r,this._positionProperty=t,this._position=new t$X,this._cartographicPosition=new t$W,this._normal=new t$X,this._definitionChanged=new o$1o,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;var n=this;if(e$28(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener((function(){n._updateClamping()})),this._removeModeListener=e.morphComplete.addEventListener((function(){n._updateClamping()}))),t.isConstant){var o=t.getValue(o$11.MINIMUM_VALUE,m$I);if(!e$28(o)||t$X.equals(o,t$X.ZERO)||!e$28(e.globe))return;this._position=t$X.clone(o,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}function a$H(e,t,i,r){if(i$F.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(e$28(n)){e$28(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var o=n.heightReference;if(e$28(o)){var a=new n$G(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new h$E(this._scene,a,o)}}}}Object.defineProperties(h$E.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),h$E.prototype._updateClamping=function(){e$28(this._removeCallbackFunc)&&this._removeCallbackFunc();var e=this._scene,t=e.globe,i=this._position;if(e$28(t)&&!t$X.equals(i,t$X.ZERO)){var r=t.ellipsoid,n=t._surface,o=this,a=r.cartesianToCartographic(i,this._cartographicPosition),s=t.getHeight(a);e$28(s)?this._terrainHeight=s:this._terrainHeight=0,this._removeCallbackFunc=n.updateHeight(a,(function(t){if(e.mode===P$$.SCENE3D){var i=r.cartesianToCartographic(t,H$G);o._terrainHeight=i.height}else o._terrainHeight=t.x;o.definitionChanged.raiseEvent()}))}else this._terrainHeight=0},h$E.prototype.getValue=function(e,t){var i=r$K.getValueOrDefault(this._heightReference,e,k$_.NONE),r=r$K.getValueOrDefault(this._extrudedHeightReference,e,k$_.NONE);if(i===k$_.NONE&&r!==k$_.RELATIVE_TO_GROUND)return this._position=t$X.clone(t$X.ZERO,this._position),t$X.clone(t$X.ZERO,t);if(this._positionProperty.isConstant)return t$X.multiplyByScalar(this._normal,this._terrainHeight,t);var n=this._scene,o=this._positionProperty.getValue(e,m$I);if(!e$28(o)||t$X.equals(o,t$X.ZERO)||!e$28(n.globe))return t$X.clone(t$X.ZERO,t);if(t$X.equalsEpsilon(this._position,o,e$27.EPSILON10))return t$X.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=t$X.clone(o,this._position),this._updateClamping();var a=n.globe.ellipsoid.geodeticSurfaceNormal(o,this._normal);return t$X.multiplyByScalar(a,this._terrainHeight,t)},h$E.prototype.isDestroyed=function(){return!1},h$E.prototype.destroy=function(){return e$28(this._removeEventListener)&&this._removeEventListener(),e$28(this._removeModeListener)&&this._removeModeListener(),e$28(this._removeCallbackFunc)&&this._removeCallbackFunc(),i$Z(this)};var V$y=t$X.ZERO,E$L=new t$X,N$y=new t$X,G$N=new e$1S;function H$F(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function i$E(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new H$F(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function p$H(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(i$E.prototype=Object.create(i$F.prototype),i$E.prototype.constructor=i$E),Object.defineProperties(i$E.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),i$E.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n=new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:t$H.fromDistanceDisplayCondition(o),color:void 0,offset:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,G$N)),e$28(t)||(t=e$1S.WHITE),a.color=o$18.fromColor(t));return e$28(this._options.offsetAttribute)&&(a.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,V$y,E$L))),new d$15({id:i,geometry:O$H.fromDimensions(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:a})},i$E.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,G$N),n=this._distanceDisplayConditionProperty.getValue(e),o={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n),offset:void 0};return e$28(this._options.offsetAttribute)&&(o.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,V$y,E$L))),new d$15({id:t,geometry:o$1c.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},i$E.prototype._computeCenter=function(e,t){return r$K.getValueOrUndefined(this._entity.position,e,t)},i$E.prototype._isHidden=function(e,t){return!e$28(t.dimensions)||!e$28(e.position)||i$F.prototype._isHidden.call(this,e,t)},i$E.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&r$K.isConstant(e.orientation)&&t.dimensions.isConstant&&r$K.isConstant(t.outlineWidth))},i$E.prototype._setStaticOptions=function(e,t){var i=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof t$z?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,r.dimensions=t.dimensions.getValue(o$11.MINIMUM_VALUE,r.dimensions),r.offsetAttribute=i!==k$_.NONE?ee$C.ALL:void 0},i$E.prototype._onEntityPropertyChanged=a$H,i$E.DynamicGeometryUpdater=p$H,e$28(Object.create)&&(p$H.prototype=Object.create(a$L.prototype),p$H.prototype.constructor=p$H),p$H.prototype._isHidden=function(e,t,i){var r=r$K.getValueOrUndefined(e.position,i,N$y),n=this._options.dimensions;return!e$28(r)||!e$28(n)||a$L.prototype._isHidden.call(this,e,t,i)},p$H.prototype._setOptions=function(e,t,i){var r=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),n=this._options;n.dimensions=r$K.getValueOrUndefined(t.dimensions,i,n.dimensions),n.offsetAttribute=r!==k$_.NONE?ee$C.ALL:void 0};var a$G={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:y$15.fromRotationTranslation(p$1a.fromRotationX(e$27.PI_OVER_TWO)),Z_UP_TO_Y_UP:y$15.fromRotationTranslation(p$1a.fromRotationX(-e$27.PI_OVER_TWO)),X_UP_TO_Z_UP:y$15.fromRotationTranslation(p$1a.fromRotationY(-e$27.PI_OVER_TWO)),Z_UP_TO_X_UP:y$15.fromRotationTranslation(p$1a.fromRotationY(e$27.PI_OVER_TWO)),X_UP_TO_Y_UP:y$15.fromRotationTranslation(p$1a.fromRotationZ(e$27.PI_OVER_TWO)),Y_UP_TO_X_UP:y$15.fromRotationTranslation(p$1a.fromRotationZ(-e$27.PI_OVER_TWO)),fromName:function(e){return o$1u.typeOf.string("name",e),a$G[e]}},z$z=Object.freeze(a$G),A$Q={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"},Q$C=Object.freeze(A$Q),e$11={HIGHLIGHT:0,REPLACE:1,MIX:2},L$N=Object.freeze(e$11),T$D={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},c$H={SCALAR:void 0,VEC2:o$1k,VEC3:t$X,VEC4:e$25,MAT2:f$15,MAT3:p$1a,MAT4:y$15};function M$H(e){var t,i=e.componentType;t="string"==typeof i?S$W.fromName(i):i;var r=T$D[e.type],n=c$H[e.type];return{componentsPerAttribute:r,classType:n,createArrayBufferView:function(e,i,n){return S$W.createArrayBufferView(t,e,i,r*n)}}}var I$Y=e$1S.WHITE,X$u=!0;function h$D(e,t,i,r,n){var o;this.featuresLength=t,this._translucentFeaturesLength=0,e$28(i)&&(o=i.extensions),this._extensions=u$Y(o,{});var a,s,l=_e$k(i);if(this._properties=l,this._batchTableHierarchy=me$o(this,i,r),this._batchTableBinaryProperties=V$x(t,l,r),this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],this._content=e,this._colorChangedCallback=n,t>0){var u=Math.min(t,e$1U.maximumTextureSize),c=Math.ceil(t/e$1U.maximumTextureSize),h=1/u,d=.5*h,f=1/c,p=.5*f;a=new o$1k(u,c),s=new e$25(h,d,f,p)}this._textureDimensions=a,this._textureStep=s}function _e$k(e){var t={};if(!e$28(e))return t;for(var i in e)e.hasOwnProperty(i)&&"HIERARCHY"!==i&&"extensions"!==i&&"extras"!==i&&(t[i]=l$1e(e[i],!0));return t}function me$o(e,t,i){if(e$28(t)){var r=e._extensions["3DTILES_batch_table_hierarchy"],n=t.HIERARCHY;if(e$28(n)&&(h$D._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=n,r=n),e$28(r))return ge$k(r,i)}}function ge$k(e,t){var i,r,n,o=e.instancesLength,a=e.classes,s=e.classIds,l=e.parentCounts,u=e.parentIds,c=o;if(e$28(s.byteOffset)&&(s.componentType=u$Y(s.componentType,S$W.UNSIGNED_SHORT),s.type=Q$C.SCALAR,s=M$H(s).createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,o)),e$28(l))for(e$28(l.byteOffset)&&(l.componentType=u$Y(l.componentType,S$W.UNSIGNED_SHORT),l.type=Q$C.SCALAR,l=M$H(l).createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,o)),n=new Uint16Array(o),c=0,i=0;i<o;++i)n[i]=c,c+=l[i];e$28(u)&&e$28(u.byteOffset)&&(u.componentType=u$Y(u.componentType,S$W.UNSIGNED_SHORT),u.type=Q$C.SCALAR,u=M$H(u).createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,c));var h=a.length;for(i=0;i<h;++i){var d=a[i].length,f=a[i].instances,p=V$x(d,f,t);a[i].instances=p$17(p,f)}var _=d$1a(new Array(h),0),m=new Uint16Array(o);for(i=0;i<o;++i)r=s[i],m[i]=_[r],++_[r];var $={classes:a,classIds:s,classIndexes:m,parentCounts:l,parentIndexes:n,parentIds:u};return ye$l($),$}h$D._deprecationWarning=t$T,Object.defineProperties(h$D.prototype,{memorySizeInBytes:{get:function(){var e=0;return e$28(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),e$28(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}});var de$l=[];function ye$l(e){var t=de$l;t.length=0;for(var i=e.classIds.length,r=0;r<i;++r)j$E(e,r,t)}function j$E(e,t,i){var r=e.parentCounts,n=e.parentIds,o=e.parentIndexes,a=e.classIds.length;if(e$28(n)){if(t>=a)throw new t$Z("Parent index "+t+" exceeds the total number of instances: "+a);if(i.indexOf(t)>-1)throw new t$Z("Circular dependency detected in the batch table hierarchy.");i.push(t);for(var s=e$28(r)?r[t]:1,l=e$28(r)?o[t]:t,u=0;u<s;++u){var c=n[l+u];c!==t&&j$E(e,c,i)}i.pop(t)}}function V$x(e,t,i){var r;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=o.byteOffset;if(e$28(a)){var s=o.componentType,l=o.type;if(!e$28(s))throw new t$U("componentType is required.");if(!e$28(l))throw new t$U("type is required.");if(!e$28(i))throw new t$U("Property "+n+" requires a batch table binary.");var u=M$H(o),c=u.componentsPerAttribute,h=u.classType,d=u.createArrayBufferView(i.buffer,i.byteOffset+a,e);e$28(r)||(r={}),r[n]={typedArray:d,componentCount:c,type:h}}}return r}function Z$F(e){var t=e._textureDimensions;return t.x*t.y*4}function $$D(e){if(!e$28(e._batchValues)){var t=Z$F(e),i=new Uint8Array(t);d$1a(i,255),e._batchValues=i}return e._batchValues}function J$J(e){if(!e$28(e._showAlphaProperties)){var t=2*e.featuresLength,i=new Uint8Array(t);d$1a(i,255),e._showAlphaProperties=i}return e._showAlphaProperties}function g$A(e,t){if(!e$28(e)||e<0||e>t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+t-NaN)}h$D.getBinaryProperties=function(e,t,i){return V$x(e,t,i)},h$D.prototype.setShow=function(e,t){if(g$A(e,this.featuresLength),o$1u.typeOf.bool("show",t),!t||e$28(this._showAlphaProperties)){var i=J$J(this),r=2*e,n=t?255:0;if(i[r]!==n)i[r]=n,$$D(this)[4*e+3]=t?i[r+1]:0,this._batchValuesDirty=!0}},h$D.prototype.setAllShow=function(e){o$1u.typeOf.bool("show",e);for(var t=this.featuresLength,i=0;i<t;++i)this.setShow(i,e)},h$D.prototype.getShow=function(e){if(g$A(e,this.featuresLength),!e$28(this._showAlphaProperties))return!0;var t=2*e;return 255===this._showAlphaProperties[t]};var Se$c=new Array(4);h$D.prototype.setColor=function(e,t){if(g$A(e,this.featuresLength),o$1u.typeOf.object("color",t),!e$1S.equals(t,I$Y)||e$28(this._batchValues)){var i=t.toBytes(Se$c),r=i[3],n=$$D(this),o=4*e,a=J$J(this),s=2*e;if(n[o]!==i[0]||n[o+1]!==i[1]||n[o+2]!==i[2]||a[s+1]!==r){n[o]=i[0],n[o+1]=i[1],n[o+2]=i[2];var l=255!==a[s+1],u=0!==a[s];n[o+3]=u?r:0,a[s+1]=r;var c=255!==r;c&&!l?++this._translucentFeaturesLength:!c&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,e$28(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}}},h$D.prototype.setAllColor=function(e){o$1u.typeOf.object("color",e);for(var t=this.featuresLength,i=0;i<t;++i)this.setColor(i,e)},h$D.prototype.getColor=function(e,t){if(g$A(e,this.featuresLength),o$1u.typeOf.object("result",t),!e$28(this._batchValues))return e$1S.clone(I$Y,t);var i=this._batchValues,r=4*e,n=this._showAlphaProperties,o=2*e;return e$1S.fromBytes(i[r],i[r+1],i[r+2],n[o+1],t)},h$D.prototype.getPickColor=function(e){return g$A(e,this.featuresLength),this._pickIds[e]};var Te$k=new e$1S;function ee$t(e,t){var i=e.typedArray,r=e.componentCount;return 1===r?i[t]:e.type.unpack(i,t*r)}function te$w(e,t,i){var r=e.typedArray,n=e.componentCount;1===n?r[t]=i:e.type.pack(i,r,t*n)}h$D.prototype.applyStyle=function(e){if(!e$28(e))return this.setAllColor(I$Y),void this.setAllShow(X$u);for(var t=this._content,i=this.featuresLength,r=0;r<i;++r){var n=t.getFeature(r),o=e$28(e.color)?e.color.evaluateColor(n,Te$k):I$Y,a=e$28(e.show)?e.show.evaluate(n):X$u;this.setColor(r,o),this.setShow(r,a)}};var xe$m=[],Ce$i=[],Le$l=0;function Ae$l(e,t,i){var r=e.classIds,n=e.parentCounts,o=e.parentIds,a=e.parentIndexes,s=r.length,l=xe$m;l.length=Math.max(l.length,s);var u=++Le$l,c=Ce$i;for(c.length=0,c.push(t);c.length>0;)if(l[t=c.pop()]!==u){l[t]=u;var h=i(e,t);if(e$28(h))return h;for(var d=n[t],f=a[t],p=0;p<d;++p){var _=o[f+p];_!==t&&c.push(_)}}}function we$k(e,t,i){for(var r=!0;r;){var n=i(e,t);if(e$28(n))return n;var o=e.parentIds[t];r=o!==t,t=o}}function P$F(e,t,i){var r=e.parentCounts;return e$28(e.parentIds)?e$28(r)?Ae$l(e,t,i):we$k(e,t,i):i(e,t)}function De$m(e,t,i){var r=P$F(e._batchTableHierarchy,t,(function(e,t){var r=e.classIds[t];if(e$28(e.classes[r].instances[i]))return!0}));return e$28(r)}function Pe$h(e,t,i){P$F(e._batchTableHierarchy,t,(function(e,t){var r=e.classIds[t],n=e.classes[r].instances;for(var o in n)n.hasOwnProperty(o)&&-1===i.indexOf(o)&&i.push(o)}))}function Ee$i(e,t,i){return P$F(e._batchTableHierarchy,t,(function(e,t){var r=e.classIds[t],n=e.classes[r],o=e.classIndexes[t],a=n.instances[i];if(e$28(a))return e$28(a.typedArray)?ee$t(a,o):l$1e(a[o],!0)}))}function be$m(e,t,i,r){var n=P$F(e._batchTableHierarchy,t,(function(e,n){var o=e.classIds[n],a=e.classes[o],s=e.classIndexes[n],l=a.instances[i];if(e$28(l)){if(n!==t)throw new t$Z('Inherited property "'+i+'" is read-only.');return e$28(l.typedArray)?te$w(l,s,r):l[s]=l$1e(r,!0),!0}}));return e$28(n)}function Oe$i(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function re$r(e,t){return e=a$$.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n} \n"}function Ie$j(e,t){for(var i,r="texture2D("+t,n=0,o=e.indexOf(r,n);o>-1;){for(var a=0,s=o;s<e.length;++s){var l=e.charAt(s);if("("===l)++a;else if(")"===l&&0===--a){i=s+1;break}}var u="tile_diffuse_final("+e.slice(o,i)+", tile_diffuse)";e=e.slice(0,o)+u+e.slice(i),n=o+u.length,o=e.indexOf(r,n)}return e}function ne$y(e,t,i){if(!e$28(t))return re$r(e,i);var r=new RegExp("(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+"+t+";"),n=e.match(r);if(!e$28(n))return re$r(e,i);var o=n[0],a=n[2];e=(e=a$$.replaceMain(e,"tile_main")).replace(o,"");var s;if("vec3"===a||"vec4"===a){var l="vec3"===a?"vec4("+t+", 1.0)":t,u="vec3"===a?"tile_diffuse.xyz":"tile_diffuse";r=new RegExp(t,"g"),e=e.replace(r,u),s=" vec4 source = "+l+"; \n tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n tile_main(); \n"}else"sampler2D"===a&&(e=Ie$j(e,t),s=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+o+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+s,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}function ke$c(e){var t=e._content.tileset,i=t.colorBlendMode,r=t.colorBlendAmount;if(i===L$N.HIGHLIGHT)return 0;if(i===L$N.REPLACE)return 1;if(i===L$N.MIX)return e$27.clamp(r,e$27.EPSILON4,1);throw new t$Z('Invalid color blend mode "'+i+'".')}h$D.prototype.isClass=function(e,t){g$A(e,this.featuresLength),o$1u.typeOf.string("className",t);var i=this._batchTableHierarchy;if(!e$28(i))return!1;var r=P$F(i,e,(function(e,i){var r=e.classIds[i];if(e.classes[r].name===t)return!0}));return e$28(r)},h$D.prototype.isExactClass=function(e,t){return o$1u.typeOf.string("className",t),this.getExactClassName(e)===t},h$D.prototype.getExactClassName=function(e){g$A(e,this.featuresLength);var t=this._batchTableHierarchy;if(e$28(t)){var i=t.classIds[e];return t.classes[i].name}},h$D.prototype.hasProperty=function(e,t){return g$A(e,this.featuresLength),o$1u.typeOf.string("name",t),e$28(this._properties[t])||e$28(this._batchTableHierarchy)&&De$m(this,e,t)},h$D.prototype.getPropertyNames=function(e,t){g$A(e,this.featuresLength),(t=e$28(t)?t:[]).length=0;var i=Object.keys(this._properties);return t.push.apply(t,i),e$28(this._batchTableHierarchy)&&Pe$h(this,e,t),t},h$D.prototype.getProperty=function(e,t){if(g$A(e,this.featuresLength),o$1u.typeOf.string("name",t),e$28(this._batchTableBinaryProperties)){var i=this._batchTableBinaryProperties[t];if(e$28(i))return ee$t(i,e)}var r=this._properties[t];if(e$28(r))return l$1e(r[e],!0);if(e$28(this._batchTableHierarchy)){var n=Ee$i(this,e,t);if(e$28(n))return n}},h$D.prototype.setProperty=function(e,t,i){var r=this.featuresLength;if(g$A(e,r),o$1u.typeOf.string("name",t),e$28(this._batchTableBinaryProperties)){var n=this._batchTableBinaryProperties[t];if(e$28(n))return void te$w(n,e,i)}if(!e$28(this._batchTableHierarchy)||!be$m(this,e,t,i)){var o=this._properties[t];e$28(o)||(this._properties[t]=new Array(r),o=this._properties[t]),o[e]=l$1e(i,!0)}},h$D.prototype.getVertexShaderCallback=function(e,t,i){if(0!==this.featuresLength){var r=this;return function(n){var o,a=ne$y(n,i,!1);return e$1U.maximumVertexTextureImageUnits>0?(o="",e&&(o+="uniform bool tile_translucentCommand; \n"),o+="uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec2 st = computeSt("+t+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n tile_color(featureProperties); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n",e&&(o+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),o+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):o="varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_color(vec4(1.0)); \n tile_featureSt = computeSt("+t+"); \n}",a+"\n"+Oe$i(r)+o}}},h$D.prototype.getFragmentShaderCallback=function(e,t){if(0!==this.featuresLength)return function(i){return i=ne$y(i,t,!0),e$1U.maximumVertexTextureImageUnits>0?i+="#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nuniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n tile_color(tile_featureColor); \n}":(e&&(i+="uniform bool tile_translucentCommand; \n"),i+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",e&&(i+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),i+=" tile_color(featureProperties); \n} \n"),i}},h$D.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=a$$.replaceMain(e,"tile_main"),e$1U.maximumVertexTextureImageUnits>0?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n} \n",e}},h$D.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){var i={tile_batchTexture:function(){return u$Y(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_colorBlend:function(){return ke$c(e)},uSwipeRegion:function(){var t=e._content.tileset._swipeRegion,i=e._content.tileset.frameState.context.drawingBufferWidth,r=e._content.tileset.frameState.context.drawingBufferHeight,n=new e$25;return n.x=t.x*i,n.y=(1-t.y)*r,n.z=t.z*i,n.w=(1-t.w)*r,n},tile_pickTexture:function(){return e._pickTexture}};return p$17(t,i)}}},h$D.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};var x$N={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};function Re$g(e){var t=e._translucentFeaturesLength;return 0===t?x$N.ALL_OPAQUE:t===e.featuresLength?x$N.ALL_TRANSLUCENT:x$N.OPAQUE_AND_TRANSLUCENT}function Be$l(e){var t=r$15.shallowClone(e),i=t.pass===Le$p.TRANSLUCENT;return t.uniformMap=e$28(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return i},t}function Me$j(e){var t=r$15.shallowClone(e);return t.pass=Le$p.TRANSLUCENT,t.renderState=ze$c(e.renderState),t}function Ue$j(e){var t=r$15.shallowClone(e);return t.renderState=Ge$d(e.renderState),t}function Ne$a(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!e$28(i)){var r=t.fragmentShaderSource.clone();r.defines=e$28(r.defines)?r.defines.slice(0):[],r.defines.push("POLYGON_OFFSET"),r.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:t._attributeLocations})}return i}function Ve$i(e,t){var i=r$15.shallowClone(t),r=l$1e(i.renderState,!0);r.cull.enabled=!0,r.cull.face=k$11.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},r.stencilTest=Fa$6.setCesium3DTileBit(),r.stencilMask=Fa$6.CESIUM_3D_TILE_MASK,i.renderState=u$R.fromCache(r),i.castShadows=!1,i.receiveShadows=!1,i.uniformMap=l$1e(t.uniformMap);var n=new o$1k(5,5);return i.uniformMap.u_polygonOffset=function(){return n},i.shaderProgram=Ne$a(e,t.shaderProgram),i}function Fe$e(e,t){var i=r$15.shallowClone(e),r=l$1e(i.renderState,!0);return r.stencilTest.enabled=!0,r.stencilTest.mask=Fa$6.SKIP_LOD_MASK,r.stencilTest.reference=Fa$6.CESIUM_3D_TILE_MASK|t<<Fa$6.SKIP_LOD_BIT_SHIFT,r.stencilTest.frontFunction=m$12.GREATER_OR_EQUAL,r.stencilTest.frontOperation.zPass=n$12.REPLACE,r.stencilTest.backFunction=m$12.GREATER_OR_EQUAL,r.stencilTest.backOperation.zPass=n$12.REPLACE,r.stencilMask=Fa$6.CESIUM_3D_TILE_MASK|Fa$6.SKIP_LOD_MASK,i.renderState=u$R.fromCache(r),i}function He$e(e){return(e.renderState.stencilTest.reference&Fa$6.SKIP_LOD_MASK)>>>Fa$6.SKIP_LOD_BIT_SHIFT}function ze$c(e){var t=l$1e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Ee$n.ALPHA_BLEND,u$R.fromCache(t)}function Ge$d(e){var t=l$1e(e,!0);return t.stencilTest=Fa$6.setCesium3DTileBit(),t.stencilMask=Fa$6.CESIUM_3D_TILE_MASK,u$R.fromCache(t)}function ie$t(e,t,i){var r=e._textureDimensions;return new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,source:{width:r.x,height:r.y,arrayBufferView:i},flipY:!1,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})}function Ke$b(e,t){var i=e.featuresLength;if(!e$28(e._pickTexture)&&i>0){for(var r=e._pickIds,n=Z$F(e),o=new Uint8Array(n),a=e._content,s=0;s<i;++s){var l=t.createPickId(a.getFeature(s));r.push(l);var u=l.color,c=4*s;o[c]=e$1S.floatToByte(u.red),o[c+1]=e$1S.floatToByte(u.green),o[c+2]=e$1S.floatToByte(u.blue),o[c+3]=e$1S.floatToByte(u.alpha)}e._pickTexture=ie$t(e,t,o),a.tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function Ye$b(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function e$10(e,t){this._content=e,this._batchId=t,this._color=void 0}function o$P(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function n$x(e,t,i,r,n,o){var a=e._cachedTypedArrays,s=a[t];return e$28(s)||(s=S$W.createArrayBufferView(i,e.buffer.buffer,e.buffer.byteOffset+o,n*r),a[t]=s),s}function A$P(e,t,i,r){var n=e._cachedTypedArrays,o=n[t];return e$28(o)||(o=S$W.createTypedArray(i,r),n[t]=o),o}function d$P(e,t,i){if(i=u$Y(i,!1)){var r=e.indexOf(t);if(r>-1)return r}return e.push(t),e.length-1}function i$D(e,t){return e$28(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}function e$$(){}function r$F(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}function p$G(e,t){var i=t.bufferView;if(e$28(i)){var r=e.bufferViews[i];if(e$28(r.byteStride)&&r.byteStride>0)return r.byteStride}return S$W.getSizeInBytes(t.componentType)*r$F(t.type)}function E$K(e){e$$.accessor(e,(function(e){e$28(e.bufferView)&&(e.byteOffset=u$Y(e.byteOffset,0))})),e$$.bufferView(e,(function(e){e$28(e.buffer)&&(e.byteOffset=u$Y(e.byteOffset,0))})),e$$.mesh(e,(function(t){e$$.meshPrimitive(t,(function(t){if(t.mode=u$Y(t.mode,de$y.TRIANGLES),!e$28(t.material)){e$28(e.materials)||(e.materials=[]);t.material=d$P(e.materials,{name:"default"})}}))})),e$$.accessorContainingVertexAttributeData(e,(function(t){var i=e.accessors[t],r=i.bufferView;if(i.normalized=u$Y(i.normalized,!1),e$28(r)){var n=e.bufferViews[r];n.byteStride=p$G(e,i),n.target=de$y.ARRAY_BUFFER}})),e$$.accessorContainingIndexData(e,(function(t){var i=e.accessors[t].bufferView;e$28(i)&&(e.bufferViews[i].target=de$y.ELEMENT_ARRAY_BUFFER)})),e$$.material(e,(function(e){var t=u$Y(e.extensions,u$Y.EMPTY_OBJECT),i=t.KHR_materials_common;if(e$28(i)){var r=i.technique,n=e$28(i.values)?i.values:{};return i.values=n,n.ambient=e$28(n.ambient)?n.ambient:[0,0,0,1],n.emission=e$28(n.emission)?n.emission:[0,0,0,1],n.transparency=u$Y(n.transparency,1),n.transparent=u$Y(n.transparent,!1),n.doubleSided=u$Y(n.doubleSided,!1),void("CONSTANT"!==r&&(n.diffuse=e$28(n.diffuse)?n.diffuse:[0,0,0,1],"LAMBERT"!==r&&(n.specular=e$28(n.specular)?n.specular:[0,0,0,1],n.shininess=u$Y(n.shininess,0))))}e.emissiveFactor=u$Y(e.emissiveFactor,[0,0,0]),e.alphaMode=u$Y(e.alphaMode,"OPAQUE"),e.doubleSided=u$Y(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=u$Y(e.alphaCutoff,.5)),e$28(t.KHR_techniques_webgl)&&e$$.materialValue(e,(function(e){e$28(e.index)&&d$O(e)})),d$O(e.emissiveTexture),d$O(e.normalTexture),d$O(e.occlusionTexture);var o=e.pbrMetallicRoughness;e$28(o)&&(o.baseColorFactor=u$Y(o.baseColorFactor,[1,1,1,1]),o.metallicFactor=u$Y(o.metallicFactor,1),o.roughnessFactor=u$Y(o.roughnessFactor,1),d$O(o.baseColorTexture),d$O(o.metallicRoughnessTexture));var a=t.pbrSpecularGlossiness;e$28(a)&&(a.diffuseFactor=u$Y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=u$Y(a.specularFactor,[1,1,1]),a.glossinessFactor=u$Y(a.glossinessFactor,1),d$O(a.specularGlossinessTexture))})),e$$.animation(e,(function(e){e$$.animationSampler(e,(function(e){e.interpolation=u$Y(e.interpolation,"LINEAR")}))}));var t=l$K(e);return e$$.node(e,(function(e,i){e$28(t[i])||e$28(e.translation)||e$28(e.rotation)||e$28(e.scale)?(e.translation=u$Y(e.translation,[0,0,0]),e.rotation=u$Y(e.rotation,[0,0,0,1]),e.scale=u$Y(e.scale,[1,1,1])):e.matrix=u$Y(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])})),e$$.sampler(e,(function(e){e.wrapS=u$Y(e.wrapS,de$y.REPEAT),e.wrapT=u$Y(e.wrapT,de$y.REPEAT)})),e$28(e.scenes)&&!e$28(e.scene)&&(e.scene=0),e}function l$K(e){var t={};return e$$.animation(e,(function(e){e$$.animationChannel(e,(function(e){var i=e.target,r=i.node,n=i.path;("translation"===n||"rotation"===n||"scale"===n)&&(t[r]=!0)}))})),t}function d$O(e){e$28(e)&&(e.texCoord=u$Y(e.texCoord,0))}function s$D(e){return e$$.shader(e,(function(e){n$w(e)})),e$$.buffer(e,(function(e){n$w(e)})),e$$.image(e,(function(e){n$w(e),e$$.compressedImage(e,(function(e){n$w(e)}))})),n$w(e),e}function n$w(e){e.extras=e$28(e.extras)?e.extras:{},e.extras._pipeline=e$28(e.extras._pipeline)?e.extras._pipeline:{}}function s$C(e,t){var i=e.extensionsRequired;if(e$28(i)){var r=i.indexOf(t);r>=0&&i.splice(r,1),0===i.length&&delete e.extensionsRequired}}function d$N(e,t){var i=e.extensionsUsed;if(e$28(i)){var r=i.indexOf(t);r>=0&&i.splice(r,1),s$C(e,t),0===i.length&&delete e.extensionsUsed}}h$D.prototype.addDerivedCommands=function(e,t){for(var i=e.commandList,r=i.length,n=this._content._tile,o=n._finalResolution,a=n.tileset,s=a._skipLevelOfDetail&&a._hasMixedContent&&e.context.stencilBuffer,l=Re$g(this),u=t;u<r;++u){var c=i[u],h=c.derivedCommands.tileset;(!e$28(h)||c.dirty)&&(h={},c.derivedCommands.tileset=h,h.originalCommand=Be$l(c),c.dirty=!1);var d=h.originalCommand;l!==x$N.ALL_OPAQUE&&c.pass!==Le$p.TRANSLUCENT&&(e$28(h.translucent)||(h.translucent=Me$j(d))),l!==x$N.ALL_TRANSLUCENT&&c.pass!==Le$p.TRANSLUCENT&&(e$28(h.opaque)||(h.opaque=Ue$j(d)),s&&(o||(e$28(h.zback)||(h.zback=Ve$i(e.context,d)),a._backfaceCommands.push(h.zback)),(!e$28(h.stencil)||n._selectionDepth!==He$e(h.stencil))&&(c.renderState.depthMask?h.stencil=Fe$e(d,n._selectionDepth):h.stencil=h.opaque)));var f=s?h.stencil:h.opaque,p=h.translucent;c.pass!==Le$p.TRANSLUCENT?(l===x$N.ALL_OPAQUE&&(i[u]=f),l===x$N.ALL_TRANSLUCENT&&(i[u]=p),l===x$N.OPAQUE_AND_TRANSLUCENT&&(i[u]=f,i.push(p))):i[u]=d}},h$D.prototype.update=function(e,t){var i=t.context;this._defaultTexture=i.defaultTexture;var r=t.passes;(r.pick||r.postProcess)&&Ke$b(this,i),this._batchValuesDirty&&(this._batchValuesDirty=!1,e$28(this._batchTexture)||(this._batchTexture=ie$t(this,i,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),Ye$b(this))},h$D.prototype.isDestroyed=function(){return!1},h$D.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return i$Z(this)},Object.defineProperties(e$10.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return e$28(this._color)||(this._color=new e$1S),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),e$10.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},e$10.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},e$10.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},e$10.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},e$10.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},e$10.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},e$10.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},o$P.prototype.getGlobalProperty=function(e,t,i){var r=this.json[e];if(e$28(r))return e$28(r.byteOffset)?n$x(this,e,t=u$Y(t,S$W.UNSIGNED_INT),i=u$Y(i,1),1,r.byteOffset):r},o$P.prototype.getPropertyArray=function(e,t,i){var r=this.json[e];if(e$28(r))return e$28(r.byteOffset)?(e$28(r.componentType)&&(t=S$W.fromName(r.componentType)),n$x(this,e,t,i,this.featuresLength,r.byteOffset)):A$P(this,e,t,r)},o$P.prototype.getProperty=function(e,t,i,r,n){if(e$28(this.json[e])){var o=this.getPropertyArray(e,t,i);if(1===i)return o[r];for(var a=0;a<i;++a)n[a]=o[i*r+a];return n}},e$$.objectLegacy=function(e,t){if(e$28(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t(e[i],i);if(e$28(r))return r}},e$$.object=function(e,t){if(e$28(e))for(var i=e.length,r=0;r<i;r++){var n=t(e[r],r);if(e$28(n))return n}},e$$.topLevel=function(e,t,i){var r=e[t];return e$28(r)&&!Array.isArray(r)?e$$.objectLegacy(r,i):e$$.object(r,i)},e$$.accessor=function(e,t){return e$$.topLevel(e,"accessors",t)},e$$.accessorWithSemantic=function(e,t,i){var r={};return e$$.mesh(e,(function(e){return e$$.meshPrimitive(e,(function(e){var n=e$$.meshPrimitiveAttribute(e,(function(e,n){if(0===n.indexOf(t)&&!e$28(r[e])){r[e]=!0;var o=i(e);if(e$28(o))return o}}));return e$28(n)?n:e$$.meshPrimitiveTarget(e,(function(e){return e$$.meshPrimitiveTargetAttribute(e,(function(e,n){if(0===n.indexOf(t)&&!e$28(r[e])){r[e]=!0;var o=i(e);if(e$28(o))return o}}))}))}))}))},e$$.accessorContainingVertexAttributeData=function(e,t){var i={};return e$$.mesh(e,(function(e){return e$$.meshPrimitive(e,(function(e){var r=e$$.meshPrimitiveAttribute(e,(function(e){if(!e$28(i[e])){i[e]=!0;var r=t(e);if(e$28(r))return r}}));return e$28(r)?r:e$$.meshPrimitiveTarget(e,(function(e){return e$$.meshPrimitiveTargetAttribute(e,(function(e){if(!e$28(i[e])){i[e]=!0;var r=t(e);if(e$28(r))return r}}))}))}))}))},e$$.accessorContainingIndexData=function(e,t){var i={};return e$$.mesh(e,(function(e){return e$$.meshPrimitive(e,(function(e){var r=e.indices;if(e$28(r)&&!e$28(i[r])){i[r]=!0;var n=t(r);if(e$28(n))return n}}))}))},e$$.animation=function(e,t){return e$$.topLevel(e,"animations",t)},e$$.animationChannel=function(e,t){var i=e.channels;return e$$.object(i,t)},e$$.animationSampler=function(e,t){var i=e.samplers;return e$$.object(i,t)},e$$.buffer=function(e,t){return e$$.topLevel(e,"buffers",t)},e$$.bufferView=function(e,t){return e$$.topLevel(e,"bufferViews",t)},e$$.camera=function(e,t){return e$$.topLevel(e,"cameras",t)},e$$.image=function(e,t){return e$$.topLevel(e,"images",t)},e$$.compressedImage=function(e,t){if(e$28(e.extras)){var i=e.extras.compressedImage3DTiles;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}}},e$$.material=function(e,t){return e$$.topLevel(e,"materials",t)},e$$.materialValue=function(e,t){var i=e.values;for(var r in e$28(e.extensions)&&e$28(e.extensions.KHR_techniques_webgl)&&(i=e.extensions.KHR_techniques_webgl.values),i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}},e$$.mesh=function(e,t){return e$$.topLevel(e,"meshes",t)},e$$.meshPrimitive=function(e,t){var i=e.primitives;if(e$28(i))for(var r=i.length,n=0;n<r;n++){var o=t(i[n],n);if(e$28(o))return o}},e$$.meshPrimitiveAttribute=function(e,t){var i=e.attributes;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}},e$$.meshPrimitiveTarget=function(e,t){var i=e.targets;if(e$28(i))for(var r=i.length,n=0;n<r;++n){var o=t(i[n],n);if(e$28(o))return o}},e$$.meshPrimitiveTargetAttribute=function(e,t){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t(e[i],i);if(e$28(r))return r}},e$$.node=function(e,t){return e$$.topLevel(e,"nodes",t)},e$$.nodeInTree=function(e,t,i){var r=e.nodes;if(e$28(r))for(var n=t.length,o=0;o<n;o++){var a=t[o],s=r[a];if(e$28(s)){var l=i(s,a);if(e$28(l))return l;var u=s.children;if(e$28(u)&&e$28(l=e$$.nodeInTree(e,u,i)))return l}}},e$$.nodeInScene=function(e,t,i){var r=t.nodes;if(e$28(r))return e$$.nodeInTree(e,r,i)},e$$.program=function(e,t){return i$D(e,"KHR_techniques_webgl")?e$$.object(e.extensions.KHR_techniques_webgl.programs,t):e$$.topLevel(e,"programs",t)},e$$.sampler=function(e,t){return e$$.topLevel(e,"samplers",t)},e$$.scene=function(e,t){return e$$.topLevel(e,"scenes",t)},e$$.shader=function(e,t){return i$D(e,"KHR_techniques_webgl")?e$$.object(e.extensions.KHR_techniques_webgl.shaders,t):e$$.topLevel(e,"shaders",t)},e$$.skin=function(e,t){return e$$.topLevel(e,"skins",t)},e$$.skinJoint=function(e,t){var i=e.joints;if(e$28(i))for(var r=i.length,n=0;n<r;n++){var o=t(i[n]);if(e$28(o))return o}},e$$.techniqueAttribute=function(e,t){var i=e.attributes;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}},e$$.techniqueUniform=function(e,t){var i=e.uniforms;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}},e$$.techniqueParameter=function(e,t){var i=e.parameters;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(e$28(n))return n}},e$$.technique=function(e,t){return i$D(e,"KHR_techniques_webgl")?e$$.object(e.extensions.KHR_techniques_webgl.techniques,t):e$$.topLevel(e,"techniques",t)},e$$.texture=function(e,t){return e$$.topLevel(e,"textures",t)};var x$M=4;function O$z(e){if("glTF"!==a$U(e))throw new t$U("File is not valid binary glTF");var t=d$M(e,0,5),i=t[1];if(1!==i&&2!==i)throw new t$U("Binary glTF version is not 1 or 2");return 1===i?S$x(e,t):T$C(e,t)}function d$M(e,t,i){for(var r=new DataView(e.buffer),n=new Array(i),o=0;o<i;++o)n[o]=r.getUint32(e.byteOffset+t+o*x$M,!0);return n}function S$x(e,t){var i=t[2],r=t[3];if(0!==t[4])throw new t$U("Binary glTF scene format is not JSON");var n=20+r,o=a$Z(e,20,r),a=JSON.parse(o);s$D(a);var s=e.subarray(n,i),l=a.buffers;if(e$28(l)&&Object.keys(l).length>0){var u=u$Y(l.binary_glTF,l.KHR_binary_glTF);e$28(u)&&(u.extras._pipeline.source=s)}return d$N(a,"KHR_binary_glTF"),a}function T$C(e,t){for(var i,r,n=t[2],o=12;o<n;){var a=d$M(e,o,2),s=a[0],l=a[1];o+=8;var u=e.subarray(o,o+s);if(o+=s,1313821514===l){var c=a$Z(u);s$D(i=JSON.parse(c))}else 5130562===l&&(r=u)}if(e$28(i)&&e$28(r)){var h=i.buffers;if(e$28(h)&&h.length>0)h[0].extras._pipeline.source=r}return i}function i$C(e,t){var i=e.extensionsUsed;e$28(i)||(i=[],e.extensionsUsed=i),d$P(i,t,!0)}function c$G(e){switch(e){case S$W.BYTE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt8(t+o*r)};case S$W.UNSIGNED_BYTE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint8(t+o*r)};case S$W.SHORT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt16(t+o*r,!0)};case S$W.UNSIGNED_SHORT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint16(t+o*r,!0)};case S$W.INT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getInt32(t+o*r,!0)};case S$W.UNSIGNED_INT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getUint32(t+o*r,!0)};case S$W.FLOAT:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getFloat32(t+o*r,!0)};case S$W.DOUBLE:return function(e,t,i,r,n){for(var o=0;o<i;++o)n[o]=e.getFloat64(t+o*r,!0)}}}function B$y(e,t){var i=e.bufferViews,r=e.buffers,n=t.bufferView,o=r$F(t.type);if(!e$28(t.bufferView))return{min:d$1a(new Array(o),0),max:d$1a(new Array(o),0)};for(var a=d$1a(new Array(o),Number.POSITIVE_INFINITY),s=d$1a(new Array(o),Number.NEGATIVE_INFINITY),l=i[n],u=r[l.buffer].extras._pipeline.source,c=t.count,h=p$G(e,t),d=t.byteOffset+l.byteOffset+u.byteOffset,f=t.componentType,p=S$W.getSizeInBytes(f),_=new DataView(u.buffer),m=new Array(o),$=c$G(f),g=0;g<c;g++){$(_,d,o,p,m);for(var v=0;v<o;v++){var y=m[v];a[v]=Math.min(a[v],y),s[v]=Math.max(s[v],y)}d+=h}return{min:a,max:s}}var E$J=[de$y.FUNC_ADD,de$y.FUNC_ADD],p$F=[de$y.ONE,de$y.ZERO,de$y.ONE,de$y.ZERO];function O$y(e,t){var i=e.enable;return!!e$28(i)&&i.indexOf(t)>-1}var N$x=[de$y.ZERO,de$y.ONE,de$y.SRC_COLOR,de$y.ONE_MINUS_SRC_COLOR,de$y.SRC_ALPHA,de$y.ONE_MINUS_SRC_ALPHA,de$y.DST_ALPHA,de$y.ONE_MINUS_DST_ALPHA,de$y.DST_COLOR,de$y.ONE_MINUS_DST_COLOR];function L$M(e,t){if(!e$28(e))return t;for(var i=0;i<4;i++)if(-1===N$x.indexOf(e[i]))return t;return e}function R$C(e){var t={},i={};return e$28(e.techniques)&&(e$$.technique(e,(function(e,r){var n=e.states;if(e$28(n)){var o=i[r]={};if(O$y(n,de$y.BLEND)){o.alphaMode="BLEND";var a=n.functions;e$28(a)&&(e$28(a.blendEquationSeparate)||e$28(a.blendFuncSeparate))&&(t[r]={blendEquation:u$Y(a.blendEquationSeparate,E$J),blendFactors:L$M(a.blendFuncSeparate,p$F)})}O$y(n,de$y.CULL_FACE)||(o.doubleSided=!0),delete e.states}})),Object.keys(t).length>0&&(e$28(e.extensions)||(e.extensions={}),i$C(e,"KHR_blend")),e$$.material(e,(function(e){if(e$28(e.technique)){var r=i[e.technique];e$$.objectLegacy(r,(function(t,i){e[i]=t}));var n=t[e.technique];e$28(n)&&(e$28(e.extensions)||(e.extensions={}),e.extensions.KHR_blend=n)}}))),e}function s$B(e,t){var i=e.extensionsRequired;e$28(i)||(i=[],e.extensionsRequired=i),d$P(i,t,!0),i$C(e,t)}function R$B(e){var t=e.techniques,i={},r={};if(e$28(t)){var n={programs:[],shaders:[],techniques:[]},o=e.glExtensionsUsed;delete e.glExtensionsUsed,e$$.technique(e,(function(t,a){var s,l={name:t.name,program:void 0,attributes:{},uniforms:{}};e$$.techniqueAttribute(t,(function(e,i){s=t.parameters[e],l.attributes[i]={semantic:s.semantic}})),e$$.techniqueUniform(t,(function(e,r){s=t.parameters[e],l.uniforms[r]={count:s.count,node:s.node,type:s.type,semantic:s.semantic,value:s.value},i[e]=r}));var u=e.programs[t.program],c={name:u.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:o},h=e.shaders[u.fragmentShader];c.fragmentShader=d$P(n.shaders,h,!0);var d=e.shaders[u.vertexShader];c.vertexShader=d$P(n.shaders,d,!0),l.program=d$P(n.programs,c),r[a]=d$P(n.techniques,l)})),n.techniques.length>0&&(e$28(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=n,i$C(e,"KHR_techniques_webgl"),s$B(e,"KHR_techniques_webgl"))}return e$$.material(e,(function(e){if(e$28(e.technique)){var t={technique:r[e.technique]};e$$.objectLegacy(e.values,(function(e,r){e$28(t.values)||(t.values={});var n=i[r];t.values[n]=e})),e$28(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=t}delete e.technique,delete e.values})),delete e.techniques,delete e.programs,delete e.shaders,e}var b$O=["mesh","node","material","accessor","bufferView","buffer"];function d$L(e,t){return t=u$Y(t,b$O),b$O.forEach((function(i){t.indexOf(i)>-1&&p$E(e,i)})),e}var _$D={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",node:"nodes",material:"materials",mesh:"meshes"};function p$E(e,t){var i=e[_$D[t]];if(e$28(i))for(var r=0,n=m$H[t](e),o=i.length,a=0;a<o;++a)n[a]||(a$F[t](e,a-r),r++)}function a$F(){}function m$H(){}function v$A(e,t){return!(e$28(t.mesh)||e$28(t.camera)||e$28(t.skin)||e$28(t.weights)||e$28(t.extras)||e$28(t.extensions)&&0!==t.extensions.length)&&(!e$28(t.children)||0===t.children.filter((function(t){return!v$A(e,e.nodes[t])})).length)}function a$E(e,t){var i={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:d$P(e.buffers,i),byteOffset:0,byteLength:t.length};return d$P(e.bufferViews,r)}function T$B(e,t){var i=p$G(e,t),r=S$W.getSizeInBytes(t.componentType),n=r$F(t.type),o=t.count,a=new Array(n*o);if(!e$28(t.bufferView))return d$1a(a,0),a;for(var s=e.bufferViews[t.bufferView],l=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+l.byteOffset,c=new DataView(l.buffer),h=new Array(n),d=c$G(t.componentType),f=0;f<o;++f){d(c,u,n,r,h);for(var p=0;p<n;++p)a[f*n+p]=h[p];u+=i}return a}function T$A(e){var t;return e$$.accessorWithSemantic(e,"JOINTS_0",(function(i){var r=e.accessors[i];(t=r.componentType)===de$y.BYTE?t$w(e,r,S$W.UNSIGNED_BYTE):t!==de$y.UNSIGNED_BYTE&&t!==de$y.UNSIGNED_SHORT&&t$w(e,r,S$W.UNSIGNED_SHORT)})),e$$.accessorWithSemantic(e,"WEIGHTS_0",(function(i){var r=e.accessors[i];(t=r.componentType)===de$y.BYTE?t$w(e,r,S$W.UNSIGNED_BYTE):t===de$y.SHORT&&t$w(e,r,S$W.UNSIGNED_SHORT)})),e}function t$w(e,t,i){var r=S$W.createTypedArray(i,T$B(e,t)),n=new Uint8Array(r.buffer);t.bufferView=a$E(e,n),t.componentType=i,t.byteOffset=0}a$F.accessor=function(e,t){e.accessors.splice(t,1),e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$$.meshPrimitiveAttribute(e,(function(i,r){i>t&&e.attributes[r]--})),e$$.meshPrimitiveTarget(e,(function(e){e$$.meshPrimitiveTargetAttribute(e,(function(i,r){i>t&&e[r]--}))}));var i=e.indices;e$28(i)&&i>t&&e.indices--}))})),e$$.skin(e,(function(e){e$28(e.inverseBindMatrices)&&e.inverseBindMatrices>t&&e.inverseBindMatrices--})),e$$.animation(e,(function(e){e$$.animationSampler(e,(function(e){e$28(e.input)&&e.input>t&&e.input--,e$28(e.output)&&e.output>t&&e.output--}))}))},a$F.buffer=function(e,t){e.buffers.splice(t,1),e$$.bufferView(e,(function(e){e$28(e.buffer)&&e.buffer>t&&e.buffer--}))},a$F.bufferView=function(e,t){e.bufferViews.splice(t,1),e$$.accessor(e,(function(e){e$28(e.bufferView)&&e.bufferView>t&&e.bufferView--})),e$$.shader(e,(function(e){e$28(e.bufferView)&&e.bufferView>t&&e.bufferView--})),e$$.image(e,(function(e){e$28(e.bufferView)&&e.bufferView>t&&e.bufferView--,e$$.compressedImage(e,(function(e){var i=e.bufferView;e$28(i)&&i>t&&e.bufferView--}))})),i$D(e,"KHR_draco_mesh_compression")&&e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$28(e.extensions)&&e$28(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>t&&e.extensions.KHR_draco_mesh_compression.bufferView--}))}))},a$F.mesh=function(e,t){e.meshes.splice(t,1),e$$.node(e,(function(e){e$28(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)}))},a$F.node=function(e,t){e.nodes.splice(t,1),e$$.skin(e,(function(e){e$28(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map((function(e){return e>t?e-1:e}))})),e$$.animation(e,(function(e){e$$.animationChannel(e,(function(e){e$28(e.target)&&e$28(e.target.node)&&e.target.node>t&&e.target.node--}))})),e$$.technique(e,(function(e){e$$.techniqueUniform(e,(function(e){e$28(e.node)&&e.node>t&&e.node--}))})),e$$.node(e,(function(e){!e$28(e.children)||(e.children=e.children.filter((function(e){return e!==t})).map((function(e){return e>t?e-1:e})))})),e$$.scene(e,(function(e){e.nodes=e.nodes.filter((function(e){return e!==t})).map((function(e){return e>t?e-1:e}))}))},a$F.material=function(e,t){e.materials.splice(t,1),e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$28(e.material)&&e.material>t&&e.material--}))}))},m$H.accessor=function(e){var t={};return e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$$.meshPrimitiveAttribute(e,(function(e){t[e]=!0})),e$$.meshPrimitiveTarget(e,(function(e){e$$.meshPrimitiveTargetAttribute(e,(function(e){t[e]=!0}))}));var i=e.indices;e$28(i)&&(t[i]=!0)}))})),e$$.skin(e,(function(e){e$28(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)})),e$$.animation(e,(function(e){e$$.animationSampler(e,(function(e){e$28(e.input)&&(t[e.input]=!0),e$28(e.output)&&(t[e.output]=!0)}))})),t},m$H.buffer=function(e){var t={};return e$$.bufferView(e,(function(e){e$28(e.buffer)&&(t[e.buffer]=!0)})),t},m$H.bufferView=function(e){var t={};return e$$.accessor(e,(function(e){e$28(e.bufferView)&&(t[e.bufferView]=!0)})),e$$.shader(e,(function(e){e$28(e.bufferView)&&(t[e.bufferView]=!0)})),e$$.image(e,(function(e){e$28(e.bufferView)&&(t[e.bufferView]=!0),e$$.compressedImage(e,(function(e){e$28(e.bufferView)&&(t[e.bufferView]=!0)}))})),i$D(e,"KHR_draco_mesh_compression")&&e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$28(e.extensions)&&e$28(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)}))})),t},m$H.mesh=function(e){var t={};return e$$.node(e,(function(i){if(e$28(i.mesh&&e$28(e.meshes))){var r=e.meshes[i.mesh];e$28(r)&&e$28(r.primitives)&&r.primitives.length>0&&(t[i.mesh]=!0)}})),t},m$H.node=function(e){var t={};return e$$.node(e,(function(i,r){v$A(e,i)||(t[r]=!0)})),e$$.skin(e,(function(e){e$28(e.skeleton)&&(t[e.skeleton]=!0),e$$.skinJoint(e,(function(e){t[e]=!0}))})),e$$.animation(e,(function(e){e$$.animationChannel(e,(function(e){e$28(e.target)&&e$28(e.target.node)&&(t[e.target.node]=!0)}))})),e$$.technique(e,(function(e){e$$.techniqueUniform(e,(function(e){e$28(e.node)&&(t[e.node]=!0)}))})),t},m$H.material=function(e){var t={};return e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$28(e.material)&&(t[e.material]=!0)}))})),t};var V$w={.8:se$n,"1.0":Re$f,"2.0":void 0};function re$q(e,t){var i=(t=u$Y(t,u$Y.EMPTY_OBJECT)).targetVersion,r=e.version;e.asset=u$Y(e.asset,{version:"1.0"}),e.asset.version=u$Y(e.asset.version,"1.0"),r=u$Y(r,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(V$w,r)||(e$28(r)&&(r=r.substring(0,3)),Object.prototype.hasOwnProperty.call(V$w,r)||(r="1.0"));for(var n=V$w[r];e$28(n)&&r!==i;)n(e,t),r=e.asset.version,n=V$w[r];return e}function F$Q(e){var t=e.materials;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.instanceTechnique;e$28(n)&&(r.technique=n.technique,r.values=n.values,delete r.instanceTechnique)}}function ie$s(e){var t=e.meshes;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i].primitives;if(e$28(r))for(var n=r.length,o=0;o<n;++o){var a=r[o],s=u$Y(a.primitive,de$y.TRIANGLES);a.mode=u$Y(a.mode,s),delete a.primitive}}}function ne$x(e){var t=e.nodes,i=new t$X,r=new n$14;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var o=t[n];if(e$28(o.rotation)){var a=o.rotation;t$X.fromArray(a,0,i),n$14.fromAxisAngle(i,a[3],r),o.rotation=[r.x,r.y,r.z,r.w]}var s=o.instanceSkin;e$28(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function te$v(e){var t=e.animations,i=e.accessors,r=e.bufferViews,n=e.buffers,o={},a=new t$X,s=new n$14;for(var l in t)if(Object.prototype.hasOwnProperty.call(t,l)){var u=t[l],c=u.channels,h=u.parameters,d=u.samplers;if(e$28(c))for(var f=c.length,p=0;p<f;++p){var _=c[p];if("rotation"===_.target.path){var m=h[d[_.sampler].output];if(e$28(o[m]))continue;o[m]=!0;for(var $=i[m],g=r[$.bufferView],v=n[g.buffer].extras._pipeline.source,y=v.byteOffset+g.byteOffset+$.byteOffset,x=$.componentType,b=$.count,w=r$F($.type),C=$.count*w,T=S$W.createArrayBufferView(x,v.buffer,y,C),S=0;S<b;S++){var E=S*w;t$X.unpack(T,E,a);var A=T[E+3];n$14.fromAxisAngle(a,A,s),n$14.pack(s,T,E)}}}}}function ae$p(e){var t=e.techniques;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.passes;if(e$28(n)){var o=u$Y(r.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(n,o)){var a=n[o],s=a.instanceProgram;r.attributes=u$Y(r.attributes,s.attributes),r.program=u$Y(r.program,s.program),r.uniforms=u$Y(r.uniforms,s.uniforms),r.states=u$Y(r.states,a.states)}delete r.passes,delete r.pass}}}function se$n(e){e$28(e.asset)||(e.asset={});var t=e.asset;if(t.version="1.0","string"==typeof t.profile){var i=t.profile.split(" ");t.profile={api:i[0],version:i[1]}}else t.profile={};if(e$28(e.version)&&delete e.version,F$Q(e),ie$s(e),ne$x(e),te$v(e),ae$p(e),e$28(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),e$28(e.lights)){var r=u$Y(e.extensions,{});e.extensions=r;var n=u$Y(r.KHR_materials_common,{});r.KHR_materials_common=n,n.lights=e.lights,delete e.lights,i$C(e,"KHR_materials_common")}}function oe$o(e){var t=e.animations;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.parameters;if(e$28(n)){var o=r.samplers;for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)){var s=o[a];s.input=n[s.input],s.output=n[s.output]}delete r.parameters}}}function K$A(e,t){var i=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t[r]=i.length,i.push(n),e$28(n.name)||(n.name=r)}return i}function fe$m(e){var t,i,r={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},n={},o=e.nodes;for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(e$28(i=o[a].jointName)&&(n[i]=a));for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e$28(r[s])){var l={},u=e[s];e[s]=K$A(u,l),r[s]=l}for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(n[i]=r.nodes[n[i]]);e$28(e.scene)&&(e.scene=r.scenes[e.scene]),e$$.bufferView(e,(function(e){e$28(e.buffer)&&(e.buffer=r.buffers[e.buffer])})),e$$.accessor(e,(function(e){e$28(e.bufferView)&&(e.bufferView=r.bufferViews[e.bufferView])})),e$$.shader(e,(function(e){var t=e.extensions;if(e$28(t)){var i=t.KHR_binary_glTF;e$28(i)&&(e.bufferView=r.bufferViews[i.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}})),e$$.program(e,(function(e){e$28(e.vertexShader)&&(e.vertexShader=r.shaders[e.vertexShader]),e$28(e.fragmentShader)&&(e.fragmentShader=r.shaders[e.fragmentShader])})),e$$.technique(e,(function(e){e$28(e.program)&&(e.program=r.programs[e.program]),e$$.techniqueParameter(e,(function(e){e$28(e.node)&&(e.node=r.nodes[e.node]);var t=e.value;"string"==typeof t&&(e.value={index:r.textures[t]})}))})),e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$28(e.indices)&&(e.indices=r.accessors[e.indices]),e$$.meshPrimitiveAttribute(e,(function(t,i){e.attributes[i]=r.accessors[t]})),e$28(e.material)&&(e.material=r.materials[e.material])}))})),e$$.node(e,(function(i){var n=i.children;if(e$28(n)){var o=n.length;for(t=0;t<o;++t)n[t]=r.nodes[n[t]]}if(e$28(i.meshes)){var a=i.meshes,s=a.length;if(s>0)for(i.mesh=r.meshes[a[0]],t=1;t<s;++t){var l={mesh:r.meshes[a[t]]},u=d$P(e.nodes,l);e$28(n)||(n=[],i.children=n),n.push(u)}delete i.meshes}if(e$28(i.camera)&&(i.camera=r.cameras[i.camera]),e$28(i.skin)&&(i.skin=r.skins[i.skin]),e$28(i.skeletons)){var c=i.skeletons;if(c.length>0&&e$28(i.skin))e.skins[i.skin].skeleton=r.nodes[c[0]];delete i.skeletons}e$28(i.jointName)&&delete i.jointName})),e$$.skin(e,(function(e){e$28(e.inverseBindMatrices)&&(e.inverseBindMatrices=r.accessors[e.inverseBindMatrices]);var i=e.jointNames;if(e$28(i)){var o=[],a=i.length;for(t=0;t<a;++t)o[t]=n[i[t]];e.joints=o,delete e.jointNames}})),e$$.scene(e,(function(e){var i=e.nodes;if(e$28(i)){var n=i.length;for(t=0;t<n;++t)i[t]=r.nodes[i[t]]}})),e$$.animation(e,(function(e){var t={};e.samplers=K$A(e.samplers,t),e$$.animationSampler(e,(function(e){e.input=r.accessors[e.input],e.output=r.accessors[e.output]})),e$$.animationChannel(e,(function(e){e.sampler=t[e.sampler];var i=e.target;e$28(i)&&(i.node=r.nodes[i.id],delete i.id)}))})),e$$.material(e,(function(e){e$28(e.technique)&&(e.technique=r.techniques[e.technique]),e$$.materialValue(e,(function(t,i){"string"==typeof t&&(e.values[i]={index:r.textures[t]})}));var t=e.extensions;if(e$28(t)){var i=t.KHR_materials_common;e$28(i)&&e$$.materialValue(i,(function(e,t){"string"==typeof e&&(i.values[t]={index:r.textures[e]})}))}})),e$$.image(e,(function(e){var t=e.extensions;if(e$28(t)){var i=t.KHR_binary_glTF;e$28(i)&&(e.bufferView=r.bufferViews[i.bufferView],e.mimeType=i.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}e$$.compressedImage(e,(function(e){var i=e.extensions;if(e$28(i)){var n=i.KHR_binary_glTF;e$28(n)&&(e.bufferView=r.bufferViews[n.bufferView],e.mimeType=n.mimeType,delete i.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}))})),e$$.texture(e,(function(e){e$28(e.sampler)&&(e.sampler=r.samplers[e.sampler]),e$28(e.source)&&(e.source=r.images[e.source])}))}function ue$l(e){e$$.animation(e,(function(e){e$$.animationSampler(e,(function(e){delete e.name}))}))}function ve$i(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];Array.isArray(i)&&0===i.length&&delete e[t]}e$$.node(e,(function(e){e$28(e.children)&&0===e.children.length&&delete e.children}))}function ce$l(e){var t=e.asset;delete t.profile,delete t.premultipliedAlpha}var me$n={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function pe$p(e){var t=e.extensionsUsed;if(e.extensionsRequired=u$Y(e.extensionsRequired,[]),e$28(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];e$28(me$n[n])&&e.extensionsRequired.push(n)}}function be$l(e){e$$.buffer(e,(function(e){delete e.type}))}function he$k(e){e$$.texture(e,(function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type}))}function ye$k(e){e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){e$$.meshPrimitiveAttribute(e,(function(t,i){"TEXCOORD"===i?e.attributes.TEXCOORD_0=t:"COLOR"===i&&(e.attributes.COLOR_0=t)})),delete e.attributes.TEXCOORD,delete e.attributes.COLOR}))})),e$$.technique(e,(function(e){e$$.techniqueParameter(e,(function(e){var t=e.semantic;e$28(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))}))}))}var Oe$h={POSITION:!0,NORMAL:!0,TANGENT:!0},le$o={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function de$k(e){var t={};e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){for(var i in e$$.meshPrimitiveAttribute(e,(function(e,i){if("_"!==i.charAt(0)){var r=i.search(/_[0-9]+/g),n=i,o="_0";r>=0&&(n=i.substring(0,r),o=i.substring(r));var a,s=le$o[n];e$28(s)?(a=s+o,t[i]=a):e$28(Oe$h[n])||(a="_"+i,t[i]=a)}})),t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=e.attributes[i];e$28(n)&&(delete e.attributes[i],e.attributes[r]=n)}}))})),e$$.technique(e,(function(e){e$$.techniqueParameter(e,(function(e){var i=t[e.semantic];e$28(i)&&(e.semantic=i)}))}))}function Te$j(e){e$$.camera(e,(function(e){var t=e.perspective;if(e$28(t)){var i=t.aspectRatio;e$28(i)&&0===i&&delete t.aspectRatio;var r=t.yfov;e$28(r)&&0===r&&(t.yfov=1)}}))}function C$E(e,t){return e$28(t.byteStride)&&0!==t.byteStride?t.byteStride:p$G(e,t)}function we$j(e){e$$.buffer(e,(function(e){e$28(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)})),e$$.accessor(e,(function(t){var i=t.bufferView;if(e$28(i)){var r=e.bufferViews[i],n=C$E(e,t),o=t.byteOffset+t.count*n;r.byteLength=Math.max(u$Y(r.byteLength,0),o)}}))}function xe$l(e){var t,i,r,n=e.bufferViews,o={};e$$.accessorContainingVertexAttributeData(e,(function(t){var i=e.accessors[t];e$28(i.bufferView)&&(o[i.bufferView]=!0)}));var a={};for(var s in e$$.accessor(e,(function(e){e$28(e.bufferView)&&(a[e.bufferView]=u$Y(a[e.bufferView],[]),a[e.bufferView].push(e))})),a)if(Object.prototype.hasOwnProperty.call(a,s)){r=n[s];var l=a[s];l.sort((function(e,t){return e.byteOffset-t.byteOffset}));var u=0,c=0,h=l.length;for(t=0;t<h;++t){var d=l[t],f=C$E(e,d),p=d.byteOffset,_=d.count*f;delete d.byteStride;var m=t<h-1;if(f!==(m?C$E(e,l[t+1]):void 0)){var $=l$1e(r,!0);o[s]&&($.byteStride=f),$.byteOffset+=u,$.byteLength=p+_-u;var g=d$P(n,$);for(i=c;i<=t;++i)(d=l[i]).bufferView=g,d.byteOffset=d.byteOffset-u;u=m?l[t+1].byteOffset:void 0,c=t+1}}}d$L(e,["accessor","bufferView","buffer"])}function Ae$k(e){e$$.accessorWithSemantic(e,"POSITION",(function(t){var i=e.accessors[t];if(!e$28(i.min)||!e$28(i.max)){var r=B$y(e,i);i.min=r.min,i.max=r.max}}))}function D$M(e){return(!e$28(e.children)||0===e.children.length)&&(!e$28(e.meshes)||0===e.meshes.length)&&!e$28(e.camera)&&!e$28(e.skin)&&!e$28(e.skeletons)&&!e$28(e.jointName)&&(!e$28(e.translation)||t$X.fromArray(e.translation).equals(t$X.ZERO))&&(!e$28(e.scale)||t$X.fromArray(e.scale).equals(new t$X(1,1,1)))&&(!e$28(e.rotation)||e$25.fromArray(e.rotation).equals(new e$25(0,0,0,1)))&&(!e$28(e.matrix)||y$15.fromColumnMajorArray(e.matrix).equals(y$15.IDENTITY))&&!e$28(e.extensions)&&!e$28(e.extras)}function L$L(e,t){e$$.scene(e,(function(e){var i=e.nodes;if(e$28(i))for(var r=i.length;r>=0;--r)if(i[r]===t)return void i.splice(r,1)})),e$$.node(e,(function(i,r){if(e$28(i.children)){var n=i.children.indexOf(t);n>-1&&(i.children.splice(n,1),D$M(i)&&L$L(e,r))}})),delete e.nodes[t]}function _e$j(e){return e$$.node(e,(function(t,i){D$M(t)&&L$L(e,i)})),e}function Pe$g(e){e$$.animation(e,(function(t){e$$.animationSampler(t,(function(t){var i=e.accessors[t.input];if(!e$28(i.min)||!e$28(i.max)){var r=B$y(e,i);i.min=r.min,i.max=r.max}}))}))}function Re$f(e){e.asset=u$Y(e.asset,{}),e.asset.version="2.0",F$Q(e),oe$o(e),_e$j(e),fe$m(e),ue$l(e),ce$l(e),pe$p(e),we$j(e),xe$l(e),Ae$k(e),Pe$g(e),be$l(e),he$k(e),ye$k(e),de$k(e),T$A(e),Te$j(e),R$C(e),R$B(e),ve$i(e)}function t$v(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new r$_,this.indexBuffersToCreate=new r$_,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new r$_,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new r$_,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new r$_,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new r$_,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function s$A(e,t,i){return e.subarray(t,t+i)}t$v.prototype.getBuffer=function(e){return s$A(this.buffers[e.buffer],e.byteOffset,e.byteLength)},t$v.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},t$v.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},t$v.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},t$v.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},t$v.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return this.finishedDecoding()&&e&&t},t$v.prototype.finishedDecoding=function(){return 0===this.primitivesToDecode.length&&0===this.activeDecodingTasks&&!this.pendingDecodingCache},t$v.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var s$z={updateForwardAxis:function(e){var t=e.gltf.extras.sourceVersion;(e$28(t)&&"2.0"!==t||"2.0"!==s$z.getAssetVersion(e.gltf))&&(e._gltfForwardAxis=z$z.X)},getAssetVersion:function(e){return e$28(e.asset)&&e$28(e.asset.version)?e.asset.version:"1.0"},splitIncompatibleMaterials:function(e){var t=e.accessors,i=e.materials,r={};return e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){var n,o,a=e.material,s=i[a],l=e.attributes.JOINTS_0;if(e$28(l)){var u=t[l];n=u.componentType,o=u.type}var c=e$28(l),h=e$28(e.attributes.COLOR_0),d=e$28(e.targets),f=e$28(e.attributes.NORMAL),p=e$28(e.attributes.TANGENT),_=e$28(e.attributes.TEXCOORD_0),m=_&&e$28(e.attributes.TEXCOORD_1),$=r[a];if(e$28($)){if($.skinning.skinned!==c||$.skinning.type!==o||$.hasVertexColors!==h||$.hasMorphTargets!==d||$.hasNormals!==f||$.hasTangents!==p||$.hasTexCoords!==_||$.hasTexCoord1!==m){var g=l$1e(s,!0);a=d$P(i,g),e.material=a,r[a]={skinning:{skinned:c,componentType:n,type:o},hasVertexColors:h,hasMorphTargets:d,hasNormals:f,hasTangents:p,hasTexCoords:_,hasTexCoord1:m}}}else r[a]={skinning:{skinned:c,componentType:n,type:o},hasVertexColors:h,hasMorphTargets:d,hasNormals:f,hasTangents:p,hasTexCoords:_,hasTexCoord1:m}}))})),r},getShaderVariable:function(e){return"SCALAR"===e?"float":e.toLowerCase()},ModelState:{NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},getFailedLoadFunction:function(e,t,i){return function(r){e._state=s$z.ModelState.FAILED;var n="Failed to load "+t+": "+i;e$28(r)&&(n+="\n"+r.message),e._readyPromise.reject(new t$U(n))}},parseBuffers:function(e,t){var i=e._loadResources;e$$.buffer(e.gltf,(function(r,n){if(e$28(r.extras._pipeline.source))i.buffers[n]=r.extras._pipeline.source;else if(e$28(t)){var o=e._resource.getDerivedResource({url:r.uri});++i.pendingBufferLoads,o.fetchArrayBuffer().then(t(e,n)).otherwise(s$z.getFailedLoadFunction(e,"buffer",o.url))}}))}},cn$2=new t$X,fn$2=new t$X;function vn$2(e,t){return e$$.techniqueAttribute(e,(function(e,i){if(e.semantic===t)return i}))}function _n$2(e,t){var i=e.accessors,r=e.materials,n=e.extensions.KHR_techniques_webgl,o=n.techniques,a=n.programs,s=n.shaders,l=t.targets,u=t.attributes;for(var c in l)if(l.hasOwnProperty(c)){var h=l[c];for(var d in h)"extras"!==d&&(u[d+"_"+c]=h[d])}var f=o[r[t.material].extensions.KHR_techniques_webgl.technique],p=s[a[f.program].vertexShader];for(var _ in u)if(u.hasOwnProperty(_)&&!e$28(vn$2(f,_))){var m=i[u[_]],$=_.toLowerCase();"_"===$.charAt(0)&&($=$.slice(1));var g="a_"+$;f.attributes[g]={semantic:_,type:m.componentType};var v=p.extras._pipeline,y=v.source;y="attribute "+s$z.getShaderVariable(m.type)+" "+g+";\n"+y,v.source=y}}function tn$4(e,t,i,r){return i$D(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==i||r&&e$28(e.node)))return t}:function(e,n){var o=t.parameters[e];if(!(o.semantic!==i||r&&e$28(o.node)))return n}}s$z.computeBoundingSphere=function(e){for(var t=e.gltf,i=t.nodes,r=t.meshes,n=t.scenes[t.scene].nodes,o=n.length,a=[],s=new t$X(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new t$X(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),u=0;u<o;++u){var c=i[n[u]];for(c._transformToRoot=s$z.getTransform(c),a.push(c);a.length>0;){var h=(c=a.pop())._transformToRoot,d=c.mesh;if(e$28(d))for(var f=r[d].primitives,p=f.length,_=0;_<p;++_){var m=f[_].attributes.POSITION;if(e$28(m)){var $=s$z.getAccessorMinMax(t,m),g=t$X.fromArray($.min,0,cn$2),v=t$X.fromArray($.max,0,fn$2);e$28(s)&&e$28(l)&&(y$15.multiplyByPoint(h,g,g),y$15.multiplyByPoint(h,v,v),t$X.minimumByComponent(s,g,s),t$X.maximumByComponent(l,v,l))}}var y=c.children;if(e$28(y))for(var x=y.length,b=0;b<x;++b){var w=i[y[b]];w._transformToRoot=s$z.getTransform(w),y$15.multiplyTransformation(h,w._transformToRoot,w._transformToRoot),a.push(w)}delete c._transformToRoot}}var C=i$19.fromCornerPoints(s,l);return e._minCorner=s,e._maxCorner=l,e._forwardAxis===z$z.Z&&i$19.transformWithoutScale(C,z$z.Z_UP_TO_X_UP,C),e._upAxis===z$z.Y?i$19.transformWithoutScale(C,z$z.Y_UP_TO_Z_UP,C):e._upAxis===z$z.X&&i$19.transformWithoutScale(C,z$z.X_UP_TO_Z_UP,C),C},s$z.ensureSemanticExistence=function(e){return e$$.mesh(e,(function(t){e$$.meshPrimitive(t,(function(t){_n$2(e,t)}))})),e},s$z.createAttributeLocations=function(e,t){var i={},r=!1,n=1;if(e$$.techniqueAttribute(e,(function(e,t){/pos/i.test(t)&&!r?(i[t]=0,r=!0):i[t]=n++})),e$28(t))for(var o in t)t.hasOwnProperty(o)&&(i[o]=n++);return i},s$z.getAccessorMinMax=function(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,o=i.max;if(e$28(r)){var a=r.WEB3D_quantized_attributes;e$28(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}},s$z.getAttributeOrUniformBySemantic=function(e,t,i,r){return e$$.technique(e,(function(n){if(!e$28(i)||n.program===i){var o=e$$.techniqueAttribute(n,tn$4(e,n,t,r));return e$28(o)?o:e$$.techniqueUniform(n,tn$4(e,n,t,r))}}))},s$z.getDiffuseAttributeOrUniform=function(e,t){var i=s$z.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return e$28(i)||(i=s$z.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),i};var ln$3=new t$X,mn$2=new n$14,hn$2=new t$X;function N$w(e,t,i){t+="(?!\\w)",t=new RegExp(t,"g");var r=e.search(t);return e.replace(t,(function(e,t){return r===t?e:i}))}function En$3(e,t){var i=e.accessors[t].extensions;if(e$28(i))return i.WEB3D_quantized_attributes}function on$2(e,t,i){var r=t.material,n=e.materials[r];if(i$D(e,"KHR_techniques_webgl")&&e$28(n.extensions)&&e$28(n.extensions.KHR_techniques_webgl)){var o=n.extensions.KHR_techniques_webgl.technique,a=e.extensions.KHR_techniques_webgl.techniques[o];return e$$.techniqueAttribute(a,(function(e,t){if(e.semantic===i)return t}))}}function D$L(e){var t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function K$z(e){var t={value:o$1k.fromArray(e),clone:o$1k.clone,func:function(){return t.value}};return t}function X$t(e){var t={value:t$X.fromArray(e),clone:t$X.clone,func:function(){return t.value}};return t}function d$K(e){var t={value:e$25.fromArray(e),clone:e$25.clone,func:function(){return t.value}};return t}function Y$v(e){var t={value:f$15.fromColumnMajorArray(e),clone:f$15.clone,func:function(){return t.value}};return t}function Z$E(e){var t={value:p$1a.fromColumnMajorArray(e),clone:p$1a.clone,func:function(){return t.value}};return t}function G$M(e){var t={value:y$15.fromColumnMajorArray(e),clone:y$15.clone,func:function(){return t.value}};return t}s$z.getTransform=function(e,t){return e$28(e.matrix)?y$15.fromColumnMajorArray(e.matrix,t):y$15.fromTranslationQuaternionRotationScale(t$X.fromArray(e.translation,0,ln$3),n$14.unpack(e.rotation,0,mn$2),t$X.fromArray(e.scale,0,hn$2),t)},s$z.getUsedExtensions=function(e){var t=e.extensionsUsed,i={};if(e$28(t))for(var r=t.length,n=0;n<r;n++){i[t[n]]=!0}return i},s$z.getRequiredExtensions=function(e){var t=e.extensionsRequired,i={};if(e$28(t))for(var r=t.length,n=0;n<r;n++){i[t[n]]=!0}return i},s$z.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},s$z.checkSupportedExtensions=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!s$z.supportedExtensions[i])throw new t$U("Unsupported glTF Extension: "+i);if("EXT_texture_webp"===i&&!1===t)throw new t$U("Loaded model requires WebP but browser does not support it.")}},s$z.checkSupportedGlExtensions=function(e,t){if(e$28(e))for(var i=e.length,r=0;r<i;r++){var n=e[r];if("OES_element_index_uint"!==n)throw new t$U("Unsupported WebGL Extension: "+n);if(!t.elementIndexUint)throw new t$U("OES_element_index_uint WebGL extension is not enabled.")}},s$z.modifyShaderForDracoQuantizedAttributes=function(e,t,i,r){var n={};for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.quantization;if(!e$28(s))continue;var l=on$2(e,t,o);"_"===o.charAt(0)&&(o=o.substring(1));var u="gltf_u_dec_"+o.toLowerCase();if(!e$28(n[u])){var c,h="gltf_decoded_"+o,d=l.replace("a_","gltf_a_dec_"),f=a.componentsPerAttribute;i=N$w(i,l,d),i=(c=s.octEncoded?"vec3":f>1?"vec"+f:"float")+" "+d+";\n"+i;var p=3===f&&"COLOR_0"===o;p&&(i=N$w(i,d,"vec4("+d+", 1.0)"));var _="";if(s.octEncoded){var m=u+"_rangeConstant";i="uniform float "+m+";\n"+i,_="\nvoid main() {\n "+d+" = czm_octDecode("+l+".xy, "+m+").zxy;\n "+h+"();\n}\n"}else{var $=u+"_normConstant",g=u+"_min";i="uniform float "+$+";\nuniform "+c+" "+g+";\n"+i,_="\nvoid main() {\n "+d+" = "+g+" + "+l+(p?".xyz":"")+" * "+$+";\n "+h+"();\n}\n"}i=a$$.replaceMain(i,h),i+=_}}return{shader:i}},s$z.modifyShaderForQuantizedAttributes=function(e,t,i){var r={},n=t.attributes;for(var o in n)if(n.hasOwnProperty(o)){var a=on$2(e,t,o),s=t.attributes[o];"_"===o.charAt(0)&&(o=o.substring(1));var l="gltf_u_dec_"+o.toLowerCase(),u=l+"_scale",c=l+"_translate";if(!e$28(r[l])&&!e$28(r[u])){var h=En$3(e,s);if(e$28(h)){var d,f=h.decodeMatrix,p="gltf_decoded_"+o,_=a.replace("a_","gltf_a_dec_"),m=Math.floor(Math.sqrt(f.length));i=(d=m>2?"vec"+(m-1):"float")+" "+_+";\n"+(i=N$w(i,a,_));var $="";5===m?(i="uniform vec4 "+c+";\n"+(i="uniform mat4 "+u+";\n"+i),$="\nvoid main() {\n "+_+" = "+u+" * "+a+" + "+c+";\n "+p+"();\n}\n",r[u]={mat:4},r[c]={vec:4}):(i="uniform mat"+m+" "+l+";\n"+i,$="\nvoid main() {\n "+_+" = "+d+"("+l+" * vec"+m+"("+a+",1.0));\n "+p+"();\n}\n",r[l]={mat:m}),i=a$$.replaceMain(i,p),i+=$}}}return{shader:i,uniforms:r}},s$z.toClipCoordinatesGLSL=function(e,t){var i=s$z.getAttributeOrUniformBySemantic(e,"POSITION"),r=i.replace("a_","gltf_a_dec_");-1!==t.indexOf(r)&&(i=r);var n=s$z.getAttributeOrUniformBySemantic(e,"MODELVIEWPROJECTION",void 0,!0);if(!e$28(n)||-1===t.indexOf(n)){var o=s$z.getAttributeOrUniformBySemantic(e,"PROJECTION",void 0,!0),a=s$z.getAttributeOrUniformBySemantic(e,"MODELVIEW",void 0,!0);-1!==t.indexOf("czm_instanced_modelView ")?a="czm_instanced_modelView":e$28(a)||(a=s$z.getAttributeOrUniformBySemantic(e,"CESIUM_RTC_MODELVIEW",void 0,!0)),n=o+" * "+a}return n+" * vec4("+i+".xyz, 1.0)"},s$z.modifyFragmentShaderForLogDepth=function(e){return e=a$$.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_writeLogDepth(); \n} \n"},s$z.modifyVertexShaderForLogDepth=function(e,t){return e=a$$.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_vertexLogDepth("+t+"); \n} \n"};var R$A=new e$25;function un$2(e){var t={value:e,clone:e$25.clone,func:function(){var e=performance.now()/1e3,i=t.value[4];if(i>0){var r=e%i;R$A.x=r*t.value[0]+t.value[1],R$A.y=r*t.value[2]+t.value[3]}else R$A.x=t.value[1],R$A.y=t.value[3];var n=t.value[9];if(n>0){var o=e%n;R$A.z=o*t.value[5]+t.value[6],R$A.w=o*t.value[7]+t.value[8]}else R$A.z=t.value[6],R$A.w=t.value[8];return R$A}};return t}function j$D(e,t,i){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=i}function pn$2(e,t,i){var r=new j$D(e,t,i);return r.func=function(){return r.value},r}Object.defineProperties(j$D.prototype,{value:{get:function(){if(!e$28(this._value)){var e=this._textures[this._textureId];if(!e$28(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),j$D.prototype.clone=function(e){return e},j$D.prototype.func=void 0;var A$O={};A$O[de$y.FLOAT]=D$L,A$O[de$y.FLOAT_VEC2]=K$z,A$O[de$y.FLOAT_VEC3]=X$t,A$O[de$y.FLOAT_VEC4]=d$K,A$O[de$y.INT]=D$L,A$O[de$y.INT_VEC2]=K$z,A$O[de$y.INT_VEC3]=X$t,A$O[de$y.INT_VEC4]=d$K,A$O[de$y.BOOL]=D$L,A$O[de$y.BOOL_VEC2]=K$z,A$O[de$y.BOOL_VEC3]=X$t,A$O[de$y.BOOL_VEC4]=d$K,A$O[de$y.FLOAT_MAT2]=Y$v,A$O[de$y.FLOAT_MAT3]=Z$E,A$O[de$y.FLOAT_MAT4]=G$M,A$O[de$y.SAMPLER_2D]=pn$2;var z$y={};function gn$2(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function On$3(e){return[e[20],e[21],e[22],e[23]]}z$y[ie$y.BASECOLOR_UV_OFFSET_AND_TILING]=un$2,z$y[ie$y.EMISSIVE_UV_OFFSET_AND_TILING]=un$2,s$z.createUniformFunction=function(e,t,i,r,n){return e$28(n)?z$y[n](t,i,r):A$O[e](t,i,r)},s$z.createUniformsForDracoQuantizedAttributes=function(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],n=r.quantization;if(!e$28(n))continue;"_"===i.charAt(0)&&(i=i.substring(1));var o="gltf_u_dec_"+i.toLowerCase();if(n.octEncoded){var a=o+"_rangeConstant",s=(1<<n.quantizationBits)-1;t[a]=D$L(s).func;continue}var l=o+"_normConstant",u=n.range/(1<<n.quantizationBits);t[l]=D$L(u).func;var c=o+"_min";switch(r.componentsPerAttribute){case 1:t[c]=D$L(n.minValues).func;break;case 2:t[c]=K$z(n.minValues).func;break;case 3:t[c]=X$t(n.minValues).func;break;case 4:t[c]=d$K(n.minValues).func}}return t},s$z.createUniformsForQuantizedAttributes=function(e,t,i){var r=e.accessors,n={},o={},a=t.attributes;for(var s in a)if(a.hasOwnProperty(s)){var l=r[a[s]],u=l.extensions;if("_"===s.charAt(0)&&(s=s.substring(1)),e$28(u)){var c=u.WEB3D_quantized_attributes;if(e$28(c)){var h=c.decodeMatrix,d="gltf_u_dec_"+s.toLowerCase();switch(l.type){case Q$C.SCALAR:o[d]=Y$v(h).func,n[d]=!0;break;case Q$C.VEC2:o[d]=Z$E(h).func,n[d]=!0;break;case Q$C.VEC3:o[d]=G$M(h).func,n[d]=!0;break;case Q$C.VEC4:var f=d+"_scale",p=d+"_translate";o[f]=G$M(gn$2(h)).func,o[p]=d$K(On$3(h)).func,n[f]=!0,n[p]=!0}}}}for(var _ in i)if(i.hasOwnProperty(_)&&!n[_]){var m=i[_];e$28(m.mat)&&(2===m.mat?o[_]=Y$v(f$15.IDENTITY).func:3===m.mat?o[_]=Z$E(p$1a.IDENTITY).func:4===m.mat&&(o[_]=G$M(y$15.IDENTITY).func)),e$28(m.vec)&&4===m.vec&&(o[_]=d$K([0,0,0,0]).func)}return o};var B$x=new t$X,Tn$3={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var i=new y$15;return function(){return e$28(t._rtcCenter)?(y$15.getTranslation(e.model,B$x),t$X.add(B$x,t._rtcCenter,B$x),y$15.multiplyByPoint(e.view,B$x,B$x),y$15.setTranslation(e.modelView,B$x,i)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};function ue$k(e,t){if(t=u$Y(t,{}),e$28(e)&&i$D(e,"KHR_materials_common")){i$D(e,"KHR_techniques_webgl")||(e$28(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl"));var i=e.extensions.KHR_techniques_webgl;le$n(e);var r=ve$h(e),n=s$z.splitIncompatibleMaterials(e),o={},a=!1;return e$$.material(e,(function(s,l){if(e$28(s.extensions)&&e$28(s.extensions.KHR_materials_common)){var u=s.extensions.KHR_materials_common,c=n[l],h=_e$i(u,c),d=o[h];e$28(d)||(d=fe$l(e,i,c,u,r,t.addBatchIdToGeneratedShaders),o[h]=d,a=!0);var f={},p=u.values;for(var _ in p)p.hasOwnProperty(_)&&"transparent"!==_&&"doubleSided"!==_&&(f["u_"+_.toLowerCase()]=p[_]);s.extensions.KHR_techniques_webgl={technique:d,values:f},s.alphaMode="OPAQUE",u.transparent&&(s.alphaMode="BLEND"),u.doubleSided&&(s.doubleSided=!0)}})),a&&s$z.ensureSemanticExistence(e),e}}function ve$h(e){var t,i={};if(e$28(e.extensions)&&e$28(e.extensions.KHR_materials_common)&&(t=e.extensions.KHR_materials_common.lights),e$28(t)){var r=e.nodes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];if(e$28(o.extensions)&&e$28(o.extensions.KHR_materials_common)){var a=o.extensions.KHR_materials_common.light;e$28(a)&&e$28(t[a])&&(t[a].node=n),delete o.extensions.KHR_materials_common}}var s=0;for(var l in t)if(t.hasOwnProperty(l)){var u=t[l],c=u.type;if("ambient"!==c&&!e$28(u.node)){delete t[l];continue}var h="light"+s.toString();switch(u.baseName=h,c){case"ambient":var d=u.ambient;i[h+"Color"]={type:de$y.FLOAT_VEC3,value:d.color};break;case"directional":var f=u.directional;i[h+"Color"]={type:de$y.FLOAT_VEC3,value:f.color},e$28(u.node)&&(i[h+"Transform"]={node:u.node,semantic:"MODELVIEW",type:de$y.FLOAT_MAT4});break;case"point":var p=u.point;i[h+"Color"]={type:de$y.FLOAT_VEC3,value:p.color},e$28(u.node)&&(i[h+"Transform"]={node:u.node,semantic:"MODELVIEW",type:de$y.FLOAT_MAT4}),i[h+"Attenuation"]={type:de$y.FLOAT_VEC3,value:[p.constantAttenuation,p.linearAttenuation,p.quadraticAttenuation]};break;case"spot":var _=u.spot;i[h+"Color"]={type:de$y.FLOAT_VEC3,value:_.color},e$28(u.node)&&(i[h+"Transform"]={node:u.node,semantic:"MODELVIEW",type:de$y.FLOAT_MAT4},i[h+"InverseTransform"]={node:u.node,semantic:"MODELVIEWINVERSE",type:de$y.FLOAT_MAT4,useInFragment:!0}),i[h+"Attenuation"]={type:de$y.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]},i[h+"FallOff"]={type:de$y.FLOAT_VEC2,value:[_.fallOffAngle,_.fallOffExponent]}}++s}}return i}function fe$l(e,t,i,r,n,o){e$28(r)||(r={}),o=u$Y(o,!1);var a,s=t.techniques,l=t.shaders,u=t.programs,c=r.technique.toUpperCase();e$28(e.extensions)&&e$28(e.extensions.KHR_materials_common)&&(a=e.extensions.KHR_materials_common.lights);var h,d=r.values,f=u$Y(r.jointCount,0),p=!1,_=!1;e$28(i)&&(p=(h=i.skinning).skinned,_=i.hasVertexColors);var m="precision highp float;\n",$="precision highp float;\n",g="CONSTANT"!==c,v={u_modelViewMatrix:{semantic:i$D(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:de$y.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:de$y.FLOAT_MAT4}};g&&(v.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:de$y.FLOAT_MAT3}),p&&(v.u_jointMatrix={count:f,semantic:"JOINTMATRIX",type:de$y.FLOAT_MAT4});var y,x=!1;for(var b in d)if(d.hasOwnProperty(b)&&"transparent"!==b&&"doubleSided"!==b){var w=ne$w(b,d[b]);y="u_"+b.toLowerCase(),!x&&w===de$y.SAMPLER_2D&&(x=!0),v[y]={type:w}}if(e$28(v.u_diffuse)&&(v.u_diffuse.semantic="_3DTILESDIFFUSE"),e$28(n))for(var C in n)n.hasOwnProperty(C)&&(v[y="u_"+C]=n[C]);for(y in v)if(v.hasOwnProperty(y)){var T=v[y],S=e$28(T.count)?"["+T.count+"]":"";T.type!==de$y.FLOAT_MAT3&&T.type!==de$y.FLOAT_MAT4||T.useInFragment?($+="uniform "+t$B(T.type)+" "+y+S+";\n",delete T.useInFragment):m+="uniform "+t$B(T.type)+" "+y+S+";\n"}var E="";if(p){var A,P,I=r$F(h.type),M=!1;if(0===h.type.indexOf("MAT")&&(M=!0,I=Math.sqrt(I)),M)for(A=0;A<I;A++)for(P=0;P<I;P++)E+=0===A&&0===P?" mat4 skinMat = ":" skinMat += ",E+="a_weight["+A+"]["+P+"] * u_jointMatrix[int(a_joint["+A+"]["+P+"])];\n";else for(A=0;A<I;A++)E+=0===A?" mat4 skinMat = ":" skinMat += ",E+="a_weight["+A+"] * u_jointMatrix[int(a_joint["+A+"])];\n"}var O,D={a_position:{semantic:"POSITION"}};if(m+="attribute vec3 a_position;\n",m+="varying vec3 v_positionEC;\n",E+=p?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",E+=" v_positionEC = pos.xyz;\n",E+=" gl_Position = u_projectionMatrix * pos;\n",$+="varying vec3 v_positionEC;\n",g&&(D.a_normal={semantic:"NORMAL"},m+="attribute vec3 a_normal;\n",m+="varying vec3 v_normal;\n",E+=p?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",$+="varying vec3 v_normal;\n"),x&&(D.a_texcoord_0={semantic:"TEXCOORD_0"},m+="attribute vec2 a_texcoord_0;\n",m+="varying vec2 "+(O="v_texcoord_0")+";\n",E+=" "+O+" = a_texcoord_0;\n",$+="varying vec2 "+O+";\n"),p){var R=s$z.getShaderVariable(h.type);D.a_joint={semantic:"JOINT"},D.a_weight={semantic:"WEIGHT"},m+="attribute "+R+" a_joint;\n",m+="attribute "+R+" a_weight;\n"}_&&(D.a_vertexColor={semantic:"COLOR_0"},m+="attribute vec4 a_vertexColor;\n",m+="varying vec4 v_vertexColor;\n",E+=" v_vertexColor = a_vertexColor;\n",$+="varying vec4 v_vertexColor;\n"),o&&(D.a_batchId={semantic:"_BATCHID"},m+="attribute float a_batchId;\n");var L=g&&("BLINN"===c||"PHONG"===c)&&e$28(v.u_specular)&&e$28(v.u_shininess)&&v.u_shininess>0,B=!1,N=!1,F="";for(var z in a)if(a.hasOwnProperty(z)){var k=a[z],V=k.type.toLowerCase(),U=k.baseName;F+=" {\n";var X,H,G="u_"+U+"Color";"ambient"===V?(N=!0,F+=" ambientLight += "+G+";\n"):g&&(B=!0,X="v_"+U+"Direction",H="v_"+U+"Position","point"!==V&&(m+="varying vec3 "+X+";\n",$+="varying vec3 "+X+";\n",E+=" "+X+" = mat3(u_"+U+"Transform) * vec3(0.,0.,1.);\n","directional"===V&&(F+=" vec3 l = normalize("+X+");\n")),"directional"!==V?(m+="varying vec3 "+H+";\n",$+="varying vec3 "+H+";\n",E+=" "+H+" = u_"+U+"Transform[3].xyz;\n",F+=" vec3 VP = "+H+" - v_positionEC;\n",F+=" vec3 l = normalize(VP);\n",F+=" float range = length(VP);\n",F+=" float attenuation = 1.0 / (u_"+U+"Attenuation.x + ",F+="(u_"+U+"Attenuation.y * range) + ",F+="(u_"+U+"Attenuation.z * range * range));\n"):F+=" float attenuation = 1.0;\n","spot"===V&&(F+=" float spotDot = dot(l, normalize("+X+"));\n",F+=" if (spotDot < cos(u_"+U+"FallOff.x * 0.5))\n",F+=" {\n",F+=" attenuation = 0.0;\n",F+=" }\n",F+=" else\n",F+=" {\n",F+=" attenuation *= max(0.0, pow(spotDot, u_"+U+"FallOff.y));\n",F+=" }\n"),F+=" diffuseLight += "+G+"* max(dot(normal,l), 0.) * attenuation;\n",L&&("BLINN"===c?(F+=" vec3 h = normalize(l + viewDir);\n",F+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(F+=" vec3 reflectDir = reflect(-l, normal);\n",F+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),F+=" specularLight += "+G+" * specularIntensity;\n")),F+=" }\n"}if(N||(F+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),!B&&"CONSTANT"!==c){F+=" vec3 l = normalize(czm_sunDirectionEC);\n";F+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.2);\n",L&&("BLINN"===c?(F+=" vec3 h = normalize(l + viewDir);\n",F+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(F+=" vec3 reflectDir = reflect(-l, normal);\n",F+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),F+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")}m+="void main(void) {\n",m+=E,m+="}\n",$+="void main(void) {\n";var W,Y=" vec3 color = vec3(0.0, 0.0, 0.0);\n";g&&($+=" vec3 normal = normalize(v_normal);\n",r.doubleSided&&($+=" if (gl_FrontFacing == false)\n",$+=" {\n",$+=" normal = -normal;\n",$+=" }\n")),"CONSTANT"!==c?(e$28(v.u_diffuse)&&(v.u_diffuse.type===de$y.SAMPLER_2D?$+=" vec4 diffuse = texture2D(u_diffuse, "+O+");\n":$+=" vec4 diffuse = u_diffuse;\n",$+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",Y+=" color += diffuse.rgb * diffuseLight;\n"),L&&(v.u_specular.type===de$y.SAMPLER_2D?$+=" vec3 specular = texture2D(u_specular, "+O+").rgb;\n":$+=" vec3 specular = u_specular.rgb;\n",$+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",Y+=" color += specular * specularLight;\n"),W=e$28(v.u_transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):W=e$28(v.u_transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",_&&(Y+=" color *= v_vertexColor.rgb;\n"),e$28(v.u_emission)&&(v.u_emission.type===de$y.SAMPLER_2D?$+=" vec3 emission = texture2D(u_emission, "+O+").rgb;\n":$+=" vec3 emission = u_emission.rgb;\n",Y+=" color += emission;\n"),(e$28(v.u_ambient)||"CONSTANT"!==c)&&(e$28(v.u_ambient)?v.u_ambient.type===de$y.SAMPLER_2D?$+=" vec3 ambient = texture2D(u_ambient, "+O+").rgb;\n":$+=" vec3 ambient = u_ambient.rgb;\n":$+=" vec3 ambient = diffuse.rgb;\n",Y+=" color += ambient * ambientLight;\n"),$+=" vec3 viewDir = -normalize(v_positionEC);\n",$+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",$+=F,$+=Y,$+=W,$+="}\n";var q=d$P(l,{type:de$y.VERTEX_SHADER,extras:{_pipeline:{source:m,extension:".glsl"}}}),j=d$P(l,{type:de$y.FRAGMENT_SHADER,extras:{_pipeline:{source:$,extension:".glsl"}}}),Z=d$P(u,{fragmentShader:j,vertexShader:q});return d$P(s,{attributes:D,program:Z,uniforms:v})}function ne$w(e,t){var i;switch(i=e$28(t.value)?t.value:e$28(t.index)?[t.index]:t,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===i.length?de$y.SAMPLER_2D:de$y.FLOAT_VEC4;case"shininess":case"transparency":return de$y.FLOAT;case"transparent":case"doubleSided":return de$y.BOOL}}function _e$i(e,t){var i="";i+="technique:"+e.technique+";";for(var r=e.values,n=Object.keys(r).sort(),o=n.length,a=0;a<o;++a){var s=n[a];r.hasOwnProperty(s)&&(i+=s+":"+ne$w(s,r[s]),i+=";")}var l=u$Y(e.jointCount,0);if(i+=l.toString()+";",e$28(t)){var u=t.skinning;l>0&&(i+=u.type+";"),i+=t.hasVertexColors}return i}function le$n(e){var t=e.extensions.KHR_materials_common;if(e$28(t)&&e$28(t.lights))for(var i=t.lights,r=i.length,n=0;n<r;n++){var o=i[n];if("ambient"===o.type){e$28(o.ambient)||(o.ambient={});var a=o.ambient;e$28(a.color)||(a.color=[1,1,1])}else if("directional"===o.type){e$28(o.directional)||(o.directional={});var s=o.directional;e$28(s.color)||(s.color=[1,1,1])}else if("point"===o.type){e$28(o.point)||(o.point={});var l=o.point;e$28(l.color)||(l.color=[1,1,1]),l.constantAttenuation=u$Y(l.constantAttenuation,1),l.linearAttenuation=u$Y(l.linearAttenuation,0),l.quadraticAttenuation=u$Y(l.quadraticAttenuation,0)}else if("spot"===o.type){e$28(o.spot)||(o.spot={});var u=o.spot;e$28(u.color)||(u.color=[1,1,1]),u.constantAttenuation=u$Y(u.constantAttenuation,1),u.fallOffAngle=u$Y(u.fallOffAngle,3.14159265),u.fallOffExponent=u$Y(u.fallOffExponent,0),u.linearAttenuation=u$Y(u.linearAttenuation,0),u.quadraticAttenuation=u$Y(u.quadraticAttenuation,0)}}}function he$j(e,t){if(t=u$Y(t,{}),i$D(e,"KHR_techniques_webgl")||!e$28(e.materials)||0===e.materials.length)return e;e$28(e.extensions)||(e.extensions={}),e$28(e.extensionsUsed)||(e.extensionsUsed=[]),e$28(e.extensionsRequired)||(e.extensionsRequired=[]),e.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},e.extensionsUsed.push("KHR_techniques_webgl"),e.extensionsRequired.push("KHR_techniques_webgl");var i=s$z.splitIncompatibleMaterials(e);return e$$.material(e,(function(r,n){var o={},a=xe$k(e,r,n,o,i,t);e$28(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl={values:o,technique:a}})),s$z.ensureSemanticExistence(e),e}function pe$o(e){return e$28(e.extensions)&&e$28(e.extensions.KHR_materials_pbrSpecularGlossiness)}function ge$j(e){return e$28(e.textureMotion)}function te$u(e,t,i){var r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0;e.hasOwnProperty("start")&&(r+=e.start[0],o+=e.start[1]),e.hasOwnProperty("range")&&(r+=e.range[0],n=e.range[1],o+=e.range[2],a=e.range[3],c=e.range[0],h=e.range[2]),e.hasOwnProperty("speed")&&0!=e.speed&&(s=(n-c)/(u=1/e.speed),l=(a-h)/u),t[i]=s,t[i+1]=r,t[i+2]=l,t[i+3]=o,t[i+4]=u}function se$m(e,t,i,r){i[r]=[0,0,0,0,1,0,1,0,1,1],e$28(e)&&te$u(e,i[r],0),e$28(t)&&te$u(t,i[r],5)}function me$m(e,t){var i=e.textureMotion;(i.hasOwnProperty("baseColorTextureScroll")||i.hasOwnProperty("baseColorTextureScale"))&&se$m(i.baseColorTextureScroll,i.baseColorTextureScale,t,"u_baseColorUVOffsetAndTiling"),(i.hasOwnProperty("emissiveTextureScroll")||i.hasOwnProperty("emissiveTextureScale"))&&se$m(i.emissiveTextureScroll,i.emissiveTextureScale,t,"u_emissiveUVOffsetAndTiling")}function xe$k(e,t,i,r,n,o){var a,s,l=u$Y(o.addBatchIdToGeneratedShaders,!1),u=e.extensions.KHR_techniques_webgl,c=u.techniques,h=u.shaders,d=u.programs,f=pe$o(t),p=ge$j(t),_=t.pbrMetallicRoughness;if(e$28(_)&&!f)for(s in _)_.hasOwnProperty(s)&&(r[a="u_"+s]=_[s]);if(f){var m=t.extensions.KHR_materials_pbrSpecularGlossiness;for(s in m)m.hasOwnProperty(s)&&(r[a="u_"+s]=m[s])}for(var $ in p&&me$m(t,r),t)t.hasOwnProperty($)&&($.indexOf("Texture")>=0||$.indexOf("Factor")>=0)&&(r[a="u_"+$]=t[$]);var g,v="precision highp float;\n",y="precision highp float;\n";e$28(e.skins)&&(g=e.skins[0]);var x,b,w=e$28(g)?g.joints:[],C=w.length,T=n[i],S=!1,E=!1,A=!1,P=!1,I=!1,M=!1,O=!1;e$28(T)&&(S=(x=T.skinning).skinned&&w.length>0,E=T.hasVertexColors,A=T.hasMorphTargets,P=T.hasNormals,I=T.hasTangents,M=T.hasTexCoords),A&&e$$.mesh(e,(function(e){e$$.meshPrimitive(e,(function(e){if(e.material===i){var t=e.targets;e$28(t)&&(b=t)}}))}));var D={u_modelViewMatrix:{semantic:i$D(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:de$y.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:de$y.FLOAT_MAT4}};e$28(t.extensions)&&e$28(t.extensions.KHR_materials_unlit)&&(O=!0,P=!1,I=!1),P&&(D.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:de$y.FLOAT_MAT3}),S&&(D.u_jointMatrix={count:C,semantic:"JOINTMATRIX",type:de$y.FLOAT_MAT4}),A&&(D.u_morphWeights={count:b.length,semantic:"MORPHWEIGHTS",type:de$y.FLOAT});var R=t.alphaMode;for(a in e$28(R)&&"MASK"===R&&(D.u_alphaCutoff={semantic:"ALPHACUTOFF",type:de$y.FLOAT}),r)r.hasOwnProperty(a)&&(D[a]={type:Te$i(a),extensionType:Ce$h(a)});var L=u$Y(D.u_baseColorTexture,D.u_baseColorFactor);for(a in e$28(L)&&(L.semantic="_3DTILESDIFFUSE"),D)if(D.hasOwnProperty(a)){var B=D[a],N=e$28(B.count)?"["+B.count+"]":"";B.type!==de$y.FLOAT_MAT3&&B.type!==de$y.FLOAT_MAT4&&"u_morphWeights"!==a||B.useInFragment?(y+="uniform "+t$B(B.type)+" "+a+N+";\n",delete B.useInFragment):v+="uniform "+t$B(B.type)+" "+a+N+";\n"}var F="";if(S){var z,k,V=r$F(x.type),U=!1;if(0===x.type.indexOf("MAT")&&(U=!0,V=Math.sqrt(V)),U)for(z=0;z<V;z++)for(k=0;k<V;k++)F+=0===z&&0===k?" mat4 skinMatrix = ":" skinMatrix += ",F+="a_weight["+z+"]["+k+"] * u_jointMatrix[int(a_joint["+z+"]["+k+"])];\n";else for(z=0;z<V;z++)F+=0===z?" mat4 skinMatrix = ":" skinMatrix += ",F+="a_weight["+z+"] * u_jointMatrix[int(a_joint["+z+"])];\n"}var X,H={a_position:{semantic:"POSITION"}};if(v+="attribute vec3 a_position;\n",P&&(v+="varying vec3 v_positionEC;\n",v+="varying vec3 v_positionWC;\n"),F+=" vec3 weightedPosition = a_position;\n",P&&(F+=" vec3 weightedNormal = a_normal;\n"),I&&(F+=" vec4 weightedTangent = a_tangent;\n"),A)for(var G=0;G<b.length;G++){var W=b[G];for(var Y in W)if(W.hasOwnProperty(Y)&&"extras"!==Y){var q="a_"+Y+"_"+G;H[q]={semantic:Y+"_"+G},v+="attribute vec3 "+q+";\n","POSITION"===Y?F+=" weightedPosition += u_morphWeights["+G+"] * "+q+";\n":"NORMAL"===Y?F+=" weightedNormal += u_morphWeights["+G+"] * "+q+";\n":I&&"TANGENT"===Y&&(F+=" weightedTangent.xyz += u_morphWeights["+G+"] * "+q+";\n")}}if(F+=S?" vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":" vec4 position = vec4(weightedPosition, 1.0);\n",P&&(F+=" v_positionWC = (czm_model * position).xyz;\n"),F+=" position = u_modelViewMatrix * position;\n",P&&(F+=" v_positionEC = position.xyz;\n"),F+=" gl_Position = u_projectionMatrix * position;\n",P&&(H.a_normal={semantic:"NORMAL"},v+="attribute vec3 a_normal;\n",v+="varying vec3 v_normal;\n",F+=S?" v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":" v_normal = u_normalMatrix * weightedNormal;\n",y+="varying vec3 v_normal;\n",y+="varying vec3 v_positionEC;\n",y+="varying vec3 v_positionWC;\n"),I&&(H.a_tangent={semantic:"TANGENT"},v+="attribute vec4 a_tangent;\n",v+="varying vec4 v_tangent;\n",F+=" v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;\n",F+=" v_tangent.w = weightedTangent.w;\n",y+="varying vec4 v_tangent;\n"),M&&(H.a_texcoord_0={semantic:"TEXCOORD_0"},v+="attribute vec2 a_texcoord_0;\n",v+="varying vec2 "+(X="v_texcoord_0")+";\n",F+=" "+X+" = a_texcoord_0;\n",y+="varying vec2 "+X+";\n"),S){var j=s$z.getShaderVariable(x.type);H.a_joint={semantic:"JOINTS_0"},H.a_weight={semantic:"WEIGHTS_0"},v+="attribute "+j+" a_joint;\n",v+="attribute "+j+" a_weight;\n"}E&&(H.a_vertexColor={semantic:"COLOR_0"},v+="attribute vec4 a_vertexColor;\n",v+="varying vec4 v_vertexColor;\n",F+=" v_vertexColor = a_vertexColor;\n",y+="varying vec4 v_vertexColor;\n"),l&&(H.a_batchId={semantic:"_BATCHID"},v+="attribute float a_batchId;\n"),v+="void main(void) \n{\n",v+=F,v+="}\n",P&&(y+="const float M_PI = 3.141592653589793;\n",y+="vec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\n\n",y+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",y+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",y+="vec3 F_Schlick(float ndv, vec3 spec) \n{\n return spec + (vec3(1.0) - spec) * pow(1.0 - ndv, 5.0);\n}\n\n",y+="float D_Phong(float g, float ndh) \n{\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\n",y+="float smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",y+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",y+="float GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\n\n",y+="void getLightColor(vec3 lightDir, vec3 viewDir, vec3 normal, vec3 lightColor, vec3 fresnelTerm, float roughness, out vec3 diffuseTerm, out vec3 specularTerm) \n{\n vec3 h = normalize(viewDir + lightDir);\n float NdotL = clamp(dot(normal, lightDir), 0.001, 1.0);\n float NdotH = clamp(dot(normal, h), 0.0, 1.0);\n vec3 li = lightColor * NdotL;\n diffuseTerm = li;\n specularTerm = li * fresnelTerm * D_Phong(1.0 - roughness, NdotH);\n}\n\n"),y+="vec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\n",y+="vec4 SRGBtoLINEAR4(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\n",y+="vec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR \n return czm_acesTonemapping(linearIn);\n#else \n return linearIn;\n#endif \n}\n\n",y+="vec3 LINEARtoSRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\n",y+="float calcLightAttenuation(float lightDistance, float cutoffDistance, float decayExponent) \n{\n return pow(clamp(1.0 - lightDistance / cutoffDistance, 0.0, 1.0), decayExponent);\n}\n\n",y+="#ifdef USE_IBL_LIGHTING \n",y+="uniform vec2 gltf_iblFactor; \n",y+="#endif \n",y+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",y+="uniform vec3 gltf_lightColor; \n",y+="#endif \n",y+="void main(void) \n{\n",P&&(y+=" vec3 ng = normalize(v_normal);\n",e$28(r.u_normalTexture)?I?(y+=" vec3 t = normalize(v_tangent.xyz);\n",y+=" vec3 b = normalize(cross(ng, t) * v_tangent.w);\n",y+=" mat3 tbn = mat3(t, b, ng);\n",y+=" vec3 n = texture2D(u_normalTexture, "+X+").rgb;\n",y+=" n = normalize(tbn * (2.0 * n - 1.0));\n"):(y="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+y,y+="#ifdef GL_OES_standard_derivatives\n",y+=" vec3 pos_dx = dFdx(v_positionEC);\n",y+=" vec3 pos_dy = dFdy(v_positionEC);\n",y+=" vec3 tex_dx = dFdx(vec3("+X+",0.0));\n",y+=" vec3 tex_dy = dFdy(vec3("+X+",0.0));\n",y+=" vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",y+=" t = normalize(t - ng * dot(ng, t));\n",y+=" vec3 b = normalize(cross(ng, t));\n",y+=" mat3 tbn = mat3(t, b, ng);\n",y+=" vec3 n = texture2D(u_normalTexture, "+X+").rgb;\n",y+=" n = normalize(tbn * (2.0 * n - 1.0));\n",y+="#else\n",y+=" vec3 n = ng;\n",y+="#endif\n"):y+=" vec3 n = ng;\n",t.doubleSided&&(y+=" if (!gl_FrontFacing)\n",y+=" {\n",y+=" n = -n;\n",y+=" }\n")),e$28(r.u_baseColorTexture)?(y+=" vec2 uvOffset = vec2(0.0);\n",y+=" vec2 uvTiling = vec2(1.0);\n",e$28(r.u_baseColorUVOffsetAndTiling)&&(y+=" uvOffset = u_baseColorUVOffsetAndTiling.xy;\n",y+=" uvTiling = u_baseColorUVOffsetAndTiling.zw;\n"),y+=" vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, "+X+" * uvTiling.xy + uvOffset.xy));\n",e$28(r.u_baseColorFactor)&&(y+=" baseColorWithAlpha *= u_baseColorFactor;\n")):e$28(r.u_baseColorFactor)?y+=" vec4 baseColorWithAlpha = u_baseColorFactor;\n":y+=" vec4 baseColorWithAlpha = vec4(1.0);\n",E&&(y+=" baseColorWithAlpha *= v_vertexColor;\n"),y+=" vec3 baseColor = baseColorWithAlpha.rgb;\n",P?(f?(e$28(r.u_specularGlossinessTexture)?(y+=" vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, "+X+"));\n",y+=" vec3 specular = specularGlossiness.rgb;\n",y+=" float glossiness = specularGlossiness.a;\n",e$28(r.u_specularFactor)&&(y+=" specular *= u_specularFactor;\n"),e$28(r.u_glossinessFactor)&&(y+=" glossiness *= u_glossinessFactor;\n")):(e$28(r.u_specularFactor)?y+=" vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n":y+=" vec3 specular = vec3(1.0);\n",e$28(r.u_glossinessFactor)?y+=" float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n":y+=" float glossiness = 1.0;\n"),e$28(r.u_diffuseTexture)?(e$28(r.u_diffuseTextureUVSpeedFactor)?y+=" vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, "+X+" + u_diffuseTextureUVSpeedFactor.xy));\n":y+=" vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, "+X+"));\n",e$28(r.u_diffuseFactor)&&(y+=" diffuse *= u_diffuseFactor;\n")):e$28(r.u_diffuseFactor)?y+=" vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n":y+=" vec4 diffuse = vec4(1.0);\n"):e$28(r.u_metallicRoughnessTexture)?(y+=" vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+X+").rgb;\n",y+=" float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",y+=" float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",e$28(r.u_metallicFactor)&&(y+=" metalness *= u_metallicFactor;\n"),e$28(r.u_roughnessFactor)&&(y+=" roughness *= u_roughnessFactor;\n")):(e$28(r.u_metallicFactor)?y+=" float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":y+=" float metalness = 1.0;\n",e$28(r.u_roughnessFactor)?y+=" float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":y+=" float roughness = 1.0;\n"),y+=" vec3 v = -normalize(v_positionEC);\n",f?(y+=" float roughness = 1.0 - glossiness;\n",y+=" vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));\n",y+=" vec3 specularColor = specular;\n"):(y+=" vec3 f0 = vec3(0.04);\n",y+=" vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n",y+=" vec3 specularColor = mix(f0, baseColor, metalness);\n"),y+=" float NdotV = abs(dot(n, v)) + 0.001;\n",y+=" vec3 diffuseTerm = vec3(0.0);\n",y+=" vec3 specularTerm = vec3(0.0);\n",y+=" vec3 fresnelTerm = F_Schlick(NdotV, specularColor);\n",y+=" vec3 color = vec3(0.0);\n",y+="#if DIR_LIGHTS > 0 \n",y+=" for (int i = 0; i < DIR_LIGHTS; i++) { \n",y+=" vec3 lightDiffuseTerm = vec3(0.0);\n",y+=" vec3 lightSpecularTerm = vec3(0.0);\n",y+=" getLightColor(uDirectionalLightDirectionEC[i], v, n, uDirectionalLightColor[i], fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n",y+=" diffuseTerm +=lightDiffuseTerm;\n",y+=" specularTerm += lightSpecularTerm;\n",y+=" } \n",y+="#endif \n",y+="#if POINT_LIGHTS > 0 \n",y+=" for (int i = 0; i < POINT_LIGHTS; i++) { \n",y+=" vec3 lVector = uPointLightPositionEC[i] - v_positionEC;\n",y+=" float lightDistance = length(lVector);\n",y+=" float lightAttenuation = calcLightAttenuation(lightDistance, uPointLightDistanceAndDecay[i].x, uPointLightDistanceAndDecay[i].y);\n",y+=" if(lightAttenuation < 0.001) {\n",y+=" continue;}\n",y+=" vec3 pointLightColor = uPointLightColor[i] * lightAttenuation;\n",y+=" vec3 lightDiffuseTerm = vec3(0.0);\n",y+=" vec3 lightSpecularTerm = vec3(0.0);\n",y+=" getLightColor(normalize(lVector), v, n, pointLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n",y+=" diffuseTerm +=lightDiffuseTerm;\n",y+=" specularTerm += lightSpecularTerm;\n",y+=" }\n",y+="#endif \n",y+="#if SPOT_LIGHTS > 0 \n",y+=" for (int i = 0; i < SPOT_LIGHTS; i++) { \n",y+=" vec3 lVector = uSpotLightPositionEC[i] - v_positionEC;\n",y+=" float lightDistance = length(lVector);\n",y+=" float lightAttenuation = calcLightAttenuation(lightDistance, uSpotLightDistanceDecayCosPenumbra[i].x, uSpotLightDistanceDecayCosPenumbra[i].y);\n",y+=" if(lightAttenuation < 0.001) {\n",y+=" continue;}\n",y+=" float spotEffect = dot(uSpotLightDirectionEC[i], normalize(lVector));\n",y+=" if(spotEffect > uSpotLightDistanceDecayCosPenumbra[i].z) {\n",y+=" vec3 spotLightColor = uSpotLightColor[i] * lightAttenuation * spotEffect;\n",y+=" vec3 lightDiffuseTerm = vec3(0.0);\n",y+=" vec3 lightSpecularTerm = vec3(0.0);\n",y+=" getLightColor(normalize(lVector), v, n, spotLightColor, fresnelTerm, roughness, lightDiffuseTerm, lightSpecularTerm);\n",y+=" diffuseTerm +=lightDiffuseTerm;\n",y+=" specularTerm += lightSpecularTerm;\n",y+=" }\n",y+=" }\n",y+="#endif \n",y+=" color = baseColor; \n",y+=" color *= max(diffuseTerm, vec3(0.0)); \n",y+=" color += max(specularTerm, vec3(0.0)); \n",y+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",y+=" vec3 lightColorHdr = czm_lightColorHdr;\n",y+="#else \n",y+=" vec3 lightColorHdr = gltf_lightColor;\n",y+="#endif \n",y+=" vec3 l = normalize(czm_lightDirectionEC);\n",y+=" vec3 h = normalize(v + l);\n",y+=" float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",y+=" float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",y+=" float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",y+=" float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",y+=" float alpha = roughness * roughness;\n",y+=" float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",y+=" vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",y+=" vec3 r0 = specularColor.rgb;\n",y+=" vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",y+=" float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",y+=" float D = GGX(alpha, NdotH);\n",y+=" vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n",y+=" vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",y+=" color += NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n",y+="#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) \n",y+=" vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",y+=" czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n",y+=" float vertexRadius = length(v_positionWC);\n",y+=" float horizonDotNadir = 1.0 - min(1.0, ellipsoid.radii.x / vertexRadius);\n",y+=" float reflectionDotNadir = dot(r, normalize(v_positionWC));\n",y+=" r.x = -r.x;\n",y+=" r = -normalize(czm_temeToPseudoFixed * r);\n",y+=" r.x = -r.x;\n",y+=" float inverseRoughness = 1.04 - roughness;\n",y+=" inverseRoughness *= inverseRoughness;\n",y+=" vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",y+=" float atmosphereHeight = 0.05;\n",y+=" float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",y+=" float blendRegionOffset = roughness * -1.0;\n",y+=" float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n",y+=" float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",y+=" float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",y+=" float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",y+=" vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n",y+=" vec3 nadirColor = belowHorizonColor * 0.5;\n",y+=" vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n",y+=" vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n",y+=" vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",y+=" vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n",y+=" float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n",y+=" float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n",y+=" vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n",y+=" float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n",y+=" vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n",y+=" specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",y+=" specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",y+="#ifdef USE_SUN_LUMINANCE \n",y+=" float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * czm_sunDirectionEC), normalize(v_positionWC * -1.0)), 0.001, 1.0);\n",y+=" float S = acos(LdotZenith);\n",y+=" float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(v_positionWC * -1.0)), 0.001, 1.0);\n",y+=" float sunNdotL = clamp(dot(n, czm_sunDirectionEC), 0.001, 1.0);\n",y+=" float gamma = acos(sunNdotL);\n",y+=" float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(sunNdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n",y+=" float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n",y+=" float luminance = gltf_luminanceAtZenith * (numerator / denominator);\n",y+="#endif \n",y+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",y+=" vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);\n",y+="#ifdef USE_SUN_LUMINANCE \n",y+=" color += IBLColor * luminance;\n",y+="#else \n",y+=" color += IBLColor; \n",y+="#endif \n",y+="#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) \n",y+=" mat3 fixedToENU = mat3(gltf_clippingPlanesMatrix[0][0], gltf_clippingPlanesMatrix[1][0], gltf_clippingPlanesMatrix[2][0], \n",y+=" gltf_clippingPlanesMatrix[0][1], gltf_clippingPlanesMatrix[1][1], gltf_clippingPlanesMatrix[2][1], \n",y+=" gltf_clippingPlanesMatrix[0][2], gltf_clippingPlanesMatrix[1][2], gltf_clippingPlanesMatrix[2][2]); \n",y+=" const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); \n",y+=" vec3 cubeDir = normalize(yUpToZUp * fixedToENU * normalize(reflect(-v, n))); \n",y+="#ifdef DIFFUSE_IBL \n",y+="#ifdef CUSTOM_SPHERICAL_HARMONICS \n",y+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); \n",y+="#else \n",y+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n",y+="#endif \n",y+="#else \n",y+=" vec3 diffuseIrradiance = vec3(0.0); \n",y+="#endif \n",y+="#ifdef SPECULAR_IBL \n",y+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",y+="#ifdef CUSTOM_SPECULAR_IBL \n",y+=" vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);\n",y+="#else \n",y+=" vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n",y+="#endif \n",y+=" specularIBL *= F * brdfLut.x + brdfLut.y;\n",y+="#else \n",y+=" vec3 specularIBL = vec3(0.0); \n",y+="#endif \n",y+=" color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n",y+="#endif \n"):y+=" vec3 color = baseColor;\n",O||(e$28(r.u_occlusionTexture)&&(y+=" color *= texture2D(u_occlusionTexture, "+X+").r;\n"),e$28(r.u_emissiveTexture)?(y+=" vec2 uvEmissiveOffset = vec2(0.0);\n",y+=" vec2 uvEmissiveTiling = vec2(1.0);\n",e$28(r.u_emissiveUVOffsetAndTiling)&&(y+=" uvEmissiveOffset = u_emissiveUVOffsetAndTiling.xy;\n",y+=" uvEmissiveTiling = u_emissiveUVOffsetAndTiling.zw;\n"),y+=" vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, "+X+"* uvEmissiveTiling.xy + uvEmissiveOffset.xy).rgb);\n",e$28(r.u_emissiveFactor)&&(y+=" emissive *= u_emissiveFactor;\n"),y+=" color += emissive;\n"):e$28(r.u_emissiveFactor)&&(y+=" color += u_emissiveFactor;\n")),O||(y+=" color = applyTonemapping(color);\n"),y+=" color = LINEARtoSRGB(color);\n",e$28(R)?"MASK"===R?(y+=" if (baseColorWithAlpha.a < u_alphaCutoff) {\n",y+=" discard;\n",y+=" }\n",y+=" gl_FragColor = vec4(color, 1.0);\n"):y+="BLEND"===R?" gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":" gl_FragColor = vec4(color, 1.0);\n":y+=" gl_FragColor = vec4(color, 1.0);\n",y+="}\n";var Z=d$P(h,{type:de$y.VERTEX_SHADER,extras:{_pipeline:{source:v,extension:".glsl"}}}),K=d$P(h,{type:de$y.FRAGMENT_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}}),Q=d$P(d,{fragmentShader:K,vertexShader:Z});return d$P(c,{attributes:H,program:Q,uniforms:D})}function Te$i(e){switch(e){case"u_baseColorFactor":case"u_baseColorUVOffsetAndTiling":case"u_emissiveUVOffsetAndTiling":case"u_diffuseFactor":return de$y.FLOAT_VEC4;case"u_metallicFactor":case"u_roughnessFactor":case"u_glossinessFactor":return de$y.FLOAT;case"u_baseColorTexture":case"u_metallicRoughnessTexture":case"u_normalTexture":case"u_occlusionTexture":case"u_emissiveTexture":case"u_diffuseTexture":case"u_specularGlossinessTexture":return de$y.SAMPLER_2D;case"u_emissiveFactor":case"u_specularFactor":return de$y.FLOAT_VEC3}return-1!==e.indexOf("Offset")?de$y.FLOAT_VEC2:-1!==e.indexOf("Rotation")?de$y.FLOAT:-1!==e.indexOf("Scale")?de$y.FLOAT_VEC2:-1!==e.indexOf("Texture")?de$y.SAMPLER_2D:void 0}function Ce$h(e){switch(e){case"u_baseColorUVOffsetAndTiling":return ie$y.BASECOLOR_UV_OFFSET_AND_TILING;case"u_emissiveUVOffsetAndTiling":return ie$y.EMISSIVE_UV_OFFSET_AND_TILING}}function c$F(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}s$z.getGltfSemanticUniforms=function(){return Tn$3};var G$L="attribute vec3 position;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelViewProjection;\nvoid main()\n{\ngl_Position = czm_depthClampFarPlane(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n",J$I={};!function(e){var t="Compound",i="MemberExpression",r="Literal",n=function(e,t){var i=new Error(e+" at character "+t);throw i.index=t,i.description=e,i},o=!0,a={"-":o,"!":o,"~":o,"+":o},s={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},l=function(e){var t,i=0;for(var r in e)(t=r.length)>i&&e.hasOwnProperty(r)&&(i=t);return i},u=l(a),c=l(s),h={true:!0,false:!1,null:null},d=function(e){return s[e]||0},f=function(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}},p=function(e){return e>=48&&e<=57},_=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!s[String.fromCharCode(e)]},m=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!s[String.fromCharCode(e)]},$=function(e){for(var o,l,$=0,g=e.charAt,v=e.charCodeAt,y=function(t){return g.call(e,t)},x=function(t){return v.call(e,t)},b=e.length,w=function(){for(var e=x($);32===e||9===e;)e=x(++$)},C=function(){var e,t,i=S();return w(),63!==x($)?i:($++,(e=C())||n("Expected expression",$),w(),58===x($)?($++,(t=C())||n("Expected expression",$),{type:"ConditionalExpression",test:i,consequent:e,alternate:t}):void n("Expected :",$))},T=function(){w();for(var t=e.substr($,c),i=t.length;i>0;){if(s.hasOwnProperty(t))return $+=i,t;t=t.substr(0,--i)}return!1},S=function(){var e,t,i,r,o,a,s,l;if(a=E(),!(t=T()))return a;for(o={value:t,prec:d(t)},(s=E())||n("Expected expression after "+t,$),r=[a,o,s];(t=T())&&0!==(i=d(t));){for(o={value:t,prec:i};r.length>2&&i<=r[r.length-2].prec;)s=r.pop(),t=r.pop().value,a=r.pop(),e=f(t,a,s),r.push(e);(e=E())||n("Expected expression after "+t,$),r.push(o,e)}for(e=r[l=r.length-1];l>1;)e=f(r[l-1].value,r[l-2],e),l-=2;return e},E=function(){var t,i,r;if(w(),t=x($),p(t)||46===t)return A();if(39===t||34===t)return P();if(_(t)||40===t)return O();if(91===t)return R();for(r=(i=e.substr($,u)).length;r>0;){if(a.hasOwnProperty(i))return $+=r,{type:"UnaryExpression",operator:i,argument:E(),prefix:!0};i=i.substr(0,--r)}return!1},A=function(){for(var e,t,i="";p(x($));)i+=y($++);if(46===x($))for(i+=y($++);p(x($));)i+=y($++);if("e"===(e=y($))||"E"===e){for(i+=y($++),("+"===(e=y($))||"-"===e)&&(i+=y($++));p(x($));)i+=y($++);p(x($-1))||n("Expected exponent ("+i+y($)+")",$)}return t=x($),_(t)?n("Variable names cannot start with a number ("+i+y($)+")",$):46===t&&n("Unexpected period",$),{type:r,value:parseFloat(i),raw:i}},P=function(){for(var e,t="",i=y($++),o=!1;$<b;){if((e=y($++))===i){o=!0;break}if("\\"===e)switch(e=y($++),e){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+="\\"+e}else t+=e}return o||n('Unclosed quote after "'+t+'"',$),{type:r,value:t,raw:i+t+i}},I=function(){var t,i=x($),o=$;for(_(i)?$++:n("Unexpected "+y($),$);$<b&&(i=x($),m(i));)$++;return t=e.slice(o,$),h.hasOwnProperty(t)?{type:r,value:h[t],raw:t}:"this"===t?{type:"ThisExpression"}:{type:"Identifier",name:t}},M=function(e){for(var i,r,o=[],a=!1;$<b;){if(w(),(i=x($))===e){a=!0,$++;break}44===i?$++:((!(r=C())||r.type===t)&&n("Expected comma",$),o.push(r))}return a||n("Expected "+String.fromCharCode(e),$),o},O=function(){var e,t;for(t=40===(e=x($))?D():I(),w(),e=x($);46===e||91===e||40===e;)$++,46===e?(w(),t={type:i,computed:!1,object:t,property:I()}):91===e?(t={type:i,computed:!0,object:t,property:C()},w(),93!==(e=x($))&&n("Unclosed [",$),$++):40===e&&(t={type:"CallExpression",arguments:M(41),callee:t}),w(),e=x($);return t},D=function(){$++;var e=C();if(w(),41===x($))return $++,e;n("Unclosed (",$)},R=function(){return $++,{type:"ArrayExpression",elements:M(93)}},L=[];$<b;)59===(o=x($))||44===o?$++:(l=C())?L.push(l):$<b&&n('Unexpected "'+y($)+'"',$);return 1===L.length?L[0]:{type:t,body:L}};$.version="0.3.1",$.toString=function(){return"JavaScript Expression Parser (JSEP) v"+$.version},$.addUnaryOp=function(e){return u=Math.max(e.length,u),a[e]=o,this},$.addBinaryOp=function(e,t){return c=Math.max(e.length,c),s[e]=t,this},$.addLiteral=function(e,t){return h[e]=t,this},$.removeUnaryOp=function(e){return delete a[e],e.length===u&&(u=l(a)),this},$.removeAllUnaryOps=function(){return a={},u=0,this},$.removeBinaryOp=function(e){return delete s[e],e.length===c&&(c=l(s)),this},$.removeAllBinaryOps=function(){return s={},c=0,this},$.removeLiteral=function(e){return delete h[e],this},$.removeAllLiterals=function(){return h={},this},e.jsep=$}(J$I);var q$I=J$I.jsep,L$K={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},s$y=Object.freeze(L$K);function L$J(e,t){var i;o$1u.typeOf.string("expression",e),this._expression=e,e=fe$k(le$m(e=se$l(e,t))),q$I.addBinaryOp("=~",0),q$I.addBinaryOp("!~",0);try{i=q$I(e)}catch(e){throw new t$U(e)}this._runtimeAst=_$C(this,i)}Object.defineProperties(L$J.prototype,{expression:{get:function(){return this._expression}}});var m$G={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new o$1k],cartesian3Array:[new t$X],cartesian4Array:[new e$25],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 o$1k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new t$X),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new e$25),this.cartesian4Array[this.cartesian4Index++]}};L$J.prototype.evaluate=function(e,t){m$G.reset();var i=this._runtimeAst.evaluate(e);return t instanceof e$1S&&i instanceof e$25?e$1S.fromCartesian4(i,t):i instanceof o$1k||i instanceof t$X||i instanceof e$25?i.clone(t):i},L$J.prototype.evaluateColor=function(e,t){m$G.reset();var i=this._runtimeAst.evaluate(e);return e$1S.fromCartesian4(i,t)},L$J.prototype.getShaderFunction=function(e,t,i,r){var n=this.getShaderExpression(t,i);return n=r+" "+e+"() \n{ \n return "+n+"; \n} \n"},L$J.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var K$y=["!","-","+"],G$K=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],V$v=/\${(.*?)}/g,J$H=/\\/g,W$C="@#%",Z$D=/@#%/g,T$z=new e$1S,C$D={abs:w$u(Math.abs),sqrt:w$u(Math.sqrt),cos:w$u(Math.cos),sin:w$u(Math.sin),tan:w$u(Math.tan),acos:w$u(Math.acos),asin:w$u(Math.asin),atan:w$u(Math.atan),radians:w$u(e$27.toRadians),degrees:w$u(e$27.toDegrees),sign:w$u(e$27.sign),floor:w$u(Math.floor),ceil:w$u(Math.ceil),round:w$u(Math.round),exp:w$u(Math.exp),exp2:w$u(ee$s),log:w$u(Math.log),log2:w$u(te$t),fract:w$u(Q$B),length:re$p,normalize:ae$o},O$x={atan2:B$w(Math.atan2,!1),pow:B$w(Math.pow,!1),min:B$w(Math.min,!0),max:B$w(Math.max,!0),distance:ne$v,dot:ie$r,cross:ue$j},F$P={clamp:Y$u(e$27.clamp,!0),mix:Y$u(e$27.lerp,!0)};function Q$B(e){return e-Math.floor(e)}function ee$s(e){return Math.pow(2,e)}function te$t(e){return e$27.log2(e)}function w$u(e){return function(t,i){if("number"==typeof i)return e(i);if(i instanceof o$1k)return o$1k.fromElements(e(i.x),e(i.y),m$G.getCartesian2());if(i instanceof t$X)return t$X.fromElements(e(i.x),e(i.y),e(i.z),m$G.getCartesian3());if(i instanceof e$25)return e$25.fromElements(e(i.x),e(i.y),e(i.z),e(i.w),m$G.getCartesian4());throw new t$U('Function "'+t+'" requires a vector or number argument. Argument is '+i+".")}}function B$w(e,t){return function(i,r,n){if(t&&"number"==typeof n){if("number"==typeof r)return e(r,n);if(r instanceof o$1k)return o$1k.fromElements(e(r.x,n),e(r.y,n),m$G.getCartesian2());if(r instanceof t$X)return t$X.fromElements(e(r.x,n),e(r.y,n),e(r.z,n),m$G.getCartesian3());if(r instanceof e$25)return e$25.fromElements(e(r.x,n),e(r.y,n),e(r.z,n),e(r.w,n),m$G.getCartesian4())}if("number"==typeof r&&"number"==typeof n)return e(r,n);if(r instanceof o$1k&&n instanceof o$1k)return o$1k.fromElements(e(r.x,n.x),e(r.y,n.y),m$G.getCartesian2());if(r instanceof t$X&&n instanceof t$X)return t$X.fromElements(e(r.x,n.x),e(r.y,n.y),e(r.z,n.z),m$G.getCartesian3());if(r instanceof e$25&&n instanceof e$25)return e$25.fromElements(e(r.x,n.x),e(r.y,n.y),e(r.z,n.z),e(r.w,n.w),m$G.getCartesian4());throw new t$U('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+r+" and "+n+".")}}function Y$u(e,t){return function(i,r,n,o){if(t&&"number"==typeof o){if("number"==typeof r&&"number"==typeof n)return e(r,n,o);if(r instanceof o$1k&&n instanceof o$1k)return o$1k.fromElements(e(r.x,n.x,o),e(r.y,n.y,o),m$G.getCartesian2());if(r instanceof t$X&&n instanceof t$X)return t$X.fromElements(e(r.x,n.x,o),e(r.y,n.y,o),e(r.z,n.z,o),m$G.getCartesian3());if(r instanceof e$25&&n instanceof e$25)return e$25.fromElements(e(r.x,n.x,o),e(r.y,n.y,o),e(r.z,n.z,o),e(r.w,n.w,o),m$G.getCartesian4())}if("number"==typeof r&&"number"==typeof n&&"number"==typeof o)return e(r,n,o);if(r instanceof o$1k&&n instanceof o$1k&&o instanceof o$1k)return o$1k.fromElements(e(r.x,n.x,o.x),e(r.y,n.y,o.y),m$G.getCartesian2());if(r instanceof t$X&&n instanceof t$X&&o instanceof t$X)return t$X.fromElements(e(r.x,n.x,o.x),e(r.y,n.y,o.y),e(r.z,n.z,o.z),m$G.getCartesian3());if(r instanceof e$25&&n instanceof e$25&&o instanceof e$25)return e$25.fromElements(e(r.x,n.x,o.x),e(r.y,n.y,o.y),e(r.z,n.z,o.z),e(r.w,n.w,o.w),m$G.getCartesian4());throw new t$U('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+r+", "+n+", and "+o+".")}}function re$p(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof o$1k)return o$1k.magnitude(t);if(t instanceof t$X)return t$X.magnitude(t);if(t instanceof e$25)return e$25.magnitude(t);throw new t$U('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function ae$o(e,t){if("number"==typeof t)return 1;if(t instanceof o$1k)return o$1k.normalize(t,m$G.getCartesian2());if(t instanceof t$X)return t$X.normalize(t,m$G.getCartesian3());if(t instanceof e$25)return e$25.normalize(t,m$G.getCartesian4());throw new t$U('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function ne$v(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof o$1k&&i instanceof o$1k)return o$1k.distance(t,i);if(t instanceof t$X&&i instanceof t$X)return t$X.distance(t,i);if(t instanceof e$25&&i instanceof e$25)return e$25.distance(t,i);throw new t$U('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function ie$r(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof o$1k&&i instanceof o$1k)return o$1k.dot(t,i);if(t instanceof t$X&&i instanceof t$X)return t$X.dot(t,i);if(t instanceof e$25&&i instanceof e$25)return e$25.dot(t,i);throw new t$U('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function ue$j(e,t,i){if(t instanceof t$X&&i instanceof t$X)return t$X.cross(t,i,m$G.getCartesian3());throw new t$U('Function "'+e+'" requires vec3 arguments. Arguments are '+t+" and "+i+".")}function u$A(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,we$i(this)}function se$l(e,t){if(!e$28(t))return e;for(var i in t)if(t.hasOwnProperty(i)){var r=new RegExp("\\$\\{"+i+"\\}","g"),n="("+t[i]+")";e$28(n)&&(e=e.replace(r,n))}return e}function le$m(e){return e.replace(J$H,W$C)}function d$J(e){return e.replace(Z$D,"\\")}function fe$k(e){for(var t=e,i="",r=t.indexOf("${");r>=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o<r)n=t.indexOf("'",o+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else if(a>=0&&a<r)n=t.indexOf('"',a+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else{i+=t.substr(0,r);var s=t.indexOf("}");if(s<0)throw new t$U("Unmatched {.");i+="czm_"+t.substr(r+2,s-(r+2)),r=(t=t.substr(s+1)).indexOf("${")}}return i+=t}function oe$n(e){var t=typeof e.value;return null===e.value?new u$A(s$y.LITERAL_NULL,null):"boolean"===t?new u$A(s$y.LITERAL_BOOLEAN,e.value):"number"===t?new u$A(s$y.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=0?new u$A(s$y.VARIABLE_IN_STRING,e.value):new u$A(s$y.LITERAL_STRING,d$J(e.value)):void 0}function ve$g(e,t){var i,r,n,o,a=t.arguments,s=a.length;if("MemberExpression"===t.callee.type){i=t.callee.property.name;var l=t.callee.object;if("test"===i||"exec"===i){if("regExp"!==l.callee.name)throw new t$U(i+" is not a function.");return 0===s?"test"===i?new u$A(s$y.LITERAL_BOOLEAN,!1):new u$A(s$y.LITERAL_NULL,null):(n=_$C(e,l),o=_$C(e,a[0]),new u$A(s$y.FUNCTION_CALL,i,n,o))}if("toString"===i)return r=_$C(e,l),new u$A(s$y.FUNCTION_CALL,i,r);throw new t$U('Unexpected function call "'+i+'".')}if("color"===(i=t.callee.name)){if(0===s)return new u$A(s$y.LITERAL_COLOR,i);if(r=_$C(e,a[0]),e$28(a[1])){var u=_$C(e,a[1]);return new u$A(s$y.LITERAL_COLOR,i,[r,u])}return new u$A(s$y.LITERAL_COLOR,i,[r])}if("rgb"===i||"hsl"===i){if(s<3)throw new t$U(i+" requires three arguments.");return r=[_$C(e,a[0]),_$C(e,a[1]),_$C(e,a[2])],new u$A(s$y.LITERAL_COLOR,i,r)}if("rgba"===i||"hsla"===i){if(s<4)throw new t$U(i+" requires four arguments.");return r=[_$C(e,a[0]),_$C(e,a[1]),_$C(e,a[2]),_$C(e,a[3])],new u$A(s$y.LITERAL_COLOR,i,r)}if("vec2"===i||"vec3"===i||"vec4"===i){r=new Array(s);for(var c=0;c<s;++c)r[c]=_$C(e,a[c]);return new u$A(s$y.LITERAL_VECTOR,i,r)}if("isNaN"===i||"isFinite"===i)return 0===s?new u$A(s$y.LITERAL_BOOLEAN,"isNaN"===i):(r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r));if("isExactClass"===i||"isClass"===i){if(s<1||s>1)throw new t$U(i+" requires exactly one argument.");return r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r)}if("getExactClassName"===i){if(s>0)throw new t$U(i+" does not take any argument.");return new u$A(s$y.UNARY,i)}if(e$28(C$D[i])){if(1!==s)throw new t$U(i+" requires exactly one argument.");return r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r)}if(e$28(O$x[i])){if(2!==s)throw new t$U(i+" requires exactly two arguments.");return n=_$C(e,a[0]),o=_$C(e,a[1]),new u$A(s$y.BINARY,i,n,o)}if(e$28(F$P[i])){if(3!==s)throw new t$U(i+" requires exactly three arguments.");n=_$C(e,a[0]),o=_$C(e,a[1]);var h=_$C(e,a[2]);return new u$A(s$y.TERNARY,i,n,o,h)}if("Boolean"===i)return 0===s?new u$A(s$y.LITERAL_BOOLEAN,!1):(r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r));if("Number"===i)return 0===s?new u$A(s$y.LITERAL_NUMBER,0):(r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r));if("String"===i)return 0===s?new u$A(s$y.LITERAL_STRING,""):(r=_$C(e,a[0]),new u$A(s$y.UNARY,i,r));if("regExp"===i)return ce$k(e,t);throw new t$U('Unexpected function call "'+i+'".')}function ce$k(e,t){var i=t.arguments;if(0===i.length)return new u$A(s$y.LITERAL_REGEX,new RegExp);var r,n=_$C(e,i[0]);if(i.length>1){var o=_$C(e,i[1]);if(U$E(n)&&U$E(o)){try{r=new RegExp(d$J(String(n._value)),o._value)}catch(e){throw new t$U(e)}return new u$A(s$y.LITERAL_REGEX,r)}return new u$A(s$y.REGEX,n,o)}if(U$E(n)){try{r=new RegExp(d$J(String(n._value)))}catch(e){throw new t$U(e)}return new u$A(s$y.LITERAL_REGEX,r)}return new u$A(s$y.REGEX,n)}function me$l(e){if(ye$j(e.name)){var t=ge$i(e.name);return"tiles3d_"===t.substr(0,8)?new u$A(s$y.BUILTIN_VARIABLE,t):new u$A(s$y.VARIABLE,t)}if("NaN"===e.name)return new u$A(s$y.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new u$A(s$y.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new u$A(s$y.LITERAL_UNDEFINED,void 0);throw new t$U(e.name+" is not defined.")}function he$i(e){var t=e.property.name;return"PI"===t?new u$A(s$y.LITERAL_NUMBER,Math.PI):"E"===t?new u$A(s$y.LITERAL_NUMBER,Math.E):void 0}function _e$h(e){if("POSITIVE_INFINITY"===e.property.name)return new u$A(s$y.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function pe$n(e,t){if("Math"===t.object.name)return he$i(t);if("Number"===t.object.name)return _e$h(t);var i,r=_$C(e,t.object);return t.computed?(i=_$C(e,t.property),new u$A(s$y.MEMBER,"brackets",r,i)):(i=new u$A(s$y.LITERAL_STRING,t.property.name),new u$A(s$y.MEMBER,"dot",r,i))}function U$E(e){return e._type>=s$y.LITERAL_NULL}function ye$j(e){return"czm_"===e.substr(0,4)}function ge$i(e){return e.substr(4)}function _$C(e,t){var i,r,n,o;if("Literal"===t.type)i=oe$n(t);else if("CallExpression"===t.type)i=ve$g(e,t);else if("Identifier"===t.type)i=me$l(t);else if("UnaryExpression"===t.type){r=t.operator;var a=_$C(e,t.argument);if(!(K$y.indexOf(r)>-1))throw new t$U('Unexpected operator "'+r+'".');i=new u$A(s$y.UNARY,r,a)}else if("BinaryExpression"===t.type){if(r=t.operator,n=_$C(e,t.left),o=_$C(e,t.right),!(G$K.indexOf(r)>-1))throw new t$U('Unexpected operator "'+r+'".');i=new u$A(s$y.BINARY,r,n,o)}else if("LogicalExpression"===t.type)r=t.operator,n=_$C(e,t.left),o=_$C(e,t.right),G$K.indexOf(r)>-1&&(i=new u$A(s$y.BINARY,r,n,o));else if("ConditionalExpression"===t.type){var s=_$C(e,t.test);n=_$C(e,t.consequent),o=_$C(e,t.alternate),i=new u$A(s$y.CONDITIONAL,"?",n,o,s)}else if("MemberExpression"===t.type)i=pe$n(e,t);else{if("ArrayExpression"!==t.type)throw"Compound"===t.type?new t$U("Provide exactly one expression."):new t$U("Cannot parse expression.");for(var l=[],u=0;u<t.elements.length;u++)l[u]=_$C(e,t.elements[u]);i=new u$A(s$y.ARRAY,l)}return i}function we$i(e){e._type===s$y.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===s$y.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===s$y.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluateGetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:e$28(C$D[e._value])&&(e.evaluate=Ae$j(e._value)):e._type===s$y.BINARY?"+"===e._value?e.evaluate=e._evaluatePlus:"-"===e._value?e.evaluate=e._evaluateMinus:"*"===e._value?e.evaluate=e._evaluateTimes:"/"===e._value?e.evaluate=e._evaluateDivide:"%"===e._value?e.evaluate=e._evaluateMod:"==="===e._value?e.evaluate=e._evaluateEqualsStrict:"!=="===e._value?e.evaluate=e._evaluateNotEqualsStrict:"<"===e._value?e.evaluate=e._evaluateLessThan:"<="===e._value?e.evaluate=e._evaluateLessThanOrEquals:">"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:e$28(O$x[e._value])&&(e.evaluate=Re$e(e._value)):e._type===s$y.TERNARY?e.evaluate=be$k(e._value):e._type===s$y.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===s$y.ARRAY?e.evaluate=e._evaluateArray:e._type===s$y.VARIABLE?e.evaluate=e._evaluateVariable:e._type===s$y.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===s$y.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===s$y.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===s$y.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===s$y.REGEX?e.evaluate=e._evaluateRegExp:e._type===s$y.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=Ee$h):e.evaluate=e._evaluateLiteral}function Ee$h(e){return e$28(e)?e.content.tileset.timeSinceLoad:0}function Ae$j(e){var t=C$D[e];return function(i){var r=this._left.evaluate(i);return t(e,r)}}function Re$e(e){var t=O$x[e];return function(i){var r=this._left.evaluate(i),n=this._right.evaluate(i);return t(e,r,n)}}function be$k(e){var t=F$P[e];return function(i){var r=this._left.evaluate(i),n=this._right.evaluate(i),o=this._test.evaluate(i);return t(e,r,n,o)}}function M$G(e,t){if(e$28(e))return e.getProperty(t)}function D$K(e){return"feature"===e._value}function k$F(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==s$y.LITERAL_NUMBER)return;var n=t[0]._value,o=t[1]._value,a=t[2]._value,s=4===i?t[3]._value:1;return e$1S.fromHsl(n,o,a,s,T$z)}function P$E(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==s$y.LITERAL_NUMBER)return;var n=T$z;return n.red=t[0]._value/255,n.green=t[1]._value/255,n.blue=t[2]._value/255,n.alpha=4===i?t[3]._value:1,n}function A$N(e){return e%1==0?e.toFixed(1):e.toString()}function Le$k(e){return"vec3("+A$N(e.red)+", "+A$N(e.green)+", "+A$N(e.blue)+")"}function S$w(e){return"vec4("+A$N(e.red)+", "+A$N(e.green)+", "+A$N(e.blue)+", "+A$N(e.alpha)+")"}function X$s(e,t,i,r){for(var n=e.length,o=new Array(n),a=0;a<n;++a)o[a]=e[a].getShaderExpression(t,i,r);return o}u$A.prototype._evaluateLiteral=function(){return this._value},u$A.prototype._evaluateLiteralColor=function(e){var t=T$z,i=this._left;if("color"===this._value)e$28(i)?i.length>1?(e$1S.fromCssColorString(i[0].evaluate(e),t),t.alpha=i[1].evaluate(e)):e$1S.fromCssColorString(i[0].evaluate(e),t):e$1S.fromBytes(255,255,255,255,t);else if("rgb"===this._value)e$1S.fromBytes(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),255,t);else if("rgba"===this._value){var r=255*i[3].evaluate(e);e$1S.fromBytes(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),r,t)}else"hsl"===this._value?e$1S.fromHsl(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),1,t):"hsla"===this._value&&e$1S.fromHsl(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),i[3].evaluate(e),t);return e$25.fromColor(t,m$G.getCartesian4())},u$A.prototype._evaluateLiteralVector=function(e){for(var t=m$G.getArray(),i=this._value,r=this._left,n=r.length,o=0;o<n;++o){var a=r[o].evaluate(e);if("number"==typeof a)t.push(a);else if(a instanceof o$1k)t.push(a.x,a.y);else if(a instanceof t$X)t.push(a.x,a.y,a.z);else{if(!(a instanceof e$25))throw new t$U(i+" argument must be a vector or number. Argument is "+a+".");t.push(a.x,a.y,a.z,a.w)}}var s=t.length,l=parseInt(i.charAt(3));if(0===s)throw new t$U("Invalid "+i+" constructor. No valid arguments.");if(s<l&&s>1)throw new t$U("Invalid "+i+" constructor. Not enough arguments.");if(s>l&&n>1)throw new t$U("Invalid "+i+" constructor. Too many arguments.");if(1===s){var u=t[0];t.push(u,u,u)}return"vec2"===i?o$1k.fromArray(t,0,m$G.getCartesian2()):"vec3"===i?t$X.fromArray(t,0,m$G.getCartesian3()):"vec4"===i?e$25.fromArray(t,0,m$G.getCartesian4()):void 0},u$A.prototype._evaluateLiteralString=function(){return this._value},u$A.prototype._evaluateVariableString=function(e){for(var t=this._value,i=V$v.exec(t);null!==i;){var r=i[0],n=M$G(e,i[1]);e$28(n)||(n=""),t=t.replace(r,n),i=V$v.exec(t)}return t},u$A.prototype._evaluateVariable=function(e){return M$G(e,this._value)},u$A.prototype._evaluateMemberDot=function(e){if(D$K(this._left))return M$G(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(e$28(t)){var i=this._right.evaluate(e);if(t instanceof o$1k||t instanceof t$X||t instanceof e$25){if("r"===i)return t.x;if("g"===i)return t.y;if("b"===i)return t.z;if("a"===i)return t.w}return t[i]}},u$A.prototype._evaluateMemberBrackets=function(e){if(D$K(this._left))return M$G(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(e$28(t)){var i=this._right.evaluate(e);if(t instanceof o$1k||t instanceof t$X||t instanceof e$25){if(0===i||"r"===i)return t.x;if(1===i||"g"===i)return t.y;if(2===i||"b"===i)return t.z;if(3===i||"a"===i)return t.w}return t[i]}},u$A.prototype._evaluateArray=function(e){for(var t=[],i=0;i<this._value.length;i++)t[i]=this._value[i].evaluate(e);return t},u$A.prototype._evaluateNot=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new t$U('Operator "!" requires a boolean argument. Argument is '+t+".");return!t},u$A.prototype._evaluateNegative=function(e){var t=this._left.evaluate(e);if(t instanceof o$1k)return o$1k.negate(t,m$G.getCartesian2());if(t instanceof t$X)return t$X.negate(t,m$G.getCartesian3());if(t instanceof e$25)return e$25.negate(t,m$G.getCartesian4());if("number"==typeof t)return-t;throw new t$U('Operator "-" requires a vector or number argument. Argument is '+t+".")},u$A.prototype._evaluatePositive=function(e){var t=this._left.evaluate(e);if(!(t instanceof o$1k||t instanceof t$X||t instanceof e$25||"number"==typeof t))throw new t$U('Operator "+" requires a vector or number argument. Argument is '+t+".");return t},u$A.prototype._evaluateLessThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t=parseFloat(t),i=parseFloat(i),"number"!=typeof t||"number"!=typeof i)throw new t$U('Operator "<" requires number arguments. Arguments are '+t+" and "+i+".");return t<i},u$A.prototype._evaluateLessThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t=parseFloat(t),i=parseFloat(i),"number"!=typeof t||"number"!=typeof i)throw new t$U('Operator "<=" requires number arguments. Arguments are '+t+" and "+i+".");return t<=i},u$A.prototype._evaluateGreaterThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t=parseFloat(t),i=parseFloat(i),"number"!=typeof t||"number"!=typeof i)throw new t$U('Operator ">" requires number arguments. Arguments are '+t+" and "+i+".");return t>i},u$A.prototype._evaluateGreaterThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t=parseFloat(t),i=parseFloat(i),"number"!=typeof t||"number"!=typeof i)throw new t$U('Operator ">=" requires number arguments. Arguments are '+t+" and "+i+".");return t>=i},u$A.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new t$U('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new t$U('Operator "||" requires boolean arguments. Second argument is '+i+".");return t||i},u$A.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new t$U('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new t$U('Operator "&&" requires boolean arguments. Second argument is '+i+".");return t&&i},u$A.prototype._evaluatePlus=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof o$1k&&t instanceof o$1k)return o$1k.add(t,i,m$G.getCartesian2());if(i instanceof t$X&&t instanceof t$X)return t$X.add(t,i,m$G.getCartesian3());if(i instanceof e$25&&t instanceof e$25)return e$25.add(t,i,m$G.getCartesian4());if("string"==typeof t||"string"==typeof i)return t+i;if("number"==typeof t&&"number"==typeof i)return t+i;throw new t$U('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateMinus=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof o$1k&&t instanceof o$1k)return o$1k.subtract(t,i,m$G.getCartesian2());if(i instanceof t$X&&t instanceof t$X)return t$X.subtract(t,i,m$G.getCartesian3());if(i instanceof e$25&&t instanceof e$25)return e$25.subtract(t,i,m$G.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t-i;throw new t$U('Operator "-" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateTimes=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof o$1k&&t instanceof o$1k)return o$1k.multiplyComponents(t,i,m$G.getCartesian2());if(i instanceof o$1k&&"number"==typeof t)return o$1k.multiplyByScalar(i,t,m$G.getCartesian2());if(t instanceof o$1k&&"number"==typeof i)return o$1k.multiplyByScalar(t,i,m$G.getCartesian2());if(i instanceof t$X&&t instanceof t$X)return t$X.multiplyComponents(t,i,m$G.getCartesian3());if(i instanceof t$X&&"number"==typeof t)return t$X.multiplyByScalar(i,t,m$G.getCartesian3());if(t instanceof t$X&&"number"==typeof i)return t$X.multiplyByScalar(t,i,m$G.getCartesian3());if(i instanceof e$25&&t instanceof e$25)return e$25.multiplyComponents(t,i,m$G.getCartesian4());if(i instanceof e$25&&"number"==typeof t)return e$25.multiplyByScalar(i,t,m$G.getCartesian4());if(t instanceof e$25&&"number"==typeof i)return e$25.multiplyByScalar(t,i,m$G.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t*i;throw new t$U('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateDivide=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof o$1k&&t instanceof o$1k)return o$1k.divideComponents(t,i,m$G.getCartesian2());if(t instanceof o$1k&&"number"==typeof i)return o$1k.divideByScalar(t,i,m$G.getCartesian2());if(i instanceof t$X&&t instanceof t$X)return t$X.divideComponents(t,i,m$G.getCartesian3());if(t instanceof t$X&&"number"==typeof i)return t$X.divideByScalar(t,i,m$G.getCartesian3());if(i instanceof e$25&&t instanceof e$25)return e$25.divideComponents(t,i,m$G.getCartesian4());if(t instanceof e$25&&"number"==typeof i)return e$25.divideByScalar(t,i,m$G.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t/i;throw new t$U('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateMod=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof o$1k&&t instanceof o$1k)return o$1k.fromElements(t.x%i.x,t.y%i.y,m$G.getCartesian2());if(i instanceof t$X&&t instanceof t$X)return t$X.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,m$G.getCartesian3());if(i instanceof e$25&&t instanceof e$25)return e$25.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,t.w%i.w,m$G.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t%i;throw new t$U('Operator "%" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateEqualsStrict=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof o$1k&&t instanceof o$1k||i instanceof t$X&&t instanceof t$X||i instanceof e$25&&t instanceof e$25?t.equals(i):("bigint"==typeof t&&(t=Number(t)),t===i)},u$A.prototype._evaluateNotEqualsStrict=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof o$1k&&t instanceof o$1k||i instanceof t$X&&t instanceof t$X||i instanceof e$25&&t instanceof e$25?!t.equals(i):t!==i},u$A.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new t$U("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return t?this._left.evaluate(e):this._right.evaluate(e)},u$A.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},u$A.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},u$A.prototype._evaluateIsExactClass=function(e){return!!e$28(e)&&e.isExactClass(this._left.evaluate(e))},u$A.prototype._evaluateIsClass=function(e){return!!e$28(e)&&e.isClass(this._left.evaluate(e))},u$A.prototype._evaluateGetExactClassName=function(e){if(e$28(e))return e.getExactClassName()},u$A.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},u$A.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},u$A.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},u$A.prototype._evaluateRegExp=function(e){var t,i=this._value.evaluate(e),r="";e$28(this._left)&&(r=this._left.evaluate(e));try{t=new RegExp(i,r)}catch(e){throw new t$U(e)}return t},u$A.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new t$U("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");return t.test(i)},u$A.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return t.test(i);if(i instanceof RegExp&&"string"==typeof t)return i.test(t);throw new t$U('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return!t.test(i);if(i instanceof RegExp&&"string"==typeof t)return!i.test(t);throw new t$U('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},u$A.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new t$U("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");var r=t.exec(i);return e$28(r)?r[1]:null},u$A.prototype._evaluateToString=function(e){var t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof o$1k||t instanceof t$X||t instanceof e$25)return String(t);throw new t$U('Unexpected function call "'+this._value+'".')};var $$C="czm_infinity";function y$E(e){e=u$Y(e,u$Y.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=u$Y(e.center,t$X.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilPreloadPass3DTiles=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=e$1S.clone(e$1S.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=u$Y(e.classificationType,L$V.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<t;++i){var r=this._batchIds[i];this._batchIdLookUp[r]=i}}u$A.prototype.getShaderExpression=function(e,t,i){var r,n,o,a,s=this._type,l=this._value;switch(e$28(this._left)&&(n=Array.isArray(this._left)?X$s(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),e$28(this._right)&&(o=this._right.getShaderExpression(e,t,this)),e$28(this._test)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=X$s(this._value,e,t,this)),s){case s$y.VARIABLE:return e+l;case s$y.UNARY:if("Boolean"===l)return"bool("+n+")";if("Number"===l)return"float("+n+")";if("round"===l)return"floor("+n+" + 0.5)";if(e$28(C$D[l]))return l+"("+n+")";if("isNaN"===l)return"("+n+" != "+n+")";if("isFinite"===l)return"(abs("+n+") < czm_infinity)";if("String"===l||"isExactClass"===l||"isClass"===l||"getExactClassName"===l)throw new t$U('Error generating style shader: "'+l+'" is not supported.');return e$28(C$D[l])?l+"("+n+")":l+n;case s$y.BINARY:return"%"===l?"mod("+n+", "+o+")":"==="===l?"("+n+" == "+o+")":"!=="===l?"("+n+" != "+o+")":"atan2"===l?"atan("+n+", "+o+")":e$28(O$x[l])?l+"("+n+", "+o+")":"("+n+" "+l+" "+o+")";case s$y.TERNARY:if(e$28(F$P[l]))return l+"("+n+", "+o+", "+a+")";break;case s$y.CONDITIONAL:return"("+a+" ? "+n+" : "+o+")";case s$y.MEMBER:return"r"===o||"x"===o||"0.0"===o?n+"[0]":"g"===o||"y"===o||"1.0"===o?n+"[1]":"b"===o||"z"===o||"2.0"===o?n+"[2]":"a"===o||"w"===o||"3.0"===o?n+"[3]":n+"[int("+o+")]";case s$y.FUNCTION_CALL:throw new t$U('Error generating style shader: "'+l+'" is not supported.');case s$y.ARRAY:if(4===l.length)return"vec4("+l[0]+", "+l[1]+", "+l[2]+", "+l[3]+")";if(3===l.length)return"vec3("+l[0]+", "+l[1]+", "+l[2]+")";if(2===l.length)return"vec2("+l[0]+", "+l[1]+")";throw new t$U("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case s$y.REGEX:throw new t$U("Error generating style shader: Regular expressions are not supported.");case s$y.VARIABLE_IN_STRING:throw new t$U("Error generating style shader: Converting a variable to a string is not supported.");case s$y.LITERAL_NULL:return $$C;case s$y.LITERAL_BOOLEAN:return l?"true":"false";case s$y.LITERAL_NUMBER:return A$N(l);case s$y.LITERAL_STRING:if(e$28(i)&&i._type===s$y.MEMBER&&("r"===l||"g"===l||"b"===l||"a"===l||"x"===l||"y"===l||"z"===l||"w"===l))return l;if(e$28(r=e$1S.fromCssColorString(l,T$z)))return Le$k(r);throw new t$U("Error generating style shader: String literals are not supported.");case s$y.LITERAL_COLOR:var u=n;if("color"===l){if(!e$28(u))return"vec4(1.0)";if(u.length>1){var c=u[0],h=u[1];return"1.0"!==h&&(t.translucent=!0),"vec4("+c+", "+h+")"}return"vec4("+u[0]+", 1.0)"}if("rgb"===l)return e$28(r=P$E(this))?S$w(r):"vec4("+u[0]+" / 255.0, "+u[1]+" / 255.0, "+u[2]+" / 255.0, 1.0)";if("rgba"===l)return"1.0"!==u[3]&&(t.translucent=!0),e$28(r=P$E(this))?S$w(r):"vec4("+u[0]+" / 255.0, "+u[1]+" / 255.0, "+u[2]+" / 255.0, "+u[3]+")";if("hsl"===l)return e$28(r=k$F(this))?S$w(r):"vec4(czm_HSLToRGB(vec3("+u[0]+", "+u[1]+", "+u[2]+")), 1.0)";if("hsla"===l)return e$28(r=k$F(this))?(1!==r.alpha&&(t.translucent=!0),S$w(r)):("1.0"!==u[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+u[0]+", "+u[1]+", "+u[2]+")), "+u[3]+")");break;case s$y.LITERAL_VECTOR:if(!e$28(n))throw new t$Z("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");for(var d=n.length,f=l+"(",p=0;p<d;++p)f+=n[p],p<d-1&&(f+=", ");return f+=")";case s$y.LITERAL_REGEX:throw new t$U("Error generating style shader: Regular expressions are not supported.");case s$y.LITERAL_UNDEFINED:return $$C;case s$y.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===l)return"u_time"}},Object.defineProperties(y$E.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var te$s={position:0,a_batchId:1};function se$k(e,t){if(!e$28(e._va)){var i=h$W.createVertexBuffer({context:t,typedArray:e._positions,usage:A$1c.STATIC_DRAW}),r=h$W.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:A$1c.STATIC_DRAW}),n=h$W.createIndexBuffer({context:t,typedArray:e._indices,usage:A$1c.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?ce$v.UNSIGNED_SHORT:ce$v.UNSIGNED_INT}),o=[{index:0,vertexBuffer:i,componentDatatype:S$W.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:r,componentDatatype:S$W.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new m$19({context:t,attributes:o,indexBuffer:n}),t.webgl2&&(e._vaSwap=new m$19({context:t,attributes:o,indexBuffer:h$W.createIndexBuffer({context:t,sizeInBytes:n.sizeInBytes,usage:A$1c.DYNAMIC_DRAW,indexDatatype:n.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}}function ne$u(e,t){if(!e$28(e._sp)){var i=e._batchTable,r=u$Y(e._attributeLocations,te$s),n=e._pickId,o=e._vertexShaderSource,a=e._fragmentShaderSource;if(e$28(o))return e._sp=S$T.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}),e._spStencil=e._sp,a=(a=a$$.replaceMain(a,"czm_non_pick_main"))+"void main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n",void(e._spPick=S$T.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:r}));var s=i.getVertexShaderCallback(!1,"a_batchId",void 0)(G$L),l=i.getFragmentShaderCallback()(Q$I,!1,void 0);n=i.getPickId();var u=new a$$({sources:[s]}),c=new a$$({defines:["VECTOR_TILE"],sources:[l]});e._sp=S$T.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:r}),u=new a$$({sources:[G$L]}),c=new a$$({defines:["VECTOR_TILE"],sources:[Q$I]}),e._spStencil=S$T.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:r}),l=(l=a$$.replaceMain(l,"czm_non_pick_main"))+"\nvoid main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n";var h=new a$$({sources:[s]}),d=new a$$({defines:["VECTOR_TILE"],sources:[l]});e._spPick=S$T.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:r})}}function m$F(e){var t=e?m$12.EQUAL:m$12.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.DECREMENT_WRAP},backFunction:t,backOperation:{fail:n$12.KEEP,zFail:n$12.INCREMENT_WRAP,zPass:n$12.INCREMENT_WRAP},reference:Fa$6.CESIUM_3D_TILE_MASK,mask:Fa$6.CESIUM_3D_TILE_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1}}function J$G(e){var t=e?m$12.EQUAL:m$12.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.INCREMENT_WRAP},backFunction:t,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:Fa$6.CESIUM_3D_TILE_MASK,mask:Fa$6.CESIUM_3D_TILE_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Me$l.LESS_OR_EQUAL},depthMask:!1}}var oe$m={stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:Fa$6.CLASSIFICATION_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Ee$n.ALPHA_BLEND},fe$j={stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:Fa$6.CLASSIFICATION_MASK},stencilMask:Fa$6.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function ce$j(e){e$28(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=u$R.fromCache(m$F(!1)),e._rsStencilPreloadPass3DTiles=u$R.fromCache(m$F(!0)),e._rsStencilDepthPass=u$R.fromCache(J$G(!1)),e._rsStencilDepthPass3DTiles=u$R.fromCache(J$G(!0)),e._rsColorPass=u$R.fromCache(oe$m),e._rsPickPass=u$R.fromCache(fe$j))}var w$t=new y$15,Z$C=new t$X;function _e$g(e,t){if(!e$28(e._uniformMap)){var i={u_modifiedModelViewProjection:function(){var i=t.uniformState.view,r=t.uniformState.projection;return y$15.clone(i,w$t),y$15.multiplyByPoint(w$t,e._center,Z$C),y$15.setTranslation(w$t,Z$C,w$t),y$15.multiply(r,w$t,w$t),w$t},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(i)}}function U$D(e,t,i,r,n,o,a){for(var s=e.constructor.BYTES_PER_ELEMENT,l=o.length,u=0;u<l;++u){var c=a[o[u]],h=r[c],d=n[c],f=new e.constructor(e.buffer,s*h,d);t.set(f,i),r[c]=i,i+=d}return i}function ue$i(e,t){var i=e._indices,r=e._indexOffsets,n=e._indexCounts,o=e._batchIdLookUp,a=new i.constructor(i.length),s=t.pop(),l=[s],u=U$D(i,a,0,r,n,s.batchIds,o);for(s.offset=0,s.count=u;t.length>0;){var c=t.pop();if(e$1S.equals(c.color,s.color))u=U$D(i,a,u,r,n,c.batchIds,o),s.batchIds=s.batchIds.concat(c.batchIds),s.count=u-s.offset;else{var h=u;u=U$D(i,a,u,r,n,c.batchIds,o),c.offset=h,c.count=u-h,l.push(c),s=c}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=l}function B$v(e,t,i,r,n,o,a){for(var s=e.bytesPerIndex,l=o.length,u=0;u<l;++u){var c=a[o[u]],h=r[c],d=n[c];t.copyFromBuffer(e,h*s,i*s,d*s),r[c]=i,i+=d}return i}function he$h(e,t){var i=e._indexOffsets,r=e._indexCounts,n=e._batchIdLookUp,o=t.pop(),a=[o],s=e._va.indexBuffer,l=e._vaSwap.indexBuffer,u=B$v(s,l,0,i,r,o.batchIds,n);for(o.offset=0,o.count=u;t.length>0;){var c=t.pop();if(e$1S.equals(c.color,o.color))u=B$v(s,l,u,i,r,c.batchIds,n),o.batchIds=o.batchIds.concat(c.batchIds),o.count=u-o.offset;else{var h=u;u=B$v(s,l,u,i,r,c.batchIds,n),c.offset=h,c.count=u-h,a.push(c),o=c}}var d=e._va;e._va=e._vaSwap,e._vaSwap=d,e._batchedIndices=a}function de$j(e,t){return t.color.toRgba()-e.color.toRgba()}function le$l(e,t){if(!e._batchDirty)return!1;for(var i=e._batchedIndices,r=i.length,n=!1,o={},a=0;a<r;++a){var s=i[a].color.toRgba();if(e$28(o[s])){n=!0;break}o[s]=!0}return n?n&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(i.sort(de$j),t.webgl2?he$h(e,i):ue$i(e,i),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0):(e._batchDirty=!1,!1)}function ie$q(e,t){var i=le$l(e,t),r=e._commands,n=e._batchedIndices,o=n.length,a=3*o;if(!e$28(r)||i||r.length!==a){r.length=a;for(var s=e._va,l=e._sp,u=u$Y(e._modelMatrix,y$15.IDENTITY),c=e._uniformMap,h=e._boundingVolume,d=0;d<o;++d){var f=n[d].offset,p=n[d].count,_=r[3*d];e$28(_)||(_=r[3*d]=new r$15({owner:e})),_.vertexArray=s,_.modelMatrix=u,_.offset=f,_.count=p,_.renderState=e._rsStencilPreloadPass,_.shaderProgram=l,_.uniformMap=c,_.boundingVolume=h,_.cull=!1,_.pass=Le$p.TERRAIN_CLASSIFICATION;var m=r$15.shallowClone(_,_.derivedCommands.tileset);m.renderState=e._rsStencilPreloadPass3DTiles,m.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=m;var $=r[3*d+1];e$28($)||($=r[3*d+1]=new r$15({owner:e})),$.vertexArray=s,$.modelMatrix=u,$.offset=f,$.count=p,$.renderState=e._rsStencilDepthPass,$.shaderProgram=l,$.uniformMap=c,$.boundingVolume=h,$.cull=!1,$.pass=Le$p.TERRAIN_CLASSIFICATION;var g=r$15.shallowClone($,$.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,$.derivedCommands.tileset=g;var v=r[3*d+2];e$28(v)||(v=r[3*d+2]=new r$15({owner:e})),v.vertexArray=s,v.modelMatrix=u,v.offset=f,v.count=p,v.renderState=e._rsColorPass,v.shaderProgram=l,v.uniformMap=c,v.boundingVolume=h,v.cull=!1,v.pass=Le$p.TERRAIN_CLASSIFICATION;var y=r$15.shallowClone(v,v.derivedCommands.tileset);y.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,v.derivedCommands.tileset=y}e._commandsDirty=!0}}function Ie$i(e,t){if(e.classificationType!==L$V.TERRAIN&&t.invertClassification&&(!e$28(e._commandsIgnoreShow)||e._commandsDirty)){for(var i=e._commands,r=e._commandsIgnoreShow,n=e._spStencil,o=i.length,a=r.length=o/3*2,s=0,l=0;l<a;l+=2){var u=r[l]=r$15.shallowClone(i[s],r[l]);u.shaderProgram=n,u.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,(u=r[l+1]=r$15.shallowClone(i[s+1],r[l+1])).shaderProgram=n,u.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=3}e._commandsDirty=!1}}function Se$b(e){if(e._pickCommandsDirty){var t=e._indexOffsets.length,i=e._pickCommands;i.length=3*t;for(var r=e._va,n=e._spStencil,o=e._spPick,a=u$Y(e._modelMatrix,y$15.IDENTITY),s=e._uniformMap,l=0;l<t;++l){var u=e._indexOffsets[l],c=e._indexCounts[l],h=e$28(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,d=i[3*l];e$28(d)||(d=i[3*l]=new r$15({owner:e,pickOnly:!0})),d.vertexArray=r,d.modelMatrix=a,d.offset=u,d.count=c,d.renderState=e._rsStencilPreloadPass,d.shaderProgram=n,d.uniformMap=s,d.boundingVolume=h,d.pass=Le$p.TERRAIN_CLASSIFICATION;var f=r$15.shallowClone(d,d.derivedCommands.tileset);f.renderState=e._rsStencilPreloadPass3DTiles,f.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=f;var p=i[3*l+1];e$28(p)||(p=i[3*l+1]=new r$15({owner:e,pickOnly:!0})),p.vertexArray=r,p.modelMatrix=a,p.offset=u,p.count=c,p.renderState=e._rsStencilDepthPass,p.shaderProgram=n,p.uniformMap=s,p.boundingVolume=h,p.pass=Le$p.TERRAIN_CLASSIFICATION;var _=r$15.shallowClone(p,p.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=_;var m=i[3*l+2];e$28(m)||(m=i[3*l+2]=new r$15({owner:e,pickOnly:!0})),m.vertexArray=r,m.modelMatrix=a,m.offset=u,m.count=c,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=s,m.boundingVolume=h,m.pass=Le$p.TERRAIN_CLASSIFICATION;var $=r$15.shallowClone(m,m.derivedCommands.tileset);$.pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=$}e._pickCommandsDirty=!1}}function be$j(e,t){e._updatingAllCommands=!0;var i,r=e._batchIds,n=r.length;for(i=0;i<n;++i){var o=t[r[i]];o.show=!0,o.color=e$1S.WHITE}var a=e._batchedIndices;for(n=a.length,i=0;i<n;++i)a[i].color=e$1S.clone(e$1S.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}y$E.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=i[n];t[o]=new e$10(e,o)}},y$E.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var ge$h=new e$1S,Ee$g=e$1S.WHITE,Te$h=!0,Ae$i=/\$/;function $$B(e,t,i,r){var n,o,a=e.classificationType,s=a!==L$V.CESIUM_3D_TILE,l=a!==L$V.TERRAIN,u=t.commandList,c=i.length;for(o=0;o<c;++o)s&&((n=i[o]).pass=Le$p.TERRAIN_CLASSIFICATION,u.push(n)),l&&((n=i[o].derivedCommands.tileset).pass=Le$p.CESIUM_3D_TILE_CLASSIFICATION,u.push(n));if(t.invertClassification&&e$28(r))for(c=r.length,o=0;o<c;++o)u.push(r[o])}function ve$f(e,t){for(var i=e.commandList,r=t.length,n=0;n<r;n+=3){var o=t[n+2];o.pass=Le$p.OPAQUE,i.push(o)}}function Le$j(e){var t=e.debugWireframe===e._debugWireframe;if(!(t=t&&!(e.debugWireframe&&e._wireframeDirty))){var i,r;e$28(e._rsWireframe)||(e._rsWireframe=u$R.fromCache({})),e.debugWireframe?(i=e._rsWireframe,r=W$_.LINES):(i=e._rsColorPass,r=W$_.TRIANGLES);for(var n=e._commands,o=n.length,a=0;a<o;a+=3){var s=n[a+2];s.renderState=i,s.primitiveType=r}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}}y$E.prototype.applyStyle=function(e,t){if(e$28(e)){var i=e.color,r=i instanceof L$J&&!Ae$i.test(i.expression);this._updatingAllCommands=r;var n,o=this._batchIds,a=o.length;for(n=0;n<a;++n){var s=t[o[n]];s.color=e$28(e.color)?e.color.evaluateColor(s,ge$h):Ee$g,s.show=e$28(e.show)?e.show.evaluate(s):Te$h}if(r){var l=this._batchedIndices;for(a=l.length,n=0;n<a;++n)l[n].color=e$1S.clone(e$1S.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}}else be$j(this,t)},y$E.prototype.updateCommands=function(e,t){if(!this._updatingAllCommands){var i=this._batchIdLookUp,r=i[e];if(e$28(r)){var n,o=this._indexOffsets,a=this._indexCounts,s=o[r],l=a[r],u=this._batchedIndices,c=u.length;for(n=0;n<c;++n){var h=u[n].offset,d=u[n].count;if(s>=h&&s<h+d)break}u.push(new c$F({color:e$1S.clone(t),offset:s,count:l,batchIds:[e]}));for(var f=[],p=[],_=u[n].batchIds,m=_.length,$=0;$<m;++$){var g=_[$];if(g!==e)o[i[g]]<s?f.push(g):p.push(g)}0!==p.length&&u.push(new c$F({color:e$1S.clone(u[n].color),offset:s+l,count:u[n].offset+u[n].count-(s+l),batchIds:p})),0!==f.length?(u[n].count=s-u[n].offset,u[n].batchIds=f):u.splice(n,1),this._batchDirty=!0}}},y$E.prototype.update=function(e){var t=e.context;se$k(this,t),ne$u(this,t),ce$j(this),_e$g(this,t);var i=e.passes;i.render&&(ie$q(this,t),Ie$i(this,e),Le$j(this),this._debugWireframe?ve$f(e,this._commands):$$B(this,e,this._commands,this._commandsIgnoreShow)),i.pick&&(Se$b(this),$$B(this,e,this._pickCommands))},y$E.prototype.isDestroyed=function(){return!1},y$E.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),i$Z(this)};var Ee$f=new t$X,y$D=s$z.ModelState;function A$M(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).gltf;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),!(t instanceof Uint8Array))throw new t$U("Only binary glTF is supported as a classifier.");re$q(t=O$z(t)),E$K(t),ue$k(t),he$j(t),e$$.buffer(t,(function(e){if(!e$28(e.extras._pipeline.source))throw new t$U("Buffer data must be embedded in the binary gltf.")}));var i=t.nodes,r=t.meshes,n=i[0].mesh;if(1!==i.length||!e$28(n))throw new t$U("Only one node is supported for classification and it must have a mesh.");if(1!==r.length)throw new t$U("Only one mesh is supported when using b3dm for classification.");var o=r[0].primitives;if(1!==o.length)throw new t$U("Only one primitive per mesh is supported when using b3dm for classification.");if(!e$28(o[0].attributes.POSITION))throw new t$U("The mesh must have a position attribute.");if(!e$28(o[0].attributes._BATCHID))throw new t$U("The mesh must have a batch id attribute.");this._gltf=t,this.show=u$Y(e.show,!0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(this.modelMatrix),this._ready=!1,this._readyPromise=o$1q.defer(),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=u$Y(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=u$Y(e.ignoreCommands,!1),this._upAxis=u$Y(e.upAxis,z$z.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new y$15,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new i$19,this._state=y$D.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new y$15,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function Ce$g(e){var t=e.gltf,i=e._loadResources;e$$.buffer(t,(function(e,t){i.buffers[t]=e.extras._pipeline.source}))}function Be$k(e){var t=e.gltf.bufferViews,i=e._loadResources.vertexBuffersToCreate;e$$.bufferView(e.gltf,(function(e,t){e.target===de$y.ARRAY_BUFFER&&i.enqueue(t)}));var r=e._loadResources.indexBuffersToCreate,n={};e$$.accessor(e.gltf,(function(e){var i=e.bufferView;t[i].target===de$y.ELEMENT_ARRAY_BUFFER&&!e$28(n[i])&&(n[i]=!0,r.enqueue({id:i,componentType:e.componentType}))}))}function Le$i(e,t){var i=t._loadResources,r=t.gltf.bufferViews[e],n=i.getBuffer(r);t._buffers[e]=n,t._geometryByteLength+=n.byteLength}function Oe$g(e,t,i){var r=i._loadResources,n=i.gltf.bufferViews[e],o={typedArray:r.getBuffer(n),indexDatatype:t};i._buffers[e]=o,i._geometryByteLength+=o.typedArray.byteLength}function Ae$h(e){var t=e._loadResources;if(0===t.pendingBufferLoads){for(var i=t.vertexBuffersToCreate,r=t.indexBuffersToCreate;i.length>0;)Le$i(i.dequeue(),e);for(;r.length>0;){var n=r.dequeue();Oe$g(n.id,n.componentType,e)}}}function Me$i(e,t){var i=t.gltf.meshes[0].primitives[0],r=s$z.modifyShaderForQuantizedAttributes(t.gltf,i,e);return t._quantizedUniforms=r.uniforms,r.shader}function ne$t(e,t){return e$28(t)&&(e=t(e)),e}function we$h(e){var t=e.gltf,i=s$z.getAttributeOrUniformBySemantic(t,"POSITION"),r=s$z.getAttributeOrUniformBySemantic(t,"_BATCHID"),n={};n[i]=0,n[r]=1;var o,a,s=s$z.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION");if(e$28(s))o="uniform mat4 "+s+";\n",a=s+" * vec4("+i+", 1.0)";else{var l=s$z.getAttributeOrUniformBySemantic(t,"PROJECTION"),u=s$z.getAttributeOrUniformBySemantic(t,"MODELVIEW");e$28(u)||(u=s$z.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW")),o="uniform mat4 "+u+";\nuniform mat4 "+l+";\n",a=l+" * "+u+" * vec4("+i+", 1.0)"}var c="attribute vec3 "+i+";\nattribute float "+r+";\n"+o+"void main() {\n"+(" vec4 positionInClipCoords = "+a+";\n")+" gl_Position = czm_depthClampFarPlane(positionInClipCoords);\n}\n";e.extensionsUsed.WEB3D_quantized_attributes&&(c=Me$i(c,e));var h=ne$t(c,e._vertexShaderLoaded),d=ne$t("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeDepthClampedToFarPlane();\n}\n",e._classificationShaderLoaded);h=s$z.modifyVertexShaderForLogDepth(h,a),d=s$z.modifyFragmentShaderForLogDepth(d),e._shaderProgram={vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:n}}function De$l(){return{POSITION:0,_BATCHID:1}}function Re$d(e){if(e._loadResources.finishedBuffersCreation()&&!e$28(e._vertexArray)){var t,i=e._buffers,r=e.gltf,n=r.accessors,o=r.meshes[0].primitives[0],a=De$l(),s={};if(e$$.meshPrimitiveAttribute(o,(function(e,t){var o=a[t];if(e$28(o)){var l=n[e];s[t]={index:o,vertexBuffer:i[l.bufferView],componentsPerAttribute:r$F(l.type),componentDatatype:l.componentType,offsetInBytes:l.byteOffset,strideInBytes:p$G(r,l)}}})),e$28(o.indices)){var l=n[o.indices];t=i[l.bufferView]}e._vertexArray={attributes:s,indexBuffer:t}}}Object.defineProperties(A$M.prototype,{gltf:{get:function(){return this._gltf}},boundingSphere:{get:function(){if(this._state!==y$D.LOADED)throw new t$Z("The model is not loaded. Use ClassificationModel.readyPromise or wait for ClassificationModel.ready to be true.");var e=this.modelMatrix,t=y$15.getScale(e,Ee$f),i=this._scaledBoundingSphere;return i.center=t$X.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=t$X.maximumComponent(t)*this._initialRadius,e$28(this._rtcCenter)&&t$X.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return e$28(this._extensionsUsed)||(this._extensionsUsed=s$z.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return e$28(this._extensionsRequired)||(this._extensionsRequired=s$z.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});var se$j={PROJECTION:function(e,t){return s$z.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return s$z.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return s$z.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return s$z.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function Pe$f(e,t){if(!e$28(e._uniformMap)){var i={};e$$.technique(e.gltf,(function(r){e$$.techniqueUniform(r,(function(r,n){!e$28(r.semantic)||!e$28(se$j[r.semantic])||(i[n]=se$j[r.semantic](t.uniformState,e))}))})),e._uniformMap=i}}function Ue$i(e,t){return s$z.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function Ve$h(e,t){switch(e.mode){case W$_.TRIANGLES:return t/3;case W$_.TRIANGLE_STRIP:case W$_.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Ne$9(e){var t,i,r=e._batchTable,n=e._uniformMap,o=e._vertexArray,a=e.gltf,s=a.accessors,l=a.meshes[0].primitives[0],u=s[l.indices],c=l.attributes.POSITION,h=s$z.getAccessorMinMax(a,c),d=i$19.fromCornerPoints(t$X.fromArray(h.min),t$X.fromArray(h.max));e$28(u)?(i=u.count,t=u.byteOffset/ce$v.getSizeInBytes(u.componentType)):(i=s[l.attributes.POSITION].count,t=0);(e._trianglesLength+=Ve$h(l,i),e$28(e._uniformMapLoaded)&&(n=e._uniformMapLoaded(n)),e.extensionsUsed.WEB3D_quantized_attributes)&&(n=p$17(n,Ue$i(e,l)));var f=o.attributes.POSITION,p=f.componentDatatype,_=f.vertexBuffer,m=_.byteOffset,$=_.byteLength/S$W.getSizeInBytes(p),g=S$W.createArrayBufferView(p,_.buffer,m,$);p=(f=o.attributes._BATCHID).componentDatatype,m=(_=f.vertexBuffer).byteOffset,$=_.byteLength/S$W.getSizeInBytes(p);var v,y=S$W.createArrayBufferView(p,_.buffer,m,$),x=o.indexBuffer.typedArray;v=o.indexBuffer.indexDatatype===ce$v.UNSIGNED_SHORT?new Uint16Array(x.buffer,x.byteOffset,x.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(x.buffer,x.byteOffset,x.byteLength/Uint32Array.BYTES_PER_ELEMENT),g=l$12(g);var b=[],w=[],C=[],T=[],S=(y=l$12(y))[(v=l$12(v,t,t+i))[0]];b.push(S),C.push(0);for(var E,A,P,I=v.length,M=1;M<I;++M)(E=y[v[M]])!==S&&(P=M-(A=C[C.length-1]),b.push(E),w.push(P),C.push(M),T.push(new c$F({offset:A,count:P,batchIds:[S],color:e$1S.WHITE})),S=E);P=I-(A=C[C.length-1]),w.push(P),T.push(new c$F({offset:A,count:P,batchIds:[S],color:e$1S.WHITE}));var O=e._shaderProgram,D=O.vertexShaderSource,R=O.fragmentShaderSource,L=O.attributeLocations,B=e$28(e._pickIdLoaded)?e._pickIdLoaded():void 0;e._primitive=new y$E({classificationType:e._classificationType,positions:g,indices:v,indexOffsets:C,indexCounts:w,batchIds:b,vertexBatchIds:y,batchedIndices:T,batchTable:r,boundingVolume:new i$19,_vertexShaderSource:D,_fragmentShaderSource:R,_attributeLocations:L,_uniformMap:n,_pickId:B,_modelMatrix:new y$15,_boundingSphere:d}),e._buffers=void 0,e._vertexArray=void 0,e._shaderProgram=void 0,e._uniformMap=void 0}function We$f(e){if(e._loadResources.finished()&&!e$28(e._primitive)){var t=e.gltf.nodes[0];e._nodeMatrix=s$z.getTransform(t,e._nodeMatrix),Ne$9(e)}}function ae$n(e,t){var i=t.context;s$z.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,i),Ae$h(e),we$h(e),Re$d(e),Pe$f(e,i),We$f(e)}var Fe$d=new e$25,Z$B=new y$15;function qe$b(e,t,i,r){var n=e._computedModelMatrix;if(e._mode!==P$$.SCENE3D&&!e._ignoreCommands){var o=y$15.getColumn(n,3,Fe$d);if(e$25.equals(o,e$25.UNIT_W)){var a=e.boundingSphere.center,s=m$1b.wgs84To2DModelMatrix(r,a,Z$B);n=y$15.multiply(s,n,Z$B),e$28(e._rtcCenter)&&(y$15.setTranslation(n,e$25.UNIT_W,n),e._rtcCenter=e._rtcCenter2D)}else n=m$1b.basisTo2D(r,n,Z$B),e._rtcCenter=e._rtcCenter3D}var l=e._primitive;(t||i)&&(y$15.multiplyTransformation(n,e._nodeMatrix,l._modelMatrix),i$19.transform(l._boundingSphere,l._modelMatrix,l._boundingVolume),e$28(e._rtcCenter)&&t$X.add(e._rtcCenter,l._boundingVolume.center,l._boundingVolume.center))}function a$D(e,t){o$1u.typeOf.object("normal",e),o$1u.typeOf.number("distance",t),this._distance=t,this._normal=new s$x(e,this),this.onChangeCallback=void 0,this.index=-1}function s$x(e,t){this._clippingPlane=t,this._cartesian3=t$X.clone(e)}function h$C(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=u$Y(e.enabled,!0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this.edgeColor=e$1S.clone(u$Y(e.edgeColor,e$1S.WHITE)),this.edgeWidth=u$Y(e.edgeWidth,0),this.planeAdded=new o$1o,this.planeRemoved=new o$1o,this._owner=void 0;var t=u$Y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?C$C:P$D,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;var i=e.planes;if(e$28(i))for(var r=i.length,n=0;n<r;++n)this.add(i[n])}function C$C(e){return e===pt$a.OUTSIDE}function P$D(e){return e===pt$a.INSIDE}function F$O(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function D$J(e,t){for(var i=e.length,r=0;r<i;++r)if(o$1i.equals(e[r],t))return r;return-1}A$M.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},A$M.prototype.update=function(e){if(e.mode!==P$$.MORPHING){var t=s$V.supportsWebPSync();if(e$28(t)){if(this._state===y$D.NEEDS_LOAD&&e$28(this.gltf)&&(this._state=y$D.LOADING,this._state!==y$D.FAILED)){var i=this.gltf.extensions;if(e$28(i)&&e$28(i.CESIUM_RTC)){var r=t$X.fromArray(i.CESIUM_RTC.center);if(!t$X.equals(r,t$X.ZERO)){this._rtcCenter3D=r;var n=e.mapProjection,o=n.ellipsoid.cartesianToCartographic(this._rtcCenter3D),a=n.project(o);t$X.fromElements(a.z,a.x,a.y,a),this._rtcCenter2D=a,this._rtcCenterEye=new t$X,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new t$v,s$z.parseBuffers(this)}var s=this._loadResources,l=!1;this._state===y$D.LOADING&&(0===s.pendingBufferLoads&&(s$z.checkSupportedExtensions(this.extensionsRequired,t),Ce$g(this),Be$k(this),this._boundingSphere=s$z.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,ae$n(this,e)),s.finished()&&(this._state=y$D.LOADED,l=!0)),e$28(s)&&this._state===y$D.LOADED&&(l||ae$n(this,e),s.finished()&&(this._loadResources=void 0));var u=this.show;if(u&&this._state===y$D.LOADED||l){this._dirty=!1;var c=this.modelMatrix,h=e.mode!==this._mode;this._mode=e.mode;var d=!y$15.equals(this._modelMatrix,c)||h;if(d||l){y$15.clone(c,this._modelMatrix);var f=this._computedModelMatrix;y$15.clone(c,f),this._upAxis===z$z.Y?y$15.multiplyTransformation(f,z$z.Y_UP_TO_Z_UP,f):this._upAxis===z$z.X&&y$15.multiplyTransformation(f,z$z.X_UP_TO_Z_UP,f)}(d||l)&&(qe$b(this,d,l,e.mapProjection),this._dirty=!0)}if(l){var p=this;return void e.afterRender.push((function(){p._ready=!0,p._readyPromise.resolve(p)}))}u&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))}}},A$M.prototype.isDestroyed=function(){return!1},A$M.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i$Z(this)},Object.defineProperties(a$D.prototype,{distance:{get:function(){return this._distance},set:function(e){o$1u.typeOf.number("value",e),e$28(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){o$1u.typeOf.object("value",e),e$28(this.onChangeCallback)&&!t$X.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),t$X.clone(e,this._normal._cartesian3)}}}),a$D.fromPlane=function(e,t){return o$1u.typeOf.object("plane",e),e$28(t)?(t.normal=e.normal,t.distance=e.distance):t=new a$D(e.normal,e.distance),t},a$D.clone=function(e,t){return e$28(t)?(t.normal=e.normal,t.distance=e.distance,t):new a$D(e.normal,e.distance)},Object.defineProperties(s$x.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){o$1u.typeOf.number("value",e),e$28(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){o$1u.typeOf.number("value",e),e$28(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){o$1u.typeOf.number("value",e),e$28(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}}),Object.defineProperties(h$C.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?C$C:P$D)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}}),h$C.prototype.add=function(e){var t=this._planes.length,i=this;e.onChangeCallback=function(e){F$O(i,e)},e.index=t,F$O(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},h$C.prototype.get=function(e){return o$1u.typeOf.number("index",e),this._planes[e]},h$C.prototype.contains=function(e){return-1!==D$J(this._planes,e)},h$C.prototype.remove=function(e){var t=this._planes,i=D$J(t,e);if(-1===i)return!1;e instanceof a$D&&(e.onChangeCallback=void 0,e.index=-1);for(var r=t.length-1,n=i;n<r;++n){var o=t[n+1];t[n]=o,o instanceof a$D&&(o.index=n)}return this._multipleDirtyPlanes=!0,t.length=r,this.planeRemoved.raiseEvent(e,i),!0},h$C.prototype.removeAll=function(){for(var e=this._planes,t=e.length,i=0;i<t;++i){var r=e[i];r instanceof a$D&&(r.onChangeCallback=void 0,r.index=-1),this.planeRemoved.raiseEvent(r,i)}this._multipleDirtyPlanes=!0,this._planes=[]};var j$C=new e$25,k$E=new e$25;function V$u(e,t,i){for(var r=e._uint8View,n=e._planes,o=0,a=t;a<i;++a){var s=n[a],l=t$N.octEncodeToCartesian4(s.normal,k$E);r[o]=l.x,r[o+1]=l.y,r[o+2]=l.z,r[o+3]=l.w;var u=e$25.packFloat(s.distance,j$C);r[o+4]=u.x,r[o+5]=u.y,r[o+6]=u.z,r[o+7]=u.w,o+=8}}function M$F(e,t,i){for(var r=e._float32View,n=e._planes,o=0,a=t;a<i;++a){var s=n[a],l=s.normal;r[o]=l.x,r[o+1]=l.y,r[o+2]=l.z,r[o+3]=s.distance,o+=4}}function b$N(e,t){var i=e$1U.maximumTextureSize;return t.x=Math.min(e,i),t.y=Math.ceil(e/t.x),t}var H$E=new o$1k;h$C.prototype.update=function(e){var t=this._clippingPlanesTexture,i=e.context,r=h$C.useFloatTexture(i),n=r?this.length:2*this.length;if(e$28(t)){var o=t.width*t.height;(o<n||n<.25*o)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(0!==this.length){if(!e$28(t)){var a=b$N(n,H$E);a.y*=2;var s=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST});r?(t=new L$17({context:i,width:a.x,height:a.y,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT,sampler:s,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new L$17({context:i,width:a.x,height:a.y,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:s,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}var l=this._dirtyIndex;if(this._multipleDirtyPlanes||-1!==l){if(this._multipleDirtyPlanes)r?(M$F(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._float32View})):(V$u(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._uint8View}));else{var u=0,c=0;r?(c=Math.floor(l/t.width),u=Math.floor(l-c*t.width),M$F(this,l,l+1),t.copyFrom({width:1,height:1,arrayBufferView:this._float32View},u,c)):(c=Math.floor(2*l/t.width),u=Math.floor(2*l-c*t.width),V$u(this,l,l+1),t.copyFrom({width:2,height:1,arrayBufferView:this._uint8View},u,c))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}}};var J$F=new y$15,S$v=new o$1i(t$X.UNIT_X,0);h$C.prototype.computeIntersectionWithBoundingVolume=function(e,t){var i=this._planes,r=i.length,n=this.modelMatrix;e$28(t)&&(n=y$15.multiply(t,n,J$F));var o=pt$a.INSIDE;!this.unionClippingRegions&&r>0&&(o=pt$a.OUTSIDE);for(var a=0;a<r;++a){var s=i[a];o$1i.transform(s,n,S$v);var l=e.intersectPlane(S$v);if(l===pt$a.INTERSECTING)o=l;else if(this._testIntersection(l))return l}return o},h$C.setOwner=function(e,t,i){if(e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),e$28(e))){if(e$28(e._owner))throw new t$Z("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[i]=e}},h$C.useFloatTexture=function(e){return e.floatingPointTexture},h$C.getTextureResolution=function(e,t,i){var r=e.texture;if(e$28(r))return i.x=r.width,i.y=r.height,i;var n=b$N(h$C.useFloatTexture(t)?e.length:2*e.length,i);return n.y*=2,n},h$C.prototype.isDestroyed=function(){return!1},h$C.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),i$Z(this)};var e$_={HIGHLIGHT:0,REPLACE:1,MIX:2,getColorBlend:function(e,t){return e===e$_.HIGHLIGHT?0:e===e$_.REPLACE?1:e===e$_.MIX?e$27.clamp(t,e$27.EPSILON4,1):void 0}},I$X=Object.freeze(e$_);function r$E(){}function b$M(e,t){var i="runtime."+Object.keys(e.createdBufferViews).length,r=e.buffers,n=Object.keys(r).length;return r[n]=t,e.createdBufferViews[i]={buffer:n,byteOffset:0,byteLength:t.byteLength},i}function R$z(e,t,i){var r=t._loadResources,n=b$M(r,e);return r.vertexBuffersToCreate.enqueue(n),n}function P$C(e,t,i){var r=e.typedArray,n=t._loadResources,o=b$M(n,r);return n.indexBuffersToCreate.enqueue({id:o,componentType:S$W.fromTypedArray(r)}),{bufferViewId:o,numberOfIndices:e.numberOfIndices}}function T$y(e,t,i,r){if(r$E._taskProcessorReady){var n=i.primitivesToDecode.peek();if(e$28(n)){var o=e.scheduleTask(n,[n.array.buffer]);if(e$28(o))return i.activeDecodingTasks++,i.primitivesToDecode.dequeue(),o.then((function(e){i.activeDecodingTasks--;var r=P$C(e.indexArray,t),o={},a=e.attributeData;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s],u=R$z(l.array,t),c=l.data;c.bufferView=u,o[s]=c}t._decodedData[n.mesh+".primitive."+n.primitive]={bufferView:r.bufferViewId,numberOfIndices:r.numberOfIndices,attributes:o}}))}}}function p$D(e,t,i){return o$1u.typeOf.string("samplerUniformName",e),o$1u.typeOf.string("matrixUniformName",t),o$1u.typeOf.string("styleUniformName",i)," float clipDistance = clip(gl_FragCoord, "+e+", "+t+"); \n vec4 clippingPlanesEdgeColor = vec4(1.0); \n clippingPlanesEdgeColor.rgb = "+i+".rgb; \n float clippingPlanesEdgeWidth = "+i+".a; \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}r$E._maxDecodingConcurrency=Math.max(s$V.hardwareConcurrency-1,1),r$E._decoderTaskProcessor=void 0,r$E._taskProcessorReady=!1,r$E._getDecoderTaskProcessor=function(){if(!e$28(r$E._decoderTaskProcessor)){var e=new i$W("decodeDraco",r$E._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then((function(){r$E._taskProcessorReady=!0})),r$E._decoderTaskProcessor=e}return r$E._decoderTaskProcessor},r$E.hasExtension=function(e){return e$28(e.extensionsRequired.KHR_draco_mesh_compression)||e$28(e.extensionsUsed.KHR_draco_mesh_compression)},r$E._decodedModelResourceCache=void 0,r$E.parse=function(e,t){if(r$E.hasExtension(e)){var i=e._loadResources,r=e.cacheKey;if(e$28(r)){e$28(r$E._decodedModelResourceCache)||(e$28(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),r$E._decodedModelResourceCache=t.cache.modelDecodingCache);var n=r$E._decodedModelResourceCache[r];if(e$28(n))return n.count++,void(i.pendingDecodingCache=!0)}var o=e._dequantizeInShader,a=e.gltf;e$$.mesh(a,(function(e,t){e$$.meshPrimitive(e,(function(e,r){if(e$28(e.extensions)){var n=e.extensions.KHR_draco_mesh_compression;if(e$28(n)){var s=a.bufferViews[n.bufferView],l=l$12(a.buffers[s.buffer].extras._pipeline.source,s.byteOffset,s.byteOffset+s.byteLength);i.primitivesToDecode.enqueue({mesh:t,primitive:r,array:l,bufferView:s,compressedAttributes:n.attributes,dequantizeInShader:o})}}}))}))}},r$E.decodeModel=function(e,t){if(!r$E.hasExtension(e))return o$1q.resolve();var i=e._loadResources,r=e.cacheKey;if(e$28(r)&&e$28(r$E._decodedModelResourceCache)){var n=r$E._decodedModelResourceCache[r];if(e$28(n)&&i.pendingDecodingCache)return o$1q(n.ready,(function(){e._decodedData=n.data,i.pendingDecodingCache=!1}));r$E._decodedModelResourceCache[r]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return o$1q.resolve();for(var o=r$E._getDecoderTaskProcessor(),a=[],s=T$y(o,e,i);e$28(s);)a.push(s),s=T$y(o,e,i);return o$1q.all(a)},r$E.decodePointCloud=function(e){var t=r$E._getDecoderTaskProcessor();if(r$E._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},r$E.cacheDataForModel=function(e){var t=e.cacheKey;if(e$28(t)&&e$28(r$E._decodedModelResourceCache)){var i=r$E._decodedModelResourceCache[t];e$28(i)&&(i.ready=!0,i.data=e._decodedData)}},r$E.destroyCachedDataForModel=function(e){var t=e.cacheKey;if(e$28(t)&&e$28(r$E._decodedModelResourceCache)){var i=r$E._decodedModelResourceCache[t];e$28(i)&&0==--i.count&&delete r$E._decodedModelResourceCache[t]}};var m$E=new o$1k;function f$K(e,t){o$1u.typeOf.object("clippingPlaneCollection",e),o$1u.typeOf.object("context",t);var i=e.unionClippingRegions,r=e.length,n=h$C.useFloatTexture(t),o=h$C.getTextureResolution(e,t,m$E),a=o.x,s=o.y,l=n?v$z(a,s):P$B(a,s);return l+="\n",l+=i?s$w(r):x$L(r)}function s$w(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 x$L(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 v$z(e,t){var i=1/t,r=1/e+"";-1===r.indexOf(".")&&(r+=".0");var n=i+"";return-1===n.indexOf(".")&&(n+=".0"),"vec4 getClippingPlane(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) * "+r+";\n float v = (float(pixY) + 0.5) * "+n+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function P$B(e,t){var i=1/t,r=1/e+"";-1===r.indexOf(".")&&(r+=".0");var n=i+"";return-1===n.indexOf(".")&&(n+=".0"),"vec4 getClippingPlane(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) * "+r+";\n float v = (float(pixY) + 0.5) * "+n+";\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 + "+r+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var e$Z={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},i$B=Object.freeze(e$Z);function S$u(){}var W$B=/^data\:/i;function d$I(e,t){var i=e.gltf,r=i.buffers,n=i.bufferViews[t.bufferView],o=r[n.buffer],a=n.byteOffset+t.byteOffset,s=t.count*r$F(t.type),l=W$B.test(o.uri)?"":o.uri;return e.cacheKey+"//"+l+"/"+a+"/"+s}var k$D={};S$u.getAnimationParameterValues=function(e,t){var i=d$I(e,t),r=k$D[i];if(!e$28(r)){var n=e.gltf,o=n.buffers,a=n.bufferViews[t.bufferView],s=o[a.buffer].extras._pipeline.source,l=t.componentType,u=t.type,c=r$F(u),h=t.count,d=p$G(n,t);r=new Array(h);for(var f=u$Y(t.byteOffset,0),p=a.byteOffset+f,_=0;_<h;_++){var m=S$W.createArrayBufferView(l,s.buffer,s.byteOffset+p,c);"SCALAR"===u?r[_]=m[0]:"VEC3"===u?r[_]=t$X.fromArray(m):"VEC4"===u&&(r[_]=n$14.unpack(m)),p+=d}e$28(e.cacheKey)&&(k$D[i]=r)}return r};var L$I={};function D$I(e,t,i){return e.cacheKey+"//"+t+"/"+i}function V$t(e){this._value=e}V$t.prototype.evaluate=function(e,t){return this._value},V$t.prototype.wrapTime=function(e){return 0},V$t.prototype.clampTime=function(e){return 0},S$u.getAnimationSpline=function(e,t,i,r,n,o,a,s){var l=D$I(e,t,r),u=L$I[l];if(!e$28(u)){var c=o,h=s;1===c.length&&1===h.length?u=new V$t(h[0]):"LINEAR"===n.interpolation&&("translation"===a||"scale"===a?u=new r$12({times:c,points:h}):"rotation"===a?u=new r$Q({times:c,points:h}):"weights"===a&&(u=new r$L({times:c,weights:h}))),e$28(e.cacheKey)&&(L$I[l]=u)}return u};var c$E={};S$u.getSkinInverseBindMatrices=function(e,t){var i=d$I(e,t),r=c$E[i];if(!e$28(r)){var n=e.gltf,o=n.buffers,a=n.bufferViews[t.bufferView],s=o[a.buffer].extras._pipeline.source,l=t.componentType,u=t.type,c=t.count,h=p$G(n,t),d=a.byteOffset+t.byteOffset,f=r$F(u);if(r=new Array(c),l===de$y.FLOAT&&u===Q$C.MAT4)for(var p=0;p<c;++p){var _=S$W.createArrayBufferView(l,s.buffer,s.byteOffset+d,f);r[p]=y$15.fromArray(_),d+=h}c$E[i]=r}return r};var e$Y={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},_0x3df4ed=Object.freeze(e$Y),E$I=Object.freeze({STOPPED:0,ANIMATING:1});function a$C(e,t,i){this._name=i.name,this._startTime=a$12.clone(e.startTime),this._delay=u$Y(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=u$Y(e.removeOnStop,!1),this._multiplier=u$Y(e.multiplier,1),this._reverse=u$Y(e.reverse,!1),this._loop=u$Y(e.loop,_0x3df4ed.NONE),this.start=new o$1o,this.update=new o$1o,this.stop=new o$1o,this._state=E$I.STOPPED,this._runtimeAnimation=i,this._computedStartTime=void 0,this._duration=void 0;var r=this;this._raiseStartEvent=function(){r.start.raiseEvent(t,r)},this._updateEventTime=0,this._raiseUpdateEvent=function(){r.update.raiseEvent(t,r,r._updateEventTime)},this._raiseStopEvent=function(){r.stop.raiseEvent(t,r)}}function f$J(e){this.animationAdded=new o$1o,this.animationRemoved=new o$1o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function R$y(e,t,i){var r=e._model,n=new a$C(i,r,r._runtime.animations[t]);return e._scheduledAnimations.push(n),e.animationAdded.raiseEvent(r,n),n}function N$v(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}Object.defineProperties(a$C.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),Object.defineProperties(f$J.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),f$J.prototype.add=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=this._model._runtime.animations;if(!e$28(t))throw new t$Z("Animations are not loaded. Wait for Model.readyPromise to resolve.");if(!e$28(e.name)&&!e$28(e.index))throw new t$Z("Either options.name or options.index must be defined.");if(e$28(e.multiplier)&&e.multiplier<=0)throw new t$Z("options.multiplier must be greater than zero.");if(e$28(e.index)&&(e.index>=t.length||e.index<0))throw new t$Z("options.index must be a valid animation index.");if(e$28(e.index))return R$y(this,e.index,e);for(var i,r=t.length,n=0;n<r;++n)if(t[n].name===e.name){i=n;break}if(!e$28(i))throw new t$Z("options.name must be a valid animation name.");return R$y(this,i,e)},f$J.prototype.addAll=function(e){if(e=u$Y(e,u$Y.EMPTY_OBJECT),!e$28(this._model._runtime.animations))throw new t$Z("Animations are not loaded. Wait for Model.readyPromise to resolve.");if(e$28(e.multiplier)&&e.multiplier<=0)throw new t$Z("options.multiplier must be greater than zero.");for(var t=[],i=this._model._runtime.animations.length,r=0;r<i;++r)t.push(R$y(this,r,e));return t},f$J.prototype.remove=function(e){if(e$28(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},f$J.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},f$J.prototype.contains=function(e){return!!e$28(e)&&-1!==this._scheduledAnimations.indexOf(e)},f$J.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._scheduledAnimations[e]};var T$x=[];function q$H(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}function a$B(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i],this._technique=void 0,this._program=void 0,this._values=void 0}function a$A(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}function r$D(e,t,i,r,n){this._model=e,this._runtimeNode=i,this._name=t.name,this._id=r,this.useMatrix=!1,this._show=!0,this._matrix=y$15.clone(n),this._originalMatrix=y$15.clone(n)}function t$u(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.persists=u$Y(e.persists,!1),this.pass=Le$p.COMPUTE,this.renderState=e.renderState,this.clear=u$Y(e.clear,!0),this.owner=e.owner}f$J.prototype.update=function(e){var t=this._scheduledAnimations,i=t.length;if(0===i)return this._previousTime=void 0,!1;if(a$12.equals(e.time,this._previousTime))return!1;this._previousTime=a$12.clone(e.time,this._previousTime);for(var r=!1,n=e.time,o=this._model,a=0;a<i;++a){var s=t[a],l=s._runtimeAnimation;e$28(s._computedStartTime)||(s._computedStartTime=a$12.addSeconds(u$Y(s.startTime,n),s.delay,new a$12)),e$28(s._duration)||(s._duration=l.stopTime*(1/s.multiplier));var u=s._computedStartTime,c=s._duration,h=s.stopTime,d=0!==c?a$12.secondsDifference(n,u)/c:0,f=d>=0,p=s.loop===_0x3df4ed.REPEAT||s.loop===_0x3df4ed.MIRRORED_REPEAT;if((f||p&&!e$28(s.startTime))&&(d<=1||p)&&(!e$28(h)||a$12.lessThanOrEquals(n,h))){if(s._state===E$I.STOPPED&&(s._state=E$I.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===_0x3df4ed.REPEAT)d-=Math.floor(d);else if(s.loop===_0x3df4ed.MIRRORED_REPEAT){var _=Math.floor(d),m=d-_;d=_%2==1?1-m:m}s.reverse&&(d=1-d);var $=d*c*s.multiplier;N$v(l,$=e$27.clamp($,l.startTime,l.stopTime)),s.update.numberOfListeners>0&&(s._updateEventTime=$,e.afterRender.push(s._raiseUpdateEvent)),r=!0}else f&&s._state===E$I.ANIMATING&&(s._state=E$I.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&T$x.push(s))}i=T$x.length;for(var g=0;g<i;++g){var v=T$x[g];t.splice(t.indexOf(v),1),e.afterRender.push(q$H(this,o,v))}return T$x.length=0,r},Object.defineProperties(a$B.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),a$B.prototype.setValue=function(e,t){if(!e$28(e))throw new t$Z("name is required.");var i="u_"+e,r=this._uniformMap.values[i];if(!e$28(r))throw new t$Z("name must match a parameter name in the material's technique that is targetable and not optimized out.");r.value=r.clone(t,r.value)},a$B.prototype.getValue=function(e){if(!e$28(e))throw new t$Z("name is required.");var t="u_"+e,i=this._uniformMap.values[t];if(e$28(i))return i.value},Object.defineProperties(a$A.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),Object.defineProperties(r$D.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=y$15.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}}),r$D.prototype.setMatrix=function(e){y$15.clone(e,this._matrix)},t$u.prototype.execute=function(e){e.execute(this)};var $$A="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",z$x="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);\n#ifdef RGBA_NORMALIZED\ngl_FragColor = vec4(rgba.rgb, 1.0);\n#else\nfloat m = rgba.a * 16.0;\nvec3 r = rgba.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n#endif\n}\n",Z$A="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function u$z(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=o$1q.defer()}var J$E=/(^data:image\/ktx)|(\.ktx$)/i,Q$A=/(^data:image\/ktx2)|(\.ktx2$)/i;Object.defineProperties(u$z.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}}}),u$z.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var ee$r=new t$X(1,0,0),te$r=new t$X(0,0,1),re$o=new t$X(-1,0,0),ie$p=new t$X(0,0,-1),m$D=new t$X(0,1,0),ae$m=new t$X(0,-1,0),S$t=[m$D,re$o,te$r,ae$m,ee$r,m$D,ie$p,m$D,m$D],C$B=S$t.length,D$H=new Float32Array(3*C$B),F$N=0,l$J=0;l$J<C$B;++l$J,F$N+=3)t$X.pack(S$t[l$J],D$H,F$N);var oe$l=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),ne$s=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function se$i(e){var t=h$W.createVertexBuffer({context:e,typedArray:oe$l,usage:A$1c.STATIC_DRAW}),i=h$W.createVertexBuffer({context:e,typedArray:D$H,usage:A$1c.STATIC_DRAW}),r=h$W.createIndexBuffer({context:e,typedArray:ne$s,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});return new m$19({context:e,attributes:[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:S$W.FLOAT},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:S$W.FLOAT}],indexBuffer:r})}function L$H(e){return function(){return e}}function x$K(e){e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();var t,i,r=e._cubeMaps;if(e$28(r))for(i=r.length,t=0;t<i;++t)r[t].destroy();var n=e._mipTextures;if(e$28(n))for(i=n.length,t=0;t<i;++t)n[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}function f$I(e){return e$$.shader(e,(function(e){n$v(e)})),e$$.buffer(e,(function(e){n$v(e)})),e$$.image(e,(function(e){n$v(e),e$$.compressedImage(e,(function(e){n$v(e)}))})),n$v(e),e}function n$v(e){!e$28(e.extras)||(e$28(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}u$z.prototype.update=function(e){var t=e.context;if(!u$z.isSupported(t)||(e$28(this._texture)&&e$28(this._va)&&x$K(this),e$28(this._texture)))return;if(!e$28(this._texture)&&!this._loading){var i=t.textureCache.getTexture(this._url);if(e$28(i))return x$K(this),this._texture=i,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,void this._readyPromise.resolve()}var r=this._cubeMapBuffers;if(!e$28(r)&&!this._loading){var n=this;J$E.test(this._url)?k$R(this._url).then((function(e){n._cubeMapBuffers=e,n._loading=!1})).otherwise(this._readyPromise.reject):Q$A.test(this._url)&&f$U(this._url).then((function(e){n._cubeMapBuffers=e,n._loading=!1})).otherwise(this._readyPromise.reject),this._loading=!0}if(!e$28(this._cubeMapBuffers))return;const o=[];let a=r[0].positiveX.pixelDatatype;e$28(a)?o.push("RGBA_NORMALIZED"):a=t.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT;const s=V$O.RGBA,l=new a$$({defines:o,sources:[z$x]});this._va=se$i(t),this._sp=S$T.fromCache({context:t,vertexShaderSource:Z$A,fragmentShaderSource:l,attributeLocations:{position:0,cubeMapCoordinates:1}});var u=Math.min(r.length,6);this._maximumMipmapLevel=u-1;for(var c=this._cubeMaps=new Array(u),h=this._mipTextures=new Array(u),d=2*r[0].positiveX.width,f={originalSize:function(){return d}},p=0;p<u;++p){var _=r[p].positiveY;r[p].positiveY=r[p].negativeY,r[p].negativeY=_;var m=c[p]=new X$z({context:t,source:r[p],pixelDatatype:a}),$=2*c[p].width,g=h[p]=new L$17({context:t,width:$,height:$,pixelDatatype:a,pixelFormat:s}),v=new t$u({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:L$H(m)},outputTexture:g,persists:!0,owner:this});e.commandList.push(v),f["texture"+p]=L$H(g)}this._texture=new L$17({context:t,width:1.5*d+2,height:d,pixelDatatype:a,pixelFormat:s}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);var y=new t$u({fragmentShaderSource:$$A,uniformMap:f,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(y),this._ready=!0,this._readyPromise.resolve()},u$z.prototype.isDestroyed=function(){return!1},u$z.prototype.destroy=function(){return x$K(this),this._texture=this._texture&&this._texture.destroy(),i$Z(this)};var wt$7=new t$X,F$M=s$z.ModelState,Rt$5="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";function $e$8(e,t){e._cachedGltf=t}function Ee$e(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(Ee$e.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),Ee$e.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,i=t.length,r=0;r<i;++r){var n=t[r];n.isDestroyed()||$e$8(n,this)}this.modelsToLoad=void 0,this.ready=!0};var Z$z={},Pr$2={};function D$G(e){var t,i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).cacheKey;if(this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=u$Y(e.releaseGltfJson,!1),e$28(i)&&e$28(Z$z[i])&&Z$z[i].ready)++(t=Z$z[i]).count;else{var r=e.gltf;if(e$28(r)){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r instanceof Uint8Array)t=new Ee$e({gltf:O$z(r),ready:!0});else t=new Ee$e({gltf:e.gltf,ready:!0});t.count=1,e$28(i)&&(Z$z[i]=t)}}$e$8(this,t);var n=u$Y(e.basePath,"");this._resource=t$S.createIfNeeded(n),this.owner=e.owner,this.show=u$Y(e.show,!0),this.silhouetteColor=u$Y(e.silhouetteColor,e$1S.RED),this._silhouetteColor=new e$1S,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=u$Y(e.silhouetteSize,0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=u$Y(e.scale,1),this._scale=this.scale,this.minimumPixelSize=u$Y(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=u$Y(e.heightReference,k$_.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var o=e.scene;this._scene=o,e$28(o)&&e$28(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener((function(){this._heightChanged=!0}),this)),this._pickObject=e.pickObject,this._allowPicking=u$Y(e.allowPicking,!0),this._ready=!1,this._readyPromise=o$1q.defer(),this.activeAnimations=new f$J(this),this.clampAnimations=u$Y(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=u$Y(e.incrementallyLoadTextures,!0),this._asynchronous=u$Y(e.asynchronous,!0),this.shadows=u$Y(e.shadows,q$L.ENABLED),this._shadows=this.shadows,this.color=u$Y(e.color,e$1S.clone(e$1S.WHITE)),this._color=new e$1S,this._colorPreviousAlpha=1,this.colorBlendMode=u$Y(e.colorBlendMode,I$X.HIGHLIGHT),this.colorBlendAmount=u$Y(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.clippingPlanesOriginMatrix=void 0,this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=u$Y(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=u$Y(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=u$Y(e.upAxis,z$z.Y),this._gltfForwardAxis=z$z.Z,this._forwardAxis=e.forwardAxis,this.cull=u$Y(e.cull,!0),this.opaquePass=u$Y(e.opaquePass,Le$p.OPAQUE),this._computedModelMatrix=new y$15,this._clippingPlaneModelViewMatrix=y$15.clone(y$15.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._minCorner=void 0,this._maxCorner=void 0,this._scaledBoundingSphere=new i$19,this._state=F$M.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._dequantizeInShader=u$Y(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._imageBasedLightingFactor=new o$1k(1,1),o$1k.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this._lightColor=t$X.clone(e.lightColor),this._luminanceAtZenith=void 0,this.luminanceAtZenith=u$Y(e.luminanceAtZenith,.2),this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._shouldUpdateSpecularMapAtlas=!0,this._specularEnvironmentMapAtlas=void 0,this._useDefaultSphericalHarmonics=!1,this._useDefaultSpecularMaps=!1,this._shouldRegenerateShaders=!1}function Lr$2(e){return e.stencilBuffer}function er$7(e){return!e$1S.equals(e.color,e$1S.WHITE)||e.colorBlendMode!==I$X.HIGHLIGHT}function wr$2(e){var t=e._clippingPlanes;return e$28(t)&&t.enabled&&0!==t.length}function At$5(e){return"glTF"===a$U(e)}function rr$7(e,t,i){if(e._state!==F$M.LOADED)throw new t$Z("The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.");if(!e$28(i))throw new t$Z("name is required.");return e._runtime[t][i]}function It$8(e){var t=e.gltf,i=e._loadResources;e$$.buffer(t,(function(e,t){i.buffers[t]=e.extras._pipeline.source}))}function Bt$5(e,t){return function(i){var r=e._loadResources,n=new Uint8Array(i);--r.pendingBufferLoads,e.gltf.buffers[t].extras._pipeline.source=n}}function Dt$8(e){var t=e.gltf.bufferViews,i=e._loadResources.vertexBuffersToCreate;e$$.bufferView(e.gltf,(function(e,t){e.target===de$y.ARRAY_BUFFER&&i.enqueue(t)}));var r=e._loadResources.indexBuffersToCreate,n={};e$$.accessor(e.gltf,(function(e){var i=e.bufferView;e$28(i)&&(t[i].target===de$y.ELEMENT_ARRAY_BUFFER&&!e$28(n[i])&&(n[i]=!0,r.enqueue({id:i,componentType:e.componentType})))}))}function Nt$5(e){var t=e.gltf;if(i$D(t,"KHR_techniques_webgl")){var i=e._sourcePrograms,r=e._sourceTechniques,n=t.extensions.KHR_techniques_webgl.programs;e$$.technique(t,(function(e,t){r[t]=l$1e(e);var o=e.program;e$28(i[o])||(i[o]=l$1e(n[o]))}))}}function Ot$3(e,t,i){return function(r){var n=e._loadResources;n.shaders[i]={source:r,type:t,bufferView:void 0},--n.pendingShaderLoads,e._rendererResources.sourceShaders[i]=r}}function Ft$4(e){var t=e.gltf,i=t.buffers,r=t.bufferViews,n=e._rendererResources.sourceShaders;e$$.shader(t,(function(t,o){if(e$28(t.bufferView)){var a=t.bufferView,s=r[a],l=s.buffer,u=a$Z(i[l].extras._pipeline.source,s.byteOffset,s.byteLength);n[o]=u}else if(e$28(t.extras._pipeline.source))n[o]=t.extras._pipeline.source;else{++e._loadResources.pendingShaderLoads;var c=e._resource.getDerivedResource({url:t.uri});c.fetchText().then(Ot$3(e,t.type,o)).otherwise(s$z.getFailedLoadFunction(e,"shader",c.url))}}))}function Ut$2(e){var t=e._sourceTechniques;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];e._loadResources.programsToCreate.enqueue({programId:r.program,techniqueId:i})}}function qe$a(e,t){return function(i){const r=e._loadResources;let n;--r.pendingTextureLoads,Array.isArray(i)&&(n=i.slice(1,i.length).map((function(e){return e.bufferView})),i=i[0]),r.texturesToCreate.enqueue({id:t,image:i,bufferView:i.bufferView,width:i.width,height:i.height,internalFormat:i.internalFormat,mipLevels:n})}}Object.defineProperties(D$G.prototype,{gltf:{get:function(){return e$28(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){if(this._state!==F$M.LOADED)throw new t$Z("The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.");var e=this.modelMatrix;this.heightReference!==k$_.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t,i=y$15.getScale(e,wt$7);this.scale instanceof t$X?(t=this.scale,e$28(this.maximumScale)&&(t.x=Math.min(this.maximumScale,t.x),t.y=Math.min(this.maximumScale,t.y),t.z=Math.min(this.maximumScale,t.z)),t$X.multiplyComponents(i,t,i)):(t=e$28(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale,t$X.multiplyByScalar(i,t,i));var r=this._scaledBoundingSphere;return r.center=t$X.multiplyComponents(this._boundingSphere.center,i,r.center),r.radius=t$X.maximumComponent(i)*this._initialRadius,e$28(this._rtcCenter)&&t$X.add(this._rtcCenter,r.center,r.center),r}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return e$28(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far must be greater than near");this._distanceDisplayCondition=r$10.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return e$28(this._extensionsUsed)||(this._extensionsUsed=s$z.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return e$28(this._extensionsRequired)||(this._extensionsRequired=s$z.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return e$28(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&h$C.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){o$1u.typeOf.object("imageBasedLightingFactor",e),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1);var t=this._imageBasedLightingFactor;e===t||o$1k.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLightingFactor.x>0&&0===e.x||0===this._imageBasedLightingFactor.x&&e.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._imageBasedLightingFactor.y>0&&0===e.y||0===this._imageBasedLightingFactor.y&&e.y>0,o$1k.clone(e,this._imageBasedLightingFactor))}},lightColor:{get:function(){return this._lightColor},set:function(e){var t=this._lightColor;e===t||t$X.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||e$28(t)&&!e$28(e)||e$28(e)&&!e$28(t),this._lightColor=t$X.clone(e,t))}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){var t=this._luminanceAtZenith;e!==t&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||e$28(t)&&!e$28(e)||e$28(e)&&!e$28(t),this._luminanceAtZenith=e)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(e$28(e)&&(!Array.isArray(e)||9!==e.length))throw new t$Z("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");e!==this._sphericalHarmonicCoefficients&&(this._sphericalHarmonicCoefficients=e,this._shouldRegenerateShaders=!0)}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){this._shouldUpdateSpecularMapAtlas=e!==this._specularEnvironmentMaps,this._specularEnvironmentMaps=e}}}),D$G.silhouetteSupported=function(e){return Lr$2(e.context)},D$G.fromGltf=function(e){if(!e$28(e)||!e$28(e.url))throw new t$Z("options.url is required");var t=e.url;e=l$1e(e);var i=t$S.createIfNeeded(t);e$28(e.headers)&&e$28(i)&&(i.headers=e.headers);var r=u$Y(e.basePath,i.clone()),n=t$S.createIfNeeded(r),o=u$Y(e.cacheKey,Pr$2[o$1r(i.url)]);e$28(o)||(o=e$1K(),Pr$2[o$1r(i.url)]=o),e$28(e.basePath)&&!e$28(e.cacheKey)&&(o+=n.url),e.cacheKey=o,e.basePath=n;var a=new D$G(e),s=Z$z[o];return e$28(s)?s.ready||(++s.count,s.modelsToLoad.push(a)):((s=new Ee$e({ready:!1})).count=1,s.modelsToLoad.push(a),$e$8(a,s),Z$z[o]=s,e$28(i.headers.Accept)||(i.headers.Accept=Rt$5),i.fetchArrayBuffer().then((function(e){var t=new Uint8Array(e);if(At$5(t)){var i=O$z(t);s.makeReady(i)}else{var r=a$Z(t);s.makeReady(JSON.parse(r))}})).otherwise(s$z.getFailedLoadFunction(a,"model",i.url))),a},D$G._gltfCache=Z$z,D$G.prototype.getNode=function(e){var t=rr$7(this,"nodesByName",e);return e$28(t)?t.publicNode:void 0},D$G.prototype.getMesh=function(e){return rr$7(this,"meshesByName",e)},D$G.prototype.getMaterial=function(e){return rr$7(this,"materialsByName",e)};var Vt$7=/(^data:image\/ktx)|(\.ktx$)/i,Ht$3=/(^data:image\/crn)|(\.crn$)/i;function qt$4(e,t,i){var r,n=e.gltf,o=n.images;e$$.texture(n,(function(n,a){var s=n.source;e$28(n.extensions)&&e$28(n.extensions.EXT_texture_webp)&&i&&(s=n.extensions.EXT_texture_webp.source);var l=o[s],u=l.extras,c=l.bufferView,h=l.mimeType;if(r=l.uri,e$28(u)&&e$28(u.compressedImage3DTiles)){var d=u.compressedImage3DTiles.crunch,f=u.compressedImage3DTiles.s3tc,p=u.compressedImage3DTiles.pvrtc1,_=u.compressedImage3DTiles.etc1;t.s3tc&&e$28(d)?(h=d.mimeType,e$28(d.bufferView)?c=d.bufferView:r=d.uri):t.s3tc&&e$28(f)?(h=f.mimeType,e$28(f.bufferView)?c=f.bufferView:r=f.uri):t.pvrtc&&e$28(p)?(h=p.mimeType,e$28(p.bufferView)?c=p.bufferView:r=p.uri):t.etc1&&e$28(_)&&(h=_.mimeType,e$28(_.bufferView)?c=_.bufferView:r=_.uri)}if(e$28(c))e._loadResources.texturesToCreateFromBufferView.enqueue({id:a,image:void 0,bufferView:c,mimeType:h});else{++e._loadResources.pendingTextureLoads;var m=e._resource.getDerivedResource({url:r});(Vt$7.test(r)?k$R(m):Ht$3.test(r)?a$R(m,void 0,!0):m.fetchImage()).then(qe$a(e,a)).otherwise(s$z.getFailedLoadFunction(e,"image",m.url))}}))}function zt$4(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds;e$$.node(e.gltf,(function(o,a){var s={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new y$15,computedMatrix:new y$15,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:o.jointName,weights:[],children:[],parents:[],publicNode:void 0};s.publicNode=new r$D(e,o,s,a,s$z.getTransform(o)),t[a]=s,i[o.name]=s,e$28(o.skin)&&(n.push(a),r.push(s))})),e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function kt$5(e){var t=e.gltf,i=e._sourceTechniques,r={},n={},o=e._uniformMaps;e$$.material(t,(function(t,a){o[a]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var s=new a$B(e,t,a);if(e$28(t.extensions)&&e$28(t.extensions.KHR_techniques_webgl)){var l=t.extensions.KHR_techniques_webgl.technique;s._technique=l,s._program=i[l].program,e$$.materialValue(t,(function(e,t){e$28(s._values)||(s._values={}),s._values[t]=l$1e(e)}))}r[t.name]=s,n[a]=s})),e._runtime.materialsByName=r,e._runtime.materialsById=n}function Gt$4(e){var t={},i=e._runtime.materialsById;e$$.mesh(e.gltf,(function(r,n){t[r.name]=new a$A(r,i,n),(e$28(e.extensionsUsed.WEB3D_quantized_attributes)||e._dequantizeInShader)&&e$$.meshPrimitive(r,(function(t,i){var r=nr$5(e,t),o=e._programPrimitives[r];e$28(o)||(o={},e._programPrimitives[r]=o),o[n+".primitive."+i]=t}))})),e._runtime.meshesByName=t}var tr$4=function(){this.id=void 0,this.model=void 0,this.context=void 0};function Rr$1(e,t,i){var r=t._loadResources,n=t.gltf.bufferViews[e];e$28(n)||(n=r.createdBufferViews[e]);var o=h$W.createVertexBuffer({context:i,typedArray:r.getBuffer(n),usage:A$1c.STATIC_DRAW});o.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=o,t._geometryByteLength+=o.sizeInBytes}tr$4.prototype.set=function(e,t,i){this.id=e,this.model=t,this.context=i},tr$4.prototype.execute=function(){Rr$1(this.id,this.model,this.context)};var ir$4=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};function Ar$1(e,t,i,r){var n=i._loadResources,o=i.gltf.bufferViews[e];e$28(o)||(o=n.createdBufferViews[e]);var a=h$W.createIndexBuffer({context:r,typedArray:n.getBuffer(o),usage:A$1c.STATIC_DRAW,indexDatatype:t});a.vertexArrayDestroyable=!1,i._rendererResources.buffers[e]=a,i._geometryByteLength+=a.sizeInBytes}ir$4.prototype.set=function(e,t,i,r){this.id=e,this.componentType=t,this.model=i,this.context=r},ir$4.prototype.execute=function(){Ar$1(this.id,this.componentType,this.model,this.context)};var Ir$2=new tr$4,Br$1=new ir$4;function Wt$5(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){var r,n=t.context,o=i.vertexBuffersToCreate,a=i.indexBuffersToCreate;if(e.asynchronous){for(;o.length>0&&(Ir$2.set(o.peek(),e,n),t.jobScheduler.execute(Ir$2,i$B.BUFFER));)o.dequeue();for(;a.length>0&&(r=a.peek(),Br$1.set(r.id,r.componentType,e,n),t.jobScheduler.execute(Br$1,i$B.BUFFER));)a.dequeue()}else{for(;o.length>0;)Rr$1(o.dequeue(),e,n);for(;a.length>0;)Ar$1((r=a.dequeue()).id,r.componentType,e,n)}}}function nr$5(e,t){var i=e._runtime.materialsById[t.material];if(e$28(i))return i._program}function Dr(e,t,i){var r,n,o=i._programPrimitives[t];if(!e$28(o))return e;for(n in o)if(o.hasOwnProperty(n)&&nr$5(i,r=o[n])===t)break;var a=e;if(i.extensionsUsed.WEB3D_quantized_attributes)a=s$z.modifyShaderForQuantizedAttributes(i.gltf,r,e),i._quantizedUniforms[t]=a.uniforms;else{var s=i._decodedData[n];if(!e$28(s))return a;a=s$z.modifyShaderForDracoQuantizedAttributes(i.gltf,r,e,s.attributes)}return i._programPrimitives[t]=void 0,a.shader}function Kt$4(e){return e=a$$.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function Me$h(e,t,i){return e$28(i)&&(e=i(e,t)),e}var ar$6=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0,this.frameState=void 0};function Nr$2(e,t,i){return e.lightSource.directionalLight.length>0&&(i="uniform vec3 uDirectionalLightColor[ DIR_LIGHTS ]; \n"+(i="uniform vec3 uDirectionalLightDirectionEC[ DIR_LIGHTS ]; \n"+i)),e.lightSource.pointLight.length>0&&(i="uniform vec2 uPointLightDistanceAndDecay[ POINT_LIGHTS ]; \n"+(i="uniform vec3 uPointLightColor[ POINT_LIGHTS ]; \n"+(i="uniform vec3 uPointLightPositionEC[ POINT_LIGHTS ]; \n"+i))),e.lightSource.spotLight.length>0&&(i="uniform float uSpotLightExponent[ SPOT_LIGHTS ]; \n"+(i="uniform vec4 uSpotLightDistanceDecayCosPenumbra[ SPOT_LIGHTS ]; \n"+(i="uniform vec3 uSpotLightDirectionEC[ SPOT_LIGHTS ]; \n"+(i="uniform vec3 uSpotLightPositionEC[ SPOT_LIGHTS ]; \n"+(i="uniform vec3 uSpotLightColor[ SPOT_LIGHTS ]; \n"+i))))),t="#define DIR_LIGHTS "+e.lightSource.directionalLight.length+"\n"+t,i="#define DIR_LIGHTS "+e.lightSource.directionalLight.length+"\n"+i,t="#define POINT_LIGHTS "+e.lightSource.pointLight.length+"\n"+t,i="#define POINT_LIGHTS "+e.lightSource.pointLight.length+"\n"+i,{vs:t="#define SPOT_LIGHTS "+e.lightSource.spotLight.length+"\n"+t,fs:i="#define SPOT_LIGHTS "+e.lightSource.spotLight.length+"\n"+i}}function Or(e,t,i,r){var n=e.programId,o=e.techniqueId,a=t._sourcePrograms[n],s=t._rendererResources.sourceShaders,l=s[a.vertexShader],u=s[a.fragmentShader],c=t._quantizedVertexShaders,h=t._toClipCoordinatesGLSL[n];if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){var d=c[n];e$28(d)||(d=Dr(l,n,t),c[n]=d),l=d}var f=Me$h(l,n,t._vertexShaderLoaded),p=Me$h(u,n,t._fragmentShaderLoaded);s$V.isInternetExplorer()||(f=s$z.modifyVertexShaderForLogDepth(f,h),p=s$z.modifyFragmentShaderForLogDepth(p)),e$28(t._uniformMapLoaded)||(p="uniform vec4 czm_pickColor;\n"+p);var _=t._imageBasedLightingFactor.x>0||t._imageBasedLightingFactor.y>0;_&&(p="#define USE_IBL_LIGHTING \n\n"+p),e$28(t._lightColor)&&(p="#define USE_CUSTOM_LIGHT_COLOR \n\n"+p),e$28(t.owner)&&t.owner._swipeEnabled&&(p="#define APPLY_SWIPE \n\n"+p);var m=Nr$2(r,f,p);if(f=m.vs,p=m.fs,("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(p=a$$.replaceMain(p,"non_gamma_corrected_main"),p+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),u$z.isSupported(i)){var $=e$28(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,g=e$28(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;($||g||_)&&(p="uniform mat4 gltf_clippingPlanesMatrix; \n"+p),e$28(t._sphericalHarmonicCoefficients)?p="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+p:t._useDefaultSphericalHarmonics&&(p="#define DIFFUSE_IBL \n"+p),e$28(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?p="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+p:t._useDefaultSpecularMaps&&(p="#define SPECULAR_IBL \n"+p)}e$28(t._luminanceAtZenith)&&(p="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+p),Fr(n,o,p,f,t,i)}function jt$2(e,t,i,r){var n=e.programId,o=e.techniqueId,a=t._sourcePrograms[n],s=t._rendererResources.sourceShaders,l=t._quantizedVertexShaders,u=t._toClipCoordinatesGLSL[n],c=t.clippingPlanes,h=wr$2(t),d=s[a.vertexShader],f=s[a.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(d=l[n]);var p=f;er$7(t)&&(p=D$G._modifyShaderForColor(p)),h&&(p=ji$4(p,c,i));var _=Me$h(d,n,t._vertexShaderLoaded),m=Me$h(p,n,t._fragmentShaderLoaded);s$V.isInternetExplorer()||(_=s$z.modifyVertexShaderForLogDepth(_,u),m=s$z.modifyFragmentShaderForLogDepth(m)),e$28(t._uniformMapLoaded)||(m="uniform vec4 czm_pickColor;\n"+m);var $=t._imageBasedLightingFactor.x>0||t._imageBasedLightingFactor.y>0;$&&(m="#define USE_IBL_LIGHTING \n\n"+m),e$28(t._lightColor)&&(m="#define USE_CUSTOM_LIGHT_COLOR \n\n"+m),e$28(t.owner)&&t.owner._swipeEnabled&&(m="#define APPLY_SWIPE \n\n"+m);var g=Nr$2(r,_,m);if(_=g.vs,m=g.fs,("2.0"!==t._sourceVersion||t._sourceKHRTechniquesWebGL)&&(m=a$$.replaceMain(m,"non_gamma_corrected_main"),m+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),u$z.isSupported(i)){var v=e$28(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,y=e$28(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;!h&&(v||y||$)&&(m="uniform mat4 gltf_clippingPlanesMatrix; \n"+m),e$28(t._sphericalHarmonicCoefficients)?m="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+m:t._useDefaultSphericalHarmonics&&(m="#define DIFFUSE_IBL \n"+m),e$28(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?m="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+m:t._useDefaultSpecularMaps&&(m="#define SPECULAR_IBL \n"+m)}e$28(t._luminanceAtZenith)&&(m="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+m),Fr(n,o,m,_,t,i)}function Fr(e,t,i,r,n,o){var a=n._sourceTechniques[t],s=s$z.createAttributeLocations(a,n._precreatedAttributes);n._rendererResources.programs[e]=S$T.fromCache({context:o,vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:s})}ar$6.prototype.set=function(e,t,i,r){this.programToCreate=e,this.model=t,this.context=i,this.frameState=r},ar$6.prototype.execute=function(){Or(this.programToCreate,this.model,this.context,this.frameState)};var Ur$3=new ar$6;function Zt$4(e,t){var i=e._loadResources,r=i.programsToCreate;if(0===i.pendingShaderLoads&&0===i.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;r.length>0&&(Ur$3.set(r.peek(),e,n,t),t.jobScheduler.execute(Ur$3,i$B.PROGRAM));)r.dequeue();else for(;r.length>0;)Or(r.dequeue(),e,n)}}function Yt$3(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Jt$4(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView];r.textures[i.id].source;var o=s$z.getFailedLoadFunction(e,"image","id: "+i.id+", bufferView: "+i.bufferView);if("image/ktx"===i.mimeType)k$R(t.getBuffer(n)).then(qe$a(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else if("image/ktx2"===i.mimeType){f$U(new Uint8Array(t.getBuffer(n))).then(qe$a(e,i.id)),++e._loadResources.pendingTextureLoads}else if("image/crn"===i.mimeType){var a=a$R(t.getBuffer(n),void 0,!0);e$28(a)&&a.then(qe$a(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads}else{var s=Yt$3(t,i);w$B({uint8Array:t.getBuffer(n),format:i.mimeType,flipY:!1}).then(s).otherwise(o),++t.pendingBufferViewToImage}}}function Qt$2(e){var t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;var i=e._rendererResources.samplers;e$$.sampler(e.gltf,(function(e,t){i[t]=new n$Y({wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minFilter,magnificationFilter:e.magFilter})}))}}var sr$2=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};function Vr$1(e,t,i){var r=t.gltf.textures[e.id],n=t._rendererResources.samplers[r.sampler];n=u$Y(n,new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT}));var o,a=e.internalFormat,s=!(e$28(a)&&V$O.isCompressedFormat(a)||n.minificationFilter!==tt$h.NEAREST_MIPMAP_NEAREST&&n.minificationFilter!==tt$h.NEAREST_MIPMAP_LINEAR&&n.minificationFilter!==tt$h.LINEAR_MIPMAP_NEAREST&&n.minificationFilter!==tt$h.LINEAR_MIPMAP_LINEAR),l=s||n.wrapS===q$11.REPEAT||n.wrapS===q$11.MIRRORED_REPEAT||n.wrapT===q$11.REPEAT||n.wrapT===q$11.MIRRORED_REPEAT,u=e.image;if(e$28(a))o=new L$17({context:i,source:{arrayBufferView:e.bufferView,mipLevels:e.mipLevels},width:e.width,height:e.height,pixelFormat:a,sampler:n});else if(e$28(u)){var c=!e$27.isPowerOfTwo(u.width)||!e$27.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=e$27.nextPowerOfTwo(u.width),h.height=e$27.nextPowerOfTwo(u.height),h.getContext("2d").drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}o=new L$17({context:i,source:u,pixelFormat:r.internalFormat,pixelDatatype:r.type,sampler:n,flipY:!1}),s&&o.generateMipmap()}e$28(o)&&(t._rendererResources.textures[e.id]=o,t._texturesByteLength+=o.sizeInBytes)}sr$2.prototype.set=function(e,t,i){this.gltfTexture=e,this.model=t,this.context=i},sr$2.prototype.execute=function(){Vr$1(this.gltfTexture,this.model,this.context)};var Hr$1=new sr$2;function Xt$3(e,t){var i=t.context,r=e._loadResources.texturesToCreate;if(e.asynchronous)for(;r.length>0&&(Hr$1.set(r.peek(),e,i),t.jobScheduler.execute(Hr$1,i$B.TEXTURE));)r.dequeue();else for(;r.length>0;)Vr$1(r.dequeue(),e,i)}function $t$4(e,t){var i,r,n=e._sourceTechniques,o={},a=e._runtime.materialsById[t.material];if(!e$28(a))return o;var s=n[a._technique];if(!e$28(s))return o;var l=s.attributes,u=e._rendererResources.programs[s.program],c=u.vertexAttributes,h=u._attributeLocations;for(i in c)if(c.hasOwnProperty(i)){var d=l[i];e$28(d)&&(r=h[i],o[d.semantic]=r)}var f=e._precreatedAttributes;if(e$28(f))for(i in f)f.hasOwnProperty(i)&&(r=h[i],o[i]=r);return o}function ei$3(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],h=n[u],d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var f=r[h.skin].joints,p=f.length,_=0;_<p;++_){var m=o[f[_]];c.joints.push(m)}}}function ri$3(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n={};e$$.skin(i,(function(t,i){var o,a=r[t.inverseBindMatrices];y$15.equals(t.bindShapeMatrix,y$15.IDENTITY)||(o=y$15.clone(t.bindShapeMatrix)),n[i]={inverseBindMatrices:S$u.getSkinInverseBindMatrices(e,a),bindShapeMatrix:o}})),ei$3(e,n)}}function ti$4(e,t,i,r){return function(n){e$28(r)&&(n=e.clampAnimations?r.clampTime(n):r.wrapTime(n),t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber)}}function ii$4(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations=[];var i=e._runtime.nodes,r=e.gltf.accessors;e$$.animation(e.gltf,(function(t,n){for(var o=t.channels,a=t.samplers,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=o.length,c=new Array(u),h=0;h<u;++h){var d=o[h],f=d.target,p=f.path,_=a[d.sampler],m=S$u.getAnimationParameterValues(e,r[_.input]),$=S$u.getAnimationParameterValues(e,r[_.output]);s=Math.min(s,m[0]),l=Math.max(l,m[m.length-1]);var g=S$u.getAnimationSpline(e,n,t,d.sampler,_,m,p,$);c[h]=ti$4(e,i[f.node],f.path,g)}e._runtime.animations[n]={name:t.name,startTime:s,stopTime:l,channelEvaluators:c}}))}}function qr(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors;e$$.mesh(o,(function(i,s){e$$.meshPrimitive(i,(function(i,l){var u,c=[],h=$t$4(e,i),d=e._decodedData[s+".primitive."+l];e$$.meshPrimitiveAttribute(i,(function(e,t){if(e$28(u=h[t])){if(e$28(d)){var i=d.attributes;if(i.hasOwnProperty(t)){var n=i[t];return void c.push({index:u,vertexBuffer:r[n.bufferView],componentsPerAttribute:n.componentsPerAttribute,componentDatatype:n.componentDatatype,normalize:n.normalized,offsetInBytes:n.byteOffset,strideInBytes:n.byteStride})}}var s=a[e],l=e$28(s.normalized)&&s.normalized;c.push({index:u,vertexBuffer:r[s.bufferView],componentsPerAttribute:r$F(s.type),componentDatatype:s.componentType,normalize:l,offsetInBytes:s.byteOffset,strideInBytes:p$G(o,s)})}}));var f,p,_,m=e._precreatedAttributes;if(e$28(m))for(p in m)m.hasOwnProperty(p)&&(e$28(u=h[p])&&((f=m[p]).index=u,c.push(f)));if(e$28(i.indices)){var $=a[i.indices].bufferView;e$28(d)&&($=d.bufferView),_=r[$]}n[s+".primitive."+l]=new m$19({context:t,attributes:c,indexBuffer:_})}))}))}}function ni$4(e){var t=e._loadResources;t.createRenderStates&&(t.createRenderStates=!1,e$$.material(e.gltf,(function(t,i){ai$4(e,t,i)})))}function ai$4(e,t,i){var r=e._rendererResources.renderStates,n=[de$y.FUNC_ADD,de$y.FUNC_ADD],o=[de$y.ONE,de$y.ONE_MINUS_SRC_ALPHA,de$y.ONE,de$y.ONE_MINUS_SRC_ALPHA];e$28(t.extensions)&&e$28(t.extensions.KHR_blend)&&(n=t.extensions.KHR_blend.blendEquation,o=t.extensions.KHR_blend.blendFactors);var a=!t.doubleSided,s="BLEND"===t.alphaMode;r[i]=u$R.fromCache({cull:{enabled:a},depthTest:{enabled:!0},depthMask:!s,blending:{enabled:s,equationRgb:n[0],equationAlpha:n[1],functionSourceRgb:o[0],functionDestinationRgb:o[1],functionSourceAlpha:o[2],functionDestinationAlpha:o[3]},stencilTest:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.REPLACE},reference:Fa$6.MODEL,mask:-1}})}var si$3={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new y$15;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new y$15;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r),y$15.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new y$15;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r),y$15.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new y$15;return function(){return y$15.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new y$15,n=new y$15;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r),y$15.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new y$15,n=new y$15;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r),y$15.multiply(e._projection,r,r),y$15.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new y$15,n=new p$1a;return function(){return y$15.inverse(i.computedMatrix,r),y$15.getRotation(r,n),p$1a.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new y$15,n=new y$15,o=new p$1a;return function(){return y$15.multiplyTransformation(e.view,i.computedMatrix,r),y$15.inverse(r,n),y$15.getRotation(n,o),p$1a.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}};function oi$3(e,t,i,r){var n=t._runtime.nodes[e];return si$3[i](r,t,n)}function ui$4(e,t,i,r,n,o,a){var s,l,u={},c={};return e$$.techniqueUniform(i,(function(i,h){var d;if(e$28(r)&&e$28(r[h]))d=s$z.createUniformFunction(i.type,r[h],o,a,i.extensionType),u[h]=d.func,c[h]=d;else if(e$28(i.node))u[h]=oi$3(i.node,e,i.semantic,n.uniformState);else if(e$28(i.semantic))if("JOINTMATRIX"===i.semantic)s=h;else if("MORPHWEIGHTS"===i.semantic)l=h;else if("ALPHACUTOFF"===i.semantic){var f=t.alphaMode;if(e$28(f)&&"MASK"===f){var p=u$Y(t.alphaCutoff,.5);d=s$z.createUniformFunction(i.type,p,o,a,i.extensionType),u[h]=d.func,c[h]=d}}else u[h]=s$z.getGltfSemanticUniforms()[i.semantic](n.uniformState,e);else if(e$28(i.value)){var _=s$z.createUniformFunction(i.type,i.value,o,a,i.extensionType);u[h]=_.func,c[h]=_}})),{map:u,values:c,jointMatrixUniformName:s,morphWeightsUniformName:l}}function ci$5(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=e._sourceTechniques,o=e._uniformMaps,a=e._rendererResources.textures,s=e._defaultTexture;e$$.material(r,(function(i,r){var l=e._runtime.materialsById[r],u=n[l._technique],c=l._values,h=ui$4(e,i,u,c,t,a,s),d=o[r];d.uniformMap=h.map,d.values=h.values,d.jointMatrixUniformName=h.jointMatrixUniformName,d.morphWeightsUniformName=h.morphWeightsUniformName}))}}function fi$3(e){return s$z.createUniformsForDracoQuantizedAttributes(e.attributes)}function hi$5(e,t){var i=nr$5(e,t),r=e._quantizedUniforms[i];return s$z.createUniformsForQuantizedAttributes(e.gltf,t,r)}function li$3(e){return function(){return e}}function di$4(e){return function(){return e.computedJointMatrices}}function pi$4(e){return function(){return e.weights}}function _i$5(e){return function(){return e.silhouetteColor}}function gi$5(e){return function(){return e.silhouetteSize}}function vi$5(e){return function(){return e.color}}var mi$4=new y$15;function xi$3(e){return function(){var t=e.clippingPlanes;if(!e$28(t)&&!e$28(e._sphericalHarmonicCoefficients)&&!e$28(e._specularEnvironmentMaps))return y$15.IDENTITY;var i=e$28(t)?t.modelMatrix:y$15.IDENTITY;return y$15.multiply(e._clippingPlaneModelViewMatrix,i,mi$4)}}function yi$4(e){return function(){var t=e.clippingPlanes;return e$28(t)&&t.enabled?t.texture:e._defaultTexture}}function Si$3(e){return function(){var t=e.clippingPlanes;if(!e$28(t))return e$1S.WHITE.withAlpha(0);var i=e$1S.clone(t.edgeColor);return i.alpha=t.edgeWidth,i}}function Ci$3(e){return function(){return I$X.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function bi$3(e){return function(){return e._imageBasedLightingFactor}}function Ei$3(e){return function(){return e._lightColor}}function Mi$3(e){return function(){return e.luminanceAtZenith}}function Ti$3(e){return function(){return e._sphericalHarmonicCoefficients}}function Pi$4(e){return function(){return e._specularEnvironmentMapAtlas.texture}}function Li$2(e){return function(){return e._specularEnvironmentMapAtlas.texture.dimensions}}function wi$4(e){return function(){return e._specularEnvironmentMapAtlas.maximumMipmapLevel}}function Ri$3(e,t){switch(e.mode){case W$_.TRIANGLES:return t/3;case W$_.TRIANGLE_STRIP:case W$_.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Ai$2(e,t,i,r,n,o){for(var a=e._nodeCommands,s=e._pickIds,l=e.allowPicking,u=e._runtime.meshesByName,c=e._rendererResources,h=c.vertexArrays,d=c.programs,f=c.renderStates,p=e._uniformMaps,_=e.gltf,m=_.accessors,$=_.meshes,g=t.mesh,v=$[g],y=v.primitives,x=y.length,b=0;b<x;++b){var w,C=y[b],T=m[C.indices],S=e._runtime.materialsById[C.material]._program,E=e._decodedData[g+".primitive."+b],A=C.attributes.POSITION;if(e$28(A)){var P=s$z.getAccessorMinMax(_,A);w=i$19.fromCornerPoints(t$X.fromArray(P.min),t$X.fromArray(P.max))}var I,M,O=h[g+".primitive."+b];if(e$28(E))M=E.numberOfIndices,I=0;else if(e$28(T))M=T.count,I=T.byteOffset/ce$v.getSizeInBytes(T.componentType);else{M=m[C.attributes.POSITION].count,I=0}e._trianglesLength+=Ri$3(C,M);var D=p[C.material],R=D.uniformMap;if(e$28(D.jointMatrixUniformName)){var L={};L[D.jointMatrixUniformName]=di$4(i),R=p$17(R,L)}if(e$28(D.morphWeightsUniformName)){var B={};B[D.morphWeightsUniformName]=pi$4(i),R=p$17(R,B)}R=p$17(R,{gltf_color:vi$5(e),gltf_colorBlend:Ci$3(e),gltf_clippingPlanes:yi$4(e),gltf_clippingPlanesEdgeStyle:Si$3(e),gltf_clippingPlanesMatrix:xi$3(e),gltf_iblFactor:bi$3(e),gltf_lightColor:Ei$3(e),gltf_sphericalHarmonicCoefficients:Ti$3(e),gltf_specularMap:Pi$4(e),gltf_specularMapSize:Li$2(e),gltf_maxSpecularLOD:wi$4(e),gltf_luminanceAtZenith:Mi$3(e)}),R=p$17(R,o.lightSource.createUniformMap()),e$28(e._uniformMapLoaded)&&(R=e._uniformMapLoaded(R,S,i));var N={};e.extensionsUsed.WEB3D_quantized_attributes?N=hi$5(e,C):e._dequantizeInShader&&e$28(E)&&(N=fi$3(E)),R=p$17(R,N);var F=f[C.material],z=F.blending.enabled,k=e._pickObject;e$28(k)||(k={primitive:e,id:e.id,node:i.publicNode,mesh:u[v.name]});var V,U=q$L.castShadows(e._shadows),X=q$L.receiveShadows(e._shadows);if(l&&!e$28(e._uniformMapLoaded))V=r.createPickId(k),s.push(V),R=p$17(R,{czm_pickColor:li$3(V.color)});l&&(V=e$28(e._pickIdLoaded)&&e$28(e._uniformMapLoaded)?e._pickIdLoaded():"czm_pickColor");var H,G=new r$15({boundingVolume:new i$19,cull:e.cull,modelMatrix:new y$15,primitiveType:C.mode,vertexArray:O,count:M,offset:I,shaderProgram:d[S],castShadows:U,receiveShadows:X,uniformMap:R,renderState:F,owner:k,pass:z?Le$p.TRANSLUCENT:e.opaquePass,pickId:V});n||((H=r$15.shallowClone(G)).boundingVolume=new i$19,H.modelMatrix=new y$15);var W={show:!0,boundingSphere:w,command:G,command2D:H,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,programId:S};i.commands.push(W),a.push(W)}}function Ii$3(e,t,i,r){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,u=(s.skins,s.scenes[s.scene].nodes),c=u.length,h=[],d={},f=0;f<c;++f)for(h.push({parentRuntimeNode:void 0,gltfNode:l[u[f]],id:u[f]});h.length>0;){var p=h.pop();d[p.id]=!0;var _=p.parentRuntimeNode,m=p.gltfNode,$=a[p.id];if(0===$.parents.length)if(e$28(m.matrix))$.matrix=y$15.fromColumnMajorArray(m.matrix);else{var g=m.rotation;$.translation=t$X.fromArray(m.translation),$.rotation=n$14.unpack(g),$.scale=t$X.fromArray(m.scale)}e$28(_)?(_.children.push($),$.parents.push(_)):o.push($),e$28(m.mesh)&&Ai$2(e,m,$,t,i,r);var v=m.children;if(e$28(v))for(var y=v.length,x=0;x<y;x++){var b=v[x];d[b]||h.push({parentRuntimeNode:$,gltfNode:l[b],id:v[x]})}}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Bi$2(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function Di$4(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function zr$3(e,t){var i=t.context,r=t.scene3DOnly,n=e._quantizedVertexShaders,o=e._toClipCoordinatesGLSL={},a=e._sourceTechniques,s=e._sourcePrograms,l=e._rendererResources,u=l.sourceShaders;for(var c in e._loadRendererResourcesFromCache&&(u=l.sourceShaders=e._cachedRendererResources.sourceShaders),a)if(a.hasOwnProperty(c)){var h=a[c].program,d=s[h],f=u[d.vertexShader];if(s$z.checkSupportedGlExtensions(d.glExtensions,i),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){var p=n[h];e$28(p)||(p=Dr(f,h,e),n[h]=p),f=p}f=Me$h(f,h,e._vertexShaderLoaded),o[h]=s$z.toClipCoordinatesGLSL(e.gltf,f)}if(e._loadRendererResourcesFromCache){var _=e._cachedRendererResources;l.buffers=_.buffers,l.vertexArrays=_.vertexArrays,l.programs=_.programs,l.silhouettePrograms=_.silhouettePrograms,l.textures=_.textures,l.samplers=_.samplers,l.renderStates=_.renderStates,e$28(e._precreatedAttributes)&&qr(e,i),e._cachedGeometryByteLength+=Bi$2(_.buffers),e._cachedTexturesByteLength+=Di$4(_.textures)}else Wt$5(e,t),Zt$4(e,t),Qt$2(e),Jt$4(e),Xt$3(e,t);ri$3(e),ii$4(e),e._loadRendererResourcesFromCache||(qr(e,i),ni$4(e)),ci$5(e,i),Ii$3(e,i,r,t)}function kr$3(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&e$28(r)?y$15.clone(r,t):e$28(e.matrix)?y$15.clone(e.matrix,t):(y$15.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}var Gr$1=[],Ni$2=new e$25,or$4=new y$15;function Wr$1(e,t,i,r){var n=e._maxDirtyNumber,o=e._runtime.rootNodes,a=o.length,s=Gr$1,l=e._computedModelMatrix;if(e._mode!==P$$.SCENE3D&&!e._ignoreCommands){var u=y$15.getColumn(l,3,Ni$2);if(e$25.equals(u,e$25.UNIT_W)){var c=e.boundingSphere.center,h=m$1b.wgs84To2DModelMatrix(r,c,or$4);l=y$15.multiply(h,l,or$4),e$28(e._rtcCenter)&&(y$15.setTranslation(l,e$25.UNIT_W,l),e._rtcCenter=e._rtcCenter2D)}else l=m$1b.basisTo2D(r,l,or$4),e._rtcCenter=e._rtcCenter3D}for(var d=0;d<a;++d){var f=o[d];for(kr$3(f,f.transformToRoot),s.push(f);s.length>0;){var p=(f=s.pop()).transformToRoot,_=f.commands;if(f.dirtyNumber===n||t||i){var m=y$15.multiplyTransformation(l,p,f.computedMatrix),$=_.length;if($>0)for(var g=0;g<$;++g){var v=_[g],y=v.command;y$15.clone(m,y.modelMatrix),i$19.transform(v.boundingSphere,y.modelMatrix,y.boundingVolume),e$28(e._rtcCenter)&&t$X.add(e._rtcCenter,y.boundingVolume.center,y.boundingVolume.center),e$28(y=v.command2D)&&e._mode===P$$.SCENE2D&&(y$15.clone(m,y.modelMatrix),y.modelMatrix[13]-=2*e$27.sign(y.modelMatrix[13])*e$27.PI*r.ellipsoid.maximumRadius,i$19.transform(v.boundingSphere,y.modelMatrix,y.boundingVolume))}}var x=f.children;if(e$28(x))for(var b=x.length,w=0;w<b;++w){var C=x[w];C.dirtyNumber=Math.max(C.dirtyNumber,f.dirtyNumber),(C.dirtyNumber===n||i)&&(kr$3(C,C.transformToRoot),y$15.multiplyTransformation(p,C.transformToRoot,C.transformToRoot)),s.push(C)}}}++e._maxDirtyNumber}var ur$2=new y$15;function Kr$2(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];ur$2=y$15.inverseTransformation(n.transformToRoot,ur$2);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,u=l.length,c=0;c<u;++c)e$28(o[c])||(o[c]=new y$15),o[c]=y$15.multiplyTransformation(ur$2,a[c].transformToRoot,o[c]),o[c]=y$15.multiplyTransformation(o[c],l[c],o[c]),e$28(s)&&(o[c]=y$15.multiplyTransformation(o[c],s,o[c]))}}function Oi$2(e){for(var t=e._runtime.rootNodes,i=t.length,r=Gr$1,n=0;n<i;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){for(var a=(o=r.pop()).computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;var c=o.children;if(e$28(c))for(var h=c.length,d=0;d<h;++d){var f=c[d];f.computedShow=a&&f.publicNode.show,r.push(f)}}}}function Fi$2(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;o<n;++o)r[o].object.id=i}}function Ui$2(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?W$_.LINES:W$_.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function Vi$2(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function Hi$2(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=q$L.castShadows(e.shadows),i=q$L.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,o=0;o<n;o++){var a=r[o];a.command.castShadows=t,a.command.receiveShadows=i}}}function qi$2(e){var t=l$1e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Ee$n.ALPHA_BLEND,u$R.fromCache(t)}function jr$4(e){var t=r$15.shallowClone(e);return t.pass=Le$p.TRANSLUCENT,t.renderState=qi$2(e.renderState),t}function Zr$1(e,t,i){var r=t.scene3DOnly,n=e.color.alpha;if(n>0&&n<1){var o=e._nodeCommands,a=o.length;if(!e$28(o[0].translucentCommand)||i)for(var s=0;s<a;++s){var l=o[s],u=l.command;if(l.translucentCommand=jr$4(u),!r){var c=l.command2D;l.translucentCommand2D=jr$4(c)}}}}function zi$2(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function ki$3(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;r=a$$.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+o+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n gl_Position = clip; \n}";return S$T.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = gltf_silhouetteColor; \n}",attributeLocations:n})}function Yr(e,t){return Lr$2(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&e$28(e._normalAttributeName)}function Gi$2(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){if(t[r].command.pass===Le$p.TRANSLUCENT)return!0}return!1}function cr$3(e){return e.color.alpha>0&&e.color.alpha<1}function Jr$1(e){return 0===e.color.alpha}function Qr(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var Wi$2=0;function Ki$2(e,t){for(var i=++Wi$2%255,r=Gi$2(e)||cr$3(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,o=t.scene3DOnly,a=e._nodeCommands,s=a.length,l=0;l<s;++l){var u=a[l],c=u.command,h=cr$3(e)?u.translucentCommand:c,d=r$15.shallowClone(h),f=l$1e(h.renderState);f.stencilTest={enabled:!0,frontFunction:de$y.ALWAYS,backFunction:de$y.ALWAYS,reference:i,mask:-1,frontOperation:{fail:de$y.KEEP,zFail:de$y.KEEP,zPass:de$y.REPLACE},backOperation:{fail:de$y.KEEP,zFail:de$y.KEEP,zPass:de$y.REPLACE}},Jr$1(e)&&(f.colorMask={red:!1,green:!1,blue:!1,alpha:!1},f.depthMask=!1),f=u$R.fromCache(f),d.renderState=f,u.silhouetteModelCommand=d;var p=r$15.shallowClone(c);(f=l$1e(c.renderState,!0)).depthTest.enabled=!0,f.cull.enabled=!1,r&&(p.pass=Le$p.TRANSLUCENT,f.depthMask=!1,f.blending=Ee$n.ALPHA_BLEND),f.stencilTest={enabled:!0,frontFunction:de$y.NOTEQUAL,backFunction:de$y.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:de$y.KEEP,zFail:de$y.KEEP,zPass:de$y.KEEP},backOperation:{fail:de$y.KEEP,zFail:de$y.KEEP,zPass:de$y.KEEP}},f=u$R.fromCache(f);var _=c.shaderProgram,m=zi$2(e,_),$=n[m];e$28($)||($=ki$3(e,_,t),n[m]=$);var g=p$17(c.uniformMap,{gltf_silhouetteColor:_i$5(e),gltf_silhouetteSize:gi$5(e)});if(p.renderState=f,p.shaderProgram=$,p.uniformMap=g,p.castShadows=!1,p.receiveShadows=!1,u.silhouetteColorCommand=p,!o){var v=u.command2D,y=r$15.shallowClone(d);y.boundingVolume=v.boundingVolume,y.modelMatrix=v.modelMatrix,u.silhouetteModelCommand2D=y;var x=r$15.shallowClone(p);y.boundingVolume=v.boundingVolume,y.modelMatrix=v.modelMatrix,u.silhouetteColorCommand2D=x}}}function ji$4(e,t,i){return e=a$$.replaceMain(e,"gltf_clip_main"),e+=D$G._getClippingFunction(t,i)+"\n",e+="uniform sampler2D gltf_clippingPlanes; \nuniform mat4 gltf_clippingPlanesMatrix; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n gltf_clip_main(); \n"+p$D("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")+"} \n"}function Xr$1(e,t,i){if(Yr(e,t)){var r=e._nodeCommands,n=Qr(e.color.alpha,e._colorPreviousAlpha)||Qr(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!e$28(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(n||i)&&Ki$2(e,t)}}function Zi$2(e,t){var i=e._clippingPlanes;e$28(i)&&i.owner===e&&i.enabled&&i.update(t)}var fr$2=new i$19;function Yi$1(e,t,i){return fr$2.center=e,fr$2.radius=t,i.camera.getPixelSize(fr$2,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}var B$u=new t$X,Te$g=new t$W,Ji$2=new t$X;function Qi$1(e,t){var i=e.scale;if(0!==e.minimumPixelSize){var r=t.context,n=Math.max(r.drawingBufferWidth,r.drawingBufferHeight),o=e$28(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(B$u.x=o[12],B$u.y=o[13],B$u.z=o[14],e$28(e._rtcCenter)&&t$X.add(e._rtcCenter,B$u,B$u),e._mode!==P$$.SCENE3D){var a=t.mapProjection,s=a.ellipsoid.cartesianToCartographic(B$u,Te$g);a.project(s,B$u),t$X.fromElements(B$u.z,B$u.x,B$u.y,B$u)}var l=e.boundingSphere.radius,u=Yi$1(B$u,l,t),c=1/u;Math.min(c*(2*l),n)<e.minimumPixelSize&&(i=e.minimumPixelSize*u/(2*e._initialRadius))}return i instanceof t$X?e$28(e.maximumScale)&&(i.x=i.x>e.maximumScale?e.maximumScale:i.x,i.y=i.y>e.maximumScale?e.maximumScale:i.y,i.z=i.z>e.maximumScale?e.maximumScale:i.z):(e$28(e.maximumScale)&&(i=i>e.maximumScale?e.maximumScale:i),i=t$X.fromElements(i,i,i,Ji$2)),i}function $r$2(e){e$28(e._cacheKey)&&e$28(e._cachedGltf)&&0==--e._cachedGltf.count&&delete Z$z[e._cacheKey],e._cachedGltf=void 0}function hr$3(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function Y$t(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function Xi$2(e){Y$t(e.buffers),Y$t(e.vertexArrays),Y$t(e.programs),Y$t(e.silhouettePrograms),Y$t(e.textures)}function et$a(e,t,i){return function(r){if(e.heightReference===k$_.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(r,Te$g);n.height+=i.height,t.cartographicToCartesian(n,r)}var o=e._clampedModelMatrix;y$15.clone(e.modelMatrix,o),o[12]=r.x,o[13]=r.y,o[14]=r.z,e._heightChanged=!0}}function $i$2(e){e$28(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(e$28(t)&&e$28(t.globe)&&e.heightReference!==k$_.NONE){var i=t.globe,r=i.ellipsoid,n=e.modelMatrix;B$u.x=n[12],B$u.y=n[13],B$u.z=n[14];var o=r.cartesianToCartographic(B$u);e$28(e._clampedModelMatrix)||(e._clampedModelMatrix=y$15.clone(n,new y$15));var a=i._surface;e._removeUpdateHeightCallback=a.updateHeight(o,et$a(e,r,o));var s=i.getHeight(o);if(e$28(s)){var l=et$a(e,r,o);t$W.clone(o,Te$g),Te$g.height=s,r.cartographicToCartesian(Te$g,B$u),l(B$u)}}else{if(e.heightReference!==k$_.NONE)throw new t$Z("Height reference is not supported without a scene and globe.");e._clampedModelMatrix=void 0}}hr$3.prototype.release=function(){if(0==--this.count)return e$28(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],Xi$2(this),i$Z(this)};var en$4=new t$X,rn$4=new t$W;function tn$3(e,t){var i,r=e.distanceDisplayCondition,n=r.near*r.near,o=r.far*r.far;if(t.mode===P$$.SCENE2D){i=.5*(t.camera.frustum.right-t.camera.frustum.left),i*=i}else{var a=y$15.getTranslation(e.modelMatrix,en$4);if(t.mode===P$$.COLUMBUS_VIEW){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(a,rn$4);a=s.project(l,a),t$X.fromElements(a.z,a.x,a.y,a)}i=t$X.distanceSquared(a,t.camera.positionWC)}return i>=n&&i<=o}var nn$3=new t$X,pe$m=new t$X,Pe$e=new y$15;function rt$d(e,t){e.programs!==t.programs&&Y$t(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&Y$t(e.silhouettePrograms)}function an$3(e,t){var i,r=e._rendererResources,n=e._cachedRendererResources;if(rt$d(r,n),wr$2(e)||er$7(e)||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,r.programs={},r.silhouettePrograms={};var o={},a=e._sourceTechniques;for(var s in a)a.hasOwnProperty(s)&&(o[i=a[s].program]||(o[i]=!0,jt$2({programId:i,techniqueId:s},e,t.context,t)))}else r.programs=n.programs,r.silhouettePrograms=n.silhouettePrograms;for(var l=r.programs,u=e._nodeCommands,c=u.length,h=0;h<c;++h){var d=u[h],f=l[i=d.programId];d.command.shaderProgram=f,e$28(d.command2D)&&(d.command2D.shaderProgram=f)}Zr$1(e,t,!0),Xr$1(e,t,!0)}function n$u(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,re$n(this,r,n)}D$G.prototype.update=function(e){if(e.multiViewportIndex>-1&&e$28(this.id)){var t=this.id.entityCollection;if(e$28(t)){var i=t.owner;if(e$28(i)&&typeof i.getVisibleInViewport<"u")if(!i.getVisibleInViewport(e.multiViewportIndex))return}}if(e.mode!==P$$.MORPHING){var r=s$V.supportsWebPSync();if(e$28(r)){var n=e.context;if(this._defaultTexture=n.defaultTexture,this._state===F$M.NEEDS_LOAD&&e$28(this.gltf)){var o,a=this.cacheKey;if(e$28(a)){n.cache.modelRendererResourceCache=u$Y(n.cache.modelRendererResourceCache,{});var s=n.cache.modelRendererResourceCache;if(e$28(o=s[this.cacheKey])){if(!o.ready)return;++o.count,this._loadRendererResourcesFromCache=!0}else(o=new hr$3(n,a)).count=1,s[this.cacheKey]=o;this._cachedRendererResources=o}else(o=new hr$3(n)).count=1,this._cachedRendererResources=o;if(this._state=F$M.LOADING,this._state!==F$M.FAILED){var l=this.gltf.extensions;if(e$28(l)&&e$28(l.CESIUM_RTC)){var u=t$X.fromArray(l.CESIUM_RTC.center);if(!t$X.equals(u,t$X.ZERO)){this._rtcCenter3D=u;var c=e.mapProjection,h=c.ellipsoid.cartesianToCartographic(this._rtcCenter3D),d=c.project(h);t$X.fromElements(d.z,d.x,d.y,d),this._rtcCenter2D=d,this._rtcCenterEye=new t$X,this._rtcCenter=this._rtcCenter3D}}s$D(this.gltf),this._loadResources=new t$v,this._loadRendererResourcesFromCache||s$z.parseBuffers(this,Bt$5)}}var f=this._loadResources,p=this._incrementallyLoadTextures,_=!1;if(this._state===F$M.LOADING){if(0===f.pendingBufferLoads){if(!f.initialized){if(e.brdfLutGenerator.update(e),s$z.checkSupportedExtensions(this.extensionsRequired,r),s$z.updateForwardAxis(this),!this._loadRendererResourcesFromCache){var m=this.gltf;m.extras.sourceVersion=s$z.getAssetVersion(m),m.extras.sourceKHRTechniquesWebGL=e$28(s$z.getUsedExtensions(m).KHR_techniques_webgl),this._sourceVersion=m.extras.sourceVersion,this._sourceKHRTechniquesWebGL=m.extras.sourceKHRTechniquesWebGL,re$q(m),E$K(m);var $={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};ue$k(m,$),he$j(m,$)}this._sourceVersion=this.gltf.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltf.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&r$E.hasExtension(this),It$8(this),Nt$5(this),this._loadRendererResourcesFromCache||(Dt$8(this),Ft$4(this),Ut$2(this),qt$4(this,n,r)),kt$5(this),Gt$4(this),zt$4(this),r$E.parse(this,n),f.initialized=!0}f.finishedDecoding()||r$E.decodeModel(this,n).otherwise(s$z.getFailedLoadFunction(this,"model",this.basePath)),f.finishedDecoding()&&!f.resourcesParsed&&(this._boundingSphere=s$z.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,r$E.cacheDataForModel(this),f.resourcesParsed=!0),f.resourcesParsed&&0===f.pendingShaderLoads&&zr$3(this,e)}(f.finished()||p&&f.finishedEverythingButTextureCreation())&&(this._state=F$M.LOADED,_=!0)}if(e$28(f)&&this._state===F$M.LOADED&&(p&&!_&&zr$3(this,e),f.finished())){this._loadResources=void 0;var g=this._rendererResources,v=this._cachedRendererResources;v.buffers=g.buffers,v.vertexArrays=g.vertexArrays,v.programs=g.programs,v.sourceShaders=g.sourceShaders,v.silhouettePrograms=g.silhouettePrograms,v.textures=g.textures,v.samplers=g.samplers,v.renderStates=g.renderStates,v.ready=!0,this._normalAttributeName=s$z.getAttributeOrUniformBySemantic(this.gltf,"NORMAL"),e$28(this._precreatedAttributes)&&(v.vertexArrays={}),this.releaseGltfJson&&$r$2(this)}var y=u$z.isSupported(n);if(this._shouldUpdateSpecularMapAtlas&&y){if(this._shouldUpdateSpecularMapAtlas=!1,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._specularEnvironmentMapAtlas=void 0,e$28(this._specularEnvironmentMaps)){this._specularEnvironmentMapAtlas=new u$z(this._specularEnvironmentMaps);var x=this;this._specularEnvironmentMapAtlas.readyPromise.then((function(){x._shouldRegenerateShaders=!0}))}this._shouldRegenerateShaders=!0}e$28(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);var b=!e$28(this._specularEnvironmentMapAtlas)&&e$28(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,w=!e$28(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,C=!e$28(this._sphericalHarmonicCoefficients)&&e$28(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,T=!e$28(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||b||w||C||T,this._useDefaultSpecularMaps=!e$28(this._specularEnvironmentMapAtlas)&&e$28(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!e$28(this._sphericalHarmonicCoefficients)&&e$28(e.sphericalHarmonicCoefficients);var S=Yr(this,e),E=cr$3(this),A=Jr$1(this),P=!e$28(this.distanceDisplayCondition)||tn$3(this,e),I=this.show&&P&&(this.scale instanceof t$X?!t$X.equals(this._scale,t$X.ZERO):0!==this.scale)&&(!A||S);if(I&&this._state===F$M.LOADED||_){var M=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var O=this.modelMatrix,D=e.mode!==this._mode;this._mode=e.mode;var R=!y$15.equals(this._modelMatrix,O)||(this.scale instanceof t$X?!t$X.equals(this._scale,this.scale):this._scale!==this.scale)||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||D;if(R||_){y$15.clone(O,this._modelMatrix),$i$2(this),e$28(this._clampedModelMatrix)&&(O=this._clampedModelMatrix),this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var L=Qi$1(this,e),B=this._computedModelMatrix;if(e$28(this._offsetMatrix)){if(!this._lastDefinedOffset){"number"==typeof this._scale?(pe$m.x=this._scale,pe$m.y=this._scale,pe$m.z=this._scale):t$X.clone(this._scale,pe$m);var N=y$15.getTranslation(this._offsetMatrix,nn$3),F=t$X.divideComponents(N,pe$m,pe$m);t$X.negate(N,N),this._offsetMat4ForScale=this._offsetMat4ForScale||new y$15,this._realOffsetMat4ForScale=this._realOffsetMat4ForScale||new y$15,y$15.fromTranslation(N,this._offsetMat4ForScale),y$15.fromTranslation(F,this._realOffsetMat4ForScale)}y$15.multiply(y$15.fromScale(L),this._realOffsetMat4ForScale,Pe$e),y$15.multiply(this._offsetMat4ForScale,Pe$e,Pe$e)}else y$15.fromScale(L,Pe$e);y$15.multiply(O,Pe$e,B),this._scale=this.scale,this._lastDefinedOffset=e$28(this._offsetMatrix),this._upAxis===z$z.Y?y$15.multiplyTransformation(B,z$z.Y_UP_TO_Z_UP,B):this._upAxis===z$z.X&&y$15.multiplyTransformation(B,z$z.X_UP_TO_Z_UP,B),this.forwardAxis===z$z.Z&&y$15.multiplyTransformation(B,z$z.Z_UP_TO_X_UP,B)}(M||R||_)&&(Wr$1(this,R,_,e.mapProjection),this._dirty=!0,(M||_)&&Kr$2(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,Oi$2(this)),Fi$2(this),Ui$2(this),Vi$2(this),Hi$2(this),Zi$2(this,e);var z=this._clippingPlanes,k=0,V=e$28(z)&&z.enabled&&z.length>0,U=e$28(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics,X=e$28(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps;if(V||U||X){var H=u$Y(this.clippingPlanesOriginMatrix,O);y$15.multiply(n.uniformState.view3D,H,this._clippingPlaneModelViewMatrix)}V&&(k=z.clippingPlanesState),e.lightSource.hasChange()&&(this._shouldRegenerateShaders=!0);var G=this._shouldRegenerateShaders;G=G||this._clippingPlanesState!==k,this._clippingPlanesState=k;var W=er$7(this);W!==this._colorShadingEnabled&&(this._colorShadingEnabled=W,G=!0),G?an$3(this,e):(Zr$1(this,e,!1),Xr$1(this,e,!1))}if(_){var Y=this;return void e.afterRender.push((function(){Y._ready=!0,Y._readyPromise.resolve(Y)}))}if(I&&!this._ignoreCommands){var q,j,Z,K=e.commandList,Q=e.passes,J=this._nodeCommands,ee=J.length,te=e.mapProjection.ellipsoid.maximumRadius*e$27.PI;if(Q.render||Q.pick&&this.allowPicking){for(q=0;q<ee;++q)if((j=J[q]).show){var ie=E?j.translucentCommand:j.command;if(ie=S?j.silhouetteModelCommand:ie,K.push(ie),Z=j.command.boundingVolume,e.mode===P$$.SCENE2D&&(Z.center.y+Z.radius>te||Z.center.y-Z.radius<te)){var re=E?j.translucentCommand2D:j.command2D;re=S?j.silhouetteModelCommand2D:re,K.push(re)}}if(S&&!Q.pick)for(q=0;q<ee;++q)(j=J[q]).show&&(K.push(j.silhouetteColorCommand),Z=j.command.boundingVolume,e.mode===P$$.SCENE2D&&(Z.center.y+Z.radius>te||Z.center.y-Z.radius<te)&&K.push(j.silhouetteColorCommand2D))}}}}},D$G.prototype.updateAnimation=function(e){this._state===F$M.LOADED&&((this.activeAnimations.update(e)||this._cesiumAnimationsDirty)&&(Wr$1(this,!0,!0,e.mapProjection),Kr$2(this)))},D$G.prototype.isDestroyed=function(){return!1},D$G.prototype.destroy=function(){e$28(this._precreatedAttributes)&&Y$t(this._rendererResources.vertexArrays),e$28(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),e$28(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),e$28(this._cachedRendererResources)&&rt$d(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),r$E.destroyCachedDataForModel(this);for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();$r$2(this),this._quantizedVertexShaders=void 0;var r=this._clippingPlanes;return e$28(r)&&!r.isDestroyed()&&r.owner===this&&r.destroy(),this._clippingPlanes=void 0,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),i$Z(this)},D$G._getClippingFunction=f$K,D$G._modifyShaderForColor=Kt$4,n$u._deprecationWarning=t$T,Object.defineProperties(n$u.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var s$v=Uint32Array.BYTES_PER_ELEMENT;function O$w(e){var t=s$z.getAttributeOrUniformBySemantic(e,"_BATCHID");return e$28(t)||e$28(t=s$z.getAttributeOrUniformBySemantic(e,"BATCHID"))&&n$u._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`."),t}function I$W(e){return function(t,i){var r=e._batchTable,n=!e$28(e._tileset.classificationType),o=e._model.gltf;e$28(o)&&(e._batchIdAttributeName=O$w(o),e._diffuseAttributeOrUniformName[i]=s$z.getDiffuseAttributeOrUniform(o,i));var a=r.getVertexShaderCallback(n,e._batchIdAttributeName,e._diffuseAttributeOrUniformName[i]);return e$28(a)?a(t):t}}function ee$q(e){return function(t,i){var r=e._batchTable,n=!e$28(e._tileset.classificationType),o=e._model.gltf;e$28(o)&&(e._diffuseAttributeOrUniformName[i]=s$z.getDiffuseAttributeOrUniform(o,i));var a=r.getFragmentShaderCallback(n,e._diffuseAttributeOrUniformName[i]);return e$28(a)?a(t):t}}function N$u(e){return function(){return e._batchTable.getPickId()}}function te$q(e){return function(t){var i=e._batchTable.getClassificationFragmentShaderCallback();return e$28(i)?i(t):t}}function ie$o(e){return function(t,i){e._model.updateCommands(t,i)}}function re$n(e,t,i){var r=e._tileset,n=e._tile,o=e._resource,a=u$Y(i,0);i=a;var s=new Uint8Array(t),l=new DataView(t);i+=s$v;var u=l.getUint32(i,!0);if(1!==u)throw new t$U("Only Batched 3D Model version 1 is supported. Version "+u+" is not.");i+=s$v;var c=l.getUint32(i,!0);i+=s$v;var h=l.getUint32(i,!0);i+=s$v;var d=l.getUint32(i,!0);i+=s$v;var f=l.getUint32(i,!0);i+=s$v;var p,_,m=l.getUint32(i,!0);if(i+=s$v,f>=570425344?(i-=2*s$v,p=h,f=d,m=0,h=0,d=0,n$u._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength].")):m>=570425344&&(i-=s$v,p=f,f=h,m=d,h=0,d=0,n$u._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength].")),0===h)_={BATCH_LENGTH:u$Y(p,0)};else{var $=a$Z(s,i,h);_=JSON.parse($),i+=h}var g=new Uint8Array(t,i,d);i+=d;var v,y,x,b=new o$P(_,g);if(p=b.getGlobalProperty("BATCH_LENGTH"),b.featuresLength=p,f>0){var w=a$Z(s,i,f);v=JSON.parse(w),i+=f,m>0&&(y=new Uint8Array(t,i,m),y=new Uint8Array(y),i+=m)}e$28(r.classificationType)&&(x=ie$o(e));var C=new h$D(e,p,v,y,x);e._batchTable=C;var T,S=a+c-i;if(0===S)throw new t$U("glTF byte length must be greater than 0.");i%4==0?T=new Uint8Array(t,i,S):(n$u._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),T=new Uint8Array(s.subarray(i,i+S)));var E={content:e,primitive:r};e._rtcCenterTransform=y$15.IDENTITY;var A=b.getGlobalProperty("RTC_CENTER",S$W.FLOAT,3);e$28(A)&&(e._rtcCenterTransform=y$15.fromTranslation(t$X.fromArray(A))),e._contentModelMatrix=y$15.multiply(n.computedTransform,e._rtcCenterTransform,new y$15),e$28(r.classificationType)?e._model=new A$M({gltf:T,cull:!1,basePath:o,requestType:$$13.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:z$z.X,debugWireframe:r.debugWireframe,vertexShaderLoaded:I$W(e),classificationShaderLoaded:te$q(e),uniformMapLoaded:C.getUniformMapCallback(),pickIdLoaded:N$u(e),classificationType:r._classificationType,batchTable:C}):e._model=new D$G({gltf:T,cull:!1,releaseGltfJson:!0,opaquePass:Le$p.CESIUM_3D_TILE,basePath:o,requestType:$$13.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:z$z.X,shadows:r.shadows,debugWireframe:r.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:I$W(e),fragmentShaderLoaded:ee$q(e),uniformMapLoaded:C.getUniformMapCallback(),pickIdLoaded:N$u(e),addBatchIdToGeneratedShaders:p>0,pickObject:E,imageBasedLightingFactor:r.imageBasedLightingFactor,lightColor:r.lightColor,luminanceAtZenith:r.luminanceAtZenith,sphericalHarmonicCoefficients:r.sphericalHarmonicCoefficients,specularEnvironmentMaps:r.specularEnvironmentMaps,owner:r})}function ae$l(e){var t=e.featuresLength;if(!e$28(e._features)&&t>0){for(var i=new Array(t),r=0;r<t;++r)i[r]=new e$10(e,r);e._features=i}}function i$A(e,t,i,r,n,o){this._tileset=e,this._tile=t,this._resource=i,this._contents=[],this._readyPromise=o$1q.defer(),L$G(this,r,n,o)}n$u.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},n$u.prototype.getFeature=function(e){var t=this.featuresLength;if(!e$28(e)||e<0||e>=t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+(t-1)+").");return ae$l(this),this._features[e]},n$u.prototype.applyDebugSettings=function(e,t){t=e?t:e$1S.WHITE,0===this.featuresLength?this._model.color=t:this._batchTable.setAllColor(t)},n$u.prototype.applyStyle=function(e){if(0===this.featuresLength){var t=e$28(e)&&e$28(e.color),i=e$28(e)&&e$28(e.show);this._model.color=t?e.color.evaluateColor(void 0,this._model.color):e$1S.clone(e$1S.WHITE,this._model.color),this._model.show=!i||e.show.evaluate(void 0)}else this._batchTable.applyStyle(e)},n$u.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._contentModelMatrix=y$15.multiply(this._tile.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),this._model.modelMatrix=this._contentModelMatrix,this._model.shadows=this._tileset.shadows,this._model.imageBasedLightingFactor=this._tileset.imageBasedLightingFactor,this._model.lightColor=this._tileset.lightColor,this._model.luminanceAtZenith=this._tileset.luminanceAtZenith,this._model.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._model.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._model.debugWireframe=this._tileset.debugWireframe;var r=this._tileset.clippingPlanes;this._model.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,e$28(r)&&this._tile.clippingPlanesDirty&&(this._model._clippingPlanes=r.enabled&&this._tile._isClipped?r:void 0),e$28(r)&&e$28(this._model._clippingPlanes)&&this._model._clippingPlanes!==r&&(this._model._clippingPlanes=r),this._model.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&!e$28(e.classificationType)&&this._batchTable.addDerivedCommands(t,i)},n$u.prototype.isDestroyed=function(){return!1},n$u.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)},Object.defineProperties(i$A.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}});var u$y=Uint32Array.BYTES_PER_ELEMENT;function L$G(e,t,i,r){i=u$Y(i,0);var n=new Uint8Array(t),o=new DataView(t);i+=u$y;var a=o.getUint32(i,!0);if(1!==a)throw new t$U("Only Composite Tile version 1 is supported. Version "+a+" is not.");i+=u$y,i+=u$y;var s=o.getUint32(i,!0);i+=u$y;for(var l=[],u=0;u<s;++u){var c=a$U(n,i),h=o.getUint32(i+2*u$y,!0),d=r[c];if(!e$28(d))throw new t$U("Unknown tile content type, "+c+", inside Composite tile");var f=d(e._tileset,e._tile,e._resource,t,i);e._contents.push(f),l.push(f.readyPromise),i+=h}o$1q.all(l).then((function(){e._readyPromise.resolve(e)})).otherwise((function(t){e._readyPromise.reject(t)}))}function e$X(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,e$28(this._center)||(e$28(this._boundingVolume)?this._center=t$X.clone(this._boundingVolume.center):this._center=t$X.clone(t$X.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=L$V.BOTH}function F$L(e){var t=new Float64Array(y$15.packedLength+t$X.packedLength),i=0;return t$X.pack(e._center,t,i),i+=t$X.packedLength,y$15.pack(e._modelMatrix,t,i),t}function M$E(e,t){for(var i=0,r=t[i++],n=t[i++],o=e._boundingVolumes=new Array(n),a=0;a<n;++a)o[a]=i$19.unpack(t,i),i+=i$19.packedLength;for(var s=t[i++],l=e._batchedIndices=new Array(s),u=0;u<s;++u){var c=e$1S.unpack(t,i);i+=e$1S.packedLength;for(var h=t[i++],d=t[i++],f=t[i++],p=new Array(f),_=0;_<f;++_)p[_]=t[i++];l[u]=new c$F({color:c,offset:h,count:d,batchIds:p})}return r}i$A.prototype.hasProperty=function(e,t){return!1},i$A.prototype.getFeature=function(e){},i$A.prototype.applyDebugSettings=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].applyDebugSettings(e,t)},i$A.prototype.applyStyle=function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].applyStyle(e)},i$A.prototype.update=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].update(e,t)},i$A.prototype.isDestroyed=function(){return!1},i$A.prototype.destroy=function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)e[i].destroy();return i$Z(this)},Object.defineProperties(e$X.prototype,{trianglesLength:{get:function(){return e$28(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return e$28(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}}),e$X.packedBoxLength=y$15.packedLength+t$X.packedLength,e$X.packedCylinderLength=y$15.packedLength+2,e$X.packedEllipsoidLength=y$15.packedLength+t$X.packedLength,e$X.packedSphereLength=t$X.packedLength+1;var R$x=new i$W("createVectorTileGeometries"),E$H=new e$1S;function W$A(e){if(!e$28(e._primitive)){if(!e$28(e._verticesPromise)){var t=e._boxes,i=e._boxBatchIds,r=e._cylinders,n=e._cylinderBatchIds,o=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,l=e._sphereBatchIds,u=e._batchTableColors,c=e._packedBuffer;if(!e$28(u)){var h=0;e$28(e._boxes)&&(t=e._boxes=l$12(t),h+=(i=e._boxBatchIds=l$12(i)).length),e$28(e._cylinders)&&(r=e._cylinders=l$12(r),h+=(n=e._cylinderBatchIds=l$12(n)).length),e$28(e._ellipsoids)&&(o=e._ellipsoids=l$12(o),h+=(a=e._ellipsoidBatchIds=l$12(a)).length),e$28(e._spheres)&&(s=e._sphere=l$12(s),h+=(l=e._sphereBatchIds=l$12(l)).length),u=e._batchTableColors=new Uint32Array(h);for(var d=e._batchTable,f=0;f<h;++f){var p=d.getColor(f,E$H);u[f]=p.toRgba()}c=e._packedBuffer=F$L(e)}var _=[];e$28(t)&&_.push(t.buffer,i.buffer),e$28(r)&&_.push(r.buffer,n.buffer),e$28(o)&&_.push(o.buffer,a.buffer),e$28(s)&&_.push(s.buffer,l.buffer),_.push(u.buffer,c.buffer);var m={boxes:e$28(t)?t.buffer:void 0,boxBatchIds:e$28(t)?i.buffer:void 0,cylinders:e$28(r)?r.buffer:void 0,cylinderBatchIds:e$28(r)?n.buffer:void 0,ellipsoids:e$28(o)?o.buffer:void 0,ellipsoidBatchIds:e$28(o)?a.buffer:void 0,spheres:e$28(s)?s.buffer:void 0,sphereBatchIds:e$28(s)?l.buffer:void 0,batchTableColors:u.buffer,packedBuffer:c.buffer},$=e._verticesPromise=R$x.scheduleTask(m,_);if(!e$28($))return;$.then((function(t){var i=new Float64Array(t.packedBuffer),r=M$E(e,i);e._indices=2===r?new Uint16Array(t.indices):new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._positions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.vertexBatchIds),e._batchIds=new Uint16Array(t.batchIds),e._ready=!0}))}e._ready&&!e$28(e._primitive)&&(e._primitive=new y$E({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:u$Y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0,e._readyPromise.resolve())}}function p$C(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._geometries=void 0,this._contentReadyPromise=void 0,this._readyPromise=o$1q.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,Q$z(this,r,n)}function q$G(e){return function(t,i){e$28(e._geometries)&&e._geometries.updateCommands(t,i)}}function K$x(e,t){var i,r,n,o,a,s=u$Y(e.BOXES_LENGTH,0),l=u$Y(e.CYLINDERS_LENGTH,0),u=u$Y(e.ELLIPSOIDS_LENGTH,0),c=u$Y(e.SPHERES_LENGTH,0);if(s>0&&e$28(e.BOX_BATCH_IDS)){var h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,s)}if(l>0&&e$28(e.CYLINDER_BATCH_IDS)){var d=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,d,l)}if(u>0&&e$28(e.ELLIPSOID_BATCH_IDS)){var f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,u)}if(c>0&&e$28(e.SPHERE_BATCH_IDS)){var p=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}var _=e$28(i)||e$28(r)||e$28(n)||e$28(o),m=s>0&&!e$28(i)||l>0&&!e$28(r)||u>0&&!e$28(n)||c>0&&!e$28(o);if(_&&m)throw new t$U("If one group of batch ids is defined, then all batch ids must be defined.");if(!(e$28(i)||e$28(r)||e$28(n)||e$28(o))){var $=0;if(!e$28(i)&&s>0)for(i=new Uint16Array(s),a=0;a<s;++a)i[a]=$++;if(!e$28(r)&&l>0)for(r=new Uint16Array(l),a=0;a<l;++a)r[a]=$++;if(!e$28(n)&&u>0)for(n=new Uint16Array(u),a=0;a<u;++a)n[a]=$++;if(!e$28(o)&&c>0)for(o=new Uint16Array(c),a=0;a<c;++a)o[a]=$++}return{boxes:i,cylinders:r,ellipsoids:n,spheres:o}}e$X.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},e$X.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},e$X.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},e$X.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},e$X.prototype.update=function(e){W$A(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},e$X.prototype.isDestroyed=function(){return!1},e$X.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i$Z(this)},Object.defineProperties(p$C.prototype,{featuresLength:{get:function(){return e$28(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return e$28(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return e$28(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return e$28(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var c$D=Uint32Array.BYTES_PER_ELEMENT;function Q$z(e,t,i){i=u$Y(i,0);var r=new Uint8Array(t),n=new DataView(t);i+=c$D;var o=n.getUint32(i,!0);if(1!==o)throw new t$U("Only Geometry tile version 1 is supported. Version "+o+" is not.");i+=c$D;var a=n.getUint32(i,!0);if(i+=c$D,0!==a){var s=n.getUint32(i,!0);if(i+=c$D,0===s)throw new t$U("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0);i+=c$D;var u=n.getUint32(i,!0);i+=c$D;var c=n.getUint32(i,!0),h=a$Z(r,i+=c$D,s),d=JSON.parse(h);i+=s;var f,p,_=new Uint8Array(t,i,l);if(i+=l,u>0){var m=a$Z(r,i,u);f=JSON.parse(m),i+=u,c>0&&(p=new Uint8Array(t,i,c),p=new Uint8Array(p))}var $=u$Y(d.BOXES_LENGTH,0),g=u$Y(d.CYLINDERS_LENGTH,0),v=u$Y(d.ELLIPSOIDS_LENGTH,0),y=u$Y(d.SPHERES_LENGTH,0),x=$+g+v+y,b=new h$D(e,x,f,p,q$G(e));if(e._batchTable=b,0!==x){var w,C=e.tile.computedTransform;e$28(d.RTC_CENTER)&&(w=t$X.unpack(d.RTC_CENTER),y$15.multiplyByPoint(C,w,w));var T=K$x(d,_);if($>0||g>0||v>0||y>0){var S,E,A,P;if($>0){var I=_.byteOffset+d.BOXES.byteOffset;S=new Float32Array(_.buffer,I,e$X.packedBoxLength*$)}if(g>0){var M=_.byteOffset+d.CYLINDERS.byteOffset;E=new Float32Array(_.buffer,M,e$X.packedCylinderLength*g)}if(v>0){var O=_.byteOffset+d.ELLIPSOIDS.byteOffset;A=new Float32Array(_.buffer,O,e$X.packedEllipsoidLength*v)}if(y>0){var D=_.byteOffset+d.SPHERES.byteOffset;P=new Float32Array(_.buffer,D,e$X.packedSphereLength*y)}e._geometries=new e$X({boxes:S,boxBatchIds:T.boxes,cylinders:E,cylinderBatchIds:T.cylinders,ellipsoids:A,ellipsoidBatchIds:T.ellipsoids,spheres:P,sphereBatchIds:T.spheres,center:w,modelMatrix:C,batchTable:b,boundingVolume:e.tile.boundingVolume.boundingVolume})}}}else e._readyPromise.resolve(e)}function x$J(e){var t=e.featuresLength;if(!e$28(e._features)&&t>0){var i=new Array(t);e$28(e._geometries)&&e._geometries.createFeatures(e,i),e._features=i}}function e$W(e,t,i){this.primitive=e,this._modelMatrix=y$15.clone(t),this._instanceId=i}p$C.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},p$C.prototype.getFeature=function(e){var t=this.featuresLength;if(!e$28(e)||e<0||e>=t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+(t-1)+").");return x$J(this),this._features[e]},p$C.prototype.applyDebugSettings=function(e,t){e$28(this._geometries)&&this._geometries.applyDebugSettings(e,t)},p$C.prototype.applyStyle=function(e){x$J(this),e$28(this._geometries)&&this._geometries.applyStyle(e,this._features)},p$C.prototype.update=function(e,t){if(e$28(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),e$28(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t),!e$28(this._contentReadyPromise)){var i=this;this._contentReadyPromise=this._geometries.readyPromise.then((function(){i._readyPromise.resolve(i)}))}},p$C.prototype.isDestroyed=function(){return!1},p$C.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)},Object.defineProperties(e$W.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return y$15.clone(this._modelMatrix)},set:function(e){y$15.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var y$C={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function w$s(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).gltf)&&!e$28(e.url))throw new t$Z("Either options.gltf or options.url is required.");if(e$28(e.gltf)&&e$28(e.url))throw new t$Z("Cannot pass in both options.gltf and options.url.");this.show=u$Y(e.show,!0),this._instancingSupported=!1,this._dynamic=u$Y(e.dynamic,!1),this._allowPicking=u$Y(e.allowPicking,!0),this._ready=!1,this._readyPromise=o$1q.defer(),this._state=y$C.NEEDS_LOAD,this._dirty=!1,this._cull=u$Y(e.cull,!0),this._opaquePass=u$Y(e.opaquePass,Le$p.OPAQUE),this._instances=re$m(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._boundingSphere=ae$k(this),this._center=t$X.clone(this._boundingSphere.center),this._rtcTransform=new y$15,this._rtcModelView=new y$15,this._mode=void 0,this.modelMatrix=y$15.clone(y$15.IDENTITY),this._modelMatrix=y$15.clone(this.modelMatrix),this._url=t$S.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=t$S.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=u$Y(e.shadows,q$L.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=u$Y(e.debugWireframe,!1),this._debugWireframe=!1,this._imageBasedLightingFactor=new o$1k(1,1),o$1k.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=e.luminanceAtZenith,this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps}function re$m(e,t){for(var i=(t=u$Y(t,[])).length,r=new Array(i),n=0;n<i;++n){var o=t[n],a=o.modelMatrix,s=u$Y(o.batchId,n);r[n]=new e$W(e,a,s)}return r}function ae$k(e){for(var t=e.length,i=new Array(t),r=0;r<t;++r)i[r]=y$15.getTranslation(e._instances[r]._modelMatrix,new t$X);return i$19.fromPoints(i)}Object.defineProperties(w$s.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){o$1u.typeOf.object("imageBasedLightingFactor",e),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),o$1k.clone(e,this._imageBasedLightingFactor)}}});var te$p=new t$X,M$D=new y$15;function ne$r(e,t,i,r){return function(n,o){var a=n.semantic;if(e$28(a)&&e.indexOf(a)>-1){if(!(t.indexOf(a)>-1))throw new t$U('Shader program cannot be optimized for instancing. Uniform "'+o+'" in program "'+i+'" uses unsupported semantic "'+a+'"');r[o]=a}}}function F$K(e,t){if(e$28(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var i={};e._instancedUniformsByProgram=i;var r=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],n=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model._sourceTechniques;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l=s.program;if(!e$28(i[l])){var u={};i[l]=u,e$$.techniqueUniform(s,ne$r(r,n,t,u))}}return i[t]}function ie$n(e){return function(t,i){var r=F$K(e,i),n=e$28(e._batchTable),o=a$$.replaceMain(t,"czm_instancing_main"),a="",s="";for(var l in r)if(r.hasOwnProperty(l)){var u,c=r[l];"MODELVIEW"===c||"CESIUM_RTC_MODELVIEW"===c?u="czm_instanced_modelView":"MODELVIEWPROJECTION"===c?(u="czm_instanced_modelViewProjection",a+="mat4 czm_instanced_modelViewProjection;\n",s+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===c&&(u="czm_instanced_modelViewInverseTranspose",a+="mat3 czm_instanced_modelViewInverseTranspose;\n",s+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");var h=new RegExp("uniform.*"+l+".*");o=o.replace(h,""),h=new RegExp(l+"\\b","g"),o=o.replace(h,u)}var d,f,p;n?(d="attribute float a_batchId;\n",f="",p=""):(d="",f="attribute vec4 pickColor;\nvarying vec4 v_pickColor;\n",p=" v_pickColor = pickColor;\n");var _="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+a+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+d+f+o+"void main()\n{\n mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+s+" czm_instancing_main();\n"+p+"}\n";if(n){var m=e._model.gltf,$=s$z.getDiffuseAttributeOrUniform(m,i);_=e._batchTable.getVertexShaderCallback(!0,"a_batchId",$)(_)}return _}}function se$h(e){return function(t,i){var r=e._batchTable;if(e$28(r)){var n=e._model.gltf,o=s$z.getDiffuseAttributeOrUniform(n,i);t=r.getFragmentShaderCallback(!0,o)(t)}else t="varying vec4 v_pickColor;\n"+t;return t}}function de$i(e,t){return function(){return y$15.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function oe$k(e){return function(){return e.computedMatrix}}function me$k(e,t){return function(i,r,n){(i=l$1e(i)).czm_instanced_modifiedModelView=de$i(e,t),i.czm_instanced_nodeTransform=oe$k(n);var o=F$K(e,r);for(var a in o)o.hasOwnProperty(a)&&delete i[a];return e$28(e._batchTable)&&(i=e._batchTable.getUniformMapCallback()(i)),i}}function ue$h(e){return function(t,i){if(e$28(e._batchTable)){var r=e._model.gltf,n=s$z.getDiffuseAttributeOrUniform(r,i);t="uniform float a_batchId\n;"+(t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",n)(t))}return t}}function he$g(e){return function(t,i){var r=e._batchTable;if(e$28(r)){var n=e._model.gltf,o=s$z.getDiffuseAttributeOrUniform(n,i);t=r.getFragmentShaderCallback(!0,o)(t)}else t="uniform vec4 czm_pickColor;\n"+t;return t}}function fe$i(e){return function(t){return e$28(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function U$C(e){var t=e._instances,i=e.length,r=e._center,n=e._vertexBufferTypedArray;e$28(n)||(n=new Float32Array(12*i)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var o=0;o<i;++o){var a=t[o]._modelMatrix,s=y$15.clone(a,M$D);s[12]-=r.x,s[13]-=r.y,s[14]-=r.z;var l=12*o;n[l+0]=s[0],n[l+1]=s[4],n[l+2]=s[8],n[l+3]=s[12],n[l+4]=s[1],n[l+5]=s[5],n[l+6]=s[9],n[l+7]=s[13],n[l+8]=s[2],n[l+9]=s[6],n[l+10]=s[10],n[l+11]=s[14]}return n}function _e$f(e,t){var i,r=e._instances,n=e.length,o=e._dynamic,a=e$28(e._batchTable);if(a){var s=new Uint16Array(n);for(i=0;i<n;++i)s[i]=r[i]._instanceId;e._batchIdBuffer=h$W.createVertexBuffer({context:t,typedArray:s,usage:A$1c.STATIC_DRAW})}if(!a){var l=new Uint8Array(4*n);for(i=0;i<n;++i){var u=e._pickIds[i].color,c=4*i;l[c]=e$1S.floatToByte(u.red),l[c+1]=e$1S.floatToByte(u.green),l[c+2]=e$1S.floatToByte(u.blue),l[c+3]=e$1S.floatToByte(u.alpha)}e._pickIdBuffer=h$W.createVertexBuffer({context:t,typedArray:l,usage:A$1c.STATIC_DRAW})}var h=U$C(e);e._vertexBuffer=h$W.createVertexBuffer({context:t,typedArray:h,usage:o?A$1c.STREAM_DRAW:A$1c.STATIC_DRAW})}function ge$g(e){var t=U$C(e);e._vertexBuffer.copyFromArrayView(t)}function ce$i(e,t){for(var i=e._instances,r=i.length,n=new Array(r),o=0;o<r;++o)n[o]=t.createPickId(i[o]);return n}function ve$e(e,t){var i=e._instancingSupported,r=e$28(e._batchTable),n=e._allowPicking,o={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:n,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLightingFactor:e.imageBasedLightingFactor,lightColor:e.lightColor,luminanceAtZenith:e.luminanceAtZenith,sphericalHarmonicCoefficients:e.sphericalHarmonicCoefficients,specularEnvironmentMaps:e.specularEnvironmentMaps};if(r||(e._pickIds=ce$i(e,t)),i){_e$f(e,t);var a=S$W.getSizeInBytes(S$W.FLOAT),s={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*a,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:4*a,strideInBytes:12*a,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:8*a,strideInBytes:12*a,instanceDivisor:1}};r&&(s.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:S$W.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r||(s.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:S$W.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o.precreatedAttributes=s,o.vertexShaderLoaded=ie$n(e),o.fragmentShaderLoaded=se$h(e),o.uniformMapLoaded=me$k(e,t),e$28(e._url)&&(o.cacheKey=e._url.getUrlComponent()+"#instanced")}else o.vertexShaderLoaded=ue$h(e),o.fragmentShaderLoaded=he$g(e),o.uniformMapLoaded=fe$i(e);e$28(e._url)?e._model=D$G.fromGltf(o):e._model=new D$G(o)}function pe$l(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?W$_.LINES:W$_.TRIANGLES,i=e._drawCommands,r=i.length,n=0;n<r;++n)i[n].primitiveType=t}}function le$k(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e._drawCommands,i=t.length,r=0;r<i;++r)t[r].debugShowBoundingVolume=e.debugShowBoundingVolume}}function be$i(e,t){for(var i=t.length,r=e.length,n=e._boundingSphere,o=e._cull,a=0;a<i;++a){var s=r$15.shallowClone(t[a]);s.instanceCount=r,s.boundingVolume=n,s.cull=o,e$28(e._batchTable)?s.pickId=e._batchTable.getPickId():s.pickId="v_pickColor",e._drawCommands.push(s)}}function ye$i(e){return function(){return e}}function we$g(e){return function(){return e}}function Ee$d(e,t){for(var i=e._instances,r=t.length,n=e.length,o=e$28(e._batchTable),a=e._cull,s=0;s<r;++s)for(var l=0;l<n;++l){var u=r$15.shallowClone(t[s]);if(u.modelMatrix=new y$15,u.boundingVolume=new i$19,u.cull=a,u.uniformMap=l$1e(u.uniformMap),o)u.uniformMap.a_batchId=ye$i(i[l]._instanceId);else{var c=e._pickIds[l];u.uniformMap.czm_pickColor=we$g(c.color)}e._drawCommands.push(u)}}function W$z(e){for(var t=e._modelCommands,i=t.length,r=e.length,n=e._rtcTransform,o=e._center,a=0;a<i;++a)for(var s=t[a],l=0;l<r;++l){var u=a*r+l,c=e._drawCommands[u],h=y$15.clone(e._instances[l]._modelMatrix,M$D);h[12]-=o.x,h[13]-=o.y,h[14]-=o.z,h=y$15.multiply(n,h,M$D);var d=s.modelMatrix,f=c.modelMatrix;y$15.multiply(h,d,f);var p=s.boundingVolume,_=c.boundingVolume;i$19.transform(p,h,_)}}function q$F(e){for(var t=e._nodeCommands,i=t.length,r=[],n=0;n<i;++n){var o=t[n];o.show&&r.push(o.command)}return r}function Te$f(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;r++){if(t[r].command.dirty)return!0}return!1}function H$D(e,t){e._drawCommands=[];var i=q$F(e._model);t?be$i(e,i):(Ee$d(e,i),W$z(e))}function Ie$h(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=q$L.castShadows(e.shadows),i=q$L.receiveShadows(e.shadows),r=e._drawCommands,n=r.length,o=0;o<n;++o){var a=r[o];a.castShadows=t,a.receiveShadows=i}}}function u$x(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,Se$a(this,r,n)}function Ne$8(e){return function(){return e._batchTable.getPickId()}}w$s.prototype.expandBoundingSphere=function(e){var t=y$15.getTranslation(e,te$p);i$19.expand(this._boundingSphere,t,this._boundingSphere)},w$s.prototype.update=function(e){if(e.mode!==P$$.MORPHING&&this.show&&0!==this.length){var t=e.context;if(this._state===y$C.NEEDS_LOAD){this._state=y$C.LOADING,this._instancingSupported=t.instancedArrays,ve$e(this,t);var i=this;this._model.readyPromise.otherwise((function(e){i._state=y$C.FAILED,i._readyPromise.reject(e)}))}var r=this._instancingSupported,n=this._model;if(n.imageBasedLightingFactor=this.imageBasedLightingFactor,n.lightColor=this.lightColor,n.luminanceAtZenith=this.luminanceAtZenith,n.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,n.specularEnvironmentMaps=this.specularEnvironmentMaps,n.update(e),n.ready&&this._state===y$C.LOADING){this._state=y$C.LOADED,this._ready=!0;var o=n.boundingSphere.radius+t$X.magnitude(n.boundingSphere.center);return this._boundingSphere.radius+=o,this._modelCommands=q$F(n),H$D(this,r),void this._readyPromise.resolve(this)}if(this._state===y$C.LOADED){var a=e.mode!==this._mode,s=this.modelMatrix,l=!y$15.equals(this._modelMatrix,s);if(a||l){this._mode=e.mode,y$15.clone(s,this._modelMatrix);var u=y$15.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==P$$.SCENE3D&&(u=m$1b.basisTo2D(e.mapProjection,u,u)),y$15.getTranslation(u,this._boundingSphere.center)}r&&this._dirty&&(this._dynamic=!0,this._dirty=!1,ge$g(this)),Te$f(n)&&H$D(this,r),!r&&(n.dirty||this._dirty||a||l)&&W$z(this),Ie$h(this),pe$l(this),le$k(this);var c=e.passes;if(c.render||c.pick)for(var h=e.commandList,d=this._drawCommands,f=d.length,p=0;p<f;++p)h.push(d[p])}}},w$s.prototype.isDestroyed=function(){return!1},w$s.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(e$28(e))for(var t=e.length,i=0;i<t;++i)e[i].destroy();return i$Z(this)},u$x._deprecationWarning=t$T,Object.defineProperties(u$x.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return e$28(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return e$28(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return e$28(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var g$z=Uint32Array.BYTES_PER_ELEMENT,L$F=new Array(4),ie$m=new Array(4);function Se$a(e,t,i){var r=u$Y(i,0);i=r;var n=new Uint8Array(t),o=new DataView(t);i+=g$z;var a=o.getUint32(i,!0);if(1!==a)throw new t$U("Only Instanced 3D Model version 1 is supported. Version "+a+" is not.");i+=g$z;var s=o.getUint32(i,!0);i+=g$z;var l=o.getUint32(i,!0);if(0===l)throw new t$U("featureTableJsonByteLength is zero, the feature table must be defined.");i+=g$z;var u=o.getUint32(i,!0);i+=g$z;var c=o.getUint32(i,!0);i+=g$z;var h=o.getUint32(i,!0);i+=g$z;var d=o.getUint32(i,!0);if(1!==d&&0!==d)throw new t$U("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+d+" is not.");var f=a$Z(n,i+=g$z,l),p=JSON.parse(f);i+=l;var _=new Uint8Array(t,i,u);i+=u;var m,$,g=new o$P(p,_),v=g.getGlobalProperty("INSTANCES_LENGTH");if(g.featuresLength=v,!e$28(v))throw new t$U("Feature table global property: INSTANCES_LENGTH must be defined");if(c>0){var y=a$Z(n,i,c);m=JSON.parse(y),i+=c,h>0&&($=new Uint8Array(t,i,h),$=new Uint8Array($),i+=h)}e._batchTable=new h$D(e,v,m,$);var x,b=r+s-i;if(0===b)throw new t$U("glTF byte length is zero, i3dm must have a glTF to instance.");i%4==0?x=new Uint8Array(t,i,b):(u$x._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(n.subarray(i,i+b)));var w=e._tileset,C={instances:new Array(v),batchTable:e._batchTable,cull:!1,url:void 0,requestType:$$13.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:w._gltfUpAxis,forwardAxis:z$z.X,opaquePass:Le$p.CESIUM_3D_TILE,pickIdLoaded:Ne$8(e),imageBasedLightingFactor:w.imageBasedLightingFactor,lightColor:w.lightColor,luminanceAtZenith:w.luminanceAtZenith,sphericalHarmonicCoefficients:w.sphericalHarmonicCoefficients,specularEnvironmentMaps:w.specularEnvironmentMaps};if(0===d){var T=a$Z(x);T=T.replace(/[\s\0]+$/,""),C.url=e._resource.getDerivedResource({url:T})}else C.gltf=x,C.basePath=e._resource.clone();var S,E=g.getGlobalProperty("EAST_NORTH_UP"),A=g.getGlobalProperty("RTC_CENTER",S$W.FLOAT,3);e$28(A)&&(S=t$X.unpack(A));for(var P=C.instances,I=new t$X,M=new Array(3),O=new t$X,D=new t$X,R=new t$X,L=new p$1a,B=new n$14,N=new t$X,F=new e$1f,z=new y$15,k=0;k<v;k++){var V=g.getProperty("POSITION",S$W.FLOAT,3,k,L$F);if(!e$28(V)){V=M;var U=g.getProperty("POSITION_QUANTIZED",S$W.UNSIGNED_SHORT,3,k,L$F);if(!e$28(U))throw new t$U("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var X=g.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",S$W.FLOAT,3);if(!e$28(X))throw new t$U("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var H=g.getGlobalProperty("QUANTIZED_VOLUME_SCALE",S$W.FLOAT,3);if(!e$28(H))throw new t$U("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var G=0;G<3;G++)V[G]=U[G]/65535*H[G]+X[G]}t$X.unpack(V,0,I),e$28(S)&&t$X.add(I,S,I),F.translation=I;var W=g.getProperty("NORMAL_UP",S$W.FLOAT,3,k,L$F),Y=g.getProperty("NORMAL_RIGHT",S$W.FLOAT,3,k,ie$m),q=!1;if(e$28(W)){if(!e$28(Y))throw new t$U("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");t$X.unpack(W,0,D),t$X.unpack(Y,0,O),q=!0}else{var j=g.getProperty("NORMAL_UP_OCT32P",S$W.UNSIGNED_SHORT,2,k,L$F),Z=g.getProperty("NORMAL_RIGHT_OCT32P",S$W.UNSIGNED_SHORT,2,k,ie$m);if(e$28(j)){if(!e$28(Z))throw new t$U("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");t$N.octDecodeInRange(j[0],j[1],65535,D),t$N.octDecodeInRange(Z[0],Z[1],65535,O),q=!0}else E?(m$1b.eastNorthUpToFixedFrame(I,t$V.WGS84,z),y$15.getMatrix3(z,L)):p$1a.clone(p$1a.IDENTITY,L)}q&&(t$X.cross(O,D,R),t$X.normalize(R,R),p$1a.setColumn(L,0,O,L),p$1a.setColumn(L,1,D,L),p$1a.setColumn(L,2,R,L)),n$14.fromRotationMatrix(L,B),F.rotation=B,N=t$X.fromElements(1,1,1,N);var K=g.getProperty("SCALE",S$W.FLOAT,1,k);e$28(K)&&t$X.multiplyByScalar(N,K,N);var Q=g.getProperty("SCALE_NON_UNIFORM",S$W.FLOAT,3,k,L$F);e$28(Q)&&(N.x*=Q[0],N.y*=Q[1],N.z*=Q[2]),F.scale=N;var J=g.getProperty("BATCH_ID",S$W.UNSIGNED_SHORT,1,k);e$28(J)||(J=k),y$15.fromTranslationRotationScale(F,z);var ee=z.clone();P[k]={modelMatrix:ee,batchId:J}}e._modelInstanceCollection=new w$s(C)}function Ue$h(e){var t=e.featuresLength;if(!e$28(e._features)&&t>0){for(var i=new Array(t),r=0;r<t;++r)i[r]=new e$10(e,r);e._features=i}}u$x.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},u$x.prototype.getFeature=function(e){var t=this.featuresLength;if(!e$28(e)||e<0||e>=t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+(t-1)+").");return Ue$h(this),this._features[e]},u$x.prototype.applyDebugSettings=function(e,t){t=e?t:e$1S.WHITE,this._batchTable.setAllColor(t)},u$x.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)},u$x.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.luminanceAtZenith=this._tileset.luminanceAtZenith,this._modelInstanceCollection.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._modelInstanceCollection.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe;var r=this._modelInstanceCollection._model;if(e$28(r)){var n=this._tileset.clippingPlanes;r.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,e$28(n)&&this._tile.clippingPlanesDirty&&(r._clippingPlanes=n.enabled&&this._tile._isClipped?n:void 0),e$28(n)&&e$28(r._clippingPlanes)&&r._clippingPlanes!==n&&(r._clippingPlanes=n)}this._modelInstanceCollection.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,i,!1)},u$x.prototype.isDestroyed=function(){return!1},u$x.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)};var e$V={ADD:0,REPLACE:1},f$H=Object.freeze(e$V),K$w={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function ie$l(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=e$1S.clone(e$1S.DARKGRAY),this._highlightColor=e$1S.clone(e$1S.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=K$w.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=u$Y(e.opaquePass,Le$p.OPAQUE),this._cull=u$Y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=y$15.clone(y$15.IDENTITY),this._modelMatrix=y$15.clone(y$15.IDENTITY),this.time=0,this.shadows=q$L.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,We$e(this,e)}Object.defineProperties(ie$l.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},color:{get:function(){return e$1S.clone(this._highlightColor)},set:function(e){this._highlightColor=e$1S.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(e$28(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=i$19.clone(e,this._boundingSphere)}}});var X$r=Uint32Array.BYTES_PER_ELEMENT;function We$e(e,t){var i=t.arrayBuffer,r=u$Y(t.byteOffset,0),n=new Uint8Array(i),o=new DataView(i);r+=X$r;var a=o.getUint32(r,!0);if(1!==a)throw new t$U("Only Point Cloud tile version 1 is supported. Version "+a+" is not.");r+=X$r,r+=X$r;var s=o.getUint32(r,!0);if(0===s)throw new t$U("Feature table must have a byte length greater than zero");r+=X$r;var l=o.getUint32(r,!0);r+=X$r;var u=o.getUint32(r,!0);r+=X$r;var c=o.getUint32(r,!0),h=a$Z(n,r+=X$r,s),d=JSON.parse(h);r+=s;var f,p,_=new Uint8Array(i,r,l);if(r+=l,u>0){var m=a$Z(n,r,u);f=JSON.parse(m),r+=u,c>0&&(p=new Uint8Array(i,r,c),r+=c)}var $=new o$P(d,_),g=$.getGlobalProperty("POINTS_LENGTH");if($.featuresLength=g,!e$28(g))throw new t$U("Feature table global property: POINTS_LENGTH must be defined");var v=$.getGlobalProperty("RTC_CENTER",S$W.FLOAT,3);e$28(v)&&(e._rtcCenter=t$X.unpack(v));var y,x,b,w,C,T,S,E,A,P=!1,I=!1,M=!1,O=!1,D=!1,R=!1,L=!1,B=!1,N=e$28(d.extensions)?d.extensions["3DTILES_draco_point_compression"]:void 0,F=e$28(f)&&e$28(f.extensions)?f.extensions["3DTILES_draco_point_compression"]:void 0;if(e$28(F)&&(S=F.properties),e$28(N)){T=N.properties;var z=N.byteOffset,k=N.byteLength;if(!e$28(T)||!e$28(z)||!e$28(k))throw new t$U("Draco properties, byteOffset, and byteLength must be defined");C=l$12(_,z,z+k),P=e$28(T.POSITION),I=e$28(T.RGB)||e$28(T.RGBA),M=e$28(T.NORMAL),O=e$28(T.BATCH_ID),R=e$28(T.RGBA),e._decodingState=K$w.NEEDS_DECODE}if(e$28(C)&&(E={buffer:C,featureTableProperties:T,batchTableProperties:S,properties:p$17(T,S),dequantizeInShader:e._dequantizeInShader}),!P)if(e$28(d.POSITION))y=$.getPropertyArray("POSITION",S$W.FLOAT,3),P=!0;else if(e$28(d.POSITION_QUANTIZED)){y=$.getPropertyArray("POSITION_QUANTIZED",S$W.UNSIGNED_SHORT,3),D=!0,P=!0;var V=$.getGlobalProperty("QUANTIZED_VOLUME_SCALE",S$W.FLOAT,3);if(!e$28(V))throw new t$U("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");e._quantizedVolumeScale=t$X.unpack(V),e._quantizedRange=65535;var U=$.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",S$W.FLOAT,3);if(!e$28(U))throw new t$U("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e._quantizedVolumeOffset=t$X.unpack(U)}if(I||(e$28(d.RGBA)?(x=$.getPropertyArray("RGBA",S$W.UNSIGNED_BYTE,4),R=!0,I=!0):e$28(d.RGB)?(x=$.getPropertyArray("RGB",S$W.UNSIGNED_BYTE,3),I=!0):e$28(d.RGB565)&&(x=$.getPropertyArray("RGB565",S$W.UNSIGNED_SHORT,1),L=!0,I=!0)),M||(e$28(d.NORMAL)?(b=$.getPropertyArray("NORMAL",S$W.FLOAT,3),M=!0):e$28(d.NORMAL_OCT16P)&&(b=$.getPropertyArray("NORMAL_OCT16P",S$W.UNSIGNED_BYTE,2),B=!0,M=!0)),O||e$28(d.BATCH_ID)&&(w=$.getPropertyArray("BATCH_ID",S$W.UNSIGNED_SHORT,1),O=!0),!P)throw new t$U("Either POSITION or POSITION_QUANTIZED must be defined.");if(e$28(d.CONSTANT_RGBA)){var X=$.getGlobalProperty("CONSTANT_RGBA",S$W.UNSIGNED_BYTE,4);e._constantColor=e$1S.fromBytes(X[0],X[1],X[2],X[3],e._constantColor)}if(O){var H=$.getGlobalProperty("BATCH_LENGTH");if(!e$28(H))throw new t$U("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");e$28(p)&&(p=new Uint8Array(p)),e$28(e._batchTableLoaded)&&e._batchTableLoaded(H,f,p)}!O&&e$28(p)&&(A=h$D.getBinaryProperties(g,f,p)),e._parsedContent={positions:y,colors:x,normals:b,batchIds:w,styleableProperties:A,draco:E},e._pointsLength=g,e._isQuantized=D,e._isOctEncoded16P=B,e._isRGB565=L,e._isTranslucent=R,e._hasColors=I,e._hasNormals=M,e._hasBatchIds=O}var je$f=new t$X,Je$7=new t$X,Ke$a=new t$X,le$j;function Xe$9(e){if(!e$28(le$j)){e$27.setRandomNumberSeed(0),le$j=new Array(e);for(var t=0;t<e;++t)le$j[t]=e$27.nextRandomNumber()}return le$j}function $e$7(e){for(var t=e.length/3,i=Math.min(t,20),r=Xe$9(20),n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=t$X.fromElements(n,n,n,je$f),s=t$X.fromElements(o,o,o,Je$7),l=0;l<i;++l){var u=Math.floor(r[l]*t),c=t$X.unpack(e,3*u,Ke$a);t$X.minimumByComponent(a,c,a),t$X.maximumByComponent(s,c,s)}var h=i$19.fromCornerPoints(a,s);return h.radius+=e$27.EPSILON2,h}function Ne$7(e,t){var i=S$W.fromTypedArray(e);return i===S$W.INT||i===S$W.UNSIGNED_INT||i===S$W.DOUBLE?(e$1$("Cast pnts property to floats",'Point cloud property "'+t+'" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.'),new Float32Array(e)):e}var er$6=new e$25,rr$6=new e$25,tr$3=new e$1S,Be$j=0,fe$h=1,_e$e=2,ze$b=3,ar$5=4,ue$g=new y$15;function ir$3(e,t){var i,r,n=t.context,o=e._parsedContent,a=e._pointsLength,s=o.positions,l=o.colors,u=o.normals,c=o.batchIds,h=o.styleableProperties,d=e$28(h),f=e._isQuantized,p=e._isQuantizedDraco,_=e._isOctEncoded16P,m=e._isOctEncodedDraco,$=e._quantizedRange,g=e._octEncodedRange,v=e._isRGB565,y=e._isTranslucent,x=e._hasColors,b=e._hasNormals,w=e._hasBatchIds,C=[],T={};if(e._styleableShaderAttributes=T,d){var S=ar$5;for(var E in h)if(h.hasOwnProperty(E)){var A=h[E],P=Ne$7(A.typedArray,E);i=A.componentCount,r=S$W.fromTypedArray(P);var I=h$W.createVertexBuffer({context:n,typedArray:P,usage:A$1c.STATIC_DRAW});e._geometryByteLength+=I.sizeInBytes;var M={index:S,vertexBuffer:I,componentsPerAttribute:i,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0};C.push(M),T[E]={location:S,componentCount:i},++S}}var O,D,R,L=h$W.createVertexBuffer({context:n,typedArray:s,usage:A$1c.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes,x&&(O=h$W.createVertexBuffer({context:n,typedArray:l,usage:A$1c.STATIC_DRAW}),e._geometryByteLength+=O.sizeInBytes),b&&(D=h$W.createVertexBuffer({context:n,typedArray:u,usage:A$1c.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes),w&&(c=Ne$7(c,"batchIds"),R=h$W.createVertexBuffer({context:n,typedArray:c,usage:A$1c.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);var B=[];if(r=f?S$W.UNSIGNED_SHORT:p?$<=255?S$W.UNSIGNED_BYTE:S$W.UNSIGNED_SHORT:S$W.FLOAT,B.push({index:Be$j,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(e._boundingSphere=f||p?i$19.fromCornerPoints(t$X.ZERO,e._quantizedVolumeScale):$e$7(s)),x)if(v)B.push({index:fe$h,vertexBuffer:O,componentsPerAttribute:1,componentDatatype:S$W.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{var N=y?4:3;B.push({index:fe$h,vertexBuffer:O,componentsPerAttribute:N,componentDatatype:S$W.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}b&&(_?(i=2,r=S$W.UNSIGNED_BYTE):m?(i=2,r=g<=255?S$W.UNSIGNED_BYTE:S$W.UNSIGNED_SHORT):(i=3,r=S$W.FLOAT),B.push({index:_e$e,vertexBuffer:D,componentsPerAttribute:i,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0})),w&&B.push({index:ze$b,vertexBuffer:R,componentsPerAttribute:1,componentDatatype:S$W.fromTypedArray(c),normalize:!1,offsetInBytes:0,strideInBytes:0}),d&&(B=B.concat(C));var F=new m$19({context:n,attributes:B}),z={depthTest:{enabled:!0}};e._opaquePass===Le$p.CESIUM_3D_TILE&&(z.stencilTest=Fa$6.setCesium3DTileBit(),z.stencilMask=Fa$6.CESIUM_3D_TILE_MASK),e._opaqueRenderState=u$R.fromCache(z),e._translucentRenderState=u$R.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:Ee$n.ALPHA_BLEND}),e._drawCommand=new r$15({boundingVolume:new i$19,cull:e._cull,modelMatrix:new y$15,primitiveType:W$_.POINTS,vertexArray:F,count:a,shaderProgram:void 0,uniformMap:void 0,renderState:y?e._translucentRenderState:e._opaqueRenderState,pass:y?Le$p.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function nr$4(e,t){var i=t.context,r=e._isQuantized,n=e._isQuantizedDraco,o=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){var r=er$6;if(r.x=e._attenuation?e.maximumAttenuation:e._pointSize,r.x*=t.pixelRatio,r.y=e.time,e._attenuation){var n,o=t.camera.frustum;n=t.mode===P$$.SCENE2D||o instanceof a$X?Number.POSITIVE_INFINITY:i.drawingBufferHeight/t.camera.frustum.sseDenominator,r.z=e.geometricError*e.geometricErrorScale,r.w=n}return r},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){var t=e.clippingPlanes;return e.isClipped?t.texture:i.defaultTexture},u_clippingPlanesEdgeStyle:function(){var t=e.clippingPlanes;if(!e$28(t))return e$1S.TRANSPARENT;var i=e$1S.clone(t.edgeColor,tr$3);return i.alpha=t.edgeWidth,i},u_clippingPlanesMatrix:function(){var t=e.clippingPlanes;if(!e$28(t))return y$15.IDENTITY;var r=u$Y(e.clippingPlanesOriginMatrix,e._modelMatrix);return y$15.multiply(i.uniformState.view3D,r,ue$g),y$15.multiply(ue$g,t.modelMatrix,ue$g)}};(r||n||o)&&(a=p$17(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){var t=rr$6;if(e$28(e._quantizedVolumeScale)){var i=t$X.clone(e._quantizedVolumeScale,t);t$X.divideByScalar(i,e._quantizedRange,t)}return t.w=e._octEncodedRange,t}})),e$28(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}var ve$d=["POSITION","COLOR","NORMAL","POSITION_ABSOLUTE"];function ge$f(e,t){for(var i=/czm_tiles3d_style_(\w+)/g,r=i.exec(e);null!==r;){var n=r[1];-1===t.indexOf(n)&&t.push(n),r=i.exec(e)}}function pe$k(e,t){for(var i=e.numberOfAttributes,r=0;r<i;++r){var n=e.getAttribute(r);if(n.index===t)return n}}function ye$h(e){for(var t=ve$d.length,i=0;i<t;++i){var r=ve$d[i],n="czm_tiles3d_style_"+r,o=r.toLowerCase();e=e.replace(new RegExp(n+"(\\W)","g"),o+"$1")}return e.replace("()","(vec3 position, vec3 position_absolute, vec4 color, vec3 normal)")}function or$3(e,t,i){var r,n,o,a,s,l,u=t.context,c=e$28(i),h=e._isQuantized,d=e._isQuantizedDraco,f=e._isOctEncoded16P,p=e._isOctEncodedDraco,_=e._isRGB565,m=e._isTranslucent,$=e._hasColors,g=e._hasNormals,v=e._hasBatchIds,y=e._backFaceCulling,x=e._normalShading,b=e._drawCommand.vertexArray,w=e.clippingPlanes,C=e._attenuation,T=m;if(c){var S={translucent:!1};a=i.getColorShaderFunction("getColorFromStyle","czm_tiles3d_style_",S),s=i.getShowShaderFunction("getShowFromStyle","czm_tiles3d_style_",S),l=i.getPointSizeShaderFunction("getPointSizeFromStyle","czm_tiles3d_style_",S),e$28(a)&&S.translucent&&(T=!0)}e._styleTranslucent=T;var E=e$28(a),A=e$28(s),P=e$28(l),I=e.isClipped,M=[];E&&(ge$f(a,M),a=ye$h(a)),A&&(ge$f(s,M),s=ye$h(s)),P&&(ge$f(l,M),l=ye$h(l));var O=M.indexOf("COLOR")>=0,D=M.indexOf("NORMAL")>=0,R=M.filter((function(e){return-1===ve$d.indexOf(e)}));if(D&&!g)throw new t$U("Style references the NORMAL semantic but the point cloud does not have normals");var L=e._styleableShaderAttributes;for(n in L)if(L.hasOwnProperty(n)){o=L[n];var B=R.indexOf(n)>=0;pe$k(b,o.location).enabled=B}var N=$&&(!E||O);$&&(pe$k(b,fe$h).enabled=N);var F=g&&(x||y||D);g&&(pe$k(b,_e$e).enabled=F);var z={a_position:Be$j};N&&(z.a_color=fe$h),F&&(z.a_normal=_e$e),v&&(z.a_batchId=ze$b);var k="",V=R.length;for(r=0;r<V;++r){if(!e$28(o=L[n=R[r]]))throw new t$U('Style references a property "'+n+'" that does not exist or is not styleable.');var U=o.componentCount,X="czm_tiles3d_style_"+n;k+="attribute "+(1===U?"float":"vec"+U)+" "+X+"; \n",z[X]=o.location}nr$4(e,t);var H="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";H+="float u_pointSize; \nfloat u_time; \n",C&&(H+="float u_geometricError; \nfloat u_depthMultiplier; \n"),H+=k,N&&(H+=m?"attribute vec4 a_color; \n":_?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),F&&(H+=f||p?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),v&&(H+="attribute float a_batchId; \n"),(h||d||p)&&(H+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),E&&(H+=a),A&&(H+=s),P&&(H+=l),H+="void main() \n{ \n u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n u_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",C&&(H+=" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),H+=N?m?" vec4 color = a_color; \n":_?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",H+=h||d?" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":" vec3 position = a_position; \n",H+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",F?(H+=f?" vec3 normal = czm_octDecode(a_normal); \n":p?" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":" vec3 normal = a_normal; \n",H+=" vec3 normalEC = czm_normal * normal; \n"):H+=" vec3 normal = vec3(1.0); \n",E&&(H+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),A&&(H+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),H+=P?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \n":C?" vec4 positionEC = czm_modelView * vec4(position, 1.0); \n float depth = -positionEC.z; \n gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":" gl_PointSize = u_pointSize; \n",H+=" color = color * u_highlightColor; \n",F&&x&&(H+=" float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \n diffuseStrength = max(diffuseStrength, 0.4); \n color.xyz *= diffuseStrength * czm_lightColor; \n"),H+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",F&&y&&(H+=" float visible = step(-normalEC.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),A&&(H+=" gl_Position.w *= float(show); \n gl_PointSize *= float(show); \n"),H+="} \n";var G="varying vec4 v_color; \n";I&&(G+="uniform sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",G+="\n",G+=f$K(w,u),G+="\n"),G+="void main() \n{ \n gl_FragColor = czm_gammaCorrect(v_color); \n",I&&(G+=p$D("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),G+="} \n",e$28(e._vertexShaderLoaded)&&(H=e._vertexShaderLoaded(H)),e$28(e._fragmentShaderLoaded)&&(G=e._fragmentShaderLoaded(G));var W=e._drawCommand;e$28(W.shaderProgram)&&W.shaderProgram.destroy(),W.shaderProgram=S$T.fromCache({context:u,vertexShaderSource:H,fragmentShaderSource:G,attributeLocations:z});try{W.shaderProgram._bind()}catch{throw new t$U("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function sr$1(e,t){if(e._decodingState===K$w.READY)return!1;if(e._decodingState===K$w.NEEDS_DECODE){var i=e._parsedContent,r=i.draco,n=r$E.decodePointCloud(r,t);e$28(n)&&(e._decodingState=K$w.DECODING,n.then((function(t){e._decodingState=K$w.READY;var n=e$28(t.POSITION)?t.POSITION.array:void 0,o=e$28(t.RGB)?t.RGB.array:void 0,a=e$28(t.RGBA)?t.RGBA.array:void 0,s=e$28(t.NORMAL)?t.NORMAL.array:void 0,l=e$28(t.BATCH_ID)?t.BATCH_ID.array:void 0,u=e$28(n)&&e$28(t.POSITION.data.quantization),c=e$28(s)&&e$28(t.NORMAL.data.quantization);if(u){var h=t.POSITION.data.quantization,d=h.range;e._quantizedVolumeScale=t$X.fromElements(d,d,d),e._quantizedVolumeOffset=t$X.unpack(h.minValues),e._quantizedRange=(1<<h.quantizationBits)-1,e._isQuantizedDraco=!0}c&&(e._octEncodedRange=(1<<t.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);var f=i.styleableProperties,p=r.batchTableProperties;for(var _ in p)if(p.hasOwnProperty(_)){var m=t[_];e$28(f)||(f={}),f[_]={typedArray:m.array,componentCount:m.data.componentsPerAttribute}}i.positions=u$Y(n,i.positions),i.colors=u$Y(u$Y(a,o),i.colors),i.normals=u$Y(s,i.normals),i.batchIds=u$Y(l,i.batchIds),i.styleableProperties=f})).otherwise((function(t){e._decodingState=K$w.FAILED,e._readyPromise.reject(t)})))}return!0}var cr$2=new e$25,lr$3=new t$X;function T$w(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function _$B(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function a$z(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).context;o$1u.defined("options.context",t);var i=t._gl,r=e$1U.maximumColorAttachments;if(this._gl=i,this._framebuffer=i.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=u$Y(e.destroyAttachments,!0),e$28(e.colorTextures)&&e$28(e.colorRenderbuffers))throw new t$Z("Cannot have both color texture and color renderbuffer attachments.");if(e$28(e.depthTexture)&&e$28(e.depthRenderbuffer))throw new t$Z("Cannot have both a depth texture and depth renderbuffer attachment.");if(e$28(e.depthStencilTexture)&&e$28(e.depthStencilRenderbuffer))throw new t$Z("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");var n,o,a,s,l,u=e$28(e.depthTexture)||e$28(e.depthRenderbuffer),c=e$28(e.depthStencilTexture)||e$28(e.depthStencilRenderbuffer);if(u&&c)throw new t$Z("Cannot have both a depth and depth-stencil attachment.");if(e$28(e.stencilRenderbuffer)&&c)throw new t$Z("Cannot have both a stencil and depth-stencil attachment.");if(u&&e$28(e.stencilRenderbuffer))throw new t$Z("Cannot have both a depth and stencil attachment.");if(this._bind(),e$28(e.colorTextures)){var h=e.colorTextures;if((s=this._colorTextures.length=this._activeColorAttachments.length=h.length)>r)throw new t$Z("The number of color attachments exceeds the number supported.");for(a=0;a<s;++a){if(n=h[a],!V$O.isColorFormat(n.pixelFormat))throw new t$Z("The color-texture pixel-format must be a color format.");if(n.pixelDatatype===y$U.FLOAT&&!t.colorBufferFloat)throw new t$Z("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(n.pixelDatatype===y$U.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new t$Z("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");T$w(this,l=this._gl.COLOR_ATTACHMENT0+a,n),this._activeColorAttachments[a]=l,this._colorTextures[a]=n}}if(e$28(e.colorRenderbuffers)){var d=e.colorRenderbuffers;if((s=this._colorRenderbuffers.length=this._activeColorAttachments.length=d.length)>r)throw new t$Z("The number of color attachments exceeds the number supported.");for(a=0;a<s;++a)o=d[a],_$B(this,l=this._gl.COLOR_ATTACHMENT0+a,o),this._activeColorAttachments[a]=l,this._colorRenderbuffers[a]=o}if(e$28(e.depthTexture)){if((n=e.depthTexture).pixelFormat!==V$O.DEPTH_COMPONENT)throw new t$Z("The depth-texture pixel-format must be DEPTH_COMPONENT.");T$w(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n}if(e$28(e.depthRenderbuffer)&&(o=e.depthRenderbuffer,_$B(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),e$28(e.stencilRenderbuffer)&&(o=e.stencilRenderbuffer,_$B(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),e$28(e.depthStencilTexture)){if((n=e.depthStencilTexture).pixelFormat!==V$O.DEPTH_STENCIL)throw new t$Z("The depth-stencil pixel-format must be DEPTH_STENCIL.");T$w(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n}e$28(e.depthStencilRenderbuffer)&&(o=e.depthStencilRenderbuffer,_$B(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}ie$l.prototype.update=function(e){if(!sr$1(this,e.context)){var t=!1,i=!y$15.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,i=!0),e$28(this._drawCommand)||(ir$3(this,e),i=!0,t=!0,this._ready=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),i){y$15.clone(this.modelMatrix,this._modelMatrix);var r=this._drawCommand.modelMatrix;if(y$15.clone(this._modelMatrix,r),e$28(this._rtcCenter)&&y$15.multiplyByTranslation(r,this._rtcCenter,r),e$28(this._quantizedVolumeOffset)&&y$15.multiplyByTranslation(r,this._quantizedVolumeOffset,r),e.mode!==P$$.SCENE3D){var n=e.mapProjection,o=y$15.getColumn(r,3,cr$2);e$25.equals(o,e$25.UNIT_W)||m$1b.basisTo2D(n,r,r)}var a=this._drawCommand.boundingVolume;if(i$19.clone(this._boundingSphere,a),this._cull){var s=a.center;y$15.multiplyByPoint(r,s,s);var l=y$15.getScale(r,lr$3);a.radius*=t$X.maximumComponent(l)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,t=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,t=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,t=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,t=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,t=!0),t&&or$3(this,e,this._style),this._drawCommand.castShadows=q$L.castShadows(this.shadows),this._drawCommand.receiveShadows=q$L.receiveShadows(this.shadows);var u=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=u?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=u?Le$p.TRANSLUCENT:this._opaquePass;var c=e.commandList,h=e.passes;(h.render||h.pick)&&c.push(this._drawCommand)}},ie$l.prototype.isDestroyed=function(){return!1},ie$l.prototype.destroy=function(){var e=this._drawCommand;return e$28(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),i$Z(this)},Object.defineProperties(a$z.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),a$z.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},a$z.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},a$z.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},a$z.prototype.getColorTexture=function(e){if(!e$28(e)||e<0||e>=this._colorTextures.length)throw new t$Z("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]},a$z.prototype.getColorRenderbuffer=function(e){if(!e$28(e)||e<0||e>=this._colorRenderbuffers.length)throw new t$Z("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]},a$z.prototype.isDestroyed=function(){return!1},a$z.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,t=this._colorTextures,i=t.length;e<i;++e){var r=t[e];e$28(r)&&r.destroy()}var n=this._colorRenderbuffers;for(i=n.length,e=0;e<i;++e){var o=n[e];e$28(o)&&o.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),i$Z(this)},a$z.copyFromFramebufferToFramebuffer=function(e,t,i,r,n,o){if(e.webgl2){var a=e._gl,s=0;if(r&&(s|=a.COLOR_BUFFER_BIT),n&&(s|=a.DEPTH_BUFFER_BIT),o&&(s|=a.STENCIL_BUFFER_BIT),0!=s){a.bindFramebuffer(a.READ_FRAMEBUFFER,t._framebuffer),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,i._framebuffer);var l=i.getColorTexture(0),u=l.width,c=l.height;a.blitFramebuffer(0,0,u,c,0,0,u,c,s,a.NEAREST),a.bindFramebuffer(a.READ_FRAMEBUFFER,null),a.bindFramebuffer(a.DRAW_FRAMEBUFFER,null)}}};var I$V="#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nvarying vec2 v_textureCoordinates;\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\nfloat dist = u_distanceAndEdlStrength.x;\nvec2 texCoordOrig = v_textureCoordinates + offset * dist;\nvec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\nvec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\nfloat depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\nfloat depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\nif (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\nreturn vec2(0.0);\n}\nfloat depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\nvoid main()\n{\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat log2Depth = log2(-eyeCoordinate.z);\nif (depthOrLogDepth == 0.0)\n{\ndiscard;\n}\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\nvec2 texelSize = 1.0 / czm_viewport.zw;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat strength = u_distanceAndEdlStrength.y;\nfloat shade = exp(-response * 300.0 * strength);\ncolor.rgb *= shade;\ngl_FragColor = vec4(color);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + (czm_projection * vec4(eyeCoordinate.xyz, 1.0)).w);\n#else\ngl_FragDepthEXT = czm_eyeToWindowCoordinates(vec4(eyeCoordinate.xyz, 1.0)).z;\n#endif\n}\n";function m$C(){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthGBuffer=void 0,this._depthTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}function s$u(){return new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}function T$v(e){var t=e._framebuffer;!e$28(t)||(e._colorGBuffer.destroy(),e._depthGBuffer.destroy(),e._depthTexture.destroy(),t.destroy(),e._framebuffer=void 0,e._colorGBuffer=void 0,e._depthGBuffer=void 0,e._depthTexture=void 0,e._drawCommand=void 0,e._clearCommand=void 0)}function R$w(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:s$u()}),o=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:s$u()}),a=new L$17({context:t,width:i,height:r,pixelFormat:V$O.DEPTH_COMPONENT,pixelDatatype:y$U.UNSIGNED_INT,sampler:s$u()});e._framebuffer=new a$z({context:t,colorTextures:[n,o],depthTexture:a,destroyAttachments:!1}),e._colorGBuffer=n,e._depthGBuffer=o,e._depthTexture=a}var c$C=new o$1k;function U$B(e,t){var i=I$V,r={u_pointCloud_colorGBuffer:function(){return e._colorGBuffer},u_pointCloud_depthGBuffer:function(){return e._depthGBuffer},u_distanceAndEdlStrength:function(){return c$C.x=e._radius,c$C.y=e._strength,c$C}},n=u$R.fromCache({blending:Ee$n.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Fa$6.setCesium3DTileBit(),stencilMask:Fa$6.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:r,renderState:n,pass:Le$p.CESIUM_3D_TILE,owner:e}),e._clearCommand=new r$11({framebuffer:e._framebuffer,color:new e$1S(0,0,0,0),depth:1,renderState:u$R.fromCache(),pass:Le$p.CESIUM_3D_TILE,owner:e})}function z$w(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=e._colorGBuffer,o=!1,a=e$28(n)&&(n.width!==i||n.height!==r);return(!e$28(n)||a)&&(T$v(e),R$w(e,t),U$B(e,t),o=!0),o}function E$G(e){return e.drawBuffers&&e.fragmentDepth}function H$C(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!e$28(i)){var r=t._attributeLocations,n=t.fragmentShaderSource.clone();n.sources=n.sources.map((function(e){return e=(e=a$$.replaceMain(e,"czm_point_cloud_post_process_main")).replace(/gl_FragColor/g,"gl_FragData[0]")})),n.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),n.sources.push("void main() \n{ \n czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \n#else\n gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\n#endif\n}"),i=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function o$O(e){var t=u$Y(e,{});this.attenuation=u$Y(t.attenuation,!1),this.geometricErrorScale=u$Y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=u$Y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=u$Y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=u$Y(t.eyeDomeLightingRadius,1),this.backFaceCulling=u$Y(t.backFaceCulling,!1),this.normalShading=u$Y(t.normalShading,!0)}function a$y(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._pointCloud=new ie$l({arrayBuffer:r,byteOffset:n,cull:!1,opaquePass:Le$p.CESIUM_3D_TILE,vertexShaderLoaded:v$y(this),fragmentShaderLoaded:P$A(this),uniformMapLoaded:k$C(this),batchTableLoaded:x$I(this),pickIdLoaded:E$F(this)})}function v$y(e){return function(t){return e$28(e._batchTable)?e._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(t):t}}function P$A(e){return function(t){return e$28(e._batchTable)?e._batchTable.getFragmentShaderCallback(!1,void 0)(t):"uniform vec4 czm_pickColor;\n"+t}}function k$C(e){return function(t){return e$28(e._batchTable)?e._batchTable.getUniformMapCallback()(t):p$17(t,{czm_pickColor:function(){return e._pickId.color}})}}function x$I(e){return function(t,i,r){e._batchTable=new h$D(e,t,i,r)}}function E$F(e){return function(){return e$28(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function I$U(e){var t=e._tileset.pointCloudShading,i=e._tile.contentBoundingVolume.boundingSphere.volume(),r=e$27.cbrt(i/e.pointsLength),n=e._tile.geometricError;return 0===n&&(n=e$28(t)&&e$28(t.baseResolution)?t.baseResolution:r),n}function B$t(e){var t=e.featuresLength;if(!e$28(e._features)&&t>0){for(var i=new Array(t),r=0;r<t;++r)i[r]=new e$10(e,r);e._features=i}}m$C.isSupported=E$G,m$C.prototype.update=function(e,t,i){if(E$G(e.context)){this._strength=i.eyeDomeLightingStrength,this._radius=i.eyeDomeLightingRadius*e.pixelRatio;var r,n=z$w(this,e.context),o=e.commandList,a=o.length;for(r=t;r<a;++r){var s=o[r];if(s.primitiveType===W$_.POINTS&&s.pass!==Le$p.TRANSLUCENT){var l=s.derivedCommands.pointCloudProcessor;(!e$28(l)||s.dirty||n||l.framebuffer!==this._framebuffer)&&(l=r$15.shallowClone(s),s.derivedCommands.pointCloudProcessor=l,l.framebuffer=this._framebuffer,l.shaderProgram=H$C(e.context,s.shaderProgram),l.castShadows=!1,l.receiveShadows=!1),o[r]=l}}var u=this._clearCommand,c=this._drawCommand;o.push(c),o.push(u)}},m$C.prototype.isDestroyed=function(){return!1},m$C.prototype.destroy=function(){return T$v(this),i$Z(this)},o$O.isSupported=function(e){return m$C.isSupported(e.context)},Object.defineProperties(a$y.prototype,{featuresLength:{get:function(){return e$28(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return e$28(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}}),a$y.prototype.hasProperty=function(e,t){return!!e$28(this._batchTable)&&this._batchTable.hasProperty(e,t)},a$y.prototype.getFeature=function(e){if(e$28(this._batchTable)){var t=this.featuresLength;if(!e$28(e)||e<0||e>=t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+(t-1)+").");return B$t(this),this._features[e]}},a$y.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:e$1S.WHITE},a$y.prototype.applyStyle=function(e){e$28(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};var w$r=new o$O;function t$t(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._readyPromise=o$1q.defer(),this.featurePropertiesDirty=!1,c$B(this,r,n)}function c$B(e,t,i){i=u$Y(i,0);var r,n=a$Z(new Uint8Array(t),i);try{r=JSON.parse(n)}catch{return void e._readyPromise.reject(new t$U("Invalid tile content."))}e._tileset.loadTileset(e._resource,r,e._tile),e._readyPromise.resolve(e)}function f$G(e,t,i,r){if(o$1u.defined("context",e),!t||0===t.length)throw new t$Z("At least one attribute is required.");var n=f$G._verifyAttributes(t);i=u$Y(i,0);for(var o,a,s=[],l={},u=n.length,c=0;c<u;++c){var h=n[c];h.vertexBuffer?s.push(h):(e$28(o=l[a=h.usage])||(o=l[a]=[]),o.push(h))}function d(e,t){return S$W.getSizeInBytes(t.componentDatatype)-S$W.getSizeInBytes(e.componentDatatype)}for(a in this._allBuffers=[],l)if(l.hasOwnProperty(a)){(o=l[a]).sort(d);var f=f$G._vertexSizeInBytes(o),p={vertexSizeInBytes:f,vertexBuffer:void 0,usage:o[0].usage,needsCommit:!1,arrayBuffer:void 0,arrayViews:f$G._createArrayViews(o,f)};this._allBuffers.push(p)}this._size=0,this._instanced=u$Y(r,!1),this._precreated=s,this._context=e,this.writers=void 0,this.va=void 0,this.resize(i)}a$y.prototype.update=function(e,t){var i,r=this._pointCloud,n=u$Y(e.pointCloudShading,w$r),o=this._tile,a=this._batchTable,s=t.mode,l=e.clippingPlanes;!e$28(this._pickId)&&!e$28(a)&&(this._pickId=t.context.createPickId({primitive:e,content:this})),e$28(a)&&a.update(e,t),i=e$28(o._contentBoundingVolume)?s===P$$.SCENE3D?o._contentBoundingVolume.boundingSphere:o._contentBoundingVolume2D.boundingSphere:s===P$$.SCENE3D?o._boundingVolume.boundingSphere:o._boundingVolume2D.boundingSphere;var u=this._styleDirty;this._styleDirty=!1,r.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,r.style=e$28(a)?void 0:e.style,r.styleDirty=u,r.modelMatrix=o.computedTransform,r.time=e.timeSinceLoad,r.shadows=e.shadows,r.boundingSphere=i,r.clippingPlanes=l,r.isClipped=e$28(l)&&l.enabled&&o._isClipped,r.clippingPlanesDirty=o.clippingPlanesDirty,r.attenuation=n.attenuation,r.backFaceCulling=n.backFaceCulling,r.normalShading=n.normalShading,r.geometricError=I$U(this),r.geometricErrorScale=n.geometricErrorScale,e$28(n)&&e$28(n.maximumAttenuation)?r.maximumAttenuation=n.maximumAttenuation:o.refine===f$H.ADD?r.maximumAttenuation=5:r.maximumAttenuation=e.maximumScreenSpaceError,r.update(t)},a$y.prototype.isDestroyed=function(){return!1},a$y.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)},Object.defineProperties(t$t.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),t$t.prototype.hasProperty=function(e,t){return!1},t$t.prototype.getFeature=function(e){},t$t.prototype.applyDebugSettings=function(e,t){},t$t.prototype.applyStyle=function(e){},t$t.prototype.update=function(e,t){},t$t.prototype.isDestroyed=function(){return!1},t$t.prototype.destroy=function(){return i$Z(this)},f$G._verifyAttributes=function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],n={index:u$Y(r.index,i),enabled:u$Y(r.enabled,!0),componentsPerAttribute:r.componentsPerAttribute,componentDatatype:u$Y(r.componentDatatype,S$W.FLOAT),normalize:u$Y(r.normalize,!1),vertexBuffer:r.vertexBuffer,usage:u$Y(r.usage,A$1c.STATIC_DRAW)};if(t.push(n),1!==n.componentsPerAttribute&&2!==n.componentsPerAttribute&&3!==n.componentsPerAttribute&&4!==n.componentsPerAttribute)throw new t$Z("attribute.componentsPerAttribute must be in the range [1, 4].");var o=n.componentDatatype;if(!S$W.validate(o))throw new t$Z("Attribute must have a valid componentDatatype or not specify it.");if(!A$1c.validate(n.usage))throw new t$Z("Attribute must have a valid usage or not specify it.")}for(var a=new Array(t.length),s=0;s<t.length;++s){var l=t[s].index;if(a[l])throw new t$Z("Index "+l+" is used by more than one attribute.");a[l]=!0}return t},f$G._vertexSizeInBytes=function(e){for(var t=0,i=e.length,r=0;r<i;++r){var n=e[r];t+=n.componentsPerAttribute*S$W.getSizeInBytes(n.componentDatatype)}var o=i>0?S$W.getSizeInBytes(e[0].componentDatatype):0,a=o>0?t%o:0;return t+=0===a?0:o-a},f$G._createArrayViews=function(e,t){for(var i=[],r=0,n=e.length,o=0;o<n;++o){var a=e[o],s=a.componentDatatype;i.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:r,vertexSizeInComponentType:t/S$W.getSizeInBytes(s),view:void 0}),r+=a.componentsPerAttribute*S$W.getSizeInBytes(s)}return i},f$G.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;i<r;++i){var n=t[i];f$G._resize(n,this._size),f$G._appendWriters(this.writers,n)}B$s(this)},f$G._resize=function(e,t){if(e.vertexSizeInBytes>0){var i=new ArrayBuffer(t*e.vertexSizeInBytes);if(e$28(e.arrayBuffer))for(var r=new Uint8Array(i),n=new Uint8Array(e.arrayBuffer),o=n.length,a=0;a<o;++a)r[a]=n[a];for(var s=e.arrayViews,l=s.length,u=0;u<l;++u){var c=s[u];c.view=S$W.createArrayBufferView(c.componentDatatype,i,c.offsetInBytes)}e.arrayBuffer=i}};var T$u=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];function U$A(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,r=e._size*t.vertexSizeInBytes,n=e$28(i);if(!n||i.sizeInBytes<r)return n&&i.destroy(),t.vertexBuffer=h$W.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function O$v(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function B$s(e){var t=e.va;if(e$28(t)){for(var i=t.length,r=0;r<i;++r)t[r].va.destroy();e.va=void 0}}f$G._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var o=i[n];e[o.index]=T$u[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},f$G.prototype.commit=function(e){var t,i,r,n=!1,o=this._allBuffers;for(i=0,r=o.length;i<r;++i)n=U$A(this,t=o[i])||n;if(n||!e$28(this.va)){B$s(this);for(var a=this.va=[],s=e$28(e)?Math.ceil(this._size/(e$27.SIXTY_FOUR_KILOBYTES-1)):1,l=0;l<s;++l){var u=[];for(i=0,r=o.length;i<r;++i){var c=l*((t=o[i]).vertexSizeInBytes*(e$27.SIXTY_FOUR_KILOBYTES-1));f$G._appendAttributes(u,t,c,this._instanced)}u=u.concat(this._precreated),a.push({va:new m$19({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(l!==s-1?e$27.SIXTY_FOUR_KILOBYTES-1:this._size%(e$27.SIXTY_FOUR_KILOBYTES-1))})}}},f$G._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},f$G.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new t$Z("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new t$Z("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)O$v(i[r],e,t)},f$G.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},f$G.prototype.isDestroyed=function(){return!1},f$G.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var r=e[t];r.vertexBuffer=r.vertexBuffer&&r.vertexBuffer.destroy()}return B$s(this),i$Z(this)};var Lt$5="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D u_atlas;\n#ifdef APPLY_SWIPE\nuniform vec4 uSwipeRegion;\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying float v_depth;\nvarying vec2 v_textureCoordinates;\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nfloat getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)\n{\nvec2 lookupVector = imageSize * (depthLookupST - adjustedST);\nlookupVector = v_rotationMatrix * lookupVector;\nvec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));\nvec2 translation = v_originTextureCoordinateAndTranslate.zw;\nif (applyTranslate)\n{\ntranslation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));\n}\nvec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));\nif (logDepthOrDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\n#ifdef SDF\nfloat getDistance(vec2 position)\n{\n#if defined(MVT) && !defined(WEBGPU)\nreturn texture2D(u_atlas, position).a;\n#else\nreturn texture2D(u_atlas, position).r;\n#endif\n}\nvec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)\n{\nfloat distance = getDistance(position);\nif (outlineWidth > 0.0)\n{\nfloat outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);\nfloat outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nvec4 sdfColor = mix(outlineColor, v_color, outlineFactor);\nfloat alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);\nreturn vec4(sdfColor.rgb, sdfColor.a * alpha);\n}\nelse\n{\nfloat alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);\nreturn vec4(v_color.rgb, v_color.a * alpha);\n}\n}\n#endif\nvoid main()\n{\n#ifdef APPLY_SWIPE\nczm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates);\n#ifdef SDF\nfloat outlineWidth = v_outlineWidth;\nvec4 outlineColor = v_outlineColor;\nfloat distance = getDistance(v_textureCoordinates);\n#if defined(GL_OES_standard_derivatives) || defined(WEBGL2) || defined(WEBGPU)\nfloat smoothing = fwidth(distance);\nvec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));\nvec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\nvec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\nvec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);\ncolor = (center + color1 + color2 + color3 + color4)/5.0;\n#else\nfloat smoothing = 1.0/32.0;\ncolor = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);\n#endif\ncolor = czm_gammaCorrect(color);\n#else\ncolor = czm_gammaCorrect(color);\ncolor *= czm_gammaCorrect(v_color);\n#endif\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef VECTOR_TILE\ncolor *= u_highlightColor;\n#endif\n#ifdef PARTICLESYSTEM\n#ifdef LOG_DEPTH\nfloat fDepth = log2(v_depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#else\nfloat fDepth = gl_FragCoord.z;\n#endif\ngl_FragColor = vec4(fDepth, fDepth * fDepth, 1.0, 1.0);\n#else\ngl_FragColor = color;\n#endif\n#ifdef LOG_DEPTH\nczm_writeLogDepth();\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat temp = v_compressed.y;\ntemp = temp * SHIFT_RIGHT1;\nfloat temp2 = (temp - floor(temp)) * SHIFT_LEFT1;\nbool enableDepthTest = temp2 != 0.0;\nbool applyTranslate = floor(temp) != 0.0;\nif (enableDepthTest) {\ntemp = v_compressed.z;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\ntemp = v_compressed.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 imageSize;\nimageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;\nimageSize.x = floor(temp);\nvec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;\nadjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);\nfloat epsilonEyeDepth = v_compressed.x + czm_epsilon1;\nfloat globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);\nif (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)\n{\nfloat globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)\n{\nfloat globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);\nif (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)\n{\ndiscard;\n}\n}\n}\n}\n#endif\n}\n",Vt$6="#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec4 compressedAttribute3;\nattribute vec2 sdf;\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\nattribute vec4 textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef VECTOR_TILE\nattribute float a_batchId;\n#endif\n#ifdef MVT\nattribute vec4 a_fade_opacity;\n#endif\nuniform float u_eyeOffsetZ;\nuniform float u_fade_change;\nvarying float v_depth;\nvarying vec2 v_textureCoordinates;\n#ifdef FRAGMENT_DEPTH_CHECK\nvarying vec4 v_textureCoordinateBounds;\nvarying vec4 v_originTextureCoordinateAndTranslate;\nvarying vec4 v_compressed;\nvarying mat2 v_rotationMatrix;\n#endif\nvarying vec4 v_pickColor;\nvarying vec4 v_color;\n#ifdef SDF\nvarying vec4 v_outlineColor;\nvarying float v_outlineWidth;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT12 = 4096.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT12 = 1.0 / 4096.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)\n{\nvec2 halfSize = imageSize * scale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nrotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\nelse\n{\nrotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n}\n#endif\nmpp = czm_metersPerPixel(positionEC);\n#ifdef FixedXYZ\nvec4 origViewPos = czm_view * vec4(0.0, 0.0, 0.0, 1.0);\nvec4 fixedAxis = positionEC - origViewPos;\nvec3 zAxis = normalize(fixedAxis.xyz);\nvec3 upViewVector = vec3(0.0, 1.0, 0.0);\nvec3 xAxis = normalize(cross(upViewVector, zAxis));\nvec3 yAxis = cross(zAxis, xAxis);\nyAxis = normalize(yAxis);\nmat3 matrix = mat3(xAxis,yAxis,zAxis);\nvec3 tmp = matrix * vec3((originTranslate + halfSize + translate + pixelOffset), 0.0);\ntmp *= czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\npositionEC.xy += tmp.xy;\n#else\npositionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);\npositionEC.xy += (translate + pixelOffset) * mpp;\n#endif\nreturn positionEC;\n}\n#ifdef VERTEX_DEPTH_CHECK\nfloat getGlobeDepth(vec4 positionEC)\n{\nvec4 posWC = czm_eyeToWindowCoordinates(positionEC);\nfloat globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\nif (globeDepth == 0.0)\n{\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\n#endif\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\n#ifdef FRAGMENT_DEPTH_CHECK\nvec2 depthOrigin = origin.xy;\n#endif\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\n#ifdef MVT\nvec2 textureCoordinates;\ntextureCoordinates.x = textureCoordinatesBottomLeft.x + direction.x * textureCoordinatesRange.x;\ntextureCoordinates.y = textureCoordinatesBottomLeft.y - direction.y * textureCoordinatesRange.y;\n#else\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#endif\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\nvec2 imageSize = vec2(floor(temp), temp2);\n#ifdef FRAGMENT_DEPTH_CHECK\nfloat labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));\nfloat applyTranslate = 0.0;\nif (labelHorizontalOrigin != 0.0)\n{\napplyTranslate = 1.0;\nlabelHorizontalOrigin -= 2.0;\ndepthOrigin.x = labelHorizontalOrigin + 1.0;\n}\ndepthOrigin = vec2(1.0) - (depthOrigin * 0.5);\n#endif\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)\ntemp = compressedAttribute3.w;\ntemp = temp * SHIFT_RIGHT12;\nvec2 dimensions;\ndimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;\ndimensions.x = floor(temp);\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\nvec4 pickColor;\nvec4 color;\ntemp = compressedAttribute2.y;\ntemp = temp * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\ntemp = compressedAttribute2.x;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\nfloat eyeDepth = positionEC.z;\n#endif\n#ifdef MVT\nvec2 fade_opacity = a_fade_opacity.xy;\nfloat placed = fade_opacity.x;\nfloat fade_change = placed > 0.5 ? u_fade_change : -u_fade_change;\nfloat interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity.y + fade_change));\ncolor.a *= interpolated_fade_opacity;\nvec3 realEyeOffset = eyeOffset.xyz;\nfloat meterPerPixel = czm_metersPerPixel(positionEC);\nrealEyeOffset.y = meterPerPixel * eyeOffset.y;\nrealEyeOffset.z = u_eyeOffsetZ;\npositionEC = czm_eyeOffset(positionEC, realEyeOffset.xyz);\nif (interpolated_fade_opacity == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#else\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\n#endif\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = compressedAttribute3.x;\nfloat farSq = compressedAttribute3.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nmat2 rotationMatrix;\nfloat mpp;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = compressedAttribute3.z;\n#endif\n#ifdef VERTEX_DEPTH_CHECK\nif (lengthSq < disableDepthTestDistance) {\nfloat depthsilon = 10.0;\nvec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;\nvec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth1 = getGlobeDepth(pEC1);\nif (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)\n{\nvec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth2 = getGlobeDepth(pEC2);\nif (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)\n{\nvec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\nfloat globeDepth3 = getGlobeDepth(pEC3);\nif (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)\n{\npositionEC.xyz = vec3(0.0);\n}\n}\n}\n}\n#endif\npositionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);\npositionEC.xyz *= show;\ngl_Position = czm_projection * positionEC;\nv_textureCoordinates = textureCoordinates;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth();\nv_depth = 1.0 - czm_currentFrustum.x + gl_Position.w;\n#endif\n#ifdef DISABLE_DEPTH_DISTANCE\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = 1.0;\n#endif\n}\n}\n#endif\n#ifdef FRAGMENT_DEPTH_CHECK\nif (sizeInMeters) {\ntranslate /= mpp;\ndimensions /= mpp;\nimageSize /= mpp;\n}\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nv_rotationMatrix = rotationMatrix;\n#else\nv_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);\n#endif\nfloat enableDepthCheck = 0.0;\nif (lengthSq < disableDepthTestDistance)\n{\nenableDepthCheck = 1.0;\n}\nfloat dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));\nfloat dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));\nfloat iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));\nfloat ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));\nv_compressed.x = eyeDepth;\nv_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;\nv_compressed.z = dw * SHIFT_LEFT12 + dh;\nv_compressed.w = iw * SHIFT_LEFT12 + ih;\nv_originTextureCoordinateAndTranslate.xy = depthOrigin;\nv_originTextureCoordinateAndTranslate.zw = translate;\nv_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;\n#endif\n#ifdef SDF\nvec4 outlineColor;\nfloat outlineWidth;\ntemp = sdf.x;\ntemp = temp * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\ntemp = sdf.y;\ntemp = temp * SHIFT_RIGHT8;\nfloat temp3 = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.a = floor(temp);\noutlineColor /= 255.0;\nv_outlineWidth = outlineWidth / 255.0;\nv_outlineColor = outlineColor;\n#endif\nv_pickColor = pickColor;\nv_color = color;\nv_color.a *= translucency;\n}\n",e$U={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},S$s=Object.freeze(e$U);function _$A(e,t,i,r,n){this.bottomLeft=u$Y(e,o$1k.ZERO),this.topRight=u$Y(t,o$1k.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=n}var q$E=new o$1k(16,16);function w$q(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.borderWidthInPixels,1),i=u$Y(e.initialSize,q$E);if(!e$28(e.context))throw new t$Z("context is required.");if(t<0)throw new t$Z("borderWidthInPixels must be greater than or equal to zero.");if(i.x<1||i.y<1)throw new t$Z("initialSize must be greater than zero.");this._context=e.context,this._pixelFormat=u$Y(e.pixelFormat,V$O.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=e$1K(),this._idHash={},this._initialSize=i,this._root=void 0}function k$B(e){if(e.validateFramebuffer){var t=e._gl,i=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i!==t.FRAMEBUFFER_COMPLETE){var r;switch(i){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:r="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:r="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:r="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:r="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new t$Z(r)}}}function D$F(e,t){if(t!==e._currentFramebuffer&&(e._currentFramebuffer=t,e$28(t))){t._bind(),k$B(e);var i=t._getActiveColorAttachments();e.drawBuffers&&e.glDrawBuffers(i)}}function j$B(e,t){var i=e._context,r=e.numberOfImages,n=e._borderWidthInPixels;if(r>0){for(var o=e._texture.width,a=e._texture.height,s=2*(o+t.width+n),l=2*(a+t.height+n),u=o/s,c=a/l,h=new _$A(new o$1k(o+n,n),new o$1k(s,a)),d=new _$A(new o$1k,new o$1k(s,a),e._root,h),f=new _$A(new o$1k(n,a+n),new o$1k(s,l)),p=new _$A(new o$1k,new o$1k(s,l),d,f),_=0;_<e._textureCoordinates.length;_++){var m=e._textureCoordinates[_];e$28(m)&&(m.x*=u,m.y*=c,m.width*=u,m.height*=c)}var $=new L$17({context:e._context,width:s,height:l,pixelFormat:e._pixelFormat}),g=new a$z({context:i,colorTextures:[e._texture],destroyAttachments:!1});D$F(i,g),$.copyFromFramebuffer(0,0,0,0,s,l),g.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=$,e._root=p}else{var v=2*(t.width+2*n),y=2*(t.height+2*n);v<e._initialSize.x&&(v=e._initialSize.x),y<e._initialSize.y&&(y=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new L$17({context:e._context,width:v,height:y,pixelFormat:e._pixelFormat}),e._root=new _$A(new o$1k(n,n),new o$1k(v,y))}}function F$J(e,t,i){if(e$28(t)){if(!e$28(t.childNode1)&&!e$28(t.childNode2)){if(e$28(t.imageIndex))return;var r=t.topRight.x-t.bottomLeft.x,n=t.topRight.y-t.bottomLeft.y,o=r-i.width,a=n-i.height;if(o<0||a<0)return;if(0===o&&0===a)return t;if(o>a){t.childNode1=new _$A(new o$1k(t.bottomLeft.x,t.bottomLeft.y),new o$1k(t.bottomLeft.x+i.width,t.topRight.y));var s=t.bottomLeft.x+i.width+e._borderWidthInPixels;s<t.topRight.x&&(t.childNode2=new _$A(new o$1k(s,t.bottomLeft.y),new o$1k(t.topRight.x,t.topRight.y)))}else{t.childNode1=new _$A(new o$1k(t.bottomLeft.x,t.bottomLeft.y),new o$1k(t.topRight.x,t.bottomLeft.y+i.height));var l=t.bottomLeft.y+i.height+e._borderWidthInPixels;l<t.topRight.y&&(t.childNode2=new _$A(new o$1k(t.bottomLeft.x,l),new o$1k(t.topRight.x,t.topRight.y)))}return F$J(e,t.childNode1,i)}return F$J(e,t.childNode1,i)||F$J(e,t.childNode2,i)}}function C$A(e,t,i){var r=F$J(e,e._root,t);if(e$28(r)){r.imageIndex=i;var n=e._texture.width,o=e._texture.height,a=r.topRight.x-r.bottomLeft.x,s=r.topRight.y-r.bottomLeft.y,l=r.bottomLeft.x/n,u=r.bottomLeft.y/o,c=a/n,h=s/o;e._textureCoordinates[i]=new f$10(l,u,c,h),e._texture.copyFrom(t,r.bottomLeft.x,r.bottomLeft.y)}else j$B(e,t),C$A(e,t,i);e._guid=e$1K()}Object.defineProperties(w$q.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return e$28(this._texture)||(this._texture=new L$17({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),w$q.prototype.addImage=function(e,t){if(!e$28(e))throw new t$Z("id is required.");if(!e$28(t))throw new t$Z("image is required.");var i=this._idHash[e];if(e$28(i))return i;if("function"==typeof t){if(!e$28(t=t(e)))throw new t$Z("image is required.")}else if("string"==typeof t||t instanceof t$S){t=t$S.createIfNeeded(t).fetchImage()}var r=this;return i=o$1q(t,(function(e){if(r.isDestroyed())return-1;var t=r.numberOfImages;return C$A(r,e,t),t})),this._idHash[e]=i,i},w$q.prototype.addSubRegion=function(e,t){if(!e$28(e))throw new t$Z("id is required.");if(!e$28(t))throw new t$Z("subRegion is required.");var i=this._idHash[e];if(!e$28(i))throw new t$U('image with id "'+e+'" not found in the atlas.');var r=this;return o$1q(i,(function(e){if(-1===e)return-1;var i=r._texture.width,n=r._texture.height,o=r.numberOfImages,a=r._textureCoordinates[e],s=a.x+t.x/i,l=a.y+t.y/n,u=t.width/i,c=t.height/n;return r._textureCoordinates.push(new f$10(s,l,u,c)),r._guid=e$1K(),o}))},w$q.prototype.addTextureCoordBounds=function(e){this._textureCoordinates.push(e)},w$q.prototype.isDestroyed=function(){return!1},w$q.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),i$Z(this)};var e$T={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},G$J=Object.freeze(e$T);function O$u(e,t,i,r,n){return new F$I(e,t,i,r,n)}function F$I(e,t,i,r,n){t=t||P$z,i=i||Q$y,n=n||Array,this.nodeSize=r||64,this.points=e,this.ids=new n(e.length),this.coords=new n(2*e.length);for(var o=0;o<e.length;o++)this.ids[o]=o,this.coords[2*o]=t(e[o]),this.coords[2*o+1]=i(e[o]);K$v(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function P$z(e){return e[0]}function Q$y(e){return e[1]}function J$D(e,t,i,r,n,o){var a=n-i,s=o-r,l={x:e-.5*a,y:t-.5*s,width:a,height:s},u={x:i,y:r,width:a,height:s},c=l.x,h=l.y,d=u.x,f=u.y;return!(c>d+u.width||c+l.width<d||h+l.height<f||h>f+u.height)}function R$v(e,t,i,r,n,o,a,s,l,u,c){for(var h,d,f=[0,e.length-1,0],p=[];f.length;){var _=f.pop(),m=f.pop(),$=f.pop(),g=void 0;if(m-$<=a)for(var v=$;v<=m;v++)h=t[2*v],d=t[2*v+1],void 0!==s&&s.length>v&&(g=l(s[e[v]])),void 0!==u?u(h,d,i,r,n,o,s[e[v]],g,c)&&p.push(e[v]):J$D(h,d,i,r,n,o)&&p.push(e[v]);else{var y=Math.floor(($+m)/2);h=t[2*y],d=t[2*y+1],void 0!==s&&s.length>y&&(g=l(s[e[y]])),void 0!==u?u(h,d,i,r,n,o,s[e[y]],g,c)&&p.push(e[y]):J$D(h,d,i,r,n,o)&&p.push(e[y]);var x=(_+1)%2;(0===_?i<=h:r<=d)&&(f.push($),f.push(y-1),f.push(x)),(0===_?n>=h:o>=d)&&(f.push(y+1),f.push(m),f.push(x))}}return p}function U$z(e,t,i,r,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var h=u.pop(),d=u.pop(),f=u.pop();if(d-f<=a)for(var p=f;p<=d;p++)s=t[2*p],l=t[2*p+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[p]);else{var _=Math.floor((f+d)/2);s=t[2*_],l=t[2*_+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[_]);var m=(h+1)%2;(0===h?i<=s:r<=l)&&(u.push(f),u.push(_-1),u.push(m)),(0===h?n>=s:o>=l)&&(u.push(_+1),u.push(d),u.push(m))}}return c}function K$v(e,t,i,r,n,o){if(!(n-r<=i)){var a=Math.floor((r+n)/2);L$E(e,t,a,r,n,o%2),K$v(e,t,i,r,a-1,o+1),K$v(e,t,i,a+1,n,o+1)}}function L$E(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var a=n-r+1,s=i-r+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1);L$E(e,t,i,Math.max(r,Math.floor(i-s*u/a+c)),Math.min(n,Math.floor(i+(a-s)*u/a+c)),o)}var h=t[2*i+o],d=r,f=n;for(B$r(e,t,r,i),t[2*n+o]>h&&B$r(e,t,r,n);d<f;){for(B$r(e,t,d,f),d++,f--;t[2*d+o]<h;)d++;for(;t[2*f+o]>h;)f--}t[2*r+o]===h?B$r(e,t,r,f):B$r(e,t,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}function B$r(e,t,i,r){C$z(e,i,r),C$z(t,2*i,2*r),C$z(t,2*i+1,2*r+1)}function C$z(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function V$s(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var d=h;d<=c;d++)N$t(t[2*d],t[2*d+1],i,r)<=l&&s.push(e[d]);else{var f=Math.floor((h+c)/2),p=t[2*f],_=t[2*f+1];N$t(p,_,i,r)<=l&&s.push(e[f]);var m=(u+1)%2;(0===u?i-n<=p:r-n<=_)&&(a.push(h),a.push(f-1),a.push(m)),(0===u?i+n>=p:r+n>=_)&&(a.push(f+1),a.push(c),a.push(m))}}return s}function N$t(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}F$I.prototype={range:function(e,t,i,r){return U$z(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return V$s(this.ids,this.coords,e,t,i,this.nodeSize)},intersect:function(e,t,i,r,n,o,a,s){return R$v(this.ids,this.coords,e,t,i,r,this.nodeSize,n,o,a,s)}};var _0x5be5dc=(_0xe9eacc=!0,function(e,t){var i=_0xe9eacc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xe9eacc=!1,i}),_0x55f147=_0x5be5dc(void 0,(function(){return _0x55f147.toString().search("(((.+)+)+)+$").toString().constructor(_0x55f147).search("(((.+)+)+)+$")})),_0xe9eacc;_0x55f147();var F$H="\nattribute vec4 aPosition;\nattribute vec4 aTexCoord0;\nattribute float aColor;\nuniform float uLineWidth;\nvarying float vColor;\n\nfloat computerOnePixelLength()\n{\n\tvec4 viewPos = czm_modelView * vec4(aPosition.xyz, 1.0);\n\tvec4 winPos = czm_projection * viewPos;\n\tfloat dwidth = czm_metersPerPixel(viewPos);\n\twinPos.x = winPos.x - 2.0 * dwidth;\n\tvec4 newViewPos = czm_inverseProjection * winPos;\n\treturn length(viewPos - newViewPos);\n}\nvoid main()\n{\n bool bUsePre = aTexCoord0.x < 0.1;\n float offset = bUsePre ? -uLineWidth : uLineWidth;\n vec4 viewPos1 = czm_modelView * vec4(aPosition.xyz, 1.0);\n\tviewPos1.x = viewPos1.x + offset * computerOnePixelLength();\n\tgl_Position = czm_projection * viewPos1;\n\tvColor = aColor;\n}";function _$z(e){this._point3Ds={},this._points=[],this._style=void 0,this._billboardCollection=void 0,this._isInitialize=!1,this._pointsChanged=!0,this._colorCommand=void 0,this._worldMatrix=y$15.clone(y$15.IDENTITY),this._boundingSphere=new i$19,this._isVisible=!1,this._frameState=void 0,this._colors=void 0,this._isUpdateColor=!1}function G$I(e,t,i){A$L(e);var r=q$D(e,i.mode);H$B(e),Y$s(e,t,r),e._isInitialize=!0}function A$L(e){e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0)}function Y$s(e,t,i){A$L(e);var r=h$W.createVertexBuffer({context:t,typedArray:i.vertices,usage:A$1c.STATIC_DRAW}),n=h$W.createVertexBuffer({context:t,typedArray:i.texcoords,usage:A$1c.STATIC_DRAW}),o=h$W.createVertexBuffer({context:t,typedArray:i.colors,usage:A$1c.STATIC_DRAW}),a=[],s={aPosition:0,aTexCoord0:1,aColor:2};a.push({index:s.aPosition,vertexBuffer:r,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),a.push({index:s.aTexCoord0,vertexBuffer:n,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1}),a.push({index:s.aColor,vertexBuffer:o,componentsPerAttribute:1,componentDatatype:S$W.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:1,normalize:!1});var l=h$W.createIndexBuffer({context:t,typedArray:i.indexPackage,usage:A$1c.STATIC_DRAW,indexDatatype:i.indexDataType});e._colorCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.S3MTiles,owner:e}),e._colorCommand.vertexArray=new m$19({context:t,attributes:a,indexBuffer:l});var u=new a$$({sources:[F$H]}),c=new a$$({sources:["uniform vec4 uFillColor;\nvarying float vColor;\nvoid main()\n{\n if(vColor < 0.1)\n {\n discard;\n return;\n }\n gl_FragColor = uFillColor;\n}\n"]});e._colorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:s}),e._colorCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),e._colorCommand.uniformMap={uLineWidth:function(){return e._style._calloutWidth},uFillColor:function(){return e._style._calloutColor}}}function q$D(e){for(var t=0,i=0,r=0,n=0,o=2*e._points.length,a=S$W.createTypedArray(S$W.FLOAT,3*o),s=S$W.createTypedArray(S$W.FLOAT,2*o),l=new Uint8Array(o),u=o/2*3,c=o>65535?ce$v.UNSIGNED_INT:ce$v.UNSIGNED_SHORT,h=S$W.createTypedArray(c,u),d=0;d<e._points.length/2;d++){var f=e._points[2*d],p=e._points[2*d+1],_=t/3;a[t++]=p.x,a[t++]=p.y,a[t++]=p.z;var m=t/3;a[t++]=p.x,a[t++]=p.y,a[t++]=p.z;var $=t/3;a[t++]=f.x,a[t++]=f.y,a[t++]=f.z;var g=t/3;a[t++]=f.x,a[t++]=f.y,a[t++]=f.z,s[i++]=0,s[i++]=0,s[i++]=1,s[i++]=0,s[i++]=1,s[i++]=1,s[i++]=0,s[i++]=1,h[r++]=_,h[r++]=m,h[r++]=$,h[r++]=_,h[r++]=$,h[r++]=g}for(d=0;d<o;d++)l[n++]=255;return e._colors=l,{vertices:a,texcoords:s,colors:l,indexPackage:h,indexDataType:c}}function H$B(e,t){for(var i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE,l=0;l<e._points.length;l++){var u=e._points[l];r=Math.max(r,u.x),i=Math.min(i,u.x),o=Math.max(o,u.y),n=Math.min(n,u.y),s=Math.max(s,u.z),a=Math.min(a,u.z)}Cesium.Math.equalsEpsilon(r,i,Cesium.Math.EPSILON6)&&(r=i+.1),Cesium.Math.equalsEpsilon(o,n,Cesium.Math.EPSILON6)&&(o=n+.1),Cesium.Math.equalsEpsilon(s,a,Cesium.Math.EPSILON6)&&(s=a+.1);var c=new t$X((r+i)/2,(o+n)/2,(s+a)/2),h=Math.max(Math.max(s-a,o-n),r-i);e._boundingSphere=new i$19(c,h/2)}function E$E(e){if(e._pointsChanged){if(e._points=[],e._frameState.mode===P$$.SCENE3D)for(var t in e._point3Ds)for(var i=e._point3Ds[t],r=0;r<i.length;r++){var n=i[r].position,o=new t$X;t$X.normalize(n,o),t$X.multiplyByScalar(o,6378137,o),i[r].dataIndex=2*e._points.length,e._points.push(n),e._points.push(o)}else for(var t in e._point3Ds)for(i=e._point3Ds[t],r=0;r<i.length;r++){o=new t$X((n=i[r].position).x,n.y,0);i[r].dataIndex=2*e._points.length,e._points.push(n),e._points.push(o)}e._pointsChanged=!1}}function Z$y(e){if(e._isUpdateColor&&e$28(e._colors)){for(var t in e._point3Ds)for(var i=e._point3Ds[t],r=0;r<i.length;r++){var n=i[r].dataIndex;e._colors[n]=i[r].show?255:0,e._colors[n+1]=e._colors[n],e._colors[n+2]=e._colors[n],e._colors[n+3]=e._colors[n]}e._colorCommand.vertexArray.getAttribute(2).vertexBuffer.copyFromArrayView(e._colors),e._isUpdateColor=!1}}Object.defineProperties(_$z.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e}},count:{get:function(){return this._points.length}},isVisible:{get:function(){return this._isVisible},set:function(e){this._isVisible=e}}}),_$z.prototype.destroy=function(){return A$L(this),i$Z(this)},_$z.prototype.addPoint=function(e,t,i){var r={id:e,position:t$X.clone(i),index:t,dataIndex:0,show:!0};e$28(this._point3Ds[e])||(this._point3Ds[e]=[]),this._point3Ds[e].push(r),this._isInitialize=!1,this._pointsChanged=!0},_$z.prototype.remove=function(e,t){var i=this.getByID(e);if(null!=i){for(var r=0;r<i.length;r++)i[r].index===t&&(delete i[r],i[r]=null);var n=[];for(r=0;r<i.length;r++)null!==i[r]&&n.push(i[r]);0===n.length?delete this._point3Ds[e]:this._point3Ds[e]=n}this._pointsChanged=!0,this._isInitialize=!0},_$z.prototype.getByID=function(e){return e$28(this._point3Ds[e])?this._point3Ds[e]:null},_$z.prototype._setVisibleByID=function(e,t,i){if(E$E(this),!e$28(this._point3Ds[e])||0===this._point3Ds[e].length)return null;for(var r=this._point3Ds[e],n=0;n<r.length;n++)r[n].index===t&&r[n].show!==i&&(r[n].show=i,this._isUpdateColor=!0)},_$z.prototype._updateIndex=function(e,t,i){var r=this._point3Ds[e];if(e$28(r))for(var n=0;n<r.length;n++)r[n].index===t&&(r[n].index=i)},_$z.prototype.update=function(e,t,i){this._frameState=t,this._pointsChanged&&E$E(this),0!==this._points.length&&this._points.length%2==0&&this._isVisible&&(this._isInitialize||G$I(this,e,t),Z$y(this),e$28(this._colorCommand)&&i.push(this._colorCommand))};var it$7=n$X.SHOW_INDEX,ae$j=n$X.POSITION_INDEX,Le$h=n$X.PIXEL_OFFSET_INDEX,Ve$g=n$X.EYE_OFFSET_INDEX,st$5=n$X.HORIZONTAL_ORIGIN_INDEX,rt$c=n$X.VERTICAL_ORIGIN_INDEX,at$b=n$X.SCALE_INDEX,ne$q=n$X.IMAGE_INDEX_INDEX,be$h=n$X.COLOR_INDEX,nt$a=n$X.ROTATION_INDEX,ht$6=n$X.ALIGNED_AXIS_INDEX,Fe$c=n$X.SCALE_BY_DISTANCE_INDEX,Me$g=n$X.TRANSLUCENCY_BY_DISTANCE_INDEX,Ue$g=n$X.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,He$d=n$X.DISTANCE_DISPLAY_CONDITION,Gt$3=n$X.DISABLE_DEPTH_DISTANCE,ot$8=n$X.TEXTURE_COORDINATE_BOUNDS,_t$7=n$X.SDF_INDEX,dt$9=n$X.OPACITY_STATE_INDEX,Ae$g=n$X.NUMBER_OF_PROPERTIES,T$t,Wt$4={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,a_fade_opacity:12},zt$3={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,a_fade_opacity:13},Yt$2={enabled:!0,equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.SOURCE_ALPHA,functionDestinationRgb:l$15.ONE,functionSourceAlpha:l$15.ONE,functionDestinationAlpha:l$15.ONE},Ge$c;function B$q(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spParticleSystem=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._rsParticleSystem=void 0,this._vaf=void 0,this._billboardsID={},this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(Ae$g),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new i$19,this._baseVolumeWC=new i$19,this._baseVolume2D=new i$19,this._boundingVolume=new i$19,this._boundingVolumeDirty=!1,this._colorCommands=[],this._depthTestEnable=u$Y(e.depthTestEnable,!0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(y$15.IDENTITY),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=u$Y(e.debugShowTextureAtlas,!1),this.blendOption=u$Y(e.blendOption,S$s.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._isParticleSystem=e.particleSystem,this._isMVT=u$Y(e.isMVT,!1),this._ignoreShow=e.ignoreShow,this._fadeChange=1,this._mode=P$$.SCENE3D,this._buffersUsage=new Array(Ae$g),this._buffersUsage[it$7]=A$1c.STATIC_DRAW,this._buffersUsage[ae$j]=A$1c.STATIC_DRAW,this._buffersUsage[Le$h]=A$1c.STATIC_DRAW,this._buffersUsage[Ve$g]=A$1c.STATIC_DRAW,this._buffersUsage[st$5]=A$1c.STATIC_DRAW,this._buffersUsage[rt$c]=A$1c.STATIC_DRAW,this._buffersUsage[at$b]=A$1c.STATIC_DRAW,this._buffersUsage[ne$q]=A$1c.STATIC_DRAW,this._buffersUsage[be$h]=A$1c.STATIC_DRAW,this._buffersUsage[nt$a]=A$1c.STATIC_DRAW,this._buffersUsage[ht$6]=A$1c.STATIC_DRAW,this._buffersUsage[Fe$c]=A$1c.STATIC_DRAW,this._buffersUsage[Me$g]=A$1c.STATIC_DRAW,this._buffersUsage[Ue$g]=A$1c.STATIC_DRAW,this._buffersUsage[He$d]=A$1c.STATIC_DRAW,this._buffersUsage[ot$8]=A$1c.STATIC_DRAW,this._buffersUsage[dt$9]=A$1c.DYNAMIC_DRAW,this._highlightColor=e$1S.clone(e$1S.WHITE);var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor},u_eyeOffsetZ:function(){if(!e$28(t._scene)||!e$28(t._scene.camera))return 0;var e=t._scene.camera;return.01*e.positionCartographic.height*Math.sin(e.pitch)},u_fade_change:function(){return t._fadeChange}};var i=this._scene;e$28(i)&&e$28(i.terrainProviderChanged)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener((function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()}),this)),this._lineCallout=new _$z,this._style3D=u$Y(e.style3D,void 0),this._lineCallout.style=this._style3D,this._visibleViewport=4095,this._swipeEnabled=u$Y(e.swipeEnabled,!1),this._swipeRegion=u$Y(e.swipeRegion,new f$10(0,0,1,1)),this._compiledSwipeEnabled=!1,this._compiledSwipeRegion=new f$10(0,0,1,1),this._billboardMode=u$Y(e.billboardMode,$r$4.None)}function ft$7(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function Xe$8(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;n<r;++n){var a=i[n];if(a){var s=a._index;a._index=o++,t.push(a),e._lineCallout._updateIndex(a.id,s,a._index)}}e._billboards=t}}function kt$4(e){var t=e.cache.billboardCollection_indexBufferBatched;if(e$28(t))return t;for(var i=new Uint16Array(98298),r=0,n=0;r<98298;r+=6,n+=4)i[r]=n,i[r+1]=n+1,i[r+2]=n+2,i[r+3]=n+0,i[r+4]=n+2,i[r+5]=n+3;return(t=h$W.createIndexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function Kt$3(e){var t=e.cache.billboardCollection_indexBufferInstanced;return e$28(t)||((t=h$W.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Qt$1(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return e$28(t)||((t=h$W.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:A$1c.STATIC_DRAW})).vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}function qt$3(e,t,i,r,n,o,a){var s=[{index:T$t.positionHighAndScale,name:"positionHighAndScale",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[ae$j]},{index:T$t.positionLowAndRotation,name:"positionLowAndRotation",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[ae$j]},{index:T$t.compressedAttribute0,name:"compressedAttribute0",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Le$h]},{index:T$t.compressedAttribute1,name:"compressedAttribute1",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Me$g]},{index:T$t.compressedAttribute2,name:"compressedAttribute2",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[be$h]},{index:T$t.eyeOffset,name:"eyeOffset",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Ve$g]},{index:T$t.scaleByDistance,name:"scaleByDistance",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Fe$c]},{index:T$t.pixelOffsetScaleByDistance,name:"pixelOffsetScaleByDistance",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Ue$g]},{index:T$t.compressedAttribute3,name:"compressedAttribute3",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[He$d]},{index:T$t.textureCoordinateBoundsOrLabelTranslate,name:"textureCoordinateBoundsOrLabelTranslate",componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[ot$8]}];return r&&s.push({index:T$t.direction,name:"direction",componentsPerAttribute:2,componentDatatype:S$W.FLOAT,vertexBuffer:Qt$1(e)}),e$28(n)&&s.push({index:T$t.a_batchId,name:"a_batchId",componentsPerAttribute:1,componentDatatyps:S$W.FLOAT,bufferUsage:A$1c.STATIC_DRAW}),o&&s.push({index:T$t.sdf,name:"sdf",componentsPerAttribute:2,componentDatatype:S$W.FLOAT,usage:i[_t$7]}),a&&s.push({index:T$t.a_fade_opacity,name:"a_fade_opacity",componentsPerAttribute:2,componentDatatype:S$W.FLOAT,usage:A$1c.STATIC_DRAW}),new f$G(e,s,r?t:4*t,r)}Object.defineProperties(B$q.prototype,{length:{get:function(){return Xe$8(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},style3D:{get:function(){return this._style3D},set:function(e){this._style3D=e,this.setBillboardImage(this._style3D),this._lineCallout.style=e}},showCallout:{get:function(){return this._lineCallout.isVisible},set:function(e){this._lineCallout.isVisible=e}},swipeRegion:{get:function(){return this._swipeRegion},set:function(e){if(!(e$28(e)&&e instanceof f$10))throw new t$Z("Expected BillboardCollection.swipeRegion to be type of BoundingRectangle.");f$10.equals(e,this._swipeRegion)||f$10.clone(e,this._swipeRegion)}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){o$1u.typeOf.bool("BillboardCollection.swipeEnabled",e),e!==this._swipeEnabled&&(this._swipeEnabled=e)}},fadeChage:{get:function(){return this._fadeChange},set:function(e){e!==this._fadeChange&&(this._fadeChange=e)}}}),B$q.prototype.add=function(e){var t=new n$X(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,e$28(t.id)&&(this._billboardsID[t.id]=t),e$28(e)&&e$28(e.position)&&this._lineCallout.addPoint(t.id,t._index,e.position),t},B$q.prototype.remove=function(e){return!!this.contains(e)&&(e$28(e.id)&&delete this._billboardsID[e.id],this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,this._lineCallout.remove(e.id,e._index),e._destroy(),!0)},B$q.prototype.removeAll=function(){ft$7(this._billboards),this._billboards=[],this._billboardsID={},this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},B$q.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},B$q.prototype.contains=function(e){return e$28(e)&&e._billboardCollection===this},B$q.prototype.containsByID=function(e){return this._billboardsID.hasOwnProperty(e)},B$q.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return Xe$8(this),this._billboards[e]},B$q.prototype.getById=function(e){if(!e$28(e))throw new t$Z("id is required.");return e$28(this._billboardsID[e])?this._billboardsID[e]:null},B$q.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<Ae$g;++r){var n=0===i[r]?A$1c.STATIC_DRAW:A$1c.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var We$d=new i$Q;function ut$7(e,t,i,r,n){var o,a=r[T$t.positionHighAndScale],s=r[T$t.positionLowAndRotation],l=n._getActualPosition();e._mode===P$$.SCENE3D&&(i$19.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),i$Q.fromCartesian(l,We$d);var u=n.scale,c=n.rotation;0!==c&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);var h=We$d.high,d=We$d.low;e._instanced?(a(o=n._index,h.x,h.y,h.z,u),s(o,d.x,d.y,d.z,c)):(a((o=4*n._index)+0,h.x,h.y,h.z,u),a(o+1,h.x,h.y,h.z,u),a(o+2,h.x,h.y,h.z,u),a(o+3,h.x,h.y,h.z,u),s(o+0,d.x,d.y,d.z,c),s(o+1,d.x,d.y,d.z,c),s(o+2,d.x,d.y,d.z,c),s(o+3,d.x,d.y,d.z,c))}var b$L=new o$1k,F$G=32768,Q$x=65536,ze$a=4096,M$C=256,Zt$3=128,Jt$3=32,$t$3=8,pt$7=4,jt$1=1/256,ct$7=0,lt$7=2,mt$4=3,Tt$5=1;function vt$7(e,t,i,r,n){var o,a=r[T$t.compressedAttribute0],s=n.pixelOffset,l=s.x,u=s.y,c=n._translate,h=c.x,d=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(l+h),Math.abs(-u+d));var f=n.horizontalOrigin,p=n._verticalOrigin,_=n.show&&n.clusterShow;0===n.color.alpha&&(_=!1),p===S$L.BASELINE&&(p=S$L.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&f===j$13.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===S$L.CENTER;var m=0,$=0,g=0,v=0,y=n._imageIndex;if(-1!==y){var x=i[y];if(!e$28(x))throw new t$Z("Invalid billboard image index: "+y);m=x.x,$=x.y,g=x.width,v=x.height}var b=m+g,w=$+v,C=Math.floor(e$27.clamp(l,-F$G,F$G)+F$G)*Zt$3;C+=(f+1)*Jt$3,C+=(p+1)*$t$3,C+=(_?1:0)*pt$7;var T=Math.floor(e$27.clamp(u,-F$G,F$G)+F$G)*M$C,S=Math.floor(e$27.clamp(h,-F$G,F$G)+F$G)*M$C,E=(e$27.clamp(d,-F$G,F$G)+F$G)*jt$1,A=Math.floor(E);if(T+=A,S+=Math.floor((E-A)*M$C),e._isMVT){var P=w;w=$,$=P}b$L.x=m,b$L.y=$;var I=t$N.compressTextureCoordinates(b$L);b$L.x=b;var M=t$N.compressTextureCoordinates(b$L);b$L.y=w;var O=t$N.compressTextureCoordinates(b$L);b$L.x=m;var D=t$N.compressTextureCoordinates(b$L);e._instanced?a(o=n._index,C,T,S,I):(a((o=4*n._index)+0,C+ct$7,T,S,I),a(o+1,C+lt$7,T,S,M),a(o+2,C+mt$4,T,S,O),a(o+3,C+Tt$5,T,S,D))}function xt$4(e,t,i,r,n){var o,a=r[T$t.compressedAttribute1],s=n.alignedAxis;t$X.equals(s,t$X.ZERO)||(e._shaderAlignedAxis=!0);var l=0,u=1,c=1,h=1,d=n.translucencyByDistance;e$28(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,(1!==u||1!==h)&&(e._shaderTranslucencyByDistance=!0));var f=0,p=n._imageIndex;if(-1!==p){var _=i[p];if(!e$28(_))throw new t$Z("Invalid billboard image index: "+p);f=_.width}var m=e._textureAtlas.texture.width,$=Math.round(u$Y(n.width,m*f));e._maxSize=Math.max(e._maxSize,$);var g=e$27.clamp($,0,Q$x),v=0;Math.abs(t$X.magnitudeSquared(s)-1)<e$27.EPSILON6&&(v=t$N.octEncodeFloat(s)),u=e$27.clamp(u,0,1),g=g*M$C+(u=1===u?255:255*u|0),h=e$27.clamp(h,0,1),v=v*M$C+(h=1===h?255:255*h|0),e._instanced?a(o=n._index,g,v,l,c):(a((o=4*n._index)+0,g,v,l,c),a(o+1,g,v,l,c),a(o+2,g,v,l,c),a(o+3,g,v,l,c))}function Ye$a(e,t,i,r,n){var o,a=r[T$t.compressedAttribute2],s=n.color,l=e$28(e._batchTable)?e$1S.WHITE:n.getPickId(t).color,u=n.sizeInMeters?1:0,c=Math.abs(t$X.magnitudeSquared(n.alignedAxis)-1)<e$27.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===u;var h=0,d=n._imageIndex;if(-1!==d){var f=i[d];if(!e$28(f))throw new t$Z("Invalid billboard image index: "+d);h=f.height}var p=e._textureAtlas.texture.dimensions,_=Math.round(u$Y(n.height,p.y*h));e._maxSize=Math.max(e._maxSize,_);var m=u$Y(n._labelHorizontalOrigin,-2),$=_*pt$7+(m+=2),g=e$1S.floatToByte(s.red),v=e$1S.floatToByte(s.green),y=e$1S.floatToByte(s.blue),x=g*Q$x+v*M$C+y;g=e$1S.floatToByte(l.red),v=e$1S.floatToByte(l.green),y=e$1S.floatToByte(l.blue);var b=g*Q$x+v*M$C+y,w=e$1S.floatToByte(s.alpha)*Q$x+e$1S.floatToByte(l.alpha)*M$C;w+=2*u+c,e._instanced?a(o=n._index,x,b,w,$):(a((o=4*n._index)+0,x,b,w,$),a(o+1,x,b,w,$),a(o+2,x,b,w,$),a(o+3,x,b,w,$))}function ke$b(e,t,i,r,n){var o,a=r[T$t.eyeOffset],s=n.eyeOffset,l=s.z;if(n._heightReference!==k$_.NONE&&(l*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(l)),e._instanced){var u=0,c=0,h=n._imageIndex;if(-1!==h){var d=i[h];if(!e$28(d))throw new t$Z("Invalid billboard image index: "+h);u=d.width,c=d.height}b$L.x=u,b$L.y=c;var f=t$N.compressTextureCoordinates(b$L);a(o=n._index,s.x,s.y,l,f)}else a((o=4*n._index)+0,s.x,s.y,l,0),a(o+1,s.x,s.y,l,0),a(o+2,s.x,s.y,l,0),a(o+3,s.x,s.y,l,0)}function Dt$7(e,t,i,r,n){var o,a=r[T$t.scaleByDistance],s=0,l=1,u=1,c=1,h=n.scaleByDistance;e$28(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue,(1!==l||1!==c)&&(e._shaderScaleByDistance=!0)),e._instanced?a(o=n._index,s,l,u,c):(a((o=4*n._index)+0,s,l,u,c),a(o+1,s,l,u,c),a(o+2,s,l,u,c),a(o+3,s,l,u,c))}function At$4(e,t,i,r,n){var o,a=r[T$t.pixelOffsetScaleByDistance],s=0,l=1,u=1,c=1,h=n.pixelOffsetScaleByDistance;e$28(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue,(1!==l||1!==c)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?a(o=n._index,s,l,u,c):(a((o=4*n._index)+0,s,l,u,c),a(o+1,s,l,u,c),a(o+2,s,l,u,c),a(o+3,s,l,u,c))}function Et$5(e,t,i,r,n){var o,a=r[T$t.compressedAttribute3],s=0,l=Number.MAX_VALUE,u=n.distanceDisplayCondition;e$28(u)&&(s=u.near,l=u.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var c,h,d=n.disableDepthTestDistance,f=n.heightReference===k$_.CLAMP_TO_GROUND&&e._scene.context.depthTexture;if(e$28(d)||(d=f?5e3:0),d*=d,(f||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),e$28(n._labelDimensions))h=n._labelDimensions.x,c=n._labelDimensions.y;else{var p=0,_=0,m=n._imageIndex;if(-1!==m){var $=i[m];if(!e$28($))throw new t$Z("Invalid billboard image index: "+m);p=$.height,_=$.width}c=Math.round(u$Y(n.height,e._textureAtlas.texture.dimensions.y*p));var g=e._textureAtlas.texture.width;h=Math.round(u$Y(n.width,g*_))}var v=Math.floor(e$27.clamp(h,0,ze$a)),y=Math.floor(e$27.clamp(c,0,ze$a)),x=v*ze$a+y;e._instanced?a(o=n._index,s,l,d,x):(a((o=4*n._index)+0,s,l,d,x),a(o+1,s,l,d,x),a(o+2,s,l,d,x),a(o+3,s,l,d,x))}function St$4(e,t,i,r,n){n.heightReference===k$_.CLAMP_TO_GROUND&&(e._shaderClampToGround=e._scene.context.depthTexture);var o,a=r[T$t.textureCoordinateBoundsOrLabelTranslate];if(e$1U.maximumVertexTextureImageUnits>0){var s=0,l=0;return e$28(n._labelTranslate)&&(s=n._labelTranslate.x,l=n._labelTranslate.y),void(e._instanced?(o=n._index,a(o,s,l,0,0)):(o=4*n._index,a(o+0,s,l,0,0),a(o+1,s,l,0,0),a(o+2,s,l,0,0),a(o+3,s,l,0,0)))}var u=0,c=0,h=0,d=0,f=n._imageIndex;if(-1!==f){var p=i[f];if(!e$28(p))throw new t$Z("Invalid billboard image index: "+f);u=p.x,c=p.y,h=p.width,d=p.height}var _=u+h,m=c+d;e._instanced?a(o=n._index,u,c,_,m):(a((o=4*n._index)+0,u,c,_,m),a(o+1,u,c,_,m),a(o+2,u,c,_,m),a(o+3,u,c,_,m))}function ei$2(e,t,i,r,n){if(e$28(e._batchTable)){var o,a=r[T$t.a_batchId],s=n._batchIndex;e._instanced?a(o=n._index,s):(a((o=4*n._index)+0,s),a(o+1,s),a(o+2,s),a(o+3,s))}}function yt$4(e,t,i,r,n){if(e._sdf){var o,a,s=r[T$t.sdf],l=n.outlineColor,u=n.outlineWidth,c=e$1S.floatToByte(l.red),h=e$1S.floatToByte(l.green),d=e$1S.floatToByte(l.blue);a=t.webgpu?c+h*M$C+d*Q$x:c*Q$x+h*M$C+d;var f,p=u/G$J.RADIUS;f=t.webgpu?e$1S.floatToByte(l.alpha)*M$C+e$1S.floatToByte(p)*Q$x:e$1S.floatToByte(l.alpha)*Q$x+e$1S.floatToByte(p)*M$C,e._instanced?s(o=n._index,a,f):(o=4*n._index,t.webgpu?(s(o+0,a,f),s(o+1,a,f),s(o+2,a,f),s(o+3,a,f)):(s(o+0,a+ct$7,f),s(o+1,a+lt$7,f),s(o+2,a+mt$4,f),s(o+3,a+Tt$5,f)))}}function It$7(e,t,i,r,n){if(e._isMVT){var o,a=r[T$t.a_fade_opacity],s=n.opacityState,l=s.placed?1:0,u=s.opacity;e._instanced?a(o=n._index,l,u):(a((o=4*n._index)+0,l,u),a(o+1,l,u),a(o+2,l,u),a(o+3,l,u))}}function ti$3(e,t,i,r,n){ut$7(e,t,i,r,n),vt$7(e,t,i,r,n),xt$4(e,t,i,r,n),Ye$a(e,t,i,r,n),ke$b(e,t,i,r,n),Dt$7(e,t,i,r,n),At$4(e,t,i,r,n),Et$5(e,t,i,r,n),St$4(e,t,i,r,n),ei$2(e,t,i,r,n),yt$4(e,t,i,r,n),It$7(e,t,i,r,n)}function Ke$9(e,t,i,r,n,o){var a;r.mode===P$$.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;for(var s=[],l=0;l<i;++l){var u=t[l],c=u.position,h=n$X._computeActualPosition(u,c,r,n);e$28(h)&&(u._setActualPosition(h),o?s.push(h):i$19.expand(a,h,a))}o&&i$19.fromPoints(s,a)}function ii$3(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P$$.SCENE3D&&!y$15.equals(o,e.modelMatrix)?(e._mode=i,y$15.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P$$.SCENE3D||i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&Ke$9(e,r,r.length,t,o,!0)):i===P$$.MORPHING?Ke$9(e,r,r.length,t,o,!0):(i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&Ke$9(e,n,e._billboardsToUpdateIndex,t,o,!1)}function si$2(e,t,i){var r=1;(!e._allSizedInMeters||0!==e._maxPixelOffset)&&(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}function ri$2(e,t){var i=t.createViewportQuadCommand("uniform sampler2D billboard_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \n} \n",{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Le$p.OVERLAY,i}B$q.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},B$q.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport};var ai$3=[],Y$r=new e$25;function i$z(e,t,i,r,n){return function(){var o=document.createElement("canvas"),a=n+2*r;o.height=o.width=a;var s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==r&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=i,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}}function i$y(e,t,i,r,n){this._content=e,this._billboard=i,this._label=r,this._polyline=n,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),s$t(this)}B$q.prototype.update=function(e,t,i){if(!e.passes.offscreen&&!e.camera.bReflect){if(this._lineCallout.update(t,e,i),e.multiViewportIndex>-1&&this._billboards.length>0){if(e$28(this._billboards[0])&&e$28(this._billboards[0]._id)&&e$28(this._billboards[0]._id.entityCollection)){var r=this._billboards[0]._id.entityCollection.owner;if(typeof r.getVisibleInViewport<"u")if(!r.getVisibleInViewport(e.multiViewportIndex))return}if(!this.getVisibleInViewport(e.multiViewportIndex))return}Xe$8(this);var n=this._billboards,o=n.length;t=e.context;this._instanced=t.instancedArrays,T$t=this._instanced?zt$3:Wt$4,Ge$c=this._instanced?Kt$3:kt$4;var a=this._textureAtlas;if(!e$28(a)){a=this._textureAtlas=new w$q({context:t});for(var s=0;s<o;++s)n[s]._loadImage()}var l=a.textureCoordinates;if(0!==l.length){ii$3(this,e),o=(n=this._billboards).length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,d=a.guid,f=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;var p,_=e.passes,m=_.pick;if(f||!m&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var $=0;$<Ae$g;++$)h[$]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=qt$3(t,o,this._buffersUsage,this._instanced,this._batchTable,this._sdf,this._isMVT),p=this._vaf.writers;for(var g=0;g<o;++g){var v=this._billboards[g];v._dirty=!1,ti$3(this,t,l,p,v)}this._vaf.commit(Ge$c(t))}this._billboardsToUpdateIndex=0}else if(c>0){var y=ai$3;y.length=0,(h[ae$j]||h[nt$a]||h[at$b])&&y.push(ut$7),(h[ne$q]||h[Le$h]||h[st$5]||h[rt$c]||h[it$7])&&(y.push(vt$7),this._instanced&&y.push(ke$b)),(h[ne$q]||h[ht$6]||h[Me$g])&&(y.push(xt$4),y.push(Ye$a)),(h[ne$q]||h[be$h])&&y.push(Ye$a),h[Ve$g]&&y.push(ke$b),h[Fe$c]&&y.push(Dt$7),h[Ue$g]&&y.push(At$4),(h[He$d]||h[Gt$3]||h[ne$q]||h[ae$j])&&y.push(Et$5),(h[ne$q]||h[ae$j])&&y.push(St$4),h[_t$7]&&y.push(yt$4),h[dt$9]&&y.push(It$7);var x=y.length;if(p=this._vaf.writers,c/o>.1){for(var b=0;b<c;++b){var w=u[b];w._dirty=!1;for(var C=0;C<x;++C)y[C](this,t,l,p,w)}this._vaf.commit(Ge$c(t))}else{for(var T=0;T<c;++T){var S=u[T];S._dirty=!1;for(var E=0;E<x;++E)y[E](this,t,l,p,S);this._instanced?this._vaf.subCommit(S._index,1):this._vaf.subCommit(4*S._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*o&&(u.length=o),e$28(this._vaf)&&e$28(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,i$19.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var A,P=y$15.IDENTITY;e.mode===P$$.SCENE3D?(P=this.modelMatrix,A=i$19.clone(this._baseVolumeWC,this._boundingVolume)):A=i$19.clone(this._baseVolume2D,this._boundingVolume),si$2(this,e,A);var I=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,I){this._blendOption===S$s.OPAQUE||this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=u$R.fromCache({depthTest:{enabled:this._depthTestEnable,func:de$y.LESS},depthMask:!0}):this._rsOpaque=void 0;var M=this._blendOption===S$s.TRANSLUCENT;this._blendOption===S$s.TRANSLUCENT||this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=u$R.fromCache({depthTest:{enabled:this._depthTestEnable,func:M?de$y.LEQUAL:de$y.LESS},depthMask:M,blending:Ee$n.ALPHA_BLEND}):this._rsTranslucent=void 0}this._isParticleSystem&&(this._rsParticleSystem=u$R.fromCache({depthTest:{enabled:!1,func:de$y.LESS},depthMask:!1,blending:Yt$2})),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;var O,D,R,L,B,N=e$1U.maximumVertexTextureImageUnits>0;if(I||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF||this._swipeEnabled!==this._compiledSwipeEnabled||!e$25.equals(this._swipeRegion,this._compiledSwipeRegion)){O=Vt$6,D=Lt$5,B=[],e$28(this._batchTable)&&(B.push("VECTOR_TILE"),O=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(O),D=this._batchTable.getFragmentShaderCallback(!1,void 0)(D)),R=new a$$({defines:B,sources:[O],name:"BillboardCollectionVS"}),this._instanced&&R.defines.push("INSTANCED"),this._shaderRotation&&R.defines.push("ROTATION"),this._shaderAlignedAxis&&R.defines.push("ALIGNED_AXIS"),this._billboardMode===$r$4.FixedXYZ&&R.defines.push("FixedXYZ"),this._shaderScaleByDistance&&R.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&R.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&R.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&R.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&R.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(N?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._ignoreShow&&R.defines.push("IGNORE_SHOW"),this._isMVT&&R.defines.push("MVT");var F=1-G$J.CUTOFF;this._sdf&&R.defines.push("SDF");var z=e$28(this._batchTable)?"VECTOR_TILE":"";if(this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT&&(L=new a$$({defines:["OPAQUE",z],sources:[D],name:"BillboardCollectionFS"}),this._shaderClampToGround&&(N?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push("SDF_EDGE "+F)),this._isMVT&&L.defines.push("MVT"),this._swipeEnabled&&L.defines.push("APPLY_SWIPE"),this._sp=S$T.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:L,attributeLocations:T$t}),L=new a$$({defines:["TRANSLUCENT",z],sources:[D],name:"BillboardCollectionFS"}),this._shaderClampToGround&&(N?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push("SDF_EDGE "+F)),this._isMVT&&L.defines.push("MVT"),this._swipeEnabled&&L.defines.push("APPLY_SWIPE"),this._spTranslucent=S$T.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:L,attributeLocations:T$t})),this._blendOption===S$s.OPAQUE&&(L=new a$$({defines:[z],sources:[D],name:"BillboardCollectionFS"}),this._shaderClampToGround&&(N?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push("SDF_EDGE "+F)),this._isMVT&&L.defines.push("MVT"),this._swipeEnabled&&L.defines.push("APPLY_SWIPE"),this._sp=S$T.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:L,attributeLocations:T$t})),this._blendOption===S$s.TRANSLUCENT&&(L=new a$$({defines:[z],sources:[D],name:"BillboardCollectionFS"}),this._shaderClampToGround&&(N?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(L.defines.push("SDF"),L.defines.push("SDF_EDGE "+F)),this._isMVT&&L.defines.push("MVT"),this._swipeEnabled&&L.defines.push("APPLY_SWIPE"),this._spTranslucent=S$T.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:L,attributeLocations:T$t})),this._swipeEnabled&&!e$28(this._uniforms.uSwipeRegion)){var k=this;this._uniforms.uSwipeRegion=function(){var t=k._swipeRegion;return e$25.fromElements(t.x,t.y,t.x+t.width,t.y+t.height,Y$r),Y$r.x=Y$r.x*e.context.drawingBufferWidth,Y$r.y=(1-Y$r.y)*e.context.drawingBufferHeight,Y$r.z=Y$r.z*e.context.drawingBufferWidth,Y$r.w=(1-Y$r.w)*e.context.drawingBufferHeight,Y$r}}this._isParticleSystem&&(L=new a$$({defines:[z],sources:[D],name:"BillboardCollectionFS"}),this._spParticleSystem=S$T.replaceCache({context:t,shaderProgram:this._spParticleSystem,vertexShaderSource:R,fragmentShaderSource:L,attributeLocations:T$t})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf,this._compiledSwipeEnabled=this._swipeEnabled,f$10.clone(this._swipeRegion,this._compiledSwipeRegion)}i=e.commandList;var V=!0;if(e._fboState.frameBufferType===L$T.NORMAL_AND_DEPTH&&(V=!1),V&&(_.render||_.pick)){var U,X=this._colorCommands,H=this._blendOption===S$s.OPAQUE,G=this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT,W=this._vaf.va,Y=W.length,q=this._uniforms;e$28(this._batchTable)?(q=this._batchTable.getUniformMapCallback()(q),U=this._batchTable.getPickId()):U="v_pickColor",X.length=Y;for(var j=G?2*Y:Y,Z=0;Z<j;++Z){var K=X[Z];e$28(K)||(K=X[Z]=new r$15);var Q=H||G&&Z%2==0;K.owner=this;var J=G?Math.floor(Z/2):Z;K.boundingVolume=A,K.modelMatrix=P,K.count=W[J].indicesCount,K.uniformMap=q,K.vertexArray=W[J].va,this._isParticleSystem?(K.pass=Le$p.Particle,K.renderState=this._rsParticleSystem,K.shaderProgram=this._spParticleSystem,K.pickId=void 0):(K.pass=Q||!G?Le$p.Label_Billboard:Le$p.TRANSLUCENT,K.renderState=Q?this._rsOpaque:this._rsTranslucent,K.shaderProgram=Q?this._sp:this._spTranslucent,K.pickId=U),K.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(K.count=6,K.instanceCount=o),i.push(K)}this.debugShowTextureAtlas&&(e$28(this.debugCommand)||(this.debugCommand=ri$2(this,e.context)),i.push(this.debugCommand))}}}}},B$q.prototype.isDestroyed=function(){return!1},B$q.prototype.destroy=function(){return e$28(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),ft$7(this._billboards),i$Z(this)},B$q.prototype.setBillboardImage=function(e){for(var t=this._billboards.length,i=0;i<t;++i){var r=this._billboards[i];r.isDestroyed()||r.setBillboardStyle(e)}};var m$B=new t$W;function s$t(e){var t=e._billboard;if(e$28(e._billboardImage)&&e._billboardImage!==t.image)t.image=e._billboardImage;else if(!e$28(e._billboardImage)){var i=u$Y(e._color,i$y.defaultColor),r=u$Y(e._pointOutlineColor,i$y.defaultPointOutlineColor),n=u$Y(e._pointOutlineWidth,i$y.defaultPointOutlineWidth),o=u$Y(e._pointSize,i$y.defaultPointSize),a=e._billboardColor,s=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(!e$1S.equals(i,a)||!e$1S.equals(r,s)||n!==l||o!==u){e._billboardColor=e$1S.clone(i,e._billboardColor),e._billboardOutlineColor=e$1S.clone(r,e._billboardOutlineColor),e._billboardOutlineWidth=n,e._billboardSize=o;var c=i.alpha,h=i.toCssColorString(),d=r.toCssColorString(),f=JSON.stringify([h,o,d,n]);t.setImage(f,i$z(c,h,d,n,o))}}}Object.defineProperties(i$y.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=e$1S.clone(e,this._color),s$t(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,s$t(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=e$1S.clone(e,this._pointOutlineColor),s$t(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,s$t(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){e$28(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){var t=u$Y(this._heightOffset,0),i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,m$B);r.height=r.height-t+e;var n=i.cartographicToCartesian(r);this._billboard.position=n,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],n],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=e$1S.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){var t=this._billboardImage!==e;this._billboardImage=e,t&&s$t(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){var e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),i$y.defaultColor=e$1S.WHITE,i$y.defaultPointOutlineColor=e$1S.BLACK,i$y.defaultPointOutlineWidth=0,i$y.defaultPointSize=8,i$y.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},i$y.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},i$y.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},i$y.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},i$y.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},i$y.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},i$y.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var c$A=1e20;function R$u(e,t,i){return t<i?e<t?t:e>i?i:e:e<i?i:e>t?t:e}function b$K(e,t){t||(t={});var i,r,n,o,a,s,l,u,c,h,d,f=null==t.cutoff?.25:t.cutoff,p=null==t.radius?8:t.radius,_=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");i=t.width,r=t.height,o=e,s=t.stride?t.stride:Math.floor(e.length/i/r)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(l=(u=e).getContext("2d"),i=u.width,r=u.height,o=(c=l.getImageData(0,0,i,r)).data,s=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(l=e,i=(u=e.canvas).width,r=u.height,o=(c=l.getImageData(0,0,i,r)).data,s=4):window.ImageData&&e instanceof window.ImageData&&(c=e,i=e.width,r=e.height,o=c.data,s=4);if(n=Math.max(i,r),window.Uint8ClampedArray&&o instanceof window.Uint8ClampedArray||window.Uint8Array&&o instanceof window.Uint8Array)for(a=o,o=Array(i*r),h=0,d=a.length;h<d;h++)o[h]=a[h*s+_]/255;else if(1!==s)throw Error("Raw data can have only 1 value per pixel");var m=Array(i*r),$=Array(i*r),g=Array(n),v=Array(n),y=Array(n+1),x=Array(n);for(h=0,d=i*r;h<d;h++){var b=o[h];m[h]=1===b?0:0===b?c$A:Math.pow(Math.max(0,.5-b),2),$[h]=1===b?c$A:0===b?0:Math.pow(Math.max(0,b-.5),2)}U$y(m,i,r,g,v,x,y),U$y($,i,r,g,v,x,y);var w=window.Float32Array?new Float32Array(i*r):new Array(i*r);for(h=0,d=i*r;h<d;h++)w[h]=R$u(1-((m[h]-$[h])/p+f),0,1);return w}function U$y(e,t,i,r,n,o,a){for(var s=0;s<t;s++){for(var l=0;l<i;l++)r[l]=e[l*t+s];for(s$s(r,n,o,a,i),l=0;l<i;l++)e[l*t+s]=n[l]}for(l=0;l<i;l++){for(s=0;s<t;s++)r[s]=e[l*t+s];for(s$s(r,n,o,a,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(n[s])}}function s$s(e,t,i,r,n){i[0]=0,r[0]=-c$A,r[1]=+c$A;for(var o=1,a=0;o<n;o++){for(var s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);s<=r[a];)a--,s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);i[++a]=o,r[a]=s,r[a+1]=+c$A}for(o=0,a=0;o<n;o++){for(;r[a+1]<o;)a++;t[o]=(o-i[a])*(o-i[a])+e[i[a]]}}var e$S={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},R$t=Object.freeze(e$S),g$y=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function m$A(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function q$C(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function x$H(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function I$T(e){var t=document.createElement("div");t.style.position="absolute",t.style.opacity=0,/bold/i.test(e._font)?(e._font=e._font.replace(/\sbold/i,""),t.style.font=e._font,t.style.fontWeight="bold"):t.style.font=e._font,document.body.appendChild(t),e._fontFamily=x$H(t,"font-family"),e._fontSize=(e$28(t.style.fontSize)&&""!==t.style.fontSize&&/\d+px/.test(t.style.fontSize)?t.style.fontSize:x$H(t,"font-size")).replace("px",""),e._fontStyle=x$H(t,"font-style"),e._fontWeight=x$H(t,"font-weight"),document.body.removeChild(t)}function O$t(e,t){if(e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).s3MTilesLabelStyle)){var i=e.s3MTilesLabelStyle;e.font=i.font,e.fillColor=i.fillColor,e.outlineColor=i.outlineColor,e.outlineWidth=i.outlineWidth,e.showBackground=i.showBackground,e.backgroundColor=i.backgroundColor,e.backgroundPadding=i.backgroundPadding,e.style=i.fillStyle,e.verticalOrigin=i.verticalOrigin,e.horizontalOrigin=i.horizontalOrigin,e.pixelOffset=i.pixelOffset,e.eyeOffset=i.eyeOffset,e.scale=i.scale,e.translucencyByDistance=i.translucencyByDistance,e.pixelOffsetScaleByDistance=i.pixelOffsetScaleByDistance,e.scaleByDistance=i.scaleByDistance,e.heightReference=i.heightReference,e.distanceDisplayCondition=i.distanceDisplayCondition,e.disableDepthTestDistance=i.disableDepthTestDistance}if(e$28(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new t$Z("disableDepthTestDistance must be greater than 0.0.");var r=e.translucencyByDistance,n=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,a=e.distanceDisplayCondition;if(e$28(r)){if(r.far<=r.near)throw new t$Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");r=o$1b.clone(r)}if(e$28(n)){if(n.far<=n.near)throw new t$Z("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");n=o$1b.clone(n)}if(e$28(o)){if(o.far<=o.near)throw new t$Z("scaleByDistance.far must be greater than scaleByDistance.near.");o=o$1b.clone(o)}if(e$28(a)){if(a.far<=a.near)throw new t$Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");a=r$10.clone(a)}this._renderedText=void 0,this._text=void 0,this._show=u$Y(e.show,!0),this._font=u$Y(e.font,"30px sans-serif"),this._fillColor=e$1S.clone(u$Y(e.fillColor,e$1S.WHITE)),this._oriFillColor=e$1S.clone(this._fillColor),this._outlineColor=e$1S.clone(u$Y(e.outlineColor,e$1S.BLACK)),this._outlineWidth=u$Y(e.outlineWidth,1),this._showBackground=u$Y(e.showBackground,!1),this._backgroundColor=u$Y(e.backgroundColor,new e$1S(.165,.165,.165,.8)),this._backgroundPadding=u$Y(e.backgroundPadding,new o$1k(7,5)),this._backgroundImage=u$Y(e.backgroundImage,null),this._style=u$Y(e.style,R$t.FILL),this._verticalOrigin=u$Y(e.verticalOrigin,S$L.BASELINE),this._horizontalOrigin=u$Y(e.horizontalOrigin,j$13.CENTER),this._pixelOffset=o$1k.clone(u$Y(e.pixelOffset,o$1k.ZERO)),this._eyeOffset=t$X.clone(u$Y(e.eyeOffset,t$X.ZERO)),this._position=t$X.clone(u$Y(e.position,t$X.ZERO)),this._scale=u$Y(e.scale,1),this._id=e.id,this._translucencyByDistance=r,this._pixelOffsetScaleByDistance=n,this._scaleByDistance=o,this._heightReference=u$Y(e.heightReference,k$_.NONE),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=u$Y(e.text,""),this._relativeSize=1,this._index=u$Y(e.index,0),this._isPicked=!1,this._screenSpacePosition=new o$1k,this._localScreenSpaceBBox=new f$10,this._associativeMvtBillboard=void 0,this._mvtLayerID=e.mvtLayerID,this._mapName=e.mapName,this._mvtMinLevel=void 0,this._mvtMaxLevel=void 0,this._mvtProperties=e.mvtProperties,I$T(this),this._updateClamping(),this.isOverlap=!1}function j$A(e,t){for(var i=/[a-zA-Z0-9]/,r=/[()[\]{}<>]/,n=[],o="",a=g$y.LTR,s="",l=e.length,u=0;u<l;++u){var c=e.charAt(u);s=t.test(c)?g$y.RTL:i.test(c)?g$y.LTR:r.test(c)?g$y.BRACKETS:g$y.WEAK,0===u&&(a=s),a===s&&s!==g$y.BRACKETS?o+=c:(""!==o&&n.push({Type:a,Word:o}),a=s,o=c)}return n.push({Type:s,Word:o}),n}function J$C(e){return e.split("").reverse().join("")}function A$K(e,t,i){return e.slice(0,t)+i+e.slice(t)}function Q$w(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}Object.defineProperties(O$t.prototype,{show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;e$28(n)&&(n.show=e)}var o=this._backgroundBillboard;e$28(o)&&(o.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._position;if(!t$X.equals(t,e)){t$X.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r].billboard;e$28(o)&&(o.position=e)}var a=this._backgroundBillboard;e$28(a)&&(a.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;e$28(n)&&(n.heightReference=e)}var o=this._backgroundBillboard;e$28(o)&&(o.heightReference=e),q$C(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._text!==e&&(this._text=e,this._renderedText=O$t.enableRightToLeftDetection?X$q(e):e,m$A(this))}},font:{get:function(){return this._font},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._font!==e&&(this._font=e,m$A(this),I$T(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._fillColor;e$1S.equals(t,e)||(this._oriFillColor=e$1S.clone(t),e$1S.clone(e,t),m$A(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._outlineColor;e$1S.equals(t,e)||(e$1S.clone(e,t),m$A(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,m$A(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._showBackground!==e&&(this._showBackground=e,m$A(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._backgroundColor;if(!e$1S.equals(t,e)){e$1S.clone(e,t);var i=this._backgroundBillboard;e$28(i)&&(i.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._backgroundPadding;o$1k.equals(t,e)||(o$1k.clone(e,t),q$C(this))}},style:{get:function(){return this._style},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._style!==e&&(this._style=e,m$A(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._pixelOffset;if(!o$1k.equals(t,e)){o$1k.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r];e$28(o.billboard)&&(o.billboard.pixelOffset=e)}var a=this._backgroundBillboard;e$28(a)&&(a.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._translucencyByDistance;if(!o$1b.equals(t,e)){this._translucencyByDistance=o$1b.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r];e$28(o.billboard)&&(o.billboard.translucencyByDistance=e)}var a=this._backgroundBillboard;e$28(a)&&(a.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._pixelOffsetScaleByDistance;if(!o$1b.equals(t,e)){this._pixelOffsetScaleByDistance=o$1b.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r];e$28(o.billboard)&&(o.billboard.pixelOffsetScaleByDistance=e)}var a=this._backgroundBillboard;e$28(a)&&(a.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._scaleByDistance;if(!o$1b.equals(t,e)){this._scaleByDistance=o$1b.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r];e$28(o.billboard)&&(o.billboard.scaleByDistance=e)}var a=this._backgroundBillboard;e$28(a)&&(a.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._eyeOffset;if(!t$X.equals(t,e)){t$X.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var o=i[r];e$28(o.billboard)&&(o.billboard.eyeOffset=e)}var a=this._backgroundBillboard;e$28(a)&&(a.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,q$C(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.verticalOrigin=e)}var o=this._backgroundBillboard;e$28(o)&&(o.verticalOrigin=e),q$C(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.scale=e*this._relativeSize)}var o=this._backgroundBillboard;e$28(o)&&(o.scale=e*this._relativeSize),q$C(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far must be greater than near");if(!r$10.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=r$10.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var o=this._backgroundBillboard;e$28(o)&&(o.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(e$28(e)&&e<0)throw new t$Z("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var o=this._backgroundBillboard;e$28(o)&&(o.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.id=e)}var o=this._backgroundBillboard;e$28(o)&&(o.id=e)}}},pickId:{get:function(){if(0!==this._glyphs.length&&e$28(this._glyphs[0].billboard))return this._glyphs[0].billboard.pickId}},isPicked:{get:function(){return this._isPicked},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._isPicked=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=t$X.clone(e,this._actualClampedPosition),e$28(e)&&this._mode===P$$.COLUMBUS_VIEW&&(e=m$1b.convertToColumbusCartesian(e));for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard._clampedPosition=e)}var o=this._backgroundBillboard;e$28(o)&&(o._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.billboard)&&(n.billboard.clusterShow=e)}var o=this._backgroundBillboard;e$28(o)&&(o.clusterShow=e)}}}}),O$t.prototype._updateClamping=function(){n$X._updateClamping(this._labelCollection,this)},O$t.prototype.computeScreenSpacePosition=function(e,t){if(!e$28(e))throw new t$Z("scene is required.");e$28(t)||(t=this._screenSpacePosition);var i=this._labelCollection.modelMatrix,r=e$28(this._actualClampedPosition)?this._actualClampedPosition:this._position;return n$X._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)},O$t.prototype.computeLocalScreenSpaceBoundingBox=function(e,t){var i=0,r=0,n=0,o=0,a=e.totalScale,s=e._backgroundBillboard;if(e$28(s))i=s._translate.x,r=-s._translate.y,n=s.width*a,o=s.height*a,e.verticalOrigin===S$L.BOTTOM||e.verticalOrigin===S$L.BASELINE?r-=o:e.verticalOrigin===S$L.CENTER&&(r-=.5*o);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(var l=0,u=0,c=e._glyphs,h=c.length,d=0;d<h;++d){var f=c[d],p=f.billboard;if(e$28(p)){var _=p._translate.x,m=-p._translate.y,$=f.dimensions.width*a,g=f.dimensions.height*a;e.verticalOrigin===S$L.BOTTOM||e.verticalOrigin===S$L.BASELINE?m-=g:e.verticalOrigin===S$L.CENTER&&(m-=.5*g),e._verticalOrigin===S$L.TOP?m+=G$J.PADDING*a:(e._verticalOrigin===S$L.BOTTOM||e._verticalOrigin===S$L.BASELINE)&&(m-=G$J.PADDING*a),i=Math.min(i,_),r=Math.min(r,m),l=Math.max(l,_+$),u=Math.max(u,m+g)}}n=l-i,o=u-r}return e$28(t)||(t=new f$10),t.x=i,t.y=r,t.width=n,t.height=o,e._text.indexOf("\n")>-1&&(t.height*=e._text.split("\n").length),t},O$t.prototype.getScreenSpaceBoundingBox=function(e,t,i){return e$28(i)||(i=new f$10),this.computeLocalScreenSpaceBoundingBox(e,i),i.x+=t.x,i.y+=t.y,i},O$t.getScreenSpaceBoundingBox=function(e,t,i){var r=0,n=0,o=0,a=0,s=e.totalScale,l=e._backgroundBillboard;if(e$28(l))r=t.x+l._translate.x,n=t.y-l._translate.y,o=l.width*s,a=l.height*s,e.verticalOrigin===S$L.BOTTOM||e.verticalOrigin===S$L.BASELINE?n-=a:e.verticalOrigin===S$L.CENTER&&(n-=.5*a);else{r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(var u=0,c=0,h=e._glyphs,d=h.length,f=0;f<d;++f){var p=h[f],_=p.billboard;if(e$28(_)){var m=t.x+_._translate.x,$=t.y-_._translate.y,g=p.dimensions.width*s,v=p.dimensions.height*s;e.verticalOrigin===S$L.BOTTOM||e.verticalOrigin===S$L.BASELINE?$-=v:e.verticalOrigin===S$L.CENTER&&($-=.5*v),e._verticalOrigin===S$L.TOP?$+=G$J.PADDING*s:(e._verticalOrigin===S$L.BOTTOM||e._verticalOrigin===S$L.BASELINE)&&($-=G$J.PADDING*s),r=Math.min(r,m),n=Math.min(n,$),u=Math.max(u,m+g),c=Math.max(c,$+v)}}o=u-r,a=c-n}return e$28(i)||(i=new f$10),i.x=r,i.y=n,i.width=o,i.height=a,i},O$t.prototype.equals=function(e){return this===e||e$28(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&t$X.equals(this._position,e._position)&&e$1S.equals(this._fillColor,e._fillColor)&&e$1S.equals(this._outlineColor,e._outlineColor)&&e$1S.equals(this._backgroundColor,e._backgroundColor)&&o$1k.equals(this._backgroundPadding,e._backgroundPadding)&&o$1k.equals(this._pixelOffset,e._pixelOffset)&&t$X.equals(this._eyeOffset,e._eyeOffset)&&o$1b.equals(this._translucencyByDistance,e._translucencyByDistance)&&o$1b.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&o$1b.equals(this._scaleByDistance,e._scaleByDistance)&&r$10.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},O$t.prototype.isDestroyed=function(){return!1},O$t.prototype.restFillColor=function(){var e=e$1S.clone(this._fillColor),t=this._oriFillColor;e$1S.equals(e,t)||(this._fillColor=e$1S.clone(t),m$A(this))},O$t.prototype.setLabelStyle=function(e){!e$28(e)||(this._font=u$Y(e.font,this._font),this._fillColor=e$1S.clone(u$Y(e.fillColor,this._fillColor)),this._oriFillColor=e$1S.clone(this._fillColor),this._outlineColor=e$1S.clone(u$Y(e.outlineColor,this._outlineColor)),this._outlineWidth=u$Y(e.outlineWidth,this._outlineWidth),this._showBackground=u$Y(e.showBackground,this._showBackground),this._backgroundColor=e$1S.clone(u$Y(e.backgroundColor,this._backgroundColor)),this._backgroundPadding=u$Y(e.backgroundPadding,this._backgroundPadding),this._style=u$Y(e.fillStyle,this._style),this._verticalOrigin=u$Y(e.verticalOrigin,this._verticalOrigin),this._horizontalOrigin=u$Y(e.horizontalOrigin,this._horizontalOrigin),this._pixelOffset=o$1k.clone(u$Y(e.pixelOffset,this._pixelOffset)),this._eyeOffset=t$X.clone(u$Y(e.eyeOffset,this._eyeOffset)),this._scale=u$Y(e.scale,this._scale),this._translucencyByDistance=o$1b.clone(u$Y(e.translucencyByDistance,this._translucencyByDistance)),this._pixelOffsetScaleByDistance=o$1b.clone(u$Y(e.pixelOffsetScaleByDistance,this._pixelOffsetScaleByDistance)),this._scaleByDistance=o$1b.clone(u$Y(e.scaleByDistance,this._scaleByDistance)),this._heightReference=u$Y(e.heightReference,this._heightReference),this._distanceDisplayCondition=r$10.clone(u$Y(e.distanceDisplayCondition,this._distanceDisplayCondition)),this._disableDepthTestDistance=u$Y(e.disableDepthTestDistance,this._disableDepthTestDistance),I$T(this),m$A(this))},O$t.enableRightToLeftDetection=!1;var $$z="×�-ת",H$A="Ø€-Û¿Ý�-Ý¿à¢?-à£?",L$D=new RegExp("["+$$z+H$A+"]");function X$q(e){for(var t=e.split("\n"),i="",r=0;r<t.length;r++){for(var n=t[r],o=L$D.test(n.charAt(0)),a=j$A(n,L$D),s=0,l="",u=0;u<a.length;++u){var c=a[u],h=c.Type===g$y.BRACKETS?Q$w(c.Word):J$C(c.Word);o?c.Type===g$y.RTL?(l=h+l,s=0):c.Type===g$y.LTR?(l=A$K(l,s,c.Word),s+=c.Word.length):(c.Type===g$y.WEAK||c.Type===g$y.BRACKETS)&&(c.Type===g$y.WEAK&&a[u-1].Type===g$y.BRACKETS?l=h+l:a[u-1].Type===g$y.RTL?(l=h+l,s=0):a.length>u+1?a[u+1].Type===g$y.RTL?(l=h+l,s=0):(l=A$K(l,s,c.Word),s+=c.Word.length):l=A$K(l,0,h)):c.Type===g$y.RTL?l=A$K(l,s,h):c.Type===g$y.LTR?s=(l+=c.Word).length:(c.Type===g$y.WEAK||c.Type===g$y.BRACKETS)&&(u>0&&a[u-1].Type===g$y.RTL?a.length>u+1?a[u+1].Type===g$y.RTL?l=A$K(l,s,h):s=(l+=c.Word).length:l+=c.Word:s=(l+=c.Word).length)}i+=l,r<t.length-1&&(i+="\n")}return i}function T$s(){var e=3,t=4,i=12,r=13,n=16,o=17;function a(e,t){return 55296<=e.charCodeAt(t)&&e.charCodeAt(t)<=56319&&56320<=e.charCodeAt(t+1)&&e.charCodeAt(t+1)<=57343}function s(e,t){void 0===t&&(t=0);var i=e.charCodeAt(t);if(55296<=i&&i<=56319&&t<e.length-1){var r=i;return 56320<=(n=e.charCodeAt(t+1))&&n<=57343?1024*(r-55296)+(n-56320)+65536:r}if(56320<=i&&i<=57343&&t>=1){var n=i;return 55296<=(r=e.charCodeAt(t-1))&&r<=56319?1024*(r-55296)+(n-56320)+65536:n}return i}function l(a,s,l){var u=[a].concat(s).concat([l]),c=u[u.length-2],h=l,d=u.lastIndexOf(14);if(d>1&&u.slice(1,d).every((function(t){return t==e}))&&-1==[e,r,o].indexOf(a))return 2;var f=u.lastIndexOf(t);if(f>0&&u.slice(1,f).every((function(e){return e==t}))&&-1==[i,t].indexOf(c))return u.filter((function(e){return e==t})).length%2==1?3:4;if(0==c&&1==h)return 0;if(2==c||0==c||1==c)return 14==h&&s.every((function(t){return t==e}))?2:1;if(2==h||0==h||1==h)return 1;if(6==c&&(6==h||7==h||9==h||10==h))return 0;if(!(9!=c&&7!=c||7!=h&&8!=h))return 0;if((10==c||8==c)&&8==h)return 0;if(h==e||15==h)return 0;if(5==h)return 0;if(c==i)return 0;var p=-1!=u.indexOf(e)?u.lastIndexOf(e)-1:u.length-2;return-1!=[r,o].indexOf(u[p])&&u.slice(p+1,-1).every((function(t){return t==e}))&&14==h||15==c&&-1!=[n,o].indexOf(h)?0:-1!=s.indexOf(t)?2:c==t&&h==t?0:1}function u(a){return 1536<=a&&a<=1541||1757==a||1807==a||2274==a||3406==a||69821==a||70082<=a&&a<=70083||72250==a||72326<=a&&a<=72329||73030==a?i:13==a?0:10==a?1:0<=a&&a<=9||11<=a&&a<=12||14<=a&&a<=31||127<=a&&a<=159||173==a||1564==a||6158==a||8203==a||8206<=a&&a<=8207||8232==a||8233==a||8234<=a&&a<=8238||8288<=a&&a<=8292||8293==a||8294<=a&&a<=8303||55296<=a&&a<=57343||65279==a||65520<=a&&a<=65528||65529<=a&&a<=65531||113824<=a&&a<=113827||119155<=a&&a<=119162||917504==a||917505==a||917506<=a&&a<=917535||917632<=a&&a<=917759||918e3<=a&&a<=921599?2:768<=a&&a<=879||1155<=a&&a<=1159||1160<=a&&a<=1161||1425<=a&&a<=1469||1471==a||1473<=a&&a<=1474||1476<=a&&a<=1477||1479==a||1552<=a&&a<=1562||1611<=a&&a<=1631||1648==a||1750<=a&&a<=1756||1759<=a&&a<=1764||1767<=a&&a<=1768||1770<=a&&a<=1773||1809==a||1840<=a&&a<=1866||1958<=a&&a<=1968||2027<=a&&a<=2035||2070<=a&&a<=2073||2075<=a&&a<=2083||2085<=a&&a<=2087||2089<=a&&a<=2093||2137<=a&&a<=2139||2260<=a&&a<=2273||2275<=a&&a<=2306||2362==a||2364==a||2369<=a&&a<=2376||2381==a||2385<=a&&a<=2391||2402<=a&&a<=2403||2433==a||2492==a||2494==a||2497<=a&&a<=2500||2509==a||2519==a||2530<=a&&a<=2531||2561<=a&&a<=2562||2620==a||2625<=a&&a<=2626||2631<=a&&a<=2632||2635<=a&&a<=2637||2641==a||2672<=a&&a<=2673||2677==a||2689<=a&&a<=2690||2748==a||2753<=a&&a<=2757||2759<=a&&a<=2760||2765==a||2786<=a&&a<=2787||2810<=a&&a<=2815||2817==a||2876==a||2878==a||2879==a||2881<=a&&a<=2884||2893==a||2902==a||2903==a||2914<=a&&a<=2915||2946==a||3006==a||3008==a||3021==a||3031==a||3072==a||3134<=a&&a<=3136||3142<=a&&a<=3144||3146<=a&&a<=3149||3157<=a&&a<=3158||3170<=a&&a<=3171||3201==a||3260==a||3263==a||3266==a||3270==a||3276<=a&&a<=3277||3285<=a&&a<=3286||3298<=a&&a<=3299||3328<=a&&a<=3329||3387<=a&&a<=3388||3390==a||3393<=a&&a<=3396||3405==a||3415==a||3426<=a&&a<=3427||3530==a||3535==a||3538<=a&&a<=3540||3542==a||3551==a||3633==a||3636<=a&&a<=3642||3655<=a&&a<=3662||3761==a||3764<=a&&a<=3769||3771<=a&&a<=3772||3784<=a&&a<=3789||3864<=a&&a<=3865||3893==a||3895==a||3897==a||3953<=a&&a<=3966||3968<=a&&a<=3972||3974<=a&&a<=3975||3981<=a&&a<=3991||3993<=a&&a<=4028||4038==a||4141<=a&&a<=4144||4146<=a&&a<=4151||4153<=a&&a<=4154||4157<=a&&a<=4158||4184<=a&&a<=4185||4190<=a&&a<=4192||4209<=a&&a<=4212||4226==a||4229<=a&&a<=4230||4237==a||4253==a||4957<=a&&a<=4959||5906<=a&&a<=5908||5938<=a&&a<=5940||5970<=a&&a<=5971||6002<=a&&a<=6003||6068<=a&&a<=6069||6071<=a&&a<=6077||6086==a||6089<=a&&a<=6099||6109==a||6155<=a&&a<=6157||6277<=a&&a<=6278||6313==a||6432<=a&&a<=6434||6439<=a&&a<=6440||6450==a||6457<=a&&a<=6459||6679<=a&&a<=6680||6683==a||6742==a||6744<=a&&a<=6750||6752==a||6754==a||6757<=a&&a<=6764||6771<=a&&a<=6780||6783==a||6832<=a&&a<=6845||6846==a||6912<=a&&a<=6915||6964==a||6966<=a&&a<=6970||6972==a||6978==a||7019<=a&&a<=7027||7040<=a&&a<=7041||7074<=a&&a<=7077||7080<=a&&a<=7081||7083<=a&&a<=7085||7142==a||7144<=a&&a<=7145||7149==a||7151<=a&&a<=7153||7212<=a&&a<=7219||7222<=a&&a<=7223||7376<=a&&a<=7378||7380<=a&&a<=7392||7394<=a&&a<=7400||7405==a||7412==a||7416<=a&&a<=7417||7616<=a&&a<=7673||7675<=a&&a<=7679||8204==a||8400<=a&&a<=8412||8413<=a&&a<=8416||8417==a||8418<=a&&a<=8420||8421<=a&&a<=8432||11503<=a&&a<=11505||11647==a||11744<=a&&a<=11775||12330<=a&&a<=12333||12334<=a&&a<=12335||12441<=a&&a<=12442||42607==a||42608<=a&&a<=42610||42612<=a&&a<=42621||42654<=a&&a<=42655||42736<=a&&a<=42737||43010==a||43014==a||43019==a||43045<=a&&a<=43046||43204<=a&&a<=43205||43232<=a&&a<=43249||43302<=a&&a<=43309||43335<=a&&a<=43345||43392<=a&&a<=43394||43443==a||43446<=a&&a<=43449||43452==a||43493==a||43561<=a&&a<=43566||43569<=a&&a<=43570||43573<=a&&a<=43574||43587==a||43596==a||43644==a||43696==a||43698<=a&&a<=43700||43703<=a&&a<=43704||43710<=a&&a<=43711||43713==a||43756<=a&&a<=43757||43766==a||44005==a||44008==a||44013==a||64286==a||65024<=a&&a<=65039||65056<=a&&a<=65071||65438<=a&&a<=65439||66045==a||66272==a||66422<=a&&a<=66426||68097<=a&&a<=68099||68101<=a&&a<=68102||68108<=a&&a<=68111||68152<=a&&a<=68154||68159==a||68325<=a&&a<=68326||69633==a||69688<=a&&a<=69702||69759<=a&&a<=69761||69811<=a&&a<=69814||69817<=a&&a<=69818||69888<=a&&a<=69890||69927<=a&&a<=69931||69933<=a&&a<=69940||70003==a||70016<=a&&a<=70017||70070<=a&&a<=70078||70090<=a&&a<=70092||70191<=a&&a<=70193||70196==a||70198<=a&&a<=70199||70206==a||70367==a||70371<=a&&a<=70378||70400<=a&&a<=70401||70460==a||70462==a||70464==a||70487==a||70502<=a&&a<=70508||70512<=a&&a<=70516||70712<=a&&a<=70719||70722<=a&&a<=70724||70726==a||70832==a||70835<=a&&a<=70840||70842==a||70845==a||70847<=a&&a<=70848||70850<=a&&a<=70851||71087==a||71090<=a&&a<=71093||71100<=a&&a<=71101||71103<=a&&a<=71104||71132<=a&&a<=71133||71219<=a&&a<=71226||71229==a||71231<=a&&a<=71232||71339==a||71341==a||71344<=a&&a<=71349||71351==a||71453<=a&&a<=71455||71458<=a&&a<=71461||71463<=a&&a<=71467||72193<=a&&a<=72198||72201<=a&&a<=72202||72243<=a&&a<=72248||72251<=a&&a<=72254||72263==a||72273<=a&&a<=72278||72281<=a&&a<=72283||72330<=a&&a<=72342||72344<=a&&a<=72345||72752<=a&&a<=72758||72760<=a&&a<=72765||72767==a||72850<=a&&a<=72871||72874<=a&&a<=72880||72882<=a&&a<=72883||72885<=a&&a<=72886||73009<=a&&a<=73014||73018==a||73020<=a&&a<=73021||73023<=a&&a<=73029||73031==a||92912<=a&&a<=92916||92976<=a&&a<=92982||94095<=a&&a<=94098||113821<=a&&a<=113822||119141==a||119143<=a&&a<=119145||119150<=a&&a<=119154||119163<=a&&a<=119170||119173<=a&&a<=119179||119210<=a&&a<=119213||119362<=a&&a<=119364||121344<=a&&a<=121398||121403<=a&&a<=121452||121461==a||121476==a||121499<=a&&a<=121503||121505<=a&&a<=121519||122880<=a&&a<=122886||122888<=a&&a<=122904||122907<=a&&a<=122913||122915<=a&&a<=122916||122918<=a&&a<=122922||125136<=a&&a<=125142||125252<=a&&a<=125258||917536<=a&&a<=917631||917760<=a&&a<=917999?e:127462<=a&&a<=127487?t:2307==a||2363==a||2366<=a&&a<=2368||2377<=a&&a<=2380||2382<=a&&a<=2383||2434<=a&&a<=2435||2495<=a&&a<=2496||2503<=a&&a<=2504||2507<=a&&a<=2508||2563==a||2622<=a&&a<=2624||2691==a||2750<=a&&a<=2752||2761==a||2763<=a&&a<=2764||2818<=a&&a<=2819||2880==a||2887<=a&&a<=2888||2891<=a&&a<=2892||3007==a||3009<=a&&a<=3010||3014<=a&&a<=3016||3018<=a&&a<=3020||3073<=a&&a<=3075||3137<=a&&a<=3140||3202<=a&&a<=3203||3262==a||3264<=a&&a<=3265||3267<=a&&a<=3268||3271<=a&&a<=3272||3274<=a&&a<=3275||3330<=a&&a<=3331||3391<=a&&a<=3392||3398<=a&&a<=3400||3402<=a&&a<=3404||3458<=a&&a<=3459||3536<=a&&a<=3537||3544<=a&&a<=3550||3570<=a&&a<=3571||3635==a||3763==a||3902<=a&&a<=3903||3967==a||4145==a||4155<=a&&a<=4156||4182<=a&&a<=4183||4228==a||6070==a||6078<=a&&a<=6085||6087<=a&&a<=6088||6435<=a&&a<=6438||6441<=a&&a<=6443||6448<=a&&a<=6449||6451<=a&&a<=6456||6681<=a&&a<=6682||6741==a||6743==a||6765<=a&&a<=6770||6916==a||6965==a||6971==a||6973<=a&&a<=6977||6979<=a&&a<=6980||7042==a||7073==a||7078<=a&&a<=7079||7082==a||7143==a||7146<=a&&a<=7148||7150==a||7154<=a&&a<=7155||7204<=a&&a<=7211||7220<=a&&a<=7221||7393==a||7410<=a&&a<=7411||7415==a||43043<=a&&a<=43044||43047==a||43136<=a&&a<=43137||43188<=a&&a<=43203||43346<=a&&a<=43347||43395==a||43444<=a&&a<=43445||43450<=a&&a<=43451||43453<=a&&a<=43456||43567<=a&&a<=43568||43571<=a&&a<=43572||43597==a||43755==a||43758<=a&&a<=43759||43765==a||44003<=a&&a<=44004||44006<=a&&a<=44007||44009<=a&&a<=44010||44012==a||69632==a||69634==a||69762==a||69808<=a&&a<=69810||69815<=a&&a<=69816||69932==a||70018==a||70067<=a&&a<=70069||70079<=a&&a<=70080||70188<=a&&a<=70190||70194<=a&&a<=70195||70197==a||70368<=a&&a<=70370||70402<=a&&a<=70403||70463==a||70465<=a&&a<=70468||70471<=a&&a<=70472||70475<=a&&a<=70477||70498<=a&&a<=70499||70709<=a&&a<=70711||70720<=a&&a<=70721||70725==a||70833<=a&&a<=70834||70841==a||70843<=a&&a<=70844||70846==a||70849==a||71088<=a&&a<=71089||71096<=a&&a<=71099||71102==a||71216<=a&&a<=71218||71227<=a&&a<=71228||71230==a||71340==a||71342<=a&&a<=71343||71350==a||71456<=a&&a<=71457||71462==a||72199<=a&&a<=72200||72249==a||72279<=a&&a<=72280||72343==a||72751==a||72766==a||72873==a||72881==a||72884==a||94033<=a&&a<=94078||119142==a||119149==a?5:4352<=a&&a<=4447||43360<=a&&a<=43388?6:4448<=a&&a<=4519||55216<=a&&a<=55238?7:4520<=a&&a<=4607||55243<=a&&a<=55291?8:44032==a||44060==a||44088==a||44116==a||44144==a||44172==a||44200==a||44228==a||44256==a||44284==a||44312==a||44340==a||44368==a||44396==a||44424==a||44452==a||44480==a||44508==a||44536==a||44564==a||44592==a||44620==a||44648==a||44676==a||44704==a||44732==a||44760==a||44788==a||44816==a||44844==a||44872==a||44900==a||44928==a||44956==a||44984==a||45012==a||45040==a||45068==a||45096==a||45124==a||45152==a||45180==a||45208==a||45236==a||45264==a||45292==a||45320==a||45348==a||45376==a||45404==a||45432==a||45460==a||45488==a||45516==a||45544==a||45572==a||45600==a||45628==a||45656==a||45684==a||45712==a||45740==a||45768==a||45796==a||45824==a||45852==a||45880==a||45908==a||45936==a||45964==a||45992==a||46020==a||46048==a||46076==a||46104==a||46132==a||46160==a||46188==a||46216==a||46244==a||46272==a||46300==a||46328==a||46356==a||46384==a||46412==a||46440==a||46468==a||46496==a||46524==a||46552==a||46580==a||46608==a||46636==a||46664==a||46692==a||46720==a||46748==a||46776==a||46804==a||46832==a||46860==a||46888==a||46916==a||46944==a||46972==a||47e3==a||47028==a||47056==a||47084==a||47112==a||47140==a||47168==a||47196==a||47224==a||47252==a||47280==a||47308==a||47336==a||47364==a||47392==a||47420==a||47448==a||47476==a||47504==a||47532==a||47560==a||47588==a||47616==a||47644==a||47672==a||47700==a||47728==a||47756==a||47784==a||47812==a||47840==a||47868==a||47896==a||47924==a||47952==a||47980==a||48008==a||48036==a||48064==a||48092==a||48120==a||48148==a||48176==a||48204==a||48232==a||48260==a||48288==a||48316==a||48344==a||48372==a||48400==a||48428==a||48456==a||48484==a||48512==a||48540==a||48568==a||48596==a||48624==a||48652==a||48680==a||48708==a||48736==a||48764==a||48792==a||48820==a||48848==a||48876==a||48904==a||48932==a||48960==a||48988==a||49016==a||49044==a||49072==a||49100==a||49128==a||49156==a||49184==a||49212==a||49240==a||49268==a||49296==a||49324==a||49352==a||49380==a||49408==a||49436==a||49464==a||49492==a||49520==a||49548==a||49576==a||49604==a||49632==a||49660==a||49688==a||49716==a||49744==a||49772==a||49800==a||49828==a||49856==a||49884==a||49912==a||49940==a||49968==a||49996==a||50024==a||50052==a||50080==a||50108==a||50136==a||50164==a||50192==a||50220==a||50248==a||50276==a||50304==a||50332==a||50360==a||50388==a||50416==a||50444==a||50472==a||50500==a||50528==a||50556==a||50584==a||50612==a||50640==a||50668==a||50696==a||50724==a||50752==a||50780==a||50808==a||50836==a||50864==a||50892==a||50920==a||50948==a||50976==a||51004==a||51032==a||51060==a||51088==a||51116==a||51144==a||51172==a||51200==a||51228==a||51256==a||51284==a||51312==a||51340==a||51368==a||51396==a||51424==a||51452==a||51480==a||51508==a||51536==a||51564==a||51592==a||51620==a||51648==a||51676==a||51704==a||51732==a||51760==a||51788==a||51816==a||51844==a||51872==a||51900==a||51928==a||51956==a||51984==a||52012==a||52040==a||52068==a||52096==a||52124==a||52152==a||52180==a||52208==a||52236==a||52264==a||52292==a||52320==a||52348==a||52376==a||52404==a||52432==a||52460==a||52488==a||52516==a||52544==a||52572==a||52600==a||52628==a||52656==a||52684==a||52712==a||52740==a||52768==a||52796==a||52824==a||52852==a||52880==a||52908==a||52936==a||52964==a||52992==a||53020==a||53048==a||53076==a||53104==a||53132==a||53160==a||53188==a||53216==a||53244==a||53272==a||53300==a||53328==a||53356==a||53384==a||53412==a||53440==a||53468==a||53496==a||53524==a||53552==a||53580==a||53608==a||53636==a||53664==a||53692==a||53720==a||53748==a||53776==a||53804==a||53832==a||53860==a||53888==a||53916==a||53944==a||53972==a||54e3==a||54028==a||54056==a||54084==a||54112==a||54140==a||54168==a||54196==a||54224==a||54252==a||54280==a||54308==a||54336==a||54364==a||54392==a||54420==a||54448==a||54476==a||54504==a||54532==a||54560==a||54588==a||54616==a||54644==a||54672==a||54700==a||54728==a||54756==a||54784==a||54812==a||54840==a||54868==a||54896==a||54924==a||54952==a||54980==a||55008==a||55036==a||55064==a||55092==a||55120==a||55148==a||55176==a?9:44033<=a&&a<=44059||44061<=a&&a<=44087||44089<=a&&a<=44115||44117<=a&&a<=44143||44145<=a&&a<=44171||44173<=a&&a<=44199||44201<=a&&a<=44227||44229<=a&&a<=44255||44257<=a&&a<=44283||44285<=a&&a<=44311||44313<=a&&a<=44339||44341<=a&&a<=44367||44369<=a&&a<=44395||44397<=a&&a<=44423||44425<=a&&a<=44451||44453<=a&&a<=44479||44481<=a&&a<=44507||44509<=a&&a<=44535||44537<=a&&a<=44563||44565<=a&&a<=44591||44593<=a&&a<=44619||44621<=a&&a<=44647||44649<=a&&a<=44675||44677<=a&&a<=44703||44705<=a&&a<=44731||44733<=a&&a<=44759||44761<=a&&a<=44787||44789<=a&&a<=44815||44817<=a&&a<=44843||44845<=a&&a<=44871||44873<=a&&a<=44899||44901<=a&&a<=44927||44929<=a&&a<=44955||44957<=a&&a<=44983||44985<=a&&a<=45011||45013<=a&&a<=45039||45041<=a&&a<=45067||45069<=a&&a<=45095||45097<=a&&a<=45123||45125<=a&&a<=45151||45153<=a&&a<=45179||45181<=a&&a<=45207||45209<=a&&a<=45235||45237<=a&&a<=45263||45265<=a&&a<=45291||45293<=a&&a<=45319||45321<=a&&a<=45347||45349<=a&&a<=45375||45377<=a&&a<=45403||45405<=a&&a<=45431||45433<=a&&a<=45459||45461<=a&&a<=45487||45489<=a&&a<=45515||45517<=a&&a<=45543||45545<=a&&a<=45571||45573<=a&&a<=45599||45601<=a&&a<=45627||45629<=a&&a<=45655||45657<=a&&a<=45683||45685<=a&&a<=45711||45713<=a&&a<=45739||45741<=a&&a<=45767||45769<=a&&a<=45795||45797<=a&&a<=45823||45825<=a&&a<=45851||45853<=a&&a<=45879||45881<=a&&a<=45907||45909<=a&&a<=45935||45937<=a&&a<=45963||45965<=a&&a<=45991||45993<=a&&a<=46019||46021<=a&&a<=46047||46049<=a&&a<=46075||46077<=a&&a<=46103||46105<=a&&a<=46131||46133<=a&&a<=46159||46161<=a&&a<=46187||46189<=a&&a<=46215||46217<=a&&a<=46243||46245<=a&&a<=46271||46273<=a&&a<=46299||46301<=a&&a<=46327||46329<=a&&a<=46355||46357<=a&&a<=46383||46385<=a&&a<=46411||46413<=a&&a<=46439||46441<=a&&a<=46467||46469<=a&&a<=46495||46497<=a&&a<=46523||46525<=a&&a<=46551||46553<=a&&a<=46579||46581<=a&&a<=46607||46609<=a&&a<=46635||46637<=a&&a<=46663||46665<=a&&a<=46691||46693<=a&&a<=46719||46721<=a&&a<=46747||46749<=a&&a<=46775||46777<=a&&a<=46803||46805<=a&&a<=46831||46833<=a&&a<=46859||46861<=a&&a<=46887||46889<=a&&a<=46915||46917<=a&&a<=46943||46945<=a&&a<=46971||46973<=a&&a<=46999||47001<=a&&a<=47027||47029<=a&&a<=47055||47057<=a&&a<=47083||47085<=a&&a<=47111||47113<=a&&a<=47139||47141<=a&&a<=47167||47169<=a&&a<=47195||47197<=a&&a<=47223||47225<=a&&a<=47251||47253<=a&&a<=47279||47281<=a&&a<=47307||47309<=a&&a<=47335||47337<=a&&a<=47363||47365<=a&&a<=47391||47393<=a&&a<=47419||47421<=a&&a<=47447||47449<=a&&a<=47475||47477<=a&&a<=47503||47505<=a&&a<=47531||47533<=a&&a<=47559||47561<=a&&a<=47587||47589<=a&&a<=47615||47617<=a&&a<=47643||47645<=a&&a<=47671||47673<=a&&a<=47699||47701<=a&&a<=47727||47729<=a&&a<=47755||47757<=a&&a<=47783||47785<=a&&a<=47811||47813<=a&&a<=47839||47841<=a&&a<=47867||47869<=a&&a<=47895||47897<=a&&a<=47923||47925<=a&&a<=47951||47953<=a&&a<=47979||47981<=a&&a<=48007||48009<=a&&a<=48035||48037<=a&&a<=48063||48065<=a&&a<=48091||48093<=a&&a<=48119||48121<=a&&a<=48147||48149<=a&&a<=48175||48177<=a&&a<=48203||48205<=a&&a<=48231||48233<=a&&a<=48259||48261<=a&&a<=48287||48289<=a&&a<=48315||48317<=a&&a<=48343||48345<=a&&a<=48371||48373<=a&&a<=48399||48401<=a&&a<=48427||48429<=a&&a<=48455||48457<=a&&a<=48483||48485<=a&&a<=48511||48513<=a&&a<=48539||48541<=a&&a<=48567||48569<=a&&a<=48595||48597<=a&&a<=48623||48625<=a&&a<=48651||48653<=a&&a<=48679||48681<=a&&a<=48707||48709<=a&&a<=48735||48737<=a&&a<=48763||48765<=a&&a<=48791||48793<=a&&a<=48819||48821<=a&&a<=48847||48849<=a&&a<=48875||48877<=a&&a<=48903||48905<=a&&a<=48931||48933<=a&&a<=48959||48961<=a&&a<=48987||48989<=a&&a<=49015||49017<=a&&a<=49043||49045<=a&&a<=49071||49073<=a&&a<=49099||49101<=a&&a<=49127||49129<=a&&a<=49155||49157<=a&&a<=49183||49185<=a&&a<=49211||49213<=a&&a<=49239||49241<=a&&a<=49267||49269<=a&&a<=49295||49297<=a&&a<=49323||49325<=a&&a<=49351||49353<=a&&a<=49379||49381<=a&&a<=49407||49409<=a&&a<=49435||49437<=a&&a<=49463||49465<=a&&a<=49491||49493<=a&&a<=49519||49521<=a&&a<=49547||49549<=a&&a<=49575||49577<=a&&a<=49603||49605<=a&&a<=49631||49633<=a&&a<=49659||49661<=a&&a<=49687||49689<=a&&a<=49715||49717<=a&&a<=49743||49745<=a&&a<=49771||49773<=a&&a<=49799||49801<=a&&a<=49827||49829<=a&&a<=49855||49857<=a&&a<=49883||49885<=a&&a<=49911||49913<=a&&a<=49939||49941<=a&&a<=49967||49969<=a&&a<=49995||49997<=a&&a<=50023||50025<=a&&a<=50051||50053<=a&&a<=50079||50081<=a&&a<=50107||50109<=a&&a<=50135||50137<=a&&a<=50163||50165<=a&&a<=50191||50193<=a&&a<=50219||50221<=a&&a<=50247||50249<=a&&a<=50275||50277<=a&&a<=50303||50305<=a&&a<=50331||50333<=a&&a<=50359||50361<=a&&a<=50387||50389<=a&&a<=50415||50417<=a&&a<=50443||50445<=a&&a<=50471||50473<=a&&a<=50499||50501<=a&&a<=50527||50529<=a&&a<=50555||50557<=a&&a<=50583||50585<=a&&a<=50611||50613<=a&&a<=50639||50641<=a&&a<=50667||50669<=a&&a<=50695||50697<=a&&a<=50723||50725<=a&&a<=50751||50753<=a&&a<=50779||50781<=a&&a<=50807||50809<=a&&a<=50835||50837<=a&&a<=50863||50865<=a&&a<=50891||50893<=a&&a<=50919||50921<=a&&a<=50947||50949<=a&&a<=50975||50977<=a&&a<=51003||51005<=a&&a<=51031||51033<=a&&a<=51059||51061<=a&&a<=51087||51089<=a&&a<=51115||51117<=a&&a<=51143||51145<=a&&a<=51171||51173<=a&&a<=51199||51201<=a&&a<=51227||51229<=a&&a<=51255||51257<=a&&a<=51283||51285<=a&&a<=51311||51313<=a&&a<=51339||51341<=a&&a<=51367||51369<=a&&a<=51395||51397<=a&&a<=51423||51425<=a&&a<=51451||51453<=a&&a<=51479||51481<=a&&a<=51507||51509<=a&&a<=51535||51537<=a&&a<=51563||51565<=a&&a<=51591||51593<=a&&a<=51619||51621<=a&&a<=51647||51649<=a&&a<=51675||51677<=a&&a<=51703||51705<=a&&a<=51731||51733<=a&&a<=51759||51761<=a&&a<=51787||51789<=a&&a<=51815||51817<=a&&a<=51843||51845<=a&&a<=51871||51873<=a&&a<=51899||51901<=a&&a<=51927||51929<=a&&a<=51955||51957<=a&&a<=51983||51985<=a&&a<=52011||52013<=a&&a<=52039||52041<=a&&a<=52067||52069<=a&&a<=52095||52097<=a&&a<=52123||52125<=a&&a<=52151||52153<=a&&a<=52179||52181<=a&&a<=52207||52209<=a&&a<=52235||52237<=a&&a<=52263||52265<=a&&a<=52291||52293<=a&&a<=52319||52321<=a&&a<=52347||52349<=a&&a<=52375||52377<=a&&a<=52403||52405<=a&&a<=52431||52433<=a&&a<=52459||52461<=a&&a<=52487||52489<=a&&a<=52515||52517<=a&&a<=52543||52545<=a&&a<=52571||52573<=a&&a<=52599||52601<=a&&a<=52627||52629<=a&&a<=52655||52657<=a&&a<=52683||52685<=a&&a<=52711||52713<=a&&a<=52739||52741<=a&&a<=52767||52769<=a&&a<=52795||52797<=a&&a<=52823||52825<=a&&a<=52851||52853<=a&&a<=52879||52881<=a&&a<=52907||52909<=a&&a<=52935||52937<=a&&a<=52963||52965<=a&&a<=52991||52993<=a&&a<=53019||53021<=a&&a<=53047||53049<=a&&a<=53075||53077<=a&&a<=53103||53105<=a&&a<=53131||53133<=a&&a<=53159||53161<=a&&a<=53187||53189<=a&&a<=53215||53217<=a&&a<=53243||53245<=a&&a<=53271||53273<=a&&a<=53299||53301<=a&&a<=53327||53329<=a&&a<=53355||53357<=a&&a<=53383||53385<=a&&a<=53411||53413<=a&&a<=53439||53441<=a&&a<=53467||53469<=a&&a<=53495||53497<=a&&a<=53523||53525<=a&&a<=53551||53553<=a&&a<=53579||53581<=a&&a<=53607||53609<=a&&a<=53635||53637<=a&&a<=53663||53665<=a&&a<=53691||53693<=a&&a<=53719||53721<=a&&a<=53747||53749<=a&&a<=53775||53777<=a&&a<=53803||53805<=a&&a<=53831||53833<=a&&a<=53859||53861<=a&&a<=53887||53889<=a&&a<=53915||53917<=a&&a<=53943||53945<=a&&a<=53971||53973<=a&&a<=53999||54001<=a&&a<=54027||54029<=a&&a<=54055||54057<=a&&a<=54083||54085<=a&&a<=54111||54113<=a&&a<=54139||54141<=a&&a<=54167||54169<=a&&a<=54195||54197<=a&&a<=54223||54225<=a&&a<=54251||54253<=a&&a<=54279||54281<=a&&a<=54307||54309<=a&&a<=54335||54337<=a&&a<=54363||54365<=a&&a<=54391||54393<=a&&a<=54419||54421<=a&&a<=54447||54449<=a&&a<=54475||54477<=a&&a<=54503||54505<=a&&a<=54531||54533<=a&&a<=54559||54561<=a&&a<=54587||54589<=a&&a<=54615||54617<=a&&a<=54643||54645<=a&&a<=54671||54673<=a&&a<=54699||54701<=a&&a<=54727||54729<=a&&a<=54755||54757<=a&&a<=54783||54785<=a&&a<=54811||54813<=a&&a<=54839||54841<=a&&a<=54867||54869<=a&&a<=54895||54897<=a&&a<=54923||54925<=a&&a<=54951||54953<=a&&a<=54979||54981<=a&&a<=55007||55009<=a&&a<=55035||55037<=a&&a<=55063||55065<=a&&a<=55091||55093<=a&&a<=55119||55121<=a&&a<=55147||55149<=a&&a<=55175||55177<=a&&a<=55203?10:9757==a||9977==a||9994<=a&&a<=9997||127877==a||127938<=a&&a<=127940||127943==a||127946<=a&&a<=127948||128066<=a&&a<=128067||128070<=a&&a<=128080||128110==a||128112<=a&&a<=128120||128124==a||128129<=a&&a<=128131||128133<=a&&a<=128135||128170==a||128372<=a&&a<=128373||128378==a||128400==a||128405<=a&&a<=128406||128581<=a&&a<=128583||128587<=a&&a<=128591||128675==a||128692<=a&&a<=128694||128704==a||128716==a||129304<=a&&a<=129308||129310<=a&&a<=129311||129318==a||129328<=a&&a<=129337||129341<=a&&a<=129342||129489<=a&&a<=129501?r:127995<=a&&a<=127999?14:8205==a?15:9792==a||9794==a||9877<=a&&a<=9878||9992==a||10084==a||127752==a||127806==a||127859==a||127891==a||127908==a||127912==a||127979==a||127981==a||128139==a||128187<=a&&a<=128188||128295==a||128300==a||128488==a||128640==a||128658==a?n:128102<=a&&a<=128105?o:11}return this.nextBreak=function(e,t){if(void 0===t&&(t=0),t<0)return 0;if(t>=e.length-1)return e.length;for(var i=u(s(e,t)),r=[],n=t+1;n<e.length;n++)if(!a(e,n-1)){var o=u(s(e,n));if(l(i,r,o))return n;r.push(o)}return e.length},this.splitGraphemes=function(e){for(var t,i=[],r=0;(t=this.nextBreak(e,r))<e.length;)i.push(e.slice(r,t)),r=t;return r<e.length&&i.push(e.slice(r)),i},this.iterateGraphemes=function(e){var t=0,i={next:function(){var i,r;return(r=this.nextBreak(e,t))<e.length?(i=e.slice(t,r),t=r,{value:i,done:!1}):t<e.length?(i=e.slice(t),t=e.length,{value:i,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(i[Symbol.iterator]=function(){return i}),i},this.countGraphemes=function(e){for(var t,i=0,r=0;(t=this.nextBreak(e,r))<e.length;)r=t,i++;return r<e.length&&i++,i},this}function ye$g(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function me$j(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}var xe$j=1.2,re$l="ID_WHITE_PIXEL",j$z=new o$1k(4,4),we$f=new f$10(1,1,1,1);function Te$e(e,t){var i=document.createElement("canvas");i.width=j$z.x,i.height=j$z.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(re$l,i).then((function(e){t._whitePixelIndex=e}))}var L$C={};function be$g(e,t,i,r,n,o,a){return L$C.font=t,L$C.fillColor=i,L$C.strokeColor=r,L$C.strokeWidth=n,L$C.padding=G$J.PADDING,a===S$L.CENTER?L$C.textBaseline="middle":a===S$L.TOP?L$C.textBaseline="top":L$C.textBaseline="bottom",L$C.fill=o===R$t.FILL||o===R$t.FILL_AND_OUTLINE,L$C.stroke=o===R$t.OUTLINE||o===R$t.FILL_AND_OUTLINE,L$C.backgroundColor=e$1S.BLACK,x$V(e,L$C)}function Z$x(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;e$28(i)&&(i.show=!1,i.image=void 0,e$28(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0),e._spareBillboards.push(i),t.billboard=void 0)}function Ce$f(e,t,i,r){e.addImage(t,i).then((function(e){r.index=e}))}var Oe$f=new T$s,q$B=new t$X;function Ie$g(e,t){var i,r,n,o=t._renderedText,a=Oe$f.splitGraphemes(o),s=a.length,l=t._glyphs,u=l.length;if(t._relativeSize=t._fontSize/G$J.FONT_SIZE,s<u)for(r=s;r<u;++r)Z$x(e,l[r]);l.length=s;var c=t._show&&t._showBackground&&o.split("\n").join("").length>0,h=t._backgroundBillboard,d=e._backgroundBillboardCollection;c?(e$28(h)||(h=e$28(t._backgroundImage)?d.add({collection:e,image:t._backgroundImage}):d.add({collection:e,image:re$l,imageSubRegion:we$f}),t._backgroundBillboard=h),e$28(t._backgroundImage)||(h.color=t._backgroundColor),h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=j$13.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t.totalScale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance,h.clusterShow=t.clusterShow):e$28(h)&&(d.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache,p=[0],_=0;for(n=0;n<s;++n){var m=a[n],$=t._verticalOrigin,g=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+$]),v=f[g];if(!e$28(v)){var y=be$g(m,t._fontStyle+" "+t._fontWeight+" "+G$J.FONT_SIZE+"px "+t._fontFamily,e$1S.WHITE,e$1S.WHITE,0,R$t.FILL,$);if(v=new me$j(e,-1,y.dimensions),f[g]=v,y.width>0&&y.height>0){for(var x=b$K(y,{cutoff:G$J.CUTOFF,radius:G$J.RADIUS}),b=y.getContext("2d"),w=y.width,C=y.height,T=b.getImageData(0,0,w,C),S=0;S<w;S++)for(var E=0;E<C;E++){var A=E*w+S,P=255*x[A],I=4*A;T.data[I+0]=P,T.data[I+1]=P,T.data[I+2]=P,T.data[I+3]=P}b.putImageData(T,0,0)," "!==m&&Ce$f(e._textureAtlas,g,y,v)}}if("\n"===m?p[++_]=0:p[_]=Math.max(p[_],v.dimensions.height),e$28(i=l[n])?-1===v.index?Z$x(e,i):e$28(i.textureInfo)&&(i.textureInfo=void 0):(i=new ye$g,l[n]=i),i.textureInfo=v,i.dimensions=v.dimensions,-1!==v.index){var M=i.billboard,O=e._spareBillboards;e$28(M)||(O.length>0?M=O.pop():((M=e._billboardCollection.add({collection:e}))._labelDimensions=new o$1k,M._labelTranslate=new o$1k),i.billboard=M),M.show=t._show,M._heightReference=t._heightReference,M.position=t._position,M.eyeOffset=t._eyeOffset,M.pixelOffset=t._pixelOffset,M.horizontalOrigin=j$13.LEFT,M.verticalOrigin=t._verticalOrigin,M.scale=t.totalScale,M.pickPrimitive=t,M.id=t._id,M.image=g,M.translucencyByDistance=t._translucencyByDistance,M.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,M.scaleByDistance=t._scaleByDistance,M.distanceDisplayCondition=t._distanceDisplayCondition,M.disableDepthTestDistance=t._disableDepthTestDistance,M._batchIndex=t._batchIndex,M.outlineColor=t.outlineColor,t.style===R$t.FILL_AND_OUTLINE?(M.color=t._fillColor,M.outlineWidth=t.outlineWidth):t.style===R$t.FILL?(M.color=t._fillColor,M.outlineWidth=0):t.style===R$t.OUTLINE&&(M.color=e$1S.TRANSPARENT,M.outlineWidth=t.outlineWidth)}}e._isMVT&&De$k(t,h,l,s,p),t._repositionAllGlyphs=!0}function De$k(e,t,i,r,n){for(var o=0,a=0;a<n.length;a++)o+=n[a];for(var s=0;s<r;++s){var l=i[s];if(e$28(l)&&e$28(l.billboard)){var u=l.billboard,c=.2*o;if(q$B.y=c,u.eyeOffset=q$B,e$28(e._associativeMvtBillboard)){var h=Math.max(e._associativeMvtBillboard._eyeOffset.y,q$B.y);e._associativeMvtBillboard.eyeOffset.y=u.eyeOffset.y=h}e$28(t)&&(t.eyeOffset=q$B)}}}function se$g(e,t,i){return t===j$13.CENTER?-e/2:t===j$13.RIGHT?-(e+i.x):i.x}var y$B=new o$1k,Be$i=new o$1k;function Se$9(e){var t,i,r,n=e._glyphs,o=e._renderedText,a=0,s=0,l=[],u=Number.NEGATIVE_INFINITY,c=0,h=1,d=n.length,f=e._backgroundBillboard,p=o$1k.clone(e$28(f)?e._backgroundPadding:o$1k.ZERO,Be$i);for(p.x/=e._relativeSize,p.y/=e._relativeSize,r=0;r<d;++r)"\n"===o.charAt(r)?(l.push(a),++h,a=0):(i=(t=n[r]).dimensions,c=Math.max(c,i.height-i.descent),u=Math.max(u,i.descent),a+=i.width-i.bounds.minx,r<d-1&&(a+=n[r+1].dimensions.bounds.minx),s=Math.max(s,a));l.push(a);var _=c+u,m=e.totalScale,$=e._horizontalOrigin,g=e._verticalOrigin,v=0,y=l[v],x=se$g(y,$,p),b=xe$j*_,w=b*(h-1),C=s,T=_+w;e$28(f)&&(C+=2*p.x,T+=2*p.y,f._labelHorizontalOrigin=$),y$B.x=x*m,y$B.y=0;var S=!0,E=0;for(r=0;r<d;++r)if("\n"===o.charAt(r))E+=b,x=se$g(y=l[++v],$,p),y$B.x=x*m,S=!0;else if(i=(t=n[r]).dimensions,g===S$L.TOP?(y$B.y=i.height-c-p.y,y$B.y+=G$J.PADDING):g===S$L.CENTER?y$B.y=(w+i.height-c)/2:g===S$L.BASELINE?(y$B.y=w,y$B.y-=G$J.PADDING):(y$B.y=w+u+p.y,y$B.y-=G$J.PADDING),y$B.y=(y$B.y-i.descent-E)*m,S&&(y$B.x-=G$J.PADDING*m,S=!1),e$28(t.billboard)&&(t.billboard._setTranslate(y$B),t.billboard._labelDimensions.x=C,t.billboard._labelDimensions.y=T,t.billboard._labelHorizontalOrigin=$),r<d-1){var A=n[r+1];y$B.x+=(i.width-i.bounds.minx+A.dimensions.bounds.minx)*m}if(e$28(f)&&o.split("\n").join("").length>0&&(x=$===j$13.CENTER?-s/2-p.x:$===j$13.RIGHT?-(s+2*p.x):0,y$B.x=x*m,g===S$L.TOP?y$B.y=_-c-u:g===S$L.CENTER?y$B.y=(_-c)/2-u:g===S$L.BASELINE?y$B.y=-p.y-u:y$B.y=0,y$B.y=y$B.y*m,f.width=C,f.height=T,f._setTranslate(y$B),f._labelTranslate=o$1k.clone(y$B,f._labelTranslate)),e.heightReference===k$_.CLAMP_TO_GROUND)for(r=0;r<d;++r){var P=(t=n[r]).billboard;e$28(P)&&(P._labelTranslate=o$1k.clone(y$B,P._labelTranslate))}}function ne$p(e,t){for(var i=t._glyphs,r=0,n=i.length;r<n;++r)Z$x(e,i[r]);e$28(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,e$28(t._removeCallbackFunc)&&t._removeCallbackFunc(),i$Z(t)}function w$p(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._id=e.id,this._s3MlayerId=-1,this._scene=e.scene,this._isMVT=e.isMVT,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._swipeEnabled=u$Y(e.swipeEnabled,!1),this._swipeRegion=u$Y(e.swipeRegion,new f$10(0,0,1,1)),this._billboardMode=u$Y(e.billboardMode,$r$4.None),this._backgroundBillboardCollection=new B$q({scene:this._scene,isMVT:this._isMVT,depthTestEnable:e.depthTestEnable,swipeEnabled:this._swipeEnabled,swipeRegion:this._swipeRegion,billboardMode:this._billboardMode}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new B$q({scene:this._scene,batchTable:this._batchTable,isMVT:this._isMVT,depthTestEnable:e.depthTestEnable,swipeEnabled:this._swipeEnabled,swipeRegion:this._swipeRegion,billboardMode:this._billboardMode}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=e$1S.clone(e$1S.WHITE),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.blendOption=u$Y(e.blendOption,S$s.OPAQUE_AND_TRANSLUCENT),this._isS3MTileLabels=u$Y(e.isS3MTileLabels,!1),this._labelsID={},this._pickedlabelsID=[],this._isPicked=!1,this._selectedColor=e$1S.clone(u$Y(e.selectedColor,new e$1S(.7,.7,1,1))),this._labelSelected=new o$1o,this._visibleViewport=4095}function oe$j(e){return e.coord.x}function ae$i(e){return e.coord.y}function le$i(e,t,i,r,n,o){var a=e,s=t;return n===S$L.CENTER?s+=r/2:n===S$L.TOP&&(s+=r),o===j$13.CENTER?a-=i/2:o===j$13.RIGHT&&(a-=i),{x:a,y:s}}function b$J(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=void 0,this._labelCollection=void 0,this._polylineCollection=void 0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._resolvedPromise=!1}function G$H(e,t){var i=e._rectangle,r=e._minHeight,n=e._maxHeight,o=2+h$10.packedLength+t$V.packedLength,a=new Float64Array(o),s=0;return a[s++]=r,a[s++]=n,h$10.pack(i,a,s),s+=h$10.packedLength,t$V.pack(t,a,s),a}Object.defineProperties(w$p.prototype,{length:{get:function(){return this._labels.length}},s3MlayerId:{get:function(){return this._s3MlayerId},set:function(e){o$1u.defined("labelCollection Id value",e),this._s3MlayerId=e}},selectedColor:{get:function(){return this._selectedColor},set:function(e){o$1u.defined("selectedColor value",e),e$1S.clone(e,this._selectedColor)}},swipeRegion:{get:function(){return this._swipeRegion},set:function(e){if(!(e$28(e)&&e instanceof f$10))throw new t$Z("Expected LabelCollection.swipeRegion to be type of BoundingRectangle.");f$10.equals(e,this._swipeRegion)||(f$10.clone(e,this._swipeRegion),this._billboardCollection.swipeRegion=this._swipeRegion,this._backgroundBillboardCollection.swipeRegion=this._swipeRegion)}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){o$1u.typeOf.bool("LabelCollection.swipeEnabled",e),e!==this._swipeEnabled&&(this._swipeEnabled=e,this._billboardCollection.swipeEnabled=e,this._backgroundBillboardCollection.swipeEnabled=e)}},billboardMode:{get:function(){return this._billboardMode}}}),w$p.prototype.add=function(e){e=u$Y(e,{});var t=this._labels.length;e.index=t;var i=new O$t(e,this);return this._labels.push(i),this._labelsToUpdate.push(i),e$28(i.id)&&(this._labelsID[i.id]=i),i},w$p.prototype.remove=function(e){if(e$28(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(-1!==t)return this._labels.splice(t,1),ne$p(this,e),e$28(e.id)&&Object.keys(this._labelsID).length>0&&delete this._labelsID[e.id],!0}return!1},w$p.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)ne$p(this,e[t]);e.length=0,this._labelsID={},this._pickedlabelsID.length=0,this._isPicked=!1},w$p.prototype.contains=function(e){return e$28(e)&&e._labelCollection===this},w$p.prototype.containsLabel=function(e){return this._labelsID.hasOwnProperty(e)},w$p.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._labels[e]},w$p.prototype.getById=function(e){if(!e$28(e))throw new t$Z("id is required.");return e$28(this._labelsID[e])?this._labelsID[e]:null},w$p.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},w$p.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},w$p.prototype.update=function(e,t,i){if(e.multiViewportIndex>-1&&this._labels.length>0){if(e$28(this._labels[0]._id)&&e$28(this._labels[0]._id.entityCollection)){var r=this._labels[0]._id.entityCollection.owner;if(typeof r.getVisibleInViewport<"u")if(!r.getVisibleInViewport(e.multiViewportIndex))return}if(!this.getVisibleInViewport(e.multiViewportIndex))return}var n=this._billboardCollection,o=this._backgroundBillboardCollection;n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume,o.modelMatrix=this.modelMatrix,o.debugShowBoundingVolume=this.debugShowBoundingVolume;t=e.context;e$28(this._textureAtlas)||(this._textureAtlas=new w$q({context:t}),n.textureAtlas=this._textureAtlas),e$28(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new w$q({context:t,initialSize:j$z}),o.textureAtlas=this._backgroundTextureAtlas,Te$e(this._backgroundTextureAtlas,this));for(var a=this._labelsToUpdate.length,s=0;s<a;++s){var l=this._labelsToUpdate[s];if(!l.isDestroyed()){var u=l._glyphs.length;l._rebindAllGlyphs&&(Ie$g(this,l),l._rebindAllGlyphs=!1),l._repositionAllGlyphs&&(Se$9(l),l._repositionAllGlyphs=!1),l.computeLocalScreenSpaceBoundingBox(l,l._localScreenSpaceBBox);var c=l._glyphs.length-u;this._totalGlyphCount+=c}}var h=o.length>0?S$s.TRANSLUCENT:this.blendOption;n.blendOption=h,o.blendOption=h,n._highlightColor=this._highlightColor,o._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,o.update(e,t,i),n.update(e,t,i)},w$p.prototype.isDestroyed=function(){return!1},w$p.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),i$Z(this)},w$p.prototype.setLabelStyle=function(e){for(var t=this._labels.length,i=0;i<t;++i){var r=this._labels[i];r.isDestroyed()||r.setLabelStyle(e)}},w$p.prototype.setLabelVisible=function(e,t){if(!e$28(e))throw new t$Z("index is required.");this._labels[e].show=t},w$p.prototype.setAllLabelsVisible=function(e){for(var t=this._labels.length,i=0;i<t;++i){var r=this._labels[i];r.isDestroyed()||(r.show=e)}},w$p.prototype.setVisibleIndex=function(e){for(var t={},i=0,r=e.length;i<r;i++)t[e[i]]=!0;for(var n in this._labelsID)e$28(t[n])?this._labelsID[n].show=!0:this._labelsID[n].show=!1},w$p.prototype.setVisibleLabels=function(e){if(0!==e.length&&0!==this._labels.length){for(var t=this._scene._view.viewport,i=t.x,r=t.x+t.width,n=t.y,o=t.y+t.height,a=[],s=0,l=e.length;s<l;++s){var u=e[s];if(e$28(this._labelsID[u])){var c,h=(_=this._labelsID[u]).computeScreenSpacePosition(this._scene,c);!e$28(h)||h.x>=i&&h.x<=r&&h.y>=n&&h.y<=o&&a.push({index:u,clustered:!0,coord:h})}}var d=O$u(a,oe$j,ae$i,4096,Int32Array),f=[],p=a.length;for(s=0;s<p;++s){for(var _,m=a[s],$=m.index,g=m.coord,v=(_=this._labelsID[$]).getScreenSpaceBoundingBox(_,g,c),y=d.intersect(v.x,v.y,v.x+v.width,v.y+v.height),x=y.length,b=0,w=0;w<x;++w){var C=y[w],T=a[C];s!==C&&!T.clustered&&++b}b<1&&(m.clustered=!1,f.push($))}this.setVisibleIndex(f)}},w$p.prototype.meetVisible=function(){var e=this._scene._view.viewport,t=this._scene.mapProjection.ellipsoid,i=this._scene.camera.positionWC,r=new s$W(t,i),n=e.x,o=e.x+e.width,a=e.y,s=e.y+e.height,l=[],u=this;this._labels.map((function(e){e.isOverlap=!1,e.computeScreenSpacePosition(u._scene);var t=e._screenSpacePosition;!!r.isPointVisible(e.position)&&t.x>=n&&t.x<=o&&t.y>=a&&t.y<=s?l.push({label:e,clustered:!1,coord:t}):e.isOverlap=!0})),l.sort(((e,t)=>{var r=e.label,n=t.label;return r._fontSize===n._fontSize?r._mvtMinLevel===n._mvtMinLevel?o$1k.distanceSquared(i,r.position)-o$1k.distanceSquared(i,n.position):r._mvtMinLevel-n._mvtMinLevel:n._fontSize-r._fontSize}));for(var c=[],h=0;h<l.length;h++){var d=($=l[h]).coord,f=(g=$.label)._localScreenSpaceBBox,p=le$i(d.x,d.y,f.width,f.height,g.verticalOrigin,g.horizontalOrigin);c.push({label:g,clustered:!1,coord:new o$1k(p.x,p.y),center:$}),c.push({label:g,clustered:!1,coord:new o$1k(p.x+f.width,p.y),center:$}),c.push({label:g,clustered:!1,coord:new o$1k(p.x,p.y+f.height),center:$}),c.push({label:g,clustered:!1,coord:new o$1k(p.x+f.width,p.y+f.height),center:$})}var _=O$u(c,oe$j,ae$i,512,Float32Array),m=l.length;for(h=0;h<m;++h){var $,g=($=l[h]).label;if(!$.clustered){d=$.coord,f=g._localScreenSpaceBBox,p=le$i(d.x,d.y,f.width,f.height,g.verticalOrigin,g.horizontalOrigin);for(var v=_.range(p.x,p.y,p.x+f.width,p.y+f.height),y=v.length,x=0;x<y;++x){var b=v[x];if(Math.floor(b/4)!==h){var w=c[b];w.center.clustered=!0,w.center.label.isOverlap=!0}}}}},w$p.prototype.setSelection=function(e){if(this.releaseSelection(),0!==Object.keys(this._labelsID).length){if(this._labelsID.hasOwnProperty(e)){var t=this._labelsID[e];if(t.isDestroyed())return;if(t.id===e){t.isPicked=!0;var i=e$1S.clone(this._selectedColor);t.fillColor=i,this._pickedlabelsID.push(e),this._labelSelected.raiseEvent({id:t.id,text:t.text,scale:t.scale,font:t.font,fillColor:t.fillColor})}}this._isPicked=!0}},w$p.prototype.releaseSelection=function(){if(this._isPicked&&0!==Object.keys(this._labelsID).length){for(var e=this._pickedlabelsID.length,t=0;t<e;++t){var i=this._pickedlabelsID[t];if(this._labelsID.hasOwnProperty(i)){var r=this._labelsID[i];r.isDestroyed()||(r.isPicked&&r.restFillColor(),r.isPicked=!1)}}this._pickedlabelsID=[]}},Object.defineProperties(b$J.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise.promise}}});var q$A=new i$W("createVectorTilePoints"),J$B=new t$X;function K$u(e,t){if(!e$28(e._billboardCollection)){var i;if(!e$28(e._verticesPromise)){i=e._positions;var r=e._packedBuffer;e$28(r)||(i=e._positions=l$12(i),e._batchIds=l$12(e._batchIds),r=e._packedBuffer=G$H(e,t));var n=[i.buffer,r.buffer],o={positions:i.buffer,packedBuffer:r.buffer},a=e._verticesPromise=q$A.scheduleTask(o,n);if(!e$28(a))return;a.then((function(t){e._positions=new Float64Array(t.positions),e._ready=!0}))}if(e._ready&&!e$28(e._billboardCollection)){i=e._positions;var s=e._batchTable,l=e._batchIds,u=e._billboardCollection=new B$q({batchTable:s}),c=e._labelCollection=new w$p({batchTable:s}),h=e._polylineCollection=new X$v;h._useHighlightColor=!0;for(var d=i.length/3,f=0;f<d;++f){var p=l[f],_=t$X.unpack(i,3*f,J$B),m=u.add();m.position=_,m._batchIndex=p;var $=c.add();$.text=" ",$.position=_,$._batchIndex=p,h.add().positions=[t$X.clone(_),t$X.clone(_)]}e._positions=void 0,e._packedBuffer=void 0}}}function M$B(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var o=t[i[n]];o.show=!0,o.pointSize=i$y.defaultPointSize,o.color=i$y.defaultColor,o.pointOutlineColor=i$y.defaultPointOutlineColor,o.pointOutlineWidth=i$y.defaultPointOutlineWidth,o.labelColor=e$1S.WHITE,o.labelOutlineColor=e$1S.WHITE,o.labelOutlineWidth=1,o.font="30px sans-serif",o.labelStyle=R$t.FILL,o.labelText=void 0,o.backgroundColor=new e$1S(.165,.165,.165,.8),o.backgroundPadding=new o$1k(7,5),o.backgroundEnabled=!1,o.scaleByDistance=void 0,o.translucencyByDistance=void 0,o.distanceDisplayCondition=void 0,o.heightOffset=0,o.anchorLineEnabled=!1,o.anchorLineColor=e$1S.WHITE,o.image=void 0,o.disableDepthTestDistance=0,o.horizontalOrigin=j$13.CENTER,o.verticalOrigin=S$L.CENTER,o.labelHorizontalOrigin=j$13.RIGHT,o.labelVerticalOrigin=S$L.BASELINE}}b$J.prototype.createFeatures=function(e,t){for(var i=this._billboardCollection,r=this._labelCollection,n=this._polylineCollection,o=this._batchIds,a=o.length,s=0;s<a;++s){var l=o[s],u=i.get(s),c=r.get(s),h=n.get(s);t[l]=new i$y(e,l,u,c,h)}},b$J.prototype.applyDebugSettings=function(e,t){e?(e$1S.clone(t,this._billboardCollection._highlightColor),e$1S.clone(t,this._labelCollection._highlightColor),e$1S.clone(t,this._polylineCollection._highlightColor)):(e$1S.clone(e$1S.WHITE,this._billboardCollection._highlightColor),e$1S.clone(e$1S.WHITE,this._labelCollection._highlightColor),e$1S.clone(e$1S.WHITE,this._polylineCollection._highlightColor))};var Q$v=new e$1S,U$x=new e$1S,X$p=new e$1S,Y$q=new e$1S,Z$w=new e$1S,$$y=new e$1S,g$x=new o$1b,C$y=new o$1b,k$A=new r$10;function a$x(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=u$Y(e.center,t$X.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._readyPromise=o$1q.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=L$V.BOTH}function U$w(e){var t=new Float64Array(3+t$X.packedLength+t$V.packedLength+h$10.packedLength),i=0;return t[i++]=e._indices.BYTES_PER_ELEMENT,t[i++]=e._minimumHeight,t[i++]=e._maximumHeight,t$X.pack(e._center,t,i),i+=t$X.packedLength,t$V.pack(e._ellipsoid,t,i),i+=t$V.packedLength,h$10.pack(e._rectangle,t,i),t}function F$F(e,t){for(var i=1,r=t[i++],n=e._boundingVolumes=new Array(r),o=0;o<r;++o)n[o]=x$13.unpack(t,i),i+=x$13.packedLength;for(var a=t[i++],s=e._batchedIndices=new Array(a),l=0;l<a;++l){var u=e$1S.unpack(t,i);i+=e$1S.packedLength;for(var c=t[i++],h=t[i++],d=t[i++],f=new Array(d),p=0;p<d;++p)f[p]=t[i++];s[l]=new c$F({color:u,offset:c,count:h,batchIds:f})}}b$J.prototype.applyStyle=function(e,t){if(e$28(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=t[i[n]];if(e$28(e.show)&&(o.show=e.show.evaluate(o)),e$28(e.pointSize)&&(o.pointSize=e.pointSize.evaluate(o)),e$28(e.color)&&(o.color=e.color.evaluateColor(o,Q$v)),e$28(e.pointOutlineColor)&&(o.pointOutlineColor=e.pointOutlineColor.evaluateColor(o,U$x)),e$28(e.pointOutlineWidth)&&(o.pointOutlineWidth=e.pointOutlineWidth.evaluate(o)),e$28(e.labelColor)&&(o.labelColor=e.labelColor.evaluateColor(o,X$p)),e$28(e.labelOutlineColor)&&(o.labelOutlineColor=e.labelOutlineColor.evaluateColor(o,Y$q)),e$28(e.labelOutlineWidth)&&(o.labelOutlineWidth=e.labelOutlineWidth.evaluate(o)),e$28(e.font)&&(o.font=e.font.evaluate(o)),e$28(e.labelStyle)&&(o.labelStyle=e.labelStyle.evaluate(o)),e$28(e.labelText)?o.labelText=e.labelText.evaluate(o):o.labelText=void 0,e$28(e.backgroundColor)&&(o.backgroundColor=e.backgroundColor.evaluateColor(o,Z$w)),e$28(e.backgroundPadding)&&(o.backgroundPadding=e.backgroundPadding.evaluate(o)),e$28(e.backgroundEnabled)&&(o.backgroundEnabled=e.backgroundEnabled.evaluate(o)),e$28(e.scaleByDistance)){var a=e.scaleByDistance.evaluate(o);g$x.near=a.x,g$x.nearValue=a.y,g$x.far=a.z,g$x.farValue=a.w,o.scaleByDistance=g$x}else o.scaleByDistance=void 0;if(e$28(e.translucencyByDistance)){var s=e.translucencyByDistance.evaluate(o);C$y.near=s.x,C$y.nearValue=s.y,C$y.far=s.z,C$y.farValue=s.w,o.translucencyByDistance=C$y}else o.translucencyByDistance=void 0;if(e$28(e.distanceDisplayCondition)){var l=e.distanceDisplayCondition.evaluate(o);k$A.near=l.x,k$A.far=l.y,o.distanceDisplayCondition=k$A}else o.distanceDisplayCondition=void 0;e$28(e.heightOffset)&&(o.heightOffset=e.heightOffset.evaluate(o)),e$28(e.anchorLineEnabled)&&(o.anchorLineEnabled=e.anchorLineEnabled.evaluate(o)),e$28(e.anchorLineColor)&&(o.anchorLineColor=e.anchorLineColor.evaluateColor(o,$$y)),e$28(e.image)?o.image=e.image.evaluate(o):o.image=void 0,e$28(e.disableDepthTestDistance)&&(o.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(o)),e$28(e.horizontalOrigin)&&(o.horizontalOrigin=e.horizontalOrigin.evaluate(o)),e$28(e.verticalOrigin)&&(o.verticalOrigin=e.verticalOrigin.evaluate(o)),e$28(e.labelHorizontalOrigin)&&(o.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(o)),e$28(e.labelVerticalOrigin)&&(o.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(o))}else M$B(this,t)},b$J.prototype.update=function(e){K$u(this,e.mapProjection.ellipsoid),this._ready&&(this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e),this._resolvedPromise||(this._readyPromise.resolve(),this._resolvedPromise=!0))},b$J.prototype.isDestroyed=function(){return!1},b$J.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),i$Z(this)},Object.defineProperties(a$x.prototype,{trianglesLength:{get:function(){return e$28(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return e$28(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}});var W$y=new i$W("createVectorTilePolygons"),z$v=new e$1S;function G$G(e){if(!e$28(e._primitive)){if(!e$28(e._verticesPromise)){var t=e._positions,i=e._counts,r=e._indexCounts,n=e._indices,o=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!e$28(a)){t=e._positions=l$12(e._positions),i=e._counts=l$12(e._counts),r=e._indexCounts=l$12(e._indexCounts),n=e._indices=l$12(e._indices),e._center=e._ellipsoid.cartographicToCartesian(h$10.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(o.length);for(var l=e._batchTable,u=a.length,c=0;c<u;++c){var h=l.getColor(c,z$v);a[c]=h.toRgba()}s=e._packedBuffer=U$w(e)}var d=[t.buffer,i.buffer,r.buffer,n.buffer,o.buffer,a.buffer,s.buffer],f={packedBuffer:s.buffer,positions:t.buffer,counts:i.buffer,indexCounts:r.buffer,indices:n.buffer,batchIds:o.buffer,batchTableColors:a.buffer},p=e._polygonMinimumHeights,_=e._polygonMaximumHeights;e$28(p)&&e$28(_)&&(p=l$12(p),_=l$12(_),d.push(p.buffer,_.buffer),f.minimumHeights=p,f.maximumHeights=_);var m=e._verticesPromise=W$y.scheduleTask(f,d);if(!e$28(m))return;o$1q(m,(function(t){e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;var i=new Float64Array(t.packedBuffer),r=i[0];F$F(e,i),e._indices=2===ce$v.getSizeInBytes(r)?new Uint16Array(t.indices):new Uint32Array(t.indices),e._indexOffsets=new Uint32Array(t.indexOffsets),e._indexCounts=new Uint32Array(t.indexCounts),e._batchedPositions=new Float32Array(t.positions),e._vertexBatchIds=new Uint16Array(t.batchIds),e._ready=!0}))}e._ready&&!e$28(e._primitive)&&(e._primitive=new y$E({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._verticesPromise=void 0,e._readyPromise.resolve())}}a$x.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},a$x.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},a$x.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},a$x.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},a$x.prototype.update=function(e){G$G(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},a$x.prototype.isDestroyed=function(){return!1},a$x.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i$Z(this)};var $$x="attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = u_modifiedModelView * currentPosition;\nvec4 prev = u_modifiedModelView * previousPosition;\nvec4 next = u_modifiedModelView * nextPosition;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_projection * p);\n#endif\n}\n";function h$B(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=e$1S.clone(e$1S.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=o$1q.defer(),this._verticesPromise=void 0}function re$k(e){var t=e._rectangle,i=e._minimumHeight,r=e._maximumHeight,n=e._ellipsoid,o=e._center,a=2+h$10.packedLength+t$V.packedLength+t$X.packedLength,s=new Float64Array(a),l=0;return s[l++]=i,s[l++]=r,h$10.pack(t,s,l),l+=h$10.packedLength,t$V.pack(n,s,l),l+=t$V.packedLength,t$X.pack(o,s,l),s}Object.defineProperties(h$B.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var ae$h=new i$W("createVectorTilePolylines"),m$z={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function ne$o(e,t){if(!e$28(e._va)){if(!e$28(e._verticesPromise)){var i=e._positions,r=e._widths,n=e._counts,o=e._transferrableBatchIds,a=e._packedBuffer;e$28(a)||(i=e._positions=l$12(i),r=e._widths=l$12(r),n=e._counts=l$12(n),o=e._transferrableBatchIds=l$12(e._batchIds),a=e._packedBuffer=re$k(e));var s=[i.buffer,r.buffer,n.buffer,o.buffer,a.buffer],l={positions:i.buffer,widths:r.buffer,counts:n.buffer,batchIds:o.buffer,packedBuffer:a.buffer},u=e._verticesPromise=ae$h.scheduleTask(l,s);if(!e$28(u))return;o$1q(u,(function(t){e._currentPositions=new Float32Array(t.currentPositions),e._previousPositions=new Float32Array(t.previousPositions),e._nextPositions=new Float32Array(t.nextPositions),e._expandAndWidth=new Float32Array(t.expandAndWidth),e._vertexBatchIds=new Uint16Array(t.batchIds);var i=t.indexDatatype;e._indices=i===ce$v.UNSIGNED_SHORT?new Uint16Array(t.indices):new Uint32Array(t.indices),e._ready=!0}))}if(e._ready&&!e$28(e._va)){var c=e._currentPositions,h=e._previousPositions,d=e._nextPositions,f=e._expandAndWidth,p=e._vertexBatchIds,_=e._indices,m=h.byteLength+c.byteLength+d.byteLength;m+=f.byteLength+p.byteLength+_.byteLength,e._trianglesLength=_.length/3,e._geometryByteLength=m;var $=h$W.createVertexBuffer({context:t,typedArray:h,usage:A$1c.STATIC_DRAW}),g=h$W.createVertexBuffer({context:t,typedArray:c,usage:A$1c.STATIC_DRAW}),v=h$W.createVertexBuffer({context:t,typedArray:d,usage:A$1c.STATIC_DRAW}),y=h$W.createVertexBuffer({context:t,typedArray:f,usage:A$1c.STATIC_DRAW}),x=h$W.createVertexBuffer({context:t,typedArray:p,usage:A$1c.STATIC_DRAW}),b=h$W.createIndexBuffer({context:t,typedArray:_,usage:A$1c.STATIC_DRAW,indexDatatype:2===_.BYTES_PER_ELEMENT?ce$v.UNSIGNED_SHORT:ce$v.UNSIGNED_INT}),w=[{index:m$z.previousPosition,vertexBuffer:$,componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{index:m$z.currentPosition,vertexBuffer:g,componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{index:m$z.nextPosition,vertexBuffer:v,componentDatatype:S$W.FLOAT,componentsPerAttribute:3},{index:m$z.expandAndWidth,vertexBuffer:y,componentDatatype:S$W.FLOAT,componentsPerAttribute:2},{index:m$z.a_batchId,vertexBuffer:x,componentDatatype:S$W.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new m$19({context:t,attributes:w,indexBuffer:b}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0,e._readyPromise.resolve()}}}var b$I=new y$15,H$z=new t$X;function oe$i(e,t){e$28(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){var i=t.uniformState.view;return y$15.clone(i,b$I),y$15.multiplyByPoint(b$I,e._center,H$z),y$15.setTranslation(b$I,H$z,b$I),b$I},u_highlightColor:function(){return e._highlightColor}})}function ie$k(e){if(!e$28(e._rs)){e._rs=u$R.fromCache({blending:Ee$n.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:{enabled:!0,factor:-5,units:-5}})}}var de$h="uniform vec4 u_highlightColor; \nvoid main()\n{\n gl_FragColor = u_highlightColor;\n}\n";function fe$g(e,t){if(!e$28(e._sp)){var i=e._batchTable,r=i.getVertexShaderCallback(!1,"a_batchId",void 0)($$x),n=i.getFragmentShaderCallback()(de$h,!1,void 0),o=new a$$({defines:["VECTOR_TILE",s$V.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[Z$J,r]}),a=new a$$({defines:["VECTOR_TILE"],sources:[n]});e._sp=S$T.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:m$z})}}function ue$f(e,t){if(!e$28(e._command)){var i=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new r$15({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:i,boundingVolume:e._boundingVolume,pass:Le$p.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}function se$f(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var o=t[i[n]];o.show=!0,o.color=e$1S.WHITE}}h$B.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=i[n];t[o]=new e$10(e,o)}},h$B.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var he$f=new e$1S,ce$h=e$1S.WHITE,_e$d=!0;function y$A(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._contentReadyPromise=void 0,this._readyPromise=o$1q.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,vt$6(this,r,n)}function ft$6(e){return function(t,i){e$28(e._polygons)&&e._polygons.updateCommands(t,i)}}function dt$8(e,t){var i,r,n,o,a=u$Y(e.POLYGONS_LENGTH,0),s=u$Y(e.POLYLINES_LENGTH,0),l=u$Y(e.POINTS_LENGTH,0);if(a>0&&e$28(e.POLYGON_BATCH_IDS)){var u=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,u,a)}if(s>0&&e$28(e.POLYLINE_BATCH_IDS)){var c=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,c,s)}if(l>0&&e$28(e.POINT_BATCH_IDS)){var h=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,l)}var d=e$28(i)||e$28(r)||e$28(n),f=a>0&&!e$28(i)||s>0&&!e$28(r)||l>0&&!e$28(n);if(d&&f)throw new t$U("If one group of batch ids is defined, then all batch ids must be defined.");if(!e$28(i)&&!e$28(r)&&!e$28(n)){var p=0;if(!e$28(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!e$28(r)&&s>0)for(r=new Uint16Array(s),o=0;o<s;++o)r[o]=p++;if(!e$28(n)&&l>0)for(n=new Uint16Array(l),o=0;o<l;++o)n[o]=p++}return{polygons:i,polylines:r,points:n}}h$B.prototype.applyStyle=function(e,t){if(e$28(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var o=t[i[n]];o.color=e$28(e.color)?e.color.evaluateColor(o,he$f):ce$h,o.show=e$28(e.show)?e.show.evaluate(o):_e$d}else se$f(this,t)},h$B.prototype.update=function(e){var t=e.context;if(ne$o(this,t),oe$i(this,t),fe$g(this,t),ie$k(this),this._ready){var i=e.passes;(i.render||i.pick)&&ue$f(this,e)}},h$B.prototype.isDestroyed=function(){return!1},h$B.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),i$Z(this)},Object.defineProperties(y$A.prototype,{featuresLength:{get:function(){return e$28(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return e$28(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){var e=0;return e$28(this._polygons)&&(e+=this._polygons.trianglesLength),e$28(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){var e=0;return e$28(this._polygons)&&(e+=this._polygons.geometryByteLength),e$28(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return e$28(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return e$28(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var B$p=Uint16Array.BYTES_PER_ELEMENT,h$A=Uint32Array.BYTES_PER_ELEMENT;function vt$6(e,t,i){i=u$Y(i,0);var r=new Uint8Array(t),n=new DataView(t);i+=h$A;var o=n.getUint32(i,!0);if(1!==o)throw new t$U("Only Vector tile version 1 is supported. Version "+o+" is not.");i+=h$A;var a=n.getUint32(i,!0);if(i+=h$A,0!==a){var s=n.getUint32(i,!0);if(i+=h$A,0===s)throw new t$U("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0);i+=h$A;var u=n.getUint32(i,!0);i+=h$A;var c=n.getUint32(i,!0);i+=h$A;var h=n.getUint32(i,!0);i+=h$A;var d=n.getUint32(i,!0);i+=h$A;var f=n.getUint32(i,!0);i+=h$A;var p=n.getUint32(i,!0),_=a$Z(r,i+=h$A,s),m=JSON.parse(_);i+=s;var $,g,v=new Uint8Array(t,i,l);if(i+=l,u>0){var y=a$Z(r,i,u);$=JSON.parse(y),i+=u,c>0&&(g=new Uint8Array(t,i,c),g=new Uint8Array(g),i+=c)}var x=u$Y(m.POLYGONS_LENGTH,0),b=u$Y(m.POLYLINES_LENGTH,0),w=u$Y(m.POINTS_LENGTH,0),C=x+b+w,T=new h$D(e,C,$,g,ft$6(e));if(e._batchTable=T,0!==C){var S,E,A;if(!e$28(m.REGION))throw new t$U("REGION is required in the feature table.");var P=m.REGION;S=h$10.unpack(P),E=P[4],A=P[5];var I,M=e._tile.computedTransform;e$28(m.RTC_CENTER)?(I=t$X.unpack(m.RTC_CENTER),y$15.multiplyByPoint(M,I,I)):((I=h$10.center(S)).height=e$27.lerp(E,A,.5),I=t$V.WGS84.cartographicToCartesian(I));var O=dt$8(m,v);if(i+=i%4,x>0){var D=new Uint32Array(t,i,h/h$A);i+=h;var R=new Uint16Array(t,i,d/B$p);i+=d;var L,B,N=v.byteOffset+m.POLYGON_COUNT.byteOffset,F=new Uint32Array(v.buffer,N,x),z=v.byteOffset+m.POLYGON_INDEX_COUNT.byteOffset,k=new Uint32Array(v.buffer,z,x);if(e$28(m.POLYGON_MINIMUM_HEIGHTS)&&e$28(m.POLYGON_MAXIMUM_HEIGHTS)){var V=v.byteOffset+m.POLYGON_MINIMUM_HEIGHTS.byteOffset;L=new Float32Array(v.buffer,V,x);var U=v.byteOffset+m.POLYGON_MAXIMUM_HEIGHTS.byteOffset;B=new Float32Array(v.buffer,U,x)}e._polygons=new a$x({positions:R,counts:F,indexCounts:k,indices:D,minimumHeight:E,maximumHeight:A,polygonMinimumHeights:L,polygonMaximumHeights:B,center:I,rectangle:S,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:T,batchIds:O.polygons,modelMatrix:M})}if(b>0){var X=new Uint16Array(t,i,f/B$p);i+=f;var H,G=v.byteOffset+m.POLYLINE_COUNT.byteOffset,W=new Uint32Array(v.buffer,G,b);if(e$28(m.POLYLINE_WIDTHS)){var Y=v.byteOffset+m.POLYLINE_WIDTHS.byteOffset;H=new Uint16Array(v.buffer,Y,b)}else{H=new Uint16Array(b);for(var q=0;q<b;++q)H[q]=2}e._polylines=new h$B({positions:X,widths:H,counts:W,batchIds:O.polylines,minimumHeight:E,maximumHeight:A,center:I,rectangle:S,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:T})}if(w>0){var j=new Uint16Array(t,i,p/B$p);e._points=new b$J({positions:j,batchIds:O.points,minimumHeight:E,maximumHeight:A,rectangle:S,batchTable:T})}}}else e._readyPromise.resolve(e)}function k$z(e){var t=e.featuresLength;if(!e$28(e._features)&&t>0){var i=new Array(t);e$28(e._polygons)&&e._polygons.createFeatures(e,i),e$28(e._polylines)&&e._polylines.createFeatures(e,i),e$28(e._points)&&e._points.createFeatures(e,i),e._features=i}}function i$x(e,t,i,r,n){if(this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,r.byteLength<12)throw new RuntimeError("Invalid glb content");const o=new DataView(r,n).getUint32(8,!0),a=new Uint8Array(r,n,o);this._model=new D$G({gltf:a,cull:!1,releaseGltfJson:!0,opaquePass:Le$p.CESIUM_3D_TILE,basePath:i,requestType:$$13.TILES3D,modelMatrix:t.computedTransform,upAxis:e._gltfUpAxis,forwardAxis:z$z.X,shadows:e.shadows,debugWireframe:e.debugWireframe,incrementallyLoadTextures:!1,imageBasedLightingFactor:e.imageBasedLightingFactor,lightColor:e.lightColor,luminanceAtZenith:e.luminanceAtZenith,sphericalHarmonicCoefficients:e.sphericalHarmonicCoefficients,specularEnvironmentMaps:e.specularEnvironmentMaps,owner:e})}y$A.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},y$A.prototype.getFeature=function(e){var t=this.featuresLength;if(!e$28(e)||e<0||e>=t)throw new t$Z("batchId is required and between zero and featuresLength - 1 ("+(t-1)+").");return k$z(this),this._features[e]},y$A.prototype.applyDebugSettings=function(e,t){e$28(this._polygons)&&this._polygons.applyDebugSettings(e,t),e$28(this._polylines)&&this._polylines.applyDebugSettings(e,t),e$28(this._points)&&this._points.applyDebugSettings(e,t)},y$A.prototype.applyStyle=function(e){k$z(this),e$28(this._polygons)&&this._polygons.applyStyle(e,this._features),e$28(this._polylines)&&this._polylines.applyStyle(e,this._features),e$28(this._points)&&this._points.applyStyle(e,this._features)},y$A.prototype.update=function(e,t){var i=!0;if(e$28(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),i=i&&this._polygons._ready),e$28(this._polylines)&&(this._polylines.update(t),i=i&&this._polylines._ready),e$28(this._points)&&(this._points.update(t),i=i&&this._points._ready),e$28(this._batchTable)&&i&&this._batchTable.update(e,t),!e$28(this._contentReadyPromise)){var r=e$28(this._points)?this._points.readyPromise:void 0,n=e$28(this._polygons)?this._polygons.readyPromise:void 0,o=e$28(this._polylines)?this._polylines.readyPromise:void 0,a=this;this._contentReadyPromise=o$1q.all([r,n,o]).then((function(){a._readyPromise.resolve(a)}))}},y$A.prototype.isDestroyed=function(){return!1},y$A.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),i$Z(this)},Object.defineProperties(i$x.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),i$x.prototype.update=function(e,t){this._model.shadows=this._tileset.shadows,this._model.imageBasedLightingFactor=this._tileset.imageBasedLightingFactor,this._model.lightColor=this._tileset.lightColor,this._model.luminanceAtZenith=this._tileset.luminanceAtZenith,this._model.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._model.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._model.debugWireframe=this._tileset.debugWireframe;var i=this._tileset.clippingPlanes;this._model.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,e$28(i)&&this._tile.clippingPlanesDirty&&(this._model._clippingPlanes=i.enabled&&this._tile._isClipped?i:void 0),e$28(i)&&e$28(this._model._clippingPlanes)&&this._model._clippingPlanes!==i&&(this._model._clippingPlanes=i),this._model.update(t)},i$x.prototype.isDestroyed=function(){return!1},i$x.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),i$Z(this)};var i$w={b3dm:function(e,t,i,r,n){return new n$u(e,t,i,r,n)},pnts:function(e,t,i,r,n){return new a$y(e,t,i,r,n)},i3dm:function(e,t,i,r,n){return new u$x(e,t,i,r,n)},cmpt:function(e,t,i,r,n){return new i$A(e,t,i,r,n,i$w)},json:function(e,t,i,r,n){return new t$t(e,t,i,r,n)},geom:function(e,t,i,r,n){return new p$C(e,t,i,r,n)},vctr:function(e,t,i,r,n){return new y$A(e,t,i,r,n)},glb:function(e,t,i,r,n){return new i$x(e,t,i,r,n)}},e$R={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},X$o=Object.freeze(e$R),e$Q={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},s$r=Object.freeze(e$Q);function f$F(){}var u$w={stack:new r$U,stackMaximumLength:0};function d$H(e){return e._visible&&e._inRequestVolume}function m$y(e){return e.hasEmptyContent||e.hasTilesetContent}function l$I(e){return!m$y(e)&&e.contentUnloaded}function T$r(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:(t.hasEmptyContent,!0))}function g$w(e,t,i,r){for(var n=t.children,o=n.length,a=0;a<o;++a){var s=n[a];s.updateVisibility(r),d$H(s)&&i.push(s)}}function C$x(e,t){(l$I(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function _$y(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function b$H(e){++e.statistics.visited}function x$G(e,t,i){t.contentAvailable&&t.contentVisibility(i)!==pt$a.OUTSIDE&&e._selectedTiles.push(t)}function W$x(){}function g$v(e){return e._visible&&e._inRequestVolume}f$F.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e._hasMixedContent=!1;var i=!0,r=e.root;if(r.updateVisibility(t),!d$H(r))return i;var n=u$w.stack;for(n.push(e.root);n.length>0;){u$w.stackMaximumLength=Math.max(u$w.stackMaximumLength,n.length);var o=n.pop(),a=o.refine===f$H.ADD,s=o.refine===f$H.REPLACE,l=T$r(e,o);l&&g$w(e,o,n,t),(a||s&&!l)&&(C$x(e,o),_$y(e,o,t),x$G(e,o,t),!m$y(o)&&!o.contentAvailable&&(i=!1)),b$H(e)}return u$w.stack.trim(u$w.stackMaximumLength),i};var k$y={stack:new r$U,stackMaximumLength:0},E$D={stack:new r$U,stackMaximumLength:0},S$r={stack:new r$U,stackMaximumLength:0},d$G={stack:new r$U,stackMaximumLength:0,ancestorStack:new r$U,ancestorStackMaximumLength:0},H$y=2;function I$S(e,t,i){V$r(e,t,e._maximumScreenSpaceError,e._maximumScreenSpaceError,i)}function B$o(e,t,i){V$r(e,t,Number.MAX_VALUE,e._maximumScreenSpaceError,i),w$o(e,t,i)}function z$u(e,t,i){V$r(e,t,Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),e.maximumScreenSpaceError,i),w$o(e,t,i)}function C$w(e){return e._skipLevelOfDetail}function Z$v(e,t){e._emptyTiles.push(t)}function b$G(e,t,i){if(t.contentVisibility(i)!==pt$a.OUTSIDE){var r=t.content;r.featurePropertiesDirty?(r.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<i.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=i.frameNumber,e._selectedTiles.push(t)}}function X$n(e,t,i){var r=S$r.stack;for(r.push(t);r.length>0;){S$r.stackMaximumLength=Math.max(S$r.stackMaximumLength,r.length);for(var n=r.pop().children,o=n.length,a=0;a<o;++a){var s=n[a];g$v(s)&&(s.contentAvailable?(P$y(e,s,i),F$E(e,s,i),b$G(e,s,i)):s._depth-t._depth<H$y&&r.push(s))}}}function D$E(e,t,i){if(C$w(e)){var r=t.contentAvailable?t:t._ancestorWithContentAvailable;e$28(r)?r._shouldSelect=!0:X$n(e,t,i)}else t.contentAvailable&&b$G(e,t,i)}function j$y(e,t,i){++e._statistics.visited,t._visitedFrame=i.frameNumber}function F$E(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function G$F(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}function J$A(e,t,i){if(!e._cullRequestsWhileMoving)return!0;var r=t.boundingSphere,n=Math.max(2*r.radius,1),o=i.camera,a=0!==o.positionWCDeltaMagnitude?o.positionWCDeltaMagnitude:o.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*a/n<1}function x$F(e,t,i){if(t._requestedFrame!==i.frameNumber&&(q$z(t)||t.contentExpired)&&J$A(e,t,i)){var r=i.camera.timeSinceMoved<e.foveatedTimeDelay;t.priorityDeferred&&r||(t._requestedFrame=i.frameNumber,e._requestedTiles.push(t))}}function N$s(e,t,i){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(i),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function K$t(e,t,i){for(var r=!1,n=t.children,o=n.length,a=0;a<o;++a){var s=n[a];N$s(e,s,i),r=r||g$v(s)}return r}function Q$u(e,t,i){var r=t.parent;return!(!e$28(r)||r.hasTilesetContent||r.refine!==f$H.ADD)&&t.getScreenSpaceError(i,!0)<=e._maximumScreenSpaceError}function O$s(e,t,i){if(N$s(e,t,i),g$v(t)){var r=t.children.length>0;if(t.hasTilesetContent&&r){var n=t.children[0];return O$s(e,n,i),void(t._visible=n._visible)}if(Q$u(e,t,i))return void(t._visible=!1);var o=t.refine===f$H.REPLACE,a=t._optimChildrenWithinParent===s$r.USE_OPTIMIZATION;if(o&&a&&r&&!K$t(e,t,i))return++e._statistics.numberOfTilesCulledWithChildrenUnion,void(t._visible=!1)}}function P$y(e,t,i){O$s(e,t,i),t.updateExpiration(),t._wasMinPriorityChild=!1,t._priorityHolder=t,G$F(e,t),t._shouldSelect=!1,t._finalResolution=!0}function Y$p(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;var i=e.parent;if(e$28(i)){var r=!q$z(i)||i._requestedFrame===t.frameNumber;e._ancestorWithContent=r?i:i._ancestorWithContent,e._ancestorWithContentAvailable=i.contentAvailable?i:i._ancestorWithContentAvailable}}function L$B(e){return e.hasEmptyContent||e.hasTilesetContent}function q$z(e){return!L$B(e)&&e.contentUnloaded}function $$w(e,t){var i=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||e$28(i)&&t._screenSpaceError<i._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>i._depth+e.skipLevels)}function rr$5(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function ar$4(e,t,i,r){var n,o=t.refine===f$H.REPLACE,a=t.children,s=a.length;for(n=0;n<s;++n)P$y(e,a[n],r);a.sort(rr$5);var l,u=!C$w(e)&&o&&!L$B(t),c=!0,h=!1,d=-1,f=Number.MAX_VALUE;for(n=0;n<s;++n)if(g$v(l=a[n])?(i.push(l),l._foveatedFactor<f&&(d=n,f=l._foveatedFactor),h=!0):(u||e.loadSiblings)&&(l._foveatedFactor<f&&(d=n,f=l._foveatedFactor),x$F(e,l,r),F$E(e,l,r)),u){var p;p=!!l._inRequestVolume&&(L$B(l)?nr$3(e,l,r):l.contentAvailable),c=c&&p}if(h||(c=!1),-1!==d&&!C$w(e)&&o){var _=a[d];_._wasMinPriorityChild=!0;var m=(t._wasMinPriorityChild||t===e.root)&&f<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(m._foveatedFactor=Math.min(_._foveatedFactor,m._foveatedFactor),m._distanceToCamera=Math.min(_._distanceToCamera,m._distanceToCamera),n=0;n<s;++n)(l=a[n])._priorityHolder=m}return c}function er$5(e,t,i){return!C$w(e)||!e.immediatelyLoadDesiredLevelOfDetail&&(!e$28(t._ancestorWithContent)||(0===t._screenSpaceError?t.parent._screenSpaceError>i:t._screenSpaceError>i))}function A$J(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function V$r(e,t,i,r,n){var o=k$y.stack;for(o.push(t);o.length>0;){k$y.stackMaximumLength=Math.max(k$y.stackMaximumLength,o.length);var a=o.pop();Y$p(a,n);var s=er$5(e,a,i),l=a.refine===f$H.ADD,u=a.refine===f$H.REPLACE,c=a.parent,h=!e$28(c)||c._refines,d=!1;A$J(e,a)&&(d=ar$4(e,a,o,n)&&h);var f=!d&&h;L$B(a)?(Z$v(e,a),x$F(e,a,n),f&&D$E(e,a,n)):l?(D$E(e,a,n),x$F(e,a,n)):u&&(s?(x$F(e,a,n),f&&D$E(e,a,n)):f?(D$E(e,a,n),x$F(e,a,n)):$$w(e,a)&&x$F(e,a,n)),j$y(e,a,n),F$E(e,a,n),a._refines=d}}function nr$3(e,t,i){var r=!0,n=E$D.stack;for(n.push(t);n.length>0;){E$D.stackMaximumLength=Math.max(E$D.stackMaximumLength,n.length);var o=n.pop(),a=o.children,s=a.length,l=L$B(o)&&A$J(e,o);if(!l&&!o.contentAvailable&&(r=!1),P$y(e,o,i),g$v(o)||(x$F(e,o,i),F$E(e,o,i)),l)for(var u=0;u<s;++u){var c=a[u];n.push(c)}}return r}function w$o(e,t,i){var r,n=d$G.stack,o=d$G.ancestorStack;for(n.push(t);n.length>0||o.length>0;){if(d$G.stackMaximumLength=Math.max(d$G.stackMaximumLength,n.length),d$G.ancestorStackMaximumLength=Math.max(d$G.ancestorStackMaximumLength,o.length),o.length>0){var a=o.peek();if(a._stackLength===n.length){o.pop(),a!==r&&(a._finalResolution=!1),b$G(e,a,i);continue}}var s=n.pop();if(e$28(s)){var l=s.refine===f$H.ADD,u=s._shouldSelect,c=s.children,h=c.length,d=A$J(e,s);if(u)if(l)b$G(e,s,i);else{if(s._selectionDepth=o.length,s._selectionDepth>0&&(e._hasMixedContent=!0),r=s,!d){b$G(e,s,i);continue}o.push(s),s._stackLength=n.length}if(d)for(var f=0;f<h;++f){var p=c[f];g$v(p)&&n.push(p)}}}}W$x.selectTiles=function(e,t){if(e._requestedTiles.length=0,!e.debugFreezeFrame){e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;var i=e.root;if(P$y(e,i,t),g$v(i)&&!(i.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)){C$w(e)?e.immediatelyLoadDesiredLevelOfDetail?B$o(e,i,t):z$u(e,i,t):I$S(e,i,t),k$y.stack.trim(k$y.stackMaximumLength),E$D.stack.trim(E$D.stackMaximumLength),S$r.stack.trim(S$r.stackMaximumLength),d$G.stack.trim(d$G.stackMaximumLength),d$G.ancestorStack.trim(d$G.ancestorStackMaximumLength);for(var r=e._requestedTiles,n=r.length,o=0;o<n;++o)r[o].updatePriority()}}};var e$P={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},r$C=new Array(e$P.NUMBER_OF_PASSES);r$C[e$P.RENDER]=Object.freeze({traversal:W$x,isRender:!0,requestTiles:!0,ignoreCommands:!1}),r$C[e$P.PICK]=Object.freeze({traversal:W$x,isRender:!1,requestTiles:!1,ignoreCommands:!1}),r$C[e$P.SHADOW]=Object.freeze({traversal:W$x,isRender:!1,requestTiles:!0,ignoreCommands:!1}),r$C[e$P.PRELOAD]=Object.freeze({traversal:W$x,isRender:!1,requestTiles:!0,ignoreCommands:!0}),r$C[e$P.PRELOAD_FLIGHT]=Object.freeze({traversal:W$x,isRender:!1,requestTiles:!0,ignoreCommands:!0}),r$C[e$P.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({traversal:W$x,isRender:!1,requestTiles:!0,ignoreCommands:!0}),r$C[e$P.MOST_DETAILED_PRELOAD]=Object.freeze({traversal:f$F,isRender:!1,requestTiles:!0,ignoreCommands:!0}),r$C[e$P.MOST_DETAILED_PICK]=Object.freeze({traversal:f$F,isRender:!1,requestTiles:!1,ignoreCommands:!1}),e$P.getPassOptions=function(e){return r$C[e]};var gr$4=Object.freeze(e$P);function t$s(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}function y$z(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.rectangle",e.rectangle),this.rectangle=h$10.clone(e.rectangle),this.minimumHeight=u$Y(e.minimumHeight,0),this.maximumHeight=u$Y(e.maximumHeight,0),this.southwestCornerCartesian=new t$X,this.northeastCornerCartesian=new t$X,this.westNormal=new t$X,this.southNormal=new t$X,this.eastNormal=new t$X,this.northNormal=new t$X;var t=u$Y(e.ellipsoid,t$V.WGS84);tt$b(this,e.rectangle,t),u$Y(e.computeBoundingVolumes,!0)&&(this._orientedBoundingBox=x$13.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,t),this._boundingSphere=i$19.fromOrientedBoundingBox(this._orientedBoundingBox))}Object.defineProperties(t$s.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),t$s.prototype.hasProperty=function(e,t){return!1},t$s.prototype.getFeature=function(e){},t$s.prototype.applyDebugSettings=function(e,t){},t$s.prototype.applyStyle=function(e){},t$s.prototype.update=function(e,t){},t$s.prototype.isDestroyed=function(){return!1},t$s.prototype.destroy=function(){return i$Z(this)},Object.defineProperties(y$z.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var z$t=new t$X,M$A=new t$X,E$C=new t$X,$$v=new t$X,F$D=new t$X,B$n=new t$X,o$N=new t$W,G$E=new o$1i(t$X.UNIT_X,0),f$E=new f$18;function tt$b(e,t,i){i.cartographicToCartesian(h$10.southwest(t),e.southwestCornerCartesian),i.cartographicToCartesian(h$10.northeast(t),e.northeastCornerCartesian),o$N.longitude=t.west,o$N.latitude=.5*(t.south+t.north),o$N.height=0;var r=i.cartographicToCartesian(o$N,F$D),n=t$X.cross(r,t$X.UNIT_Z,z$t);t$X.normalize(n,e.westNormal),o$N.longitude=t.east;var o=i.cartographicToCartesian(o$N,B$n),a=t$X.cross(t$X.UNIT_Z,o,z$t);t$X.normalize(a,e.eastNormal);var s,l=t$X.subtract(r,o,z$t),u=t$X.normalize(l,$$v),c=t.south;if(c>0){o$N.longitude=.5*(t.west+t.east),o$N.latitude=c;var h=i.cartographicToCartesian(o$N,f$E.origin);t$X.clone(u,f$E.direction);var d=o$1i.fromPointNormal(e.southwestCornerCartesian,e.westNormal,G$E);g$10.rayPlane(f$E,d,e.southwestCornerCartesian),s=i.geodeticSurfaceNormal(h,M$A)}else s=i.geodeticSurfaceNormalCartographic(h$10.southeast(t),M$A);var f=t$X.cross(s,l,E$C);t$X.normalize(f,e.southNormal);var p,_=t.north;if(_<0){o$N.longitude=.5*(t.west+t.east),o$N.latitude=_;var m=i.cartographicToCartesian(o$N,f$E.origin);t$X.negate(u,f$E.direction);var $=o$1i.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,G$E);g$10.rayPlane(f$E,$,e.northeastCornerCartesian),p=i.geodeticSurfaceNormal(m,M$A)}else p=i.geodeticSurfaceNormalCartographic(h$10.northwest(t),M$A);var g=t$X.cross(l,p,E$C);t$X.normalize(g,e.northNormal)}var rt$b=new t$X,et$9=new t$X,it$6=new t$X(0,-1,0),at$a=new t$X(0,0,-1),Z$u=new t$X;function t$r(e,t){0===t&&(t=e$27.EPSILON7),this._boundingSphere=new i$19(e,t)}y$z.prototype.distanceToCamera=function(e){o$1u.defined("frameState",e);var t=e.camera,i=new t$X,r=new t$W;if(e$28(t._sensitivePosition)&&t._sensitivePositionRatio>0){var n=t$W.fromCartesian(t._sensitivePosition);r.latitude=n.latitude*t._sensitivePositionRatio+t.positionCartographic.latitude*(1-t._sensitivePositionRatio),r.longitude=n.longitude*t._sensitivePositionRatio+t.positionCartographic.longitude*(1-t._sensitivePositionRatio),r.height=t.positionCartographic.height,i=t$W.toCartesian(r)}else i=t.positionWC,r=t.positionCartographic;var o,a,s,l=0;if(!h$10.contains(this.rectangle,r)){var u=this.southwestCornerCartesian,c=this.northeastCornerCartesian,h=this.westNormal,d=this.southNormal,f=this.eastNormal,p=this.northNormal;e.mode!==P$$.SCENE3D&&((u=e.mapProjection.project(h$10.southwest(this.rectangle),rt$b)).z=u.y,u.y=u.x,u.x=0,(c=e.mapProjection.project(h$10.northeast(this.rectangle),et$9)).z=c.y,c.y=c.x,c.x=0,h=it$6,f=t$X.UNIT_Y,d=at$a,p=t$X.UNIT_Z);var _=t$X.subtract(i,u,Z$u),m=t$X.dot(_,h),$=t$X.dot(_,d),g=t$X.subtract(i,c,Z$u),v=t$X.dot(g,f),y=t$X.dot(g,p);m>0?l+=m*m:v>0&&(l+=v*v),$>0?l+=$*$:y>0&&(l+=y*y)}e.mode===P$$.SCENE3D?(o=r.height,a=this.minimumHeight,s=this.maximumHeight):(o=i.x,a=this.minimumHeight,s=this.maximumHeight);var x=0;if(o>s){var b=o-s;x=b*b}else if(o<a){var w=a-o;x=w*w}return l>t._sensitiveRegionRatio*x?l+=x:l=x,Math.sqrt(l)},y$z.prototype.intersectPlane=function(e){return o$1u.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},y$z.prototype.createDebugVolume=function(e){o$1u.defined("color",e);var t=new y$15.clone(y$15.IDENTITY);return new v$C({geometryInstances:new d$15({geometry:new k$P({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),id:"outline",modelMatrix:t,attributes:{color:o$18.fromColor(e)}}),appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1})},Object.defineProperties(t$r.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),t$r.prototype.distanceToCamera=function(e){o$1u.defined("frameState",e);var t=this._boundingSphere;return Math.max(0,t$X.distance(t.center,e.camera.positionWC)-t.radius)},t$r.prototype.intersectPlane=function(e){return o$1u.defined("plane",e),i$19.intersectPlane(this._boundingSphere,e)},t$r.prototype.update=function(e,t){t$X.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t},t$r.prototype.createDebugVolume=function(e){return o$1u.defined("color",e),new v$C({geometryInstances:new d$15({geometry:new a$Q({radius:this.radius}),id:"outline",modelMatrix:y$15.fromTranslation(this.center,new y$15.clone(y$15.IDENTITY)),attributes:{color:o$18.fromColor(e)}}),appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1})};var b$F=new t$X,h$z=new t$X,I$R=new t$X,S$q=new t$X;function u$v(e,t,i){i=t$X.cross(e,t,i);var r=t$X.magnitude(i);return t$X.multiplyByScalar(i,e$27.EPSILON7/r,i)}function g$u(e,t){var i=t$X.normalize(e,S$q);return u$v(e,t$X.equalsEpsilon(i,t$X.UNIT_X,e$27.EPSILON6)?t$X.UNIT_Y:t$X.UNIT_X,t)}function B$m(e){var t=p$1a.getColumn(e,0,b$F),i=p$1a.getColumn(e,1,h$z),r=p$1a.getColumn(e,2,I$R),n=t$X.equals(t,t$X.ZERO),o=t$X.equals(i,t$X.ZERO),a=t$X.equals(r,t$X.ZERO);return n||o||a?n&&o&&a?(e[0]=e$27.EPSILON7,e[4]=e$27.EPSILON7,e[8]=e$27.EPSILON7,e):(!n||o||a?n||!o||a?n||o||!a?n?o?a||(i=u$v(r,t=g$u(r,t),i)):r=u$v(i,t=g$u(i,t),r):r=u$v(i=g$u(t,i),t,r):r=u$v(i,t,r):i=u$v(t,r,i):t=u$v(i,r,t),p$1a.setColumn(e,0,t,e),p$1a.setColumn(e,1,i,e),p$1a.setColumn(e,2,r,e),e):e}function c$z(e,t){t=B$m(t),this._orientedBoundingBox=new x$13(e,t),this._boundingSphere=i$19.fromOrientedBoundingBox(this._orientedBoundingBox)}function c$y(e,t,i,r){this._tileset=e,this._header=i;var n=i.content;this.transform=e$28(i.transform)?y$15.unpack(i.transform):y$15.clone(y$15.IDENTITY);var o,a,s,l,u,c,h,d,f=e$28(r)?r.computedTransform:e.modelMatrix,p=y$15.multiply(f,this.transform,new y$15),_=e$28(r)?r._initialTransform:y$15.IDENTITY;if(this._initialTransform=y$15.multiply(_,this.transform,new y$15),this.computedTransform=p,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,p),this._boundingVolume2D=void 0,e$28(n)&&e$28(n.boundingVolume)&&(o=this.createBoundingVolume(n.boundingVolume,p)),this._contentBoundingVolume=o,this._contentBoundingVolume2D=void 0,e$28(i.viewerRequestVolume)&&(a=this.createBoundingVolume(i.viewerRequestVolume,p)),this._viewerRequestVolume=a,this.geometricError=i.geometricError,this._geometricError=i.geometricError,e$28(this._geometricError)||(this._geometricError=e$28(r)?r.geometricError:e._geometricError,c$y._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale(),e$28(i.refine)?(("replace"===i.refine||"add"===i.refine)&&c$y._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+i.refine+'". Instead use "'+i.refine.toUpperCase()+'".'),s="REPLACE"===i.refine.toUpperCase()?f$H.REPLACE:f$H.ADD):s=e$28(r)?r.refine:f$H.REPLACE,this.refine=s,this.children=[],this.parent=r,t=t$S.createIfNeeded(t),e$28(n)){var m=n.uri;e$28(n.url)&&(c$y._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),m=n.url),u=!1,c=X$o.UNLOADED,(h=e.isSuperMapiServer?-1!==m.indexOf(".json")?-1===t.url.indexOf("/data/path")?t.getDerivedResource({url:"./data/path/"+m}):t.getDerivedResource({url:m}):-1===t.url.indexOf("/data/path")&&-1!==m.indexOf(".b3dm")?t.getDerivedResource({url:"./data/path/"+m}):t.getDerivedResource({url:m}):t.getDerivedResource({url:m})).url=h.url.replace(/\+/g,"%2B"),d=r$1b.getServerKey(h.getUrlComponent())}else l=new t$s(e,this),u=!0,c=X$o.READY;this._content=l,this._contentResource=h,this._contentState=c,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=d,this.hasEmptyContent=u,this.hasTilesetContent=!1,this.cacheNode=void 0;var $,g,v=i.expire;e$28(v)&&($=v.duration,e$28(v.date)&&(g=a$12.fromIso8601(v.date))),this.expireDuration=$,this.expireDate=g,this.lastStyleTime=0,this._optimChildrenWithinParent=s$r.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=e$1S.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new a$12,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Object.defineProperties(c$z.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),c$z.prototype.distanceToCamera=function(e){return o$1u.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},c$z.prototype.intersectPlane=function(e){return o$1u.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)},c$z.prototype.update=function(e,t){t$X.clone(e,this._orientedBoundingBox.center),t=B$m(t),p$1a.clone(t,this._orientedBoundingBox.halfAxes),i$19.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},c$z.prototype.createDebugVolume=function(e){return o$1u.defined("color",e),new v$C({geometryInstances:new d$15({geometry:new o$1c({minimum:new t$X(-1,-1,-1),maximum:new t$X(1,1,1)}),id:"outline",modelMatrix:y$15.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),attributes:{color:o$18.fromColor(e)}}),appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1})},c$y._deprecationWarning=t$T,Object.defineProperties(c$y.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return u$Y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return e$28(this._color)||(this._color=new e$1S),e$1S.clone(this._color)},set:function(e){this._color=e$1S.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent||e$28(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===X$o.READY}},contentUnloaded:{get:function(){return this._contentState===X$o.UNLOADED}},contentExpired:{get:function(){return this._contentState===X$o.EXPIRED}},contentFailed:{get:function(){return this._contentState===X$o.FAILED}},contentReadyToProcessPromise:{get:function(){if(e$28(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(e$28(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var P$x=new t$X;function Ce$e(e,t){var i=e._tileset,r=t.camera,n=e.boundingSphere,o=n.radius,a=t$X.multiplyByScalar(r.directionWC,e._centerZDepth,P$x),s=t$X.add(r.positionWC,a,P$x),l=t$X.subtract(s,n.center,P$x);if(t$X.magnitude(l)>o){var u=t$X.normalize(l,P$x),c=t$X.multiplyByScalar(u,o,P$x),h=t$X.add(n.center,c,P$x),d=t$X.subtract(h,r.positionWC,P$x),f=t$X.normalize(d,P$x);e._foveatedFactor=1-Math.abs(t$X.dot(r.directionWC,f))}else e._foveatedFactor=0;var p=e.refine===f$H.REPLACE,_=i._skipLevelOfDetail;if(p&&!_||!i.foveatedScreenSpaceError||1===i.foveatedConeSize||e._priorityProgressiveResolution&&p&&_||i._pass===gr$4.PRELOAD_FLIGHT||i._pass===gr$4.PRELOAD)return!1;var m=1-Math.cos(.5*r.frustum.fov),$=i.foveatedConeSize*m;if(e._foveatedFactor<=$)return!1;var g=m-$,v=e$27.clamp((e._foveatedFactor-$)/g,0,1),y=i.foveatedInterpolationCallback(i.foveatedMinimumScreenSpaceErrorRelaxation,i.maximumScreenSpaceError,v),x=0===e._screenSpaceError&&e$28(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return i.maximumScreenSpaceError-y<=x}var X$m=new a$12;function Ee$c(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;var i=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,o=t._screenSpaceErrorProgressiveResolution<=n,a=e$28(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function be$f(e,t){var i=t.parent,r=e$28(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent)?i._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}function De$j(e){if(e$28(e.expireDuration)){var t=a$12.now(X$m);a$12.addSeconds(t,e.expireDuration,t),e$28(e.expireDate)?a$12.lessThan(e.expireDate,t)&&a$12.clone(t,e.expireDate):e.expireDate=a$12.clone(t)}}function Re$c(e,t){return function(i){e._contentState===X$o.PROCESSING?--t.statistics.numberOfTilesProcessing:--t.statistics.numberOfPendingRequests,e._contentState=X$o.FAILED,e._contentReadyPromise.reject(i),e._contentReadyToProcessPromise.reject(i)}}function Pe$d(e){return function(){return e._priority}}c$y.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=u$Y(i,1),o=e$28(this.parent)?this.parent.geometricError:r._geometricError,a=t?o:this.geometricError;if(0===a)return 0;var s,l=e.camera,u=l.frustum,c=e.context,h=c.drawingBufferWidth,d=c.drawingBufferHeight*n;if(e.mode===P$$.SCENE2D||u instanceof a$X){e$28(u._offCenterFrustum)&&(u=u._offCenterFrustum),s=a/(Math.max(u.top-u.bottom,u.right-u.left)/Math.max(h,d))}else{var f=Math.max(this._distanceToCamera,e$27.EPSILON7);if(s=a*d/(f*l.frustum.sseDenominator),r.dynamicScreenSpaceError){var p=r._dynamicScreenSpaceErrorComputedDensity,_=r.dynamicScreenSpaceErrorFactor;s-=e$27.fog(f,p)*_}}return s/=e.pixelRatio},c$y.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=e$28(t)?t.computedTransform:i.modelMatrix,n=e$28(t)?t._visibilityPlaneMask:i$S.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,n),this._visible=this._visibilityPlaneMask!==i$S.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=be$f(i,this),this._priorityProgressiveResolution=Ee$c(i,this),this.priorityDeferred=Ce$e(this,e)},c$y.prototype.updateExpiration=function(){if(e$28(this.expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=a$12.now(X$m);a$12.lessThan(this.expireDate,e)&&(this._contentState=X$o.EXPIRED,this._expiredContent=this._content)}},c$y.prototype.requestContent=function(){var e=this,t=this._tileset;if(this.hasEmptyContent)return!1;var i=this._contentResource.clone(),r=this.contentExpired;r&&i.setQueryParameters({expired:this.expireDate.toString()});var n=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.TILES3D,priorityFunction:Pe$d(this),serverKey:this._serverKey});this._request=n,i.request=n;var o=i.fetchArrayBuffer();if(!e$28(o))return!1;var a=this._contentState;this._contentState=X$o.LOADING,this._contentReadyToProcessPromise=o$1q.defer(),this._contentReadyPromise=o$1q.defer();var s=Re$c(this,t);return o.then((function(i){if(!e.isDestroyed()){var n=a$U(new Uint8Array(i));"glTF"===n&&(n="glb");var o,a=i$w[n];return t._disableSkipLevelOfDetail=t._disableSkipLevelOfDetail||"vctr"===n||"geom"===n,e$28(a)?o=a(t,e,e._contentResource,i,0):(o=i$w.json(t,e,e._contentResource,i,0),e.hasTilesetContent=!0),r&&(e.expireDate=void 0),e._content=o,e._contentState=X$o.PROCESSING,e._contentReadyToProcessPromise.resolve(o),o.readyPromise.then((function(t){e.isDestroyed()?s():(De$j(e),e._selectedFrame=0,e.lastStyleTime=0,a$12.now(e._loadTimestamp),e._contentState=X$o.READY,e._contentReadyPromise.resolve(t))}))}s()})).otherwise((function(i){if(n.state===W$14.CANCELLED)return e._contentState=a,--t.statistics.numberOfPendingRequests,void++t.statistics.numberOfAttemptedRequests;s(i)})),!0},c$y.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=X$o.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 Q$t=new i$19;function j$x(e,t){if(t.mode!==P$$.SCENE3D&&!e$28(e._boundingVolume2D)){var i=e._boundingVolume.boundingSphere,r=i$19.projectTo2D(i,t.mapProjection,Q$t);e._boundingVolume2D=new t$r(r.center,r.radius)}return t.mode!==P$$.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Te$d(e,t){if(t.mode!==P$$.SCENE3D&&!e$28(e._contentBoundingVolume2D)){var i=e._contentBoundingVolume.boundingSphere,r=i$19.projectTo2D(i,t.mapProjection,Q$t);e._contentBoundingVolume2D=new t$r(r.center,r.radius)}return t.mode!==P$$.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}c$y.prototype.visibility=function(e,t){var i=e.cullingVolume,r=j$x(this,e),n=this._tileset,o=n.clippingPlanes;if(e$28(o)&&o.enabled){var a=o.computeIntersectionWithBoundingVolume(r,n.clippingPlanesOriginMatrix);if(this._isClipped=a!==pt$a.INSIDE,a===pt$a.OUTSIDE)return i$S.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},c$y.prototype.contentVisibility=function(e){if(!e$28(this._contentBoundingVolume))return pt$a.INSIDE;if(this._visibilityPlaneMask===i$S.MASK_INSIDE)return pt$a.INSIDE;var t=e.cullingVolume,i=Te$d(this,e),r=this._tileset,n=r.clippingPlanes;if(e$28(n)&&n.enabled){var o=n.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=o!==pt$a.INSIDE,o===pt$a.OUTSIDE)return pt$a.OUTSIDE}return t.computeVisibility(i)},c$y.prototype.distanceToTile=function(e){return j$x(this,e).distanceToCamera(e)};var Be$h=new t$X;c$y.prototype.distanceToTileCenter=function(e){var t=j$x(this,e).boundingVolume,i=t$X.subtract(t.center,e.camera.positionWC,Be$h);return t$X.dot(e.camera.directionWC,i)},c$y.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!e$28(t)||0===t.distanceToCamera(e)};var $$u=new p$1a,ee$p=new t$X,we$e=new p$1a,te$o=new t$X,re$j=new h$10,xe$i=new x$13,K$s=new y$15;function Le$g(e,t,i){var r=t$X.fromElements(e[0],e[1],e[2],te$o),n=p$1a.fromArray(e,3,we$e);r=y$15.multiplyByPoint(t,r,r);var o=y$15.getMatrix3(t,$$u);return n=p$1a.multiply(o,n,n),e$28(i)?(i.update(r,n),i):new c$z(r,n)}function Fe$b(e,t,i,r){var n=h$10.unpack(e,0,re$j),o=e[4],a=e[5],s=x$13.fromRectangle(n,o,a,t$V.WGS84,xe$i),l=s.center,u=s.halfAxes;t=y$15.multiplyTransformation(t,y$15.inverseTransformation(i,K$s),K$s),l=y$15.multiplyByPoint(t,l,l);var c=y$15.getMatrix3(t,$$u);return u=p$1a.multiply(c,u,u),e$28(r)&&r instanceof c$z?(r.update(l,u),r):new c$z(l,u)}function qe$9(e,t,i,r){return y$15.equalsEpsilon(t,i,e$27.EPSILON8)?e$28(r)?r:new y$z({rectangle:h$10.unpack(e,0,re$j),minimumHeight:e[4],maximumHeight:e[5]}):Fe$b(e,t,i,r)}function Ie$f(e,t,i){var r=t$X.fromElements(e[0],e[1],e[2],te$o),n=e[3];r=y$15.multiplyByPoint(t,r,r);var o=y$15.getScale(t,ee$p);return n*=t$X.maximumComponent(o),e$28(i)?(i.update(r,n),i):new t$r(r,n)}function Oe$e(e,t,i,r){if(r.isRender){var n=e$28(e._header.content)&&e$28(e._header.content.boundingVolume),o=e.hasEmptyContent||e.hasTilesetContent,a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!n;if(a){var s;s=e._finalResolution?o?e$1S.DARKGRAY:e$1S.WHITE:e$1S.YELLOW,e$28(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(s)),e._debugBoundingVolume.update(i);var l=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");l.color=o$18.toValue(s,l.color)}else!a&&e$28(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&n?(e$28(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(e$1S.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&e$28(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&e$28(e._viewerRequestVolume)?(e$28(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(e$1S.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&e$28(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());var u=t.debugColorizeTiles&&!e._debugColorizeTiles||e$28(t._heatmap.tilePropertyName),c=!t.debugColorizeTiles&&e._debugColorizeTiles;u?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):c&&(e._debugColorizeTiles=!1,e.color=e$1S.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),c&&t.makeStyleDirty()}}function Ae$f(e,t,i){var r=e._content,n=e._expiredContent;if(e$28(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function Me$f(e,t){var i=t.clippingPlanes,r=0;e$28(i)&&e._isClipped&&i.enabled&&(r=i.clippingPlanesState),r!==e._clippingPlanesState&&(e._clippingPlanesState=r,e.clippingPlanesDirty=!0)}c$y.prototype.createBoundingVolume=function(e,t,i){if(!e$28(e))throw new t$U("boundingVolume must be defined");if(e$28(e.box))return Le$g(e.box,t,i);if(e$28(e.region))return qe$9(e.region,t,this._initialTransform,i);if(e$28(e.sphere))return Ie$f(e.sphere,t,i);throw new t$U("boundingVolume must contain a sphere, region, or box")},c$y.prototype.updateTransform=function(e){e=u$Y(e,y$15.IDENTITY);var t=y$15.multiply(e,this.transform,K$s);if(!y$15.equals(t,this.computedTransform)){y$15.clone(t,this.computedTransform);var i=this._header,r=this._header.content;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),e$28(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e$28(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.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()}},c$y.prototype.updateGeometricErrorScale=function(){var e=y$15.getScale(this.computedTransform,ee$p),t=t$X.maximumComponent(e);this.geometricError=this._geometricError*t},c$y.prototype.update=function(e,t,i){var r=t.commandList.length;Me$f(this,e),Oe$e(this,e,t,i),Ae$f(this,e,t),this._commandsLength=t.commandList.length-r,this.clippingPlanesDirty=!1};var ie$j=[];function ne$n(e,t,i){var r=e*Math.pow(10,t);return parseInt(r)*Math.pow(10,i)}function q$y(e,t,i){return Math.max(e$27.normalize(e,t,i)-e$27.EPSILON7,0)}c$y.prototype.process=function(e,t){var i=t.commandList;t.commandList=ie$j,this._content.update(e,t),ie$j.length=0,t.commandList=i},c$y.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),o=Math.pow(10,9),a=Math.pow(10,10),s=q$y(this._depth,i.depth,r.depth);s=t?1-s:s;var l=ne$n(!e._skipLevelOfDetail&&this.refine===f$H.REPLACE?q$y(this._priorityHolder._distanceToCamera,i.distance,r.distance):q$y(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),4,0),u=this._priorityProgressiveResolution?0:n,c=ne$n(q$y(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),4,4),h=this.priorityDeferred?o:0,d=e._pass===gr$4.PRELOAD_FLIGHT?0:a;this._priority=s+l+u+c+h+d},c$y.prototype.isDestroyed=function(){return!1},c$y.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(),i$Z(this)};var I$Q={},y$y=new t$X;function e$O(){this._list=new h$P,this._sentinel=this._list.add(),this._trimTiles=!1}function a$w(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 f$D(e,t){return"_loadTimestamp"===t?a$12.toDate(e).getTime():e}function L$A(e,t){var i=e.tilePropertyName;if(e$28(i)){var r=f$D(t[i],i);return e$28(r)?(e._maximum=Math.max(r,e._maximum),e._minimum=Math.min(r,e._minimum),r):(e.tilePropertyName=void 0,r)}}I$Q.checkChildrenWithinParent=function(e){o$1u.typeOf.object("tile",e);var t=e.children,i=t.length,r=e.boundingVolume;if(r instanceof c$z||r instanceof y$z){var n=r._orientedBoundingBox;e._optimChildrenWithinParent=s$r.USE_OPTIMIZATION;for(var o=0;o<i;++o){var a=t[o].boundingVolume;if(!(a instanceof c$z||a instanceof y$z)){e._optimChildrenWithinParent=s$r.SKIP_OPTIMIZATION;break}var s=a._orientedBoundingBox,l=t$X.subtract(s.center,n.center,y$y),u=t$X.magnitude(l);if(t$X.divideByScalar(l,u,l),Math.abs(n.halfAxes[0]*l.x)+Math.abs(n.halfAxes[1]*l.y)+Math.abs(n.halfAxes[2]*l.z)+Math.abs(n.halfAxes[3]*l.x)+Math.abs(n.halfAxes[4]*l.y)+Math.abs(n.halfAxes[5]*l.z)+Math.abs(n.halfAxes[6]*l.x)+Math.abs(n.halfAxes[7]*l.y)+Math.abs(n.halfAxes[8]*l.z)<=Math.abs(s.halfAxes[0]*l.x)+Math.abs(s.halfAxes[1]*l.y)+Math.abs(s.halfAxes[2]*l.z)+Math.abs(s.halfAxes[3]*l.x)+Math.abs(s.halfAxes[4]*l.y)+Math.abs(s.halfAxes[5]*l.z)+Math.abs(s.halfAxes[6]*l.x)+Math.abs(s.halfAxes[7]*l.y)+Math.abs(s.halfAxes[8]*l.z)+u){e._optimChildrenWithinParent=s$r.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===s$r.USE_OPTIMIZATION},e$O.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},e$O.prototype.touch=function(e){var t=e.cacheNode;e$28(t)&&this._list.splice(this._sentinel,t)},e$O.prototype.add=function(e){e$28(e.cacheNode)||(e.cacheNode=this._list.add(e))},e$O.prototype.unloadTile=function(e,t,i){var r=t.cacheNode;!e$28(r)||(this._list.remove(r),t.cacheNode=void 0,i(e,t))},e$O.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,n=1024*e.maximumMemoryUsage*1024,o=this._sentinel,a=r.head;a!==o&&(e.totalMemoryUsageInBytes>n||i);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}},e$O.prototype.trim=function(){this._trimTiles=!0},a$w.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=f$D(e,i),this._referenceMaximum[i]=f$D(t,i)};var p$B=[new e$1S(.1,.1,.1,1),new e$1S(.153,.278,.878,1),new e$1S(.827,.231,.49,1),new e$1S(.827,.188,.22,1),new e$1S(1,.592,.259,1),new e$1S(1,.843,0,1)];function r$B(){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 f$C(e,t,i,r){var n=t.innerContents,o=t.pointsLength,a=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,u=t.texturesByteLength,c=t.batchTableByteLength;if(r?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-o:o,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-u:u,e.batchTableByteLength+=i?-c:c):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-o:o,e.numberOfTrianglesSelected+=i?-a:a),e$28(n))for(var h=n.length,d=0;d<h;++d)f$C(e,n[d],i,r)}function e$N(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}function p$A(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.url",e.url),this._url=void 0,this._basePath=void 0,this._root=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._extensionsUsed=void 0,this._gltfUpAxis=void 0,this._cache=new e$O,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._cullWithChildrenBounds=u$Y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new r$U,this._maximumScreenSpaceError=u$Y(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=u$Y(e.maximumMemoryUsage,512),this._styleEngine=new e$N,this._modelMatrix=e$28(e.modelMatrix)?y$15.clone(e.modelMatrix):y$15.clone(y$15.IDENTITY),this._statistics=new r$B,this._statisticsLast=new r$B,this._statisticsPerPass=new Array(gr$4.NUMBER_OF_PASSES);for(var t=0;t<gr$4.NUMBER_OF_PASSES;++t)this._statisticsPerPass[t]=new r$B;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new a$w(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=u$Y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this._visibleViewport=4095,this.cullRequestsWhileMovingMultiplier=u$Y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=e$27.clamp(u$Y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=u$Y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=o$1q.defer(),this._classificationType=e.classificationType,this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._initialClippingPlanesOriginMatrix=y$15.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this.preloadWhenHidden=u$Y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=u$Y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=u$Y(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=u$Y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=u$Y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=u$Y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=u$Y(e.foveatedInterpolationCallback,e$27.lerp),this.foveatedTimeDelay=u$Y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=u$Y(e.shadows,q$L.ENABLED),this.show=u$Y(e.show,!0),this.colorBlendMode=L$N.HIGHLIGHT,this.colorBlendAmount=.5,this.pointCloudShading=new o$O(e.pointCloudShading),this._pointCloudEyeDomeLighting=new m$C,this.loadProgress=new o$1o,this.allTilesLoaded=new o$1o,this.initialTilesLoaded=new o$1o,this.tileLoad=new o$1o,this.tileUnload=new o$1o,this.tileFailed=new o$1o,this.tileVisible=new o$1o,this.skipLevelOfDetail=u$Y(e.skipLevelOfDetail,!1),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=u$Y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=u$Y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=u$Y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=u$Y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=u$Y(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._imageBasedLightingFactor=new o$1k(1,1),o$1k.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=u$Y(e.luminanceAtZenith,.2),this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps,this.debugFreezeFrame=u$Y(e.debugFreezeFrame,!1),this.debugColorizeTiles=u$Y(e.debugColorizeTiles,!1),this.debugWireframe=u$Y(e.debugWireframe,!1),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=u$Y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=u$Y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=u$Y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=u$Y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=u$Y(e.debugShowMemoryUsage,!1),this.debugShowUrl=u$Y(e.debugShowUrl,!1),this.isSuperMapiServer=u$Y(e.isSuperMapiServer,!1),this._swipeRegion=new e$25(0,0,1,1),this._swipeEnabled=!1;var i,r=this;o$1q(e.url).then((function(e){var t;return i=t$S.createIfNeeded(e),r._credits=i.credits,"json"===i.extension?t=i.getBaseUri(!0):i.isDataUri&&(t=""),r._url=i.url,r._basePath=t,p$A.loadJson(i)})).then((function(e){r._root=r.loadTileset(i,e);var t=e$28(e.asset.gltfUpAxis)?z$z.fromName(e.asset.gltfUpAxis):z$z.Y,n=e.asset;r._asset=n,r._properties=e.properties,r._geometricError=e.geometricError,r._extensionsUsed=e.extensionsUsed,r._gltfUpAxis=t,r._extras=e.extras;var o=n.extras;if(e$28(o)&&e$28(o.cesium)&&e$28(o.cesium.credits)){var a=o.cesium.credits,s=r._credits;e$28(s)||(s=[],r._credits=s);for(var l=0;l<a.length;++l){var u=a[l];s.push(new r$1a(u.html,u.showOnScreen))}}var c=r._root.createBoundingVolume(e.root.boundingVolume,y$15.IDENTITY).boundingSphere.center,h=r._ellipsoid.cartesianToCartographic(c);e$28(h)&&h.height>e$1_._defaultMinTerrainHeight&&(r._initialClippingPlanesOriginMatrix=m$1b.eastNorthUpToFixedFrame(c)),r._clippingPlanesOriginMatrix=y$15.clone(r._initialClippingPlanesOriginMatrix),r._readyPromise.resolve(r)})).otherwise((function(e){r._readyPromise.reject(e)}))}a$w.prototype.colorize=function(e,t){if(e$28(this.tilePropertyName)&&e.contentAvailable&&e._selectedFrame===t.frameNumber){var i=L$A(this,e),r=this._previousMinimum,n=this._previousMaximum;if(r!==Number.MAX_VALUE&&n!==-Number.MAX_VALUE){var o=n-r+e$27.EPSILON7,a=e$27.clamp(i-r,0,o)/o*(p$B.length-1),s=Math.floor(a),l=Math.ceil(a),u=a-s,c=p$B[s],h=p$B[l],d=e$1S.clone(e$1S.WHITE);d.red=e$27.lerp(c.red,h.red,u),d.green=e$27.lerp(c.green,h.green,u),d.blue=e$27.lerp(c.blue,h.blue,u),e._debugColor=d}}},a$w.prototype.resetMinimumMaximum=function(){var e=this.tilePropertyName;if(e$28(e)){var t=this._referenceMinimum[e],i=this._referenceMaximum[e],r=e$28(t)&&e$28(i);this._previousMinimum=r?t:this._minimum,this._previousMaximum=r?i:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}},r$B.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},r$B.prototype.incrementSelectionCounts=function(e){f$C(this,e,!1,!1)},r$B.prototype.incrementLoadCounts=function(e){f$C(this,e,!1,!0)},r$B.prototype.decrementLoadCounts=function(e){f$C(this,e,!0,!0)},r$B.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(e$N.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}}}),e$N.prototype.makeDirty=function(){this._styleDirty=!0},e$N.prototype.applyStyle=function(e,t){if(e.ready&&(!e$28(this._style)||this._style.ready)){var i=this._styleDirty;t.isRender&&(this._styleDirty=!1),i&&++this._lastStyleTime;for(var r=this._lastStyleTime,n=e._statistics,o=i?e._selectedTiles:e._selectedTilesToStyle,a=o.length,s=0;s<a;++s){var l=o[s];if(l.lastStyleTime!==r){var u=l.content;l.lastStyleTime=r,u.applyStyle(this._style),n.numberOfFeaturesStyled+=u.featuresLength,++n.numberOfTilesStyled}}}},Object.defineProperties(p$A.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){if(!this.ready)throw new t$Z("The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._asset}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){h$C.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){if(!this.ready)throw new t$Z("The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._properties}},ready:{get:function(){return e$28(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},url:{get:function(){return this._url}},basePath:{get:function(){return t$T("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMemoryUsage=e}},root:{get:function(){if(!this.ready)throw new t$Z("The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._root}},boundingSphere:{get:function(){if(!this.ready)throw new t$Z("The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=y$15.clone(e,this._modelMatrix)}},swipeRegion:{get:function(){return new f$10(this._swipeRegion.x,this._swipeRegion.y,this._swipeRegion.z-this._swipeRegion.x,this._swipeRegion.w-this._swipeRegion.y)},set:function(e){if(e$28(e)){if(!(e instanceof f$10))throw new t$Z("swipeRegion must be a instance of BoundingRectangle.");e$25.fromElements(e.x,e.y,e.x+e.width,e.y+e.height,this._swipeRegion)}}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){if(e!==this._swipeEnabled){e||e$25.fromElements(0,0,1,1,this._swipeRegion),this._swipeEnabled=e;var t=[];for(t.push(this.root);t.length>0;)for(var i=t.pop().children,r=i.length,n=0;n<r;++n)if(t.push(i[n]),e$28(i[n]._content)){var o=i[n]._content._model;!e$28(o)||(o._shouldRegenerateShaders=!0)}}}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return e$28(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(y$15.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):y$15.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),o$1u.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),o$1u.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){if(!this.ready)throw new t$Z("The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true.");return this._extras}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){o$1u.typeOf.object("imageBasedLightingFactor",e),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),o$1u.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),o$1u.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),o$1k.clone(e,this._imageBasedLightingFactor)}}}),p$A.loadJson=function(e){return t$S.createIfNeeded(e).fetchJson()},p$A.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},p$A.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},p$A.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},p$A.prototype.loadTileset=function(e,t,i){var r=t.asset;if(!e$28(r))throw new t$U("Tileset must have an asset property.");if("0.0"!==r.version&&"1.0"!==r.version)throw new t$U("The tileset must be 3D Tiles version 0.0 or 1.0.");var n=this._statistics,o=r.tilesetVersion;e$28(o)&&(this._basePath+="?v="+o,e.setQueryParameters({v:o}));var a=new c$y(this,e,t.root,i);e$28(i)&&(i.children.push(a),a._depth=i._depth+1);var s=[];for(s.push(a);s.length>0;){var l=s.pop();++n.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===f$H.ADD;var u=l._header.children;if(e$28(u))for(var c=u.length,h=0;h<c;++h){var d=new c$y(this,e,u[h],l);l.children.push(d),d._depth=l._depth+1,s.push(d)}this._cullWithChildrenBounds&&I$Q.checkChildrenWithinParent(l)}return a};var j$w=new t$X,Me$e=new t$W,Pe$c=new y$15,Le$f=new t$X,xe$h=new t$X,De$i=new t$X;function Oe$d(e,t){var i,r,n,o,a,s=t.camera,l=e._root,u=l.contentBoundingVolume;if(u instanceof y$z)i=t$X.normalize(s.positionWC,j$w),r=s.directionWC,n=s.positionCartographic.height,o=u.minimumHeight,a=u.maximumHeight;else{var c=y$15.inverseTransformation(l.computedTransform,Pe$c),h=t.mapProjection.ellipsoid,d=u.boundingVolume,f=y$15.multiplyByPoint(c,d.center,Le$f);if(t$X.magnitude(f)>h.minimumRadius){var p=t$W.fromCartesian(f,h,Me$e);i=t$X.normalize(s.positionWC,j$w),r=s.directionWC,n=s.positionCartographic.height,o=0,a=2*p.height}else{var _=y$15.multiplyByPoint(c,s.positionWC,xe$h);if(i=t$X.UNIT_Z,r=y$15.multiplyByPointAsVector(c,s.directionWC,De$i),r=t$X.normalize(r,r),n=_.z,u instanceof c$z){var m=l._header.boundingVolume.box[11];o=f.z-m,a=f.z+m}else if(u instanceof t$r){var $=d.radius;o=f.z-$,a=f.z+$}}}var g=o+(a-o)*e.dynamicScreenSpaceErrorHeightFalloff,v=a,y=e$27.clamp((n-g)/(v-g),0,1),x=1-Math.abs(t$X.dot(r,i));x*=1-y;var b=e.dynamicScreenSpaceErrorDensity;b*=x,e._dynamicScreenSpaceErrorComputedDensity=b}function Re$b(e,t){if(!t.hasEmptyContent){var i=e._statistics,r=t.contentExpired;if(!t.requestContent())return void++i.numberOfAttemptedRequests;r&&(t.hasTilesetContent?He$c(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(Ue$f(e,t)),t.contentReadyPromise.then(qe$8(e,t)).otherwise(Be$g(e,t))}}function Ae$e(e,t){return e._priority-t._priority}function Ve$f(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,o=0;o<n;++o){var a=i[o],s=t.frameNumber-a._touchedFrame>=1;a._contentState===X$o.LOADING?s?(a._request.cancel(),++r):r>0&&(i[o-r]=a):++r}i.length-=r}function Fe$a(e,t){var i=e._requestedTiles,r=i.length;i.sort(Ae$e);for(var n=0;n<r;++n)Re$b(e,i[n])}function Ue$f(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function Be$g(e,t){return function(i){var r=t._contentResource.url,n=e$28(i.message)?i.message:i.toString();e.tileFailed.numberOfListeners>0?e.tileFailed.raiseEvent({url:r,message:n}):(console.log("A 3D tile failed to load: "+r),console.log("Error: "+n))}}function qe$8(e,t){return function(){--e._statistics.numberOfTilesProcessing,t.hasTilesetContent||(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t)}}function Ne$6(e){for(var t=e._processingQueue,i=t.length,r=0,n=0;n<i;++n){var o=t[n];o._contentState===X$o.PROCESSING?r>0&&(t[n-r]=o):++r}t.length-=r}function Ie$e(e,t){Ne$6(e);for(var i=e._processingQueue,r=i.length,n=0;n<r;++n)i[n].process(e,t)}p$A.prototype.postPassesUpdate=function(e){!this.ready||(Ve$f(this,e),Ge$b(this,e),this._cache.unloadTiles(this,K$r))},p$A.prototype.prePassesUpdate=function(e){if(this.ready){Ie$e(this,e);var t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,e$28(t)&&t.enabled&&t.update(e),e$28(this._loadTimestamp)||(this._loadTimestamp=a$12.clone(e.time)),this._timeSinceLoad=Math.max(1e3*a$12.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!e$28(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&Oe$d(this,e),e.newFrame&&this._cache.reset()}};var D$D=new t$X,ke$a={maximumFractionDigits:3};function Q$s(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,ke$a):Math.round(t).toLocaleString()}function V$q(e){var t=e.boundingVolume.boundingVolume,i=t.halfAxes,r=t.radius,n=t$X.clone(t.center,D$D);if(e$28(i))n.x+=.75*(i[0]+i[3]+i[6]),n.y+=.75*(i[1]+i[4]+i[7]),n.z+=.75*(i[2]+i[5]+i[8]);else if(e$28(r)){var o=t$X.normalize(t.center,D$D);o=t$X.multiplyByScalar(o,.75*r,D$D),n=t$X.add(o,t.center,D$D)}return n}function F$C(e,t,i){var r="",n=0;(t.debugShowGeometricError&&(r+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics)&&(r+="\nCommands: "+e.commandsLength,n++,e.content.pointsLength>0&&(r+="\nPoints: "+e.content.pointsLength,n++),e.content.trianglesLength>0&&(r+="\nTriangles: "+e.content.trianglesLength,n++),r+="\nFeatures: "+e.content.featuresLength,n++);t.debugShowMemoryUsage&&(r+="\nTexture Memory: "+Q$s(e.content.texturesByteLength),r+="\nGeometry Memory: "+Q$s(e.content.geometryByteLength),n+=2),t.debugShowUrl&&(r+="\nUrl: "+e._header.content.uri,n++);var o={text:r.substring(1),position:i,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function We$c(e,t){var i,r,n=e._selectedTiles,o=n.length,a=e._emptyTiles,s=a.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(e$28(e.debugPickedTile)){var l=e$28(e.debugPickPosition)?e.debugPickPosition:V$q(e.debugPickedTile);F$C(e.debugPickedTile,e,l).pixelOffset=new o$1k(15,-15)}}else{for(i=0;i<o;++i)F$C(r=n[i],e,V$q(r));for(i=0;i<s;++i)(r=a[i]).hasTilesetContent&&F$C(r,e,V$q(r))}e._tileDebugLabels.update(t)}function ze$9(e,t,i){e._styleEngine.applyStyle(e,i);var r,n,o=i.isRender,a=e._statistics,s=t.commandList,l=s.length,u=e._selectedTiles,c=u.length,h=e._emptyTiles,d=h.length,f=e.tileVisible,p=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&c>0;e._backfaceCommands.length=0,p&&(e$28(e._stencilClearCommand)||(e._stencilClearCommand=new r$11({stencil:0,pass:Le$p.CESIUM_3D_TILE,renderState:u$R.fromCache({stencilMask:Fa$6.SKIP_LOD_MASK})})),s.push(e._stencilClearCommand));var _=s.length;for(r=0;r<c;++r)n=u[r],o&&f.raiseEvent(n),n.update(e,t,i),a.incrementSelectionCounts(n.content),++a.selected;for(r=0;r<d;++r)(n=h[r]).update(e,t,i);var m=s.length-_;if(e._backfaceCommands.trim(),p){var $=e._backfaceCommands.values,g=$.length;for(s.length+=g,r=m-1;r>=0;--r)s[_+g+r]=s[_+r];for(r=0;r<g;++r)s[_+r]=$[r]}m=s.length-l,a.numberOfCommands=m,o&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&m>0&&e._pointCloudEyeDomeLighting.update(t,l,e.pointCloudShading),o&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(e$28(e._tileDebugLabels)||(e._tileDebugLabels=new w$p),We$c(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Y$o=[];function He$c(e,t){var i=t,r=Y$o;for(r.push(t);r.length>0;){for(var n=(t=r.pop()).children,o=n.length,a=0;a<o;++a)r.push(n[a]);t!==i&&(Xe$7(e,t),--e._statistics.numberOfTilesTotal)}i.children=[]}function K$r(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Xe$7(e,t){e._cache.unloadTile(e,t,K$r),t.destroy()}function Ge$b(e,t){var i=e._statistics,r=e._statisticsLast,n=i.numberOfPendingRequests,o=i.numberOfTilesProcessing,a=r.numberOfPendingRequests,s=r.numberOfTilesProcessing;r$B.clone(i,r);var l=n!==a||o!==s;l&&t.afterRender.push((function(){e.loadProgress.raiseEvent(n,o)})),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,l&&e._tilesLoaded&&(t.afterRender.push((function(){e.allTilesLoaded.raiseEvent()})),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push((function(){e.initialTilesLoaded.raiseEvent()}))))}function je$e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function Qe$9(e,t){(t.frameNumber!==e._updatedModelMatrixFrame||!e$28(e._previousModelMatrix))&&(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!y$15.equals(e.modelMatrix,e._previousModelMatrix),e._previousModelMatrix=y$15.clone(e.modelMatrix,e._previousModelMatrix))}function Ye$9(e,t,i,r){if(t.mode===P$$.MORPHING||!e.ready)return!1;var n=e._statistics;n.clear();var o=r.isRender;++e._updatedVisibilityFrame,je$e(e),Qe$9(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;var a=r.traversal.selectTiles(e,t),s=t.context;if(r.requestTiles&&s.memorySize<s.memoryThresholdValue&&Fe$a(e),ze$9(e,t,r),r$B.clone(n,i),o){var l=e._credits;if(e$28(l)&&0!==n.selected)for(var u=l.length,c=0;c<u;++c)t.creditDisplay.addCredit(l[c])}return a}p$A.prototype.trimLoadedTiles=function(){this._cache.trim()},p$A.prototype.update=function(e){if(e.multiViewportIndex>-1&&!this.getVisibleInViewport(e.multiViewportIndex))return;this.frameState=e,this.updateForPass(e,e.tilesetPassState)},p$A.prototype.updateForPass=function(e,t){o$1u.typeOf.object("frameState",e),o$1u.typeOf.object("tilesetPassState",t);var i=t.pass;if((i!==gr$4.PRELOAD||this.preloadWhenHidden&&!this.show)&&(i!==gr$4.PRELOAD_FLIGHT||this.preloadFlightDestinations&&(this.show||this.preloadWhenHidden))&&(i!==gr$4.REQUEST_RENDER_MODE_DEFER_CHECK||!(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))){var r=e.commandList,n=e.camera,o=e.cullingVolume;t.ready=!1;var a=gr$4.getPassOptions(i),s=a.ignoreCommands,l=u$Y(t.commandList,r),u=l.length;e.commandList=l,e.camera=u$Y(t.camera,n),e.cullingVolume=u$Y(t.cullingVolume,o);var c=this._statisticsPerPass[i];(this.show||s)&&(this._pass=i,t.ready=Ye$9(this,e,c,a)),s&&(l.length=u),e.commandList=r,e.camera=n,e.cullingVolume=o}},p$A.prototype.hasExtension=function(e){return!!e$28(this._extensionsUsed)&&this._extensionsUsed.indexOf(e)>-1},p$A.prototype.isDestroyed=function(){return!1},p$A.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),e$28(this._root)){var e=Y$o;for(e.push(this._root);e.length>0;){var t=e.pop();t.destroy();for(var i=t.children,r=i.length,n=0;n<r;++n)e.push(i[n])}}return this._root=void 0,i$Z(this)};var P$w=new y$15;function l$H(e,t){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(l$H.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new e$1P,this._onCollectionChanged(t,t.values,[],[])}function _$x(e,t,i,r){var n=i[t.id];e$28(n)&&(r.removeAndDestroy(n.tilesetPrimitive),delete i[t.id])}function V$p(e,t,i){e.readyPromise.otherwise((function(e){console.error(e),i[t.id].loadFail=!0}))}l$H.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");for(var t=this._entitiesToVisualize.values,i=this._tilesetHash,r=this._primitives,n=0,o=t.length;n<o;n++){var a,s,l=t[n],u=l._tileset,c=i[l.id],h=l.isShowing&&l.isAvailable(e)&&r$K.getValueOrDefault(u._show,e,!0);if(h&&(s=l.computeModelMatrix(e,P$w),a=t$S.createIfNeeded(r$K.getValueOrUndefined(u._uri,e))),h){var d=e$28(c)?c.tilesetPrimitive:void 0;(!e$28(d)||a.url!==c.url)&&(e$28(d)&&(r.removeAndDestroy(d),delete i[l.id]),(d=new p$A({url:a})).id=l,r.add(d),c={tilesetPrimitive:d,url:a.url,loadFail:!1},i[l.id]=c,V$p(d,l,i)),d.show=!0,e$28(s)&&(d.modelMatrix=s),d.maximumScreenSpaceError=r$K.getValueOrDefault(u.maximumScreenSpaceError,e,d.maximumScreenSpaceError)}else e$28(c)&&(c.tilesetPrimitive.show=!1)}return!0},l$H.prototype.isDestroyed=function(){return!1},l$H.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(l$H.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._tilesetHash,i=this._primitives,r=e.length-1;r>-1;r--)_$x(this,e[r],t,i);return i$Z(this)},l$H.prototype.getBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(t))throw new t$Z("result is required.");var i=this._tilesetHash[e.id];if(!e$28(i)||i.loadFail)return A$U.FAILED;var r=i.tilesetPrimitive;return e$28(r)&&r.show?r.ready?(i$19.clone(r.boundingSphere,t),A$U.DONE):A$U.PENDING:A$U.FAILED},l$H.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a=this._entitiesToVisualize,s=this._tilesetHash,l=this._primitives;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._tileset)&&a.set(o.id,o);for(n=r.length-1;n>-1;n--)e$28((o=r[n])._tileset)?a.set(o.id,o):(_$x(this,o,s,l),a.remove(o.id));for(n=i.length-1;n>-1;n--)_$x(this,o=i[n],s,l),a.remove(o.id)};var f$B=e$1S.WHITE,p$z=e$1S.BLACK,u$u=new o$1k(2,2);function r$A(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(r$A.prototype,{isConstant:{get:function(){return r$K.isConstant(this._evenColor)&&r$K.isConstant(this._oddColor)&&r$K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:C$H("evenColor"),oddColor:C$H("oddColor"),repeat:C$H("repeat")}),r$A.prototype.getType=function(e){return"Checkerboard"},r$A.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.lightColor=r$K.getValueOrClonedDefault(this._evenColor,e,f$B,t.lightColor),t.darkColor=r$K.getValueOrClonedDefault(this._oddColor,e,p$z,t.darkColor),t.repeat=r$K.getValueOrDefault(this._repeat,e,u$u),t},r$A.prototype.equals=function(e){return this===e||e instanceof r$A&&r$K.equals(this._evenColor,e._evenColor)&&r$K.equals(this._oddColor,e._oddColor)&&r$K.equals(this._repeat,e._repeat)};var E$B={UNKNOWN:"UNKNOWN",GEOPOINT3D:"POINT3D",GEOLINE3D:"LINE3D",GEOREGION3D:"REGION3D",GEOMODEL3D:"GEOMODEL3D",GEOSPHERE:"GEOSPHERE",GEOBOX:"GEOBOX",GEOBILLBOARD:"GEOBILLBOARD",GEOELLIPSOID:"GEOELLIPSOID",GEOCYLINDER:"GEOCYLINDER",GEOCONE:"GEOCONE",GEOCIRCLE3D:"CIRCLE3D"},P$v=Object.freeze(E$B);function s$q(e,t,i){this.x=parseFloat(e)||0,this.y=parseFloat(t)||0,this.z=parseFloat(i)||0}s$q.equals=function(e,t){return e===t||e$28(e)&&e$28(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};var e$M={CENTER:0,APEX:1},O$r=Object.freeze(e$M);function o$M(e){this.init(e)}function T$q(e,t,i,r){var n=h$W.createVertexBuffer({context:r,typedArray:S$W.createTypedArray(t.componentDatatype,t.values),usage:A$1c.STATIC_DRAW});e.push({index:i,vertexBuffer:n,componentsPerAttribute:t.componentsPerAttribute,componentDatatype:t.componentDatatype,offsetInBytes:0,strideInBytes:0,normalize:!1})}Object.defineProperties(o$M.prototype,{geoRotationX:{get:function(){return this.rotationX},set:function(e){"number"==typeof e&&(this.rotationX=e,this._isMatrixDirty=!0)}},geoRotationY:{get:function(){return this.rotationY},set:function(e){"number"==typeof e&&(this.rotationY=e,this._isMatrixDirty=!0)}},geoRotationZ:{get:function(){return this.rotationZ},set:function(e){"number"==typeof e&&(this.rotationZ=e,this._isMatrixDirty=!0)}},geoScaleX:{get:function(){return this.scaleX},set:function(e){"number"==typeof e&&(this.scaleX=e,this._isMatrixDirty=!0)}},geoScaleY:{get:function(){return this.scaleY},set:function(e){"number"==typeof e&&(this.scaleY=e,this._isMatrixDirty=!0)}},geoScaleZ:{get:function(){return this.scaleZ},set:function(e){"number"==typeof e&&(this.scaleZ=e,this._isMatrixDirty=!0)}},geoId:{get:function(){return this.id},set:function(e){"number"==typeof e&&(this.id=e,this._isMatrixDirty=!0)}},geoType:{get:function(){return this.type},set:function(e){"number"==typeof e&&(this.type=e)}},geoPosition:{get:function(){return this.position},set:function(e){e instanceof s$q&&!s$q.equals(e,this.position)&&(this.position=e,this._isMatrixDirty=!0,this._isGeometryDirty=!0)}},modelMatrix:{get:function(){return this._isMatrixDirty&&this._computeMatrix(),this._modelMatrix}},isGeometryDirty:{get:function(){return this._isGeometryDirty},set:function(e){this._isGeometryDirty=e}},isLatLon:{get:function(){return this._isLatLon},set:function(e){this._isLatLon=e}}}),o$M.prototype.init=function(e){e=e||{},this.rotationX=u$Y(e.rotationX,0),this.rotationY=u$Y(e.rotationY,0),this.rotationZ=u$Y(e.rotationZ,0),this.scaleX=u$Y(e.scaleX,1),this.scaleY=u$Y(e.scaleY,1),this.scaleZ=u$Y(e.scaleZ,1),this.position=u$Y(e.position,new s$q(0,0,0)),this.id=u$Y(e.id,0),this.type=u$Y(e.type,P$v.UNKNOWN),this.point3Ds=[],this.parts=[],this._geometry=void 0,this._modelMatrix=new y$15(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this._isMatrixDirty=!0,this._isGeometryDirty=!0,this._isLatLon=!0},o$M.prototype.getBounds=function(){return null},o$M.prototype._getGeometry=function(){return(!e$28(this._geometry)||this._isGeometryDirty)&&this._createGeometry(),this._geometry},o$M.prototype._computeMatrix=function(){if(this._isLatLon){var e=t$X.fromDegrees(this.position.x,this.position.y,this.position.z),t=e$27.toRadians(this.rotationX),i=e$27.toRadians(this.rotationY),r=new i$10(e$27.toRadians(this.rotationZ),t,i),n=new t$X(this.scaleX,this.scaleY,this.scaleZ),o=new n$14,a=new y$15,s=n$14.fromHeadingPitchRoll(r,o),l=y$15.fromTranslationQuaternionRotationScale(t$X.ZERO,s,n,a);if(this._modelMatrix=m$1b.eastNorthUpToFixedFrame(e,t$V.WGS84,this._modelMatrix),"GEOCONE"===this.type&&this._rotateOrigin===O$r.APEX){var u,c,h;if(l=y$15.fromTranslationQuaternionRotationScale(t$X.ZERO,s,new t$X(1,1,1),a),!e$28(this._vertex))return void(this._isMatrixDirty=!1);var d=new y$15;y$15.inverse(this._modelMatrix,d);var f=y$15.clone(this._modelMatrix),p=new y$15;y$15.fromScale(n,p);var _=y$15.multiplyByPoint(d,this._vertex,new t$X);_=y$15.multiplyByPoint(p,_,new t$X),_=y$15.multiplyByPoint(f,_,new t$X);var m=t$X.subtract(_,e,new t$X);u=y$15.fromTranslation(m),y$15.multiply(u,this._modelMatrix,this._modelMatrix),y$15.multiply(l,this._modelMatrix,this._modelMatrix),y$15.multiplyByScale(this._modelMatrix,n,this._modelMatrix),h=y$15.multiplyByPoint(u,_,new t$X),h=y$15.multiplyByPoint(l,h,new t$X);var $=t$X.subtract(_,h,new t$X);c=y$15.fromTranslation($),y$15.multiply(c,this._modelMatrix,this._modelMatrix)}else y$15.multiply(this._modelMatrix,l,this._modelMatrix)}else{e=new t$X(this.position.x,this.position.y,this.position.z);y$15.fromTranslation(e,this._modelMatrix,this._modelMatrix)}this._isMatrixDirty=!1},o$M.prototype._createGeometry=function(){},o$M.prototype._getVertexBuffer=function(e){let t=this._getGeometry();return(!e$28(this._vertexBuffer)||this._vertexBuffer.isDestroyed())&&(this._vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:S$W.createTypedArray(S$W.FLOAT,t.attributes.position.values),usage:A$1c.STATIC_DRAW})),this._vertexBuffer},o$M.prototype.getVertexArray=function(e){let t=this._getGeometry(),i=[];i.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1});var r=t.attributes.normal;e$28(r)&&T$q(i,r,1,e);var n=t.attributes.st;return e$28(n)&&T$q(i,n,2,e),new m$19({context:e,attributes:i,indexBuffer:h$W.createIndexBuffer({context:e,typedArray:t.indices,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})})},o$M.prototype.getOutlineVertexArray=function(e){};var A$I={id:void 0};function _$w(e){if(e._firing)e._refire=!0;else if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;if(0!==r.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=i.values.slice(0),a=r.values.slice(0);t.removeAll(),i.removeAll(),r.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function r$z(e){this._owner=e,this._entities=new e$1P,this._addedEntities=new e$1P,this._removedEntities=new e$1P,this._changedEntities=new e$1P,this._suspendCount=0,this._collectionChanged=new o$1o,this._id=e$1K(),this._show=!0,this._firing=!1,this._refire=!1}function b$E(e){if(e$28(e.box))return{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z+e.height/2),box:{dimensions:new t$X(e.box.dimensions.x,e.box.dimensions.y,e.box.dimensions.z),material:new e$1S(0,0,1,.2)}};if(e$28(e.cylinder))return{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z+e.height/2),cylinder:{length:e.cylinder.length,topRadius:e.cylinder.topRadius,bottomRadius:e.cylinder.bottomRadius,material:new e$1S(0,0,1,.2)}};if(e$28(e.billboard))return{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z+e.height/2),billboard:{image:e.imagePath,width:e.width,height:e.height}};if(e$28(e.ellipsoid))return e$28(e.radius)?{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z+e.radius),ellipsoid:{radii:new t$X(e.radius,e.radius,e.radius),material:new e$1S(0,0,1,.2)}}:{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z+e.yAxis),ellipsoid:{radii:new t$X(e.ellipsoid.radii.x,e.ellipsoid.radii.y,e.ellipsoid.radii.z),material:new e$1S(0,0,1,.2)}};if(e$28(e.polygon))return{polygon:{hierarchy:e.polygon.points,material:new e$1S(1,0,0,.1),extrudedHeight:e.polygon.extrudedHeight,perPositionHeight:e.polygon.perPositionHeight,height:e.polygon.height}};if(e$28(e.polyline)){for(var t=[],i=0,r=e.polyline.positions.length;i<r;++i)t.push(t$X.fromDegrees(e.polyline.positions[i].x,e.polyline.positions[i].y,e.polyline.positions[i].z));return{polyline:{positions:t,width:5,material:new e$1S(1,0,0,1)}}}return e$28(e.ellipse)?{position:t$X.fromDegrees(e.position.x,e.position.y,e.position.z),ellipse:{semiMinorAxis:e.ellipse.semiMinorAxis,semiMajorAxis:e.ellipse.semiMajorAxis,height:e.position.z,material:new e$1S(0,0,1,.2)}}:"POINT3D"===e.type?{position:t$X.fromDegrees(e.x,e.y,e.z),point:new n$z({color:new e$1S(1,1,0),pixelSize:10,outlineColor:new e$1S(0,1,1)})}:{}}r$z.prototype.suspendEvents=function(){this._suspendCount++},r$z.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new t$Z("resumeEvents can not be called before suspendEvents.");this._suspendCount--,_$w(this)},r$z.collectionChangedEventCallback=void 0,Object.defineProperties(r$z.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");if(e!==this._show){this.suspendEvents();var t,i=[],r=this._entities.values,n=r.length;for(t=0;t<n;t++)i.push(r[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=i[t],a=r[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),r$z.prototype.computeAvailability=function(){for(var e=o$11.MAXIMUM_VALUE,t=o$11.MINIMUM_VALUE,i=this._entities.values,r=0,n=i.length;r<n;r++){var o=i[r].availability;if(e$28(o)){var a=o.start,s=o.stop;a$12.lessThan(a,e)&&!a.equals(o$11.MINIMUM_VALUE)&&(e=a),a$12.greaterThan(s,t)&&!s.equals(o$11.MAXIMUM_VALUE)&&(t=s)}}return o$11.MAXIMUM_VALUE.equals(e)&&(e=o$11.MINIMUM_VALUE),o$11.MINIMUM_VALUE.equals(t)&&(t=o$11.MAXIMUM_VALUE),new d$_({start:e,stop:t})},r$z.prototype.add=function(e){if(!e$28(e))throw new t$Z("entity is required.");e instanceof o$M&&(e=b$E(e)),e instanceof h$F||(e=new h$F(e));var t=e.id,i=this._entities;if(i.contains(t))throw new t$U("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(r$z.prototype._onEntityDefinitionChanged,this),_$w(this),e},r$z.prototype.remove=function(e){return!!e$28(e)&&this.removeById(e.id)},r$z.prototype.contains=function(e){if(!e$28(e))throw new t$Z("entity is required");return!!e$28(e.id)&&this._entities.get(e.id)===e},r$z.prototype.removeById=function(e){if(!e$28(e))return!1;var t=this._entities.get(e);return!!this._entities.remove(e)&&(e$28(t._polygon)&&e$28(t._polygon.outlines)&&t._polygon.outlines.removeAll(),e$28(t._polygon)&&e$28(t._polygon.clampOutlines)&&t.entityCollection._owner._entityCluster._scene._primitives.remove(t._polygon.clampOutlines),this._addedEntities.remove(e)||(this._removedEntities.set(e,t),this._changedEntities.remove(e)),this._entities.remove(e),t.definitionChanged.removeEventListener(r$z.prototype._onEntityDefinitionChanged,this),_$w(this),!0)},r$z.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,r=this._addedEntities,n=this._removedEntities,o=0;o<t;o++){var a=i[o];e$28(a._polygon)&&e$28(a._polygon.outlines)&&a._polygon.outlines.removeAll(),e$28(a._polygon)&&e$28(a._polygon.clampOutlines)&&a.entityCollection._owner._entityCluster._scene._primitives.remove(a._polygon.clampOutlines);var s=a.id;e$28(r.get(s))||(a.definitionChanged.removeEventListener(r$z.prototype._onEntityDefinitionChanged,this),n.set(s,a))}e.removeAll(),r.removeAll(),this._changedEntities.removeAll(),_$w(this)},r$z.prototype.getById=function(e){if(!e$28(e))throw new t$Z("id is required.");return this._entities.get(e)},r$z.prototype.getOrCreateEntity=function(e){if(!e$28(e))throw new t$Z("id is required.");var t=this._entities.get(e);return e$28(t)||(A$I.id=e,t=new h$F(A$I),this.add(t)),t},r$z.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),_$w(this)};var w$n={id:void 0},C$v=new Array(2);function x$E(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0;e._name=void 0,e._availability=void 0}function A$H(e,t,i,r){C$v[0]=i,C$v[1]=r.id,t[JSON.stringify(C$v)]=r.definitionChanged.addEventListener(s$p.prototype._onDefinitionChanged,e)}function T$p(e,t,i,r){C$v[0]=i,C$v[1]=r.id;var n=JSON.stringify(C$v);t[n](),t[n]=void 0}function g$t(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var t,i,r,n,o,a,s=e._collections,l=s.length,u=e._collectionsCopy,c=u.length,h=e._composite,d=new r$z(e),f=e._eventHash;for(t=0;t<c;t++)for((o=u[t]).collectionChanged.removeEventListener(s$p.prototype._onCollectionChanged,e),r=o.values,a=o.id,n=r.length-1;n>-1;n--)T$p(e,f,a,i=r[n]);for(t=l-1;t>=0;t--)for((o=s[t]).collectionChanged.addEventListener(s$p.prototype._onCollectionChanged,e),r=o.values,a=o.id,n=r.length-1;n>-1;n--){A$H(e,f,a,i=r[n]);var p=d.getById(i.id);e$28(p)||(e$28(p=h.getById(i.id))?x$E(p):(w$n.id=i.id,p=new h$F(w$n)),d.add(p)),p.merge(i)}e._collectionsCopy=s.slice(0),h.suspendEvents(),h.removeAll();var _=d.values;for(t=0;t<_.length;t++)h.add(_[t]);h.resumeEvents()}}function s$p(e,t){this._owner=t,this._composite=new r$z(this),this._suspendCount=0,this._collections=e$28(e)?e.slice():[],this._collectionsCopy=[],this._id=e$1K(),this._eventHash={},g$t(this),this._shouldRecomposite=!1}function E$A(e,t){if(!e$28(t))throw new t$Z("collection is required.");var i=e.indexOf(t);if(-1===i)throw new t$Z("collection is not in this composite.");return i}function q$x(e,t,i){var r=e._collections;if((t=e$27.clamp(t,0,r.length-1))!==(i=e$27.clamp(i,0,r.length-1))){var n=r[t];r[t]=r[i],r[i]=n,g$t(e)}}function c$x(e,t,i,r){function n(){i.raiseEvent(e)}var o=[];t.removeAll();for(var a=r.length,s=0;s<a;s++){var l=r.get(s);e$28(l.data)&&-1===o.indexOf(l.data)&&t.add(l.data.definitionChanged,n)}}function e$L(){this._eventHelper=new n$R,this._definitionChanged=new o$1o,this._intervals=new c$L,this._intervals.changedEvent.addEventListener(e$L.prototype._intervalsChanged,this)}function e$K(){this._definitionChanged=new o$1o,this._composite=new e$L,this._composite.definitionChanged.addEventListener(e$K.prototype._raiseDefinitionChanged,this)}function t$q(e){this._referenceFrame=u$Y(e,Re$j.FIXED),this._definitionChanged=new o$1o,this._composite=new e$L,this._composite.definitionChanged.addEventListener(t$q.prototype._raiseDefinitionChanged,this)}Object.defineProperties(s$p.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),s$p.prototype.addCollection=function(e,t){var i=e$28(t);if(!e$28(e))throw new t$Z("collection is required.");if(i){if(t<0)throw new t$Z("index must be greater than or equal to zero.");if(t>this._collections.length)throw new t$Z("index must be less than or equal to the number of collections.")}i?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),g$t(this)},s$p.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t&&(this._collections.splice(t,1),g$t(this),!0)},s$p.prototype.removeAllCollections=function(){this._collections.length=0,g$t(this)},s$p.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},s$p.prototype.contains=function(e){return this._composite.contains(e)},s$p.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},s$p.prototype.getCollection=function(e){if(!e$28(e))throw new t$Z("index is required.","index");return this._collections[e]},s$p.prototype.getCollectionsLength=function(){return this._collections.length},s$p.prototype.raiseCollection=function(e){var t=E$A(this._collections,e);q$x(this,t,t+1)},s$p.prototype.lowerCollection=function(e){var t=E$A(this._collections,e);q$x(this,t,t-1)},s$p.prototype.raiseCollectionToTop=function(e){var t=E$A(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),g$t(this))},s$p.prototype.lowerCollectionToBottom=function(e){var t=E$A(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),g$t(this))},s$p.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},s$p.prototype.resumeEvents=function(){if(0===this._suspendCount)throw new t$Z("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(g$t(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},s$p.prototype.computeAvailability=function(){return this._composite.computeAvailability()},s$p.prototype.getById=function(e){return this._composite.getById(e)},s$p.prototype._onCollectionChanged=function(e,t,i){var r=this._collectionsCopy,n=r.length,o=this._composite;o.suspendEvents();var a,s,l,u,c=i.length,h=this._eventHash,d=e.id;for(a=0;a<c;a++){var f=i[a];T$p(this,h,d,f);var p=f.id;for(s=n-1;s>=0;s--)e$28(l=r[s].getById(p))&&(e$28(u)||x$E(u=o.getById(p)),u.merge(l));e$28(u)||o.removeById(p),u=void 0}var _=t.length;for(a=0;a<_;a++){var m=t[a];A$H(this,h,d,m);var $=m.id;for(s=n-1;s>=0;s--)e$28(l=r[s].getById($))&&(e$28(u)||(e$28(u=o.getById($))?x$E(u):(w$n.id=$,u=new h$F(w$n),o.add(u))),u.merge(l));u=void 0}o.resumeEvents()},s$p.prototype._onDefinitionChanged=function(e,t,i,r){for(var n=this._collections,o=this._composite,a=n.length,s=e.id,l=o.getById(s),u=l[t],c=!e$28(u),h=!0,d=a-1;d>=0;d--){var f=n[d].getById(e.id);if(e$28(f)){var p=f[t];if(e$28(p)){if(h){if(h=!1,!e$28(p.merge)||!e$28(p.clone)){u=p;break}u=p.clone(u)}u.merge(p)}}}c&&-1===l.propertyNames.indexOf(t)&&l.addProperty(t),l[t]=u},Object.defineProperties(e$L.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),e$L.prototype.getValue=function(e,t){if(!e$28(e))throw new t$Z("time is required");var i=this._intervals.findDataForIntervalContainingDate(e);if(e$28(i))return i.getValue(e,t)},e$L.prototype.equals=function(e){return this===e||e instanceof e$L&&this._intervals.equals(e._intervals,r$K.equals)},e$L.prototype._intervalsChanged=function(){c$x(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},Object.defineProperties(e$K.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),e$K.prototype.getType=function(e){if(!e$28(e))throw new t$Z("time is required");var t=this._composite._intervals.findDataForIntervalContainingDate(e);if(e$28(t))return t.getType(e)},e$K.prototype.getValue=function(e,t){if(!e$28(e))throw new t$Z("time is required");var i=this._composite._intervals.findDataForIntervalContainingDate(e);if(e$28(i))return i.getValue(e,t)},e$K.prototype.equals=function(e){return this===e||e instanceof e$K&&this._composite.equals(e._composite,r$K.equals)},e$K.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(t$q.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),t$q.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},t$q.prototype.getValueInReferenceFrame=function(e,t,i){if(!e$28(e))throw new t$Z("time is required.");if(!e$28(t))throw new t$Z("referenceFrame is required.");var r=this._composite._intervals.findDataForIntervalContainingDate(e);if(e$28(r))return r.getValueInReferenceFrame(e,t,i)},t$q.prototype.equals=function(e){return this===e||e instanceof t$q&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,r$K.equals)},t$q.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var N$r=new e$1d(0);function i$v(e){i$F.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}e$28(Object.create)&&(i$v.prototype=Object.create(i$F.prototype),i$v.prototype.constructor=i$v),Object.defineProperties(i$v.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),i$v.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!e$28(t.height)&&!e$28(t.extrudedHeight)&&d$Q.isSupported(this._scene)},i$v.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight;return 0===t||e$28(i)&&i!==t},i$v.prototype._computeCenter=t$Z.throwInstantiationError,i$v.prototype._onEntityPropertyChanged=function(e,t,i,r){if(i$F.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(e$28(n)){e$28(n.zIndex)&&(e$28(n.height)||e$28(n.extrudedHeight))&&e$1$(e$1$.geometryZIndex),this._zIndex=u$Y(n.zIndex,N$r),e$28(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var o=n.heightReference,a=n.extrudedHeightReference;if(e$28(o)||e$28(a)){var s=new n$G(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new h$E(this._scene,s,o,a)}}}},i$v.prototype.destroy=function(){e$28(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),i$F.prototype.destroy.call(this)},i$v.getGeometryHeight=function(e,t){if(o$1u.defined("heightReference",t),e$28(e))return t!==k$_.CLAMP_TO_GROUND?e:0;t!==k$_.NONE&&e$1$(e$1$.geometryHeightReference)},i$v.getGeometryExtrudedHeight=function(e,t){if(o$1u.defined("extrudedHeightReference",t),e$28(e))return t!==k$_.CLAMP_TO_GROUND?e:i$v.CLAMP_TO_GROUND;t!==k$_.NONE&&e$1$(e$1$.geometryExtrudedHeightReference)},i$v.CLAMP_TO_GROUND="clamp",i$v.computeGeometryOffsetAttribute=function(e,t,i,r){(!e$28(e)||!e$28(t))&&(t=k$_.NONE),(!e$28(i)||!e$28(r))&&(r=k$_.NONE);var n=0;return t!==k$_.NONE&&n++,r===k$_.RELATIVE_TO_GROUND&&n++,2===n?ee$C.ALL:1===n?ee$C.TOP:void 0};var H$x=new e$1S,I$P=t$X.ZERO,D$C=new t$X,G$D=new h$10;function T$o(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function f$A(e,t){i$v.call(this,{entity:e,scene:t,geometryOptions:new T$o(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function l$G(e,t,i){a$L.call(this,e,t,i)}function o$L(){t$Z.throwInstantiationError()}function s$o(e,t){if(e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new t$Z("disableDepthTestDistance must be greater than or equal to 0.0.");var i=e.translucencyByDistance,r=e.scaleByDistance,n=e.distanceDisplayCondition;if(e$28(i)){if(i.far<=i.near)throw new t$Z("translucencyByDistance.far must be greater than translucencyByDistance.near.");i=o$1b.clone(i)}if(e$28(r)){if(r.far<=r.near)throw new t$Z("scaleByDistance.far must be greater than scaleByDistance.near.");r=o$1b.clone(r)}if(e$28(n)){if(n.far<=n.near)throw new t$Z("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");n=r$10.clone(n)}this._show=u$Y(e.show,!0),this._position=t$X.clone(u$Y(e.position,t$X.ZERO)),this._actualPosition=t$X.clone(this._position),this._color=e$1S.clone(u$Y(e.color,e$1S.WHITE)),this._outlineColor=e$1S.clone(u$Y(e.outlineColor,e$1S.TRANSPARENT)),this._outlineWidth=u$Y(e.outlineWidth,0),this._pixelSize=u$Y(e.pixelSize,10),this._scaleByDistance=r,this._translucencyByDistance=i,this._distanceDisplayCondition=n,this._disableDepthTestDistance=u$Y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=u$Y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}e$28(Object.create)&&(f$A.prototype=Object.create(i$v.prototype),f$A.prototype.constructor=f$A),f$A.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n={show:new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,H$x)),e$28(t)||(t=e$1S.WHITE),n.color=o$18.fromColor(t));return e$28(this._options.offsetAttribute)&&(n.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,I$P,D$C))),new d$15({id:i,geometry:new P$U(this._options),attributes:n})},f$A.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,H$x),n={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return e$28(this._options.offsetAttribute)&&(n.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,I$P,D$C))),new d$15({id:t,geometry:new V$K(this._options),attributes:n})},f$A.prototype._computeCenter=function(e,t){var i=r$K.getValueOrUndefined(this._entity.corridor.positions,e);if(e$28(i)&&0!==i.length)return t$X.clone(i[Math.floor(i.length/2)],t)},f$A.prototype._isHidden=function(e,t){return!e$28(t.positions)||!e$28(t.width)||i$F.prototype._isHidden.call(this,e,t)},f$A.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!r$K.isConstant(t.height)||!r$K.isConstant(t.extrudedHeight)||!r$K.isConstant(t.granularity)||!r$K.isConstant(t.width)||!r$K.isConstant(t.outlineWidth)||!r$K.isConstant(t.cornerType)||!r$K.isConstant(t.zIndex)||this._onTerrain&&!r$K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof t$z)},f$A.prototype._setStaticOptions=function(e,t){var i=r$K.getValueOrUndefined(t.height,o$11.MINIMUM_VALUE),r=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),n=r$K.getValueOrUndefined(t.extrudedHeight,o$11.MINIMUM_VALUE),o=r$K.getValueOrDefault(t.extrudedHeightReference,o$11.MINIMUM_VALUE,k$_.NONE);e$28(n)&&!e$28(i)&&(i=0);var a=this._options;a.vertexFormat=this._materialProperty instanceof t$z?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(o$11.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(o$11.MINIMUM_VALUE),a.granularity=r$K.getValueOrUndefined(t.granularity,o$11.MINIMUM_VALUE),a.cornerType=r$K.getValueOrUndefined(t.cornerType,o$11.MINIMUM_VALUE),a.offsetAttribute=i$v.computeGeometryOffsetAttribute(i,r,n,o),a.height=i$v.getGeometryHeight(i,r),(n=i$v.getGeometryExtrudedHeight(n,o))===i$v.CLAMP_TO_GROUND&&(n=e$1_.getMinimumMaximumHeights(P$U.computeRectangle(a,G$D)).minimumTerrainHeight),a.extrudedHeight=n},f$A.DynamicGeometryUpdater=l$G,e$28(Object.create)&&(l$G.prototype=Object.create(a$L.prototype),l$G.prototype.constructor=l$G),l$G.prototype._isHidden=function(e,t,i){var r=this._options;return!e$28(r.positions)||!e$28(r.width)||a$L.prototype._isHidden.call(this,e,t,i)},l$G.prototype._setOptions=function(e,t,i){var r=this._options,n=r$K.getValueOrUndefined(t.height,i),o=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),a=r$K.getValueOrUndefined(t.extrudedHeight,i),s=r$K.getValueOrDefault(t.extrudedHeightReference,i,k$_.NONE);e$28(a)&&!e$28(n)&&(n=0),r.positions=r$K.getValueOrUndefined(t.positions,i),r.width=r$K.getValueOrUndefined(t.width,i),r.granularity=r$K.getValueOrUndefined(t.granularity,i),r.cornerType=r$K.getValueOrUndefined(t.cornerType,i),r.offsetAttribute=i$v.computeGeometryOffsetAttribute(n,o,a,s),r.height=i$v.getGeometryHeight(n,o),(a=i$v.getGeometryExtrudedHeight(a,s))===i$v.CLAMP_TO_GROUND&&(a=e$1_.getMinimumMaximumHeights(P$U.computeRectangle(r,G$D)).minimumTerrainHeight),r.extrudedHeight=a},Object.defineProperties(o$L.prototype,{name:{get:t$Z.throwInstantiationError},clock:{get:t$Z.throwInstantiationError},entities:{get:t$Z.throwInstantiationError},isLoading:{get:t$Z.throwInstantiationError},changedEvent:{get:t$Z.throwInstantiationError},errorEvent:{get:t$Z.throwInstantiationError},loadingEvent:{get:t$Z.throwInstantiationError},show:{get:t$Z.throwInstantiationError},clustering:{get:t$Z.throwInstantiationError}}),o$L.prototype.update=t$Z.throwInstantiationError,o$L.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var I$O=s$o.SHOW_INDEX=0,C$u=s$o.POSITION_INDEX=1,g$s=s$o.COLOR_INDEX=2,O$q=s$o.OUTLINE_COLOR_INDEX=3,b$D=s$o.OUTLINE_WIDTH_INDEX=4,q$w=s$o.PIXEL_SIZE_INDEX=5,A$G=s$o.SCALE_BY_DISTANCE_INDEX=6,X$l=s$o.TRANSLUCENCY_BY_DISTANCE_INDEX=7,x$D=s$o.DISTANCE_DISPLAY_CONDITION_INDEX=8,L$z=s$o.DISABLE_DEPTH_DISTANCE_INDEX=9;function c$w(e,t){var i=e._pointPrimitiveCollection;e$28(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}s$o.NUMBER_OF_PROPERTIES=10,Object.defineProperties(s$o.prototype,{show:{get:function(){return this._show},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._show!==e&&(this._show=e,c$w(this,I$O))}},position:{get:function(){return this._position},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._position;t$X.equals(t,e)||(t$X.clone(e,t),t$X.clone(e,this._actualPosition),c$w(this,C$u))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._scaleByDistance;o$1b.equals(t,e)||(this._scaleByDistance=o$1b.clone(e,t),c$w(this,A$G))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far distance must be greater than near distance.");var t=this._translucencyByDistance;o$1b.equals(t,e)||(this._translucencyByDistance=o$1b.clone(e,t),c$w(this,X$l))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._pixelSize!==e&&(this._pixelSize=e,c$w(this,q$w))}},color:{get:function(){return this._color},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._color;e$1S.equals(t,e)||(e$1S.clone(e,t),c$w(this,g$s))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");var t=this._outlineColor;e$1S.equals(t,e)||(e$1S.clone(e,t),c$w(this,O$q))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,c$w(this,b$D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(e$28(e)&&e.far<=e.near)throw new t$Z("far must be greater than near");r$10.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=r$10.clone(e,this._distanceDisplayCondition),c$w(this,x$D))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!e$28(e)||e<0)throw new t$Z("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,c$w(this,L$z)}}},id:{get:function(){return this._id},set:function(e){this._id=e,e$28(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,c$w(this,I$O))}}}),s$o.prototype.getPickId=function(e){return e$28(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},s$o.prototype._getActualPosition=function(){return this._actualPosition},s$o.prototype._setActualPosition=function(e){t$X.clone(e,this._actualPosition),c$w(this,C$u)};var m$x=new e$25;s$o._computeActualPosition=function(e,t,i){return t.mode===P$$.SCENE3D?e:(y$15.multiplyByPoint(i,e,m$x),m$W.computeActualWgs84Position(t,m$x))};var E$z=new e$25;s$o._computeScreenSpacePosition=function(e,t,i,r){var n=y$15.multiplyByVector(e,e$25.fromElements(t.x,t.y,t.z,1,E$z),E$z);return m$W.wgs84ToWindowCoordinates(i,n,r)},s$o.prototype.computeScreenSpacePosition=function(e,t){var i=this._pointPrimitiveCollection;if(e$28(t)||(t=new o$1k),!e$28(i))throw new t$Z("PointPrimitive must be in a collection.");if(!e$28(e))throw new t$Z("scene is required.");var r=i.modelMatrix,n=s$o._computeScreenSpacePosition(r,this._actualPosition,e,t);if(e$28(n))return n.y=e.canvas.clientHeight-n.y,n},s$o.getScreenSpaceBoundingBox=function(e,t,i){var r=e.pixelSize,n=.5*r,o=t.x-n,a=t.y-n,s=r,l=r;return e$28(i)||(i=new f$10),i.x=o,i.y=a,i.width=s,i.height=l,i},s$o.prototype.equals=function(e){return this===e||e$28(e)&&this._id===e._id&&t$X.equals(this._position,e._position)&&e$1S.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&e$1S.equals(this._outlineColor,e._outlineColor)&&o$1b.equals(this._scaleByDistance,e._scaleByDistance)&&o$1b.equals(this._translucencyByDistance,e._translucencyByDistance)&&r$10.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},s$o.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var X$k="varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\ngl_FragColor = czm_gammaCorrect(color);\nczm_writeLogDepth();\n}\n",xe$g="uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_pixelRatio;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0, 0.0, 1.0);\n}\n#endif\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(vec4(czm_currentFrustum.x));\n#endif\n}\n}\n#endif\nv_color = color;\nv_color.a *= translucency * show;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency * show;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize * show;\ngl_Position *= show;\nv_pickColor = pickColor;\n}\n",Pe$b=s$o.SHOW_INDEX,Z$t=s$o.POSITION_INDEX,de$g=s$o.COLOR_INDEX,Le$e=s$o.OUTLINE_COLOR_INDEX,Be$f=s$o.OUTLINE_WIDTH_INDEX,Ve$e=s$o.PIXEL_SIZE_INDEX,_e$c=s$o.SCALE_BY_DISTANCE_INDEX,pe$j=s$o.TRANSLUCENCY_BY_DISTANCE_INDEX,le$h=s$o.DISTANCE_DISPLAY_CONDITION_INDEX,Ue$e=s$o.DISABLE_DEPTH_DISTANCE_INDEX,q$v=s$o.NUMBER_OF_PROPERTIES,p$y={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function D$B(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(q$v),this._maxPixelSize=1,this._baseVolume=new i$19,this._baseVolumeWC=new i$19,this._baseVolume2D=new i$19,this._boundingVolume=new i$19,this._boundingVolumeDirty=!1,this._colorCommands=[],this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(y$15.IDENTITY),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.blendOption=u$Y(e.blendOption,S$s.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=P$$.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW,A$1c.STATIC_DRAW];var t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}},this.depthTestEnabled=u$Y(e.depthTestEnabled,!0)}function ue$e(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function J$z(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function we$d(e,t,i){return new f$G(e,[{index:p$y.positionHighAndSize,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Z$t]},{index:p$y.positionLowAndShow,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[Z$t]},{index:p$y.compressedAttribute0,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[de$g]},{index:p$y.compressedAttribute1,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[pe$j]},{index:p$y.scaleByDistance,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:i[_e$c]},{index:p$y.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,usage:i[le$h]}],t)}Object.defineProperties(D$B.prototype,{length:{get:function(){return J$z(this),this._pointPrimitives.length}}}),D$B.prototype.add=function(e){var t=new s$o(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},D$B.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},D$B.prototype.removeAll=function(){ue$e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},D$B.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},D$B.prototype.contains=function(e){return e$28(e)&&e._pointPrimitiveCollection===this},D$B.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return J$z(this),this._pointPrimitives[e]},D$B.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<q$v;++r){var n=0===i[r]?A$1c.STATIC_DRAW:A$1c.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var K$q=new i$Q;function ce$g(e,t,i,r){var n=r._index,o=r._getActualPosition();e._mode===P$$.SCENE3D&&(i$19.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),i$Q.fromCartesian(o,K$q);var a=r.pixelSize,s=r.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);var l=i[p$y.positionHighAndSize],u=K$q.high;l(n,u.x,u.y,u.z,a);var c=i[p$y.positionLowAndOutline],h=K$q.low;c(n,h.x,h.y,h.z,s)}var W$w=65536,B$l=256;function fe$f(e,t,i,r){var n=r._index,o=r.color,a=r.getPickId(t).color,s=r.outlineColor,l=e$1S.floatToByte(o.red),u=e$1S.floatToByte(o.green),c=e$1S.floatToByte(o.blue),h=l*W$w+u*B$l+c;l=e$1S.floatToByte(s.red),u=e$1S.floatToByte(s.green),c=e$1S.floatToByte(s.blue);var d=l*W$w+u*B$l+c;l=e$1S.floatToByte(a.red),u=e$1S.floatToByte(a.green),c=e$1S.floatToByte(a.blue);var f=l*W$w+u*B$l+c,p=e$1S.floatToByte(o.alpha)*W$w+e$1S.floatToByte(s.alpha)*B$l+e$1S.floatToByte(a.alpha);(0,i[p$y.compressedAttribute0])(n,h,d,f,p)}function me$i(e,t,i,r){var n=r._index,o=0,a=1,s=1,l=1,u=r.translucencyByDistance;e$28(u)&&(o=u.near,a=u.nearValue,s=u.far,l=u.farValue,(1!==a||1!==l)&&(e._shaderTranslucencyByDistance=!0));var c=r.show&&r.clusterShow;0===r.color.alpha&&0===r.outlineColor.alpha&&(c=!1),a=e$27.clamp(a,0,1);var h=(c?1:0)*B$l+(a=1===a?255:255*a|0),d=l=1===(l=e$27.clamp(l,0,1))?255:255*l|0;(0,i[p$y.compressedAttribute1])(n,h,d,o,s)}function De$h(e,t,i,r){var n=r._index,o=i[p$y.scaleByDistance],a=0,s=1,l=1,u=1,c=r.scaleByDistance;e$28(c)&&(a=c.near,s=c.nearValue,l=c.far,u=c.farValue,(1!==s||1!==u)&&(e._shaderScaleByDistance=!0)),o(n,a,s,l,u)}function ve$c(e,t,i,r){var n=r._index,o=i[p$y.distanceDisplayConditionAndDisableDepth],a=0,s=Number.MAX_VALUE,l=r.distanceDisplayCondition;e$28(l)&&(a=l.near,s=l.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);var u=r.disableDepthTestDistance;(u*=u)>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1)),o(n,a,s,u)}function Re$a(e,t,i,r){ce$g(e,t,i,r),fe$f(e,t,i,r),me$i(e,t,i,r),De$h(e,t,i,r),ve$c(e,t,i,r)}function $$t(e,t,i,r,n,o){var a;r.mode===P$$.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;for(var s=[],l=0;l<i;++l){var u=t[l],c=u.position,h=s$o._computeActualPosition(c,r,n);e$28(h)&&(u._setActualPosition(h),o?s.push(h):i$19.expand(a,h,a))}o&&i$19.fromPoints(s,a)}function Me$d(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P$$.SCENE3D&&!y$15.equals(o,e.modelMatrix)?(e._mode=i,y$15.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P$$.SCENE3D||i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&$$t(e,r,r.length,t,o,!0)):i===P$$.MORPHING?$$t(e,r,r.length,t,o,!0):(i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&$$t(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function Xe$6(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;i.radius+=r}var We$b=[];function a$v(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._enabled=u$Y(e.enabled,!1),this._pixelRange=u$Y(e.pixelRange,80),this._minimumClusterSize=u$Y(e.minimumClusterSize,1),this._clusterBillboards=u$Y(e.clusterBillboards,!0),this._clusterLabels=u$Y(e.clusterLabels,!0),this._clusterPoints=u$Y(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 o$1o}function ci$4(e){return e.coord.x}function di$3(e){return e.coord.y}function Z$s(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}D$B.prototype.update=function(e){if(e.multiViewportIndex>-1&&this._pointPrimitives.length>0&&e$28(this._pointPrimitives[0])&&e$28(this._pointPrimitives[0].id)&&e$28(this._pointPrimitives[0].id.entityCollection)&&e$28(this._pointPrimitives[0].id.entityCollection.owner)){var t=this._pointPrimitives[0].id.entityCollection.owner;if(typeof t.getVisibleInViewport<"u")if(!t.getVisibleInViewport(e.multiViewportIndex))return}J$z(this),this._maxTotalPointSize=e$1U.maximumAliasedPointSize,Me$d(this,e);var i,r=this._pointPrimitives.length,n=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,a=this._propertiesChanged,s=this._createVertexArray,l=e.context,u=e.passes,c=u.pick;if(s||!c&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var h=0;h<q$v;++h)a[h]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=we$d(l,r,this._buffersUsage),i=this._vaf.writers;for(var d=0;d<r;++d){var f=this._pointPrimitives[d];f._dirty=!1,Re$a(this,l,i,f)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){var p=We$b;p.length=0,(a[Z$t]||a[Be$f]||a[Ve$e])&&p.push(ce$g),(a[de$g]||a[Le$e])&&p.push(fe$f),(a[Pe$b]||a[pe$j])&&p.push(me$i),a[_e$c]&&p.push(De$h),(a[le$h]||a[Ue$e])&&p.push(ve$c);var _=p.length;if(i=this._vaf.writers,o/r>.1){for(var m=0;m<o;++m){var $=n[m];$._dirty=!1;for(var g=0;g<_;++g)p[g](this,l,i,$)}this._vaf.commit()}else{for(var v=0;v<o;++v){var y=n[v];y._dirty=!1;for(var x=0;x<_;++x)p[x](this,l,i,y);this._vaf.subCommit(y._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>1.5*r&&(n.length=r),e$28(this._vaf)&&e$28(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,i$19.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var b,w=y$15.IDENTITY;e.mode===P$$.SCENE3D?(w=this.modelMatrix,b=i$19.clone(this._baseVolumeWC,this._boundingVolume)):b=i$19.clone(this._baseVolume2D,this._boundingVolume),Xe$6(this,e,b);var C,T,S=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,S&&(this._blendOption===S$s.OPAQUE||this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=u$R.fromCache({depthTest:{enabled:this.depthTestEnabled,func:de$y.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===S$s.TRANSLUCENT||this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=u$R.fromCache({depthTest:{enabled:!0,func:de$y.LEQUAL},depthMask:!1,blending:Ee$n.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance,(S||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(C=new a$$({sources:[xe$g]}),this._shaderScaleByDistance&&C.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&C.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&C.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&C.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT&&(T=new a$$({defines:["OPAQUE"],sources:[X$k]}),this._sp=S$T.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:p$y}),T=new a$$({defines:["TRANSLUCENT"],sources:[X$k]}),this._spTranslucent=S$T.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:p$y})),this._blendOption===S$s.OPAQUE&&(T=new a$$({sources:[X$k]}),this._sp=S$T.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:p$y})),this._blendOption===S$s.TRANSLUCENT&&(T=new a$$({sources:[X$k]}),this._spTranslucent=S$T.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:C,fragmentShaderSource:T,attributeLocations:p$y})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);var E,A,P,I,M=e.commandList;if(u.render||c){var O=this._colorCommands,D=this._blendOption===S$s.OPAQUE,R=this._blendOption===S$s.OPAQUE_AND_TRANSLUCENT;A=(E=this._vaf.va).length,O.length=A;var L=R?2*A:A;for(I=0;I<L;++I){var B=D||R&&I%2==0;e$28(P=O[I])||(P=O[I]=new r$15),P.primitiveType=W$_.POINTS,P.pass=B||!R?Le$p.OPAQUE:Le$p.TRANSLUCENT,P.owner=this;var N=R?Math.floor(I/2):I;P.boundingVolume=b,P.modelMatrix=w,P.shaderProgram=B?this._sp:this._spTranslucent,P.uniformMap=this._uniforms,P.vertexArray=E[N].va,P.renderState=B?this._rsOpaque:this._rsTranslucent,P.debugShowBoundingVolume=this.debugShowBoundingVolume,P.pickId="v_pickColor",M.push(P)}}}},D$B.prototype.isDestroyed=function(){return!1},D$B.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),ue$e(this._pointPrimitives),i$Z(this)};var ai$2=new f$10;function G$C(e,t,i,r,n){if(e$28(e._labelCollection)&&r._clusterLabels?n=O$t.getScreenSpaceBoundingBox(e,t,n):e$28(e._billboardCollection)&&r._clusterBillboards?n=n$X.getScreenSpaceBoundingBox(e,t,n):e$28(e._pointPrimitiveCollection)&&r._clusterPoints&&(n=s$o.getScreenSpaceBoundingBox(e,t,n)),Z$s(n,i),r._clusterLabels&&!e$28(e._labelCollection)&&e$28(e.id)&&J$y(r,e.id.id)&&e$28(e.id._label)){var o=r._collectionIndicesByEntity[e.id.id].labelIndex,a=r._labelCollection.get(o),s=a.getScreenSpaceBoundingBox(a,t,ai$2);Z$s(s,i),n=f$10.union(n,s,n)}return n}function ui$3(e,t){if(e.clusterShow=!0,!e$28(e._labelCollection)&&e$28(e.id)&&J$y(t,e.id.id)&&e$28(e.id._label)){var i=t._collectionIndicesByEntity[e.id.id].labelIndex;t._labelCollection.get(i).clusterShow=!0}}function hi$4(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.label.id=i,n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function J$y(e,t){return e$28(e)&&e$28(e._collectionIndicesByEntity[t])&&e$28(e._collectionIndicesByEntity[t].labelIndex)}function z$s(e,t,i,r,n){if(e$28(e))for(var o=e.length,a=0;a<o;++a){var s=e.get(a);if(s.clusterShow=!1,s.show&&(n._scene.mode!==P$$.SCENE3D||r.isPointVisible(s.position))){var l=n._clusterLabels&&e$28(s._labelCollection),u=n._clusterBillboards&&e$28(s.id._billboard),c=n._clusterPoints&&e$28(s.id._point);if(!l||!c&&!u){var h=s.computeScreenSpacePosition(i);!e$28(h)||t.push({index:a,collection:e,clustered:!1,coord:h})}}}}var _i$4=new f$10,bi$2=new f$10,fi$2=new f$10;function gi$4(e){return function(t){if(!(e$28(t)&&t<.05)&&e.enabled){var i=e._scene,r=e._labelCollection,n=e._billboardCollection,o=e._pointCollection;if((e$28(r)||e$28(n)||e$28(o))&&(e._clusterBillboards||e._clusterLabels||e._clusterPoints)){var a=e._clusterLabelCollection,s=e._clusterBillboardCollection,l=e._clusterPointCollection;e$28(a)?a.removeAll():a=e._clusterLabelCollection=new w$p({scene:i}),e$28(s)?s.removeAll():s=e._clusterBillboardCollection=new B$q({scene:i}),e$28(l)?l.removeAll():l=e._clusterPointCollection=new D$B;var u=e._pixelRange,c=e._minimumClusterSize;e._previousClusters;var h=[];e._previousHeight;var d=i.camera.positionCartographic.height,f=i.mapProjection.ellipsoid,p=i.camera.positionWC,_=new s$W(f,p),m=[];e._clusterLabels&&z$s(r,m,i,_,e),e._clusterBillboards&&z$s(n,m,i,_,e),e._clusterPoints&&z$s(o,m,i,_,e);var $,g,v,y,x,b,w,C,T,S,E,A=O$u(m,ci$4,di$3,4096,Int32Array);for(v=m.length,$=0;$<v;++$){var P=m[$];if(!P.clustered){P.clustered=!0,S=P.collection,E=P.index;var I=S.get(E);y=G$C(I,P.coord,u,e,_i$4);var M=f$10.clone(y,bi$2);b=(x=A.intersect(y.x,y.y,y.x+y.width,y.y+y.height)).length;var O=t$X.clone(I.position);T=1,C=[I.id];var D=t$X.distanceSquared(p,O);for(g=0;g<b;++g)if(!(w=m[x[g]]).clustered){var R=w.collection.get(w.index),L=G$C(R,w.coord,u,e,fi$2);t$X.distanceSquared(p,R.position)<D&&(O=t$X.clone(R.position)),f$10.union(M,L,M),++T,C.push(R.id)}if(T>=c){var B=t$X.clone(O);for(hi$4(B,T,C,e),h.push({position:B,width:M.width,height:M.height,minimumWidth:y.width,minimumHeight:y.height}),g=0;g<b;++g)m[x[g]].clustered=!0}else ui$3(I,e)}}0===a.length&&(a.destroy(),e._clusterLabelCollection=void 0),0===s.length&&(s.destroy(),e._clusterBillboardCollection=void 0),0===l.length&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=h,e._previousHeight=d}}}}function R$s(e,t,i,r){return function(n){var o=this[e];e$28(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var a=this._collectionIndicesByEntity[n.id];if(e$28(a)||(a=this._collectionIndicesByEntity[n.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),e$28(o)&&e$28(a[r]))return o.get(a[r]);e$28(o)||(o=this[e]=new t({scene:this._scene}));var s,l,u=this[i];return u.length>0?(s=u.shift(),l=o.get(s)):(l=o.add(),s=o.length-1),a[r]=s,this._clusterDirty=!0,l}}function Y$n(e,t){var i=e._collectionIndicesByEntity[t];!e$28(i.billboardIndex)&&!e$28(i.labelIndex)&&!e$28(i.pointIndex)&&delete e._collectionIndicesByEntity[t]}function M$z(e){if(e$28(e))for(var t=e.length,i=0;i<t;++i)e.get(i).clusterShow=!0}function vi$4(e){e.enabled||(e$28(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),e$28(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),e$28(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,M$z(e._labelCollection),M$z(e._billboardCollection),M$z(e._pointCollection))}function n$t(e){this._name=e,this._clock=void 0,this._changed=new o$1o,this._error=new o$1o,this._isLoading=!1,this._loading=new o$1o,this._entityCollection=new r$z(this),this._entityCluster=new a$v}function t$p(){this.pntArray=[]}function p$x(e){e=e||[],this.init(e)}function n$s(e){e=e||[],this._extrudedHeight=void 0,this._closeTop=!0,this._closeBottom=!0,this._isWall=!1,this.init(e)}function c$v(e){for(var t=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=0;o<e.length;o++){var a=e[o];t=Math.min(a.x,t),i=Math.max(a.x,i),r=Math.min(a.y,r),n=Math.max(a.y,n)}return{minLon:t,maxLon:i,minLat:r,maxLat:n}}a$v.prototype._initialize=function(e){this._scene=e;var t=gi$4(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},Object.defineProperties(a$v.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),a$v.prototype.getLabel=R$s("_labelCollection",w$p,"_unusedLabelIndices","labelIndex"),a$v.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(e$28(this._labelCollection)&&e$28(t)&&e$28(t.labelIndex)){var i=t.labelIndex;t.labelIndex=void 0,Y$n(this,e.id);var r=this._labelCollection.get(i);r.show=!1,r.text="",r.id=void 0,this._unusedLabelIndices.push(i),this._clusterDirty=!0}},a$v.prototype.getBillboard=R$s("_billboardCollection",B$q,"_unusedBillboardIndices","billboardIndex"),a$v.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(e$28(this._billboardCollection)&&e$28(t)&&e$28(t.billboardIndex)){var i=t.billboardIndex;t.billboardIndex=void 0,Y$n(this,e.id);var r=this._billboardCollection.get(i);r.id=void 0,r.show=!1,r.image=void 0,this._unusedBillboardIndices.push(i),this._clusterDirty=!0}},a$v.prototype.getPoint=R$s("_pointCollection",D$B,"_unusedPointIndices","pointIndex"),a$v.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(e$28(this._pointCollection)&&e$28(t)&&e$28(t.pointIndex)){var i=t.pointIndex;t.pointIndex=void 0,Y$n(this,e.id);var r=this._pointCollection.get(i);r.show=!1,r.id=void 0,this._unusedPointIndices.push(i),this._clusterDirty=!0}},a$v.prototype.update=function(e){var t;e._fboState.enabled||(e$28(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),e$28(this._billboardCollection)&&this._billboardCollection.length>0&&!e$28(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,vi$4(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),e$28(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),e$28(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),e$28(this._clusterPointCollection)&&this._clusterPointCollection.update(e),e$28(this._labelCollection)&&this._labelCollection.update(e),e$28(this._billboardCollection)&&this._billboardCollection.update(e),e$28(this._pointCollection)&&this._pointCollection.update(e))},a$v.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),e$28(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},Object.defineProperties(n$t.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){o$L.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!e$28(e))throw new t$Z("value must be defined.");this._entityCluster=e}}}),t$p.prototype.add=function(e){e instanceof s$q&&this.pntArray.push(e)},t$p.prototype.removeAll=function(){this.pntArray=[]},p$x.prototype=new o$M,p$x.prototype.constructor=p$x,p$x.prototype.parent=o$M.prototype,Object.defineProperties(p$x.prototype,{partCount:{get:function(){return this.parts.length}}}),p$x.prototype.init=function(e){this.parts=[],this.polyline={positions:[],width:10},this.points=[];for(var t=0,i=e.length;t<i;t++){var r=e[t].pntArray.length;if(this.parts.push(r),r>0)for(var n=0;n<r;n++){var o=e[t].pntArray[n];this.points.push(o),this.polyline.positions.push(o)}}this.type=P$v.GEOLINE3D},p$x.prototype.addPart=function(e){if(!(!e instanceof t$p)){for(var t=0,i=e.pntArray.length;t<i;t++)this.points.push(e.pntArray[t]),this.polyline.positions.push(e.pntArray[t]);this.parts.push(e.pntArray.length)}},p$x.prototype.getPart=function(e){if("number"!=typeof e||e>=this.partCount)return null;for(var t=new t$p,i=0,r=0;r<e;r++)i+=this.parts[r];for(r=i;r<this.parts[e];r++)t.add(new s$q(this.points[r].x,this.points[r].y,this.points[r].z));return t},n$s.prototype=new o$M,n$s.prototype.constructor=n$s,n$s.prototype.parent=o$M.prototype,Object.defineProperties(n$s.prototype,{partCount:{get:function(){return this.parts.length}},extrudedHeight:{get:function(){return this._extrudedHeight},set:function(e){this._extrudedHeight=e,this.polygon.extrudedHeight=e,this._isGeometryDirty=!0}},closeTop:{set:function(e){this._closeTop=e,this.polygon.closeTop=e,this._isGeometryDirty=!0}},closeBottom:{set:function(e){this._closeBottom=e,this.polygon.closeBottom=e,this._isGeometryDirty=!0}},isWall:{set:function(e){this._isWall=e,this.polygon.isWall=e,this._isGeometryDirty=!0}},bottomAltitude:{get:function(){return this.polygon.height},set:function(e){this.polygon.height=e,this.polygon.perPositionHeight=!1,this._isGeometryDirty=!0}}}),n$s.prototype.init=function(e){this.type=P$v.GEOREGION3D,this.parts=[],this.points=[],this.polygon={positions:[],extrudedHeight:this.extrudedHeight,closeTop:this._closeTop,closeBottom:this._closeBottom,perPositionHeight:!0,isComputeTexCoord:!0};for(var t=0,i=e.length;t<i;t++){var r=e[t].pntArray.length;if(this.parts.push(r),r>0)for(var n=0;n<r;n++)this.polygon.positions.push(t$X.fromDegrees(e[t].pntArray[n].x,e[t].pntArray[n].y,e[t].pntArray[n].z)),this.points.push(new s$q(e[t].pntArray[n].x,e[t].pntArray[n].y,e[t].pntArray[n].z))}this.type=P$v.GEOREGION3D;var o=c$v(this.points),a=t$X.fromDegrees(o.minLon,o.maxLat,0),s=t$X.fromDegrees(o.maxLon,o.maxLat,0),l=t$X.fromDegrees(o.minLon,o.minLat,0);this.width=t$X.distance(a,s),this.height=t$X.distance(a,l)},n$s.prototype.addPart=function(e){if(!(!e instanceof t$p)){for(var t=0,i=e.pntArray.length;t<i;t++){var r=e.pntArray[t];this.points.push(r),this.polygon.positions.push(t$X.fromDegrees(r.x,r.y,r.z))}this.parts.push(e.pntArray.length)}},n$s.prototype.getPart=function(e){if("number"!=typeof e||e>=this.partCount)return null;for(var t=new t$p,i=0,r=0;r<e;r++)i+=this.parts[r];for(r=i;r<this.parts[e];r++)t.add(new s$q(this.points[r].x,this.points[r].y,this.points[r].z));return t},n$s.prototype._createGeometry=function(){var e=U$Q.fromPositions(this.polygon);this._geometry=U$Q.createGeometry(e),this._isGeometryDirty=!1};var _0x1fc93d=(_0x1cf51d=!0,function(e,t){var i=_0x1cf51d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1cf51d=!1,i}),_0x59a9c1=_0x1fc93d(void 0,(function(){return _0x59a9c1.toString().search("(((.+)+)+)+$").toString().constructor(_0x59a9c1).search("(((.+)+)+)+$")})),_0x1cf51d;_0x59a9c1();var _0x3a9934={},_0x31796c=!1,_0x16aa85,_0xed1676,_0x2d717c;function _0x3a94e0(e,t=0,i=1,r=1){var n=_0x16aa85._malloc(16);return _0xed1676(n,t,"i32"),_0xed1676(n+4,e,"i32"),_0xed1676(n+8,i,"float"),_0xed1676(n+12,r,"float"),n}function _0x5610a2(e,t=4){if(i%t==0)return e;var i=e%t;return 0!=i&&(e+=t-i),e}function _0x278ae9(e=!1,t=!1,i=!0,r=3,n=!1,o=!1,a=0,s=!0,l=30){var u=_0x16aa85._malloc(36);return _0xed1676(u,e,"i32"),_0xed1676(u+4,t,"i32"),_0xed1676(u+8,i,"i32"),_0xed1676(u+12,r,"i32"),_0xed1676(u+16,n,"i32"),_0xed1676(u+20,o,"i32"),_0xed1676(u+24,a,"i32"),_0xed1676(u+28,s,"i32"),_0xed1676(u+32,l,"float"),u}function _0x368a5c(e,t=!1,i=!1,r=!0,n=7,o=1,a=1,s=30){var l=_0x16aa85._malloc(32);return _0xed1676(l,e,"float"),_0xed1676(l+4,t,"i32"),_0xed1676(l+8,i,"i32"),_0xed1676(l+12,r,"i32"),_0xed1676(l+16,n,"i32"),_0xed1676(l+20,o,"float"),_0xed1676(l+24,a,"float"),_0xed1676(l+32,s,"float"),l}function _0x11d4e0(e,t=!1,i=!1,r=!0,n=7,o=1,a=30){var s=_0x16aa85._malloc(28);return _0xed1676(s,e,"float"),_0xed1676(s+4,t,"i32"),_0xed1676(s+8,i,"i32"),_0xed1676(s+12,r,"i32"),_0xed1676(s+16,n,"i32"),_0xed1676(s+20,o,"i32"),_0xed1676(s+24,a,"float"),s}function _0x6d4d93(e,t=3){if(e$28(e)){for(var i=e.length,r=0,n=0;n<e.length;n++){r+=(u=e[n]).length}var o=2;(1===t||3===t)&&(o=3);var a=4*(3+i),s=r*o*8+(a=_0x5610a2(a,8)),l=_0x16aa85._malloc(s);_0xed1676(l,t,"i32"),_0xed1676(l+4,i,"i32"),_0xed1676(l+8,8,"i32");for(n=0;n<i;n++){var u=e[n];_0xed1676(l+8+4*(n+1),u.length,"i32")}var c=0;for(n=0;n<i;n++){u=e[n];for(var h=0;h<u.length;h++)for(var d=u[h],f=0;f<o;f++)_0xed1676(l+a+c,d[f],"double"),c+=8}return l}}function _0x3fc6be(e){if(!e$28(e)||0==e)return;var t=0;_0x2d717c(e,"i32");const i=_0x2d717c(e+(t+=4),"i32"),r=_0x2d717c(e+(t+=4),"i32");t+=4;var n=0,o=0,a=0;4==r?(n=_0x2d717c(e+t,"float"),o=_0x2d717c(e+(t+=4),"float"),a=_0x2d717c(e+(t+=r),"float"),t+=r):(t=_0x5610a2(t,8),n=_0x2d717c(e+t,"double"),o=_0x2d717c(e+(t+=8),"double"),a=_0x2d717c(e+(t+=r),"double"),t+=r);for(var s=0;s<i;s++){var l=_0x2d717c(e+t,"i32");t+=4,t=_0x5610a2(t+=l,4)}var u=[];for(s=0;s<i;s++){var c=[],h=_0x2d717c(e+t,"i32"),d=_0x2d717c(e+(t+=4),"i32"),f=_0x2d717c(e+(t+=4),"i32"),p=_0x2d717c(e+(t+=4),"i32");t+=4,c[0]=h,c[1]=d,c[2]=f,c[3]=p,u[s]=c}var _=[];for(s=0;s<i;s++){8==r&&(t=_0x5610a2(t,8));h=(c=u[s])[0],d=c[1],f=c[2],p=c[3];for(var m=[],$=0,g=0;g<h;g++)4==r?(m[$++]=_0x2d717c(e+t,"float"),t+=r,m[$++]=_0x2d717c(e+t,"float"),t+=r,m[$++]=_0x2d717c(e+t,"float"),t+=r):(m[$++]=_0x2d717c(e+t,"double"),t+=r,m[$++]=_0x2d717c(e+t,"double"),t+=r,m[$++]=_0x2d717c(e+t,"double"),t+=r);var v=[],y=0;for(g=0;g<d;g++)v[y++]=_0x2d717c(e+t,"i32"),t+=4,v[y++]=_0x2d717c(e+t,"i32"),t+=4,v[y++]=_0x2d717c(e+t,"i32"),t+=4;var x=[],b=0;for(g=0;g<f;g++)x[b++]=_0x2d717c(e+t,"float"),t+=4,x[b++]=_0x2d717c(e+t,"float"),t+=4;var w=[],C=0;for(g=0;g<p;g++)w[C++]=_0x2d717c(e+t,"float"),t+=4,w[C++]=_0x2d717c(e+t,"float"),t+=4,w[C++]=_0x2d717c(e+t,"float"),t+=4;_[s]={vertex:{count:c[0],typedArray:m},indices:{typedArray:v,count:c[1]},uv:x,normal:w,position:new t$X(n,o,a)}}return _}function M$y(e){this.id=e,this.vertexFormat=void 0,this.slices=void 0,this.offsetAttribute=void 0}function l$F(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new M$y(e),geometryPropertyName:"geometry",observedPropertyNames:["loftParam","geometry","children","orientation","scale","position"]}),this.asynchronous=!1,this.twoPasses=!0,this.wrapS=q$11.REPEAT,this.wrapT=q$11.REPEAT,this.compressVertices=!1;var i=this;e$28(e.geometry)&&(e.geometry.outlineWidth=new e$1d(e.geometry.outlineWidth||1),this._outline=new e$1d(e.geometry.outline||!1),Object.defineProperties(e.geometry,{outline:{get:function(){return i._outline},set:function(t){if(t!==i._outline)if(!0===t)i._outline=!0,e.geometry.outlineWidth=new e$1d(e.geometry.outlineWidth||1),i._onEntityPropertyChanged(e,"geometry",e.geometry,void 0),i.createOutlineGeometryInstance(1);else{i._outline=void 0;var r=e._polygon;e$28(r.outlines)&&r.outlines.removeAll(),r.outlines=void 0,r._outline=!1}}}})),this._onEntityPropertyChanged(e,"geometry",e.geometry,void 0)}_0x3a9934.initWebAssembly=function(){var e=o$1q.defer();return _0x31796c?e.resolve(!0):Promise.resolve().then((function(){return SuModeling})).then((function(t){_0x16aa85=t.Module,_0xed1676=t.setValue,_0x2d717c=t.getValue,_0x16aa85.onRuntimeInitialized=function(){_0x31796c=!0,e.resolve(!0)}})),e.promise},_0x3a9934.loft=function(e,t,i,r){if(!_0x31796c)return null;if(!(e instanceof p$x))throw new t$Z("line3d must be GeoLine3D.");e$28(i)||(i={}),e$28(r)||(r={});for(var n=u$Y(i.createTexCoord,!0),o=u$Y(i.generateNormal,!0),a=u$Y(i.group,!0),s=u$Y(i.att,3),l=u$Y(i.splitSegment,!1),u=u$Y(i.splitSide,!1),c=u$Y(i.chamferFactor,0),h=u$Y(i.segmentClosed,!0),d=u$Y(i.normalAngle,30),f=u$Y(r.realTexMapSize,!0),p=u$Y(r.mappingMode,0),_=u$Y(r.uTiling,1),m=u$Y(r.vTiling,1),$=[],g=t.parts,v=0,y=0;y<g.length;y++){for(var x=g[y],b=[],w=0;w<x;w++)b.push([t.points[w+v].x,t.points[w+v].y]);$.push(b),v+=x}var C=_0x6d4d93($,"REGION3D"===t.type?2:0),T=[];for(g=e.parts,v=0,y=0;y<g.length;y++){x=g[y];var S=[];for(w=0;w<x;w++)S.push([e.points[w+v].x,e.points[w+v].y,e.points[w+v].z]);T.push(S),v+=x}var E=_0x6d4d93(T,1),A=_0x3a94e0(f,p,_,m),P=_0x278ae9(n,o,a,s,l,u,c,h,d),I=_0x16aa85._loft(E,!0,C,P,A);_0x16aa85._free(C),_0x16aa85._free(E),_0x16aa85._free(P),_0x16aa85._free(A);var M=_0x3fc6be(I);return _0x16aa85._free(I),M},_0x3a9934.linearExtrude=function(e,t,i){if(!_0x31796c)return null;if(!(e instanceof n$s))throw new t$Z("region3d must be GeoRegion3D.");e$28(t)||(t={}),e$28(i)||(i={});for(var r=u$Y(t.height,10),n=u$Y(t.createTexCoord,!0),o=u$Y(t.generateNormal,!0),a=u$Y(t.group,!0),s=u$Y(t.att,7),l=u$Y(t.scaleX,1),u=u$Y(t.scaleY,1),c=u$Y(t.normalAngle,30),h=u$Y(i.realTexMapSize,!0),d=u$Y(i.mappingMode,0),f=u$Y(i.uTiling,1),p=u$Y(i.vTiling,1),_=_0x368a5c(r,n,o,a,s,l,u,c),m=_0x3a94e0(h,d,f,p),$=[],g=e.parts,v=0,y=0;y<g.length;y++){for(var x=g[y],b=[],w=0;w<x;w++)b.push([e.points[w+v].x,e.points[w+v].y,e.points[w+v].z]);$.push(b),v+=x}var C=_0x6d4d93($),T=_0x16aa85._linearExtrude(C,_,!0,m);_0x16aa85._free(C),_0x16aa85._free(_),_0x16aa85._free(m);var S=_0x3fc6be(T);return _0x16aa85._free(T),S},_0x3a9934.rotateExtrude=function(e,t,i){if(!_0x31796c)return null;if(!(e instanceof n$s||e instanceof p$x))throw new t$Z("geometry must be GeoRegion3D or GeoLine3D.");e$28(t)||(t={}),e$28(i)||(i={});for(var r=u$Y(t.angle,360),n=u$Y(t.createTexCoord,!0),o=u$Y(t.generateNormal,!0),a=u$Y(t.group,!0),s=u$Y(t.att,7),l=u$Y(t.slices,1),u=u$Y(t.normalAngle,30),c=u$Y(i.realTexMapSize,!0),h=u$Y(i.mappingMode,0),d=u$Y(i.uTiling,1),f=u$Y(i.vTiling,1),p=_0x11d4e0(r,n,o,a,s,l,u),_=_0x3a94e0(c,h,d,f),m=[],$=e.parts,g=0,v=0;v<$.length;v++){for(var y=$[v],x=[],b=0;b<y;b++)x.push([e.points[b+g].x,e.points[b+g].y]);m.push(x),g+=y}var w=_0x6d4d93(m,"REGION3D"===e.type?2:0),C=_0x16aa85._rotateExtrude(w,p,_);_0x16aa85._free(w),_0x16aa85._free(p),_0x16aa85._free(_);var T=_0x3fc6be(C);return _0x16aa85._free(C),T},e$28(Object.create)&&(l$F.prototype=Object.create(i$F.prototype),l$F.prototype.constructor=l$F),Object.defineProperties(l$F.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),l$F.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");if(this._options.instance instanceof d$15)return this._options.instance;var t,i=this._options.loftParam,r=this._options.linearExtrudeParam;if(e$28(i)?t=_0x3a9934.loft(i.line,i.region,i.buildParam,i.uvwParam):e$28(r)&&(t=_0x3a9934.linearExtrude(r.region,r.buildParam,r.uvwParam)),!e$28(t))return null;var n,o,a=[],s=this._entity;n=e$28(s.orientation)?s.orientation.getValue(e):{heading:0,pitch:0,roll:0},o=e$28(s.scale)?s.scale.getValue(e):{x:1,y:1,z:1};for(var l=0;l<t.length;l++){var u=t[l].vertex.typedArray,c=t[l].indices.typedArray,h=t[l].normal,d=t[l].uv,f=t[l].position,p=s.isAvailable(e);(!e$28(s.position)||!e$28(s.position.getValue(e)))&&(s.position=f);var _=new a$_({position:new o$1g({componentDatatype:S$W.DOUBLE,componentsPerAttribute:3,values:new Float64Array(u)}),normal:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:new Float32Array(h)}),st:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:new Float32Array(d)})}),m=i$19.fromVertices(new Float64Array(u),new t$X(0,0,0),3),$=new I$1n({attributes:_,indices:c,primitiveType:W$_.TRIANGLES,boundingSphere:m});f=s.position.getValue(e);var g=m$1b.headingPitchRollToFixedFrame(t$X.fromDegrees(f.x,f.y,f.z),new i$10(n.heading,n.pitch,n.roll),t$V.WGS84,m$1b.eastNorthUpToFixedFrame);y$15.multiplyByScale(g,o,g),a.push(new d$15({id:s,geometry:$,modelMatrix:g,attributes:{show:new e$1h(p&&s.isShowing&&this._showProperty.getValue(e))}}))}if(a.length>1){var v=[];for(l=0;l<a.length;l++){var y=new a$N(s.geometry.material);y._unique=!0;var x=new h$F({geometry:{instance:a[l],material:y}});v.push(x)}return s.children=v,null}return a[0]},l$F.prototype.createOutlineGeometryInstance=function(e){o$1u.defined("time",e);var t=this._options;if(!this._outlineEnabled||!e$28(t.linearExtrudeParam))throw new t$Z("This instance does not represent an outlined geometry.");for(var i,r=this._entity,n=(t=this._options).linearExtrudeParam.region,o={},a=n.parts,s=0,l=0;l<a.length;l++){for(var u=a[l],c=[],h=0;h<u;h++)c.push(n.points[h+s].x,n.points[h+s].y);0===l?(o.positions=t$X.fromDegreesArray(c),i=n.points[h+s-1].z):(e$28(o.holes)||(o.holes=[]),o.holes.push({positions:t$X.fromDegreesArray(c)})),s+=u}var d=this.outlineWidth<=1?1.1:this.outlineWidth,f=new u$B({hierarchy:o,extrudedHeight:t.linearExtrudeParam.buildParam.height+i,height:i,show:!0,outline:!0,outlineWidth:d,arcType:1,outlineColor:this.outlineColorProperty,perPositionHeight:!0});return r._polygon=f,null},l$F.prototype._isDynamic=function(e,t){return!1},l$F.prototype.isOutlineVisible=function(e){return!0},l$F.prototype._setStaticOptions=function(e,t){var i=this._options;i.loftParam=t.loftParam,i.linearExtrudeParam=t.linearExtrudeParam,i.instance=t.instance},l$F.prototype._onEntityPropertyChanged=a$H;var P$u=t$X.ZERO,U$v=new t$X,N$q=new t$X,D$A=new e$1S;function x$C(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function s$n(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new x$C(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function f$z(e,t,i){a$L.call(this,e,t,i)}function e$J(){this._definitionChanged=new o$1o,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}e$28(Object.create)&&(s$n.prototype=Object.create(i$F.prototype),s$n.prototype.constructor=s$n),Object.defineProperties(s$n.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),s$n.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n=new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:t$H.fromDistanceDisplayCondition(o),color:void 0,offset:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,D$A)),e$28(t)||(t=e$1S.WHITE),a.color=o$18.fromColor(t));return e$28(this._options.offsetAttribute)&&(a.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,P$u,U$v))),new d$15({id:i,geometry:new l$_(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:a})},s$n.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,D$A),n=this._distanceDisplayConditionProperty.getValue(e),o={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n),offset:void 0};return e$28(this._options.offsetAttribute)&&(o.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,P$u,U$v))),new d$15({id:t,geometry:new d$13(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},s$n.prototype._computeCenter=function(e,t){return r$K.getValueOrUndefined(this._entity.position,e,t)},s$n.prototype._isHidden=function(e,t){return!e$28(e.position)||!e$28(t.length)||!e$28(t.topRadius)||!e$28(t.bottomRadius)||i$F.prototype._isHidden.call(this,e,t)},s$n.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&r$K.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&r$K.isConstant(t.slices)&&r$K.isConstant(t.outlineWidth)&&r$K.isConstant(t.numberOfVerticalLines))},s$n.prototype._setStaticOptions=function(e,t){var i=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof t$z?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,r.length=t.length.getValue(o$11.MINIMUM_VALUE),r.topRadius=t.topRadius.getValue(o$11.MINIMUM_VALUE),r.bottomRadius=t.bottomRadius.getValue(o$11.MINIMUM_VALUE),r.slices=r$K.getValueOrUndefined(t.slices,o$11.MINIMUM_VALUE),r.numberOfVerticalLines=r$K.getValueOrUndefined(t.numberOfVerticalLines,o$11.MINIMUM_VALUE),r.offsetAttribute=i!==k$_.NONE?ee$C.ALL:void 0},s$n.prototype._onEntityPropertyChanged=a$H,s$n.DynamicGeometryUpdater=f$z,e$28(Object.create)&&(f$z.prototype=Object.create(a$L.prototype),f$z.prototype.constructor=f$z),f$z.prototype._isHidden=function(e,t,i){var r=this._options;return!e$28(r$K.getValueOrUndefined(e.position,i,N$q))||!e$28(r.length)||!e$28(r.topRadius)||!e$28(r.bottomRadius)||a$L.prototype._isHidden.call(this,e,t,i)},f$z.prototype._setOptions=function(e,t,i){var r=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),n=this._options;n.length=r$K.getValueOrUndefined(t.length,i),n.topRadius=r$K.getValueOrUndefined(t.topRadius,i),n.bottomRadius=r$K.getValueOrUndefined(t.bottomRadius,i),n.slices=r$K.getValueOrUndefined(t.slices,i),n.numberOfVerticalLines=r$K.getValueOrUndefined(t.numberOfVerticalLines,i),n.offsetAttribute=r!==k$_.NONE?ee$C.ALL:void 0},Object.defineProperties(e$J.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:c$J("startTime"),stopTime:c$J("stopTime"),currentTime:c$J("currentTime"),clockRange:c$J("clockRange"),clockStep:c$J("clockStep"),multiplier:c$J("multiplier")}),e$J.prototype.clone=function(e){return e$28(e)||(e=new e$J),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},e$J.prototype.equals=function(e){return this===e||e$28(e)&&a$12.equals(this.startTime,e.startTime)&&a$12.equals(this.stopTime,e.stopTime)&&a$12.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},e$J.prototype.merge=function(e){if(!e$28(e))throw new t$Z("source is required.");this.startTime=u$Y(this.startTime,e.startTime),this.stopTime=u$Y(this.stopTime,e.stopTime),this.currentTime=u$Y(this.currentTime,e.currentTime),this.clockRange=u$Y(this.clockRange,e.clockRange),this.clockStep=u$Y(this.clockStep,e.clockStep),this.multiplier=u$Y(this.multiplier,e.multiplier)},e$J.prototype.getValue=function(e){return e$28(e)||(e=new u$M),e.startTime=u$Y(this.startTime,e.startTime),e.stopTime=u$Y(this.stopTime,e.stopTime),e.currentTime=u$Y(this.currentTime,e.currentTime),e.clockRange=u$Y(this.clockRange,e.clockRange),e.multiplier=u$Y(this.multiplier,e.multiplier),e.clockStep=u$Y(this.clockStep,e.clockStep),e};var h$y=e$1S.WHITE,u$t=.1,c$u=new o$1k(8,8),d$F=new o$1k(0,0),p$w=new o$1k(1,1);function t$o(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}function t$n(e){this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(t$o.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)&&r$K.isConstant(this._cellAlpha)&&r$K.isConstant(this._lineCount)&&r$K.isConstant(this._lineThickness)&&r$K.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),cellAlpha:C$H("cellAlpha"),lineCount:C$H("lineCount"),lineThickness:C$H("lineThickness"),lineOffset:C$H("lineOffset")}),t$o.prototype.getType=function(e){return"Grid"},t$o.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,h$y,t.color),t.cellAlpha=r$K.getValueOrDefault(this._cellAlpha,e,u$t),t.lineCount=r$K.getValueOrClonedDefault(this._lineCount,e,c$u,t.lineCount),t.lineThickness=r$K.getValueOrClonedDefault(this._lineThickness,e,p$w,t.lineThickness),t.lineOffset=r$K.getValueOrClonedDefault(this._lineOffset,e,d$F,t.lineOffset),t},t$o.prototype.equals=function(e){return this===e||e instanceof t$o&&r$K.equals(this._color,e._color)&&r$K.equals(this._cellAlpha,e._cellAlpha)&&r$K.equals(this._lineCount,e._lineCount)&&r$K.equals(this._lineThickness,e._lineThickness)&&r$K.equals(this._lineOffset,e._lineOffset)},Object.defineProperties(t$n.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color")}),t$n.prototype.getType=function(e){return"PolylineArrow"},t$n.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,e$1S.WHITE,t.color),t},t$n.prototype.equals=function(e){return this===e||e instanceof t$n&&r$K.equals(this._color,e._color)};var d$E=e$1S.WHITE,l$E=e$1S.TRANSPARENT,f$y=16,g$r=255;function o$K(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(o$K.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)&&r$K.isConstant(this._gapColor)&&r$K.isConstant(this._dashLength)&&r$K.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),gapColor:C$H("gapColor"),dashLength:C$H("dashLength"),dashPattern:C$H("dashPattern")}),o$K.prototype.getType=function(e){return"PolylineDash"},o$K.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,d$E,t.color),t.gapColor=r$K.getValueOrClonedDefault(this._gapColor,e,l$E,t.gapColor),t.dashLength=r$K.getValueOrDefault(this._dashLength,e,f$y,t.dashLength),t.dashPattern=r$K.getValueOrDefault(this._dashPattern,e,g$r,t.dashPattern),t},o$K.prototype.equals=function(e){return this===e||e instanceof o$K&&r$K.equals(this._color,e._color)&&r$K.equals(this._gapColor,e._gapColor)&&r$K.equals(this._dashLength,e._dashLength)&&r$K.equals(this._dashPattern,e._dashPattern)};var f$x=e$1S.WHITE,p$v=.25,P$t=1;function t$m(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(t$m.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)&&r$K.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),glowPower:C$H("glowPower"),taperPower:C$H("taperPower")}),t$m.prototype.getType=function(e){return"PolylineGlow"},t$m.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,f$x,t.color),t.glowPower=r$K.getValueOrDefault(this._glowPower,e,p$v,t.glowPower),t.taperPower=r$K.getValueOrDefault(this._taperPower,e,P$t,t.taperPower),t},t$m.prototype.equals=function(e){return this===e||e instanceof t$m&&r$K.equals(this._color,e._color)&&r$K.equals(this._glowPower,e._glowPower)&&r$K.equals(this._taperPower,e._taperPower)};var f$w=e$1S.WHITE,h$x=e$1S.BLACK,a$u=1;function e$I(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}function n$r(e,t){this._value=void 0,this._definitionChanged=new o$1o,this._eventHelper=new n$R,this._referenceFrame=u$Y(t,Re$j.FIXED),this.setValue(e)}function i$u(e){this._value=void 0,this._definitionChanged=new o$1o,this._eventHelper=new n$R,this.setValue(e)}function s$m(e){var t=e._targetProperty;if(!e$28(t)){var i=e._targetEntity;if(!e$28(i)){if(!e$28(i=e._targetCollection.getById(e._targetId)))return void(e._targetEntity=e._targetProperty=void 0);i.definitionChanged.addEventListener(a$t.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=i}var r=e._targetPropertyNames;t=e._targetEntity;for(var n=0,o=r.length;n<o&&e$28(t);++n)t=t[r[n]];e._targetProperty=t}return t}function a$t(e,t,i){if(!e$28(e))throw new t$Z("targetCollection is required.");if(!e$28(t)||""===t)throw new t$Z("targetId is required.");if(!e$28(i)||0===i.length)throw new t$Z("targetPropertyNames is required.");for(var r=0;r<i.length;r++){var n=i[r];if(!e$28(n)||""===n)throw new t$Z("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new o$1o,e.collectionChanged.addEventListener(a$t.prototype._onCollectionChanged,this)}Object.defineProperties(e$I.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)&&r$K.isConstant(this._outlineColor)&&r$K.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth")}),e$I.prototype.getType=function(e){return"PolylineOutline"},e$I.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,f$w,t.color),t.outlineColor=r$K.getValueOrClonedDefault(this._outlineColor,e,h$x,t.outlineColor),t.outlineWidth=r$K.getValueOrDefault(this._outlineWidth,e,a$u),t},e$I.prototype.equals=function(e){return this===e||e instanceof e$I&&r$K.equals(this._color,e._color)&&r$K.equals(this._outlineColor,e._outlineColor)&&r$K.equals(this._outlineWidth,e._outlineWidth)},Object.defineProperties(n$r.prototype,{isConstant:{get:function(){var e=this._value;if(!e$28(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!r$K.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),n$r.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},n$r.prototype.getValueInReferenceFrame=function(e,t,i){if(!e$28(e))throw new t$Z("time is required.");if(!e$28(t))throw new t$Z("referenceFrame is required.");var r=this._value;if(e$28(r)){var n=r.length;e$28(i)||(i=new Array(n));for(var o=0,a=0;o<n;){var s=r[o].getValueInReferenceFrame(e,t,i[o]);e$28(s)&&(i[a]=s,a++),o++}return i.length=a,i}},n$r.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),e$28(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];e$28(n)&&t.add(n.definitionChanged,n$r.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},n$r.prototype.equals=function(e){return this===e||e instanceof n$r&&this._referenceFrame===e._referenceFrame&&r$K.arrayEquals(this._value,e._value)},n$r.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(i$u.prototype,{isConstant:{get:function(){var e=this._value;if(!e$28(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!r$K.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),i$u.prototype.getValue=function(e,t){if(!e$28(e))throw new t$Z("time is required.");var i=this._value;if(e$28(i)){var r=i.length;e$28(t)||(t=new Array(r));for(var n=0,o=0;n<r;){var a=this._value[n].getValue(e,t[n]);e$28(a)&&(t[o]=a,o++),n++}return t.length=o,t}},i$u.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),e$28(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];e$28(n)&&t.add(n.definitionChanged,i$u.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},i$u.prototype.equals=function(e){return this===e||e instanceof i$u&&r$K.arrayEquals(this._value,e._value)},i$u.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(a$t.prototype,{isConstant:{get:function(){return r$K.isConstant(s$m(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){var e=s$m(this);return e$28(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s$m(this)}}}),a$t.fromString=function(e,t){if(!e$28(e))throw new t$Z("targetCollection is required.");if(!e$28(t))throw new t$Z("referenceString is required.");for(var i,r=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var l=t.charAt(s);o?(a+=l,o=!1):"\\"===l?o=!0:n&&"#"===l?(i=a,n=!1,a=""):n||"."!==l?a+=l:(r.push(a),a="")}return r.push(a),new a$t(e,i,r)},a$t.prototype.getValue=function(e,t){var i=s$m(this);return e$28(i)?i.getValue(e,t):void 0},a$t.prototype.getValueInReferenceFrame=function(e,t,i){var r=s$m(this);return e$28(r)?r.getValueInReferenceFrame(e,t,i):void 0},a$t.prototype.getType=function(e){var t=s$m(this);return e$28(t)?t.getType(e):void 0},a$t.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},a$t.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){e$28(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},a$t.prototype._onCollectionChanged=function(e,t,i){var r=this._targetEntity;e$28(r)&&-1!==i.indexOf(r)?(r.definitionChanged.removeEventListener(a$t.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):e$28(r)||e$28(r=s$m(this))&&this._definitionChanged.raiseEvent(this)};var m$w={packedLength:1,pack:function(e,t,i){if(!e$28(e))throw new t$Z("value is required");if(!e$28(t))throw new t$Z("array is required");return t[i=u$Y(i,0)]=e,t},unpack:function(e,t,i){if(!e$28(e))throw new t$Z("array is required");return e[t=u$Y(t,0)]},convertPackedArrayForInterpolation:function(e,t,i,r){if(!e$28(e))throw new t$Z("packedArray is required");t=u$Y(t,0);for(var n,o=0,a=(i=u$Y(i,e.length))-t+1;o<a;o++){var s=e[t+o];0===o||Math.abs(n-s)<Math.PI?r[o]=s:r[o]=s-e$27.TWO_PI,n=s}},unpackInterpolationResult:function(e,t,i,r,n){if(!e$28(e))throw new t$Z("array is required");if(!e$28(t))throw new t$Z("sourceArray is required");return(n=e[0])<0?n+e$27.TWO_PI:n}},j$v={packedLength:1,pack:function(e,t,i){t[i=u$Y(i,0)]=e},unpack:function(e,t,i){return e[t=u$Y(t,0)]}};function J$x(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;r<o;r++)e[t++]=i[r]}function Z$r(e,t){return e instanceof a$12?e:"string"==typeof e?a$12.fromIso8601(e):a$12.addSeconds(t,e,new a$12)}var P$s=[],q$u=[];function S$p(e,t,i,r,n){for(var o,a,s,l,u,c,h=0;h<r.length;){var d=0,f=0;if((s=a$14(t,u=Z$r(r[h],e),a$12.compare))<0){for(l=(s=~s)*n,a=void 0,c=t[s];h<r.length&&(u=Z$r(r[h],e),!(e$28(a)&&a$12.compare(a,u)>=0||e$28(c)&&a$12.compare(u,c)>=0));){for(P$s[d++]=u,h+=1,o=0;o<n;o++)q$u[f++]=r[h],h+=1;a=u}d>0&&(q$u.length=f,J$x(i,l,q$u),P$s.length=d,J$x(t,s,P$s))}else{for(o=0;o<n;o++)h++,i[s*n+o]=r[h];h++}}}function g$q(e,t){o$1u.defined("type",e);var i=e;i===Number&&(i=j$v);var r,n=i.packedLength,o=u$Y(i.packedInterpolationLength,n),a=0;if(e$28(t)){var s=t.length;r=new Array(s);for(var l=0;l<s;l++){var u=t[l];u===Number&&(u=j$v);var c=u.packedLength;n+=c,o+=u$Y(u.packedInterpolationLength,c),r[l]=u}a=s}this._type=e,this._innerType=i,this._interpolationDegree=1,this._interpolationAlgorithm=v$F,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=n,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new o$1o,this._derivativeTypes=t,this._innerDerivativeTypes=r,this._inputOrder=a,this._forwardExtrapolationType=_0x33054b.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=_0x33054b.NONE,this._backwardExtrapolationDuration=0}function z$r(e,t,i){var r=e._packedLength;e._times.splice(t,i),e._values.splice(t*r,i*r),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}function o$J(e,t){var i;if((t=u$Y(t,0))>0){i=new Array(t);for(var r=0;r<t;r++)i[r]=t$X}this._numberOfDerivatives=t,this._property=new g$q(t$X,i),this._definitionChanged=new o$1o,this._referenceFrame=u$Y(e,Re$j.FIXED),this._property._definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this)}),this)}Object.defineProperties(g$q.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),g$q.prototype.getValue=function(e,t){o$1u.defined("time",e);var i=this._times,r=i.length;if(0!==r){var n,o=this._innerType,a=this._values,s=a$14(i,e,a$12.compare);if(s<0){if(0===(s=~s)){var l=i[s];if(n=this._backwardExtrapolationDuration,this._backwardExtrapolationType===_0x33054b.NONE||0!==n&&a$12.secondsDifference(l,e)>n)return;if(this._backwardExtrapolationType===_0x33054b.HOLD)return o.unpack(a,0,t)}if(s>=r){var u=i[s=r-1];if(n=this._forwardExtrapolationDuration,this._forwardExtrapolationType===_0x33054b.NONE||0!==n&&a$12.secondsDifference(e,u)>n)return;if(this._forwardExtrapolationType===_0x33054b.HOLD)return s=r-1,o.unpack(a,s*o.packedLength,t)}var c=this._xTable,h=this._yTable,d=this._interpolationAlgorithm,f=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var _=Math.min(d.getRequiredDataPoints(this._interpolationDegree,p),r);_!==this._numberOfPoints&&(this._numberOfPoints=_,c.length=_,h.length=_*f)}var m=this._numberOfPoints-1;if(m<1)return;var $=0,g=r-1;if(g-$+1>=m+1){var v=s-(m/2|0)-1;v<$&&(v=$);var y=v+m;y>g&&((v=(y=g)-m)<$&&(v=$)),$=v,g=y}for(var x=g-$+1,b=0;b<x;++b)c[b]=a$12.secondsDifference(i[$+b],i[g]);if(e$28(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(a,$,g,h);else for(var w=0,C=this._packedLength,T=$*C,S=(g+1)*C;T<S;)h[w]=a[T],T++,w++;var E,A=a$12.secondsDifference(e,i[g]);if(0!==p&&e$28(d.interpolate)){var P=Math.floor(f/(p+1));E=d.interpolate(A,c,h,P,p,p,this._interpolationResult)}else E=d.interpolateOrderZero(A,c,h,f,this._interpolationResult);return e$28(o.unpackInterpolationResult)?o.unpackInterpolationResult(E,a,$,g,t):o.unpack(E,0,t)}return o.unpack(a,s*this._packedLength,t)}},g$q.prototype.setInterpolationOptions=function(e){if(e$28(e)){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;e$28(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),e$28(r)&&this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},g$q.prototype.addSample=function(e,t,i){var r=this._innerDerivativeTypes,n=e$28(r);o$1u.defined("time",e),o$1u.defined("value",t),n&&o$1u.defined("derivatives",i);var o=this._innerType,a=[];if(a.push(e),o.pack(t,a,a.length),n)for(var s=r.length,l=0;l<s;l++)r[l].pack(i[l],a,a.length);S$p(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},g$q.prototype.addSamples=function(e,t,i){var r=this._innerDerivativeTypes,n=e$28(r);if(o$1u.defined("times",e),o$1u.defined("values",t),e.length!==t.length)throw new t$Z("times and values must be the same length.");if(n&&(!e$28(i)||i.length!==e.length))throw new t$Z("times and derivativeValues must be the same length.");for(var o=this._innerType,a=e.length,s=[],l=0;l<a;l++)if(s.push(e[l]),o.pack(t[l],s,s.length),n)for(var u=i[l],c=r.length,h=0;h<c;h++)r[h].pack(u[h],s,s.length);S$p(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},g$q.prototype.addSamplesPackedArray=function(e,t){o$1u.defined("packedSamples",e),S$p(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},g$q.prototype.removeSample=function(e){o$1u.defined("time",e);var t=a$14(this._times,e,a$12.compare);return!(t<0)&&(z$r(this,t,1),!0)},g$q.prototype.removeSamples=function(e){o$1u.defined("timeInterval",e);var t=this._times,i=a$14(t,e.start,a$12.compare);i<0?i=~i:e.isStartIncluded||++i;var r=a$14(t,e.stop,a$12.compare);r<0?r=~r:e.isStopIncluded&&++r,z$r(this,i,r-i)},g$q.prototype.equals=function(e){if(this===e)return!0;if(!e$28(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t,i,r=this._derivativeTypes,n=e$28(r),o=e._derivativeTypes;if(n!==e$28(o))return!1;if(n){if((i=r.length)!==o.length)return!1;for(t=0;t<i;t++)if(r[t]!==o[t])return!1}var a=this._times,s=e._times;if((i=a.length)!==s.length)return!1;for(t=0;t<i;t++)if(!a$12.equals(a[t],s[t]))return!1;var l=this._values,u=e._values;for(t=0;t<i;t++)if(l[t]!==u[t])return!1;return!0},g$q._mergeNewSamples=S$p,Object.defineProperties(o$J.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),o$J.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},o$J.prototype.getValueInReferenceFrame=function(e,t,i){if(o$1u.defined("time",e),o$1u.defined("referenceFrame",t),e$28(i=this._property.getValue(e,i)))return t$y.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},o$J.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},o$J.prototype.addSample=function(e,t,i){var r=this._numberOfDerivatives;if(r>0&&(!e$28(i)||i.length!==r))throw new t$Z("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,i)},o$J.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},o$J.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},o$J.prototype.removeSample=function(e){this._property.removeSample(e)},o$J.prototype.removeSamples=function(e){this._property.removeSamples(e)},o$J.prototype.equals=function(e){return this===e||e instanceof o$J&&r$K.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var e$H={HORIZONTAL:0,VERTICAL:1},mr$3=Object.freeze(e$H),l$D=mr$3.HORIZONTAL,u$s=e$1S.WHITE,C$t=e$1S.BLACK,p$u=0,_$v=1;function i$t(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}function t$l(e){this._definitionChanged=new o$1o,this._intervals=new c$L,this._intervals.changedEvent.addEventListener(t$l.prototype._intervalsChanged,this),this._referenceFrame=u$Y(e,Re$j.FIXED)}function t$k(){this._definitionChanged=new o$1o,this._intervals=new c$L,this._intervals.changedEvent.addEventListener(t$k.prototype._intervalsChanged,this)}function r$y(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o$1o,this._normalize=u$Y(t,!0),this.position=e}Object.defineProperties(i$t.prototype,{isConstant:{get:function(){return r$K.isConstant(this._orientation)&&r$K.isConstant(this._evenColor)&&r$K.isConstant(this._oddColor)&&r$K.isConstant(this._offset)&&r$K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:C$H("orientation"),evenColor:C$H("evenColor"),oddColor:C$H("oddColor"),offset:C$H("offset"),repeat:C$H("repeat")}),i$t.prototype.getType=function(e){return"Stripe"},i$t.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.horizontal=r$K.getValueOrDefault(this._orientation,e,l$D)===mr$3.HORIZONTAL,t.evenColor=r$K.getValueOrClonedDefault(this._evenColor,e,u$s,t.evenColor),t.oddColor=r$K.getValueOrClonedDefault(this._oddColor,e,C$t,t.oddColor),t.offset=r$K.getValueOrDefault(this._offset,e,p$u),t.repeat=r$K.getValueOrDefault(this._repeat,e,_$v),t},i$t.prototype.equals=function(e){return this===e||e instanceof i$t&&r$K.equals(this._orientation,e._orientation)&&r$K.equals(this._evenColor,e._evenColor)&&r$K.equals(this._oddColor,e._oddColor)&&r$K.equals(this._offset,e._offset)&&r$K.equals(this._repeat,e._repeat)},Object.defineProperties(t$l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),t$l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},t$l.prototype.getValueInReferenceFrame=function(e,t,i){if(!e$28(e))throw new t$Z("time is required.");if(!e$28(t))throw new t$Z("referenceFrame is required.");var r=this._intervals.findDataForIntervalContainingDate(e);if(e$28(r))return t$y.convertToReferenceFrame(e,r,this._referenceFrame,t,i)},t$l.prototype.equals=function(e){return this===e||e instanceof t$l&&this._intervals.equals(e._intervals,r$K.equals)&&this._referenceFrame===e._referenceFrame},t$l.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(t$k.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),t$k.prototype.getValue=function(e,t){if(!e$28(e))throw new t$Z("time is required");var i=this._intervals.findDataForIntervalContainingDate(e);return e$28(i)&&"function"==typeof i.clone?i.clone(t):i},t$k.prototype.equals=function(e){return this===e||e instanceof t$k&&this._intervals.equals(e._intervals,r$K.equals)},t$k.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(r$y.prototype,{isConstant:{get:function(){return r$K.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(e$28(t)&&this._subscription(),this._position=e,e$28(e)&&(this._subscription=e._definitionChanged.addEventListener((function(){this._definitionChanged.raiseEvent(this)}),this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var C$s=new t$X,c$t=new t$X,_$u=new a$12,p$t=1/60;function e$G(e,t){this._velocityVectorProperty=new r$y(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o$1o,this.ellipsoid=u$Y(t,t$V.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener((function(){i._definitionChanged.raiseEvent(i)}))}r$y.prototype.getValue=function(e,t){return this._getValue(e,t)},r$y.prototype._getValue=function(e,t,i){if(!e$28(e))throw new t$Z("time is required");e$28(t)||(t=new t$X);var r=this._position;if(r$K.isConstant(r))return this._normalize?void 0:t$X.clone(t$X.ZERO,t);var n=r.getValue(e,C$s),o=r.getValue(a$12.addSeconds(e,p$t,_$u),c$t);if(e$28(n)&&(e$28(o)||(o=n,e$28(n=r.getValue(a$12.addSeconds(e,-p$t,_$u),c$t))))){if(t$X.equals(n,o))return this._normalize?void 0:t$X.clone(t$X.ZERO,t);e$28(i)&&n.clone(i);var a=t$X.subtract(o,n,t);return this._normalize?t$X.normalize(a,t):t$X.divideByScalar(a,p$t,t)}},r$y.prototype.equals=function(e){return this===e||e instanceof r$y&&r$K.equals(this._position,e._position)},Object.defineProperties(e$G.prototype,{isConstant:{get:function(){return r$K.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var s$l=new t$X,m$v=new t$X,l$C=new p$1a,xr$2;function y$x(){}function U$u(e,t){return"#"===t[0]&&(t=xr$2+t),a$t.fromString(e,t)}function Kr$1(e,t,i){if(e$28(i.reference))return U$u(t,i.reference);if(e$28(i.velocityReference)){var r=U$u(t,i.velocityReference);switch(e){case t$X:case y$x:return new r$y(r,e===y$x);case n$14:return new e$G(r)}}throw new t$U(JSON.stringify(i)+" is not valid CZML.")}function Ye$8(e,t){return new n$G((function(i,r){return t(e.getValue(i,r))}),e.isConstant)}e$G.prototype.getValue=function(e,t){var i=this._velocityVectorProperty._getValue(e,m$v,s$l);if(e$28(i))return m$1b.rotationMatrixFromPositionVelocity(s$l,i,this._ellipsoid,l$C),n$14.fromRotationMatrix(l$C,t)},e$G.prototype.equals=function(e){return this===e||e instanceof e$G&&r$K.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},y$x.packedLength=t$X.packedLength,y$x.unpack=t$X.unpack,y$x.pack=t$X.pack;var g$p=new t$X,B$k=new c$M,x$B=new t$W,Y$m=new d$_,pr$3=new n$14;function Ke$8(e){var t=e.rgbaf;if(e$28(t))return t;var i=e.rgba;if(e$28(i)){var r=i.length;if(r===e$1S.packedLength)return[e$1S.byteToFloat(i[0]),e$1S.byteToFloat(i[1]),e$1S.byteToFloat(i[2]),e$1S.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=e$1S.byteToFloat(i[n+1]),t[n+2]=e$1S.byteToFloat(i[n+2]),t[n+3]=e$1S.byteToFloat(i[n+3]),t[n+4]=e$1S.byteToFloat(i[n+4]);return t}}function $r$1(e,t){var i=u$Y(e.uri,e);return e$28(t)?t.getDerivedResource({url:i}):t$S.createIfNeeded(i)}function $e$6(e){var t=e.wsen;if(e$28(t))return t;var i=e.wsenDegrees;if(e$28(i)){var r=i.length;if(r===h$10.packedLength)return[e$27.toRadians(i[0]),e$27.toRadians(i[1]),e$27.toRadians(i[2]),e$27.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=e$27.toRadians(i[n+1]),t[n+2]=e$27.toRadians(i[n+2]),t[n+3]=e$27.toRadians(i[n+3]),t[n+4]=e$27.toRadians(i[n+4]);return t}}function Ie$d(e){var t=e.length;if(B$k.magnitude=1,2===t)return B$k.clock=e[0],B$k.cone=e[1],t$X.fromSpherical(B$k,g$p),[g$p.x,g$p.y,g$p.z];for(var i=new Array(t/3*4),r=0,n=0;r<t;r+=3,n+=4)i[n]=e[r],B$k.clock=e[r+1],B$k.cone=e[r+2],t$X.fromSpherical(B$k,g$p),i[n+1]=g$p.x,i[n+2]=g$p.y,i[n+3]=g$p.z;return i}function ke$9(e){var t=e.length;if(3===t)return B$k.clock=e[0],B$k.cone=e[1],B$k.magnitude=e[2],t$X.fromSpherical(B$k,g$p),[g$p.x,g$p.y,g$p.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],B$k.clock=e[r+1],B$k.cone=e[r+2],B$k.magnitude=e[r+3],t$X.fromSpherical(B$k,g$p),i[r+1]=g$p.x,i[r+2]=g$p.y,i[r+3]=g$p.z;return i}function je$d(e){var t=e.length;if(3===t)return x$B.longitude=e[0],x$B.latitude=e[1],x$B.height=e[2],t$V.WGS84.cartographicToCartesian(x$B,g$p),[g$p.x,g$p.y,g$p.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],x$B.longitude=e[r+1],x$B.latitude=e[r+2],x$B.height=e[r+3],t$V.WGS84.cartographicToCartesian(x$B,g$p),i[r+1]=g$p.x,i[r+2]=g$p.y,i[r+3]=g$p.z;return i}function ze$8(e){var t=e.length;if(3===t)return x$B.longitude=e$27.toRadians(e[0]),x$B.latitude=e$27.toRadians(e[1]),x$B.height=e[2],t$V.WGS84.cartographicToCartesian(x$B,g$p),[g$p.x,g$p.y,g$p.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],x$B.longitude=e$27.toRadians(e[r+1]),x$B.latitude=e$27.toRadians(e[r+2]),x$B.height=e[r+3],t$V.WGS84.cartographicToCartesian(x$B,g$p),i[r+1]=g$p.x,i[r+2]=g$p.y,i[r+3]=g$p.z;return i}function _r$1(e){var t=e.cartesian;if(e$28(t))return t;var i=e.cartesianVelocity;if(e$28(i))return i;var r=e.unitCartesian;if(e$28(r))return r;var n=e.unitSpherical;if(e$28(n))return Ie$d(n);var o=e.spherical;if(e$28(o))return ke$9(o);var a=e.cartographicRadians;if(e$28(a))return je$d(a);var s=e.cartographicDegrees;if(e$28(s))return ze$8(s);throw new t$U(JSON.stringify(e)+" is not a valid CZML interval.")}function Ir$1(e,t){t$X.unpack(e,t,g$p),t$X.normalize(g$p,g$p),t$X.pack(g$p,e,t)}function Ce$d(e){var t=_r$1(e);if(3===t.length)return Ir$1(t,0),t;for(var i=1;i<t.length;i+=4)Ir$1(t,i);return t}function kr$2(e,t){n$14.unpack(e,t,pr$3),n$14.normalize(pr$3,pr$3),n$14.pack(pr$3,e,t)}function Ue$d(e){var t=e.unitQuaternion;if(e$28(t)){if(4===t.length)return kr$2(t,0),t;for(var i=1;i<t.length;i+=5)kr$2(t,i)}return t}function jr$3(e){return"boolean"==typeof e?Boolean:"number"==typeof e?Number:"string"==typeof e?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?f$10:e.hasOwnProperty("cartesian2")?o$1k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?t$X:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?y$x:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?e$1S:e.hasOwnProperty("arcType")?m$_:e.hasOwnProperty("classificationType")?L$V:e.hasOwnProperty("colorBlendMode")?I$X:e.hasOwnProperty("cornerType")?ar$a:e.hasOwnProperty("heightReference")?k$_:e.hasOwnProperty("horizontalOrigin")?j$13:e.hasOwnProperty("date")?a$12:e.hasOwnProperty("labelStyle")?R$t:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?o$1b:e.hasOwnProperty("distanceDisplayCondition")?r$10:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?n$14:e.hasOwnProperty("shadowMode")?q$L:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?mr$3:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?h$10:e.hasOwnProperty("uri")?h$$:e.hasOwnProperty("verticalOrigin")?S$L:Object}function rn$3(e,t,i){switch(e){case m$_:return m$_[u$Y(t.arcType,t)];case Array:return t.array;case Boolean:return u$Y(t.boolean,t);case f$10:return t.boundingRectangle;case o$1k:return t.cartesian2;case t$X:return _r$1(t);case y$x:return Ce$d(t);case e$1S:return Ke$8(t);case L$V:return L$V[u$Y(t.classificationType,t)];case I$X:return I$X[u$Y(t.colorBlendMode,t)];case ar$a:return ar$a[u$Y(t.cornerType,t)];case k$_:return k$_[u$Y(t.heightReference,t)];case j$13:return j$13[u$Y(t.horizontalOrigin,t)];case Image:return $r$1(t,i);case a$12:return a$12.fromIso8601(u$Y(t.date,t));case R$t:return R$t[u$Y(t.labelStyle,t)];case Number:return u$Y(t.number,t);case o$1b:return t.nearFarScalar;case r$10:return t.distanceDisplayCondition;case Object:return u$Y(u$Y(t.object,t.value),t);case n$14:return Ue$d(t);case m$w:return u$Y(t.number,t);case q$L:return q$L[u$Y(u$Y(t.shadowMode,t.shadows),t)];case String:return u$Y(t.string,t);case mr$3:return mr$3[u$Y(t.stripeOrientation,t)];case h$10:return $e$6(t);case h$$:return $r$1(t,i);case S$L:return S$L[u$Y(t.verticalOrigin,t)];default:throw new t$U(e)}}var en$3={HERMITE:E$V,LAGRANGE:i$M,LINEAR:v$F};function lr$2(e,t){var i=e.interpolationAlgorithm,r=e.interpolationDegree;(e$28(i)||e$28(r))&&t.setInterpolationOptions({interpolationAlgorithm:en$3[i],interpolationDegree:r});var n=e.forwardExtrapolationType;e$28(n)&&(t.forwardExtrapolationType=_0x33054b[n]);var o=e.forwardExtrapolationDuration;e$28(o)&&(t.forwardExtrapolationDuration=o);var a=e.backwardExtrapolationType;e$28(a)&&(t.backwardExtrapolationType=_0x33054b[a]);var s=e.backwardExtrapolationDuration;e$28(s)&&(t.backwardExtrapolationDuration=s)}var zr$2={iso8601:void 0};function b$C(e){if(e$28(e))return zr$2.iso8601=e,d$_.fromIso8601(zr$2)}function Br(e){var t=o$11.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Cr$1(e){var t=new e$L;return t.intervals.addInterval(Br(e)),t}function Ur$2(e){var t=new t$q(e.referenceFrame);return t.intervals.addInterval(Br(e)),t}function gr$3(e,t,i,r,n,o,a){var s=b$C(r.interval);e$28(n)&&(s=e$28(s)?d$_.intersect(s,n,Y$m):n);var l,u,c,h=!e$28(r.reference)&&!e$28(r.velocityReference),d=e$28(s)&&!s.equals(o$11.MAXIMUM_INTERVAL);if(!0===r.delete)return d?re$i(t[i],s):void(t[i]=void 0);var f=!1;if(h){if(!e$28(u=rn$3(e,r,o)))return;l=u$Y(e.packedLength,1),c=u$Y(u.length,1),f=!e$28(r.array)&&"string"!=typeof u&&c>l&&e!==Object}var p="function"==typeof e.unpack&&e!==m$w;if(f||d){var _,m,$=t[i],g=r.epoch;if(e$28(g)&&(_=a$12.fromIso8601(g)),f&&!d)return $ instanceof g$q||(t[i]=$=new g$q(e)),$.addSamplesPackedArray(u,_),void lr$2(r,$);if(!f&&d)return(s=s.clone()).data=h?p?e.unpack(u,0):u:Kr$1(e,a,r),e$28($)||(t[i]=$=h?new t$k:new e$L),void(h&&$ instanceof t$k?$.intervals.addInterval(s):$ instanceof e$L?(h&&(s.data=new e$1d(s.data)),$.intervals.addInterval(s)):(t[i]=$=Cr$1($),h&&(s.data=new e$1d(s.data)),$.intervals.addInterval(s)));e$28($)||(t[i]=$=new e$L),$ instanceof e$L||(t[i]=$=Cr$1($));var v=$.intervals;(!e$28(m=v.findInterval(s))||!(m.data instanceof g$q))&&((m=s.clone()).data=new g$q(e),v.addInterval(m)),m.data.addSamplesPackedArray(u,_),lr$2(r,m.data)}else t[i]=h?new e$1d(p?e.unpack(u,0):u):Kr$1(e,a,r)}function re$i(e,t){if(e instanceof g$q)e.removeSamples(t);else if(e instanceof t$k)e.intervals.removeInterval(t);else if(e instanceof e$L){for(var i=e.intervals,r=0;r<i.length;++r){var n=d$_.intersect(i.get(r),t,Y$m);n.isEmpty||re$i(n.data,t)}i.removeInterval(t)}else;}function f$v(e,t,i,r,n,o,a){if(e$28(r))if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)gr$3(e,t,i,r[s],n,o,a);else gr$3(e,t,i,r,n,o,a)}function ee$o(e,t,i,r,n,o){var a=b$C(i.interval);e$28(r)&&(a=e$28(a)?d$_.intersect(a,r,Y$m):r);var s,l=e$28(i.cartesianVelocity)?1:0,u=t$X.packedLength*(l+1),c=!e$28(i.reference),h=e$28(a)&&!a.equals(o$11.MAXIMUM_INTERVAL);if(!0===i.delete)return h?ne$m(e[t],a):void(e[t]=void 0);var d,f=!1;if(c&&(e$28(i.referenceFrame)&&(d=Re$j[i.referenceFrame]),d=u$Y(d,Re$j.FIXED),f=u$Y((s=_r$1(i)).length,1)>u),f||h){var p,_,m=e[t],$=i.epoch;if(e$28($)&&(p=a$12.fromIso8601($)),f&&!h)return(!(m instanceof o$J)||e$28(d)&&m.referenceFrame!==d)&&(e[t]=m=new o$J(d,l)),m.addSamplesPackedArray(s,p),void lr$2(i,m);if(!f&&h)return(a=a.clone()).data=c?t$X.unpack(s):U$u(o,i.reference),e$28(m)||(m=c?new t$l(d):new t$q(d),e[t]=m),void(c&&m instanceof t$l&&e$28(d)&&m.referenceFrame===d?m.intervals.addInterval(a):m instanceof t$q?(c&&(a.data=new r$G(a.data,d)),m.intervals.addInterval(a)):(e[t]=m=Ur$2(m),c&&(a.data=new r$G(a.data,d)),m.intervals.addInterval(a)));e$28(m)?m instanceof t$q||(e[t]=m=Ur$2(m)):e[t]=m=new t$q(d);var g=m.intervals;(!e$28(_=g.findInterval(a))||!(_.data instanceof o$J)||e$28(d)&&_.data.referenceFrame!==d)&&((_=a.clone()).data=new o$J(d,l),g.addInterval(_)),_.data.addSamplesPackedArray(s,p),lr$2(i,_.data)}else e[t]=c?new r$G(t$X.unpack(s),d):U$u(o,i.reference)}function ne$m(e,t){if(e instanceof o$J)e.removeSamples(t);else if(e instanceof t$l)e.intervals.removeInterval(t);else if(e instanceof t$q){for(var i=e.intervals,r=0;r<i.length;++r){var n=d$_.intersect(i.get(r),t,Y$m);n.isEmpty||ne$m(n.data,t)}i.removeInterval(t)}else;}function ae$g(e,t,i,r,n,o){if(e$28(i))if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)ee$o(e,t,i[a],r,n,o);else ee$o(e,t,i,r,n,o)}function ie$i(e,t,i,r,n,o){var a=b$C(i.interval);e$28(r)&&(a=e$28(a)?d$_.intersect(a,r,Y$m):r);var s,l,u,c=e[t];if(e$28(a)){c instanceof e$K||(c=new e$K,e[t]=c);var h=c.intervals;e$28(l=h.findInterval({start:a.start,stop:a.stop}))?s=l.data:(l=a.clone(),h.addInterval(l))}else s=c;e$28(i.solidColor)?(s instanceof t$z||(s=new t$z),f$v(e$1S,s,"color",(u=i.solidColor).color,void 0,void 0,o)):e$28(i.grid)?(s instanceof t$o||(s=new t$o),f$v(e$1S,s,"color",(u=i.grid).color,void 0,n,o),f$v(Number,s,"cellAlpha",u.cellAlpha,void 0,n,o),f$v(o$1k,s,"lineCount",u.lineCount,void 0,n,o),f$v(o$1k,s,"lineThickness",u.lineThickness,void 0,n,o),f$v(o$1k,s,"lineOffset",u.lineOffset,void 0,n,o)):e$28(i.image)?(s instanceof a$N||(s=new a$N),u=i.image,f$v(Image,s,"image",u.image,void 0,n,o),f$v(o$1k,s,"repeat",u.repeat,void 0,n,o),f$v(e$1S,s,"color",u.color,void 0,n,o),f$v(Boolean,s,"transparent",u.transparent,void 0,n,o)):e$28(i.stripe)?(s instanceof i$t||(s=new i$t),u=i.stripe,f$v(mr$3,s,"orientation",u.orientation,void 0,n,o),f$v(e$1S,s,"evenColor",u.evenColor,void 0,n,o),f$v(e$1S,s,"oddColor",u.oddColor,void 0,n,o),f$v(Number,s,"offset",u.offset,void 0,n,o),f$v(Number,s,"repeat",u.repeat,void 0,n,o)):e$28(i.polylineOutline)?(s instanceof e$I||(s=new e$I),f$v(e$1S,s,"color",(u=i.polylineOutline).color,void 0,n,o),f$v(e$1S,s,"outlineColor",u.outlineColor,void 0,n,o),f$v(Number,s,"outlineWidth",u.outlineWidth,void 0,n,o)):e$28(i.polylineGlow)?(s instanceof t$m||(s=new t$m),f$v(e$1S,s,"color",(u=i.polylineGlow).color,void 0,n,o),f$v(Number,s,"glowPower",u.glowPower,void 0,n,o),f$v(Number,s,"taperPower",u.taperPower,void 0,n,o)):e$28(i.polylineArrow)?(s instanceof t$n||(s=new t$n),f$v(e$1S,s,"color",(u=i.polylineArrow).color,void 0,void 0,o)):e$28(i.polylineDash)?(s instanceof o$K||(s=new o$K),f$v(e$1S,s,"color",(u=i.polylineDash).color,void 0,void 0,o),f$v(e$1S,s,"gapColor",u.gapColor,void 0,void 0,o),f$v(Number,s,"dashLength",u.dashLength,void 0,n,o),f$v(Number,s,"dashPattern",u.dashPattern,void 0,n,o)):e$28(i.checkerboard)&&(s instanceof r$A||(s=new r$A),f$v(e$1S,s,"evenColor",(u=i.checkerboard).evenColor,void 0,n,o),f$v(e$1S,s,"oddColor",u.oddColor,void 0,n,o),f$v(o$1k,s,"repeat",u.repeat,void 0,n,o)),e$28(l)?l.data=s:e[t]=s}function L$y(e,t,i,r,n,o){if(e$28(i))if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)ie$i(e,t,i[a],r,n,o);else ie$i(e,t,i,r,n,o)}function nn$2(e,t,i,r){e$28(t.name)&&(e.name=t.name)}function an$2(e,t,i,r){var n=t.description;e$28(n)&&f$v(String,e,"description",n,void 0,r,i)}function on$1(e,t,i,r){var n=t.position;e$28(n)&&ae$g(e,"position",n,void 0,r,i)}function sn$2(e,t,i,r){var n=t.viewFrom;e$28(n)&&f$v(t$X,e,"viewFrom",n,void 0,r,i)}function fn$1(e,t,i,r){var n=t.orientation;e$28(n)&&f$v(n$14,e,"orientation",n,void 0,r,i)}function tn$2(e,t,i,r){var n=t.properties;if(e$28(n))for(var o in e$28(e.properties)||(e.properties=new f$L),n)if(n.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);var a=n[o];if(Array.isArray(a))for(var s=0,l=a.length;s<l;++s)gr$3(jr$3(a[s]),e.properties,o,a[s],void 0,r,i);else gr$3(jr$3(a),e.properties,o,a,void 0,r,i)}}function Mr$1(e,t,i,r,n,o,a){var s=i.map((function(e){return U$u(n,e)}));if(e$28(r)){r=b$C(r);var l=e[t];if(!(l instanceof a)){var u=new a;u.intervals.addInterval(Br(l)),e[t]=l=u}r.data=new o(s),l.intervals.addInterval(r)}else e[t]=new o(s)}function oe$h(e,t,i,r){var n=i.references;e$28(n)?Mr$1(e,t,n,i.interval,r,i$u,e$L):f$v(Array,e,t,i,void 0,void 0,r)}function se$e(e,t,i,r){if(e$28(i))if(Array.isArray(i))for(var n=0,o=i.length;n<o;++n)oe$h(e,t,i[n],r);else oe$h(e,t,i,r)}function fe$e(e,t,i,r){var n=i.references;e$28(n)?Mr$1(e,t,n,i.interval,r,n$r,t$q):(e$28(i.cartesian)?i.array=t$X.unpackArray(i.cartesian):e$28(i.cartographicRadians)?i.array=t$X.fromRadiansArrayHeights(i.cartographicRadians):e$28(i.cartographicDegrees)&&(i.array=t$X.fromDegreesArrayHeights(i.cartographicDegrees)),e$28(i.array)&&f$v(Array,e,t,i,void 0,void 0,r))}function vr$1(e,t,i,r){if(e$28(i))if(Array.isArray(i))for(var n=0,o=i.length;n<o;++n)fe$e(e,t,i[n],r);else fe$e(e,t,i,r)}function dn$2(e){return t$X.unpackArray(e)}function un$1(e){return t$X.fromRadiansArrayHeights(e)}function hn$1(e){return t$X.fromDegreesArrayHeights(e)}function te$n(e,t,i,r){var n=i.references;if(e$28(n)){var o=n.map((function(e){var t={};return Mr$1(t,"positions",e,i.interval,r,n$r,t$q),t.positions}));e[t]=new n$r(o)}else e$28(i.cartesian)?i.array=i.cartesian.map(dn$2):e$28(i.cartographicRadians)?i.array=i.cartographicRadians.map(un$1):e$28(i.cartographicDegrees)&&(i.array=i.cartographicDegrees.map(hn$1)),e$28(i.array)&&f$v(Array,e,t,i,void 0,void 0,r)}function mn$1(e,t,i,r){if(e$28(i))if(Array.isArray(i))for(var n=0,o=i.length;n<o;++n)te$n(e,t,i[n],r);else te$n(e,t,i,r)}function pn$1(e,t,i,r){var n=t.availability;if(e$28(n)){var o;if(Array.isArray(n))for(var a=0,s=n.length;a<s;++a)e$28(o)||(o=new c$L),o.addInterval(b$C(n[a]));else(o=new c$L).addInterval(b$C(n));e.availability=o}}function ln$2(e,t,i,r,n){!e$28(t)||f$v(y$x,e,"alignedAxis",t,i,r,n)}function gn$1(e,t,i,r){var n=t.billboard;if(e$28(n)){var o=b$C(n.interval),a=e.billboard;e$28(a)||(e.billboard=a=new n$I),f$v(Boolean,a,"show",n.show,o,r,i),f$v(Image,a,"image",n.image,o,r,i),f$v(Number,a,"scale",n.scale,o,r,i),f$v(o$1k,a,"pixelOffset",n.pixelOffset,o,r,i),f$v(t$X,a,"eyeOffset",n.eyeOffset,o,r,i),f$v(j$13,a,"horizontalOrigin",n.horizontalOrigin,o,r,i),f$v(S$L,a,"verticalOrigin",n.verticalOrigin,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(e$1S,a,"color",n.color,o,r,i),f$v(m$w,a,"rotation",n.rotation,o,r,i),ln$2(a,n.alignedAxis,o,r,i),f$v(Boolean,a,"sizeInMeters",n.sizeInMeters,o,r,i),f$v(Number,a,"width",n.width,o,r,i),f$v(Number,a,"height",n.height,o,r,i),f$v(o$1b,a,"scaleByDistance",n.scaleByDistance,o,r,i),f$v(o$1b,a,"translucencyByDistance",n.translucencyByDistance,o,r,i),f$v(o$1b,a,"pixelOffsetScaleByDistance",n.pixelOffsetScaleByDistance,o,r,i),f$v(f$10,a,"imageSubRegion",n.imageSubRegion,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(Number,a,"disableDepthTestDistance",n.disableDepthTestDistance,o,r,i)}}function vn$1(e,t,i,r){var n=t.box;if(e$28(n)){var o=b$C(n.interval),a=e.box;e$28(a)||(e.box=a=new n$F),f$v(Boolean,a,"show",n.show,o,r,i),f$v(t$X,a,"dimensions",n.dimensions,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function wn$1(e,t,i,r){var n=t.corridor;if(e$28(n)){var o=b$C(n.interval),a=e.corridor;e$28(a)||(e.corridor=a=new n$E),f$v(Boolean,a,"show",n.show,o,r,i),vr$1(a,"positions",n.positions,i),f$v(Number,a,"width",n.width,o,r,i),f$v(Number,a,"height",n.height,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),f$v(k$_,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),f$v(ar$a,a,"cornerType",n.cornerType,o,r,i),f$v(Number,a,"granularity",n.granularity,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(L$V,a,"classificationType",n.classificationType,o,r,i),f$v(Number,a,"zIndex",n.zIndex,o,r,i)}}function Pn$1(e,t,i,r){var n=t.cylinder;if(e$28(n)){var o=b$C(n.interval),a=e.cylinder;e$28(a)||(e.cylinder=a=new n$D),f$v(Boolean,a,"show",n.show,o,r,i),f$v(Number,a,"length",n.length,o,r,i),f$v(Number,a,"topRadius",n.topRadius,o,r,i),f$v(Number,a,"bottomRadius",n.bottomRadius,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(Number,a,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),f$v(Number,a,"slices",n.slices,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function bn$2(e,t){var i=e.version;if(e$28(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new t$U("Cesium only supports CZML version 1.");t._version=i}}if(!e$28(t._version))throw new t$U("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;e$28(e.name)&&(n.name=e.name);var o=e.clock;if(e$28(o)){var a=n.clock;e$28(a)?(a.interval=u$Y(o.interval,a.interval),a.currentTime=u$Y(o.currentTime,a.currentTime),a.range=u$Y(o.range,a.range),a.step=u$Y(o.step,a.step),a.multiplier=u$Y(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function On$2(e,t,i,r){var n=t.ellipse;if(e$28(n)){var o=b$C(n.interval),a=e.ellipse;e$28(a)||(e.ellipse=a=new n$C),f$v(Boolean,a,"show",n.show,o,r,i),f$v(Number,a,"semiMajorAxis",n.semiMajorAxis,o,r,i),f$v(Number,a,"semiMinorAxis",n.semiMinorAxis,o,r,i),f$v(Number,a,"height",n.height,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),f$v(k$_,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),f$v(m$w,a,"rotation",n.rotation,o,r,i),f$v(m$w,a,"stRotation",n.stRotation,o,r,i),f$v(Number,a,"granularity",n.granularity,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(Number,a,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(L$V,a,"classificationType",n.classificationType,o,r,i),f$v(Number,a,"zIndex",n.zIndex,o,r,i)}}function Tn$2(e,t,i,r){var n=t.ellipsoid;if(e$28(n)){var o=b$C(n.interval),a=e.ellipsoid;e$28(a)||(e.ellipsoid=a=new e$16),f$v(Boolean,a,"show",n.show,o,r,i),f$v(t$X,a,"radii",n.radii,o,r,i),f$v(t$X,a,"innerRadii",n.innerRadii,o,r,i),f$v(Number,a,"minimumClock",n.minimumClock,o,r,i),f$v(Number,a,"maximumClock",n.maximumClock,o,r,i),f$v(Number,a,"minimumCone",n.minimumCone,o,r,i),f$v(Number,a,"maximumCone",n.maximumCone,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(Number,a,"stackPartitions",n.stackPartitions,o,r,i),f$v(Number,a,"slicePartitions",n.slicePartitions,o,r,i),f$v(Number,a,"subdivisions",n.subdivisions,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function An$2(e,t,i,r){var n=t.label;if(e$28(n)){var o=b$C(n.interval),a=e.label;e$28(a)||(e.label=a=new n$B),f$v(Boolean,a,"show",n.show,o,r,i),f$v(String,a,"text",n.text,o,r,i),f$v(String,a,"font",n.font,o,r,i),f$v(R$t,a,"style",n.style,o,r,i),f$v(Number,a,"scale",n.scale,o,r,i),f$v(Boolean,a,"showBackground",n.showBackground,o,r,i),f$v(e$1S,a,"backgroundColor",n.backgroundColor,o,r,i),f$v(o$1k,a,"backgroundPadding",n.backgroundPadding,o,r,i),f$v(o$1k,a,"pixelOffset",n.pixelOffset,o,r,i),f$v(t$X,a,"eyeOffset",n.eyeOffset,o,r,i),f$v(j$13,a,"horizontalOrigin",n.horizontalOrigin,o,r,i),f$v(S$L,a,"verticalOrigin",n.verticalOrigin,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(e$1S,a,"fillColor",n.fillColor,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(o$1b,a,"translucencyByDistance",n.translucencyByDistance,o,r,i),f$v(o$1b,a,"pixelOffsetScaleByDistance",n.pixelOffsetScaleByDistance,o,r,i),f$v(o$1b,a,"scaleByDistance",n.scaleByDistance,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(Number,a,"disableDepthTestDistance",n.disableDepthTestDistance,o,r,i)}}function Rn$2(e,t,i,r){var n=t.model;if(e$28(n)){var o=b$C(n.interval),a=e.model;e$28(a)||(e.model=a=new t$x),f$v(Boolean,a,"show",n.show,o,r,i),f$v(h$$,a,"uri",n.gltf,o,r,i),f$v(Number,a,"scale",n.scale,o,r,i),f$v(Number,a,"minimumPixelSize",n.minimumPixelSize,o,r,i),f$v(Number,a,"maximumScale",n.maximumScale,o,r,i),f$v(Boolean,a,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),f$v(Boolean,a,"runAnimations",n.runAnimations,o,r,i),f$v(Boolean,a,"clampAnimations",n.clampAnimations,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(e$1S,a,"silhouetteColor",n.silhouetteColor,o,r,i),f$v(Number,a,"silhouetteSize",n.silhouetteSize,o,r,i),f$v(e$1S,a,"color",n.color,o,r,i),f$v(I$X,a,"colorBlendMode",n.colorBlendMode,o,r,i),f$v(Number,a,"colorBlendAmount",n.colorBlendAmount,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i);var s,l,u=n.nodeTransformations;if(e$28(u))if(Array.isArray(u))for(s=0,l=u.length;s<l;++s)de$f(a,u[s],o,r,i);else de$f(a,u,o,r,i);var c=n.articulations;if(e$28(c))if(Array.isArray(c))for(s=0,l=c.length;s<l;++s)ue$d(a,c[s],o,r,i);else ue$d(a,c,o,r,i)}}function de$f(e,t,i,r,n){var o=b$C(t.interval);e$28(i)&&(o=e$28(o)?d$_.intersect(o,i,Y$m):i);for(var a=e.nodeTransformations,s=Object.keys(t),l=0,u=s.length;l<u;++l){var c=s[l];if("interval"!==c){var h=t[c];if(e$28(h)){e$28(a)||(e.nodeTransformations=a=new f$L),a.hasProperty(c)||a.addProperty(c);var d=a[c];e$28(d)||(a[c]=d=new a$K),f$v(t$X,d,"translation",h.translation,o,r,n),f$v(n$14,d,"rotation",h.rotation,o,r,n),f$v(t$X,d,"scale",h.scale,o,r,n)}}}}function ue$d(e,t,i,r,n){var o=b$C(t.interval);e$28(i)&&(o=e$28(o)?d$_.intersect(o,i,Y$m):i);for(var a=e.articulations,s=Object.keys(t),l=0,u=s.length;l<u;++l){var c=s[l];if("interval"!==c){var h=t[c];!e$28(h)||(e$28(a)||(e.articulations=a=new f$L),a.hasProperty(c)||a.addProperty(c),f$v(Number,a,c,h,o,r,n))}}}function xn$2(e,t,i,r){var n=t.path;if(e$28(n)){var o=b$C(n.interval),a=e.path;e$28(a)||(e.path=a=new n$A),f$v(Boolean,a,"show",n.show,o,r,i),f$v(Number,a,"leadTime",n.leadTime,o,r,i),f$v(Number,a,"trailTime",n.trailTime,o,r,i),f$v(Number,a,"width",n.width,o,r,i),f$v(Number,a,"resolution",n.resolution,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function _n$1(e,t,i,r){var n=t.point;if(e$28(n)){var o=b$C(n.interval),a=e.point;e$28(a)||(e.point=a=new n$z),f$v(Boolean,a,"show",n.show,o,r,i),f$v(Number,a,"pixelSize",n.pixelSize,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(e$1S,a,"color",n.color,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(o$1b,a,"scaleByDistance",n.scaleByDistance,o,r,i),f$v(o$1b,a,"translucencyByDistance",n.translucencyByDistance,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(Number,a,"disableDepthTestDistance",n.disableDepthTestDistance,o,r,i)}}function rr$4(e){this.polygon=e,this._definitionChanged=new o$1o}function Bn$3(e,t,i,r){var n=t.polygon;if(e$28(n)){var o=b$C(n.interval),a=e.polygon;e$28(a)||(e.polygon=a=new u$B),f$v(Boolean,a,"show",n.show,o,r,i),vr$1(a,"_positions",n.positions,i),mn$1(a,"_holes",n.holes,i),(e$28(a._positions)||e$28(a._holes))&&(a.hierarchy=new rr$4(a)),f$v(Number,a,"height",n.height,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),f$v(k$_,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),f$v(m$w,a,"stRotation",n.stRotation,o,r,i),f$v(Number,a,"granularity",n.granularity,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(Boolean,a,"perPositionHeight",n.perPositionHeight,o,r,i),f$v(Boolean,a,"closeTop",n.closeTop,o,r,i),f$v(Boolean,a,"closeBottom",n.closeBottom,o,r,i),f$v(m$_,a,"arcType",n.arcType,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(L$V,a,"classificationType",n.classificationType,o,r,i),f$v(Number,a,"zIndex",n.zIndex,o,r,i)}}function Mn$2(e){return e?m$_.GEODESIC:m$_.NONE}function En$2(e,t,i,r){var n=t.polyline;if(e$28(n)){var o=b$C(n.interval),a=e.polyline;if(e$28(a)||(e.polyline=a=new a$I),f$v(Boolean,a,"show",n.show,o,r,i),vr$1(a,"positions",n.positions,i),f$v(Number,a,"width",n.width,o,r,i),f$v(Number,a,"granularity",n.granularity,o,r,i),L$y(a,"material",n.material,o,r,i),L$y(a,"depthFailMaterial",n.depthFailMaterial,o,r,i),f$v(m$_,a,"arcType",n.arcType,o,r,i),f$v(Boolean,a,"clampToGround",n.clampToGround,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(L$V,a,"classificationType",n.classificationType,o,r,i),f$v(Number,a,"zIndex",n.zIndex,o,r,i),e$28(n.followSurface)&&!e$28(n.arcType)){var s={};f$v(Boolean,s,"followSurface",n.followSurface,o,r,i),a.arcType=Ye$8(s.followSurface,Mn$2)}}}function Nn$2(e,t,i,r){var n=t.rectangle;if(e$28(n)){var o=b$C(n.interval),a=e.rectangle;e$28(a)||(e.rectangle=a=new n$y),f$v(Boolean,a,"show",n.show,o,r,i),f$v(h$10,a,"coordinates",n.coordinates,o,r,i),f$v(Number,a,"height",n.height,o,r,i),f$v(k$_,a,"heightReference",n.heightReference,o,r,i),f$v(Number,a,"extrudedHeight",n.extrudedHeight,o,r,i),f$v(k$_,a,"extrudedHeightReference",n.extrudedHeightReference,o,r,i),f$v(m$w,a,"rotation",n.rotation,o,r,i),f$v(m$w,a,"stRotation",n.stRotation,o,r,i),f$v(Number,a,"granularity",n.granularity,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i),f$v(L$V,a,"classificationType",n.classificationType,o,r,i),f$v(Number,a,"zIndex",n.zIndex,o,r,i)}}function Ln$3(e,t,i,r){var n=t.tileset;if(e$28(n)){var o=b$C(n.interval),a=e.tileset;e$28(a)||(e.tileset=a=new i$G),f$v(Boolean,a,"show",n.show,o,r,i),f$v(h$$,a,"uri",n.uri,o,r,i),f$v(Number,a,"maximumScreenSpaceError",n.maximumScreenSpaceError,o,r,i)}}function Sn$3(e,t,i,r){var n=t.wall;if(e$28(n)){var o=b$C(n.interval),a=e.wall;e$28(a)||(e.wall=a=new e$12),f$v(Boolean,a,"show",n.show,o,r,i),vr$1(a,"positions",n.positions,i),se$e(a,"minimumHeights",n.minimumHeights,i),se$e(a,"maximumHeights",n.maximumHeights,i),f$v(Number,a,"granularity",n.granularity,o,r,i),f$v(Boolean,a,"fill",n.fill,o,r,i),L$y(a,"material",n.material,o,r,i),f$v(Boolean,a,"outline",n.outline,o,r,i),f$v(e$1S,a,"outlineColor",n.outlineColor,o,r,i),f$v(Number,a,"outlineWidth",n.outlineWidth,o,r,i),f$v(q$L,a,"shadows",n.shadows,o,r,i),f$v(r$10,a,"distanceDisplayCondition",n.distanceDisplayCondition,o,r,i)}}function he$e(e,t,i,r,n){var o=e.id;if(e$28(o)||(o=e$1K()),xr$2=o,!e$28(n._version)&&"document"!==o)throw new t$U("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(o);else if("document"===o)bn$2(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;e$28(s)&&(a.parent=t.getOrCreateEntity(s));for(var l=i.length-1;l>-1;l--)i[l](a,e,t,r)}xr$2=void 0}function Hn$2(e){var t,i=e._documentPacket.clock;if(!e$28(i)){if(!e$28(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(o$11.MINIMUM_VALUE)){var n=r.start,o=r.stop,a=a$12.secondsDifference(o,n),s=Math.round(a/120);return(t=new e$J).startTime=a$12.clone(n),t.stopTime=a$12.clone(o),t.clockRange=tt$f.LOOP_STOP,t.multiplier=s,t.currentTime=a$12.clone(n),t.clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}e$28(e._clock)?t=e._clock.clone():((t=new e$J).startTime=o$11.MINIMUM_VALUE.clone(),t.stopTime=o$11.MAXIMUM_VALUE.clone(),t.currentTime=o$11.MINIMUM_VALUE.clone(),t.clockRange=tt$f.LOOP_STOP,t.clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);var l=b$C(i.interval);return e$28(l)&&(t.startTime=l.start,t.stopTime=l.stop),e$28(i.currentTime)&&(t.currentTime=a$12.fromIso8601(i.currentTime)),e$28(i.range)&&(t.clockRange=u$Y(tt$f[i.range],tt$f.LOOP_STOP)),e$28(i.step)&&(t.clockStep=u$Y(g$N[i.step],g$N.SYSTEM_CLOCK_MULTIPLIER)),e$28(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function me$h(e,t,i,r){if(!e$28(t))throw new t$Z("czml is required.");var n=t,o=(i=u$Y(i,u$Y.EMPTY_OBJECT)).sourceUri,a=i.credit;if("string"==typeof a&&(a=new r$1a(a)),e._credit=a,"string"==typeof t||t instanceof t$S){n=(t=t$S.createIfNeeded(t)).fetchJson(),o=u$Y(o,t.clone());var s=e._resourceCredits,l=t.credits;if(e$28(l))for(var u=l.length,c=0;c<u;c++)s.push(l[c])}return o=t$S.createIfNeeded(o),o$L.setLoading(e,!0),o$1q(n,(function(t){return cn$1(e,t,o,r)})).otherwise((function(t){return o$L.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),o$1q.reject(t)}))}function cn$1(e,t,i,r){o$L.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new pe$i,n.removeAll()),E$y._processCzml(t,n,i,void 0,e);var o=Hn$2(e),a=e._documentPacket;return e$28(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!e$28(e._name)&&e$28(i)&&(e._name=f$V(i.getUrlComponent()),o=!0),o$L.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function pe$i(){this.name=void 0,this.clock=void 0}function E$y(e){this._name=e,this._changed=new o$1o,this._error=new o$1o,this._isLoading=!1,this._loading=new o$1o,this._clock=void 0,this._documentPacket=new pe$i,this._version=void 0,this._entityCollection=new r$z(this),this._entityCluster=new a$v,this._credit=void 0,this._resourceCredits=[]}function i$s(){this._dataSources=[],this._dataSourceAdded=new o$1o,this._dataSourceRemoved=new o$1o,this._dataSourceMoved=new o$1o}function c$s(e,t){if(!e$28(t))throw new t$Z("dataSource is required.");var i=e.indexOf(t);if(-1===i)throw new t$Z("dataSource is not in this collection.");return i}function _$t(e,t,i){var r=e._dataSources,n=r.length-1;if((t=e$27.clamp(t,0,n))!==(i=e$27.clamp(i,0,n))){var o=r[t];r[t]=r[i],r[i]=o,e.dataSourceMoved.raiseEvent(o,i,t)}}function o$I(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._primitives=[],this._guid=e$1K(),this._zIndex=void 0,this.show=u$Y(e.show,!0),this.destroyPrimitives=u$Y(e.destroyPrimitives,!0)}function a$s(e,t){if(!e.contains(t))throw new t$Z("primitive is not in this collection.");return e._primitives.indexOf(t)}function r$x(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}function r$w(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new e$1P}Object.defineProperties(rr$4.prototype,{isConstant:{get:function(){var e=this.polygon._positions,t=this.polygon._holes;return(!e$28(e)||e.isConstant)&&(!e$28(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}}),rr$4.prototype.getValue=function(e,t){var i,r;return e$28(this.polygon._positions)&&(i=this.polygon._positions.getValue(e)),e$28(this.polygon._holes)&&(e$28(r=this.polygon._holes.getValue(e))&&(r=r.map((function(e){return new e$1m(e)})))),e$28(t)?(t.positions=i,t.holes=r,t):new e$1m(i,r)},rr$4.prototype.equals=function(e){return this===e||e instanceof rr$4&&r$K.equals(this.polygon._positions,e.polygon._positions)&&r$K.equals(this.polygon._holes,e.polygon._holes)},E$y.load=function(e,t){return(new E$y).load(e,t)},Object.defineProperties(E$y.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!e$28(e))throw new t$Z("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}}),E$y.updaters=[gn$1,vn$1,wn$1,Pn$1,On$2,Tn$2,An$2,Rn$2,nn$2,an$2,xn$2,_n$1,Bn$3,En$2,tn$2,Nn$2,on$1,Ln$3,sn$2,Sn$3,fn$1,pn$1],E$y.prototype.process=function(e,t){return me$h(this,e,t,!1)},E$y.prototype.load=function(e,t){return me$h(this,e,t,!0)},E$y.processPacketData=f$v,E$y.processPositionPacketData=ae$g,E$y.processMaterialPacketData=L$y,E$y._processCzml=function(e,t,i,r,n){if(r=u$Y(r,E$y.updaters),Array.isArray(e))for(var o=0,a=e.length;o<a;++o)he$e(e[o],t,r,i,n);else he$e(e,t,r,i,n)},Object.defineProperties(i$s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}}),i$s.prototype.add=function(e){if(!e$28(e))throw new t$Z("dataSource is required.");if(this.contains(e))throw new t$Z("CutomDataSource: "+e.name+" cannot be added repeatedly");var t=this,i=this._dataSources;return o$1q(e,(function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e}))},i$s.prototype.remove=function(e,t){t=u$Y(t,!1);var i=this._dataSources.indexOf(e);if(-1!==i){this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,e);for(var r=0;r<e._entityCollection.values.length;r++){var n=e._entityCollection.values[r];e$28(n._polygon)&&e$28(n._polygon.outlines)&&n._polygon.outlines.removeAll(),e$28(n._polygon)&&e$28(n._polygon.clampOutlines)&&n.entityCollection._owner._entityCluster._scene._primitives.remove(n._polygon.clampOutlines)}return t&&"function"==typeof e.destroy&&e.destroy(),!0}return!1},i$s.prototype.removeAll=function(e){e=u$Y(e,!1);for(var t=this._dataSources,i=0,r=t.length;i<r;++i){for(var n=t[i],o=0;o<n._entityCollection.values.length;o++){var a=n._entityCollection.values[o];let e=n._entityCluster._scene;e$28(a._polygon)&&e$28(a._polygon.outlines)&&a._polygon.outlines.removeAll(),!e.isDestroyed()&&e$28(a._polygon)&&e$28(a._polygon.clampOutlines)&&e._primitives.remove(a._polygon.clampOutlines)}this._dataSourceRemoved.raiseEvent(this,n),e&&"function"==typeof n.destroy&&n.destroy()}this._dataSources=[]},i$s.prototype.contains=function(e){return-1!==this.indexOf(e)},i$s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},i$s.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._dataSources[e]},i$s.prototype.getByName=function(e){if(!e$28(e))throw new t$Z("name is required.");return this._dataSources.filter((function(t){return t.name===e}))},i$s.prototype.raise=function(e){var t=c$s(this._dataSources,e);_$t(this,t,t+1)},i$s.prototype.lower=function(e){var t=c$s(this._dataSources,e);_$t(this,t,t-1)},i$s.prototype.raiseToTop=function(e){var t=c$s(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))},i$s.prototype.lowerToBottom=function(e){var t=c$s(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},i$s.prototype.isDestroyed=function(){return!1},i$s.prototype.destroy=function(){return this.removeAll(!0),i$Z(this)},Object.defineProperties(o$I.prototype,{length:{get:function(){return this._primitives.length}}}),o$I.prototype.add=function(e){if(!e$28(e))throw new t$Z("primitive is required.");var t=e._external=e._external||{};return(t._composites=t._composites||{})[this._guid]={collection:this},this._primitives.push(e),e},o$I.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(-1!==t)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},o$I.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},o$I.prototype.removeAll=function(){for(var e=this._primitives,t=e.length,i=0;i<t;++i)delete e[i]._external._composites[this._guid],this.destroyPrimitives&&e[i].destroy();this._primitives=[]},o$I.prototype.contains=function(e){return!!(e$28(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},o$I.prototype.raise=function(e){if(e$28(e)){var t=a$s(this,e),i=this._primitives;if(t!==i.length-1){var r=i[t];i[t]=i[t+1],i[t+1]=r}}},o$I.prototype.raiseToTop=function(e){if(e$28(e)){var t=a$s(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},o$I.prototype.lower=function(e){if(e$28(e)){var t=a$s(this,e),i=this._primitives;if(0!==t){var r=i[t];i[t]=i[t-1],i[t-1]=r}}},o$I.prototype.lowerToBottom=function(e){if(e$28(e)){var t=a$s(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},o$I.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._primitives[e]},o$I.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},o$I.prototype.prePassesUpdate=function(e){for(var t=this._primitives,i=0;i<t.length;++i){var r=t[i];e$28(r.prePassesUpdate)&&r.prePassesUpdate(e)}},o$I.prototype.updateForPass=function(e,t){for(var i=this._primitives,r=0;r<i.length;++r){var n=i[r];e$28(n.updateForPass)&&n.updateForPass(e,t)}},o$I.prototype.postPassesUpdate=function(e){for(var t=this._primitives,i=0;i<t.length;++i){var r=t[i];e$28(r.postPassesUpdate)&&r.postPassesUpdate(e)}},o$I.prototype.isDestroyed=function(){return!1},o$I.prototype.destroy=function(){return this.removeAll(),i$Z(this)},Object.defineProperties(r$x.prototype,{length:{get:function(){return this._length}}}),r$x.prototype.add=function(e,t){o$1u.defined("primitive",e),e$28(t)&&o$1u.typeOf.number("zIndex",t),t=u$Y(t,0);var i=this._collections[t];if(!e$28(i)){(i=new o$I({destroyPrimitives:!1}))._zIndex=t,this._collections[t]=i;for(var r=this._collectionsArray,n=0;n<r.length&&r[n]._zIndex<t;)n++;r.splice(n,0,i)}return i.add(e),this._length++,e._zIndex=t,e},r$x.prototype.set=function(e,t){return o$1u.defined("primitive",e),o$1u.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e},r$x.prototype.remove=function(e,t){if(this.contains(e)){var i,r=e._zIndex,n=this._collections[r];return(i=t?n.remove(e):n.removeAndDestroy(e))&&this._length--,0===n.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(n),1),this._collections[r]=void 0,n.destroy()),i}return!1},r$x.prototype.removeAll=function(){for(var e=this._collectionsArray,t=0;t<e.length;t++){var i=e[t];i.destroyPrimitives=!0,i.destroy()}this._collections={},this._collectionsArray=[],this._length=0},r$x.prototype.contains=function(e){if(!e$28(e))return!1;var t=this._collections[e._zIndex];return e$28(t)&&t.contains(e)},r$x.prototype.update=function(e){if(this.show)for(var t=this._collectionsArray,i=0;i<t.length;i++)t[i].update(e)},r$x.prototype.isDestroyed=function(){return!1},r$x.prototype.destroy=function(){return this.removeAll(),i$Z(this)},r$w.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},r$w.prototype.remove=function(e){var t=e.id,i=this._dynamicUpdaters.get(t);e$28(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},r$w.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},r$w.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},r$w.prototype.getBoundingSphere=function(e,t){return e$28(e=this._dynamicUpdaters.get(e.id))&&e$28(e.getBoundingSphere)?e.getBoundingSphere(t):A$U.FAILED};var I$N=new e$1S,E$x=t$X.ZERO,H$w=new t$X,D$z=new h$10;function L$x(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function u$r(e,t){i$v.call(this,{entity:e,scene:t,geometryOptions:new L$x(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function h$w(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(u$r.prototype=Object.create(i$v.prototype),u$r.prototype.constructor=u$r),u$r.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n={show:new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,I$N)),e$28(t)||(t=e$1S.WHITE),n.color=o$18.fromColor(t));return e$28(this._options.offsetAttribute)&&(n.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,E$x,H$w))),new d$15({id:i,geometry:new Y$K(this._options),attributes:n})},u$r.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,I$N),n=this._distanceDisplayConditionProperty.getValue(e),o={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n),offset:void 0};return e$28(this._options.offsetAttribute)&&(o.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,E$x,H$w))),new d$15({id:t,geometry:new M$W(this._options),attributes:o})},u$r.prototype._computeCenter=function(e,t){return r$K.getValueOrUndefined(this._entity.position,e,t)},u$r.prototype._isHidden=function(e,t){return!e$28(e.position)||!e$28(t.semiMajorAxis)||!e$28(t.semiMinorAxis)||i$F.prototype._isHidden.call(this,e,t)},u$r.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!r$K.isConstant(t.rotation)||!r$K.isConstant(t.height)||!r$K.isConstant(t.extrudedHeight)||!r$K.isConstant(t.granularity)||!r$K.isConstant(t.stRotation)||!r$K.isConstant(t.outlineWidth)||!r$K.isConstant(t.numberOfVerticalLines)||!r$K.isConstant(t.zIndex)||this._onTerrain&&!r$K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof t$z)},u$r.prototype._setStaticOptions=function(e,t){var i=r$K.getValueOrUndefined(t.height,o$11.MINIMUM_VALUE),r=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),n=r$K.getValueOrUndefined(t.extrudedHeight,o$11.MINIMUM_VALUE),o=r$K.getValueOrDefault(t.extrudedHeightReference,o$11.MINIMUM_VALUE,k$_.NONE);e$28(n)&&!e$28(i)&&(i=0);var a=this._options;a.vertexFormat=this._materialProperty instanceof t$z?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(o$11.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(o$11.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(o$11.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=r$K.getValueOrUndefined(t.rotation,o$11.MINIMUM_VALUE),a.granularity=r$K.getValueOrUndefined(t.granularity,o$11.MINIMUM_VALUE),a.stRotation=r$K.getValueOrUndefined(t.stRotation,o$11.MINIMUM_VALUE),a.numberOfVerticalLines=r$K.getValueOrUndefined(t.numberOfVerticalLines,o$11.MINIMUM_VALUE),a.offsetAttribute=i$v.computeGeometryOffsetAttribute(i,r,n,o),a.height=i$v.getGeometryHeight(i,r),a.outlineWidth=t.outlineWidth?t.outlineWidth.getValue():1,(n=i$v.getGeometryExtrudedHeight(n,o))===i$v.CLAMP_TO_GROUND&&(n=e$1_.getMinimumMaximumHeights(Y$K.computeRectangle(a,D$z)).minimumTerrainHeight),a.extrudedHeight=n},u$r.DynamicGeometryUpdater=h$w,e$28(Object.create)&&(h$w.prototype=Object.create(a$L.prototype),h$w.prototype.constructor=h$w),h$w.prototype._isHidden=function(e,t,i){var r=this._options;return!e$28(r.center)||!e$28(r.semiMajorAxis)||!e$28(r.semiMinorAxis)||a$L.prototype._isHidden.call(this,e,t,i)},h$w.prototype._setOptions=function(e,t,i){var r=this._options,n=r$K.getValueOrUndefined(t.height,i),o=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),a=r$K.getValueOrUndefined(t.extrudedHeight,i),s=r$K.getValueOrDefault(t.extrudedHeightReference,i,k$_.NONE);e$28(a)&&!e$28(n)&&(n=0),r.center=r$K.getValueOrUndefined(e.position,i,r.center),r.semiMajorAxis=r$K.getValueOrUndefined(t.semiMajorAxis,i),r.semiMinorAxis=r$K.getValueOrUndefined(t.semiMinorAxis,i),r.rotation=r$K.getValueOrUndefined(t.rotation,i),r.granularity=r$K.getValueOrUndefined(t.granularity,i),r.stRotation=r$K.getValueOrUndefined(t.stRotation,i),r.numberOfVerticalLines=r$K.getValueOrUndefined(t.numberOfVerticalLines,i),r.offsetAttribute=i$v.computeGeometryOffsetAttribute(n,o,a,s),r.height=i$v.getGeometryHeight(n,o),(a=i$v.getGeometryExtrudedHeight(a,s))===i$v.CLAMP_TO_GROUND&&(a=e$1_.getMinimumMaximumHeights(Y$K.computeRectangle(r,D$z)).minimumTerrainHeight),r.extrudedHeight=a};var pe$h=new t$z(e$1S.WHITE),G$B=t$X.ZERO,L$w=new t$X,ye$f=new t$X,_e$b=new t$X,F$B=new e$1S,ve$b=new t$X(1,1,1);function Ce$c(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function l$B(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new Ce$c(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function M$x(e,t,i){a$L.call(this,e,t,i),this._scene=e._scene,this._modelMatrix=new y$15,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new t$X,this._material={}}e$28(Object.create)&&(l$B.prototype=Object.create(i$F.prototype),l$B.prototype.constructor=l$B),Object.defineProperties(l$B.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),l$B.prototype.createFillGeometryInstance=function(e,t,i){o$1u.defined("time",e);var r,n,o=this._entity,a=o.isAvailable(e),s=new e$1h(a&&o.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),u={show:s,distanceDisplayCondition:t$H.fromDistanceDisplayCondition(l),color:void 0,offset:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||a)&&(n=this._materialProperty.color.getValue(e,F$B)),e$28(n)||(n=e$1S.WHITE),r=o$18.fromColor(n),u.color=r);return e$28(this._options.offsetAttribute)&&(u.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,G$B,L$w))),new d$15({id:o,geometry:new b$Y(this._options),modelMatrix:t?void 0:o.computeModelMatrixForHeightReference(e,o.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:u})},l$B.prototype.createOutlineGeometryInstance=function(e,t,i){o$1u.defined("time",e);var r=this._entity,n=r.isAvailable(e),o=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,F$B),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new e$1h(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(o),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(a),offset:void 0};return e$28(this._options.offsetAttribute)&&(s.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,G$B,L$w))),new d$15({id:r,geometry:new x$Y(this._options),modelMatrix:t?void 0:r.computeModelMatrixForHeightReference(e,r.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:s})},l$B.prototype._computeCenter=function(e,t){return r$K.getValueOrUndefined(this._entity.position,e,t)},l$B.prototype._isHidden=function(e,t){return!e$28(e.position)||!e$28(t.radii)||i$F.prototype._isHidden.call(this,e,t)},l$B.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&r$K.isConstant(e.orientation)&&t.radii.isConstant&&r$K.isConstant(t.innerRadii)&&r$K.isConstant(t.stackPartitions)&&r$K.isConstant(t.slicePartitions)&&r$K.isConstant(t.outlineWidth)&&r$K.isConstant(t.minimumClock)&&r$K.isConstant(t.maximumClock)&&r$K.isConstant(t.minimumCone)&&r$K.isConstant(t.maximumCone)&&r$K.isConstant(t.subdivisions))},l$B.prototype._setStaticOptions=function(e,t){var i=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof t$z?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,r.radii=t.radii.getValue(o$11.MINIMUM_VALUE,r.radii),r.innerRadii=r$K.getValueOrUndefined(t.innerRadii,r.radii),r.minimumClock=r$K.getValueOrUndefined(t.minimumClock,o$11.MINIMUM_VALUE),r.maximumClock=r$K.getValueOrUndefined(t.maximumClock,o$11.MINIMUM_VALUE),r.minimumCone=r$K.getValueOrUndefined(t.minimumCone,o$11.MINIMUM_VALUE),r.maximumCone=r$K.getValueOrUndefined(t.maximumCone,o$11.MINIMUM_VALUE),r.stackPartitions=r$K.getValueOrUndefined(t.stackPartitions,o$11.MINIMUM_VALUE),r.slicePartitions=r$K.getValueOrUndefined(t.slicePartitions,o$11.MINIMUM_VALUE),r.subdivisions=r$K.getValueOrUndefined(t.subdivisions,o$11.MINIMUM_VALUE),r.offsetAttribute=i!==k$_.NONE?ee$C.ALL:void 0},l$B.prototype._onEntityPropertyChanged=a$H,l$B.DynamicGeometryUpdater=M$x,e$28(Object.create)&&(M$x.prototype=Object.create(a$L.prototype),M$x.prototype.constructor=M$x),M$x.prototype.update=function(e){o$1u.defined("time",e);var t=this._entity,i=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!r$K.getValueOrDefault(i.show,e,!0))return e$28(this._primitive)&&(this._primitive.show=!1),void(e$28(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var r=r$K.getValueOrUndefined(i.radii,e,ye$f),n=e$28(r)?t.computeModelMatrixForHeightReference(e,i.heightReference,.5*r.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!e$28(n)||!e$28(r))return e$28(this._primitive)&&(this._primitive.show=!1),void(e$28(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var o=r$K.getValueOrDefault(i.fill,e,!0),a=r$K.getValueOrDefault(i.outline,e,!1),s=r$K.getValueOrClonedDefault(i.outlineColor,e,e$1S.BLACK,F$B),l=r$H.getValue(e,u$Y(i.material,pe$h),this._material),u=r$K.getValueOrUndefined(i.innerRadii,e,_e$b),c=r$K.getValueOrUndefined(i.minimumClock,e),h=r$K.getValueOrUndefined(i.maximumClock,e),d=r$K.getValueOrUndefined(i.minimumCone,e),f=r$K.getValueOrUndefined(i.maximumCone,e),p=r$K.getValueOrUndefined(i.stackPartitions,e),_=r$K.getValueOrUndefined(i.slicePartitions,e),m=r$K.getValueOrUndefined(i.subdivisions,e),$=r$K.getValueOrDefault(i.outlineWidth,e,1),g=r$K.getValueOrDefault(i.heightReference,e,k$_.NONE),v=g!==k$_.NONE?ee$C.ALL:void 0,y=this._scene.mode,x=y===P$$.SCENE3D&&g===k$_.NONE,b=this._options,w=this._geometryUpdater.shadowsProperty.getValue(e),C=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),T=r$K.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,G$B,L$w);if(!x||this._lastSceneMode!==y||!e$28(this._primitive)||b.stackPartitions!==p||b.slicePartitions!==_||e$28(u)&&!t$X.equals(b.innerRadii!==u)||b.minimumClock!==c||b.maximumClock!==h||b.minimumCone!==d||b.maximumCone!==f||b.subdivisions!==m||this._lastOutlineWidth!==$||b.offsetAttribute!==v){var S=this._primitives;if(S.removeAndDestroy(this._primitive),S.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=y,this._lastOutlineWidth=$,b.stackPartitions=p,b.slicePartitions=_,b.subdivisions=m,b.offsetAttribute=v,b.radii=t$X.clone(x?ve$b:r,b.radii),e$28(u))if(x){var E=t$X.magnitude(r);b.innerRadii=t$X.fromElements(u.x/E,u.y/E,u.z/E,b.innerRadii)}else b.innerRadii=t$X.clone(u,b.innerRadii);else b.innerRadii=void 0;b.minimumClock=c,b.maximumClock=h,b.minimumCone=d,b.maximumCone=f;var A=new t$A({material:l,translucent:l.isTranslucent(),closed:!0});b.vertexFormat=A.vertexFormat;var P=this._geometryUpdater.createFillGeometryInstance(e,x,this._modelMatrix);this._primitive=S.add(new v$C({geometryInstances:P,appearance:A,asynchronous:!1,shadows:w}));var I=this._geometryUpdater.createOutlineGeometryInstance(e,x,this._modelMatrix);this._outlinePrimitive=S.add(new v$C({geometryInstances:I,appearance:new r$J({flat:!0,translucent:255!==I.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth($)}}),asynchronous:!1,shadows:w})),this._lastShow=o,this._lastOutlineShow=a,this._lastOutlineColor=e$1S.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=C,this._lastOffset=t$X.clone(T,this._lastOffset)}else if(this._primitive.ready){var M=this._primitive,O=this._outlinePrimitive;M.show=!0,O.show=!0,M.appearance.material=l;var D=this._attributes;e$28(D)||(D=M.getGeometryInstanceAttributes(t),this._attributes=D),o!==this._lastShow&&(D.show=e$1h.toValue(o,D.show),this._lastShow=o);var R=this._outlineAttributes;e$28(R)||(R=O.getGeometryInstanceAttributes(t),this._outlineAttributes=R),a!==this._lastOutlineShow&&(R.show=e$1h.toValue(a,R.show),this._lastOutlineShow=a),e$1S.equals(s,this._lastOutlineColor)||(R.color=o$18.toValue(s,R.color),e$1S.clone(s,this._lastOutlineColor)),r$10.equals(C,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=t$H.toValue(C,D.distanceDisplayCondition),R.distanceDisplayCondition=t$H.toValue(C,R.distanceDisplayCondition),r$10.clone(C,this._lastDistanceDisplayCondition)),t$X.equals(T,this._lastOffset)||(D.offset=e$1o.toValue(T,D.offset),R.offset=e$1o.toValue(T,D.offset),t$X.clone(T,this._lastOffset))}x&&(r.x=Math.max(r.x,.001),r.y=Math.max(r.y,.001),r.z=Math.max(r.z,.001),n=y$15.multiplyByScale(n,r,n),this._primitive.modelMatrix=n,this._outlinePrimitive.modelMatrix=n)};var R$r=new t$X,N$p=new e$1S;function z$q(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function p$s(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new z$q(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function h$v(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(p$s.prototype=Object.create(i$F.prototype),p$s.prototype.constructor=p$s),p$s.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i,r=this._entity,n=r.isAvailable(e),o=new e$1h(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=t$H.fromDistanceDisplayCondition(a);this._materialProperty instanceof t$z?(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,N$p)),e$28(i)||(i=e$1S.WHITE),t={show:o,distanceDisplayCondition:s,color:o$18.fromColor(i)}):t={show:o,distanceDisplayCondition:s};var l=r.plane,u=this._options,c=r.computeModelMatrix(e),h=r$K.getValueOrDefault(l.plane,e,u.plane),d=r$K.getValueOrUndefined(l.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=d,c=O$p(h,d,c,this._scene.mapProjection.ellipsoid,c),new d$15({id:r,geometry:new f$T(this._options),modelMatrix:c,attributes:t})},p$s.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,N$p),n=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,a=this._options,s=t.computeModelMatrix(e),l=r$K.getValueOrDefault(o.plane,e,a.plane),u=r$K.getValueOrUndefined(o.dimensions,e,a.dimensions);return a.plane=l,a.dimensions=u,s=O$p(l,u,s,this._scene.mapProjection.ellipsoid,s),new d$15({id:t,geometry:new i$K,modelMatrix:s,attributes:{show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n)}})},p$s.prototype._isHidden=function(e,t){return!e$28(t.plane)||!e$28(t.dimensions)||!e$28(e.position)||i$F.prototype._isHidden.call(this,e,t)},p$s.prototype._getIsClosed=function(e){return!1},p$s.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&r$K.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&r$K.isConstant(t.outlineWidth))},p$s.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof t$z,r=this._options;r.vertexFormat=i?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,r.plane=t.plane.getValue(o$11.MINIMUM_VALUE,r.plane),r.dimensions=t.dimensions.getValue(o$11.MINIMUM_VALUE,r.dimensions)},p$s.DynamicGeometryUpdater=h$v,e$28(Object.create)&&(h$v.prototype=Object.create(a$L.prototype),h$v.prototype.constructor=h$v),h$v.prototype._isHidden=function(e,t,i){var r=this._options;return!e$28(r$K.getValueOrUndefined(e.position,i,R$r))||!e$28(r.plane)||!e$28(r.dimensions)||a$L.prototype._isHidden.call(this,e,t,i)},h$v.prototype._setOptions=function(e,t,i){var r=this._options;r.plane=r$K.getValueOrDefault(t.plane,i,r.plane),r.dimensions=r$K.getValueOrUndefined(t.dimensions,i,r.dimensions)};var B$j=new t$X,Q$r=new t$X,X$j=new t$X,q$t=new t$X,W$v=new t$X,k$x=new n$14,K$p=new p$1a;function O$p(e,t,i,r,n){var o=e.normal,a=e.distance,s=t$X.multiplyByScalar(o,-a,X$j);s=y$15.multiplyByPoint(i,s,s);var l=y$15.multiplyByPointAsVector(i,o,q$t);t$X.normalize(l,l);var u=r.geodeticSurfaceNormal(s,Q$r);e$27.equalsEpsilon(Math.abs(t$X.dot(u,l)),1,e$27.EPSILON8)&&(u=t$X.clone(t$X.UNIT_Z,u),e$27.equalsEpsilon(Math.abs(t$X.dot(u,l)),1,e$27.EPSILON8)&&(u=t$X.clone(t$X.UNIT_X,u)));var c=t$X.cross(u,l,B$j);u=t$X.cross(l,c,u),t$X.normalize(c,c),t$X.normalize(u,u);var h=K$p;p$1a.setColumn(h,0,c,h),p$1a.setColumn(h,1,u,h),p$1a.setColumn(h,2,l,h);var d=n$14.fromRotationMatrix(h,k$x),f=o$1k.clone(t,W$v);return f.z=1,y$15.fromTranslationQuaternionRotationScale(s,d,f,n)}p$s.createPrimitiveMatrix=O$p;var B$i="Entity polygons cannot have both height and perPositionHeight. height will be ignored",S$o="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",j$u=new e$1S,F$A=t$X.ZERO,W$u=new t$X,X$i=new h$10,te$m=[],re$h=new o$1k;function ie$h(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.depthTestEnabled=void 0,this.groundBottomAltitude=void 0,this.groundExtrudedHeight=void 0}function l$A(e,t){i$v.call(this,{entity:e,scene:t,geometryOptions:new ie$h(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function v$x(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(l$A.prototype=Object.create(i$v.prototype),l$A.prototype.constructor=l$A),l$A.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n=this._options,o={show:new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,j$u)),e$28(t)||(t=e$1S.WHITE),o.color=o$18.fromColor(t));return e$28(n.offsetAttribute)&&(o.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,F$A,W$u))),new d$15({id:i,geometry:n.perPositionHeight&&!e$28(n.extrudedHeight)?new P$W(n):new U$Q(n),attributes:o})},l$A.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=this._options,n=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,j$u),o=this._distanceDisplayConditionProperty.getValue(e),a={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(n),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(o),offset:void 0};return e$28(r.offsetAttribute)&&(a.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,F$A,W$u))),new d$15({id:t,geometry:r.perPositionHeight&&!e$28(r.extrudedHeight)?new a$V(r):new A$X(r),attributes:a})},l$A.prototype._computeCenter=function(e,t){var i=r$K.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(e$28(i)){var r=i.positions;if(0!==r.length){for(var n=this._scene.mapProjection.ellipsoid,o=f$16.fromPoints(r,n),a=o.projectPointsOntoPlane(r,te$m),s=a.length,l=0,u=s-1,c=new o$1k,h=0;h<s;u=h++){var d=a[h],f=a[u],p=d.x*f.y-f.x*d.y,_=o$1k.add(d,f,re$h);_=o$1k.multiplyByScalar(_,p,_),c=o$1k.add(c,_,c),l+=p}var m=1/(3*l);return c=o$1k.multiplyByScalar(c,m,c),o.projectPointOntoEllipsoid(c,t)}}},l$A.prototype._isHidden=function(e,t){return!e$28(t.hierarchy)||i$F.prototype._isHidden.call(this,e,t)},l$A.prototype._isOnTerrain=function(e,t){var i=i$v.prototype._isOnTerrain.call(this,e,t),r=t.perPositionHeight,n=e$28(r)&&(!r.isConstant||r.getValue(o$11.MINIMUM_VALUE));return i&&!n},l$A.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!r$K.isConstant(t.height)||!r$K.isConstant(t.extrudedHeight)||!r$K.isConstant(t.granularity)||!r$K.isConstant(t.stRotation)||!r$K.isConstant(t.outlineWidth)||!r$K.isConstant(t.perPositionHeight)||!r$K.isConstant(t.closeTop)||!r$K.isConstant(t.closeBottom)||!r$K.isConstant(t.zIndex)||!r$K.isConstant(t.arcType)||this._onTerrain&&!r$K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof t$z)},l$A.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof t$z,r=this._options;r.vertexFormat=i?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat;var n,o=t.hierarchy.getValue(o$11.MINIMUM_VALUE),a=r$K.getValueOrUndefined(t.height,o$11.MINIMUM_VALUE),s=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),l=r$K.getValueOrUndefined(t.extrudedHeight,o$11.MINIMUM_VALUE),u=r$K.getValueOrDefault(t.extrudedHeightReference,o$11.MINIMUM_VALUE,k$_.NONE),c=r$K.getValueOrDefault(t.perPositionHeight,o$11.MINIMUM_VALUE,!1);a=i$v.getGeometryHeight(a,s),c?(e$28(a)&&(a=void 0,e$1$(B$i)),s!==k$_.NONE&&c&&(a=void 0,e$1$(S$o))):(e$28(l)&&!e$28(a)&&(a=0),n=i$v.computeGeometryOffsetAttribute(a,s,l,u)),r.polygonHierarchy=o,r.granularity=r$K.getValueOrUndefined(t.granularity,o$11.MINIMUM_VALUE),r.stRotation=r$K.getValueOrUndefined(t.stRotation,o$11.MINIMUM_VALUE),r.perPositionHeight=c,r.closeTop=r$K.getValueOrDefault(t.closeTop,o$11.MINIMUM_VALUE,!0),r.closeBottom=r$K.getValueOrDefault(t.closeBottom,o$11.MINIMUM_VALUE,!0),r.offsetAttribute=n,r.height=a,r.arcType=r$K.getValueOrDefault(t.arcType,o$11.MINIMUM_VALUE,m$_.GEODESIC),r.depthTestEnabled=!e$28(e._depthTestEnabled)||e._depthTestEnabled,(l=i$v.getGeometryExtrudedHeight(l,u))===i$v.CLAMP_TO_GROUND&&(l=e$1_.getMinimumMaximumHeights(U$Q.computeRectangle(r,X$i)).minimumTerrainHeight),r.extrudedHeight=l,r.groundBottomAltitude=r$K.getValueOrUndefined(t.groundBottomAltitude,o$11.MINIMUM_VALUE),r.groundExtrudedHeight=r$K.getValueOrUndefined(t.groundExtrudedHeight,o$11.MINIMUM_VALUE)},l$A.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight,r=e$28(i)&&i!==t;return!e.perPositionHeight&&(!r&&0===t||r&&e.closeTop&&e.closeBottom)},l$A.DynamicGeometryUpdater=v$x,e$28(Object.create)&&(v$x.prototype=Object.create(a$L.prototype),v$x.prototype.constructor=v$x),v$x.prototype._isHidden=function(e,t,i){return!e$28(this._options.polygonHierarchy)||a$L.prototype._isHidden.call(this,e,t,i)},v$x.prototype._setOptions=function(e,t,i){var r=this._options;r.polygonHierarchy=r$K.getValueOrUndefined(t.hierarchy,i),Array.isArray(r.polygonHierarchy)&&(r.polygonHierarchy=new e$1m(r.polygonHierarchy));var n,o=r$K.getValueOrUndefined(t.height,i),a=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),s=r$K.getValueOrDefault(t.extrudedHeightReference,i,k$_.NONE),l=r$K.getValueOrUndefined(t.extrudedHeight,i),u=r$K.getValueOrUndefined(t.perPositionHeight,i);o=i$v.getGeometryHeight(o,s),u?(e$28(o)&&(o=void 0,e$1$(B$i)),a!==k$_.NONE&&u&&(o=void 0,e$1$(S$o))):(e$28(l)&&!e$28(o)&&(o=0),n=i$v.computeGeometryOffsetAttribute(o,a,l,s)),r.granularity=r$K.getValueOrUndefined(t.granularity,i),r.stRotation=r$K.getValueOrUndefined(t.stRotation,i),r.perPositionHeight=r$K.getValueOrUndefined(t.perPositionHeight,i),r.closeTop=r$K.getValueOrDefault(t.closeTop,i,!0),r.closeBottom=r$K.getValueOrDefault(t.closeBottom,i,!0),r.offsetAttribute=n,r.height=o,r.arcType=r$K.getValueOrDefault(t.arcType,i,m$_.GEODESIC),(l=i$v.getGeometryExtrudedHeight(l,s))===i$v.CLAMP_TO_GROUND&&(l=e$1_.getMinimumMaximumHeights(U$Q.computeRectangle(r,X$i)).minimumTerrainHeight),r.extrudedHeight=l};var M$w=new e$1S;function A$F(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0,this.enuCenter=void 0}function a$r(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new A$F(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function l$z(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(a$r.prototype=Object.create(i$F.prototype),a$r.prototype.constructor=a$r),a$r.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i,r=this._entity,n=r.isAvailable(e),o=new e$1h(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=t$H.fromDistanceDisplayCondition(a);this._materialProperty instanceof t$z?(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,M$w)),e$28(i)||(i=e$1S.WHITE),t={show:o,distanceDisplayCondition:s,color:o$18.fromColor(i)}):t={show:o,distanceDisplayCondition:s};return new d$15({id:r,geometry:new N$G(this._options),attributes:t})},a$r.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,M$w),n=this._distanceDisplayConditionProperty.getValue(e);return new d$15({id:t,geometry:new _$K(this._options),attributes:{show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n)}})},a$r.prototype._isHidden=function(e,t){return!e$28(t.positions)||!e$28(t.shape)||i$F.prototype._isHidden.call(this,e,t)},a$r.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&r$K.isConstant(t.granularity)&&r$K.isConstant(t.outlineWidth)&&r$K.isConstant(t.cornerType))},a$r.prototype._setStaticOptions=function(e,t){var i=t.granularity,r=t.cornerType,n=t.enuCenter,o=this._options,a=this._materialProperty instanceof t$z;o.vertexFormat=a?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(o$11.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(o$11.MINIMUM_VALUE,o.shape),o.granularity=e$28(i)?i.getValue(o$11.MINIMUM_VALUE):void 0,o.cornerType=e$28(r)?r.getValue(o$11.MINIMUM_VALUE):void 0,o.enuCenter=e$28(n)?n.getValue(o$11.MINIMUM_VALUE):void 0},a$r.DynamicGeometryUpdater=l$z,e$28(Object.create)&&(l$z.prototype=Object.create(a$L.prototype),l$z.prototype.constructor=l$z),l$z.prototype._isHidden=function(e,t,i){var r=this._options;return!e$28(r.polylinePositions)||!e$28(r.shapePositions)||a$L.prototype._isHidden.call(this,e,t,i)},l$z.prototype._setOptions=function(e,t,i){var r=this._options;r.polylinePositions=r$K.getValueOrUndefined(t.positions,i,r.polylinePositions),r.shapePositions=r$K.getValueOrUndefined(t.shape,i),r.granularity=r$K.getValueOrUndefined(t.granularity,i),r.cornerType=r$K.getValueOrUndefined(t.cornerType,i)};var D$y=new e$1S,G$A=t$X.ZERO,E$w=new t$X,w$m=new h$10,S$n=new h$10,F$z=new t$W;function j$t(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function d$D(e,t){i$v.call(this,{entity:e,scene:t,geometryOptions:new j$t(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function h$u(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(d$D.prototype=Object.create(i$v.prototype),d$D.prototype.constructor=d$D),d$D.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n={show:new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,D$y)),e$28(t)||(t=e$1S.WHITE),n.color=o$18.fromColor(t));return e$28(this._options.offsetAttribute)&&(n.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,G$A,E$w))),new d$15({id:i,geometry:new j$N(this._options),attributes:n})},d$D.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,D$y),n=this._distanceDisplayConditionProperty.getValue(e),o={show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n),offset:void 0};return e$28(this._options.offsetAttribute)&&(o.offset=e$1o.fromCartesian3(r$K.getValueOrDefault(this._terrainOffsetProperty,e,G$A,E$w))),new d$15({id:t,geometry:new k$P(this._options),attributes:o})},d$D.prototype._computeCenter=function(e,t){var i=r$K.getValueOrUndefined(this._entity.rectangle.coordinates,e,S$n);if(e$28(i)){var r=h$10.center(i,F$z);return t$W.toCartesian(r,t$V.WGS84,t)}},d$D.prototype._isHidden=function(e,t){return!e$28(t.coordinates)||i$F.prototype._isHidden.call(this,e,t)},d$D.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!r$K.isConstant(t.height)||!r$K.isConstant(t.extrudedHeight)||!r$K.isConstant(t.granularity)||!r$K.isConstant(t.stRotation)||!r$K.isConstant(t.rotation)||!r$K.isConstant(t.outlineWidth)||!r$K.isConstant(t.zIndex)||this._onTerrain&&!r$K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof t$z)},d$D.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof t$z,r=r$K.getValueOrUndefined(t.height,o$11.MINIMUM_VALUE),n=r$K.getValueOrDefault(t.heightReference,o$11.MINIMUM_VALUE,k$_.NONE),o=r$K.getValueOrUndefined(t.extrudedHeight,o$11.MINIMUM_VALUE),a=r$K.getValueOrDefault(t.extrudedHeightReference,o$11.MINIMUM_VALUE,k$_.NONE);e$28(o)&&!e$28(r)&&(r=0);var s=this._options;s.vertexFormat=i?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(o$11.MINIMUM_VALUE,s.rectangle),s.granularity=r$K.getValueOrUndefined(t.granularity,o$11.MINIMUM_VALUE),s.stRotation=r$K.getValueOrUndefined(t.stRotation,o$11.MINIMUM_VALUE),s.rotation=r$K.getValueOrUndefined(t.rotation,o$11.MINIMUM_VALUE),s.offsetAttribute=i$v.computeGeometryOffsetAttribute(r,n,o,a),s.height=i$v.getGeometryHeight(r,n),(o=i$v.getGeometryExtrudedHeight(o,a))===i$v.CLAMP_TO_GROUND&&(o=e$1_.getMinimumMaximumHeights(j$N.computeRectangle(s,w$m)).minimumTerrainHeight),s.extrudedHeight=o},d$D.DynamicGeometryUpdater=h$u,e$28(Object.create)&&(h$u.prototype=Object.create(a$L.prototype),h$u.prototype.constructor=h$u),h$u.prototype._isHidden=function(e,t,i){return!e$28(this._options.rectangle)||a$L.prototype._isHidden.call(this,e,t,i)},h$u.prototype._setOptions=function(e,t,i){var r=this._options,n=r$K.getValueOrUndefined(t.height,i),o=r$K.getValueOrDefault(t.heightReference,i,k$_.NONE),a=r$K.getValueOrUndefined(t.extrudedHeight,i),s=r$K.getValueOrDefault(t.extrudedHeightReference,i,k$_.NONE);e$28(a)&&!e$28(n)&&(n=0),r.rectangle=r$K.getValueOrUndefined(t.coordinates,i,r.rectangle),r.granularity=r$K.getValueOrUndefined(t.granularity,i),r.stRotation=r$K.getValueOrUndefined(t.stRotation,i),r.rotation=r$K.getValueOrUndefined(t.rotation,i),r.offsetAttribute=i$v.computeGeometryOffsetAttribute(n,o,a,s),r.height=i$v.getGeometryHeight(n,o),(a=i$v.getGeometryExtrudedHeight(a,s))===i$v.CLAMP_TO_GROUND&&(a=e$1_.getMinimumMaximumHeights(j$N.computeRectangle(r,w$m)).minimumTerrainHeight),r.extrudedHeight=a};var W$t=new e$1S,Y$l=new r$10,$$s=new r$10,ee$n=t$X.ZERO,te$l=new t$X;function v$w(e,t,i,r,n,o,a){var s;this.translucent=t,this.appearanceType=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.depthFailMaterial=void 0,this.closed=o,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.updaters=new e$1P,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.subscriptions=new e$1P,this.showsUpdated=new e$1P,this.itemsToRemove=[],this.invalidated=!1,e$28(n)&&(s=n.definitionChanged.addEventListener(v$w.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}function y$w(e,t,i,r,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}function q$s(e,t){for(var i=e.length-1;i>=0;i--){var r=e[i];if(r.remove(t))return 0===r.updaters.length&&(e.splice(i,1),r.destroy()),!0}return!1}function L$v(e,t,i){for(var r=!1,n=t.length,o=0;o<n;++o){var a=t[o],s=a.itemsToRemove,l=s.length;if(l>0)for(o=0;o<l;o++){var u=s[o];a.remove(u),e.add(i,u),r=!0}}return r}function C$r(e,t,i,r){var n,o=t.length;for(n=o-1;n>=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u<l;u++)e.add(i,s[u]);a.destroy()}}for(o=t.length,n=0;n<o;++n)r=t[n].update(i)&&r;return r}function N$o(e,t,i){for(var r=e.length,n=0;n<r;n++){var o=e[n];if(o.contains(t))return o.getBoundingSphere(t,i)}return A$U.FAILED}function x$A(e){for(var t=e.length,i=0;i<t;i++)e[i].destroy();e.length=0}v$w.prototype.onMaterialChanged=function(){this.invalidated=!0},v$w.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,i=e.depthFailMaterialProperty;return i===t||!!e$28(t)&&t.equals(i)},v$w.prototype.add=function(e,t){var i=e.id;if(this.createPrimitive=!0,this.enuCenter=e._options&&e._options.enuCenter,e$28(this.enuCenter)&&(this.materialSupport=r$J.MaterialSupport.FLOAT_POSITION),this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&r$K.isConstant(e.distanceDisplayConditionProperty)&&r$K.isConstant(e.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener((function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(i,e)},v$w.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return e$28(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},v$w.prototype.update=function(e){var t,i=!0,r=0,n=this.primitive,o=this.primitives;if(this.createPrimitive){var a=this.geometry.values;if(a.length>0){var s;e$28(n)&&(e$28(this.oldPrimitive)?o.remove(n):this.oldPrimitive=n),e$28(this.depthFailAppearanceType)&&(e$28(this.depthFailMaterialProperty)&&(this.depthFailMaterial=r$H.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),s=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),(n=new v$C({show:!1,asynchronous:!0,geometryInstances:a,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed,materialSupport:this.materialSupport,renderState:{depthTest:{enabled:this._depthTestEnabled}}}),depthFailAppearance:s,shadows:this.shadows,updateBoundingSphere:!e$28(this.enuCenter),modelMatrix:e$28(this.enuCenter)?m$1b.eastNorthUpToFixedFrame(this.enuCenter,t$V.WGS84,new y$15):void 0}))._polygonOffset=this.polygonOffset,o.add(n),i=!1}else{e$28(n)&&(o.remove(n),n=void 0);var l=this.oldPrimitive;e$28(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(e$28(n)&&n.ready){n.show=!0,e$28(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),e$28(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof t$z)&&(this.depthFailMaterial=r$H.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var u=this.updatersWithAttributes.values,c=u.length,h=this.waitingOnCreate;for(t=0;t<c;t++){var d=u[t],f=this.geometry.get(d.id),p=this.attributes.get(f.id.id);if(e$28(p)||(p=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,p)),!d.fillMaterialProperty.isConstant||h){var _=d.fillMaterialProperty.color,m=r$K.getValueOrDefault(_,e,e$1S.WHITE,W$t);e$1S.equals(p._lastColor,m)||(p._lastColor=e$1S.clone(m,p._lastColor),p.color=o$18.toValue(m,p.color),(this.translucent&&255===p.color[3]||!this.translucent&&255!==p.color[3])&&(this.itemsToRemove[r++]=d))}if(e$28(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof t$z&&(!d.depthFailMaterialProperty.isConstant||h)){var $=d.depthFailMaterialProperty.color,g=r$K.getValueOrDefault($,e,e$1S.WHITE,W$t);e$1S.equals(p._lastDepthFailColor,g)||(p._lastDepthFailColor=e$1S.clone(g,p._lastDepthFailColor),p.depthFailColor=o$18.toValue(g,p.depthFailColor))}var v=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e));v!==(1===p.show[0])&&(p.show=e$1h.toValue(v,p.show));var y=d.distanceDisplayConditionProperty;if(!r$K.isConstant(y)){var x=r$K.getValueOrDefault(y,e,$$s,Y$l);r$10.equals(x,p._lastDistanceDisplayCondition)||(p._lastDistanceDisplayCondition=r$10.clone(x,p._lastDistanceDisplayCondition),p.distanceDisplayCondition=t$H.toValue(x,p.distanceDisplayCondition))}var b=d.terrainOffsetProperty;if(!r$K.isConstant(b)){var w=r$K.getValueOrDefault(b,e,ee$n,te$l);t$X.equals(w,p._lastOffset)||(p._lastOffset=t$X.clone(w,p._lastOffset),p.offset=e$1o.toValue(w,p.offset))}}this.updateShows(n),this.waitingOnCreate=!1}else e$28(n)&&!n.ready&&(i=!1);return this.itemsToRemove.length=r,i},v$w.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=this.geometry.get(n.id),a=this.attributes.get(o.id.id);e$28(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));var s=n.entity.isShowing;s!==(1===a.show[0])&&(a.show=e$1h.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},v$w.prototype.contains=function(e){return this.updaters.contains(e.id)},v$w.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return A$U.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!e$28(r)||!e$28(r.boundingSphere)||e$28(r.show)&&0===r.show[0]?A$U.FAILED:(r.boundingSphere.clone(t),A$U.DONE)},v$w.prototype.destroy=function(){var e=this.primitive,t=this.primitives;e$28(e)&&t.remove(e);var i=this.oldPrimitive;e$28(i)&&t.remove(i),e$28(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},y$w.prototype.add=function(e,t){var i,r,n=t.createFillGeometryInstance(e);255===n.attributes.color.value[3]?(i=this._solidItems,r=!1):(i=this._translucentItems,r=!0);for(var o=i.length,a=0;a<o;a++){var s=i[a];if(this.enuCenter)break;if(!s._hasEnuCenter&&s.isMaterial(t))return void s.add(t,n)}var l=new v$w(this._primitives,r,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l._hasEnuCenter=t._options&&!!t._options.enuCenter,l._depthTestEnabled=!e$28(t._options)||!e$28(t._options.depthTestEnabled)||t._options.depthTestEnabled,l.polygonOffset=t._entity._polygonOffset,l.add(t,n),i.push(l)},y$w.prototype.remove=function(e){q$s(this._solidItems,e)||q$s(this._translucentItems,e)},y$w.prototype.update=function(e){var t=C$r(this,this._solidItems,e,!0);t=C$r(this,this._translucentItems,e,t)&&t;var i=L$v(this,this._solidItems,e),r=L$v(this,this._translucentItems,e);return(i||r)&&(t=C$r(this,this._solidItems,e,t)&&t,t=C$r(this,this._translucentItems,e,t)&&t),t},y$w.prototype.getBoundingSphere=function(e,t){var i=N$o(this._solidItems,e,t);return i===A$U.FAILED?N$o(this._translucentItems,e,t):i},y$w.prototype.removeAllPrimitives=function(){x$A(this._solidItems),x$A(this._translucentItems)};var Z$q=new r$10,j$s=new r$10,z$p=t$X.ZERO,J$w=new t$X;function p$r(e,t,i,r,n,o,a){this.primitives=e,this.appearanceType=t,this.materialProperty=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.closed=o,this.shadows=a,this.updaters=new e$1P,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(p$r.prototype.onMaterialChanged,this),this.subscriptions=new e$1P,this.showsUpdated=new e$1P,this.materialSupport=void 0,this.asynchronous=!0,this.wrapS=q$11.CLAMP_TO_EDGE,this.wrapT=q$11.CLAMP_TO_EDGE,this.compressVertices=!0}p$r.prototype.onMaterialChanged=function(){this.invalidated=!0},p$r.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty,r=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;if(i===t&&n===r)return!0;var o=e$28(t)&&t.equals(i);return o=(!e$28(r)&&!e$28(n)||e$28(r)&&r.equals(n))&&o},p$r.prototype.add=function(e,t){var i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),this.enuCenter=e$28(t._options)?t._options.enuCenter:void 0,e$28(this.enuCenter)&&(this.materialSupport=t$A.MaterialSupport.TEXTUREDMODEL),e$28(t.asynchronous)&&(this.asynchronous=t.asynchronous),e$28(t.wrapS)&&(this.wrapS=t.wrapS),e$28(t.wrapT)&&(this.wrapT=t.wrapT),e$28(t.compressVertices)&&(this.compressVertices=t.compressVertices),this.twoPasses=t.twoPasses,t.hasConstantFill&&t.fillMaterialProperty.isConstant&&r$K.isConstant(t.distanceDisplayConditionProperty)&&r$K.isConstant(t.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener((function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},p$r.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return e$28(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var K$o=new e$1S;function c$r(e,t,i,r,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}p$r.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives,o=this.geometry.values;if(1===o.length&&null===o[0]&&(this.createPrimitive=!1),this.createPrimitive){if(o.length>0){var a;e$28(r)&&(e$28(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),this.material=r$H.getValue(e,this.materialProperty,this.material),this.material._wrapS=this.wrapS,this.material._wrapT=this.wrapT,e$28(this.depthFailMaterialProperty)&&(this.depthFailMaterial=r$H.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),r=new v$C({show:!1,asynchronous:this.asynchronous,geometryInstances:o,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed,materialSupport:this.materialSupport}),depthFailAppearance:a,shadows:this.shadows,updateBoundingSphere:!e$28(this.enuCenter),modelMatrix:e$28(this.enuCenter)?m$1b.eastNorthUpToFixedFrame(this.enuCenter,t$V.WGS84,new y$15):void 0,twoPasses:this.twoPasses,compressVertices:this.compressVertices}),n.add(r),i=!1}else{e$28(r)&&(n.remove(r),r=void 0);var s=this.oldPrimitive;e$28(s)&&(n.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(e$28(r)&&r.ready){r.show=!0,e$28(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=r$H.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,e$28(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof t$z)&&(this.depthFailMaterial=r$H.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var l=this.updatersWithAttributes.values,u=l.length;for(t=0;t<u;t++){var c=l[t],h=c.entity,d=this.geometry.get(c.id),f=this.attributes.get(d.id.id);if(e$28(f)||(f=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,f)),e$28(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof t$z&&!c.depthFailMaterialProperty.isConstant){var p=c.depthFailMaterialProperty.color,_=r$K.getValueOrDefault(p,e,e$1S.WHITE,K$o);e$1S.equals(f._lastDepthFailColor,_)||(f._lastDepthFailColor=e$1S.clone(_,f._lastDepthFailColor),f.depthFailColor=o$18.toValue(_,f.depthFailColor))}var m=h.isShowing&&(c.hasConstantFill||c.isFilled(e));m!==(1===f.show[0])&&(f.show=e$1h.toValue(m,f.show));var $=c.distanceDisplayConditionProperty;if(!r$K.isConstant($)){var g=r$K.getValueOrDefault($,e,j$s,Z$q);r$10.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=r$10.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=t$H.toValue(g,f.distanceDisplayCondition))}var v=c.terrainOffsetProperty;if(!r$K.isConstant(v)){var y=r$K.getValueOrDefault(v,e,z$p,J$w);t$X.equals(y,f._lastOffset)||(f._lastOffset=t$X.clone(y,f._lastOffset),f.offset=e$1o.toValue(y,f.offset))}}this.updateShows(r)}else e$28(r)&&!r.ready&&(i=!1);return i},p$r.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=n.entity,a=this.geometry.get(n.id),s=this.attributes.get(a.id.id);e$28(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));var l=o.isShowing;l!==(1===s.show[0])&&(s.show=e$1h.toValue(l,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},p$r.prototype.contains=function(e){return this.updaters.contains(e.id)},p$r.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!e$28(i)||!i.ready)return A$U.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!e$28(r)||!e$28(r.boundingSphere)||e$28(r.show)&&0===r.show[0]?A$U.FAILED:(r.boundingSphere.clone(t),A$U.DONE)},p$r.prototype.destroy=function(){var e=this.primitive,t=this.primitives;e$28(e)&&t.remove(e);var i=this.oldPrimitive;e$28(i)&&t.remove(i),this.removeMaterialSubscription()},c$r.prototype.add=function(e,t){var i=this._items,r=i.length;if(t instanceof a$r&&e$28(t.entity._polylineVolume.enuCenter))if(0===i.length){(a=new p$r(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows)).add(e,t),a.enuCenter=t.entity._polylineVolume.enuCenter._value,i.push(a)}else{for(var n=0;n<r;n++){var o=i[n];if(t$X.equals(o.enuCenter,t.entity._polylineVolume.enuCenter._value))return void o.add(e,t)}(a=new p$r(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows)).add(e,t),a.enuCenter=t.entity._polylineVolume.enuCenter._value,i.push(a)}else{for(n=0;n<r;n++){if((o=i[n]).isMaterial(t))return void o.add(e,t)}var a;(a=new p$r(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows)).add(e,t),i.push(a)}},c$r.prototype.remove=function(e){for(var t=this._items,i=t.length-1;i>=0;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},c$r.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;t>=0;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,o=n.length,a=0;a<o;a++)this.add(e,n[a]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},c$r.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return A$U.FAILED},c$r.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var x$z=new e$1S,E$v=new r$10,F$y=new r$10;function d$C(e,t,i,r){this.primitives=e,this.zIndex=r,this.classificationType=t,this.color=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.updaters=new e$1P,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.subscriptions=new e$1P,this.showsUpdated=new e$1P,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new r$P}function p$q(e,t){this._batches=[],this._primitives=e,this._classificationType=t}d$C.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},d$C.prototype.add=function(e,t){var i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),this.rectangleCollisionCheck.insert(i,t.geometry.rectangle),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&r$K.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener((function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(i,e)},d$C.prototype.remove=function(e){var t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);return e$28(r)&&(r(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},d$C.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives;if(this.createPrimitive){var o=this.geometry.values;if(o.length>0)e$28(r)&&(e$28(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),r=new d$Q({show:!1,asynchronous:!0,geometryInstances:o.slice(),classificationType:this.classificationType}),n.add(r,this.zIndex),i=!1;else{e$28(r)&&(n.remove(r),r=void 0);var a=this.oldPrimitive;e$28(a)&&(n.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(e$28(r)&&r.ready){r.show=!0,e$28(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0);var s=this.updatersWithAttributes.values,l=s.length,u=this.waitingOnCreate;for(t=0;t<l;t++){var c=s[t],h=this.geometry.get(c.id),d=this.attributes.get(h.id.id);if(e$28(d)||(d=r.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,d)),!c.fillMaterialProperty.isConstant||u){var f=c.fillMaterialProperty.color,p=r$K.getValueOrDefault(f,e,e$1S.WHITE,x$z);e$1S.equals(d._lastColor,p)||(d._lastColor=e$1S.clone(p,d._lastColor),d.color=o$18.toValue(p,d.color))}var _=c.entity.isShowing&&(c.hasConstantFill||c.isFilled(e));_!==(1===d.show[0])&&(d.show=e$1h.toValue(_,d.show));var m=c.distanceDisplayConditionProperty;if(!r$K.isConstant(m)){var $=r$K.getValueOrDefault(m,e,F$y,E$v);r$10.equals($,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=r$10.clone($,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=t$H.toValue($,d.distanceDisplayCondition))}}this.updateShows(r),this.waitingOnCreate=!1}else e$28(r)&&!r.ready&&(i=!1);return this.itemsToRemove.length=0,i},d$C.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=this.geometry.get(n.id),a=this.attributes.get(o.id.id);e$28(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));var s=n.entity.isShowing;s!==(1===a.show[0])&&(a.show=e$1h.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},d$C.prototype.contains=function(e){return this.updaters.contains(e.id)},d$C.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return A$U.PENDING;var r=i.getBoundingSphere(e.entity);return e$28(r)?(r.clone(t),A$U.DONE):A$U.FAILED},d$C.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;e$28(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;e$28(i)&&(e.remove(i),this.oldPrimitive=void 0)},p$q.prototype.add=function(e,t){for(var i,r=t.createFillGeometryInstance(e),n=this._batches,o=r$K.getValueOrDefault(t.zIndex,0),a=n.length,s=0;s<a;++s){var l=n[s];if(l.zIndex===o&&!l.overlapping(r.geometry.rectangle)){i=l;break}}return e$28(i)||(i=new d$C(this._primitives,this._classificationType,r.attributes.color.value,o),n.push(i)),i.add(t,r),i},p$q.prototype.remove=function(e){for(var t=this._batches,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},p$q.prototype.update=function(e){var t,i,r=!0,n=this._batches,o=n.length;for(t=0;t<o;++t)r=n[t].update(e)&&r;for(t=0;t<o;++t)for(var a=n[t],s=a.itemsToRemove,l=s.length,u=0;u<l;u++){i=s[u],a.remove(i);var c=this.add(e,i);a.isDirty=!0,c.isDirty=!0}for(t=o-1;t>=0;--t){var h=n[t];h.isDirty&&(r=n[t].update(e)&&r,h.isDirty=!1),0===h.geometry.length&&n.splice(t,1)}return r},p$q.prototype.getBoundingSphere=function(e,t){for(var i=this._batches,r=i.length,n=0;n<r;++n){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return A$U.FAILED},p$q.prototype.removeAllPrimitives=function(){for(var e=this._batches,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()};var b$B=new r$10,U$t=new r$10;function v$v(e,t,i,r,n,o){this.primitives=e,this.classificationType=t,this.appearanceType=i,this.materialProperty=r,this.updaters=new e$1P,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.material=void 0,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(v$v.prototype.onMaterialChanged,this),this.subscriptions=new e$1P,this.showsUpdated=new e$1P,this.usingSphericalTextureCoordinates=n,this.zIndex=o,this.rectangleCollisionCheck=new r$P}function f$u(e,t,i){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=i}v$v.prototype.onMaterialChanged=function(){this.invalidated=!0},v$v.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},v$v.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof t$z&&t instanceof t$z||e$28(t)&&t.equals(i)},v$v.prototype.add=function(e,t,i){var r=t.id;if(this.updaters.set(r,t),this.geometry.set(r,i),this.rectangleCollisionCheck.insert(r,i.geometry.rectangle),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&r$K.isConstant(t.distanceDisplayConditionProperty)){var n=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener((function(e,i,r,o){"isShowing"===i&&n.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},v$v.prototype.remove=function(e){var t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);return e$28(r)&&(r(),this.subscriptions.remove(t)),!0}return!1},v$v.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives,o=this.geometry.values;if(this.createPrimitive){if(o.length>0)e$28(r)&&(e$28(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),this.material=r$H.getValue(e,this.materialProperty,this.material),r=new d$Q({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,flat:!0}),classificationType:this.classificationType}),n.add(r,this.zIndex),i=!1;else{e$28(r)&&(n.remove(r),r=void 0);var a=this.oldPrimitive;e$28(a)&&(n.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(e$28(r)&&r.ready){r.show=!0,e$28(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=r$H.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var s=this.updatersWithAttributes.values,l=s.length;for(t=0;t<l;t++){var u=s[t],c=u.entity,h=this.geometry.get(u.id),d=this.attributes.get(h.id.id);e$28(d)||(d=r.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,d));var f=c.isShowing&&(u.hasConstantFill||u.isFilled(e));f!==(1===d.show[0])&&(d.show=e$1h.toValue(f,d.show));var p=u.distanceDisplayConditionProperty;if(!r$K.isConstant(p)){var _=r$K.getValueOrDefault(p,e,U$t,b$B);r$10.equals(_,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=r$10.clone(_,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=t$H.toValue(_,d.distanceDisplayCondition))}}this.updateShows(r)}else e$28(r)&&!r.ready&&(i=!1);return i},v$v.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=n.entity,a=this.geometry.get(n.id),s=this.attributes.get(a.id.id);e$28(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));var l=o.isShowing;l!==(1===s.show[0])&&(s.show=e$1h.toValue(l,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},v$v.prototype.contains=function(e){return this.updaters.contains(e.id)},v$v.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return A$U.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!e$28(r)||!e$28(r.boundingSphere)||e$28(r.show)&&0===r.show[0]?A$U.FAILED:(r.boundingSphere.clone(t),A$U.DONE)},v$v.prototype.destroy=function(){var e=this.primitive,t=this.primitives;e$28(e)&&t.remove(e);var i=this.oldPrimitive;e$28(i)&&t.remove(i),this.removeMaterialSubscription()},f$u.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),o=y$F.shouldUseSphericalCoordinates(n.geometry.rectangle),a=r$K.getValueOrDefault(t.zIndex,0),s=0;s<r;++s){var l=i[s];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===o&&l.zIndex===a&&!l.overlapping(n.geometry.rectangle))return void l.add(e,t,n)}var u=new v$v(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,a);u.add(e,t,n),i.push(u)},f$u.prototype.remove=function(e){for(var t=this._items,i=t.length-1;i>=0;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},f$u.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;t>=0;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,o=n.length,a=0;a<o;a++)this.add(e,n[a]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},f$u.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return A$U.FAILED},f$u.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var I$M=new e$1S;function P$r(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0,this.enuCenter=void 0,this.outlineWidth=void 0}function r$v(e,t){i$F.call(this,{entity:e,scene:t,geometryOptions:new P$r(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function u$q(e,t,i){a$L.call(this,e,t,i)}e$28(Object.create)&&(r$v.prototype=Object.create(i$F.prototype),r$v.prototype.constructor=r$v),r$v.prototype.createFillGeometryInstance=function(e){if(o$1u.defined("time",e),!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i,r=this._entity,n=r.isAvailable(e),o=new e$1h(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=t$H.fromDistanceDisplayCondition(a);this._materialProperty instanceof t$z?(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,I$M)),e$28(i)||(i=e$1S.WHITE),t={show:o,distanceDisplayCondition:s,color:o$18.fromColor(i)}):t={show:o,distanceDisplayCondition:s};return new d$15({id:r,geometry:new E$R(this._options),attributes:t})},r$v.prototype.createOutlineGeometryInstance=function(e){if(o$1u.defined("time",e),!this._outlineEnabled)throw new t$Z("This instance does not represent an outlined geometry.");var t=this._entity,i=t.isAvailable(e),r=r$K.getValueOrDefault(this._outlineColorProperty,e,e$1S.BLACK,I$M),n=this._distanceDisplayConditionProperty.getValue(e);return new d$15({id:t,geometry:new P$L(this._options),attributes:{show:new e$1h(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o$18.fromColor(r),distanceDisplayCondition:t$H.fromDistanceDisplayCondition(n)}})},r$v.prototype._isHidden=function(e,t){return!e$28(t.positions)||i$F.prototype._isHidden.call(this,e,t)},r$v.prototype._getIsClosed=function(e){return!1},r$v.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&r$K.isConstant(t.minimumHeights)&&r$K.isConstant(t.maximumHeights)&&r$K.isConstant(t.outlineWidth)&&r$K.isConstant(t.granularity))},r$v.prototype._setStaticOptions=function(e,t){var i=t.minimumHeights,r=t.maximumHeights,n=t.granularity,o=this._materialProperty instanceof t$z,a=t.enuCenter,s=this._options;s.vertexFormat=o?r$J.VERTEX_FORMAT:t$A.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(o$11.MINIMUM_VALUE,s.positions),s.minimumHeights=e$28(i)?i.getValue(o$11.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=e$28(r)?r.getValue(o$11.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=e$28(n)?n.getValue(o$11.MINIMUM_VALUE):void 0,s.enuCenter=e$28(a)?a.getValue(o$11.MINIMUM_VALUE):void 0,s.outlineWidth=t.outlineWidth?t.outlineWidth.getValue(o$11.MINIMUM_VALUE):1},r$v.DynamicGeometryUpdater=u$q,e$28(Object.create)&&(u$q.prototype=Object.create(a$L.prototype),u$q.prototype.constructor=u$q),u$q.prototype._isHidden=function(e,t,i){return!e$28(this._options.positions)||a$L.prototype._isHidden.call(this,e,t,i)},u$q.prototype._setOptions=function(e,t,i){var r=this._options;r.positions=r$K.getValueOrUndefined(t.positions,i,r.positions),r.minimumHeights=r$K.getValueOrUndefined(t.minimumHeights,i,r.minimumHeights),r.maximumHeights=r$K.getValueOrUndefined(t.maximumHeights,i,r.maximumHeights),r.granularity=r$K.getValueOrUndefined(t.granularity,i)};var F$x=new e$1S,H$v=new r$10,Z$p=new r$10,j$r=t$X.ZERO,k$w=new t$X;function c$q(e,t,i,r){this.translucent=t,this.width=i,this.shadows=r,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.updaters=new e$1P,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.itemsToRemove=[],this.subscriptions=new e$1P,this.showsUpdated=new e$1P}function y$v(e,t,i){this._primitives=e,this._scene=t,this._shadows=i,this._solidBatches=new e$1P,this._translucentBatches=new e$1P}c$q.prototype.add=function(e,t){var i=e.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&r$K.isConstant(e.distanceDisplayConditionProperty)&&r$K.isConstant(e.terrainOffsetProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener((function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,e)})))}else this.updatersWithAttributes.set(i,e)},c$q.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return e$28(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},c$q.prototype.update=function(e){var t,i=!0,r=0,n=this.primitive,o=this.primitives;if(this.createPrimitive){var a=this.geometry.values;if(a.length>0)e$28(n)&&(e$28(this.oldPrimitive)?o.remove(n):this.oldPrimitive=n),n=new v$C({show:!1,asynchronous:!0,geometryInstances:a,appearance:new r$J({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width},hasSideness:e$28(this.outlineWidth)}),shadows:this.shadows}),e$28(this.outlineWidth)&&(n._outlineWidth=this.outlineWidth),o.add(n),i=!1;else{e$28(n)&&(o.remove(n),n=void 0);var s=this.oldPrimitive;e$28(s)&&(o.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(e$28(n)&&n.ready){n.show=!0,e$28(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);var l=this.updatersWithAttributes.values,u=l.length,c=this.waitingOnCreate;for(t=0;t<u;t++){var h=l[t],d=this.geometry.get(h.id),f=this.attributes.get(d.id.id);if(e$28(f)||(f=n.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,f)),!h.outlineColorProperty.isConstant||c){var p=h.outlineColorProperty,_=r$K.getValueOrDefault(p,e,e$1S.WHITE,F$x);e$1S.equals(f._lastColor,_)||(f._lastColor=e$1S.clone(_,f._lastColor),f.color=o$18.toValue(_,f.color),(this.translucent&&255===f.color[3]||!this.translucent&&255!==f.color[3])&&(this.itemsToRemove[r++]=h))}var m=h.entity.isShowing&&(h.hasConstantOutline||h.isOutlineVisible(e));m!==(1===f.show[0])&&(f.show=e$1h.toValue(m,f.show));var $=h.distanceDisplayConditionProperty;if(!r$K.isConstant($)){var g=r$K.getValueOrDefault($,e,Z$p,H$v);r$10.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=r$10.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=t$H.toValue(g,f.distanceDisplayCondition))}var v=h.terrainOffsetProperty;if(!r$K.isConstant(v)){var y=r$K.getValueOrDefault(v,e,j$r,k$w);t$X.equals(y,f._lastOffset)||(f._lastOffset=t$X.clone(y,f._lastOffset),f.offset=e$1o.toValue(y,f.offset))}}this.updateShows(n),this.waitingOnCreate=!1}else e$28(n)&&!n.ready&&(i=!1);return this.itemsToRemove.length=r,i},c$q.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=this.geometry.get(n.id),a=this.attributes.get(o.id.id);e$28(a)||(a=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,a));var s=n.entity.isShowing;s!==(1===a.show[0])&&(a.show=e$1h.toValue(s,a.show),o.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()},c$q.prototype.contains=function(e){return this.updaters.contains(e.id)},c$q.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return A$U.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!e$28(r)||!e$28(r.boundingSphere)||e$28(r.show)&&0===r.show[0]?A$U.FAILED:(r.boundingSphere.clone(t),A$U.DONE)},c$q.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;e$28(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;e$28(i)&&(e.remove(i),this.oldPrimitive=void 0)},y$v.prototype.add=function(e,t){var i=t.createOutlineGeometryInstance(e);if(e$28(i)){var r,n,o,a=this._scene.clampLineWidth(t.outlineWidth);255===i.attributes.color.value[3]?(n=this._solidBatches,t instanceof u$r||t instanceof r$v?(o=t.outlineWidth,r=n.get(o)):r=n.get(a),e$28(r)||(r=new c$q(this._primitives,!1,a,this._shadows),e$28(o)?(n.set(o,r),r.outlineWidth=o):n.set(a,r)),r.add(t,i)):(n=this._translucentBatches,t instanceof u$r||t instanceof r$v?(o=t.outlineWidth,r=n.get(o)):r=n.get(a),e$28(r)||(r=new c$q(this._primitives,!0,a,this._shadows),n.set(a,r),e$28(o)&&(r.outlineWidth=o)),r.add(t,i))}},y$v.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;t<r;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},y$v.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,i=0;i<s;i++){c=(n=a[i]).update(e);var d=(o=n.itemsToRemove).length;if(d>0)for(h=!0,t=0;t<d;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;i<u;i++){c=(n=l[i]).update(e);var f=(o=n.itemsToRemove).length;if(f>0)for(h=!0,t=0;t<f;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},y$v.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;i<n;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(i=0;i<s;i++){var l=a[i];if(l.contains(e))return l.getBoundingSphere(e,t)}return A$U.FAILED},y$v.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;e<n;e++)r[e].removeAllPrimitives()};var ee$m=[],I$L=[i$E,s$n,f$A,u$r,l$B,p$s,l$A,a$r,d$D,r$v,l$F];function m$u(e,t){this.entity=e,this.scene=t;var i=new Array(I$L.length),r=new o$1o;function n(e){r.raiseEvent(e)}for(var o=new n$R,a=0;a<i.length;a++){var s=new I$L[a](e,t);o.add(s.geometryChanged,n),i[a]=s}this.updaters=i,this.geometryChanged=r,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(m$u.prototype._onEntityPropertyChanged,this)}function c$p(e,t,i,r){o$1u.defined("scene",e),o$1u.defined("entityCollection",t),i=u$Y(i,e.primitives),r=u$Y(r,e.groundPrimitives),this._scene=e,this._primitives=i,this._groundPrimitives=r,this._entityCollection=void 0,this._addedObjects=new e$1P,this._removedObjects=new e$1P,this._changedObjects=new e$1P;var n=q$L.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(2*n),this._closedColorBatches=new Array(2*n),this._closedMaterialBatches=new Array(2*n),this._openColorBatches=new Array(2*n),this._openMaterialBatches=new Array(2*n);var o,a=h$F.supportsMaterialsforEntitiesOnTerrain(e);for(this._supportsMaterialsforEntitiesOnTerrain=a,o=0;o<n;++o)this._outlineBatches[o]=new y$v(i,e,o,!1),this._outlineBatches[n+o]=new y$v(i,e,o,!0),this._closedColorBatches[o]=new y$w(i,r$J,void 0,!0,o,!0),this._closedColorBatches[n+o]=new y$w(i,r$J,void 0,!0,o,!1),this._closedMaterialBatches[o]=new c$r(i,t$A,void 0,!0,o,!0),this._closedMaterialBatches[n+o]=new c$r(i,t$A,void 0,!0,o,!1),this._openColorBatches[o]=new y$w(i,r$J,void 0,!1,o,!0),this._openColorBatches[n+o]=new y$w(i,r$J,void 0,!1,o,!1),this._openMaterialBatches[o]=new c$r(i,t$A,void 0,!1,o,!0),this._openMaterialBatches[n+o]=new c$r(i,t$A,void 0,!1,o,!1);var s=L$V.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(s),u=[];if(a)for(o=0;o<s;++o)u.push(new f$u(r,o,t$A)),l[o]=new p$q(r,o);else for(o=0;o<s;++o)l[o]=new p$q(r,o);this._groundColorBatches=l,this._groundMaterialBatches=u,this._dynamicBatch=new r$w(i,r),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new e$1P,this._updaterSets=new e$1P,this._entityCollection=t,t.collectionChanged.addEventListener(c$p.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ee$m)}m$u.prototype._onEntityPropertyChanged=function(e,t,i,r){for(var n=this.updaters,o=0;o<n.length;o++)n[o]._onEntityPropertyChanged(e,t,i,r)},m$u.prototype.forEach=function(e){for(var t=this.updaters,i=0;i<t.length;i++)e(t[i])},m$u.prototype.destroy=function(){this.eventHelper.removeAll();for(var e=this.updaters,t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),i$Z(this)},c$p.prototype.update=function(e){o$1u.defined("time",e);var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values,h=this;for(t=c.length-1;t>-1;t--)r=(i=c[t]).id,(n=this._updaterSets.get(r)).entity===i?n.forEach((function(t){h._removeUpdater(t),h._insertUpdaterIntoBatch(e,t)})):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)if(r=(i=l[t]).id,e$28(n=this._updaterSets.get(r))&&(n.forEach(this._removeUpdater.bind(this)),n.destroy(),this._updaterSets.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r),i.children.length>0))for(var d=0;d<i.children.length;d++){r=(f=i.children[d]).id,e$28(n=this._updaterSets.get(r))&&(n.forEach(this._removeUpdater.bind(this)),n.destroy(),this._updaterSets.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r))}for(t=a.length-1;t>-1;t--)if(r=(i=a[t]).id,n=new m$u(i,this._scene),this._updaterSets.set(r,n),n.forEach((function(t){h._insertUpdaterIntoBatch(e,t)})),this._subscriptions.set(r,n.geometryChanged.addEventListener(c$p._onGeometryChanged,this)),i.children.length>0)for(d=0;d<i.children.length;d++){var f=i.children[d];i.entityCollection.contains(f)||(r=f.id,n=new m$u(f,this._scene),this._updaterSets.set(r,n),n.forEach((function(t){h._insertUpdaterIntoBatch(e,t)})),this._subscriptions.set(r,n.geometryChanged.addEventListener(c$p._onGeometryChanged,this)))}o.removeAll(),s.removeAll(),u.removeAll();var p=!0,_=this._batches,m=_.length;for(t=0;t<m;t++)p=_[t].update(e)&&p;return p};var te$k=[],re$g=new i$19;c$p.prototype.getBoundingSphere=function(e,t){o$1u.defined("entity",e),o$1u.defined("result",t);for(var i=te$k,r=re$g,n=0,o=A$U.DONE,a=this._batches,s=a.length,l=e.id,u=this._updaterSets.get(l).updaters,c=0;c<u.length;c++)for(var h=u[c],d=0;d<s;d++){if((o=a[d].getBoundingSphere(h,r))===A$U.PENDING)return A$U.PENDING;o===A$U.DONE&&(i[n]=i$19.clone(r,i[n]),n++)}return 0===n?A$U.FAILED:(i.length=n,i$19.fromBoundingSpheres(i,t),A$U.DONE)},c$p.prototype.isDestroyed=function(){return!1},c$p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(c$p.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();this._subscriptions.removeAll();var n=this._updaterSets.values;for(i=n.length,e=0;e<i;e++)n[e].destroy();return this._updaterSets.removeAll(),i$Z(this)},c$p.prototype._removeUpdater=function(e){for(var t=this._batches,i=t.length,r=0;r<i;r++)t[r].remove(e)},c$p.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic)this._dynamicBatch.add(e,t);else{var i;(t.outlineEnabled||t.fillEnabled)&&(i=t.shadowsProperty.getValue(e));var r=q$L.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(e$28(t.terrainOffsetProperty)?this._outlineBatches[r+i].add(e,t):this._outlineBatches[i].add(e,t)),t.fillEnabled)if(t.onTerrain){var n=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof t$z?this._groundColorBatches[n].add(e,t):this._groundMaterialBatches[n].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof t$z?e$28(t.terrainOffsetProperty)?this._closedColorBatches[r+i].add(e,t):this._closedColorBatches[i].add(e,t):e$28(t.terrainOffsetProperty)?this._closedMaterialBatches[r+i].add(e,t):this._closedMaterialBatches[i].add(e,t):t.fillMaterialProperty instanceof t$z?e$28(t.terrainOffsetProperty)?this._openColorBatches[r+i].add(e,t):this._openColorBatches[i].add(e,t):e$28(t.terrainOffsetProperty)?this._openMaterialBatches[r+i].add(e,t):this._openMaterialBatches[i].add(e,t)}},c$p._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,n=r.id;!e$28(t.get(n))&&!e$28(i.get(n))&&i.set(n,r)},c$p.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)n=(o=i[r]).id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)n=(o=t[r]).id,s.remove(n)?l.set(n,o):a.set(n,o)};var U$s=1,q$r="30px sans-serif",N$n=R$t.FILL,z$o=e$1S.WHITE,A$E=e$1S.BLACK,F$w=1,H$u=!1,T$n=new e$1S(.165,.165,.165,.8),W$s=new o$1k(7,5),I$K=o$1k.ZERO,Z$o=t$X.ZERO,j$q=k$_.NONE,K$n=j$13.CENTER,J$v=S$L.CENTER,M$v=new t$X,Q$q=new e$1S,X$h=new e$1S,Y$k=new e$1S,$$r=new o$1k,G$z=new t$X,b$A=new o$1k,ee$l=new o$1b,te$j=new o$1b,re$f=new o$1b,ne$l=new r$10;function S$m(e){this.entity=e,this.label=void 0,this.index=void 0}function l$y(e,t){if(!e$28(e))throw new t$Z("entityCluster is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(l$y.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new e$1P,this._onCollectionChanged(t,t.values,[],[])}function y$u(e,t,i){e$28(e)&&(e.label=void 0,i.removeLabel(t))}l$y.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var o,a,s=t[r],l=s.entity,u=l._label,c=s.label,h=l.isShowing&&l.isAvailable(e)&&r$K.getValueOrDefault(u._show,e,!0);if(h&&(a=r$K.getValueOrUndefined(l._position,e,M$v),o=r$K.getValueOrUndefined(u._text,e),h=e$28(a)&&e$28(o)),h){r$K.isConstant(l._position)||(i._clusterDirty=!0);var d=!1,f=r$K.getValueOrDefault(u._heightReference,e,j$q);e$28(c)||((c=i.getLabel(l)).id=l,s.label=c,d=t$X.equals(c.position,a)&&c.heightReference===f),c.show=!0,c.position=a,c.text=o,c.scale=r$K.getValueOrDefault(u._scale,e,U$s),c.font=r$K.getValueOrDefault(u._font,e,q$r),c.style=r$K.getValueOrDefault(u._style,e,N$n),c.fillColor=r$K.getValueOrDefault(u._fillColor,e,z$o,Q$q),c.outlineColor=r$K.getValueOrDefault(u._outlineColor,e,A$E,X$h),c.outlineWidth=r$K.getValueOrDefault(u._outlineWidth,e,F$w),c.showBackground=r$K.getValueOrDefault(u._showBackground,e,H$u),c.backgroundColor=r$K.getValueOrDefault(u._backgroundColor,e,T$n,Y$k),c.backgroundPadding=r$K.getValueOrDefault(u._backgroundPadding,e,W$s,$$r),c.pixelOffset=r$K.getValueOrDefault(u._pixelOffset,e,I$K,b$A),c.eyeOffset=r$K.getValueOrDefault(u._eyeOffset,e,Z$o,G$z),c.heightReference=f,c.horizontalOrigin=r$K.getValueOrDefault(u._horizontalOrigin,e,K$n),c.verticalOrigin=r$K.getValueOrDefault(u._verticalOrigin,e,J$v),c.translucencyByDistance=r$K.getValueOrUndefined(u._translucencyByDistance,e,ee$l),c.pixelOffsetScaleByDistance=r$K.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,te$j),c.scaleByDistance=r$K.getValueOrUndefined(u._scaleByDistance,e,re$f),c.distanceDisplayCondition=r$K.getValueOrUndefined(u._distanceDisplayCondition,e,ne$l),c.disableDepthTestDistance=r$K.getValueOrUndefined(u._disableDepthTestDistance,e),d&&c._updateClamping()}else y$u(s,l,i)}return!0},l$y.prototype.getBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(t))throw new t$Z("result is required.");var i=this._items.get(e.id);if(!e$28(i)||!e$28(i.label))return A$U.FAILED;var r=i.label;return t.center=t$X.clone(u$Y(r._clampedPosition,r.position),t.center),t.radius=0,A$U.DONE},l$y.prototype.isDestroyed=function(){return!1},l$y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(l$y.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return i$Z(this)},l$y.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a=this._items,s=this._cluster;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._label)&&e$28(o._position)&&a.set(o.id,new S$m(o));for(n=r.length-1;n>-1;n--)e$28((o=r[n])._label)&&e$28(o._position)?a.contains(o.id)||a.set(o.id,new S$m(o)):(y$u(a.get(o.id),o,s),a.remove(o.id));for(n=i.length-1;n>-1;n--)o=i[n],y$u(a.get(o.id),o,s),a.remove(o.id)};var N$m=1,j$p=0,k$v=!0,W$r=!0,J$u=q$L.ENABLED,K$m=k$_.NONE,Q$p=e$1S.RED,X$g=0,Y$j=e$1S.WHITE,Z$n=I$X.HIGHLIGHT,$$q=.5,G$y=new o$1k(1,1),ee$k=new y$15,ie$g=new y$15;function d$B(e,t){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(d$B.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new e$1P,this._onCollectionChanged(t,t.values,[],[])}function M$u(e,t,i,r){var n=i[t.id];e$28(n)&&(r.removeAndDestroy(n.modelPrimitive),delete i[t.id])}function re$e(e,t){var i=t[e.id];e$28(i)&&(i.nodeTransformationsScratch={})}function te$i(e,t,i){e.readyPromise.otherwise((function(e){console.error(e),i[t.id].loadFail=!0}))}function i$r(e){this._definitionChanged=new o$1o,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}d$B.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");for(var t=this._entitiesToVisualize.values,i=this._modelHash,r=this._primitives,n=0,o=t.length;n<o;n++){var a,s,l=t[n],u=l._model,c=i[l.id],h=l.isShowing&&l.isAvailable(e)&&r$K.getValueOrDefault(u._show,e,!0);if(h&&(s=l.computeModelMatrix(e,ee$k),a=t$S.createIfNeeded(r$K.getValueOrUndefined(u._uri,e)),h=e$28(s)&&e$28(a)),h){var d=e$28(c)?c.modelPrimitive:void 0;if((!e$28(d)||a.url!==c.url)&&(e$28(d)&&(r.removeAndDestroy(d),delete i[l.id]),(d=D$G.fromGltf({url:a,incrementallyLoadTextures:r$K.getValueOrDefault(u._incrementallyLoadTextures,e,k$v),scene:this._scene})).id=l,r.add(d),c={modelPrimitive:d,url:a.url,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{},loadFail:!1},i[l.id]=c,te$i(d,l,i)),d.show=!0,d.scale=r$K.getValueOrDefault(u._scale,e,N$m),d._offsetMatrix=u._offsetMatrix,d.minimumPixelSize=r$K.getValueOrDefault(u._minimumPixelSize,e,j$p),d.maximumScale=r$K.getValueOrUndefined(u._maximumScale,e),d.modelMatrix=y$15.clone(s,d.modelMatrix),d.shadows=r$K.getValueOrDefault(u._shadows,e,J$u),d.heightReference=r$K.getValueOrDefault(u._heightReference,e,K$m),d.distanceDisplayCondition=r$K.getValueOrUndefined(u._distanceDisplayCondition,e),d.silhouetteColor=r$K.getValueOrDefault(u._silhouetteColor,e,Q$p,d._silhouetteColor),d.silhouetteSize=r$K.getValueOrDefault(u._silhouetteSize,e,X$g),d.color=r$K.getValueOrDefault(u._color,e,Y$j,d._color),d.colorBlendMode=r$K.getValueOrDefault(u._colorBlendMode,e,Z$n),d.colorBlendAmount=r$K.getValueOrDefault(u._colorBlendAmount,e,$$q),d.clippingPlanes=r$K.getValueOrUndefined(u._clippingPlanes,e),d.clampAnimations=r$K.getValueOrDefault(u._clampAnimations,e,W$r),d.imageBasedLightingFactor=r$K.getValueOrDefault(u._imageBasedLightingFactor,e,G$y),d.lightColor=r$K.getValueOrUndefined(u._lightColor,e),d.ready){var f=r$K.getValueOrDefault(u._runAnimations,e,!0);c.animationsRunning!==f&&(f?d.activeAnimations.addAll({loop:_0x3df4ed.REPEAT}):d.activeAnimations.removeAll(),c.animationsRunning=f);var p=r$K.getValueOrUndefined(u._nodeTransformations,e,c.nodeTransformationsScratch);if(e$28(p))for(var _=c.originalNodeMatrixHash,m=Object.keys(p),$=0,g=m.length;$<g;++$){var v=m[$],y=p[v];if(e$28(y)){var x=d.getNode(v);if(e$28(x)){var b=_[v];e$28(b)||(b=x.matrix.clone(),_[v]=b);var w=y$15.fromTranslationRotationScale(y,ie$g);x.matrix=y$15.multiply(b,w,w)}}}}}else e$28(c)&&(c.modelPrimitive.show=!1)}return!0},d$B.prototype.isDestroyed=function(){return!1},d$B.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d$B.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;r>-1;r--)M$u(this,e[r],t,i);return i$Z(this)},d$B.prototype.getBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(t))throw new t$Z("result is required.");var i=this._modelHash[e.id];if(!e$28(i)||i.loadFail)return A$U.FAILED;var r=i.modelPrimitive;if(!e$28(r)||!r.show)return A$U.FAILED;if(!r.ready)return A$U.PENDING;if(r.heightReference===k$_.NONE)i$19.transform(r.boundingSphere,r.modelMatrix,t);else{if(!e$28(r._clampedModelMatrix))return A$U.PENDING;i$19.transform(r.boundingSphere,r._clampedModelMatrix,t)}return A$U.DONE},d$B.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a=this._entitiesToVisualize,s=this._modelHash,l=this._primitives;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._model)&&e$28(o._position)&&a.set(o.id,o);for(n=r.length-1;n>-1;n--)e$28((o=r[n])._model)&&e$28(o._position)?(re$e(o,s),a.set(o.id,o)):(M$u(this,o,s,l),a.remove(o.id));for(n=i.length-1;n>-1;n--)M$u(this,o=i[n],s,l),a.remove(o.id)},Object.defineProperties(i$r.prototype,{isConstant:{get:function(){return r$K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e$28(this._value)?this._value.referenceFrame:Re$j.FIXED}}}),i$r.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,Re$j.FIXED,t)},i$r.prototype.setValue=function(e){this._value!==e&&(this._value=e,e$28(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e$28(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},i$r.prototype.getValueInReferenceFrame=function(e,t,i){if(!e$28(e))throw new t$Z("time is required.");if(!e$28(t))throw new t$Z("referenceFrame is required.");if(e$28(this._value))return e$28(i=this._value.getValueInReferenceFrame(e,t,i))?t$V.WGS84.scaleToGeodeticSurface(i,i):void 0},i$r.prototype.equals=function(e){return this===e||e instanceof i$r&&this._value===e._value},i$r.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var $$p=60,U$r=1,F$v=new d$_,V$o=new d$_,D$x=new d$_;function T$m(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function ee$j(e,t,i,r,n,o,a,s,l){var u,c=s;e$28(u=e.getValueInReferenceFrame(t,o,l[c]))&&(l[c++]=u);for(var h,d,f,p=!e$28(n)||a$12.lessThanOrEquals(n,t)||a$12.greaterThanOrEquals(n,i),_=0,m=r.length,$=r[_],g=i,v=!1;_<m;){if(!p&&a$12.greaterThanOrEquals($,n)&&(e$28(u=e.getValueInReferenceFrame(n,o,l[c]))&&(l[c++]=u),p=!0),a$12.greaterThan($,t)&&a$12.lessThan($,g)&&!$.equals(n)&&(e$28(u=e.getValueInReferenceFrame($,o,l[c]))&&(l[c++]=u)),_<m-1){if(a>0&&!v){var y=r[_+1],x=a$12.secondsDifference(y,$);(v=x>a)&&(h=Math.ceil(x/a),d=0,f=x/Math.max(h,2),h=Math.max(h-1,1))}if(v&&d<h){$=a$12.addSeconds($,f,new a$12),d++;continue}}v=!1,$=r[++_]}return e$28(u=e.getValueInReferenceFrame(i,o,l[c]))&&(l[c++]=u),c}function ne$k(e,t,i,r,n,o,a,s){for(var l,u=0,c=a,h=t,d=Math.max(o,60),f=!e$28(r)||a$12.lessThanOrEquals(r,t)||a$12.greaterThanOrEquals(r,i);a$12.lessThan(h,i);)!f&&a$12.greaterThanOrEquals(h,r)&&(f=!0,e$28(l=e.getValueInReferenceFrame(r,n,s[c]))&&(s[c]=l,c++)),e$28(l=e.getValueInReferenceFrame(h,n,s[c]))&&(s[c]=l,c++),u++,h=a$12.addSeconds(t,d*u,new a$12);return e$28(l=e.getValueInReferenceFrame(i,n,s[c]))&&(s[c]=l,c++),c}function oe$g(e,t,i,r,n,o,a,s){D$x.start=t,D$x.stop=i;for(var l=a,u=e.intervals,c=0;c<u.length;c++){var h=u.get(c);if(!d$_.intersect(h,D$x,F$v).isEmpty){var d=h.start;h.isStartIncluded||(d=h.isStopIncluded?h.stop:a$12.addSeconds(h.start,a$12.secondsDifference(h.stop,h.start)/2,new a$12));var f=e.getValueInReferenceFrame(d,n,s[l]);e$28(f)&&(s[l]=f,l++)}}return l}function ie$f(e,t,i,r,n,o,a,s){var l=e.getValueInReferenceFrame(t,n,s[a]);return e$28(l)&&(s[a++]=l),a}function re$d(e,t,i,r,n,o,a,s){V$o.start=t,V$o.stop=i;for(var l=a,u=e.intervals,c=0;c<u.length;c++){var h=u.get(c);if(!d$_.intersect(h,V$o,F$v).isEmpty){var d=h.start,f=h.stop,p=t;a$12.greaterThan(d,p)&&(p=d);var _=i;a$12.lessThan(f,_)&&(_=f),l=x$y(h.data,p,_,r,n,o,l,s)}}return l}function x$y(e,t,i,r,n,o,a,s){for(;e instanceof a$t;)e=e.resolvedProperty;e instanceof o$J?a=ee$j(e,t,i,e._property._times,r,n,o,a,s):a=e instanceof t$q?re$d(e,t,i,r,n,o,a,s):e instanceof t$l?oe$g(e,t,i,r,n,o,a,s):e instanceof r$G||e instanceof i$r&&r$K.isConstant(e)?ie$f(e,t,i,r,n,o,a,s):ne$k(e,t,i,r,n,o,a,s);return a}function A$D(e,t,i,r,n,o,a){e$28(a)||(a=[]);var s=x$y(e,t,i,r,n,o,0,a);return a.length=s,a}var G$x=new p$1a;function I$J(e,t){this._unusedIndexes=[],this._polylineCollection=new X$v,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function w$l(e,t){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(w$l.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new e$1P,this._onCollectionChanged(t,t.values,[],[])}I$J.prototype.update=function(e){if(this._referenceFrame===Re$j.INERTIAL){var t=m$1b.computeIcrfToFixedMatrix(e,G$x);e$28(t)||(t=m$1b.computeTemeToPseudoFixedMatrix(e,G$x)),y$15.fromRotationTranslation(t,t$X.ZERO,this._polylineCollection.modelMatrix)}},I$J.prototype.updateObject=function(e,t){var i,r,n=t.entity,o=n._path,a=n._position,s=o._show,l=t.polyline,u=n.isShowing&&(!e$28(s)||s.getValue(e));if(u){var c=r$K.getValueOrUndefined(o._leadTime,e),h=r$K.getValueOrUndefined(o._trailTime,e),d=n._availability,f=e$28(d),p=e$28(c),_=e$28(h);if(u=f||p&&_){if(_&&(i=a$12.addSeconds(e,-h,new a$12)),p&&(r=a$12.addSeconds(e,c,new a$12)),f){var m=d.start,$=d.stop;(!_||a$12.greaterThan(m,i))&&(i=m),(!p||a$12.lessThan($,r))&&(r=$)}u=a$12.lessThan(i,r)}}if(u){if(!e$28(l)){var g=this._unusedIndexes;if(g.length>0){var v=g.pop();l=this._polylineCollection.get(v),t.index=v}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}var y=r$K.getValueOrDefault(o._resolution,e,$$p);l.show=!0,l.positions=A$D(a,i,r,e,this._referenceFrame,y,l.positions.slice()),l.material=r$H.getValue(e,o._material,l.material),l.width=r$K.getValueOrDefault(o._width,e,U$r),l.distanceDisplayCondition=r$K.getValueOrUndefined(o._distanceDisplayCondition,e,l.distanceDisplayCondition)}else e$28(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0)},I$J.prototype.removeObject=function(e){var t=e.polyline;e$28(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},I$J.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i$Z(this)},w$l.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);var r=this._items.values;if(0===r.length&&e$28(this._updaters)&&Object.keys(this._updaters).length>0){for(var n in t)t.hasOwnProperty(n)&&t[n].destroy();this._updaters={}}for(var o=0,a=r.length;o<a;o++){var s=r[o],l=s.entity._position,u=s.updater,c=Re$j.FIXED;this._scene.mode===P$$.SCENE3D&&(c=l.referenceFrame);var h=this._updaters[c];u===h&&e$28(h)?h.updateObject(e,s):(e$28(u)&&u.removeObject(s),e$28(h)||((h=new I$J(this._scene,c)).update(e),this._updaters[c]=h),s.updater=h,e$28(h)&&h.updateObject(e,s))}return!0},w$l.prototype.isDestroyed=function(){return!1},w$l.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(w$l.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i$Z(this)},w$l.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a,s=this._items;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._path)&&e$28(o._position)&&s.set(o.id,new T$m(o));for(n=r.length-1;n>-1;n--)e$28((o=r[n])._path)&&e$28(o._position)?s.contains(o.id)||s.set(o.id,new T$m(o)):e$28(a=s.get(o.id))&&(e$28(a.updater)&&a.updater.removeObject(a),s.remove(o.id));for(n=i.length-1;n>-1;n--)o=i[n],e$28(a=s.get(o.id))&&(e$28(a.updater)&&a.updater.removeObject(a),s.remove(o.id))},w$l._subSample=A$D;var x$x=e$1S.WHITE,I$I=e$1S.BLACK,L$u=0,W$q=1,z$n=0,M$t=new e$1S,w$k=new t$X,F$u=new e$1S,H$t=new o$1b,j$o=new o$1b,k$u=new r$10;function J$t(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function v$u(e,t){if(!e$28(e))throw new t$Z("entityCluster is required.");if(!e$28(t))throw new t$Z("entityCollection is required.");t.collectionChanged.addEventListener(v$u.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new e$1P,this._onCollectionChanged(t,t.values,[],[])}function V$n(e,t,i){if(e$28(e)){if(e$28(e.pointPrimitive))return e.pointPrimitive=void 0,void i.removePoint(t);e$28(e.billboard)&&(e.billboard=void 0,i.removeBillboard(t))}}v$u.prototype.update=function(e){if(!e$28(e))throw new t$Z("time is required.");for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var o,a=t[r],s=a.entity,l=s._point,u=a.pointPrimitive,c=a.billboard,h=r$K.getValueOrDefault(l._heightReference,e,k$_.NONE),d=s.isShowing&&s.isAvailable(e)&&r$K.getValueOrDefault(l._show,e,!0);if(d&&(d=e$28(o=r$K.getValueOrUndefined(s._position,e,w$k))),d){r$K.isConstant(s._position)||(i._clusterDirty=!0);var f=!1,p=!1;if(h===k$_.NONE||e$28(c)?h===k$_.NONE&&!e$28(u)&&(e$28(c)&&(V$n(a,s,i),c=void 0),(u=i.getPoint(s)).id=s,a.pointPrimitive=u):(e$28(u)&&(V$n(a,s,i),u=void 0),(c=i.getBillboard(s)).id=s,c.image=void 0,a.billboard=c,f=!0,p=t$X.equals(c.position,o)&&c.heightReference===h),e$28(u))u.show=!0,u.position=o,u.scaleByDistance=r$K.getValueOrUndefined(l._scaleByDistance,e,H$t),u.translucencyByDistance=r$K.getValueOrUndefined(l._translucencyByDistance,e,j$o),u.color=r$K.getValueOrDefault(l._color,e,x$x,M$t),u.outlineColor=r$K.getValueOrDefault(l._outlineColor,e,I$I,F$u),u.outlineWidth=r$K.getValueOrDefault(l._outlineWidth,e,L$u),u.pixelSize=r$K.getValueOrDefault(l._pixelSize,e,W$q),u.distanceDisplayCondition=r$K.getValueOrUndefined(l._distanceDisplayCondition,e,k$u),u.disableDepthTestDistance=r$K.getValueOrDefault(l._disableDepthTestDistance,e,z$n);else if(e$28(c)){c.show=!0,c.position=o,c.scaleByDistance=r$K.getValueOrUndefined(l._scaleByDistance,e,H$t),c.translucencyByDistance=r$K.getValueOrUndefined(l._translucencyByDistance,e,j$o),c.distanceDisplayCondition=r$K.getValueOrUndefined(l._distanceDisplayCondition,e,k$u),c.disableDepthTestDistance=r$K.getValueOrDefault(l._disableDepthTestDistance,e,z$n),c.heightReference=h;var _=r$K.getValueOrDefault(l._color,e,x$x,M$t),m=r$K.getValueOrDefault(l._outlineColor,e,I$I,F$u),$=Math.round(r$K.getValueOrDefault(l._outlineWidth,e,L$u)),g=Math.max(1,Math.round(r$K.getValueOrDefault(l._pixelSize,e,W$q)));if($>0?(c.scale=1,f=f||$!==a.outlineWidth||g!==a.pixelSize||!e$1S.equals(_,a.color)||!e$1S.equals(m,a.outlineColor)):(c.scale=g/50,g=50,f=f||$!==a.outlineWidth||!e$1S.equals(_,a.color)||!e$1S.equals(m,a.outlineColor)),f){a.color=e$1S.clone(_,a.color),a.outlineColor=e$1S.clone(m,a.outlineColor),a.pixelSize=g,a.outlineWidth=$;var v=_.alpha,y=_.toCssColorString(),x=m.toCssColorString(),b=JSON.stringify([y,g,x,$]);c.setImage(b,i$z(v,y,x,$,g))}p&&c._updateClamping()}}else V$n(a,s,i)}return!0},v$u.prototype.getBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(t))throw new t$Z("result is required.");var i=this._items.get(e.id);if(!e$28(i)||!e$28(i.pointPrimitive)&&!e$28(i.billboard))return A$U.FAILED;if(e$28(i.pointPrimitive))t.center=t$X.clone(i.pointPrimitive.position,t.center);else{var r=i.billboard;if(!e$28(r._clampedPosition))return A$U.PENDING;t.center=t$X.clone(r._clampedPosition,t.center)}return t.radius=0,A$U.DONE},v$u.prototype.isDestroyed=function(){return!1},v$u.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(v$u.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return i$Z(this)},v$u.prototype._onCollectionChanged=function(e,t,i,r){var n,o,a=this._items,s=this._cluster;for(n=t.length-1;n>-1;n--)e$28((o=t[n])._point)&&e$28(o._position)&&a.set(o.id,new J$t(o));for(n=r.length-1;n>-1;n--)e$28((o=r[n])._point)&&e$28(o._position)?a.contains(o.id)||a.set(o.id,new J$t(o)):(V$n(a.get(o.id),o,s),a.remove(o.id));for(n=i.length-1;n>-1;n--)o=i[n],V$n(a.get(o.id),o,s),a.remove(o.id)};var d$A=e$1S.WHITE,l$x=1,f$t=.3,h$t=5,u$p=0,c$o=1e3;function o$H(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._spotSize=void 0,this._trailLength=void 0,this._spotIntensity=void 0,this._constantSpeed=void 0,this._period=void 0,this.color=e.color,this.spotSize=e.spotSize,this.trailLength=e.trailLength,this.spotIntensity=e.spotIntensity,this.constantSpeed=e.constantSpeed/1e3,this.period=1e3*e.period,this.trailTime=void 0,this._startTime=performance.now(),this._bAsy=u$Y(e.bAsy,!0)}Object.defineProperties(o$H.prototype,{isConstant:{get:function(){return r$K.isConstant(this._trailLength)&&r$K.isConstant(this._constantSpeed)&&r$K.isConstant(this._period)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),spotSize:C$H("spotSize"),trailLength:C$H("trailLength"),spotIntensity:C$H("spotIntensity"),constantSpeed:C$H("constantSpeed"),period:C$H("period")}),o$H.prototype.getType=function(e){return"PolylineTrail"},o$H.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,d$A,t.color),t.trailTime=performance.now(),t.spotSize=r$K.getValueOrDefault(this._spotSize,e,l$x),t.constantSpeed=r$K.getValueOrDefault(this._constantSpeed,e,u$p),t.trailLength=r$K.getValueOrDefault(this._trailLength,e,f$t),t.period=r$K.getValueOrDefault(this._period,e,c$o),t.spotIntensity=r$K.getValueOrDefault(this._spotIntensity,e,h$t),t.startTime=this._startTime,t},o$H.prototype.equals=function(e){return this===e||e instanceof o$H&&r$K.equals(this._color,e._color)&&r$K.equals(this._spotSize,e._spotSize)&&r$K.equals(this._constantSpeed,e._constantSpeed)&&r$K.equals(this._trailLength,e._trailLength)&&r$K.equals(this._period,e._period)&&r$K.equals(this._spotIntensity,e._spotIntensity)};var ne$j=new e$1d(0),O$o={},W$p=new e$1S,oe$f=new t$z(e$1S.WHITE),ae$f=new e$1d(!0),se$d=new e$1d(q$L.DISABLED),le$g=new e$1d(new r$10),de$e=new e$1d(L$V.BOTH);function pe$g(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.hMax=void 0,this.followSurface=void 0,this.arcType=void 0,this.granularity=void 0}function he$d(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function u$o(e,t){if(!e$28(e))throw new t$Z("entity is required");if(!e$28(t))throw new t$Z("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(u$o.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new o$1o,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new pe$g,this._groundGeometryOptions=new he$d,this._id="polyline-"+e.id,this._clampToGround=!1,this._supportsPolylinesOnTerrain=h$F.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(u$o.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!e$28(this._entity.availability)&&r$K.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}}),u$o.prototype.isOutlineVisible=function(e){return!1},u$o.prototype.isFilled=function(e){var t=this._entity;return u$Y(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e),!1)},u$o.prototype.createFillGeometryInstance=function(e){if(!e$28(e))throw new t$Z("time is required.");if(!this._fillEnabled)throw new t$Z("This instance does not represent a filled geometry.");var t,i=this._entity,r=i.isAvailable(e),n=new e$1h(r&&i.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),a={show:n,distanceDisplayCondition:t$H.fromDistanceDisplayCondition(o)};return this._materialProperty instanceof t$z&&(e$28(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,W$p)),e$28(t)||(t=e$1S.WHITE),a.color=o$18.fromColor(t)),this.clampToGround||this.entity.clampToS3M?new d$15({id:i,geometry:new aa$1(this._groundGeometryOptions),attributes:a}):(this._materialProperty instanceof o$H?(this._geometryOptions.dist=1,e$28(this._materialProperty.constantSpeed)&&this._materialProperty.constantSpeed>0?this._geometryOptions.period=-1:this._geometryOptions.period=e$28(this._materialProperty.period)?this._materialProperty.period:1e3):(this._geometryOptions.dist=0,this._geometryOptions.period=-1),e$28(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof t$z&&(e$28(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||r)&&(t=this._depthFailMaterialProperty.color.getValue(e,W$p)),e$28(t)||(t=e$1S.WHITE),a.depthFailColor=o$18.fromColor(t)),new d$15({id:i,geometry:new R$J(this._geometryOptions),attributes:a}))},u$o.prototype.createOutlineGeometryInstance=function(e){throw new t$Z("This instance does not represent an outlined geometry.")},u$o.prototype.isDestroyed=function(){return!1},u$o.prototype.destroy=function(){this._entitySubscription(),i$Z(this)},u$o.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"polyline"===t){var n=this._entity.polyline;if(!e$28(n))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var o=n.positions,a=n.show;if(e$28(a)&&a.isConstant&&!a.getValue(o$11.MINIMUM_VALUE)||!e$28(o))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=n.zIndex,l=u$Y(n.material,oe$f),u=l instanceof t$z;this._materialProperty=l,this._depthFailMaterialProperty=n.depthFailMaterial,this._showProperty=u$Y(a,ae$f),this._shadowsProperty=u$Y(n.shadows,se$d),this._distanceDisplayConditionProperty=u$Y(n.distanceDisplayCondition,le$g),this._classificationTypeProperty=u$Y(n.classificationType,de$e),this._fillEnabled=!0,this._zIndex=u$Y(s,ne$j);var c=n.width,h=n.hMax,d=n.followSurface,f=n.arcType,p=n.clampToGround,_=n.granularity;if(o.isConstant&&r$K.isConstant(c)&&r$K.isConstant(d)&&r$K.isConstant(f)&&r$K.isConstant(_)&&r$K.isConstant(p)&&r$K.isConstant(s)){var m,$=this._geometryOptions,g=o.getValue(o$11.MINIMUM_VALUE,$.positions);if(!e$28(g)||g.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));m=u&&(!e$28(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof t$z)?e$17.VERTEX_FORMAT:r$I.VERTEX_FORMAT,$.vertexFormat=m,$.positions=g,$.width=e$28(c)?c.getValue(o$11.MINIMUM_VALUE):void 0,$.hMax=e$28(h)?h.getValue(o$11.MINIMUM_VALUE):void 0,$.followSurface=e$28(d)?d.getValue(o$11.MINIMUM_VALUE):void 0,$.arcType=e$28(f)?f.getValue(o$11.MINIMUM_VALUE):void 0,$.granularity=e$28(_)?_.getValue(o$11.MINIMUM_VALUE):void 0;var v=this._groundGeometryOptions;v.positions=g,v.width=$.width,v.arcType=$.arcType,v.granularity=$.granularity,this._clampToGround=!!e$28(p)&&p.getValue(o$11.MINIMUM_VALUE),!this._clampToGround&&e$28(s)&&e$1$("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},u$o.prototype.createDynamicUpdater=function(e,t){if(o$1u.defined("primitives",e),o$1u.defined("groundPrimitives",t),!this._dynamic)throw new t$Z("This instance does not represent dynamic geometry.");return new I$H(e,t,this)};var w$j={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function I$H(e,t,i){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=i,this._positions=[]}function q$q(e){if(e$28(e._line))return e._line;var t=e._geometryUpdater._scene.id,i=O$o[t],r=e._primitives;!e$28(i)||i.isDestroyed()?(i=new X$v,O$o[t]=i,r.add(i)):r.contains(i)||r.add(i);var n=i.add();return n.id=e._geometryUpdater._entity,e._line=n,n}I$H.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,n=r.positions,o=r$K.getValueOrUndefined(n,e,this._positions);t._clampToGround=r$K.getValueOrDefault(r._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=r$K.getValueOrDefault(r._width,e,1),t._groundGeometryOptions.arcType=r$K.getValueOrDefault(r._arcType,e,m$_.GEODESIC),t._groundGeometryOptions.granularity=r$K.getValueOrDefault(r._granularity,e,9999);var a=this._groundPrimitives;if(e$28(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!i.isShowing||!i.isAvailable(e)||!r$K.getValueOrDefault(r._show,e,!0)||!e$28(o)||o.length<2)return;var s,l=t.fillMaterialProperty;if(l instanceof t$z)s=new e$17;else{var u=r$H.getValue(e,l,this._material);s=new r$I({material:u,translucent:u.isTranslucent()}),this._material=u}return this._groundPolylinePrimitive=a.add(new g$D({geometryInstances:t.createFillGeometryInstance(e),appearance:s,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),r$K.getValueOrUndefined(t.zIndex,e)),void(e$28(this._line)&&(this._line.show=!1))}var c=q$q(this);if(i.isShowing&&i.isAvailable(e)&&r$K.getValueOrDefault(r._show,e,!0))if(!e$28(o)||o.length<2)c.show=!1;else{var h=r$K.getValueOrUndefined(r._followSurface,e),d=m$_.GEODESIC;e$28(h)&&(d=h?m$_.GEODESIC:m$_.NONE),d=r$K.getValueOrDefault(r._arcType,e,d);var f=t._scene.globe;d!==m$_.NONE&&e$28(f)&&(w$j.ellipsoid=f.ellipsoid,w$j.positions=o,w$j.granularity=r$K.getValueOrUndefined(r._granularity,e),w$j.height=m$U.extractHeights(o,f.ellipsoid),w$j.hMax=r$K.getValueOrUndefined(r._hMax,e),o=m$U.generateCartesianArc(w$j)),c.show=!0,c.positions=o.slice(),c.material=r$H.getValue(e,t.fillMaterialProperty,c.material),c.width=r$K.getValueOrDefault(r._width,e,1),c.distanceDisplayCondition=r$K.getValueOrUndefined(r._distanceDisplayCondition,e,c.distanceDisplayCondition)}else c.show=!1},I$H.prototype.getBoundingSphere=function(e){if(o$1u.defined("result",e),this._geometryUpdater.clampToGround){var t=this._groundPolylinePrimitive;if(e$28(t)&&t.show&&t.ready){var i=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(e$28(i)&&e$28(i.boundingSphere))return i$19.clone(i.boundingSphere,e),A$U.DONE}return e$28(t)&&!t.ready?A$U.PENDING:A$U.DONE}var r=q$q(this);return r.show&&r.positions.length>0?(i$19.fromPoints(r.positions,e),A$U.DONE):A$U.FAILED},I$H.prototype.isDestroyed=function(){return!1},I$H.prototype.destroy=function(){var e=this._geometryUpdater._scene.id,t=O$o[e];e$28(t)&&(t.remove(this._line),0===t.length&&(this._primitives.removeAndDestroy(t),delete O$o[e])),e$28(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),i$Z(this)};var b$z=new e$1S,L$t=new r$10,O$n=new r$10;function v$t(e,t,i,r,n){var o;o=i instanceof t$z?e$17:r$I,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=i,this.updaters=new e$1P,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e$1P,this.material=void 0,this.updatersWithAttributes=new e$1P,this.attributes=new e$1P,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(v$t.prototype.onMaterialChanged,this),this.subscriptions=new e$1P,this.showsUpdated=new e$1P,this.zIndex=r,this._asynchronous=n}function m$t(e,t,i){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=u$Y(i,!0)}v$t.prototype.onMaterialChanged=function(){this.invalidated=!0},v$t.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof t$z&&t instanceof t$z||e$28(t)&&t.equals(i)},v$t.prototype.add=function(e,t,i){var r=t.id;if(this.updaters.set(r,t),this.geometry.set(r,i),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&r$K.isConstant(t.distanceDisplayConditionProperty)){var n=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener((function(e,i,r,o){"isShowing"===i&&n.showsUpdated.set(t.id,t)})))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},v$t.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return e$28(i)&&(i(),this.subscriptions.remove(t)),!0}return!1},v$t.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.orderedGroundPrimitives,o=this.geometry.values;if(this.createPrimitive){if(o.length>0)e$28(r)&&(e$28(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),r=new g$D({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===r$I&&(this.material=r$H.getValue(e,this.materialProperty,this.material),r.appearance.material=this.material),n.add(r,this.zIndex),i=!1;else{e$28(r)&&(n.remove(r),r=void 0);var a=this.oldPrimitive;e$28(a)&&(n.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(e$28(r)&&r.ready){r.show=!0,e$28(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===r$I&&(this.material=r$H.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);var s=this.updatersWithAttributes.values,l=s.length;for(t=0;t<l;t++){var u=s[t],c=u.entity,h=this.geometry.get(u.id),d=this.attributes.get(h.id.id);if(e$28(d)||(d=r.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,d)),!u.fillMaterialProperty.isConstant){var f=u.fillMaterialProperty.color,p=r$K.getValueOrDefault(f,e,e$1S.WHITE,b$z);e$1S.equals(d._lastColor,p)||(d._lastColor=e$1S.clone(p,d._lastColor),d.color=o$18.toValue(p,d.color))}var _=c.isShowing&&(u.hasConstantFill||u.isFilled(e));_!==(1===d.show[0])&&(d.show=e$1h.toValue(_,d.show));var m=u.distanceDisplayConditionProperty;if(!r$K.isConstant(m)){var $=r$K.getValueOrDefault(m,e,O$n,L$t);r$10.equals($,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=r$10.clone($,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=t$H.toValue($,d.distanceDisplayCondition))}}this.updateShows(r)}else e$28(r)&&!r.ready&&(i=!1);return i},v$t.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],o=n.entity,a=this.geometry.get(n.id),s=this.attributes.get(a.id.id);e$28(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));var l=o.isShowing;l!==(1===s.show[0])&&(s.show=e$1h.toValue(l,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},v$t.prototype.contains=function(e){return this.updaters.contains(e.id)},v$t.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return A$U.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!e$28(r)||!e$28(r.boundingSphere)||e$28(r.show)&&0===r.show[0]?A$U.FAILED:(r.boundingSphere.clone(t),A$U.DONE)},v$t.prototype.destroy=function(){var e=this.primitive,t=this.orderedGroundPrimitives;e$28(e)&&t.remove(e);var i=this.oldPrimitive;e$28(i)&&t.remove(i),this.removeMaterialSubscription()},m$t.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),o=r$K.getValueOrDefault(t.zIndex,0),a=0;a<r;++a){var s=i[a];if(s.isMaterial(t)&&s.zIndex===o)return void s.add(e,t,n)}var l=new v$t(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);l.add(e,t,n),i.push(l)},m$t.prototype.remove=function(e){for(var t=this._items,i=t.length-1;i>=0;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},m$t.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;t>=0;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,o=n.length,a=0;a<o;a++)this.add(e,n[a]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},m$t.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return A$U.FAILED},m$t.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var I$G=[];function A$C(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function E$u(e,t,i,r){if(i.isDynamic)e._dynamicBatch.add(t,i);else{if((i.clampToGround||i.entity.clampToS3M)&&i.fillEnabled){var n=i.classificationTypeProperty.getValue(t);return i.entity.clampToS3M&&(n=L$V.S3M_TILE),void e._groundBatches[n].add(t,i)}var o;i.fillEnabled&&(o=i.shadowsProperty.getValue(t));var a,s=0;e$28(i.depthFailMaterialProperty)&&(s=i.depthFailMaterialProperty instanceof t$z?1:2),e$28(o)&&(a=o+s*q$L.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.fillMaterialProperty instanceof t$z?e._colorBatches[a].add(t,i):e._materialBatches[a].add(t,i))}}function l$w(e,t,i,r){o$1u.defined("scene",e),o$1u.defined("entityCollection",t),r=u$Y(r,e.groundPrimitives),i=u$Y(i,e.primitives),this._scene=e,this._primitives=i,this._entityCollection=void 0,this._addedObjects=new e$1P,this._removedObjects=new e$1P,this._changedObjects=new e$1P;var n,o=q$L.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(3*o),this._materialBatches=new Array(3*o),n=0;n<o;++n)this._colorBatches[n]=new y$w(i,e$17,void 0,!1,n),this._materialBatches[n]=new c$r(i,r$I,void 0,!1,n),this._colorBatches[n+o]=new y$w(i,e$17,e$17,!1,n),this._materialBatches[n+o]=new c$r(i,r$I,e$17,!1,n),this._colorBatches[n+2*o]=new y$w(i,e$17,r$I,!1,n),this._materialBatches[n+2*o]=new c$r(i,r$I,r$I,!1,n);this._dynamicBatch=new r$w(i,r);var a=L$V.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),n=0;n<a;++n)this._groundBatches[n]=new m$t(r,n);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new e$1P,this._updaters=new e$1P,this._entityCollection=t,t.collectionChanged.addEventListener(l$w.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,I$G)}l$w.prototype.update=function(e){o$1u.defined("time",e);var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)r=(i=c[t]).id,(n=this._updaters.get(r)).entity===i?(A$C(this,n),E$u(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)r=(i=l[t]).id,A$C(this,n=this._updaters.get(r)),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)r=(i=a[t]).id,n=new u$o(i,this._scene),this._updaters.set(r,n),E$u(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(l$w._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,d=this._batches,f=d.length;for(t=0;t<f;t++)h=d[t].update(e)&&h;return h};var T$l=[],F$t=new i$19;function u$n(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.scene",e.scene),o$1u.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),d$Q.initializeTerrainHeights(),g$D.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new n$R,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(i.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=u$Y(e.visualizersCallback,u$n.defaultVisualizersCallback);var r=!1,n=new o$I,o=new o$I;i.length>0&&(t.primitives.add(n),t.groundPrimitives.add(o),r=!0),this._primitives=n,this._groundPrimitives=o;for(var a=0,s=i.length;a<s;a++)this._onDataSourceAdded(i,i.get(a));var l,u,c=new n$t;if(this._onDataSourceAdded(void 0,c),this._defaultDataSource=c,!r){var h=this,d=function(){t.primitives.add(n),t.groundPrimitives.add(o),l(),u(),h._removeDefaultDataSourceListener=void 0,h._removeDataSourceCollectionListener=void 0};l=c.entities.collectionChanged.addEventListener(d),u=i.dataSourceAdded.addEventListener(d)}this._removeDefaultDataSourceListener=l,this._removeDataSourceCollectionListener=u,this._ready=!1}l$w.prototype.getBoundingSphere=function(e,t){o$1u.defined("entity",e),o$1u.defined("result",t);for(var i=T$l,r=F$t,n=0,o=A$U.DONE,a=this._batches,s=a.length,l=this._updaters.get(e.id),u=0;u<s;u++){if((o=a[u].getBoundingSphere(l,r))===A$U.PENDING)return A$U.PENDING;o===A$U.DONE&&(i[n]=i$19.clone(r,i[n]),n++)}return 0===n?A$U.FAILED:(i.length=n,i$19.fromBoundingSpheres(i,t),A$U.DONE)},l$w.prototype.isDestroyed=function(){return!1},l$w.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(l$w.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();return this._subscriptions.removeAll(),i$Z(this)},l$w._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,n=r.id;!e$28(t.get(n))&&!e$28(i.get(n))&&i.set(n,r)},l$w.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)n=(o=i[r]).id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)n=(o=t[r]).id,s.remove(n)?l.set(n,o):a.set(n,o)},u$n.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new g$F(t,r),new c$p(e,r,i._primitives,i._groundPrimitives),new l$y(t,r),new d$B(e,r),new l$H(e,r),new v$u(t,r),new w$l(e,r),new l$w(e,r,i._primitives,i._groundPrimitives)]},Object.defineProperties(u$n.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),u$n.prototype.isDestroyed=function(){return!1},u$n.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),e$28(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),i$Z(this)},u$n.prototype.update=function(e){if(o$1u.defined("time",e),!e$1_.initialized)return this._ready=!1,!1;var t,i,r,n,o=!0,a=this._dataSourceCollection,s=a.length;for(t=0;t<s;t++){var l=a.get(t);for(e$28(l.update)&&(o=l.update(e)&&o),n=(r=l._visualizers).length,i=0;i<n;i++)o=r[i].update(e)&&o}for(n=(r=this._defaultDataSource._visualizers).length,i=0;i<n;i++)o=r[i].update(e)&&o;return this._ready=o,o},u$n.prototype._postRender=function(){for(var e=this._scene.frameState,t=this._dataSourceCollection,i=t.length,r=0;r<i;r++){var n=t.get(r),o=n.credit;e$28(o)&&e.creditDisplay.addCredit(o);var a=n._resourceCredits;if(e$28(a))for(var s=a.length,l=0;l<s;l++)e.creditDisplay.addCredit(a[l])}};var R$q=[],k$t=new i$19;function h$s(e,t,i,r){if(!e$28(e))throw new t$Z("entity is required.");if(!e$28(r))throw new t$Z("result is required.");var n;return e$28(t)&&t.show&&t.ready&&(e$28(n=t.getGeometryInstanceAttributes(e))&&e$28(n.boundingSphere))||e$28(i)&&i.show&&i.ready&&(e$28(n=i.getGeometryInstanceAttributes(e))&&e$28(n.boundingSphere))?(i$19.clone(n.boundingSphere,r),A$U.DONE):e$28(t)&&!t.ready||e$28(i)&&!i.ready?A$U.PENDING:A$U.FAILED}u$n.prototype.getBoundingSphere=function(e,t,i){if(o$1u.defined("entity",e),o$1u.typeOf.bool("allowPartial",t),o$1u.defined("result",i),!this._ready)return A$U.PENDING;var r,n,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;var a=this._dataSourceCollection;for(n=a.length,r=0;r<n;r++){var s=a.get(r);if(s.entities.contains(e)){o=s;break}}}if(!e$28(o))return A$U.FAILED;var l=R$q,u=k$t,c=0,h=A$U.DONE,d=o._visualizers,f=d.length;for(r=0;r<f;r++){if(e$28(d[r].getBoundingSphere)){if(h=d[r].getBoundingSphere(e,u),!t&&h===A$U.PENDING)return A$U.PENDING;h===A$U.DONE&&(l[c]=i$19.clone(u,l[c]),c++)}}return 0===c?A$U.FAILED:(l.length=c,i$19.fromBoundingSpheres(l,i),A$U.DONE)},u$n.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=this._primitives,n=this._groundPrimitives,o=r.add(new o$I),a=n.add(new r$x);t._primitives=o,t._groundPrimitives=a;var s=t.clustering;s._initialize(i),o.add(s),t._visualizers=this._visualizersCallback(i,s,t)},u$n.prototype._onDataSourceRemoved=function(e,t){var i=this._primitives,r=this._groundPrimitives,n=t._primitives,o=t._groundPrimitives,a=t.clustering;n.remove(a);for(var s=n._primitives,l=0;l<s.length;l++)if(e$28(s[l]._instanceIds))for(var u=s[l]._instanceIds,c=0;c<u.length;c++)e$28(u[c]._polygon)&&e$28(u[c]._polygon.outlines)&&this._scene._primitives.remove(u[c]._polygon.outlines);var h=t._visualizers,d=h.length;for(c=0;c<d;c++)h[c].destroy();i.remove(n),r.remove(o),t._visualizers=void 0},u$n.prototype._onDataSourceMoved=function(e,t,i){var r=this._primitives,n=this._groundPrimitives,o=e._primitives,a=e._groundPrimitives;t===i+1?(r.raise(o),n.raise(a)):t===i-1?(r.lower(o),n.lower(a)):0===t?(r.lowerToBottom(o),n.lowerToBottom(a),r.raise(o),n.raise(a)):(r.raiseToTop(o),n.raiseToTop(a))};var p$p=new e$1S(1,1,1,1);function t$j(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=new e$1S(1,1,1,1),this._colorSubscription=void 0,this.color=e.color}Object.defineProperties(t$j.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color")}),t$j.prototype.getType=function(e){return"EmissionColor"},t$j.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,p$p,t.color),t},t$j.prototype.equals=function(e){return this===e||e instanceof t$j&&r$K.equals(this._color,e._color)};var Z$m=new p$1a,F$s=new p$1a,j$n=new p$1a,s$k=new y$15,P$q=new t$X,J$s=new t$X,q$p=new t$X,x$w=new t$X,W$o=new t$X,K$l=new t$X,_$s=new a$12,B$h=1.25;function ee$i(e,t,i,r,n,o,a){var s=e.scene.mode,l=n.getValue(o,e._lastCartesian);if(e$28(l)){var u,c,h,d,f,p,_=!1,m=!1;if(s===P$$.SCENE3D){a$12.addSeconds(o,.001,_$s);var $=n.getValue(_$s,P$q);if(e$28($)||(a$12.addSeconds(o,-.001,_$s),$=n.getValue(_$s,P$q),m=!0),e$28($)){var g,v=m$1b.computeFixedToIcrfMatrix(o,Z$m),y=m$1b.computeFixedToIcrfMatrix(_$s,F$s);e$28(v)&&e$28(y)?g=p$1a.transpose(v,j$n):(g=m$1b.computeTemeToPseudoFixedMatrix(o,j$n),v=p$1a.transpose(g,Z$m),y=m$1b.computeTemeToPseudoFixedMatrix(_$s,F$s),p$1a.transpose(y,y));var x=p$1a.multiplyByVector(v,l,W$o),b=p$1a.multiplyByVector(y,$,K$l);t$X.subtract(x,b,x$w);var w=1e3*t$X.magnitude(x$w),C=e$27.GRAVITATIONALPARAMETER,T=-C/(w*w-2*C/t$X.magnitude(x));T<0||T>B$h*a.maximumRadius?(u=J$s,t$X.normalize(l,u),t$X.negate(u,u),h=t$X.clone(t$X.UNIT_Z,q$p),c=t$X.cross(h,u,P$q),t$X.magnitude(c)>e$27.EPSILON7&&(t$X.normalize(u,u),t$X.normalize(c,c),h=t$X.cross(u,c,q$p),t$X.normalize(h,h),_=!0)):t$X.equalsEpsilon(l,$,e$27.EPSILON7)||(h=J$s,t$X.normalize(x,h),t$X.normalize(b,b),c=t$X.cross(h,b,q$p),m&&(c=t$X.multiplyByScalar(c,-1,c)),t$X.equalsEpsilon(c,t$X.ZERO,e$27.EPSILON7)||(u=t$X.cross(c,h,P$q),p$1a.multiplyByVector(g,u,u),p$1a.multiplyByVector(g,c,c),p$1a.multiplyByVector(g,h,h),t$X.normalize(u,u),t$X.normalize(c,c),t$X.normalize(h,h),_=!0))}}e$28(e.boundingSphere)&&(l=e.boundingSphere.center),r&&(d=t$X.clone(t.position,x$w),f=t$X.clone(t.direction,W$o),p=t$X.clone(t.up,K$l));var S=s$k;_?(S[0]=u.x,S[1]=u.y,S[2]=u.z,S[3]=0,S[4]=c.x,S[5]=c.y,S[6]=c.z,S[7]=0,S[8]=h.x,S[9]=h.y,S[10]=h.z,S[11]=0,S[12]=l.x,S[13]=l.y,S[14]=l.z,S[15]=0):m$1b.eastNorthUpToFixedFrame(l,a,S),t._setTransform(S),r&&(t$X.clone(d,t.position),t$X.clone(f,t.direction),t$X.clone(p,t.up),t$X.cross(f,p,t.right))}if(i){var E=s===P$$.SCENE2D||t$X.equals(e._offset3D,t$X.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,E)}}function V$m(e,t,i){o$1u.defined("entity",e),o$1u.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=u$Y(i,t$V.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new t$X,this._defaultOffset3D=void 0,this._offset3D=new t$X}Object.defineProperties(V$m,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=t$X.clone(e,new t$X)}}}),V$m.defaultOffset3D=new t$X(-14e3,3500,3500);var C$q=new a$S,re$c=new t$X;V$m.prototype.update=function(e,t){o$1u.defined("time",e);var i=this.scene,r=this.ellipsoid,n=i.mode;if(n!==P$$.MORPHING){var o=this.entity,a=o.position;if(e$28(a)){var s=o!==this._lastEntity,l=n!==this._mode,u=i.camera,c=s||l,h=!0;if(s){var d=o.viewFrom,f=e$28(d);if(!f&&e$28(t)){C$q.pitch=-e$27.PI_OVER_FOUR,C$q.range=0;var p=a.getValue(e,re$c);if(e$28(p)){var _=2-1/Math.max(1,t$X.magnitude(p)/r.maximumRadius);C$q.pitch*=_}u.viewBoundingSphere(t,C$q),this.boundingSphere=t,c=!1,h=!1}else(!f||!e$28(d.getValue(e,this._offset3D)))&&t$X.clone(V$m._defaultOffset3D,this._offset3D)}else!l&&this._mode!==P$$.SCENE2D&&t$X.clone(u.position,this._offset3D);this._lastEntity=o,this._mode=n,ee$i(this,u,c,h,a,e,r)}}};var $$o={};!function(e){var t,i,r="File format is not recognized.",n="Error while reading zip file.",o="Error while reading file data.",a=524288,s="text/plain",l="message";try{t=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch{}function u(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r<i.length;r++)e=e>>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function c(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function h(){}function d(e){var t,i=this;i.size=0,i.init=function(r,n){var o=new Blob([e],{type:s});(t=new p(o)).init((function(){i.size=t.size,r()}),n)},i.readUint8Array=function(e,i,r,n){t.readUint8Array(e,i,r,n)}}function f(e){var t,i=this;i.size=0,i.init=function(r){for(var n=e.length;"="==e.charAt(n-1);)n--;t=e.indexOf(",")+1,i.size=Math.floor(.75*(n-t)),r()},i.readUint8Array=function(i,r,n){var o,a=c(r),s=4*Math.floor(i/3),l=4*Math.ceil((i+r)/3),u=window.atob(e.substring(s+t,l+t)),h=i-3*Math.floor(s/4);for(o=h;o<h+r;o++)a.array[o-h]=u.charCodeAt(o);n(a.array)}}function p(e){var t=this;t.size=0,t.init=function(t){this.size=e.size,t()},t.readUint8Array=function(t,i,r,n){var o=new FileReader;o.onload=function(e){r(new Uint8Array(e.target.result))},o.onerror=n,o.readAsArrayBuffer(function(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}(e,t,i))}}function _(){}function m(e){var i,r=this;r.init=function(e){i=new Blob([],{type:s}),e()},r.writeUint8Array=function(e,r){i=new Blob([i,t?e:e.buffer],{type:s}),r()},r.getData=function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=r,n.readAsText(i,e)}}function $(e){var t=this,i="",r="";t.init=function(t){i+="data:"+(e||"")+";base64,",t()},t.writeUint8Array=function(e,t){var n,o=r.length,a=r;for(r="",n=0;n<3*Math.floor((o+e.length)/3)-o;n++)a+=String.fromCharCode(e[n]);for(;n<e.length;n++)r+=String.fromCharCode(e[n]);a.length>2?i+=window.btoa(a):r=a,t()},t.getData=function(e){e(i+window.btoa(r))}}function g(e){var i,r=this;r.init=function(t){i=new Blob([],{type:e}),t()},r.writeUint8Array=function(r,n){i=new Blob([i,t?r:r.buffer],{type:e}),n()},r.getData=function(e){e(i)}}function v(e,t,i,r,n,o,s,u,c,h){var d,f,p=0;function _(){e.removeEventListener(l,m,!1),u(f)}function m(e){var t=e.data,r=t.data;t.onappend&&(f+=r.length,i.writeUint8Array(r,(function(){o(!1,r),$()}),h)),t.onflush&&(r?(f+=r.length,i.writeUint8Array(r,(function(){o(!1,r),_()}),h)):_()),t.progress&&s&&s(d+t.current,n)}function $(){(d=p*a)<n?t.readUint8Array(r+d,Math.min(a,n-d),(function(t){e.postMessage({append:!0,data:t}),p++,s&&s(d,n),o(!0,t)}),c):e.postMessage({flush:!0})}f=0,e.addEventListener(l,m,!1),$()}function y(e,t,i,r,n,o,s,l,u,c){var h,d=0,f=0;!function p(){var _;(h=d*a)<n?t.readUint8Array(r+h,Math.min(a,n-h),(function(t){var a=e.append(t,(function(){s&&s(r+h,n)}));f+=a.length,o(!0,t),i.writeUint8Array(a,(function(){o(!1,a),d++,setTimeout(p,1)}),c),s&&s(h,n)}),u):(_=e.flush())?(f+=_.length,i.writeUint8Array(_,(function(){o(!1,_),l(f)}),c)):l(f)}()}function x(e,t,i,r,n,o,s,l,c){var h=0,d=new u;!function u(){var f=h*a;f<r?e.readUint8Array(i+f,Math.min(a,r-f),(function(e){n&&d.append(e),s&&s(f,r,e),t.writeUint8Array(e,(function(){h++,u()}),c)}),l):o(r,d.get())}()}function b(e){var t,i,r="",n=["Ç","ü","é","â","ä","à ","Ã¥","ç","ê","ë","è","ï","î","ì","Ä","Ã…","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","Æ’","á","Ã","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Ã�","Â","À","©","¦","¦","+","+","¢","Â¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ã�","Ê","Ë","È","i","Ã�","ÃŽ","Ã�","+","+","_","_","¦","ÃŒ","_","Ó","ß","Ô","Ã’","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ã�","¯","´","Â","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r+=(i=255&e.charCodeAt(t))>127?n[i-128]:String.fromCharCode(i);return r}function w(e){return decodeURIComponent(escape(e))}function C(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function T(e,t,i,r,n){e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=function(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch{}}(e.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("File is using Zip64 (4gb+ file size).")):n("File contains encrypted entry.")}function S(t,i){function a(){}function s(e,r){t.readUint8Array(t.size-e,e,(function(t){var i=c(t.length,t).view;1347093766!=i.getUint32(0)?s(e+1,r):r(i)}),(function(){i(n)}))}return a.prototype.getData=function(n,a,s,l){var h,d=this;function f(e,t){h&&h.terminate(),h=null,e&&e(t)}function p(e,t){l&&!function(e){var t=c(4);return t.view.setUint32(0,e),d.crc32==t.view.getUint32(0)}(t)?_():n.getData((function(e){f(a,e)}))}function _(){f(i,o)}function m(){f(i,"Error while writing file data.")}t.readUint8Array(d.offset,30,(function(o){var a,f=c(o.length,o);1347093252==f.view.getUint32(0)?(T(d,f,4,!1,i),a=d.offset+30+d.filenameLength+d.extraFieldLength,n.init((function(){0===d.compressionMethod?x(t,n,a,d.compressedSize,l,p,s,_,m):h=function(t,i,r,n,o,a,s,l,c){var h,d=new u;function f(e,t){o&&!e&&d.append(t)}function p(e){a(e,d.get())}return e.zip.useWebWorkers?v(h=new Worker(e.zip.workerScriptsPath+"inflate.js"),t,i,r,n,f,s,p,l,c):y(new e.zip.Inflater,t,i,r,n,f,s,p,l,c),h}(t,n,a,d.compressedSize,l,p,s,_,m)}),m)):i(r)}),_)},{getEntries:function(e){t.size<22?i(r):s(22,(function(o){var s,l;s=o.getUint32(16,!0),l=o.getUint16(8,!0),t.readUint8Array(s,t.size-s,(function(t){var n,o,s,u,h=0,d=[],f=c(t.length,t);for(n=0;n<l;n++){if(o=new a,1347092738!=f.view.getUint32(h))return void i(r);T(o,f,h+6,!0,i),o.commentLength=f.view.getUint16(h+32,!0),o.directory=16==(16&f.view.getUint8(h+38)),o.offset=f.view.getUint32(h+42,!0),s=C(f.array.subarray(h+46,h+46+o.filenameLength)),o.filename=2048==(2048&o.bitFlag)?w(s):b(s),!o.directory&&"/"==o.filename.charAt(o.filename.length-1)&&(o.directory=!0),u=C(f.array.subarray(h+46+o.filenameLength+o.extraFieldLength,h+46+o.filenameLength+o.extraFieldLength+o.commentLength)),o.comment=2048==(2048&o.bitFlag)?w(u):b(u),d.push(o),h+=46+o.filenameLength+o.extraFieldLength+o.commentLength}e(d)}),(function(){i(n)}))}))},close:function(e){e&&e()}}}function E(e){return unescape(encodeURIComponent(e))}function A(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function P(t,i,r){var n,a={},s=[],h=0;function d(e,t){n&&n.terminate(),n=null,e&&e(t)}function f(){d(i,"Error while writing zip file.")}function p(){d(i,o)}return{add:function(o,_,m,$,g){var b,w,C;function T(e,i){var r=c(16);h+=e||0,r.view.setUint32(0,1347094280),typeof i<"u"&&(b.view.setUint32(10,i,!0),r.view.setUint32(4,i,!0)),_&&(r.view.setUint32(8,e,!0),b.view.setUint32(14,e,!0),r.view.setUint32(12,_.size,!0),b.view.setUint32(18,_.size,!0)),t.writeUint8Array(r.array,(function(){h+=16,d(m)}),f)}function S(){g=g||{},o=o.trim(),g.directory&&"/"!=o.charAt(o.length-1)&&(o+="/"),a.hasOwnProperty(o)?i("File already exists."):(w=A(E(o)),s.push(o),function(e){var i;C=g.lastModDate||new Date,b=c(26),a[o]={headerArray:b.array,directory:g.directory,filename:w,offset:h,comment:A(E(g.comment||""))},b.view.setUint32(0,335546376),g.version&&b.view.setUint8(0,g.version),!r&&0!==g.level&&!g.directory&&b.view.setUint16(4,2048),b.view.setUint16(6,(C.getHours()<<6|C.getMinutes())<<5|C.getSeconds()/2,!0),b.view.setUint16(8,(C.getFullYear()-1980<<4|C.getMonth()+1)<<5|C.getDate(),!0),b.view.setUint16(22,w.length,!0),(i=c(30+w.length)).view.setUint32(0,1347093252),i.array.set(b.array,4),i.array.set(w,30),h+=i.array.length,t.writeUint8Array(i.array,e,f)}((function(){_?r||0===g.level?x(_,t,0,_.size,!0,T,$,p,f):n=function(t,i,r,n,o,a,s){var c,h=new u;function d(e,t){e&&h.append(t)}function f(e){n(e,h.get())}return e.zip.useWebWorkers?((c=new Worker(e.zip.workerScriptsPath+"deflate.js")).addEventListener(l,(function e(){c.removeEventListener(l,e,!1),v(c,t,i,0,t.size,d,o,f,a,s)}),!1),c.postMessage({init:!0,level:r})):y(new e.zip.Deflater,t,i,0,t.size,d,o,f,a,s),c}(_,t,g.level,T,$,p,f):T()})))}_?_.init(S,p):S()},close:function(e){var i,r,n,o=0,l=0;for(r=0;r<s.length;r++)o+=46+(n=a[s[r]]).filename.length+n.comment.length;for(i=c(o+22),r=0;r<s.length;r++)n=a[s[r]],i.view.setUint32(l,1347092738),i.view.setUint16(l+4,5120),i.array.set(n.headerArray,l+6),i.view.setUint16(l+32,n.comment.length,!0),n.directory&&i.view.setUint8(l+38,16),i.view.setUint32(l+42,n.offset,!0),i.array.set(n.filename,l+46),i.array.set(n.comment,l+46+n.filename.length),l+=46+n.filename.length+n.comment.length;i.view.setUint32(l,1347093766),i.view.setUint16(l+8,s.length,!0),i.view.setUint16(l+10,s.length,!0),i.view.setUint32(l+12,o,!0),i.view.setUint32(l+16,h,!0),t.writeUint8Array(i.array,(function(){d((function(){t.getData(e)}))}),f)}}}u.prototype.table=function(){var e,t,i,r=[];for(e=0;e<256;e++){for(i=e,t=0;t<8;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),d.prototype=new h,d.prototype.constructor=d,f.prototype=new h,f.prototype.constructor=f,p.prototype=new h,p.prototype.constructor=p,_.prototype.getData=function(e){e(this.data)},m.prototype=new _,m.prototype.constructor=m,$.prototype=new _,$.prototype.constructor=$,g.prototype=new _,g.prototype.constructor=g,e.zip={Reader:h,Writer:_,BlobReader:p,Data64URIReader:f,TextReader:d,BlobWriter:g,Data64URIWriter:$,TextWriter:m,createReader:function(e,t,i){e.init((function(){t(S(e,i))}),i)},createWriter:function(e,t,i,r){e.init((function(){t(P(e,i,r))}),i)},useWebWorkers:!0},Object.defineProperties(e.zip,{workerScriptsPath:{get:function(){return typeof i>"u"&&(i=n$17("ThirdParty/Workers/")),i}}})}($$o);var he$c=$$o.zip,ie$e=32,ze$7="http://www.opengis.net/kml/2.2",A$B="http://www.google.com/kml/ext/2.2",Ge$a="http://www.w3.org/2000/xmlns/";function Y$i(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var We$a=/^data:image\/([^,;]+)/;function je$c(e,t){return function(i){e._files[t]=i}}function $$n(e){this._time=e}function ne$i(){this._ids={},this._styles={},this._count=0}function se$c(){this._ids={}}function oe$e(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).entities,i=u$Y(e.kmz,!1);if(!e$28(t))throw new t$Z("entities is required.");var r=oe$e._createState(e),n=t.values.filter((function(e){return!e$28(e.parent)})),o=r.kmlDoc,a=o.documentElement;a.setAttributeNS(Ge$a,"xmlns:gx",A$B);var s=o.createElement("Document");a.appendChild(s),ge$e(r,s,n),r.styleCache.save(s);var l=r.externalFileHandler;return l.promise.then((function(){var e=(new XMLSerializer).serializeToString(r.kmlDoc);return i?qe$7(e,l.files):{kml:e,externalFiles:l.files}}))}function qe$7(e,t){var i=o$1q.defer();return he$c.createWriter(new he$c.BlobWriter,(function(r){Ke$7(r,e).then((function(){var e=Object.keys(t);return me$g(r,e,t,0)})).then((function(){r.close((function(e){i.resolve({kmz:e})}))}))})),i.promise}function Ke$7(e,t){var i=o$1q.defer();return e.add("doc.kml",new he$c.TextReader(t),(function(){i.resolve()})),i.promise}function me$g(e,t,i,r){if(t.length!==r){var n=t[r],o=o$1q.defer();return e.add(n,new he$c.BlobReader(i[n]),(function(){o.resolve()})),o.promise.then((function(){return me$g(e,t,i,r+1)}))}}function ge$e(e,t,i){for(var r,n,o,a=e.kmlDoc,s=e.styleCache,l=e.valueGetter,u=e.idManager,c=i.length,h=0;h<c;++h){var d=i[h];r=[],Xe$5(e,d,n=[],o=[]),Ze$6(e,d.polyline,n,o),we$c(e,d.rectangle,n,o,r),we$c(e,d.polygon,n,o,r),rr$3(e,d,d.model,n,o);var f,p=d.availability;e$28(p)&&(f=a.createElement("TimeSpan"),a$12.equals(p.start,o$11.MINIMUM_VALUE)||f.appendChild(l$v(a,"begin",a$12.toIso8601(p.start))),a$12.equals(p.stop,o$11.MAXIMUM_VALUE)||f.appendChild(l$v(a,"end",a$12.toIso8601(p.stop))));for(var _=0;_<r.length;++_){var m=r[_];m.setAttribute("id",u.get(d.id)),m.appendChild(l$v(a,"name",d.name)),m.appendChild(l$v(a,"visibility",d.show)),m.appendChild(l$v(a,"description",d.description)),e$28(f)&&m.appendChild(f),t.appendChild(m)}var $=n.length;if($>0){var g=a.createElement("Placemark");g.setAttribute("id",u.get(d.id));var v=d.name,y=d.label;if(e$28(y)){var x=a.createElement("LabelStyle"),b=l.get(y.text);v=e$28(b)&&b.length>0?b:v;var w=l.getColor(y.fillColor);e$28(w)&&(x.appendChild(l$v(a,"color",w)),x.appendChild(l$v(a,"colorMode","normal")));var C=l.get(y.scale);e$28(C)&&x.appendChild(l$v(a,"scale",C)),o.push(x)}g.appendChild(l$v(a,"name",v)),g.appendChild(l$v(a,"visibility",d.show)),g.appendChild(l$v(a,"description",d.description)),e$28(f)&&g.appendChild(f),t.appendChild(g);var T=o.length;if(T>0){for(var S=a.createElement("Style"),E=0;E<T;++E)S.appendChild(o[E]);g.appendChild(l$v(a,"styleUrl",s.get(S)))}if(1===n.length)g.appendChild(n[0]);else if(n.length>1){for(var A=a.createElement("MultiGeometry"),P=0;P<$;++P)A.appendChild(n[P]);g.appendChild(A)}}var I=d._children;if(I.length>0){var M=a.createElement("Folder");M.setAttribute("id",u.get(d.id)),M.appendChild(l$v(a,"name",d.name)),M.appendChild(l$v(a,"visibility",d.show)),M.appendChild(l$v(a,"description",d.description)),t.appendChild(M),ge$e(e,M,I)}}}Y$i.prototype.texture=function(e){var t,i=this;if("string"==typeof e||e instanceof t$S){if(!(e=t$S.createIfNeeded(e)).isDataUri)return e.url;var r=e.url.match(We$a);t="texture_"+ ++this._count,e$28(r)&&(t+="."+r[1]);var n=e.fetchBlob().then((function(e){i._files[t]=e}));return this._promises.push(n),t}if(e instanceof HTMLCanvasElement){var o=o$1q.defer();return this._promises.push(o.promise),t="texture_"+ ++this._count+".png",e.toBlob((function(e){i._files[t]=e,o.resolve()})),t}return""},Y$i.prototype.model=function(e,t){var i=this._modelCallback;if(!e$28(i))throw new t$U("Encountered a model entity while exporting to KML, but no model callback was supplied.");var r={},n=i(e,t,r);for(var o in r)if(r.hasOwnProperty(o)){var a=o$1q(r[o]);this._promises.push(a),a.then(je$c(this,o))}return n},Object.defineProperties(Y$i.prototype,{promise:{get:function(){return o$1q.all(this._promises)}},files:{get:function(){return this._files}}}),$$n.prototype.get=function(e,t,i){var r;return e$28(e)&&(r=e$28(e.getValue)?e.getValue(this._time,i):e),u$Y(r,t)},$$n.prototype.getColor=function(e,t){var i=this.get(e,t);if(e$28(i))return H$s(i)},$$n.prototype.getMaterialType=function(e){if(e$28(e))return e.getType(this._time)},ne$i.prototype.get=function(e){var t=this._ids,i=e.innerHTML;if(e$28(t[i]))return t[i];var r="style-"+ ++this._count;return e.setAttribute("id",r),r="#"+r,t[i]=r,this._styles[i]=e,r},ne$i.prototype.save=function(e){var t=this._styles,i=e.childNodes[0];for(var r in t)t.hasOwnProperty(r)&&e.insertBefore(t[r],i)},se$c.prototype.get=function(e){if(!e$28(e))return this.get(e$1K());var t=this._ids;return e$28(t[e])?e.toString()+"-"+ ++t[e]:(t[e]=0,e)},oe$e._createState=function(e){var t=e.entities,i=new ne$i,r=t.computeAvailability(),n=e$28(e.time)?e.time:r.start,o=u$Y(e.defaultAvailability,r),a=u$Y(e.sampleDuration,60);o.start===o$11.MINIMUM_VALUE?o.stop===o$11.MAXIMUM_VALUE?o=new d$_:a$12.addSeconds(o.stop,-10*a,o.start):o.stop===o$11.MAXIMUM_VALUE&&a$12.addSeconds(o.start,10*a,o.stop);var s=new Y$i(e.modelCallback);return{kmlDoc:document.implementation.createDocument(ze$7,"kml"),ellipsoid:u$Y(e.ellipsoid,t$V.WGS84),idManager:new se$c,styleCache:i,externalFileHandler:s,time:n,valueGetter:new $$n(n),sampleDuration:a,defaultAvailability:new c$L([o])}};var T$k=new t$X,_$r=new t$W,R$p=new a$12;function Xe$5(e,t,i,r){var n=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter,s=u$Y(t.billboard,t.point);if(e$28(s)||e$28(t.path)){var l=t.position;if(!l.isConstant)return void Ce$b(e,t,s,i,r);a.get(l,void 0,T$k);var u=l$v(n,"coordinates",F$r(T$k,o)),c=n.createElement("Point"),h=n.createElement("altitudeMode");h.appendChild(B$g(e,s.heightReference)),c.appendChild(h),c.appendChild(u),i.push(c);var d=s instanceof n$I?De$g(e,s):Ee$b(e,s);r.push(d)}}function Ce$b(e,t,i,r,n){var o,a=e.kmlDoc,s=e.ellipsoid,l=e.valueGetter,u=t.position,c=!0;u instanceof t$q?(o=u.intervals,c=!1):o=u$Y(t.availability,e.defaultAvailability);var h,d,f,p=i instanceof t$x,_=[];for(h=0;h<o.length;++h){var m=o.get(h),$=c?u:m.data,g=a.createElement("altitudeMode");$ instanceof i$r?($=$._value,g.appendChild(B$g(e,k$_.CLAMP_TO_GROUND))):e$28(i)?g.appendChild(B$g(e,i.heightReference)):g.appendChild(B$g(e,k$_.NONE));var v=[],y=[];if($.isConstant){l.get($,void 0,T$k);var x=l$v(a,"coordinates",F$r(T$k,s));v.push(a$12.toIso8601(m.start)),y.push(x),v.push(a$12.toIso8601(m.stop)),y.push(x)}else if($ instanceof o$J)for(f=$._property._times,d=0;d<f.length;++d)v.push(a$12.toIso8601(f[d])),$.getValueInReferenceFrame(f[d],Re$j.FIXED,T$k),y.push(F$r(T$k,s));else if($ instanceof g$q){f=$._times;var b=$._values;for(d=0;d<f.length;++d)v.push(a$12.toIso8601(f[d])),t$X.fromArray(b,3*d,T$k),y.push(F$r(T$k,s))}else{var w=e.sampleDuration;m.start.clone(R$p),m.isStartIncluded||a$12.addSeconds(R$p,w,R$p);for(var C=m.stop;a$12.lessThan(R$p,C);)$.getValue(R$p,T$k),v.push(a$12.toIso8601(R$p)),y.push(F$r(T$k,s)),a$12.addSeconds(R$p,w,R$p);m.isStopIncluded&&a$12.equals(R$p,C)&&($.getValue(R$p,T$k),v.push(a$12.toIso8601(R$p)),y.push(F$r(T$k,s)))}var T=a.createElementNS(A$B,"Track");T.appendChild(g);for(var S=0;S<v.length;++S){var E=l$v(a,"when",v[S]),A=l$v(a,"coord",y[S],A$B);T.appendChild(E),T.appendChild(A)}p&&T.appendChild(_e$a(e,i)),_.push(T)}if(1===_.length)r.push(_[0]);else if(_.length>1){var P=a.createElementNS(A$B,"MultiTrack");for(h=0;h<_.length;++h)P.appendChild(_[h]);r.push(P)}if(e$28(i)&&!p){var I=i instanceof n$I?De$g(e,i):Ee$b(e,i);n.push(I)}var M=t.path;if(e$28(M)){var O=l.get(M.width),D=M.material;if(e$28(D)||e$28(O)){var R=a.createElement("LineStyle");e$28(O)&&R.appendChild(l$v(a,"width",O)),de$d(e,D,R),n.push(R)}}}function Ee$b(e,t){var i=e.kmlDoc,r=e.valueGetter,n=i.createElement("IconStyle"),o=r.getColor(t.color);e$28(o)&&(n.appendChild(l$v(i,"color",o)),n.appendChild(l$v(i,"colorMode","normal")));var a=r.get(t.pixelSize);return e$28(a)&&n.appendChild(l$v(i,"scale",a/ie$e)),n}function De$g(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,o=i.createElement("IconStyle"),a=r.get(t.image);if(e$28(a)){a=n.texture(a);var s=i.createElement("Icon");s.appendChild(l$v(i,"href",a));var l=r.get(t.imageSubRegion);e$28(l)&&(s.appendChild(l$v(i,"x",l.x,A$B)),s.appendChild(l$v(i,"y",l.y,A$B)),s.appendChild(l$v(i,"w",l.width,A$B)),s.appendChild(l$v(i,"h",l.height,A$B))),o.appendChild(s)}var u=r.getColor(t.color);e$28(u)&&(o.appendChild(l$v(i,"color",u)),o.appendChild(l$v(i,"colorMode","normal")));var c=r.get(t.scale);e$28(c)&&o.appendChild(l$v(i,"scale",c));var h=r.get(t.pixelOffset);if(e$28(h)){c=u$Y(c,1),o$1k.divideByScalar(h,c,h);var d=r.get(t.width,ie$e),f=r.get(t.height,ie$e),p=r.get(t.horizontalOrigin,j$13.CENTER);p===j$13.CENTER?h.x-=.5*d:p===j$13.RIGHT&&(h.x-=d);var _=r.get(t.verticalOrigin,S$L.CENTER);_===S$L.TOP?h.y+=f:_===S$L.CENTER&&(h.y+=.5*f);var m=i.createElement("hotSpot");m.setAttribute("x",-h.x),m.setAttribute("y",h.y),m.setAttribute("xunits","pixels"),m.setAttribute("yunits","pixels"),o.appendChild(m)}var $=r.get(t.rotation),g=r.get(t.alignedAxis);return e$28($)&&t$X.equals(t$X.UNIT_Z,g)&&(0===($=e$27.toDegrees(-$))&&($=360),o.appendChild(l$v(i,"heading",$))),o}function Ze$6(e,t,i,r){var n=e.kmlDoc,o=e.ellipsoid,a=e.valueGetter;if(e$28(t)){var s,l=n.createElement("LineString"),u=n.createElement("altitudeMode"),c=a.get(t.clampToGround,!1);c?(l.appendChild(l$v(n,"tessellate",!0)),s=n.createTextNode("clampToGround")):s=n.createTextNode("absolute"),u.appendChild(s),l.appendChild(u);var h=t.positions,d=l$v(n,"coordinates",F$r(a.get(h),o));l.appendChild(d);var f=a.get(t.zIndex);c&&e$28(f)&&l.appendChild(l$v(n,"drawOrder",f,A$B)),i.push(l);var p=n.createElement("LineStyle"),_=a.get(t.width);e$28(_)&&p.appendChild(l$v(n,"width",_)),de$d(e,t.material,p),r.push(p)}}function Je$6(e,t,i){var r,n=e.kmlDoc,o=e.valueGetter,a=o.get(t.height,0);i>0&&(a=i);for(var s=t.coordinates,l=o.get(s),u=[],c=[h$10.northeast,h$10.southeast,h$10.southwest,h$10.northwest],h=0;h<4;++h)c[h](l,_$r),u.push(e$27.toDegrees(_$r.longitude)+","+e$27.toDegrees(_$r.latitude)+","+a);r=l$v(n,"coordinates",u.join(" "));var d=n.createElement("outerBoundaryIs"),f=n.createElement("LinearRing");return f.appendChild(r),d.appendChild(f),[d]}function Me$c(e,t,i,r){for(var n=e.kmlDoc,o=e.ellipsoid,a=[],s=t.length,l=0;l<s;++l)t$W.fromCartesian(t[l],o,_$r),a.push(e$27.toDegrees(_$r.longitude)+","+e$27.toDegrees(_$r.latitude)+","+(r?_$r.height:i));var u=l$v(n,"coordinates",a.join(" ")),c=n.createElement("LinearRing");return c.appendChild(u),c}function Qe$8(e,t,i){var r=e.kmlDoc,n=e.valueGetter,o=n.get(t.height,0),a=n.get(t.perPositionHeight,!1);!a&&i>0&&(o=i);var s=[],l=t.hierarchy,u=n.get(l),c=Array.isArray(u)?u:u.positions,h=r.createElement("outerBoundaryIs");h.appendChild(Me$c(e,c,o,a)),s.push(h);var d=u.holes;if(e$28(d))for(var f=d.length,p=0;p<f;++p){var _=r.createElement("innerBoundaryIs");_.appendChild(Me$c(e,d[p].positions,o,a)),s.push(_)}return s}function we$c(e,t,i,r,n){var o=e.kmlDoc,a=e.valueGetter;if(e$28(t)){var s=t instanceof n$y;if(s&&"Image"===a.getMaterialType(t.material))return void Ve$d(e,t,n);var l=o.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&l.appendChild(l$v(o,"extrude",!0));for(var c=s?Je$6(e,t,u):Qe$8(e,t,u),h=c.length,d=0;d<h;++d)l.appendChild(c[d]);var f=o.createElement("altitudeMode");f.appendChild(B$g(e,t.heightReference)),l.appendChild(f),i.push(l);var p=o.createElement("PolyStyle"),_=a.get(t.fill,!1);_&&p.appendChild(l$v(o,"fill",_)),de$d(e,t.material,p);var m=a.get(t.outline,!1);if(m){p.appendChild(l$v(o,"outline",m));var $=o.createElement("LineStyle"),g=a.get(t.outlineWidth,1);$.appendChild(l$v(o,"width",g));var v=a.getColor(t.outlineColor,e$1S.BLACK);$.appendChild(l$v(o,"color",v)),$.appendChild(l$v(o,"colorMode","normal")),r.push($)}r.push(p)}}function Ve$d(e,t,i){var r=e.kmlDoc,n=e.valueGetter,o=e.externalFileHandler,a=r.createElement("GroundOverlay"),s=r.createElement("altitudeMode");s.appendChild(B$g(e,t.heightReference)),a.appendChild(s);var l=n.get(t.height);e$28(l)&&a.appendChild(l$v(r,"altitude",l));var u=n.get(t.coordinates),c=r.createElement("LatLonBox");c.appendChild(l$v(r,"north",e$27.toDegrees(u.north))),c.appendChild(l$v(r,"south",e$27.toDegrees(u.south))),c.appendChild(l$v(r,"east",e$27.toDegrees(u.east))),c.appendChild(l$v(r,"west",e$27.toDegrees(u.west))),a.appendChild(c);var h=n.get(t.material),d=o.texture(h.image),f=r.createElement("Icon");f.appendChild(l$v(r,"href",d)),a.appendChild(f),e$28(h.color)&&a.appendChild(l$v(r,"color",H$s(h.color))),i.push(a)}var Ye$7=new t$X;function _e$a(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,o=i.createElement("Model"),a=r.get(t.scale);if(e$28(a)){a instanceof t$X||(a=t$X.fromElements(a,a,a,Ye$7));var s=i.createElement("Scale");s.appendChild(l$v(i,"x",a.x)),s.appendChild(l$v(i,"y",a.y)),s.appendChild(l$v(i,"z",a.z)),o.appendChild(s)}var l=i.createElement("Link"),u=n.model(t,e.time);return l.appendChild(l$v(i,"href",u)),o.appendChild(l),o}var xe$f=new p$1a,$e$5=new y$15,le$f=new y$15;function er$4(e,t){var i=m$1b.eastNorthUpToFixedFrame(e,void 0,le$f),r=p$1a.fromQuaternion(t,xe$f),n=y$15.fromRotationTranslation(r,t$X.ZERO,$e$5),o=y$15.inverse(i,le$f),a=y$15.multiply(o,n,le$f),s=y$15.getMatrix3(a,xe$f);return i$10.fromQuaternion(n$14.fromRotationMatrix(s))}function rr$3(e,t,i,r,n){var o=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(e$28(i)){var l=t.position;if(!l.isConstant)return void Ce$b(e,t,i,r,n);var u=_e$a(e,i),c=o.createElement("altitudeMode");c.appendChild(B$g(e,i.heightReference)),u.appendChild(c),s.get(l,void 0,T$k),t$W.fromCartesian(T$k,a,_$r);var h=o.createElement("Location");h.appendChild(l$v(o,"longitude",e$27.toDegrees(_$r.longitude))),h.appendChild(l$v(o,"latitude",e$27.toDegrees(_$r.latitude))),h.appendChild(l$v(o,"altitude",_$r.height)),u.appendChild(h);var d=n$14.IDENTITY;e$28(t.orientation)&&(d=t.orientation.getValue(e.time));var f=er$4(t.position.getValue(e.time),d),p=o.createElement("Orientation");p.appendChild(l$v(o,"heading",e$27.toDegrees(f.heading))),p.appendChild(l$v(o,"tilt",e$27.toDegrees(f.pitch))),p.appendChild(l$v(o,"roll",e$27.toDegrees(f.roll))),u.appendChild(p),r.push(u)}}function de$d(e,t,i){var r=e.kmlDoc,n=e.valueGetter;if(e$28(t)){var o=n.get(t);if(e$28(o)){var a;switch(n.getMaterialType(t)){case"Image":a=H$s(e$1S.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=H$s(o.color);break;case"PolylineOutline":a=H$s(o.color);var s=H$s(o.outlineColor),l=o.outlineWidth;i.appendChild(l$v(r,"outerColor",s,A$B)),i.appendChild(l$v(r,"outerWidth",l,A$B));break;case"Stripe":a=H$s(o.oddColor)}e$28(a)&&(i.appendChild(l$v(r,"color",a)),i.appendChild(l$v(r,"colorMode","normal")))}}}function B$g(e,t){var i,r=e.kmlDoc;switch(e.valueGetter.get(t,k$_.NONE)){case k$_.NONE:i=r.createTextNode("absolute");break;case k$_.CLAMP_TO_GROUND:i=r.createTextNode("clampToGround");break;case k$_.RELATIVE_TO_GROUND:i=r.createTextNode("relativeToGround")}return i}function F$r(e,t){Array.isArray(e)||(e=[e]);for(var i=e.length,r=[],n=0;n<i;++n)t$W.fromCartesian(e[n],t,_$r),r.push(e$27.toDegrees(_$r.longitude)+","+e$27.toDegrees(_$r.latitude)+","+_$r.height);return r.join(" ")}function l$v(e,t,i,r){"boolean"==typeof(i=u$Y(i,""))&&(i=i?"1":"0");var n=e$28(r)?e.createElementNS(r,t):e.createElement(t),o="string"===i&&-1!==i.indexOf("<")?e.createCDATASection(i):e.createTextNode(i);return n.appendChild(o),n}function H$s(e){for(var t="",i=e.toBytes(),r=3;r>=0;--r)t+=i[r]<16?"0"+i[r].toString(16):i[r].toString(16);return t}var ce$f={};!function(e,t){!function(e){var t=function(e){return e},i=function(e){if(null==e)return t;var i,r,n=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(i=r=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(i+=e[0])*n+a,c[1]=(r+=e[1])*o+s;l<u;)c[l]=e[l],++l;return c}},r=function(e){var t,r=i(e.transform),n=1/0,o=n,a=-n,s=-n;function l(e){(e=r(e))[0]<n&&(n=e[0]),e[0]>a&&(a=e[0]),e[1]<o&&(o=e[1]),e[1]>s&&(s=e[1])}function u(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,i=-1,l=e.length;++i<l;)(t=r(e[i],i))[0]<n&&(n=t[0]),t[0]>a&&(a=t[0]),t[1]<o&&(o=t[1]),t[1]>s&&(s=t[1])})),e.objects)u(e.objects[t]);return[n,o,a,s]},n=function(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i},o=function(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return a(e,t)}))}:a(e,t)};function a(e,t){var i=t.id,r=t.bbox,n=null==t.properties?{}:t.properties,o=s(e,t);return null==i&&null==r?{type:"Feature",properties:n,geometry:o}:null==r?{type:"Feature",id:i,properties:n,geometry:o}:{type:"Feature",id:i,bbox:r,properties:n,geometry:o}}function s(e,t){var r=i(e.transform),o=e.arcs;function a(e,t){t.length&&t.pop();for(var i=o[e<0?~e:e],a=0,s=i.length;a<s;++a)t.push(r(i[a],a));e<0&&n(t,s)}function s(e){return r(e)}function l(e){for(var t=[],i=0,r=e.length;i<r;++i)a(e[i],t);return t.length<2&&t.push(t[0]),t}function u(e){for(var t=l(e);t.length<4;)t.push(t[0]);return t}function c(e){return e.map(u)}function h(e){var t,i=e.type;switch(i){case"GeometryCollection":return{type:i,geometries:e.geometries.map(h)};case"Point":t=s(e.coordinates);break;case"MultiPoint":t=e.coordinates.map(s);break;case"LineString":t=l(e.arcs);break;case"MultiLineString":t=e.arcs.map(l);break;case"Polygon":t=c(e.arcs);break;case"MultiPolygon":t=e.arcs.map(c);break;default:return null}return{type:i,coordinates:t}}return h(t)}var l=function(e,t){var i={},r={},n={},o=[],a=-1;function s(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach((function(e){i[0]+=e[0],i[1]+=e[1]}))):i=r[r.length-1],t<0?[i,n]:[n,i]}function l(e,t){for(var r in e){var n=e[r];delete t[n.start],delete n.start,delete n.end,n.forEach((function(e){i[e<0?~e:e]=1})),o.push(n)}}return t.forEach((function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++a],t[a]=i,t[r]=n)})),t.forEach((function(e){var t,i,o=s(e),a=o[0],l=o[1];if(t=n[a])if(delete n[t.end],t.push(e),t.end=l,i=r[l]){delete r[i.start];var u=i===t?t:t.concat(i);r[u.start=t.start]=n[u.end=i.end]=u}else r[t.start]=n[t.end]=t;else if(t=r[l])if(delete r[t.start],t.unshift(e),t.start=a,i=n[a]){delete n[i.end];var c=i===t?t:i.concat(t);r[c.start=i.start]=n[c.end=t.end]=c}else r[t.start]=n[t.end]=t;else r[(t=[e]).start=a]=n[t.end=l]=t})),l(n,r),l(r,n),t.forEach((function(e){i[e<0?~e:e]||o.push([e])})),o},u=function(e){return s(e,c.apply(this,arguments))};function c(e,t,i){var r,n,o;if(arguments.length>1)r=h(e,t,i);else for(n=0,r=new Array(o=e.arcs.length);n<o;++n)r[n]=n;return{type:"MultiLineString",arcs:l(e,r)}}function h(e,t,i){var r,n=[],o=[];function a(e){var t=e<0?~e:e;(o[t]||(o[t]=[])).push({i:e,g:r})}function s(e){e.forEach(a)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}function c(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":u(e.arcs)}}return c(t),o.forEach(null==i?function(e){n.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&n.push(e[0].i)}),n}function d(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return Math.abs(o)}var f=function(e){return s(e,p.apply(this,arguments))};function p(e,t){var i={},r=[],n=[];function o(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(o);break;case"Polygon":a(e.arcs);break;case"MultiPolygon":e.arcs.forEach(a)}}function a(e){e.forEach((function(t){t.forEach((function(t){(i[t=t<0?~t:t]||(i[t]=[])).push(e)}))})),r.push(e)}function u(t){return d(s(e,{type:"Polygon",arcs:[t]}).coordinates[0])}return t.forEach(o),r.forEach((function(e){if(!e._){var t=[],r=[e];for(e._=1,n.push(t);e=r.pop();)t.push(e),e.forEach((function(e){e.forEach((function(e){i[e<0?~e:e].forEach((function(e){e._||(e._=1,r.push(e))}))}))}))}})),r.forEach((function(e){delete e._})),{type:"MultiPolygon",arcs:n.map((function(t){var r,n=[];if(t.forEach((function(e){e.forEach((function(e){e.forEach((function(e){i[e<0?~e:e].length<2&&n.push(e)}))}))})),(r=(n=l(e,n)).length)>1)for(var o,a,s=1,c=u(n[0]);s<r;++s)(o=u(n[s]))>c&&(a=n[0],n[0]=n[s],n[s]=a,c=o);return n}))}}var _=function(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=n+1:r=n}return i},m=function(e){var t={},i=e.map((function(){return[]}));function r(e,i){e.forEach((function(e){e<0&&(e=~e);var r=t[e];r?r.push(i):t[e]=[i]}))}function n(e,t){e.forEach((function(e){r(e,t)}))}function o(e,t){"GeometryCollection"===e.type?e.geometries.forEach((function(e){o(e,t)})):e.type in a&&a[e.type](e.arcs,t)}var a={LineString:r,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach((function(e){n(e,t)}))}};for(var s in e.forEach(o),t)for(var l=t[s],u=l.length,c=0;c<u;++c)for(var h=c+1;h<u;++h){var d,f=l[c],p=l[h];(d=i[f])[s=_(d,p)]!==p&&d.splice(s,0,p),(d=i[p])[s=_(d,f)]!==f&&d.splice(s,0,f)}return i},$=function(e){if(null==e)return t;var i,r,n=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(i=r=0);var l=2,u=e.length,c=new Array(u),h=Math.round((e[0]-a)/n),d=Math.round((e[1]-s)/o);for(c[0]=h-i,i=h,c[1]=d-r,r=d;l<u;)c[l]=e[l],++l;return c}},g=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)l=e.bbox;else{if(!((i=Math.floor(t))>=2))throw new Error("n must be â‰?2");var i,n=(l=e.bbox||r(e))[0],o=l[1],a=l[2],s=l[3];t={scale:[a-n?(a-n)/(i-1):1,s-o?(s-o)/(i-1):1],translate:[n,o]}}var l,u,c=$(t),h=e.objects,d={};function f(e){return c(e)}function p(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(p)};break;case"Point":t={type:"Point",coordinates:f(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(f)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function _(e){var t,i=0,r=1,n=e.length,o=new Array(n);for(o[0]=c(e[0],0);++i<n;)((t=c(e[i],i))[0]||t[1])&&(o[r++]=t);return 1===r&&(o[r++]=[0,0]),o.length=r,o}for(u in h)d[u]=p(h[u]);return{type:"Topology",bbox:l,transform:t,objects:d,arcs:e.arcs.map(_)}},v=function(e){var t=1/0,i=1/0,r=-1/0,n=-1/0;function o(e){null!=e&&a.hasOwnProperty(e.type)&&a[e.type](e)}var a={GeometryCollection:function(e){e.geometries.forEach(o)},Point:function(e){s(e.coordinates)},MultiPoint:function(e){e.coordinates.forEach(s)},LineString:function(e){l(e.arcs)},MultiLineString:function(e){e.arcs.forEach(l)},Polygon:function(e){e.arcs.forEach(l)},MultiPolygon:function(e){e.arcs.forEach(u)}};function s(e){var o=e[0],a=e[1];o<t&&(t=o),o>r&&(r=o),a<i&&(i=a),a>n&&(n=a)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}for(var c in e)o(e[c]);return r>=t&&n>=i?[t,i,r,n]:void 0},y=function(e,t,i,r,n){3===arguments.length&&(r=Array,n=null);for(var o=new r(e=1<<Math.max(4,Math.ceil(Math.log(e)/Math.LN2))),a=e-1,s=0;s<e;++s)o[s]=n;function l(r){for(var s=t(r)&a,l=o[s],u=0;l!=n;){if(i(l,r))return!0;if(++u>=e)throw new Error("full hashset");l=o[s=s+1&a]}return o[s]=r,!0}function u(r){for(var s=t(r)&a,l=o[s],u=0;l!=n;){if(i(l,r))return!0;if(++u>=e)break;l=o[s=s+1&a]}return!1}function c(){for(var e=[],t=0,i=o.length;t<i;++t){var r=o[t];r!=n&&e.push(r)}return e}return{add:l,has:u,values:c}},x=function(e,t,i,r,n,o){3===arguments.length&&(r=o=Array,n=null);for(var a=new r(e=1<<Math.max(4,Math.ceil(Math.log(e)/Math.LN2))),s=new o(e),l=e-1,u=0;u<e;++u)a[u]=n;function c(r,o){for(var u=t(r)&l,c=a[u],h=0;c!=n;){if(i(c,r))return s[u]=o;if(++h>=e)throw new Error("full hashmap");c=a[u=u+1&l]}return a[u]=r,s[u]=o,o}function h(r,o){for(var u=t(r)&l,c=a[u],h=0;c!=n;){if(i(c,r))return s[u];if(++h>=e)throw new Error("full hashmap");c=a[u=u+1&l]}return a[u]=r,s[u]=o,o}function d(r,o){for(var u=t(r)&l,c=a[u],h=0;c!=n;){if(i(c,r))return s[u];if(++h>=e)break;c=a[u=u+1&l]}return o}function f(){for(var e=[],t=0,i=a.length;t<i;++t){var r=a[t];r!=n&&e.push(r)}return e}return{set:c,maybeSet:h,get:d,keys:f}},b=function(e,t){return e[0]===t[0]&&e[1]===t[1]},w=new ArrayBuffer(16),C=new Uint32Array(w),T=function(e){var t=C[0]^C[1];return 2147483647&(t=t<<5^t>>7^C[2]^C[3])},S=function(e){var t,i,r,n,o=e.coordinates,a=e.lines,s=e.rings,l=C(),u=new Int32Array(o.length),c=new Int32Array(o.length),h=new Int32Array(o.length),d=new Int8Array(o.length),f=0;for(t=0,i=o.length;t<i;++t)u[t]=c[t]=h[t]=-1;for(t=0,i=a.length;t<i;++t){var p=a[t],_=p[0],m=p[1];for(r=l[_],n=l[++_],++f,d[r]=1;++_<=m;)w(t,r,r=n,n=l[_]);++f,d[n]=1}for(t=0,i=o.length;t<i;++t)u[t]=-1;for(t=0,i=s.length;t<i;++t){var $=s[t],g=$[0]+1,v=$[1];for(w(t,l[v-1],r=l[g-1],n=l[g]);++g<=v;)w(t,r,r=n,n=l[g])}function w(e,t,i,r){if(u[i]!==e){u[i]=e;var n=c[i];if(n>=0){var o=h[i];(n!==t||o!==r)&&(n!==r||o!==t)&&(++f,d[i]=1)}else c[i]=t,h[i]=r}}function C(){for(var e=x(1.4*o.length,S,E,Int32Array,-1,Int32Array),t=new Int32Array(o.length),i=0,r=o.length;i<r;++i)t[i]=e.maybeSet(i,i);return t}function S(e){return T(o[e])}function E(e,t){return b(o[e],o[t])}u=c=h=null;var A,P=y(1.4*f,T,b);for(t=0,i=o.length;t<i;++t)d[A=l[t]]&&P.add(o[A]);return P},E=function(e){var t,i,r,n=S(e),o=e.coordinates,a=e.lines,s=e.rings;for(i=0,r=a.length;i<r;++i)for(var l=a[i],u=l[0],c=l[1];++u<c;)n.has(o[u])&&(t={0:u,1:l[1]},l[1]=u,l=l.next=t);for(i=0,r=s.length;i<r;++i)for(var h=s[i],d=h[0],f=d,p=h[1],_=n.has(o[d]);++f<p;)n.has(o[f])&&(_?(t={0:f,1:h[1]},h[1]=f,h=h.next=t):(A(o,d,p,p-f),o[p]=o[d],_=!0,f=d));return e};function A(e,t,i,r){P(e,t,i),P(e,t,t+r),P(e,t+r,i)}function P(e,t,i){for(var r,n=t+(i---t>>1);t<n;++t,--i)r=e[t],e[t]=e[i],e[i]=r}var I=function(e){var t,i,r,n,o=e.coordinates,a=e.lines,s=e.rings,l=a.length+s.length;for(delete e.lines,delete e.rings,r=0,n=a.length;r<n;++r)for(t=a[r];t=t.next;)++l;for(r=0,n=s.length;r<n;++r)for(i=s[r];i=i.next;)++l;var u=x(2*l*1.4,T,b),c=e.arcs=[];for(r=0,n=a.length;r<n;++r){t=a[r];do{h(t)}while(t=t.next)}for(r=0,n=s.length;r<n;++r)if((i=s[r]).next)do{h(i)}while(i=i.next);else d(i);function h(e){var t,i,r,n,a,s,l,h;if(r=u.get(t=o[e[0]]))for(l=0,h=r.length;l<h;++l)if(f(n=r[l],e))return e[0]=n[0],void(e[1]=n[1]);if(a=u.get(i=o[e[1]]))for(l=0,h=a.length;l<h;++l)if(p(s=a[l],e))return e[1]=s[0],void(e[0]=s[1]);r?r.push(e):u.set(t,[e]),a?a.push(e):u.set(i,[e]),c.push(e)}function d(e){var t,i,r,n,a;if(i=u.get(t=o[e[0]]))for(n=0,a=i.length;n<a;++n){if(_(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(m(r,e))return e[0]=r[1],void(e[1]=r[0])}if(i=u.get(t=o[e[0]+$(e)]))for(n=0,a=i.length;n<a;++n){if(_(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(m(r,e))return e[0]=r[1],void(e[1]=r[0])}i?i.push(e):u.set(t,[e]),c.push(e)}function f(e,t){var i=e[0],r=t[0],n=e[1];if(i-n!=r-t[1])return!1;for(;i<=n;++i,++r)if(!b(o[i],o[r]))return!1;return!0}function p(e,t){var i=e[0],r=t[0],n=e[1],a=t[1];if(i-n!=r-a)return!1;for(;i<=n;++i,--a)if(!b(o[i],o[a]))return!1;return!0}function _(e,t){var i=e[0],r=t[0],n=e[1]-i;if(n!==t[1]-r)return!1;for(var a=$(e),s=$(t),l=0;l<n;++l)if(!b(o[i+(l+a)%n],o[r+(l+s)%n]))return!1;return!0}function m(e,t){var i=e[0],r=t[0],n=e[1],a=t[1],s=n-i;if(s!==a-r)return!1;for(var l=$(e),u=s-$(t),c=0;c<s;++c)if(!b(o[i+(c+l)%s],o[a-(c+u)%s]))return!1;return!0}function $(e){for(var t=e[0],i=e[1],r=t,n=r,a=o[r];++r<i;){var s=o[r];(s[0]<a[0]||s[0]===a[0]&&s[1]<a[1])&&(n=r,a=s)}return n-t}return e},M=function(e){for(var t=-1,i=e.length;++t<i;){for(var r,n,o=e[t],a=0,s=1,l=o.length,u=o[0],c=u[0],h=u[1];++a<l;)r=(u=o[a])[0],n=u[1],(r!==c||n!==h)&&(o[s++]=[r-c,n-h],c=r,h=n);1===s&&(o[s++]=[0,0]),o.length=s}return e},O=function(e){var t=-1,i=[],r=[],n=[];function o(e){e&&a.hasOwnProperty(e.type)&&a[e.type](e)}var a={GeometryCollection:function(e){e.geometries.forEach(o)},LineString:function(e){e.arcs=s(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(s)},Polygon:function(e){e.arcs=e.arcs.map(l)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};function s(e){for(var r=0,o=e.length;r<o;++r)n[++t]=e[r];var a={0:t-o+1,1:t};return i.push(a),a}function l(e){for(var i=0,o=e.length;i<o;++i)n[++t]=e[i];var a={0:t-o+1,1:t};return r.push(a),a}function u(e){return e.map(l)}for(var c in e)o(e[c]);return{type:"Topology",coordinates:n,lines:i,rings:r,objects:e}},D=function(e){var t,i={};for(t in e)i[t]=R(e[t]);return i};function R(e){return null==e?{type:null}:("FeatureCollection"===e.type?L:"Feature"===e.type?B:N)(e)}function L(e){var t={type:"GeometryCollection",geometries:e.features.map(B)};return null!=e.bbox&&(t.bbox=e.bbox),t}function B(e){var t,i=N(e.geometry);for(t in null!=e.id&&(i.id=e.id),null!=e.bbox&&(i.bbox=e.bbox),e.properties){i.properties=e.properties;break}return i}function N(e){if(null==e)return{type:null};var t="GeometryCollection"===e.type?{type:"GeometryCollection",geometries:e.geometries.map(N)}:"Point"===e.type||"MultiPoint"===e.type?{type:e.type,coordinates:e.coordinates}:{type:e.type,arcs:e.coordinates};return null!=e.bbox&&(t.bbox=e.bbox),t}var F=function(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=o-r?(i-1)/(o-r):1,l=a-n?(i-1)/(a-n):1;function u(e){return[Math.round((e[0]-r)*s),Math.round((e[1]-n)*l)]}function c(e,t){for(var i,o,a,u,c,h=-1,d=0,f=e.length,p=new Array(f);++h<f;)i=e[h],u=Math.round((i[0]-r)*s),c=Math.round((i[1]-n)*l),(u!==o||c!==a)&&(p[d++]=[o=u,a=c]);for(p.length=d;d<t;)d=p.push([p[0][0],p[0][1]]);return p}function h(e){return c(e,2)}function d(e){return c(e,4)}function f(e){return e.map(d)}function p(e){null!=e&&_.hasOwnProperty(e.type)&&_[e.type](e)}var _={GeometryCollection:function(e){e.geometries.forEach(p)},Point:function(e){e.coordinates=u(e.coordinates)},MultiPoint:function(e){e.coordinates=e.coordinates.map(u)},LineString:function(e){e.arcs=h(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(h)},Polygon:function(e){e.arcs=f(e.arcs)},MultiPolygon:function(e){e.arcs=e.arcs.map(f)}};for(var m in e)p(e[m]);return{scale:[1/s,1/l],translate:[r,n]}},z=function(e,t){var i=v(e=D(e)),r=t>0&&i&&F(e,i,t),n=I(E(O(e))),o=n.coordinates,a=x(1.4*n.arcs.length,k,V);function s(e){e&&l.hasOwnProperty(e.type)&&l[e.type](e)}e=n.objects,n.bbox=i,n.arcs=n.arcs.map((function(e,t){return a.set(e,t),o.slice(e[0],e[1]+1)})),delete n.coordinates,o=null;var l={GeometryCollection:function(e){e.geometries.forEach(s)},LineString:function(e){e.arcs=u(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(u)},Polygon:function(e){e.arcs=e.arcs.map(u)},MultiPolygon:function(e){e.arcs=e.arcs.map(c)}};function u(e){var t=[];do{var i=a.get(e);t.push(e[0]<e[1]?i:~i)}while(e=e.next);return t}function c(e){return e.map(u)}for(var h in e)s(e[h]);return r&&(n.transform=r,n.arcs=M(n.arcs)),n};function k(e){var t,i=e[0],r=e[1];return r<i&&(t=i,i=r,r=t),i+31*r}function V(e,t){var i,r=e[0],n=e[1],o=t[0],a=t[1];return n<r&&(i=r,r=n,n=i),a<o&&(i=o,o=a,a=i),r===o&&n===a}var U=function(e){var t,i,r=e.objects,n={},o=e.arcs,a=o.length,s=-1,l=new Array(a),u=0,c=-1;function h(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(h);break;case"LineString":f(e.arcs);break;case"MultiLineString":case"Polygon":e.arcs.forEach(f);break;case"MultiPolygon":e.arcs.forEach(p)}}function d(e){e<0&&(e=~e),l[e]||(l[e]=1,++u)}function f(e){e.forEach(d)}function p(e){e.forEach(f)}function _(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(_)};break;case"LineString":t={type:"LineString",arcs:$(e.arcs)};break;case"MultiLineString":t={type:"MultiLineString",arcs:e.arcs.map($)};break;case"Polygon":t={type:"Polygon",arcs:e.arcs.map($)};break;case"MultiPolygon":t={type:"MultiPolygon",arcs:e.arcs.map(g)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function m(e){return e<0?~l[~e]:l[e]}function $(e){return e.map(m)}function g(e){return e.map($)}for(i in r)h(r[i]);for(t=new Array(u);++s<a;)l[s]&&(l[s]=++c,t[c]=o[s]);for(i in r)n[i]=_(r[i]);return{type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:t}},X=function(e,t){var i,r=e.objects,n={};function o(e){var t,i;switch(e.type){case"Polygon":t=(i=a(e.arcs))?{type:"Polygon",arcs:i}:{type:null};break;case"MultiPolygon":t=(i=e.arcs.map(a).filter(G)).length?{type:"MultiPolygon",arcs:i}:{type:null};break;case"GeometryCollection":t=(i=e.geometries.map(o).filter(W)).length?{type:"GeometryCollection",geometries:i}:{type:null};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function a(e){return e.length&&s(e[0])?[e[0]].concat(e.slice(1).filter(l)):null}function s(e){return t(e,!1)}function l(e){return t(e,!0)}for(i in null==t&&(t=H),r)n[i]=o(r[i]);return U({type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:e.arcs})};function H(){return!0}function G(e){return e}function W(e){return null!=e.type}var Y=function(e){var t,i=new Array(e.arcs.length),r=0;function n(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(n);break;case"Polygon":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}}function o(e){for(var t=0,n=e.length;t<n;++t,++r)for(var o=e[t],a=0,s=o.length;a<s;++a){var l=o[a];l<0&&(l=~l);var u=i[l];null==u?i[l]=r:u!==r&&(i[l]=-1)}}for(t in e.objects)n(e.objects[t]);return function(e){for(var t,r=0,n=e.length;r<n;++r)if(-1===i[(t=e[r])<0?~t:t])return!0;return!1}};function q(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))/2}function j(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return Math.abs(o)/2}var Z=function(e,t,i){return t=null==t?Number.MIN_VALUE:+t,null==i&&(i=j),function(r,n){return i(o(e,{type:"Polygon",arcs:[r]}).geometry.coordinates[0],n)>=t}},K=function(e,t,i){var r=Y(e),n=Z(e,t,i);return function(e,t){return r(e,t)||n(e,t)}};function Q(e,t){return e[1][2]-t[1][2]}var J=function(){var e={},t=[],i=0;function r(e,i){for(;i>0;){var r=(i+1>>1)-1,n=t[r];if(Q(e,n)>=0)break;t[n._=i]=n,t[e._=i=r]=e}}function n(e,r){for(;;){var n=r+1<<1,o=n-1,a=r,s=t[a];if(o<i&&Q(t[o],s)<0&&(s=t[a=o]),n<i&&Q(t[n],s)<0&&(s=t[a=n]),a===r)break;t[s._=r]=s,t[e._=r=a]=e}}return e.push=function(e){return r(t[e._=i]=e,i++),i},e.pop=function(){if(!(i<=0)){var e,r=t[0];return--i>0&&(e=t[i],n(t[e._=0]=e,0)),r}},e.remove=function(e){var o,a=e._;if(t[a]===e)return a!==--i&&(Q(o=t[i],e)<0?r:n)(t[o._=a]=o,a),a},e};function ee(e){return[e[0],e[1],0]}var te=function(e,t){var r=e.transform?i(e.transform):ee,n=J();null==t&&(t=q);var o=e.arcs.map((function(e){var i,o,s,l=[],u=0;for(o=1,s=(e=e.map(r)).length-1;o<s;++o)(i=[e[o-1],e[o],e[o+1]])[1][2]=t(i),l.push(i),n.push(i);for(e[0][2]=e[s][2]=1/0,o=0,s=l.length;o<s;++o)(i=l[o]).previous=l[o-1],i.next=l[o+1];for(;i=n.pop();){var c=i.previous,h=i.next;i[1][2]<u?i[1][2]=u:u=i[1][2],c&&(c.next=h,c[2]=i[2],a(c)),h&&(h.previous=c,h[0]=i[0],a(h))}return e}));function a(e){n.remove(e),e[1][2]=t(e),n.push(e)}return{type:"Topology",bbox:e.bbox,objects:e.objects,arcs:o}},ie=function(e,t){var i=[];return e.arcs.forEach((function(e){e.forEach((function(e){isFinite(e[2])&&i.push(e[2])}))})),i.length&&re(i.sort(ne),t)};function re(e,t){if(i=e.length){if((t=+t)<=0||i<2)return e[0];if(t>=1)return e[i-1];var i,r=(i-1)*t,n=Math.floor(r),o=e[n];return o+(e[n+1]-o)*(r-n)}}function ne(e,t){return t-e}var oe=function(e,t){t=null==t?Number.MIN_VALUE:+t;var i=e.arcs.map((function(e){for(var i,r=-1,n=0,o=e.length,a=new Array(o);++r<o;)(i=e[r])[2]>=t&&(a[n++]=[i[0],i[1]]);return a.length=n,a}));return{type:"Topology",transform:e.transform,bbox:e.bbox,objects:e.objects,arcs:i}},ae=Math.PI,se=2*ae,le=ae/4,ue=ae/180,ce=Math.abs,he=Math.atan2,de=Math.cos,fe=Math.sin;function pe(e,t){for(var i,r,n=0,o=e.length,a=0,s=e[t?n++:o-1],l=s[0]*ue,u=s[1]*ue/2+le,c=de(u),h=fe(u);n<o;++n){i=l,l=(s=e[n])[0]*ue,u=s[1]*ue/2+le,r=c,c=de(u);var d=l-i,f=d>=0?1:-1,p=f*d,_=h*(h=fe(u)),m=r*c+_*de(p),$=_*f*fe(p);a+=he($,m)}return a}function _e(e,t){var i=pe(e,!0);return t&&(i*=-1),2*(i<0?se+i:i)}function me(e){return 2*ce(pe(e,!1))}e.bbox=r,e.feature=o,e.mesh=u,e.meshArcs=c,e.merge=f,e.mergeArcs=p,e.neighbors=m,e.quantize=g,e.transform=i,e.untransform=$,e.topology=z,e.filter=X,e.filterAttached=Y,e.filterAttachedWeight=K,e.filterWeight=Z,e.planarRingArea=j,e.planarTriangleArea=q,e.presimplify=te,e.quantile=ie,e.simplify=oe,e.sphericalRingArea=_e,e.sphericalTriangleArea=me,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof exports&&typeof module<"u"?exports:e.topojson=e.topojson||{})}(ce$f);var ke$8=ce$f.topojson;function P$p(e){return t$X.fromDegrees(e[0],e[1],e[2])}var A$A={"urn:ogc:def:crs:OGC:1.3:CRS84":P$p,"EPSG:4326":P$p,"urn:ogc:def:crs:EPSG::4326":P$p},J$r={},Q$o={},M$s=48,R$o,G$w=e$1S.ROYALBLUE,L$s=e$1S.YELLOW,O$m=2,U$q=e$1S.fromBytes(255,255,0,100),D$w=!1,Le$d={small:24,medium:48,large:64},Oe$c=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Z$l(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==Oe$c.indexOf(r))continue;var n=e[r];e$28(n)&&(i+="object"==typeof n?"<tr><th>"+r+"</th><td>"+Z$l(n)+"</td></tr>":"<tr><th>"+r+"</th><td>"+n+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function Ue$c(e,t,i){var r;return function(n,o){return e$28(r)||(r=e(t,i)),r}}function $$m(e,t){return new n$G(Ue$c(Z$l,e,t),!0)}function B$f(e,t,i){var r=e.id;if(e$28(r)&&"Feature"===e.type){for(var n=2,o=r;e$28(t.getById(o));)o=r+"_"+n,n++;r=o}else r=e$1K();var a=t.getOrCreateEntity(r),s=e.properties;if(e$28(s)){a.properties=s;var l,u=s.title;if(e$28(u))a.name=u,l="title";else{var c=Number.MAX_VALUE;for(var h in s)if(s.hasOwnProperty(h)&&s[h]){var d=h.toLowerCase();if(c>1&&"title"===d){c=1,l=h;break}c>2&&"name"===d?(c=2,l=h):c>3&&/title/i.test(h)?(c=3,l=h):c>4&&/name/i.test(h)&&(c=4,l=h)}e$28(l)&&(a.name=s[l])}var f=s.description;null!==f&&(a.description=e$28(f)?new e$1d(f):i(s,l))}return a}function F$q(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}var K$k={Feature:re$b,FeatureCollection:Be$e,GeometryCollection:ie$d,LineString:le$e,MultiLineString:ae$e,MultiPoint:oe$d,MultiPolygon:me$f,Point:ne$h,Polygon:ce$e,Topology:ue$c},ee$h={GeometryCollection:ie$d,LineString:le$e,MultiLineString:ae$e,MultiPoint:oe$d,MultiPolygon:me$f,Point:ne$h,Polygon:ce$e,Topology:ue$c};function re$b(e,t,i,r,n){if(null!==t.geometry){if(!e$28(t.geometry))throw new t$U("feature.geometry is required.");var o=t.geometry.type,a=ee$h[o];if(!e$28(a))throw new t$U("Unknown geometry type: "+o);a(e,t,t.geometry,r,n)}else B$f(t,e._entityCollection,n.describe)}function Be$e(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;a<s;a++)re$b(e,o[a],void 0,r,n)}function ie$d(e,t,i,r,n){for(var o=i.geometries,a=0,s=o.length;a<s;a++){var l=o[a],u=l.type,c=ee$h[u];if(!e$28(c))throw new t$U("Unknown geometry type: "+u);c(e,t,l,r,n)}}function te$h(e,t,i,r,n){var o,a=n.markerSymbol,s=n.markerColor,l=n.markerSize,u=t.properties;if(e$28(u)){var c=u["marker-color"];e$28(c)&&(s=e$1S.fromCssColorString(c)),l=u$Y(Le$d[u["marker-size"]],l);var h=u["marker-symbol"];e$28(h)&&(a=h)}o=e$28(a)?1===a.length?e._pinBuilder.fromText(a.toUpperCase(),s,l):e._pinBuilder.fromMakiIconId(a,s,l):e._pinBuilder.fromColor(s,l);var d=new n$I;d.verticalOrigin=new e$1d(S$L.BOTTOM),2===r.length&&n.clampToGround&&(d.heightReference=k$_.CLAMP_TO_GROUND);var f=B$f(t,e._entityCollection,n.describe);f.billboard=d,f.position=new r$G(i(r));var p=o$1q(o).then((function(e){d.image=new e$1d(e)})).otherwise((function(){d.image=new e$1d(e._pinBuilder.fromColor(s,l))}));e._promises.push(p)}function ne$h(e,t,i,r,n){te$h(e,t,r,i.coordinates,n)}function oe$d(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)te$h(e,t,r,o[a],n)}function se$b(e,t,i,r,n){var o=n.strokeMaterialProperty,a=n.strokeWidthProperty,s=t.properties;if(e$28(s)){var l=s["stroke-width"];e$28(l)&&(a=new e$1d(l));var u,c=s.stroke;e$28(c)&&(u=e$1S.fromCssColorString(c));var h=s["stroke-opacity"];e$28(h)&&1!==h&&(e$28(u)||(u=o.color.clone()),u.alpha=h),e$28(u)&&(o=new t$z(u))}var d=B$f(t,e._entityCollection,n.describe),f=new a$I;d.polyline=f,f.clampToGround=n.clampToGround,f.material=o,f.width=a,f.positions=new e$1d(F$q(r,i)),f.arcType=m$_.RHUMB}function le$e(e,t,i,r,n){se$b(e,t,r,i.coordinates,n)}function ae$e(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)se$b(e,t,r,o[a],n)}function fe$d(e,t,i,r,n){if(0!==r.length&&0!==r[0].length){var o=n.strokeMaterialProperty.color,a=n.fillMaterialProperty,s=n.strokeWidthProperty,l=t.properties;if(e$28(l)){var u=l["stroke-width"];e$28(u)&&(s=new e$1d(u));var c,h=l.stroke;e$28(h)&&(c=e$1S.fromCssColorString(h));var d=l["stroke-opacity"];e$28(d)&&1!==d&&(e$28(c)||(c=n.strokeMaterialProperty.color.clone()),c.alpha=d),e$28(c)&&(o=new e$1d(c));var f,p=l.fill;e$28(p)&&((f=e$1S.fromCssColorString(p)).alpha=a.color.alpha),e$28(d=l["fill-opacity"])&&d!==a.color.alpha&&(e$28(f)||(f=a.color.clone()),f.alpha=d),e$28(f)&&(a=new t$z(f))}var _=new u$B;_.outline=new e$1d(!0),_.outlineColor=o,_.outlineWidth=s,_.material=a,_.arcType=m$_.GEODESIC,_._fromDataSource=!0;for(var m=[],$=1,g=r.length;$<g;$++)m.push(new e$1m(F$q(r[$],i)));var v=r[0];_.hierarchy=new e$1d(new e$1m(F$q(v,i),m)),v[0].length>2?_.perPositionHeight=new e$1d(!0):n.clampToGround||(_.height=0);var y=B$f(t,e._entityCollection,n.describe);n.clampToGround&&(_.classificationType=L$V.TERRAIN),n.clampToS3M&&(_.classificationType=L$V.S3M_TILE),y.polygon=_}}function ce$e(e,t,i,r,n){fe$d(e,t,r,i.coordinates,n)}function me$f(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)fe$d(e,t,r,o[a],n)}function ue$c(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=ke$8.feature(i,i.objects[o]);(0,K$k[a.type])(e,a,a,r,n)}}function y$t(e){this._name=e,this._changed=new o$1o,this._error=new o$1o,this._isLoading=!1,this._loading=new o$1o,this._entityCollection=new r$z(this),this._promises=[],this._pinBuilder=new s$H,this._entityCluster=new a$v,this._credit=void 0,this._resourceCredits=[],this._visibleViewport=4095,this._swipeRegion=new e$25(0,0,1,1),this._swipeEnabled=!1}function pe$f(e,t,i,r){var n;e$28(r)&&(n=f$V(r)),e$28(n)&&e._name!==n&&(e._name=n,e._changed.raiseEvent(e));var o=K$k[t.type];if(!e$28(o))throw new t$U("Unsupported GeoJSON object type: "+t.type);var a=t.crs,s=null!==a?P$p:null;if(e$28(a)){if(!e$28(a.properties))throw new t$U("crs.properties is undefined.");var l=a.properties;if("name"===a.type){if(!e$28(s=A$A[l.name]))throw new t$U("Unknown crs name: "+l.name)}else if("link"===a.type){var u=J$r[l.href];if(e$28(u)||(u=Q$o[l.type]),!e$28(u))throw new t$U("Unable to resolve crs link: "+JSON.stringify(l));s=u(l)}else{if("EPSG"!==a.type)throw new t$U("Unknown crs type: "+a.type);if(!e$28(s=A$A["EPSG:"+l.code]))throw new t$U("Unknown crs EPSG code: "+l.code)}}return o$1q(s,(function(r){return e._entityCollection.removeAll(),null!==r&&o(e,t,t,r,i),o$1q.all(e._promises,(function(){return e._promises.length=0,o$L.setLoading(e,!1),e}))}))}function o$G(e,t){this.position=e,this.headingPitchRoll=t}y$t.load=function(e,t){return(new y$t).load(e,t)},Object.defineProperties(y$t,{markerSize:{get:function(){return M$s},set:function(e){M$s=e}},markerSymbol:{get:function(){return R$o},set:function(e){R$o=e}},markerColor:{get:function(){return G$w},set:function(e){G$w=e}},stroke:{get:function(){return L$s},set:function(e){L$s=e}},strokeWidth:{get:function(){return O$m},set:function(e){O$m=e}},fill:{get:function(){return U$q},set:function(e){U$q=e}},clampToGround:{get:function(){return D$w},set:function(e){D$w=e}},crsNames:{get:function(){return A$A}},crsLinkHrefs:{get:function(){return J$r}},crsLinkTypes:{get:function(){return Q$o}}}),Object.defineProperties(y$t.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!e$28(e))throw new t$Z("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},swipeRegion:{get:function(){return new f$10(this._swipeRegion.x,this._swipeRegion.y,this._swipeRegion.z-this._swipeRegion.x,this._swipeRegion.w-this._swipeRegion.y)},set:function(e){if(e$28(e)){if(!(e instanceof f$10))throw new t$Z("swipeRegion must be a instance of BoundingRectangle.");if(e$25.fromElements(e.x,e.y,e.x+e.width,e.y+e.height,this._swipeRegion),e$28(this._entityCluster._billboardCollection)&&(this._entityCluster._billboardCollection._swipeRegion=e$25.clone(this._swipeRegion,new e$25)),e$28(this._primitives))for(var t=0;t<this._primitives._primitives.length;t++)this._primitives._primitives[t]instanceof v$C&&(this._primitives._primitives[t]._swipeRegion=e$25.clone(this._swipeRegion,new e$25));if(e$28(this._groundPrimitives)){var i=this._groundPrimitives._collectionsArray;for(t=0;t<i.length;t++)if(i[t]instanceof o$I)for(var r=0;r<i[t]._primitives.length;r++)i[t]._primitives[r]._primitive._primitive._swipeRegion=e$25.clone(this._swipeRegion,new e$25)}}}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){if(e!==this._swipeEnabled){if(e||e$25.fromElements(0,0,1,1,this._swipeRegion),this._swipeEnabled=e,e$28(this._entityCluster._billboardCollection)&&(this._entityCluster._billboardCollection._swipeEnabled=e),e$28(this._primitives))for(var t=0;t<this._primitives._primitives.length;t++)this._primitives._primitives[t]instanceof v$C&&(this._primitives._primitives[t].swipeEnabled=e);if(e$28(this._groundPrimitives)){var i=this._groundPrimitives._collectionsArray;for(t=0;t<i.length;t++)if(i[t]instanceof o$I)for(var r=0;r<i[t]._primitives.length;r++)i[t]._primitives[r]._primitive._primitive.swipeEnabled=e}}}}}),y$t.prototype.load=function(e,t){if(!e$28(e))throw new t$Z("data is required.");o$L.setLoading(this,!0);var i=(t=u$Y(t,u$Y.EMPTY_OBJECT)).credit;"string"==typeof i&&(i=new r$1a(i)),this._credit=i;var r=e,n=t.sourceUri;if("string"==typeof e||e instanceof t$S){r=(e=t$S.createIfNeeded(e)).fetchJson(),n=u$Y(n,e.getUrlComponent());var o=this._resourceCredits,a=e.credits;if(e$28(a))for(var s=a.length,l=0;l<s;l++)o.push(a[l])}t={describe:u$Y(t.describe,$$m),markerSize:u$Y(t.markerSize,M$s),markerSymbol:u$Y(t.markerSymbol,R$o),markerColor:u$Y(t.markerColor,G$w),strokeWidthProperty:new e$1d(u$Y(t.strokeWidth,O$m)),strokeMaterialProperty:new t$z(u$Y(t.stroke,L$s)),fillMaterialProperty:new t$z(u$Y(t.fill,U$q)),clampToGround:u$Y(t.clampToGround,D$w),clampToS3M:u$Y(t.clampToS3M,!1)};var u=this;return o$1q(r,(function(e){return pe$f(u,e,t,n)})).otherwise((function(e){return o$L.setLoading(u,!1),u._error.raiseEvent(u,e),console.log(e),o$1q.reject(e)}))},y$t.prototype.loadPoiJsonData=function(e,t){if(!e$28(e))throw new t$Z("data is required.");o$L.setLoading(this,!0);var i=(t=u$Y(t,u$Y.EMPTY_OBJECT)).sourceUri;return pe$f(this,e,t={describe:u$Y(t.describe,$$m),markerSize:u$Y(t.markerSize,M$s),markerSymbol:u$Y(t.markerSymbol,R$o),markerColor:u$Y(t.markerColor,G$w),strokeWidthProperty:new e$1d(u$Y(t.strokeWidth,O$m)),strokeMaterialProperty:new t$z(u$Y(t.stroke,L$s)),fillMaterialProperty:new t$z(u$Y(t.fill,U$q))},i)},y$t.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},y$t.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport};var be$e={};!function(e,t){e.Autolinker=function(){function e(e,t){for(var i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i]);return e}function t(e,t,i){var r;return e.length>t&&(null==i?(i="…",r=3):r=i.length,e=e.substring(0,t-r)+i),e}function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}function r(e,t){for(var i=e.length-1;i>=0;i--)!0===t(e[i])&&e.splice(i,1)}function n(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r}function o(e){throw new Error("Unhandled case for value: '"+e+"'")}var a=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],a=e.split(n);t=a.shift();)-1===i(o,t)&&o.push(t);return this.getAttrs().class=o.join(" "),this},e.prototype.removeClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,o=r?r.split(n):[],a=e.split(n);o.length&&(t=a.shift());){var s=i(o,t);-1!==s&&o.splice(s,1)}return this.getAttrs().class=o.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")},e}();function s(e,t,i){var r,n;null==i?(i="…",n=3,r=8):(n=i.length,r=i.length);var o=function(e){var t={},i=e,r=i.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],i=i.substr(r[0].length)),(r=i.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],i=i.substr(r[0].length)),(r=i.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],i=i.substr(r[0].length)),(r=i.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],i=i.substr(r[0].length)),(r=i.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t},a=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var r=t/2,n=Math.ceil(r),o=-1*Math.floor(r),a="";return o<0&&(a=e.substr(o)),e.substr(0,n)+i+a};if(e.length<=t)return e;var l=t-n,u=o(e);if(u.query){var c=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(u.query=u.query.substr(0,c[1].length),e=a(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=a(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=l)return u.host.length==t?(u.host.substr(0,t-n)+i).substr(0,l+r):s(h,l).substr(0,l+r);var d="";if(u.path&&(d+="/"+u.path),u.query&&(d+="?"+u.query),d){if((h+d).length>=l)return(h+d).length==t?(h+d).substr(0,t):(h+s(d,l-h.length)).substr(0,l+r);h+=d}if(u.fragment){var f="#"+u.fragment;if((h+f).length>=l)return(h+f).length==t?(h+f).substr(0,t):(h+s(f,l-h.length)).substr(0,l+r);h+=f}if(u.scheme&&u.host){var p=u.scheme+"://";if((h+p).length<l)return(p+h).substr(0,t)}if(h.length<=t)return h;var _="";return l>0&&(_=h.substr(-1*Math.floor(l/2))),(h.substr(0,Math.ceil(l/2))+i+_).substr(0,l+r)}function l(e,t,i){if(e.length<=t)return e;var r,n;null==i?(i="…",r=8,n=3):(r=i.length,n=i.length);var o=t-n,a="";return o>0&&(a=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+i+a).substr(0,o+r)}function u(e,i,r){return t(e,i,r)}var c=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 a({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<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var i=[t],r=e.getCssClassSuffixes(),n=0,o=r.length;n<o;n++)i.push(t+"-"+r[n]);return i.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var i=t.length,r=t.location;return"smart"===r?s(e,i):"middle"===r?l(e,i):u(e,i)},e}(),h=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),d=function(e,t){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},d(e,t)};function f(e,t){function i(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var p=function(){return p=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},p.apply(this,arguments)},_=function(e){function t(t){var i=e.call(this,t)||this;return i.email="",i.email=t.email,i}return f(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(h),m=function(e){function t(t){var i=e.call(this,t)||this;return i.serviceName="",i.hashtag="",i.serviceName=t.serviceName,i.hashtag=t.hashtag,i}return f(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":case"facebook":case"instagram":return""+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(h),$=function(e){function t(t){var i=e.call(this,t)||this;return i.serviceName="twitter",i.mention="",i.mention=t.mention,i.serviceName=t.serviceName,i}return f(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":case"instagram":case"soundcloud":return""+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&t.push(i),t},t}(h),g=function(e){function t(t){var i=e.call(this,t)||this;return i.number="",i.plusSign=!1,i.number=t.number,i.plusSign=t.plusSign,i}return f(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(h),v=function(e){function t(t){var i=e.call(this,t)||this;return i.url="",i.urlMatchType="scheme",i.protocolUrlMatch=!1,i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.schemePrefixRegex=/^(https?:\/\/)?/i,i.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,i.protocolRelativeRegex=/^\/\//,i.protocolPrepended=!1,i.urlMatchType=t.urlMatchType,i.url=t.url,i.protocolUrlMatch=t.protocolUrlMatch,i.protocolRelativeMatch=t.protocolRelativeMatch,i.stripPrefix=t.stripPrefix,i.stripTrailingSlash=t.stripTrailingSlash,i.decodePercentEncoding=t.decodePercentEncoding,i}return f(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return!this.protocolRelativeMatch&&!this.protocolUrlMatch&&!this.protocolPrepended&&(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}},t}(h),y=function(){function e(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder}return e}(),x=/[A-Za-z]/,b=/[0-9]/,w=/\s/,C=/['"]/,T=/[\x00-\x1F\x7F]/,S=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,E=S+/\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,A=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,P=E+A,I=E+A,M="(?:["+A+"]{1,3}\\.){3}["+A+"]{1,3}",O="["+I+"](?:["+I+"\\-]{0,61}["+I+"])?",D=function(e){return"(?=("+O+"))\\"+e},R=function(e){return"(?:"+D(e)+"(?:\\."+D(e+1)+"){0,126}|"+M+")"},L=new RegExp("["+I+"]"),B=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிஙà¯�கபà¯�பூரà¯�|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இநà¯�தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|моÑ�ква|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|Ù�لسطين|مليسيا|à¤à¤¾à¤°à¤¤à¤®à¥�|இலஙà¯�கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|à¤à¤¾à¤°à¥‹à¤¤|संगठन|বাংলা|à°à°¾à°°à°¤à±�|à´à´¾à´°à´¤à´‚|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|Ñ�айт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|à¤à¤¾à¤°à¤¤|à¦à¦¾à¦°à¦¤|à¦à¦¾à§°à¦¤|à¨à¨¾à¨°à¨¤|àªàª¾àª°àª¤|à¬à¬¾à¬°à¬¤|à²à²¾à²°à²¤|ලංකà·�|グーグル|クラウド|ãƒ�イント|大众汽车|组织机构|電訊盈科|é¦™æ ¼é‡Œæ‹‰|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|руÑ�|Ñ�рб|укр|Õ°Õ¡Õµ|קו×�|عرب|قطر|كوم|مصر|कॉम|नेट|คà¸à¸¡|ไทย|ストア|セール|ã�¿ã‚“ã�ª|䏿–‡ç½‘|天主教|æˆ‘çˆ±ä½ |æ–°åŠ å�¡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|ë‹·ë„·|ë‹·ì»´|삼성|한êµ|コム|世界|ä¸ä¿¡|ä¸å›½|ä¸åœ‹|ä¼�业|佛山|ä¿¡æ�¯|å�¥åº·|å…«å�¦|å…¬å�¸|公益|å�°æ¹¾|å�°ç�£|商城|商店|å•†æ ‡|嘉里|在线|大拿|娱ä¹�|å®¶é›»|工行|广东|å¾®å�š|慈善|手机|手表|æ‹›è�˜|政务|政府|æ–°é—»|æ—¶å°š|書ç±�|机构|游æˆ�|澳門|点看|ç� å®�|移动|网å�€|网店|网站|网络|è�”é?š|è°·æŒ|è´ç‰©|通販|集团|食å“�|é¤�厅|香港)/,N=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=new RegExp("["+I+"!#$%&'*+/=?^_`{|}~-]"),t.strictTldRegex=new RegExp("^"+B.source+"$"),t}return f(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,i=this.localPartCharRegex,r=this.strictTldRegex,n=[],a=e.length,s=new F,l={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,c=0,h=s;u<a;){var d=e.charAt(u);switch(c){case 0:f(d);break;case 1:m(e.charAt(u-1),d);break;case 2:$(d);break;case 3:g(d);break;case 4:v(d);break;case 5:y(d);break;case 6:x(d);break;case 7:b(d);break;default:o(c)}u++}return T(),n;function f(e){"m"===e?w(1):i.test(e)&&w()}function m(e,t){":"===e?i.test(t)?(c=2,h=new F(p({},h,{hasMailtoPrefix:!0}))):C():l[e]===t||(i.test(t)?c=2:"."===t?c=3:"@"===t?c=4:C())}function $(e){"."===e?c=3:"@"===e?c=4:i.test(e)||C()}function g(e){"."===e||"@"===e?C():i.test(e)?c=2:C()}function v(e){L.test(e)?c=5:C()}function y(e){"."===e?c=7:"-"===e?c=6:L.test(e)||T()}function x(e){"-"===e||"."===e?T():L.test(e)?c=5:T()}function b(e){"."===e||"-"===e?T():L.test(e)?(c=5,h=new F(p({},h,{hasDomainDot:!0}))):T()}function w(e){void 0===e&&(e=2),c=e,h=new F({idx:u})}function C(){c=0,h=s}function T(){if(h.hasDomainDot){var i=e.slice(h.idx,u);/[-.]$/.test(i)&&(i=i.slice(0,-1));var o=h.hasMailtoPrefix?i.slice(7):i;a(o)&&n.push(new _({tagBuilder:t,matchedText:i,offset:h.idx,email:o}))}function a(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)}C()}},t}(y),F=function(){function e(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot}return e}(),z=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),i=t&&t[0].toLowerCase();return"javascript:"!==i&&"vbscript:"!==i},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+S+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),k=function(e){function t(t){var i=e.call(this,t)||this;return i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.matcherRegex=function(){var e=/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/,t=/(?:www\.)/,i=new RegExp("[/?#](?:["+I+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;✓]*["+I+"\\-+&@#/%=~_()|'$*\\[\\]✓])?");return new RegExp(["(?:","(",e.source,R(2),")","|","(","(//)?",t.source,R(6),")","|","(","(//)?",R(10)+"\\.",B.source,"(?![-"+P+"])",")",")","(?::[0-9]+)?","(?:"+i.source+")?"].join(""),"gi")}(),i.wordCharRegExp=new RegExp("["+I+"]"),i.stripPrefix=t.stripPrefix,i.stripTrailingSlash=t.stripTrailingSlash,i.decodePercentEncoding=t.decodePercentEncoding,i}return f(t,e),t.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.stripPrefix,n=this.stripTrailingSlash,o=this.decodePercentEncoding,a=this.tagBuilder,s=[],l=function(){var i=t[0],l=t[1],c=t[4],h=t[5],d=t[9],f=t.index,p=h||d,_=e.charAt(f-1);if(!z.isValid(i,l)||f>0&&"@"===_||f>0&&p&&u.wordCharRegExp.test(_))return"continue";if(/\?$/.test(i)&&(i=i.substr(0,i.length-1)),u.matchHasUnbalancedClosingParen(i))i=i.substr(0,i.length-1);else{var m=u.matchHasInvalidCharAfterTld(i,l);m>-1&&(i=i.substr(0,m))}var $=["http://","https://"].find((function(e){return!!l&&-1!==l.indexOf(e)}));if($){var g=i.indexOf($);i=i.substr(g),l=l.substr(g),f+=g}var y=l?"scheme":c?"www":"tld",x=!!l;s.push(new v({tagBuilder:a,matchedText:i,offset:f,urlMatchType:y,url:i,protocolUrlMatch:x,protocolRelativeMatch:!!p,stripPrefix:r,stripTrailingSlash:n,decodePercentEncoding:o}))},u=this;null!==(t=i.exec(e));)l();return s},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,i=e.charAt(e.length-1);if(")"===i)t="(";else{if("]"!==i)return!1;t="["}for(var r=0,n=0,o=e.length-1;n<o;n++){var a=e.charAt(n);a===t?r++:a===i&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var i=0;t&&(i=e.indexOf(":"),e=e.slice(i));var r=new RegExp("^((.?//)?[-."+I+"]*[-"+I+"]\\.[-"+I+"]+)").exec(e);return null===r?-1:(i+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?i:-1)},t}(y),V=function(e){function t(t){var i=e.call(this,t)||this;return i.serviceName="twitter",i.matcherRegex=new RegExp("#[_"+I+"]{1,139}(?![_"+I+"])","g"),i.nonWordCharRegex=new RegExp("[^"+I+"]"),i.serviceName=t.serviceName,i}return f(t,e),t.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.nonWordCharRegex,n=this.serviceName,o=this.tagBuilder,a=[];null!==(t=i.exec(e));){var s=t.index,l=e.charAt(s-1);if(0===s||r.test(l)){var u=t[0],c=t[0].slice(1);a.push(new m({tagBuilder:o,matchedText:u,offset:s,serviceName:n,hashtag:c}))}}return a},t}(y),U=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/g,t}return f(t,e),t.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.tagBuilder,n=[];null!==(t=i.exec(e));){var o=t[0],a=o.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),l=0==t.index?"":e.substr(t.index-1,1),u=e.substr(t.index+o.length,1),c=!l.match(/\d/)&&!u.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&c&&n.push(new g({tagBuilder:r,matchedText:o,offset:t.index,number:a,plusSign:s}))}return n},t.prototype.testMatch=function(e){return/\D/.test(e)},t}(y),X=function(e){function t(t){var i=e.call(this,t)||this;return i.serviceName="twitter",i.matcherRegexes={twitter:new RegExp("@[_"+I+"]{1,50}(?![_"+I+"])","g"),instagram:new RegExp("@[_."+I+"]{1,30}(?![_"+I+"])","g"),soundcloud:new RegExp("@[-_."+I+"]{1,50}(?![-_"+I+"])","g")},i.nonWordCharRegex=new RegExp("[^"+I+"]"),i.serviceName=t.serviceName,i}return f(t,e),t.prototype.parseMatches=function(e){var t,i=this.serviceName,r=this.matcherRegexes[this.serviceName],n=this.nonWordCharRegex,o=this.tagBuilder,a=[];if(!r)return a;for(;null!==(t=r.exec(e));){var s=t.index,l=e.charAt(s-1);if(0===s||n.test(l)){var u=t[0].replace(/\.+$/g,""),c=u.slice(1);a.push(new $({tagBuilder:o,matchedText:u,offset:s,serviceName:i,mention:c}))}}return a},t}(y);function H(e,t){for(var i=t.onOpenTag,r=t.onCloseTag,n=t.onText,a=t.onComment,s=t.onDoctype,l=new G,u=0,c=e.length,h=0,d=0,f=l;u<c;){var _=e.charAt(u);switch(h){case 0:m(_);break;case 1:$(_);break;case 2:v(_);break;case 3:g(_);break;case 4:y(_);break;case 5:S(_);break;case 6:E(_);break;case 7:A(_);break;case 8:P(_);break;case 9:I(_);break;case 10:M(_);break;case 11:O(_);break;case 12:D(_);break;case 13:R();break;case 14:L(_);break;case 15:B(_);break;case 16:N(_);break;case 17:F(_);break;case 18:z(_);break;case 19:k(_);break;case 20:V(_);break;default:o(h)}u++}function m(e){"<"===e&&X()}function $(e){"!"===e?h=13:"/"===e?(h=2,f=new G(p({},f,{isClosing:!0}))):"<"===e?X():x.test(e)?(h=3,f=new G(p({},f,{isOpening:!0}))):(h=0,f=l)}function g(e){w.test(e)?(f=new G(p({},f,{name:Y()})),h=4):"<"===e?X():"/"===e?(f=new G(p({},f,{name:Y()})),h=12):">"===e?(f=new G(p({},f,{name:Y()})),H()):!x.test(e)&&!b.test(e)&&":"!==e&&U()}function v(e){">"===e?U():x.test(e)?h=3:U()}function y(e){w.test(e)||("/"===e?h=12:">"===e?H():"<"===e?X():"="===e||C.test(e)||T.test(e)?U():h=5)}function S(e){w.test(e)?h=6:"/"===e?h=12:"="===e?h=7:">"===e?H():"<"===e?X():C.test(e)&&U()}function E(e){w.test(e)||("/"===e?h=12:"="===e?h=7:">"===e?H():"<"===e?X():C.test(e)?U():h=5)}function A(e){w.test(e)||('"'===e?h=8:"'"===e?h=9:/[>=`]/.test(e)?U():"<"===e?X():h=10)}function P(e){'"'===e&&(h=11)}function I(e){"'"===e&&(h=11)}function M(e){w.test(e)?h=4:">"===e?H():"<"===e&&X()}function O(e){w.test(e)?h=4:"/"===e?h=12:">"===e?H():"<"===e?X():(h=4,q())}function D(e){">"===e?(f=new G(p({},f,{isClosing:!0})),H()):h=4}function R(t){"--"===e.substr(u,2)?(u+=2,f=new G(p({},f,{type:"comment"})),h=14):"DOCTYPE"===e.substr(u,7).toUpperCase()?(u+=7,f=new G(p({},f,{type:"doctype"})),h=20):U()}function L(e){"-"===e?h=15:">"===e?U():h=16}function B(e){"-"===e?h=18:">"===e?U():h=16}function N(e){"-"===e&&(h=17)}function F(e){h="-"===e?18:16}function z(e){">"===e?H():"!"===e?h=19:"-"===e||(h=16)}function k(e){"-"===e?h=17:">"===e?H():h=16}function V(e){">"===e?H():"<"===e&&X()}function U(){h=0,f=l}function X(){h=1,f=new G({idx:u})}function H(){var t=e.slice(d,f.idx);t&&n(t,d),"comment"===f.type?a(f.idx):"doctype"===f.type?s(f.idx):(f.isOpening&&i(f.name,f.idx),f.isClosing&&r(f.name,f.idx)),U(),d=u+1}function W(){var t=e.slice(d,u);n(t,d),d=u+1}function Y(){var t=f.idx+(f.isClosing?2:1);return e.slice(t,u).toLowerCase()}function q(){u--}d<u&&W()}var G=function(){function e(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing}return e}(),W=function(){function t(e){void 0===e&&(e={}),this.version=t.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"==typeof e.email?e.email:this.email,this.phone="boolean"==typeof e.phone?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow="boolean"==typeof e.newWindow?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash="boolean"==typeof e.stripTrailingSlash?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof e.decodePercentEncoding?e.decodePercentEncoding:this.decodePercentEncoding;var i=this.mention;if(!1!==i&&"twitter"!==i&&"instagram"!==i&&"soundcloud"!==i)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return t.link=function(e,i){return new t(i).link(e)},t.parse=function(e,i){return new t(i).parse(e)},t.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},t.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},t.prototype.normalizeTruncateCfg=function(t){return"number"==typeof t?{length:t,location:"end"}:e(t||{},{length:Number.POSITIVE_INFINITY,location:"end"})},t.prototype.parse=function(e){var t=this,i=["a","style","script"],r=0,o=[];return H(e,{onOpenTag:function(e){i.indexOf(e)>=0&&r++},onText:function(e,i){if(0===r){var a=n(e,/( | |<|<|>|>|"|"|')/gi),s=i;a.forEach((function(e,i){if(i%2==0){var r=t.parseText(e,s);o.push.apply(o,r)}s+=e.length}))}},onCloseTag:function(e){i.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},t.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var i=e[t],r=i.getOffset(),n=i.getMatchedText().length,o=r+n;if(t+1<e.length){if(e[t+1].getOffset()===r){var a=e[t+1].getMatchedText().length>n?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},t.prototype.removeUnwantedMatches=function(e){return this.hashtag||r(e,(function(e){return"hashtag"===e.getType()})),this.email||r(e,(function(e){return"email"===e.getType()})),this.phone||r(e,(function(e){return"phone"===e.getType()})),this.mention||r(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||r(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||r(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||r(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},t.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var i=this.getMatchers(),r=[],n=0,o=i.length;n<o;n++){for(var a=i[n].parseMatches(e),s=0,l=a.length;s<l;s++)a[s].setOffset(t+a[s].getOffset());r.push.apply(r,a)}return r},t.prototype.link=function(e){if(!e)return"";for(var t=this.parse(e),i=[],r=0,n=0,o=t.length;n<o;n++){var a=t[n];i.push(e.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(e.substring(r)),i.join("")},t.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof a?t.toAnchorString():e.buildTag().toAnchorString()},t.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new V({tagBuilder:e,serviceName:this.hashtag}),new N({tagBuilder:e}),new U({tagBuilder:e}),new X({tagBuilder:e,serviceName:this.mention}),new k({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},t.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new c({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},t.version="3.11.0",t.AnchorTagBuilder=c,t.HtmlTag=a,t.matcher={Email:N,Hashtag:V,Matcher:y,Mention:X,Phone:U,Url:k},t.match={Email:_,Hashtag:m,Match:h,Mention:$,Phone:g,Url:v},t}();return W}()}(be$e);var zr$1=be$e.Autolinker;function o$F(e,t){this.position=e,this.headingPitchRange=t}function l$u(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new o$1o,this.tourEnd=new o$1o,this.entryStart=new o$1o,this.entryEnd=new o$1o,this._activeEntries=[]}function h$r(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function f$s(e,t,i){var r=this.playlist[this.playlistIndex];if(r){var n=y$s.bind(this,e,t,i);if(this._activeEntries.push(r),this.entryStart.raiseEvent(r),r.blocking)r.play(n,e.scene.camera,t);else{var o=this;r.play((function(){o.entryEnd.raiseEvent(r);var e=o._activeEntries.indexOf(r);e>=0&&o._activeEntries.splice(e,1)})),n(e,t,i)}}else e$28(i)&&i(!1)}function y$s(e,t,i,r){var n=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(n,r),r)i(r);else{var o=this._activeEntries.indexOf(n);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,f$s.call(this,e,t,i)}}function a$q(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 i$q(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}l$u.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},l$u.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;f$s.call(this,e,t,(function(e){i.playlistIndex=0,e||h$r(i._activeEntries),i.tourEnd.raiseEvent(e)}))},l$u.prototype.stop=function(){h$r(this._activeEntries)},a$q.prototype.play=function(e,t,i){if(this.activeCamera=t,e$28(e)&&null!==e){var r=this;this.activeCallback=function(t){delete r.activeCallback,delete r.activeCamera,e(!e$28(t)&&t)}}var n=this.getCameraOptions(i);if(this.view.headingPitchRoll)t.flyTo(n);else if(this.view.headingPitchRange){var o=new i$19(this.view.position);t.flyToBoundingSphere(o,n)}},a$q.prototype.stop=function(){e$28(this.activeCamera)&&this.activeCamera.cancelFlight(),e$28(this.activeCallback)&&this.activeCallback(!0)},a$q.prototype.getCameraOptions=function(e){var t={duration:this.duration};return e$28(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=m$S.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),e$28(e)&&(t=p$17(t,e)),t},i$q.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout((function(){delete t.activeCallback,e(!1)}),1e3*this.duration)},i$q.prototype.stop=function(){clearTimeout(this.timeout),e$28(this.activeCallback)&&this.activeCallback(!0)};var _0x2af39b=(_0x340a39=!0,function(e,t){var i=_0x340a39?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x340a39=!1,i}),_0x4a5278=_0x2af39b(void 0,(function(){return _0x4a5278.toString().search("(((.+)+)+)+$").toString().constructor(_0x4a5278).search("(((.+)+)+)+$")})),_0x340a39;_0x4a5278();var _0x5a8ca1="attribute vec4 aPosition;\n#ifdef HAS_NORMAL\n attribute vec3 aNormal;\n#endif\nuniform vec4 uFillColor;\nattribute vec4 aTexCoord0;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\nattribute vec3 aPosHigh;\nattribute vec3 aPosLow;\nattribute vec4 aQuaternion;\nattribute vec4 aScaleAndRadius;\nattribute vec4 aColor2;\nattribute vec4 aPickColor;\nattribute vec3 aOffset;\n#ifdef LocalTransform\nattribute vec4 aLocalTranslation;\nattribute vec4 aLocalQuaternion;\n#endif\nuniform mat4 uGeoMat;\nuniform float uRangeMode;\nuniform vec2 uVisibleDistance;\nuniform float uFilterPixel;\nuniform float uMixColorType;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\nvarying vec4 vPositionWC;\nvarying vec3 vNormalEC;\nvarying vec2 vTexCoord;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvarying mat4 vModelMatrix;\n#ifdef Volume\n attribute vec3 aRatio;\n varying vec3 vecRotioCoord;\n varying vec2 vecHypTexCoord;\n#endif\n\nmat4 transfromFromQuaternion(vec4 q, vec4 translation)\n{\n float x2 = q.x * q.x;\n float xy = q.x * q.y;\n float xz = q.x * q.z;\n float xw = q.x * q.w;\n float y2 = q.y * q.y;\n float yz = q.y * q.z;\n float yw = q.y * q.w;\n float z2 = q.z * q.z;\n float zw = q.z * q.w;\n float w2 = q.w * q.w;\n float m00 = x2 - y2 - z2 + w2;\n float m01 = 2.0 * (xy - zw);\n float m02 = 2.0 * (xz + yw);\n float m10 = 2.0 * (xy + zw);\n float m11 = -x2 + y2 - z2 + w2;\n float m12 = 2.0 * (yz - xw);\n float m20 = 2.0 * (xz - yw);\n float m21 = 2.0 * (yz + xw);\n float m22 = -x2 - y2 + z2 + w2;\n return mat4(m00, m10, m20, 0.0, m01, m11, m21, 0.0, m02, m12, m22, 0.0, translation.x, translation.y, translation.z, 1.0);\n}\nfloat filterTest(vec3 rte, float radius)\n{\n if(uRangeMode > 0.0)\n {\n float distance = length(rte);\n float theta = czm_piOverFour * 0.5;\n float screenPix = max(czm_globeDepthTextureDim.x, czm_globeDepthTextureDim.y) * 0.5;\n float lamat = screenPix / tan(theta);\n return lamat * radius / distance > uFilterPixel ? 1.0 : 0.0;\n }\n return length(rte) < uVisibleDistance.x && length(rte) > uVisibleDistance.y ? 1.0 : 0.0;\n}\nvoid main()\n{\n vec4 vertexPos = vec4(aPosition.xyz, 1.0) - vec4(aOffset.xyz,0.0);\n vec4 positionMC = uGeoMat*vertexPos;\n vec4 rte = czm_translateRelativeToEye(aPosHigh,aPosLow);\n vTexCoord = aTexCoord0.xy;\n float show = filterTest(rte.xyz, aScaleAndRadius.w);\n mat4 rotationMat = transfromFromQuaternion(aQuaternion, vec4(0.0));\n mat4 worldMatrix;\n worldMatrix[0] = vec4(rotationMat[0].xyz,0.0);\n worldMatrix[1] = vec4(rotationMat[1].xyz,0.0);\n worldMatrix[2] = vec4(rotationMat[2].xyz,0.0);\n worldMatrix[3] = vec4(rte.x,rte.y,rte.z,1.0);\n mat4 scaleMatrix;\n vec3 scale = aScaleAndRadius.xyz;\n scaleMatrix[0] = vec4(scale.x,0,0,0.0);\n scaleMatrix[1] = vec4(0,scale.y,0,0.0);\n scaleMatrix[2] = vec4(0,0,scale.z,0.0);\n scaleMatrix[3] = vec4(0,0,0,1.0);\n mat4 modelMatrix = worldMatrix;\n#ifdef LocalTransform\n mat4 localTransformMat = transfromFromQuaternion(aLocalQuaternion, aLocalTranslation);\n modelMatrix *= localTransformMat;\n#endif\n modelMatrix *= scaleMatrix;\n mat3 rotationMatrix = mat3(modelMatrix);\n positionMC = modelMatrix * vec4(positionMC.xyz, 1.0);\n positionMC.w = 1.0;\n gl_Position = show * czm_modelViewProjectionRelativeToEye * positionMC;\n vPositionMC.xyz = positionMC.xyz;\n vPositionWC = modelMatrix * positionMC;\n vPositionMC.w = 0.0;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n if(abs(uMixColorType) < 0.1)\n {\n vColor = vertexColor * aColor2;\n }\n else\n {\n vColor = aColor2;\n }\n vPickColor = aPickColor / 255.0;\n vModelMatrix = modelMatrix * uGeoMat;\n vPositionEC = (czm_modelViewRelativeToEye * vec4(vPositionMC.xyz, 1.0)).xyz;\n#ifdef HAS_NORMAL\n if(length(aNormal) > 0.8)\n {\n mat4 modelView = czm_view * vModelMatrix;\n mat4 invModelView = czm_inverseMatrix(modelView);\n mat3 invModelViewRotation = mat3(invModelView);\n mat3 normalMatrix = czm_transpose(invModelViewRotation);\n vNormalEC = normalize(normalMatrix * aNormal);\n vPositionMC.w = 1.0;\n }\n#endif\n#ifdef Volume\nvecRotioCoord = aRatio;\n#endif\n#ifdef ClampObject\n gl_Position = czm_depthClampFarPlane(czm_modelViewProjectionRelativeToEye*positionMC);\n vColor = vColor * uFillColor;\n#endif\n}",_0x486ac1=(_0x266493=!0,function(e,t){var i=_0x266493?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x266493=!1,i}),_0x147013=_0x486ac1(void 0,(function(){return _0x147013.toString().search("(((.+)+)+)+$").toString().constructor(_0x147013).search("(((.+)+)+)+$")})),_0x266493;_0x147013();var _0x34cf70=273;function _0x5ca307(e,t,i){switch(e){case de$y.COMPRESSED_RGB_S3TC_DXT1_EXT:case de$y.COMPRESSED_RGB_ETC1_WEBGL:return(t+3>>2)*(i+3>>2)*8;case de$y.COMPRESSED_RGBA_S3TC_DXT5_EXT:return(t+3>>2)*(i+3>>2)*16;case de$y.COMPRESSED_RGB_PVRTC_4BPPV1_IMG:case de$y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case de$y.COMPRESSED_RGB_PVRTC_2BPPV1_IMG:case de$y.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);case V$O.RGB:return t*i*3;case _0x34cf70:return t*i*2;case V$O.RGBA:return t*i*4;case V$O.LUMINANCE_ALPHA:return t*i*2;default:return 0}}var _0x33f6d6=function(e,t,i,r,n,o,a,s,l,u,c,h){this._context=t,this._gl=t._gl,this._width=i,this._height=r,this._imageBuffer=o,this._oriCompressType=h,this._texture=null,this._internalFormat=n,this._isCompressed=V$O.isCompressedFormat(n),this._wrapS=u$Y(s,q$11.CLAMP_TO_EDGE),this._wrapT=u$Y(l,q$11.CLAMP_TO_EDGE),this._pixelDataType=u$Y(u,y$U.UNSIGNED_BYTE),this._pixelDataType===y$U.FLOAT&&(this._wrapS=q$11.CLAMP_TO_EDGE,this._wrapT=q$11.CLAMP_TO_EDGE),this.ready=!1,this.is3D=a,this.id=e,this._target=this._gl.TEXTURE_2D,this._size=o.length,this._mipmapEnabled=u$Y(c,!0),1==this.is3D?this.init3DTexture():(this._target=this._gl.TEXTURE_2D,this.initTexture()),this._sizeInBytes=this._size,this._context.memorySize+=this._sizeInBytes};function _0xc343c8(e,t,i,r){var n=1;if(!e$27.isPowerOfTwo(i)||!e$27.isPowerOfTwo(r))return 1;for(var o=e.length,a=i,s=r,l=0;;){if(l+=V$O.compressedTextureSizeInBytes(t,a,s),s>>=1,0==(a>>=1)&&0==s)break;n++,a=Math.max(a,1),s=Math.max(s,1)}return l==o?n:1}function _0x22147d(e,t,i){var r=e.length,n=Math.ceil(Math.sqrt(r)),o=document.createElement("canvas");o.width=t*n,o.height=i*n;var a=o.getContext("2d");a.fillStyle="#00f",a.fillRect(0,0,o.width,o.height);for(var s=0;s<r;s++){var l=e[s%r],u=s%n,c=Math.floor(s/n);a.drawImage(l,u*t,c*i)}return a.getImageData(0,0,t*n,i*n)}Object.defineProperties(_0x33f6d6.prototype,{width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),_0x33f6d6.prototype.initTexture=function(){var e=this._gl;this._texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this._texture),this.ext;var t=this._internalFormat,i=this._width,r=this._height,n=this._imageBuffer,o=0,a=0;t===V$O.LUMINANCE_ALPHA||0===this._oriCompressType?e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1):(t==V$O.RGB||t==V$O.RGBA)&&e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0);var s,l=_0xc343c8(n,t,i,r);this._context.webgl2&&t!==de$y.LUMINANCE_ALPHA&&(s=t===_0x34cf70?e.RGB565:V$O.toInternalFormat(t,this._pixelDataType,this._context),e.texStorage2D(e.TEXTURE_2D,l,s,i,r));var u=l>1&&this._mipmapEnabled;do{var c,h=_0x5ca307(t,i,r);c=t==V$O.RGBA&&this._pixelDataType===y$U.FLOAT?new Float32Array(n.buffer,n.byteOffset+o,h):new Uint8Array(n.buffer,n.byteOffset+o,h),this._isCompressed?this._context.webgl2?e.compressedTexSubImage2D(e.TEXTURE_2D,a++,0,0,i,r,t,c):e.compressedTexImage2D(e.TEXTURE_2D,a++,t,i,r,0,c):this._context.webgl2?t===_0x34cf70?(e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texSubImage2D(e.TEXTURE_2D,0,0,0,i,r,e.RGB,e.UNSIGNED_SHORT_5_6_5,n),h/=2):t===V$O.LUMINANCE_ALPHA?e.texImage2D(e.TEXTURE_2D,0,t,i,r,0,t,e.UNSIGNED_BYTE,c):e.texSubImage2D(e.TEXTURE_2D,a++,0,0,i,r,t,this._pixelDataType,c):t===_0x34cf70?(e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGB,i,r,0,e.RGB,e.UNSIGNED_SHORT_5_6_5,n),h/=2):e.texImage2D(e.TEXTURE_2D,a++,t,i,r,0,t,this._pixelDataType,c),i=Math.max(i>>1,1),r=Math.max(r>>1,1),o+=h}while(o<n.length&&u);a>1?(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e$27.isPowerOfTwo(this._width)&&e$27.isPowerOfTwo(this._height)?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)):this._context.webgl2&&t==V$O.RGBA||e$27.isPowerOfTwo(this._width)&&e$27.isPowerOfTwo(this._height)&&t==V$O.RGBA?(this.generateMipmap(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR)):(e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this._wrapS),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this._wrapT),e.bindTexture(e.TEXTURE_2D,null),delete this._imageBuffer,this._imageBuffer=null,this.ready=!0},_0x33f6d6.prototype.generateMipmap=function(){var e=S$N.NICEST;if(!this._context.webgl2){if(this._width>1&&!e$27.isPowerOfTwo(this._width))throw new DeveloperError("width must be a power of two to call generateMipmap().");if(this._height>1&&!e$27.isPowerOfTwo(this._height))throw new DeveloperError("height must be a power of two to call generateMipmap().")}var t=this._gl,i=this._target;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i)},_0x33f6d6.prototype.updateTexture=function(e,t){this.id=e,this._size=t.length;var i=this._gl;i.bindTexture(i.TEXTURE_2D,this._texture),this.ext;var r=this._internalFormat,n=this._width,o=this._height;this._imageBuffer=t;var a=0,s=0;r===V$O.LUMINANCE_ALPHA||0===this._oriCompressType?i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1):(r==V$O.RGB||r==V$O.RGBA)&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0);var l=_0xc343c8(t,r,n,o)>1;do{var u,c=_0x5ca307(r,n,o);u=r==V$O.RGBA&&this._pixelDataType===y$U.FLOAT?new Float32Array(t.buffer,t.byteOffset+a,c):new Uint8Array(t.buffer,t.byteOffset+a,c),this._isCompressed?this._context.webgl2?i.compressedTexSubImage2D(i.TEXTURE_2D,s++,0,0,n,o,r,u):i.compressedTexImage2D(i.TEXTURE_2D,s++,r,n,o,0,u):this._context.webgl2?r===_0x34cf70?(i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texSubImage2D(i.TEXTURE_2D,0,0,0,n,o,i.RGB,i.UNSIGNED_SHORT_5_6_5,t),c/=2):i.texSubImage2D(i.TEXTURE_2D,s++,0,0,n,o,r,this._pixelDataType,u):r===_0x34cf70?(i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGB,n,o,0,i.RGB,i.UNSIGNED_SHORT_5_6_5,t),c/=2):i.texImage2D(i.TEXTURE_2D,s++,r,n,o,0,r,this._pixelDataType,u),n=Math.max(n>>1,1),o=Math.max(o>>1,1),a+=c}while(a<t.length&&l);s>1?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),e$27.isPowerOfTwo(this._width)&&e$27.isPowerOfTwo(this._height)?i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR)):(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR)),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,this._wrapS),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,this._wrapT),i.bindTexture(i.TEXTURE_2D,null),delete this._imageBuffer,this._imageBuffer=null,this.ready=!0},_0x33f6d6.prototype.init3DTexture=function(){for(var e=this._imageBuffer,t=this._gl,i=_0x22147d(e,this._width,this._height),r=i.width*i.height*4,n=new Uint8Array(r),o=0;o<r;o++)n[o]=i.data[o];t=this._gl;this._texture=t.createTexture(),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,this._texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),e.length,t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i.width,i.height,0,t.RGBA,t.UNSIGNED_BYTE,n),t.bindTexture(t.TEXTURE_2D,null),this.ready=!0},_0x33f6d6.prototype.dxtToRgb565=function(e,t,i,r){for(var n=new Uint16Array(4),o=new Uint16Array(i*r),a=0,s=0,l=0,u=0,c=0,h=0,d=0,f=0,p=0,_=i/4,m=r/4,$=0;$<m;$++)for(var g=0;g<_;g++)l=t+4*($*_+g),n[0]=e[l],n[1]=e[l+1],u=31&n[0],c=2016&n[0],h=63488&n[0],d=31&n[1],f=2016&n[1],p=63488&n[1],n[2]=5*u+3*d>>3|5*c+3*f>>3&2016|5*h+3*p>>3&63488,n[3]=5*d+3*u>>3|5*f+3*c>>3&2016|5*p+3*h>>3&63488,a=e[l+2],o[s=4*$*i+4*g]=n[3&a],o[s+1]=n[a>>2&3],o[s+2]=n[a>>4&3],o[s+3]=n[a>>6&3],o[s+=i]=n[a>>8&3],o[s+1]=n[a>>10&3],o[s+2]=n[a>>12&3],o[s+3]=n[a>>14],a=e[l+3],o[s+=i]=n[3&a],o[s+1]=n[a>>2&3],o[s+2]=n[a>>4&3],o[s+3]=n[a>>6&3],o[s+=i]=n[a>>8&3],o[s+1]=n[a>>10&3],o[s+2]=n[a>>12&3],o[s+3]=n[a>>14];return o},_0x33f6d6.prototype.destroy=function(){this._gl.deleteTexture(this._texture),this._texture=null,this.ready=!1,this.id=0,this._context.memorySize-=this._sizeInBytes},_0x33f6d6.prototype.enable=function(){this.ready&&(this._gl.activeTexture(this._gl.TEXTURE0),this._gl.bindTexture(this._target,this._texture))},_0x33f6d6.prototype.disable=function(){this.ready&&this._gl.bindTexture(this._target,null)};var _0x121609=(_0x4241e3=!0,function(e,t){var i=_0x4241e3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4241e3=!1,i}),_0x3192ac=_0x121609(void 0,(function(){return _0x3192ac.toString().search("(((.+)+)+)+$").toString().constructor(_0x3192ac).search("(((.+)+)+)+$")})),_0x4241e3;_0x3192ac();var _0x5994df={encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22},_0xbc8ee1=Object.freeze(_0x5994df),_0x327703=(_0x702dfa=!0,function(e,t){var i=_0x702dfa?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x702dfa=!1,i}),_0x4e3417=_0x327703(void 0,(function(){return _0x4e3417.toString().search("(((.+)+)+)+$").toString().constructor(_0x4e3417).search("(((.+)+)+)+$")})),_0x702dfa;_0x4e3417();var _0x472cf2={MIX:0,REPLACE:1,SILHOUETTE:2,ALWAYS_SHOW_SILHOUETTE:3,SILHOUETTE_EDGE:4,WIREFRAME:5},Ya$1=Object.freeze(_0x472cf2),_0x3f19ff=(_0xbeb61e=!0,function(e,t){var i=_0xbeb61e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xbeb61e=!1,i}),_0x3a7e91=_0x3f19ff(void 0,(function(){return _0x3a7e91.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a7e91).search("(((.+)+)+)+$")})),_0xbeb61e;_0x3a7e91();var _0x2a32b0="attribute vec4 position;\n\nuniform vec4 uRect;\n\nvoid main()\n{\n vec4 vPos = position;\n vec2 vBounds = uRect.zw - uRect.xy;\n vPos.xy = (vPos.xy - uRect.xy) / vBounds.xy * 2.0 - 1.0;\n gl_Position = vec4(vPos.xy, 0.0, 1.0);\n}",e$F={Fill:0,WireFrame:1,Fill_And_WireFrame:2},yt$3=Object.freeze(e$F),e$E=function(){this._fillForeColor=new e$1S,this._fillStyle=yt$3.Fill,this._lineColor=new e$1S,this._lineWidth=1,this._bottomAltitude=0,this._pointSize=1,this._pointColor=new e$1S,this._altitudeMode=k$_.NONE,this._emissionColor=new e$1S(1,1,1,1),this._owner=void 0,this._dirty=!1,this._image=void 0,this._imageReady=!0,this._calloutColor=e$1S.RED,this._calloutWidth=1,this._billboardMode=$r$4.SCREEN_ALIGNED};Object.defineProperties(e$E.prototype,{fillForeColor:{get:function(){return this._fillForeColor},set:function(e){o$1u.typeOf.object("fillForeColor value",e),e$1S.clone(e,this._fillForeColor)}},bottomAltitude:{get:function(){return this._bottomAltitude},set:function(e){o$1u.typeOf.number("bottomAltitude value",e),this._bottomAltitude!==e&&(this._bottomAltitude=e,this._dirty=!0)}},altitudeMode:{get:function(){return this._altitudeMode},set:function(e){o$1u.typeOf.number("altitudeMode value",e),this._altitudeMode=e}},fillStyle:{get:function(){return this._fillStyle},set:function(e){o$1u.typeOf.number("fillStyle value",e),this._fillStyle=e}},lineColor:{get:function(){return this._lineColor},set:function(e){o$1u.typeOf.object("line color",e),e$1S.clone(e,this._lineColor)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){o$1u.typeOf.number("line width",e),this._lineWidth=e}},pointSize:{get:function(){return this._pointSize},set:function(e){o$1u.typeOf.number("point size",e),this._pointSize=e}},pointColor:{get:function(){return this._pointColor},set:function(e){o$1u.typeOf.object("point color",e),e$1S.clone(e,this._pointColor)}},emissionColor:{get:function(){return this._emissionColor},set:function(e){o$1u.typeOf.object("emission color",e),e$1S.clone(e,this._emissionColor)}},image:{get:function(){return this._image},set:function(e){this._imageReady=!1,this._image=e,"string"==typeof e?this._loadImage():this._imageReady=!0}},imageReady:{get:function(){return this._imageReady}},calloutColor:{get:function(){return this._calloutColor},set:function(e){this._calloutColor!==e&&(this._calloutColor=e)}},calloutWidth:{get:function(){return this._calloutWidth},set:function(e){this._calloutWidth!==e&&(this._calloutWidth=e)}},billboardMode:{get:function(){return this._billboardMode},set:function(e){this._billboardMode!==e&&(this._billboardMode=e)}}}),e$E.prototype._loadImage=function(){var e=this._image;e=t$S.createIfNeeded(e).fetchImage();var t=this;o$1q(e,(function(e){t._image=e,t._imageReady=!0}))};var _0x5c52f7=(_0x539973=!0,function(e,t){var i=_0x539973?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x539973=!1,i}),_0x3bc6ff=_0x5c52f7(void 0,(function(){return _0x3bc6ff.toString().search("(((.+)+)+)+$").toString().constructor(_0x3bc6ff).search("(((.+)+)+)+$")})),_0x539973;_0x3bc6ff();var _0xc1bb56="attribute vec4 position;\n\nuniform vec4 uRect;\n\nvarying float fHeight;\n\nvoid main()\n{\n vec4 vPos = position;\n vec2 vBounds = uRect.zw - uRect.xy;\n vPos.xy = (vPos.xy - uRect.xy) / vBounds.xy * 2.0 - 1.0;\n gl_Position = vec4(vPos.xy, 0.5, 1.0);\n fHeight = vPos.z;\n}",_0x5808a9=(_0x55cbce=!0,function(e,t){var i=_0x55cbce?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x55cbce=!1,i}),_0x3b42de=_0x5808a9(void 0,(function(){return _0x3b42de.toString().search("(((.+)+)+)+$").toString().constructor(_0x3b42de).search("(((.+)+)+)+$")})),_0x55cbce;_0x3b42de();var _0x5e5993="#ifdef Mode_Height\nvarying float fHeight;\n#endif\n#ifdef OVERLAY\n varying vec2 vTexCoord;\n uniform sampler2D uTexture;\n#endif\n\nvoid main()\n{\n gl_FragColor = vec4(1.0);\n#ifdef Mode_Height\n #ifdef UseFloatTexture\n gl_FragColor = vec4(fHeight, 0.0, 0.0, 1.0);\n #else\n gl_FragColor = czm_packValue(fHeight);\n #endif\n#endif\n#ifdef OVERLAY\n gl_FragColor = texture2D(uTexture,vTexCoord);\n#endif\n}",e$D={Triangle:0,Quad:1,Sketch:2,EffectOutline:3},_0x255091=Object.freeze(e$D),_0x42269d=(_0x2de671=!0,function(e,t){var i=_0x2de671?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2de671=!1,i}),_0x1493e5=_0x42269d(void 0,(function(){return _0x1493e5.toString().search("(((.+)+)+)+$").toString().constructor(_0x1493e5).search("(((.+)+)+)+$")})),_0x2de671;_0x1493e5();var _0x3d8687={OSGBFile:0,OSGBCacheFile:1,ClampGroundPolygon:2,ClampObjectPolygon:3,ClampGroundLine:4,ClampObjectLine:5,IconPoint:6,Text:7,PointCloudFile:8,ExtendRegion3D:9,ExtendClampPolygonCache:10,PolylineEffect:11,RegionEffect:12,ClampGroundAndObjectLineCache:13,ClampGroundRealtimeRasterCache:14},f$r=Object.freeze(_0x3d8687),_0x45151f=(_0x40bcf3=!0,function(e,t){var i=_0x40bcf3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x40bcf3=!1,i}),_0x269714=_0x45151f(void 0,(function(){return _0x269714.toString().search("(((.+)+)+)+$").toString().constructor(_0x269714).search("(((.+)+)+)+$")})),_0x40bcf3;_0x269714();var _0x26f4d7={UNLOAD:0,LOADING:1,LOADED:2,VOLLOADED:3,PARSING:4,PARSED:5,TRANSFORMING:6,TRANSFORMED:7,LOST:8,LOADVOL:9,FAILED:10,VOLFAILED:11},I$F=Object.freeze(_0x26f4d7),E$t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7,RENDERING:8,RENDERED:9},_t$6=Object.freeze(E$t);function n$q(e,t,i,r,n){if(this.imageryLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r){var o=t/2|0,a=i/2|0,s=r-1;this.parent=e.getImageryFromCache(o,a,s)}(this.state=_t$6.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,this.isMvtTexture=!1,this.cancelCount=0,!e$28(n)&&e.imageryProvider.ready)&&(n=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,r));this.rectangle=n,this.discard=!1}function A$z(e,t,i,r){var n=t.getGeometry().getFlatCoordinates(),o=n[0],a=n[1],s=i[0]*o+i[2]*a+i[4],l=i[1]*o+i[3]*a+i[5],u=s/e._canvasWidth,c=l/e._canvasWidth,h=r.west+r.width*u,d=r.south+r.height*(1-c);return t$X.fromRadians(h,d,100)}n$q.createPlaceholder=function(e){var t=new n$q(e,0,0,0);return t.addReference(),t.state=_t$6.PLACEHOLDER,t},n$q.prototype.addReference=function(){++this.referenceCount},n$q.prototype.releaseReference=function(){if(--this.referenceCount,0===this.referenceCount){if(this.imageryLayer.removeImageryFromCache(this),e$28(this.parent)&&this.parent.releaseReference(),e$28(this.image)&&e$28(this.image.destroy)&&this.image.destroy(),e$28(this.idTexture)&&(this.imageryLayer.imageryProvider.removeTile(this.x,this.y,this.level),this.idTexture.destroy()),this.release(),e$28(this.texture)&&this.texture.destroy(),e$28(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),e$28(this.labelParent)){this.imageryLayer.kmlLayer.entities.remove(this.labelParent);for(var e=0,t=this.labelParent._children.length;e<t;e++)this.imageryLayer.kmlLayer.entities.remove(this.labelParent._children[e]);this.labelParent=void 0}if(e$28(this.billboardParent)){this.imageryLayer.kmlLayer.entities.remove(this.billboardParent);for(e=0,t=this.billboardParent._children.length;e<t;e++)this.imageryLayer.kmlLayer.entities.remove(this.billboardParent._children[e]);this.billboardParent=void 0}return i$Z(this),0}return this.referenceCount},new o$1k,new t$X;var b$y=new o$1b;n$q.prototype.createLabel=function(e,t){for(var i=this.rectangle,r=this.transform,n=(t.length,0),o=t.length;n<o;n++){var a=t[n],s=a.feature,l=a.style,u=l.getText(),c=l.textSize,h=u.getText();if(""!==h){var d,f,p,_,m=u.getFont(m),$=c+"px "+m,g=u.getFill(),v=u.getStroke();e$28(g)&&(d=g.getColor(),(d=e$1S.unpack(d)).alpha=1),e$28(v)&&(f=v.getColor(),f=e$1S.unpack(f),p=v.getWidth(),_=R$t.FILL_AND_OUTLINE);var y=this.labelParent;e$28(y)||(this.labelParent=y=new h$F,this.labelParent.show=!1,e.kmlLayer.entities.add(y)),b$y.near=15e3,b$y.nearValue=2,b$y.far=1e7,b$y.farValue=0,e.kmlLayer.entities.add({parent:y,position:A$z(e.imageryProvider,s,r,i),label:{text:h,font:$,verticalOrigin:S$L.TOP,horizontalOrigin:j$13.LEFT,fillColor:d,outlineColor:f,outlineWidth:p,style:_,pixelOffset:new o$1k(0,2*-c),heightReference:k$_.CLAMP_TO_GROUND,scaleByDistance:b$y}})}}},n$q.prototype.createBillboard=function(e,t){for(var i=this.rectangle,r=this.transform,n=(t.length,0),o=t.length;n<o;n++){var a,s=t[n],l=s.feature,u=s.style.layout;if(e$28(u)&&e$28(u["icon-image"])){var c=u["icon-image"],h=u$Y(u["icon-size"],1);if(e$28(e._imageCanvas[c]))a=e._imageCanvas[c];else{var d=e.imageryProvider._subSpriteImage[c];if(!e$28(d))continue;(a=document.createElement("canvas")).width=d.width,a.height=d.height,a.getContext("2d").putImageData(d,0,0),e._imageCanvas[c]=a}var f=this.billboardParent;e$28(f)||(this.billboardParent=f=new h$F,e.kmlLayer.entities.add(f)),e.kmlLayer.entities.add({parent:f,position:A$z(e.imageryProvider,l,r,i),billboard:{image:a,scale:h,heightReference:k$_.CLAMP_TO_GROUND,pixelOffset:new o$1k(0,-a.height),scaleByDistance:new o$1b(1500,1.5,8e6,0)}})}}},n$q.prototype.processStateMachine=function(e,t,i){this.state===_t$6.UNLOADED&&!i&&!this.imageryLayer._pausing&&(this.state=_t$6.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===_t$6.TRANSITIONING&&e$28(this.request)&&e$28(this.beginRequestTime)&&performance.now()-this.beginRequestTime>r$1b.TIMEOUT&&this.request.cancel(),this.state===_t$6.RECEIVED&&(this.state=_t$6.TRANSITIONING,this.image,this.imageryLayer._createTexture(e.context,this,e));var r=this.state===_t$6.READY&&t&&!this.texture;(this.state===_t$6.TEXTURE_LOADED||r)&&(this.state=_t$6.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},n$q.prototype.isDestroyed=function(){return!1},n$q.prototype.showLabelAndIcon=function(e){},n$q.prototype.setVisible=function(e){},n$q.prototype.release=function(){},n$q.prototype.onAlphaChanged=function(){};var _0x471406=(_0x5295e4=!0,function(e,t){var i=_0x5295e4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5295e4=!1,i}),_0x142796=_0x471406(void 0,(function(){return _0x142796.toString().search("(((.+)+)+)+$").toString().constructor(_0x142796).search("(((.+)+)+)+$")})),_0x5295e4;function _0x4325ec(){this.text={},this.icon={}}function _0x824f2(e){this._provider=e,this._billboardsByLayers={},this._symbolInstancesInfoByLayers={}}_0x142796(),_0x4325ec.prototype.init=function(e,t,i,r){for(var n={},o=0;o<t.length;o++){n[t[o].index]=t[o]}for(o=0;o<e.length;o++){var a=e.get(o),s=a.rightJustifiedTextSymbolIndex;const t=n[a.featureIndex];var l;l=r?a.key+" "+i:t.icon.name+" "+t.id+" "+i,s>=0&&(this.text[s]={key:l,feature:t}),(s=a.centerJustifiedTextSymbolIndex)>=0&&(this.text[s]={key:l,feature:t}),(s=a.leftJustifiedTextSymbolIndex)>=0&&(this.text[s]={key:l,feature:t}),(s=a.verticalPlacedTextSymbolIndex)>=0&&(this.text[s]={key:l,feature:t}),(s=a.placedIconSymbolIndex)>=0&&(this.icon[s]={key:l,feature:t}),(s=a.verticalPlacedIconSymbolIndex)>=0&&(this.icon[s]={key:l,feature:t})}};var _0xd9cac7=new t$X,_0x2e7b6d=new e$1S,_0x7f865e=new e$1S,_0x26dd1e=new e$1S,_0x479224=new o$1k,_0x5ebc77=new o$1k,_0x4f7169=new o$1k,_0x26bb0e=new o$1k,_0x1a9859=new o$1k,_0x282a5b=new o$1k,_0x4a92ab=new o$1k,_0x5b85a2=new o$1k,_0x1bceaf=new o$1k,_0x3336fe=new o$1k;function _0x57b1a0(e,t,i,r){var n=Math.floor(.5*r.x);return t||i?t&&!i?n/128:e.uSize:mix(n,r.y,e?e.uSizeT:0)/128}function _0x1c1695(e,t,i,r){const n=e.layoutVertexArray.bytesPerElement/2,o=t+4*i+r;return{tileX:e.layoutVertexArray.int16[o*n],tileY:e.layoutVertexArray.int16[o*n+1],offsetX:e.layoutVertexArray.int16[o*n+2]/32,offsetY:e.layoutVertexArray.int16[o*n+3]/32,texCoordX:e.layoutVertexArray.uint16[o*n+4],texCoordY:e.layoutVertexArray.uint16[o*n+5],sizeX:e.layoutVertexArray.uint16[o*n+6],sizeY:e.layoutVertexArray.uint16[o*n+7],pixeloffsetX:e.layoutVertexArray.int16[o*n+8],pixeloffsetY:e.layoutVertexArray.int16[o*n+9]}}function _0x5588b3(e){var t=j$13.LEFT,i=S$L.CENTER;return"center"===e?(t=j$13.CENTER,i=S$L.CENTER):"left"===e?(t=j$13.LEFT,i=S$L.CENTER):"right"===e?(t=j$13.RIGHT,i=S$L.CENTER):"top"===e||"bottom"===e?(t=j$13.CENTER,i=S$L.TOP):"top-left"==e?(t=j$13.LEFT,i=S$L.TOP):"top-right"==e?(t=j$13.RIGHT,i=S$L.TOP):"bottom-left"==e?(t=j$13.LEFT,i=S$L.BOTTOM):"bottom-right"==e&&(t=j$13.RIGHT,i=S$L.BOTTOM),{horizontalOrigin:t,verticalOrigin:i}}function _0x56afb4(e,t,i){var r=i.rectangle;return{longtitude:e*r.width/_0xea783f+r.west,lattitude:t*r.height/_0xea783f+r.south}}_0x824f2.prototype.drawLayerSymbols=function(e,t,i){var r=e.getBucket(t);if(!r)return;var n,o,a=i?r.text:r.icon;if(!a||!a.segments.get().length)return;n=this._billboardsByLayers[t.bucketName]?this._billboardsByLayers[t.bucketName]:this._billboardsByLayers[t.bucketName]={},this._symbolInstancesInfoByLayers[t.bucketName]?o=this._symbolInstancesInfoByLayers[t.bucketName]:(o=this._symbolInstancesInfoByLayers[t.bucketName]=new _0x4325ec).init(r.symbolInstances,r.features,e.level,i),i?(this._textCollection=this._textCollection||this._provider._billboardCollectionPool.getOne(),this._textCollection.destroyTextureAtlas=!1,this._textCollection._sdf=!0,this._textCollection.textureAtlas=e.cesiumGlyphAtlas):(this._iconCollection=this._iconCollection||this._provider._billboardCollectionPool.getOne(),this._iconCollection.destroyTextureAtlas=!1,this._iconCollection._sdf=!1,this._iconCollection.textureAtlas=e.cesiumImageAtlas);var s=t.paint,l=t.layout,u=s.get("text-color").value.value;u=e$28(u)?u:s.get("text-color").value.evaluate(),_0x2e7b6d.red=u.r,_0x2e7b6d.green=u.g,_0x2e7b6d.blue=u.b;var c=s.get("text-halo-color").value.value,h=s.get("text-halo-width").value.value;s.get("text-halo-blur").value.value,s.get("text-show-background").value.value;var d=i?s.get("text-translate"):s.get("icon-translate"),f=i?s.get("text-translate-anchor"):s.get("icon-translate-anchor");_0x7f865e.red=c.r,_0x7f865e.green=c.g,_0x7f865e.blue=c.b,_0x7f865e.alpha=c.a,_0x5588b3(l.get("text-anchor").value.value);(i||r.sdfIcons)&&t.paint.get(i?"text-halo-width":"icon-halo-width").constantOr(1);var p,_,m=i?r.textSizeData:r.iconSizeData,$=_0x20dc96(m,e.level),g=m.kind,v="constant"===g||"source"===g,y="constant"===g||"camera"===g,x=void 0;i?(p=this._textCollection,_=e.cesiumGlyphAtlas,x=e.glyphAtlasTexture.size,r.iconsInText&&(e.imageAtlasTexture.size,e.imageAtlasTexture)):(p=this._iconCollection,_=e.cesiumImageAtlas,x=e.imageAtlasTexture.size);for(var b=a.placedSymbolArray.length,w=0;w<b;w++){var C,T=a.placedSymbolArray.get(w),S=i?o.text[w]:o.icon[w],E=S.feature,A=S.key,P=E.id;!n[A]&&(n[A]=[]),C=n[A];for(var I=T.numGlyphs,M=T.vertexStartIndex,O=0;O<I;O++){var D,R,L=_0x1c1695(a,M,O,0);_0x4f7169.x=L.texCoordX/x[0],_0x4f7169.y=L.texCoordY/x[1],_0x4a92ab.x=L.offsetX,_0x4a92ab.y=L.offsetY,_0x3336fe.x=L.sizeX,_0x3336fe.y=L.sizeY,D=_0x56afb4(L.tileX,L.tileY,e),R=t$X.fromRadians(D.longtitude,D.lattitude,0);L=_0x1c1695(a,M,O,1);_0x26bb0e.x=L.texCoordX/x[0],_0x26bb0e.y=L.texCoordY/x[1],_0x5b85a2.x=L.offsetX,_0x5b85a2.y=L.offsetY;L=_0x1c1695(a,M,O,2);_0x479224.x=L.texCoordX/x[0],_0x479224.y=L.texCoordY/x[1],_0x1a9859.x=L.offsetX,_0x1a9859.y=L.offsetY;L=_0x1c1695(a,M,O,3);_0x5ebc77.x=L.texCoordX/x[0],_0x5ebc77.y=L.texCoordY/x[1],_0x282a5b.x=L.offsetX,_0x282a5b.y=L.offsetY;var B=_0x26bb0e.y-_0x5ebc77.y,N=_0x5ebc77.x-_0x479224.x;_.addTextureCoordBounds(new f$10(_0x479224.x,_0x479224.y,N,B));var F,z=_0x57b1a0($,v,y,_0x3336fe),k=i?z/24:z,V=_0x282a5b.x-_0x1a9859.x,U=_0x1a9859.y-_0x4a92ab.y;e$28(E)&&e$28(E.properties)&&e$28(E.properties.TEXT_COLOR)&&(F=new e$1S.fromCssColorString(E.properties.TEXT_COLOR));var X=e.mvtProvider.innerLayer.alpha;i?(e$1S.clone(u$Y(F,_0x2e7b6d),_0x26dd1e),_0x26dd1e.alpha*=X):e$1S.unpack([1,1,1,X],0,_0x26dd1e),V*=k,U*=k,p._depthTestEnable&&(_0xd9cac7.y=U/2),"map"===f&&(d=[0,0]),_0x1bceaf.x=_0x1a9859.x*k+.5*V+d[0],_0x1bceaf.y=_0x1a9859.y*k-.5*U+d[1];var H=p.add({id:P,scale:1,position:R,heightReference:p._depthTestEnable?k$_.RELATIVE_TO_GROUND:k$_.CLAMP_TO_GROUND,eyeOffset:_0xd9cac7,width:V,height:U,pixelOffset:_0x1bceaf,verticalOrigin:S$L.CENTER,horizontalOrigin:j$13.CENTER,isMVT:!0,color:_0x26dd1e,outlineColor:_0x7f865e,outlineWidth:h,mvtLayerID:this._layerID,mapName:this._provider._owner._name,mvtProperties:E.properties,show:!0});H._imageIndex=_.numberOfImages-1,H._billboardsBySymbol=C,C.push(H)}}},_0x824f2.prototype._setNeedReRender=function(e){if(e){for(var t in this._billboardsByLayers){var i=this._billboardsByLayers[t];for(var r in i)for(var n=i[r],o=0;o<n.length;o++){var a=n[o];a._billboardCollection.remove(a)}}this._billboardsByLayers={}}},_0x824f2.prototype.release=function(){this._iconCollection&&!this._iconCollection.isDestroyed()&&(this._iconCollection.removeAll(),this._provider._billboardCollectionPool.pushBack(this._iconCollection)),this._textCollection&&!this._textCollection.isDestroyed()&&(this._textCollection.removeAll(),this._provider._billboardCollectionPool.pushBack(this._textCollection))};var _0x4cd7f2=(_0x498182=!0,function(e,t){var i=_0x498182?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x498182=!1,i}),_0x44f45b=_0x4cd7f2(void 0,(function(){return _0x44f45b.toString().search("(((.+)+)+)+$").toString().constructor(_0x44f45b).search("(((.+)+)+)+$")})),_0x498182;function _0x11de52(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}_0x44f45b(),_0x11de52.prototype.encode=function(e){return this._stringToNumber[e]},_0x11de52.prototype.decode=function(e){return this._numberToString[e]};var _0x4bcf11=(_0x301ec3=!0,function(e,t){var i=_0x301ec3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x301ec3=!1,i}),_0x34385d=_0x4bcf11(void 0,(function(){return _0x34385d.toString().search("(((.+)+)+)+$").toString().constructor(_0x34385d).search("(((.+)+)+)+$")})),_0x301ec3;function _0x3ffc12(e,t,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=n,e.readFields(_0x5b6c83,this,t)}function _0x5b6c83(e,t,i){1==e?t.id=i.readVarint():2==e?_0x53a0f8(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function _0x53a0f8(e,t){for(var i=e.readVarint()+e.pos;e.pos<i;){var r=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[r]=n}}function _0xd51c55(e){var t=e.length;if(t<=1)return[e];for(var i,r,n=[],o=0;o<t;o++){var a=_0x5a69e3(e[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&n.push(i),i=[e[o]]):i.push(e[o]))}return i&&n.push(i),n}function _0x5a69e3(e){for(var t,i,r=0,n=0,o=e.length,a=o-1;n<o;a=n++)t=e[n],r+=((i=e[a]).x-t.x)*(t.y+i.y);return r}_0x34385d(),_0x3ffc12.types=["Unknown","Point","LineString","Polygon"],_0x3ffc12.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,r=1,n=0,o=0,a=0,s=[];e.pos<i;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}n--,1===r||2===r?(o+=e.readSVarint(),a+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new _0x36c32e(o,a))):7===r?t&&t.push(t[0].clone()):console.log("VectorTileFeature loadGeometry unknown command "+r)}return t&&s.push(t),s},_0x3ffc12.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(r<=0){var c=e.readVarint();i=7&c,r=c>>3}if(r--,1===i||2===i)(n+=e.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=e.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,u]},_0x3ffc12.prototype.toGeoJSON=function(e,t,i){var r,n,o=this.extent*Math.pow(2,i),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=_0x3ffc12.types[this.type];function c(e){for(var t=0;t<e.length;t++){var i=e[t],r=180-360*(i.y+s)/o;e[t]=[360*(i.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<l.length;r++)h[r]=l[r][0];c(l=h);break;case 2:for(r=0;r<l.length;r++)c(l[r]);break;case 3:for(l=_0xd51c55(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)c(l[r][n])}1===l.length?l=l[0]:u="Multi"+u;var d={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var _0xa5a936=(_0x38304c=!0,function(e,t){var i=_0x38304c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x38304c=!1,i}),_0x4876d9=_0xa5a936(void 0,(function(){return _0x4876d9.toString().search("(((.+)+)+)+$").toString().constructor(_0x4876d9).search("(((.+)+)+)+$")})),_0x38304c;function _0x5ca843(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(_0x27114f,this,t),this.length=this._features.length}function _0x27114f(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(_0x3e4bb5(i))}function _0x3e4bb5(e){for(var t=null,i=e.readVarint()+e.pos;e.pos<i;){var r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}_0x4876d9(),_0x5ca843.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new _0x3ffc12(this._pbf,t,this.extent,this._keys,this._values)};var _0x5df414=(_0x5a77fc=!0,function(e,t){var i=_0x5a77fc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5a77fc=!1,i}),_0x182bb9=_0x5df414(void 0,(function(){return _0x182bb9.toString().search("(((.+)+)+)+$").toString().constructor(_0x182bb9).search("(((.+)+)+)+$")})),_0x5a77fc;function _0x4526e9(e,t){this.layers=e.readFields(_0x571362,{},t)}function _0x571362(e,t,i){if(3===e){var r=new _0x5ca843(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}_0x182bb9();var _0x8023f5=(_0x1b9f76=!0,function(e,t){var i=_0x1b9f76?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1b9f76=!1,i}),_0x859c4a=_0x8023f5(void 0,(function(){return _0x859c4a.toString().search("(((.+)+)+)+$").toString().constructor(_0x859c4a).search("(((.+)+)+)+$")})),_0x1b9f76;_0x859c4a();var _0x492918=3;function _0x2083d9(e,t,i){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],i=n[2],this.d=t+2*i;for(var o=0;o<this.d*this.d;o++){var a=n[_0x492918+o],s=n[_0x492918+o+1];r.push(a===s?null:n.subarray(a,s))}var l=n[_0x492918+r.length],u=n[_0x492918+r.length+1];this.keys=n.subarray(l,u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=t+2*i;for(var c=0;c<this.d*this.d;c++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=i,this.scale=t/e,this.uid=0;var h=i/t*e;this.min=-h,this.max=e+h}_0x2083d9.prototype.insert=function(e,t,i,r,n){this._forEachCell(t,i,r,n,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},_0x2083d9.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},_0x2083d9.prototype._insertCell=function(e,t,i,r,n,o){this.cells[n].push(o)},_0x2083d9.prototype.query=function(e,t,i,r,n){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,i,r,this._queryCell,s,{},n),s},_0x2083d9.prototype._queryCell=function(e,t,i,r,n,o,a,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===a[d]){var f=4*d;(s?s(c[f+0],c[f+1],c[f+2],c[f+3]):e<=c[f+2]&&t<=c[f+3]&&i>=c[f+0]&&r>=c[f+1])?(a[d]=!0,o.push(u[d])):a[d]=!1}}},_0x2083d9.prototype._forEachCell=function(e,t,i,r,n,o,a,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(i),h=this._convertToCellCoord(r),d=l;d<=c;d++)for(var f=u;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&n.call(this,e,t,i,r,p,o,a,s))return}},_0x2083d9.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},_0x2083d9.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},_0x2083d9.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=_0x492918+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var n=new Int32Array(t+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=t,a=0;a<e.length;a++){var s=e[a];n[_0x492918+a]=o,n.set(s,o),o+=s.length}return n[_0x492918+e.length]=o,n.set(this.keys,o),o+=this.keys.length,n[_0x492918+e.length+1]=o,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer},_0x36ace8.register("GridIndex",_0x2083d9,{omit:["layers","patternFeatures"]});var _0x4d787d=(_0x4124df=!0,function(e,t){var i=_0x4124df?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4124df=!1,i}),_0x3e76bd=_0x4d787d(void 0,(function(){return _0x3e76bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x3e76bd).search("(((.+)+)+)+$")})),_0x4124df;_0x3e76bd();var _0x51dbf7=function(e,t,i){this.x=e.x,this.y=e.y,this.z=e.z,this.grid=t||new _0x2083d9(_0xea783f,16,0),this.featureIndexArray=i||new _0x53f40a};function _0x31116b(e){for(var t=1/0,i=1/0,r=-1/0,n=-1/0,o=0,a=e;o<a.length;o+=1){var s=a[o];t=Math.min(t,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y)}return{minX:t,minY:i,maxX:r,maxY:n}}function _0x1c338d(e,t){return t-e}function _0x5c2f11(e,t,i){if(e$28(i)&&i.realtime&&e$28(i.zoom)){var r=i.zoom-e,n=_0xea783f/(t*Math.pow(2,r));return n*=t/512}return _0xea783f/t}function n$p(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}_0x51dbf7.prototype.insert=function(e,t,i,r,n,o,a){var s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);var l=this.grid;a=a||0;for(var u=0;u<t.length;u++){for(var c=t[u],h=[1/0,1/0,-1/0,-1/0],d=0;d<c.length;d++){var f=c[d];h[0]=Math.min(h[0],f.x),h[1]=Math.min(h[1],f.y),h[2]=Math.max(h[2],f.x),h[3]=Math.max(h[3],f.y)}h[0]<_0xea783f&&h[1]<_0xea783f&&h[2]>=0&&h[3]>=0&&l.insert(s,h[0]-a,h[1]-a,h[2]+a,h[3]+a)}},_0x51dbf7.prototype.loadVTLayers=function(){return!this.vtLayers&&(this.vtLayers=new _0x4526e9(new h$Q(this.rawTileData)).layers,this.sourceLayerCoder=new _0x11de52(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},_0x51dbf7.prototype.query=function(e,t,i){var r=this;this.loadVTLayers();var n=e.params||{},o=_0x5c2f11(this.z,e.tileSize,n),a=_0x461a14.createFilter(n.filter),s=e.queryGeometry,l=5,u=_0x31116b(s),c=[];e$28(n.selectTolerance)&&(l+=o*n.selectTolerance),(c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l)).sort(_0x1c338d);for(var h,d={},f=function(i){var l=c[i];if(l!==h){h=l;var u=r.featureIndexArray.get(l),f=null;r.loadMatchingFeature(d,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,a,n.layers,t,(function(t,i){!f&&(f=_0x3e7ee3(t));return i.queryIntersectsFeature(s,t,{},f,r.z,e.transform,o,e.pixelPosMatrix,e.adjustScale)}))}},p=0;p<c.length;p++)f(p);return d},_0x51dbf7.prototype.loadMatchingFeature=function(e,t,i,r,n,o,a,s){if(e$28(t)&&e$28(i)&&e$28(r)){var l=this.bucketLayerIDs[t];if(!o||arraysIntersect(o,l)){var u=this.sourceLayerCoder.decode(i),c=this.vtLayers[u].feature(r);if(n(new _0x105812(this.z),c))for(var h=0;h<l.length;h++){var d=l[h];if(!(o&&o.indexOf(d)<0)){var f=a[d];if(f){var p=!s||s(c,f);if(p){c.layer=f.serialize();var _=e[d];void 0===_&&(_=e[d]=[]),_.push({featureIndex:r,feature:c,intersectionZ:p})}}}}}}},_0x51dbf7.prototype.lookupSymbolFeatures=function(e,t,i,r,n,o){var a={};this.loadVTLayers();for(var s=createFilter(r),l=0,u=e;l<u.length;l+=1){var c=u[l];this.loadMatchingFeature(a,t,i,c,s,n,o)}return a},_0x51dbf7.prototype.hasLayer=function(e){for(var t=0,i=this.bucketLayerIDs;t<i.length;t+=1)for(var r=0,n=i[t];r<n.length;r+=1){if(e===n[r])return!0}return!1},_0x36ace8.register("FeatureIndex",_0x51dbf7,{omit:["rawTileData","sourceLayerCoder","vtLayers"]});var _0x1d53d7=!1,_0x364a72=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i,r,n,o){this.isMVT=!0,this.mvtProvider=t.imageryProvider,this.tileSize=this.mvtProvider._canvasWidth,this._painter=this.mvtProvider._painter,this._MVTStyle=this.mvtProvider._MVTStyle,this.dispatcher=this._MVTStyle.dispatcher,this._MVTLabel=new _0x824f2(this.mvtProvider),this.highLighting=!1,this._visible=!1,this.working=!1,this.repaintWorking=!1,this.layersToUpdate=[],this.removedIds=[],this.imageryNeedToRender={},e.call(this,t,i,r,n,o),this._isToReRender=!1,this.frameState=null,this.realtime=this.mvtProvider.realtime,this.zoomLevel=-1,this.lastCameraZoomLevel=-1,this._passState=new n$p,this._passState.viewport=new f$10,this.hasRawData=!1,this.uid=uniqueId()}function o(e){var t=e.mvtProvider._maxImageCacheLevel-e.level,i=0,r=!1,n=e.imageryLayer._detailLevelOffset;if(t<n&&(r=!0,i=n-t),!e.hasRawData||r){var o=function(e,t){var i=e.parent,r=1,n=e.hasRawData;t>0&&(n=!1);var o=null;for(;!n&&e$28(i);)r>=t&&((n=i.hasRawData)&&(o=i)),i=i.parent,r++;return o}(e,i);return!e$28(o)&&e.hasRawData?e:o}return e}function a(e){return{param:{featureIndex:e.featureIndex,tileID:{x:e.requestX,y:e.requestY,z:e.requestZ},indexData:e.indexData,pickId:e.pickId,webgpu:_0x1d53d7,type:"vector",source:e.mvtProvider.name,uid:e.uid,request:e.mvtProvider._requestManager.transformRequest(e.requestUrl,_0x3c09b7.Tile)},transferableObjects:[]}}function s(e,t,i){e.setBuckets(t.buckets),e.imageAtlas=t.imageAtlas,e.featureIndex=t.featureIndex,e$28(t.featureIndex)&&(e.featureIndex.rawTileData=t.rawTileData),e.glyphAtlasImage=t.glyphAtlasImage,i?e.repaintWorking=!1:e.working=!1}function l(e,t){var i=m(e.rectangle,t.rectangle),r=e.level,n=1;if(t.realtime){var o=t.frameState.camera;e$28(o.zoomLevel)&&o.zoomLevel!=1/0&&(r=o.zoomLevel,t.zoomLevel=r)}else n=Math.pow(2,t.level-e.level);e.targetTileSize=e.tileSize*n,u(e,t,i,r),t.state!=_t$6.READY&&(t.state=_t$6.RENDERED),c(t)}function u(e,t,i,r){var n=e._painter;for(var o in e.buckets){var a=e.buckets[o];if(a instanceof _0x132061)if(!("point"!==e._MVTStyle._layers[o].layout.get("symbol-placement")))continue;a.upload(n.cesiumContext)}e$28(e.imageAtlas)&&(e.imageAtlasTexture=new _0x3651b1(n.context,n.cesiumContext,e.imageAtlas.image,V$O.RGBA),e.cesiumImageAtlas=new w$q({pixelFormat:V$O.RGBA,context:n.cesiumContext}),e.cesiumImageAtlas._texture=e.imageAtlasTexture.cesiumTexture),e.glyphAtlasImage&&(e.glyphAtlasTexture=new _0x3651b1(n.context,n.cesiumContext,e.glyphAtlasImage,n.cesiumContext.webgpu?V$O.RED:V$O.ALPHA),e.glyphAtlasImage=null,e.cesiumGlyphAtlas=new w$q({pixelFormat:V$O.ALPHA,context:n.cesiumContext}),e.cesiumGlyphAtlas._texture=e.glyphAtlasTexture.cesiumTexture),e.viewProjection=i;var s=e$28(e.context)?e.context:t.context,l=t.level,u=t.texture||t.textureWebMercator;t._passState.context=s,t._passState.viewport.x=0,t._passState.viewport.y=0,t._passState.viewport.width=u.width,t._passState.viewport.height=u.height;var c=u.width+"_"+u.height;!e$28(e.mvtProvider._renderTextureList[c])&&(e.mvtProvider._renderTextureList[c]=new L$17({context:s,width:u.width,height:u.height,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8}));var h=e.mvtProvider._renderTextureList[c];!t._framebuffer&&(t._framebuffer=new a$z({context:s,colorTextures:[u],depthStencilTexture:h})),t._passState.framebuffer=t._framebuffer;try{n.renderOneTile(e._MVTStyle,e,{targetTileLevel:l,finestRenderLevel:e.mvtProvider.maximumLevel,zoom:r,lineAntialiasing:e.mvtProvider.lineAntialiasing?1:0,passState:t._passState})}catch(e){console.log(e)}s.webgpu&&s.engine.flushFramebuffer()}function c(e){e.highLighting=!1,e.imageryLayer._finalizeReprojectTexture(e.context,e.texture||e.textureWebMercator)}r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.processStateMachine=function(e,t,i){this.frameState=e,this.context=e.context,_0x1d53d7=e.context.webgpu,this.state===_t$6.UNLOADED&&!i&&!this.imageryLayer._pausing&&(this.state=_t$6.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===_t$6.RECEIVED&&(this.state=_t$6.TRANSITIONING,this.indexData=this.image.indexData,this.image,this.imageryLayer._createTexture(e.context,this,e)),this.state===_t$6.TEXTURE_LOADED&&function(e){var t=o(e);if(!e$28(t))return e.highLighting=!1,void console.log("MVTImagery has no rawData.");var i=$(e.x,e.y,e.level);if(t.imageryNeedToRender[i]=e,e$28(t.buckets)&&!t.repaintWorking&&!t._isToReRender)return void l(t,e);if(!t.working){if(t.repaintWorking||t._isToReRender)return;var r=a(t);function n(e,i){delete t.request,e?(console.log("loadTile tile error in worker"),t.state=_t$6.FAILED):s(t,i,!1)}t.working=!0,!t.actor&&(t.actor=t.dispatcher.getActor()),t.request=t.actor.send("loadTile",r.param,n.bind(this))}}(this);var r=this.state===_t$6.READY&&t&&!this.texture;(this.state===_t$6.RENDERED||r)&&(this.state=_t$6.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},n.prototype.addRepaintTask=function(e,t,i){var r={};this.layersToUpdate.map((function(e){r[e.id]=!0}));var n=this;e.map((function(e){!e$28(r[e.id])&&n.layersToUpdate.push(e)})),this.removedIds=t,this.highLighting=i},n.prototype.clearRepaintTask=function(){this.layersToUpdate=[],this.removedIds=[]},n.prototype.update=function(){this.repaint()},n.prototype.setBuckets=function(e){var t=this.buckets;if(e$28(t))for(var i in e){if(e$28(t[i]))t[i].destroy(),t[i]=e[i];else t[i]=e[i]}else this.buckets=e},n.prototype.repaint=function(){this.state===_t$6.READY&&(this._isToReRender&&function(e){var t=o(e);if(!e$28(t))return;var i=$(e.x,e.y,e.level);if(e._isToReRender&&!e.working&&(l(t,e),e._setNeedReRender(!1),e$28(t.imageryNeedToRender[i])&&delete t.imageryNeedToRender[i],0==Object.getOwnPropertyNames(t.imageryNeedToRender).length&&e$28(t.buckets)))for(var r in t.buckets){t.buckets[r].clear()}}(this),(this.layersToUpdate.length>0||this.removedIds.length>0)&&function(e){var t=o(e);if(!e$28(t))return e.clearRepaintTask(),void(e.highLighting=!1);var i=$(e.x,e.y,e.level),r=e.layersToUpdate;if(t.imageryNeedToRender[i]=e,t.repaintWorking){if(!t.IsPickIdSameWithCurrentPickID())return;e.clearRepaintTask()}else{if(t.working)return;r.length>0&&r[0].id.indexOf("_highlight")>-1?t.pickId=r[0].id+r[0].filter[2]:t.pickId=void 0;var n=a(t);e.clearRepaintTask(),t.repaintWorking=!0,!t.actor&&(t.actor=t.dispatcher.getActor());var l=void 0;function u(i,r){if(delete t.request,i)console.log("reloadTile tile error in worker");else{if(s(t,r,!0),e$28(e.featureIndex)&&(e.featureIndex.rawTileData=l),!t.IsPickIdSameWithCurrentPickID())return;if(!t.isDestroyed())for(var n in t.imageryNeedToRender)!t.imageryNeedToRender[n].isDestroyed()&&t.imageryNeedToRender[n]._setNeedReRender(!0)}}e$28(t.featureIndex)&&(l=t.featureIndex.rawTileData),t.request=t.actor.send("reloadTile",n.param,u.bind(this))}}(this))},n.prototype._setNeedReRender=function(e){this._isToReRender=e,this._MVTLabel._setNeedReRender(e)},n.prototype.realtimeRender=function(){if(this.state===_t$6.READY&&this.realtime&&function(e){var t=e.frameState.camera;if(!e$28(t.zoomLevel)||t.zoomLevel==1/0)return!1;var i=!1;e.lastCameraZoomLevel!=t.zoomLevel&&(i=!0),e.lastCameraZoomLevel=t.zoomLevel;var r=Math.abs(e.zoomLevel-t.zoomLevel);return!(r<.2&&i)&&0!=r}(this)){var e=o(this);e$28(e)&&e$28(e.buckets)&&!this.working&&function(e,t){var i=t.frameState.camera,r=void 0;if(!e$28(i.zoomLevel))return;r=i.zoomLevel;var n=m(e.rectangle,t.rectangle);e.mvtProvider._context,e.targetTileSize=e.tileSize,u(e,t,n,r),c(t),t.zoomLevel=r}(e,this)}},n.prototype.IsPickIdSameWithCurrentPickID=function(){return!e$28(this.mvtProvider._currentPickID)||!e$28(this.pickId)||this.mvtProvider._currentPickID===this.pickId},n.prototype.setVisible=function(e){this._visible=e},n.prototype.getBucket=function(e){if(e$28(this.buckets))return e$28(e.bucketName)?this.buckets[e.bucketName]:this.buckets[e.id]};var h=new y$15,d=new y$15,f=new t$X(0,0,-1),p=new t$X(0,1,0),_=new t$X;function m(e,t){var i=t.width/e.width;t.height,e.height;var r=_0xea783f*i,n=.5*-r,o=.5*r,a=.5*-r,s=.5*r;h=y$15.computeOrthographicOffCenter(n,o,a,s,-1,400,h);var l=new t$X(.5*((t.west-e.west)/e.width*_0xea783f+(t.east-e.west)/e.width*_0xea783f),.5*((t.north-e.south)/e.height*_0xea783f+(t.south-e.south)/e.height*_0xea783f),200);d=y$15.computeView(l,f,p,_,d);var u=new y$15;return y$15.multiply(h,d,u),u}function $(e,t,i){return JSON.stringify([e,t,i])}return _=t$X.cross(f,p,_),n.prototype.queryRenderedFeatures=function(e,t,i){if(!e$28(this.featureIndex)||!e$28(this.featureIndex.rawTileData))return null;var r=this.featureIndex.query({queryGeometry:t,tileSize:this.tileSize,params:i},e,null),n=!1;for(var o in r)if(e[o]instanceof _0x30f994&&r[o].length>1){n=!0;break}return n&&(r=this.featureIndex.query({queryGeometry:t,tileSize:this.tileSize,params:i,adjustScale:.1},e,null)),r},n.prototype.querySourceFeatures=function(e,t){if(e$28(this.featureIndex)&&e$28(this.featureIndex.rawTileData)){var i=this.featureIndex.loadVTLayers(),r=e?e.sourceLayer:"";""!==r&&(r=r.replace(/(.*)(#\d.*)/,"$1"),e.sourceLayer=r);var n=i[r];if(n)for(var o=_0x461a14.createFilter(e&&e.filter),a=0;a<n.length;a++){var s=n.feature(a);o(new _0x105812(0),s)&&t.push(s)}}},n.prototype.isTileIDLessThan=function(e){return this.level<e.level||!(this.level>e.level)&&(this.x<e.x||!(this.x>e.x)&&this.y<e.y)},n.prototype.onAlphaChanged=function(){this._setNeedReRender(!0)},n.prototype.release=function(){if(this.request&&(this.request.cancel(),delete this.request),this.actor&&(this.actor.send("abortTile",{type:"vector",source:this.mvtProvider.name,uid:this.uid},void 0),this.actor.send("removeTile",{type:"vector",source:this.mvtProvider.name,uid:this.uid},void 0)),e$28(this.buckets)){for(var e in this.buckets){this.buckets[e].destroy()}this.buckets=null}e$28(this.imageAtlasTexture)&&(this.imageAtlasTexture.destroy(),this.imageAtlasTexture=null),e$28(this.glyphAtlasTexture)&&(this.glyphAtlasTexture.destroy(),this.glyphAtlasTexture=null),this._MVTLabel.release()},n}(n$q),_0x3389ec=(_0x349d9d=!0,function(e,t){var i=_0x349d9d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x349d9d=!1,i}),_0x450881=_0x3389ec(void 0,(function(){return _0x450881.toString().search("(((.+)+)+)+$").toString().constructor(_0x450881).search("(((.+)+)+)+$")})),_0x349d9d;function _0x333f13(){}_0x450881();var _0x43c4b9=20;function _0xd56e03(e,t){return e.priority-t.priority}s$V.supportsWebAssembly();var _0x4c9a6d=new o$1n({comparator:_0xd56e03});function _0x2063e1(e){e$28(e.priorityFunction)&&(e.priority=e.priorityFunction())}_0x4c9a6d.maximumLength=_0x43c4b9,_0x4c9a6d.reserve(_0x43c4b9);var _0x46586d={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};function _0x2be1b0(e){return e.state===_0x46586d.UNISSUED&&(e.state=_0x46586d.ISSUED,e.deferred=o$1q.defer()),e.deferred.promise}function _0x1d4b57(e){var t=_0x333f13.taskProcessorMap[e.processorName];if(!_0x333f13.taskProcessorReady)return!1;var i=t.scheduleTask(e.data);return!!e$28(i)&&(e.state=_0x46586d.ACTIVE,i.then((function(t){e.state!==_0x46586d.CANCELLED&&(e.state=_0x46586d.RECEIVED,e.deferred.resolve(t))})).otherwise((function(t){e.state!==_0x46586d.CANCELLED&&(e.state=_0x46586d.FAILED,e.deferred.reject(t))})),!0)}_0x333f13.cancelTask=function(e){e.state=_0x46586d.CANCELLED,e$28(e.deferred)&&e.deferred.reject()},_0x333f13.startTask=function(e){_0x2063e1(e);var t=_0x4c9a6d.insert(e);if(e$28(t)){if(t===e)return;_0x333f13.cancelTask(t)}return _0x2be1b0(e)},_0x333f13.processTasks=function(){for(var e=_0x4c9a6d.internalArray,t=_0x4c9a6d.length,i=0;i<t;++i)_0x2063e1(e[i]);_0x4c9a6d.resort();for(var r;_0x4c9a6d.length>0;)if((r=_0x4c9a6d.pop()).state!==_0x46586d.CANCELLED&&!_0x1d4b57(r))return void _0x4c9a6d.insert(r)},_0x333f13.initWebAssembly=function(){_0x333f13.init=!0,_0x333f13.S3MBTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper_new.js",wasmBinaryFile:"ThirdParty/draco_decoder_new.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then((function(e){_0x333f13.taskProcessorReady=e})),!1!==s$V.supportsWebAssembly()?(_0x333f13.S3MBTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/crunch.js",wasmBinaryFile:"ThirdParty/crunch.wasm"}).then((function(e){_0x333f13.taskProcessorReady=e})),_0x333f13.CRNProcessor.initWebAssemblyModule({modulePath:"ThirdParty/crunch.js",wasmBinaryFile:"ThirdParty/crunch.wasm"}).then((function(){setTimeout((()=>{_0x333f13.CRNTaskProcessorReady=!0}),1e3)})),_0x333f13.unzipDataTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/crunch.js",wasmBinaryFile:"ThirdParty/crunch.wasm"}).then((function(){_0x333f13.CRNTaskProcessorReady=!0}))):_0x333f13.CRNTaskProcessorReady=!0},_0x333f13.S3MTaskProcessor=new i$W("S3MTilesParser"),_0x333f13.S3MBTaskProcessor=new i$W("S3MBTilesParser"),_0x333f13.indexTaskProcessor=new i$W("indexedDBWorker"),_0x333f13.CRNProcessor=new i$W("transcodeCRNToDXT",Number.POSITIVE_INFINITY),_0x333f13.unzipDataTaskProcessor=new i$W("UnZipData"),_0x333f13.taskProcessorReady=!1,_0x333f13.CRNTaskProcessorReady=!1,_0x333f13.init=!1,_0x333f13.taskProcessorMap={UnZipData:_0x333f13.unzipDataTaskProcessor,S3MBTilesParser:_0x333f13.S3MBTaskProcessor};const _0x42d782=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1a6ef3=_0x42d782(void 0,(function(){return _0x1a6ef3.toString().search("(((.+)+)+)+$").toString().constructor(_0x1a6ef3).search("(((.+)+)+)+$")}));_0x1a6ef3();class _0x46f1f4{constructor(e,t){this.layer=e,this.tile=t}getQueryFieldNames(){const e=this.layer,t=this.tile;let i,r=e._fieldsInfo._hash;i=t._attrAppend.length>0?t._attrAppend:e$28(e._queryFieldNames)?e._queryFieldNames:Object.keys(r);let n=i.join(";");return r.hasOwnProperty("smid")?(n=n.replace("smid;",""),n="smid;"+n):(n=n.replace("SmID;",""),n="SmID;"+n),n}getKeyValueUrl(e,t){const i=this.layer,r=this.tile;let n=r._relativePath.path.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,""),o=i._urlArguments,a={layerName:i.name,rootTile:n,tile:r._fileName,suffix:"attribute",fields:t};a=Object.assign(a,o);let s=e.match(/(\S*)\/datas/);return s.length>0&&(e=s[0]),{url:e,queryParameters:a}}parse(e,t){const i=this.layer,r=this.tile;let n=0,o=new DataView(t).getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;const a=new Int32Array(t,n,o);n+=o*Uint32Array.BYTES_PER_ELEMENT;const s=a[0];let l=Math.floor(s/4.125),u=Math.ceil(l/8);const c=u;let h=l*Int32Array.BYTES_PER_ELEMENT,d=new Int8Array(t,n+u,h),f=new Int8Array(d),p=new Int32Array(f.buffer),_=n+s,m=[],$=[];const g=i._fieldsInfo;for(let i=1;i<e.length;i++){let r=e[i],n=g.get(r),o=n.type,s=Number(n.size),h=a[i];l=Math.floor(h/(s+.125)),u=Math.ceil(l/8),(10===o||"ntext"===o||"text"===o)&&(s=1,u=c,l=h-u);let d=new Uint8Array(t,_,u);m.push(d);let f,p=new Int8Array(t,_+u,l*s),v=new Int8Array(p).buffer;if(4===o||"int32"===o)f=new Int32Array(v);else if("int16"===o)f=new Int16Array(v);else if(16===o||"int64"===o)f=new BigInt64Array(v);else if(6===o||"float"===o)f=new Float32Array(v);else if(7===o||"double"===o)f=new Float64Array(v);else if(10===o||"ntext"===o||"text"===o){let e=new DataView(v),t=0,i=[];for(;t<e.byteLength;){let r=e.getInt32(t,!0);if(t+=4,t+r>v.byteLength||r<0)break;let n=new Uint8Array(v,t,r);t+=r;let o=a$Z(n,void 0,void 0,"gbk");i.push(o)}f=i}_+=h,$.push(f)}for(let t=0;t<p.length;t++){let n=p[t],o={};for(let i=0;i<$.length;i++){let r=m[i][Math.floor(t/8)],n=e[i+1];0!=(r>>7-t%8&1)?o[n]=$[i][t]:o[n]=null}let a=r._attributes[n];e$28(a)&&(o=combine(o,a)),r._attributes[n]=o,n===i.curQueryId&&i.queryAttrDeferred.resolve(o)}r._attrDiryEvent.raiseEvent(r._attributes)}load(){const e=this.layer,t=this.tile;let i=t._relativePath.resolve(e._baseUri).toString()+t._fileName+".attribute",r=this.getQueryFieldNames(),n=r.split(";"),o={fields:r};if(e._urlType===fi$5.KEY_VALUE&&({url:i,queryParameters:o}=this.getKeyValueUrl(i,r)),e$28(a$Y.CREDENTIAL)){let t=e._layerScheduler._scpUrl;i=e$28(a$Y.CREDENTIAL._keymap[t])?a$Y.addTokenWithKey(t,i):a$Y.addToken(i)}let a=new t$S({url:i,queryParameters:o});a.request=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.OTHER,priorityFunction:function(){return t._disFromCamera}});const s=a.fetchArrayBuffer();!e$28(s)||(t._attrLoadState=I$F.LOADING,s.then((e=>{this.parse(n,e),t._attrLoadState=I$F.LOADED})).otherwise((e=>{t._attrLoadState=e$28(e)?I$F.FAILED:I$F.UNLOAD})))}}const _0x538420=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x570e9c=_0x538420(void 0,(function(){return _0x570e9c.toString().search("(((.+)+)+)+$").toString().constructor(_0x570e9c).search("(((.+)+)+)+$")}));_0x570e9c();class _0x4e28c6{constructor(e,t){this.layer=e,this.tile=t}parse(e){const t=new DataView(e);let i=0,r=t.getInt32(i,!0);i+=4;const n=new Array(r);for(let e=0;e<r;e++){let r=t.getInt32(i,!0);n[e]=r,i+=4}const o=new Array(r);for(let t=0;t<r;t++){let r=n[t],a=new Uint8Array(e,i+12,r-12),s=nt$c.inflate(a).buffer,l=new TextDecoder("utf-8").decode(s);o[t]=JSON.parse(l),i+=r}}load(){const e=this.layer,t=this.tile;let i=e._baseUri.toString()+"1.attribute",r=e._fieldsInfo._hash,n=new t$S({url:i,queryParameters:{fields:(e$28(e._queryFieldNames)?e._queryFieldNames:Object.keys(r)).join(";")}});n.request=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.OTHER,priorityFunction:function(){return t._disFromCamera}});const o=n.fetchArrayBuffer();!e$28(o)||(t._attrLoadState=I$F.LOADING,o.then((e=>{this.parse(e),t._attrLoadState=I$F.LOADED})).otherwise((e=>{t._attrLoadState=e$28(e)?I$F.FAILED:I$F.UNLOAD})))}}const _0x337c70=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x467954=_0x337c70(void 0,(function(){return _0x467954.toString().search("(((.+)+)+)+$").toString().constructor(_0x467954).search("(((.+)+)+)+$")}));_0x467954();class _0x4ac716{constructor(e,t){this.layer=e,this.tile=t}getKeyValueUrl(e){const t=this.layer,i=this.tile;let r=i._relativePath.path.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,""),n=t._urlArguments,o={layerName:t.name,rootTile:r,tile:i._fileName,suffix:"s3md"};o=Object.assign(o,n);let a=e.match(/(\S*)\/datas/);return a.length>0&&(e=a[0]),{url:e,queryParameters:o}}convertFieldValueType(e,t,i){let r=e[t];return"int32"===r||"int64"===r||"int16"===r?parseInt(i):"float"===r||"double"===r?parseFloat(i):i}parse(e){const t=this.layer,i=this.tile;let r,n=new Uint8Array(e,8),o=nt$c.inflate(n).buffer,a=new Uint8Array(o),s=new TextDecoder("utf-8").decode(a),l=s.substring(4);try{r=JSON.parse(l)}catch{l=s.substring(s.indexOf("{")),r=JSON.parse(l)}let u=r.layerInfos;if(u.length<0)return;let c=u[0],h=c.records,d=c.fieldInfos,f={};for(let e=0,t=d.length;e<t;e++){let t=d[e];f[t.name]=t.type}for(let e=0,r=h.length;e<r;e++){let r=h[e],n=r.values,o=r.id,a={};for(let e=0,t=n.length;e<t;++e){let t=n[e],i=t.name,r=t.field;a[i]=this.convertFieldValueType(f,i,r)}i._attributes[o]=a,o===t.curQueryId&&t.queryAttrDeferred.resolve(a)}i._attrDiryEvent.raiseEvent(i._attributes)}load(){const e=this.layer,t=this.tile;let i,r=t._relativePath.resolve(e._baseUri).toString()+t._fileName+".s3md";if(e._urlType===fi$5.KEY_VALUE&&({url:r,queryParameters:i}=this.getKeyValueUrl(r)),e$28(a$Y.CREDENTIAL)){let t=e._layerScheduler._scpUrl;r=e$28(a$Y.CREDENTIAL._keymap[t])?a$Y.addTokenWithKey(t,r):a$Y.addToken(r)}let n=new t$S({url:r,queryParameters:i});n.request=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.OTHER,priorityFunction:function(){return t._disFromCamera}});const o=n.fetchArrayBuffer();!e$28(o)||(t._attrLoadState=I$F.LOADING,o.then((e=>{this.parse(e),t._attrLoadState=I$F.LOADED})).otherwise((e=>{t._attrLoadState=e$28(e)?I$F.FAILED:I$F.UNLOAD})))}}const _0x2945ec=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x5db58a=_0x2945ec(void 0,(function(){return _0x5db58a.toString().search("(((.+)+)+)+$").toString().constructor(_0x5db58a).search("(((.+)+)+)+$")}));_0x5db58a();const _0x20c152={attribute:function(e,t){return new _0x46f1f4(e,t)},db:function(e,t){return new _0x4e28c6(e,t)},s3md:function(e,t){return new _0x4ac716(e,t)}};var _0x524b5f=(_0x278c2c=!0,function(e,t){var i=_0x278c2c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x278c2c=!1,i}),_0x4cfded=_0x524b5f(void 0,(function(){return _0x4cfded.toString().search("(((.+)+)+)+$").toString().constructor(_0x4cfded).search("(((.+)+)+)+$")})),_0x278c2c;function _0x100161(){this._fileName=void 0,this._relativePath=void 0,this._orientedBoundingBox=void 0,this._boundingSphere=void 0,this._childrenPageLod=[],this._pagelodMap={},this._isLeafTile=!1,this._isRootTile=!1,this._hasLeafChild=!1,this._isEmptyTree=!0,this._s3mLoadState=I$F.UNLOAD,this._attrLoadState=I$F.UNLOAD,this._leafAttrLoadState=I$F.UNLOAD,this._attrAppend=[],this._isParsed=!1,this._configLoadState=I$F.UNLOAD,this._avgPix=0,this._disFromCamera=0,this._nLODLev=0,this._ready=!1,this._configReady=!1,this._isVisible=!0,this._owner=void 0,this.s3mBuffer=null,this.volBuffer=null,this.volImage=null,this._texturesByteLength=0,this._replacementNode=null,this._volObj=null,this._volTexture=null,this._volTextures={},this.skeletonState=void 0,this.skeletonPackages=void 0,this.instancePackage=void 0,this._reloadVol=!1,this._oriBoundingSphere=null,this._isAncestorBlock=!1,this._isChildBlock=!1,this._blockKey=void 0,this._priority=1e3,this._rootBatchIdMap={},this._ancestorMap={},this._parent=void 0,this._depth=1,this._parentPagelod=void 0,this._leafChildren=[],this._centerZDepth=0,this._foveatedFactor=0,this._priority=0,this._hasConfig=!1,this._needLoad=!1,this._disvisibleOrUnreadyCount=0,this._isUnready=!0,this._subdomainIndex=0,this._prepareLoad=!1,this._tmpMaterialArr=[],this.hasTranslate=!1,this.isFlatten=!1,this.isVirtualNode=!1,this.configLoading=!1,this.root=this,this._attributes={},this._attrDiryEvent=new o$1o}function _0x2a7181(e,t,i){return Math.max(e$27.normalize(e,t,i)-e$27.EPSILON7,0)}function _0x74bb38(e,t,i){var r=e*Math.pow(10,t);return parseInt(r)*Math.pow(10,i)}_0x4cfded(),_0x100161.prototype.updatePriority=function(e){var t=e._minimumPriority,i=e._maximumPriority,r=4,n=_0x74bb38(_0x2a7181(this._foveatedFactor,t.foveatedFactor,i.foveatedFactor),4,r);r=8;var o=_0x74bb38(1-_0x2a7181(this._avgPix,t.pixel,i.pixel),4,r);r=0;var a=_0x74bb38(_0x2a7181(this._disFromCamera,t.distance,i.distance),4,r);this._priority=n+o+a},_0x100161.prototype.memoryUsage=function(){for(var e=this._texturesByteLength,t=0;t<this._childrenPageLod.length;t++)for(var i=0;i<this._childrenPageLod[t]._renderEntityList.length;i++)e+=this._childrenPageLod[t]._renderEntityList[i]._geometryByteLength,e$28(this._childrenPageLod[t]._entity)&&this._childrenPageLod[t]._entity._isChildBlock&&(e+=this._childrenPageLod[t]._entity.memoryUsage());return e},_0x100161.prototype.memoryUsageEx=function(e){e.texSize+=this._texturesByteLength;for(var t=0;t<this._childrenPageLod.length;t++)for(var i=0;i<this._childrenPageLod[t]._renderEntityList.length;i++)e.geoSize+=this._childrenPageLod[t]._renderEntityList[i]._geometryByteLength,e$28(this._childrenPageLod[t]._entity)&&this._childrenPageLod[t]._entity._isChildBlock&&this._childrenPageLod[t]._entity.memoryUsageEx(e);return e.geoSize+e.texSize},Object.defineProperties(_0x100161.prototype,{attrLoadState:{get:function(){return this._attrLoadState},set:function(e){this._attrLoadState=e}},leafAttrLoadState:{get:function(){return this._leafAttrLoadState},set:function(e){this._leafAttrLoadState=e}}}),_0x100161.prototype.setEmptyTreeFlag=function(e){for(var t=[this];t.length;){var i=t.pop();i._isEmptyTree=e;for(var r=0,n=i._childrenPageLod.length;r<n;r++){var o=i._childrenPageLod[r];e$28(o._entity)&&o._entity._isEmptyTree&&t.push(o._entity)}}},_0x100161.prototype.traverse=function(e){for(var t=0,i=this._childrenPageLod.length;t<i;t++){var r=this._childrenPageLod[t];e(r),r._entity&&(r._entity._s3mLoadState===I$F.LOADING||r._entity._s3mLoadState===I$F.LOADVOL?r._entity._s3mLoadState=I$F.LOST:r._entity.traverse(e))}},_0x100161.prototype.transformResource=function(e,t,i){var r=e.context,n=!0;let o=!1;for(var a=0,s=this._childrenPageLod.length;a<s;a++){for(var l=!0,u=0,c=(d=this._childrenPageLod[a])._renderEntityList.length;u<c;u++){var h=d._renderEntityList[u];if(r.memorySize>i)return o=!0,o;if(!h.renderable){n=!1,l=!1;try{h.transformResource(e,t)}catch(e){console.log(e)}}}d._ready=l}for(a=0,s=this._leafChildren.length;a<s;a++){var d;for(l=!0,u=0,c=(d=this._leafChildren[a])._renderEntityList.length;u<c;u++){h=d._renderEntityList[u];if(r.memorySize>i)return o=!0,o;if(!h.renderable){n=!1,l=!1;try{h.transformResource(e,t)}catch(e){console.log(e)}}}d._ready=l}return n&&(this._ready=!0,this._s3mLoadState=I$F.TRANSFORMED),o},_0x100161.prototype.freeResource=function(e){for(var t=0,i=this._childrenPageLod.length;t<i;t++){this._childrenPageLod[t].freeResource(e)}for(t=0,i=this._leafChildren.length;t<i;t++){this._leafChildren[t].freeResource(e)}this._leafChildren.length=0,this._ready=!1,this._s3mLoadState=I$F.UNLOAD,this._replacementNode=void 0},_0x100161.prototype.isDestroyed=function(){return!1},_0x100161.prototype.destroy=function(e,t){for(var i=0,r=this._childrenPageLod.length;i<r;i++)this._childrenPageLod[i]=this._childrenPageLod[i]&&!this._childrenPageLod[i].isDestroyed()&&this._childrenPageLod[i].destroy(e,t);for(var n in this._childrenPageLod.length=0,this._ready=!1,this._s3mLoadState=I$F.UNLOAD,this._avgPix=0,this._disFromCamera=0,this.s3mBuffer=null,this.volBuffer=null,this.volImage=null,this._replacementNode=null,this.skeletonState=void 0,this.skeletonPackage=void 0,this.instancePackage=void 0,e$28(this._volObj)&&Se$8.DestroyTexture(this._volObj.id),this._volObj=null,e$28(this._volTexture)&&this._volTexture.destroy(),this._volTexture=null,this._volTextures)if(this._volTextures.hasOwnProperty(n)){var o=this._volTextures[n];e$28(o)&&o.destroy()}this._volTextures={},this.request=void 0,e$28(this.task)&&_0x333f13.cancelTask(this.task),this.task=void 0;for(i=0,r=this._tmpMaterialArr.length;i<r;i++){var a=this._tmpMaterialArr[i];a.isDestroyed()||a.destroy()}},_0x100161.prototype.isImageryLoaded=function(e){if(!e$28(e._imageryLayer))return!0;for(var t=!0,i=this._childrenPageLod.length,r=0;r<i;r++)for(var n=this._childrenPageLod[r]._renderEntityList,o=n.length,a=0;a<o;a++){var s=n[a]._imagerys;if(e$28(s))for(var l=s.length,u=0;u<l;u++)s[u]instanceof _0x364a72?s[u].state===_t$6.RENDERED||s[u].state===_t$6.READY||s[u].state===_t$6.FAILED||(t=!1):s[u].state<_t$6.TEXTURE_LOADED&&(t=!1)}return t},_0x100161.prototype.extendRadius=function(e){e*=1.5,e$28(this._oriBoundingSphere)||(this._oriBoundingSphere=this._boundingSphere.clone()),this._boundingSphere.radius=this._oriBoundingSphere.radius+e;for(var t=0,i=this._childrenPageLod.length;t<i;t++){var r=this._childrenPageLod[t];r._boundingSphere.radius=this._oriBoundingSphere.radius+e;for(var n=0;n<r._renderEntityList.length;n++){var o=r._renderEntityList[n];o._boundingVolume.radius=this._oriBoundingSphere.radius+e,e$28(o._colorCommand)&&(o._colorCommand._boundingVolume.radius=this._oriBoundingSphere.radius+e)}}},_0x100161.prototype.loadImagery=function(e,t){if(e$28(e._imageryLayer)){for(var i=0,r=this._childrenPageLod.length,n=0;n<r;n++)for(var o=this._childrenPageLod[n]._renderEntityList,a=o.length,s=0;s<a;s++)if(!o[s]._imageRasterFinish){var l=o[s]._imagerys;if(e$28(l))for(var u=l.length,c=0;c<u;c++)l[c].state<_t$6.TEXTURE_LOADED&&(l[c].processStateMachine(t,!1),i+=1)}return i}},_0x100161.prototype.resetAttrLoadState=function(){this._attrLoadState=I$F.UNLOAD},_0x100161.prototype.loadAttributes=function(e){return!e.needLoadAttributes||(this._attrLoadState!==I$F.UNLOAD?this._attrLoadState===I$F.LOADED:(_0x20c152[e._attributeExtentName](e,this).load(),!1))};var _0x40948a=(_0x317cc4=!0,function(e,t){var i=_0x317cc4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x317cc4=!1,i}),_0x14ed3c=_0x40948a(void 0,(function(){return _0x14ed3c.toString().search("(((.+)+)+)+$").toString().constructor(_0x14ed3c).search("(((.+)+)+)+$")})),_0x317cc4;_0x14ed3c();var _0x52db4a={DISTANCE_FROM_EYE_POINT:0,PIXEL_SIZE_ON_SCREEN:1,GEOMETRY_ERROR:2},_0x189b29=Object.freeze(_0x52db4a),_0xdc1899=(_0x2a256a=!0,function(e,t){var i=_0x2a256a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2a256a=!1,i}),_0x31a515=_0xdc1899(void 0,(function(){return _0x31a515.toString().search("(((.+)+)+)+$").toString().constructor(_0x31a515).search("(((.+)+)+)+$")})),_0x2a256a;_0x31a515();var _0x2e42e6={Root_Priority:0,Child_Priority:1,UsePagedLodInfo:2,Child_Priority_NonLinear:3},U$p=Object.freeze(_0x2e42e6),_0xbd11a=(_0x525031=!0,function(e,t){var i=_0x525031?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x525031=!1,i}),_0x260007=_0xbd11a(void 0,(function(){return _0x260007.toString().search("(((.+)+)+)+$").toString().constructor(_0x260007).search("(((.+)+)+)+$")})),_0x525031;function _0x575d8a(){this._orientedBoundingBox=void 0,this._boundingSphere=void 0,this._rangeList=0,this._rangeDataList=void 0,this._isLeafNode=!1,this._isLessLodDis=!0,this._entity=null,this._renderEntityList=[],this._ready=!1,this._pix=0,this._rangeMode=_0x189b29.DISTANCE_FROM_EYE_POINT,this._processFileType=0,this._renderEntityVisible={},this._fileType=f$r.OSGBFile,this._finalResolution=!0,this._isVisible=!0,this._centerZDepth=0,this._isFinalTraverse=!0}function _0x698e39(e,t,i,r){var n=i._boundingSphere,o=n.radius,a=n.center,s=t.drawingBufferHeight,l=e$28(i._orientedBoundingBox)?Math.sqrt(i._orientedBoundingBox.distanceSquaredTo(e.positionWC)):Math.max(t$X.distance(e.positionWC,a)-o,1e-5),u=i._rangeList*s/(l*e.frustum.sseDenominator);if(e$28(r)&&(r===U$p.Child_Priority_NonLinear||r===U$p.UsePagedLodInfo)){var c=i._fileType===f$r.OSGBFile?800:300,h=Math.max(o,c);if(e$28(i._orientedBoundingBox)&&(a=i._orientedBoundingBox.center),(l=t$X.distance(e.positionWC,a))>h){var d=2*h/l;d<1&&(u*=d)}}return u}function pixelsPerMeter(e,t){var i=e.uniformState.resolutionScale,r=e.drawingBufferHeight/(2*Math.tan(.5*e$27.PI_OVER_FOUR))/t;return r/=i}function _0x28a3f1(e,t,i,r,n){var o=0,a=i._boundingSphere,s=a.radius,l=a.center,u=t$X.distance(e.positionWC,l);if(u=Math.max(1e-5,u),e._mode===P$$.SCENE2D&&(u=e.positionCartographic.height),o=t.drawingBufferHeight/(2*Math.tan(.5*e$27.PI_OVER_FOUR))*s/u,e$28(r)&&(r==U$p.Child_Priority_NonLinear||r===U$p.UsePagedLodInfo)){var c=Math.max(a.radius,n);u>c&&(o*=c/u)}return Math.ceil(o)}_0x260007(),_0x575d8a.prototype.calcPixFromCam=function(e,t,i,r,n){if(this._boundingSphere){var o=e.positionWC,a=t$X.clone(this._boundingSphere.center),s=t$X.distance(a,o);e._mode==P$$.SCENE2D&&(s=e.positionCartographic.height),this._disFromCamera=s-this._boundingSphere.radius;var l=0;if(i/=to.getQuality(),this._rangeMode==_0x189b29.DISTANCE_FROM_EYE_POINT)l=s-this._boundingSphere.radius,this._isLessLodDis=l>this._rangeList*i,l=-l;else if(this._rangeMode===_0x189b29.GEOMETRY_ERROR)l=_0x698e39(e,t,this,n),this._isLessLodDis=l<=16*i;else l=2*_0x28a3f1(e,t,this,n,this._fileType===f$r.OSGBFile?800:300),this._isLessLodDis=l<=this._rangeList*i;this._pix=l,this._entity&&(this._entity._avgPix=l,this._entity._disFromCamera=this._disFromCamera,this._entity._isRootTile||(this._entity._disFromCamera*=r))}},_0x575d8a.prototype.calcImageryScaleLevel=function(e,t,i,r,n){if(this._boundingSphere){var o=e.positionWC,a=t$X.clone(this._boundingSphere.center),s=t$X.distance(a,o);e._mode==P$$.SCENE2D&&(s=e.positionCartographic.height),this._disFromCamera=s-this._boundingSphere.radius;var l=0;return i/=to.getQuality(),n==_0x189b29.DISTANCE_FROM_EYE_POINT?(l=s-this._boundingSphere.radius,this._isLessLodDis=l>this._rangeList*i,l=-l,this._pix=l,Math.sqrt(this._rangeList*i/l)):n===_0x189b29.GEOMETRY_ERROR?(this._rangeList=16*this._boundingSphere.radius/256,l=_0x698e39(e,t,this,r),this._isLessLodDis=l<=16*i,this._pix=l,Math.sqrt(l/(16*i))):(l=2*_0x28a3f1(e,t,this,r,this._fileType===f$r.OSGBFile?800:300),this._isLessLodDis=l<=this._rangeList*i,this._pix=l,Math.sqrt(l/(this._rangeList*i)))}},_0x575d8a.prototype.freeResource=function(e){for(var t=0,i=this._renderEntityList.length;t<i;t++){this._renderEntityList[t].destroy(!0)}this._renderEntityList.length=0,this._ready=!1},_0x575d8a.prototype.isDestroyed=function(){return!1},_0x575d8a.prototype.destroy=function(e,t){for(var i=0,r=this._renderEntityList.length;i<r;i++)e$28(e)&&this._renderEntityList[i].refreshRaster(e),this._renderEntityList[i]=this._renderEntityList[i]&&!this._renderEntityList[i].isDestroyed()&&this._renderEntityList[i].destroy();return this._renderEntityList.length=0,e$28(this._entity)&&(t||this._entity._isChildBlock)&&this._entity.destroy(e,t),this._entity=void 0,i$Z(this)};var _0x49c86b=(_0x2c828c=!0,function(e,t){var i=_0x2c828c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2c828c=!1,i}),_0x9a9f66=_0x49c86b(void 0,(function(){return _0x9a9f66.toString().search("(((.+)+)+)+$").toString().constructor(_0x9a9f66).search("(((.+)+)+)+$")})),_0x2c828c;_0x9a9f66();var _0x144583=function(){this.context=void 0,this.model=void 0,this.index=void 0};_0x144583.prototype.set=function(e,t,i){this.context=e,this.model=t,this.index=i},_0x144583.prototype.execute=function(){var e=this.context,t=this.model._layer,i=this.index,r=this.model._vertexPackage,n=r.vertexAttributes[i];if(!e$28(n))throw new t$Z("attribute is not exit");if(-1!==r.instanceIndex&&!e$28(this.model._instanceBuffer)){if(!e$28(r.instanceBuffer))throw new t$Z("instance buffer is null");this.model._instanceBuffer=h$W.createVertexBuffer({context:e,typedArray:r.instanceBuffer,usage:A$1c.STATIC_DRAW}),this.model._geometryByteLength+=this.model._instanceBuffer.sizeInBytes,to._memGeometryAdded(this.model._instanceBuffer.sizeInBytes)}1!==n.instanceDivisor||e$28(n.typedArray)?e$28(n.vertexBuffer)||(e$28(n.vertexBuffer)||(n.vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:n.typedArray,usage:A$1c.STATIC_DRAW})),t._totalMemoryUsageInBytes+=n.vertexBuffer.sizeInBytes,this.model._geometryByteLength+=n.vertexBuffer.sizeInBytes,to._memGeometryAdded(n.vertexBuffer.sizeInBytes),n.typedArray=null,delete n.typedArray):n.vertexBuffer=this.model._instanceBuffer};var _0xef79ef=(_0x13d1ed=!0,function(e,t){var i=_0x13d1ed?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x13d1ed=!1,i}),_0x389eea=_0xef79ef(void 0,(function(){return _0x389eea.toString().search("(((.+)+)+)+$").toString().constructor(_0x389eea).search("(((.+)+)+)+$")})),_0x13d1ed;_0x389eea();var _0x524a34=function(){this.model=void 0,this.context=void 0,this.index=0};_0x524a34.prototype.set=function(e,t,i,r){this.model=t,this.context=e,this.index=i,this.verticesCount=r},_0x524a34.prototype.execute=function(){var e=this.context,t=this.model._layer,i=this.model._arrIndexPackage[this.index];if(!e$28(i))throw new t$Z("index package is null");if(!e$28(i.indexBuffer)){if(!e$28(i.indicesTypedArray))throw new t$Z("index buffer is null");var r=ce$v.UNSIGNED_SHORT;(1===i.indexType||this.verticesCount>=e$27.SIXTY_FOUR_KILOBYTES)&&this.context.elementIndexUint&&(r=ce$v.UNSIGNED_INT),e$28(i.indexBuffer)||(i.indexBuffer=h$W.createIndexBuffer({context:e,typedArray:i.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:r}),t._totalMemoryUsageInBytes+=i.indexBuffer.sizeInBytes,this.model._geometryByteLength+=i.indexBuffer.sizeInBytes,to._memGeometryAdded(i.indexBuffer.sizeInBytes)),i.indicesTypedArray=null,delete i.indicesTypedArray}};var _0x7e06c9=(_0x10cff6=!0,function(e,t){var i=_0x10cff6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x10cff6=!1,i}),_0x4eef64=_0x7e06c9(void 0,(function(){return _0x4eef64.toString().search("(((.+)+)+)+$").toString().constructor(_0x4eef64).search("(((.+)+)+)+$")})),_0x10cff6;function _0x2dd764(){this.textures={},this.textureRefCounts={},this._context=void 0}_0x4eef64(),_0x2dd764.createTexture=function(e){var t=e.imageUrl,i=u$Y(e.wrapS,q$11.REPEAT),r=u$Y(e.wrapT,q$11.REPEAT),n=u$Y(e.minificationFilter,tt$h.LINEAR),o=u$Y(e.magnificationFilter,rt$g.LINEAR),a=u$Y(e.pixelFormat,V$O.RGBA),s=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE);if(e$28(t)){var l=t;_0x2b8028.textureRefCounts[l]?_0x2b8028.textureRefCounts[l]++:(_0x2b8028.textureRefCounts[l]=1,o$1q(t$D(t),(function(e){var t=new n$Y({wrapS:i,wrapT:r,minificationFilter:n,magnificationFilter:o}),u=new L$17({context:_0x2b8028._context,source:e,pixelFormat:a,pixelDatatype:s,sampler:t});u.generateMipmap(),_0x2b8028.textures[l]=u})))}},_0x2dd764.getTexture=function(e){if(e$28(e))return _0x2b8028.textures[e]},_0x2dd764.removeTexture=function(e){e$28(e)&&(e$28(_0x2b8028.textureRefCounts[e])&&(_0x2b8028.textureRefCounts[e]--,0===_0x2b8028.textureRefCounts[e])&&(_0x2b8028.textures[e].destroy(),delete _0x2b8028.textures[e],delete _0x2b8028.textureRefCounts[e]))},_0x2dd764.update=function(e){_0x2b8028._context=e};var _0x2b8028=new _0x2dd764,_0x1f63a9=(_0x426ff3=!0,function(e,t){var i=_0x426ff3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x426ff3=!1,i}),_0x35786d=_0x1f63a9(void 0,(function(){return _0x35786d.toString().search("(((.+)+)+)+$").toString().constructor(_0x35786d).search("(((.+)+)+)+$")})),_0x426ff3;_0x35786d();var _0x3039d8={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},_0x33a28d=Object.freeze(_0x3039d8),_0x963438=(_0xf46a64=!0,function(e,t){var i=_0xf46a64?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xf46a64=!1,i}),_0x371578=_0x963438(void 0,(function(){return _0x371578.toString().search("(((.+)+)+)+$").toString().constructor(_0x371578).search("(((.+)+)+)+$")})),_0xf46a64;_0x371578();var _0x4d4a52={NONE:0,SELECTION:1,ALL:2},_0x121e29=Object.freeze(_0x4d4a52),_0x2f42e3=(_0xf4c5c9=!0,function(e,t){var i=_0xf4c5c9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xf4c5c9=!1,i}),_0x1ea226=_0x2f42e3(void 0,(function(){return _0x1ea226.toString().search("(((.+)+)+)+$").toString().constructor(_0x1ea226).search("(((.+)+)+)+$")})),_0xf4c5c9;_0x1ea226();var _0x3eace2={MIX:0,REPLACE:1},_0x125991=Object.freeze(_0x3eace2),_0x371153=(_0x3f6167=!0,function(e,t){var i=_0x3f6167?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3f6167=!1,i}),_0x4a937f=_0x371153(void 0,(function(){return _0x4a937f.toString().search("(((.+)+)+)+$").toString().constructor(_0x4a937f).search("(((.+)+)+)+$")})),_0x3f6167;function _0x20b1b5(){}_0x4a937f();var _0x45e6c0=[];_0x20b1b5.createUniformMapsForCompressAttributes=function(e,t){var i=e._vertexPackage,r=i.nCompressOptions;(r&_0x33a28d.SVC_Vertex)==_0x33a28d.SVC_Vertex&&(t.decode_position_min=function(){return i.minVerticesValue},t.decode_position_normConstant=function(){return i.vertCompressConstant}),(r&_0x33a28d.SVC_Normal)==_0x33a28d.SVC_Normal&&(t.normal_rangeConstant=function(){return i.normalRangeConstant}),(r&_0x33a28d.SVC_TexutreCoord)==_0x33a28d.SVC_TexutreCoord&&(i.texCoordCompressConstant.length>0&&(t.decode_texCoord0_min=function(){return i.minTexCoordValue[0]},t.decode_texCoord0_normConstant=function(){return i.texCoordCompressConstant[0]},t.decode_texCoord0_vNormConstant=function(){return i.texCoordCompressConstant[0]}),i.texCoordCompressConstant.length>1&&(t.decode_texCoord1_min=function(){return i.minTexCoordValue[1]},t.decode_texCoord1_normConstant=function(){return i.texCoordCompressConstant[1]},t.decode_texCoord1_vNormConstant=function(){return i.texCoordCompressConstant[1]}),i.texCoordCompressConstant.length>2&&(t.decode_texCoord2_min=function(){return i.minTexCoordValue[2]},t.decode_texCoord2_normConstant=function(){return i.texCoordCompressConstant[2]}),i.texCoordCompressConstant.length>3&&(t.decode_texCoord3_min=function(){return i.minTexCoordValue[3]},t.decode_texCoord3_normConstant=function(){return i.texCoordCompressConstant[3]}),i.texCoordCompressConstant.length>4&&(t.decode_texCoord4_min=function(){return i.minTexCoordValue[4]},t.decode_texCoord4_normConstant=function(){return i.texCoordCompressConstant[4]}),i.texCoordCompressConstant.length>5&&(t.decode_texCoord5_min=function(){return i.minTexCoordValue[5]},t.decode_texCoord5_normConstant=function(){return i.texCoordCompressConstant[5]}),i.texCoordCompressConstant.length>6&&(t.decode_texCoord6_min=function(){return i.minTexCoordValue[6]},t.decode_texCoord6_normConstant=function(){return i.texCoordCompressConstant[6]}),i.texCoordCompressConstant.length>7&&(t.decode_texCoord7_min=function(){return i.minTexCoordValue[7]},t.decode_texCoord7_normConstant=function(){return i.texCoordCompressConstant[7]}))};var _0x5b252e=new o$1k,_0x241135=new o$1k;_0x20b1b5.createCommonLayerUniform=function(e,t){t.uPolygonOffset=function(){var t=e._rsColor.polygonOffset;return e$28(t)?(_0x241135.x=t.factor,_0x241135.y=t.units):(_0x241135.x=0,_0x241135.y=0),_0x241135},t.u_polygonOffset=function(){var t=0,i=0,r=e._rsColor.polygonOffset;return e$28(r)?(t=r.factor,i=r.units):(t=0,i=0),{x:t,y:i}},t.uPointSize=function(){return e.style3D.pointSize},t.uTranslation=function(){return e.selectedTranslate},t.uSelColor=function(){return e.selectedColor},t.uMinMaxTransparent=function(){return _0x5b252e.x=e.minTransparentAlpha,_0x5b252e.y=e.maxTransparentAlpha,_0x5b252e},t.uBottom=function(){return e.style3D.bottomAltitude}},_0x20b1b5.createMaterialUniform=function(e,t,i){t.uAmbientColor=function(){return i.mixColorType===_0x125991.REPLACE?e$1S.WHITE:e._ambientColor},t.uDiffuseColor=function(){return i.mixColorType===_0x125991.REPLACE?e$1S.WHITE:e._diffuseColor},t.uTexMatrix=function(){return e._texMatrix},t.uTexture0Width=function(){return e$28(e.baseColorTexture)?e.baseColorTexture.width:e$28(e._textures[0])?e._textures[0].width:1},t.uTexture1Width=function(){return e$28(e._textures[1])?e._textures[1]._width:1}},_0x20b1b5.createDynamicMaterialUniform=function(e,t,i,r){r.uFillForeColor=function(){return t.style3D.fillForeColor};var n=new e$25;r.uTexUVOffset=function(){n.x=0,n.y=0,n.z=1,n.w=1;var e=i._baseColorTextureMotion;if(e$28(e)){var r=e.OffsetPeriod,o=e.OffsetSpeedU,a=e.OffsetSpeedV,s=e.TilingPeriod,l=e.TilingSpeedU,u=e.TilingSpeedV,c=performance.now()/1e3;if(r>0){var h=c%r;n.x=h*o,n.y=h*a}if(s>0){var d=c%s;n.z=1+d*l,n.w=1+d*u}}else if(0!==t._textureUVSpeed.x||0!==t._textureUVSpeed.y){var f=performance.now()/1e3;n.x=t._textureUVSpeed.x*f,n.y=t._textureUVSpeed.y*f}return n},r.uEnvMapIntensity=function(){return t._envMapIntensity}};var _0x5ab89c=new y$15;function o$E(){this._uniformDataArray={},this._needUpdate=!1}_0x20b1b5.create=function(e,t,i,r){var n=t._fileType,o=n===f$r.PolylineEffect||n===f$r.ClampGroundRealtimeRasterCache&&e$28(i._attributeLocations.aTexCoord1),a=n===f$r.RegionEffect,s=n===f$r.ClampGroundRealtimeRasterCache&&!e$28(i._attributeLocations.aTexCoord1),l=n===f$r.PointCloudFile,u=i.materialPass;n===f$r.OSGBFile||f$r.OSGBCacheFile,_0x20b1b5.createCommonLayerUniform(t,r),_0x20b1b5.createMaterialUniform(u,r,t),_0x20b1b5.createDynamicMaterialUniform(i,t,u,r),r.uEmissionColor=function(){return t.style3D.emissionColor},r.uSelectCastShadow=function(){return t.shadowType==_0x121e29.SELECTION},r.uPixels=function(){return e$25.fromArray(t._context.pixels)},r.uLayerID=function(){return t._id/255},r.uTransparentFilter=function(){return t.selectionFiltrateByTransparency},r.uGeoMatrix=function(){return i._geoMatrix},r.uInverseGeoMatrix=function(){return i._inverseGeoMatrix},r.s3m_iblReferenceFrameMatrix=function(){return i._iblReferenceFrameMatrix},r.uSkeletonMatrix=function(){return i._instanceSkeletonMatrix},r.uTexture=function(){var e;return e$28(i._symbolTextureUrl)?e$28(e=_0x2dd764.getTexture(i._symbolTextureUrl))?e:t._context.defaultTexture:e$28(u._textures[0])?(e=u._textures[0]).isTexBlock?e.renderable&&e.ready?e:e$28(u._ancestorTexture)?u._ancestorTexture:e:e:t._context.defaultTexture},r.uMapTexture=function(){if(e$28(u._textures[0])){var e=u._textures[0],i=u._mapTextures[e.id];return e$28(i)?i:e}return t._context.defaultTexture},r.uSecTexture=function(){var e=u._textures[1];return e.isTexBlock?e.renderable&&e.ready?e:e$28(u._ancestorTextureBake)?u._ancestorTextureBake:t._context.defaultTexture:e},r.uSkeletonCount=function(){return i.skeletonCount};var c=new e$25;r.uLayerBounds=function(){return c.x=t._layerModelBounds.x,c.y=t._layerModelBounds.y,c.z=t._layerModelBounds.z-t._layerModelBounds.x,c.w=t._layerModelBounds.w-t._layerModelBounds.y,c},r.uLayerCornerLength=function(){return Math.sqrt(t._layerModelBounds.z*t._layerModelBounds.z+t._layerModelBounds.w*t._layerModelBounds.w)},r.uMaxCategoryOrHypCeil=function(){var e=t._hypMaxCategory;return e$28(t._hypsometricSetting)&&(0!=t._hypsometricSetting._floor||0!=t._hypsometricSetting._ceiling)&&(e=t._hypsometricSetting._ceiling),e$28(e)||(e=100),e},r.uMinCategoryOrHypFloor=function(){var e=t._hypMinCategory;return e$28(t._hypsometricSetting)&&(0!=t._hypsometricSetting._floor||0!=t._hypsometricSetting._ceiling)&&(e=t._hypsometricSetting._floor),e$28(e)||(e=0),e},r.uRect=function(){return t._flattenBounds},r.uCameraHeight=function(){return t._frameState.camera.positionCartographic.height},r.uFlattenTexture=function(){return e.multiViewportIndex>-1?1<<e.multiViewportIndex&t._flattenVisibleViewport?t._flattenTexture:t._context.defaultTexture:t._flattenTexture},r.uHypHasColorByHeight=function(){return i.useWValue},r.fMultiTemporalFactor=function(){return i._fMultiTemporalFactor};var h=new e$25;r.uTextureDim=function(){var e=u._textures[0].renderable?u._textures[0]:e$28(u._ancestorTexture)?u._ancestorTexture:u._textures[0];if(h.x=e._width,h.y=e._height,e$28(u._textures[1])){var t=u._textures[1].renderable?u._textures[1]:e$28(u._ancestorTextureBake)?u._ancestorTextureBake:u._textures[1];h.z=t._width,h.w=t._height}return h},r.uHypHasAnalysisRegion=function(){return t._bUseHypRegion},r.uMixColorType=function(){return e$28(t._mixColorType)?t._mixColorType:0},r.uDataFloor=function(){return t._fMinValue===t._fMaxValue?0:t._fMinValue},r.uDataCeil=function(){return t._fMinValue===t._fMaxValue?1:t._fMaxValue},r.uEmissionTexAtlas=function(){return e$28(t._hypsometricSetting._emissionTextureAtlas)?t._hypsometricSetting._emissionTextureAtlas.texture:t._context.defaultTexture},r.uEmissionTexAtlasRects=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting._getEmissionAtlasTextureRects():_0x45e6c0},r.uEmissionTexAtlasTilingAndOffset=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting._getEmissionTexAtlasTilingAndOffset():_0x45e6c0},r.uHypsometricTexture=function(){return t._hypsometricTexture},r.uHypsometricRenderTexture=function(){return t._hypsometricRenderTexture},r.uHypOpacity=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting.Opacity:1},r.uHypContourInterval=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting.LineInterval:100};var d=new e$25;r.uHypLineColor=function(){return e$28(t._hypsometricSetting)?(d.x=t._hypsometricSetting.LineColor.red,d.y=t._hypsometricSetting.LineColor.green,d.z=t._hypsometricSetting.LineColor.blue,d.w=t._hypsometricSetting.LineColor.alpha,d):e$25.ZERO},r.uHypContourFillMode=function(){var e=1;if(e$28(t._hypsometricSetting))switch(t._hypsometricSetting.DisplayMode){case k$T.DisplayMode.NONE:e=0;break;case k$T.DisplayMode.FACE:e=1;break;case k$T.DisplayMode.LINE:e=2;break;case k$T.DisplayMode.FACE_AND_LINE:e=3}return e},r.uHypFloor=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting.ColorTableMinKey:0},r.uHypCeil=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting.ColorTableMaxKey:0},r.uHypMaxVisibleValue=function(){return(e$28(t._hypsometricSetting)?t._hypsometricSetting.MaxVisibleValue:0)+e$27.EPSILON5},r.uHypMinVisibleValue=function(){return(e$28(t._hypsometricSetting)?t._hypsometricSetting.MinVisibleValue:0)-e$27.EPSILON5},r.uHypRect=function(){return t._hypsometricBound},r.uNoValueColor=function(){return e$28(t._hypsometricSetting)?t._hypsometricSetting.noValueColor:e$1S.WHITE},r.uHypsometricVisible=function(){return i._isLeaf&&i._isHypsometricVisible||t._hypsometricSetting._visibleDistanceMax===Number.MAX_VALUE&&0===t._hypsometricSetting._visibleDistanceMin&&t._hypsometricSetting._maxVisibleAltitude===Number.MAX_VALUE&&0===t._hypsometricSetting._minVisibleAltitude?1:0},r.uVisibleDistanceMax=function(){return t._visibleDistanceMax},r.uOverlayRect=function(){return t._overlayBounds},r.uOverlayTexture=function(){return t._overlayTexture},r.uTriangleFiltratePixel=function(){return t._triangleFiltratePixel},r.uMaxCategory=function(){return t._hypMaxCategory},r.uMinCategory=function(){return t._hypMinCategory},r.uCategoryWidht=function(){return t._categorieTexture&&t._categorieTexture.width||256},r.uCategoryHeight=function(){return t._categorieTexture&&t._categorieTexture.height||1},r.uCategorieTexture=function(){return t._categorieTexture},r.uSelectColorType=function(){return t.selectColorType},r.uLineColor=function(){return t.style3D.lineColor},r.uLineWidth=function(){return t.style3D.lineWidth},r.uFillStyle=function(){return t.style3D.fillStyle},r.uNormalDepthTexture=function(){return t._frameState._framebufferList.normalAndDepth.renderTexture._fb.getColorTexture(0)},r.uBrightness=function(){return t._brightness},r.uContrast=function(){return t._contrast},r.uHue=function(){return t._hue},r.uSaturation=function(){return t._saturation},r.uOneOverGamma=function(){return 1/t._gamma},r.uTransparentBackColor=function(){return t._transparentBackColor},r.uTransparentBackColorTolerance=function(){return t._transparentBackColorTolerance},r.uExcavationTexture=function(){return t._excavationTexture},r.uExcavationMode=function(){return t._excavationMode},r.uExcavationRect=function(){return t._excavationBounds},r.uServerExcavationMode=function(){return t._serverExcavationMode},r.uServerExcavationRect=function(){return t._serverExcavationBounds},r.uServerExcavationTexture=function(){return t._excavationTexture},r.clip_mode=function(){return t._clipMode},r.clip_planes=function(){return t._clipPlane},r.clip_line_color=function(){return t._clipLineColor},r.uSplitDirection=function(){return t.splitDirection},r.uSplitPosition=function(){return t.splitPosition};var f=new e$25;if(r.uSwipeRegion=function(){return f.x=t._swipeRegion.x*t._frameState.context.drawingBufferWidth,f.y=(1-t._swipeRegion.y)*t._frameState.context.drawingBufferHeight,f.z=t._swipeRegion.z*t._frameState.context.drawingBufferWidth,f.w=(1-t._swipeRegion.w)*t._frameState.context.drawingBufferHeight,f},r.uHorizontalLine=function(){return e$28(t._fHorizontalLine)?t._fHorizontalLine:0},r.uHorizontalColor=function(){return e$28(e$28(t._HorizontalColor))?t._HorizontalColor:new e$25(1,1,0,0)},r.uImgTexture=function(){return e$28(i._rasterImageTexture)?i._rasterImageTexture:t._context.defaultTransparentTexture},r.uImgTextureAlpha=function(){return e$28(t._imageryLayer)?t._imageryLayer instanceof Array?t._imageryLayer[t._imageryLayer.length-1].alpha:t._imageryLayer.show&&i._showImagerysImmediate?t._imageryLayer.alpha:0:1},r.uImgTextureBound=function(){return i._imageryTextureBound},r.u_dayTextures=function(){return i._dayTextures},r.u_dayTextureUseWebMercatorT=function(){return i._dayTextureUseWebMercatorT},r.u_dayTextureTexCoordsRectangle=function(){return i._dayTextureTexCoordsRectangle},r.u_dayTextureTranslationAndScale=function(){return i._dayTextureTranslationAndScale},r.u_transparentBackColor=function(){return i._transparentBackColor},r.u_imageryClipEnable=function(){return i._imageryClipEnable},r.u_dayTextureFlipY=function(){return i._dayTextureFlipY},r.u_dayTextureAlpha=function(){return i._dayTextureAlpha},r.uVolumeTexture=function(){return"png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt?i._volTexture:i._volObj.volTexture},r.sideBlockCount=function(){return i._volObj.nSideBlockCount},r.blockLength=function(){return i._volObj.nBlockLength},r.texLength=function(){return i._volObj.nLength},r.width=function(){return i._volObj.nWidth},r.height=function(){return i._volObj.nHeight},r.depth=function(){return i._volObj.nDepth},r.uVolumeWidth=function(){return i._volObj.nWidth},r.uVolumeHeight=function(){return i._volObj.nHeight},r.uFilterMode=function(){var e=0;return e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(e=1),e},r.uVolumeType=function(){return e$28(i._volObj.nFormat)?3200===i._volObj.nFormat||e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?0:1:0},r.uFloodFlagTexture=function(){if(e$28(t._floodFlagTexture))return t._floodFlagTexture},r.uFloodRect=function(){if(e$28(t._floodRect))return t._floodRect},r.uFloodMatrixInvert=function(){var e=new y$15;return y$15.multiply(t._matFloodInvertMatrix,i._matModel,e),e},o&&(r.uEffectLineWidth=function(){return e$28(t._effect)?t._effect._lineWidth:t.style3D.lineWidth},r.uColor=function(){return e$28(t._effect)?t._effect._color:t.style3D.lineColor},r.uType=function(){return e$28(t._effect)?t._effect._type:0},r.uOutlineColor=function(){return e$28(t._effect)?t._effect._outlineColor:t.style3D.lineColor},r.uOutlineWidth=function(){return e$28(t._effect)?t._effect._outlineWidth:0},r.uGapColor=function(){return e$28(t._effect)?t._effect._gapColor:t.style3D.lineColor},r.uDashLength=function(){return e$28(t._effect)?t._effect._dashLength:0},r.uDashPattern=function(){if(e$28(t._effect)){if(t._effect._isMove){t._effect._frame>159&&(t._effect._frame=0);var e=Math.floor(t._effect._frame/10),i=t._effect._dashPattern<<e,r=t._effect._dashPattern>>16-e;return t._effect._frame++,i+r}return t._effect._dashPattern}return 0},r.uGlowPower=function(){return e$28(t._effect)?t._effect._glowPower:0},r.uIsArrow=function(){return!!e$28(t._effect)&&t._effect._isArrow}),a&&(r.uRotationAngle=function(){return t._effect._rotationAngle},r.uType=function(){return t._effect._type},r.uForeColor=function(){return t._effect._foreColor},r.uBackColor=function(){return t._effect._backColor},r.uLineWidthX=function(){return t._effect._lineWidthX},r.uLineWidthY=function(){return t._effect._lineWidthY},r.uRepeatX=function(){return t._effect._repeatX},r.uRepeatY=function(){return t._effect._repeatY},r.uOffsetX=function(){return t._effect._offsetX},r.uOffsetY=function(){return t._effect._offsetY}),_0x20b1b5.createUniformMapsForCompressAttributes(i,r),l&&(r.uPointCloudSize=function(){var e=t._context.uniformState;return t._pointCloudShading.eyeDomeLighting||t._pointCloudShading.performance?t._pointCloudEyeDomeLighting.textureScale*t.style3D.pointSize*e.resolutionScale:t.style3D.pointSize*e.resolutionScale}),s&&(r.textureRepeat=function(){return i._symbolTextureRepeat}),i._isClamp){r.uIsPicking=function(){return t._picking};var p=new o$1k;r.uMinMaxTerrainHeight=function(){return p.x=t._shadowVolumeBottomHeight,p.y=t._shadowVolumeTopHeight,p},r.uLineWidth=function(){return t.style3D.lineWidth};var _=new y$15;r.uMatrixInvert=function(){return y$15.inverse(t._matModel,_),_},r.uPickPosition=function(){return t._pickPosition},r.uPickPositionHeight=function(){return t._context._pickPositionHeight},r.uSouthWest=function(){return i._southWestCorner},r.uNorthDir=function(){return i._northVector},r.uEastDir=function(){return i._eastVector},r.uTexture=function(){if(e$28(i._symbolTextureUrl)){var e=_0x2dd764.getTexture(i._symbolTextureUrl);return e$28(e)?e:t._context.defaultTexture}return e$28(u._textures[0])?u._textures[0]:t._context.defaultTexture};var m=new o$1k;r.uLevelScale=function(){var e=t._frameState.globeBottomLevel,i=4*Math.PI/(1*(1<<e));return m.x=t._layerBounds.width/i,m.y=t._layerBounds.height/i,m};var $=new o$1k;r.uRepeatTimes=function(){return $.x=t$X.magnitude(i._eastVector)/t._layerRange,$.y=t$X.magnitude(i._northVector)/t._layerRange,$}}e$28(t.waterEffectSet)&&(r.uReflectMap=function(){return t._frameState._framebufferList.water.renderTexture._fb.getColorTexture(0)},r.uNoiseMap=function(){return t._frameState._framebufferList.water._waterNormalMap},r.uTimeVal=function(){var e=.01*t._waterParamter.timeVal;return i._waterTime=i._waterTime>1?e:i._waterTime+e,i._waterTime},r.uScale=function(){return t._waterParamter.scale},r.uScroll=function(){return t._waterParamter.scroll},r.uNoise=function(){return t._waterParamter.noise},r.uBumpSpeed=function(){return t._waterParamter.bumpSpeed},r.uFresnelPower=function(){return t._waterParamter.fresnelPower},r.uMinFresnel=function(){return t._waterParamter.minFresnel},r.uMaxFresnel=function(){return t._waterParamter.maxFresnel},r.uTintColour=function(){return t._waterParamter.tintColour},r.uNoiseScale=function(){return t._waterParamter.noiseScale},r.uWaterColour=function(){return t._waterParamter.waterColour},r.uWaterBrightness=function(){return t._waterParamter.waterBrightness}),r.uBaseColorTextureIndex=function(){return u._baseColorTextureIndex>-1?u._baseColorTextureIndex:t._PBRMaterialParams.pbrMetallicRoughness.baseColorTextureIndex},r.uBaseColorFactor=function(){return u._baseColor||t._PBRMaterialParams.pbrMetallicRoughness.baseColor},r.uMetallicFactor=function(){return u._metallicFactor||t._PBRMaterialParams.pbrMetallicRoughness.metallicFactor},r.uRoughnessFactor=function(){return u$Y(u._roughnessFactor,t._PBRMaterialParams.pbrMetallicRoughness.roughnessFactor)},r.uEmissiveFactor=function(){return u._emissiveFactor||t._PBRMaterialParams.pbrMetallicRoughness.emissiveFactor},r.uEmissionTexture=function(){if(e$28(u.emissiveTexture))return u.emissiveTexture;var e=u._emissiveTextureIndex;return e>-1&&e$28(u._textures[e])?u._textures[e]:t._PBRMaterialParams.pbrMetallicRoughness.emissiveTexture},r.uMetallicRoughnessTexture=function(){return e$28(u._metallicRoughnessTextureIndex)&&u._metallicRoughnessTextureIndex>-1?e$28(u.metallicRoughnessTexture)?u.metallicRoughnessTexture:u._textures[u._metallicRoughnessTextureIndex]:t._PBRMaterialParams.pbrMetallicRoughness.metallicRoughnessTexture},r.uNormalTexture=function(){return e$28(u._normalTextureIndex)&&u._normalTextureIndex>-1?u.normalTexture?u.normalTexture:u._textures[u._normalTextureIndex]:t._PBRMaterialParams.pbrMetallicRoughness.normalTexture},r.uNormalTextureScale=function(){return e$28(u._normalTextureScale)?u._normalTextureScale:t._PBRMaterialParams.pbrMetallicRoughness.normalTextureScale},r.uOcclusionTexture=function(){return e$28(u._occlusionTextureIndex)&&u._occlusionTextureIndex>-1?u.occlusionTexture?u.occlusionTexture:e$28(u._textures[u._occlusionTextureIndex])?u._textures[u._occlusionTextureIndex]:t._context.defaultTexture:t._PBRMaterialParams.pbrMetallicRoughness.occlusionTexture},r.uIndexOfRefraction=function(){return e$28(u._indexOfRefraction)&&u._indexOfRefraction>0?u._indexOfRefraction:t._PBRMaterialParams.pbrMetallicRoughness.indexOfRefraction},r.uTransmissionFactor=function(){return e$28(u._transmissionFactor)&&u._transmissionFactor>0?u._transmissionFactor:e$28(t._PBRMaterialParams.pbrMetallicRoughness.volume)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.volume.transmissionFactor)?t._PBRMaterialParams.pbrMetallicRoughness.volume.transmissionFactor:1},r.uThickness=function(){return e$28(u._volume)?u._volume._thickness:t._PBRMaterialParams.pbrMetallicRoughness.volume.thickness},r.uSnowCoverageFactor=function(){return e$28(u.snowEffect)&&u.snowEffect._snow_coverage>0?u.snowEffect._snow_coverage:e$28(t._PBRMaterialParams.pbrMetallicRoughness.snowEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snow_coverage)&&t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snow_coverage>0?t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snow_coverage:.5},r.uSnowMaskTexture=function(){return e$28(u.snowEffect)&&e$28(u.snowEffect._snowMaskTexture)?u.snowEffect._snowMaskTexture:t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowMaskTexture},r.uSnowNormalTexture=function(){return e$28(u.snowEffect)&&e$28(u.snowEffect._snowNormalTexture)?u.snowEffect._snowNormalTexture:t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowNormalTexture},r.uIntensityScale=function(){return e$28(u._intensityScale)&&u.rainEffect._intensityScale>0?u._intensityScale:e$28(t._PBRMaterialParams.pbrMetallicRoughness.intensityScale)&&t._PBRMaterialParams.pbrMetallicRoughness.intensityScale>0?t._PBRMaterialParams.pbrMetallicRoughness.intensityScale:1},r.uAnimationSpeed=function(){return e$28(u.rainEffect)&&e$28(u.rainEffect._animationSpeed)?u.rainEffect._animationSpeed:t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.animationSpeed},r.uRippleTexture=function(){return e$28(u.rainEffect)&&e$28(u.rainEffect._rippleTexture)?u.rainEffect._rippleTexture:t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rippleTexture},r.uWetnessFactor=function(){return e$28(u.rainEffect)&&u.rainEffect._wetnessFactor>0?u.rainEffect._wetnessFactor:e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wetnessFactor)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wetnessFactor>0?t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wetnessFactor:0},r.uRippleScale=function(){return e$28(u.rainEffect)&&u.rainEffect._ripple_scale>0?u.rainEffect._ripple_scale:e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.ripple_scale)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.ripple_scale>0?t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.ripple_scale:5},r.uWindIntensity=function(){return e$28(u.rainEffect)&&u.rainEffect._wind_intensity>0?u.rainEffect._wind_intensity:e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wind_intensity)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wind_intensity>0?t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wind_intensity:0},r.uRain=function(){return e$28(u.rainEffect)&&u.rainEffect._rain>0?u.rainEffect._rain:e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rain)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rain>0?t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rain:200},r.uCameraDepth=function(){return e$28(u.rainEffect)&&u.rainEffect._cameraDepth>0?u.rainEffect._cameraDepth:e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.cameraDepth)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.cameraDepth>0?t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.cameraDepth:.8},r.uTintColor=function(){return e$28(u._volume)?u._volume._tintColor:e$28(t._PBRMaterialParams.pbrMetallicRoughness.volume)?t._PBRMaterialParams.pbrMetallicRoughness.volume.tintColor:e$1S.WHITE},r.uDiffusionDistance=function(){return e$28(u._volume)?u._volume._diffusionDistance:e$28(t._PBRMaterialParams.pbrMetallicRoughness.volume)?t._PBRMaterialParams.pbrMetallicRoughness.volume.diffusionDistance:e$1S.WHITE},r.uClearcoatFactor=function(){return e$28(u._clearcoat)?u._clearcoat._clearcoatFactor:t._PBRMaterialParams.pbrMetallicRoughness.clearcoat.clearcoatFactor},r.uClearcoatRoughnessFactor=function(){return e$28(u._clearcoat)?u._clearcoat._clearcoatRoughnessFactor:t._PBRMaterialParams.pbrMetallicRoughness.clearcoat.clearcoatRoughnessFactor},r.uAnisotropy=function(){return e$28(u._anisotropy)?u._anisotropy:t._PBRMaterialParams.pbrMetallicRoughness.anisotropy},r.uBaseTexture=function(){return e$28(u._baseColorTextureIndex)&&u._baseColorTextureIndex>-1?u.baseColorTexture:t._PBRMaterialParams.pbrMetallicRoughness.baseColorTexture};var g=u._emissiveTextureMotion||t._PBRMaterialParams.pbrMetallicRoughness.emissiveTextureMotion,v=new e$25;if(r.uEmissiveUVOffsetAndTiling=function(){var e=performance.now()/1e3,t=g.OffsetPeriod,i=g.OffsetSpeedU,r=g.OffsetSpeedV,n=g.TilingPeriod,o=g.TilingSpeedU,a=g.TilingSpeedV;if(g&&t>0){var s=e%t;v.x=s*i,v.y=s*r}else v.x=0,v.y=0;if(g&&n>0){var l=e%g._tilingPeriod;v.z=1+l*o,v.w=1+l*a}else v.z=1,v.w=1;return v},u._usePBRTextureBatch){var y=new o$1k;r.uPBRTexture=function(){return u.pbrParamTexture},r.uPBRTexWH=function(){var e=u.pbrParamTexture;return y.x=e._width,y.y=e._height,y}}r.uAlphaCutoff=function(){return u._alphaCutoff},r.uPBRMaterials=function(){return e.pbrMaterialsArr},r.uPbrParTextureWidth=function(){return e$28(u.baseColorTexture)?u.baseColorTexture._width:e$28(u.normalTexture)?u.normalTexture._width:e$28(u.metallicRoughnessTexture)?u.metallicRoughnessTexture._width:e$28(u.emissiveTexture)?u.emissiveTexture._width:e$28(u.pbrParamTexture)?u.pbrParamTexture._width:1},r.uCameraReflect=function(){return e.camera.bReflect?-1:1};var x={x:0,y:0};r.uPanOffset=function(){return e$28(t._context.curFusionViewMatrix)?(e$28(t.panOffset)&&(x.x=t.panOffset.x/t._context.drawingBufferWidth,x.y=t.panOffset.y/t._context.drawingBufferHeight),x):(x.x=0,x.y=0,x)},r.uModelView=function(){return e$28(t._context.curFusionViewMatrix)?y$15.multiply(t._context.curFusionViewMatrix,i._matModel,_0x5ab89c):y$15.multiply(t._context.uniformState.view3D,i._matModel,_0x5ab89c)},e$28(i._batchTable)&&(r=i._batchTable.getUniformMapCallback()(r)),e$28(u._batchTable)&&(u._batchTable.update(e),r=u._batchTable.getUniformMapCallback()(r)),e$28(u._batchTableBake)&&(u._batchTableBake.update(e),r=u._batchTableBake.getUniformMapCallback()(r)),r=p$17(r,e.lightSource.createUniformMap()),i._uniformMap=r},Object.defineProperties(o$E.prototype,{needUpdate:{set:function(){this._needUpdate=value},get:function(){return this._needUpdate}}}),o$E.prototype.set=function(e,t){this._uniformDataArray[e]=t,t.listener=this,this._needUpdate=!0},o$E.prototype.removeAt=function(e){delete this._uniformDataArray[e],this._needUpdate=!0},o$E.prototype.update=function(e,t){for(var i in this._uniformDataArray){var r=this._uniformDataArray[i],n=e*parseInt(i);r.writeToFloat32Array(t,n)}};var u$m=[],s$j=0;function l$t(e){u$m=[];for(var t=e-1,i=0;i<e;++i,--t)u$m.push(t);s$j=e-1}function B$e(){0==u$m.length&&l$t(e$1U.maxUniformBufferBinding);var e=u$m[s$j];return s$j--,e}function c$n(e){s$j++,u$m[s$j]=e}function f$q(){this.cache={}}function i$p(e,t){this._context=e,this._collection=new o$E,this._gpuBuffer=null,this._lastOffsetInByte=-1,this._uniformBlockSizeInByte=0,this._arrayWriteToGPU=new Float32Array(64),this._bindingPoint=B$e(),this._dataChanged=!1,this._bufferSizeChanged=!1,this._isDynamic=t,this._dataCountInBuffer=0,this._allIndex=[],this._nextUnusedIndex=-1,this._initAllIndex(0)}function p$o(e){for(var t=e$1U.uniformBufferOffsetAlignment;e>t;)t+=e$1U.uniformBufferOffsetAlignment;return t}f$q.get=function(e){return a$p.cache[e]},f$q.create=function(e,t,i){var r=new i$p(e,i);return a$p.cache[t]=r,r},f$q.update=function(e){for(var t in a$p.context=e,a$p.cache)a$p.cache[t].update()},Object.defineProperties(i$p.prototype,{bindingPoint:{get:function(){return this._bindingPoint}}}),i$p.prototype._initAllIndex=function(e){this._allIndex=[];for(var t=e-1,i=0;i<e;++i,--t)this._allIndex.push(t);this._nextUnusedIndex=e-1},i$p.prototype._getUnusedIndex=function(){if(this._nextUnusedIndex<0){var e=this._dataCountInBuffer;this._dataCountInBuffer=0==e?1:2*e,this._initAllIndex(this._dataCountInBuffer),this._nextUnusedIndex-=e,this._bufferSizeChanged=!0}var t=this._allIndex[this._nextUnusedIndex];return this._nextUnusedIndex--,t},i$p.prototype._markIndexAsUnused=function(e){this._nextUnusedIndex++,this._allIndex[this._nextUnusedIndex]=e},i$p.prototype.add=function(e){0==this._uniformBlockSizeInByte&&(this._uniformBlockSizeInByte=p$o(e.sizeInByte));var t=this._getUnusedIndex();return this._collection.set(t,e),this._dataChanged=!0,t},i$p.prototype.removeAt=function(e){this._markIndexAsUnused(e),this._dataChanged=!0,this._collection.removeAt(e)},i$p.prototype.update=function(){var e=this._dataCountInBuffer;if(this._bufferSizeChanged&&(this._reallocateGPUBuffer(e),this._bufferSizeChanged=!1),e$28(this._gpuBuffer)&&(this._dataChanged||this._isDynamic)){var t=this._uniformBlockSizeInByte/Float32Array.BYTES_PER_ELEMENT;this._collection.update(t,this._arrayWriteToGPU);var i=this._context._gl;i.bindBuffer(i.UNIFORM_BUFFER,this._gpuBuffer),i.bufferData(i.UNIFORM_BUFFER,this._arrayWriteToGPU,i.DYNAMIC_DRAW),i.bindBuffer(i.UNIFORM_BUFFER,null),this._dataChanged=!1}this._nextUnusedIndex==this._dataCountInBuffer-1&&this._release()},i$p.prototype._reallocateGPUBuffer=function(e){var t=this._context._gl;e$28(this._gpuBuffer)&&t.deleteBuffer(this._gpuBuffer);var i=e*this._uniformBlockSizeInByte;this._gpuBuffer=t.createBuffer(),t.bindBuffer(t.UNIFORM_BUFFER,this._gpuBuffer),t.bufferData(t.UNIFORM_BUFFER,i,t.DYNAMIC_DRAW),t.bindBuffer(t.UNIFORM_BUFFER,null);var r=this._uniformBlockSizeInByte/Float32Array.BYTES_PER_ELEMENT;this._arrayWriteToGPU=new Float32Array(r*e)},i$p.prototype.bindBufferRange=function(e,t){var i=this._uniformBlockSizeInByte*e;if(this._lastOffsetInByte!=i){var r=this._context._gl;r.bindBufferRange(r.UNIFORM_BUFFER,this._bindingPoint,this._gpuBuffer,i,t),this._lastOffsetInByte=i}},i$p.prototype.isDestroyed=function(){return!1},i$p.prototype.destroy=function(){return this._release(),c$n(this._bindingPoint),destroyObject(this)},i$p.prototype._release=function(){var e=this._context._gl;e$28(this._gpuBuffer)&&(e.deleteBuffer(this._gpuBuffer),this._gpuBuffer=null),this._dataCountInBuffer=0,this._arrayWriteToGPU=null,this._lastOffsetInByte=-1,this._allIndex=[],this._nextUnusedIndex=-1,this._initAllIndex(0)};var a$p=new f$q;function r$u(e,t){this._uniformStructName=t.name,this._context=e;var i=f$q.get(this._uniformStructName);e$28(i)||(i=f$q.create(e,this._uniformStructName,t.isDynamic)),this._index=i.add(t),this._sizeInByte=0,this._refCount=0}f$q.manager=a$p,Object.defineProperties(r$u.prototype,{}),r$u.prototype.bindProgram=function(e){var t=e._program,i=this._context._gl,r=f$q.get(this._uniformStructName),n=e._uniformBlockLocation[this._uniformStructName];if(!e$28(n)){if((n=i.getUniformBlockIndex(t,this._uniformStructName))==i.INVALID_INDEX)return;i.uniformBlockBinding(t,n,r.bindingPoint),e._uniformBlockLocation[this._uniformStructName]=n}0==this._sizeInByte&&(this._sizeInByte=i.getActiveUniformBlockParameter(t,n,i.UNIFORM_BLOCK_DATA_SIZE)),r.bindBufferRange(this._index,this._sizeInByte)},r$u.prototype.increaseRef=function(){this._refCount++},r$u.prototype.decreaseRef=function(){(this._refCount--,0==this._refCount)&&f$q.get(this._uniformStructName).removeAt(this._index);this._refCount<0&&(this._refCount=0)},r$u.prototype.isDestroyed=function(){return!1},r$u.prototype.destroy=function(){return i$Z(this)};var t$i=function(){this._isDynamic=!0,this._name="UniformDataBase",this._sizeInByte=0};function _0x3fa369(){}Object.defineProperties(t$i.prototype,{name:{get:function(){return this._name}},sizeInByte:{get:function(){return this._sizeInByte}},isDynamic:{get:function(){return this._isDynamic}}}),t$i.prototype.writeToFloat32Array=function(e,t){};var _0x201ba9=function(e){function t(t){e.apply(this,arguments),this.layer=t,this._isDynamic=!0,this._name="LayerParameter",this._sizeInByte=64}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.writeToFloat32Array=function(e,t){t$X.pack(this.layer.selectedTranslate,e,t),e[t+3]=this.layer.style3D.bottomAltitude,e[t+4]=this.layer.minTransparentAlpha,e[t+5]=this.layer.maxTransparentAlpha;var i=this.layer._rsColor.polygonOffset;e$28(i)?(e[t+6]=i.factor,e[t+7]=i.units):(e[t+6]=0,e[t+7]=0),e$1S.pack(this.layer.selectedColor,e,t+8),e[t+12]=this.layer.style3D.pointSize},t}(t$i),_0x3ca04e=function(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));function n(t,i){e.apply(this,arguments),this.lightSource=i,this._isDynamic=!0,this._name="LightParameter",this._sizeInByte=48,this.uniformState=t.uniformState}return r(),e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.writeToFloat32Array=function(e,t){e$1S.pack(this.lightSource.ambientLightColor,e,t),t+=4,e$1S.pack(this.lightSource.sunLightColor,e,t),t+=4,t$X.pack(this.uniformState.sunDirectionEC,e,t),t+=3,e[t++]=this.lightSource.sunLightON},n}(t$i),_0x21f825=function(e){function t(t){e.apply(this,arguments),this.materialPass=t,this._isDynamic=!1,this._name="MaterialParameter",this._sizeInByte=104}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.writeToFloat32Array=function(e,t){this.materialPass.isDestroyed()||(e$1S.pack(this.materialPass._ambientColor,e,t),t+=4,e$1S.pack(this.materialPass._diffuseColor,e,t),t+=4,y$15.pack(this.materialPass._texMatrix,e,t),t+=16,e[t++]=e$28(this.materialPass._textures[0])?this.materialPass._textures[0]._width:1,e[t++]=e$28(this.materialPass._textures[1])?this.materialPass._textures[1]._width:1)},t}(t$i),_0x2a93be=new e$25,_0x36cc6b=function(e){function t(t,i,r){e.apply(this,arguments),this.materialPass=r,this.layer=i,this.useLineColor=t.useLineColor,this._isDynamic=!1,this._name="MaterialDynamicParameter",this._sizeInByte=32}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.writeToFloat32Array=function(e,t){_0x2a93be.x=0,_0x2a93be.y=0,_0x2a93be.z=1,_0x2a93be.w=1;var i=this.layer,r=this.materialPass._baseColorTextureMotion;if(e$28(r)){var n=performance.now()/1e3;if(r._offsetPeriod>0){var o=n%r._offsetPeriod;_0x2a93be.x=o*r._offsetSpeedU,_0x2a93be.y=o*r._offsetSpeedV}if(r._tilingPeriod>0){var a=n%r._tilingPeriod;_0x2a93be.z=1+a*r._tilingSpeedU,_0x2a93be.w=1+a*r._tilingSpeedV}}else if(0!==i._textureUVSpeed.x||0!==i._textureUVSpeed.y){var s=performance.now()/1e3;_0x2a93be.x=i._textureUVSpeed.x*s,_0x2a93be.y=i._textureUVSpeed.y*s}e$25.pack(_0x2a93be,e,t),this.useLineColor?e$1S.pack(i.style3D.lineColor,e,t+4):e$1S.pack(i.style3D.fillForeColor,e,t+4)},t}(t$i),_0x45c591=function(e){function t(t,i){e.apply(this,arguments),this.layer=i,this._isDynamic=!1,this._name="WaterParameter",this._sizeInByte=64}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.writeToFloat32Array=function(e,t){o$1k.pack(this.layer._waterParamter.bumpSpeed,e,t),t+=2,e[t++]=this.layer._waterParamter.scale,e[t++]=this.layer._waterParamter.fresnelPower,e[t++]=this.layer._waterParamter.minFresnel,e[t++]=this.layer._waterParamter.maxFresnel,e[t++]=this.layer._waterParamter.noiseScale,e[t++]=this.layer._waterParamter.waterBrightness,e$25.pack(this.layer._waterParamter.tintColour,e,t),t+=4,e$25.pack(this.layer._waterParamter.waterColour,e,t),t+=4},t}(t$i);_0x3fa369.createCommonLayerUniformBuffer=function(e){if(!e._context.webgl2)return null;var t=new _0x201ba9(e);return new r$u(e._context,t)},_0x3fa369.createMaterialUniformBuffer=function(e,t){if(!e._context.webgl2)return null;var i=new _0x21f825(t);return new r$u(e._context,i)},_0x3fa369.createMaterialDynamicUniformBuffer=function(e,t,i){if(!t._context.webgl2)return null;var r=new _0x36cc6b(e,t,i);return new r$u(t._context,r)},_0x3fa369.createLightSourceUniformBuffer=function(e,t){return e.webgl2?new r$u(e,new _0x3ca04e(e,t)):null},_0x3fa369.createWaterUniformBuffer=function(e,t){return e.webgl2?new r$u(e,new _0x45c591(e,t)):null};var _0x4b4edf=(_0x24b6f6=!0,function(e,t){var i=_0x24b6f6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x24b6f6=!1,i}),_0x3a6a37=_0x4b4edf(void 0,(function(){return _0x3a6a37.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a6a37).search("(((.+)+)+)+$")})),_0x24b6f6;_0x3a6a37();var _0x308597="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform float uTransparentFilter;\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\n#ifdef DepthEXT\nvarying float vWindowZ;\n#endif\n\nvoid main()\n{\n#ifdef GL_EXT_frag_depth\n #ifdef DepthEXT\n\t gl_FragDepthEXT = min(vWindowZ * gl_FragCoord.w, 1.0);\n #endif\n#endif\n#ifdef WEBGL2\n #ifdef DepthEXT\n\t gl_FragDepthEXT = min(vWindowZ * gl_FragCoord.w, 1.0);\n #endif\n#endif\n\tif(vColor.a < uTransparentFilter)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n\tgl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n gl_FragColor = vSecondColor;\n}",_0xf013cf=(_0x5522b6=!0,function(e,t){var i=_0x5522b6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5522b6=!1,i}),_0x29839a=_0xf013cf(void 0,(function(){return _0x29839a.toString().search("(((.+)+)+)+$").toString().constructor(_0x29839a).search("(((.+)+)+)+$")})),_0x5522b6;_0x29839a();var _0x27e460="uniform float uTransparentFilter; \nvarying vec4 vSecondColor; \nvarying vec4 vColor;\nvoid main() \n{\n\tif(vColor.a < uTransparentFilter)\n\t{\n\t\tdiscard;\n\t}\n gl_FragColor = vSecondColor; \n}",_0x173eaf=(_0x387d08=!0,function(e,t){var i=_0x387d08?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x387d08=!1,i}),_0x186422=_0x173eaf(void 0,(function(){return _0x186422.toString().search("(((.+)+)+)+$").toString().constructor(_0x186422).search("(((.+)+)+)+$")})),_0x387d08;_0x186422();var _0x31c99f="precision highp float;\nconst float uPixelRatio = 1.0;\n// Inputs\nattribute vec3 aPosition0;\nattribute vec3 aPosition1;\nattribute float batchId;\n// attribute float aVariantOffset;\nattribute float aVariantStroke;\nattribute float aVariantExtension;\n\n#ifdef SILHOUETTE\nattribute vec3 aNormalA;\nattribute vec3 aNormalB;\n#else /* SILHOUETTE */\nattribute vec3 aNormal;\n#endif /* SILHOUETTE */\n\nattribute vec2 aSideness;\n//attribute vec2 aPackedAttributes;\n\nstruct UnpackedAttributes\n{\n vec2 sideness;\n vec2 sidenessNorm;\n float lineWidthPixels;\n float extensionLengthPixels;\n#if (MODE == 2)\n float type;\n#endif\n};\n\n// Output required to compute color\nvarying vec4 vColor;\n// Output required to compute distance to line/caps\nvarying vec3 vPosition; \nvarying vec3 vViewPosition;\nvarying float vRadius;\nvarying float vLineLengthPixels;\nvarying float vSizeFalloffFactor;\nvarying float vDistanceFromEye;\n\nvarying vec2 vStrokeUV;\nuniform vec2 uStrokesTextureScale;\nuniform float uStrokesLog2Resolution;\n\nuniform float uLineWidth;\nuniform vec4 uLineColor;\nuniform vec3 uTranslation;\nconst vec2 uDepthBias = vec2(0.5, -4e-4);\n\n// Utility function to check for NaN values\nbool isNaN(float val)\n{\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n // important: some nVidias failed to cope with version below.\n // Probably wrong optimization.\n /*return ( val <= 0.0 || 0.0 <= val ) ? false : true;*/\n}\n\nvec2 calculateProjectedBiasXY(vec4 projPos, vec3 worldNormal)\n{\n float offsetXY = uDepthBias.x;\n float offsetZ = uDepthBias.y;\n vec4 projNormal = czm_projection * czm_view * vec4(worldNormal, 0.0);\n return offsetXY * projPos.w * 2.0 / czm_viewport.zw * normalize(projNormal.xyz).xy;\n}\n\n// A z-offset, using a depth based heuristic.\nfloat calculateProjectedBiasZ(vec4 projPos)\n{\n float fProjZ = projPos.z / projPos.w;\n if(fProjZ < 0.1)\n {\n return 0.0;\n }\n float offsetZ = uDepthBias.y;\n return sqrt(projPos.z) * offsetZ;\n}\n\nvec4 adjustProjectedPosition(vec4 projPos, vec3 worldNormal, float lineWidth)\n{\n vec2 offsetXY = calculateProjectedBiasXY(projPos, worldNormal);\n // we currently have to do this check because some geometries come with 0 length edge normals.\n if (!isNaN(offsetXY.x) && !isNaN(offsetXY.y))\n {\n projPos.xy += offsetXY;\n }\n#ifdef LOG_DEPTH\n vDistanceFromEye = projPos.w;\n#else\n projPos.z += calculateProjectedBiasZ(projPos);\n#endif\n return projPos;\n}\n\n#if (MODE == 0)\nvoid calculateStyleOutputs(UnpackedAttributes unpackedAttributes)\n{}\n#elif (MODE == 1)\nfloat strokeVariants = 6.0;\nvoid calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) {\n vec2 sidenessNorm = unpackedAttributes.sidenessNorm;\n float lineIndex = clamp(ceil(log2(lineLength)), 0.0, uStrokesLog2Resolution);\n vStrokeUV = vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * strokeVariants + aVariantStroke + 0.5) * uStrokesTextureScale;\n}\nvoid calculateStyleOutputs(UnpackedAttributes unpackedAttributes)\n{\n calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);\n}\n#elif (MODE == 2)\nvarying float vType;\nvoid calculateStyleOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec4 projPos, vec3 worldNormal, UnpackedAttributes unpackedAttributes)\n{\n vType = unpackedAttributes.type;\n if (unpackedAttributes.type <= 0.0)\n {\n calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes);\n }\n}\n#endif\n\n\n// Solid\n#if (MODE == 2 || MODE == 0)\nfloat calculateLineAmplitudeSolid()\n{\n return 0.0;\n}\n#endif\n#if (MODE == 0)\nfloat calculateLineAmplitude(UnpackedAttributes unpackedAttributes)\n{\n return calculateLineAmplitudeSolid();\n}\n#endif\n// Sketch\n#if (MODE == 2 || MODE == 1)\nfloat calculateLineAmplitudeSketch()\n{\n float strokesAmplitude = 6.0;\n return strokesAmplitude;\n}\n#endif\n#if (MODE == 1)\nfloat calculateLineAmplitude(UnpackedAttributes unpackedAttributes)\n{\n return calculateLineAmplitudeSketch();\n}\n#endif\n// Uber\n#if (MODE == 2)\nfloat calculateLineAmplitude(UnpackedAttributes unpackedAttributes)\n{\n float type = unpackedAttributes.type;\n if (type <= 0.0)\n {\n return calculateLineAmplitudeSketch();\n }\n else\n {\n return calculateLineAmplitudeSolid();\n }\n}\n#endif\n\n\nuniform float uDistanceFalloffFactor;\nfloat distanceBasedPerspectiveFactor(float distance)\n{\n return clamp(sqrt(uDistanceFalloffFactor / distance), 0.0, 1.0);\n}\n\n#define COMPONENT_COLOR_FIELD_OFFSET 0.0\n#define COMPONENT_OTHER_FIELDS_OFFSET 1.0\n#define COMPONENT_FIELD_COUNT 2.0\n#define LINE_WIDTH_FRACTION_FACTOR 8.0\n#define EXTENSION_LENGTH_OFFSET 128.0\n#define COMPONENT_TEX_WIDTH 4096.0\n\nstruct ComponentData\n{\n float lineWidth;\n float extensionLength;\n float type;\n};\n\n\nComponentData readComponentData()\n{\n return ComponentData(uLineWidth, 0.0, 0.0);\n}\n\nvec3 modelToWorldNormal(vec3 normal)\n{\n return (czm_model * vec4(normal, 0.0)).xyz;\n}\n\nvec3 silhouetteWorldNormal(vec3 normalA, vec3 normalB)\n{\n return modelToWorldNormal(normalize(normalA + normalB));\n}\n\n// Fall-off extension length for shorter strokes, starting from strokes that are 256 size,\n// fall-off exponentially\nfloat calculateExtensionLength(float extensionLength, float lineLength)\n{\n return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);\n}\n\n#ifdef SILHOUETTE\n// #uniforms: czm_view, czm_model\nbool isSilhouetteEdge(vec4 viewPos, vec3 normalA, vec3 normalB)\n{\n// transform the two face normals\n vec3 viewNormalA = (czm_view * czm_model * vec4(normalA, 0.0)).xyz;\n vec3 viewNormalB = (czm_view * czm_model * vec4(normalB, 0.0)).xyz;\n// compute the direction from the edge to the camera\n vec3 viewDir = -viewPos.xyz;\n// check which of the two faces are visible\n// display the edge if exactly one of the two is visible\n float faceAVisible = dot(viewDir, viewNormalA);\n// positive if visible\n float faceBVisible = dot(viewDir, viewNormalB);\n// positive if visible\n// 1 if exactly one face visible, 0 otherwise\n return faceAVisible * faceBVisible < 0.0;\n}\n#endif /* SILHOUETTE */\n\nvoid clipLineSegmentToNearPlane(vec3 p0,vec3 p1,out bool clipped,out bool culledByNearPlane,out vec4 clippedPositionEC)\n{\n culledByNearPlane = false;\n clipped = false;\n vec3 p0ToP1 = p1 - p0;\n float magnitude = length(p0ToP1);\n vec3 direction = normalize(p0ToP1);\n float endPoint0Distance = czm_currentFrustum.x + p0.z;\n float denominator = -direction.z;\n if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n {\n culledByNearPlane = true;\n }\n else if (endPoint0Distance > 0.0)\n {\n float t = endPoint0Distance / denominator;\n if (t < 0.0 || t > magnitude)\n {\n culledByNearPlane = true;\n }\n else\n {\n p0 = p0 + t * direction;\n p0.z = min(p0.z, -czm_currentFrustum.x);\n clipped = true;\n }\n }\n clippedPositionEC = vec4(p0, 1.0);\n}\n\nvec4 calculateGeometricOutputs(vec4 viewPosV0, vec4 viewPosV1, vec4 worldPosV0, vec4 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes)\n{\n vec2 sideness = unpackedAttributes.sideness;\n vec2 sidenessNorm = unpackedAttributes.sidenessNorm;\n vec4 clippedViewPosV0; bool clippedV0,culledV0; clipLineSegmentToNearPlane(viewPosV0.xyz, viewPosV1.xyz, clippedV0, culledV0, clippedViewPosV0); vec4 clippedViewPosV1; bool clippedV1, culledV1; clipLineSegmentToNearPlane(viewPosV1.xyz, viewPosV0.xyz, clippedV1, culledV1, clippedViewPosV1); vec4 viewPos = mix(clippedViewPosV0, clippedViewPosV1, sidenessNorm.y);\n vViewPosition = viewPos.xyz / viewPos.w;\n vec4 projPosV0 = czm_projection * clippedViewPosV0;\n vec4 projPosV1 = czm_projection * clippedViewPosV1;\n vec4 projPos = czm_projection * viewPos;\n vec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w);\n vec2 uNDCToPixel = vec2(czm_viewport.z / 2.0, czm_viewport.w / 2.0);\n vec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * uNDCToPixel;\n float lineLengthPixels = length(screenSpaceLinePixels);\n float dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels;\n vec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels;\n vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x;\n float falloffFactor = distanceBasedPerspectiveFactor(-viewPos.z) * uPixelRatio;\n float lineWidthPixels = unpackedAttributes.lineWidthPixels * falloffFactor;\n float extensionLengthPixels = calculateExtensionLength(unpackedAttributes.extensionLengthPixels, lineLengthPixels) * falloffFactor;\n float lineAmplitudePixels = calculateLineAmplitude(unpackedAttributes) * uPixelRatio;\n vSizeFalloffFactor = falloffFactor;\n float lineWidthAndAmplitudePixels = lineWidthPixels + lineAmplitudePixels + lineAmplitudePixels;\n float extendedLineLengthPixels = lineLengthPixels + extensionLengthPixels + extensionLengthPixels;\n#ifdef ANTIALIASING\n const float aaPaddingPixels = 1.0;\n // Line size with padding\n float halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + aaPaddingPixels;\n float aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + aaPaddingPixels;\n // Line length with padding\n float aaPaddedLineLengthPixels = extendedLineLengthPixels + aaPaddingPixels + aaPaddingPixels;\n float halfAAPaddedLineLengthPixels = aaPaddedLineLengthPixels * 0.5;\n#else /* ANTIALIASING */\n // Even if there is no AA, we still want to do proper <1px rendering,\n // so we effectively clamp the pixel sizes to minimum of 1px and compute\n // coverage in the fragment shader \n float halfAAPaddedLineWidthAndAmplitudePixels = max(lineWidthAndAmplitudePixels, 1.0) * 0.5;\n float aaPaddedRoundedCapSizePixels = max(lineWidthPixels, 1.0) * 0.5;\n float halfAAPaddedLineLengthPixels = max(extendedLineLengthPixels, 1.0) * 0.5;\n#endif /* ANTIALIASING */\n // Half line width in NDC including padding for anti aliasing\n vec2 uPixelToNDC = vec2(2.0 / czm_viewport.z, 2.0 / czm_viewport.w);\n vec2 halfAAPaddedLineWidthAndAmplitudeNDC = halfAAPaddedLineWidthAndAmplitudePixels * uPixelToNDC;\n vec2 aaPaddedRoundedCapSizeNDC = aaPaddedRoundedCapSizePixels * uPixelToNDC;\n vec2 extensionLengthNDC = extensionLengthPixels * uPixelToNDC;\n // Compute screen space position of vertex, offsetting for line size and end caps\n vec2 ndcOffset = (screenSpaceDirection * sideness.y * (aaPaddedRoundedCapSizeNDC + extensionLengthNDC) + perpendicularScreenSpaceDirection * halfAAPaddedLineWidthAndAmplitudeNDC);\n projPos.xy += ndcOffset * projPos.w;\n projPos.z += (dzPerPixel * (aaPaddedRoundedCapSizePixels + extensionLengthPixels)) * sideness.y * projPos.w;\n projPos = adjustProjectedPosition(projPos, worldNormal, 1.0 + max((lineWidthAndAmplitudePixels - 1.0) * 0.5, 0.0));\n // Line length with end caps\n float aaPaddedLineWithCapsLengthPixels = extendedLineLengthPixels + aaPaddedRoundedCapSizePixels + aaPaddedRoundedCapSizePixels;\n float pixelPositionAlongLine = aaPaddedLineWithCapsLengthPixels * sidenessNorm.y - aaPaddedRoundedCapSizePixels;\n // Position in pixels with origin at first vertex of line segment\n // The line width radius in pixels\n vRadius = lineWidthPixels * 0.5;\n vLineLengthPixels = extendedLineLengthPixels;\n vPosition = czm_writeNonPerspective(vec3(halfAAPaddedLineWidthAndAmplitudePixels * sideness.x, pixelPositionAlongLine, pixelPositionAlongLine / extendedLineLengthPixels), projPos.w);\n#ifdef SILHOUETTE\n gl_Position = isSilhouetteEdge(viewPosV0, aNormalA, aNormalB) ? projPos : vec4(10.0, 10.0, 10.0, 1.0);\n#else /* SILHOUETTE */\n gl_Position = projPos;\n#endif /* SILHOUETTE */\n\n#if (MODE == 2)\n if (unpackedAttributes.type <= 0.0 && lineLengthPixels <= 3.0)\n {\n gl_Position = vec4(10.0, 10.0, 10.0, 1.0);\n }\n#elif (MODE == 1)\n if (lineLengthPixels <= 3.0)\n {\n gl_Position = vec4(10.0, 10.0, 10.0, 1.0); \n }\n#endif\n return projPos;\n}\n\n\n#if (MODE == 2)\nUnpackedAttributes unpackAttributes(ComponentData component)\n{\n vec2 sidenessNorm = aSideness;\n vec2 sideness = sidenessNorm * 2.0 - 1.0;\n float fType = component.type;\n float extensionLengthPixels = component.extensionLength;\n float lineWidth = component.lineWidth;\n if (fType <= 0.0)\n {\n extensionLengthPixels *= aVariantExtension * 2.0 - 1.0;\n }\n return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels, fType);\n}\n#else /* (MODE == 2) */\nUnpackedAttributes unpackAttributes(ComponentData component)\n{\n vec2 sidenessNorm = aSideness;\n vec2 sideness = sidenessNorm * 2.0 - 1.0;\n float extensionLengthPixels = component.extensionLength;\n#if (MODE == 1)\n // extensionLengthPixels = 0.05 * aVariantExtension * 2.0 - 1.0;\n extensionLengthPixels = 5.0;\n#endif\n float lineWidth = component.lineWidth;\n return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels);\n}\n#endif /* (MODE == 2) */\n\nvarying float fSelected;\n#ifdef BatchTable\nuniform sampler2D batchTexture; \nuniform vec4 batchTextureStep;\nvec2 computeSt(float batchId)\n{\n float stepX = batchTextureStep.x;\n float centerX = batchTextureStep.y;\n float numberOfAttributes = float(5);\n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);\n}\nvec4 czm_batchTable_operation(float batchId)\n{\n vec2 st = computeSt(batchId);\n st.x += batchTextureStep.x * float(1);\n vec4 textureValue = texture2D(batchTexture, st);\n vec4 value = textureValue;\n return value;\n}\nvec3 czm_batchTable_translate(float batchId) \n{\n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float(3); \n vec4 textureValue = texture2D(batchTexture, st); \n vec3 value = textureValue.xyz; \n return value; \n} \n#endif\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n uniform mat4 uGeoMatrix;\n#endif\nvoid s3mBatchOperation(vec4 operationType, inout vec4 vertexColor, inout vec4 vertexPos_0, inout vec4 vertexPos_1, vec3 translation,inout float fSelected)\n{\n operationType.x += 0.001;\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isSetColor = fract(right_2);\n if(isSetColor > 0.1)\n {\n fSelected = 1.0;\n }\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n fSelected = 1.0;\n }\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n float isOffset = fract(floor(right_8)* 0.5);\n if(isOffset > 0.1)\n {\n vertexPos_0.xyz += translation;\n vertexPos_1.xyz += translation;\n }\n}\nvoid main()\n{\n fSelected = 0.0;\n ComponentData component = readComponentData();\n UnpackedAttributes unpackedAttributes = unpackAttributes(component);\n vec4 vertexPos0 = vec4(aPosition0, 1.0);\n vec4 vertexPos1 = vec4(aPosition1, 1.0);\n vec3 translate = uTranslation;\n#ifdef BatchTable\n #ifdef Translation\n translate = czm_batchTable_translate(batchId);\n #endif\n vColor = uLineColor;\n vec4 operationType = czm_batchTable_operation(batchId);\n s3mBatchOperation(operationType, vColor, vertexPos0, vertexPos1, translate, fSelected);\n#endif\n vec4 worldPosV0 = czm_model * vertexPos0;\n vec4 worldPosV1 = czm_model * vertexPos1;\n vec4 viewPosV0 = czm_modelView * vertexPos0;\n vec4 viewPosV1 = czm_modelView * vertexPos1;\n#ifdef SILHOUETTE\n vec3 worldNormal = silhouetteWorldNormal(aNormalA, aNormalB);\n#else /* SILHOUETTE */\n vec3 worldNormal = modelToWorldNormal(aNormal);\n#endif /* SILHOUETTE */\n // General geometric computation for all types of edges\n vec4 projPos = calculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal, unpackedAttributes);\n calculateStyleOutputs(unpackedAttributes);\n#ifdef EXCAVATION\n vec3 vertexPos = mix(aPosition0.xyz, aPosition1.xyz, aSideness.y);\n vExcavationVertexPos = uGeoMatrix * vec4(vertexPos.xyz, 1.0);\n#endif\n}",_0x22e8fe=(_0x53c59d=!0,function(e,t){var i=_0x53c59d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x53c59d=!1,i}),_0x4233e0=_0x22e8fe(void 0,(function(){return _0x4233e0.toString().search("(((.+)+)+)+$").toString().constructor(_0x4233e0).search("(((.+)+)+)+$")})),_0x53c59d;_0x4233e0();var _0x2252ea="precision highp float;\n\nvarying vec4 vColor;\nvarying float vRadius;\nvarying vec3 vPosition;\nvarying vec3 vViewPosition;\nvarying float vLineLengthPixels;\nvarying float vSizeFalloffFactor;\nvarying float vDistanceFromEye;\nvarying vec2 vStrokeUV;\nuniform sampler2D uStrokesTexture;\nvarying float vVariantExtension;\nvarying float fSelected;\n\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\n// At which coverage threshold we discard a fragment completely\n#define COVERAGE_TEST_THRESHOLD 0.01\nconst float nearRange = 1000.0;\nconst float farRange = 20000.0;\n\n// Sketch\n#if (MODE == 1)\nconst vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n}\nfloat calculateLineOffsetSketch()\n{\n float strokesNormalizationScale = 16.0;\n float offsetNorm = rgba2float(texture2D(uStrokesTexture, vStrokeUV));\n return (offsetNorm - 0.5) * strokesNormalizationScale;\n}\nfloat calculateLineOffset()\n{\n return calculateLineOffsetSketch();\n}\nfloat calculateLinePressureSketch() {\n return rgba2float(texture2D(uStrokesTexture, vStrokeUV + vec2(0.0, 0.5)));\n}\nfloat calculateLinePressure()\n{\n return calculateLinePressureSketch();\n}\n#endif\n\n// Solid\n#if (MODE == 2 || MODE == 0)\nfloat calculateLineOffsetSolid()\n{\n return 0.0;\n}\nfloat calculateLinePressureSolid()\n{\n return 1.0;\n}\n#endif\n\n#if (MODE == 0)\nfloat calculateLineOffset()\n{\n return calculateLineOffsetSolid();\n}\nfloat calculateLinePressure()\n{\n return calculateLinePressureSolid();\n}\n#endif\n\n// Uber\n#if (MODE == 2)\nvarying float vType;\nfloat calculateLineOffset()\n{\n if (vType <= 0.0)\n {\n return calculateLineOffsetSketch();\n }\n else\n {\n return calculateLineOffsetSolid();\n }\n}\n\nfloat calculateLinePressure()\n{\n if (vType <= 0.0)\n {\n return calculateLinePressureSketch();\n }\n else\n {\n return calculateLinePressureSolid();\n }\n}\n#endif\n\nvec2 lineWithCapsDistance(float radius, vec2 position, float lineLength)\n{\n float lineOffset = calculateLineOffset();\n float positionX = position.x - lineOffset;\n if (radius < 1.0)\n {\n float coverageX = clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0);\n float coverageY = clamp(min(lineLength, position.y + 0.5) - max(0.0, position.y - 0.5), 0.0, 1.0);\n float coverage = min(coverageX, coverageY);\n return vec2(0.5 - coverage, 0.0);\n }\n else\n {\n // Between -radius -> 0 for start cap, 0 for line, 0 -> radius\n float positionOnCap = position.y - clamp(position.y, 0.0, lineLength);\n vec2 lineToPosition = vec2(positionX, positionOnCap);\n return vec2(length(lineToPosition) - radius, positionOnCap / radius);\n }\n}\n\nvoid main()\n{\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n vec3 realPosition = czm_readNonPerspective(vPosition, gl_FragCoord.w);\n float radius = vRadius * calculateLinePressure();\n vec2 distance = lineWithCapsDistance(radius, realPosition.xy, vLineLengthPixels);\n float coverage = clamp(0.5 - distance.x, 0.0, 1.0);\n#ifdef ANTIALIASING\n const float coverageLimit = COVERAGE_TEST_THRESHOLD;\n#else\n /* ANTIALIASING */\n // Use subpixel coverage computation when lines get subpixel widths\n // so we still render them appropriately. Otherwise discard anything\n // that is not fully within the line\n float coverageLimit = radius <= 0.5 ? COVERAGE_TEST_THRESHOLD : 0.75;\n#endif /* ANTIALIASING */\n if (coverage < coverageLimit || vColor.a < 0.1)\n {\n discard;\n }\n#ifdef WIREFRAME_SELECT_TYPE\n if(fSelected < 0.1)\n {\n discard;\n }\n#endif\n float alpha = vColor.a * coverage;\n gl_FragColor = vec4(vColor.rgb, alpha);\n#ifdef CLIP\n gl_FragColor *= czm_clip(vec4(vViewPosition, 1.0), 1.0);\n#endif\n#ifdef APPLY_SWIPE\n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n float attenuation = 1.0 - smoothstep(nearRange, farRange, vDistanceFromEye);\n gl_FragColor.a *= attenuation;\n czm_writeLogDepth();\n}",_0x38b805=(_0xe13554=!0,function(e,t){var i=_0xe13554?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xe13554=!1,i}),_0x5eecee=_0x38b805(void 0,(function(){return _0x5eecee.toString().search("(((.+)+)+)+$").toString().constructor(_0x5eecee).search("(((.+)+)+)+$")})),_0xe13554;function _0x34bd01(e){this._ambientColor=new e$1S(1,1,1,1),this._diffuseColor=new e$1S(1,1,1,1),this._specularColor=new e$1S(0,0,0,0),this._shininess=50,this._bTransparentSorting=!1,this._textures=[],this._texMatrix=new y$15,this._usePBR=!1,this._isInvalidOblique=!1,this._usePBRTextureBatch=!1,this._alphaMode=void 0,this._isKTK2=!1,this._RGBTOBGR=!1,e$28(e)&&(e$28(e.ambient)&&(this._ambientColor=e$25.clone(e.ambient)),e$28(e.diffuse)&&(this._diffuseColor=e$25.clone(e.diffuse)),e$28(e.specular)&&(this._specularColor=e$25.clone(e.specular)),this._shininess=e.shininess||50,this._bTransparentSorting=e.bTransparentSorting||!1,this._textures=e.textures||[]),this._mapTextures={}}_0x5eecee(),Object.defineProperties(_0x34bd01.prototype,{hasTexture:{get:function(){return this._textures.length>0||(e$28(this.baseColorTexture)||e$28(this.normalTexture)||e$28(this.emissiveTexture)||e$28(this.metallicRoughnessTexture)||e$28(this.occlusionTexture)||e$28(this.pbrParamTexture))}}}),_0x34bd01.prototype.clone=function(e){for(var t in e$28(e)||(e=new _0x34bd01({})),e._ambientColor=e$1S.clone(this._ambientColor),e._diffuseColor=e$1S.clone(this._diffuseColor),e._specularColor=e$1S.clone(this._specularColor),e._bTransparentSorting=this._bTransparentSorting,e._shininess=this._shininess,e._texMatrix=y$15.clone(this._texMatrix),e._usePBR=this._usePBR,e._alphaMode=this._alphaMode,e._isInvalidOblique=this._isInvalidOblique,e._isKTK2=this._isKTK2,e._RGBTOBGR=this._RGBTOBGR,this._usePBR&&(e._alphaCutoff=this._alphaCutoff,e._baseColor=e$1S.clone(this._baseColor),e._baseColorTextureIndex=this._baseColorTextureIndex,e._baseColorTextureCoordIndex=this._baseColorTextureCoordIndex,e._doubleSided=this._doubleSided,e._emissiveFactor=e$1S.clone(this._emissiveFactor),e._emissiveTextureIndex=this._emissiveTextureIndex,e._emissiveTextureCoordIndex=this._emissiveTextureCoordIndex,e._roughnessFactor=this._roughnessFactor,e._metallicFactor=this._metallicFactor,e._metallicRoughnessTextureIndex=this._metallicRoughnessTextureIndex,e._metallicRoughnessTextureCoordIndex=this._metallicRoughnessTextureCoordIndex,e._normalTextureIndex=this._normalTextureIndex,e._normalTextureCoordIndex=this._normalTextureCoordIndex,e._normalTextureScale=this._normalTextureScale,e._occlusionTextureIndex=this._occlusionTextureIndex,e._occlusionTextureCoordIndex=this._occlusionTextureCoordIndex,e._occlusionTextureStrength=this._occlusionTextureStrength,e._baseColorTextureMotion=new _0x59bf6b,e._baseColorTextureMotion.clone(this._baseColorTextureMotion),e._emissiveTextureMotion=new _0x59bf6b,e._emissiveTextureMotion.clone(this._emissiveTextureMotion),e._usePBRTextureBatch=this._usePBRTextureBatch,e.baseColorTexture=this.baseColorTexture,e.normalTexture=this.normalTexture,e.emissiveTexture=this.emissiveTexture,e.metallicRoughnessTexture=this.metallicRoughnessTexture,e.occlusionTexture=this.occlusionTexture,e.pbrParamTexture=this.pbrParamTexture),this._textures){!e$28(i=this._textures[t])||(this._isKTK2?i._context._textureCache.getTexture(i.keyword):Se$8.AddRef(i.id),e._textures[t]=this._textures[t])}for(var t in this._mapTextures){var i;!e$28(i=this._mapTextures[t])||(Se$8.AddRef(i.id),e._mapTextures[t]=this._mapTextures[t])}},_0x34bd01.prototype.requestSharedTexture=function(e,t,i,r,n,o,a,s){var l=Se$8._shareTexturePromiseCache[e];e$28(l)||(l=o$$(e,o),Se$8._shareTexturePromiseCache[e]=l);var u=this;return o$1q(l,(function(i){var o,l,c=new Uint32Array(i,0,6),h=c[0],d=c[1],f=c[2],p=c[3],_=c[4],m=c[5],$=new Uint8Array(i,24,m);try{var g=nt$c.inflate($).buffer;l=new Uint8Array(g,0,_)}catch{m===_&&(l=$)}o=Se$8.CreateTexture(t,r,d,f,p,h,l,!1,a,s);var v=u._baseColorTextureIndex===n,y=u._emissiveTextureIndex===n,x=u._normalTextureIndex===n,b=u._metallicRoughnessTextureIndex===n,w=u._occlusionTextureIndex===n;v?u.baseColorTexture=o:y?u.emissiveTexture=o:x?u.normalTexture=o:b?u.metallicRoughnessTexture=o:w&&(u.occlusionTexture=o),0===n&&u._textures.length>0?u._textures.splice(0,0,o):u._textures.push(o),delete Se$8._shareTexturePromiseCache[e]})),l},_0x34bd01.prototype.createWebp=function(e,t,i,r,n,o,a,s,l,u,c){var h=Se$8.textureManager.textures[e];if(c=u$Y(c,!0),e$28(h))return this._textures.push(h),Se$8.textureManager.refCounts[e]++,h;for(var d=n.length,f=n.byteOffset,p=new DataView(n.buffer),_=0,m=[];_<d;){var $=p.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT,_+=Uint32Array.BYTES_PER_ELEMENT;var g=n.subarray(_,_+$);f+=$,_+=$;var v=w$B({uint8Array:g,format:"image/webp"});m.push(v)}var y=this;return o$1q.all(m,(function(t){var n=t[0];if(e$28(n)){var o=!0;(!e$27.isPowerOfTwo(n.width)||!e$27.isPowerOfTwo(n.height))&&(s=q$11.CLAMP_TO_EDGE,l=q$11.CLAMP_TO_EDGE,o=!1),o=o&&c;var a=t.slice(1),u=new L$17({context:i,source:n,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({wrapS:s,wrapT:l,minificationFilter:0!==t.length&&o?tt$h.LINEAR_MIPMAP_LINEAR:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR}),mipLevels:a});u.id=e,Se$8.textureManager.textures[e]=u,Se$8.textureManager.refCounts[e]=1,0===r&&y._textures.length>0?y._textures.splice(0,0,u):y._textures.push(u)}})).otherwise((function(e){console.error(e)}))},_0x34bd01.prototype.createJPGPNG=function(e,t,i,r,n,o,a){var s=Se$8.textureManager.textures[e];if(e$28(s))return this._textures.push(s),Se$8.textureManager.refCounts[e]++,s;var l=[],u="image/jpeg";"png"===a&&(u="image/png");var c=w$B({uint8Array:r,format:u});l.push(c);var h=this,d=o$1q.defer();return o$1q.all(l,(function(r){var a=r[0];if(e$28(a)){(!e$27.isPowerOfTwo(a.width)||!e$27.isPowerOfTwo(a.height))&&(n=q$11.CLAMP_TO_EDGE,o=q$11.CLAMP_TO_EDGE);var s=new L$17({context:t,source:a,pixelFormat:V$O.RGBA,flipY:!0,sampler:new n$Y({wrapS:n,wrapT:o,minificationFilter:(r.length,tt$h.LINEAR),magnificationFilter:rt$g.LINEAR})});s.id=e,Se$8.textureManager.textures[e]=s,Se$8.textureManager.refCounts[e]=1,to._memTextureAdded(s._sizeInBytes),0===i&&h._textures.length>0?h._textures.splice(0,0,s):h._textures.push(s),d.resolve(s)}})).otherwise((function(e){console.error(e)})),d.promise},_0x34bd01.prototype.createPBRParamter=function(e){if(e$28(e.pbrMetallicRoughness)){var t=e.pbrMetallicRoughness;this._usePBR=!0,this._alphaCutoff=u$Y(t.alphaCutoff,e.alphaCutoff),this._alphaMode=u$Y(t.alphaMode,e.alphaMode),this._baseColor=new e$1S(t.baseColor.x,t.baseColor.y,t.baseColor.z,t.baseColor.w),this._baseColorTextureIndex=t.baseColorTextureIndex,this._baseColorTextureCoordIndex=t.baseColorTextureCoordIndex,this._doubleSided=t.doubleSided,this._emissiveFactor=new e$1S(t.emissiveFactor.x,t.emissiveFactor.y,t.emissiveFactor.z,1),this._emissiveTextureIndex=t.emissiveTextureIndex,this._emissiveTextureCoordIndex=t.emissiveTextureCoordIndex,this._roughnessFactor=t.roughnessFactor,this._metallicFactor=t.metallicFactor,this._metallicRoughnessTextureIndex=t.metallicRoughnessTextureIndex,this._metallicRoughnessTextureCoordIndex=t.metallicRoughnessTextureCoordIndex,this._normalTextureIndex=t.normalTextureIndex,this._normalTextureCoordIndex=t.normalTextureCoordIndex,this._normalTextureScale=t.normalTextureScale,this._occlusionTextureIndex=t.occlusionTextureIndex,this._occlusionTextureCoordIndex=t.occlusionTextureCoordIndex,this._occlusionTextureStrength=t.occlusionTextureStrength,this._baseColorTextureMotion=new _0x59bf6b(t.baseColorTextureMotion),this._emissiveTextureMotion=new _0x59bf6b(t.emissiveTextureMotion),this.baseColorTexture=t.baseColorTexture,this.normalTexture=t.normalTexture,this.emissiveTexture=t.emissiveTexture,this.metallicRoughnessTexture=t.metallicRoughnessTexture,this.occlusionTexture=t.occlusionTexture}},_0x34bd01.prototype.createCRN=function(e,t,i,r,n,o,a,s,l,u){var c;if(l=u$Y(l,!0),s?c=a$R(n.imageBuffer,!0,!0):_0x333f13.CRNTaskProcessorReady&&(c=h$M(_0x333f13.CRNProcessor,n.imageBuffer,!0)),e$28(c)){var h=this;return c.then((function(t){if(!h.isDestroyed()){u=u$Y(u,{});var s=Se$8.CreateTexture(e,i,n.width,n.height,n.nFormat,_0xbc8ee1.enrS3TCDXTN,t.bufferView,!1,o,a,l);u.isEmissiveTex?h.emissiveTexture=s:u.isNormalTexture?h.normalTexture=s:u.isMetallicRoughnessTexture?h.metallicRoughnessTexture=s:u.isBaseColorTexture?h.baseColorTexture=s:0===r&&h._textures.length>0?h._textures.splice(0,0,s):h._textures.push(s)}})),c}},_0x34bd01.prototype.createKTX2=function(e,t,i,r,n,o,a,s,l){this._isKTK2=!0;var u=i._textureCache.getTexture(e);if(s=u$Y(s,!0),e$28(u))return this._textures.push(u),u;var c=f$U(n.imageBuffer,n.id);if(e$28(c)){var h=this;return c.then((function(t){l=u$Y(l,{});var n=i._textureCache.getTexture(e);if(e$28(n))h._textures.push(n);else{var u,c=0;Array.isArray(t)&&(c=t.length,u=t.slice(1,t.length).map((function(e){return e.bufferView})),t=t[0]);var d=!0;(!e$27.isPowerOfTwo(t.width)||!e$27.isPowerOfTwo(t.height))&&(o=q$11.CLAMP_TO_EDGE,a=q$11.CLAMP_TO_EDGE,d=!1),s||(c=0,u=void 0,d=!1);var f=new n$Y({wrapS:o,wrapT:a,minificationFilter:0!==c&&d?tt$h.LINEAR_MIPMAP_LINEAR:tt$h.LINEAR,magnificationFilter:tt$h.LINEAR});(n=e$28(t.internalFormat)?new L$17({context:i,pixelFormat:t.internalFormat,width:t.width,height:t.height,source:{arrayBufferView:t.bufferView,mipLevels:u},sampler:f}):new L$17({context:i,source:t,sampler:f})).keyword=e,l.isEmissiveTex?h.emissiveTexture=n:l.isNormalTexture?h.normalTexture=n:l.isMetallicRoughnessTexture?h.metallicRoughnessTexture=n:l.isBaseColorTexture?h.baseColorTexture=n:0===r&&h._textures.length>0?h._textures.splice(0,0,n):h._textures.push(n),i._textureCache.addTexture(e,n)}})).otherwise((function(e){console.log(e)})),c}},_0x34bd01.prototype.createCommonParamter=function(e){var t=u$Y(e.ambient,e$1S.WHITE);this._ambientColor=new e$1S(t.r,t.g,t.b,t.a);var i=u$Y(e.diffuse,e$1S.WHITE);this._diffuseColor=new e$1S(i.r,i.g,i.b,i.a);var r=u$Y(e.specular,e$1S.WHITE);this._specularColor=new e$1S(r.r,r.g,r.b,r.a),this._shininess=u$Y(e.shininess,10),this._bTransparentSorting=u$Y(e.transparentsorting,!1)};var _0x198889=new e$25;function _0x59bf6b(e){if(!e$28(e))return this.OffsetPeriod=0,this.OffsetSpeedU=0,this.OffsetSpeedV=0,this.TilingPeriod=0,this.TilingSpeedU=0,void(this.TilingSpeedV=0);this.OffsetPeriod=u$Y(e.OffsetPeriod,e.offsetPeriod),this.OffsetSpeedU=u$Y(e.OffsetSpeedU,e.offsetSpeedU),this.OffsetSpeedV=u$Y(e.OffsetSpeedV,e.offsetSpeedV),this.TilingPeriod=u$Y(e.TilingPeriod,e.tilingPeriod),this.TilingSpeedU=u$Y(e.TilingSpeedU,e.tilingSpeedU),this.TilingSpeedV=u$Y(e.TilingSpeedV,e.tilingSpeedV)}_0x34bd01.prototype.createPBRUniformMap=function(){var e={};if(!this._usePBR)return e;var t=this;e.u_metallicFactor=function(){return t._metallicFactor},e.u_roughnessFactor=function(){return t._roughnessFactor},e.u_emissiveFactor=function(){return t._emissiveFactor},e.u_baseColorFactor=function(){return t._baseColor},e.u_alphaCutoff=function(){return t._alphaCutoff},e.u_baseColorTexture=function(){return t._textures[t._baseColorTextureIndex]},e.u_metallicRoughnessTexture=function(){return t._textures[t._metallicRoughnessTextureIndex]},e.u_normalTexture=function(){return t._textures[t._normalTextureIndex]},e.u_occlusionTexture=function(){return t._textures[t._occlusionTextureIndex]},e.u_emissiveTexture=function(){return t._textures[t._emissiveTextureIndex]};var i=t._emissiveTextureMotion;e.u_emissiveUVOffsetAndTiling=function(){var e=performance.now()/1e3;if(i._offsetPeriod>0){var t=e%i._offsetPeriod;_0x198889.x=t*i._offsetSpeedU,_0x198889.y=t*i._offsetSpeedV}else _0x198889.x=0,_0x198889.y=0;if(i._tilingPeriod>0){var r=e%i._tilingPeriod;_0x198889.z=1+r*i._tilingSpeedU,_0x198889.w=1+r*i._tilingSpeedV}else _0x198889.z=1,_0x198889.w=1;return _0x198889};var r=t._baseColorTextureMotion;return e.u_baseColorUVOffsetAndTiling=function(){var e=performance.now()/1e3;if(r._offsetPeriod>0){var t=e%r._offsetPeriod;_0x198889.x=t*r._offsetSpeedU,_0x198889.y=t*r._offsetSpeedV}else _0x198889.x=0,_0x198889.y=0;if(r._tilingPeriod>0){var i=e%r._tilingPeriod;_0x198889.z=1+i*r._tilingSpeedU,_0x198889.w=1+i*r._tilingSpeedV}else _0x198889.z=1,_0x198889.w=1;return _0x198889},e},_0x34bd01.prototype.appendPBRMacroToShader=function(e,t){!this._usePBR||(e.defines.push("USE_PBR"),t.defines.push("USE_PBR"),this._baseColorTextureIndex>=0&&t.defines.push("HAS_BASECOLOR_TEXTURE"),this._normalTextureIndex>=0&&t.defines.push("HAS_NORMAL_TEXTURE"),this._metallicRoughnessTextureIndex>=0&&t.defines.push("HAS_METALLICROUGHNESS_TEXTURE"),this._occlusionTextureIndex>=0&&t.defines.push("HAS_OCCLUSION_TEXTURE"),this._emissiveTextureIndex>=0&&t.defines.push("HAS_EMISSIVE_TEXTURE"),this._doubleSided&&t.defines.push("DOUBLE_SIDED"))},_0x34bd01.Default=new _0x34bd01,_0x34bd01.prototype.isDestroyed=function(){return!1},_0x34bd01.prototype.destroy=function(){for(var e in this._ambientColor=null,this._diffuseColor=null,this._specularColor=null,this._textures){e$28(t=this._textures[e])&&(this._isKTK2?t.destroy():Se$8.DestroyTexture(t.id))}for(var e in this._mapTextures){var t;e$28(t=this._mapTextures[e])&&Se$8.DestroyTexture(t.id)}return i$Z(this)},_0x59bf6b.prototype.clone=function(e){this.OffsetPeriod=e.OffsetPeriod,this.OffsetSpeedU=e.OffsetSpeedU,this.OffsetSpeedV=e.OffsetSpeedV,this.TilingPeriod=e.TilingPeriod,this.TilingSpeedU=e.TilingSpeedU,this.TilingSpeedV=e.TilingSpeedV};var _0x44d70a=(_0x5794a7=!0,function(e,t){var i=_0x5794a7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5794a7=!1,i}),_0x5b0933=_0x44d70a(void 0,(function(){return _0x5b0933.toString().search("(((.+)+)+)+$").toString().constructor(_0x5b0933).search("(((.+)+)+)+$")})),_0x5794a7;_0x5b0933();var _0x50b1f5={EXCAVATION:"EXCAVATION",FALTTEN:"FALTTEN",OVERLAY:"OVERLAY",HYPSOMETRIC:"HYPSOMETRIC",ADJUST_COLOR:"ADJUST_COLOR",TRANSPARENT_BACK_COLOR:"TRANSPARENT_BACK_COLOR",HORIZONTAL_LINE:"HORIZONTAL_LINE",COMPUTE_W_VALUE:"COMPUTE_W_VALUE",COMPUTE_TEXCOORD:"COMPUTE_TEXCOORD",HAS_LIGHT:"HAS_LIGHT",HAS_NORMAL:"HAS_NORMAL",REPLACE_SELECT_TYPE:"REPLACE_SELECT_TYPE",SILHOUETTE_SELECT_TYPE:"SILHOUETTE_SELECT_TYPE",MULTI_TEX:"MULTI_TEX",APPLY_SPLIT:"APPLY_SPLIT",APPLY_SWIPE:"APPLY_SWIPE",TEXCOORD:"TexCoord",TEXCOORD2:"TexCoord2",COMPRESS_VERTEX:"COMPRESS_VERTEX",COMPRESS_NORMAL:"COMPRESS_NORMAL",COMPRESS_COLOR:"COMPRESS_COLOR",COMPRESS_TEXCOORD:"COMPRESS_TEXCOORD",SKETCH_MODE:"SKETCH_MODE",NORMAL_AND_DEPTH:"NORMAL_AND_DEPTH",POST_EFFECT:"POST_EFFECT",CLIP_FILT_BY_ID:"CLIP_FILT_BY_ID",CLIP:"CLIP",CLIPPLANE:"CLIPPLANE",PBR:"PBR",PT_CLOUD:"PT_CLOUD",DIR_LIGHTS:"DIR_LIGHTS ",POINT_LIGHTS:"POINT_LIGHTS ",SPOT_LIGHTS:"SPOT_LIGHTS ",HEMISPHERE_LIGHTS:"HEMISPHERE_LIGHTS ",W_VISIBLE:"W_VISIBLE",EMISSION_TEXTURE:"EMISSION_TEXTURE",EMISSION_TEXTURE_COUNT:"EMISSION_TEXTURE_COUNT ",TEXTURE_MOVE:"TEXTURE_MOVE",VOLUME:"Volume",VOLUME2:"Volume2",TEXTURE_COORD_ONE_IS_W:"TEXTURE_COORD_ONE_IS_W",TRIANGLE_FILTRATE:"TRIANGLE_FILTRATE",UseInstanceSkeletonMatrix:"UseInstanceSkeletonMatrix",RGBTOBGR:"RGBTOBGR",HAS_SKELETONSELECTED:"HAS_SKELETONSELECTED",SKELETONSELECT_ENABLE:"SKELETONSELECT_ENABLE",REPLACE_COLOR_TYPE:"REPLACE_COLOR_TYPE",INVALID_OBLIQUE:"INVALID_OBLIQUE",IGNORE_NORMAL:"IGNORE_NORMAL",TextureBatch:"TextureBatch",Translation:"Translation",VOL_AND_HYP:"VOL_AND_HYP",VERTEX_CAPTURE:"VERTEX_CAPTURE",SEC_TEX_EMISSION:"SEC_TEX_EMISSION",BRDF:"BRDF",PBR_THEME:"PBR_THEME",IBL:"IBL",POINT:"POINT",HAS_BASE_TEXTURE:"HAS_BASE_TEXTURE",HAS_NORMAL_TEXTURE:"HAS_NORMAL_TEXTURE",HAS_OCCLUSION_TEXTURE:"HAS_OCCLUSION_TEXTURE",HAS_EMISSIVE_TEXTURE:"HAS_EMISSIVE_TEXTURE",REFRACTION:"REFRACTION",HAS_ANISOTROPY:"HAS_ANISOTROPY",HAS_CLEARCOAT:"HAS_CLEARCOAT",HAS_VOLUME:"HAS_VOLUME",HAS_TRANSMISSION:"HAS_TRANSMISSION",USE_BatchPBR:"USE_BatchPBR",HAS_DIR_LIGHTS:"HAS_DIR_LIGHTS",HAS_POINT_LIGHTS:"HAS_POINT_LIGHTS",HAS_SPOT_LIGHTS:"HAS_SPOT_LIGHTS",HAS_HEMISPHERE_LIGHTS:"HAS_HEMISPHERE_LIGHTS",NO_TEXCOORD:"NO_TEXCOORD",FLOOD_ANALYSIS:"FLOOD_ANALYSIS",HAS_RAIN:"HAS_RAIN",HAS_WETNESS:"HAS_WETNESS",HAS_SNOW:"HAS_SNOW",HAS_MetallicRoughness_TEXTURE:"HAS_MetallicRoughness_TEXTURE",FusionMode:"FusionMode",VISIBLEDISTANCEMAX:"VISIBLEDISTANCEMAX",MASK:"MASK",LineVector:"LineVector",KtxEnvMap:"KtxEnvMap",WIREFRAME_SELECT_TYPE:"WIREFRAME_SELECT_TYPE",UseFloatTexture:"UseFloatTexture"},H$r=Object.freeze(_0x50b1f5),_0x3d5bcf=(_0x121338=!0,function(e,t){var i=_0x121338?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x121338=!1,i}),_0xd6190c=_0x3d5bcf(void 0,(function(){return _0xd6190c.toString().search("(((.+)+)+)+$").toString().constructor(_0xd6190c).search("(((.+)+)+)+$")})),_0x121338;_0xd6190c();var _0x19b3c0={S3M:49,S3M4:1},_0x2528fb=Object.freeze(_0x19b3c0),_0x959536=(_0x47d0fa=!0,function(e,t){var i=_0x47d0fa?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x47d0fa=!1,i}),_0x3a980d=_0x959536(void 0,(function(){return _0x3a980d.toString().search("(((.+)+)+)+$").toString().constructor(_0x3a980d).search("(((.+)+)+)+$")})),_0x47d0fa;_0x3a980d();var _0x4e0f54={RESET:0,SetColor:1,SELECTED:2,HIDE:4,OFFSET:8,CLIP:16,BLOOM:32,ALL:255},_0xfef200=Object.freeze(_0x4e0f54),_0x47fcd7=(_0x29a86f=!0,function(e,t){var i=_0x29a86f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x29a86f=!1,i}),_0xbe7e98=_0x47fcd7(void 0,(function(){return _0xbe7e98.toString().search("(((.+)+)+)+$").toString().constructor(_0xbe7e98).search("(((.+)+)+)+$")})),_0x29a86f;_0xbe7e98();var _0x58b992={DIRECTIONAL:0,POINT:1,SPOT:2,HEMISPHERE:3},w$i=Object.freeze(_0x58b992),_0x40ed2b=(_0x20e470=!0,function(e,t){var i=_0x20e470?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x20e470=!1,i}),_0x361aa5=_0x40ed2b(void 0,(function(){return _0x361aa5.toString().search("(((.+)+)+)+$").toString().constructor(_0x361aa5).search("(((.+)+)+)+$")})),_0x20e470;_0x361aa5();var _0x4366dc={POINT:0,VOXEL:1},_0x5a7173=Object.freeze(_0x4366dc),_0x18a2a0=(_0x3b8f2d=!0,function(e,t){var i=_0x3b8f2d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3b8f2d=!1,i}),_0x1c8b46=_0x18a2a0(void 0,(function(){return _0x1c8b46.toString().search("(((.+)+)+)+$").toString().constructor(_0x1c8b46).search("(((.+)+)+)+$")})),_0x3b8f2d;_0x1c8b46();var _0x1cd34b={NONE:0,TITANIUM_SCUFFED:1,METAL_PLATE:2,EMISSION:4,ROUGHNESS:8},je$b=Object.freeze(_0x1cd34b),_0x5bf2d3=(_0x2a3e4f=!0,function(e,t){var i=_0x2a3e4f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2a3e4f=!1,i}),_0x173c88=_0x5bf2d3(void 0,(function(){return _0x173c88.toString().search("(((.+)+)+)+$").toString().constructor(_0x173c88).search("(((.+)+)+)+$")})),_0x2a3e4f;_0x173c88();var z$m="uniform float uTransparentFilter; \n#ifdef SQRESULT\nuniform sampler2D uFrontColorTexture;\nuniform sampler2D uFrontDepthTexture;\nuniform sampler2D uBackDepthTexture;\nuniform float uSQMode; \nvarying vec4 vSecondColor; \nvarying vec4 vColor;\nvarying vec4 vPrjPos; \n#endif\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef SQRESULT\nbool isPointInObject(vec4 xyPos)\n{\n bool bIn = false;\n vec4 color = texture2D(uFrontColorTexture,xyPos.xy);\n if(color.r > 0.99 && color.g < 0.01 && color.b < 0.01)\n {\n float depthNear = czm_unpackDepth(texture2D(uFrontDepthTexture,xyPos.xy));\n depthNear = czm_reverseLogDepth(depthNear);\n float depthFar = czm_unpackDepth(texture2D(uBackDepthTexture,xyPos.xy));\n depthFar = czm_reverseLogDepth(depthFar);\n if(xyPos.z - depthNear > -0.0000001 && depthFar - xyPos.z > -0.0000001)\n {\n bIn = true;\n }\n }\n return uSQMode < 0.5 ? !bIn : bIn;\n}\n#endif\nvoid main() \n{\n#ifdef SQRESULT\n vec4 xyPos = vPrjPos / vPrjPos.w; \n xyPos.xyz = xyPos.xyz * 0.5 + 0.5; \n if(!isPointInObject(xyPos)) \n { \n discard; \n } \n if(vColor.a < uTransparentFilter)\n\t{\n\t\tdiscard;\n\t}\n\tgl_FragColor = vSecondColor; \n#endif\n#ifdef DEPTH\n #ifdef LOG_DEPTH\n czm_writeLogDepth();\n gl_FragColor = czm_packDepth(gl_FragDepthEXT);\n #else\n gl_FragColor = czm_packDepth(gl_FragCoord.z);\n #endif\n#endif\n#ifdef COLOR\n gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n#endif\n}",_0x80db3e=(_0xaa5210=!0,function(e,t){var i=_0xaa5210?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xaa5210=!1,i}),_0x233c59=_0x80db3e(void 0,(function(){return _0x233c59.toString().search("(((.+)+)+)+$").toString().constructor(_0x233c59).search("(((.+)+)+)+$")})),_0xaa5210;function _0x1875be(e,t){this._content=e,this._id=t,this._batchId=t,this._color=new e$1S(1,1,1,1),this._imageUrl="",this._vertexOffset=[],this._instanceIds=void 0,this._pbrMaterialIndex=void 0}_0x233c59(),Object.defineProperties(_0x1875be.prototype,{show:{get:function(){return!0},set:function(e){}},color:{get:function(){return e$28(this._color)||(this._color=new e$1S),this._color},set:function(e){this._color=e}},pbrMaterialIndex:{get:function(){return e$28(this._pbrMaterialIndex)||(this._pbrMaterialIndex=0),this._pbrMaterialIndex},set:function(e){this._pbrMaterialIndex=e}},imageUrl:{get:function(){return this._imageUrl},set:function(e){this._imageUrl=e}},id:{get:function(){return this._id},set:function(e){this._id=e}},batchId:{get:function(){return this._batchId},set:function(e){this._batchId=e}},instanceIds:{get:function(){return this._instanceIds},set:function(e){this._instanceIds=e}}}),_0x1875be.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},_0x1875be.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},_0x1875be.prototype.getProperty=function(e){return this[e]},_0x1875be.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},_0x1875be.prototype.addVertexOffset=function(e,t){this._vertexOffset.push({vertexCount:e,vertexOffset:t})},_0x1875be.prototype.getVertexOffset=function(){return this._vertexOffset},_0x1875be.prototype.getRenderBatchKey=function(){var e=this._color.toCssColorString();return this._imageUrl+"_"+e};var _0x280ad6=(_0x2cea51=!0,function(e,t){var i=_0x2cea51?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2cea51=!1,i}),_0x27cf53=_0x280ad6(void 0,(function(){return _0x27cf53.toString().search("(((.+)+)+)+$").toString().constructor(_0x27cf53).search("(((.+)+)+)+$")})),_0x2cea51;_0x27cf53();var _0x5650c2=function(){this.model=void 0,this.context=void 0,this.texture=void 0,this.subTextureInfo=void 0};_0x5650c2.prototype.set=function(e,t,i,r,n){this.model=t,this.context=e,this.texture=i,this.subTextureInfo=r,this.textureLod=n},_0x5650c2.prototype.execute=function(){var e=this.subTextureInfo;if(!this.texture.ready){if(!this.textureLod)return this.texture.arrayBufferView=e.arrayBufferView,void this.texture.init();this.texture.init()}this.texture.copyFrom({xOffset:e.xOffset,yOffset:e.yOffset,width:e.width,height:e.height,arrayBufferView:e.arrayBufferView})};var _0x217a46=(_0x1cd60d=!0,function(e,t){var i=_0x1cd60d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1cd60d=!1,i}),_0x4ae0da=_0x217a46(void 0,(function(){return _0x4ae0da.toString().search("(((.+)+)+)+$").toString().constructor(_0x4ae0da).search("(((.+)+)+)+$")})),_0x1cd60d;_0x4ae0da();var _0x2baa71="attribute vec4 aPosition;\n#ifdef USE_VertexWeight\n attribute float aVertexWeight;\n #ifdef MultiTemporalWeight\n attribute float aVertexWeight_1;\n uniform float fMultiTemporalFactor;\n #endif\n#endif\n#ifdef HAS_NORMAL\n attribute vec3 aNormal;\n#endif\n#ifdef TexCoord\n attribute vec4 aTexCoord0;\n#endif\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\nuniform mat4 uGeoMatrix;\nuniform float uPointCloudSize;\nvarying float v_pixelDistance;\nvarying vec4 vPosition;\n#ifdef COMPRESS_TEXCOORD\n#ifdef TexCoord\n attribute vec4 aTexCoordZ0;\n uniform float decode_texCoord0_normConstant;\n uniform vec2 decode_texCoord0_min;\n#endif\n#endif\n#ifdef COMPRESS_VERTEX\n uniform vec4 decode_position_min;\n uniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_NORMAL\n uniform float normal_rangeConstant;\n#endif\n#ifdef COMPUTE_W_VALUE\n uniform float uHypHasColorByHeight;\n varying float wValue;\n#endif\n#ifdef HYPSOMETRIC\n uniform sampler2D uHypsometricTexture;\n uniform float uHypOpacity;\n uniform float uHypContourFillMode;\n uniform float uHypFloor;\n uniform float uHypCeil;\n uniform float uHypMaxVisibleValue;\n uniform float uHypMinVisibleValue;\n uniform vec4 uNoValueColor;\n#endif\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n#endif\n uniform float uBottom;\n uniform vec4 uFillForeColor;\n varying vec4 vColor;\n varying vec4 vPositionMC;\n#ifdef W_VISIBLE\n uniform sampler2D uCategorieTexture;\n uniform float uMaxCategory;\n uniform float uMinCategory;\n uniform float uCategoryWidht;\n#endif\nfloat computeWValue(vec4 vertexPos){\n float realWValue = vertexPos.w;\n#ifdef TEXTURE_COORD_ONE_IS_W\n realWValue = aTexCoord0.x;\n#endif\n#ifdef USE_VertexWeight\n realWValue = aVertexWeight;\n #ifdef MultiTemporalWeight\n realWValue = mix(aVertexWeight, aVertexWeight_1, fMultiTemporalFactor);\n\t\tvertexPos.z += realWValue;\n\t#endif\n#endif\n#ifdef COMPUTE_W_VALUE\n if(uHypHasColorByHeight > 0.1)\n {\n wValue = realWValue + uBottom;\n }\n else\n {\n wValue = vertexPos.z + uBottom;\n }\n#endif\n return realWValue;\n}\n#ifdef HYPSOMETRIC\nvec4 computeContourMapColor(float fValue)\n{\n float threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\n float contourRate = (fValue - uHypFloor) / threshold;\n float finalCoord = clamp(contourRate, 0.0, 1.0);\n float count = floor(finalCoord * 16.0);\n float y = (count*2.0 + 1.0)/32.0;\n float x = fract(finalCoord*16.0);\n if(y > 1.0)\n {\n x = 1.0;\n }\n vec2 contourCoord = vec2(x, y);\n return texture2D(uHypsometricTexture, contourCoord).rgba;\n}\nvec4 getHypsometricColor(vec4 oriColor, float fValue)\n{\n vec4 contourMapColor = vec4(0.0);\n float finalOpacity = uHypOpacity;\n if(fValue > uHypMaxVisibleValue || fValue < uHypMinVisibleValue)\n {\n return uNoValueColor * oriColor;\n }\n contourMapColor = computeContourMapColor(fValue);\n finalOpacity *= sign(uHypContourFillMode);\n vec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\n return mixColor;\n}\n#endif\n\nvec3 realNormal;\nvoid main()\n{\n#ifdef COMPRESS_VERTEX\n vec4 vertexPos = vec4(1.0);\n vertexPos = decode_position_min + aPosition * decode_position_normConstant;\n#else\n vec4 vertexPos = aPosition;\n#endif\n#ifdef HAS_NORMAL\n realNormal = aNormal;\n #ifdef COMPRESS_NORMAL\n realNormal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy;\n #endif\n#endif\n float oriVertexW = computeWValue(vertexPos);\n vertexPos.w = 1.0;\n#ifdef EXCAVATION\n vExcavationVertexPos = uGeoMatrix * vertexPos;\n#endif\nvec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n #ifdef COMPRESS_COLOR\n #ifdef MeshOPT_Compress\n vertexColor = aColor;\n #else\n vertexColor = aColor / 255.0;\n #endif\n #endif\n#endif\n vColor = vertexColor*uFillForeColor;\n vPositionMC.xyz = vertexPos.xyz;\n vPositionMC.w = 0.0;\n gl_Position = czm_modelViewProjection * vertexPos;\n#ifdef HYPSOMETRIC\n vColor = getHypsometricColor(vColor, wValue);\n#endif\n#ifdef W_VISIBLE\n vec2 categoryTexCoord = vec2(abs(oriVertexW - uMinCategory) / uCategoryWidht + 0.5 /uCategoryWidht , 0.5);\n float category = texture2D(uCategorieTexture, categoryTexCoord).a;\n vColor.a *= 1.0 - category;\n#endif\n v_pixelDistance = 2.0 / uPointCloudSize;\n gl_PointSize = uPointCloudSize;\n vPosition = czm_modelView * vertexPos;\n}",_0x4c074a=(_0x3f180a=!0,function(e,t){var i=_0x3f180a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3f180a=!1,i}),_0x17aad4=_0x4c074a(void 0,(function(){return _0x17aad4.toString().search("(((.+)+)+)+$").toString().constructor(_0x17aad4).search("(((.+)+)+)+$")})),_0x3f180a;_0x17aad4();var _0x3191d0="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef COMPUTE_W_VALUE\n varying float wValue;\n#endif\nvarying vec4 vColor;\nvarying vec4 vPositionMC;\nvarying vec4 vPosition;\nvarying float v_pixelDistance;\n#ifdef APPLY_SPLIT\nuniform float uSplitDirection;\nuniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nvoid main()\n{\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n\tif(vColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n gl_FragColor = vColor;\n#ifdef ADJUST_COLOR\n\tgl_FragColor.rgb = czm_adjustColor(gl_FragColor.rgb);\n#endif\n float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n gl_FragColor.a *= wholeAlpha;\n\tif(gl_FragColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n gl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x14bc15=(_0x1ff9b9=!0,function(e,t){var i=_0x1ff9b9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1ff9b9=!1,i}),_0xe64be7=_0x14bc15(void 0,(function(){return _0xe64be7.toString().search("(((.+)+)+)+$").toString().constructor(_0xe64be7).search("(((.+)+)+)+$")})),_0x1ff9b9;_0xe64be7();var _0x1162a0="attribute vec4 aPosition;\n#ifdef TexCoord\n attribute vec4 aTexCoord0;\n#endif\nattribute vec4 aColor;\nvarying float v_pixelDistance;\nvarying vec4 vPosition;\nuniform mat4 uGeoMatrix;\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n#endif\n#ifdef HYPSOMETRIC\n uniform sampler2D uHypsometricTexture;\n uniform float uHypOpacity;\n uniform float uHypContourFillMode;\n uniform float uHypFloor;\n uniform float uHypCeil;\n uniform float uHypMaxVisibleValue;\n uniform float uHypMinVisibleValue;\n uniform vec4 uNoValueColor;\n#endif\n uniform float uPointCloudSize;\n uniform vec4 uFillForeColor;\n varying vec4 vColor;\n varying vec4 vPositionMC;\n#ifdef HYPSOMETRIC\nvec4 computeContourMapColor(float fValue)\n{\n float threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\n float contourRate = (fValue - uHypFloor) / threshold;\n float finalCoord = clamp(contourRate, 0.0, 1.0);\n float count = floor(finalCoord * 16.0);\n float y = (count*2.0 + 1.0)/32.0;\n float x = fract(finalCoord*16.0);\n if(y > 1.0)\n {\n x = 1.0;\n }\n vec2 contourCoord = vec2(x, y);\n return texture2D(uHypsometricTexture, contourCoord).rgba;\n}\nvec4 getHypsometricColor(vec4 oriColor, float fValue)\n{\n vec4 contourMapColor = vec4(0.0);\n float finalOpacity = uHypOpacity;\n contourMapColor = computeContourMapColor(fValue);\n finalOpacity *= sign(uHypContourFillMode);\n vec4 mixColor = mix(vec4(1.0,1.0,1.0,1.0), contourMapColor, finalOpacity);\n return mixColor;\n}\n#endif\n\nfloat getGlobeDepth(vec4 positionEC)\n{\n vec4 posWC = czm_eyeToWindowCoordinates(positionEC);\n float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\n if (globeDepth == 0.0)\n {\n return 0.0; // not on the globe\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\n return eyeCoordinate.z / eyeCoordinate.w;\n}\n\nvoid main()\n{\n vec4 vertexPos = aPosition;\n vertexPos.w = 1.0;\n vPositionMC.xyz = vertexPos.xyz;\n vPositionMC.w = 0.0;\n vColor = aColor;\n float wValue = aTexCoord0.x;\n gl_Position = czm_modelViewProjection * vertexPos;\n#ifdef HYPSOMETRIC\n if(wValue > uHypMaxVisibleValue || wValue < uHypMinVisibleValue)\n {\n gl_Position = czm_projection * vec4(0.0, 0.0, 0.0, 1.0);\n }\n vColor = getHypsometricColor(vColor, wValue);\n#endif\n#ifdef EXCAVATION\n vExcavationVertexPos = uGeoMatrix * vertexPos;\n#endif\n vColor *= uFillForeColor;\n vPosition = czm_modelView * vertexPos;\n float depthsilon = 10.0;\n float globeDepth = getGlobeDepth(vPosition);\n if (globeDepth != 0.0 && vPosition.z + depthsilon < globeDepth)\n {\n gl_Position = czm_projection * vec4(0.0, 0.0, 0.0, 1.0);\n }\n float mpp = czm_metersPerPixel(vPosition);\n float pointSize = uPointCloudSize / mpp;\n v_pixelDistance = 2.0 / pointSize;\n gl_PointSize = pointSize;\n}",_0x2bed8a=(_0x3dfcdb=!0,function(e,t){var i=_0x3dfcdb?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3dfcdb=!1,i}),_0x3c9a17=_0x2bed8a(void 0,(function(){return _0x3c9a17.toString().search("(((.+)+)+)+$").toString().constructor(_0x3c9a17).search("(((.+)+)+)+$")})),_0x3dfcdb;_0x3c9a17();var _0x180856="#extension GL_EXT_draw_buffers : enable\nvarying vec4 vColor;\nvarying vec4 vPosition;\nvarying vec4 vPositionMC;\nvarying float v_pixelDistance;\nvoid main()\n{\n#ifdef CLIP\n czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n vec4 color = vColor;\n float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n color.a *= wholeAlpha;\n\tcolor = czm_gammaCorrect(color);\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n#ifdef OIT\n vec3 Ci = color.rgb * color.a;\n float ai = color.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n#else\n gl_FragColor = color;\n#endif\n}",_0xf5a0a4=(_0x1f3a23=!0,function(e,t){var i=_0x1f3a23?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1f3a23=!1,i}),_0x1146d7=_0xf5a0a4(void 0,(function(){return _0x1146d7.toString().search("(((.+)+)+)+$").toString().constructor(_0x1146d7).search("(((.+)+)+)+$")})),_0x1f3a23;_0x1146d7();var _0xbceba="attribute vec4 aPosition;\n#ifdef USE_VertexWeight\n attribute float aVertexWeight;\n #ifdef MultiTemporalWeight\n attribute float aVertexWeight_1;\n uniform float fMultiTemporalFactor;\n #endif\n#endif\n#ifdef USE_TextureCoordMatrix\n attribute vec2 aTextureCoordMatrix;\n#endif\n#ifdef HAS_NORMAL\n attribute vec3 aNormal;\n#endif\n#ifdef TexCoord\n attribute vec4 aTexCoord0;\n varying vec2 vTexCoordZ;\n#endif\nvarying vec4 vTexCoord;\n#ifdef IMAGERY\n attribute vec2 img;\n varying vec2 imgCoord;\n#endif\n#ifdef TexCoord2\n attribute vec4 aTexCoord1;\n#endif\n#ifdef TextureBatch\n attribute float aTextureBatchId0;\n#ifdef MULTI_TEX\n attribute float aTextureBatchId1;\n#endif\n#endif\n uniform float uPointSize;\n uniform vec4 uSelColor;\n uniform vec3 uTranslation;\n struct LayerParameter{\n vec4 translationAndBottom;\n vec4 minMaxTransparentAndPolygonOffset;\n vec4 selColor;\n float pointSize;\n };\n \n uniform mat4 uTexMatrix;\n uniform float uTexture0Width;\n uniform float uTexture1Width;\n struct MaterialParameter{\n vec4 ambientColor;\n vec4 diffuseColor;\n mat4 texMatrix;\n vec2 textureWidth;\n };\n uniform vec4 uFillForeColor;\n struct MaterialDynamicParameter{\n vec4 texUVOffset;\n vec4 fillForeColor;\n };\n LayerParameter u_LayerParam;\n MaterialParameter u_MaterialParam;\n MaterialDynamicParameter u_MaterialDynamicParameter;\n#ifdef FINAL_RESOLUTION_CLIP\nvarying vec3 vertexClip;\n#endif\nuniform mat4 uGeoMatrix;\nuniform mat4 uInverseGeoMatrix;\n#ifdef UseInstanceSkeletonMatrix\nuniform mat4 uSkeletonMatrix;\n#endif\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\n#ifdef Instance\n#ifdef InstanceModel\nattribute float batchId;\nuniform float uSkeletonCount;\n#endif\nattribute float instanceId;\n#else\nattribute float batchId;\n#endif\n#endif\nvarying vec4 vSecondColor;\nconst float POW_24 = 16777216.0;\nconst float POW_16 = 65536.0;\nconst float POW_8 = 256.0;\n#ifdef Volume\n attribute vec3 aRatio;\n varying vec3 vecRotioCoord;\n#endif\n#ifdef InstanceRenderBIM\n attribute vec4 uv2;\n attribute vec4 uv3;\n attribute vec4 uv4;\n attribute vec4 secondary_colour;\n attribute vec4 uv6;\n#endif\n#ifdef InstanceRenderPipeline\n attribute vec4 uv1;\n attribute vec4 uv2;\n attribute vec4 uv3;\n attribute vec4 uv4;\n attribute vec4 uv5;\n attribute vec4 uv6;\n attribute vec4 uv7;\n attribute vec4 secondary_colour;\n attribute vec4 uv9;\n#endif\n#ifdef QUAD_OUTLINE\n varying float vDistanceFromEye;\n#endif\n#ifdef EMISSION_TEXTURE\n uniform vec4 uLayerBounds;\n varying vec2 vLayerTexCoord;\n varying vec2 vModIndexAndTexIndex;\n#endif\n#ifdef COMPRESS_TEXCOORD\n#ifdef TexCoord\n attribute vec4 aTexCoordZ0;\n uniform vec2 decode_texCoord0_min;\n#endif\n#ifdef TexCoord2\n attribute vec4 aTexCoordZ1;\n uniform vec2 decode_texCoord1_min;\n#endif\n#ifdef MeshOPT_Compress\n uniform vec3 decode_texCoord0_vNormConstant;\n uniform vec3 decode_texCoord1_vNormConstant;\n#else\n uniform float decode_texCoord0_normConstant;\n uniform float decode_texCoord1_normConstant;\n#endif\n#endif\n#ifdef COMPRESS_VERTEX\n uniform vec4 decode_position_min;\n uniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_NORMAL\n uniform float normal_rangeConstant;\n#endif\n#ifdef FALTTEN\n#ifdef VertexTextureSupport\n uniform sampler2D uFlattenTexture;\n#endif\n uniform vec4 uRect;\n uniform float uCameraHeight;\n#endif\n#ifdef COMPUTE_W_VALUE\n uniform float uHypHasColorByHeight;\n varying float wValue;\n#endif\n#ifdef COMPUTE_TEXCOORD\n#ifdef TextureBatch\n uniform vec4 uTextureDim;\n varying vec4 vTexTran;\n varying vec4 vTexScale;\n varying vec4 vTexSize;\n varying vec2 vMaxMipLevel;\n#else\n varying vec4 vTexMatrix;\n varying vec2 vIsRGBA;\n#endif\n#ifdef TexCoord2\n varying vec4 vTexMatrix2;\n#endif\n#endif\n#ifdef HYPSOMETRIC\n uniform float uHypHasAnalysisRegion;\n uniform vec4 uHypRect;\n varying vec2 vecHypTexCoord;\n#endif\n#ifdef SERVEREXCAVATION\n varying vec4 vServerExcavationVertexPos;\n#endif\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n#endif\n#ifdef OVERLAY\n uniform vec4 uOverlayRect;\n#endif\n#ifdef NORMAL_AND_DEPTH\n varying vec4 oriVertex;\n varying vec3 perVertexNormals;\n varying float depthInCamera;\n#endif\nvarying vec2 fSelected;\n#ifdef SILHOUETTE_SELECT_TYPE\n varying float fSelectedForSilh;\n#endif\n varying vec4 vIsFiltByID;\n varying vec3 v_positionEC;\n#ifdef PBR\n varying vec3 v_positionWC;\n varying vec4 pbrVertex;\n#endif\n#ifdef TRIANGLE_FILTRATE\n uniform float uTriangleFiltratePixel;\n#endif\n#ifdef POINT\n varying float v_pixelDistance;\n#endif\n uniform float uBottom;\n varying vec4 vColor;\n varying vec4 vPositionMC;\n#ifdef PBR_THEME\n varying float vPBRIndex;\n#endif\n#ifdef Instance\n varying vec3 vPositionRotateMC;\n#endif\n#ifdef W_VISIBLE\n uniform sampler2D uCategorieTexture;\n uniform float uMaxCategory;\n uniform float uMinCategory;\n uniform float uCategoryWidht;\n uniform float uCategoryHeight;\n#endif\n#ifdef SQRESULT\nuniform mat4 uSQViewProj;\nvarying vec4 vPrjPos;\n#endif\n vec2 CalculatePolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect)\n {\n vec4 realVertexPos = uGeoMatrix * vertexPos;\n vec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\n vec2 texCoord = vec2(realVertexPos.x - rectPos.x, realVertexPos.y - rectPos.y);\n texCoord.x = texCoord.x / vecRatio.x;\n texCoord.y = texCoord.y / vecRatio.y;\n ptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\n texCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\n return texCoord;\n }\n#ifdef FALTTEN\n#ifdef VertexTextureSupport\n vec4 CalculateHeight(vec4 vertexPos)\n {\n vec4 vecPos = uGeoMatrix * vec4(vertexPos.xyz, 1.0);\n vec2 vecRatio = vec2(uRect.z - uRect.x, uRect.w - uRect.y);\n vec2 vecTexCoord = vec2(vecPos.x - uRect.x, vecPos.y - uRect.y);\n vecTexCoord.x = vecTexCoord.x / vecRatio.x;\n vecTexCoord.y = vecTexCoord.y / vecRatio.y;\n if(vecTexCoord.x > 1.0 || vecTexCoord.x < 0.0 || vecTexCoord.y > 1.0 || vecTexCoord.y < 0.0)\n {\n return vertexPos;\n }\n vec4 value = texture2D(uFlattenTexture, vecTexCoord.xy);\n #ifdef UseFloatTexture\n float fHeight = value.r;\n #else\n float fHeight = czm_unpackValue(value);\n #endif\n if(vecPos.z > fHeight && value.a > 0.5)\n {\n float fDepthOffset = clamp((uCameraHeight - fHeight - uBottom) * 0.0001 * (vecPos.z + uBottom - fHeight), 0.001, 3.0);\n vecPos.z = fHeight + fDepthOffset;\n vecPos.w = vecPos.z;\n }\n return uInverseGeoMatrix * vec4(vecPos.xyz, 1.0);\n }\n#endif\n#endif\nfloat computeWValue(inout vec4 vertexPos){\n float realWValue = vertexPos.w;\n#ifdef TEXTURE_COORD_ONE_IS_W\n realWValue = aTexCoord0.x;\n#endif\n#ifdef USE_VertexWeight\n realWValue = aVertexWeight;\n #ifdef MultiTemporalWeight\n realWValue = mix(aVertexWeight, aVertexWeight_1, fMultiTemporalFactor);\n #ifdef ChangeZValue\n\t\tvertexPos.z += realWValue;\n\t\t#endif\n\t#endif\n#endif\n#ifdef COMPUTE_W_VALUE\n if(uHypHasColorByHeight > 0.1)\n {\n wValue = realWValue + uBottom;\n }\n else\n {\n wValue = vertexPos.z + uBottom;\n }\n#endif\n return realWValue;\n}\n#ifdef TextureBatch\nvoid getTextureParameter(in vec4 xywh, in vec2 textureDim, inout vec2 translate, inout vec2 scale, inout vec2 texSize, inout float maxMipLevel)\n{\n float width = xywh.z;\n float height = xywh.w;\n width *= 2.0 / 3.0;\n maxMipLevel = log2(min(width, height));\n scale.x = width / textureDim.x;\n scale.y = height / textureDim.y;\n translate.x = xywh.x;\n translate.y = xywh.y;\n translate /= textureDim;\n texSize.x = width;\n texSize.y = height;\n}\n#endif\nvec3 realNormal;\nconst float RIGHT_8 = 65280.0;\nconst float RIGHT_16 = 16711680.0;\nvarying vec3 vNormalEC;\n#ifdef USE_BatchPBR\n uniform vec2 uPBRTexWH;\n uniform sampler2D uPBRTexture;\n varying vec4 vMetallicRoughness;\n varying vec4 vEmissiveFactor;\n varying vec3 vAlphaCutoffAndModeAndDoubleSide;\n#endif\nvoid InitUniformStructParameter(){\n#ifdef UNIFORM_BUFFER\n#else\n u_LayerParam.translationAndBottom.xyz = uTranslation;\n u_LayerParam.translationAndBottom.w = uBottom;\n u_LayerParam.selColor = uSelColor;\n u_LayerParam.pointSize = uPointSize;\n u_MaterialParam.textureWidth.x = uTexture0Width;\n u_MaterialParam.textureWidth.y = uTexture1Width;\n u_MaterialParam.texMatrix = uTexMatrix;\n u_MaterialDynamicParameter.fillForeColor = uFillForeColor;\n#endif\n}\nvarying vec4 vFloodPos;\n#ifdef FLOOD_ANALYSIS\nuniform mat4 uFloodMatrixInvert;\n#endif\n#ifdef FusionMode\n uniform mat4 uModelView;\n uniform vec2 uPanOffset;\n#endif\n#ifndef WEBGL2\nfloat round(float x) {\n return fract(x) >= 0.5 ? ceil(x) : floor(x);\n}\n#endif\nvoid main()\n{\n InitUniformStructParameter();\n#ifdef COMPRESS_VERTEX\n vec4 vertexPos = vec4(1.0);\n vertexPos = decode_position_min + vec4(aPosition.xyz, 1.0) * decode_position_normConstant;\n#else\n vec4 vertexPos = aPosition;\n#endif\n#ifdef FINAL_RESOLUTION_CLIP\nvertexClip = (uGeoMatrix * vec4(vertexPos.xyz, 1.0)).xyz;\n#endif\n#ifdef UseInstanceSkeletonMatrix\n vertexPos = uSkeletonMatrix * vec4(vertexPos.xyz, 1.0);\n#endif\n#ifdef TexCoord\n#ifdef COMPRESS_TEXCOORD\n #ifdef MeshOPT_Compress\n vec2 texCoord0;\n texCoord0.x = aTexCoord0.x * decode_texCoord0_vNormConstant.x;\n texCoord0.y = aTexCoord0.y * decode_texCoord0_vNormConstant.y;\n vTexCoord.xy = decode_texCoord0_min + texCoord0.xy;\n #else\n vTexCoord.xy = decode_texCoord0_min.xy + aTexCoord0.xy * decode_texCoord0_normConstant;\n #endif\n#else\n vTexCoord.xy = aTexCoord0.xy;\n#endif\n#endif\n#ifdef TexCoord2\n#ifdef COMPRESS_TEXCOORD\n #ifdef MeshOPT_Compress\n vec2 texCoord1;\n texCoord1.x = aTexCoord1.x * decode_texCoord1_vNormConstant.x;\n texCoord1.y = aTexCoord1.y * decode_texCoord1_vNormConstant.y;\n vTexCoord.zw = decode_texCoord1_min + texCoord1.xy;\n #else\n vTexCoord.zw = decode_texCoord1_min.xy + aTexCoord1.xy * decode_texCoord1_normConstant;\n #endif\n#else\n vTexCoord.zw = aTexCoord1.xy;\n#endif\n#ifdef USE_BatchPBR\n float x = (aTexCoord1.x * 2.0 + 0.5)/ uPBRTexWH.x;\n float y = (aTexCoord1.x * 2.0 + 1.5)/ uPBRTexWH.x;\n vec4 pbrParam = texture2D(uPBRTexture, vec2(x, 0.5));\n vMetallicRoughness.xy = pbrParam.rg;\n vAlphaCutoffAndModeAndDoubleSide.x = pbrParam.b;\n float temp = pbrParam.a / 65536.0;\n vAlphaCutoffAndModeAndDoubleSide.y = floor(temp);\n vAlphaCutoffAndModeAndDoubleSide.z = (temp- vAlphaCutoffAndModeAndDoubleSide.y) * 65536.0;\n vEmissiveFactor = texture2D(uPBRTexture, vec2(y, 0.5));\n#endif\n#endif\n#ifdef HAS_NORMAL\n realNormal = aNormal;\n#ifdef COMPRESS_NORMAL\n #ifdef MeshOPT_Compress\n realNormal.x = aNormal.x / 127.0;\n realNormal.y = aNormal.y / 127.0;\n realNormal.z = 1.0 - abs(realNormal.x) - abs(realNormal.y);\n realNormal = normalize(realNormal);\n #else\n realNormal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy;\n #endif\n#endif\n#endif\n#ifdef InstanceRenderBIM\n mat4 worldMatrix;\n worldMatrix[0] = uv2;\n worldMatrix[1] = uv3;\n worldMatrix[2] = uv4;\n worldMatrix[3] = vec4( 0, 0, 0, 1 );\n vPositionRotateMC = vertexPos.xyz * mat3(worldMatrix);\n vertexPos = vec4(vertexPos.xyz, 1.0) * worldMatrix;\n#endif\n#ifdef InstanceRenderPipeline\n mat4 worldMatrix;\n mat4 worldMatrix0;\n mat4 worldMatrix1;\n vec4 worldPos0;\n vec4 worldPos1;\n worldMatrix0[0] = uv1;\n worldMatrix0[1] = uv2;\n worldMatrix0[2] = uv3;\n worldMatrix0[3] = vec4( 0, 0, 0, 1 );\n worldMatrix1[0] = uv4;\n worldMatrix1[1] = uv5;\n worldMatrix1[2] = uv6;\n worldMatrix1[3] = vec4( 0, 0, 0, 1 );\n vec4 realVertex = vec4(vertexPos.xyz, 1.0);\n realVertex.x = realVertex.x * uv7.z;\n worldPos0 = realVertex * worldMatrix0;\n worldPos1 = realVertex * worldMatrix1;\n#ifdef TexCoord\n if(aTexCoord0.y > 0.5)\n {\n vec4 tex4Vec = u_MaterialParam.texMatrix * vec4(uv7.y, aTexCoord0.x, 0.0, 1.0);\n vTexCoord.xy = tex4Vec.xy;\n vertexPos = worldPos1;\n worldMatrix = worldMatrix1;\n }\n else\n {\n vec4 tex4Vec = u_MaterialParam.texMatrix * vec4(uv7.x, aTexCoord0.x, 0.0, 1.0);\n vTexCoord.xy = tex4Vec.xy;\n vertexPos = worldPos0;\n worldMatrix = worldMatrix0;\n }\n#ifdef HAS_NORMAL\n realNormal.x = realNormal.x * uv7.z;\n#endif\n#endif\n vPositionRotateMC = vertexPos.xyz;\n#endif\n#ifdef Volume\n vecRotioCoord = aRatio;\n#endif\n#ifdef FALTTEN\n#ifdef VertexTextureSupport\n vertexPos = CalculateHeight(vertexPos);\n#endif\n#endif\n vec4 vLocalPos = uGeoMatrix * vertexPos;\n vec4 vTempPos = vLocalPos;\n float oriVertexW = computeWValue(vLocalPos);\n #ifdef MultiTemporalWeight\n vertexPos.z += vLocalPos.z - vTempPos.z;\n #endif\n vertexPos.w = 1.0;\n#ifdef HYPSOMETRIC\n if(uHypHasAnalysisRegion > 0.1)\n {\n float ptInRect = 1.0;\n vecHypTexCoord = CalculatePolyTexCoord(vertexPos, uHypRect, ptInRect);\n }\n#endif\n#ifdef EXCAVATION\n vExcavationVertexPos = uGeoMatrix * vertexPos;\n#endif\n#ifdef SERVEREXCAVATION\n vServerExcavationVertexPos = uGeoMatrix * vertexPos;\n#endif\nvec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef InstanceRenderBIM\n vertexColor *= secondary_colour;\n#endif\n#ifdef InstanceRenderPipeline\n vertexColor *= secondary_colour;\n#endif\n#ifdef REPLACE_COLOR_TYPE\n vertexColor = u_MaterialDynamicParameter.fillForeColor;\n#else\n vertexColor *= u_MaterialDynamicParameter.fillForeColor;\n#endif\n vIsFiltByID = vec4(0.0);\n#ifdef BatchTable\n#ifdef Instance\nfloat index = instanceId;\n#else\nfloat index = batchId;\n#endif\n#ifdef InstanceModel\n index = instanceId * uSkeletonCount + batchId;\n#endif\n vSecondColor = czm_batchTable_pickColor(index);\n vec4 operationType = czm_batchTable_operation(index);\n vec4 objsColor = czm_batchTable_color(index);\n vec3 translate = u_LayerParam.translationAndBottom.xyz;\n#ifdef PBR_THEME\n vPBRIndex = czm_batchTable_pbrMaterialIndex(index).x + 0.1;\n#endif\n#ifdef Translation\n translate = czm_batchTable_translate(index);\n#endif\n#ifdef EMISSION_TEXTURE\n float pickId = vSecondColor.r * 255.0 + vSecondColor.g * RIGHT_8 + vSecondColor.b * RIGHT_16;\n vModIndexAndTexIndex.x = mod(pickId, 10.0) * 0.1;\n vModIndexAndTexIndex.y = mod(pickId, float(EMISSION_TEXTURE_COUNT));\n vec4 realVertexPos = uGeoMatrix * vertexPos;\n vLayerTexCoord = (realVertexPos.xy - uLayerBounds.xy) / uLayerBounds.zw;\n#endif\n#ifdef SILHOUETTE_SELECT_TYPE\n fSelectedForSilh = 0.0;\n czm_s3mBatchOperation(operationType, objsColor, vertexColor, vertexPos, vIsFiltByID, translate, fSelectedForSilh);\n#endif\n#ifndef SILHOUETTE_SELECT_TYPE\n fSelected = vec2(0.0);\n czm_s3mBatchOperation(operationType, objsColor, u_LayerParam.selColor, vertexColor, vertexPos, vIsFiltByID, translate, fSelected);\n#endif\n#endif\n vColor = vertexColor;\n vPositionMC.xyz = vertexPos.xyz;\n vPositionMC.w = 1.0;\n#ifdef TRIANGLE_FILTRATE\n vec4 positionEC = czm_modelView * vertexPos;\n float minEdgeLength = max(aPosition.w, 2.0);\n float pixelLength = minEdgeLength / czm_metersPerPixel(positionEC);\n if(pixelLength < uTriangleFiltratePixel){\n positionEC = vec4(0.0, 0.0, 0.0, 1.0);\n }\n gl_Position = czm_projection * positionEC;\n#else\n#ifdef FusionMode\n vec4 positionCC = czm_projection * uModelView * vertexPos;\n positionCC.x += (2.0 * uPanOffset.x * positionCC.w);\n positionCC.y += (-2.0 * uPanOffset.y * positionCC.w);\n gl_Position = positionCC;\n#else\n gl_Position = czm_modelViewProjection * vertexPos;\n#endif\n#endif\n#ifdef COMPUTE_TEXCOORD\n vTexCoordZ.x = aTexCoord0.z;\n #ifdef USE_TextureCoordMatrix\n vTexCoordZ.x = aTextureCoordMatrix.x;\n #endif\n float nz = round(vTexCoordZ.x);\n#ifdef TextureBatch\n if(aTextureBatchId0 < 0.0)\n {\n vMaxMipLevel.x = -1.0;\n }\n else\n {\n vec4 xywh = czm_batchTable_xywh(aTextureBatchId0);\n getTextureParameter(xywh, uTextureDim.xy, vTexTran.xy, vTexScale.xy, vTexSize.xy, vMaxMipLevel.x);\n }\n#ifdef MULTI_TEX\n if(aTextureBatchId1 < 0.0)\n {\n vMaxMipLevel.y = -1.0;\n }\n else\n {\n vec4 xywh2 = czm_batchTable_xywh2(aTextureBatchId1);\n getTextureParameter(xywh2, uTextureDim.zw, vTexTran.zw, vTexScale.zw, vTexSize.zw, vMaxMipLevel.y);\n }\n#endif\n#else\n vec2 vecTexTileWidth;\n vTexMatrix = vec4(0.0,0.0,1.0,0.0);\n vIsRGBA.x = 0.0;\n if(vTexCoordZ.x < -90000.0)\n {\n vTexMatrix.z = -1.0;\n }\n#ifndef Instance\n czm_getTextureMatrixFromZValue(int(nz), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z, vIsRGBA.x);\n#ifdef TexCoord2\n vTexMatrix2 = vec4(0.0,0.0,1.0,0.0);\n vIsRGBA.y = 0.0;\n vTexCoordZ.y = aTexCoord1.z;\n#ifdef COMPRESS_TEXCOORD\n vTexCoordZ.y = aTexCoordZ1.x;\n#endif\n#ifdef USE_TextureCoordMatrix\n vTexCoordZ.y = aTextureCoordMatrix.y;\n#endif\n nz = round(vTexCoordZ.y);\n czm_getTextureMatrixFromZValue(int(nz), vTexMatrix2.x, vTexMatrix2.y, vTexMatrix2.z, vIsRGBA.y);\n#endif\n#endif\n vTexMatrix.w = log2(u_MaterialParam.textureWidth.x * vTexMatrix.z);\n#ifdef TexCoord2\n vTexMatrix2.w = log2(u_MaterialParam.textureWidth.y * vTexMatrix.z);\n#endif\n#endif\n#endif\n v_positionEC = (czm_modelView * vertexPos).xyz;\n vNormalEC = vec3(0.0);\n#ifdef HAS_LIGHT\n #ifdef PBR\n v_positionWC = (czm_model * vertexPos).xyz;\n pbrVertex = vertexPos;\n #else\n #if defined(HAS_NORMAL) && !defined(IS_SQUARE_PIPE)\n vec3 positionEC = (czm_modelView * vertexPos).xyz;\n vec3 normalEC = vec3(1.0);\n #ifdef Instance\n vec3 normalWC = realNormal.xyz * mat3(worldMatrix);\n normalEC = czm_normal * normalWC;\n #else\n normalEC = czm_normal * realNormal;\n #endif\n vNormalEC = normalEC;\n #endif\n #endif\n#endif\n#ifdef NORMAL_AND_DEPTH\n oriVertex = vertexPos;\n vec4 position = czm_modelView * vertexPos;\n depthInCamera = (position.z - czm_depthRange.near) / (czm_depthRange.far - czm_depthRange.near);\n perVertexNormals = vec3(0.0,0.0,0.0);\n#ifdef HAS_NORMAL\n if(length(realNormal) > 0.8)\n {\n perVertexNormals = normalize(czm_normal * realNormal);\n }\n#endif\n#endif\n#ifdef W_VISIBLE\n float category_u = abs(oriVertexW - uMinCategory);\n float category_y = ceil(category_u / uCategoryWidht) / uCategoryHeight - 0.5 / uCategoryHeight;\n float category_x = mod(category_u, uCategoryWidht) / uCategoryWidht + 0.5 / uCategoryWidht ;\n vec2 categoryTexCoord = vec2(category_x , category_y);\n float category = texture2D(uCategorieTexture, categoryTexCoord).a;\n vColor.a *= 1.0 - category;\n#endif\n#ifdef SQRESULT\n vPrjPos = uSQViewProj * vec4(vertexPos.xyz, 1.0);\n#endif\n#ifdef IMAGERY\n imgCoord = img;\n#endif\n gl_PointSize = u_LayerParam.pointSize;\n#ifdef POINT\n v_pixelDistance = 2.0 / u_LayerParam.pointSize;\n#endif\n#ifdef QUAD_OUTLINE\n vDistanceFromEye = gl_Position.z;\n#endif\n#ifdef VERTEX_CAPTURE\n vSecondColor = czm_modelView * vertexPos;\n gl_PointSize = 12.0;\n#endif\n vFloodPos = vec4(1.0,1.0,1.0,1.0);\n#ifdef FLOOD_ANALYSIS\n vFloodPos = uFloodMatrixInvert * vec4(vertexPos.xyz, 1.0);\n#endif\n}",_0x259ed9=(_0x20a126=!0,function(e,t){var i=_0x20a126?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x20a126=!1,i}),_0x53565c=_0x259ed9(void 0,(function(){return _0x53565c.toString().search("(((.+)+)+)+$").toString().constructor(_0x53565c).search("(((.+)+)+)+$")})),_0x20a126;_0x53565c();var _0x4cdf29="\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#ifdef TRANSPARENT_BACK_COLOR\n uniform vec4 uTransparentBackColor;\n uniform float uTransparentBackColorTolerance;\n#endif\n#ifdef FINAL_RESOLUTION_CLIP\nvarying vec3 vertexClip;\nuniform vec3 uMaxClip;\nuniform vec3 uMinClip;\n#endif\n#ifdef TexCoord\n uniform sampler2D uTexture;\n#ifdef Map\n\tuniform sampler2D uMapTexture;\n#endif\n varying vec4 vTexCoord;\n varying vec2 vTexCoordZ;\n#endif\n#ifdef SEC_TEX_EMISSION\n uniform vec3 uEmissionFactor;\n#endif\n#ifdef COMPUTE_TEXCOORD\n#ifdef TextureBatch\n uniform vec4 uTextureDim;\n varying vec4 vTexTran;\n varying vec4 vTexScale;\n varying vec4 vTexSize;\n varying vec2 vMaxMipLevel;\n#else\n varying vec4 vTexMatrix;\n varying vec2 vIsRGBA;\n#endif\n#endif\n#ifdef COMPUTE_W_VALUE\n varying float wValue;\n#endif\n#ifdef MULTI_TEX\n uniform sampler2D uSecTexture;\n varying vec4 vTexMatrix2;\n#endif\n#ifdef USE_BatchPBR\n varying vec4 vMetallicRoughness;\n varying vec4 vEmissiveFactor;\n varying vec3 vAlphaCutoffAndModeAndDoubleSide;\n#endif\n#ifdef OVERLAY\n uniform vec4 uOverlayRect;\n uniform sampler2D uOverlayTexture;\n#endif\n#ifdef NORMAL_AND_DEPTH\n varying vec4 oriVertex;\n varying vec3 perVertexNormals;\n varying float depthInCamera;\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\n#ifdef APPLY_SPLIT\n uniform float uSplitDirection;\n uniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nvarying vec2 fSelected;\n#ifdef SILHOUETTE_SELECT_TYPE\n uniform vec4 uSelColor;\n uniform int uSelectColorType;\n varying float fSelectedForSilh;\n#endif\n#ifdef SKETCH_MODE\n uniform vec4 uLineColor;\n uniform float uLineWidth;\n#endif\n#ifdef Only_LineColor\n uniform vec4 uLineColor;\n#endif\n uniform vec4 uEmissionColor;\n#ifdef POST_EFFECT\n uniform float uMaxBloomHeight;\n#endif\nuniform vec2 uPolygonOffset;\n uniform vec2 uMinMaxTransparent;\n struct LayerParameter{\n vec4 translationAndBottom;\n vec4 minMaxTransparentAndPolygonOffset;\n vec4 selColor;\n float pointSize;\n };\n uniform vec4 uAmbientColor;\n uniform vec4 uDiffuseColor;\n uniform float uTexture0Width;\n uniform float uTexture1Width;\n struct MaterialParameter{\n vec4 ambientColor;\n vec4 diffuseColor;\n mat4 texMatrix;\n vec2 textureWidth;\n };\n uniform vec4 uTexUVOffset;\n uniform vec4 uFillForeColor;\n struct MaterialDynamicParameter{\n vec4 texUVOffset;\n vec4 fillForeColor;\n };\n \n uniform vec3 uAmbientLightColor;\n uniform vec4 uSunLightColor;\n uniform float uSunLightON;\n struct LightParameter{\n vec4 ambientLightColor;\n vec4 sunLightColor;\n vec4 sunDirECAndSunLightON;\n };\n LayerParameter u_LayerParam;\n MaterialParameter u_MaterialParam;\n MaterialDynamicParameter u_MaterialDynamicParameter;\n LightParameter u_LightParam;\n#ifdef PBR_THEME\n uniform mat4 uPBRMaterials[NUM_PBR_MATERIALS];\n varying float vPBRIndex;\n#endif\n varying vec4 vIsFiltByID;\n varying vec4 vColor;\n varying vec4 vPositionMC;\n varying vec3 v_positionEC;\n varying vec4 vSecondColor;\n varying vec3 vNormalEC;\n#ifdef Instance\n varying vec3 vPositionRotateMC;\n#endif\nuniform float uShadowDarkness;\n#ifdef IMAGERY\nvarying vec2 imgCoord;\nuniform sampler2D uImgTexture;\nuniform float uImgTextureAlpha;\nuniform vec2 uImgTextureBound;\n\n\n\n//#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\nuniform bool u_dayTextureFlipY[TEXTURE_UNITS];\n//过滤颜色,rgb代表过滤的颜色,a表示Tolerance\nuniform vec4 u_transparentBackColor[TEXTURE_UNITS];\nuniform bool u_imageryClipEnable[TEXTURE_UNITS];\n\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SPLIT\nuniform vec2 u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SWIPE\nuniform vec4 u_dayTextureSwipeRegion[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GLOBESPLIT\nuniform vec2 u_GlobeSplitDirection;\n#endif\n\n#ifdef APPLY_GLOBESWIPE\nuniform vec4 u_GlobeSwipeRegion;\n#endif\n\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n//#endif\n\n\n/*\n//#if GRIDTEXTURE_UNITS > 0\nuniform sampler2D u_gridTextures[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTranslationAndScale[GRIDTEXTURE_UNITS];\nuniform bool u_gridTextureUseWebMercatorT[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTexCoordsRectangle[GRIDTEXTURE_UNITS];\n//#endif\n*/\n\n\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\n\n#endif\n\n\n\nuniform mat4 uGeoMatrix;\nvec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n#ifndef HDR \n srgbIn = srgbIn ;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n#else\n return srgbIn;\n#endif\n}\n vec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else\n return linearIn;\n#endif\n}\n#ifndef INVALID_OBLIQUE\n vec4 getTextureColor(out vec4 outTexCoord, out vec4 firstColor, out vec4 secColor)\n {\n#ifdef TextureBatch\n vec4 FColor = czm_getTexColorForS3M(uTexture, vTexCoord.xy, vTexSize.xy, vTexTran.xy, vTexScale.xy, vMaxMipLevel.x, outTexCoord.xy);\n#else\n if(vTexMatrix.z < 0.0)\n {\n return vec4(1.0);\n }\n float texTileWidth0 = vTexMatrix.z * u_MaterialParam.textureWidth.x;\n vec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordZ.x);\n vec4 FColor = czm_getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x, u_MaterialDynamicParameter.texUVOffset, outTexCoord.xy);\n#ifdef Map\n\t\tvec4 FMapColor = czm_getTexColorForS3M(uMapTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x, u_MaterialDynamicParameter.texUVOffset, outTexCoord.xy);\n\t\tif(FMapColor.a > 0.9)\n\t\t{\n FColor.rgb = FMapColor.bgr;\n }\n#endif\n#endif\n firstColor = FColor;\n#ifdef MULTI_TEX\n#ifdef TextureBatch\n vec4 SColor = czm_getTexColorForS3M(uSecTexture, vTexCoord.zw, vTexSize.zw, vTexTran.zw, vTexScale.zw, vMaxMipLevel.y, outTexCoord.zw);\n#else\n float texTileWidth1 = vTexMatrix2.z * u_MaterialParam.textureWidth.y;\n realTexCoord = vec3(vTexCoord.zw, vTexCoordZ.y);\n vec4 SColor = czm_getTexColorForS3M(uSecTexture, realTexCoord, texTileWidth1, vTexMatrix2.w, vTexMatrix2.z, vTexMatrix2.xy, vIsRGBA.y, u_MaterialDynamicParameter.texUVOffset, outTexCoord.zw);\n#endif\n#ifdef SEC_TEX_EMISSION\n secColor = SColor;\n return FColor;\n#else\n return SRGBtoLINEAR4(FColor) * SRGBtoLINEAR4(SColor);\n#endif\n#else\n return SRGBtoLINEAR4(FColor);\n#endif\n }\n#endif\n#ifdef SQCLIP\nuniform sampler2D uFrontColorTexture;\nuniform sampler2D uFrontDepthTexture;\nuniform sampler2D uBackDepthTexture;\nuniform float uSQMode; \nfloat computeDepth()\n{\n#ifdef LOG_DEPTH\n return log2(v_depthFromNearPlusOne) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#else\n return gl_FragCoord.z;\n#endif\n}\nbool isPointInObject(vec2 texCoord)\n{\n bool bIn = false;\n vec4 colorInClipTexture = texture2D(uFrontColorTexture,texCoord.xy);\n if(colorInClipTexture.r > 0.99 && colorInClipTexture.g < 0.01 && colorInClipTexture.b < 0.01)\n {\n float depthNear = czm_unpackDepth(texture2D(uFrontDepthTexture, texCoord.xy)) - 0.00001;\n float depthFar = czm_unpackDepth(texture2D(uBackDepthTexture, texCoord.xy)) + 0.00001;\n float currentDepth = computeDepth();\n if(currentDepth > depthNear && currentDepth < depthFar){\n bIn = true;\n }\n }\n return uSQMode < 0.5 ? !bIn : bIn;\n}\n#endif\n\n\nvec2 calculatePolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect){\n vec4 realVertexPos = vertexPos;\n vec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\n vec2 texCoord = vec2(realVertexPos.x - rectPos.x, realVertexPos.y - rectPos.y);\n texCoord.x = texCoord.x / vecRatio.x;\n texCoord.y = texCoord.y / vecRatio.y;\n ptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\n texCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\n return texCoord;\n}\n\n#include <brdf>\n\n#ifndef HAS_LIGHT\n #include <rainDecl>\n #ifdef HAS_WETNESS\n uniform float uWetnessFactor;\n #endif\n\n #include <snowDecl>\n#endif\n\nvoid InitUniformStructParameter(){\n#ifdef UNIFORM_BUFFER\n#else\n u_LayerParam.minMaxTransparentAndPolygonOffset.x = uMinMaxTransparent.x;\n u_LayerParam.minMaxTransparentAndPolygonOffset.y = uMinMaxTransparent.y;\n u_LayerParam.minMaxTransparentAndPolygonOffset.z = uPolygonOffset.x;\n u_LayerParam.minMaxTransparentAndPolygonOffset.w = uPolygonOffset.y;\n u_MaterialParam.textureWidth.x = uTexture0Width;\n u_MaterialParam.textureWidth.y = uTexture1Width;\n u_MaterialParam.ambientColor = uAmbientColor;\n u_MaterialParam.diffuseColor = uDiffuseColor;\n u_MaterialDynamicParameter.texUVOffset = uTexUVOffset;\n u_MaterialDynamicParameter.fillForeColor = uFillForeColor;\n u_LightParam.ambientLightColor.rgb = uAmbientLightColor;\n u_LightParam.sunLightColor = uSunLightColor;\n u_LightParam.ambientLightColor.a = 1.0;\n u_LightParam.sunDirECAndSunLightON.xyz = czm_sunDirectionEC;\n u_LightParam.sunDirECAndSunLightON.w = uSunLightON;\n#endif\n}\n#ifdef FLOOD_ANALYSIS\nuniform sampler2D uFloodFlagTexture;\nuniform vec4 uFloodRect;\nvarying vec4 vFloodPos;\nbool GetWaterColor(out vec4 color)\n{\n float width = uFloodRect.z - uFloodRect.x;\n float height = uFloodRect.w - uFloodRect.y;\n if(vFloodPos.x < uFloodRect.x || vFloodPos.x > uFloodRect.z || vFloodPos.y < uFloodRect.y || vFloodPos.y > uFloodRect.w)\n {\n return false;\n }\n vec2 floodTexcoord = vec2((vFloodPos.x - uFloodRect.x) / width, (vFloodPos.y - uFloodRect.y) / height);\n vec4 flagColor = texture2D(uFloodFlagTexture, floodTexcoord);\n if(flagColor.r < 0.5)\n {\n return false;\n }\n color = vec4(40.0/255.0,150.0/255.0,200.0/255.0,1.0);\n return true;\n}\n#endif\n#ifdef VISIBLEDISTANCEMAX\n uniform float uVisibleDistanceMax;\n#endif\n#include <executeServerExcavationDecl>\nvoid main()\n{\n InitUniformStructParameter();\n czm_s3mMaterialInput material;\n material.ambientColor = u_MaterialParam.ambientColor;\n material.diffuseColor = u_MaterialParam.diffuseColor;\n material.ambientLightColor = u_LightParam.ambientLightColor;\n material.sunLightColor = u_LightParam.sunLightColor;\n material.sunLightON = u_LightParam.sunDirECAndSunLightON.w;\n material.sunDirectionEC = u_LightParam.sunDirECAndSunLightON.xyz;\n#ifdef FINAL_RESOLUTION_CLIP\n\tif(vertexClip.x > uMaxClip.x || vertexClip.y > uMaxClip.y || vertexClip.z > uMaxClip.z \n\t|| vertexClip.x < uMinClip.x || vertexClip.y < uMinClip.y || vertexClip.z < uMinClip.z) \n { \n discard; \n } \n#endif\n#ifdef Height_Map\n gl_FragColor = czm_packValue(wValue);\n return;\n#endif\nif(vColor.a == 0.0)\n{\n discard;\n}\n#ifdef SQCLIP\n vec2 texCoord = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\n if(!isPointInObject(texCoord)) \n { \n discard; \n } \n#endif\n#ifdef NORMAL\n vec3 normalMC = normalize(czm_computeNormal(vPositionMC.xyz));\n normalMC = normalMC * 0.5 + vec3(0.5);\n gl_FragColor = vec4(normalMC, 1.0);\n #ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = gl_FragCoord.z;\n #endif\n #ifdef WEBGL2\n gl_FragDepthEXT = gl_FragCoord.z;\n #endif\n return;\n#endif\n#ifdef NORMAL_AND_DEPTH\n#ifdef SILHOUETTE_SELECT_TYPE\n if(fSelectedForSilh < 0.9)\n {\n discard;\n }\n#endif\n vec3 normal = normalize(perVertexNormals);\n float dLength = length(perVertexNormals);\n if(dLength <= 0.9)\n {\n normal = vec3(czm_normal*czm_computeNormal(oriVertex.xyz));\n }\n normal = (normal + 1.0) * 0.5;\n gl_FragColor = vec4(normal, 1.0);\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = gl_FragCoord.z;\n#endif\n#ifdef WEBGL2\n gl_FragDepthEXT = gl_FragCoord.z;\n#endif\n return;\n#endif\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n#ifdef SERVEREXCAVATION\n if(executeServerExcavation())\n {\n discard;\n }\n#endif\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n vec4 realTexCoord = vec4(0.0);\n vec4 baseColor = vColor;\n#ifdef INVALID_OBLIQUE\n baseColor *= vec4(0.5,0.5,0.5,1.0);\n#else\n vec4 firstColor;\n vec4 secColor;\n #ifdef InstanceRenderPipeline\n vec4 outTexColor = texture2D(uTexture, (vTexCoord.xy * uTexUVOffset.zw + uTexUVOffset.xy));\n realTexCoord.xy = vTexCoord.xy;\n #else\n vec4 outTexColor = getTextureColor(realTexCoord, firstColor, secColor);\n #endif\n #ifndef REPLACE_COLOR_TYPE\n baseColor = baseColor * outTexColor;\n #endif\n#endif\n\n#ifndef HAS_LIGHT\n #ifdef HAS_RAIN\n vec3 ng = length(vNormalEC) < 0.1 ? normalize(czm_normal * czm_computeNormal(vPositionMC.xyz)) : normalize(vNormalEC);\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS = normalize(fixedToENU * ng);\n vec3 rainNormal = rippleGenerator(uRippleTexture, uAnimationSpeed, normalWS, uWetnessFactor);\n baseColor.rgb *= dot(rainNormal, vec3(0.0, 0.0, 1.0));\n #endif\n\n #ifdef HAS_SNOW\n vec3 ng = length(vNormalEC) < 0.1 ? normalize(czm_normal * czm_computeNormal(vPositionMC.xyz)) : normalize(vNormalEC);\n mat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\n vec3 normalWS = normalize(fixedToENU * ng);\n float roughness = 1.0;\n snowGenerator(uSnowMaskTexture, uSnowNormalTexture, vTexCoord.xy, uSnowCoverageFactor, normalWS, baseColor.xyz, roughness);\n #endif\n#endif\n\n gl_FragColor = baseColor;\n#ifdef BRDF\n gl_FragColor = brdf(baseColor, realTexCoord.xy, vTexCoord.xy, v_positionEC, vPositionMC.xyz, vNormalEC, uSunLightColor, u_LightParam.sunDirECAndSunLightON.w);\n#endif\n#ifdef TRANSPARENT_BACK_COLOR\n if(uTransparentBackColorTolerance > 0.01)\n {\n float rDiff = abs(uTransparentBackColor.r - gl_FragColor.r);\n float gDiff = abs(uTransparentBackColor.g - gl_FragColor.g);\n float bDiff = abs(uTransparentBackColor.b - gl_FragColor.b);\n if(rDiff < uTransparentBackColorTolerance && gDiff < uTransparentBackColorTolerance && bDiff < uTransparentBackColorTolerance)\n {\n discard;\n }\n }\n#endif\n#ifdef REPLACE_COLOR_TYPE\n if(fSelected.y > 0.9)\n {\n gl_FragColor = vColor;\n }\n#endif\n#ifdef REPLACE_SELECT_TYPE\n if(fSelected.x > 0.9)\n {\n gl_FragColor = vColor;\n }\n#endif\n#ifdef VISIBLEDISTANCEMAX\n if(length(v_positionEC) > uVisibleDistanceMax)\n {\n float minAlphl = min(1.0, (length(v_positionEC) - uVisibleDistanceMax) / 2000.0);\n gl_FragColor.a = 1.0 - minAlphl;\n }\n#endif\n#ifdef HYPSOMETRIC\n\tif(uHypsometricVisible>0.5)\n\t{\n #ifdef Volume2\n vec4 volColor = texture2D(uVolumeTexture, vec2(vTexCoord.x, 1.0 - vTexCoord.y));\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, volColor);\n #else\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, wValue);\n #endif\n }\n#endif\n#ifdef HAS_LIGHT\n#ifdef PBR\n czm_S3MPBR(gl_FragColor, realTexCoord);\n#else\n#ifndef BRDF\n#ifdef Instance\n gl_FragColor *= czm_computeLightColorInstanceInFP(material, vPositionRotateMC, vPositionMC.xyz, vPositionMC.w, vNormalEC);\n#else\n #ifndef IGNORE_NORMAL\n gl_FragColor *= czm_computeLightColorInFP(material, vPositionMC.xyz, vPositionMC.w, vNormalEC);\n #endif\n #ifdef IS_SQUARE_PIPE\n gl_FragColor *= czm_computeLightColorInFP(material, vPositionMC.xyz, 0.0, vNormalEC);\n #endif\n#endif\n #ifndef HDR \n gl_FragColor.rgb = czm_acesTonemapping(gl_FragColor.rgb);\n #endif\n \n#endif\n#endif\n#endif\ngl_FragColor.rgb = LINEARtoSRGB(gl_FragColor.rgb);\n#ifdef OVERLAY\n float ptInOveralyRect = 1.0;\n vec4 vertexPos = uGeoMatrix * vec4(vPositionMC.xyz, 1.0);\n vec2 vecOverlayTexCoord = calculatePolyTexCoord(vertexPos, uOverlayRect, ptInOveralyRect);\n if(ptInOveralyRect > 0.5)\n {\n vec4 overlayColor = texture2D(uOverlayTexture, vecOverlayTexCoord.xy);\n if(!(overlayColor.r > 0.999 && overlayColor.g > 0.999 && overlayColor.b > 0.999) && !(overlayColor.r < 0.001 && overlayColor.g < 0.001 && overlayColor.b < 0.001))\n {\n vec4 mixColor = mix(gl_FragColor, overlayColor, overlayColor.a);\n gl_FragColor = vec4(mixColor.r, mixColor.g, mixColor.b, gl_FragColor.a);\n }\n }\n#endif\n#ifdef HORIZONTAL_LINE\n gl_FragColor = czm_getHorizontalColor(gl_FragColor, wValue);\n#endif \n\tif(gl_FragColor.a == 0.0)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n#ifdef CLIP_FILT_BY_ID\n gl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), vIsFiltByID.x);\n#else\n gl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n#endif\n#ifdef SILHOUETTE_SELECT_TYPE\n if(uSelectColorType == 2)\n {\n if(fSelectedForSilh > 0.9)\n {\n gl_FragColor = czm_sketchMode(gl_FragColor, uSelColor, 3.0);\n }\n }\n else\n {\n gl_FragColor = czm_sketchMode(gl_FragColor, uSelColor, 3.0);\n }\n#endif\n#ifdef SKETCH_MODE\n gl_FragColor = czm_sketchMode(gl_FragColor, uLineColor, uLineWidth);\n if(gl_FragColor.a < u_LayerParam.minMaxTransparentAndPolygonOffset.x)\n\t{\n\t\tdiscard;\n\t}\n#endif\n#ifdef Only_LineColor\n\tgl_FragColor = uLineColor;\n#endif\n#ifdef EMISSION_TEXTURE\n vec3 normalMC = normalize(czm_computeNormal(vPositionMC.xyz));\n float isNotTopFace = 1.0 - step(0.95, normalMC.z);\n float dayTime = 1.0 - czm_RGBToHSL(uAmbientLightColor.rgb).z;\n vec3 emissionTexColor = czm_getEmissiveTextureColor(wValue) * dayTime;\n gl_FragColor.rgb += uEmissionColor.rgb * emissionTexColor * isNotTopFace;\n#endif\n#ifdef SEC_TEX_EMISSION\n gl_FragColor.rgb += uEmissionColor.rgb * secColor.rgb;\n#endif\n#ifdef TEXTURE_MOVE\n gl_FragColor.rgb = uEmissionColor.rgb * baseColor.rgb;\n#endif\n#ifdef LOG_DEPTH\n if(u_LayerParam.minMaxTransparentAndPolygonOffset.z != 0.0 || u_LayerParam.minMaxTransparentAndPolygonOffset.w != 0.0){\n float logZ = 1.0 / gl_FragCoord.w + 1.0;\n float DZ = max(dFdx(logZ), dFdy(logZ));\n logZ += DZ * u_LayerParam.minMaxTransparentAndPolygonOffset.z + 0.0000001 * u_LayerParam.minMaxTransparentAndPolygonOffset.w;\n czm_writeLogDepth(logZ);\n }\n else{\n czm_writeLogDepth(v_depthFromNearPlusOne);\n }\n#endif\n#ifdef PARTLY_TRANSPARENT\n #ifdef TRANSPARENT_PASS\n if(gl_FragColor.a > 0.95){\n discard;\n }\n #else\n if(gl_FragColor.a <= 0.95){\n discard;\n }\n #endif\n#endif\n#ifdef ADJUST_COLOR\n gl_FragColor.rgb = czm_adjustColor(gl_FragColor.rgb);\n#endif\n\n\n#ifdef IMAGERY\nvec2 texcood = vec2(imgCoord.x/uImgTextureBound.x, imgCoord.y/uImgTextureBound.y);\n/*\nvec4 imageColor = texture2D(uImgTexture, texcood);\nif(imageColor.a > 0.9 && uImgTextureAlpha > 0.9)\n{\n gl_FragColor = imageColor;\n}\nelse\n{\n gl_FragColor.rgb = mix(gl_FragColor.rgb, imageColor.rgb, uImgTextureAlpha*imageColor.a);\n}\n*/\n#ifdef MULTIBATCH\n\tgl_FragColor = computeDayColor(vec4(1.0,1.0,1.0,0.0), clamp(vec3(texcood,0.0), 0.0, 1.0));\n#else\n\tgl_FragColor = computeDayColor(gl_FragColor, clamp(vec3(texcood,0.0), 0.0, 1.0));\n#endif\n#endif\n#ifdef FLOOD_ANALYSIS\n vec4 floodColor = vec4(1.0,1.0,1.0,1.0);\n if(GetWaterColor(floodColor))\n {\n gl_FragColor = floodColor;\n return;\n }\n#endif\ngl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x5c568f=(_0xb08edd=!0,function(e,t){var i=_0xb08edd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xb08edd=!1,i}),_0x64fa7a=_0x5c568f(void 0,(function(){return _0x64fa7a.toString().search("(((.+)+)+)+$").toString().constructor(_0x64fa7a).search("(((.+)+)+)+$")})),_0xb08edd;_0x64fa7a();var _0x33bf99="attribute vec4 aPosition;\n#endif\n#ifdef TexCoord\n varying vec4 vTexCoord;\n#endif\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\nvarying vec4 vSecondColor;\n#ifdef REPLACE_SELECT_TYPE\nvarying float fSelected;\n#endif\nuniform vec4 uSelColor;\nuniform vec2 textureRepeat;\n#ifdef LineVector\nuniform vec4 uLineColor;\n#endif\n#ifdef COMPRESS_VERTEX\n uniform vec4 decode_position_min;\n uniform float decode_position_normConstant;\n#endif\nuniform vec4 uFillForeColor;\nvarying vec4 vColor;\nvoid main()\n{\n#ifdef COMPRESS_VERTEX\n vec4 vertexPos = vec4(1.0);\n vertexPos = decode_position_min + aPosition * decode_position_normConstant;\n#else\n vec4 vertexPos = aPosition;\n#endif\n#ifdef TexCoord\n vTexCoord.xy = vertexPos.xy * textureRepeat;\n#endif\n vertexPos.w = 1.0;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n#ifdef REPLACE_SELECT_TYPE\n fSelected = 0.0;\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor, fSelected);\n#else\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n#endif\nvColor = vertexColor*uFillForeColor;\n#ifdef LineVector\n vColor = vertexColor * uLineColor;\n#endif\n gl_Position = czm_modelViewProjection * vertexPos;\n}",_0x5ed309=(_0xfe209=!0,function(e,t){var i=_0xfe209?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xfe209=!1,i}),_0x4daa24=_0x5ed309(void 0,(function(){return _0x4daa24.toString().search("(((.+)+)+)+$").toString().constructor(_0x4daa24).search("(((.+)+)+)+$")})),_0xfe209;_0x4daa24();var _0x321a25="#ifdef TexCoord\n uniform sampler2D uTexture;\n varying vec4 vTexCoord;\n#endif\n uniform vec4 uEmissionColor;\n varying vec4 vColor;\n varying vec4 vSecondColor;\n#ifdef REPLACE_SELECT_TYPE\n varying float fSelected;\n#endif\nvoid main()\n{\n\tif(vColor.a == 0.0)\n\t{\n\t\tdiscard;\n\t}\n#ifdef TexCoord\n vec4 texColor = texture2D(uTexture, vTexCoord.xy);\n gl_FragColor = texColor * vColor;\n#else\n gl_FragColor = vColor;\n#endif\n#ifdef REPLACE_SELECT_TYPE\n if(fSelected > 0.9)\n {\n gl_FragColor = vColor;\n }\n#endif\n\tif(gl_FragColor.a == 0.0)\n\t{\n\t\tdiscard;\n\t}\n gl_FragColor.rgb *= uEmissionColor.rgb;\n}",_0x1a4463=(_0xfca289=!0,function(e,t){var i=_0xfca289?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xfca289=!1,i}),_0x1fc7bd=_0x1a4463(void 0,(function(){return _0x1fc7bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x1fc7bd).search("(((.+)+)+)+$")})),_0xfca289;_0x1fc7bd();var _0xb5c174="\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#extension GL_EXT_shader_texture_lod : enable\n#ifdef COMPUTE_W_VALUE\n varying float wValue;\n#endif\n#ifdef TexCoord\n varying vec4 vTexCoord;\n varying vec2 vTexCoordZ;\n#endif\n#ifdef NO_TEXCOORD\n uniform sampler2D uTexture;\n#endif\n#ifdef COMPUTE_TEXCOORD\n varying vec4 vTexMatrix;\n varying vec2 vIsRGBA;\n#endif\n#ifdef PBR_THEME\n uniform mat4 uPBRMaterials[NUM_PBR_MATERIALS];\n varying float vPBRIndex;\n#endif\nvarying vec4 vColor;\nvarying vec4 vPositionMC;\nvarying vec3 v_positionEC;\nvarying vec4 vSecondColor;\nvarying vec3 vNormalEC;\n#ifdef Instance\n varying vec3 vPositionRotateMC;\n#endif\n#ifdef IMAGERY\nvarying vec2 imgCoord;\nuniform sampler2D uImgTexture;\nuniform float uImgTextureAlpha;\nuniform vec2 uImgTextureBound;\n//#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\nuniform bool u_dayTextureFlipY[TEXTURE_UNITS];\n//过滤颜色,rgb代表过滤的颜色,a表示Tolerance\nuniform vec4 u_transparentBackColor[TEXTURE_UNITS];\nuniform bool u_imageryClipEnable[TEXTURE_UNITS];\n\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SPLIT\nuniform vec2 u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SWIPE\nuniform vec4 u_dayTextureSwipeRegion[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GLOBESPLIT\nuniform vec2 u_GlobeSplitDirection;\n#endif\n\n#ifdef APPLY_GLOBESWIPE\nuniform vec4 u_GlobeSwipeRegion;\n#endif\n\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n//#endif\n\n\n/*\n//#if GRIDTEXTURE_UNITS > 0\nuniform sampler2D u_gridTextures[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTranslationAndScale[GRIDTEXTURE_UNITS];\nuniform bool u_gridTextureUseWebMercatorT[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTexCoordsRectangle[GRIDTEXTURE_UNITS];\n//#endif\n*/\n\n\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\n\n#endif\n\n\n#ifdef USE_BatchPBR\n varying vec4 vMetallicRoughness;\n varying vec4 vEmissiveFactor;\n varying vec3 vAlphaCutoffAndModeAndDoubleSide;\n#endif\n#ifdef OVERLAY\n uniform vec4 uOverlayRect;\n uniform sampler2D uOverlayTexture;\n#endif\n#ifdef NORMAL_AND_DEPTH\n varying vec4 oriVertex;\n varying vec3 perVertexNormals;\n varying float depthInCamera;\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\n#ifdef QUAD_OUTLINE\n varying float vDistanceFromEye;\n#endif\n#ifdef APPLY_SPLIT\nuniform float uSplitDirection;\nuniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nvarying vec4 vIsFiltByID;\nvarying vec2 fSelected;\n#ifdef SILHOUETTE_SELECT_TYPE\nuniform vec4 uSelColor;\nuniform int uSelectColorType;\nvarying float fSelectedForSilh;\n#endif\n#ifdef SKETCH_MODE\n uniform vec4 uLineColor;\n uniform float uLineWidth;\n#endif\n#ifdef POINT\n varying float v_pixelDistance;\n#endif\n#ifdef Only_LineColor\n uniform vec4 uLineColor;\n#endif\n uniform vec4 uEmissionColor;\n#ifdef POST_EFFECT\n uniform float uMaxBloomHeight;\n#endif\n uniform vec2 uPolygonOffset;\n uniform vec2 uMinMaxTransparent;\n struct LayerParameter{\n vec4 translationAndBottom;\n vec4 minMaxTransparentAndPolygonOffset;\n vec4 selColor;\n float pointSize;\n };\n uniform vec4 uAmbientColor;\n uniform vec4 uDiffuseColor;\n struct MaterialParameter{\n vec4 ambientColor;\n vec4 diffuseColor;\n mat4 texMatrix;\n vec2 textureWidth;\n };\n uniform vec4 uFillForeColor;\n uniform vec4 uTexUVOffset;\n struct MaterialDynamicParameter{\n vec4 texUVOffset;\n vec4 fillForeColor;\n };\n \n uniform vec3 uAmbientLightColor;\n uniform vec4 uSunLightColor;\n uniform float uSunLightON;\n struct LightParameter{\n vec4 ambientLightColor;\n vec4 sunLightColor;\n vec4 sunDirECAndSunLightON;\n };\n LayerParameter u_LayerParam;\n MaterialParameter u_MaterialParam;\n MaterialDynamicParameter u_MaterialDynamicParameter;\n LightParameter u_LightParam;\n#ifdef SQCLIP\nuniform sampler2D uFrontColorTexture;\nuniform sampler2D uFrontDepthTexture;\nuniform sampler2D uBackDepthTexture;\nuniform float uSQMode; \nfloat computeDepth()\n{\n#ifdef LOG_DEPTH\n return log2(v_depthFromNearPlusOne) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#else\n return gl_FragCoord.z;\n#endif\n}\nbool isPointInObject(vec2 texCoord)\n{\n bool bIn = false;\n vec4 colorInClipTexture = texture2D(uFrontColorTexture,texCoord.xy);\n if(colorInClipTexture.r > 0.99 && colorInClipTexture.g < 0.01 && colorInClipTexture.b < 0.01)\n {\n float depthNear = czm_unpackDepth(texture2D(uFrontDepthTexture, texCoord.xy)) - 0.00001;\n float depthFar = czm_unpackDepth(texture2D(uBackDepthTexture, texCoord.xy)) + 0.00001;\n float currentDepth = computeDepth();\n if(currentDepth > depthNear && currentDepth < depthFar){\n bIn = true;\n }\n }\n return uSQMode < 0.5 ? !bIn : bIn;\n}\n#endif\n\nvec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n srgbIn = srgbIn;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n vec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else\n return linearIn;\n#endif\n}\n\n#include <brdf>\n\nvoid InitUniformStructParameter(){\n#ifdef UNIFORM_BUFFER\n#else\n u_LayerParam.minMaxTransparentAndPolygonOffset.x = uMinMaxTransparent.x;\n u_LayerParam.minMaxTransparentAndPolygonOffset.y = uMinMaxTransparent.y;\n u_LayerParam.minMaxTransparentAndPolygonOffset.z = uPolygonOffset.x;\n u_LayerParam.minMaxTransparentAndPolygonOffset.w = uPolygonOffset.y;\n u_MaterialParam.ambientColor = uAmbientColor;\n u_MaterialParam.diffuseColor = uDiffuseColor;\n u_MaterialDynamicParameter.fillForeColor = uFillForeColor;\n u_MaterialDynamicParameter.texUVOffset = uTexUVOffset;\n u_LightParam.ambientLightColor.rgb = uAmbientLightColor;\n u_LightParam.ambientLightColor.a = 1.0;\n u_LightParam.sunLightColor = uSunLightColor;\n u_LightParam.sunDirECAndSunLightON.xyz = czm_sunDirectionEC;\n u_LightParam.sunDirECAndSunLightON.w = uSunLightON;\n#endif\n}\n#ifdef VISIBLEDISTANCEMAX\n uniform float uVisibleDistanceMax;\n#endif\n uniform mat4 uGeoMatrix;\nvec2 calculatePolyTexCoord(vec4 vertexPos, vec4 rectPos, out float ptInRect){\n vec4 realVertexPos = vertexPos;\n vec2 vecRatio = vec2(rectPos.z - rectPos.x, rectPos.w - rectPos.y);\n vec2 texCoord = vec2(realVertexPos.x - rectPos.x, realVertexPos.y - rectPos.y);\n texCoord.x = texCoord.x / vecRatio.x;\n texCoord.y = texCoord.y / vecRatio.y;\n ptInRect = step(0.0, texCoord.x) * step(0.0, texCoord.y) * step(0.0, 1.0 - texCoord.x) * step(0.0, 1.0 - texCoord.y);\n texCoord = clamp(texCoord, vec2(0.0), vec2(1.0));\n return texCoord;\n}\nvoid main()\n{\n InitUniformStructParameter();\n czm_s3mMaterialInput material;\n material.ambientColor = u_MaterialParam.ambientColor;\n material.diffuseColor = u_MaterialParam.diffuseColor;\n material.ambientLightColor = u_LightParam.ambientLightColor;\n material.sunLightColor = u_LightParam.sunLightColor;\n material.sunLightON = u_LightParam.sunDirECAndSunLightON.w;\n material.sunDirectionEC = u_LightParam.sunDirECAndSunLightON.xyz;\n#ifdef SQCLIP\n vec2 texCoord = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\n if(!isPointInObject(texCoord)) \n { \n discard; \n } \n#endif\n#ifdef NORMAL\n vec3 normalMC = normalize(czm_computeNormal(vPositionMC.xyz));\n normalMC = normalMC * 0.5 + vec3(0.5);\n gl_FragColor = vec4(normalMC, 1.0);\n #ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = gl_FragCoord.z;\n #endif\n #ifdef WEBGL2\n gl_FragDepthEXT = gl_FragCoord.z;\n #endif\n return;\n#endif\n#ifdef NORMAL_AND_DEPTH\n#ifdef SILHOUETTE_SELECT_TYPE\n if(fSelectedForSilh < 0.9)\n {\n discard;\n }\n#endif\n vec3 normal = normalize(perVertexNormals);\n float dLength = length(perVertexNormals);\n if(dLength <= 0.5)\n {\n normal = vec3(czm_normal*czm_computeNormal(oriVertex.xyz));\n }\n normal = vec3(czm_normal*czm_computeNormal(oriVertex.xyz));\n normal = (normal + 1.0) * 0.5;\n gl_FragColor = vec4(normal, 1.0);\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = gl_FragCoord.z;\n#endif\n#ifdef WEBGL2\n gl_FragDepthEXT = gl_FragCoord.z;\n#endif\n#endif\n return;\n#endif\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE\n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n\nvec4 imageryColor = vec4(1.0, 1.0, 1.0, 1.0);\n#ifdef IMAGERY\n vec2 texcood = vec2(imgCoord.x/uImgTextureBound.x, imgCoord.y/uImgTextureBound.y);\n#ifdef MULTIBATCH\n imageryColor = computeDayColor(vec4(1.0,1.0,1.0,0.0), clamp(vec3(texcood,0.0), 0.0, 1.0));\n#else\n imageryColor = computeDayColor(imageryColor, clamp(vec3(texcood,0.0), 0.0, 1.0));\n#endif\n#endif\n\n\tif(vColor.a == 0.0)\n\t{\n\t discard;\n\t}\n gl_FragColor = vColor * imageryColor;\n#ifdef LineVector\n gl_FragColor = vColor * imageryColor * uDiffuseColor;\n#endif\n#ifdef NO_TEXCOORD\n#ifndef REPLACE_COLOR_TYPE\n gl_FragColor *= texture2D(uTexture, vec2(0.5));\n#endif\n#endif\n#ifdef BRDF\n vec2 texCoord = vec2(0.0);\n #ifdef TexCoord\n texCoord = vTexCoord.xy;\n #endif\n gl_FragColor = brdf(gl_FragColor, texCoord, texCoord, v_positionEC, vPositionMC.xyz, vNormalEC, uSunLightColor, u_LightParam.sunDirECAndSunLightON.w);\n#endif\n#ifdef ADJUST_COLOR\n\tgl_FragColor.rgb = czm_adjustColor(gl_FragColor.rgb);\n#endif\n#ifdef POINT\n float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n gl_FragColor.a *= wholeAlpha;\n if(gl_FragColor.a < 0.1)\n {\n discard;\n }\n#endif\n#ifdef REPLACE_COLOR_TYPE\n if(fSelected.y > 0.9)\n {\n gl_FragColor = vColor;\n }\n#endif\n#ifdef REPLACE_SELECT_TYPE\n if(fSelected.x > 0.9)\n {\n gl_FragColor = vColor;\n }\n#endif\n#ifdef VISIBLEDISTANCEMAX\n if(length(v_positionEC) > uVisibleDistanceMax)\n {\n float minAlphl = min(1.0, (length(v_positionEC) - uVisibleDistanceMax) / 2000.0);\n gl_FragColor.a = 1.0 - minAlphl;\n }\n#endif\n#ifdef HYPSOMETRIC\n\tif(uHypsometricVisible>0.5)\n\t{\n\t#ifdef VOL_AND_HYP\n gl_FragColor = vec4(1.0);\n #endif\n #ifdef Volume2\n vec4 volColor = texture2D(uVolumeTexture, vec2(vTexCoord.x, 1.0 - vTexCoord.y));\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, volColor);\n #else\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, wValue);\n #ifdef MultiTemporalWeight\n if(gl_FragColor.a < 0.1)\n {\n discard;\n }\n #endif\n #endif\n }\n#endif\n#ifdef HAS_LIGHT\n#ifdef PBR\n czm_S3MPBR(gl_FragColor, vec2(0.0));\n#else\n#ifndef BRDF\n#ifndef POINT\n#ifdef Instance\n gl_FragColor *= czm_computeLightColorInstanceInFP(material, vPositionRotateMC, vPositionMC.xyz, vPositionMC.w, vNormalEC);\n#else\n gl_FragColor *= czm_computeLightColorInFP(material, vPositionMC.xyz, vPositionMC.w, vNormalEC);\n#endif\n#ifndef HDR \n gl_FragColor.rgb = czm_acesTonemapping(gl_FragColor.rgb);\n#endif\n gl_FragColor.rgb = LINEARtoSRGB(gl_FragColor.rgb);\n#endif\n#endif\n#endif\n#endif\n\n#ifdef OVERLAY\n float ptInOveralyRect = 1.0;\n vec4 vertexPos = uGeoMatrix * vec4(vPositionMC.xyz, 1.0);\n vec2 vecOverlayTexCoord = calculatePolyTexCoord(vertexPos, uOverlayRect, ptInOveralyRect);\n if(ptInOveralyRect > 0.5)\n {\n vec4 overlayColor = texture2D(uOverlayTexture, vecOverlayTexCoord.xy);\n if(!(overlayColor.r > 0.999 && overlayColor.g > 0.999 && overlayColor.b > 0.999) && !(overlayColor.r < 0.001 && overlayColor.g < 0.001 && overlayColor.b < 0.001))\n {\n vec4 mixColor = mix(gl_FragColor, overlayColor, overlayColor.a);\n gl_FragColor = vec4(mixColor.r, mixColor.g, mixColor.b, gl_FragColor.a);\n }\n }\n#endif\n#ifdef HORIZONTAL_LINE\n gl_FragColor = czm_getHorizontalColor(gl_FragColor, wValue);\n#endif\n\tif(gl_FragColor.a == 0.0)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n#ifdef CLIP_FILT_BY_ID\n gl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), vIsFiltByID.x);\n#else\n gl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n#endif\n#ifdef SILHOUETTE_SELECT_TYPE\n if(uSelectColorType == 2)\n {\n if(fSelectedForSilh > 0.9)\n {\n gl_FragColor = czm_sketchMode(gl_FragColor, uSelColor, 3.0);\n }\n }\n else\n {\n gl_FragColor = czm_sketchMode(gl_FragColor, uSelColor, 3.0);\n }\n#endif\n#ifdef SKETCH_MODE\n\tgl_FragColor = czm_sketchMode(gl_FragColor, uLineColor, uLineWidth);\n\tif(gl_FragColor.a < u_LayerParam.minMaxTransparentAndPolygonOffset.x)\n\t{\n\t\tdiscard;\n\t}\n#endif\n#ifdef Only_LineColor\n\tgl_FragColor = uLineColor;\n#endif\n#ifdef LOG_DEPTH\n#ifndef QUAD_OUTLINE\n if(u_LayerParam.minMaxTransparentAndPolygonOffset.z != 0.0 || u_LayerParam.minMaxTransparentAndPolygonOffset.w != 0.0){\n float logZ = 1.0 / gl_FragCoord.w + 1.0;\n float DZ = max(dFdx(logZ), dFdy(logZ));\n logZ += DZ * u_LayerParam.minMaxTransparentAndPolygonOffset.z + 0.0000001 * u_LayerParam.minMaxTransparentAndPolygonOffset.w;\n czm_writeLogDepth(logZ);\n }\n else{\n czm_writeLogDepth(v_depthFromNearPlusOne);\n }\n#else\n czm_writeLogDepth(v_depthFromNearPlusOne - 0.8);\n#endif\n#endif\n#ifdef EMISSION_TEXTURE\n vec3 normalMC = normalize(czm_computeNormal(vPositionMC.xyz));\n float isNotTopFace = 1.0 - step(0.95, normalMC.z);\n float dayTime = 1.0 - czm_RGBToHSL(uAmbientLightColor.rgb).z;\n vec3 emissionTexColor;\n #ifdef TexCoord\n emissionTexColor = czm_getEmissiveTextureColor(wValue, vTexCoord.xy) * dayTime;\n #else\n emissionTexColor = czm_getEmissiveTextureColor(wValue) * dayTime;\n #endif\n gl_FragColor.rgb += uEmissionColor.rgb * emissionTexColor * isNotTopFace;\n#else\n gl_FragColor.rgb *= uEmissionColor.rgb;\n#endif\n#ifdef QUAD_OUTLINE\n float attenuation = 1.0;\n if (vDistanceFromEye > 0.0 && vDistanceFromEye <= 500.0) {\n attenuation = clamp(1.0 - smoothstep(0.0, 500.0, vDistanceFromEye), 0.6, 1.0); }\n else if (vDistanceFromEye > 500.0 && vDistanceFromEye <= 20000.0) {\n attenuation = clamp(1.0 - smoothstep(500.0, 10000.0, vDistanceFromEye), 0.0, 0.6); }\n else {\n attenuation = 0.0;\n }\n gl_FragColor.a *= attenuation;\n#endif\ngl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x2fd24d=(_0x4396e2=!0,function(e,t){var i=_0x4396e2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4396e2=!1,i}),_0x1308bd=_0x2fd24d(void 0,(function(){return _0x1308bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x1308bd).search("(((.+)+)+)+$")})),_0x4396e2;_0x1308bd();var _0xd76675="attribute vec3 aPosition;\n\n#ifdef HAS_NORMAL\nattribute vec3 aNormal;\n#endif\n\nattribute vec4 aTexCoord0;\n\nattribute vec4 aTexCoord1;\n\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nuniform vec4 uSelColor;\nuniform vec4 uDiffuseColor;\n\nfloat computerOnePixelLength()\n{\n\tvec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n\tviewPos.xyz *= 0.9;\n\tvec4 winPos = czm_projection * viewPos;\n\tfloat dwidth = czm_metersPerPixel(viewPos);\n\t#ifdef EYE_DISTANCE_SCALING\n\t dwidth = 1.0;\n\t#endif\n\twinPos.x = winPos.x - 2.0 * dwidth;\n\tvec4 newViewPos = czm_inverseProjection * winPos;\n\treturn length(viewPos - newViewPos);\n}\n\nvec4 computePos(vec3 v3Normal)\n{\n vec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n\tviewPos.xyz = viewPos.xyz + v3Normal * computerOnePixelLength();\n\tviewPos.xyz = viewPos.xyz * 0.9;\n\tclip_vertex = viewPos;\n\tvec4 pos = czm_projection * viewPos;\n\treturn pos;\n}\n\nvoid main()\n{\n vTexCoord.xy = aTexCoord0.xy;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor * uDiffuseColor;\n#ifdef ICON\n gl_Position = computePos(aTexCoord1.xyz);\n#else\n vTexCoord.zw = aTexCoord1.xy;\n #ifdef HAS_NORMAL\n \tgl_Position = computePos(aNormal);\n #else\n gl_Position = computePos(aTexCoord1.xyz);\n #endif\n#endif\n}",_0x420680=(_0x23d424=!0,function(e,t){var i=_0x23d424?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x23d424=!1,i}),_0x5a8dc4=_0x420680(void 0,(function(){return _0x5a8dc4.toString().search("(((.+)+)+)+$").toString().constructor(_0x5a8dc4).search("(((.+)+)+)+$")})),_0x23d424;_0x5a8dc4();var _0x33fbe7="attribute vec3 aPosition;\n\nattribute vec3 aNormal;\n\nattribute vec4 aTexCoord0;\n\nattribute vec4 aTexCoord1;\nattribute vec4 uv0;\n\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nuniform vec4 uSelColor;\nuniform vec4 uDiffuseColor;\n\nfloat computerOnePixelLength()\n{\n\tvec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n\tvec4 winPos = czm_projection * viewPos;\n\tfloat dwidth = czm_metersPerPixel(viewPos);\n\twinPos.x = winPos.x - 2.0 * dwidth;\n\tvec4 newViewPos = czm_inverseProjection * winPos;\n\treturn length(viewPos - newViewPos);\n}\nmat3 RotateZ(in float angle)\n{\n float sina = sin(angle);\n float cosa = cos(angle);\n mat3 rotMatrix = mat3(cosa, sina, 0, -sina, cosa, 0, 0, 0, 1);\n return rotMatrix;\n}\n\nvec4 computePos(vec3 v3Normal)\n{\n vec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n vec4 origViewPos = czm_view * vec4(0.0, 0.0, 0.0, 1.0);\n vec4 cameraViewPos = vec4(0.0, 0.0, 0.0, 1.0);\n vec4 fixedAxis = vec4(1.0);\n vec3 xAxis = vec3(1.0);\n vec3 yAxis = vec3(1.0);\n vec3 zAxis = vec3(1.0);\n vec4 cameraViewVector = vec4(1.0);\n if (czm_sceneMode != czm_sceneMode3D)\n {\n fixedAxis = czm_view * vec4(1.0, 0.0, 0.0, 1.0);\n fixedAxis = fixedAxis - origViewPos;\n zAxis = normalize(fixedAxis.xyz);\n cameraViewVector = viewPos - cameraViewPos;\n yAxis = normalize(cameraViewVector.xyz);\n xAxis = normalize(cross(yAxis, zAxis));\n yAxis = cross(zAxis, xAxis);\n }\n else\n {\n fixedAxis = viewPos - origViewPos;\n yAxis = normalize(fixedAxis.xyz);\n cameraViewVector = cameraViewPos - viewPos;\n zAxis = normalize(cameraViewVector.xyz);\n xAxis = normalize(cross(yAxis, zAxis));\n zAxis = cross(xAxis, yAxis);\n }\n mat3 matrix = mat3(xAxis, yAxis, zAxis) * RotateZ(aTexCoord0.z);\n vec3 offset = czm_sceneMode != czm_sceneMode3D ? v3Normal.xzy : v3Normal;\n offset = matrix * offset;\n\tviewPos.xyz = viewPos.xyz + offset;\n\tclip_vertex = viewPos;\n\tvec4 pos = czm_projection * viewPos;\n\treturn pos;\n}\n\nvoid main()\n{\n vTexCoord.xy = aTexCoord0.xy;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor * uDiffuseColor;\n#ifdef ICON\n gl_Position = computePos(aTexCoord1.xyz);\n#else\n vTexCoord.zw = aTexCoord1.xy;\n gl_Position = computePos(aNormal);\n#endif\n}",_0x16b43e=(_0x5b0799=!0,function(e,t){var i=_0x5b0799?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5b0799=!1,i}),_0x10de27=_0x16b43e(void 0,(function(){return _0x10de27.toString().search("(((.+)+)+)+$").toString().constructor(_0x10de27).search("(((.+)+)+)+$")})),_0x5b0799;_0x10de27();var _0x4e338f="attribute vec3 aPosition;\n\nattribute vec3 aNormal;\n\nattribute vec4 aTexCoord0;\n\nattribute vec4 aTexCoord1;\n\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nuniform vec4 uSelColor;\nuniform vec4 uDiffuseColor;\n\nfloat computerOnePixelLength()\n{\n\tvec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n\tvec4 winPos = czm_projection * viewPos;\n\tfloat dwidth = czm_metersPerPixel(viewPos);\n\twinPos.x = winPos.x - 2.0 * dwidth;\n\tvec4 newViewPos = czm_inverseProjection * winPos;\n\treturn length(viewPos - newViewPos);\n}\n\nmat3 rotateZ(in float angle)\n{\n float sina = sin(angle);\n float cosa = cos(angle);\n mat3 rotMatrix = mat3(cosa, sina, 0.0, -sina, cosa, 0.0, 0.0, 0.0, 1.0);\n return rotMatrix;\n}\nvec4 computePos(vec3 v3Normal)\n{\n vec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n vec4 origViewPos = czm_view * vec4(0.0, 0.0, 0.0, 1.0);\n vec4 fixedAxis = viewPos - origViewPos;\n vec3 zAxis = normalize(fixedAxis.xyz);\n vec4 upView = vec4(0.0, 1.0, 0.0, 1.0);\n upView = czm_view * upView;\n vec3 upViewVector = normalize(upView.xyz - origViewPos.xyz);\n vec3 xAxis = normalize(cross(upViewVector, zAxis));\n vec3 yAxis = cross(zAxis, xAxis);\n yAxis = normalize(yAxis);\n mat3 matrix = mat3(xAxis,yAxis,zAxis);\n vec3 offset = matrix * rotateZ(-czm_piOverFour * 3.0 + aTexCoord0.z) * v3Normal;\n\tviewPos.xyz = viewPos.xyz + offset * computerOnePixelLength();\n\tclip_vertex = viewPos;\n\tvec4 pos = czm_projection * viewPos;\n\treturn pos;\n}\n\nvoid main()\n{\n vTexCoord.xy = aTexCoord0.xy;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor * uDiffuseColor;\n#ifdef ICON\n gl_Position = computePos(aTexCoord1.xyz);\n#else\n vTexCoord.zw = aTexCoord1.xy;\n gl_Position = computePos(aNormal);\n#endif\n}",_0x178035=(_0x1bbe89=!0,function(e,t){var i=_0x1bbe89?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1bbe89=!1,i}),_0x5a1b8a=_0x178035(void 0,(function(){return _0x5a1b8a.toString().search("(((.+)+)+)+$").toString().constructor(_0x5a1b8a).search("(((.+)+)+)+$")})),_0x1bbe89;_0x5a1b8a();var _0xc95c54="\nattribute vec3 aPosition;\n#ifndef ICON\nattribute vec3 aNormal;\n#endif\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\nattribute vec4 aTexCoord2;\n\n#ifdef VertexColor\n #ifdef WEBGPU\n \tattribute uvec4 aColor;\n #else\n \tattribute vec4 aColor;\n #endif\n#endif\n\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nuniform vec4 uSelColor;\nuniform vec4 uDiffuseColor;\n\nfloat computerOnePixelLength()\n{\n\tvec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n viewPos.xyz *= 0.9;\n\tvec4 winPos = czm_projection * viewPos;\n\tfloat dwidth = czm_metersPerPixel(viewPos);\n\twinPos.x = winPos.x - 2.0 * dwidth;\n\tvec4 newViewPos = czm_inverseProjection * winPos;\n\treturn length(viewPos - newViewPos);\n}\n\nmat3 RotateX(in float angle)\n{\t\n\tfloat sina = sin(angle);\n\tfloat cosa = cos(angle);\n\tmat3 rotMatrix = mat3(1, 0, 0, 0, cosa, sina, 0, -sina, cosa);\n\treturn rotMatrix;\n}\n\nmat3 RotateY(in float angle)\n{\n\tfloat sina = sin(angle);\n\tfloat cosa = cos(angle);\n\tmat3 rotMatrix = mat3(cosa, 0, -sina, 0, 1, 0, sina, 0, cosa);\n\treturn rotMatrix;\n}\n\nmat3 RotateZ(in float angle)\n{\n float sina = sin(angle);\n float cosa = cos(angle);\n mat3 rotMatrix = mat3(cosa, sina, 0, -sina, cosa, 0, 0, 0, 1);\n return rotMatrix;\n}\n\nmat3 RotateXYZ(in float rx, in float ry, in float rz)\n{\n\tmat3 rotXMatrix = RotateX(rx);\n\tmat3 rotYMatrix = RotateY(ry);\n\tmat3 rotZMatrix = RotateZ(rz);\n\tmat3 rotMatrix = rotXMatrix * rotYMatrix * rotZMatrix;\n\treturn rotMatrix;\n}\n\n\nmat3 getSphereMatrix(in mat4 worldviewMat, in vec3 centerPos)\n{\n\tvec4 viewPos = worldviewMat * vec4(centerPos.xyz, 1.0);\n vec4 origViewPos = czm_view * vec4(0.0, 0.0, 0.0, 1.0);\n vec4 upView = vec4(0.0, 0.0, 1.0, 1.0);\n upView = czm_view * upView;\n vec3 upViewVector = normalize(upView.xyz - origViewPos.xyz);\n\tvec4 fixedAxis = viewPos - origViewPos;\n\tvec3 yAxis = normalize(fixedAxis.xyz);\n\tvec3 xAxis = normalize(cross(upViewVector, yAxis));\n\tvec3 zAxis = cross(yAxis, xAxis);\n\tyAxis = normalize(yAxis);\n\treturn mat3(xAxis,yAxis,zAxis);\n}\n\nvec4 computePos(vec3 v3Normal)\n{\n mat3 matrix = getSphereMatrix(czm_modelView, aPosition);\n mat3 rotMatrix = matrix * RotateXYZ(aTexCoord2.x, aTexCoord2.y, aTexCoord2.z);\n vec3 offset = v3Normal;\n\toffset = rotMatrix * offset * computerOnePixelLength();\n vec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n\tviewPos.xyz += offset.xyz;\n\tviewPos.xyz *= 0.9;\n\tvec4 pos = czm_projection * viewPos;\n\treturn pos;\n}\n\nvoid main()\n{\n vTexCoord.xy = aTexCoord0.xy;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor * uDiffuseColor;\n#ifdef ICON\n gl_Position = computePos(aTexCoord1.xzy);\n#else\n vTexCoord.zw = aTexCoord1.xy;\n gl_Position = computePos(aNormal);\n#endif\n}",_0x2608ba=(_0x565c3b=!0,function(e,t){var i=_0x565c3b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x565c3b=!1,i}),_0x1399c4=_0x2608ba(void 0,(function(){return _0x1399c4.toString().search("(((.+)+)+)+$").toString().constructor(_0x1399c4).search("(((.+)+)+)+$")})),_0x565c3b;_0x1399c4();var _0x5a5938="uniform sampler2D uTexture;\nuniform sampler2D uSecTexture;\nuniform vec4 uAmbientColor;\n\nvarying vec4 vColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nvarying vec4 vSecondColor;\n#ifdef APPLY_SPLIT\nuniform float uSplitDirection;\nuniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nvoid main()\n{\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n\tif(vColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n\tvec4 texColor = vec4(vColor.rgb, min(texture2D(uTexture, vTexCoord.xy).a, vColor.a));\n\tvec4 haloTexColor = vec4(uAmbientColor.rgb, min(texture2D(uSecTexture, vTexCoord.zw).a, uAmbientColor.a));\n\tif(texColor.a + haloTexColor.a < 0.2)\n\t{\n\t\tdiscard;\n\t}\n\tvec3 v3Color = mix(haloTexColor.rgb, texColor.rgb, texColor.a + 0.2);\n\tgl_FragColor = vec4(v3Color.rgb, min(1.0, texColor.a + haloTexColor.a));\n\tif(gl_FragColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n\tgl_FragColor *= czm_clip(clip_vertex, 1.0);\n\tgl_FragColor = czm_gammaCorrect(gl_FragColor);\n#endif\n}",_0x7f0f8a=(_0x2c601d=!0,function(e,t){var i=_0x2c601d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2c601d=!1,i}),_0x2ea50b=_0x7f0f8a(void 0,(function(){return _0x2ea50b.toString().search("(((.+)+)+)+$").toString().constructor(_0x2ea50b).search("(((.+)+)+)+$")})),_0x2c601d;_0x2ea50b();var _0x45f285="uniform sampler2D uTexture;\nvarying vec4 vColor;\nvarying vec4 vTexCoord;\nvarying vec4 clip_vertex;\nvarying vec4 vSecondColor;\n#ifdef APPLY_SPLIT\n uniform float uSplitDirection;\n uniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\n\nvoid main()\n{\n\tif(vColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n\tvec4 texColor = texture2D(uTexture, vTexCoord.xy);\n#ifdef RGBTOBGR\n texColor = vec4(texColor.b, texColor.g, texColor.r, texColor.a);\n#endif\n\tgl_FragColor = vColor * texColor;\n\tif(gl_FragColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIP\n\tgl_FragColor *= czm_clip(clip_vertex, 1.0);\n#endif\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0xfa30c4=(_0x4c40bb=!0,function(e,t){var i=_0x4c40bb?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4c40bb=!1,i}),_0x3c4321=_0xfa30c4(void 0,(function(){return _0x3c4321.toString().search("(((.+)+)+)+$").toString().constructor(_0x3c4321).search("(((.+)+)+)+$")})),_0x4c40bb;_0x3c4321();var _0x36fa1b="attribute vec4 aPosition;\n\nattribute vec4 aTexCoord0;\n\nattribute vec4 aTexCoord1;\n\nattribute vec4 aTexCoord2;\n\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nuniform float uLineWidth;\nuniform float uIsPicking;\nuniform vec4 uPickPosition;\nuniform mat4 uMatrixInvert;\nuniform vec4 uDiffuseColor;\nuniform vec4 uSelColor;\n#ifdef SELECTED\nvarying float fSelected;\n#endif\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying float vWindowZ;\n\nconst float SCREEN_VALUE = 1.0 / (2.0 * 1236.077);\n\nfloat ComputerLineWidth()\n{\n\tvec4 worldPos = czm_model * aPosition;\n\treturn uLineWidth * length(czm_viewerPositionWC - worldPos.xyz) * SCREEN_VALUE;\n}\n\nvoid main()\n{\n float shadowVolumeWidth = ComputerLineWidth();\n vec4 vertexPos = aPosition;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n if(uIsPicking > 0.0)\n {\n\t\tshadowVolumeWidth = shadowVolumeWidth * 3.0;\n\t\tvertexPos.xyz = vertexPos.xyz + aTexCoord2.xyz * shadowVolumeWidth + normalize(aTexCoord1.xyz) * uPickPosition.z;\n }\n else\n {\n\t\tvertexPos.xyz = vertexPos.xyz + aTexCoord2.xyz * shadowVolumeWidth + aTexCoord1.xyz;\n }\n vec4 v_Position = czm_modelViewProjection * vertexPos;\n vColor = vertexColor * uDiffuseColor;\n#ifdef SELECTED\n vColor = uSelColor;\n fSelected = aTexCoord0.x;\n#endif\n vWindowZ = (0.5 * (v_Position.z / v_Position.w) + 0.5) * v_Position.w;\n v_Position.z = min(v_Position.z, v_Position.w);\n gl_Position = v_Position;\n}",_0xfbdfd4=(_0x1acdbd=!0,function(e,t){var i=_0x1acdbd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1acdbd=!1,i}),_0x3b4cd0=_0xfbdfd4(void 0,(function(){return _0x3b4cd0.toString().search("(((.+)+)+)+$").toString().constructor(_0x3b4cd0).search("(((.+)+)+)+$")})),_0x1acdbd;_0x3b4cd0();var _0x2cebc1="attribute vec4 aPosition;\nattribute vec3 aNormal;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying float vWindowZ;\nvarying float vPositionMC;\n\nuniform vec2 uMinMaxTerrainHeight;\nuniform vec3 uSouthWest;\nuniform vec3 uNorthDir;\nuniform vec3 uEastDir;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\nvarying vec2 v_inversePlaneExtents;\nuniform vec4 uSelColor;\nuniform vec4 uFillForeColor;\nvarying float fSelected;\n\nuniform float uIsPicking;\nuniform float uPickPositionHeight;\nuniform mat4 uMatrixInvert;\nuniform vec4 uPickPosition;\nuniform vec4 uDiffuseColor;\n\n#ifdef COMPRESS_VERTEX\n uniform vec4 decode_position_min;\n uniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_TEXCOORD\n uniform float decode_texCoord0_normConstant;\n uniform float decode_texCoord1_normConstant;\n uniform vec4 decode_texCoord0_min;\n uniform vec4 decode_texCoord1_min;\n#endif\n\nvoid ComputeBounds()\n{\n vec3 southWestCorner = (czm_modelView * vec4(uSouthWest, 1.0)).xyz;\n vec3 northWestCorner = czm_normal * uNorthDir + southWestCorner;\n vec3 southEastCorner = czm_normal * uEastDir + southWestCorner;\n vec3 eastWard = southEastCorner - southWestCorner;\n float eastExtent = length(eastWard);\n eastWard /= eastExtent;\n vec3 northWard = northWestCorner - southWestCorner;\n float northExtent = length(northWard);\n northWard /= northExtent;\n v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\n v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\n v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n}\nvoid main()\n{\n#ifdef HAS_TEXTURE\n ComputeBounds();\n#endif\n vec4 uncompress = vec4(1.0);\n vec4 realPosition = aPosition;\n#ifdef COMPRESS_VERTEX\n uncompress = decode_position_min + aPosition * decode_position_normConstant;\n realPosition = uncompress;\n#endif\n vec3 vertexPos = realPosition.xyz;\n vec3 zDir = aTexCoord1.xyz;\n bool hasBaseHeight = false;\n if(length(realPosition) > 0.1){\n hasBaseHeight = true;\n }\n float topOrBottom = dot(zDir, vec3(0.0, 0.0, 1.0)) > 0.0 ? 1.0 : -1.0;\n vec3 upDir = zDir * topOrBottom;\n float fExtendHeight = 0.0;\n if(uIsPicking > 0.0){\n // 顶点ä¿�å˜äº†é«˜åº¦ï¼Œåœ¨æ‹¾å�–时在原始的顶点高度附近进行上下拉伸\n if(hasBaseHeight){\n fExtendHeight = czm_branchFreeTernary(topOrBottom < 0.0, -50.0, 100.0);\n }\n else{\n fExtendHeight = czm_branchFreeTernary(topOrBottom < 0.0, uPickPositionHeight - 2.0, uPickPositionHeight + 10.0);\n }\n }\n else{\n fExtendHeight = czm_branchFreeTernary(topOrBottom < 0.0, uMinMaxTerrainHeight.x, uMinMaxTerrainHeight.y);\n }\n vertexPos.xyz = realPosition.xyz + upDir * fExtendHeight;\n vec4 v_Position = czm_modelViewProjection * vec4(vertexPos, 1.0);\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\nfSelected = 0.0;\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, vec4(1.0), vertexColor, fSelected);\n#endif\n#ifdef SELECTED\n vColor = uSelColor;\n#else\n vColor = vertexColor * uDiffuseColor * uFillForeColor;\n#endif\n vWindowZ = (0.5 * (v_Position.z / v_Position.w) + 0.5) * v_Position.w;\n v_Position.z = min(v_Position.z, v_Position.w);\n gl_Position = v_Position;\n}",_0x4d6321=(_0x2473dd=!0,function(e,t){var i=_0x2473dd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2473dd=!1,i}),_0x5231d1=_0x4d6321(void 0,(function(){return _0x5231d1.toString().search("(((.+)+)+)+$").toString().constructor(_0x5231d1).search("(((.+)+)+)+$")})),_0x2473dd;_0x5231d1();var _0x3fb63c="attribute vec3 aPosition;\nattribute vec3 aNormal;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying float vWindowZ;\n\nuniform float uIsPicking;\nuniform mat4 uMatrixInvert;\nuniform vec4 uPickPosition;\nuniform vec4 uDiffuseColor;\nuniform vec4 uSelColor;\n#ifdef SELECTED\nvarying float fSelected;\n#endif\n\nvoid main()\n{\n vec3 vertexPos = aPosition;\n vertexPos.xyz = vertexPos.xyz + aTexCoord1.xyz;\n vec4 v_Position = czm_modelViewProjection * vec4(vertexPos, 1.0);\n if(uIsPicking > 0.0)\n {\n#ifdef EXTEND_OBJECT\n\t\tvec4 modelBottomPos = uMatrixInvert * czm_model * vec4(aPosition, 1.0);\n\t\tvec4 modelTopPos = uMatrixInvert * czm_model * vec4(vertexPos, 1.0);\n\t\tif(uPickPosition.z < modelBottomPos.z || uPickPosition.z > modelTopPos.z)\n\t\t{\n\t\t\tvColor.a = 0.0;\n\t\t}\n#else\n\t\tvertexPos.xyz = aPosition.xyz + normalize(aTexCoord1.xyz) * (uPickPosition.z + 10.0);\n\t\tvec4 v_Position = czm_modelViewProjection * vec4(vertexPos, 1.0);\n#endif\n }\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n#ifdef SELECTED\n vColor = uSelColor;\n fSelected = aTexCoord0.x;\n#else\n vColor = vertexColor * uDiffuseColor;\n#endif\n vWindowZ = (0.5 * (v_Position.z / v_Position.w) + 0.5) * v_Position.w;\n v_Position.z = min(v_Position.z, v_Position.w);\n gl_Position = v_Position;\n}",_0x5bc23b=(_0x4151ed=!0,function(e,t){var i=_0x4151ed?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4151ed=!1,i}),_0xd43409=_0x5bc23b(void 0,(function(){return _0xd43409.toString().search("(((.+)+)+)+$").toString().constructor(_0xd43409).search("(((.+)+)+)+$")})),_0x4151ed;_0xd43409();var _0x271d9d="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nvarying vec4 vColor;\nvarying float vWindowZ;\nvarying float fSelected;\nvarying vec4 vSecondColor;\n\n#ifdef HAS_TEXTURE\nuniform sampler2D uTexture;\nuniform vec2 uLevelScale;\nuniform vec2 uRepeatTimes;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\nvarying vec2 v_inversePlaneExtents;\n#endif\n\n#ifdef APPLY_SPLIT\nuniform float uSplitDirection;\nuniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\n#ifdef HAS_TEXTURE\nvec4 getTextureColor()\n{\n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n vec2 uv;\n uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\n uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n vec2 st;\n st.x = czm_lineDistance(vec2(0.0), vec2(0.0, 1.0), uv);\n st.y = czm_lineDistance(vec2(0.0), vec2(1.0, 0.0), uv);\n st.xy *= uLevelScale * uRepeatTimes;\n vec4 texColor = texture2D(uTexture, st);\n if(texColor.a < 0.01) {\n texColor.a = 1.0;\n }\n return texColor;\n}\n#endif\n\nvoid main()\n{\n#ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n#endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n#ifdef SELECTED\n if(fSelected < 0.5)\n {\n discard;\n }\n#endif\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = min(vWindowZ * gl_FragCoord.w, 1.0);\n#endif\n#ifdef WEBGL2\n gl_FragDepthEXT = min(vWindowZ * gl_FragCoord.w, 1.0);\n#endif\n vec4 texColor = vec4(1.0);\n#ifdef HAS_TEXTURE\n texColor = getTextureColor();\n#endif\n gl_FragColor = vColor * texColor;\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x38e4b4=(_0x4218ff=!0,function(e,t){var i=_0x4218ff?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4218ff=!1,i}),_0x51e285=_0x38e4b4(void 0,(function(){return _0x51e285.toString().search("(((.+)+)+)+$").toString().constructor(_0x51e285).search("(((.+)+)+)+$")})),_0x4218ff;_0x51e285();var _0x1948de="attribute vec4 aPosition;\n\nattribute vec3 aNormal;\n\nattribute vec4 aTexCoord0;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\nuniform sampler2D batchTexture; \nuniform vec4 batchTextureStep;\nvec2 computeSt(float batchId)\n{\n float stepX = batchTextureStep.x;\n float centerX = batchTextureStep.y;\n float numberOfAttributes = float(5);\n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);\n}\nvec4 czm_batchTable_pickColor(float batchId)\n{\n vec2 st = computeSt(batchId);\n st.x += batchTextureStep.x * float(2);\n vec4 textureValue = texture2D(batchTexture, st);\n vec4 value = textureValue;\n value /= 255.0;\n return value;\n}\nvec4 czm_batchTable_operation(float batchId)\n{\n vec2 st = computeSt(batchId);\n st.x += batchTextureStep.x * float(1);\n vec4 textureValue = texture2D(batchTexture, st);\n vec4 value = textureValue;\n return value;\n}\nvoid s3mBatchOperation(vec4 operationType, inout vec4 vertexColor)\n{\n operationType.x += 0.001;\n float right_2 = operationType.x * 0.5;\n float right_4 = right_2 * 0.5;\n float right_8 = right_4 * 0.5;\n float right_16 = right_8 * 0.5;\n float isHide = fract(floor(right_4)* 0.5);\n if(isHide > 0.1)\n {\n vertexColor.a = 0.0;\n }\n}\n#endif\n\n#ifdef UNIFORM_BUFFER\n uniform WaterParameter{\n vec4 bumpSpeedAndScaleAndFresnelPower;\n vec4 minmaxFresnelAndNoiseScaleAndBrightness;\n vec4 tintColour;\n vec4 waterColour;\n } u_WaterParam;\n#else\n uniform float uScale;\n uniform vec2 uBumpSpeed;\n struct WaterParameter {\n vec4 bumpSpeedAndScaleAndFresnelPower;\n };\n WaterParameter u_WaterParam;\n#endif\nuniform float uTimeVal;\nuniform mat4 uGeoMatrix;\nvarying vec2 vNoiseCoord;\nvarying vec3 vProjectionCoord;\nvarying vec3 vEyeDir;\nvarying vec3 vNormal;\nvarying vec4 vColor;\nvarying float fVertexColor;\nvarying vec4 vSecondColor;\nvarying vec4 clip_vertex;\nvarying vec4 vPositionMC;\nvarying vec2 fSelected;\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n#endif\n\nvoid InitUniformStructParameter(){\n#ifndef UNIFORM_BUFFER\n u_WaterParam.bumpSpeedAndScaleAndFresnelPower.z = uScale;\n u_WaterParam.bumpSpeedAndScaleAndFresnelPower.xy = uBumpSpeed;\n#endif\n}\nvoid main()\n{\n InitUniformStructParameter();\n#ifdef EXCAVATION\n vExcavationVertexPos = uGeoMatrix * vec4(aPosition.xyz, 1.0);\n#endif\n\tvec4 oPos = czm_modelViewProjection * aPosition;\n\tvPositionMC = uGeoMatrix * aPosition;\n\tmat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0,\n\t\t\t0.0, 0.5, 0.0, 0.0,\n\t\t\t0.0, 0.0, 0.5, 0.0,\n\t\t\t0.5, 0.5, 0.5, 1.0);\n\tvec4 proj = scalemat * oPos;\n\tvProjectionCoord = proj.xyw;\n\tfloat scale = u_WaterParam.bumpSpeedAndScaleAndFresnelPower.z;\n\tvec2 bumpSpeed = u_WaterParam.bumpSpeedAndScaleAndFresnelPower.xy;\n\tvNoiseCoord.xy = aTexCoord0.xy * scale + bumpSpeed * uTimeVal;\n\tvec4 cameraPos = czm_inverseModel * vec4(czm_cameraPositionWC, 1.0);\n\tvEyeDir = aPosition.xyz - cameraPos.xyz;\n\tvNormal = aNormal.xyz;\n\tgl_Position = oPos;\n\tclip_vertex = czm_modelView * aPosition;\n\tvec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n s3mBatchOperation(operationType, vertexColor);\n#endif\n vColor = vertexColor;\n\tfVertexColor = vColor.a;\n}",_0x3209e1=(_0x371f02=!0,function(e,t){var i=_0x371f02?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x371f02=!1,i}),_0x4f8c6a=_0x3209e1(void 0,(function(){return _0x4f8c6a.toString().search("(((.+)+)+)+$").toString().constructor(_0x4f8c6a).search("(((.+)+)+)+$")})),_0x371f02;_0x4f8c6a();var _0xab5c07="uniform sampler2D uReflectMap;\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D uNoiseMap;\n#ifdef UNIFORM_BUFFER\n uniform WaterParameter{\n vec4 bumpSpeedAndScaleAndFresnelPower;\n vec4 minmaxFresnelAndNoiseScaleAndBrightness;\n vec4 tintColour;\n vec4 waterColour;\n } u_WaterParam;\n#else\n uniform vec4 uTintColour;\n uniform vec4 uWaterColour;\n uniform float uFresnelPower;\n uniform float uMinFresnel;\n uniform float uMaxFresnel;\n uniform float uNoiseScale;\n uniform float uWaterBrightness;\n struct WaterParameter {\n vec4 bumpSpeedAndScaleAndFresnelPower;\n vec4 minmaxFresnelAndNoiseScaleAndBrightness;\n vec4 tintColour;\n vec4 waterColour;\n };\n WaterParameter u_WaterParam;\n#endif\nvarying vec2 vNoiseCoord;\nvarying vec3 vProjectionCoord;\nvarying vec3 vEyeDir;\nvarying vec3 vNormal;\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying vec4 vPositionMC;\nuniform vec2 uPolygonOffset;\n\nvec4 AdjSaturation(in vec4 inputColor, in float saturation)\n{\n\tvec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721);\n\tvec3 intensity = vec3(dot(inputColor.rgb, lumCoeff));\n\tvec3 tempColor = mix(intensity, inputColor.rgb, saturation);\n\treturn vec4(tempColor, 1.0);\n}\n\n#ifdef APPLY_SPLIT\nuniform float uSplitDirection;\nuniform float uSplitPosition;\n#endif\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\nvoid InitUniformStructParameter(){\n#ifndef UNIFORM_BUFFER\n u_WaterParam.tintColour = uTintColour;\n u_WaterParam.waterColour = uWaterColour;\n u_WaterParam.bumpSpeedAndScaleAndFresnelPower.w = uFresnelPower;\n u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.x = uMinFresnel;\n u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.y = uMaxFresnel;\n u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.z = uNoiseScale;\n u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.w = uWaterBrightness;\n#endif\n}\nvoid main()\n{\n InitUniformStructParameter();\n if(vColor.a < 0.1)\n {\n discard;\n }\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n#ifdef LOG_DEPTH\n czm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n float fresnelPower = u_WaterParam.bumpSpeedAndScaleAndFresnelPower.w;\n float noiseScale = u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.z;\n float waterBrightness = u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.w;\n float minFresnel = u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.x;\n float maxFresnel = u_WaterParam.minmaxFresnelAndNoiseScaleAndBrightness.y;\n vec4 tintColour = u_WaterParam.tintColour;\n vec4 waterColour = u_WaterParam.waterColour;\n gl_FragColor = vColor;\n vec2 final = vProjectionCoord.xy / vProjectionCoord.z;\n vec3 noiseNormal = (texture2D(uNoiseMap, (vNoiseCoord.xy / 5.0)).rgb - 0.5).rbg * noiseScale;\n final += noiseNormal.xz;\n float realMinFresnel, realMaxFresnel;\n if(minFresnel < maxFresnel)\n {\n realMinFresnel = minFresnel;\n realMaxFresnel = maxFresnel;\n }\n else\n {\n realMinFresnel = maxFresnel;\n realMaxFresnel = minFresnel;\n }\n float fresnelBias = realMinFresnel;\n float fresnelScale = (realMaxFresnel - realMinFresnel) / 1.0;\n float fresnel = fresnelBias + fresnelScale * pow(1.0 + dot(normalize(vEyeDir), vNormal), fresnelPower);\n fresnel = clamp(fresnel, 0.05, 0.95);\n vec4 reflectionColour = texture2D(uReflectMap, final);\n vec4 refractionColour = reflectionColour + tintColour;\n vec4 resultColour = mix(waterColour, reflectionColour, fresnel);\n resultColour = AdjSaturation(resultColour, 1.0);\n resultColour = resultColour * waterBrightness;\n resultColour.a = waterColour.a;\n //resultColour *= fillForeColor;\n gl_FragColor = gl_FragColor * resultColour;\n if(gl_FragColor.a < 0.1)\n {\n discard;\n }\n #ifdef APPLY_SPLIT\n if (uSplitDirection > 1.5)\n {\n if(gl_FragCoord.x > uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection > 0.5)\n {\n if(gl_FragCoord.x < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -1.5)\n {\n if(gl_FragCoord.y < uSplitPosition)\n {\n discard;\n }\n }\n else if(uSplitDirection < -0.5)\n {\n if(gl_FragCoord.y > uSplitPosition)\n {\n discard;\n }\n }\n #endif\n#ifdef APPLY_SWIPE \n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n //gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x481bac=(_0x2905f7=!0,function(e,t){var i=_0x2905f7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2905f7=!1,i}),_0x553bf1=_0x481bac(void 0,(function(){return _0x553bf1.toString().search("(((.+)+)+)+$").toString().constructor(_0x553bf1).search("(((.+)+)+)+$")})),_0x2905f7;_0x553bf1();var _0xcb6db0="\nattribute vec4 aPosition;\nattribute vec3 aNormal;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\nvarying vec4 vSecondColor;\nvarying vec2 oUV;\nvarying vec4 vColor;\nvarying vec4 vPositionMC;\nuniform mat4 uTexMatrix;\nvoid main()\n{\n float fExtendHeight = aTexCoord1.x;\n\tvec3 Postion = aPosition.xyz + (aNormal.xyz * fExtendHeight).xyz;\n\tfloat u = aTexCoord0.x;\n\tfloat v = aTexCoord0.y;\n if ( aTexCoord1.y > 0.2 && aTexCoord1.y < 0.8)\n {\n if (uTexMatrix[0].x > 0.0)\n {\n float fRealSize = uTexMatrix[1].y;\n v = fExtendHeight / fRealSize;\n }\n else\n {\n float fRepeatNum = uTexMatrix[1].y;\n v = fRepeatNum;\n }\n }\n oUV = vec2(u, v);\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor;\n\tgl_Position = czm_modelViewProjection * vec4(Postion, 1.0);\n\tvPositionMC = vec4(Postion, 0.0);\n}",_0x53c6ec=(_0x2deac6=!0,function(e,t){var i=_0x2deac6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2deac6=!1,i}),_0xc772c4=_0x53c6ec(void 0,(function(){return _0xc772c4.toString().search("(((.+)+)+)+$").toString().constructor(_0xc772c4).search("(((.+)+)+)+$")})),_0x2deac6;_0xc772c4();var _0x332cde="\n#ifdef HAS_TEXTURE\nuniform sampler2D uTexture;\n#endif\nvarying vec2 oUV;\nvarying vec4 vColor;\nvarying vec4 vPositionMC;\nvoid main()\n{\n\tvec4 mixColor = vec4(1.0);\n#ifdef HAS_TEXTURE\n mixColor = mixColor * texture2D( uTexture, oUV );\n#endif\n gl_FragColor = mixColor * vColor;\n#ifdef HAS_LIGHT\n\tgl_FragColor *= czm_computeLightColorInFP(vPositionMC.xyz, vPositionMC.w, vec3(0.0));\n#endif\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x258c8d=(_0x2ca08c=!0,function(e,t){var i=_0x2ca08c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2ca08c=!1,i}),_0x4c1e71=_0x258c8d(void 0,(function(){return _0x4c1e71.toString().search("(((.+)+)+)+$").toString().constructor(_0x4c1e71).search("(((.+)+)+)+$")})),_0x2ca08c;_0x4c1e71();var _0x3f8a14="\nattribute vec4 aPosition;\nattribute vec4 aTexCoord0;\nattribute vec4 aColor;\nvarying vec2 vTexCoord;\nvarying vec4 selectionColor;\nvarying vec3 oriVertex;\nvarying vec3 vPositionToEyeEC;\nvoid main()\n{\n vTexCoord = aTexCoord0.xy;\n oriVertex = aPosition.xyz;\n\tvec4 vVertex = vec4(aPosition.xyz, 1.0);\n\tgl_Position = czm_modelViewProjection * vVertex;\n\tselectionColor = vec4(aColor.rgb, 1.0);\n\tvec4 positionEC = czm_modelView * vVertex;\n vPositionToEyeEC = -normalize(positionEC.xyz);\n}",_0x4a3345=(_0x27ad5d=!0,function(e,t){var i=_0x27ad5d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x27ad5d=!1,i}),_0x2577bc=_0x4a3345(void 0,(function(){return _0x2577bc.toString().search("(((.+)+)+)+$").toString().constructor(_0x2577bc).search("(((.+)+)+)+$")})),_0x27ad5d;_0x2577bc();var _0x313bb9="\nuniform float uRotationAngle;\nuniform int uType;\nuniform vec4 uForeColor;\nuniform vec4 uBackColor;\nuniform float uLineWidthX;\nuniform float uLineWidthY;\nuniform float uOffsetX;\nuniform float uOffsetY;\nuniform float uRepeatX;\nuniform float uRepeatY;\n\nvarying vec3 oriVertex;\nvarying vec2 vTexCoord;\nvarying vec4 selectionColor;\nvarying vec3 vPositionToEyeEC;\nconst float horizontal = 0.0;\nconst float PI = 3.1415926535897932384626;\nvec2 rotateTexCoord(vec2 oriTexCoord)\n{\n\tfloat rotationRadian = uRotationAngle * PI;\n\tvec2 n = vec2(cos(rotationRadian),-sin(rotationRadian));\n\tvec2 t = vec2(sin(rotationRadian),cos(rotationRadian));\n\tmat2 rotateZMatrix = mat2(n,t);\n\treturn rotateZMatrix * oriTexCoord;\n}\nvec4 czm_getGridMaterial(vec2 texCoord)\n{\n\tvec2 lineCount = vec2(uRepeatX, uRepeatY);\n\tvec2 lineOffset = vec2(uOffsetX, uOffsetY);\n\tvec2 lineThickness = vec2(uLineWidthX, uLineWidthY);\n\n float scaledWidth = fract(lineCount.s * texCoord.s - lineOffset.s);\n scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n\n float scaledHeight = fract(lineCount.t * texCoord.t - lineOffset.t);\n scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\n float value;\n\n const float fuzz = 1.2;\n vec2 thickness = (lineThickness * 1.0) - 1.0;\n\n vec2 dx = abs(dFdx(texCoord));\n vec2 dy = abs(dFdy(texCoord));\n vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\n\n\tif(uRepeatX < 0.5)\n\t{\n\t\tvalue = smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight);\n\t}\n\telse if(uRepeatY < 0.5)\n\t{\n\t\tvalue = smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth);\n\t}\n\telse\n\t{\n\t\tvalue = min(\n\t\t\tsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n\t\t\tsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n\t}\n\n\tif(value < 0.5)\n\t{\n\t\treturn uForeColor;\n\t}\n\treturn uBackColor;\n}\nvec4 czm_getStripMaterial(vec2 texCoord)\n{\n\tfloat repeat = uRepeatX;\n\tfloat offset = uOffsetX;\n\n float coord = mix(texCoord.s, texCoord.t, horizontal);\n float value = fract((coord - offset) * (repeat * 0.5));\n\n vec4 currentColor = mix(uForeColor, uBackColor, step(0.5, value)); \n\n return currentColor;\n}\nvec4 czm_getDotMaterial(vec2 texCoord)\n{\n\tfloat dotRepeat = uRepeatX;\n\n float b = smoothstep(0.3, 0.32, length(fract(dotRepeat * texCoord.st) - 0.5));\n vec4 color = mix(uForeColor, uBackColor, b);\n return color;\n}\nvec4 czm_getCheckBoardMaterial(vec2 texCoord)\n{\n\tvec2 checkBoardRepeat = vec2(uRepeatX, uRepeatY); \n\n float b = mod(floor(checkBoardRepeat.s * texCoord.s) + floor(checkBoardRepeat.t * texCoord.t), 2.0);\n vec4 currentColor = mix(uForeColor, uBackColor, b);\n return currentColor;\n}\n\nvoid main()\n{\n vec3 newNormal = vec3( czm_normal * czm_computeNormal( oriVertex ) );\n newNormal = normalize( newNormal );\n\tvec4 mixColor = czm_directionLight(newNormal,vPositionToEyeEC,oriVertex);\n\n\tvec2 rotateCoord = rotateTexCoord(vTexCoord);\n\n vec4 color = uForeColor;\n if(uType == 1)\n {\n \tcolor = czm_getStripMaterial(rotateCoord);\n }\n else if(uType == 2)\n {\n \tcolor = czm_getDotMaterial(rotateCoord);\n }\n else if(uType == 3)\n {\n \tcolor = czm_getCheckBoardMaterial(rotateCoord);\n }\n else if(uType == 4)\n {\n \tcolor = czm_getGridMaterial(rotateCoord);\n }\n gl_FragColor = color * mixColor * selectionColor;\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x290d09=(_0x2d6eb7=!0,function(e,t){var i=_0x2d6eb7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2d6eb7=!1,i}),_0x364290=_0x290d09(void 0,(function(){return _0x364290.toString().search("(((.+)+)+)+$").toString().constructor(_0x364290).search("(((.+)+)+)+$")})),_0x2d6eb7;_0x364290();var _0x4c7dfa="\nuniform float uEffectLineWidth;\n\nattribute vec4 aPosition;\nattribute vec3 aNormal;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\nuniform vec4 uSelColor;\nuniform mat4 uGeoMatrix;\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvarying float v_alpha;\nvarying vec4 vPositionMC;\n#ifdef EXCAVATION\n varying vec4 vExcavationVertexPos;\n#endif\nvoid clipLineSegmentToNearPlane(\n vec3 p0,\n vec3 p1,\n out vec4 positionWC,\n out bool clipped,\n out bool culledByNearPlane,\n out vec4 clippedPositionEC)\n {\n culledByNearPlane = false;\n clipped = false;\n vec3 p0ToP1 = p1 - p0;\n float magnitude = length(p0ToP1);\n vec3 direction = normalize(p0ToP1);\n float endPoint0Distance = czm_currentFrustum.x + p0.z;\n float denominator = -direction.z;\n if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n {\n culledByNearPlane = true;\n }\n else if (endPoint0Distance > 0.0)\n {\n float t = endPoint0Distance / denominator;\n if (t < 0.0 || t > magnitude)\n {\n culledByNearPlane = true;\n }\n else\n {\n p0 = p0 + t * direction;\n p0.z = min(p0.z, -czm_currentFrustum.x);\n clipped = true;\n }\n }\n clippedPositionEC = vec4(p0, 1.0);\n positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n }\n vec4 getPolylineWindowCoordinates(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n {\n #ifdef POLYLINE_DASH\n vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\n vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\n vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n vec2 lineDir;\n if (usePrevious) {\n lineDir = normalize(positionWindow.xy - previousWindow.xy);\n }\n else {\n lineDir = normalize(nextWindow.xy - positionWindow.xy);\n }\n angle = atan(lineDir.x, lineDir.y) - 1.570796327;\n angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n #endif\n vec4 clippedPrevWC, clippedPrevEC;\n bool prevSegmentClipped, prevSegmentCulled;\n clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\n vec4 clippedNextWC, clippedNextEC;\n bool nextSegmentClipped, nextSegmentCulled;\n clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\n bool segmentClipped, segmentCulled;\n vec4 clippedPositionWC, clippedPositionEC;\n clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\n if (segmentCulled)\n {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\n vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\n if (prevSegmentCulled)\n {\n directionToPrevWC = -directionToNextWC;\n }\n else if (nextSegmentCulled)\n {\n directionToNextWC = -directionToPrevWC;\n }\n vec2 thisSegmentForwardWC, otherSegmentForwardWC;\n if (usePrevious)\n {\n thisSegmentForwardWC = -directionToPrevWC;\n otherSegmentForwardWC = directionToNextWC;\n }\n else\n {\n thisSegmentForwardWC = directionToNextWC;\n otherSegmentForwardWC = -directionToPrevWC;\n }\n vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\n vec2 leftWC = thisSegmentLeftWC;\n float expandWidth = width * 0.5;\n if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n {\n vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\n vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\n float leftSumLength = length(leftSumWC);\n leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\n vec2 u = -thisSegmentForwardWC;\n vec2 v = leftWC;\n float sinAngle = abs(u.x * v.y - u.y * v.x);\n expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n }\n vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\n return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n }\nvoid main()\n{\n\tvec2 expandAndWidth = aTexCoord1.zw;\n\texpandAndWidth.y = expandAndWidth.y * uEffectLineWidth;\n\tfloat u = abs(expandAndWidth.x);\n\tfloat expandDir = sign(expandAndWidth.x);\n#ifdef ENABLE_DYNAMIC\n\tfloat w = 0.2 + 0.3*(1.0 - pow(2.0*abs(u - 0.5), 2.0));\n\tfloat width = abs(expandAndWidth.y*w) + 0.5;\n#else\n\tfloat width = abs(expandAndWidth.y) + 0.5;\n#endif\n\tbool usePrev = expandAndWidth.y < 0.0;\n\tvPositionMC.xyz = aPosition.xyz;\n vPositionMC.w = 0.0;\n#ifdef EXCAVATION\n vExcavationVertexPos = uGeoMatrix * vec4(aPosition.xyz, 1.0);\n#endif\n\tvec4 p = czm_modelView * aPosition;\n\tvec4 prev = czm_modelView * vec4(aNormal, 1.0);\n\tvec4 next = czm_modelView * aTexCoord0;\n\tv_st.s = aTexCoord1.x;\n\tv_width = width;\n\tv_alpha = u;\n\tfloat polylineAngle;\n\tvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\n\tv_polylineAngle = polylineAngle;\n\tgl_Position = czm_viewportOrthographic * positionWC;\n\tv_st.t = czm_writeNonPerspective(clamp(aTexCoord1.y, 0.0, 1.0), gl_Position.w);\n\tvec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n\tvColor = vertexColor;\n}",_0x5367b9=(_0x30f3c3=!0,function(e,t){var i=_0x30f3c3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x30f3c3=!1,i}),_0x14099b=_0x5367b9(void 0,(function(){return _0x14099b.toString().search("(((.+)+)+)+$").toString().constructor(_0x14099b).search("(((.+)+)+)+$")})),_0x30f3c3;_0x14099b();var _0x32ca44="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nvarying vec4 vColor;\nvarying vec2 v_st;\nvarying float v_width;\nvarying float v_polylineAngle;\nvarying vec4 vSecondColor;\nconst float maskLength = 16.0;\nuniform vec4 uColor;\nuniform int uType;\nuniform vec4 uOutlineColor;\nuniform float uOutlineWidth;\nuniform vec4 uGapColor;\nuniform float uDashLength;\nuniform float uDashPattern;\nuniform float uGlowPower;\nuniform int uIsArrow;\nvarying vec4 vPositionMC;\nuniform vec2 uPolygonOffset;\n#ifdef APPLY_SWIPE\n uniform vec4 uSwipeRegion;\n#endif\n\nmat2 rotate(float rad)\n{\n\tfloat c = cos(rad);\n\tfloat s = sin(rad);\n\treturn mat2(\n\t\tc, s,\n\t\t-s, c\n\t);\n}\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\n\tfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\n\treturn slope * (x - p0.x) + p0.y;\n}\nvoid main()\n{\n vec2 st = v_st;\n st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\n#ifdef APPLY_SWIPE\n czm_RollerShutter(gl_FragCoord.xy, uSwipeRegion);\n#endif\n#ifdef GL_OES_standard_derivatives\n\tfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\n\tfloat base = 0.99;\n#endif\n\tvec4 lineColor = uColor;\n#ifdef REPLACE_COLOR_TYPE\n lineColor = vColor;\n#endif\n\tvec2 center = vec2(1.0, 0.5);\n\tfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\n\tfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\n\tfloat halfWidth = 0.15;\n\tfloat s = step(0.5 - halfWidth, st.t);\n\ts *= 1.0 - step(0.5 + halfWidth, st.t);\n\ts *= 1.0 - step(base, st.s);\n\tfloat t = step(base, st.s);\n\tt *= 1.0 - step(ptOnUpperLine, st.t);\n\tt *= step(ptOnLowerLine, st.t);\n\tfloat dist;\n\n\tvec4 outsideColor = vec4(0.0);\n\tvec4 currentColor;\n\tif (uIsArrow == 0 || st.s < base)\n\t{\n\t\tif(uType == 3)\n\t\t{\n\t\t\tfloat glow = uGlowPower / abs(st.t - 0.3) - (uGlowPower / 0.5);\n\t\t\tvec3 emission = max(vec3(glow - 1.0 + lineColor.rgb), lineColor.rgb);\n\t\t\tfloat alpha = clamp(0.0, 1.0, glow) * lineColor.a;\n\t\t\tvec4 fragColor = vec4(emission, alpha);\n\t\t\tif(uIsArrow != 0)\n\t\t\t{\n\t\t\t\tfloat d1 = abs(st.t - (0.5 - halfWidth));\n\t\t\t\tfloat d2 = abs(st.t - (0.5 + halfWidth));\n\t\t\t\tdist = min(d1, d2);\n\t\t\t\tcurrentColor = mix(outsideColor, fragColor, clamp(s + t, 0.0, 1.0));\n\t\t\t\tgl_FragColor = czm_antialias(outsideColor, fragColor, currentColor, dist, 0.1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgl_FragColor = fragColor;\n\t\t\t}\n\t\t}\n\t\telse if(uType == 1)\n\t\t{\n\t\t\tvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\n\t\t\tfloat dashPosition = fract(pos.x / uDashLength);\n\t\t\tfloat maskIndex = floor(dashPosition * maskLength);\n\t\t\tfloat maskTest = floor(uDashPattern / pow(2.0, maskIndex));\n\t\t\tvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? uGapColor : lineColor;\n\t\t\tif (fragColor.a < 0.005)\n\t\t\t{\n\t\t\t\tdiscard;\n\t\t\t}\n\t\t\tif(uIsArrow != 0)\n\t\t\t{\n\t\t\t\tfloat d1 = abs(st.t - (0.5 - halfWidth));\n\t\t\t\tfloat d2 = abs(st.t - (0.5 + halfWidth));\n\t\t\t\tdist = min(d1, d2);\n\t\t\t\tcurrentColor = mix(outsideColor, fragColor, clamp(s + t, 0.0, 1.0));\n\t\t\t\tgl_FragColor = czm_antialias(outsideColor, fragColor, currentColor, dist, 0.1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgl_FragColor = fragColor;\n\t\t\t}\n\t\t}\n\t\telse if(uType == 2)\n\t\t{\n\t\t\tfloat halfInteriorWidth = 0.5 * (v_width - uOutlineWidth) / v_width;\n\t\t\tfloat b = step(0.5 - halfInteriorWidth, st.t);\n\t\t\tb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\n\t\t\tfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\n\t\t\tfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\n\t\t\tfloat dist = min(d1, d2);\n\t\t\tcurrentColor = mix(uOutlineColor, lineColor, b);\n\t\t\tgl_FragColor = czm_antialias(uOutlineColor, lineColor, currentColor, dist, 0.1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(uIsArrow != 0)\n\t\t\t{\n\t\t\t\tfloat d1 = abs(st.t - (0.5 - halfWidth));\n\t\t\t\tfloat d2 = abs(st.t - (0.5 + halfWidth));\n\t\t\t\tdist = min(d1, d2);\n\t\t\t\tcurrentColor = mix(outsideColor, lineColor, clamp(s + t, 0.0, 1.0));\n\t\t\t\tgl_FragColor = czm_antialias(outsideColor, lineColor, currentColor, dist, 0.1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgl_FragColor = lineColor;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfloat d1 = czm_infinity;\n\t\tif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n\t\t{\n\t\t\td1 = abs(st.s - base);\n\t\t}\n\t\tfloat d2 = abs(st.t - ptOnUpperLine);\n\t\tfloat d3 = abs(st.t - ptOnLowerLine);\n\t\tdist = min(min(d1, d2), d3);\n\t\tcurrentColor = mix(outsideColor, lineColor, clamp(s + t, 0.0, 1.0));\n\t\tgl_FragColor = czm_antialias(outsideColor, lineColor, currentColor, dist, 0.1);\n\t}\n#ifndef REPLACE_COLOR_TYPE\n gl_FragColor = gl_FragColor * vColor;\n#endif\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n if(gl_FragColor.a < 0.1){discard;}\n#ifdef CLIP\ngl_FragColor *= czm_clip(czm_modelView * vec4(vPositionMC.xyz, 1.0), 1.0);\n#endif\n#ifdef EXCAVATION\n if(czm_executeExcavation())\n {\n discard;\n }\n#endif\n#ifdef LOG_DEPTH\n if(uPolygonOffset.x != 0.0 || uPolygonOffset.y != 0.0){\n float logZ = 1.0 / gl_FragCoord.w + 1.0;\n float DZ = max(dFdx(logZ), dFdy(logZ));\n logZ += DZ * uPolygonOffset.x + 0.0000001 * uPolygonOffset.y;\n czm_writeLogDepth(logZ);\n }\n else{\n czm_writeLogDepth();\n }\n#endif\n}",_0xee22ae=(_0x48009a=!0,function(e,t){var i=_0x48009a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x48009a=!1,i}),_0x376dd8=_0xee22ae(void 0,(function(){return _0x376dd8.toString().search("(((.+)+)+)+$").toString().constructor(_0x376dd8).search("(((.+)+)+)+$")})),_0x48009a;_0x376dd8();var _0xba57d1="\nuniform float uEffectLineWidth;\n\nattribute vec4 aPosition;\nattribute vec3 aNormal;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\nuniform vec4 uSelColor;\nvarying vec4 vColor;\nvarying vec4 vSecondColor;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\nvarying float v_alpha;\nvarying float fWindowZ;\nvarying vec4 vPositionMC;\nvoid clipLineSegmentToNearPlane(\n vec3 p0,\n vec3 p1,\n out vec4 positionWC,\n out bool clipped,\n out bool culledByNearPlane)\n{\n culledByNearPlane = false;\n clipped = false;\n vec3 p1ToP0 = p1 - p0;\n float magnitude = length(p1ToP0);\n vec3 direction = normalize(p1ToP0);\n float endPoint0Distance = -(czm_currentFrustum.x + p0.z);\n float denominator = -direction.z;\n if (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n {\n culledByNearPlane = true;\n }\n else if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n {\n float t = (czm_currentFrustum.x + p0.z) / denominator;\n if (t < 0.0 || t > magnitude)\n {\n culledByNearPlane = true;\n }\n else\n {\n p0 = p0 + t * direction;\n clipped = true;\n }\n }\n positionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\n\tvec4 endPointWC, p0, p1;\n\tbool culledByNearPlane, clipped;\n\tvec4 positionEC = position;\n\tvec4 prevEC = previous;\n\tvec4 nextEC = next;\n\tvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\n\tvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\n\tvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n\n\tvec2 lineDir;\n\tif (usePrevious)\n\t{\n\t\tlineDir = normalize(positionWindow.xy - previousWindow.xy);\n\t}\n\telse\n\t{\n\t\tlineDir = normalize(nextWindow.xy - positionWindow.xy);\n\t}\n\tangle = atan(lineDir.x, lineDir.y) - 1.570796327;\n\tangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n\n\tclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\n\tclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\n\tclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\n\tif (culledByNearPlane)\n\t{\n\t\treturn vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\tvec2 prevWC = normalize(p0.xy - endPointWC.xy);\n\tvec2 nextWC = normalize(p1.xy - endPointWC.xy);\n\tfloat expandWidth = width * 0.5;\n\tvec2 direction;\n\tif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon7) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon7))\n\t{\n\t\tdirection = vec2(-nextWC.y, nextWC.x);\n\t}\n\telse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon7) || clipped)\n\t{\n\t\tdirection = vec2(prevWC.y, -prevWC.x);\n\t}\n\telse\n\t{\n\t\tvec2 normal = vec2(-nextWC.y, nextWC.x);\n\t\tdirection = normalize((nextWC + prevWC) * 0.5);\n\t\tif (dot(direction, normal) < 0.0)\n\t\t{\n\t\t\tdirection = -direction;\n\t\t}\n\t\tfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\n\t\texpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n\t}\n\tvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\n\treturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\nvoid main()\n{\n\tvec2 expandAndWidth = aTexCoord1.zw;\n\texpandAndWidth.y = expandAndWidth.y * uEffectLineWidth;\n\tfloat u = abs(expandAndWidth.x);\n\tfloat expandDir = sign(expandAndWidth.x);\n#ifdef ENABLE_DYNAMIC\n\tfloat w = 0.2 + 0.3*(1.0 - pow(2.0*abs(u - 0.5), 2.0));\n\tfloat width = abs(expandAndWidth.y*w) + 0.5;\n#else\n\tfloat width = abs(expandAndWidth.y) + 0.5;\n#endif\n\tbool usePrev = expandAndWidth.y < 0.0;\n\tvPositionMC.xyz = aPosition.xyz;\n vPositionMC.w = 0.0;\n\tvec4 p = czm_modelView * aPosition;\n\tvec4 prev = czm_modelView * vec4(aNormal, 1.0);\n\tvec4 next = czm_modelView * aTexCoord0;\n\tv_st = aTexCoord1.xy;\n\tv_width = width;\n\tv_alpha = u;\n\tvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_polylineAngle);\n\tvec4 pos = czm_projection * p;\n\tfWindowZ = (0.5 * (pos.z / pos.w) + 0.5);\n\tgl_Position = czm_viewportOrthographic * positionWC;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n float right_2 = operationType.x * 0.5;\n float isPicked = fract(floor(right_2)* 0.5);\n if(isPicked > 0.1)\n {\n fWindowZ = -1.0;\n }\n#endif\n\tvColor = vertexColor;\n}",_0xe79945=(_0x4dd94a=!0,function(e,t){var i=_0x4dd94a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4dd94a=!1,i}),_0x547e68=_0xe79945(void 0,(function(){return _0x547e68.toString().search("(((.+)+)+)+$").toString().constructor(_0x547e68).search("(((.+)+)+)+$")})),_0x4dd94a;_0x547e68();var _0x558b7c="attribute vec4 aPosition;\n#ifdef VertexColor\n attribute vec4 aColor;\n#endif\n#ifdef BatchTable\n attribute float batchId;\n#endif\n attribute vec4 aTexCoord0;\n attribute vec4 aTexCoord1;\n attribute vec4 aTexCoord2;\n attribute vec4 aTexCoord3;\n attribute vec4 aTexCoord4;\n attribute vec4 aTexCoord5;\n uniform vec4 uSelColor;\n varying vec4 v_startPlaneNormalEcAndHalfWidth;\n varying vec4 v_endPlaneNormalEcAndBatchId;\n varying vec4 v_rightPlaneEC;\n varying vec4 v_endEcAndStartEcX;\n varying vec4 v_texcoordNormalizationAndStartEcYZ;\n varying vec4 v_vertexColor;\n varying vec4 vSecondColor;\n uniform float uLineWidth;\n uniform vec4 uLineColor;\n#ifdef COMPRESS_VERTEX\n uniform vec4 decode_position_min;\n uniform float decode_position_normConstant;\n#endif\n#ifdef COMPRESS_TEXCOORD\n uniform float decode_texCoord0_normConstant;\n uniform float decode_texCoord1_normConstant;\n uniform float decode_texCoord2_normConstant;\n uniform float decode_texCoord3_normConstant;\n uniform float decode_texCoord4_normConstant;\n uniform float decode_texCoord5_normConstant;\n uniform vec4 decode_texCoord0_min;\n uniform vec4 decode_texCoord1_min;\n uniform vec4 decode_texCoord2_min;\n uniform vec4 decode_texCoord3_min;\n uniform vec4 decode_texCoord4_min;\n uniform vec4 decode_texCoord5_min;\n#endif\n void main()\n {\n vec3 position3DHigh = aPosition.xyz;\n vec4 uncompress = vec4(1.0);\n#ifdef COMPRESS_VERTEX\n uncompress = decode_position_min + aPosition * decode_position_normConstant;\n position3DHigh = uncompress.xyz;\n#endif\n vec3 position3DLow = aTexCoord5.xyz;\n#ifdef COMPRESS_TEXCOORD\n uncompress = decode_texCoord5_min + aTexCoord5 * decode_texCoord5_normConstant;\n position3DLow = uncompress.xyz;\n#endif\n vec4 startHiAndForwardOffsetX = aTexCoord0;\n vec4 startLoAndForwardOffsetY = aTexCoord1;\n vec4 startNormalAndForwardOffsetZ = aTexCoord2;\n vec4 endNormalAndTextureCoordinateNormalizationX = aTexCoord3;\n vec4 rightNormalAndTextureCoordinateNormalizationY = aTexCoord4;\n#ifdef COMPRESS_TEXCOORD\n uncompress = decode_texCoord0_min + aTexCoord0 * decode_texCoord0_normConstant;\n startHiAndForwardOffsetX = uncompress;\n uncompress = decode_texCoord1_min + aTexCoord1 * decode_texCoord1_normConstant;\n startLoAndForwardOffsetY = uncompress;\n uncompress = decode_texCoord2_min + aTexCoord2 * decode_texCoord2_normConstant;\n startNormalAndForwardOffsetZ = uncompress;\n uncompress = decode_texCoord3_min + aTexCoord3 * decode_texCoord3_normConstant;\n endNormalAndTextureCoordinateNormalizationX = uncompress;\n uncompress = decode_texCoord4_min + aTexCoord4 * decode_texCoord4_normConstant;\n rightNormalAndTextureCoordinateNormalizationY = uncompress;\n#endif\n vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\n vec3 forwardOffset = vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\n vec3 offset = czm_normal * forwardOffset;\n vec3 ecEnd = ecStart + offset;\n vec3 forwardDirectionEC = normalize(offset);\n // start plane\n vec4 startPlaneEC;\n startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n // end plane\n vec4 endPlaneEC;\n endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n // Right plane\n v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n v_endEcAndStartEcX.xyz = ecEnd;\n v_endEcAndStartEcX.w = ecStart.x;\n v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n vec4 positionRelativeToEye = czm_translateRelativeToEye(position3DHigh, position3DLow);\n // Check distance to the end plane and start plane, pick the plane that is closer\n vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;\n float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\n float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\n vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\n vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));\n vec3 normalEC = normalize(cross(planeDirection, upOrDown));\n upOrDown = cross(forwardDirectionEC, normalEC);\n upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\n positionEC.xyz += upOrDown;\n v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\n float width = uLineWidth;\n v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\n v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\n v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\n v_endPlaneNormalEcAndBatchId.w = 0.0;\n width = width * max(0.0, czm_metersPerPixel(positionEC));\n width = width / dot(normalEC, v_rightPlaneEC.xyz);\n normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n positionEC.xyz += width * normalEC;\n gl_Position = czm_depthClampFarPlane(czm_projection * positionEC);\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n v_vertexColor = vertexColor * uLineColor;\n }",_0x3dd35b=(_0x2b2bbd=!0,function(e,t){var i=_0x2b2bbd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2b2bbd=!1,i}),_0x4180aa=_0x3dd35b(void 0,(function(){return _0x4180aa.toString().search("(((.+)+)+)+$").toString().constructor(_0x4180aa).search("(((.+)+)+)+$")})),_0x2b2bbd;_0x4180aa();var _0x3a5032="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n varying vec4 v_startPlaneNormalEcAndHalfWidth;\n varying vec4 v_endPlaneNormalEcAndBatchId;\n varying vec4 v_rightPlaneEC; // Technically can compute distance for this here\n varying vec4 v_endEcAndStartEcX;\n varying vec4 v_texcoordNormalizationAndStartEcYZ;\n varying vec4 v_vertexColor;\n varying vec4 vSecondColor;\n void main(void)\n {\n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\n vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\n // Discard for sky\n if (logDepthOrDepth == 0.0) {\n discard;\n }\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n eyeCoordinate /= eyeCoordinate.w;\n float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\n // Check distance of the eye coordinate against the right-facing plane\n float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n // Check eye coordinate against the mitering planes\n float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\n float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\n if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0)\n {\n discard;\n }\n gl_FragColor = v_vertexColor;\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n// vec3 alignedPlaneNormal;\n// // start aligned plane\n// alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\n// alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n// distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\n// // end aligned plane\n// alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\n// alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n// distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n// // Clamp - distance to aligned planes may be negative due to mitering,\n// // so fragment texture coordinate might be out-of-bounds.\n// float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\n// s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\n// float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\n// czm_writeDepthClampedToFarPlane();\n }\n ",_0x1526e3=(_0x40b6dc=!0,function(e,t){var i=_0x40b6dc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x40b6dc=!1,i}),_0xb31d17=_0x1526e3(void 0,(function(){return _0xb31d17.toString().search("(((.+)+)+)+$").toString().constructor(_0xb31d17).search("(((.+)+)+)+$")})),_0x40b6dc;_0xb31d17();var _0x2c6884={SIZE_PER_INSTANCE:20,SIZE_PER_DM_INSTANCE:35,S3MB_BIM_INSTANCE:17,S3MB_BIM_INSTANCE_2:16,S3MB_PIPE_INSTANCE:29},_0x3199cb=Object.freeze(_0x2c6884),_0x5c8ecd=(_0x46290c=!0,function(e,t){var i=_0x46290c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x46290c=!1,i}),_0x23108a=_0x5c8ecd(void 0,(function(){return _0x23108a.toString().search("(((.+)+)+)+$").toString().constructor(_0x23108a).search("(((.+)+)+)+$")})),_0x46290c;_0x23108a();var _0x13cbf3={NONE:0,LEFT:1,RIGHT:2,TOP:-1,BOTTOM:-2},_0x171baa=Object.freeze(_0x13cbf3),_0x346e58=(_0x342679=!0,function(e,t){var i=_0x342679?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x342679=!1,i}),_0x345a9d=_0x346e58(void 0,(function(){return _0x345a9d.toString().search("(((.+)+)+)+$").toString().constructor(_0x345a9d).search("(((.+)+)+)+$")})),_0x342679;_0x345a9d();var _0x168443={DatasetField:0,EdgeLengthMin:1},_0x4a384f=Object.freeze(_0x168443),_0x1ba369=(_0x1631af=!0,function(e,t){var i=_0x1631af?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1631af=!1,i}),_0x4b36bd=_0x1ba369(void 0,(function(){return _0x4b36bd.toString().search("(((.+)+)+)+$").toString().constructor(_0x4b36bd).search("(((.+)+)+)+$")})),_0x1631af;_0x4b36bd();var _0x5edc23={OPAQUE:"opaque",BLEND:"blend",MASK:"mask"},_0x9df4c2=Object.freeze(_0x5edc23),_0x2602f9=(_0x21f116=!0,function(e,t){var i=_0x21f116?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21f116=!1,i}),_0x10e083=_0x2602f9(void 0,(function(){return _0x10e083.toString().search("(((.+)+)+)+$").toString().constructor(_0x10e083).search("(((.+)+)+)+$")})),_0x21f116;function _0xa7e56d(e){}function _0x3634fe(e){return e.verticesCount<=8||16==e.verticesCount}function _0x5b6fd7(e){return 1!==e._brightness||1!==e._contrast||0!==e._hue||1!==e._saturation||1!==e._gamma}_0x10e083(),_0xa7e56d.createShaderProgram=function(e,t,i){var r=t.layer,n=r._style3D,o="S3MTilesVectex_"+r.id,a="S3MTilesNormalFP_"+r.id,s=new a$$({name:o,sources:[_0xbceba]}),l=new a$$({name:a,sources:[_0xb5c174]});switch(t.fileType){case f$r.PointCloudFile:if(o="S3MPointCloudVp_"+r.id,a="S3MPointCloudFp_"+r.id,r._pointCloudShading.renderMode==_0x5a7173.VOXEL){s=new a$$({name:o,sources:[_0x1162a0]}),l=new a$$({name:a,sources:[_0x180856]}),r._bUseHypColorTable&&(s.defines.push(H$r.COMPUTE_W_VALUE),s.defines.push(H$r.HYPSOMETRIC),l.defines.push(H$r.HYPSOMETRIC),l.defines.push(H$r.COMPUTE_W_VALUE)),r._style3D.fillForeColor.alpha<.95&&l.defines.push("OIT")}else{s=new a$$({name:o,sources:[_0x2baa71]}),(l=new a$$({name:a,sources:[_0x3191d0]})).defines.push(H$r.PT_CLOUD),s.defines.push(H$r.PT_CLOUD);var u=t.volTexture||t.volObj;if((r._bUseHypColorTable||u&&r._bUseHypColorTable)&&(s.defines.push(H$r.COMPUTE_W_VALUE),s.defines.push(H$r.HYPSOMETRIC),s.defines.push(H$r.VOL_AND_HYP),l.defines.push(H$r.HYPSOMETRIC),l.defines.push(H$r.COMPUTE_W_VALUE),l.defines.push(H$r.VOL_AND_HYP)),e$28((f=t.vertexPackage).nCompressOptions))((p=f.nCompressOptions)&_0x33a28d.SVC_Vertex)==_0x33a28d.SVC_Vertex&&s.defines.push(H$r.COMPRESS_VERTEX),(p&_0x33a28d.SVC_Normal)==_0x33a28d.SVC_Normal&&s.defines.push(H$r.COMPRESS_NORMAL),((p&_0x33a28d.SVC_VertexColor)==_0x33a28d.SVC_VertexColor||"MESHOPT"===r._vertexCompressionType)&&s.defines.push(H$r.COMPRESS_COLOR),(p&_0x33a28d.SVC_TexutreCoord)==_0x33a28d.SVC_TexutreCoord&&s.defines.push(H$r.COMPRESS_TEXCOORD);e$28(f.textureCoordIsW)&&t.hasTexCoord&&s.defines.push(H$r.TEXTURE_COORD_ONE_IS_W)}r._clipping&&l.defines.push("CLIP"),r._section&&l.defines.push("CLIPPLANE");break;case f$r.OSGBFile:case f$r.OSGBCacheFile:var c=t.materialPass._textures.length;if(t.materialPass._isInvalidOblique)(l=new a$$({name:a="S3MTilesFragment_"+r.id,sources:[_0x4cdf29]})).defines.push(H$r.INVALID_OBLIQUE);else if(t.hasTexCoord){if(c>0){if(l=new a$$({name:a="S3MTilesFragment_"+r.id,sources:[_0x4cdf29]}),e$28(t.materialPass._batchTable)){var h=t.materialPass._batchTable.getVertexShaderCallback()(_0xbceba);(s=new a$$({name:o,sources:[h]})).defines.push(H$r.TextureBatch),l.defines.push(H$r.TextureBatch)}c>1&&t.hasTexCoord2&&(e$28(t.materialPass._batchTableBake)&&(s=new a$$({name:o,sources:[h=t.materialPass._batchTableBake.getVertexShaderCallback()(h)]})).defines.push(H$r.TextureBatch),s.defines.push(H$r.MULTI_TEX),l.defines.push(H$r.MULTI_TEX),2===r.textureEmissionUnit&&l.defines.push(H$r.SEC_TEX_EMISSION))}t.materialPass.hasTexture&&(s.defines.push(H$r.COMPUTE_TEXCOORD),l.defines.push(H$r.COMPUTE_TEXCOORD))}!t.hasTexCoord&&c>0&&l.defines.push(H$r.NO_TEXCOORD),t.materialPass._usePBRTextureBatch&&(s.defines.push(H$r.USE_BatchPBR),l.defines.push(H$r.USE_BatchPBR)),r.shadowType===_0x121e29.NONE&&(s.defines.push("NormalVertex"),l.defines.push("NormalVertex")),e$1U.maximumVertexTextureImageUnits>0&&s.defines.push("VertexTextureSupport"),r._isS3MB?((t.instanceMode===_0x3199cb.S3MB_BIM_INSTANCE||t.instanceMode===_0x3199cb.S3MB_BIM_INSTANCE_2)&&(s.defines.push("InstanceRenderBIM"),s.defines.push("InstanceS3MB")),t.instanceMode===_0x3199cb.S3MB_PIPE_INSTANCE&&(s.defines.push("InstanceRenderPipeline"),l.defines.push("InstanceRenderPipeline"),s.defines.push("InstanceS3MB"),_0x3634fe(i._vertexPackage)&&(s.defines.push("IS_SQUARE_PIPE"),l.defines.push("IS_SQUARE_PIPE"))),(t.instanceMode===_0x3199cb.S3MB_BIM_INSTANCE||t.instanceMode===_0x3199cb.S3MB_BIM_INSTANCE_2||t.instanceMode===_0x3199cb.S3MB_PIPE_INSTANCE)&&(s.defines.push("Instance"),l.defines.push("Instance"))):(t.instanceMode===_0x3199cb.SIZE_PER_INSTANCE&&s.defines.push("InstanceRenderBIM"),t.instanceMode===_0x3199cb.SIZE_PER_DM_INSTANCE&&(s.defines.push("InstanceRenderPipeline"),_0x3634fe(i._vertexPackage)&&(s.defines.push("IS_SQUARE_PIPE"),l.defines.push("IS_SQUARE_PIPE"))),(t.instanceMode===_0x3199cb.SIZE_PER_DM_INSTANCE||t.instanceMode===_0x3199cb.SIZE_PER_INSTANCE)&&(s.defines.push("Instance"),l.defines.push("Instance"))),r._clipping&&l.defines.push("CLIP"),r._section&&l.defines.push("CLIPPLANE"),t.volObj?(s.defines.push(H$r.VOLUME),l.defines.push(H$r.VOLUME)):t.volTexture&&(s.defines.push(H$r.VOLUME2),l.defines.push(H$r.VOLUME2)),e$28(t.materialPass._mapTextures)&&Object.getOwnPropertyNames(t.materialPass._mapTextures).length>0&&l.defines.push("Map"),_0x5b6fd7(r)&&l.defines.push(H$r.ADJUST_COLOR),r._hasLight&&4===t.primitiveType&&(s.defines.push(H$r.HAS_LIGHT),l.defines.push(H$r.HAS_LIGHT)),t.hasNormal&&!t.ignoreNormal&&(s.defines.push(H$r.HAS_NORMAL),l.defines.push(H$r.HAS_NORMAL)),t.ignoreNormal&&l.defines.push(H$r.IGNORE_NORMAL),r._selectColorType===Ya$1.REPLACE?(s.defines.push(H$r.REPLACE_SELECT_TYPE),l.defines.push(H$r.REPLACE_SELECT_TYPE)):r.isSilhouette()&&(s.defines.push(H$r.SILHOUETTE_SELECT_TYPE),l.defines.push(H$r.SILHOUETTE_SELECT_TYPE)),(r._operationType&_0xfef200.CLIP)===_0xfef200.CLIP&&l.defines.push(H$r.CLIP_FILT_BY_ID),r._PBRMaterialType!==je$b.NONE&&(s.defines.push(H$r.PBR),l.defines.push(H$r.PBR)),r._flattening&&(s.defines.push(H$r.FALTTEN),t.context.floatingPointTexture&&s.defines.push(H$r.UseFloatTexture)),r._hasOverlay&&(s.defines.push(H$r.OVERLAY),l.defines.push(H$r.OVERLAY));u=t.volTexture||t.volObj;if((!r._bVolume&&r._bUseHypColorTable||u&&r._bUseHypColorTable)&&(s.defines.push(H$r.COMPUTE_W_VALUE),l.defines.push(H$r.COMPUTE_W_VALUE),s.defines.push(H$r.HYPSOMETRIC),l.defines.push(H$r.HYPSOMETRIC),s.defines.push(H$r.VOL_AND_HYP),l.defines.push(H$r.VOL_AND_HYP)),e$28(r._hypsometricSetting)&&e$28(r._hypsometricSetting._emissionTextureArray)&&r._hypsometricSetting._emissionTextureArray.length>0&&r._hypsometricSetting._emissionTextureArray.length===r._hypsometricSetting._loadedEmissionTexture?(s.defines.push(H$r.COMPUTE_W_VALUE),l.defines.push(H$r.COMPUTE_W_VALUE),s.defines.push(H$r.EMISSION_TEXTURE),l.defines.push(H$r.EMISSION_TEXTURE),s.defines.push(H$r.EMISSION_TEXTURE_COUNT+r._hypsometricSetting._emissionTextureArray.length),l.defines.push(H$r.EMISSION_TEXTURE_COUNT+r._hypsometricSetting._emissionTextureArray.length)):(s.defines.push(H$r.EMISSION_TEXTURE_COUNT+0),l.defines.push(H$r.EMISSION_TEXTURE_COUNT+0)),t.nVertexDim>3&&e$28(r._categorieTexture)&&s.defines.push(H$r.W_VISIBLE),e$28(r._vertexWeightMode)&&r._vertexWeightMode===_0x4a384f.EdgeLengthMin&&r._triangleFiltratePixel>0&&s.defines.push(H$r.TRIANGLE_FILTRATE),e$28((f=t.vertexPackage).nCompressOptions))((p=f.nCompressOptions)&_0x33a28d.SVC_Vertex)==_0x33a28d.SVC_Vertex&&s.defines.push(H$r.COMPRESS_VERTEX),(p&_0x33a28d.SVC_Normal)==_0x33a28d.SVC_Normal&&s.defines.push(H$r.COMPRESS_NORMAL),((p&_0x33a28d.SVC_VertexColor)==_0x33a28d.SVC_VertexColor||"MESHOPT"===r._vertexCompressionType)&&s.defines.push(H$r.COMPRESS_COLOR),(p&_0x33a28d.SVC_TexutreCoord)==_0x33a28d.SVC_TexutreCoord&&s.defines.push(H$r.COMPRESS_TEXCOORD);r._lastSelectSkeletonId>-1&&s.defines.push("HAS_SKELETONSELECTED"),(e$28(r._imageryLayer)||r._needCoverImageryLayer)&&e$28(i._imagerys)&&i._imagerys.length>0&&e$28(t.attributeLocations.img)&&(s.defines.push("IMAGERY"),l.defines.push("IMAGERY")),r.partlyTransparent&&e$28(t.materialPass._bTransparentSorting)&&l.defines.push("PARTLY_TRANSPARENT"),r._scene.pickPointEnabled&&(s.defines.push(H$r.VERTEX_CAPTURE),l.defines.push(H$r.VERTEX_CAPTURE));var d=e$28(r.themeStyle)&&e$28(r.themeStyle.pbrMaterialIndex);((t.materialPass._usePBR||r._pbrParameter&je$b.ROUGHNESS)>0||e$28(r._PBRMaterialParams.loadingTexture)&&!r._PBRMaterialParams.loadingTexture||d)&&(r._hasLight&&l.defines.push(H$r.BRDF),t.context.textureFloatLinear&&l.defines.push("OES_texture_float_linear"),d&&(s.defines.push(H$r.PBR_THEME),l.defines.push(H$r.PBR_THEME),l.defines.push("NUM_PBR_MATERIALS "+e.pbrMaterialsArr.length)),(t.materialPass._baseColorTextureIndex>-1&&e$28(t.materialPass.baseColorTexture)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.baseColorTexture))&&t.hasTexCoord&&l.defines.push(H$r.HAS_BASE_TEXTURE),(t.materialPass._metallicRoughnessTextureIndex>-1&&e$28(t.materialPass.metallicRoughnessTexture)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.metallicRoughnessTexture))&&t.hasTexCoord&&l.defines.push(H$r.HAS_MetallicRoughness_TEXTURE),(t.materialPass._normalTextureIndex>-1&&e$28(t.materialPass.normalTexture)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.normalTexture))&&t.hasTexCoord&&l.defines.push(H$r.HAS_NORMAL_TEXTURE),(t.materialPass._emissiveTextureIndex>-1&&e$28(t.materialPass.emissiveTexture)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.emissiveTexture))&&l.defines.push(H$r.HAS_EMISSIVE_TEXTURE),(e$28(e.specularEnvironmentMaps)||e$28(e.hdrEnvMap))&&(l.defines.push(H$r.IBL),e$28(e.specularEnvironmentMaps)&&l.defines.push(H$r.KtxEnvMap)),(t.materialPass._occlusionTextureIndex>-1||e$28(r._PBRMaterialParams.pbrMetallicRoughness.occlusionTexture)&&r._PBRMaterialParams.pbrMetallicRoughness.occlusionTexture instanceof L$17)&&t.hasTexCoord&&l.defines.push(H$r.HAS_OCCLUSION_TEXTURE),(e$28(t.materialPass._anisotropy)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.anisotropy))&&t.hasTexCoord&&l.defines.push(H$r.HAS_ANISOTROPY),(e$28(t.materialPass._subsurface)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.subsurface))&&t.hasTexCoord&&l.defines.push(H$r.HAS_SUBSURFACE),(e$28(t.materialPass._clearcoat)||e$28(r._PBRMaterialParams.pbrMetallicRoughness.clearcoat))&&t.hasTexCoord&&l.defines.push(H$r.HAS_CLEARCOAT),(t.materialPass._indexOfRefraction>-1||e$28(r._PBRMaterialParams.pbrMetallicRoughness.indexOfRefraction)&&r._PBRMaterialParams.pbrMetallicRoughness.indexOfRefraction>0)&&l.defines.push(H$r.REFRACTION),e$28(r._PBRMaterialParams.pbrMetallicRoughness.snowEffect)&&r._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowMaskTexture&&r._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowMaskTexture instanceof L$17&&e$28(r._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowNormalTexture)&&r._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowNormalTexture instanceof L$17&&l.defines.push(H$r.HAS_SNOW),e$28(r._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&r._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wetnessFactor&&l.defines.push(H$r.HAS_WETNESS),e$28(r._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&r._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rippleTexture&&r._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rippleTexture instanceof L$17&&l.defines.push(H$r.HAS_RAIN),e$28(t.materialPass._alphaMode)&&t.materialPass._alphaMode===_0x9df4c2.MASK&&l.defines.push(H$r.MASK)),r._PBRMaterialParams.pbrMetallicRoughness.emissionTextureIndex>0&&l.defines.push(H$r.SEC_TEX_EMISSION),r.visibleDistanceMax<6378137&&r.translucencyByDistance&&l.defines.push(H$r.VISIBLEDISTANCEMAX),e$28(t.unFinalResolution)&&t.unFinalResolution&&(s.defines.push("FINAL_RESOLUTION_CLIP"),l.defines.push("FINAL_RESOLUTION_CLIP"));break;case f$r.ClampGroundPolygon:case f$r.ClampObjectPolygon:var f,p;if(e$28((f=t.vertexPackage).clampRegionEdge))o="S3MTilesLineShadowVectex_"+r.id,a="S3MTilesShadowVolumeFP_"+r.id,s=new a$$({name:o,sources:[_0x558b7c]}),l=new a$$({name:a,sources:[_0x3a5032]});else{var _=t.materialPass._textures.length>0||t.hasSymbolTexture;o="S3MTilesRegionShadowVectex_"+r.id,a="S3MTilesShadowVolumeFP_"+r.id,s=new a$$({name:o,sources:[_0x2cebc1]}),l=new a$$({name:a,sources:[_0x271d9d]}),_&&(s.defines.push("HAS_TEXTURE"),l.defines.push("HAS_TEXTURE"))}if(e$28(f.nCompressOptions))((p=f.nCompressOptions)&_0x33a28d.SVC_Vertex)==_0x33a28d.SVC_Vertex&&s.defines.push(H$r.COMPRESS_VERTEX),(p&_0x33a28d.SVC_Normal)==_0x33a28d.SVC_Normal&&s.defines.push(H$r.COMPRESS_NORMAL),(p&_0x33a28d.SVC_TexutreCoord)==_0x33a28d.SVC_TexutreCoord&&s.defines.push(H$r.COMPRESS_TEXCOORD);break;case f$r.ExtendClampPolygonCache:o="S3MTilesExtendPolygonShadowVP_"+r.id,a="S3MTilesShadowVolumeFP_"+r.id,s=new a$$({name:o,sources:[_0x3fb63c]}),l=new a$$({name:a,sources:[_0x271d9d]});break;case f$r.ClampGroundLine:o="S3MTilesClampGroundLineVectex_"+r.id,a="S3MTilesClampGroundLineFP_"+r.id,s=new a$$({name:o,sources:[_0x36fa1b]}),l=new a$$({name:a,sources:[_0x271d9d]});break;case f$r.ClampGroundAndObjectLineCache:o="S3MTilesLineShadowVectex_"+r.id,a="S3MTilesShadowVolumeFP_"+r.id,s=new a$$({name:o,sources:[_0x558b7c]}),l=new a$$({name:a,sources:[_0x3a5032]});break;case f$r.ClampObjectLine:o="S3MTilesLineShadowVectex_"+r.id,a="S3MTilesShadowVolumeFP_"+r.id,s=new a$$({name:o,sources:[_0x36fa1b]}),l=new a$$({name:a,sources:[_0x271d9d]});break;case f$r.IconPoint:n.billboardMode===$r$4.FixedZ?s=new a$$({name:o="BillboardAxialVp_"+r.id,sources:[_0x33fbe7]}):n.billboardMode===$r$4.FixedXYZ?s=new a$$({name:o="BillboardPixelSizeWithAngleVp_"+r.id,sources:[_0x4e338f]}):n.billboardMode===$r$4.FIXED_ROTATE_ANGLE?s=new a$$({name:o="FixedRotateAngleVp_"+r.id,sources:[_0xc95c54]}):s=new a$$({name:o="S3MTilesBillboardPixelSizeVp_"+r.id,sources:[_0xd76675]}),l=new a$$({name:a="S3MTilesCommonOntTextureFP_"+r.id,sources:[_0x45f285]}),s.defines.push("ICON"),e$28(n.fixedPixelSize)&&!n.fixedPixelSize&&s.defines.push("EYE_DISTANCE_SCALING"),r._clipping&&l.defines.push("CLIP"),r._section&&l.defines.push("CLIPPLANE"),t.hasNormal&&!t.ignoreNormal&&(s.defines.push(H$r.HAS_NORMAL),l.defines.push(H$r.HAS_NORMAL));break;case f$r.Text:o="S3MTilesBillboardPixelSizeVp_"+r.id,n.billboardMode===$r$4.FixedXYZ?s=new a$$({name:o="BillboardPixelSizeWithAngleVp_"+r.id,sources:[_0x4e338f]}):n.billboardMode===$r$4.FIXED_ROTATE_ANGLE?s=new a$$({name:o="FixedRotateAngleVp_"+r.id,sources:[_0xc95c54]}):s=new a$$({name:o,sources:[_0xd76675]}),t.materialPass._textures.length>1?l=new a$$({name:a="S3MTilesFontWithHaloFp_"+r.id,sources:[_0x5a5938]}):t.materialPass._textures.length>0&&(l=new a$$({name:a="S3MTilesCommonOntTextureFP_"+r.id,sources:[_0x45f285]})),e$28(n.fixedPixelSize)&&!n.fixedPixelSize&&s.defines.push("EYE_DISTANCE_SCALING"),r._clipping&&l.defines.push("CLIP"),t.layer._section&&l.defines.push("CLIPPLANE"),t.hasNormal&&!t.ignoreNormal&&(s.defines.push(H$r.HAS_NORMAL),l.defines.push(H$r.HAS_NORMAL));break;case f$r.ExtendRegion3D:o="DynamicExtendRegionVp_"+r.id,a="DynamicExtendRegionFp_"+r.id,s=new a$$({name:o,sources:[_0xcb6db0]}),l=new a$$({name:a,sources:[_0x332cde]}),t.materialPass._textures.length>0&&l.defines.push("HAS_TEXTURE"),r._hasLight&&(s.defines.push(H$r.HAS_LIGHT),l.defines.push(H$r.HAS_LIGHT));break;case f$r.RegionEffect:o="RegionMaterialVp_"+r.id,a="RegionMaterialFp_"+r.id,s=new a$$({name:o,sources:[_0x3f8a14]}),l=new a$$({name:a,sources:[_0x313bb9]}),r._clipping&&l.defines.push("CLIP"),r._hasExcavation&&(s.defines.push(H$r.EXCAVATION),l.defines.push(H$r.EXCAVATION)),r._hasServerExcavation&&(s.defines.push("SERVEREXCAVATION"),l.defines.push("SERVEREXCAVATION"));break;case f$r.PolylineEffect:o="PolylineVp_"+r.id,a="PolylineFp_"+r.id,s=new a$$({name:o,sources:[_0x4c7dfa]}),l=new a$$({name:a,sources:[_0x32ca44]}),r._clipping&&l.defines.push("CLIP"),r._hasExcavation&&(s.defines.push(H$r.EXCAVATION),l.defines.push(H$r.EXCAVATION)),r._hasServerExcavation&&(s.defines.push("SERVEREXCAVATION"),l.defines.push("SERVEREXCAVATION"));break;case f$r.ClampGroundRealtimeRasterCache:l=new a$$({name:a="S3MTilesFragmentRaster_"+r.id,sources:[_0x321a25]}),s=new a$$({name:o="S3MTilesVectexRaster_"+r.id,sources:[_0x33bf99]}),r._selectColorType===Ya$1.REPLACE&&(s.defines.push(H$r.REPLACE_SELECT_TYPE),l.defines.push(H$r.REPLACE_SELECT_TYPE)),(t.hasSymbolTexture||t.materialPass._textures.length>0)&&(s.defines.push(H$r.TEXCOORD),l.defines.push(H$r.TEXCOORD))}if(t.fileType===f$r.ClampGroundRealtimeRasterCache&&t.hasTexCoord2&&(o="PolylineVp_"+r.id,a="PolylineFp_"+r.id,s=new a$$({name:o,sources:[_0xba57d1]}),l=new a$$({name:a,sources:[_0x32ca44]})),t.hasTexCoord&&(s.defines.push(H$r.TEXCOORD),l.defines.push(H$r.TEXCOORD)),t.hasTexCoord2&&(s.defines.push(H$r.TEXCOORD2),l.defines.push(H$r.TEXCOORD2)),r.horizontalline&&(s.defines.push(H$r.COMPUTE_W_VALUE),l.defines.push(H$r.COMPUTE_W_VALUE),l.defines.push(H$r.HORIZONTAL_LINE)),r._transparentBackColorTolerance>0&&l.defines.push(H$r.TRANSPARENT_BACK_COLOR),r.splitDirection!==_0x171baa.NONE&&l.defines.push(H$r.APPLY_SPLIT),r.swipeEnabled&&l.defines.push(H$r.APPLY_SWIPE),"MESHOPT"===r._vertexCompressionType&&s.defines.push("MeshOPT_Compress"),e$28(t.vertexPackage.customVertexAttribute)&&e$28(t.vertexPackage.customVertexAttribute.TextureCoordMatrix)&&s.defines.push("USE_TextureCoordMatrix"),e$28(t.vertexPackage.customVertexAttribute)&&e$28(t.vertexPackage.customVertexAttribute.VertexWeight)&&s.defines.push("USE_VertexWeight"),i._bMultiTemporalWeight&&(s.defines.push("MultiTemporalWeight"),l.defines.push("MultiTemporalWeight"),r.temporalSetting.changeZValue&&s.defines.push("ChangeZValue")),e$28(e.lightSource)){var m=e.lightSource.directionalLight;s.defines.push(H$r.DIR_LIGHTS+m.length),l.defines.push(H$r.DIR_LIGHTS+m.length),m.length>0&&l.defines.push(H$r.HAS_DIR_LIGHTS);var $=e.lightSource._visibleLightList[w$i.POINT];s.defines.push(H$r.POINT_LIGHTS+$.length),l.defines.push(H$r.POINT_LIGHTS+$.length),$.length>0&&l.defines.push(H$r.HAS_POINT_LIGHTS);var g=e.lightSource._visibleLightList[w$i.SPOT];s.defines.push(H$r.SPOT_LIGHTS+g.length),l.defines.push(H$r.SPOT_LIGHTS+g.length),g.length>0&&l.defines.push(H$r.HAS_SPOT_LIGHTS);var v=e.lightSource.hemisphereLight;l.defines.push(H$r.HEMISPHERE_LIGHTS+v.length),v.length>0&&l.defines.push(H$r.HAS_HEMISPHERE_LIGHTS)}return r._hasExcavation&&(s.defines.push(H$r.EXCAVATION),l.defines.push(H$r.EXCAVATION)),r._hasServerExcavation&&(s.defines.push("SERVEREXCAVATION"),l.defines.push("SERVEREXCAVATION")),t.hasInstanceSkeletonMatrix&&s.defines.push(H$r.UseInstanceSkeletonMatrix),r.mixColorType===_0x125991.REPLACE&&(s.defines.push(H$r.REPLACE_COLOR_TYPE),l.defines.push(H$r.REPLACE_COLOR_TYPE)),t.hasVertexColor&&s.defines.push("VertexColor"),t.isInstanceModel&&s.defines.push("InstanceModel"),t.hasTranslation&&s.defines.push(H$r.Translation),1===t.primitiveType&&(s.defines.push(H$r.POINT),l.defines.push(H$r.POINT)),2===t.primitiveType&&(l.defines.push(H$r.LineVector),s.defines.push(H$r.LineVector)),t.materialPass._RGBTOBGR&&l.defines.push(H$r.RGBTOBGR),r.enableFusion&&s.defines.push(H$r.FusionMode),e$28(i._batchTable)&&s.defines.push("BatchTable"),e$28(r._floodFlagTexture)&&(s.defines.push(H$r.FLOOD_ANALYSIS),l.defines.push(H$r.FLOOD_ANALYSIS)),e$28(i._batchTable)&&(h=i._batchTable.getVertexShaderCallback()(s.sources[0]),s=new a$$({defines:s.defines,sources:[h]})),e$28(r._effect)&&1===r._effect._type&&s.defines.push("POLYLINE_DASH"),e$28(r._associateMaterialUrl)&&l.defines.push("BaseColorReplace"),t.context.webgl2&&(s.defines.push("WEBGL2"),l.defines.push("WEBGL2")),i._createImageryShader(r,l),S$T.fromCache({context:t.context,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:t.attributeLocations})},_0xa7e56d.createWaterShaderProgram=function(e,t,i,r){var n=new a$$({name:"FresnelVp",sources:[_0x1948de]}),o=new a$$({name:"FresnelFp",sources:[_0xab5c07]});return t._clipping&&o.defines.push("CLIP"),t._section&&o.defines.push("CLIPPLANE"),e$28(r._batchTable)&&n.defines.push("BatchTable"),e$28(t._rsColor.polygonOffset)&&t._rsColor.polygonOffset.enabled&&o.defines.push("POLYGON_OFFSET"),t._hasExcavation&&(n.defines.push(H$r.EXCAVATION),o.defines.push(H$r.EXCAVATION)),t._hasServerExcavation&&(n.defines.push("SERVEREXCAVATION"),o.defines.push("SERVEREXCAVATION")),t.splitDirection!==_0x171baa.NONE&&o.defines.push(H$r.APPLY_SPLIT),t.swipeEnabled&&o.defines.push(H$r.APPLY_SWIPE),e$28(t._effect)&&1===t._effect._type&&n.defines.push("POLYLINE_DASH"),S$T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:i})};var _0x534b60=(_0x590708=!0,function(e,t){var i=_0x590708?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x590708=!1,i}),_0x27c8be=_0x534b60(void 0,(function(){return _0x27c8be.toString().search("(((.+)+)+)+$").toString().constructor(_0x27c8be).search("(((.+)+)+)+$")})),_0x590708;_0x27c8be();var _0x43ddbc=function(){this.model=void 0,this.frameState=void 0,this.layer=void 0};_0x43ddbc.prototype.set=function(e,t,i){this.frameState=e,this.layer=t,this.model=i},_0x43ddbc.prototype.execute=function(){var e=this.frameState,t=e.context,i=this.model,r=this.layer,n=i._vertexPackage,o=n.vertexAttributes,a=n.attrLocation,s=r._fileType,l=i._arrIndexPackage[0];e$28(l)&&"string"==typeof l.materialCode&&(l.materialCode=l.materialCode.replace(/\0/,""));var u=e$28(l)&&e$28(l.materialCode)?i._mapPass[l.materialCode]:_0x34bd01.Default,c={};c.primitiveType=s===f$r.PointCloudFile?W$_.POINTS:e$28(l)?l.primitiveType:W$_.TRIANGLES,c.context=t,c.fileType=s,c.layer=r,c.instanceMode=n.instanceMode,c.volObj=i._volObj,c.volTexture=i._volTexture,c.materialPass=u,c.attributeLocations=a,c.nVertexDim=o[0].componentsPerAttribute,c.vertexPackage=n,c.hasNormal=e$28(a.aNormal)&&!r._ignoreNormal,c.hasTexCoord=e$28(a.aTexCoord0),c.hasTexCoord2=e$28(a.aTexCoord1),c.hasSymbolTexture=e$28(i._symbolTextureUrl),c.hasInstanceSkeletonMatrix=e$28(i._instanceSkeletonMatrix),c.hasVertexColor=e$28(a.aColor),c.isInstanceModel=i._isInstanceModel,c.hasTranslation=i._idsTranslateMap.length>0,c.ignoreNormal=r.ignoreNormal,e$28(r.waterEffectSet)?i._sp=_0xa7e56d.createWaterShaderProgram(t,r,a,i):i._sp=_0xa7e56d.createShaderProgram(e,c,i)};var _0x27936e=(_0x9e48a6=!0,function(e,t){var i=_0x9e48a6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x9e48a6=!1,i}),_0x148a2c=_0x27936e(void 0,(function(){return _0x148a2c.toString().search("(((.+)+)+)+$").toString().constructor(_0x148a2c).search("(((.+)+)+)+$")})),_0x9e48a6;function _0x1eb77f(){}function _0x5b95d9(e){--e;for(var t=1;32>t;t<<=1)e|=e>>t;return e+1}_0x148a2c(),_0x1eb77f.computeNeighbors=function(e,t){for(var i=e.length/3,r=new Uint32Array(t+1),n=new Uint32Array(t+1),o=function(e,t){e<t?r[e+1]++:n[t+1]++},a=0;a<i;a++){var s=e[3*a],l=e[3*a+1],u=e[3*a+2];o(s,l),o(l,u),o(u,s)}for(a=l=s=0;a<t;a++)u=r[a+1],o=n[a+1],r[a+1]=s,n[a+1]=l,s+=u,l+=o;var c=new Uint32Array(6*i),h=r[t];for(o=function(e,t,i){if(e<t){var o=r[e+1]++;c[2*o]=t,c[2*o+1]=i}else o=n[t+1]++,c[2*h+2*o]=e,c[2*h+2*o+1]=i},a=0;a<i;a++)s=e[3*a],l=e[3*a+1],u=e[3*a+2],o(s,l,a),o(l,u,a),o(u,s,a);for(s=function(e,t){var i=2*e;for(e=t-e,t=1;t<e;t++){for(var r=c[i+2*t],n=c[i+2*t+1],o=t-1;0<=o&&c[i+2*o]>r;o--)c[i+2*o+2]=c[i+2*o],c[i+2*o+3]=c[i+2*o+1];c[i+2*o+2]=r,c[i+2*o+3]=n}},a=0;a<t;a++)s(r[a],r[a+1]),s(h+n[a],h+n[a+1]);var d=new Int32Array(3*i),f=function(t,i){return t===e[3*i]?0:t===e[3*i+1]?1:t===e[3*i+2]?2:-1};for(i=function(e,t){e=f(e,t),d[3*t+e]=-1},s=function(e,t,i,r){e=f(e,t),d[3*t+e]=r,i=f(i,r),d[3*r+i]=t},a=0;a<t;a++){l=r[a],u=r[a+1],o=n[a];for(var p=n[a+1];l<u&&o<p;){var _=c[2*l],m=c[2*h+2*o];_===m?(s(a,c[2*l+1],m,c[2*h+2*o+1]),l++,o++):_<m?(i(a,c[2*l+1]),l++):(i(m,c[2*h+2*o+1]),o++)}for(;l<u;)i(a,c[2*l+1]),l++;for(;o<p;)i(m=c[2*h+2*o],c[2*h+2*o+1]),o++}return d};var _0x41d879=null;function _0x4ed087(){}function _0x23f6f3(e){return Math.acos(1<e?1:-1>e?-1:e)}function _0x5d2855(e){var t,i=(t=!0,function(e,i){var r=t?function(){if(i){var t=i.apply(e,arguments);return i=null,t}}:function(){};return t=!1,r}),r=i(this,(function(){return r.toString().search("(((.+)+)+)+$").toString().constructor(r).search("(((.+)+)+)+$")}));return r(),e*Math.PI/180}_0x1eb77f.deduplicate=function(e,t,i,r,n){void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=e.byteLength/(4*t)),e=new Uint32Array(e,r,n*t),r=new Uint32Array(n);var o=Math.floor(1.1*n)+1;(null==_0x41d879||_0x41d879.length<2*o)&&(_0x41d879=new Uint32Array(_0x5b95d9(2*o)));for(var a=0;a<2*o;a++)_0x41d879[a]=0;var s=0,l=0!==i?Math.ceil(7.84*1.96/(i*i)*i*(1-i)):n;for(a=0;a<n;a++){if(a===l){if((c=1-s/a)+1.96*Math.sqrt(c*(1-c)/a)<i)return null;l*=2}for(var u,c=a*t,h=u=0;h<t;h++)u=(u=e[c+h]+u|0)+(u<<11)+(u>>>2)|0;h=(u>>>=0)%o;for(var d=s;0!==_0x41d879[2*h+1];){if(_0x41d879[2*h]===u){var f=_0x41d879[2*h+1]-1,p=f*t;e:{for(var _=0;_<t;_++)if(e[c+_]!==e[p+_]){p=!1;break e}p=!0}if(p){d=r[f];break}}++h>=o&&(h-=o)}d===s&&(_0x41d879[2*h]=u,_0x41d879[2*h+1]=a+1,s++),r[a]=d}if(0!==i&&1-s/n<i)return null;for(i=new Uint32Array(t*s),a=s=0;a<n;a++)if(r[a]===s){for(o=e,l=a*t,c=i,u=s*t,h=t,d=0;d<h;d++)c[u+d]=o[l+d];s++}return{buffer:i.buffer,indices:r,uniqueCount:s}};var _0x2ff0c5=4,_0x329c3a=35,_0x34a615=_0x5d2855(_0x2ff0c5),_0x104349=_0x5d2855(_0x329c3a),_0x4e76df=Math.cos(_0x104349),_0x4d29e8=Math.cos(_0x34a615);function _0x1087d9(e,t,i){var r=i.x-t.x,n=i.y-t.y;return(i=r*r+n*n+(t=i.z-t.z)*t)?(i=1/Math.sqrt(i),e.x=r*i,e.y=n*i,e.z=t*i,e):(e.x=0,e.y=0,e.z=0,e)}var _0x590bc5={position0:new t$X,position1:new t$X,faceNormal0:new t$X,faceNormal1:new t$X,cosAngle:0},_0x5356ef=new t$X,_0x2f8f57=new t$X;function _0x2697bc(e,t){var i=_0x23f6f3(e.cosAngle);return _0x1087d9(_0x2f8f57,e.position1,e.position0),t$X.cross(e.faceNormal0,e.faceNormal1,_0x5356ef),i*(0<t$X.dot(_0x5356ef,_0x2f8f57)?-1:1)>t}function _0x3dee0(e){var t=e.faces.length/3,i=e.faces,r=e.neighbors,n=0,o=0;for(o=0;o<t;o++){var a=r[3*o+0],s=r[3*o+1],l=r[3*o+2],u=i[3*o+0],c=i[3*o+1],h=i[3*o+2];n+=-1===a||u<c?1:0,n+=-1===s||c<h?1:0,n+=-1===l||h<u?1:0}var d=new Int32Array(4*n),f=0;for(o=0;o<t;o++){a=r[3*o+0],s=r[3*o+1],l=r[3*o+2],u=i[3*o+0],c=i[3*o+1],h=i[3*o+2];(-1===a||u<c)&&(d[f++]=u,d[f++]=c,d[f++]=o,d[f++]=a),(-1===s||c<h)&&(d[f++]=c,d[f++]=h,d[f++]=o,d[f++]=s),(-1===l||h<u)&&(d[f++]=h,d[f++]=u,d[f++]=o,d[f++]=l)}return d}var _0x5291a7=new t$X,_0x56451e=new t$X,_0x39c6d1=new t$X;function _0x1e51b5(e){var t=e.x*e.x+e.y*e.y+e.z*e.z;t>0&&(t=1/Math.sqrt(t),e.x*=t,e.y*=t,e.z*=t)}function _0x5df622(e){for(var t=e.faces.length/3,i=e.vertices,r=e.dim,n=e.faces,o=new Float32Array(3*t),a=0;a<t;a++){var s=n[3*a+0],l=n[3*a+1],u=n[3*a+2];_0x5291a7.x=i[r*s],_0x5291a7.y=i[r*s+1],_0x5291a7.z=i[r*s+2],_0x56451e.x=i[r*l],_0x56451e.y=i[r*l+1],_0x56451e.z=i[r*l+2],_0x39c6d1.x=i[r*u],_0x39c6d1.y=i[r*u+1],_0x39c6d1.z=i[r*u+2],t$X.subtract(_0x56451e,_0x5291a7,_0x56451e),t$X.subtract(_0x39c6d1,_0x5291a7,_0x39c6d1),t$X.cross(_0x56451e,_0x39c6d1,_0x5291a7),_0x1e51b5(_0x5291a7),o[3*a+0]=_0x5291a7.x,o[3*a+1]=_0x5291a7.y,o[3*a+2]=_0x5291a7.z}return o}function _0x30b1f7(e,t){0===t&&(t=e,e=0);for(var i=Array(t-e),r=e;r<t;r++)i[r-e]=r;return i}_0x4ed087.extractEdges=function(e){var t=e.vertices,i=e.dim,r=_0x590bc5,n=r.position0,o=r.position1,a=r.faceNormal0,s=r.faceNormal1,l=_0x5df622(e),u=_0x3dee0(e),c=u.length/4,h=new Float32Array(9*c),d=0,f=new Float32Array(12*c),p=0,_=0,m=0,$=_0x30b1f7(0,c),g=new Float32Array(c);g.forEach((function(e,r,a){var s=u[4*r+0],l=u[4*r+1];n.x=t[s*i],n.y=t[s*i+1],n.z=t[s*i+2],o.x=t[l*i],o.y=t[l*i+1],o.z=t[l*i+2],a[r]=t$X.distance(n,o)})),$.sort((function(e,t){return g[t]-g[e]}));for(var v=[],y=[],x=0;x<c;x++){var b=$[x],w=g[b],C=u[4*b+0],T=u[4*b+1],S=u[4*b+2],E=u[4*b+3],A=-1===E;if(n.x=t[C*i],n.y=t[C*i+1],n.z=t[C*i+2],o.x=t[T*i],o.y=t[T*i+1],o.z=t[T*i+2],A)a.x=l[3*S],a.y=l[3*S+1],a.z=l[3*S+2],s.x=a.x,s.y=a.y,s.z=a.z,r.cosAngle=t$X.dot(a,s);else if(a.x=l[3*S],a.y=l[3*S+1],a.z=l[3*S+2],s.x=l[3*E],s.y=l[3*E+1],s.z=l[3*E+2],r.cosAngle=t$X.dot(a,s),r.cosAngle>_0x4d29e8)continue;_+=w,m++,A||r.cosAngle<_0x4e76df?(h[d++]=r.position0.x,h[d++]=r.position0.y,h[d++]=r.position0.z,h[d++]=r.position1.x,h[d++]=r.position1.y,h[d++]=r.position1.z,h[d++]=r.faceNormal0.x,h[d++]=r.faceNormal0.y,h[d++]=r.faceNormal0.z,v.push(w)):_0x2697bc(r,_0x34a615)&&(f[p++]=r.position0.x,f[p++]=r.position0.y,f[p++]=r.position0.z,f[p++]=r.position1.x,f[p++]=r.position1.y,f[p++]=r.position1.z,f[p++]=r.faceNormal0.x,f[p++]=r.faceNormal0.y,f[p++]=r.faceNormal0.z,f[p++]=r.faceNormal1.x,f[p++]=r.faceNormal1.y,f[p++]=r.faceNormal1.z,y.push(w))}h=h.slice(0,d),f=f.slice(0,p);var P=_/m,I=v.length,M=y.length;return{regular:{instancesData:h,instanceCount:I,edgeLength:I*P},silhouette:{instancesData:f,instanceCount:M,edgeLength:M*P},averageEdgeLength:P}};var _0x387336=(_0x147fb8=!0,function(e,t){var i=_0x147fb8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x147fb8=!1,i}),_0x29a458=_0x387336(void 0,(function(){return _0x29a458.toString().search("(((.+)+)+)+$").toString().constructor(_0x29a458).search("(((.+)+)+)+$")})),_0x147fb8;function _0x5598e9(e){}function _0x543dd8(e){if(e$28(e.cachedSidenessVertexBuffer))return e.cachedSidenessVertexBuffer;var t=new Float32Array(8),i=0;return t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=0,e.cachedSidenessVertexBuffer=h$W.createVertexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW}),e.cachedSidenessVertexBuffer.vertexArrayDestroyable=!1,e.cachedSidenessVertexBuffer}function _0x3ade73(){var e=new Uint16Array(6),t=0;return e[t++]=2,e[t++]=1,e[t++]=0,e[t++]=3,e[t++]=2,e[t++]=0,e}function _0x58c6de(e,t){for(var i,r,n,o=t.componentsPerAttribute,a=e.vertCompressConstant,s=new t$X(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),l=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),u=new Float32Array(3*e.verticesCount),c=0;c<e.verticesCount;c++)i=l[o*c]*a+s.x,r=l[o*c+1]*a+s.y,n=l[o*c+2]*a+s.z,u[3*c]=i,u[3*c+1]=r,u[3*c+2]=n;return u}_0x29a458(),_0x5598e9.RegularInstanceStride=12,_0x5598e9.SilhouetteInstanceStride=15,_0x5598e9.createEdgeData=function(e,t,i){if(0==t.length)return null;var r,n=t[0];r=0===n.indexType?new Uint16Array(n.indicesTypedArray.buffer,n.indicesTypedArray.byteOffset,n.indicesTypedArray.byteLength/2):new Uint32Array(n.indicesTypedArray.buffer,n.indicesTypedArray.byteOffset,n.indicesTypedArray.byteLength/4);var o=_0x5598e9.extractEdgeInformation(e,!1,r),a=_0x4ed087.extractEdges(o);return e$28(i)&&(e$28(a.regular.instancesData)&&i.push(a.regular.instancesData.buffer),e$28(a.silhouette.instancesData)&&i.push(a.silhouette.instancesData.buffer)),a},_0x5598e9.createIndexBuffer=function(e){return e$28(e.cachedSidenessIndexBuffer)||(e.cachedSidenessIndexBuffer=h$W.createIndexBuffer({context:e,typedArray:_0x3ade73(),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),e.cachedSidenessIndexBuffer.vertexArrayDestroyable=!1),e.cachedSidenessIndexBuffer},_0x5598e9.createRegularEdgeAttributes=function(e,t){if(e$28(t.instancesData)&&0!=t.instancesData.length){var i={},r=[];t.attributeLocations=i,t.attributes=r;var n=h$W.createVertexBuffer({context:e,typedArray:t.instancesData,usage:A$1c.STATIC_DRAW});t.instancesData=null;var o=S$W.getSizeInBytes(S$W.FLOAT),a=_0x543dd8(e),s=0;i.aSideness=s++,r.push({index:i.aSideness,vertexBuffer:a,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:2*S$W.getSizeInBytes(S$W.FLOAT),normalize:!1});var l=_0x5598e9.RegularInstanceStride,u=0;i.aPosition0=s++,r.push({index:i.aPosition0,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=3,i.aPosition1=s++,r.push({index:i.aPosition1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=3,i.aNormal=s++,r.push({index:i.aNormal,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=3,i.batchId=s++,r.push({index:i.batchId,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=1,i.aVariantStroke=s++,r.push({index:i.aVariantStroke,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=1,i.aVariantExtension=s++,r.push({index:i.aVariantExtension,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*u,strideInBytes:o*l,instanceDivisor:1}),u+=1}},_0x5598e9.createSilhouetteEdgeAttributes=function(e,t){if(e$28(t.instancesData)&&0!=t.instancesData.length){var i={},r=[];t.attributeLocations=i,t.attributes=r;var n=h$W.createVertexBuffer({context:e,typedArray:t.instancesData,usage:A$1c.STATIC_DRAW});t.instancesData=null;var o=S$W.getSizeInBytes(S$W.FLOAT),a=0;i.aSideness=a++,r.push({index:i.aSideness,vertexBuffer:_0x543dd8(e),componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:2*o,normalize:!1});var s=_0x5598e9.SilhouetteInstanceStride,l=0;i.aPosition0=a++,r.push({index:i.aPosition0,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=3,i.aPosition1=a++,r.push({index:i.aPosition1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=3,i.aNormalA=a++,r.push({index:i.aNormalA,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=3,i.aNormalB=a++,r.push({index:i.aNormalB,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=3,i.batchId=a++,r.push({index:i.batchId,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=1,i.aVariantStroke=a++,r.push({index:i.aVariantStroke,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=1,i.aVariantExtension=a++,r.push({index:i.aVariantExtension,vertexBuffer:n,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,normalize:!0,offsetInBytes:o*l,strideInBytes:o*s,instanceDivisor:1}),l+=1}},_0x5598e9.extractEdgeInformation=function(e,t,i){var r,n=e.attrLocation.aPosition,o=e.vertexAttributes[n],a=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,s=o.componentsPerAttribute;a?(s=3,r=_0x58c6de(e,o)):r=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);var l=r.length/s;if(t&&i)return{faces:i,neighbors:_0x1eb77f.computeNeighbors(i,l),vertices:r,dim:s};var u,c=o.typedArray.buffer;u=a?r.buffer:c.slice(o.typedArray.byteOffset,o.typedArray.byteOffset+o.typedArray.byteLength);var h=_0x1eb77f.deduplicate(u,s),d=_0x5598e9.selectIndexData(h.indices,i);return{faces:d,neighbors:_0x1eb77f.computeNeighbors(d,h.uniqueCount),vertices:new Float32Array(h.buffer),dim:s}},_0x5598e9.selectIndexData=function(e,t){if(t){t=t.slice();for(var i=0;i<t.length;i++)t[i]=e[t[i]];return t}return e};var _0x4c0901=new t$X,_0x31197f=new t$X,_0x1b1240=new t$X,_0x5dd201=new t$X,_0x974a28=new t$X,_0x3b7999=new t$X,_0x4d1cec=new t$X,_0x124359=new t$X;function _0x5e1ac1(e,t){function i(e,t,i){var r=48217*e%2147483647,n=t+r/2147483647*(i-=t);return{seed:r,result:Math.round(n)}}var r=function(e,t){var i=new Float32Array(6),r=new Uint32Array(i.buffer),n=new Uint32Array(1);i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=t.x,i[4]=t.y,i[5]=t.z,n[0]=5381;for(var o=0;o<r.length;o++)n[0]=31*n[0]+r[o];return n[0]}(e,t);e$28(r)||(r=2147483647*Math.random());var n=i(r,0,255);r=n.seed,n.result,r=(n=i(r,0,5)).seed;var o,a=n.result;r=(n={seed:o=48217*r%2147483647,result:o/2147483646}).seed;var s=n.result;return s=-(1-Math.min(s/.7,1))+Math.max(0,s-.7)/(1-.7),{variantStroke:a,variantExtension:s=255*(Math.abs(s)**1.2*(0>s?-1:1)*.5+.5)}}_0x5598e9.createEdgeDataByIndices=function(e,t){var i,r,n=e.attrLocation.aPosition,o=e.vertexAttributes[n],a=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,s=o.componentsPerAttribute;a?(s=3,i=_0x58c6de(e,o)):i=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);for(var l=[],u=[],c=(r=0===t.indexType?new Uint16Array(t.indicesTypedArray.buffer,t.indicesTypedArray.byteOffset,t.indicesTypedArray.byteLength/2):new Uint32Array(t.indicesTypedArray.buffer,t.indicesTypedArray.byteOffset,t.indicesTypedArray.byteLength/4)).length,h=0,d=0,f=4*Math.floor(c/4);d<f;d+=4){var p=r[d],_=r[d+1],m=r[d+2],$=r[d+3];if(_0x4c0901.x=i[s*p],_0x4c0901.y=i[s*p+1],_0x4c0901.z=i[s*p+2],_0x31197f.x=i[s*_],_0x31197f.y=i[s*_+1],_0x31197f.z=i[s*_+2],_0x1b1240.x=i[s*m],_0x1b1240.y=i[s*m+1],_0x1b1240.z=i[s*m+2],_0x5dd201.x=i[s*$],_0x5dd201.y=i[s*$+1],_0x5dd201.z=i[s*$+2],!(t$X.equals(_0x31197f,_0x1b1240)||t$X.equals(_0x31197f,_0x5dd201)||t$X.equals(_0x31197f,_0x4c0901)||t$X.equals(_0x1b1240,_0x4c0901)||t$X.equals(_0x5dd201,_0x4c0901))){if(m===$){if(t$X.subtract(_0x31197f,_0x4c0901,_0x974a28),t$X.subtract(_0x1b1240,_0x4c0901,_0x3b7999),t$X.cross(_0x974a28,_0x3b7999,_0x974a28),t$X.equals(_0x974a28,t$X.ZERO))continue;t$X.normalize(_0x974a28,_0x974a28),l.push(_0x4c0901.x),l.push(_0x4c0901.y),l.push(_0x4c0901.z),l.push(_0x31197f.x),l.push(_0x31197f.y),l.push(_0x31197f.z),l.push(_0x974a28.x),l.push(_0x974a28.y),l.push(_0x974a28.z),l.push(p);var g=(y=_0x5e1ac1(_0x4c0901,_0x31197f)).variantStroke,v=y.variantExtension;l.push(g),l.push(v)}else{if(t$X.subtract(_0x31197f,_0x4c0901,_0x974a28),t$X.subtract(_0x1b1240,_0x4c0901,_0x3b7999),t$X.cross(_0x974a28,_0x3b7999,_0x974a28),t$X.equals(_0x974a28,t$X.ZERO)||(t$X.normalize(_0x974a28,_0x974a28),t$X.subtract(_0x31197f,_0x4c0901,_0x4d1cec),t$X.subtract(_0x5dd201,_0x4c0901,_0x124359),t$X.cross(_0x124359,_0x4d1cec,_0x4d1cec),t$X.equals(_0x4d1cec,t$X.ZERO)))continue;t$X.normalize(_0x4d1cec,_0x4d1cec),u.push(_0x4c0901.x),u.push(_0x4c0901.y),u.push(_0x4c0901.z),u.push(_0x31197f.x),u.push(_0x31197f.y),u.push(_0x31197f.z),u.push(_0x974a28.x),u.push(_0x974a28.y),u.push(_0x974a28.z),u.push(_0x4d1cec.x),u.push(_0x4d1cec.y),u.push(_0x4d1cec.z),u.push(p);var y;g=(y=_0x5e1ac1(_0x4c0901,_0x31197f)).variantStroke,v=y.variantExtension;u.push(g),u.push(v)}h+=t$X.distance(_0x4c0901,_0x31197f)}}var x=h/(c/4),b=l.length/_0x5598e9.RegularInstanceStride,w=u.length/_0x5598e9.SilhouetteInstanceStride;return{regular:{instancesData:new Float32Array(l),instanceCount:b,edgeLength:b*x},silhouette:{instancesData:new Float32Array(u),instanceCount:w,edgeLength:w},averageEdgeLength:x}};var _0x2f22c3=(_0xc39177=!0,function(e,t){var i=_0xc39177?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xc39177=!1,i}),_0x5621e8=_0x2f22c3(void 0,(function(){return _0x5621e8.toString().search("(((.+)+)+)+$").toString().constructor(_0x5621e8).search("(((.+)+)+)+$")})),_0xc39177;function _0x1e730b(e,t){this._id=e,this._worldPosLeftBottom=void 0,this._windowCoordRect=new h$10,this._weight=1e3,this._heigtRangeMax=-1,this._distanceRangeSquare=Number.POSITIVE_INFINITY,this._pixelWidth=-1,this._pixelHeight=-1,this._centerPixelOffset=-1,this._layer=t,this._visible=void 0}_0x5621e8(),Object.defineProperties(_0x1e730b.prototype,{windowCoordRect:{get:function(){return this._windowCoordRect}},heigtRangeMax:{get:function(){return this._heigtRangeMax},set:function(e){this._heigtRangeMax=e;var t=e*e;this._distanceRangeSquare=Math.max(1e4,t)}},weight:{get:function(){return this._weight},set:function(e){this._weight=e}},pixelWidth:{get:function(){return this._pixelWidth},set:function(e){this._pixelWidth=e}},pixelHeight:{get:function(){return this._pixelHeight},set:function(e){this._pixelHeight=e}},worldPosLeftBottom:{get:function(){return this._worldPosLeftBottom},set:function(e){this._worldPosLeftBottom=e}},centerPixelOffset:{get:function(){return this._centerPixelOffset},set:function(e){this._centerPixelOffset=e}},layerName:{get:function(){return this._layer.name}},layer:{get:function(){return this._layer}},id:{get:function(){return this._id}},visible:{get:function(){return this._visible},set:function(e){(!e$28(this._visible)||e!==this._visible||e&&this.layer._objsHideList._hash[this.id])&&_0x1e730b.addToChangeQueue(this,e),this._visible=e}}});var _0x8ee141=new o$1k;_0x1e730b.prototype.calcWindowCoordRect=function(e,t){m$1b.pointToWindowCoordinates(e,t,this._worldPosLeftBottom,_0x8ee141),this._windowCoordRect.west=_0x8ee141.x,this._windowCoordRect.east=_0x8ee141.x+this._pixelWidth,this._windowCoordRect.south=_0x8ee141.y,this._windowCoordRect.north=_0x8ee141.y-this._pixelHeight},_0x1e730b.prototype.isInViewport=function(e,t){return this._windowCoordRect.west+200>0&&this._windowCoordRect.east<e+this._pixelWidth&&this._windowCoordRect.north+200>0&&this._windowCoordRect.south-50<t+this._pixelHeight},_0x1e730b.prototype.isInHeightRange=function(e){return!this._layer._hasHeightRangeAttributeName||e<this._heigtRangeMax},_0x1e730b.prototype.isInVisibleRange=function(e){return!this._layer._hasHeightRangeAttributeName||t$X.distanceSquared(e,this._worldPosLeftBottom)<this._distanceRangeSquare};var _0x244878=new h$10,_0x380c86=new h$10;function _0x50224b(e,t){e.east+=t,e.west-=t,e.south+=t,e.north-=t}_0x1e730b.isIntersectionTest=function(e,t,i){h$10.clone(e,_0x244878),h$10.clone(t,_0x380c86),_0x50224b(_0x244878,i),_0x50224b(_0x380c86,i);var r=Math.max(_0x244878.west,_0x380c86.west),n=Math.min(_0x244878.south,_0x380c86.south),o=Math.min(_0x244878.east,_0x380c86.east);return!(n<=Math.max(_0x244878.north,_0x380c86.north)||r>=o)};var _0xf4daa0=[];function _0x338d66(e,t){for(var i=0,r=e._layerQueue.length;i<r;i++){var n=e._layerQueue[i];if(n.id===t)return n}}function _0x4f2723(e,t){for(var i in t){var r=e.find(i),n=r?r.iconRelatedTextLayerID:void 0;if(n){var o=i,a=_0x338d66(e,n);if(a){var s=t[a.name];s&&s.length>0&&(t[o]=s)}}}}_0x1e730b.meetVisible=function(e,t,i){_0xf4daa0.length=0;e.sort((function(e,t){return e.weight-t.weight}));for(var r=0,n=e.length;r<n;r++){var o=e[r];o.layerName;var a=o.layer;if(!a.iconRelatedTextLayerID||!i){var s=o.id;if(a._objsVisibleMap._allObjsHide){if(!0!==a._objsVisibleMap[s])continue}else if(!1===a._objsVisibleMap[s]){o.visible=!1;continue}for(var l=o.windowCoordRect,u=!1,c=0,h=_0xf4daa0.length;c<h;c++){var d=_0xf4daa0[c],f=d.windowCoordRect;if(!(o.id===d.id&&o.layer.id===d.layer.id)&&_0x1e730b.isIntersectionTest(l,f,t)){u=!0;break}}u?o.visible=!1:(_0xf4daa0.push(o),o.visible=!0)}}},_0x1e730b._visibleChangedQueue={},_0x1e730b._invisibleChangedQueue={},_0x1e730b.addToChangeQueue=function(e,t){var i,r=e.layerName;(i=t?_0x1e730b._visibleChangedQueue:_0x1e730b._invisibleChangedQueue)[r]||(i[r]=[]),i[r].push(e.id)},_0x1e730b.addPotentialVisibiltyChangedLayer=function(e){_0x1e730b._visibleChangedQueue[e]||(_0x1e730b._visibleChangedQueue[e]=[]),_0x1e730b._invisibleChangedQueue[e]||(_0x1e730b._invisibleChangedQueue[e]=[])},_0x1e730b.setVisibiltyChangedToLayer=function(e,t){for(var i in t&&(_0x4f2723(e,_0x1e730b._visibleChangedQueue),_0x4f2723(e,_0x1e730b._invisibleChangedQueue)),_0x1e730b._visibleChangedQueue){var r=e.find(i);(n=_0x1e730b._visibleChangedQueue[i]).length>0&&r.setOnlyObjsVisible(n,!0,!1)}for(var i in _0x1e730b._invisibleChangedQueue){var n;r=e.find(i);(n=_0x1e730b._invisibleChangedQueue[i]).length>0&&r.setOnlyObjsVisible(n,!1,!1)}},_0x1e730b.resetVisibleChangedQueue=function(){_0x1e730b._visibleChangedQueue={},_0x1e730b._invisibleChangedQueue={}},_0x1e730b.prototype.isDestroyed=function(){return!1},_0x1e730b.prototype.destroy=function(){return i$Z(this)};var _0x7b3a87=(_0xca6b60=!0,function(e,t){var i=_0xca6b60?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xca6b60=!1,i}),_0x3000b1=_0x7b3a87(void 0,(function(){return _0x3000b1.toString().search("(((.+)+)+)+$").toString().constructor(_0x3000b1).search("(((.+)+)+)+$")})),_0xca6b60;_0x3000b1();var _0x59da62="\nattribute vec4 aTopPos;\nattribute vec4 aBottomPos;\nattribute vec2 offset;\nattribute float aPixelOffsetX;\n\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nuniform vec4 uLineColor;\nuniform float uLineWidth;\n\nvarying vec4 vColor;\n\nfloat computerOnePixelLength(vec4 viewPos)\n{\n vec4 winPos = czm_projection * viewPos;\n float dwidth = czm_metersPerPixel(viewPos);\n winPos.x = winPos.x - 2.0 * dwidth;\n vec4 newViewPos = czm_inverseProjection * winPos;\n return length(viewPos - newViewPos);\n}\n\nvoid main()\n{\n\tvec4 vertexColor = vec4(1.0);\n vec4 selColor = vec4(1.0);\n#ifdef BatchTable\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, selColor, vertexColor);\n#endif\n\n\tif(vertexColor.a < 0.01){\n\t\tgl_Position = czm_projection * vec4(0.0, 0.0, 0.0, 1.0);\n\t\treturn;\n\t}\n\t\n vColor = vertexColor * uLineColor;\n vec3 pos = offset.y > 0.0 ? aTopPos.xyz : aBottomPos.xyz;\n vec4 viewPos = czm_modelView * vec4(pos, 1.0);\n float onePixelLengthByMeter = computerOnePixelLength(viewPos);\n viewPos.x = viewPos.x + (offset.x * uLineWidth * 0.5 + aPixelOffsetX) * onePixelLengthByMeter;\n gl_Position = czm_projection * viewPos;\n}",_0x1505da=(_0x415f28=!0,function(e,t){var i=_0x415f28?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x415f28=!1,i}),_0x3f3547=_0x1505da(void 0,(function(){return _0x3f3547.toString().search("(((.+)+)+)+$").toString().constructor(_0x3f3547).search("(((.+)+)+)+$")})),_0x415f28;_0x3f3547();var _0xc05137="\nvarying vec4 vColor;\n\nvoid main()\n{\n gl_FragColor = vColor;\n}";const _0x5409b6=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x1afc39=_0x5409b6(void 0,(function(){return _0x1afc39.toString().search("(((.+)+)+)+$").toString().constructor(_0x1afc39).search("(((.+)+)+)+$")}));_0x1afc39();let _0x51825f=new t$X,_0x741e28=new t$X;function _0x3a39e5(e,t){const i=t._arrtextOverlapInfo.length;if(0==i)return;const r=S$W.createTypedArray(S$W.FLOAT,3*i),n=S$W.createTypedArray(S$W.FLOAT,3*i),o=S$W.createTypedArray(S$W.FLOAT,i),a=S$W.createTypedArray(S$W.FLOAT,i),s=new y$15;y$15.clone(y$15.IDENTITY,s),y$15.getTranslation(t._matModel,_0x51825f),y$15.setTranslation(s,_0x51825f,s);let l=0;for(;l<i;l++){const e=t._arrtextOverlapInfo[l].worldPosLeftBottom;t$X.clone(e,_0x741e28);const i=t$W.fromCartesian(_0x741e28);i.height=0;const s=t$W.toCartesian(i);t$X.subtract(_0x741e28,_0x51825f,_0x741e28),t$X.subtract(s,_0x51825f,s),r[3*l]=_0x741e28.x,r[3*l+1]=_0x741e28.y,r[3*l+2]=_0x741e28.z,n[3*l]=s.x,n[3*l+1]=s.y,n[3*l+2]=s.z,o[l]=l,a[l]=t._arrtextOverlapInfo[l].centerPixelOffset}const u=e._context,c=h$W.createVertexBuffer({context:u,typedArray:r,usage:A$1c.STATIC_DRAW}),h=h$W.createVertexBuffer({context:u,typedArray:n,usage:A$1c.STATIC_DRAW}),d=h$W.createVertexBuffer({context:u,typedArray:o,usage:A$1c.STATIC_DRAW}),f=h$W.createVertexBuffer({context:u,typedArray:a,usage:A$1c.STATIC_DRAW}),p=[],_={offset:0,aTopPos:1,aBottomPos:2,batchId:3,aPixelOffset:4},m=u.createBillboardOffsetVertexBuffer();p.push({name:"offset",index:_.offset,vertexBuffer:m,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});const $=S$W.getSizeInBytes(S$W.FLOAT);p.push({name:"aTopPos",index:_.aTopPos,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*$,normalize:!1,instanceDivisor:1}),p.push({name:"aBottomPos",index:_.aBottomPos,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*$,normalize:!1,instanceDivisor:1}),p.push({name:"batchId",index:_.batchId,vertexBuffer:d,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),p.push({name:"aPixelOffsetX",index:_.aPixelOffsetX,vertexBuffer:f,componentsPerAttribute:1,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,instanceDivisor:1});const g=u.createBillboardPointIndexBuffer(),v=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:s,boundingVolume:t._boundingVolume,pass:Le$p.S3MTiles,owner:t,cull:!0,instanceCount:i});v.vertexArray=new m$19({context:u,attributes:p,indexBuffer:g});const y=new a$$({name:"TextLineCalloutVp",sources:[t._batchTable.getVertexShaderCallback()(_0x59da62)]});y.defines.push("BatchTable");const x=new a$$({name:"TextLineCalloutFp",sources:[_0xc05137]});v.shaderProgram=S$T.fromCache({context:u,vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:_}),v.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});let b={uLineColor:function(){return e.style3D.lineColor},uLineWidth:function(){return e.style3D.calloutWidth}};return b=t._batchTable.getUniformMapCallback()(b),v.uniformMap=b,v}var _0x4b00ae=(_0x46f0b3=!0,function(e,t){var i=_0x46f0b3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x46f0b3=!1,i}),_0x514ec1=_0x4b00ae(void 0,(function(){return _0x514ec1.toString().search("(((.+)+)+)+$").toString().constructor(_0x514ec1).search("(((.+)+)+)+$")})),_0x46f0b3;function _0x1f65d5(e){var t=(e=e||{}).arrIndexPackage,i=e.vertexPackage,r=e.mapPass;if(!(e.arrIndexPackage&&e.vertexPackage&&e.mapPass&&e$28(e.context)))throw new t$Z("gl texture indexes vertexes is required to create RenderEntityPagelod");if(this._layer=e.layer,this._entity=e.entity,this._context=e.context,this._arrIndexPackage=t,this._vertexPackage=i,this._attributeLocations=this._vertexPackage.attrLocation,this._edgeGeometry=e.edgeGeometry,this._pickInfo=u$Y(e.pickInfo,{}),this._ids=Object.keys(this._pickInfo),this._vertexBufferToCreate=new r$_,this._vertexWeightBuffers=[],this._bMultiTemporalWeight=!1,this._fMultiTemporalFactor=0,this._fMultiTemporalPercentage=0,this._nFirstMultiTemporalPos=-1,this._nSecondMultiTemporalPos=-1,this._nSpecificTemporalPos=-1,this._layer._temporalCount>0&&(this._bMultiTemporalWeight=!0),this._bMultiTemporalWeight){for(var n=[],o=Object.keys(i.attrLocation),a=o.length,s=0;s<a;++s){var l=o[s];n.push(i.attrLocation[l])}n.sort((function(e,t){return e-t})),this._nFirstMultiTemporalPos=i.attrLocation.aVertexWeight,this._nSecondMultiTemporalPos=i.attrLocation.aVertexWeight_1;var u=[],c=n.length;for(s=0;s<this._vertexPackage.vertexAttributes.length;s++){if(s===i.attrLocation.aVertexWeight||s===i.attrLocation.aVertexWeight_1||s>n[c-1]){var h=new Uint8Array(this._vertexPackage.vertexAttributes[s].typedArray,0,this._vertexPackage.vertexAttributes[s].byteLength);if(this._vertexWeightBuffers.push(h),s>n[c-1])continue}u.push(this._vertexPackage.vertexAttributes[s]),this._vertexBufferToCreate.enqueue(s)}this._vertexPackage.vertexAttributes=u}else for(s=0;s<this._vertexPackage.vertexAttributes.length;s++)this._vertexBufferToCreate.enqueue(s);for(this._indexBufferToCreate=new r$_,s=0;s<this._arrIndexPackage.length;s++)13!==this._arrIndexPackage[s].primitiveType&&this._arrIndexPackage[s].indicesCount>0&&this._indexBufferToCreate.enqueue(s);if(this._subTexturesToUpload=new r$_,this._shaderProgramToCreate=new r$_,this._shaderProgramToCreate.enqueue(0),this._version=e.version||_0x2528fb.S3M,this._isS3MBlock=u$Y(e.isS3MBlock,!1),this._initialize=!1,this._matModel=e.matModel,this._iblReferenceFrameMatrix=p$1a.clone(p$1a.IDENTITY),this._tranlateMatrix=y$15.clone(y$15.IDENTITY),this._mapPass=r,this._colorCommand=void 0,this._pickCommand=void 0,this._wireFrameCommands={},this._stencilCommand=void 0,this._clampColorCommand=void 0,this._clipStencilCommand=void 0,this._pickRectCommand=void 0,this._spatialQueryCommand=void 0,this._lineCalloutCommand=void 0,this._waterIndex=-1,this._waterTime=0,this._boundingVolume=e.boundingVolume,this._instanceCount=i.instanceCount,this._instanceMode=i.instanceMode,this._isS3MB=u$Y(e.isS3MB,!1),this._volObj=e.volObj,this._volTexture=e.volTexture,this._geoMatrix=u$Y(e.geoMatrix,y$15.IDENTITY),this._inverseGeoMatrix=y$15.inverse(this._geoMatrix,new y$15),this._instanceSkeletonMatrix=e.instanceSkeletonMatrix,this._wireFrameIndexBuffers=void 0,this._bufferPrepared=!1,this._fileType=e.fileType,e.fileType===f$r.ExtendRegion3D&&e$28(i.attrLocation.aTexCoord1)){var d=i.vertexAttributes[i.attrLocation.aTexCoord1].typedArray,f=d.slice(d.buffer,d.byteOffset,d.byteLength);this._texCoord1=new Float32Array(f.buffer,0,f.byteLength/4)}this._selectionInforMap=void 0,this._geometryByteLength=0,this._intersectWithClipPlane=!1,this._boundingRectangle=e.boundingRectangle,this._symbolTextureUrl=e.symbolTextureUrl,this._symbolColor=e.symbolColor,this._symbolTextureRepeat=e.symbolTextureRepeat,e$28(this._symbolTextureRepeat)||(this._symbolTextureRepeat=new o$1k(600,600)),this._clampRegionEdge=u$Y(i.clampRegionEdge,!1),e$28(e.level)&&(this._level=e.level,this._row=e.row,this._col=e.col),this._rasterized=!1,this._groupName=e.groupName,this._ptIndexGroup=e.ptIndexGroup,this._geoName=e.geoName,this.oriPassGroup=Le$p.S3MTiles,this._labelPosArray=[],this._labelTextArray=[],this._pickIDArray=[],this._labelsCreated={},this._labelIndexs={},this._labelPromiseArr=[],this._labelReady=!1,this._batchTable=void 0,this._updateBatchTable=!0,this._idsOperationMap=new e$1P,this._idsColorMap=new e$1P,this._idsTranslateMap=new e$1P,this._idsPBRIndexMap=new e$1P,this._hasBloomOperation=!1,this._isInstanceModel=this._layer.skeletonSelectEnable&&"InstanceModel"===this._layer._dataType&&i.skeletonCount>0,this.skeletonCount=i.skeletonCount,this._imagerys=[],this._imageryLevels=[],this._showImagerysImmediate=!0,this._imageryTextureBound=new o$1k,this._isLeaf=!1,this._isHypsometricVisible=!0,this._passIncrement=0,this._clipCommand=void 0,this._disFromCamera=0,this.materialPass=void 0,this.useWValue=!1,this.useLineColor=!1,this._polygons=void 0,this._polygonId=void 0,this._polygonCommands=[],this._imageRasterFinish=!1,this._isSelected=!1,this._clipBounds=[],this._scaleImagerys=[],this._visibleScaleImageryIndex=void 0,this._plusRoArray=[],this._removeListenerFunc=this._entity.root._attrDiryEvent.addEventListener((e=>{_0x47329e(this._layer,this,e)}))}_0x514ec1(),Object.defineProperties(_0x1f65d5.prototype,{renderable:{get:function(){if(!this._isS3MBlock||!e$28(this._mapPass))return this._bufferPrepared;for(var e in this._mapPass)if(this._mapPass.hasOwnProperty(e)){var t=this._mapPass[e],i=t._textures[0];return e$28(i)?this._bufferPrepared&&(i.renderable&&i.ready||e$28(t._ancestorTexture)):this._bufferPrepared}return this._bufferPrepared}}}),_0x1f65d5.prototype.initialize=function(){if(!this._initialize){if(this.createSelectionMap(),this.createBoundingBoxForInstance(),this._fileType===f$r.Text||this._fileType===f$r.IconPoint?this.createBillboardsBounds(this._layer):this._fileType===f$r.ClampGroundPolygon&&this.createClampGroundBounds(),e$28(this._symbolTextureUrl)&&_0x2dd764.createTexture({imageUrl:this._symbolTextureUrl}),this.prepareLabels(),!e$28(this._batchTable)&&this._ids.length>0){var e=this._layer,t=e._context;_0x4d34f7(t,this),_0x18fa4d(t,this,e)}this._initialize=!0}},_0x1f65d5.prototype.createSelectionMap=function(){var e=this._pickInfo;if(e$28(e)&&_0x2528fb.S3M4===this._version)for(var t in this._selectionInforMap=new e$1P,e)!e.hasOwnProperty(t)||-1===this._vertexPackage.instanceIndex&&"0"===t||this._selectionInforMap.set(t,e[t])},_0x1f65d5.prototype.createBoundingBoxForInstance=function(){var e=this._vertexPackage;if(e$28(e)&&-1!==e.instanceIndex&&e$28(e.instanceBounds)){var t=e.instanceBounds,i=new t$X(t[0],t[1],t[2]),r=new t$X(t[3],t[4],t[5]),n=t$X.lerp(i,r,.5,new t$X),o=t$X.distance(n,i),a=new t$X;y$15.multiplyByPoint(this._matModel,n,a),this._boundingVolume.center=a,this._boundingVolume.radius=o>this._boundingVolume.radius?o:this._boundingVolume.radius,e.instanceBounds=void 0}},_0x1f65d5.prototype.createClampGroundBounds=function(){var e=this._boundingRectangle.x,t=this._boundingRectangle.y,i=this._boundingRectangle.x+this._boundingRectangle.width,r=this._boundingRectangle.y+this._boundingRectangle.height,n=new t$X(i,t,0),o=new t$X(e,r,0);this._southWestCorner=new t$X(e,t,0),this._eastVector=new t$X,this._northVector=new t$X,t$X.subtract(n,this._southWestCorner,this._eastVector),t$X.subtract(o,this._southWestCorner,this._northVector)},_0x1f65d5.prototype.createBillboardsBounds=function(e){this._arrtextOverlapInfo=[];var t=this._matModel,i=this._selectionInforMap.values,r=this._vertexPackage.vertexAttributes[0].typedArray,n=this._vertexPackage.vertexAttributes[0].componentsPerAttribute||3;if(e$28(r)&&e$28(r.buffer)){var o,a,s=new Float32Array(r.buffer,r.byteOffset,r.byteLength/4);this._fileType===f$r.Text?(o=this._vertexPackage.vertexAttributes[1].typedArray,a=new Float32Array(o.buffer,o.byteOffset,o.byteLength/4)):(o=this._vertexPackage.vertexAttributes[3].typedArray,a=new Float32Array(o.buffer,o.byteOffset,o.byteLength/4));for(var l=new t$X,u=[],c=0;c<this._vertexPackage.verticesCount;c++)t$X.fromArray(a,3*c,l),u.push(t$X.clone(l));for(var h,d,f,p=e$28(e._overlapWeightAttributeName),_=e$28(e._heightRangeAttributeName),m=0,$=i.length;m<$;m++){var g=new _0x1e730b(this._ids[m],e);d=(h=i[m]).vertexColorOffset,f=u$Y(h.vertexCount,h.vertexColorCount);for(var v=Number.MAX_VALUE,y=Number.MIN_VALUE,x=Number.MAX_VALUE,b=Number.MIN_VALUE,w=d;w<d+f;w++){var C=u[w];v=Math.min(C.x,v),y=Math.max(C.x,y),x=Math.min(C.y,x),b=Math.max(C.y,b)}g.pixelWidth=y-v,g.pixelHeight=b-x,g.centerPixelOffset=.5*(y+v);var T=new t$X(s[d*n],s[d*n+1],s[d*n+2]);if(y$15.multiplyByPoint(t,T,T),g.worldPosLeftBottom=T,p||_){var S=this._ids[m],E=e.getAttributesById(S);e$28(E)&&e$28(E.then)&&this._getLabelWeightOrHeight(g,E,e._overlapWeightAttributeName,e._heightRangeAttributeName)}this._arrtextOverlapInfo.push(g)}}else console.log("createBillboardsBounds")},_0x1f65d5.prototype._getLabelWeightOrHeight=function(e,t,i,r){t.then((t=>{if(i&&(e.weight=u$Y(t[i],1e3),e.heigtRangeMax=-1),r){var n=parseInt(t[r].split(",")[0]);e.heigtRangeMax=u$Y(n,-1)}}))},_0x1f65d5.prototype.updateBillboardsBounds=function(e,t,i){if(!e.isOverlapDisplayed)for(var r=this._arrtextOverlapInfo,n=i.camera._positionCartographic.height,o=i.camera.positionWC,a=t.viewProjection,s=t.viewportTransformation,l=t.viewport.width,u=t.viewport.height,c=0,h=r.length;c<h;c++){var d=r[c];d.isInHeightRange(n)?d.isInVisibleRange(o)?(d.calcWindowCoordRect(a,s),d.isInViewport(l,u)?e._scene.layers._allTextOverlap.push(d):d.visible=!1):d.visible=!1:d.visible=!1}};var _0x183511=new e$25;function _0x106e07(e){var t,i,r,n=e._idsColorMap,o=[];if(n.length>0)for(t=0,i=n.length;t<i;t++)(r=n.values[t]).dirty&&(r.dirty=!1,o=r.color.toBytes(),_0x183511.x=o[0],_0x183511.y=o[1],_0x183511.z=o[2],_0x183511.w=o[3],e$28(r.batchId)?e._batchTable.setBatchedAttribute(r.batchId,0,_0x183511):Array.isArray(r.instanceIds)&&r.instanceIds.map((function(t){e._batchTable.setBatchedAttribute(t,0,_0x183511)})));var a=e._idsTranslateMap;if(a.length>0)for(var s in a._hash)(r=a._hash[s]).dirty&&(r.dirty=!1,e$28(r.batchId)?e._batchTable.setBatchedAttribute(r.batchId,3,r.translate):Array.isArray(r.instanceIds)&&r.instanceIds.map((function(t){e._batchTable.setBatchedAttribute(t,3,r.translate)})),t$X.equals(r.translate,t$X.ZERO)&&a.remove(s));var l=e._idsPBRIndexMap;if(l.length>0)for(t=0,i=l.length;t<i;t++)(r=l.values[t]).dirty&&(r.dirty=!1,e$28(r.batchId)?e._batchTable.setBatchedAttribute(r.batchId,4,r.pbrMaterialIndex):Array.isArray(r.instanceIds)&&r.instanceIds.map((function(t){e._batchTable.setBatchedAttribute(t,4,r.pbrMaterialIndex)})));var u=e._idsOperationMap;if(u.length>0)for(t=0,i=u.length;t<i;t++)if((r=u.values[t]).dirty)if(r.dirty=!1,e._isInstanceModel){if(r.skeletonId>-1){var c=r.instanceIds[0]*e.skeletonCount+r.skeletonId;e._batchTable.setBatchedAttribute(c,1,r.operationValue)}}else e._instanceCount>0?Array.isArray(r.instanceIds)&&r.instanceIds.map((function(t){e._batchTable.setBatchedAttribute(t,1,r.operationValue)})):e$28(r.batchId)&&e._batchTable.setBatchedAttribute(r.batchId,1,r.operationValue)}function _0x4d34f7(e,t){var i=[];i.push({functionName:"czm_batchTable_color",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"czm_batchTable_operation",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4},{functionName:"czm_batchTable_pickColor",componentDatatype:S$W.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"czm_batchTable_translate",componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!0},{functionName:"czm_batchTable_pbrMaterialIndex",componentDatatype:S$W.FLOAT,componentsPerAttribute:3,normalize:!0});var r=t._pickInfo,n=Object.keys(r),o=new x$Q(e,i,t._isInstanceModel?t._instanceCount*t.skeletonCount:t._instanceCount>0?t._instanceCount:n.length);t._batchTable=o}function _0x18fa4d(e,t,i){var r=t._batchTable,n=t._selectionInforMap,o=t._selectionInforMap._hash;for(var a in o)if(o.hasOwnProperty(a)){var s=n.get(a);if(t._isInstanceModel){var l=s.instanceIds[0],u=Object.keys(s.skeletonIds).length;for(var c in s.skeletonIds)if(s.skeletonIds.hasOwnProperty(c)){var h=l*u+Number(c),d=(f=e.createPickId({primitive:i,id:a,skeletonId:Number(c)})).color;_0x183511.x=e$1S.floatToByte(d.red),_0x183511.y=e$1S.floatToByte(d.green),_0x183511.z=e$1S.floatToByte(d.blue),_0x183511.w=e$1S.floatToByte(d.alpha),r.setBatchedAttribute(h,2,_0x183511)}}else{var f;e$28(f=i._pickObjs[a])||(f=e.createPickId({primitive:i,id:a}),i._pickObjs[a]=f);d=f.color;if(_0x183511.x=e$1S.floatToByte(d.red),_0x183511.y=e$1S.floatToByte(d.green),_0x183511.z=e$1S.floatToByte(d.blue),_0x183511.w=e$1S.floatToByte(d.alpha),t._instanceCount>0){s.instanceIds.map((function(e){r.setBatchedAttribute(e,2,_0x183511)}))}else{var p=s.batchId;r.setBatchedAttribute(p,2,_0x183511)}}}}function _0x280918(e,t){for(var i=e.position.values,r=e.position.componentsPerAttribute,n=i.length/r,o=new Float32Array(3*n),a=0;a<n;a++){var s=new t$X(i[a*r],i[a*r+1],i[a*r+2]),l=t$W.fromCartesian(s),u=e$27.toDegrees(l.longitude),c=e$27.toDegrees(l.latitude),h=l.height,d=(u-t.left)/t.width,f=(c-t.bottom)/t.length,p=(h-t.minHeight)/t.height;o[3*a]=d,o[3*a+1]=f,o[3*a+2]=p}e.aRatio=new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:o})}_0x1f65d5.prototype.updateBatchTable=function(e,t,i){_0x106e07(this),this._batchTable.update(e),this._updateBatchTable=!1},_0x1f65d5.prototype.transformResource=function(e,t){this.initialize(),this.createResources(e,t)&&this._bufferPrepared&&e$28(this._sp)&&(this.createAllCommands(e,t),this.createNormalAndDepthCommand(t),this.createPostEffectCommand(t),this.createClampColorCommand(t),this.createTransparentCommand(t),(t._fileType===f$r.ClampGroundPolygon||t._fileType===f$r.ClampObjectPolygon||t._fileType===f$r.ClampGroundLine||t._fileType===f$r.ExtendClampPolygonCache)&&this.cloneSelectCommand(t))},_0x1f65d5.prototype.createLazyCommand=function(e,t){if(this._bufferPrepared&&(this.createPickRectCommand(t),t.LoadingPriority===U$p.UsePagedLodInfo&&t._hasMixedContent&&e.context.stencilBuffer)){var i=this._colorCommand;if(!e$28(i))return;var r=i.derivedCommands;if(e$28(r)||(r=i.derivedCommands={}),!this.ownerPagelod._finalResolution&&e$28(this._clipBounds)&&this._clipBounds.length>0){r.zback={};for(var n=0;n<this._clipBounds.length;n++){var o=this._clipBounds[n].name,a=this._clipBounds[n].orientedBoundingBox;e$28(a.zback)||(a.zback=a._createDeriveZBackfaceCommand(e.context),a.zback._boundingSphere=this._clipBounds[n].boundingSphere),r.zback[o]=a.zback,t._backfaceCommands.push(a.zback)}}!this.ownerPagelod._finalResolution&&e$28(this._clipBounds)&&this._clipBounds.length>0?r.stencil=_0x38fa12(i):r.stencil=i}};var _0x1bb288=new t$X(0,0,0);_0x1f65d5.prototype.setPolygonOffset=function(e){for(var t=this,i=function(){return e$28(t._layer._polygonsTranslate[t._polygonId])?t._layer._polygonsTranslate[t._polygonId]:_0x1bb288},r=function(){return _0x1bb288},n=0;n<this._polygonCommands.length;n++){var o=this._polygonCommands[n];o.uniformMap.uTranslate=i,o.uniformMap.uTranslate=n==e?i:r}},_0x1f65d5.prototype.updatePolygons=function(e,t,i){if(e$28(this._polygons)){this._polygonCommands=[];for(var r=this,n=0;n<this._polygons.length;n++)!function(){var t=U$Q.createGeometry(r._polygons[n]);e$28(r._volObj)&&_0x280918(t.attributes,r._volObj.volBounds);for(var o=new e$25,a=new e$25,s=y$15.inverse(r._matModel,new y$15),l=t.attributes.position.values.length/t.attributes.position.componentsPerAttribute,u=0;u<l;u++)o.x=t.attributes.position.values[3*u],o.y=t.attributes.position.values[3*u+1],o.z=t.attributes.position.values[3*u+2],o.w=1,y$15.multiplyByVector(s,o,a),t.attributes.position.values[3*u]=a.x,t.attributes.position.values[3*u+1]=a.y,t.attributes.position.values[3*u+2]=a.z;var c=new r$15({primitiveType:t.primitiveType,modelMatrix:r._matModel,boundingVolume:t.boundingSphere,pass:Le$p.S3MTiles,cull:!0}),h=r._polygonId+"_"+n,d=e.createPickId({primitive:r,id:h}).color;c.pickId="vSecondColor";c.uniformMap=l$1e(r._uniformMap),e$28(c.uniformMap)&&(c.uniformMap.uSecondColor=function(){return d},c.uniformMap.uTranslate=function(){return _0x1bb288}),c.vertexArray=m$19.fromGeometry({context:e,geometry:t,attributeLocations:{aPosition:0,aTexCoord0:1,aNormal:2,aRatio:3},bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var f=["attribute vec4 aPosition;","attribute vec3 aRatio;","uniform vec4 uSecondColor;","uniform vec3 uTranslate;","varying vec4 vSecondColor;","varying vec3 vecRotioCoord;","varying vec2 vecHypTexCoord;","varying vec4 vPositionMC;","void main()","{"," vPositionMC.xyz = aPosition.xyz;"," vPositionMC.w = 0.0;"," vSecondColor = uSecondColor;"," vecRotioCoord = aRatio;"," vec4 pos = aPosition;"," pos.xyz += uTranslate;"," gl_Position = czm_modelViewProjection * pos;","}"].join("\n"),p=["#extension GL_EXT_shader_texture_lod : enable","#extension GL_OES_standard_derivatives : enable","varying vec4 vSecondColor;","varying vec4 vPositionMC;","vec4 LinearTosRGB( in vec4 value )","{"," return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );","}","void main()","{"," gl_FragColor = czm_getHypsometricColor(vec4(1.0,1.0,1.0,1.0), 0.0);"," gl_FragColor *= czm_computeLightColorInFP(vPositionMC.xyz, vPositionMC.w, vec3(0.0,0.0,0.0));"," gl_FragColor = LinearTosRGB(gl_FragColor);","}"].join("\n"),_=new a$$({sources:[f]}),m=new a$$({sources:[p]});_.defines.push("Volume"),m.defines.push("Volume"),_.defines.push("HYPSOMETRIC"),m.defines.push("HYPSOMETRIC"),m.defines.push(H$r.DIR_LIGHTS+0),m.defines.push(H$r.POINT_LIGHTS+0),m.defines.push(H$r.SPOT_LIGHTS+0),m.defines.push(H$r.HEMISPHERE_LIGHTS+0),c.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:{aPosition:0,aTexCoord0:1,aNormal:2,aRatio:3}}),c.renderState=i._rsColor,r._polygonCommands.push(c)}();this._polygons=void 0}if(this._polygonCommands.length>0){var o={};o[this._polygonId]=4,this.updateObjsOperation(o)}for(n=0;n<this._polygonCommands.length;n++)t.push(this._polygonCommands[n])},_0x1f65d5.prototype.updateVertexWeight=function(){if(this._bMultiTemporalWeight&&e$28(this._layer._temporalSetting)){var e=this._layer._temporalSetting;if(!(this._fMultiTemporalPercentage===e.progress&&e.location<0)){var t=this._vertexWeightBuffers,i=t.length,r=this._colorCommand;if(this._nSpecificTemporalPos!==e.location){var n=t[e$27.clamp(0,e.location,i-1)],o=0*(c=r.vertexArray.getAttribute(this._attributeLocations.aVertexWeight)).strideInBytes+c.offsetInBytes;return c.vertexBuffer.copyFromArrayView(n,o),this._fMultiTemporalFactor=0,void(this._nSpecificTemporalPos=e.location)}if(this._nSpecificTemporalPos>-1)return;this._fMultiTemporalPercentage=e.progress;var a=this._fMultiTemporalPercentage;if(!(a>1)){var s=a*i,l=Math.floor(s);a=s-(l=e$27.clamp(0,l,i-1)),this._fMultiTemporalFactor=e$27.clamp(0,a,1);var u=Math.ceil(s);if(u=e$27.clamp(0,u,i-1),this._nFirstMultiTemporalPos!==l){n=t[l],o=0*(c=r.vertexArray.getAttribute(this._attributeLocations.aVertexWeight)).strideInBytes+c.offsetInBytes;c.vertexBuffer.copyFromArrayView(n,o),this._nFirstMultiTemporalPos=l}if(this._nSecondMultiTemporalPos!==u){var c;n=t[u],o=0*(c=r.vertexArray.getAttribute(this._attributeLocations.aVertexWeight_1)).strideInBytes+c.offsetInBytes;c.vertexBuffer.copyFromArrayView(n,o),this._nSecondMultiTemporalPos=u}}}}};var _0x564143=new y$15;_0x1f65d5.prototype.update=function(e,t,i,r){if(this.transformResource(t,r),this.createLazyCommand(t,r),this._bufferPrepared&&this.createPickRectCommand(r),r._fileType===f$r.PointCloudFile&&e$28(r._pointCloudLayerVisible))if(e$28(this._ptIndexGroup)){for(var n in this._ptIndexGroup)if(this._ptIndexGroup.hasOwnProperty(n)&&r._pointCloudLayerVisible[r._pointCloudLayerNames[n]]){this.pushCommands(t,i,r);break}}else e$28(this._groupName)&&r._pointCloudLayerVisible[this._groupName]&&this.pushCommands(t,i,r);else this.pushCommands(t,i,r);r._fileType===f$r.PointCloudFile&&e$28(this._colorCommand)&&(r._pointCloudShading.renderMode==_0x5a7173.VOXEL?this._colorCommand.renderState=u$R.fromCache({depthTest:{enabled:!1}}):(r._pointCloudShading.eyeDomeLighting||r._pointCloudShading.performance)&&(this._colorCommand.renderState=u$R.fromCache({depthTest:{enabled:!0}}))),(r._fileType===f$r.Text||r._fileType===f$r.IconPoint)&&this.updateBillboardsBounds(r,e.uniformState,t),this._layer._showLabel&&this.updateLabels(t),this._updateBatchTable&&this._ids.length>0&&this.updateBatchTable(t,t.context,r),this.updatePolygons(e,i,r),e$28(t.specularEnvironmentMaps)&&(_0x564143=y$15.multiply(r._context.uniformState.view3D,this._matModel,_0x564143),this._iblReferenceFrameMatrix=y$15.getMatrix3(_0x564143,this._iblReferenceFrameMatrix),this._iblReferenceFrameMatrix=p$1a.getRotation(this._iblReferenceFrameMatrix,this._iblReferenceFrameMatrix),this._iblReferenceFrameMatrix=p$1a.transpose(this._iblReferenceFrameMatrix,this._iblReferenceFrameMatrix)),this.updateVertexWeight()};var _0x522ed8=new _0x43ddbc;function _0x40ab67(e,t,i){for(var r=i._shaderProgramToCreate;r.length&&(r.peek(),_0x522ed8.set(e,t,i),e.jobScheduler.execute(_0x522ed8,i$B.PROGRAM));)r.dequeue()}function _0x578d9a(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!e$28(i)){var r=t.fragmentShaderSource.clone();r.defines=e$28(r.defines)?r.defines.slice(0):[],r.defines.push("POLYGON_OFFSET"),r.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:t._attributeLocations})}return i}function _0x38fa12(e){var t=r$15.shallowClone(e),i=l$1e(t.renderState,!0);return i.cull.enabled=!0,i.stencilTest.enabled=!0,i.stencilTest.mask=Fa$6.SKIP_LOD_MASK,i.stencilTest.reference=Fa$6.SKIP_LOD_MASK,i.stencilTest.frontFunction=m$12.EQUAL,i.stencilTest.frontOperation={fail:n$12.REPLACE,zFail:n$12.REPLACE,zPass:n$12.REPLACE},i.stencilMask=Fa$6.S3M_TILE,t.renderState=u$R.fromCache(i),t.pass=Le$p.S3MTilesClampObjectColor,t}function _0x194705(e,t){var i=e._selections,r=e._objsColorList,n=e._objsOnlyVisibleList,o=new e$1P;for(var a in e$1P.clone(r,o),n._hash)if(n._hash.hasOwnProperty(a)){var s=n.get(a),l=u$Y(o.get(a),new e$1S),u=e$1S.multiply(l,s,new e$1S);o.set(a,u)}for(var a in i._hash)if(i._hash.hasOwnProperty(a)){var c=i._hash[a],h=(l=u$Y(o.get(a),new e$1S),e$1S.multiply(c,l,new e$1S));o.set(a,h)}o.length>0&&t.updateObjsColor(o,e.selectColorType,!0)}function _0x1a4bf3(e,t){var i=e._selections,r=e._objsColorList,n=e._objsOnlyVisibleList,o=new e$1P,a=e$1P.clone(n);for(var s in r._hash)if(r._hash.hasOwnProperty(s)){var l=r._hash[s];e$1S.equals(e$1S.WHITE,l)?a.set(s,l):o.set(s,l)}for(var s in i._hash)if(i._hash.hasOwnProperty(s)){l=i._hash[s];e$1S.equals(e$1S.WHITE,l)?a.set(s,l):o.set(s,l)}for(var s in o._hash)if(o._hash.hasOwnProperty(s)&&n.contains(s)){var u=o.get(s),c=(l=n.get(s),e$1S.multiply(u,l,new e$1S));o.set(s,c),a.remove(s)}a.length>0&&t.updateObjsColor(a,Ya$1.MIX,!0),o.length>0&&t.updateObjsColor(o,Ya$1.REPLACE,!0)}function _0x3f41e3(e,t){var i=e._selections,r=e._objsColorList,n=e._objsOnlyVisibleList,o=new e$1P;for(var a in e$1P.clone(r,o),n._hash)if(n._hash.hasOwnProperty(a)){var s=n.get(a),l=u$Y(o.get(a),new e$1S),u=e$1S.multiply(l,s,new e$1S);o.set(a,u)}o.length>0&&t.updateObjsColor(o,Ya$1.MIX,!0),i.length>0&&t.updateObjsColor(i,e.selectColorType,!0)}function _0x3509a6(e,t,i){var r=t._pickInfo,n=[];for(var o in r)if(r.hasOwnProperty(o)&&"0"!==o){var a=new _0x1875be(t,o);Object.assign(a,i[o]),a.id=o,a.batchId=r[o].batchId,a.instanceIds=r[o].instanceIds,n.push(a)}return n}_0x1f65d5.prototype.createResources=function(e,t){var i=this._bufferPrepared;return this._bufferPrepared||_0x4ce354(this,e,t,t._context),e$28(this._sp)||_0x40ab67(e,t,this),_0x46ed22(this,e,t),t._fileType===f$r.ClampGroundRealtimeRasterCache?this._bufferPrepared:i&this._bufferPrepared},_0x1f65d5.prototype.pushClampCommands=function(e,t,i){var r=this._colorCommand;e$28(this._clampSelected)&&this._clampSelected?(i._fileType===f$r.ClampGroundPolygon||i._fileType===f$r.ClampGroundLine?(r.pass=Le$p.GLOBE+1,this._stencilCommand.pass=Le$p.GLOBE+1,e$28(this._selectedStencilCommand)&&e$28(this._selectedColorCommand)&&(this._selectedStencilCommand.pass=Le$p.GLOBE+1,this._selectedColorCommand.pass=Le$p.GLOBE+1)):i._fileType===f$r.ClampObjectPolygon&&(r.pass=Le$p.ClampObject,this._stencilCommand.pass=Le$p.ClampObject,e$28(this._selectedStencilCommand)&&e$28(this._selectedColorCommand)&&(this._selectedStencilCommand.pass=Le$p.ClampObject,this._selectedColorCommand.pass=Le$p.ClampObject)),t.push(this._stencilCommand),t.push(r),e$28(this._selectedStencilCommand)&&e$28(this._selectedColorCommand)&&(t.push(this._selectedStencilCommand),t.push(this._selectedColorCommand))):(i._fileType===f$r.ClampGroundPolygon||i._fileType===f$r.ClampGroundLine?(r.pass=Le$p.GLOBE+1,this._stencilCommand.pass=Le$p.GLOBE+1):i._fileType===f$r.ClampObjectPolygon&&(r.pass=Le$p.ClampObject,this._stencilCommand.pass=Le$p.ClampObject),t.push(this._stencilCommand),t.push(r))},_0x1f65d5.prototype.isTransparent=function(e){return e._style3D.fillForeColor.alpha<e.maxTransparentAlpha&&e._pointCloudShading.renderMode!==_0x5a7173.VOXEL&&e.orderIndependentTranslucency},_0x1f65d5.prototype.pushCommandsForNormalAndDepthFrameBuffer=function(e,t){!e$28(this._normalAndDepthCommand)||(e.isSilhouette()?e$28(this._hasSilhouette)&&this._hasSilhouette&&t.push(this._normalAndDepthCommand):t.push(this._normalAndDepthCommand))},_0x1f65d5.prototype.pushCommandsForPostEffectFrameBuffer=function(e,t){!e.bloomEnable||!e$28(this._postEffectCommand)||(e.bloomEnable&&e$28(this._postEffectCommand)||this._hasBloomOperation)&&t.push(this._postEffectCommand)},_0x1f65d5.prototype.pushCommandsForClampFrameBuffer=function(e,t){!this._intersectWithClipPlane||!e$28(this._clampColorCommand)||(t.push(this._clipStencilCommand),t.push(this._clampColorCommand))},_0x1f65d5.prototype.pushCommandsForFrameBuffer=function(e,t,i,r){t==L$T.NORMAL_AND_DEPTH?this.pushCommandsForNormalAndDepthFrameBuffer(e,i):t==L$T.POSTEFFECT_FILTER?this.pushCommandsForPostEffectFrameBuffer(e,i):t==L$T.CLAMP?this.pushCommandsForClampFrameBuffer(e,i):t==L$T.PICKRECT?this.pushCommandsForPickRectBuffer(e,i):t==L$T.SQRESULT?this.pushCommandsForSpatialQueryBuffer(e,i):t==L$T.RASTER&&this.pushCommandsForRasterHeightMap(r,e,i)},_0x1f65d5.prototype.isNeedRasterized=function(e){for(var t in e){if(!e$28(this._layerImagerys[t])||this._layerImagerys[t].length!=e[t].length)return!0;for(var i=0;i<e[t].length;i++)if(this._layerImagerys[t][i].level!=e[t][i].level||this._layerImagerys[t][i].x!=e[t][i].x||this._layerImagerys[t][i].y!=e[t][i].y)return!0}return!1},_0x1f65d5.prototype.pushCommands=function(e,t,i){if(e$28(this._colorCommand)){if(e$28(i._imageryLayer)&&e$28(this._cartographic)&&e$28(this._imagerys)&&!this._imageRasterFinish&&this.updateImageryTexture(i,e),e$28(this._dayTextureAlpha)&&e$28(this._imagerys))for(var r=0;r<this._imagerys.length;r++){var n=this._imagerys[r].imageryLayer;this._dayTextureAlpha[r]=n.alpha}if(e.passes.pick&&e$28(this._stencilCommand))return t.push(this._stencilCommand),void(this._pickCommand&&t.push(this._pickCommand));if(i._spatialClipEnable)return e$28(this._clipCommand)||this.createSpatialClipCommand(e,i),void t.push(this._clipCommand);if(!e.passes.depth||i._fileType!==f$r.IconPoint&&i._fileType!==f$r.Text){var o=e._fboState.frameBufferType;if(e$28(o)&&(o===L$T.NORMAL_AND_DEPTH||o===L$T.POSTEFFECT_FILTER||o===L$T.CLAMP||o===L$T.PICKRECT||o===L$T.SQRESULT||o===L$T.RASTER&&(4&e.useType)>0))return void this.pushCommandsForFrameBuffer(i,o,t,e);if(i._style3D.fillStyle!==yt$3.WireFrame||i._fileType===f$r.ClampGroundPolygon){this._colorCommand.renderState=i._rsColor;var a=i.LoadingPriority===U$p.UsePagedLodInfo&&i._hasMixedContent&&e.context.stencilBuffer,s=a?this._colorCommand.derivedCommands.stencil:this._colorCommand,l=Le$p.S3MTiles,u=this._mapPass,c=!1;if(e$28(this.materialPass)&&this.materialPass._alphaMode===_0x9df4c2.BLEND&&!e$28(i.waterEffectSet))c=!0;else if(i._isTransparencyOptimization){for(var h in u)if(u[h]._bTransparentSorting){c=!0;break}}else for(var h in u)if(u[h]._bTransparentSorting){l+=1;break}if(this._isSelected&&i.selectedColor.alpha<1&&(c=!0),!(e.passes.pick&&i._scene.pickPointEnabled)&&(this.isTransparent(i)||c)&&(i.partlyTransparent?t.push(this._transparentCommand):l=i.orderIndependentTranslucency?Le$p.TRANSLUCENT:l),i._fileType===f$r.IconPoint||i._fileType===f$r.Text?l=Le$p.Label_Billboard:i._pointCloudShading.renderMode==_0x5a7173.VOXEL&&(l=Le$p.Voxel_Billboard),e$28(this._stencilCommand))this.pushClampCommands(e,t,i);else if(this.oriPassGroup!==Le$p.OVERLAY&&(s.pass=i.receiveObjectClamp?l:Le$p.NonClampObject,s.pass+=this._passIncrement),e$28(this.ownerPagelod)&&!this.ownerPagelod._finalResolution&&a&&(s.pass+=1),i._fileType===f$r.ClampGroundRealtimeRasterCache)e$28(this._level)&&(s._globeIndex={level:this._level,row:this._row,col:this._col}),e$28(s)&&this._updateBatchTable&&this._ids.length>0&&this.updateBatchTable(e,e.context,i),s&&e.commandListRealtimeRaster.push(s);else if(this._plusRoArray.length>0){for(var d=this._plusRoArray.length-1;d>=0&&!e$28(this._plusRoArray[d]);)d--;var f=this._plusRoArray[d];for(r=0;r<f.length;r++)t.push(f[r].command)}else s&&t.push(s)}i._style3D.fillStyle!==yt$3.Fill?i.wireFrameMode===_0x255091.EffectOutline||i.wireFrameMode===_0x255091.Sketch?(e$28(this._regularEdgeCommand)&&(t.push(this._regularEdgeCommand),i._addRenderedEdge(this._regularEdgeCommand.edgeTotalLength,this._regularEdgeCommand.edgeCount)),e$28(this._silhouetteEdgeCommand)&&(t.push(this._silhouetteEdgeCommand),i._addRenderedEdge(this._silhouetteEdgeCommand.edgeTotalLength,this._silhouetteEdgeCommand.edgeCount))):i.wireFrameMode===_0x255091.Quad?e$28(this._wireFrameCommands.quad)&&t.push(this._wireFrameCommands.quad):i.wireFrameMode===_0x255091.Triangle&&e$28(this._wireFrameCommands.triangle)&&t.push(this._wireFrameCommands.triangle):e$28(this._regularEdgeCommand)&&this._isSelected&&i._selectColorType===Ya$1.WIREFRAME&&(t.push(this._regularEdgeCommand),i._addRenderedEdge(this._regularEdgeCommand.edgeTotalLength,this._regularEdgeCommand.edgeCount)),i.showCallout&&this._lineCalloutCommand&&t.push(this._lineCalloutCommand),this._rasterized||i._fileType===f$r.ClampGroundRealtimeRasterCache&&this.refreshRaster(e),this._rasterized=!0}}};var _0x229939=new e$1S;function _0x47329e(e,t,i){var r=e.themeStyle;if(e$28(r)){if(!e$28(r.color)&&e$28(r.pbrMaterialIndex)){e$28(t._featureArray)||(t._featureArray=_0x3509a6(e,t,i));for(var n=t._featureArray,o=0;o<n.length;o++){var a=n[o];Object.assign(a,i[a.id]);var s=r.pbrMaterialIndex.evaluate(a);e$28(s)||(s=-1),t._idsPBRIndexMap.set(a.id,{batchId:a.batchId,instanceIds:a.instanceIds,pbrMaterialIndex:s,dirty:!0})}t._updateBatchTable=!0}e$28(t._featureArray)||(t._featureArray=_0x3509a6(e,t,i));for(n=t._featureArray,o=0;o<n.length;o++){a=n[o];Object.assign(a,i[a.id]);var l=void 0;e$28(r.color)&&(l=r.color.evaluateColor(a,_0x229939));var u=void 0;e$28(r.show)&&(u=r.show.evaluate(a));var c=t._idsOperationMap.get(a.id);if(e$28(c)||(c={batchId:a.batchId,instanceIds:a.instanceIds,skeletonId:-1,operationValue:new e$25,dirty:!0},t._idsOperationMap.set(a.id,c)),e$28(l)&&(t._idsColorMap.set(a.id,{batchId:a.batchId,instanceIds:a.instanceIds,color:e$1S.clone(l),dirty:!0}),c.operationValue.x=c.operationValue.x|_0xfef200.SetColor,c.dirty=!0),e$28(u)){if(u){var h=_0xfef200.ALL^_0xfef200.HIDE;c.operationValue.x&=h}else c.operationValue.x=1&c.operationValue.x|_0xfef200.HIDE;c.dirty=!0}}t._updateBatchTable=!0}}function _0x4ce354(e,t,i,r){_0x14fe1f(e,t,r),_0x311b21(e,t,i,r),0===e._vertexBufferToCreate.length&&0===e._indexBufferToCreate.length&&(e._bufferPrepared=!0,e._instanceBuffer=void 0)}_0x1f65d5.prototype.initLayerSetting=function(e){if(this._isClamp=_0x45b8e1(e,this),e$28(e.waterEffectSet)){var t={boundingVolume:this._boundingVolume,distance:e.height+e.style3D.bottomAltitude+e.waterEffectSet[0].averageHeight};this._waterIndex=e.addWaterPlane(t)}e.allObjsHide&&this.updateAllObjsVisible(e,!e.allObjsHide),Object.keys(e._objsOperationList).length>0&&this.updateObjsOperation(e._objsOperationList);let i=this._entity.root._attributes;e.themeStyle&&Object.keys(i).length>0&&_0x47329e(e,this,i),Object.keys(e._objsColorList).length>0&&this.updateObjsColor(e._objsColorList),Object.keys(e._objsOffsetList).length>0&&this.updateObjsTranslate(e._objsOffsetList)},_0x1f65d5.prototype.initLayerSettingBak=function(e){if(this._isClamp=_0x45b8e1(e,this),e$28(e.waterEffectSet)){var t={boundingVolume:this._boundingVolume,distance:e.height+e.style3D.bottomAltitude+e.waterEffectSet[0].averageHeight};this._waterIndex=e.addWaterPlane(t)}if(e.allObjsHide&&this.updateAllObjsVisible(!e.allObjsHide),e.selectColorType===Ya$1.REPLACE?_0x1a4bf3(e,this):e.selectColorType===Ya$1.MIX?_0x194705(e,this):(this.updateObjsColor(e._selections,e.selectColorType,!0),_0x3f41e3(e,this)),e._objsVisibleList.length>0&&this.updateObjsVisible(e._objsVisibleList,e._objsVisibleList.values[0]),e$28(e._objsHeightList)&&e._objsHeightList.length>0&&this.updateExtendHeight(e._objsHeightList),Object.keys(e._objsOperationList).length>0){var i=Math.max(Math.abs(e.selectedTranslate.x),Math.abs(e.selectedTranslate.y),Math.abs(e.selectedTranslate.z));this.updateObjsOperation(e._objsOperationList,i)}},_0x1f65d5.prototype.createAllCommands=function(e,t){e$28(this._colorCommand)||(e$28(t.waterEffectSet)?this.createWater(t):this.createCommand(e,t),this.initLayerSetting(t))};var _0x4d6115=new _0x144583,_0x4679bc=new _0x524a34;function _0x14fe1f(e,t,i){for(var r=e._vertexBufferToCreate;r.length;){var n=r.peek();if(_0x4d6115.set(i,e,n),!t.jobScheduler.execute(_0x4d6115,i$B.BUFFER))break;r.dequeue()}}function _0x311b21(e,t,i,r){for(var n=e._vertexPackage.verticesCount,o=e._indexBufferToCreate;o.length;){var a=o.peek();if(_0x4679bc.set(r,e,a,n),!t.jobScheduler.execute(_0x4679bc,i$B.BUFFER))break;o.dequeue()}}var _0x1d47d9=new _0x5650c2;function _0x46ed22(e,t,i){if(i._isS3MBlock){for(var r in e._mapPass)if(e._mapPass.hasOwnProperty(r)){(l=e._mapPass[r]).initTexture(),l.initBakeTexture(),l.requestSubTextures(t,t.context,i,e._subTexturesToUpload),l.requestBakeSubTextures(t,t.context,i,e._subTexturesToUpload)}for(var n=e._subTexturesToUpload;n.length;){var o=n.peek(),a=o.texture,s=o.subTextureInfo;if(_0x1d47d9.set(t.context,e,a,s,i._textureLod),!t.jobScheduler.execute(_0x1d47d9,i$B.TEXTURE))break;n.dequeue()}if(0===n.length)for(var r in e._mapPass)if(e._mapPass.hasOwnProperty(r)){var l;(l=e._mapPass[r]).enableTextureRenderable(),l.enableBakeTextureRenderable()}}}function _0x12fc4f(e){var t=e._fileType;return e.shadowType!=_0x121e29.NONE&&(t===f$r.OSGBFile||t===f$r.OSGBCacheFile||t===f$r.PointCloudFile)}function _0x45b8e1(e,t){var i=e._fileType,r=i==f$r.ClampGroundPolygon||i==f$r.ClampObjectPolygon||i==f$r.ExtendClampPolygonCache||i==f$r.ClampGroundLine||i==f$r.ClampObjectLine;return t._clampRegionEdge&&(r=!1),r}_0x1f65d5.prototype.createWater=function(e){var t=e._context,i=this._vertexPackage,r=i.vertexAttributes;this._instanceCount=i.instanceCount,this._instanceMode=i.instanceMode,this._attributeLocations=i.attrLocation;var n=Le$p.S3MTiles,o=this._arrIndexPackage[0];if(e$28(o)){var a=this._mapPass[o.materialCode],s=W$_.TRIANGLES;switch(o.primitiveType){case 1:s=W$_.POINTS;break;case 2:s=W$_.LINES;break;case 4:s=W$_.TRIANGLES}var l=new r$15({primitiveType:s,modelMatrix:this._matModel,boundingVolume:this._boundingVolume,pass:n,count:o.indicesCount,cull:!0});e$28(e._waterUniformBuffer)&&l.addUniformBuffer(e._waterUniformBuffer),l.pickId="vSecondColor",l.vertexArray=new m$19({context:t,attributes:r,indexBuffer:o.indexBuffer}),this.materialPass=a,l.shaderProgram=this._sp,l.renderState=e._rsColor,l.castShadows=!1,l.receiveShadows=!1,l.selectCastShadows=!1,this._uniformMap={},_0x20b1b5.create(e._frameState,e,this,this._uniformMap),l.uniformMap=this._uniformMap,this._colorCommand=l}this._vertexPackage=null,this._arrIndexPackage.length=0},_0x1f65d5.prototype.createWireframeIndexBuffer=function(e){var t,i,r;if(e$28(t=this._arrIndexPackage[0])&&e$28(t.indicesTypedArray)){i={indices:0===t.indexType?new Uint16Array(t.indicesTypedArray.buffer,t.indicesTypedArray.byteOffset,t.indicesCount):new Uint32Array(t.indicesTypedArray),primitiveType:W$_.TRIANGLES},k$Z.toWireframe(i),r=i.indices;var n=ce$v.UNSIGNED_SHORT;return this._vertexPackage.verticesCount>e$27.SIXTY_FOUR_KILOBYTES?(n=ce$v.UNSIGNED_INT,r=new Uint32Array(r)):r=new Uint16Array(r),h$W.createIndexBuffer({context:e,typedArray:r,usage:A$1c.STATIC_DRAW,indexDatatype:n})}},_0x1f65d5.prototype.createStencilCommandForClampLayer=function(e,t){var i=void 0;(i=r$15.shallowClone(e)).renderState=t,this._stencilCommand=i},_0x1f65d5.prototype.createClampColorCommand=function(e){e._context;var t=this._colorCommand;if(e$28(t)&&e.isRenderClipSection()&&!e$28(this._clampColorCommand)){this._intersectWithClipPlane=this.isIntersectWithClipPlane(e);var i=r$15.shallowClone(t);i.renderState=e._rsClampColor,this._clampColorCommand=i;var r=r$15.shallowClone(t);r.renderState=e._rsStencil,this._clipStencilCommand=r}};var _0x572e22=new h$10;_0x1f65d5.prototype.refreshRasterTile=function(e,t){var i=e._rectangle;e$28(h$10.intersection(t,i,_0x572e22))&&(e._rasterized=!1),e$28(e._southwestChild)&&this.refreshRasterTile(e._southwestChild,t),e$28(e._southeastChild)&&this.refreshRasterTile(e._southeastChild,t),e$28(e._northwestChild)&&this.refreshRasterTile(e._northwestChild,t),e$28(e._northeastChild)&&this.refreshRasterTile(e._northeastChild,t)},_0x1f65d5.prototype.refreshRasterTile2=function(e,t,i,r){var n=!1;if(e._level>=t){var o=Math.pow(2,e._level-t),a=Math.floor(e.y/o),s=Math.floor(e.x/o);a===i&&s===r&&(n=!0)}else{o=Math.pow(2,t-e._level),a=Math.floor(i/o),s=Math.floor(r/o);a===e.y&&s===e.x&&(n=!0)}n&&(e._rasterized=!1,e$28(e._southwestChild)&&this.refreshRasterTile2(e._southwestChild,t,i,r),e$28(e._southeastChild)&&this.refreshRasterTile2(e._southeastChild,t,i,r),e$28(e._northwestChild)&&this.refreshRasterTile2(e._northwestChild,t,i,r),e$28(e._northeastChild)&&this.refreshRasterTile2(e._northeastChild,t,i,r))},_0x1f65d5.prototype.refreshRaster=function(e,t){if(this._layer._fileType===f$r.ClampGroundRealtimeRasterCache)if(e$28(this._level)&&!e$28(t))this.refreshRasterTile2(e._quadtree._levelZeroTiles[0],this._level,this._row,this._col),this.refreshRasterTile2(e._quadtree._levelZeroTiles[1],this._level,this._row,this._col);else if(e$28(e._quadtree._levelZeroTiles)){var i=new h$10(this._boundingVolume.center.x-this._boundingVolume.radius,this._boundingVolume.center.y-this._boundingVolume.radius,this._boundingVolume.center.x+this._boundingVolume.radius,this._boundingVolume.center.y+this._boundingVolume.radius);i.west=e$27.toRadians(i.west),i.north=e$27.toRadians(i.north),i.east=e$27.toRadians(i.east),i.south=e$27.toRadians(i.south),this.refreshRasterTile(e._quadtree._levelZeroTiles[0],i),this.refreshRasterTile(e._quadtree._levelZeroTiles[1],i)}},_0x1f65d5.prototype.createSpatialClipCommand=function(e,t){if(!e$28(this._clipCommand)){var i=this._colorCommand,r=i.shaderProgram.vertexShaderSource.clone(),n=i.shaderProgram.fragmentShaderSource.clone();r.defines.push("SQCLIP"),n.defines.push("SQCLIP"),e.useLogDepth&&n.defines.push("LOG_DEPTH");var o=r$15.shallowClone(i);o.uniformMap.uFrontDepthTexture=function(){return t._sqTextures[0]},o.uniformMap.uBackDepthTexture=function(){return t._sqTextures[1]},o.uniformMap.uFrontColorTexture=function(){return t._sqTextures[2]},o.uniformMap.uSQMode=function(){return t._sqMode},o.shaderProgram=S$T.fromCache({context:t._context,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),this._clipCommand=o}},_0x1f65d5.prototype.createCommand=function(e,t){if(e$28(this._sp)){var i=t._context,r=this._vertexPackage,n=r.vertexAttributes;this._instanceCount=r.instanceCount,this._instanceMode=r.instanceMode,this._attributeLocations=r.attrLocation;var o=Le$p.S3MTiles,a=this._clampRegionEdge?t._rsClampLineColor:t._rsColor,s=t._fileType,l=this._arrIndexPackage[0];t._hasWireframe||this._arrIndexPackage.length>1&&(t._hasWireframe=!0);var u,c=_0x34bd01.Default,h=r.verticesCount,d=W$_.POINTS;if(e$28(l))switch(!0===(c=u$Y(this._mapPass[l.materialCode],_0x34bd01.Default))._bTransparentSorting&&(o=Le$p.S3MTiles+1),u=l.indexBuffer,l.primitiveType){case 1:d=W$_.POINTS;break;case 2:d=W$_.LINES;break;case 4:d=W$_.TRIANGLES}else if(e$28(this._ptIndexGroup)){var f,p,_,m,$,g=0;for($ in this._ptIndexGroup)this._ptIndexGroup.hasOwnProperty($)&&(p=t._pointCloudLayerNames[$],t._pointCloudLayerVisible[p]&&(_=this._ptIndexGroup[$].start,g+=(m=this._ptIndexGroup[$].end)-_+1));if(g>0){var v=ce$v.createTypedArray(r.verticesCount,g),y=0;for($ in this._ptIndexGroup)if(this._ptIndexGroup.hasOwnProperty($)&&(p=t._pointCloudLayerNames[$],t._pointCloudLayerVisible[p]))for(_=this._ptIndexGroup[$].start,m=this._ptIndexGroup[$].end,f=_;f<=m;)v[y++]=f++;var x=r.verticesCount>=e$27.SIXTY_FOUR_KILOBYTES&&i.elementIndexUint?ce$v.UNSIGNED_INT:ce$v.UNSIGNED_SHORT;u=h$W.createIndexBuffer({context:i,typedArray:v,usage:A$1c.STATIC_DRAW,indexDatatype:x})}else h=1}this.materialPass=c,this.useWValue=4===n[0].componentsPerAttribute,e$28(this._attributeLocations.aVertexWeight)&&(this.useWValue=1),(1===d||s===f$r.ClampGroundRealtimeRasterCache&&e$28(this._attributeLocations.aTexCoord1))&&(this.useLineColor=!0),this.oriPassGroup=o;var b=new r$15({primitiveType:d,modelMatrix:this._matModel,boundingVolume:this._boundingVolume,pass:o,count:e$28(u)?void 0:h,cull:!0,occlude:!1});this._entity&&this._entity.isFlatten&&(b.cull=!1),b.opaquePass=Le$p.S3MTiles,t._fileType===f$r.ClampGroundRealtimeRasterCache&&(b.layerId=t.id),b.pickId="vSecondColor",s===f$r.PointCloudFile&&(b.pickId="vPosition"),b.instanceCount=this._instanceCount,b.vertexArray=new m$19({context:i,attributes:n,indexBuffer:u}),b.shaderProgram=this._sp,_0x45b8e1(t,this)&&((t._fileType===f$r.ClampGroundPolygon||t._fileType===f$r.ClampObjectPolygon||t._fileType===f$r.ClampGroundLine||t._fileType===f$r.ExtendClampPolygonCache)&&(b.pickId=void 0),this._isClamp=!0),b.renderState=a,this._uniformMap={},_0x20b1b5.create(e,t,this,this._uniformMap),b.uniformMap=this._uniformMap,e$28(t._commonLayerUniformBuffer)&&(b.addUniformBuffer(t._commonLayerUniformBuffer),b.addUniformBuffer(e.lightSource._uniformBuffer),b.addUniformBuffer(_0x3fa369.createMaterialUniformBuffer(t,c)),b.addUniformBuffer(_0x3fa369.createMaterialDynamicUniformBuffer(this,t,c))),_0x45b8e1(t,this)&&this.createStencilCommandForClampLayer(b,t._rsStencil);var w=_0x12fc4f(t);b.castShadows=w,b.receiveShadows=w,b.selectCastShadows=!0,b.owner=this,(s==f$r.IconPoint||s===f$r.Text)&&(b.cull=!1),this._colorCommand=b,this.createWireFrameCommand(t,n),this._createLineCalloutCommand(t),this._vertexPackage=null,this._arrIndexPackage=null}},_0x1f65d5.prototype.createOneEdgeCommand=function(e,t,i,r,n){if(!e$28(i.attributes)||0==i.attributes.length||!e$28(i.instanceCount)||0==i.instanceCount)return null;var o,a,s=Le$p.OPAQUE+1,l=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matModel,boundingVolume:this._boundingVolume,pass:s,owner:this,cull:!0});if(l.vertexArray=new m$19({context:e,attributes:i.attributes,indexBuffer:r}),l.instanceCount=i.instanceCount,n){var u="RegularEdge_"+t.id,c="RegularEdge_"+t.id;o=new a$$({name:u,sources:[_0x31c99f]}),a=new a$$({name:c,sources:[_0x2252ea]})}else{u="SilhouetteEdge_"+t.id,c="SilhouetteEdge_"+t.id;o=new a$$({name:u,sources:[_0x31c99f]}),a=new a$$({name:c,sources:[_0x2252ea]}),o.defines.push("SILHOUETTE"),a.defines.push("SILHOUETTE")}o.defines.push("ANTIALIASING"),a.defines.push("ANTIALIASING"),o.defines.push("POLYGON_OFFSET"),a.defines.push("POLYGON_OFFSET"),t._hasExcavation&&(o.defines.push(H$r.EXCAVATION),a.defines.push(H$r.EXCAVATION)),t._hasServerExcavation&&(o.defines.push("SERVEREXCAVATION"),a.defines.push("SERVEREXCAVATION")),t.swipeEnabled&&a.defines.push(H$r.APPLY_SWIPE),t._clipping&&a.defines.push("CLIP"),t._section&&a.defines.push("CLIPPLANE"),this._batchTable&&o.defines.push("BatchTable"),t._selectColorType===Ya$1.WIREFRAME&&t._style3D.fillStyle===yt$3.Fill&&a.defines.push(H$r.WIREFRAME_SELECT_TYPE);var h=0;t.wireFrameMode===_0x255091.Sketch&&(h=1),o.defines.push("MODE "+h),a.defines.push("MODE "+h),l.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:i.attributeLocations}),l.renderState=u$R.fromCache({depthTest:{enabled:!0,func:Me$l.LESS_OR_EQUAL},cull:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var d={uLineColor:function(){return t.style3D.lineColor},uLineWidth:function(){return t.style3D.lineWidth},uDistanceFalloffFactor:function(){return t._edgeDistanceFalloffFactor},u_polygonOffset:function(){return new o$1k(-5,-5)},uStrokesTexture:function(){return e$28(t._edgeStrokesTexture)||t._initEdgeTexture(),t._edgeStrokesTexture},uStrokesTextureScale:function(){return e$28(t._edgeStrokesTexture)||t._initEdgeTexture(),o$1k.fromElements(1/t._edgeStrokesTexture._width,1/t._edgeStrokesTexture._height)},uStrokesLog2Resolution:function(){return e$28(t._edgeStrokesTexture)||t._initEdgeTexture(),e$27.log2(t._edgeStrokesTexture.width)}};return l.uniformMap=p$17(d,this._colorCommand.uniformMap),l.edgeTotalLength=i.edgeLength,l.edgeCount=i.instanceCount,l.wireframeType=t.wireFrameMode,l},_0x1f65d5.prototype.createEdgeCommands=function(e){if(e$28(this._edgeGeometry)){var t=e._context,i=this._edgeGeometry;_0x5598e9.createRegularEdgeAttributes(t,i.regular),_0x5598e9.createSilhouetteEdgeAttributes(t,i.silhouette);var r=_0x5598e9.createIndexBuffer(t);this._regularEdgeCommand=this.createOneEdgeCommand(t,e,i.regular,r,!0),this._silhouetteEdgeCommand=this.createOneEdgeCommand(t,e,i.silhouette,r,!1),(e$28(this._regularEdgeCommand)||e$28(this._silhouetteEdgeCommand))&&e.wireFrameMode===_0x255091.Quad&&(e.wireFrameMode=_0x255091.EffectOutline)}},_0x1f65d5.prototype.createTrangleWireFrameCommand=function(e,t){if(e$28(this._arrIndexPackage[0])){var i=e._context;this._arrIndexPackage[0].indicesCount;var r=new r$15({primitiveType:W$_.LINES,modelMatrix:this._matModel,boundingVolume:this._boundingVolume,pass:Le$p.OPAQUE+1,owner:this,cull:!0});r.vertexArray=new m$19({context:i,attributes:t,indexBuffer:this._wireFrameIndexBuffers});var n=this._colorCommand.shaderProgram.vertexShaderSource.clone(),o=this._colorCommand.shaderProgram.fragmentShaderSource.clone();o.defines.push("Only_LineColor"),r.shaderProgram=S$T.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),r.renderState=this._colorCommand.renderState,r.uniformMap=p$17(this._colorCommand.uniformMap,{uLineColor:function(){return e.style3D.lineColor}}),this._wireFrameCommands.triangle=r}},_0x1f65d5.prototype.createQuadWireFrameCommand=function(e,t,i){var r=e._context;r.webgl2||!r.depthTexture||r.webglOptions.preserveDrawingBuffer?Le$p.OPAQUE:Le$p.OVERLAY,this._mapPass[i.materialCode]||_0x34bd01.Default;var n=new r$15({primitiveType:2===i.primitiveType?W$_.LINES:W$_.LINE_STRIP,modelMatrix:this._matModel,boundingVolume:this._boundingVolume,pass:Le$p.LOG_DEPTH_OVERLAY,owner:this,cull:!0});n.vertexArray=new m$19({context:r,attributes:t,indexBuffer:i.indexBuffer});var o=this._colorCommand.shaderProgram.vertexShaderSource.clone(),a=this._colorCommand.shaderProgram.fragmentShaderSource.clone(),s=o.defines.indexOf(H$r.SKETCH_MODE);s>0&&o.defines.splice(s,1),(s=o.defines.indexOf(H$r.COMPUTE_W_VALUE))>0&&o.defines.splice(s,1),(s=o.defines.indexOf(H$r.EMISSION_TEXTURE))>0&&o.defines.splice(s,1),(s=a.defines.indexOf(H$r.SKETCH_MODE))>0&&a.defines.splice(s,1),(s=a.defines.indexOf(H$r.COMPUTE_W_VALUE))>0&&a.defines.splice(s,1),(s=a.defines.indexOf(H$r.EMISSION_TEXTURE))>0&&a.defines.splice(s,1),o.defines.push("QUAD_OUTLINE"),a.defines.push("QUAD_OUTLINE"),a.defines.push("Only_LineColor"),n.shaderProgram=S$T.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),n.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var l={uLineColor:function(){return e.style3D.lineColor}};n.uniformMap=p$17(l,this._colorCommand.uniformMap),this._wireFrameCommands.quad=n},_0x1f65d5.prototype.createWireFrameCommand=function(e,t){if(!this._isClamp&&e._fileType!==f$r.ClampGroundPolygon&&this._arrIndexPackage.length>1)if(13==this._arrIndexPackage[1].primitiveType)this.createEdgeCommands(e);else if(2==this._arrIndexPackage[1].primitiveType){var i=this._arrIndexPackage[1];this.createQuadWireFrameCommand(e,t,i)}},_0x1f65d5.prototype._createLineCalloutCommand=function(e){!e.showCallout||this._fileType!==f$r.Text&&this._fileType!==f$r.IconPoint||(this._lineCalloutCommand=_0x3a39e5(e,this))},_0x1f65d5.prototype.updateTheme=function(e){_0x47329e(e,this)},_0x1f65d5.prototype.updateObjsColor=function(e){if(this._initialize&&e$28(this._selectionInforMap)&&_0x2528fb.S3M!==this._version&&(!(this._selectionInforMap.length<1)&&e$28(this._colorCommand))){var t=this._selectionInforMap._hash;for(var i in t)if(t.hasOwnProperty(i)){var r=e[i];if(e$28(r)){var n=t[i];this._updateBatchTable=!0;var o=n.batchId,a=n.instanceIds;this._idsColorMap.set(i,{batchId:o,instanceIds:a,color:r,dirty:!0});var s=this._idsOperationMap.get(i);e$28(s)||(s={batchId:o,instanceIds:a,operationValue:new e$25,dirty:!0}),s.dirty=!0,s.operationValue.x=r===e$1S.TRANSPARENT?254&s.operationValue.x:1|s.operationValue.x,this._passIncrement=r.alpha<1?1:0,this._idsOperationMap.set(i,s)}}}},_0x1f65d5.prototype.updateObjsTranslate=function(e){if(this._initialize&&e$28(this._selectionInforMap)&&_0x2528fb.S3M!==this._version){var t=this._selectionInforMap.length,i=this._colorCommand;if(!(t<1)&&e$28(i)){var r=this._selectionInforMap._hash,n=this._idsTranslateMap.length,o=!1;for(var a in r)if(r.hasOwnProperty(a)){var s=e[a];if(s){var l=r[a];this._updateBatchTable=!0;var u=l.batchId,c=l.instanceIds;this._idsTranslateMap.set(a,{batchId:u,instanceIds:c,translate:s,dirty:!0});var h=this._idsOperationMap.get(a);e$28(h)||(h={batchId:u,instanceIds:c,operationValue:new t$X,dirty:!0}),h.dirty=!0,t$X.equals(s,t$X.ZERO)?(h.operationValue.x=h.operationValue.x&(_0xfef200.ALL^_0xfef200.OFFSET),this._idsOperationMap.set(a,h)):(h.operationValue.x=h.operationValue.x|_0xfef200.OFFSET,o=!0)}}e$28(this._entity)&&(this._entity.hasTranslate=this._entity.hasTranslate||o,this._entity._parent&&(this._entity._parent.hasTranslate=this._entity.hasTranslate||this._entity._parent.hasTranslate)),i.boundingVolume=o?void 0:this._boundingVolume;var d=this._idsTranslateMap.length;(d>0&&0===n||n>0&&0===d)&&d>0&&0===n&&this.appendProgramDefine({layer:this._layer},!0,!1,H$r.Translation,!0,!1)}}},_0x1f65d5.prototype.updateAllObjsVisible=function(e,t){if(this._initialize&&e$28(this._selectionInforMap)&&_0x2528fb.S3M!==this._version&&(!(this._selectionInforMap.length<1)&&e$28(this._colorCommand))){var i=this._selectionInforMap._hash;for(var r in i)if(i.hasOwnProperty(r)&&!e._objsVisibleList.contains(r)){var n=i[r];this._updateBatchTable=!0;var o=n.batchId,a=n.instanceIds,s=this._idsOperationMap.get(r);e$28(s)||(s={batchId:o,instanceIds:a,operationValue:new e$25,dirty:!0}),s.dirty=!0,s.operationValue.x=t?s.operationValue.x&(_0xfef200.ALL^_0xfef200.HIDE):s.operationValue.x|_0xfef200.HIDE,this._idsOperationMap.set(r,s),s.operationValue.x===_0xfef200.RESET?delete e._objsOperationList[r]:(e._objsOperationList[r]=s.operationValue.x,e._objsHideList.set(r,!0))}}},_0x1f65d5.prototype.removeAllExtendHeight=function(){this._initialize&&e$28(this._texCoord1)&&e$28(this._colorCommand)&&this._colorCommand.vertexArray.getAttribute(this._attributeLocations.aTexCoord1).vertexBuffer.copyFromArrayView(this._texCoord1)},_0x1f65d5.prototype.removeExtendHeight=function(e){if(this._initialize&&e$28(this._texCoord1)&&(!(this._selectionInforMap.length<1)&&e$28(this._colorCommand))){var t=this._selectionInforMap._hash;for(var i in t)if(t.hasOwnProperty(i)&&-1!=e.indexOf(parseInt(i))){var r,n,o,a,s=t[i];r=this._colorCommand.vertexArray.getAttribute(this._attributeLocations.aTexCoord1),n=(a=s.vertexColorOffset*r.componentsPerAttribute)*S$W.getSizeInBytes(r.componentDatatype),o=s.vertexColorCount*r.componentsPerAttribute;var l=this._texCoord1.slice(a,o);r.vertexBuffer.copyFromArrayView(l,n)}}},_0x1f65d5.prototype.updateExtendHeight=function(e){if(this._initialize&&e$28(this._texCoord1)&&(!(this._selectionInforMap.length<1)&&e$28(this._colorCommand))){var t=this._selectionInforMap._hash;for(var i in t)if(t.hasOwnProperty(i)&&e.contains(i)){var r,n,o,a,s=t[i],l=e.get(i);r=this._colorCommand.vertexArray.getAttribute(this._attributeLocations.aTexCoord1),n=(a=s.vertexColorOffset*r.componentsPerAttribute)*S$W.getSizeInBytes(r.componentDatatype),o=s.vertexColorCount*r.componentsPerAttribute;for(var u=S$W.createTypedArray(r.componentDatatype,o),c=0;c<s.vertexColorCount;c++)this._texCoord1[2*c+1+a]>.3&&this._texCoord1[2*c+1+a]<.8?(u[2*c]=l,u[2*c+1]=.5):this._texCoord1[2*c+1+a]>.8?(u[2*c]=l,u[2*c+1]=1):(u[2*c]=this._texCoord1[2*c+a],u[2*c+1]=0);r.vertexBuffer.copyFromArrayView(u,n)}}},_0x1f65d5.prototype.updateObjsOperation=function(e,t){if(this._initialize&&e$28(this._selectionInforMap)&&_0x2528fb.S3M!==this._version&&(!(this._selectionInforMap.length<1)&&e$28(this._colorCommand))){var i=this._selectionInforMap._hash,r=!1,n=_0x45b8e1(this._layer,this),o=!1,a=this._layer.isSilhouette(),s=!1,l=!1;for(var u in i)if(i.hasOwnProperty(u)){var c=e[u];if(e$28(c)){var h=i[u];this._updateBatchTable=!0;var d=this._layer._lastSelectSkeletonId,f=d>-1?u+"_"+d:u,p=h.batchId,_=h.instanceIds,m=this._idsOperationMap.get(f);e$28(m)||(m={batchId:p,instanceIds:_,skeletonId:d,operationValue:new e$25,dirty:!0}),m.dirty=!0,m.operationValue.x=1&m.operationValue.x|c,this._idsOperationMap.set(f,m),(m.operationValue.x&_0xfef200.BLOOM)>0&&(r=!0),n&&(m.operationValue.x&_0xfef200.SELECTED)>0&&(o=!0),a&&(m.operationValue.x&_0xfef200.SELECTED)>0&&(s=!0),(m.operationValue.x&_0xfef200.SELECTED)>0&&(l=!0)}}this._hasBloomOperation=r,this._clampSelected=o,this._hasSilhouette=s,this._isSelected=l}};var _0x1919b5=new o$1i(new t$X(1,0,0),0);function _0x2f620d(e,t){return t$X.distance(e.center,t.center)<=e.radius+t.radius}function _0xc473c8(e,t){var i=!1,r=t.split(" "),n=!1;if(r.length>1){var o=r[0],a=r[1];for(var s in e.defines)if(-1!==e.defines[s].indexOf(o))return e.defines[s]=o+" "+a,!0;n=!0,e.defines.push(t)}else{for(var l=0,u=e.defines.length;l<u;l++)if(e.defines[l]===t){i=!0;break}i||(n=!0,e.defines.push(t))}return n}function _0x173810(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function _0x356dad(e,t){e$28(t)&&(t.vertexArray=t.vertexArray&&!t.vertexArray.isDestroyed()&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&!t.shaderProgram.isDestroyed()&&t.shaderProgram.destroy(),t.renderState=void 0,t.uniformMap=void 0,t.removeAllUniformBuffer())}function _0x171fd2(e,t,i,r){if(!e$28(i._labelPromiseArr[r])){var n=e._s3MTilesLabelStyle._textField;e.getAttributesById(t).then((function(e){if(i._labelPromiseArr[r]=void 0,e.hasOwnProperty(n)){var o=e[n];i._labelTextArray[r]=o,i._labelsCreated[t]=!0}}))}}_0x1f65d5.prototype.isIntersectWithClipPlane=function(e){return!!e.isRenderClipSection()&&this._boundingVolume.intersectPlane(o$1i.fromCartesian4(e._oriClipPlane[0],_0x1919b5))===pt$a.INTERSECTING},_0x1f65d5.prototype.setCustomClipBox=function(e,t){var i={layer:e};t?(this.appendProgramDefine(i,!1,!0,H$r.CLIP),e._section&&this.appendProgramDefine(i,!1,!0,H$r.CLIPPLANE)):(this.removeProgramDefine(i,!1,!0,H$r.CLIP),e._section&&this.removeProgramDefine(i,!1,!0,H$r.CLIPPLANE)),e$28(this._clampColorCommand)&&(!this._clampColorCommand.shaderProgram.isDestroyed()&&this._clampColorCommand.shaderProgram.destroy(),this._clampColorCommand=void 0),e$28(this._clipStencilCommand)&&(!this._clipStencilCommand.shaderProgram.isDestroyed()&&this._clipStencilCommand.shaderProgram.destroy(),this._clipStencilCommand=void 0)},_0x1f65d5.prototype.updateShadow=function(e){var t=_0x12fc4f(this),i=this._colorCommand;!e$28(i)||(i.castShadows=t,i.receiveShadows=t,i.selectCastShadows=!e$28(e.waterEffectSet))},_0x1f65d5.prototype.cloneSelectCommand=function(e){var t=e._context,i=new a$$({name:"S3MTilesSelection",sources:[_0x308597]});e._clipping&&i.defines.push("CLIP"),i.defines.push("DepthEXT");var r=this._colorCommand;if(e$28(r)){var n=r.shaderProgram.vertexShaderSource.clone(),o=void 0;if((o=r$15.shallowClone(r,o)).uniformMap.uTransparentFilter=function(){return e.selectionFiltrateByTransparency},o.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:this._attributeLocations}),this._pickCommand=o,this._pickCommand.pass=Le$p.ClampObject,e$28(this._stencilCommand)){var a=this._stencilCommand.shaderProgram.vertexShaderSource.clone(),s=this._stencilCommand.shaderProgram.fragmentShaderSource.clone();a.defines.push("SELECTED"),s.defines.push("SELECTED"),this._selectedStencilCommand=r$15.shallowClone(this._stencilCommand),this._selectedStencilCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:this._attributeLocations}),this._selectedColorCommand=r$15.shallowClone(this._colorCommand),this._selectedColorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:this._attributeLocations})}}},_0x1f65d5.prototype.createNormalAndDepthCommand=function(e){var t=e._context,i=this._colorCommand;if(e.isSilhouette()&&e$28(i)&&!e$28(this._normalAndDepthCommand)){var r=i.shaderProgram.vertexShaderSource.clone(),n=i.shaderProgram.fragmentShaderSource.clone();r.defines.push(H$r.NORMAL_AND_DEPTH),n.defines.push(H$r.NORMAL_AND_DEPTH),e.isSilhouette()&&(r.defines.push(H$r.SILHOUETTE_SELECT_TYPE),n.defines.push(H$r.SILHOUETTE_SELECT_TYPE));var o=void 0;(o=r$15.shallowClone(i,o)).shaderProgram=S$T.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),o.uniformMap.uNormalDepthTexture=function(){return e._frameState._framebufferList.normalAndDepth.renderTexture._fb.getColorTexture(0)},this._normalAndDepthCommand=o}},_0x1f65d5.prototype.createTransparentCommand=function(e){var t=e._context,i=this._colorCommand;if(e.partlyTransparent&&e$28(i)&&!e$28(this._transparentCommand)){var r=i.shaderProgram.vertexShaderSource.clone(),n=i.shaderProgram.fragmentShaderSource.clone();n.defines.push("TRANSPARENT_PASS");var o=void 0;(o=r$15.shallowClone(i,o)).shaderProgram=S$T.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),o.pass=Le$p.TRANSLUCENT,this._transparentCommand=o}},_0x1f65d5.prototype.createPostEffectCommand=function(e){var t=e._context,i=this._colorCommand;if(e.bloomEnable&&e$28(i)&&!e$28(this._postEffectCommand)){var r=i.shaderProgram.vertexShaderSource.clone(),n=i.shaderProgram.fragmentShaderSource.clone();r.defines.push(H$r.POST_EFFECT),n.defines.push(H$r.POST_EFFECT);var o=void 0;(o=r$15.shallowClone(i,o)).shaderProgram=S$T.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:this._attributeLocations}),o.pass=Le$p.S3MTiles,this._postEffectCommand=o}},_0x1f65d5.prototype.enableAjustTransparentBackColor=function(e){this.appendProgramDefine(e,!1,!0,H$r.TRANSPARENT_BACK_COLOR)},_0x1f65d5.prototype.disableAjustTransparentBackColor=function(e){this.removeProgramDefine(e,!1,!0,H$r.TRANSPARENT_BACK_COLOR)},_0x1f65d5.prototype.enableAdjustColor=function(e){this.appendProgramDefine(e,!1,!0,H$r.ADJUST_COLOR)},_0x1f65d5.prototype.enableVertexCapture=function(e){this.appendProgramDefine(e,!0,!0,H$r.VERTEX_CAPTURE)},_0x1f65d5.prototype.disableVertexCapture=function(e){this.removeProgramDefine(e,!0,!0,H$r.VERTEX_CAPTURE)},_0x1f65d5.prototype.enableExcavation=function(e){this.appendProgramDefine(e,!0,!0,H$r.EXCAVATION)},_0x1f65d5.prototype.disableExcavation=function(e){this.removeProgramDefine(e,!0,!0,H$r.EXCAVATION)},_0x1f65d5.prototype.enableServerExcavation=function(e){this.appendProgramDefine(e,!0,!0,"SERVEREXCAVATION")},_0x1f65d5.prototype.disableServerExcavation=function(e){this.removeProgramDefine(e,!0,!0,"SERVEREXCAVATION")},_0x1f65d5.prototype.enableFlatten=function(e){e$28(e.entity)&&e$28(e.entity._boundingSphere)&&e$28(e.boundingSphere)&&(_0x2f620d(e.entity._boundingSphere,e.boundingSphere)&&(e.entity.isFlatten=!0,e$28(this._colorCommand)&&(this._colorCommand.cull=!1)));this.appendProgramDefine(e,!0,!1,H$r.FALTTEN),this.appendProgramDefine(e,!0,!1,H$r.UseFloatTexture)},_0x1f65d5.prototype.enableOverlay=function(e){this.appendProgramDefine(e,!0,!0,H$r.OVERLAY)},_0x1f65d5.prototype.disableOverlay=function(e){this.removeProgramDefine(e,!0,!1,H$r.OVERLAY)},_0x1f65d5.prototype.disableFlatten=function(e){e$28(e.entity)&&(e.entity.isFlatten=!1),e$28(this._colorCommand)&&(this._colorCommand.cull=!0),this.removeProgramDefine(e,!0,!1,H$r.FALTTEN),this.removeProgramDefine(e,!0,!1,H$r.UseFloatTexture)},_0x1f65d5.prototype.enableHypsometric=function(e){this.appendProgramDefine(e,!0,!0,H$r.COMPUTE_W_VALUE),this.appendProgramDefine(e,!0,!0,H$r.HYPSOMETRIC)},_0x1f65d5.prototype.disableHypsometric=function(e){this.removeProgramDefine(e,!0,!0,H$r.COMPUTE_W_VALUE),this.removeProgramDefine(e,!0,!0,H$r.EMISSION_TEXTURE),this.removeProgramDefine(e,!0,!0,H$r.HYPSOMETRIC)},_0x1f65d5.prototype.hasLightChange=function(e){e.enable?this.appendProgramDefine(e,!0,!0,H$r.HAS_LIGHT):this.removeProgramDefine(e,!0,!0,H$r.HAS_LIGHT)},_0x1f65d5.prototype.skeletonSelectedChange=function(e){e.enable?this.appendProgramDefine(e,!0,!0,H$r.HAS_SKELETONSELECTED):this.removeProgramDefine(e,!0,!0,H$r.HAS_SKELETONSELECTED)},_0x1f65d5.prototype.skeletonSelectEnable=function(e){e.enable?this.appendProgramDefine(e,!0,!0,H$r.SKELETONSELECT_ENABLE):this.removeProgramDefine(e,!0,!0,H$r.SKELETONSELECT_ENABLE)},_0x1f65d5.prototype.selectColorTypeChange=function(e){e.selectColorType==Ya$1.REPLACE?(this.appendProgramDefine(e,!0,!0,H$r.REPLACE_SELECT_TYPE),this.removeProgramDefine(e,!0,!0,H$r.SILHOUETTE_SELECT_TYPE)):e.selectColorType==Ya$1.SILHOUETTE||e.selectColorType==Ya$1.ALWAYS_SHOW_SILHOUETTE?(this.appendProgramDefine(e,!0,!0,H$r.SILHOUETTE_SELECT_TYPE),this.removeProgramDefine(e,!0,!0,H$r.REPLACE_SELECT_TYPE)):(this.removeProgramDefine(e,!0,!0,H$r.REPLACE_SELECT_TYPE),this.removeProgramDefine(e,!0,!0,H$r.SILHOUETTE_SELECT_TYPE))},_0x1f65d5.prototype.mixColorTypeChange=function(e){e.mixColorType===_0x125991.REPLACE?this.appendProgramDefine(e,!0,!0,H$r.REPLACE_COLOR_TYPE):this.removeProgramDefine(e,!0,!0,H$r.REPLACE_COLOR_TYPE)},_0x1f65d5.prototype.splitDirectionChange=function(e){e.enableSplit?this.appendProgramDefine(e,!1,!0,H$r.APPLY_SPLIT):this.removeProgramDefine(e,!1,!0,H$r.APPLY_SPLIT)},_0x1f65d5.prototype.swipeStateChange=function(e){e.enableSwipe?this.appendProgramDefine(e,!1,!0,H$r.APPLY_SWIPE):this.removeProgramDefine(e,!1,!0,H$r.APPLY_SWIPE)},_0x1f65d5.prototype.edgeWireFrameModeChange=function(e){this.appendProgramDefineForCommand(this._regularEdgeCommand,e,!0,!0,"MODE "+e.edgeMode,!1),this.appendProgramDefineForCommand(this._silhouetteEdgeCommand,e,!0,!0,"MODE "+e.edgeMode,!1)},_0x1f65d5.prototype.PBRMaterialTypeChange=function(e){e.PBRType===je$b.NONE?this.removeProgramDefine(e,!0,!0,H$r.PBR):this.appendProgramDefine(e,!0,!0,H$r.PBR)},_0x1f65d5.prototype.emissionTextureChange=function(e){e.enable?(this.appendProgramDefine(e,!0,!0,H$r.COMPUTE_W_VALUE),this.appendProgramDefine(e,!0,!0,H$r.EMISSION_TEXTURE),this.appendProgramDefine(e,!0,!0,H$r.EMISSION_TEXTURE_COUNT+e.textureCount)):this.removeProgramDefine(e,!0,!0,H$r.EMISSION_TEXTURE)},_0x1f65d5.prototype.enableTextureMove=function(e){e.enable?this.appendProgramDefine(e,!0,!0,H$r.TEXTURE_MOVE):this.removeProgramDefine(e,!0,!0,H$r.TEXTURE_MOVE)},_0x1f65d5.prototype.enableTriangleFiltrate=function(e){e.enable?this.appendProgramDefine(e,!0,!1,H$r.TRIANGLE_FILTRATE):this.removeProgramDefine(e,!0,!1,H$r.TRIANGLE_FILTRATE)},_0x1f65d5.prototype.enableClipFilt=function(e){e.enable?this.appendProgramDefine(e,!1,!0,H$r.CLIP_FILT_BY_ID):this.removeProgramDefine(e,!1,!0,H$r.CLIP_FILT_BY_ID)},_0x1f65d5.prototype.enableFlood=function(e){this.appendProgramDefine(e,!0,!0,H$r.FLOOD_ANALYSIS)},_0x1f65d5.prototype.disableFlood=function(e){this.removeProgramDefine(e,!0,!0,H$r.FLOOD_ANALYSIS)},_0x1f65d5.prototype.emissionTextureUnitChange=function(e){e.enable?this.appendProgramDefine(e,!0,!1,H$r.SEC_TEX_EMISSION):this.removeProgramDefine(e,!0,!1,H$r.SEC_TEX_EMISSION)},_0x1f65d5.prototype.pbrParameterChange=function(e){if(e.enable){var t=e.layer,i=(t._pbrParameter&je$b.ROUGHNESS)>0||t._PBRMaterialParams.loadingTexture,r=e$28(t.themeStyle)&&e$28(t.themeStyle.pbrMaterialIndex),n=[],o=!1;if(i||r){t._hasLight&&n.push(H$r.BRDF);var a=e$28(this._attributeLocations.aTexCoord0);r&&(o=!0,n.push(H$r.PBR_THEME),n.push("NUM_PBR_MATERIALS "+t._frameState.pbrMaterialsArr.length)),e$28(t._PBRMaterialParams.pbrMetallicRoughness.baseColorTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.baseColorTexture instanceof L$17&&a&&n.push(H$r.HAS_BASE_TEXTURE),a&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.wetnessFactor)&&(n.push(H$r.HAS_WETNESS),e$28(t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rippleTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.rainEffect.rippleTexture instanceof L$17&&n.push(H$r.HAS_RAIN)),a&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.snowEffect)&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowMaskTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowMaskTexture instanceof L$17&&e$28(t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowNormalTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.snowEffect.snowNormalTexture instanceof L$17&&n.push(H$r.HAS_SNOW),(e$28(this.materialPass)&&this.materialPass._metallicRoughnessTextureIndex>-1||e$28(t._PBRMaterialParams.pbrMetallicRoughness.metallicRoughnessTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.metallicRoughnessTexture instanceof L$17)&&a&&n.push(H$r.HAS_MetallicRoughness_TEXTURE),(e$28(this.materialPass)&&this.materialPass._normalTextureIndex>-1||e$28(t._PBRMaterialParams.pbrMetallicRoughness.normalTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.normalTexture instanceof L$17)&&a&&n.push(H$r.HAS_NORMAL_TEXTURE),(e$28(this.materialPass)&&this.materialPass._occlusionTextureIndex>-1||e$28(t._PBRMaterialParams.pbrMetallicRoughness.occlusionTexture)&&t._PBRMaterialParams.pbrMetallicRoughness.occlusionTexture instanceof L$17)&&a&&n.push(H$r.HAS_OCCLUSION_TEXTURE),(e$28(this.materialPass)&&e$28(this.materialPass._anisotropy)||e$28(t._PBRMaterialParams.pbrMetallicRoughness.anisotropy))&&n.push(H$r.HAS_ANISOTROPY),(e$28(this.materialPass)&&e$28(this.materialPass._volume)||e$28(t._PBRMaterialParams.pbrMetallicRoughness.volume))&&(n.push(H$r.HAS_VOLUME),n.push(H$r.HAS_TRANSMISSION)),(e$28(this.materialPass)&&e$28(this.materialPass._clearcoat)||e$28(t._PBRMaterialParams.pbrMetallicRoughness.clearcoat))&&n.push(H$r.HAS_CLEARCOAT),(e$28(this.materialPass)&&this.materialPass._indexOfRefraction>-1||e$28(t._PBRMaterialParams.pbrMetallicRoughness.indexOfRefraction)&&t._PBRMaterialParams.pbrMetallicRoughness.indexOfRefraction>0)&&n.push(H$r.REFRACTION),e$28(this.materialPass)&&this.materialPass._emissiveTextureIndex>-1&&n.push(H$r.HAS_EMISSIVE_TEXTURE),e$28(t._frameState.specularEnvironmentMaps)&&n.push(H$r.IBL),this.appendProgramDefinesForCommand(this._colorCommand,e,o,!0,n,!0,!0)}else n=[H$r.BRDF,"NUM_PBR_MATERIALS "+t._frameState.pbrMaterialsArr.length,H$r.HAS_BASE_TEXTURE,H$r.HAS_NORMAL_TEXTURE,H$r.HAS_EMISSIVE_TEXTURE,H$r.IBL,H$r.HAS_MetallicRoughness_TEXTURE,H$r.HAS_SNOW,H$r.HAS_RAIN,H$r.PBR_THEME],this.removeProgramDefinesForCommand(this._colorCommand,e,o,!0,n)}},_0x1f65d5.prototype.enableFusionChange=function(e){e.enable?this.appendProgramDefine(e,!0,!1,H$r.FusionMode):this.removeProgramDefine(e,!0,!1,H$r.FusionMode)},_0x1f65d5.prototype.appendProgramDefine=function(e,t,i,r,n,o){n=u$Y(n,!0),o=u$Y(o,!0),this.appendProgramDefineForCommand(this._colorCommand,e,t,i,r,n,o),this.appendProgramDefineForCommand(this._regularEdgeCommand,e,t,i,r,!1,o),this.appendProgramDefineForCommand(this._silhouetteEdgeCommand,e,t,i,r,!1,o),this.appendProgramDefineForCommand(this._wireFrameCommands.quad,e,!1,!0,r,!1,o),this.appendProgramDefineForCommand(this._wireFrameCommands.triangle,e,!1,!0,r,!1,o)},_0x1f65d5.prototype.appendProgramDefineForCommand=function(e,t,i,r,n,o,a){if(o=u$Y(o,!0),a=u$Y(a,!0),e$28(e)){l=t.layer._context,u=e.shaderProgram.fragmentShaderSource.clone(),c=e.shaderProgram.vertexShaderSource.clone();e$28(u.name)||(u.name="fpCustomName"+t.layer.id),e$28(c.name)||(c.name="vpCustomName"+t.layer.id),i&&_0xc473c8(c,n),r&&_0xc473c8(u,n);h=e.shaderProgram._attributeLocations;a&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());var s=S$T.fromCache({context:l,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h});o&&(this._sp=s),e.shaderProgram=s,e$28(this._stencilCommand)&&(this._stencilCommand.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.stencil)&&(e.derivedCommands.stencil.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.zback)&&(e.derivedCommands.zback.shaderProgram=_0x578d9a(l,e.shaderProgram))}else if(o&&e$28(this._sp)){var l=t.layer._context,u=this._sp.fragmentShaderSource.clone(),c=this._sp.vertexShaderSource.clone();e$28(u.name)||(u.name="fpCustomName"+t.layer.id),e$28(c.name)||(c.name="vpCustomName"+t.layer.id),i&&_0xc473c8(c,n),r&&_0xc473c8(u,n);var h=this._attributeLocations;this._sp.destroy(),this._sp=S$T.fromCache({context:l,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h})}},_0x1f65d5.prototype.appendProgramDefinesForCommand=function(e,t,i,r,n,o,a){o=u$Y(o,!0),a=u$Y(a,!0);var s=t.layer._context;if(e$28(e)){u=e.shaderProgram.fragmentShaderSource.clone(),c=e.shaderProgram.vertexShaderSource.clone();e$28(u.name)||(u.name="fpCustomName"+t.layer.id),e$28(c.name)||(c.name="vpCustomName"+t.layer.id),n.forEach((function(e){i&&_0xc473c8(c,e),r&&_0xc473c8(u,e)}));h=e.shaderProgram._attributeLocations;a&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());var l=S$T.fromCache({context:s,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h});o&&(this._sp=l),e.shaderProgram=l,e$28(this._stencilCommand)&&(this._stencilCommand.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.stencil)&&(e.derivedCommands.stencil.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.zback)&&(e.derivedCommands.zback.shaderProgram=_0x578d9a(s,e.shaderProgram))}else if(o&&e$28(this._sp)){var u=this._sp.fragmentShaderSource.clone(),c=this._sp.vertexShaderSource.clone();e$28(u.name)||(u.name="fpCustomName"+t.layer.id),e$28(c.name)||(c.name="vpCustomName"+t.layer.id),n.forEach((function(e){i&&_0xc473c8(c,e),r&&_0xc473c8(u,e)}));var h=this._attributeLocations;this._sp.destroy(),this._sp=S$T.fromCache({context:s,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:h})}},_0x1f65d5.prototype.removeProgramDefine=function(e,t,i,r){this.removeProgramDefineForCommand(this._colorCommand,e,t,i,r),e$28(this._regularEdgeCommand)&&this.removeProgramDefineForCommand(this._regularEdgeCommand,e,t,i,r,!1),e$28(this._silhouetteEdgeCommand)&&this.removeProgramDefineForCommand(this._silhouetteEdgeCommand,e,t,i,r,!1),e$28(this._wireFrameCommands.quad)&&this.removeProgramDefineForCommand(this._wireFrameCommands.quad,e,!1,!0,r,!1),e$28(this._wireFrameCommands.triangle)&&this.removeProgramDefineForCommand(this._wireFrameCommands.triangle,e,!1,!0,r,!1)},_0x1f65d5.prototype.removeProgramDefineForCommand=function(e,t,i,r,n,o){if(o=u$Y(o,!0),e$28(e)){s=t.layer._context,l=e.shaderProgram.fragmentShaderSource.clone(),u=e.shaderProgram.vertexShaderSource.clone();e$28(l.name)||(l.name="fpCustomName"+t.layer.id),e$28(u.name)||(u.name="vpCustomName"+t.layer.id),i&&_0x173810(u,n),r&&_0x173810(l,n);c=e.shaderProgram._attributeLocations;e.shaderProgram.destroy();var a=S$T.fromCache({context:s,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:c});e.shaderProgram=a,o&&(this._sp=a),e$28(this._stencilCommand)&&(this._stencilCommand.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.stencil)&&(e.derivedCommands.stencil.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.zback)&&(e.derivedCommands.zback.shaderProgram=_0x578d9a(s,e.shaderProgram))}else if(o&&e$28(this._sp)){var s=t.layer._context,l=this._sp.fragmentShaderSource.clone(),u=this._sp.vertexShaderSource.clone();e$28(l.name)||(l.name="fpCustomName"+t.layer.id),e$28(u.name)||(u.name="vpCustomName"+t.layer.id),i&&_0x173810(u,n),r&&_0x173810(l,n);var c=this._attributeLocations;this._sp.destroy(),this._sp=S$T.fromCache({context:s,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:c})}},_0x1f65d5.prototype.removeProgramDefinesForCommand=function(e,t,i,r,n,o){var a=t.layer._context;if(o=u$Y(o,!0),e$28(e)){l=e.shaderProgram.fragmentShaderSource.clone(),u=e.shaderProgram.vertexShaderSource.clone();e$28(l.name)||(l.name="fpCustomName"+t.layer.id),e$28(u.name)||(u.name="vpCustomName"+t.layer.id),n.forEach((function(e){i&&_0x173810(u,e),r&&_0x173810(l,e)}));c=e.shaderProgram._attributeLocations;e.shaderProgram.destroy();var s=S$T.fromCache({context:a,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:c});e.shaderProgram=s,o&&(this._sp=s),e$28(this._stencilCommand)&&(this._stencilCommand.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.stencil)&&(e.derivedCommands.stencil.shaderProgram=e.shaderProgram),e$28(e.derivedCommands)&&e$28(e.derivedCommands.zback)&&(e.derivedCommands.zback.shaderProgram=_0x578d9a(a,e.shaderProgram))}else if(o&&e$28(this._sp)){var l=this._sp.fragmentShaderSource.clone(),u=this._sp.vertexShaderSource.clone();e$28(l.name)||(l.name="fpCustomName"+t.layer.id),e$28(u.name)||(u.name="vpCustomName"+t.layer.id),n.forEach((function(e){i&&_0x173810(u,e),r&&_0x173810(l,e)}));var c=this._attributeLocations;this._sp.destroy(),this._sp=S$T.fromCache({context:a,vertexShaderSource:u,fragmentShaderSource:l,attributeLocations:c})}},_0x1f65d5.prototype.lightSourceChanged=function(e){if(e$28(this._colorCommand)){var t=e.changedList,i=this._layer._scene._lightSource;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r],o=n.type,a=n.count;switch(o){case w$i.DIRECTIONAL:this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.DIR_LIGHTS+a),i.directionalLight.length>0&&a>0?this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_DIR_LIGHTS):this.removeProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_DIR_LIGHTS);break;case w$i.POINT:this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.POINT_LIGHTS+a),i.pointLight.length>0&&a>0?this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_POINT_LIGHTS):this.removeProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_POINT_LIGHTS);break;case w$i.SPOT:this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.SPOT_LIGHTS+a),i.spotLight.length>0&&a>0?this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_SPOT_LIGHTS):this.removeProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_SPOT_LIGHTS);break;case w$i.HEMISPHERE:this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HEMISPHERE_LIGHTS+a),i.hemisphereLight.length>0&&a>0?this.appendProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_HEMISPHERE_LIGHTS):this.removeProgramDefineForCommand(this._colorCommand,e,!0,!0,H$r.HAS_HEMISPHERE_LIGHTS)}}}},_0x1f65d5.prototype.enableCategoryVisible=function(e){this.appendProgramDefine(e,!0,!1,H$r.W_VISIBLE)},_0x1f65d5.prototype.isDestroyed=function(){return!1},_0x1f65d5.prototype.destroyScaleImagerys=function(){if(e$28(this._scaleImagerys)){for(var e=0;e<this._scaleImagerys.length;e++){var t=this._scaleImagerys[e];if(e$28(t))for(var i=0;i<t.length;i++)t[i].releaseReference()}this._scaleImagerys.length=0}},_0x1f65d5.prototype.destroy=function(){this._removeListenerFunc();var e=e$28(this._layer.instanceSkeletonManager)&&"InstanceModel"===this._layer._dataType;if(e$28(this._vertexPackage)&&!e)for(var t=this._vertexPackage.vertexAttributes,i=0,r=t.length;i<r;i++){var n=t[i];e$28(n.vertexBuffer)&&!n.vertexBuffer.isDestroyed()&&!n.vertexBuffer.isDestroyed()&&n.vertexBuffer.destroy()}if(e$28(this._arrIndexPackage)&&!e)for(i=0,r=this._arrIndexPackage.length;i<r;i++){var o=this._arrIndexPackage[i];e$28(o.indexBuffer)&&!o.indexBuffer.isDestroyed()&&o.indexBuffer.destroy()}e$28(this._wireFrameIndexBuffers)&&this._wireFrameIndexBuffers.destroy();var a=this._context,s=this._layer;if(s._isS3MBlock)for(var l in this._mapPass)this._mapPass.hasOwnProperty(l)&&s.materialManager.free(s,l);else for(var l in this._mapPass)if(this._mapPass.hasOwnProperty(l)){var u=this._mapPass[l];!u.isDestroyed()&&u.destroy()}if(this._mapPass=void 0,this._sp=void 0,this._instanceMode>0){if(e$28(this._colorCommand)){var c=this._colorCommand;c.vertexArray=c.vertexArray&&!c.vertexArray.isDestroyed()&&c.vertexArray.destroy(),c.shaderProgram=c.shaderProgram&&!c.shaderProgram.isDestroyed()&&c.shaderProgram.destroy(),c.renderState=void 0,c.uniformMap=void 0,this._colorCommand=void 0}}else _0x356dad(a,this._colorCommand),this._colorCommand=void 0,this._wireFrameCommands.triangle&&_0x356dad(a,this._wireFrameCommands.triangle),this._wireFrameCommands.quad&&_0x356dad(this._wireFrameCommands.quad),this._wireFrameCommands={},_0x356dad(a,this._pickCommand),this._pickCommand=void 0,this._stencilCommand=void 0,_0x356dad(a,this._selectedStencilCommand),this._selectedStencilCommand=void 0,_0x356dad(a,this._selectedColorCommand),this._selectedColorCommand=void 0,_0x356dad(a,this._normalAndDepthCommand),this._normalAndDepthCommand=void 0,_0x356dad(a,this._postEffectCommand),this._postEffectCommand=void 0,_0x356dad(a,this._pickRectCommand),this._pickRectCommand=void 0,_0x356dad(a,this._clipCommand),this._clipCommand=void 0,_0x356dad(a,this._regularEdgeCommand),this._regularEdgeCommand=void 0,_0x356dad(a,this._silhouetteEdgeCommand),this._silhouetteEdgeCommand=void 0,_0x356dad(a,this._lineCalloutCommand),this._lineCalloutCommand=void 0;if(this._clampColorCommand=void 0,this._clipStencilCommand=void 0,e$28(this._selectionInforMap)&&this._selectionInforMap.removeAll(),this._vertexPackage=void 0,this._vertexColor=void 0,this._texCoord1=void 0,this._vertexColorInstance=void 0,this._arrIndexPackage=void 0,e$28(this._volObj)&&(this._volObj=void 0),e$28(this._volTexture)&&(this._volTexture=void 0),e$28(this._symbolTextureUrl)&&_0x2dd764.removeTexture(this._symbolTextureUrl),this._waterIndex,this.s3mbuffer&&(this.s3mbuffer=null),e$28(this._batchTable)&&(this._batchTable=this._batchTable.destroy()),e$28(this._imagerys)){for(var h=this._imagerys,d=(i=0,h.length);i<d;++i)h[i].releaseReference();this._imagerys.length=0}if(this.destroyScaleImagerys(),e$28(this._plusRoArray)){for(i=0;i<this._plusRoArray.length;i++){var f=this._plusRoArray[i];if(e$28(f))for(r=0;r<f.length;r++)f[r].shaderProgram.destroy(),f[r].uniformMap=void 0}this._plusRoArray.length=0}return this._vertexWeightBuffers.length=0,this._layer._totalMemoryUsageInBytes-=this._geometryByteLength,i$Z(this)},_0x1f65d5.prototype.createPickRectCommand=function(e){if(e$28(this._colorCommand)&&!e$28(this._pickRectCommand)&&"FresnelVp"!==this._colorCommand.shaderProgram.vertexShaderSource.name&&"FresnelFp"!==this._colorCommand.shaderProgram.fragmentShaderSource.name&&e._selectUpdate){var t=e._context,i=new a$$({name:"S3MTilesRectSelection",sources:[_0x27e460]}),r=this._colorCommand;if(!e$28(r))return;var n=r.shaderProgram.vertexShaderSource.clone(),o=void 0;(o=r$15.shallowClone(r,o)).uniformMap.uTransparentFilter=function(){return e.selectionFiltrateByTransparency},o.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:this._attributeLocations}),this._pickRectCommand=o}},_0x1f65d5.prototype.prepareLabels=function(){if(!this._labelReady){var e=this._pickInfo,t=this._vertexPackage;if(e$28(e)&&Object.keys(e).length===t.verticesCount&&"InstanceModel"!==this._layer._dataType){for(var i in e)!e.hasOwnProperty(i)||"0"===i||(this._pickIDArray.push(i),this._labelsCreated[i]=!1);this._layer._labelCollection;var r,n,o=new t$X,a=t.vertexAttributes[0],s=a.componentsPerAttribute,l=e$28(t.nCompressOptions)&&(t.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,u=1;if(e$28(a.typedArray)){l?(u=t.vertCompressConstant,r=new t$X(t.minVerticesValue.x,t.minVerticesValue.y,t.minVerticesValue.z),n=new Uint16Array(a.typedArray.buffer,a.typedArray.byteOffset,a.typedArray.byteLength/2)):n=new Float32Array(a.typedArray.buffer,a.typedArray.byteOffset,a.typedArray.byteLength/4);for(var c=this._matModel,h=0;h<t.verticesCount;h++)t$X.fromArray(n,s*h,o),l&&(o=t$X.multiplyByScalar(o,u,o),o=t$X.add(o,r,o)),y$15.multiplyByPoint(c,o,o),this._labelPosArray.push(t$X.clone(o));this._labelTextArray=new Array(this._labelPosArray.length),this._labelReady=!0}}}},_0x1f65d5.prototype.isNoExistAllLabels=function(){var e=this._layer._labelCollection;if(0===e._labels.length)return!0;for(var t=!0,i=0;i<this._labelPosArray.length;i++){var r=this._pickIDArray[i];if(e._labelsID.hasOwnProperty(r)){t=!1;break}}return t};var _0x25aa77=new o$1k;_0x1f65d5.prototype.updateLabels=function(e){if(e.camera,this.isNoExistAllLabels()&&e$28(this._labelIndexs)&&Object.keys(this._labelIndexs).length>0&&(this._labelIndexs={}),e$28(this._layer._layerScheduler._indexedDBScheduler)&&0!==this._pickIDArray.length&&0!==this._labelPosArray.length&&!(this._labelPosArray.length<=Object.keys(this._labelIndexs).length)){var t=this._layer,i=t._labelCollection,r=[],n=t._iconCollection,o=[],a=k$_.RELATIVE_TO_GROUND;if(t.showIcon){if(!e$28(t.style3D)||!t.style3D.imageReady)return;a=t.style3D.altitudeMode,t._showLabel&&(_0x25aa77.y=-t.style3D.image.height/2,a=t._s3MTilesLabelStyle.heightReference)}t._s3MTilesLabelStyle._textField;for(var s=0;s<this._labelPosArray.length;s++){var l=this._pickIDArray[s];if(l=Number(l),this._labelsCreated[l]){var u=this._labelPosArray[s],c=this._labelTextArray[s];if(i.containsLabel(l))this._labelIndexs.hasOwnProperty(l)||(this._labelIndexs[l]=!0);else{var h=n.add({position:u,id:l,image:t.style3D.image,billboardStyle:t.style3D,heightReference:a,show:!0});o.push(h._index);var d=i.add({position:u,id:l,text:c,s3MTilesLabelStyle:t._s3MTilesLabelStyle,pixelOffset:_0x25aa77,show:!1});r.push(d._index)}}else _0x171fd2(t,l,this,s)}for(var f=0,p=r.length;f<p;f++)this._labelIndexs[l]=!0}},_0x1f65d5.prototype.pushCommandsForPickRectBuffer=function(e,t){"FresnelVp"===this._colorCommand.shaderProgram.vertexShaderSource.name||"FresnelFp"===this._colorCommand.shaderProgram.fragmentShaderSource.name||!e$28(this._pickRectCommand)||t.push(this._pickRectCommand)},_0x1f65d5.prototype.pushCommandsForSpatialQueryBuffer=function(e,t,i){if(e._spatialQueryEnable&&"FresnelVp"!==this._colorCommand.shaderProgram.vertexShaderSource.name&&"FresnelFp"!==this._colorCommand.shaderProgram.fragmentShaderSource.name){if(!e$28(this._spatialQueryCommand)){var r=this._colorCommand,n=r.shaderProgram.vertexShaderSource.clone();n.defines.push("SQRESULT");var o=new a$$({name:"SpatialQueryFp",sources:[z$m]});o.defines.push("SQRESULT");var a=r$15.shallowClone(r);a.uniformMap.uTransparentFilter=function(){return e.selectionFiltrateByTransparency},a.uniformMap.uFrontDepthTexture=function(){return e._sqTextures[0]},a.uniformMap.uBackDepthTexture=function(){return e._sqTextures[1]},a.uniformMap.uFrontColorTexture=function(){return e._sqTextures[2]},a.uniformMap.uSQMode=function(){return e._sqMode};var s=new y$15,l=this._matModel;a.uniformMap.uSQViewProj=function(){var t=new y$15;return y$15.multiply(e._sqViewMatirx,l,t),y$15.multiply(e._sqPrjMatirx,t,s),s},a.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._spatialQueryCommand=a,a.owner="sqResultTexture"}t.push(this._spatialQueryCommand)}},_0x1f65d5.prototype.pushCommandsForRasterHeightMap=function(e,t,i){if(e$28(this._colorCommand)){if(!e$28(this._rasterHeightCommand)){var r=r$15.shallowClone(this._colorCommand,new r$15),n=this._colorCommand.shaderProgram.vertexShaderSource.clone(),o=this._colorCommand.shaderProgram.fragmentShaderSource.clone();n.defines.push("Height_Map"),o.defines.push("Height_Map"),n.defines.push("COMPUTE_W_VALUE"),o.defines.push("COMPUTE_W_VALUE"),r.shaderProgram=S$T.fromCache({context:e.context,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._rasterHeightCommand=r}i.push(this._rasterHeightCommand)}},_0x1f65d5.prototype.setImagerys=function(e,t){if(this._cartographic=t,this._imagerys=e,e$28(e))if(e$28(this._sp)){for(var i=this._sp.fragmentShaderSource,r=-1,n=0;n<i.defines.length;n++)if(i.defines[n].includes("TEXTURE_UNITS")){r=n;break}r<0&&this._imagerys.length>0||e$28(this._dayTextures)&&e.length>this._dayTextures.length||!e$28(this._dayTextures)?this._refreshImageryShader():this._computeImageryParameter(this._layer)}else this._computeImageryParameter(this._layer)},_0x1f65d5.prototype.hasScaleImagerys=function(e){return e$28(this._scaleImagerys[e-1])},_0x1f65d5.prototype.setScaleImagerys=function(e,t){!e$28(e)||t<1||(this._scaleImagerys[t-1]=e)},_0x1f65d5.prototype.resetScaleImagerys=function(e,t){if(this._imageRasterFinish&&e$28(this._sp)){if(this._scaleImagerys.length>e){for(var i=e;i<this._scaleImagerys.length;i++){if(e$28(a=this._scaleImagerys[i]))for(var r=0;r<a.length;r++)a[r].releaseReference()}this._scaleImagerys.length=e}if(this._plusRoArray.length>e){for(i=e;i<this._plusRoArray.length;i++){if(e$28(H=this._plusRoArray[i]))for(r=0;r<H.length;r++)H[r].uniformMap=void 0,H[r].shaderProgram.destroy()}this._plusRoArray.length=e}var n=void 0;for(i=0;i<this._scaleImagerys.length;i++){if(e$28(a=this._scaleImagerys[i])){var o=!0;for(r=0;r<a.length;r++)a[r].processStateMachine(t,!1),a[r]instanceof _0x364a72?a[r].state===_t$6.RENDERED||a[r].state===_t$6.READY||a[r].state===_t$6.FAILED||(o=!1):a[r].state<_t$6.TEXTURE_LOADED&&(o=!1);o&&(n=i)}}if(n!=this._visibleScaleImageryIndex){var a=void 0;if(e$28(n)&&(a=this._scaleImagerys[n]),e$28(n)&&e$28(a)&&a.length>0){if(this._visibleScaleImageryIndex=n,!e$28(this._plusRoArray[n])){var s=this._layer,l=this._sp.fragmentShaderSource.clone();for(i=0;i<l.defines.length;i++)if(l.defines[i].includes("GRIDTEXTURE_UNITS")){l.defines.splice(i,1);break}for(i=0;i<l.defines.length;i++)if(l.defines[i].includes("TEXTURE_UNITS")){l.defines.splice(i,1);break}for(i=0;i<l.defines.length;i++)if(l.defines[i].includes("APPLY_ALPHA")){l.defines.splice(i,1);break}for(i=0;i<l.sources.length;i++)if(l.sources[i].includes("czm_sampleAndBlend")){l.sources.splice(i,1);break}var u=this._sp.vertexShaderSource.clone(),c=!1;for(i=0;i<u.defines.length;i++)if(u.defines[i].includes("IMAGERY")){c=!0;break}c||u.defines.push("IMAGERY");for(var h=0,d=a.length,f=0;d>0;){var p,_=d;p=0===(d-=_=Math.min(_,e$1U._maximumTextureImageUnits-2))?l:l.clone(),h>0&&p.defines.push("MULTIBATCH");var m=[],$=[],g=[],v=[],y=[],x=[],b=[],w=[],C=!1;e$28(_0x37ebcb)||(_0x37ebcb=new h$10),_0x37ebcb.west=this._cartographic.min.longitude,_0x37ebcb.east=this._cartographic.max.longitude,_0x37ebcb.north=this._cartographic.max.latitude,_0x37ebcb.south=this._cartographic.min.latitude,this._imageryTextureBound.x=this._cartographic.max.longitude-this._cartographic.min.longitude,this._imageryTextureBound.y=this._cartographic.max.latitude-this._cartographic.min.latitude;for(i=0;i<_;i++){var T=a[f+i],S=T.imageryLayer,E=S._imageryProvider.tilingScheme.projection instanceof t$M&&_0x37ebcb.north<t$M.MaximumLatitude&&_0x37ebcb.south>-t$M.MaximumLatitude;$.push(E);var A=E?T.textureWebMercator:T.texture;e$28(A)||(A=s._context.defaultTransparentTexture),m.push(A);var P=u$Y(S._imageryProvider.flipY,!1);b.push(P);var I=this._calculateTextureTranslationAndScale(_0x37ebcb,T.rectangle,E,S._imageryProvider._tilingScheme),M=this._calculateTextureTexCoordsRectangle(_0x37ebcb,T.rectangle,E,S._imageryProvider._tilingScheme);g.push(M),v.push(I);var O=new e$25;O.x=S.transparentBackColor.red,O.y=S.transparentBackColor.green,O.z=S.transparentBackColor.blue,O.w=S.transparentBackColorTolerance,y.push(O),x.push(S.enableImageryClip),w.push(S.alpha),C=C||S.alpha<.999}f+=_;var D="",R="";(L=!1)&&(R="APPLY_IMAGERY_CUTOUT");var L,B=[],N={mixIndex:!0,mixDirection:0},F="#ifdef IMAGERY\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n{\nvec4 color = initialColor;\n";(L=!1)&&(F+="vec4 cutoutAndColorResult;\nbool texelUnclipped;\n");for(i=0;i<_;++i){var z=_0x1d293a(B,i);if(e$28(z)){var k=i+1;k==_&&(k=i),F+="color = mvtTextureSampleAndBlend(\ncolor,\nu_dayTextures["+i+"],\nu_dayTextures["+k+"],\nu_dayTextureUseWebMercatorT["+i+"] ? textureCoordinates.xz : textureCoordinates.xy,\nu_dayTextureTexCoordsRectangle["+i+"],\nu_dayTextureTranslationAndScale["+i+"],\n"+converColorToVec4(z)+",\n"+(this._applyAlpha?"u_dayTextureAlpha["+i+"]":"1.0")+",\n0.0,\nvec4(0.0,0.0,0.0,0.0)\n);\n",i++}else F+=L?"cutoutAndColorResult = u_dayTextureCutoutRectangles["+i+"];\ntexelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\ncutoutAndColorResult = czm_sampleAndBlend(\n":i===N.mixIndex&&N.mixDirection>0?"color = sampleAndBlendParent(\n":"color = czm_sampleAndBlend(\n",F+="color,\nu_dayTextures["+i+"],\nu_dayTextureUseWebMercatorT["+i+"] ? textureCoordinates.xz : textureCoordinates.xy,\nu_dayTextureTexCoordsRectangle["+i+"],\nu_dayTextureTranslationAndScale["+i+"],\nu_transparentBackColor["+i+"],\nu_imageryClipEnable["+i+"],\nu_dayTextureFlipY["+i+"],\n"+(this._applyAlpha?"u_dayTextureAlpha["+i+"]":"1.0")+",\n0.0,\n0.0,\n0.0,\n0.0,\n0.0,\nvec2(0.0,0.0),\nvec4(0.0,0.0,0.0,0.0),\n0.0\n);\n",L&&(F+="color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n")}for(i=0;i<0;++i)F+="color = gridTextureSampleAndBlend(\ncolor,\nu_gridTextures["+i+"],\nu_gridTextureUseWebMercatorT["+i+"] ? textureCoordinates.xz : textureCoordinates.xy,\nu_gridTextureTexCoordsRectangle["+i+"],\nu_gridTextureTranslationAndScale["+i+"]);\n";F+="return color;\n}\n#endif",p.sources.push(F);for(c=!1,i=0;i<p.defines.length;i++)if(p.defines[i].includes("IMAGERY")){c=!0;break}c||p.defines.push("IMAGERY"),this._applyAlpha&&p.defines.push("APPLY_ALPHA"),p.defines.push("TEXTURE_UNITS "+_),""!=D&&p.defines.push(D),""!=R&&p.defines.push(R),p.defines.push("GRIDTEXTURE_UNITS 0");var V=this._sp._attributeLocations,U=S$T.fromCache({context:s._context,vertexShaderSource:u,fragmentShaderSource:p,attributeLocations:V}),X=this;(function(e){var t=l$1e(X._colorCommand._uniformMap),i=X._plusRoArray;t.u_dayTextures=function(){return i[n][e].dayTextures},t.u_dayTextureUseWebMercatorT=function(){return i[n][e].dayTextureUseWebMercatorT},t.u_dayTextureTexCoordsRectangle=function(){return i[n][e].dayTextureTexCoordsRectangle},t.u_dayTextureTranslationAndScale=function(){return i[n][e].dayTextureTranslationAndScale},t.u_transparentBackColor=function(){return i[n][e].transparentBackColor},t.u_imageryClipEnable=function(){return i[n][e].imageryClipEnable},t.u_dayTextureFlipY=function(){return i[n][e].dayTextureFlipY},t.u_dayTextureAlpha=function(){return i[n][e].dayTextureAlpha};var r=r$15.shallowClone(X._colorCommand);r.shaderProgram=U,r._uniformMap=t;var o={command:r,shaderProgram:U,uniformMap:t,dayTextures:m,dayTextureUseWebMercatorT:$,dayTextureTexCoordsRectangle:g,dayTextureTranslationAndScale:v,transparentBackColor:O,imageryClipEnable:x,dayTextureFlipY:b,dayTextureAlpha:w};e$28(X._plusRoArray[n])||(X._plusRoArray[n]=[]),X._plusRoArray[n].push(o)})(h),h+=1}}}else{this._visibleScaleImageryIndex=void 0;for(i=0;i<this._plusRoArray.length;i++){var H;if(e$28(H=this._plusRoArray[i]))for(r=0;r<H.length;r++)H[r].shaderProgram.destroy(),H[r].uniformMap=void 0}this._plusRoArray=[];l=this._sp.fragmentShaderSource;var G=-1;for(i=0;i<l.defines.length;i++)if(l.defines[i].includes("TEXTURE_UNITS")){G=i;break}G<0&&this._imagerys.length>0||e$28(this._dayTextures)&&this._imagerys.length>this._dayTextures.length||!e$28(this._dayTextures)?this._refreshImageryShader():this._computeImageryParameter(this._layer)}}}};var _0x459be0=new t$X,_0x5a31f2=new t$X,_0x1252bf=new t$X;_0x1f65d5.prototype.setRealtimeRasterCamera=function(e,t){var i=f$10.clone(t.context.uniformState._viewport);this._imageryTextureBound.x=e.max.longitude-e.min.longitude,this._imageryTextureBound.y=e.max.latitude-e.min.latitude;var r=e$27.toDegrees(e.min.longitude),n=e$27.toDegrees(e.max.longitude),o=e$27.toDegrees(e.max.latitude),a=e$27.toDegrees(e.min.latitude),s=n-r,l=o-a,u=t.camera,c=u.frustum.clipPlane;1===t._fboState.frameBufferType&&u.disableReflection(),t$X.clone(u.position,_0x459be0),t$X.clone(u.direction,_0x5a31f2),t$X.clone(u.up,_0x1252bf);var h=u._scene._mode;u._mode=P$$.SCENE3D,u._scene._mode=P$$.SCENE3D,u.setView({destination:new t$X(.5*(r+n),.5*(o+a),50),orientation:{direction:new t$X(0,0,-1),up:new t$X(0,1,0)},convert:!1}),u._mode=h,u._scene._mode=h;var d=new a$X({width:s,aspectRatio:s/l,near:1,far:100});return t.context.uniformState.update(t),t.context.uniformState.updateFrustum(d),{position:_0x459be0,direction:_0x5a31f2,upDirection:_0x1252bf,viewport:i,waterPlane:c}},_0x1f65d5.prototype.resetCamera=function(e,t){var i=t.camera;1===t._fboState.frameBufferType&&e.waterPlane&&i.enableReflection(e.waterPlane),i.setView({destination:e.position,orientation:{direction:e.direction,up:e.upDirection},convert:!1}),t.context.uniformState.update(t),t.context.uniformState.updateFrustum(i.frustum),t.context.uniformState.viewport=e.viewport},_0x1f65d5.prototype.isImageryLoaded=function(){for(var e=!0,t=this._imagerys.length,i=0;i<t;i++)this._imagerys[i]instanceof _0x364a72?this._imagerys[i].state===_t$6.RENDERED||this._imagerys[i].state===_t$6.READY||this._imagerys[i].state===_t$6.FAILED||(e=!1):this._imagerys[i].state<_t$6.TEXTURE_LOADED&&(e=!1);return e},_0x1f65d5.prototype.updateImageryTexture=function(e,t){if(this.isImageryLoaded()){for(var i=[],r=0;r<this._imagerys.length;r++)e$28(this._imagerys[r].texture)&&i.push(this._imagerys[r]);i.length>0&&(this._imageRasterFinish=!0,this._computeImageryParameter(e))}else{this._imageryLevels.length!=this._imagerys.length&&(this._imageryLevels.length=this._imagerys.length);i=[];var n=[];for(r=0;r<this._imagerys.length;r++){for(var o=this._imagerys[r],a=o.rectangle;o.state!=_t$6.READY&&e$28(o.parent)&&o.imageryLayer._imageryProvider.minimumLevel<o.level;)o=o.parent;e$28(o.texture)&&o.state==_t$6.READY&&(i.push(o),n.push(a))}var s=!1;if(i.length==this._imagerys.length)for(r=0;r<i.length;r++)i[r].level!=this._imageryLevels[r]&&(s=!0,this._imageryLevels[r]=i[r].level);s&&i.length>0&&this._computeImageryParameter(e,i,n)}};var _0x536057=new h$10,_0x42a0c3=new h$10;_0x1f65d5.prototype._calculateTextureTranslationAndScale=function(e,t,i,r){var n=t,o=e;i&&(n=r.rectangleToNativeRectangle(n,_0x536057),o=r.rectangleToNativeRectangle(o,_0x42a0c3));var a=o.width,s=o.height,l=a/n.width,u=s/n.height;return new e$25(l*(o.west-n.west)/a,u*(o.south-n.south)/s,l,u)},_0x1f65d5.prototype._calculateTextureTexCoordsRectangle=function(e,t,i,r){var n=t,o=e;i&&(n=r.rectangleToNativeRectangle(n,_0x536057),o=r.rectangleToNativeRectangle(o,_0x42a0c3));var a=o.width,s=o.height;return new e$25((n.west-o.west)/a,(n.south-o.south)/s,(n.east-o.west)/a,(n.north-o.south)/s)};var _0x37ebcb=void 0,_0x232af2=new e$25;function _0x1d293a(e,t){if(!e$28(e)||0==e.length)return null;for(var i=e.length,r=0;r<i;r++)if(e[r].textureIndex===t)return e[r].selectColor;return null}_0x1f65d5.prototype._computeImageryParameter=function(e,t,i){var r=t;e$28(r)||(r=this._imagerys);var n=0;e$28(this._dayTextures)&&this._dayTextures.length>0&&(n=this._dayTextures.length-r.length),this._dayTextures=[],this._dayTextureUseWebMercatorT=[],this._dayTextureTexCoordsRectangle=[],this._dayTextureTranslationAndScale=[],this._transparentBackColor=[],this._imageryClipEnable=[],this._dayTextureFlipY=[],this._dayTextureAlpha=[],this._applyAlpha=!1,e$28(_0x37ebcb)||(_0x37ebcb=new h$10),_0x37ebcb.west=this._cartographic.min.longitude,_0x37ebcb.east=this._cartographic.max.longitude,_0x37ebcb.north=this._cartographic.max.latitude,_0x37ebcb.south=this._cartographic.min.latitude,this._imageryTextureBound.x=this._cartographic.max.longitude-this._cartographic.min.longitude,this._imageryTextureBound.y=this._cartographic.max.latitude-this._cartographic.min.latitude;for(var o=0;o<r.length;o++){var a=r[o].imageryLayer,s=a._imageryProvider.tilingScheme.projection instanceof t$M&&_0x37ebcb.north<t$M.MaximumLatitude&&_0x37ebcb.south>-t$M.MaximumLatitude;this._dayTextureUseWebMercatorT.push(s);var l=s?r[o].textureWebMercator:r[o].texture;e$28(l)||(l=e._context.defaultTransparentTexture),this._dayTextures.push(l);var u=u$Y(a._imageryProvider.flipY,!1);this._dayTextureFlipY.push(u);var c,h=this._calculateTextureTranslationAndScale(_0x37ebcb,r[o].rectangle,s,a._imageryProvider._tilingScheme);c=e$28(i)?this._calculateTextureTexCoordsRectangle(_0x37ebcb,i[o],s,a._imageryProvider._tilingScheme):this._calculateTextureTexCoordsRectangle(_0x37ebcb,r[o].rectangle,s,a._imageryProvider._tilingScheme),this._dayTextureTexCoordsRectangle.push(c),this._dayTextureTranslationAndScale.push(h);var d=new e$25;d.x=a.transparentBackColor.red,d.y=a.transparentBackColor.green,d.z=a.transparentBackColor.blue,d.w=a.transparentBackColorTolerance,this._transparentBackColor.push(d),this._imageryClipEnable.push(a.enableImageryClip),this._dayTextureAlpha.push(a.alpha),this._applyAlpha=this._applyAlpha||a.alpha<.999}if(n>0)for(o=0;o<n;o++)this._dayTextures.push(e._context.defaultTransparentTexture),this._dayTextureUseWebMercatorT.push(!1),this._dayTextureTexCoordsRectangle.push(_0x232af2),this._dayTextureTranslationAndScale.push(_0x232af2),this._transparentBackColor.push(_0x232af2),this._imageryClipEnable.push(!1),this._dayTextureFlipY.push(!1),this._dayTextureAlpha.push(1)},_0x1f65d5.prototype._createImageryShader=function(e,t){if(e$28(this._imagerys)&&this._imagerys.length>0){this._computeImageryParameter(e);var i="",r="";(o=!1)&&(r="APPLY_IMAGERY_CUTOUT");var n=this._imagerys.length;n=Math.min(n,e$1U._maximumTextureImageUnits-2);var o,a=[],s={mixIndex:!0,mixDirection:0},l="#ifdef IMAGERY\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n{\n vec4 color = initialColor;\n";(o=!1)&&(l+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var u=0;u<n;++u){var c=_0x1d293a(a,u);if(e$28(c)){var h=u+1;h==n&&(h=u),l+=" color = mvtTextureSampleAndBlend(\n color,\n u_dayTextures["+u+"],\n u_dayTextures["+h+"],\n u_dayTextureUseWebMercatorT["+u+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+u+"],\n u_dayTextureTranslationAndScale["+u+"],\n "+converColorToVec4(c)+",\n "+(this._applyAlpha?"u_dayTextureAlpha["+u+"]":"1.0")+",\n 0.0,\n vec4(0.0,0.0,0.0,0.0)\n );\n",u++}else l+=o?" 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 = czm_sampleAndBlend(\n":u===s.mixIndex&&s.mixDirection>0?" color = sampleAndBlendParent(\n":" color = czm_sampleAndBlend(\n",l+=" color,\n u_dayTextures["+u+"],\n u_dayTextureUseWebMercatorT["+u+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+u+"],\n u_dayTextureTranslationAndScale["+u+"],\n u_transparentBackColor["+u+"],\n u_imageryClipEnable["+u+"],\n u_dayTextureFlipY["+u+"],\n "+(this._applyAlpha?"u_dayTextureAlpha["+u+"]":"1.0")+",\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n 0.0,\n vec2(0.0,0.0),\n vec4(0.0,0.0,0.0,0.0),\n 0.0\n );\n",o&&(l+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n")}for(u=0;u<0;++u)l+=" color = gridTextureSampleAndBlend(\n color,\n u_gridTextures["+u+"],\n u_gridTextureUseWebMercatorT["+u+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_gridTextureTexCoordsRectangle["+u+"],\n u_gridTextureTranslationAndScale["+u+"]);\n";l+=" return color;\n}\n#endif",t.sources.push(l);var d=!1;for(u=0;u<t.defines.length;u++)if(t.defines[u].includes("IMAGERY")){d=!0;break}d||t.defines.push("IMAGERY"),this._applyAlpha&&t.defines.push("APPLY_ALPHA"),t.defines.push("TEXTURE_UNITS "+n),""!=i&&t.defines.push(i),""!=r&&t.defines.push(r),t.defines.push("GRIDTEXTURE_UNITS 0")}},_0x1f65d5.prototype._refreshImageryShader=function(){for(var e=this._layer,t=this._sp.fragmentShaderSource.clone(),i=this._sp.vertexShaderSource.clone(),r=0;r<t.defines.length;r++)if(t.defines[r].includes("GRIDTEXTURE_UNITS")){t.defines.splice(r,1);break}for(r=0;r<t.defines.length;r++)if(t.defines[r].includes("TEXTURE_UNITS")){t.defines.splice(r,1);break}for(r=0;r<t.defines.length;r++)if(t.defines[r].includes("APPLY_ALPHA")){t.defines.splice(r,1);break}for(r=0;r<t.sources.length;r++)if(t.sources[r].includes("czm_sampleAndBlend")){t.sources.splice(r,1);break}this._createImageryShader(e,t);var n=!1;for(r=0;r<i.defines.length;r++)if(i.defines[r].includes("IMAGERY")){n=!0;break}n||i.defines.push("IMAGERY");var o=this._sp._attributeLocations;this._sp=this._sp&&this._sp.destroy();var a=S$T.fromCache({context:e._context,vertexShaderSource:i,fragmentShaderSource:t,attributeLocations:o});this._sp=a,e$28(this._colorCommand)&&(this._colorCommand.shaderProgram=a)};var _0x2a584f=(_0x3825d8=!0,function(e,t){var i=_0x3825d8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3825d8=!1,i}),_0x27b03f=_0x2a584f(void 0,(function(){return _0x27b03f.toString().search("(((.+)+)+)+$").toString().constructor(_0x27b03f).search("(((.+)+)+)+$")})),_0x3825d8;function _0x4327f2(){}function _0x680da2(e){var t=new i$19,i=e.instanceBounds;if(!e$28(i))return t;var r=new t$X(i[0],i[1],i[2]),n=new t$X(i[3],i[4],i[5]),o=t$X.lerp(r,n,.5,new t$X),a=t$X.distance(o,r);return t.center=o,t.radius=a,t}function _0x10755d(e){var t,i,r=new i$19,n=new t$X,o=e.vertexAttributes[0],a=o.componentsPerAttribute,s=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,l=1;s?(l=e.vertCompressConstant,t=new t$X(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),i=new Uint16Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/2)):i=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);for(var u=[],c=0;c<e.verticesCount;c++)t$X.fromArray(i,a*c,n),s&&(n=t$X.multiplyByScalar(n,l,n),n=t$X.add(n,t,n)),u.push(t$X.clone(n));return i$19.fromPoints(u,r),u.length=0,r}function _0x90edaa(e){var t,i,r=new i$19,n=new t$X,o=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,a=e.vertexAttributes[0],s=a.componentsPerAttribute,l=1;o?(l=e.vertCompressConstant,i=new t$X(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(a.typedArray.buffer,a.typedArray.byteOffset,a.typedArray.byteLength/2)):t=new Float32Array(a.typedArray.buffer,a.typedArray.byteOffset,a.typedArray.byteLength/4);for(var u=[],c=0;c<e.verticesCount;c++)t$X.fromArray(t,s*c,n),o&&(n=t$X.multiplyByScalar(n,l,n),n=t$X.add(n,i,n)),u.push(t$X.clone(n));return i$19.fromPoints(u,r),u.length=0,r}function _0x54778e(e){var t,i,r=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,n=new f$10,o=e.vertexAttributes[0],a=o.componentsPerAttribute,s=1;r?(s=e.vertCompressConstant,i=new t$X(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),t=new Uint16Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/2)):t=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);for(var l=[],u=0;u<e.verticesCount;u++){var c=t[a*u],h=t[a*u+1];r&&(c=s*c+i.x,h=s*h+i.y),l.push(new o$1k(c,h))}return f$10.fromPoints(l,n),l.length=0,n}function _0x219273(e){var t,i,r=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,n=new i$19,o=new t$X,a=new t$X,s=e.vertexAttributes[0],l=s.componentsPerAttribute,u=e.attrLocation.aPosition,c=e.vertexAttributes[u],h=e.attrLocation.aTexCoord5,d=e.vertexAttributes[h],f=d.componentsPerAttribute;r?(l=3,f=3,t=_0x1ea30c(e,c),i=_0x32b3ca(e,d,5)):(t=new Float32Array(s.typedArray.buffer,s.typedArray.byteOffset,s.typedArray.byteLength/4),i=new Float32Array(d.typedArray.buffer,d.typedArray.byteOffset,d.typedArray.byteLength/4));for(var p=[],_=0;_<e.verticesCount;_++)t$X.fromArray(t,l*_,o),t$X.fromArray(i,f*_,a),t$X.add(o,a,o),p.push(t$X.clone(o));return i$19.fromPoints(p,n),p.length=0,n}function _0x25cc0a(e){var t=W$_.TRIANGLES;switch(e){case 1:t=W$_.POINTS;break;case 2:t=W$_.LINES;break;case 3:t=W$_.LINE_STRIP;break;case 4:t=W$_.TRIANGLES}return t}function _0x186bdc(e,t,i,r){var n,o={};o.indicesCount=6*(e-t),o.indexType=r>65535?1:0,o.primitiveType=W$_.TRIANGLES,n=0===o.indexType?new Uint16Array(o.indicesCount):new Uint32Array(o.indicesCount);for(var a=0,s=0;s<t;s++){for(var l=0;l<i[s]-1;l++)n[6*(a-s+l)]=4*(a-s+l),n[6*(a-s+l)+1]=4*(a-s+l)+2,n[6*(a-s+l)+2]=4*(a-s+l)+1,n[6*(a-s+l)+3]=4*(a-s+l)+1,n[6*(a-s+l)+4]=4*(a-s+l)+2,n[6*(a-s+l)+5]=4*(a-s+l)+3;a+=i[s]}return o.indicesTypedArray=n,o}function _0x1ea30c(e,t){for(var i,r,n,o=t.componentsPerAttribute,a=e.vertCompressConstant,s=new t$X(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),l=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),u=new Float32Array(3*e.verticesCount),c=0;c<e.verticesCount;c++)i=l[o*c]*a+s.x,r=l[o*c+1]*a+s.y,n=l[o*c+2]*a+s.z,u[3*c]=i,u[3*c+1]=r,u[3*c+2]=n;return u}function _0x32b3ca(e,t,i){for(var r,n,o,a=t.componentsPerAttribute,s=e.texCoordCompressConstant[i],l=new e$25(e.minTexCoordValue[i].x,e.minTexCoordValue[i].y,e.minTexCoordValue[i].z,e.minTexCoordValue[i].w),u=new Uint16Array(t.typedArray.buffer,t.typedArray.byteOffset,t.typedArray.byteLength/2),c=new Float32Array(3*e.verticesCount),h=0;h<e.verticesCount;h++)r=u[a*h]*s+l.x,n=u[a*h+1]*s+l.y,o=u[a*h+2]*s+l.z,c[3*h]=r,c[3*h+1]=n,c[3*h+2]=o;return c}function _0x1e68b8(e){for(var t=[],i=e.length,r=0;r<i;r++){var n=_0x25cc0a(e[r].primitiveType);(n===W$_.LINES||n===W$_.LINE_STRIP)&&t.push(e[r])}return t}function _0x512d8a(e){for(var t=0,i=e.length,r=0;r<i;r++){var n=e[r],o=_0x25cc0a(n.primitiveType);o==W$_.LINES?t+=n.indicesCount/2:o==W$_.LINE_STRIP&&t++}return t}function _0x392fd4(e){for(var t=0,i=e.length,r=0;r<i;r++){t+=e[r].indicesCount}return t}function _0x231c51(e,t,i){for(var r,n=[],o=i.length,a=0;a<o;a++){var s,l=i[a];s=0===l.indexType?new Uint16Array(l.indicesTypedArray.buffer,l.indicesTypedArray.byteOffset,l.indicesTypedArray.byteLength/2):new Uint32Array(l.indicesTypedArray.buffer,l.indicesTypedArray.byteOffset,l.indicesTypedArray.byteLength/4);var u=_0x25cc0a(l.primitiveType);if(u==W$_.LINES)for(r=0;r<l.indicesCount;r+=2){var c=[],h=new t$X;h.x=e[s[r]*t],h.y=e[s[r]*t+1],h.z=e[s[r]*t+2],c.push(h);var d=new t$X;d.x=e[s[r+1]*t],d.y=e[s[r+1]*t+1],d.z=e[s[r+1]*t+2],c.push(d),n.push(c)}else if(u==W$_.LINE_STRIP){c=[];for(r=0;r<l.indicesCount;r++){var f=new t$X;f.x=e[s[r]*t],f.y=e[s[r]*t+1],f.z=e[s[r]*t+2],c.push(f)}n.push(c)}}return n}_0x27b03f(),_0x4327f2.calcBoundingSphereInWorker=function(e,t){return t.instanceIndex>-1?_0x680da2(t):e$28(t.clampRegionEdge)?_0x219273(t):e>=f$r.ClampGroundPolygon&&e<=f$r.ClampObjectLine?_0x90edaa(t):e==f$r.ClampGroundAndObjectLineCache?_0x219273(t):_0x10755d(t)},_0x4327f2.calcBoundingSphere=function(e,t,i){var r,n=e._fileType;return r=t.instanceIndex>-1?_0x680da2(t):e$28(t.clampRegionEdge)?_0x219273(t):n>=f$r.ClampGroundPolygon&&n<=f$r.ClampObjectLine?_0x90edaa(t):n==f$r.ClampGroundAndObjectLineCache?_0x219273(t):_0x10755d(t),i$19.transform(r,i,r),r},_0x4327f2.calcBoundingRectangle=function(e,t){var i;return e._fileType===f$r.ClampGroundPolygon&&(i=_0x54778e(t)),i},_0x4327f2.createEdge=function(e,t){if(!(t.length<1)){var i=_0x1e68b8(t);if(0!=i.length){var r,n=_0x512d8a(i),o=e.attrLocation.aPosition,a=e.vertexAttributes[o],s=e$28(e.nCompressOptions)&&(e.nCompressOptions&_0x33a28d.SVC_Vertex)===_0x33a28d.SVC_Vertex,l=a.componentsPerAttribute;s?(l=3,r=_0x1ea30c(e,a)):r=new Float32Array(a.typedArray.buffer,a.typedArray.byteOffset,a.typedArray.byteLength/4);for(var u=_0x392fd4(i),c=_0x231c51(r,l,i),h=4*u-4*n,d=new Float32Array(3*h),f=new Float32Array(3*h),p=new Float32Array(3*h),_=new Int8Array(2*h),m=0,$=0;$<n;$++){for(var g=c[$].length,v=0;v<g;v++){var y=4*m-4*$,x=3*y+12*v,b=c[$][v];0!=v&&(d[x-6]=b.x,d[x-5]=b.y,d[x-4]=b.z,d[x-3]=b.x,d[x-2]=b.y,d[x-1]=b.z),v!=g-1&&(d[x]=b.x,d[x+1]=b.y,d[x+2]=b.z,d[x+3]=b.x,d[x+4]=b.y,d[x+5]=b.z);var w=b;v+1<g&&(w=c[$][v+1]),0!=v&&(p[x-6]=w.x,p[x-5]=w.y,p[x-4]=w.z,p[x-3]=w.x,p[x-2]=w.y,p[x-1]=w.z),v!=g-1&&(p[x]=w.x,p[x+1]=w.y,p[x+2]=w.z,p[x+3]=w.x,p[x+4]=w.y,p[x+5]=w.z);var C=b;v>=1&&(C=c[$][v-1]),0!=v&&(f[x-6]=C.x,f[x-5]=C.y,f[x-4]=C.z,f[x-3]=C.x,f[x-2]=C.y,f[x-1]=C.z),v!=g-1&&(f[x]=C.x,f[x+1]=C.y,f[x+2]=C.z,f[x+3]=C.x,f[x+4]=C.y,f[x+5]=C.z),x=2*y+8*v,0!=v&&(_[x-4]=-1,_[x-3]=-1,_[x-2]=1,_[x-1]=-1),v!=g-1&&(_[x]=-1,_[x+1]=1,_[x+2]=1,_[x+3]=1)}m+=c[$].length}var T={vertexAttributes:[],attrLocation:{}},S=T.vertexAttributes,E=T.attrLocation;T.instanceCount=0,T.instanceMode=0,E.aPosition=0,S.push({index:E.aPosition,typedArray:d,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),E.aNormal=1,S.push({index:E.aNormal,typedArray:f,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),E.aTexCoord0=2,S.push({index:E.aTexCoord0,typedArray:p,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),E.aTexCoord1=3,S.push({index:E.aTexCoord1,typedArray:_,componentsPerAttribute:2,componentDatatype:S$W.BYTE,offsetInBytes:0,strideInBytes:2*Int8Array.BYTES_PER_ELEMENT,normalize:!1});for(var A=[],P=0;P<c.length;P++)A.push(c[P].length);return{vertexPackage:T,indexPackage:_0x186bdc(u,n,A,h)}}}};var _0x1c632d=(_0x3df7cd=!0,function(e,t){var i=_0x3df7cd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3df7cd=!1,i}),_0x528b77=_0x1c632d(void 0,(function(){return _0x528b77.toString().search("(((.+)+)+)+$").toString().constructor(_0x528b77).search("(((.+)+)+)+$")})),_0x3df7cd;function _0x3e8cbd(){}_0x528b77(),Object.defineProperties(_0x3e8cbd.prototype,{});var _0x4eef3c=new e$1S,_0x133b30=e$1S.WHITE,_0x976b00=void 0,_0x528f2d=600;function _0x303252(e,t){var i=[];for(var r in e)if(e.hasOwnProperty(r)&&"0"!==r){var n=new _0x1875be(this,r);Object.assign(n,t._layerScheduler._attributes[r]);var o=e[r];Array.isArray(o)||(o=[o]);for(var a=0,s=o.length;a<s;a++)n.addVertexOffset(o[a].vertexColorCount,o[a].vertexColorOffset);i.push(n)}return i}function _0x2eae9d(e,t){for(var i=t.length,r=!1,n=0;n<i&&!r;n++)for(var o=t[n],a=o.span,s=0;s<a.length;s++){var l=a[s],u=l.vertexOffset,c=l.vertexOffset+l.vertexCount;if(e>=u&&e<c){o.indexValue.push(e),r=!0;break}}}function _0x599d9f(e,t){if(1!=t.length){var i=0,r=e.indicesCount,n=0===e.indexType?Uint16Array:Uint32Array,o=new n(e.indicesTypedArray.buffer,e.indicesTypedArray.byteOffset,r);for(i=0;i<r;i++){_0x2eae9d(o[i],t)}for(i=0;i<t.length;i++){var a,s=t[i],l=s.indexValue.length;a=new n(l);for(var u=0;u<l;u++)a[u]=s.indexValue[u];s.indexPackage={indexType:e.indexType,indicesCount:l,indicesTypedArray:a,materialCode:e.materialCode,primitiveType:e.primitiveType}}}else t[0].indexPackage=e}function _0xfb3f46(e){for(var t=e._array,i=0;i<t.length;i++){var r=t[i],n=r.batchFeatures;if(e$28(n)&&!(n.length<1))for(var o=0;o<n.length;o++){var a=n[o];r.span=r.span.concat(a.getVertexOffset())}}}if(_0x3e8cbd.createRenderEntityPageLOD=function(e,t){var i=t.themeStyle,r=e.pickInfo,n=e.arrIndexPackage;if(this._fileType===f$r.Text&&this.createBillboardsBounds(),!e$28(i)||!e$28(r)||!e$28(i.image))return[new _0x1f65d5(e)];for(var o=_0x303252(r,t),a=new e$1P,s=0;s<o.length;s++){var l=o[s],u=e$28(i.color)?i.color.evaluateColor(l,_0x4eef3c):_0x133b30,c=e$28(i.image)?i.image.evaluate(l):_0x976b00,h=e$28(i.imageRepeatX)?i.imageRepeatX.evaluate(l):_0x528f2d,d=e$28(i.imageRepeatY)?i.imageRepeatY.evaluate(l):_0x528f2d;e$28(h)||(h=_0x528f2d),e$28(d)||(d=_0x528f2d);var f=new o$1k(h,d);l.color=u,l.imageUrl=c;var p=l.getRenderBatchKey();if(!a.contains(p)){var _=new e$1S;_=e$1S.clone(u),a.set(p,{color:_,imageUrl:c,imageRepeat:f,batchFeatures:[],span:[],indexValue:[]})}a.get(p).batchFeatures.push(l)}var m=a._array;_0xfb3f46(a),_0x599d9f(n[0],m);for(var $=[],g=0;g<m.length;g++){e.symbolTextureUrl=m[g].imageUrl,e.symbolColor=m[g].color,e.arrIndexPackage=[m[g].indexPackage],e.symbolTextureRepeat=m[g].imageRepeat;var v=new _0x1f65d5(e);$.push(v)}return $},typeof WebAssembly<"u"){let e=function(e){return n$o.locateFile?n$o.locateFile(e,v$s):v$s+e},t=function(e,t){e||O("Assertion failed: "+t)},i=function(e){var i=n$o["_"+e];return t(i,"Cannot call unknown function "+e+", make sure it is exported"),i},r=function(e,t,r,n,o){var s={string:function(e){var t=0;if(null!=e&&0!==e){var i=1+(e.length<<2);t=en$2(i),l(e,t,i)}return t},array:function(e){var t=en$2(e.length);return u(e,t),t}};var c=i(e),h=[],d=0;if(n)for(var f=0;f<n.length;f++){var p=s[r[f]];p?(0===d&&(d=Kn()),h[f]=p(n[f])):h[f]=n[f]}var _=c.apply(null,h);return _=function(e){return"string"===t?a(e):"boolean"===t?Boolean(e):e}(_),0!==d&&Fn$1(d),_},n=function(e,t,n,o){var a=(n=n||[]).every((function(e){return"number"===e}));return"string"!==t&&a&&!o?i(e):function(){return r(e,t,n,arguments)}},o=function(e,t,i){for(var r=t+i,n=t;e[n]&&!(n>=r);)++n;if(n-t>16&&e.subarray&&O$l)return O$l.decode(e.subarray(t,n));for(var o="";t<n;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|l:(7&a)<<18|s<<12|l<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var u=a-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o},a=function(e,t){return e?o(X$f,e,t):""},s=function(e,t,i,r){if(!(r>0))return 0;for(var n=i,o=i+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(i>=o)break;t[i++]=s}else if(s<=2047){if(i+1>=o)break;t[i++]=192|s>>6,t[i++]=128|63&s}else if(s<=65535){if(i+2>=o)break;t[i++]=224|s>>12,t[i++]=128|s>>6&63,t[i++]=128|63&s}else{if(i+3>=o)break;t[i++]=240|s>>18,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}}return t[i]=0,i-n},l=function(e,t,i){return s(e,X$f,t,i)},u=function(e,t){W$n.set(e,t)},c=function(e,t){return e%t>0&&(e+=t-e%t),e},h=function(){n$o.HEAP8=W$n=new Int8Array(c$m),n$o.HEAP16=new Int16Array(c$m),n$o.HEAP32=x$v=new Int32Array(c$m),n$o.HEAPU8=X$f=new Uint8Array(c$m),n$o.HEAPU16=new Uint16Array(c$m),n$o.HEAPU32=new Uint32Array(c$m),n$o.HEAPF32=new Float32Array(c$m),n$o.HEAPF64=new Float64Array(c$m)},d=function(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?n$o.dynCall_v(i):n$o.dynCall_vi(i,t.arg):i(void 0===t.arg?null:t.arg)}else t()}},f=function(){if(n$o.preRun)for("function"==typeof n$o.preRun&&(n$o.preRun=[n$o.preRun]);n$o.preRun.length;)$(n$o.preRun.shift());d(N$l)},p=function(){nn$1||(nn$1=!0,d(Qn))},_=function(){d(Zn$1)},m=function(){if(n$o.postRun)for("function"==typeof n$o.postRun&&(n$o.postRun=[n$o.postRun]);n$o.postRun.length;)g(n$o.postRun.shift());d(M$r)},$=function(e){N$l.unshift(e)},g=function(e){M$r.unshift(e)},v=function(e){b$x++,n$o.monitorRunDependencies&&n$o.monitorRunDependencies(b$x)},y=function(e){if(b$x--,n$o.monitorRunDependencies&&n$o.monitorRunDependencies(b$x),0==b$x&&(null!==J$q&&(clearInterval(J$q),J$q=null),R$n)){var t=R$n;R$n=null,t()}},x=function(e){return String.prototype.startsWith?e.startsWith(rn$2):0===e.indexOf(rn$2)},b=function(){try{if(n$o.wasmBinary)return new Uint8Array(n$o.wasmBinary);if(n$o.readBinary)return n$o.readBinary(m$s);throw"both async and sync fetching of the wasm failed"}catch(e){O(e)}},w=function(){return n$o.wasmBinary||!_$q&&!h$q||"function"!=typeof fetch?new Promise((function(e,t){e(b())})):fetch(m$s,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+m$s+"'";return e.arrayBuffer()})).catch((function(){return b()}))},C=function(e){var t={env:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:Bn$2};function i(e,t){var i=e.exports;n$o.asm=i,y()}function r(e){i(e.instance)}function n(e){return w().then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(e){}))}if(v(),n$o.instantiateWasm)try{return n$o.instantiateWasm(t,i)}catch{return!1}return function(){if(n$o.wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||x(m$s)||"function"!=typeof fetch)return n(r);fetch(m$s,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(e){n(r)}))}))}(),{}},T=function(){return W$n.length},S=function(e){return n$o.___errno_location&&(x$v[n$o.___errno_location()>>2]=e),e},E=function(e){O("OOM")},A=function(e){e=c(e,65536);var t=c$m.byteLength;try{return-1!==P$o.grow((e-t)/65536)&&(c$m=P$o.buffer,!0)}catch{return!1}},P=function(e){var t=T(),i=65536,r=2147418112;if(e>r)return!1;for(var n=Math.max(t,16777216);n<e;)n=n<=536870912?c(2*n,i):Math.min(c((3*n+2147483648)/4,i),r);return!!A(n)&&(h(),!0)},I=function(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e},M=function(e){function t(){n$o.calledRun||(n$o.calledRun=!0,!d$z&&(p(),_(),n$o.onRuntimeInitialized&&n$o.onRuntimeInitialized(),m()))}e=e||n$o.arguments,b$x>0||(f(),b$x>0)||n$o.calledRun||(n$o.setStatus?(n$o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n$o.setStatus("")}),1),t()}),1)):t())},O=function(e){n$o.onAbort&&n$o.onAbort(e),e=void 0!==e?'"'+e+'"':"",d$z=!0};var n$o=typeof n$o<"u"?n$o:{},A$y={},l$s;for(l$s in n$o)n$o.hasOwnProperty(l$s)&&(A$y[l$s]=n$o[l$s]);n$o.arguments=[],n$o.thisProgram="./this.program",n$o.quit=function(e,t){throw t},n$o.preRun=[],n$o.postRun=[];var _$q=!1,h$q=!1,L$r=!1,D$v=!1,V$l=!1;_$q="object"==typeof window,h$q="function"==typeof importScripts,D$v="object"==typeof process&&"function"==typeof require,L$r=D$v&&!_$q&&!h$q,V$l=!_$q&&!L$r&&!h$q;var v$s="",H$q,U$o;if(L$r)v$s=__dirname+"/",n$o.read=function(e,t){var i;return H$q||(H$q=require("fs")),U$o||(U$o=require("path")),e=U$o.normalize(e),i=H$q.readFileSync(e),t?i:i.toString()},n$o.readBinary=function(e){var i=n$o.read(e,!0);return i.buffer||(i=new Uint8Array(i)),t(i.buffer),i},process.argv.length>1&&(n$o.thisProgram=process.argv[1].replace(/\\/g,"/")),n$o.arguments=process.argv.slice(2),typeof module<"u"&&(module.exports=n$o),process.on("uncaughtException",(function(e){if(!(e instanceof I))throw e})),process.on("unhandledRejection",O),n$o.quit=function(e){process.exit(e)},n$o.inspect=function(){return"[Emscripten Module object]"};else V$l?(typeof read<"u"&&(n$o.read=function(e){return read(e)}),n$o.readBinary=function(e){var i;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(i=read(e,"binary"),t("object"==typeof i),i)},typeof scriptArgs<"u"?n$o.arguments=scriptArgs:typeof arguments<"u"&&(n$o.arguments=arguments),"function"==typeof quit&&(n$o.quit=function(e){quit(e)})):(_$q||h$q)&&(h$q?v$s=self.location.href:document.currentScript&&(v$s=document.currentScript.src),v$s=0!==v$s.indexOf("blob:")?v$s.substr(0,v$s.lastIndexOf("/")+1):"",n$o.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},h$q&&(n$o.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),n$o.readAsync=function(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)},n$o.setWindowTitle=function(e){document.title=e});var Gn$1=n$o.print||(typeof console<"u"?console.log.bind(console):typeof print<"u"?print:null),Sn$2=n$o.printErr||(typeof printErr<"u"?printErr:typeof console<"u"&&console.warn.bind(console)||Gn$1);for(l$s in A$y)A$y.hasOwnProperty(l$s)&&(n$o[l$s]=A$y[l$s]);A$y=void 0;var Bn$2={"f64-rem":function(e,t){return e%t},debugger:function(){}};new Array(0);var P$o,d$z=!1,O$l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;typeof TextDecoder<"u"&&new TextDecoder("utf-16le");var Ln$2=65536,c$m,W$n,X$f,x$v,Jn=5246e3,E$s=3088,I$E=5242880,G$v=n$o.TOTAL_MEMORY||16777216;G$v<I$E&&Sn$2("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+G$v+"! (TOTAL_STACK="+I$E+")"),n$o.buffer?c$m=n$o.buffer:"object"==typeof WebAssembly&&"function"==typeof WebAssembly.Memory?(P$o=new WebAssembly.Memory({initial:G$v/Ln$2}),c$m=P$o.buffer):c$m=new ArrayBuffer(G$v),h(),x$v[E$s>>2]=Jn;var N$l=[],Qn=[],Zn$1=[],M$r=[],nn$1=!1,b$x=0,J$q=null,R$n=null;n$o.preloadedImages={},n$o.preloadedAudios={};var rn$2="data:application/octet-stream;base64,",m$s,$n=typeof window>"u"?self:window;m$s=$n.location.href.endsWith(".openrealspace")?"../../static/Build/Cesium/ThirdParty/Module.wasm":"ThirdParty/Module.wasm",x(m$s)||(m$s=e(m$s)),n$o.asm=function(e,t,i){return t.memory=P$o,t.table=new WebAssembly.Table({initial:23,maximum:23,element:"anyfunc"}),t.__memory_base=1024,t.__table_base=0,C(t)};var Yn={},kn$2={b:O,c:S,f:T,e:P,d:E,a:E$s},tn$1=n$o.asm(Yn,kn$2,c$m);n$o.asm=tn$1,n$o.___errno_location=function(){return n$o.asm.g.apply(null,arguments)},n$o._floatToTextureColor=function(){return n$o.asm.h.apply(null,arguments)},n$o._free=function(){return n$o.asm.i.apply(null,arguments)},n$o._free_result=function(){return n$o.asm.j.apply(null,arguments)},n$o._malloc=function(){return n$o.asm.k.apply(null,arguments)};var en$2=n$o.stackAlloc=function(){return n$o.asm.n.apply(null,arguments)},Fn$1=n$o.stackRestore=function(){return n$o.asm.o.apply(null,arguments)},Kn=n$o.stackSave=function(){return n$o.asm.p.apply(null,arguments)};if(n$o.dynCall_v=function(){return n$o.asm.l.apply(null,arguments)},n$o.dynCall_vi=function(){return n$o.asm.m.apply(null,arguments)},n$o.asm=tn$1,n$o.cwrap=n,I.prototype=new Error,I.prototype.constructor=I,R$n=function e(){n$o.calledRun||M(),n$o.calledRun||(R$n=e)},n$o.run=M,n$o.abort=O,n$o.preInit)for("function"==typeof n$o.preInit&&(n$o.preInit=[n$o.preInit]);n$o.preInit.length>0;)n$o.preInit.pop()();n$o.noExitRuntime=!0,M()}else var n$o=null;var _0x43b100=n$o,Ve$c="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",je$a="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",e$C={LEFT:-1,BOTTOM:-1,NONE:0,RIGHT:1,TOP:1},Xe$4=Object.freeze(e$C);function o$D(e,t,i,r){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i,this.flipY=r,this.imageryLayer=void 0,this.morphingAlpha=void 0}o$D.prototype.freeResources=function(){e$28(this.readyImagery)&&this.readyImagery.releaseReference(),e$28(this.loadingImagery)&&this.loadingImagery.releaseReference()},o$D.prototype.processStateMachine=function(e,t,i){var r=this.loadingImagery,n=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===_t$6.READY)return e$28(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),this.morphingBeginTime=performance.now(),!0;for(var o,a=r.parent;e$28(a)&&(a.state!==_t$6.READY||!this.useWebMercatorT&&!e$28(a.texture));)a.state!==_t$6.FAILED&&a.state!==_t$6.INVALID&&(o=o||a),a=a.parent;return this.readyImagery!==a&&(e$28(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=a,e$28(a)&&(a.addReference(),this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this))),(r.state===_t$6.FAILED||r.state===_t$6.INVALID)&&(e$28(o)?(o.processStateMachine(t,!this.useWebMercatorT,i),!1):(r.imageryLayer&&!1===r.imageryLayer.enableUpsample&&(this.discard=!0),!0))};const _0x4f5169=function(){let e=!0;return function(t,i){const r=e?function(){if(i){const e=i.apply(t,arguments);return i=null,e}}:function(){};return e=!1,r}}(),_0x41341c=_0x4f5169(void 0,(function(){return _0x41341c.toString().search("(((.+)+)+)+$").toString().constructor(_0x41341c).search("(((.+)+)+)+$")}));function BillboardCollectionPool(e,t){this._use=[],this._unUse=[],this._owner=t,this._scene=e.scene,this._showCallout=u$Y(e.showCallout,!1)}function i$o(e){if(!e$28(e.provider))throw new t$Z("options.provder and options.viewer is required.");this._layerConfig=e.layerConfig,this._provider=e.provider,this._provider.lineAntialiasing=e.lineAntialiasing||!1,this._inner=e.layer,this._imagelayerCollection=e.imagelayerCollection,this._name=e.name,e$28(e.layerConfig)&&e$28(e.layerConfig.id)&&(this._name=e.layerConfig.id),this._style3D=u$Y(e.style3D,new e$E),this._swipeEnabled=u$Y(e.swipeEnabled,!1),this._billboardMode=u$Y(e.billboardMode,$r$4.None),this._labelDepthTestEnabled=u$Y(e.labelDepthTestEnabled,!1),this._swipeRegion=u$Y(e.swipeRegion,new f$10(0,0,1,1)),this._provider.enableMorphing=u$Y(e.enableMorphing,!1),this._isTdt=!1,this._inner.swipeEnabled=this._swipeEnabled,this._inner.swipeRegion=this._swipeRegion,this._provider._style3D=this._style3D,this.labelSelected=new o$1o,this._visibleViewport=4095,this._selectedColor=this._provider._selectedColor,this._overlapDisplayedThreshold=this._provider._overlapDisplayedThreshold,this._billboardCollectionPool=new BillboardCollectionPool(e,this),this._provider._billboardCollectionPool=this._billboardCollectionPool}function f$p(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.typeOf.object("options.clock",e.clock),o$1u.typeOf.object("options.times",e.times),o$1u.typeOf.func("options.requestImageFunction",e.requestImageFunction),o$1u.typeOf.func("options.reloadFunction",e.reloadFunction),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 _$p(e,t,i){return e+"-"+t+"-"+i}function F$p(e){var t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function k$s(e){var t=e._times;if(e$28(t)){var i=e._clock,r=i.currentTime,n=i.canAnimate&&i.shouldAnimate,o=i.multiplier;if(n||0===o){var a,s=t.indexOf(r);if(!(s<0)){var l=t.get(s);return o>0?(a=a$12.secondsDifference(l.stop,r),++s):(a=a$12.secondsDifference(l.start,r),--s),a/=o,s>=0&&a<=5?t.get(s):void 0}}}}function I$D(e,t,i){var r=e._times.indexOf(i.start),n=e._tileCache,o=n[r];e$28(o)||(o=n[r]={});var a=t.key;if(e$28(o[a]))return!0;var s=F$p(a),l=new r$1c({throttle:!0,throttleByServer:!0,type:$$13.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,l,i);return!!e$28(u)&&(o[a]={promise:u,request:l},!0)}_0x41341c(),Object.defineProperties(BillboardCollectionPool.prototype,{showCallout:{get:function(){return!1},set:function(e){}},swipeRegion:{get:function(){return!1},set:function(e){}},swipeEnabled:{get:function(){return!1},set:function(e){}}}),BillboardCollectionPool.prototype.pushBack=function(e){let t=this._use.indexOf(e);-1!=t&&(this._use.splice(t,1),this._unUse.push(e))},BillboardCollectionPool.prototype.getOne=function(){let e;return this._unUse.length>0?(e=this._unUse[0],this._unUse.splice(0,1),this._use.push(e),e):(e=new B$q({scene:this._scene,style3D:this._owner._style3D,isMVT:!0,swipeEnabled:this._owner._swipeEnabled,swipeRegion:this._owner._swipeRegion,billboardMode:this._owner._billboardMode,depthTestEnable:this._owner._labelDepthTestEnabled}),e.showCallout=this._showCallout,this._use.push(e),e)},BillboardCollectionPool.prototype.setVisibleInViewport=function(e,t){},BillboardCollectionPool.prototype.getVisibleInViewport=function(e){return 0},BillboardCollectionPool.prototype.destroy=function(){for(var e=0;e<this._use.length;e++)this._use[e].destroy();for(e=0;e<this._unUse.length;e++)this._unUse[e].destroy();this._use=[],this._unUse=[]},Object.defineProperties(i$o.prototype,{detailLevelOffset:{get:function(){return this._inner._detailLevelOffset},set:function(e){e$28(e)&&"number"==typeof e&&(this._inner._detailLevelOffset=e)}},tileWidth:{get:function(){return this._provider._tileWidth}},tileHeight:{get:function(){return this._provider._tileHeight}},maximumLevel:{get:function(){return this._provider._ready?this._provider._maximumLevel:-1}},minimumLevel:{get:function(){return this._provider._ready?this._provider._minimumLevel:-1}},tilingScheme:{get:function(){return this._provider._tilingScheme}},rectangle:{get:function(){return this._provider._ready?this._provider._rectangle:null}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._provider._errorEvent}},ready:{get:function(){return this._provider._ready}},readyPromise:{get:function(){return this._provider.readyPromise}},hasAlphaChannel:{get:function(){return!0}},show:{get:function(){return this._inner.show},set:function(e){this._inner.show=e}},mapboxStyle:{get:function(){return this._provider instanceof M$X?this._provider._MVTStyle.serialize():this._provider.mapboxStyle},set:function(e){this._provider.mapboxStyle=e}},alpha:{get:function(){return this._inner.alpha},set:function(e){o$1u.defined("alpha",e),o$1u.typeOf.number("alpha",e),this._inner.alpha=e$27.clamp(e,0,1)}},selectedColor:{get:function(){return this._provider._selectedColor},set:function(e){e instanceof e$1S&&(this._provider._selectedColor=e)}},overlapDisplayedThreshold:{get:function(){return this._provider._overlapDisplayedThreshold},set:function(e){o$1u.typeOf.number("vectortilesmap overlapDisplayedThreshold",e),this._provider._overlapDisplayedThreshold=e}},name:{get:function(){return this._name},set:function(e){this._name=e}},pausing:{get:function(){return this._inner._pausing},set:function(e){this._inner._pausing=e,this._provider._pausing=e}},indexedDBSetting:{get:function(){return this._provider._indexedDBSetting},set:function(e){e$28(e)&&"boolean"==typeof e.isOpen&&(this._provider._indexedDBSetting.isOpen=e.isOpen)}},layerConfig:{get:function(){return this._layerConfig}},selectEnabled:{get:function(){return this._selectEnabled},set:function(e){this._selectEnabled=e,this._provider._selectEnabled=e}},showCallout:{get:function(){return this._showCallout},set:function(e){this._billboardCollectionPool.showCallout=e}},style3D:{get:function(){return this._style3D},set:function(e){this._style3D=e,this._provider._style3D=this._style3D,this._billboardCollectionPool.style3D=this._style3D}},globalLineWidthExpand:{get:function(){return 0},set:function(e){}},globalLineWidthScale:{get:function(){return this._provider.globalLineWidthScale},set:function(e){e<=0&&(e=.01),e>100&&(e=100),this._provider.globalLineWidthScale=e}},lineAntialiasing:{get:function(){return this._provider.lineAntialiasing},set:function(e){this._provider.lineAntialiasing=e}},swipeRegion:{get:function(){return this._swipeRegion},set:function(e){if(!(e$28(e)&&e instanceof f$10))throw new t$Z("Expected VectorTilesMap.swipeRegion to be type of BoundingRectangle.");f$10.equals(e,this._swipeRegion)||(f$10.clone(e,this._swipeRegion),this._billboardCollectionPool.swipeRegion=this._swipeRegion,this._inner.swipeRegion=this._swipeRegion)}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){o$1u.typeOf.bool("VectorTilesMap.swipeEnabled",e),e!==this._swipeEnabled&&(this._swipeEnabled=e,this._billboardCollectionPool.swipeEnabled=e,this._inner.swipeEnabled=this._swipeEnabled)}},isOverlapDisplayed:{get:function(){return this._provider.isOverlapDisplayed},set:function(e){this._provider.isOverlapDisplayed=e}},enableMorphing:{get:function(){return this._provider.enableMorphing},set:function(e){this._provider.enableMorphing=e}},queryTolerance:{get:function(){return this._provider.selectTolerance},set:function(e){this._provider.selectTolerance=e}},imageryLayer:{get:function(){return this._inner}}}),i$o.prototype.addLayer=function(e,t,i){this._provider._MVTStyle.addLayer(e,t,i)},i$o.prototype.removeLayer=function(e){this._provider._MVTStyle.removeLayer(e)},i$o.prototype.setFilter=function(e,t,i){if(!0===i){var r=[],n=this._provider._viewer.scene.camera.computeViewRectangle();if(e$28(n)){var o=h$10.southwest(n),a=h$10.southeast(n),s=h$10.northeast(n),l=h$10.northwest(n);r=this._provider.queryRenderedFeatures([o,a,s,l],{layers:[e.replace(/(.*)(_highlight)/,"$1")]});for(var u=["in","$id"],c=(t=_0x461a14.createFilter(t),0);c<r.length;c++){var h=r[c].feature;t(new _0x105812(0),h)&&u.push(h.id)}this.setFilter(e,u)}}else this._provider._currentPickID=void 0,this._provider._MVTStyle.setFilter(e,t)},i$o.prototype.getFilter=function(e){return this._provider._MVTStyle.getFilter(e)},i$o.prototype.setLayoutProperty=function(e,t,i,r){this._provider._MVTStyle.setLayoutProperty(e,t,i,r)},i$o.prototype.getLayoutProperty=function(e,t){return this._provider._MVTStyle.getLayoutProperty(e,t)},i$o.prototype.setPaintProperty=function(e,t,i,r){this._provider._MVTStyle.setPaintProperty(e,t,i,r)},i$o.prototype.getPaintProperty=function(e,t){return this._provider._MVTStyle.getPaintProperty(e,t)},i$o.prototype.queryRenderedFeatures=function(e,t){for(var i=[],r=0,n=e.length;r<n;r++){var o=e[r],a=t$W.fromCartesian(o);i.push(a)}return this._provider.queryRenderedFeatures(i,t)},i$o.prototype.querySourceFeatures=function(e){return this._provider.querySourceFeatures(e)},i$o.prototype.update=function(e,t){},i$o.prototype.getProperty=function(e){return this._provider.getProperty(e)},i$o.prototype.setVisibleInViewport=function(e,t){e$28(this._inner)&&this._inner.setVisibleInViewport(e,t),this._billboardCollectionPool.setVisibleInViewport(e,t)},i$o.prototype.getVisibleInViewport=function(e){e$28(this._inner)&&this._inner.getVisibleInViewport(e),this._billboardCollectionPool.getVisibleInViewport(e)},i$o.prototype.refresh=function(){var e=this._inner._imageryCache;for(var t in e)e[t].isRendered=!1;for(var i of(this._imagelayerCollection.remove(this._inner,!0,!0),this._inner=this._imagelayerCollection.addImageryProvider(this._provider),this._provider.innerLayer=this._inner,this._provider._viewer.scene.layers.layerQueue))i._imageryLayer===this&&(i._removeCoverImageryLayer(),i.coverImageryLayer=this)},i$o.prototype.isDestroyed=function(){return!1},i$o.prototype.destroy=function(){return this._provider._billboardCollectionPool=null,e$28(this._billboardCollectionPool)&&(this._billboardCollectionPool.destroy(),this._billboardCollectionPool=null),this._imagelayerCollection.remove(this._inner,!0,!0),i$Z(this)},i$o.prototype.releaseSelection=function(){this._provider._MVTStyle.cancelHighLight(this._provider)},Object.defineProperties(f$p.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),f$p.prototype.getFromCache=function(e,t,i,r){var n,o=_$p(e,t,i),a=this._tileCache[this._currentIntervalIndex];if(e$28(a)&&e$28(a[o])){var s=a[o];n=s.promise.otherwise((function(e){throw r.state=s.request.state,e})),delete a[o]}return n},f$p.prototype.checkApproachingInterval=function(e,t,i,r){var n=_$p(e,t,i),o=this._tilesRequestedForInterval,a=k$s(this),s={key:n,priorityFunction:r.priorityFunction};(!e$28(a)||!I$D(this,s,a))&&o.push(s),o.length>=512&&o.splice(0,256)},f$p.prototype._clockOnTick=function(e){var t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){var n=this._tileCache[r];for(var o in n)n.hasOwnProperty(o)&&n[o].request.cancel();return delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,void this._reloadFunction()}var a=k$s(this);if(e$28(a))for(var s=this._tilesRequestedForInterval,l=!0;l&&0!==s.length;){var u=s.pop();(l=I$D(this,u,a))||s.push(u)}};var I$C=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function y$r(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");if(!e$28(e.layer))throw new t$Z("options.layer is required.");if(!e$28(e.style))throw new t$Z("options.style is required.");if(!e$28(e.tileMatrixSetID))throw new t$Z("options.tileMatrixSetID is required.");if(e$28(e.times)&&!e$28(e.clock))throw new t$Z("options.times was specified, so options.clock is required.");this._baseUrl=e.url;var t=t$S.createIfNeeded(e.url),i=e.style,r=e.tileMatrixSetID;if(t.url.indexOf("{")>=0){var n={style:i,Style:i,TileMatrixSet:r};t.setTemplateValues(n),t.setQueryParameters(I$C),this._useKvp=!1}else t.setQueryParameters(I$C),this._useKvp=!0;this._resource=t,this._layer=e.layer,this._style=i,this._tileMatrixSetID=r,this._tileMatrixLabels=e.tileMatrixLabels,this._format=u$Y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=e$28(e.tilingScheme)?e.tilingScheme:new c$10({ellipsoid:e.ellipsoid}),this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._minimumLevel=u$Y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=u$Y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var o=this;this._reload=void 0;var a=this._baseUrl;this.tablename=this._layer,new l$11({name:a}).then((function(e){e.checkObjectStoreExit(o.tablename)?o._indexedDBScheduler=e:e.createObjectStore(o.tablename).then((function(){o._indexedDBScheduler=e}))})),this._indexedDBSetting={isOpen:!1,clear:function(){o._indexedDBScheduler.clear(o.tablename)},cache:[]},e$28(e.times)&&(this._timeDynamicImagery=new f$p({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return x$u(o,e,t,i,r,n)},reloadFunction:function(){e$28(o._reload)&&o._reload()}})),this._readyPromise=o$1q.resolve(!0);var s=this._tilingScheme.positionToTileXY(h$10.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(h$10.northeast(this._rectangle),this._minimumLevel);Math.abs(l.x-s.x),Math.abs(l.y-s.y),u$Y(e.limitLevelZeroTilesCount,!0),this._errorEvent=new o$1o;var u=e.credit;this._credit="string"==typeof u?new r$1a(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():e$28(this._subdomains)&&this._subdomains.length>0?this._subdomains=[this._subdomains]:this._subdomains=["a","b","c"],this._customRequestHeaders=e.customRequestHeaders}function x$u(e,t,i,r,n,o){var a,s=e._tileMatrixLabels,l=e$28(s)?s[r]:r.toString(),u=e._subdomains,c=e._dimensions,h=e$28(o)?o.data:void 0,d={};if(e._useKvp)e$28(c)&&(d=p$17(d,c)),e$28(h)&&(d=p$17(d,h));else{var f={TileMatrix:l,TileRow:i.toString(),TileCol:t.toString(),s:u[(t+i+r)%u.length]};(a=e._resource.getDerivedResource({request:n})).setTemplateValues(f),e$28(c)&&a.setTemplateValues(c),e$28(h)&&a.setTemplateValues(h)}return d.tilematrix=l,d.layer=e._layer,d.style=e._style,d.tilerow=i,d.tilecol=t,d.tilematrixset=e._tileMatrixSetID,d.format=e._format,e$28(a)?a.setQueryParameters(d):a=e._resource.getDerivedResource({queryParameters:d,request:n}),e$28(a$Y.CREDENTIAL)&&(e$28(a$Y.CREDENTIAL._keymap[e._baseUrl])?a.url=a$Y.addTokenWithKey(e._baseUrl,a.url):a.url=a$Y.addToken(a.url)),N$k(e,a)}function Y$h(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}Object.defineProperties(y$r.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,e$28(this._reload)&&this._reload())}}}),y$r.prototype.getTileCredits=function(e,t,i){},y$r.prototype.requestImage=function(e,t,i,r){var n,o,a=this._timeDynamicImagery;if(e$28(a)&&(o=a.currentInterval,n=a.getFromCache(e,t,i,r)),r.quadKey=Y$h(e,t,i),!0===this._indexedDBSetting.isOpen&&!e$28(n)&&!0===r.cacheEnable){if(e$28(this._indexedDBScheduler)){var s=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey);return e$28(s)?s.then((function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):x$u(this,e,t,i,r,o)}return x$u(this,e,t,i,r,o)}return e$28(n)||(r.cacheEnable=!1,n=x$u(this,e,t,i,r,o)),e$28(n)&&e$28(a)&&a.checkApproachingInterval(e,t,i,r),n},y$r.prototype.pickFeatures=function(e,t,i,r,n){};var A$x=/\.ktx$/i,j$m=/\.crn$/i,F$o=/\.dxtz$/i;function N$k(e,t){o$1u.defined("url",t);var i=t$S.createIfNeeded(t);return A$x.test(i.url)?k$R(i):j$m.test(i.url)?a$R(i):F$o.test(i.url)?(e.flipY=!0,B$E(i)):e$28(e.tileDiscardPolicy)?i.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):(e$28(e._customRequestHeaders)&&(i.headers=p$17(i.headers,e._customRequestHeaders)),!0===e._indexedDBSetting.isOpen?i.fetchBlob():i.fetchImage({preferImageBitmap:!0,flipY:!0}))}var G$u=new i$W("indexedDBWorker"),Ee$a=-1;function h$p(e,t){this._imageryProvider=e,t=u$Y(t,{}),this._alpha=u$Y(t.alpha,u$Y(e.defaultAlpha,1)),this.brightness=u$Y(t.brightness,u$Y(e.defaultBrightness,h$p.DEFAULT_BRIGHTNESS)),this.contrast=u$Y(t.contrast,u$Y(e.defaultContrast,h$p.DEFAULT_CONTRAST)),this.hue=u$Y(t.hue,u$Y(e.defaultHue,h$p.DEFAULT_HUE)),this.saturation=u$Y(t.saturation,u$Y(e.defaultSaturation,h$p.DEFAULT_SATURATION)),this.gamma=u$Y(t.gamma,u$Y(e.defaultGamma,h$p.DEFAULT_GAMMA)),this.transparentBackColor=u$Y(t.transparentBackColor,u$Y(e.defaultTransparentBackColor,h$p.DEFAULT_TRANSPARENTBACKCOLOR)),this.transparentBackColorTolerance=u$Y(t.transparentBackColorTolerance,u$Y(e.defaultTransparentBackColorTolerance,h$p.DEFAULT_TRANSPARENTBACKCOLORTOLERANCE));var i=u$Y(t.splitDirection,u$Y(e.defaultSplit,h$p.DEFAULT_SPLIT)),r=u$Y(t.splitDirection,u$Y(e.defaultSplit,h$p.DEFAULT_SPLIT));this.splitDirection=new o$1k(i,r),this.minificationFilter=u$Y(t.minificationFilter,u$Y(e.defaultMinificationFilter,h$p.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=u$Y(t.magnificationFilter,u$Y(e.defaultMagnificationFilter,h$p.DEFAULT_MAGNIFICATION_FILTER)),this.show=u$Y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=u$Y(t.rectangle,h$10.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new o$D(n$q.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this._visibleViewport=4095,this.colorToAlpha=t.colorToAlpha,this._selectColor=new e$1S(0,0,1,1),this.colorToAlphaThreshold=u$Y(t.colorToAlphaThreshold,h$p.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD),this._pausing=!1,e$28(e._indexedDBSetting)?this._indexedDBSetting=e._indexedDBSetting:this._indexedDBSetting={isOpen:!1},this._imageCanvas={},this._swipeRegion=new e$25(0,0,1,1),this._swipeEnabled=!1,this._lodOffset=0,this._detailLevelOffset=0,this._featherEdgesEnabled=!1,this._minHeight=Number.NEGATIVE_INFINITY,this._maxHeight=1/0,this._inVisibleHeightRange=1,this.enableUpsample=!0,this.enableImageryClip=!1,this._minTextureAlphaFilter=0}Object.defineProperties(h$p.prototype,{name:{get:function(){return this._imageryProvider.name}},alpha:{get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this._imageryProvider.onAlphaChanged&&this._imageryProvider.onAlphaChanged())}},featherEdgesEnabled:{get:function(){return this._featherEdgesEnabled},set:function(e){e$28(e)&&"boolean"==typeof e&&(this._featherEdgesEnabled=e)}},lodOffset:{get:function(){return this._lodOffset},set:function(e){e$28(e)&&"number"==typeof e&&(this._lodOffset=e)}},imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}},indexedDBSetting:{get:function(){return this._indexedDBSetting},set:function(e){e$28(e)&&"boolean"==typeof e.isOpen&&(this._indexedDBSetting.isOpen=e.isOpen)}},swipeRegion:{get:function(){return new f$10(this._swipeRegion.x,this._swipeRegion.y,this._swipeRegion.z-this._swipeRegion.x,this._swipeRegion.w-this._swipeRegion.y)},set:function(e){if(e$28(e)){if(!(e instanceof f$10))throw new t$Z("swipeRegion must be a instance of BoundingRectangle.");e$25.fromElements(e.x,e.y,e.x+e.width,e.y+e.height,this._swipeRegion)}}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){e!==this._swipeEnabled&&(e?o$1k.fromElements(0,0,this.splitDirection):e$25.fromElements(0,0,1,1,this._swipeRegion),this._swipeEnabled=e)}},minHeight:{get:function(){return this._minHeight},set:function(e){this._minHeight=e}},maxHeight:{get:function(){return this._maxHeight},set:function(e){return this._maxHeight=e}},minTextureAlphaFilter:{get:function(){return this._minTextureAlphaFilter},set:function(e){"number"==typeof e&&(this._minTextureAlphaFilter=e$27.clamp(e,0,1))}}}),h$p.DEFAULT_BRIGHTNESS=1,h$p.DEFAULT_CONTRAST=1,h$p.DEFAULT_HUE=0,h$p.DEFAULT_SATURATION=1,h$p.DEFAULT_GAMMA=1,h$p.DEFAULT_TRANSPARENTBACKCOLOR=e$1S.BLACK,h$p.DEFAULT_TRANSPARENTBACKCOLORTOLERANCE=0,h$p.DEFAULT_SPLIT=Xe$4.NONE,h$p.DEFAULT_MINIFICATION_FILTER=tt$h.LINEAR,h$p.DEFAULT_MAGNIFICATION_FILTER=rt$g.LINEAR,h$p.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,h$p.prototype.isBaseLayer=function(){return this._isBaseLayer&&!e$28(this._imageryProvider._scales)&&!e$28(this._imageryProvider._useKvp)&&!e$28(this._imageryProvider._useSrs)},h$p.prototype.isDestroyed=function(){return!1},h$p.prototype.destroy=function(){return i$Z(this)};var Ae$d=new h$10,xe$e=new h$10,ue$b=new h$10,Le$c=new h$10;function ye$e(e,t,i){if(e$28(e._imageryProvider._indexedDBScheduler)){var r={blob:i,key:t.quadKey,tablename:e._imageryProvider.tablename,dbname:e._imageryProvider._indexedDBScheduler.dbname};G$u.scheduleTask(r,[])}}function Re$9(e,t,i,r,n){var o=new DataView(e),a=0,s=o.getUint32(a,!0);if(t>s-1||s>256)throw new t$Z("pack imagery index invalid");a+=4;var l,u,c=[];for(l=0;l<s;l++)u=o.getUint32(a,!0),c.push(u),a+=4;for(l=0;l<s;l++){if(u=c[l],l===t){if(0===u)return void(!0===i._indexedDBSetting.isOpen&&ye$e(i,r,Ee$a));if(!e$28(n)){var h=new Uint8Array(e,a,u);return new Uint8Array(h).buffer}return et$8({uint8Array:new Uint8Array(e,a,u),format:n,flipY:!0,layer:i,imagery:r})}a+=u}}h$p.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then((function(){return h$10.intersection(e.rectangle,t)}))},h$p.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data;if(e$28(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||e$28(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(e$28(i)||(i=r.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;var o=n.tilingScheme.projection instanceof t$M&&e.rectangle.north<t$M.MaximumLatitude&&e.rectangle.south>-t$M.MaximumLatitude,a=h$10.intersection(n.rectangle,this._rectangle,Ae$d),s=h$10.intersection(e.rectangle,a,xe$e);if(!e$28(s)){if(!this.isBaseLayer())return!1;var l=a,u=e.rectangle;s=xe$e,u.south>=l.north?s.north=s.south=l.north:u.north<=l.south?s.north=s.south=l.south:(s.south=Math.max(u.south,l.south),s.north=Math.min(u.north,l.north)),u.west>=l.east?s.west=s.east=l.east:u.east<=l.west?s.west=s.east=l.west:(s.west=Math.max(u.west,l.west),s.east=Math.min(u.east,l.east))}var c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);var h=nt$9(this,1*t.getLevelMaximumGeometricError(e.level),c,e$28(this._imageryProvider.resolution)?this._imageryProvider.resolution:1);h=Math.max(0,h);var d=n.maximumLevel;if(h>d&&(h=d),e$28(n.minimumLevel)&&!(n instanceof M$X)){var f=n.minimumLevel;h<f&&(h=f)}var p=n.tilingScheme,_=p.positionToTileXY(h$10.northwest(s),h),m=p.positionToTileXY(h$10.southeast(s),h),$=e.rectangle.width/512,g=e.rectangle.height/512,v=p.tileXYToRectangle(_.x,_.y,h);Math.abs(v.south-e.rectangle.north)<g&&_.y<m.y&&++_.y,Math.abs(v.east-e.rectangle.west)<$&&_.x<m.x&&++_.x;var y=p.tileXYToRectangle(m.x,m.y,h);Math.abs(y.north-e.rectangle.south)<g&&m.y>_.y&&--m.y,Math.abs(y.west-e.rectangle.east)<$&&m.x>_.x&&--m.x,v.east<n.rectangle.west&&++_.x,v.south>n.rectangle.north&&++_.y,y.west>n.rectangle.east&&--m.x,y.north<n.rectangle.south&&--m.y;var x,b=h$10.clone(e.rectangle,Le$c),w=p.tileXYToRectangle(_.x,_.y,h),C=h$10.intersection(w,a,ue$b);if(!e$28(C))return!1;o?(p.rectangleToNativeRectangle(b,b),p.rectangleToNativeRectangle(w,w),p.rectangleToNativeRectangle(C,C),p.rectangleToNativeRectangle(a,a),x=p.tileXYToNativeRectangle.bind(p),$=b.width/512,g=b.height/512):x=p.tileXYToRectangle.bind(p);var T,S,E=0,A=1;!this.isBaseLayer()&&Math.abs(C.west-b.west)>=$&&(E=Math.min(1,(C.west-b.west)/b.width)),!this.isBaseLayer()&&Math.abs(C.north-b.north)>=g&&(A=Math.max(0,(C.north-b.south)/b.height));for(var P=A,I=u$Y(this._imageryProvider.flipY,!1),M=_.x;M<=m.x;M++)if(T=E,w=x(M,_.y,h),e$28(C=h$10.simpleIntersection(w,a,ue$b))){E=Math.min(1,(C.east-b.west)/b.width),M===m.x&&(this.isBaseLayer()||Math.abs(C.east-b.east)<$)&&(E=1),A=P;for(var O=_.y;O<=m.y;O++)if(S=A,w=x(M,O,h),e$28(C=h$10.simpleIntersection(w,a,ue$b))){A=Math.max(0,(C.south-b.south)/b.height),O===m.y&&(this.isBaseLayer()||Math.abs(C.south-b.south)<g)&&(A=0);var D=new e$25(T,A,E,S),R=this.getImageryFromCache(M,O,h);if(r.imagery.splice(i,0,new o$D(R,D,o,I)),++i,this._imageryProvider.enableMorphing&&e$28(R.mvtProvider)&&e$28(R.parent)){var L=new o$D(this.getImageryFromCache(R.parent.x,R.parent.y,R.parent.level),D,o,I);L.morphingAlpha=.9,r.imagery.splice(i,0,L),++i}}}return!0},h$p.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,r=e.rectangle;if(t.useWebMercatorT){var n=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=n.rectangleToNativeRectangle(i,Ae$d),r=n.rectangleToNativeRectangle(r,Le$c)}var o=r.width,a=r.height,s=o/i.width,l=a/i.height;return new e$25(s*(r.west-i.west)/o,l*(r.south-i.south)/a,s,l)};var Je$5=/\.dxtz/i;function be$d(e,t,i){var r=new DataView(e),n=0;r.getUint32(n,!0),n+=4;var o=r.getUint32(n,!0);n+=4;for(var a=t.col,s=t.row*t.blockSize+a,l=0,u=0,c=0;c<o;c++){if(c<s)l+=r.getUint32(n,!0);else if(c===s){u=r.getUint32(n,!0),n+=4;break}n+=4}if(n=8+4*o,0!==u){n+=l;var h=o$1q.defer(),d=t.url;return Je$5.test(d)?h.resolve($e$4(e,n,u)):w$B({uint8Array:new Uint8Array(e,n,u),format:i,flipY:!0})}}function $e$4(e,t,i){var r=new DataView(e,t,i),n=0,o=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;var a=32===o?V$O.RGBA_DXT5:V$O.RGB_DXT1,s=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var l=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT,r.getUint32(n,!0),n+=Uint32Array.BYTES_PER_ELEMENT;var u=r.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var c=new Uint8Array(e,n+t,u),h=nt$c.inflate(c).buffer;return new e$1y(a,s,l,new Uint8Array(h))}function et$8(e){var t=e.uint8Array,i=e.format,r=e.request,n=u$Y(e.flipY,!1),o=e.layer,a=e.imagery;o$1u.typeOf.object("uint8Array",t),o$1u.typeOf.string("format",i);var s,l=new Blob([t],{type:i});return!0===o._indexedDBSetting.isOpen&&ye$e(o,a,l),t$S.supportsImageBitmapOptions().then((function(e){return e?o$1q(t$S.createImageBitmapFromBlob(l,{flipY:n,premultiplyAlpha:!1})):new t$S({url:s=window.URL.createObjectURL(l),request:r}).fetchImage({flipY:n})})).then((function(e){return e$28(s)&&window.URL.revokeObjectURL(s),e})).otherwise((function(e){return e$28(s)&&window.URL.revokeObjectURL(s),o$1q.reject(e)}))}function tt$a(e,t){var i=document.createElement("canvas");i.getContext("bitmaprenderer").transferFromImageBitmap(e),i.toBlob(t)}function De$f(e,t){var i=e.slice(0),r=new Int8Array(i);for(var n=t.split("").map((function(e){return e.charCodeAt(0)})),o=0;o<n.length;o++)r[o]=r[o]^n[o];return r.buffer}var rt$a={webp:"image/webp",png:"image/png"};function Ie$c(e,t,i){return e+":"+t+":"+i}function le$d(e,t,i){return JSON.stringify([e,t,i])}h$p.prototype._requestImagery=function(e){var t=this._imageryProvider,i=this;function r(r){if(!e.isDestroyed()){if(!e$28(r))return n();if(r===Ee$a)return void(e.state=_t$6.FAILED);if("cacheError"===r)return void o(!1);if(r instanceof ArrayBuffer&&e$28(t._cacheKey)&&t._cacheKey.length>0&&e.request.type!==$$13.BLOCK){var a=De$f(r,t._cacheKey);r=e.request.type===$$13.PACK?a:new Blob([new Uint8Array(a,0,a.byteLength)],{type:t._fileExtension||"image/png"})}if(e.request.type!==$$13.PACK&&!r.mvt&&e.request.type!==$$13.BLOCK&&e.request.type!==$$13.BLOCKPACK){if(r instanceof Blob){if(!0===i._indexedDBSetting.isOpen&&!e.request.cacheEnable&&e$28(i._imageryProvider._indexedDBScheduler)){e.quadKey=e.request.quadKey;var s={blob:r,key:e.quadKey,tablename:i._imageryProvider.tablename,dbname:i._imageryProvider._indexedDBScheduler.dbname,cacheSize:30};G$u.scheduleTask(s,[])}return void t$S.supportsImageBitmapOptions().then((function(t){if(t)t$S.createImageBitmapFromBlob(r,{flipY:!0,premultiplyAlpha:!1}).then((function(t){e.image=t,e.state=_t$6.RECEIVED,e.request=void 0,l$13.handleSuccess(i._requestImageError)}));else{var n=window.URL.createObjectURL(r);t$D(n,!1).then((function(e){return window.URL.revokeObjectURL(n),e}),(function(e){return window.URL.revokeObjectURL(n),o$1q.reject(e)})).then((function(t){e.image=t,e.state=_t$6.RECEIVED,e.request=void 0,l$13.handleSuccess(i._requestImageError)}))}}))}!0===i._indexedDBSetting.isOpen&&!e.request.cacheEnable&&e$28(i._imageryProvider._indexedDBScheduler)&&(e.quadKey=e.request.quadKey,createImageBitmap(r,{imageOrientation:"flipY",premultiplyAlpha:"none"}).then((function(t){tt$a(t,(function(t){var r={blob:t,key:e.quadKey,tablename:i._imageryProvider.tablename,dbname:i._imageryProvider._indexedDBScheduler.dbname,cacheSize:30};G$u.scheduleTask(r,[])}))})))}var l=rt$a[t._fileExtension];if(e.request.type!==$$13.BLOCKPACK||r.mvt)if(e.request.type!==$$13.PACK||r.mvt)if(e.request.type===$$13.BLOCK){if(!e$28((c=t.blockCache[e.request.quadKey]).data)&&(c.data=r,!0===i._indexedDBSetting.isOpen&&!e.request.cacheEnable&&e$28(i._imageryProvider._indexedDBScheduler))){s={blob:r.slice(0),key:e.request.quadKey,tablename:i._imageryProvider.tablename,dbname:i._imageryProvider._indexedDBScheduler.dbname,cacheSize:30};G$u.scheduleTask(s,[])}t.blockCacheQueue.touch(c),t.blockCacheQueue.trim(t.blockCacheSize),e$28(t._cacheKey)&&t._cacheKey.length>0&&(r=De$f(r,t._cacheKey)),e$28(h=be$d(r,e.request.blockInfo,l))||(e.state=_t$6.FAILED),h.then((function(t){e.image=t,e.state=_t$6.RECEIVED})).otherwise((function(t){e.state=_t$6.FAILED}))}else e.image=r,e.state=_t$6.RECEIVED;else{if(r instanceof Blob&&e.request.cacheEnable&&!0===i._indexedDBSetting.isOpen)return void t$S.supportsImageBitmapOptions().then((function(t){if(t)t$S.createImageBitmapFromBlob(r,{flipY:!0,premultiplyAlpha:!1}).then((function(t){e.image=t,e.state=_t$6.RECEIVED,e.request=void 0,l$13.handleSuccess(i._requestImageError)}));else{var n=window.URL.createObjectURL(r);t$D(n,!1).then((function(e){return window.URL.revokeObjectURL(n),e}),(function(e){return window.URL.revokeObjectURL(n),o$1q.reject(e)})).then((function(t){e.image=t,e.state=_t$6.RECEIVED,e.request=void 0,l$13.handleSuccess(i._requestImageError)}))}}));e.quadKey=e.request.quadKey,l=u$Y(l,"image/png");var u=Re$9(r,e.request.quadKeyIndex,i,e,l);if(!e$28(u))return void(e.state=_t$6.FAILED);u.then((function(t){e.image=t,e.state=_t$6.RECEIVED})).otherwise((function(t){e.state=_t$6.FAILED}))}else if(!e$28(e.request.quadKeyIndex)&&e$28(e.request.blockRequest)&&(e.request.quadKeyIndex=e.request.blockRequest.quadKeyIndex),e$28(e.request.quadKeyIndex)&&(r=Re$9(r,e.request.quadKeyIndex,i,e)),e$28(r)){var c,h;if(!e$28(c=t.blockCache[e.request.quadKey])&&(c=new e$1B(t,e.request.quadKey,r),t.blockCache[e.request.quadKey]=c,!0===i._indexedDBSetting.isOpen&&!e.request.cacheEnable&&e$28(i._imageryProvider._indexedDBScheduler))){var s={blob:r.slice(0),key:e.request.quadKey,tablename:i._imageryProvider.tablename,dbname:i._imageryProvider._indexedDBScheduler.dbname,cacheSize:5};G$u.scheduleTask(s,[])}t.blockCacheQueue.touch(c),t.blockCacheQueue.trim(t.blockCacheSize),e$28(h=be$d(r,e.request.blockInfo,l))||(e.state=_t$6.FAILED),h.then((function(t){e.image=t,e.state=_t$6.RECEIVED})).otherwise((function(t){e.state=_t$6.FAILED}))}else e.state=_t$6.FAILED;e.request=void 0,l$13.handleSuccess(i._requestImageError)}}function n(r){if(!e.isDestroyed()){if(e.request.state===W$14.CANCELLED)return e.state=_t$6.UNLOADED,void(e.request=void 0);e.state=_t$6.FAILED,e.request=void 0;var n="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";i._requestImageError=l$13.handleError(i._requestImageError,t,t.errorEvent,n,e.x,e.y,e.level,o,r)}}function o(i){var o=new r$1c({throttle:!1,throttleByServer:!0,type:$$13.IMAGERY});o.cacheEnable=i,e.request=o,e.state=_t$6.TRANSITIONING;var a=t.requestImage(e.x,e.y,e.level,o,e.rectangle,e);if(!e$28(a))return e.state=_t$6.UNLOADED,void(e.request=void 0);e$28(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),e.beginRequestTime=performance.now(),o$1q(a,r,n)}o(!0)},h$p.prototype._createTextureWebGL=function(e,t){var i=new n$Y({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),r=t.image;return e$28(r.internalFormat)?new L$17({context:e,pixelFormat:r.internalFormat,width:r.width,height:r.height,source:{arrayBufferView:r.bufferView},sampler:i}):e$28(r.mvt)?r.colorTexture:new L$17({context:e,source:r,pixelFormat:this._imageryProvider.hasAlphaChannel?V$O.RGBA:V$O.RGB,sampler:i})},h$p.prototype._createTexture=function(e,t,i){var r=this._imageryProvider,n=t.image;if(e$28(r.tileDiscardPolicy)){var o=r.tileDiscardPolicy;if(e$28(o)){if(!o.isReady())return void(t.state=_t$6.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=_t$6.INVALID)}}if(this.minificationFilter!==tt$h.NEAREST&&this.minificationFilter!==tt$h.LINEAR)throw new t$Z("ImageryLayer minification filter must be NEAREST or LINEAR");var a=this._createTextureWebGL(e,t);e$28(n.mvt)&&(t.isMvtTexture=!0,t.idTexture=n.idTexture,t.iconImageObjects=n.iconImageObjects,t.textObjects=n.textObjects,t.tile=n.tile,t.transform=n.transform,t.isRendered=!1,t.rawData=n.rawData),r.tilingScheme.projection instanceof t$M?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=_t$6.TEXTURE_LOADED},h$p.prototype._finalizeReprojectTexture=function(e,t){var i=this.minificationFilter,r=this.magnificationFilter;if(i===tt$h.LINEAR&&r===rt$g.LINEAR&&!V$O.isCompressedFormat(t.pixelFormat)&&e$27.isPowerOfTwo(t.width)&&e$27.isPowerOfTwo(t.height)){i=tt$h.LINEAR_MIPMAP_LINEAR;var n=e$1U.maximumTextureFilterAnisotropy,o=Math.min(n,u$Y(this._maximumAnisotropy,n)),a=Ie$c(i,r,o),s=e.cache.imageryLayerMipmapSamplers;e$28(s)||(s={},e.cache.imageryLayerMipmapSamplers=s);var l=s[a];e$28(l)||(l=s[a]=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:r,maximumAnisotropy:o})),t.generateMipmap(S$N.NICEST),t.sampler=l}else{var u=Ie$c(i,r,0),c=e.cache.imageryLayerNonMipmapSamplers;e$28(c)||(c={},e.cache.imageryLayerNonMipmapSamplers=c);var h=c[u];e$28(h)||(h=c[u]=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:r})),t.sampler=h}},h$p.prototype._reprojectTexture=function(e,t,i){var r=t.textureWebMercator||t.texture,n=t.rectangle,o=e.context;if((i=u$Y(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof n$1b)&&n.width/r.width>1e-5){var a=this;t.addReference();var s=new t$u({persists:!0,owner:this,preExecute:function(e){at$9(e,o,r,t.rectangle)},postExecute:function(e){t.texture=e,a._finalizeReprojectTexture(o,e),t.state=_t$6.READY,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else i&&(t.texture=r),this._finalizeReprojectTexture(o,r),t.state=_t$6.READY},h$p.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},h$p.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},h$p.prototype.getImageryFromCache=function(e,t,i,r){var n=le$d(e,t,i),o=this._imageryCache[n];return e$28(o)||(o=this._imageryProvider instanceof M$X?new _0x364a72(this,e,t,i,r):new n$q(this,e,t,i,r),this._imageryCache[n]=o),o.addReference(),o},h$p.prototype.getReadyImageryFromCache=function(e,t,i){for(var r=void 0,n=i;n>0&&!e$28(r);){n--;var o=le$d(e,t,i);e$28(r=this._imageryCache[o])&&r.state!=_t$6.READY&&(r=void 0)}return r},h$p.prototype.removeImageryFromCache=function(e){var t=le$d(e.x,e.y,e.level);delete this._imageryCache[t]};var te$g={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new o$1k,texture:void 0},it$5=s$V.supportsTypedArrays()?new Float32Array(128):void 0;function at$9(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!e$28(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){e$28(this.framebuffer)&&this.framebuffer.destroy(),e$28(this.vertexArray)&&this.vertexArray.destroy(),e$28(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var o=new Float32Array(256),a=0,s=0;s<64;++s){var l=s/63;o[a++]=0,o[a++]=l,o[a++]=1,o[a++]=l}var u={position:0,webMercatorT:1},c=I$1i.getRegularGridIndicesForReproject(2,64),h=h$W.createIndexBuffer({context:t,typedArray:c,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});n.vertexArray=new m$19({context:t,attributes:[{index:u.position,vertexBuffer:h$W.createVertexBuffer({context:t,typedArray:o,usage:A$1c.STATIC_DRAW}),componentsPerAttribute:2},{index:u.webMercatorT,vertexBuffer:h$W.createVertexBuffer({context:t,sizeInBytes:512,usage:A$1c.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:h});var d=new a$$({sources:[je$a]});n.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:Ve$c,attributeLocations:u}),n.sampler=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}i.sampler=n.sampler;var f=i.width,p=i.height;te$g.textureDimensions.x=f,te$g.textureDimensions.y=p,te$g.texture=i;var _=Math.sin(r.south),m=.5*Math.log((1+_)/(1-_));_=Math.sin(r.north);var $=1/(.5*Math.log((1+_)/(1-_))-m),g=new L$17({context:t,width:f,height:p,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});e$27.isPowerOfTwo(f)&&e$27.isPowerOfTwo(p)&&g.generateMipmap(S$N.NICEST);for(var v=r.south,y=r.north,x=it$5,b=0,w=0;w<64;++w){var C=w/63,T=e$27.lerp(v,y,C);_=Math.sin(T);var S=(.5*Math.log((1+_)/(1-_))-m)*$;x[b++]=S,x[b++]=S}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(x),e.shaderProgram=n.shaderProgram,e.outputTexture=g,e.uniformMap=te$g,e.vertexArray=n.vertexArray}function nt$9(e,t,i,r){var n=e._imageryProvider,o=n.tilingScheme,a=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof n$1b?1:Math.cos(i),l=o.rectangle,u=o.getNumberOfXTilesAtLevel(0);e$28(o._suggest)&&o._suggest?u=o._numberOfLevelZeroTilesX:0!==e._lodOffset&&(e._lodOffset>0?u/=1<<Math.floor(e._lodOffset):u*=1<<Math.floor(-e._lodOffset));var c=l.width,h=a.maximumRadius*c*s/(n.tileWidth*u/r);if(e$28(o._scaleDenominators)&&o._scaleDenominators.length>0){var d;d=o.tileXYToRectangle(0,0,0,d);var f=o.getNumberOfXTilesAtLevel(0)*d.width;h=a.maximumRadius*c*s/(c/f*n.tileWidth*u/r)}var p=h/t,_=Math.log(p)/Math.log(2);return 0|Math.round(_)}h$p.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},h$p.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},h$p.prototype.saveLocalCache=function(){if(!0===this._indexedDBSetting.isOpen&&e$28(this._imageryProvider._indexedDBScheduler)){var e={tablename:this._imageryProvider.tablename,dbname:this._imageryProvider._indexedDBScheduler.dbname};G$u.scheduleTask(e,[])}};var y$q=void 0,b$w=void 0;h$p.prototype.getImagery=function(e,t){var i=1;e$28(t)&&(i<<=t);var r=[],n=this._imageryProvider;if(e$28(b$w)||(b$w=new h$10),!e$28(e)||(b$w.west=e.min.longitude,b$w.south=e.min.latitude,b$w.east=e.max.longitude,b$w.north=e.max.latitude,!e$28(h$10.intersection(n.rectangle,b$w))))return r;var o,a,s=0,l=23;for(e$28(n._maximumLevel)&&(l=n._maximumLevel),this._imageryProvider instanceof M$X&&l--;s<=l&&(o=n._tilingScheme.positionToTileXY(e.max,s),a=n._tilingScheme.positionToTileXY(e.min,s),e$28(o)||(o=new o$1k(n._tilingScheme.getNumberOfXTilesAtLevel(s),0)),e$28(a)||(a=new o$1k(0,n._tilingScheme.getNumberOfYTilesAtLevel(s))),s!==l&&(e$28(y$q)||(y$q=new h$10),n._tilingScheme.tileXYToRectangle(a.x,a.y,s,y$q),!e$28(y$q)||!(y$q.width*i<2*(e.max.longitude-e.min.longitude)||y$q.height*i<2*(e.max.latitude-e.min.latitude))));s++);for(var u=a.x;u<=o.x;u++)for(var c=a.y;c>=o.y;c--)e$28(y$q)||(y$q=new h$10),n._tilingScheme.tileXYToRectangle(u,c,s,y$q),e$28(h$10.intersection(y$q,n.rectangle))&&e$28(h$10.intersection(y$q,b$w))&&r.push(this.getImageryFromCache(u,c,s));return r},h$p.prototype.getMaxScaleLevel=function(e){var t=1,i=0,r=this._imageryProvider;if(e$28(b$w)||(b$w=new h$10),b$w.west=e.min.longitude,b$w.south=e.min.latitude,b$w.east=e.max.longitude,b$w.north=e.max.latitude,!e$28(h$10.intersection(r.rectangle,b$w)))return[];var n,o,a=0,s=23;for(e$28(r._maximumLevel)&&(s=r._maximumLevel);a<=s&&(n=r._tilingScheme.positionToTileXY(e.max,a),o=r._tilingScheme.positionToTileXY(e.min,a),e$28(n)||(n=new o$1k(r._tilingScheme.getNumberOfXTilesAtLevel(a),0)),e$28(o)||(o=new o$1k(0,r._tilingScheme.getNumberOfYTilesAtLevel(a))),a!==s);a++)e$28(y$q)||(y$q=new h$10),r._tilingScheme.tileXYToRectangle(o.x,o.y,a,y$q),e$28(y$q)&&(y$q.width*t<2*(e.max.longitude-e.min.longitude)||y$q.height*t<2*(e.max.latitude-e.min.latitude))&&(i+=1,t*=2);return i},h$p.prototype.refresh=function(){var e=this._imageryLayers;if(e$28(e)){for(var t in this._imageryCache){var i=this._imageryCache[t];this.removeImageryFromCache(i)}var r=e.indexOf(this);e.remove(this,!1,!0),e.add(this,r)}},h$p.prototype.setLayerStatusParameters=function(e){var t=o$1q.defer();return this._imageryProvider.setLayerStatusParameters(e).then((e=>{this.refresh(),t.resolve(e)})).otherwise((e=>{t.reject(e)})),t.promise};var _0x11b982=(_0x5ce494=!0,function(e,t){var i=_0x5ce494?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5ce494=!1,i}),_0x5725fc=_0x11b982(void 0,(function(){return _0x5725fc.toString().search("(((.+)+)+)+$").toString().constructor(_0x5725fc).search("(((.+)+)+)+$")})),_0x5ce494;_0x5725fc();var _0x4f012b=null,_0xf748bc=null;function _0x27cba5(){}null!==_0x43b100&&(_0x4f012b=_0x43b100.cwrap("floatToTextureColor","number",["number","number","number","number","number","number","number"]),_0xf748bc=_0x43b100.cwrap("free_result",null,["number"]));var _0x42ea2f=new s$P;function _0x38bc75(e,t){for(var i=new Uint8Array(4*e.length),r=t._ceiling-t._floor,n=0,o=e.length;n<o;n++){var a=e[n],s=4*n;if(a<0||a>1)i[s+0]=255,i[s+1]=255,i[s+2]=255,i[s+3]=255;else{a=a*r+t._floor;var l=t._dictColorTable.getColor(a);i[s+0]=255*l.red,i[s+1]=255*l.green,i[s+2]=255*l.blue,i[s+3]=255*l.alpha}}return i}function _0x575bcc(e,t){var i=e,r=i.length,n=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*r);_0x43b100.HEAPF32.set(i,n/Float32Array.BYTES_PER_ELEMENT);var o=t._ceiling,a=t._floor,s=t._dictColorTable._dictTable._hash,l=[],u=[];for(var c in s)l.push(parseFloat(c));l.sort((function(e,t){return e-t}));for(var h=0,d=l.length;h<d;h++)u.push(s[l[h]]);var f=new ArrayBuffer(4*l.length),p=new Uint8Array(f),_=0;for(d=l.length;_<d;_++){var m=u[_];p[4*_]=255*m.red,p[4*_+1]=255*m.green,p[4*_+2]=255*m.blue,p[4*_+3]=255*m.alpha}var $=new Float32Array(f),g=(c=new Float32Array(l)).length,v=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*g);_0x43b100.HEAPF32.set(c,v/Float32Array.BYTES_PER_ELEMENT);var y=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*g);_0x43b100.HEAPF32.set($,y/Float32Array.BYTES_PER_ELEMENT);var x=_0x4f012b(n,r,o,a,v,y,g),b=new Uint8Array(_0x43b100.HEAPU8.buffer,x,4*r);return _0xf748bc(x),_0x43b100._free(n),_0x43b100._free(v),_0x43b100._free(y),b}function _0x19d868(e,t){var i=e.length/4;return _0x575bcc(new Float32Array(e.buffer,e.byteOffset,i),t)}function _0x3fc8ed(e,t){for(var i=e.length/4,r=new Float32Array(e.buffer,e.byteOffset,i),n=0;n<r.length;n++){var o=r[n],a=4*n;if(o<0||o>1)e[a+0]=255,e[a+1]=255,e[a+2]=255,e[a+3]=255;else{o=o*(t._ceiling-t._floor)+t._floor;var s=t._dictColorTable.getColor(o);e[a+0]=255*s.red,e[a+1]=255*s.green,e[a+2]=255*s.blue,e[a+3]=255*s.alpha}}return new Uint8Array(e.buffer,0,e.length)}function _0x537ca1(e){var t=new t$X(1,255,65025);(t=t$X.multiplyByScalar(t,e,t)).x=t.x-Math.floor(t.x),t.y=t.y-Math.floor(t.y),t.z=t.z-Math.floor(t.z);var i=new t$X,r=new t$X(1/255,1/255,0);return i.x=t.y*r.x,i.y=t.z*r.y,i.z=t.z*r.z,t=t$X.subtract(t,i,t)}function _0x1a494d(e,t,i){for(var r=new Uint8Array(4*e.length),n=0;n<e.length;n++){var o,a,s,l,u=e[n],c=4*n,h=new e$25(0,0,0,0);if(u>=0&&u<=1){var d=_0x537ca1(u);h.x=d.x,h.y=d.y,h.z=d.z,h.w=1}o=255*h.x,a=255*h.y,s=255*h.z,l=255*h.w,e$28(i)&&!0===i?(r[c+0]=parseInt(s),r[c+1]=parseInt(a),r[c+2]=parseInt(o),r[c+3]=parseInt(l)):(r[c+0]=parseInt(o),r[c+1]=parseInt(a),r[c+2]=parseInt(s),r[c+3]=parseInt(l))}return r}function _0x492cf6(e,t,i){for(var r=e.length/4,n=new Float32Array(e.buffer,e.byteOffset,r),o=0;o<n.length;o++){var a,s,l,u,c=n[o],h=4*o,d=new e$25(0,0,0,0);if(c>=0&&c<=1){c<e$27.EPSILON9?c=e$27.EPSILON9:1-c<e$27.EPSILON9&&(c=1-e$27.EPSILON9);var f=_0x537ca1(c);d.x=f.x,d.y=f.y,d.z=f.z,d.w=1}a=255*d.x,s=255*d.y,l=255*d.z,u=255*d.w,e$28(i)&&!0===i?(e[h+0]=l,e[h+1]=s,e[h+2]=a,e[h+3]=u):(e[h+0]=a,e[h+1]=s,e[h+2]=l,e[h+3]=u)}return new Uint8Array(e.buffer,0,e.length)}function _0x3bc4fe(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(e$28(i)){if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}else if(a.localName===t)return a}}function _0x468208(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];e$28(i)?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}function _0xdd94b5(e,t,i){var r=_0x3bc4fe(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function _0x12fd60(e,t,i){var r=_0x3bc4fe(e,t,i);if(e$28(r))return r.textContent.trim()}function _0x92e866(e,t,i){var r=_0x3bc4fe(e,t,i);if(e$28(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function _0x2606c7(e,t,i,r){var n=y$15.multiply(t,i,new y$15),o=e.vertexAttributes[0],a=o.typedArray,s=new Float32Array(a.buffer,a.byteOffset,a.byteLength/4),l=o.componentsPerAttribute,u=e.verticesCount,c=new Float32Array(3*u),h=e.attrLocation;h.aRatio=Object.keys(h).length;for(var d=0;d<u;d++){var f=new t$X(s[d*l],s[d*l+1],s[d*l+2]),p=new t$X;y$15.multiplyByPoint(n,f,p);var _=t$W.fromCartesian(p),m=e$27.toDegrees(_.longitude),$=e$27.toDegrees(_.latitude),g=_.height,v=(m-r.left)/r.width,y=($-r.bottom)/r.length,x=(g-r.minHeight)/r.height;c[3*d]=v,c[3*d+1]=y,c[3*d+2]=x}e.vertexAttributes.push({index:h.aRatio,typedArray:c,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1})}function _0x517366(e,t){for(var i=[],r=Math.max(t.max.longitude-t.min.longitude,t.max.latitude-t.min.latitude),n=0,o=Math.PI;n<23&&!(r>o);)o*=.5,n++;n--;var a=e,s=a._imageryProvider;e instanceof i$o&&(s=a._provider,a=a._inner);var l=new g$14,u=l.positionToTileXY(t.max,n),c=l.positionToTileXY(t.min,n);if(!e$28(s._minimumLevel)||n>s._minimumLevel){var h=s._maximumLevel;if(e instanceof i$o&&h--,e$28(h)){var d=n-h;d>0&&(c.x=Math.floor(c.x/Math.pow(2,d)),c.y=Math.floor(c.y/Math.pow(2,d)),u.x=Math.floor(u.x/Math.pow(2,d)),u.y=Math.floor(u.y/Math.pow(2,d)),n=h)}for(var f=c.x;f<=u.x;f++)for(var p=c.y;p>=u.y;p--)i.push(a.getImageryFromCache(f,p,n))}return i}_0x27cba5.convertFloat=function(e,t,i){i===k$T.FilterMode.NEAREST?null===_0x4f012b?_0x3fc8ed(e.imageArray,t):e.imageArray=_0x19d868(e.imageArray,t):_0x492cf6(e.imageArray)},_0x27cba5.convertFloatTexture=function(e,t,i){return i===k$T.FilterMode.LINEAR?_0x1a494d(e.imageArray,t,!0):null===_0x4f012b?_0x38bc75(e.imageArray,t):_0x575bcc(e.imageArray,t)},_0x27cba5.parseResult=function(e,t,i,r){if(i.isDestroyed())return i.s3mBuffer=null,i.volBuffer=null,void(i.task=void 0);var n=i._fileName.split("_"),o=parseInt(n[1]),a=parseInt(n[2]);o=Math.pow(2,t._level)-o-1,t._version=e.version;for(var s=t._gl,l=_0x42ea2f.read(e.xmlDoc).firstChild,u=l.namespaceURI,c=_0x468208(_0x3bc4fe(l,"Material3Ds",u),"material",u),h={},d=[],f=t._context,p=0,_=c.length;p<_;p++){var m=c[p],$=_0x12fd60(m,"name",u),g=new _0x34bd01({});h[$]=g;var v=_0x3bc4fe(m,"Ambient",u),y=u$Y(_0xdd94b5(v,"AmbientR",u),_0xdd94b5(v,"R",u)),x=u$Y(_0xdd94b5(v,"AmbientG",u),_0xdd94b5(v,"G",u)),b=u$Y(_0xdd94b5(v,"AmbientB",u),_0xdd94b5(v,"B",u)),w=u$Y(_0xdd94b5(v,"AmbientA",u),_0xdd94b5(v,"A",u));g._ambientColor=new e$1S(y,x,b,w);var C=_0x3bc4fe(m,"Diffuse",u);y=u$Y(_0xdd94b5(C,"DiffuseR",u),_0xdd94b5(C,"R",u)),x=u$Y(_0xdd94b5(C,"DiffuseG",u),_0xdd94b5(C,"G",u)),b=u$Y(_0xdd94b5(C,"DiffuseB",u),_0xdd94b5(C,"B",u)),w=u$Y(_0xdd94b5(C,"DiffuseA",u),_0xdd94b5(C,"A",u)),g._diffuseColor=new e$1S(y,x,b,w);var T=_0x3bc4fe(m,"Specular",u);y=u$Y(_0xdd94b5(T,"SpecularR",u),_0xdd94b5(T,"R",u)),x=u$Y(_0xdd94b5(T,"SpecularG",u),_0xdd94b5(T,"G",u)),b=u$Y(_0xdd94b5(T,"SpecularB",u),_0xdd94b5(T,"B",u)),w=u$Y(_0xdd94b5(T,"SpecularA",u),_0xdd94b5(T,"A",u)),g._specularColor=new e$1S(y,x,b,w);var S=_0xdd94b5(m,"Shininess",u);g._shininess=S,g._bTransparentSorting=_0x92e866(m,"TransparentSorting",u);var E=_0x468208(m,"texture",u);0===E.length&&t._fileType===f$r.OSGBFile&&(g._isInvalidOblique=!0);for(var A=0;A<E.length;A++){var P=E[A],I=_0x12fd60(P,"name",u),M=_0x12fd60(P,"TextureName",u),O=_0x3bc4fe(P,"AddressMode",u),D=_0x12fd60(O,"u",u),R=_0x12fd60(O,"v",u);D="TAM_WRAP"===D?q$11.REPEAT:q$11.CLAMP_TO_EDGE,R="TAM_WRAP"===R?q$11.REPEAT:q$11.CLAMP_TO_EDGE;for(var L=_0x12fd60(P,"TexModMatrix",u).split(","),B=16;B--;)L[B]=parseFloat(L[B]);g._texMatrix=y$15.unpack(L);var N=e.texturePackage[I],F=I+t._id+f._id+i._relativePath.path;if(e$28(N)&&(F+=N.imageBuffer.length),e$28(N)&&N.width>0&&N.height>0&&e$28(N.imageBuffer)&&N.imageBuffer.byteLength>0)switch(0===N.compressType&&(t._supportCompressType=0),i._texturesByteLength+=N.imageBuffer.length,N.compressType){case _0x493d0c.WEBP:var z=g.createWebp(F,M,f,A,N.imageBuffer,N.width,N.height,t.mipmapEnabled);d.push(z),g._isWEBP=!0;break;case _0x493d0c.CRN_DXT5:var k=g.createCRN(F,M,f,A,N,D,R,t.mipmapEnabled);d.push(k);break;default:var V=Se$8.CreateTexture(F,f,N.width,N.height,N.nFormat,N.compressType,N.imageBuffer,!1,D,R,t.mipmapEnabled);g._textures.push(V)}else if(t._isTextureShare){var U=t._baseUri+"Texture/"+M;e$28(a$Y.CREDENTIAL)&&(U=a$Y.addToken(U));var X=g.requestSharedTexture(U,F,M,f,A,t.customRequestHeaders,D,R);d.push(X)}if("png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt){var H=I+"_"+i._fileName;H=""!==t._volName?H+"_"+t._volName:H,"vol_texture_mapping"===t._strVolumeExt?H+=".vol":H+=".png";var G=i._relativePath.resolve(t._baseUri)+H;if(0!=t.urlType){var W=t._urlArguments,Y=G.indexOf("datas")+5,q=W.layer3DName,j=G.substring(G.indexOf("/path/")+6).split("/"),Z=W.scene3DName,K=j[0],Q=j[1].substring(0,j[1].indexOf(".")),J=j[1].substring(j[1].indexOf(".")+1,j[1].length);G=G.substring(0,Y)+"?layerName="+q+"&rootTile="+K+"&tile="+Q+"&suffix="+J+"&scene3DName="+Z+"&layer3DName="+q}var ee=void 0;"vol_texture_mapping"===t._strVolumeExt?e$28(ee=o$$(G,void 0))&&function(e,r,n){e.then((function(e){var o;if(e$28(e)){var a=void 0,s=new Uint8Array(e,8),l=nt$c.inflate(s).buffer;if(1===new Float64Array(l,0,1)[0]){var u=new Uint32Array(l,8,4),c=u[0],h=u[1],d=u[2];a={nFormat:c,nWidth:h,nHeight:d,nPixelSize:u[3],imageArray:new Float32Array(l,24,h*d)}}if(e$28(a)){var f,p=tt$h.LINEAR,_=rt$g.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(p=tt$h.NEAREST,_=rt$g.NEAREST),f=t._hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?_0x1a494d(a.imageArray,t._hypsometricSetting,!0):null===_0x4f012b?_0x38bc75(a.imageArray,t._hypsometricSetting):_0x575bcc(a.imageArray,t._hypsometricSetting),(o=new L$17({context:t._context,width:a.nWidth,height:a.nHeight,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:p,magnificationFilter:_})})).copyFrom({width:a.nWidth,height:a.nHeight,arrayBufferView:f}),i._volTextures[r]=o,n.texID2Vol=r}e=null}}),(function(e){}))}(ee,F,g):"png"===t._strVolumeExt&&(e$28(ee=t$D(G))&&function(e,r,n){e.then((function(e){var o;if(e$28(e)){var a,s=tt$h.LINEAR,l=rt$g.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(s=tt$h.NEAREST,l=rt$g.NEAREST),a=t._hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?_0x492cf6(d$11(e),t._hypsometricSetting,!0):null===_0x4f012b?_0x3fc8ed(d$11(e),t._hypsometricSetting):_0x19d868(d$11(e),t._hypsometricSetting),(o=new L$17({context:t._context,width:e.width,height:e.height,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:s,magnificationFilter:l})})).copyFrom({width:e.width,height:e.height,arrayBufferView:a}),e=null,i._volTextures[r]=o,n.texID2Vol=r}}),(function(e){}))}(ee,F,g)),d.push(ee)}}}o$1q.all(d,(function(){var r,n;if(e$28(t._volData)){r=t._volData._volBounds;var c=t._context._id+"_"+t.id+"_layerVol",d=k$T.FilterMode.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(d=k$T.FilterMode.NEAREST),e$28(t._hypsometricSetting)&&e$28(t._volData._buffer)&&(d===k$T.FilterMode.NEAREST?null===_0x4f012b?_0x3fc8ed(t._volData._buffer,t._hypsometricSetting):t._volData._buffer=_0x19d868(t._volData._buffer,t._hypsometricSetting):_0x492cf6(t._volData._buffer,t._hypsometricSetting));var f={};f.nLength=t._volData._nLength,f.imageArray=t._volData._buffer;var p=Se$8.CreateVolumeTexture(c,s,t._context,f,d);delete t._volData._buffer,t._volData._buffer=void 0,n={volTexture:p,nFormat:3201,nSideBlockCount:t._volData._nSideBlockCount,nBlockLength:t._volData._nBlockLength,nLength:t._volData._nLength,nWidth:t._volData._width,nHeight:t._volData._height,nDepth:t._volData._depth,id:c,dataFloor:t._volData._minValue,dataCeil:t._volData._maxValue,volBounds:r},i._volObj=n}else if("vol"===t._strVolumeExt)if(e.volImageBuffer){r=e.volBounds;c=t._context._id+"_"+t.id+"_"+i._relativePath.resolve(t._baseUri)+"_"+i._fileName,d=k$T.FilterMode.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(d=k$T.FilterMode.NEAREST),3201===e.volImageBuffer.nFormat&&e$28(t._hypsometricSetting)&&(d===k$T.FilterMode.NEAREST?null===_0x4f012b?_0x3fc8ed(e.volImageBuffer.imageArray,t._hypsometricSetting):e.volImageBuffer.imageArray=_0x19d868(e.volImageBuffer.imageArray,t._hypsometricSetting):_0x492cf6(e.volImageBuffer.imageArray,t._hypsometricSetting)),n={volTexture:p=Se$8.CreateVolumeTexture(c,s,t._context,e.volImageBuffer,d),nFormat:e.volImageBuffer.nFormat,nSideBlockCount:e.volImageBuffer.nSideBlockCount,nBlockLength:e.volImageBuffer.nBlockLength,nLength:e.volImageBuffer.nLength,nWidth:e.volImageBuffer.nWidth,nHeight:e.volImageBuffer.nHeight,nDepth:e.volImageBuffer.nDepth,id:c,dataFloor:t._fMinValue,dataCeil:t._fMaxValue,volBounds:r},delete e.volImageBuffer.imageArray,e.volImageBuffer.imageArray=null,e$28(i._volObj)&&Se$8.DecRef(i._volObj.id),i._volObj=n}else t._bVolume&&(e$28(n=i._volObj)&&(r=i._volObj.volBounds));var _=_0x3bc4fe(l,"PageLods",u),m=_0x468208(_,"PagedLOD",u),$=t._matModel;if(m.length>0){for(var g=0;g<m.length;g++){(ne=new _0x575d8a)._fileType=t._fileType;var v=m[g],y=_0x12fd60(v,"RangeDataList",u);y?y=y.replace(/.osgb$/,"").replace(/.s3m$/,""):i._isLeafTile=!0;var x=_0x12fd60(v,"RangeMode",u),b=_0xdd94b5(v,"RangeList",u),w=_0x3bc4fe(v,"BoundingSphere",u),C=_0xdd94b5(w,"x",u),T=_0xdd94b5(w,"y",u),S=_0xdd94b5(w,"z",u),E=_0xdd94b5(w,"radius",u),A=new t$X(C,T,S);ne._rangeMode="DISTANCE_FROM_EYE_POINT"==x?_0x189b29.DISTANCE_FROM_EYE_POINT:_0x189b29.PIXEL_SIZE_ON_SCREEN,ne._rangeDataList=y,0===ne._rangeDataList.indexOf("Root")&&(ne._processFileType=1),ne._rangeList=b,ne._boundingSphere=new i$19(A,E),ne._originalBS=new i$19(A,E),i$19.transform(ne._boundingSphere,t._matModel,ne._boundingSphere);for(var P=_0x468208(v,"Geode",u),I=[],M=[],O=0;O<P.length;O++){for(var D=_0x12fd60(ae=P[O],"GeoDeModMatrix",u).split(","),R=0;R<16;R++)D[R]=parseFloat(D[R]);if(1===t._heightScale)se=y$15.multiply($,D,new y$15);else{var L=y$15.multiplyByScale(D,new t$X(1,1,t._heightScale),new y$15);se=y$15.multiply($,L,new y$15)}for(var B=_0x468208(ae,"GeoName"),N=0;N<B.length;N++){var F=B[N].textContent.trim();if(!((ue=(le=e.geoPackage[F]).vertexPackage).verticesCount<1)){var z=le.arrIndexPackage,k=le.pickInfo,V={};for(O=0;O<z.length;O++){if(e$28(ce=z[O])){var U=ce.materialCode,X=h[U],H=new _0x34bd01({});e$28(X)&&X.clone(H),V[U]=H,("png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt)&&e$28(X.texID2Vol)&&(p=i._volTextures[X.texID2Vol])}}n&&(_0x2606c7(ue,t._oriMatModel,D,r),Se$8.AddRef(i._fileName));var G=ne._boundingSphere;if(ne._boundingSphere.radius<0){G=_0x4327f2.calcBoundingSphere(t,ue,se);var W=i$19.transform(G,y$15.inverse(se,new y$15),new i$19);i$19.transform(W,D,W),I.push(G),M.push(W)}var Y={context:t._context,vertexPackage:ue,arrIndexPackage:z,edgeGeometry:le.edgeGeometry,pickInfo:k,version:e.version,mapPass:V,layer:t,matModel:se,boundingVolume:G,volObj:n,volTexture:p,fileType:t._fileType,geoMatrix:D,level:t._level,row:o,col:a,geoName:F,entity:i};if(e$28(t.themeStyle)&&e$28(t.themeStyle._image)){var q=_0x3e8cbd.createRenderEntityPageLOD(Y,t);ne._renderEntityList=ne._renderEntityList.concat(q)}else{var j=new _0x1f65d5(Y);if(t._imageryLayer instanceof Array){for(var Z=[],K=0;K<t._imageryLayer.length;K++){if(e$28(he=t._imageryLayer[K])&&(he instanceof h$p||he instanceof i$o)){var Q=_0x517366(he,le.cartographicBounds);Z=Z.concat(Q)}}Z.length>0&&j.setImagerys(Z,le.cartographicBounds)}else{if(e$28(t._imageryLayer)&&(t._imageryLayer instanceof h$p||t._imageryLayer instanceof i$o))(Z=_0x517366(t._imageryLayer,le.cartographicBounds)).length>0&&j.setImagerys(Z,le.cartographicBounds)}ne._renderEntityList.push(j)}}}}ne._boundingSphere.radius<0&&(ne._boundingSphere=i$19.fromBoundingSpheres(I,new i$19),ne._originalBS=i$19.fromBoundingSpheres(M,new i$19)),e$28(i._pagelodMap[y])?(i._pagelodMap[y]._renderEntityList=ne._renderEntityList,i._pagelodMap[y]._ready=!0):(i._childrenPageLod.push(ne),t.LoadingPriority===U$p.UsePagedLodInfo&&(ne._isLeafNode=!0))}if((P=_0x468208(_,"Geode",u)).length>0){I=[],M=[];(ne=new _0x575d8a)._fileType=t._fileType,ne._isLeafNode=!0;for(O=0;O<P.length;O++){for(D=_0x12fd60(ae=P[O],"GeoDeModMatrix",u).split(","),R=0;R<16;R++)D[R]=parseFloat(D[R]);if(1===t._heightScale)se=y$15.multiply($,D,new y$15);else{L=y$15.multiplyByScale(D,new t$X(1,1,t._heightScale),new y$15);se=y$15.multiply($,L,new y$15)}for(var J=_0x468208(ae,"GeoName",u),ee=0;ee<J.length;ee++){F=J[ee].textContent.trim();if(!((ue=(le=e.geoPackage[F]).vertexPackage).verticesCount<1)){k=le.pickInfo;var te=_0x4327f2.calcBoundingSphere(t,ue,se);W=i$19.transform(te,y$15.inverse(se,new y$15),new i$19);i$19.transform(W,D,W),I.push(te),M.push(W);var ie=_0x4327f2.calcBoundingRectangle(t,ue);z=le.arrIndexPackage,V={};for(var re in z){if(e$28(ce=z[re])){U=ce.materialCode,X=h[U],H=new _0x34bd01({});e$28(X)&&X.clone(H),V[U]=H,("png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt)&&e$28(X.texID2Vol)&&(p=i._volTextures[X.texID2Vol])}}n&&(_0x2606c7(ue,t._oriMatModel,D,r),Se$8.AddRef(i._fileName));Y={context:t._context,vertexPackage:ue,arrIndexPackage:z,edgeGeometry:le.edgeGeometry,pickInfo:k,version:e.version,mapPass:V,layer:t,matModel:se,boundingVolume:te,boundingRectangle:ie,volObj:n,volTexture:p,fileType:t._fileType,geoMatrix:D,level:t._level,row:o,col:a,geoName:F,entity:i};if(e$28(t.themeStyle)){q=_0x3e8cbd.createRenderEntityPageLOD(Y,t);ne._renderEntityList=ne._renderEntityList.concat(q)}else{j=new _0x1f65d5(Y);if(t._imageryLayer instanceof Array){for(Z=[],K=0;K<t._imageryLayer.length;K++){if(e$28(he=t._imageryLayer[K])&&(he instanceof h$p||he instanceof i$o)){Q=_0x517366(he,le.cartographicBounds);Z=Z.concat(Q)}}Z.length>0&&j.setImagerys(Z,le.cartographicBounds)}else{if(e$28(t._imageryLayer)&&(t._imageryLayer instanceof h$p||t._imageryLayer instanceof i$o))(Z=_0x517366(t._imageryLayer,le.cartographicBounds)).length>0&&j.setImagerys(Z,le.cartographicBounds)}ne._renderEntityList.push(j)}}}}ne._boundingSphere=i$19.fromBoundingSpheres(I,new i$19),ne._originalBS=i$19.fromBoundingSpheres(M,new i$19),ne._ready=!0,i._childrenPageLod.push(ne)}}else{var ne;i._isLeafTile=!0,(ne=new _0x575d8a)._fileType=t._fileType;var oe=_0x468208(_,"Geode");for(I=[],M=[],g=0;g<oe.length;g++){var ae;for(D=_0x12fd60(ae=oe[g],"GeoDeModMatrix",u).split(","),R=0;R<16;R++)D[R]=parseFloat(D[R]);var se;if(1===t._heightScale)se=y$15.multiply($,D,new y$15);else{L=y$15.multiplyByScale(D,new t$X(1,1,t._heightScale),new y$15);se=y$15.multiply($,L,new y$15)}for(J=_0x468208(ae,"GeoName",u),ee=0;ee<J.length;ee++){var le,ue;F=J[ee].textContent.trim();if(!((ue=(le=e.geoPackage[F]).vertexPackage).verticesCount<1)){k=le.pickInfo,te=_0x4327f2.calcBoundingSphere(t,ue,se),W=i$19.transform(te,y$15.inverse(se,new y$15),new i$19);i$19.transform(W,D,W),I.push(te),M.push(te);for(ie=_0x4327f2.calcBoundingRectangle(t,ue),z=le.arrIndexPackage,V={},O=0;O<z.length;O++){var ce;if(e$28(ce=z[O])){U=ce.materialCode,X=h[U],H=new _0x34bd01({});e$28(X)&&X.clone(H),V[U]=H,("png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt)&&e$28(X.texID2Vol)&&(p=i._volTextures[X.texID2Vol])}}n&&(_0x2606c7(ue,t._oriMatModel,D,r),Se$8.AddRef(i._fileName));Y={context:t._context,vertexPackage:ue,arrIndexPackage:z,edgeGeometry:le.edgeGeometry,pickInfo:k,version:e.version,mapPass:V,layer:t,matModel:se,boundingVolume:te,boundingRectangle:ie,volObj:n,volTexture:p,fileType:t._fileType,geoMatrix:D,level:t._level,row:o,col:a,geoName:F,entity:i};if(e$28(t.themeStyle)&&e$28(t.themeStyle._image)){q=_0x3e8cbd.createRenderEntityPageLOD(Y,t);ne._renderEntityList=ne._renderEntityList.concat(q)}else{j=new _0x1f65d5(Y);if(t._imageryLayer instanceof Array){for(Z=[],K=0;K<t._imageryLayer.length;K++){var he;if(e$28(he=t._imageryLayer[K])&&(he instanceof h$p||he instanceof i$o)){Q=_0x517366(he,le.cartographicBounds);Z=Z.concat(Q)}}Z.length>0&&j.setImagerys(Z,le.cartographicBounds)}else{if(e$28(t._imageryLayer)&&(t._imageryLayer instanceof h$p||t._imageryLayer instanceof i$o))(Z=_0x517366(t._imageryLayer,le.cartographicBounds)).length>0&&j.setImagerys(Z,le.cartographicBounds)}ne._renderEntityList.push(j)}}}}ne._boundingSphere=i$19.fromBoundingSpheres(I,new i$19),ne._originalBS=i$19.fromBoundingSpheres(M,new i$19),ne._ready=!0,i._childrenPageLod.push(ne)}if(!e$28(i._boundingSphere)||i._isLeafTile){for(var de=[],fe=0;fe<i._childrenPageLod.length;fe++)de.push(i._childrenPageLod[fe]._boundingSphere);i._boundingSphere=i$19.fromBoundingSpheres(de),i._oriBoundingSphere=i$19.clone(i._boundingSphere)}if(!t$X.equals(t._boundingSphereOffset,t$X.ZERO)){var pe=Math.max(Math.abs(t._boundingSphereOffset.x),Math.abs(t._boundingSphereOffset.y),Math.abs(t._boundingSphereOffset.z));i.extendRadius(pe)}for(var _e in h){var me=h[_e];!e$28(me)||(me.destroy(),h[_e]=null)}n&&Se$8.DecRef(i._fileName),i._s3mLoadState=I$F.PARSED,i._isParsed=!0,t.LoadingPriority===U$p.UsePagedLodInfo&&i._isEmptyTree&&i.setEmptyTreeFlag(!1)}))},_0x27cba5.binaryDataParser=function(e,t,i,r){if(t._s3mLoadState===I$F.UNLOAD)return t.s3mBuffer=null,t.volBuffer=null,void(t.task=void 0);var n;e$28(e._imageryLayer)&&(n=e._fileType!==f$r.OSGBFile&&e._fileType!==f$r.OSGBCacheFile||e$28(e.waterEffectSet)?void 0:y$15.pack(e._matModel,new Array(16)));var o={buffer:i,supportCompressType:e._supportCompressType,ignoreNormal:e._ignoreNormal,bVolume:!1,modelMatrix:n,isCoverImageryLayer:e$28(e._imageryLayer)},a=[i];e$28(r)&&"vol"===e._strVolumeExt&&(o.bVolume=!0,o.volbuffer=r,a.push(r)),_0x333f13.init||_0x333f13.initWebAssembly();var s=_0x333f13.S3MTaskProcessor.scheduleTask(o,a);!e$28(s)||(t._s3mLoadState=I$F.PARSING,e._layerScheduler._statistics.numberOfProcessingAttempted=0,e._layerScheduler._statistics.numberOfTilesProcessing++,t.s3mBuffer=null,t.volBuffer=null,s.then((function(i){if(e$28(window.Proxy)){var n=t._relativePath.toString()+t._fileName;if((!0===e._indexedDBSetting.isGeoTilesSave||e._indexedDBSetting.isGeoTilesRootNodeSave&&e._layerScheduler._isRootNode(n))&&e$28(e._layerScheduler._indexedDBScheduler)){if(e$28(e._layerScheduler._indexedDBScheduler.cachestatus)&&e$28(e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename])&&(1===e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename][n]||2===e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename][n]))return;var o={blob:i,key:n,tablename:e._layerScheduler.tablename,dbname:e._layerScheduler._indexedDBScheduler.dbname};_0x333f13.indexTaskProcessor.scheduleTask(o,[])}}e._layerScheduler._statistics.numberOfTilesProcessing--,_0x27cba5.parseResult(i,e,t,r)})).otherwise((function(i){if(e._layerScheduler._statistics.numberOfTilesProcessing--,t.task=void 0,t._s3mLoadState==I$F.UNLOAD)return t.s3mBuffer=null,void(t.volBuffer=null);e$28(i)?(t.s3mBuffer=null,t.volBuffer=null,t._s3mLoadState=I$F.FAILED,console.log(i)):t._s3mLoadState=I$F.LOADED})))};var _0x2c6003=(_0x509231=!0,function(e,t){var i=_0x509231?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x509231=!1,i}),_0x16adeb=_0x2c6003(void 0,(function(){return _0x16adeb.toString().search("(((.+)+)+)+$").toString().constructor(_0x16adeb).search("(((.+)+)+)+$")})),_0x509231;function _0x4a5bf1(){this.skeletons=new e$1P,this.bufferCache={},this.vertexJob=new _0x515468,this.indexJob=new _0x26343b}_0x16adeb(),_0x4a5bf1.STATE={SkeletonParsing:0,SkeletonReady:1};var _0x297045={UNLOAD:0,LOADING:1,LOADED:2,PARSING:3,PARSED:4,CREATING:5,READY:6,LOADFAILED:7,PARSFAILED:8};function _0x515468(){this.context=void 0,this.geoPackage=void 0,this.index=0}function _0x26343b(){this.geoPackage=void 0,this.context=void 0,this.index=0}function _0x452928(e,t,i){if(!e$28(t.request)){let o=i.split("#");var r=new h$$("./ModelFile/"+(encodeURIComponent(o[0])+(o[1]?"#"+o[1]:""))).resolve(e._baseUri).toString();e$28(a$Y.CREDENTIAL)&&(r=a$Y.addToken(r));var n=new r$1c({url:r,throttle:!0,throttleByServer:!0,serverKey:r$1b.getServerKey(r),priorityFunction:function(){return 1e3}});t.request=n}var o=o$$(t.request.url,void 0,t.request);!e$28(o)||(t.state=_0x297045.LOADING,o.then((function(e){t.request=void 0,t.buffer=e,t.state=_0x297045.LOADED})).otherwise((function(e){e$28(e)?t.state=_0x297045.LOADFAILED:(t.state=_0x297045.UNLOAD,t.request=void 0)})))}function _0x2ed7f3(e,t,i){var r={buffer:i,isS3MZ:!1,supportCompressType:e._supportCompressType,ignoreNormal:e._ignoreNormal,isJsonScp:e._isJsonScp,createEdge:!1},n=[i];if(_0x333f13.init||_0x333f13.initWebAssembly(),_0x333f13.taskProcessorReady){var o=_0x333f13.S3MBTaskProcessor.scheduleTask(r,n);!e$28(o)||(t.buffer=void 0,t.state=_0x297045.PARSING,o.then((function(e){t.state=_0x297045.PARSED,t.skeletonPackage=e})).otherwise((function(e){t.state=_0x297045.PARSFAILED})))}}function _0x518ca1(e,t,i,r){var n=e._context,o=i.skeletonPackage.geoPackage;for(var a in delete o.ignoreNormal,o)if(o.hasOwnProperty(a)){for(var s=o[a],l=s.vertexPackage.vertexAttributes.length,u=new r$_,c=0;c<l;c++)u.enqueue(c);i.vertexBufferToCreate.set(a,u);var h=s.arrIndexPackage[0];if(e$28(h)){ce$v.UNSIGNED_SHORT,(1===h.indexType||s.vertexPackage.verticesCount>=e$27.SIXTY_FOUR_KILOBYTES)&&n.elementIndexUint&&ce$v.UNSIGNED_INT;var d=new r$_;d.enqueue(0),i.indexBufferToCreate.set(a,d)}t.bufferCache[r+"_"+a]=1}i.state=_0x297045.CREATING}function _0x306902(e,t,i,r){var n=!0;for(var o in i.vertexBufferToCreate._hash){for(var a=i.vertexBufferToCreate._hash[o];a.length;){var s=a.peek();if(t.vertexJob.set(e._context,i.skeletonPackage.geoPackage[o],s),!e._frameState.jobScheduler.execute(t.vertexJob,i$B.BUFFER))break;a.dequeue()}n=n&&0===a.length}for(var o in i.indexBufferToCreate._hash){for(a=i.indexBufferToCreate._hash[o];a.length;){s=a.peek();if(t.indexJob.set(e._context,i.skeletonPackage.geoPackage[o],s),!e._frameState.jobScheduler.execute(t.indexJob,i$B.BUFFER))break;a.dequeue()}n=n&&0===a.length}n&&(i.vertexBufferToCreate=void 0,i.indexBufferToCreate=void 0,i.state=_0x297045.READY)}_0x515468.prototype.set=function(e,t,i){this.context=e,this.geoPackage=t,this.index=i},_0x515468.prototype.execute=function(){var e=this.context,t=this.index,i=this.geoPackage.vertexPackage.vertexAttributes[t];e$28(i.vertexBuffer)||(i.vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:i.typedArray,usage:A$1c.STATIC_DRAW}),delete i.typedArray,i.vertexBuffer.vertexArrayDestroyable=!1)},_0x26343b.prototype.set=function(e,t,i){this.geoPackage=t,this.context=e,this.index=i},_0x26343b.prototype.execute=function(){var e=this.context;this.index;var t=this.geoPackage.arrIndexPackage[0],i=this.geoPackage.vertexPackage.verticesCount,r=ce$v.UNSIGNED_SHORT;(1===t.indexType||i>=e$27.SIXTY_FOUR_KILOBYTES)&&e.elementIndexUint&&(r=ce$v.UNSIGNED_INT);var n=h$W.createIndexBuffer({context:e,typedArray:t.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:r});n.vertexArrayDestroyable=!1,delete t.indicesTypedArray,t.indexBuffer=n},_0x4a5bf1.prototype.getSkeleton=function(e,t,i){var r=t.skeletonPackages,n=i.indexOf("#"),o=i;n>-1&&(o=i.substring(0,n));var a=this.skeletons.get(o);return e$28(a)||(a={state:_0x297045.UNLOAD,skeletonPackage:void 0,vertexBufferToCreate:new e$1P,indexBufferToCreate:new e$1P},this.skeletons.set(o,a)),a.state===_0x297045.UNLOAD?_0x452928(e,a,i):a.state===_0x297045.LOADED?_0x2ed7f3(e,a,a.buffer):a.state===_0x297045.PARSED?_0x518ca1(e,this,a,o):a.state===_0x297045.CREATING&&_0x306902(e,this,a),a.state===_0x297045.READY&&(r.contains(o)||r.set(o,a.skeletonPackage)),a},_0x4a5bf1.prototype.remove=function(e){var t=this.skeletons.get(e);if(e$28(t)&&e$28(t.skeletonPackage)){var i=t.skeletonPackage.geoPackage;for(var r in i)if(i.hasOwnProperty(r)){for(var n=i[r],o=n.vertexPackage.vertexAttributes,a=o.length,s=0;s<a;s++){var l=o[s];if(e$28(l.vertexBuffer)){var u=l.vertexBuffer;l.vertexBuffer.vertexArrayDestroyable=!0,e$28(u)&&!u.isDestroyed()&&u.vertexArrayDestroyable&&u.destroy(),l.vertexBuffer=void 0}}var c=n.arrIndexPackage[0];if(e$28(c)){var h=c.indexBuffer;h.vertexArrayDestroyable=!0,e$28(h)&&!h.isDestroyed()&&h.vertexArrayDestroyable&&h.destroy(),c.indexBuffer=void 0}delete this.bufferCache[e+"_"+r]}this.skeletons.remove(e)}},_0x4a5bf1.parse=function(e,t){var i=t.instancePackage.geoPackage;delete i.ignoreNormal;var r=!0;for(var n in e$28(t.skeletonPackages)||(t.skeletonPackages=new e$1P),i)if(i.hasOwnProperty(n)){r=e.instanceSkeletonManager.getSkeleton(e,t,n).state===_0x297045.READY&&r}r&&(t.skeletonState=_0x4a5bf1.STATE.SkeletonReady)};var _0x1aa189=(_0x3b7dd4=!0,function(e,t){var i=_0x3b7dd4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3b7dd4=!1,i}),_0x3dec00=_0x1aa189(void 0,(function(){return _0x3dec00.toString().search("(((.+)+)+)+$").toString().constructor(_0x3dec00).search("(((.+)+)+)+$")})),_0x3b7dd4;_0x3dec00();var _0x305a0a=4369,_0x497a47=6410;function _0x33be61(e){this.context=e.context,this.gl=e.context._gl,this.contextId=e.context.id,this.layerId=e.layerId,this.rootName=e.rootName,this.textureId=e.textureId,this._width=e.width,this._height=e.height,this._compressType=e.compressType,this._supportCompressType=e.supportCompressType,this._pixelFormat=e.pixelFormat,this._internalFormat=e.internalFormat,this.wrapS=u$Y(e.wrapS,q$11.CLAMP_TO_EDGE),this.wrapT=u$Y(e.wrapT,q$11.CLAMP_TO_EDGE),this.arrayBufferView=e.arrayBufferView,this._texture=void 0,this._target=this.gl.TEXTURE_2D,this.size=this._width*this._height,this.refCount=1,this.ready=!1,this.renderable=!1,this.isTexBlock=!0,e$28(this.arrayBufferView)&&this.init(),this._sizeInBytes=V$O.compressedTextureSizeInBytes(this._internalFormat,this._width,this._height),this.context.memorySize+=this._sizeInBytes}function _0xf984d3(e,t,i,r){var n=1;if(!e$27.isPowerOfTwo(i)||!e$27.isPowerOfTwo(r))return!1;for(var o=e.length,a=i,s=r,l=0;;){if(l+=V$O.compressedTextureSizeInBytes(t,a,s),s>>=1,0==(a>>=1)&&0==s)break;n++,a=Math.max(a,1),s=Math.max(s,1)}return l===o?n:1}_0x33be61.prototype.init=function(){if(this._compressType===_0xbc8ee1.enrS3TCDXTN&&1!=this._supportCompressType){if(e$28(this.arrayBufferView)){var e=null;L$12.decode(e,this._width,this._height,this.arrayBufferView,this._pixelFormat),e=this._pixelFormat>_0x493d0c.BGR||this._pixelFormat===_0x493d0c.LUMINANCE_ALPHA?new Uint8Array(this._width*this._height*4):new Uint16Array(this._width*this._height),L$12.decode(e,this._width,this._height,this.arrayBufferView,this._pixelFormat),this.arrayBufferView=e}this._internalFormat=_0x305a0a}var t=this.gl;e$28(this._texture)||(this._texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,this._texture);var i=this._internalFormat,r=0;if(e$28(this.arrayBufferView)){var n=this._width,o=this._height,a=_0xf984d3(this.arrayBufferView,i,this._width,this._height)>1,s=this.arrayBufferView.byteLength,l=0;(i===_0x497a47||i===_0x305a0a)&&t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0);do{var u=V$O.compressedTextureSizeInBytes(i,n,o),c=new Uint8Array(this.arrayBufferView.buffer,this.arrayBufferView.byteOffset+l,u);i===_0x305a0a?t.texImage2D(t.TEXTURE_2D,r++,t.RGBA,n,o,0,t.RGBA,t.UNSIGNED_BYTE,c):t.compressedTexImage2D(t.TEXTURE_2D,r++,i,n,o,0,c),n=Math.max(n>>1,1),o=Math.max(o>>1,1),l+=u}while(a&&l<s)}else{var h=V$O.compressedTextureSizeInBytes(i,this._width,this._height);i===_0x305a0a?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this._width,this._height,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(this._width*this._height*4)):t.compressedTexImage2D(t.TEXTURE_2D,0,i,this._width,this._height,0,new Uint8Array(h))}r>1?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),e$27.isPowerOfTwo(this._width)&&e$27.isPowerOfTwo(this._height)?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT),t.texParameteri(this._target,this.context._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,1),t.bindTexture(t.TEXTURE_2D,null),this.arrayBufferView=void 0,this.ready=!0},_0x33be61.prototype.copyFrom=function(e){var t=this.gl,i=this._target;t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture);var r=e.xOffset,n=e.yOffset,o=e.width,a=e.height,s=e.arrayBufferView,l=this._internalFormat,u=t.UNSIGNED_BYTE;if(t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),this._compressType===_0xbc8ee1.enrS3TCDXTN&&1!=this._supportCompressType){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0);var c=null;l=this._pixelFormat;L$12.decode(c,o,a,s,l),c=l>_0x493d0c.BGR||l===_0x493d0c.LUMINANCE_ALPHA?new Uint8Array(o*a*4):new Uint16Array(o*a),L$12.decode(c,o,a,s,l),s=c,this._internalFormat=_0x305a0a,t.texSubImage2D(t.TEXTURE_2D,0,r,n,o,a,t.RGBA,u,s)}else{t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1);var h=V$O.compressedTextureSizeInBytes(l,o,a),d=new Uint8Array(s.buffer,s.byteOffset,h);t.compressedTexSubImage2D(i,0,r,n,o,a,l,d)}t.bindTexture(i,null)},_0x33be61.prototype.update=function(e){this.context=e.context,this.gl=e.context._gl,this.contextId=e.context.id,this.layerId=e.layerId,this.rootName=e.rootName,this.textureId=e.textureId,this._width=e.width,this._height=e.height,this._internalFormat=e.internalFormat,this.arrayBufferView=e.arrayBufferView,this.refCount=1,this.ready=!1,this.renderable=!1,e$28(this.arrayBufferView)&&this.init()},_0x33be61.prototype.destroy=function(){this.gl.deleteTexture(this._texture),this._texture=null,this.refCount=0,this.ready=!1,this.renderable=!1,this.context.memorySize-=this._sizeInBytes};var _0x3dd425=(_0x1d6671=!0,function(e,t){var i=_0x1d6671?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1d6671=!1,i}),_0x15fbdb=_0x3dd425(void 0,(function(){return _0x15fbdb.toString().search("(((.+)+)+)+$").toString().constructor(_0x15fbdb).search("(((.+)+)+)+$")})),_0x1d6671;_0x15fbdb();var _0x55f040={cache:{},cacheSize:0,freeCache:{},freeQueue:new r$_,freeCacheSize:0,throttleSize:52428800,getCache:function(e,t,i){var r=this.cache[e];e$28(r)||(r=this.cache[e]={});var n=r[t];e$28(n)||(n=r[t]={});var o=n[i];return e$28(o)||(o=n[i]={}),o},get:function(e,t,i,r){var n=this.getCache(e,t,i)[r];if(e$28(n))return n.refCount++,n},create:function(e){var t=e.context,i=t.id,r=e.layerId,n=e.rootName,o=e.textureId,a=this.getCache(i,r,n),s=a[o];if(e$28(s))return s.refCount++,s;var l=e.width,u=e.height,c=e.compressType,h=e.supportCompressType,d=e.pixelFormat,f=e.arrayBufferView;return s=new _0x33be61({context:t,layerId:r,rootName:n,textureId:o,width:l,height:u,compressType:c,supportCompressType:h,pixelFormat:d,internalFormat:e.internalFormat,arrayBufferView:f}),a[o]=s,s},del:function(e){if(e$28(e.contextId)){var t=this.getCache(e.contextId,e.layerId,e.rootName);!e$28(t[e.textureId])||0==--e.refCount&&(delete t[e.textureId],e.destroy())}}},_0x5eeb20=(_0x500eee=!0,function(e,t){var i=_0x500eee?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x500eee=!1,i}),_0x57fab6=_0x5eeb20(void 0,(function(){return _0x57fab6.toString().search("(((.+)+)+)+$").toString().constructor(_0x57fab6).search("(((.+)+)+)+$")})),_0x500eee;function _0x469da(){this.isRoot=!1,this.isLeaf=!1,this.ownerLayerName=void 0,this._refCount=0,this.ownerEntity=void 0,this._ambientColor=new e$25(1,1,1,1),this._diffuseColor=new e$25(1,1,1,1),this._specularColor=new e$25(0),this._texMatrix=y$15.clone(y$15.IDENTITY,new y$15),this._shininess=50,this._bTransparentSorting=!1,this._textures=[],this._created=!1,this._createdBaker=!1,this._subRequested=!1,this._subRequestedBaker=!1,this._subRequestNames=void 0,this._subRequestNamesBake=void 0,this._subTextureNames=void 0,this._subTextureNamesBake=void 0,this._subBatchValues=void 0,this._oriTextureBake=void 0,this._batchTable=void 0,this._batchTableBake=void 0,this._ancestorTexture=void 0,this._oriTexture=void 0,this.textureParameter=void 0,this.textureParameterBake=void 0,this.textureInitilized=!1,this.textureBakeInitilized=!1,this.textureRenderableFlag=!1,this.textureBakeRenderableFlag=!1,this.isCrnTexture=!1,this.hasTexture=!0,this.taskMap={},this._usePBR=!1}function _0xac7e10(e){if(!e$28(e))return this._offsetPeriod=0,this._offsetSpeedU=0,this._offsetSpeedV=0,this._tilingPeriod=0,this._tilingSpeedU=0,void(this._tilingSpeedV=0);this._offsetPeriod=e.OffsetPeriod,this._offsetSpeedU=e.OffsetSpeedU,this._offsetSpeedV=e.OffsetSpeedV,this._tilingPeriod=e.TilingPeriod,this._tilingSpeedU=e.TilingSpeedU,this._tilingSpeedV=e.TilingSpeedV}_0x57fab6(),_0x469da.prototype.createPBRParamter=function(e){if(e$28(e.pbrMetallicRoughness)&&!this._usePBR){var t=e.pbrMetallicRoughness;this._usePBR=!0,this._alphaCutoff=u$Y(t.alphaCutoff,e.alphaCutoff),this._alphaMode=u$Y(t.alphaMode,e.alphaMode),this._baseColor=new e$1S(t.baseColor.x,t.baseColor.y,t.baseColor.z,t.baseColor.w),this._baseColorTextureIndex=t.baseColorTextureIndex,this._baseColorTextureCoordIndex=t.baseColorTextureCoordIndex,this._doubleSided=t.doubleSided,this._emissiveFactor=new e$1S(t.emissiveFactor.x,t.emissiveFactor.y,t.emissiveFactor.z,1),this._emissiveTextureIndex=t.emissiveTextureIndex,this._emissiveTextureCoordIndex=t.emissiveTextureCoordIndex,this._roughnessFactor=t.roughnessFactor,this._metallicFactor=t.metallicFactor,this._metallicRoughnessTextureIndex=t.metallicRoughnessTextureIndex,this._metallicRoughnessTextureCoordIndex=t.metallicRoughnessTextureCoordIndex,this._normalTextureIndex=t.normalTextureIndex,this._normalTextureCoordIndex=t.normalTextureCoordIndex,this._normalTextureScale=t.normalTextureScale,this._occlusionTextureIndex=t.occlusionTextureIndex,this._occlusionTextureCoordIndex=t.occlusionTextureCoordIndex,this._occlusionTextureStrength=t.occlusionTextureStrength,this._baseColorTextureMotion=new _0xac7e10(t.baseColorTextureMotion),this._emissiveTextureMotion=new _0xac7e10(t.emissiveTextureMotion)}};var _0x390c66={};function _0x4804d4(e,t,i){for(var r in i)if(i.hasOwnProperty(r)){var n=i[r],o=Number(r);t.setBatchedAttribute(o,0,n)}t.update(e)}function _0x1c529d(e,t,i,r,n,o){var a=n[r];if(e$28(a)){for(var s=_0x55f040.get(e,t,i,a);e$28(a)&&e$28(s)&&!s.renderable;)s.refCount--,a=n[a],s=_0x55f040.get(e,t,i,a);return o.name=a,s}}function _0x49f92a(e){var t=e.indexOf(".");return e.substr(0,t)}_0x469da.prototype.createBakeTexture=function(e,t,i,r,n,o,a,s){if(!this._createdBaker){this.textureParameterBake={context:e,layer:t,isRoot:i,rootName:r,curTextureName:n,textureInfo:o,rootBatchIdMap:a,ancestorMap:s};var l=t._textureLod;this._createdBaker=!0,this._subRequestedBaker=i&&l;var u=o.textureData,c=V$O.RGBA_DXT5,h=_0x55f040.create({context:e,layerId:t.id,rootName:r,textureId:o.id,width:o.width,height:o.height,compressType:o.compressType,supportCompressType:t._supportCompressType,pixelFormat:o.format,internalFormat:c,arrayBufferView:u});h.renderable=i&&l;var d=o.subTexInfos.length,f=a[o.rootTextureName];if(this._textures.push(h),l){var p=[{functionName:"czm_batchTable_xywh2",componentDatatype:S$W.FLOAT,componentsPerAttribute:4}],_=e$28(f)?Object.keys(f).length:d;this._batchTableBake=new x$Q(e,p,_),this._batchTableBake.suffix="_2";var m=_0x390c66[t.name];e$28(m)||(m=_0x390c66[t.name]={});var $=m[r];e$28($)||($=m[r]={});var g=$[n];e$28(g)||(g=$[n]={});for(var v=o.subTexInfos,y=0;y<d;y++){var x=v[y],b=x.subName.split("_")[0],w=new e$25(x.offsetX,x.offsetY,x.width,x.height);g[b]=w}}if(!i||!l){this._subRequestNamesBake=[];for(y=0;y<o.requestNames.length;y++){var C=o.requestNames[y],T=_0x49f92a(C);if("Tex"===T.split("_")[0]){var S=C.split("#"),E=_0x49f92a(S[0]);if(S.length>1)for(var A=S[1],P=A.length,I=0;I<P;I+=3){var M=E+"_"+A.substring(I,I+3);this._subRequestNamesBake.push(M)}}else this._subRequestNamesBake.push(T)}}return this._oriTextureBake=h,h}},_0x469da.prototype.initTexture=function(){if(!this.textureInitilized&&e$28(this.textureParameter)){this.textureInitilized=!0;var e=this.textureParameter.context,t=this.textureParameter.layer,i=this.textureParameter.isRoot,r=this.textureParameter.rootName,n=this.textureParameter.curTextureName,o=this.textureParameter.textureInfo,a=this.textureParameter.rootBatchIdMap,s=this.textureParameter.ancestorMap;this.textureParameter=void 0;var l={},u=a[o.rootTextureName],c=i||!t._textureLod?void 0:_0x1c529d(e.id,t.id,r,n,s,l),h=_0x390c66[t.name];e$28(h)||(h=_0x390c66[t.name]={});var d=h[r];e$28(d)||(d=h[r]={});var f=d[n];e$28(f)||(f=d[n]={});for(var p=i?void 0:e$28(l.name)?d[l.name]:void 0,_={},m=o.subTexInfos,$=[],g=o.subTexInfos.length,v=0;v<g;v++){var y=m[v];if($.push(y.subName),t._textureLod){var x=y.subName.split("_")[0],b=new e$25(y.offsetX,y.offsetY,y.width,y.height),w=e$28(u)?u[x]:v,C=i?void 0:e$28(p)?p[x]:void 0,T=e$28(C)?C:b;this._batchTable.setBatchedAttribute(w,0,T),_[w]=b,f[x]=b}}this._subTexInfos=m,this._subTextureNames=$,this._subBatchValues=_,this._ancestorTexture=c}},_0x469da.prototype.initBakeTexture=function(){if(!this.textureBakeInitilized&&e$28(this.textureParameterBake)){this.textureBakeInitilized=!0;var e=this.textureParameterBake.context,t=this.textureParameterBake.layer,i=this.textureParameterBake.isRoot,r=this.textureParameterBake.rootName,n=this.textureParameterBake.curTextureName,o=this.textureParameterBake.textureInfo,a=this.textureParameterBake.rootBatchIdMap,s=this.textureParameterBake.ancestorMap;this.textureParameterBake=void 0;var l={},u=a[o.rootTextureName],c=i||!t._textureLod?void 0:_0x1c529d(e.id,t.id,r,n,s,l),h=_0x390c66[t.name];e$28(h)||(h=_0x390c66[t.name]={});var d=h[r];e$28(d)||(d=h[r]={});var f=d[n];e$28(f)||(f=d[n]={});for(var p=i?void 0:e$28(l.name)?d[l.name]:void 0,_={},m=o.subTexInfos,$=[],g=o.subTexInfos.length,v=0;v<g;v++){var y=m[v];if($.push(y.subName),t._textureLod){var x=y.subName.split("_")[0],b=new e$25(y.offsetX,y.offsetY,y.width,y.height),w=e$28(u)?u[x]:v,C=i?void 0:e$28(p)?p[x]:void 0,T=e$28(C)?C:b;this._batchTableBake.setBatchedAttribute(w,0,T),_[w]=b,f[x]=b}}this._subTexInfosBake=m,this._subTextureNamesBake=$,this._subBatchValuesBake=_,this._ancestorTextureBake=c}},_0x469da.prototype.createTexture=function(e,t,i,r,n,o,a,s){if(!this._created){this.isCrnTexture=o.compressType===_0x493d0c.CRN_DXT5,this.textureParameter={context:e,layer:t,isRoot:i,rootName:r,curTextureName:n,textureInfo:o,rootBatchIdMap:a,ancestorMap:s};var l=t._textureLod;this.isRoot=i&&l,this._created=!0,this._subRequested=i&&l;var u=o.textureData,c=V$O.RGBA_DXT5,h=_0x55f040.create({context:e,layerId:t.id,rootName:r,textureId:o.id,width:o.width,height:o.height,compressType:o.compressType,supportCompressType:t._supportCompressType,pixelFormat:o.format,internalFormat:c,arrayBufferView:u});h.renderable=i&&l;var d=o.subTexInfos.length,f=a[o.rootTextureName];if(this._textures.push(h),l){var p=[{functionName:"czm_batchTable_xywh",componentDatatype:S$W.FLOAT,componentsPerAttribute:4}],_=e$28(f)?Object.keys(f).length:d;this._batchTable=new x$Q(e,p,_),this._batchTable.suffix="_1";var m=_0x390c66[t.name];e$28(m)||(m=_0x390c66[t.name]={});var $=m[r];e$28($)||($=m[r]={});var g=$[n];e$28(g)||(g=$[n]={});for(var v=o.subTexInfos,y=0;y<d;y++){var x=v[y],b=x.subName.split("_")[0],w=new e$25(x.offsetX,x.offsetY,x.width,x.height);g[b]=w}}if(!i||!l){this._subRequestNames=[];for(y=0;y<o.requestNames.length;y++){var C=o.requestNames[y],T=_0x49f92a(C);if("Tex"===T.split("_")[0]){var S=C.split("#"),E=_0x49f92a(S[0]);if(S.length>1)for(var A=S[1],P=A.length,I=0;I<P;I+=3){var M=E+"_"+A.substring(I,I+3);this._subRequestNames.push(M)}}else this._subRequestNames.push(T)}}return this.isLeaf=!(i&&l||1===o.requestNames.length&&o.requestNames[0]===n),this._oriTexture=h,h}},_0x469da.prototype.requestSubTextures=function(e,t,i,r){if(!this._subRequested&&e$28(this._subRequestNames)){for(var n=this._subRequestNames,o=this._subTexInfos,a=this._subTextureNames,s=this._subBatchValues,l=this._oriTexture,u=[],c=i._baseUri,h=t._subTextureManager,d=0,f=n.length;d<f;d++){var p=n[d];if(e$28($=h.get(i._id,c,p,this))){var _=$.result;for(var m in u.push(d),_)if(_.hasOwnProperty(m)){var $=_[m],g=a.indexOf(m);if(g<0&&this.isLeaf)continue;var v=0,y=0,x=$.width,b=$.height;if(g>=0){var w=o[g];v=w.offsetX,y=w.offsetY}this.isLeaf?r.enqueue({texture:l,subTextureInfo:{xOffset:v,yOffset:y,width:x,height:b,arrayBufferView:$.arrayBufferView}}):l.arrayBufferView=$.arrayBufferView}}}if(u.length===n.length)n.length=0;else{var C=0;for(d=0,f=u.length;d<f;d++)n.splice(u[d]-C,1),C++}0===n.length&&(this.textureRenderableFlag=!0,this.isLeaf||l.init(),i._textureLod&&_0x4804d4(e,this._batchTable,s),this._subRequested=!0,this._subRequestNames=void 0,this._subTextureNames=void 0,this._subBatchValues=void 0,this._subTexInfos=void 0)}},_0x469da.prototype.requestBakeSubTextures=function(e,t,i,r){if(!this._subRequestedBaker&&e$28(this._subRequestNamesBake)){for(var n=this._subRequestNamesBake,o=this._subTexInfosBake,a=this._subTextureNamesBake,s=this._subBatchValuesBake,l=this._oriTextureBake,u=[],c=i._baseUri,h=t._subTextureManager,d=0,f=n.length;d<f;d++){var p=n[d];if(e$28($=h.get(i._id,c,p,this))){var _=$.result;for(var m in u.push(d),_)if(_.hasOwnProperty(m)){var $=_[m],g=a.indexOf(m);if(g<0&&this.isLeaf)continue;var v=0,y=0,x=$.width,b=$.height;if(g>=0){var w=o[g];v=w.offsetX,y=w.offsetY}r.enqueue({texture:l,subTextureInfo:{xOffset:v,yOffset:y,width:x,height:b,arrayBufferView:$.arrayBufferView}})}}}if(u.length===n.length)n.length=0;else{var C=0;for(d=0,f=u.length;d<f;d++)n.splice(u[d]-C,1),C++}0===n.length&&(this.textureBakeRenderableFlag=!0,this.isLeaf||l.init(),this._subRequestedBaker=!0,this._subRequestNamesBake=void 0,this._subTextureNamesBake=void 0,this._subBatchValuesBake=void 0,this._subTexInfosBake=void 0,i._textureLod&&_0x4804d4(e,this._batchTableBake,s))}},_0x469da.prototype.enableTextureRenderable=function(){if(this.textureRenderableFlag){this.textureRenderableFlag=!1;var e=this._oriTexture;e.renderable=!0,e$28(this._ancestorTexture)&&this._ancestorTexture.textureId!==e.textureId&&_0x55f040.del(this._ancestorTexture),this._textures[0]=e,this._oriTexture=void 0,this._ancestorTexture=void 0}},_0x469da.prototype.enableBakeTextureRenderable=function(){if(this.textureBakeRenderableFlag){this.textureBakeRenderableFlag=!1;var e=this._oriTextureBake;e.renderable=!0,e$28(this._ancestorTextureBake)&&this._ancestorTextureBake.textureId!==e.textureId&&_0x55f040.del(this._ancestorTextureBake),this._textures[1]=e,this._oriTextureBake=void 0,this._ancestorTextureBake=void 0}},_0x469da.prototype.isDestroyed=function(){return!1},_0x469da.prototype.destroy=function(e){this._ambientColor=null,this._diffuseColor=null,this._specularColor=null;for(var t=0,i=this._textures.length;t<i;t++){var r=this._textures[t];_0x55f040.del(r)}this._textures.length=0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._batchTableBake=this._batchTableBake&&this._batchTableBake.destroy(),this._subTexInfos=void 0,this._subTextureNames=void 0,this._subBatchValues=void 0,this._subTextureNamesBake=void 0,this._subTexInfosBake=void 0,e$28(this._ancestorTexture)&&this._ancestorTexture.textureId!==this._oriTexture.textureId&&_0x55f040.del(this._ancestorTexture),this._oriTexture=void 0,this._ancestorTexture=void 0,this.ownerEntity=void 0,this.textureParameter=void 0,this._oriTextureBake=void 0;var n=e._context;if(e$28(this._subRequestNames)){for(t=0,i=this._subRequestNames.length;t<i;t++){var o=(a=this._subRequestNames[t]).split(".")[0];o=(s=a.indexOf("%23"))>-1?o+a.substring(s):o,n._subTextureManager.del(e._id,o)}this._subRequestNames=void 0}if(e$28(this._subRequestNamesBake)){for(t=0,i=this._subRequestNamesBake.length;t<i;t++){var a,s;o=(a=this._subRequestNamesBake[t]).split(".")[0];o=(s=a.indexOf("%23"))>-1?o+a.substring(s):o,n._subTextureManager.del(e._id,o)}this._subRequestNames=void 0}if(e$28(this.taskMap))for(var l in this.taskMap)if(this.taskMap.hasOwnProperty(l)){var u=this.taskMap[l];_0x333f13.cancelTask(u)}return this.taskMap=void 0,i$Z(this)};var _0x3edfac=(_0x3eb848=!0,function(e,t){var i=_0x3eb848?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3eb848=!1,i}),_0x353c50=_0x3edfac(void 0,(function(){return _0x353c50.toString().search("(((.+)+)+)+$").toString().constructor(_0x353c50).search("(((.+)+)+)+$")})),_0x3eb848;function _0x4749eb(){this.cache={}}_0x353c50(),_0x4749eb.prototype.create=function(e){var t=this.cache[e];return e$28(t)?t._refCount++:(t=new _0x469da,this.cache[e]=t),t},_0x4749eb.prototype.free=function(e,t){var i=this.cache[t];!e$28(i)||0==--i._refCount&&(delete this.cache[t],i.destroy(e))};var _0x148eb8=(_0x28ba10=!0,function(e,t){var i=_0x28ba10?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x28ba10=!1,i}),_0xb32a41=_0x148eb8(void 0,(function(){return _0xb32a41.toString().search("(((.+)+)+)+$").toString().constructor(_0xb32a41).search("(((.+)+)+)+$")})),_0x28ba10;_0xb32a41();var _0x6fc07a={UnLoad:0,Loading:1,Loaded:2,Parsing:3,Ready:4,Failed:5};function _0x20c3f2(){this.state={},this.cache={},this.zipBufferCache={},this.list=new h$P,this.requests=[],this.requestPriorityMap={},this.requestMap={},this.parseTaskMap={},this.tablenames=[],this.indexedDBSchedulers=[]}var _0x59a40d=0,_0x2cf866=209715200;_0x20c3f2.prototype.prepareRequest=function(e,t,i,r,n){var o=e+"_"+i;if(!e$28(this.requestMap[o])){var a=t+i+".texblock",s=new r$1c({url:a,throttle:!0,throttleByServer:!0,type:4,priorityFunction:function(){return r._disFromCamera}});s.quadKey=i,s.providerName=n.ownerLayerName;var l=this.requestPriorityMap[r._priority];e$28(l)||(l=this.requestPriorityMap[r._priority]=[]),l.push({request:s,url:a,keyWord:o,priority:s.priorityFunction()}),this.requestMap[o]=s}};var _0x3f8fd7=function(e,t){return e.priority-t.priority};function _0x2eed27(e,t){var i=new DataView(e),r=0,n=i.getUint32(r,!0);if(!(t>n-1||n>256)){r+=4;var o,a,s=[];for(o=0;o<n;o++)a=i.getUint32(r,!0),s.push(a),r+=4;for(o=0;o<n;o++){if(a=s[o],o===t)return 0===a?void 0:new Uint8Array(e).slice(r,r+a).buffer;r+=a}}}function _0xcf77ba(e){return function(){return e._disFromCamera}}_0x20c3f2.prototype.processRequests=function(e){var t=0;for(var i in this.requestPriorityMap)if(this.requestPriorityMap.hasOwnProperty(i)){if(t===r$1b.perPacketCount){for(var r=0,n=(a=this.requestPriorityMap[i]).length;r<n;r++){var o=a[r];delete this.requestMap[o.keyWord]}continue}var a;(a=this.requestPriorityMap[i]).sort(_0x3f8fd7);for(r=0,n=a.length;r<n;r++){o=a[r];if(this.load(o,e),++t===r$1b.perPacketCount)break}for(;r<n;r++){o=a[r];delete this.requestMap[o.keyWord]}}this.requestPriorityMap={}},_0x20c3f2.prototype.load=function(e,t){var i=this.tablenames[t.id];if(!e$28(i))return this.request(e,t);var r=e.keyWord,n=this,o=r.indexOf("_"),a=this.indexedDBSchedulers[t.id].getElementFromDB(i,r.slice(o+1));return e$28(a)?a.then((function(i){if(!e$28(i))return n.request(e,t);var o={keyWord:t.id+"_"+i.keyWord,result:i.result,byteLength:i.byteLength},a=n.list.add(o);n.cache[r]=a,n.state[r]=_0x6fc07a.Ready,delete n.state[r],delete n.parseTaskMap[r],_0x59a40d+=i.byteLength;for(var s=n.list.head;_0x59a40d>_0x2cf866;){var l=s,u=s.item.keyWord,c=n.cache[u].item;_0x59a40d-=c.byteLength,delete n.cache[u],s=s.next,n.list.remove(l)}}),(function(i){return n.request(e,t)})):n.request(e,t)},_0x20c3f2.prototype.request=function(e,t){var i=e.keyWord,r=e.request,n=o$$(e.url,void 0,r);if(e$28(n)){this.state[i]=_0x6fc07a.Loading;var o=this;n.then((function(e){if(t._layerScheduler._prepareLoaded||t._layerScheduler.dealWithPrepareLoad(e.byteLength),delete o.requestMap[i],e$28(o.state[i])){o.state[i]=_0x6fc07a.Loaded;var n=_0x2eed27(e,r.quadKeyIndex);if(!e$28(n))return delete o.requestMap[i],void(o.state[i]=_0x6fc07a.Failed);var a=new Uint8Array(n),s=new DataView(n),l=0,u=s.getUint32(l,!0);l+=Uint32Array.BYTES_PER_ELEMENT,o.zipBufferCache[i]=[];for(var c=0;c<u;c++){var h=s.getUint32(l,!0),d=a$Z(a,l+=Uint32Array.BYTES_PER_ELEMENT,h);l+=h;var f=s.getUint32(l,!0);l+=Uint32Array.BYTES_PER_ELEMENT;var p=s.getUint32(l,!0);l+=Uint32Array.BYTES_PER_ELEMENT;var _=new Uint8Array(n).slice(l,l+p);o.zipBufferCache[i].push({unzipLength:f,zippedLength:p,zipBuffer:_,name:d}),l+=p}}}),(function(e){delete o.requestMap[i],o.state[i]=e$28(e)?_0x6fc07a.Failed:_0x6fc07a.UnLoad}))}else delete this.requestMap[i]},_0x20c3f2.prototype.parse=function(e,t){if(!this.parseTaskMap[e]){var i=this.zipBufferCache[e];if(!e$28(i))return void(this.state[e]=_0x6fc07a.UnLoad);var r=t.taskMap[e];e$28(r)||(r=t.taskMap[e]={data:{data:i,isCRN:t.isCrnTexture},priority:t.ownerEntity._disFromCamera,state:0,priorityFunction:_0xcf77ba(t.ownerEntity),processorName:"UnZipData"});var n=_0x333f13.startTask(r);if(e$28(n)){this.parseTaskMap[e]=!0,this.state[e]=_0x6fc07a.Parsing;var o=this;n.then((function(i){try{delete o.zipBufferCache[e],delete t.taskMap[e];for(var r=i.data,n={},a=0;a<r.length;a++){var s=r[a],l=s.name,u=new Uint8Array(s.unzipBuffer).buffer,c=new DataView(u),h=0;c.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var d=c.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var f=c.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;c.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var p=c.getUint32(h,!0);h+=Uint32Array.BYTES_PER_ELEMENT;var _=new Uint8Array(u,h,p);h+=p,n[l]={width:d,height:f,arrayBufferView:_}}var m={keyWord:e,result:n,byteLength:u.byteLength},$=o.list.add(m);o.cache[e]=$,o.state[e]=_0x6fc07a.Ready;var g=e.indexOf("_"),v=e.slice(0,g),y=e.slice(g+1);if(e$28(o.indexedDBSchedulers[v])){var x={blob:{keyWord:y,result:n,byteLength:u.byteLength},key:y,tablename:o.tablenames[v],dbname:o.indexedDBSchedulers[v].dbname};_0x333f13.indexTaskProcessor.scheduleTask(x,[])}delete o.state[e],delete t.taskMap[e],delete o.parseTaskMap[e],_0x59a40d+=u.byteLength;for(var b=o.list.head;_0x59a40d>_0x2cf866;){var w=b.item,C=b,T=w.keyWord,S=o.cache[T].item;_0x59a40d-=S.byteLength,delete o.cache[T],b=b.next,o.list.remove(C)}}catch(e){console.log(e),console.log(t.ownerEntity)}})).otherwise((function(i){delete t.taskMap[e],delete o.parseTaskMap[e],e$28(o.state)&&(e$28(i)?(console.log(i),o.state[e]=_0x6fc07a.Failed):o.state[e]=_0x6fc07a.Loaded)}))}}},_0x20c3f2.prototype.get=function(e,t,i,r){var n=e+"_"+i,o=this.cache[n];if(e$28(o))return this.list.splice(this.list.tail,o),o.item;var a=this.state[n];e$28(a)||(a=this.state[n]=_0x6fc07a.UnLoad),a===_0x6fc07a.UnLoad&&this.prepareRequest(e,t,i,r.ownerEntity,r),a===_0x6fc07a.Loaded&&this.parse(n,r)},_0x20c3f2.prototype.del=function(e,t){var i=e+"_"+t;delete this.state[i],delete this.zipBufferCache[i];var r=this.requestMap[i];e$28(r)&&(r.cancelled=!0,delete this.requestMap[i])};var _0x2c3b0c=(_0x21c08b=!0,function(e,t){var i=_0x21c08b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21c08b=!1,i}),_0x5e2e07=_0x2c3b0c(void 0,(function(){return _0x5e2e07.toString().search("(((.+)+)+)+$").toString().constructor(_0x5e2e07).search("(((.+)+)+)+$")})),_0x21c08b;_0x5e2e07();var _0x2ed417=null,_0x1cbadb=null;function _0x1eccda(){this._taskProcessorReady=!1}function _0x31fdf8(e,t,i){for(var r=e.length/4,n=new Float32Array(e.buffer,e.byteOffset,r),o=0;o<n.length;o++){var a,s,l,u,c=n[o],h=4*o,d=new e$25(0,0,0,0);if(c>=0&&c<=1){c<e$27.EPSILON9?c=e$27.EPSILON9:1-c<e$27.EPSILON9&&(c=1-e$27.EPSILON9);var f=_0x4a7c32(c);d.x=f.x,d.y=f.y,d.z=f.z,d.w=1}a=255*d.x,s=255*d.y,l=255*d.z,u=255*d.w,e$28(i)&&!0===i?(e[h+0]=l,e[h+1]=s,e[h+2]=a,e[h+3]=u):(e[h+0]=a,e[h+1]=s,e[h+2]=l,e[h+3]=u)}return new Uint8Array(e.buffer,0,e.length)}function _0x21de91(e,t,i){for(var r=new Uint8Array(4*e.length),n=0;n<e.length;n++){var o,a,s,l,u=e[n],c=4*n,h=new e$25(0,0,0,0);if(u>=0&&u<=1){var d=_0x4a7c32(u);h.x=d.x,h.y=d.y,h.z=d.z,h.w=1}o=255*h.x,a=255*h.y,s=255*h.z,l=255*h.w,e$28(i)&&!0===i?(r[c+0]=parseInt(s),r[c+1]=parseInt(a),r[c+2]=parseInt(o),r[c+3]=parseInt(l)):(r[c+0]=parseInt(o),r[c+1]=parseInt(a),r[c+2]=parseInt(s),r[c+3]=parseInt(l))}return r}function _0x285ce7(e,t){for(var i=e.length/4,r=new Float32Array(e.buffer,e.byteOffset,i),n=0;n<r.length;n++){var o=r[n],a=4*n;if(o<0||o>1)e[a+0]=255,e[a+1]=255,e[a+2]=255,e[a+3]=255;else{o=o*(t._ceiling-t._floor)+t._floor;var s=t._dictColorTable.getColor(o);e[a+0]=255*s.red,e[a+1]=255*s.green,e[a+2]=255*s.blue,e[a+3]=255*s.alpha}}return new Uint8Array(e.buffer,0,e.length)}function _0x2bb89c(e,t){var i=e.length/4;return _0x577dcc(new Float32Array(e.buffer,e.byteOffset,i),t)}function _0x4a7c32(e){var t=new t$X(1,255,65025);(t=t$X.multiplyByScalar(t,e,t)).x=t.x-Math.floor(t.x),t.y=t.y-Math.floor(t.y),t.z=t.z-Math.floor(t.z);var i=new t$X,r=new t$X(1/255,1/255,0);return i.x=t.y*r.x,i.y=t.z*r.y,i.z=t.z*r.z,t=t$X.subtract(t,i,t)}function _0x2367ff(e,t){for(var i=new Uint8Array(4*e.length),r=t._ceiling-t._floor,n=0,o=e.length;n<o;n++){var a=e[n],s=4*n;if(a<0||a>1)i[s+0]=255,i[s+1]=255,i[s+2]=255,i[s+3]=255;else{a=a*r+t._floor;var l=t._dictColorTable.getColor(a);i[s+0]=255*l.red,i[s+1]=255*l.green,i[s+2]=255*l.blue,i[s+3]=255*l.alpha}}return i}function _0x577dcc(e,t){var i=e,r=i.length,n=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*r);_0x43b100.HEAPF32.set(i,n/Float32Array.BYTES_PER_ELEMENT);var o=t._ceiling,a=t._floor,s=t._dictColorTable._dictTable._hash,l=[],u=[];for(var c in s)l.push(parseFloat(c));l.sort((function(e,t){return e-t}));for(var h=0,d=l.length;h<d;h++)u.push(s[l[h]]);var f=new ArrayBuffer(4*l.length),p=new Uint8Array(f),_=0;for(d=l.length;_<d;_++){var m=u[_];p[4*_]=255*m.red,p[4*_+1]=255*m.green,p[4*_+2]=255*m.blue,p[4*_+3]=255*m.alpha}var $=new Float32Array(f),g=(c=new Float32Array(l)).length,v=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*g);_0x43b100.HEAPF32.set(c,v/Float32Array.BYTES_PER_ELEMENT);var y=_0x43b100._malloc(Float32Array.BYTES_PER_ELEMENT*g);_0x43b100.HEAPF32.set($,y/Float32Array.BYTES_PER_ELEMENT);var x=_0x2ed417(n,r,o,a,v,y,g),b=new Uint8Array(_0x43b100.HEAPU8.buffer,x,4*r);return _0x1cbadb(x),_0x43b100._free(n),_0x43b100._free(v),_0x43b100._free(y),b}function _0x96b644(e,t,i,r){var n=y$15.multiply(t,i,new y$15),o=e.vertexAttributes[0],a=o.typedArray,s=new Float32Array(a.buffer,a.byteOffset,a.byteLength/4),l=o.componentsPerAttribute,u=e.verticesCount,c=new Float32Array(3*u),h=e.attrLocation;h.aRatio=Object.keys(h).length;for(var d=0;d<u;d++){var f=new t$X(s[d*l],s[d*l+1],s[d*l+2]),p=new t$X;y$15.multiplyByPoint(n,f,p);var _=t$W.fromCartesian(p),m=e$27.toDegrees(_.longitude),$=e$27.toDegrees(_.latitude),g=_.height,v=(m-r.left)/r.width,y=($-r.bottom)/r.length,x=(g-r.minHeight)/r.height;c[3*d]=v,c[3*d+1]=y,c[3*d+2]=x}e.vertexAttributes.push({index:h.aRatio,typedArray:c,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1})}async function _0x459956(e,t,i){e._version=i.version,e._dataVersion=i.dataVersion,e._gl;var r=i.groupNode,n=i.geoPackage,o=i.matrials.material,a=e._context,s=e.materialManager;if(e$28(s)||(s=e.materialManager=new _0x4749eb),e$28(a._subTextureManager)||(a._subTextureManager=new _0x20c3f2),e.indexedDBSetting.isGeoTilesSave&&!e$28(a._subTextureManager.indexedDBSchedulers[e.id])&&e$28(e._layerScheduler._indexedDBScheduler)&&(a._subTextureManager.indexedDBSchedulers[e.id]=e._layerScheduler._indexedDBScheduler,a._subTextureManager.tablenames[e.id]=e._layerScheduler.tablename+"Texture"),e._layerScheduler._prepareLoaded||!t._prepareLoad)for(var l=0,u=o.length;l<u;l++){var c=o[l].material,h=c.id,d=s.create(h);d.createPBRParamter(c),d.ownerLayerName=e.name,d.ownerEntity=t;var f=c.ambient;e$28(f)&&(d._ambientColor=new e$1S(f.r,f.g,f.b,f.a));var p=c.diffuse;e$28(p)&&(d._diffuseColor=new e$1S(p.r,p.g,p.b,p.a));var _=c.specular;e$28(_)&&(d._specularColor=new e$1S(_.r,_.g,_.b,_.a)),d._shininess=u$Y(c.shininess,d._shininess),d._bTransparentSorting=u$Y(c.transparentsorting,!1),d.id=h;for(var m=c.textureunitstates,$=0;$<m.length;$++){var g=m[$].textureunitstate,v=g.id;0===g.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,0===g.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;var y=i.texturePackage[v];if(e$28(y)){if(e$28(y.textureData))switch(y.compressType){case _0x493d0c.CRN_DXT5:if(_0x333f13.CRNTaskProcessorReady&&!y.isDXT){var x=h$M(_0x333f13.CRNProcessor,y.textureData,!0);await x.then((e=>{y.textureData=e._buffer}))}break;case _0x493d0c.STANDARD_CRN:x=a$R(y.textureData,!0,!0);await x.then((e=>{y.textureData=e._buffer}))}var b;e$28(b=0===$?d.createTexture(a,e,t._isRootTile,t._rootName,v,y,i.rootBatchIdMap,i.ancestorMap):d.createBakeTexture(a,e,t._isRootTile,t._rootName,v,y,i.rootBatchIdMap,i.ancestorMap))&&(t._texturesByteLength+=b._sizeInBytes)}}}var w=e._matModel,C=r.pageLods,T=!0;for(l=0;l<C.length;l++){var S=new _0x575d8a;S._fileType=e._fileType;var E=C[l];if(""===E.childTile?S._isLeafNode=!0:T=!1,S._rangeMode=E.rangeMode,S._rangeDataList=E.childTile,S._rangeList=E.rangeList,-1===E.boundingSphere.radius&&(E.boundingSphere.radius=6378137),S._isLeafNode||(S._boundingSphere=new i$19(E.boundingSphere.center,E.boundingSphere.radius),i$19.transform(S._boundingSphere,e._matModel,S._boundingSphere)),e$28(E._obb)){var A=t$X.fromElements(E._obb.obbCenter.x,E._obb.obbCenter.y,E._obb.obbCenter.z);y$15.multiplyByPoint(e._matModel,A,A);var P=e$25.fromElements(E._obb.xExtent.x,E._obb.xExtent.y,E._obb.xExtent.z,0),I=e$25.fromElements(E._obb.yExtent.x,E._obb.yExtent.y,E._obb.yExtent.z,0),M=e$25.fromElements(E._obb.zExtent.x,E._obb.zExtent.y,E._obb.zExtent.z,0);e$25.equals(P,e$25.ZERO)&&(P=new e$25(1,0,0,0)),e$25.equals(I,e$25.ZERO)&&(I=new e$25(0,1,0,0)),e$25.equals(M,e$25.ZERO)&&(M=new e$25(0,0,1,0)),y$15.multiplyByVector(e._matModel,P,P),y$15.multiplyByVector(e._matModel,I,I),y$15.multiplyByVector(e._matModel,M,M);var O=new p$1a(P.x,I.x,M.x,P.y,I.y,M.y,P.z,I.z,M.z);S._orientedBoundingBox=new x$13(A,O)}var D=E.geodes,R=[];if(e._layerScheduler._prepareLoaded||!t._prepareLoad)for(var L=0;L<D.length;L++){var B,N=D[L],F=N.matrix;if(1===e._heightScale)B=y$15.multiply(w,F,new y$15);else{var z=y$15.multiplyByScale(F,new t$X(1,1,e._heightScale),new y$15);B=y$15.multiply(w,z,new y$15)}for(var k=N.skeletonNames,V=0;V<k.length;V++){var U=k[V],X=n[U],H=X.vertexPackage;if(_0x474b73(X,e)){var G;if(S._isLeafNode){var W=H.boundingSphere;e$28(W)?(G=new i$19(W.center,W.radius),i$19.transform(G,B,G)):G=_0x4327f2.calcBoundingSphere(e,H,B),R.push(G)}var Y=_0x4327f2.calcBoundingRectangle(e,H),q=X.arrIndexPackage,j=X.pickInfo,Z={};for(u=0;u<q.length&&u<1;u++){var K=q[u];if(e$28(K)){h=K.materialCode;var Q=s.create(h);Z[h]=Q}}var J={context:e._context,vertexPackage:H,arrIndexPackage:q,edgeGeometry:X.edgeGeometry,pickInfo:j,version:i.version,mapPass:Z,layer:e,entity:t,matModel:B,boundingVolume:S._boundingSphere?S._boundingSphere:G,boundingRectangle:Y,volObj:null,fileType:e._fileType,isS3MB:e._isS3MB,geoMatrix:F,dataType:e._dataType,level:e._level,geoName:U,isS3MBlock:!0};if(e$28(e.themeStyle)){var ee=_0x3e8cbd.createRenderEntityPageLOD(J,e);S._renderEntityList=S._renderEntityList.concat(ee)}else{var te=new _0x1f65d5(J);if(e._imageryLayer instanceof Array){for(var ie=[],re=0;re<e._imageryLayer.length;re++){var ne,oe=e._imageryLayer[re];if(e$28(oe)&&(oe instanceof h$p||oe instanceof i$o))ne=oe instanceof i$o?oe._inner.getImagery(X.cartographicBounds):oe.getImagery(X.cartographicBounds),ie=ie.concat(ne)}ie.length>0&&te.setImagerys(ie,X.cartographicBounds)}else{if(e$28(e._imageryLayer)&&(e._imageryLayer instanceof h$p||e._imageryLayer instanceof i$o))(ie=oe instanceof i$o?e._imageryLayer._inner.getImagery(X.cartographicBounds):e._imageryLayer.getImagery(X.cartographicBounds)).length>0&&te.setImagerys(ie,X.cartographicBounds);else e._needCoverImageryLayer&&te.setImagerys(ie,X.cartographicBounds)}S._renderEntityList.push(te)}}}}S._isLeafNode&&(S._boundingSphere=i$19.fromBoundingSpheres(R,new i$19)),e$28(t._pagelodMap[E.childTile])?(t._pagelodMap[E.childTile]._renderEntityList=S._renderEntityList,t._pagelodMap[E.childTile]._ready=!0):(t._childrenPageLod.push(S),e.LoadingPriority===U$p.UsePagedLodInfo&&(S._ready=!0,t._childrenPageLod.shift(),S._isLeafNode=!0))}if(t._isLeafTile=T,!e$28(t._boundingSphere)||t._isLeafTile){for(var ae=[],se=t._childrenPageLod.length;se--;)ae.push(t._childrenPageLod[se]._boundingSphere);t._boundingSphere=i$19.fromBoundingSpheres(ae),t._oriBoundingSphere=i$19.clone(t._boundingSphere)}t._s3mLoadState=I$F.PARSED}async function _0x163c08(e,t,i){var r=e[i._fileName];if(e$28(r)){i._blockKey=i._fileName,i._isAncestorBlock=!0,i._rootBatchIdMap=r.rootBatchIdMap,i._ancestorMap=r.ancestorMap,await _0x459956(t,i,r);for(var n=[i];n.length;)for(var o=n.pop(),a=o._childrenPageLod,s=0,l=a.length;s<l;s++){var u=a[s],c=u._rangeDataList;if(""!==c){var h=new _0x100161;if(h.layer=o.layer,h._subdomainIndex=o._subdomainIndex+s+1,h._priority=o._priority-1,h._rootBatchIdMap=e$28(r)?r.rootBatchIdMap:o._rootBatchIdMap,h._ancestorMap=e$28(r)?r.ancestorMap:o._ancestorMap,h._rootName=o._rootName,c.indexOf("/")>-1){var d=c.lastIndexOf("/"),f=c.substring(0,d+1);h._fileName=c.substring(d+1),h._relativePath=new Uri(f).resolve(o._relativePath)}else h._relativePath=o._relativePath,h._fileName=c;u._entity=h,e$28(r=e[h._fileName])?(h._blockKey=o._blockKey,h._isChildBlock=!0,await _0x459956(t,h,r),n.push(h)):(h._isAncestorBlock=!0,h._blockKey=h._fileName)}}}}function _0x29ef52(e){return function(){return e._disFromCamera}}function _0x25186e(e){return e$28(e.clampRegionEdge)&&e.clampRegionEdge}function _0x474b73(e,t){var i=e.vertexPackage;if(i.verticesCount<1)return!1;if(t._fileType===f$r.ClampGroundPolygon){var r=t.style3D.fillStyle;return r===yt$3.WireFrame?_0x25186e(i):r!==yt$3.Fill||!_0x25186e(i)}return!0}if(null!==_0x43b100&&(_0x2ed417=_0x43b100.cwrap("floatToTextureColor","number",["number","number","number","number","number","number","number"]),_0x1cbadb=_0x43b100.cwrap("free_result",null,["number"])),_0x1eccda.parseResult=function(e,t,i,r){t._version=e.version,t._dataVersion=e.dataVersion;var n=t._gl,o=e.groupNode,a=e.geoPackage,s=e.matrials.material,l={},u=[],c=t._context;t._RGBTOBGR;var h=i._fileName.split("_"),d=parseInt(h[1]),f=parseInt(h[2]);if(d=Math.pow(2,t._level)-d-1,t._layerScheduler._prepareLoaded||!i._prepareLoad){if(e$28(t._imageryLayer))if(t._imageryLayer instanceof Array)for(var p=0;p<t._imageryLayer.length;p++)u.push(t._imageryLayer[p]._imageryProvider._readyPromise);else t._imageryLayer instanceof h$p&&u.push(t._imageryLayer._imageryProvider._readyPromise),t._imageryLayer instanceof i$o&&u.push(t._imageryLayer._provider._readyPromise);for(var _=0,m=s.length;_<m;_++){var $=s[_].material,g=$.id;if(e$28(t._materialMap)){var v=t._materialMap[g];e$28(v)&&($=v.material)}var y=new _0x34bd01({});i._tmpMaterialArr.push(y),y.createPBRParamter($),l[g]=y;var x=u$Y($.ambient,e$1S.WHITE);y._ambientColor=new e$1S(x.r,x.g,x.b,x.a);var b=u$Y($.diffuse,e$1S.WHITE);y._diffuseColor=new e$1S(b.r,b.g,b.b,b.a);var w=u$Y($.specular,e$1S.WHITE);y._specularColor=new e$1S(w.r,w.g,w.b,w.a),y._shininess=u$Y($.shininess,10),y._bTransparentSorting=u$Y($.transparentsorting,!1),y._alphaMode=$.alphaMode;var C=$.textureunitstates;0===C.length&&t._fileType===f$r.OSGBFile&&(y._isInvalidOblique=!0);for(var T=0;T<C.length;T++){var S=C[T].textureunitstate,E=S.id,A=E.indexOf("PBRMaterialParam")>-1,P=y._baseColorTextureIndex===T;y._baseColorTextureIndex;var I=y._emissiveTextureIndex===T,M=y._normalTextureIndex===T,O=y._metallicRoughnessTextureIndex===T,D=y._occlusionTextureIndex===T;A&&(y._usePBRTextureBatch=!0);var R=0===S.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,L=0===S.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;y._texMatrix=y$15.unpack(S.texmodmatrix);var B=e.texturePackage[E]||e.texturePackage[E+"\0"],N=E+t._id+t._context._id+i._relativePath.path+i._fileName;if(e$28(B)&&(N+=B.imageBuffer.length),e$28(B)&&B.width>0&&B.height>0&&B.imageBuffer.length>0){var F={isPBRMaterialParam:A,isEmissiveTex:I,isNormalTexture:M,isMetallicRoughnessTexture:O,isBaseColorTexture:P};switch(B.compressType){case _0x493d0c.WEBP:y._RGBTOBGR=B.nFormat===_0x493d0c.ABGR;var z=y.createWebp(N,E,c,T,B.imageBuffer,B.width,B.height,R,L,B.mipmapLevel,t.mipmapEnabled);u.push(z);break;case _0x493d0c.CRN_DXT5:if(!e$28(k=y.createCRN(N,E,c,T,B,R,L,!1,t.mipmapEnabled,F)))return void(i.parsingResult=e);i.parsingResult=null,u.push(k);break;case _0x493d0c.STANDARD_CRN:var k;if(!e$28(k=y.createCRN(N,E,c,T,B,R,L,!0,t.mipmapEnabled)))return void(i.parsingResult=e);i.parsingResult=null,u.push(k);break;case _0x493d0c.KTX2:var V=y.createKTX2(N,E,c,T,B,R,L,t.mipmapEnabled,F);e$28(V)&&u.push(V);break;default:var U=Se$8.CreateTexture(N,c,B.width,B.height,B.nFormat,B.compressType,B.imageBuffer,!1,R,L,t.mipmapEnabled,B.oriCompressType);A?y.pbrParamTexture=U:I?y.emissiveTexture=U:M?y.normalTexture=U:O?y.metallicRoughnessTexture=U:D?y.occlusionTexture=U:P?y.baseColorTexture=U:y._textures.push(U)}}else if(t._isTextureShare&&!e$28(t._materialMap)){N=E+t._id+t._context._id,E.lastIndexOf("\\")>-1&&(E=f$V(E.replace(/\\/g,"/").replace(/jpg|png/g,"dxtz"))),E.lastIndexOf("/")>-1&&(E=f$V(E.replace("png","dxtz")));var X=t._baseUri+"Texture/"+E;e$28(a$Y.CREDENTIAL)&&(X=a$Y.addToken(X));var H=y.requestSharedTexture(X,N,E,c,T,t.customRequestHeaders,R,L);u.push(H)}if(e$28(t._maps)&&t._maps.mapNames.length>0){var G=E.substring(0,E.indexOf("."))+"_"+i._fileName+"."+t._maps.mapExts[0],W=i._relativePath.path;i._relativePath.path=t._maps.mapNames[0]+"/"+i._relativePath.path;var Y=i._relativePath.resolve(t._baseUri)+G;i._relativePath.path=W,Y=Y.replace(/\+/g,"%2b");var q=o$1q.defer(),j=q.promise;u.push(j);var Z=o$$(Y,void 0);e$28(Z)?function(e,t,i,r){e.then((function(e){if(e$28(e)){var n=w$B({uint8Array:e,format:"image/webp"});e$28(n)?(o=t,a=i,s=r,n.then((function(e){if(e$28(e)){var t=new L$17({context:c,source:e,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({wrapS:R,wrapT:L,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})});t.id=o+"map",a._mapTextures[o]=t,Se$8.textureManager.textures[t.id]=t,Se$8.textureManager.refCounts[t.id]=1}s.resolve(Y)}),(function(e){s.resolve()}))):r.resolve(),e=null}else r.resolve();var o,a,s}),(function(e){r.resolve()}))}(Z,N,y,q):q.resolve()}if("png"===t._strVolumeExt||"vol_texture_mapping"===t._strVolumeExt){var K=g+"_"+i._fileName;K=""!==t._volName?K+"_"+t._volName:K,"vol_texture_mapping"===t._strVolumeExt?K+=".vol":K+=".png";var Q=i._relativePath.resolve(t._baseUri)+K;if(0!==t.urlType){var J=t._urlArguments,ee=Q.indexOf("datas")+5,te=J.layer3DName,ie=Q.substring(Q.indexOf("/path/")+6).split("/"),re=J.scene3DName,ne=ie[0],oe=ie[1].substring(0,ie[1].indexOf(".")),ae=ie[1].substring(ie[1].indexOf(".")+1,ie[1].length);Q=Q.substring(0,ee)+"?layerName="+te+"&rootTile="+ne+"&tile="+oe+"&suffix="+ae+"&scene3DName="+re+"&layer3DName="+te}var se=void 0;"vol_texture_mapping"===t._strVolumeExt?e$28(se=o$$(Q,void 0))&&function(e,r,n){e.then((function(e){var o;if(e$28(e)){var a=void 0,s=new Uint8Array(e,8),l=nt$c.inflate(s).buffer;if(1===new Float64Array(l,0,1)[0]){var u=new Uint32Array(l,8,4),c=u[0],h=u[1];u[2];var d=u[3];a={nFormat:c,nWidth:h,nHeight:d,nPixelSize:d,imageArray:new Float32Array(l,24,nCount)}}if(e$28(a)){var f,p=tt$h.LINEAR,_=rt$g.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(p=tt$h.NEAREST,_=rt$g.NEAREST),t._hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?f=_0x21de91(a.imageArray,t._hypsometricSetting,!0):(f=null===_0x2ed417?_0x2367ff(a.imageArray,t._hypsometricSetting):_0x577dcc(a.imageArray,t._hypsometricSetting),(o=new L$17({context:t._context,width:a.nWidth,height:a.nHeight,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:p,magnificationFilter:_})})).copyForm({width:a.nWidth,height:a.nHeight,arrayBufferView:f}),i._volTexures[r]=o,n.texID2Vol=texureId),e=null}}}),(function(e){}))}(se,N,y):"png"===t._strVolumeExt&&(e$28(se=t$D(Q))&&(e$28(se=t$D(Q))&&function(e,r,n){e.then((function(e){var o;if(e$28(e)){var a,s=tt$h.LINEAR,l=rt$g.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(s=tt$h.NEAREST,l=rt$g.NEAREST),a=t._hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?_0x21de91(d$11(e),t._hypsometricSetting,!0):null==_0x2ed417?_0x285ce7(d$11(e),t._hypsometricSetting):_0x2bb89c(d$11(e),t._hypsometricSetting),(o=new L$17({context:t._context,width:e.width,height:e.height,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:s,magnificationFilter:l})})).copyFrom({width:e.width,height:e.height,arrayBufferView:a}),e=null,i._volTextures[r]=o,n.texID2Vol=r}}),(function(e){}))}(se,N,y)))}}}}o$1q.all(u,(function(){if(i._tmpMaterialArr.length=0,i._s3mLoadState!==I$F.UNLOAD){var r,s;if(e$28(t._volData)){r=t._volData._volBounds;var u=t._context._id+"_"+t.id+"_layerVol",c=k$T.FilterMode.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(c=k$T.FilterMode.NEAREST),e$28(t._hypsometricSetting)&&e$28(t._volData._buffer)&&(c===k$T.FilterMode.NEAREST?null===_0x2ed417?_0x285ce7(t._volData._buffer,t._hypsometricSetting):t._volData._buffer=_0x2bb89c(t._volData._buffer,t._hypsometricSetting):_0x31fdf8(t._volData._buffer,t._hypsometricSetting));var h={};h.nLength=t._volData._nLength,h.imageArray=t._volData._buffer;var p=Se$8.CreateVolumeTexture(u,n,t._context,h,c);delete t._volData._buffer,t._volData._buffer=void 0,s={volTexture:p,nFormat:3201,nSideBlockCount:t._volData._nSideBlockCount,nBlockLength:t._volData._nBlockLength,nLength:t._volData._nLength,nWidth:t._volData._width,nHeight:t._volData._height,nDepth:t._volData._depth,id:u,dataFloor:t._volData._minValue,dataCeil:t._volData._maxValue,volBounds:r},i._volObj=s}else if("vol"===t._strVolumeExt)if(e.volImageBuffer){r=e.volBounds;u=t._context._id+"_"+t.id+"_"+i._relativePath.resolve(t._baseUri)+"_"+i._fileName,c=k$T.FilterMode.LINEAR;e$28(t._hypsometricSetting)&&t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(c=k$T.FilterMode.NEAREST),3201===e.volImageBuffer.nFormat&&e$28(t._hypsometricSetting)&&(c===k$T.FilterMode.NEAREST?null===_0x2ed417?_0x285ce7(e.volImageBuffer.imageArray,t._hypsometricSetting):e.volImageBuffer.imageArray=_0x2bb89c(e.volImageBuffer.imageArray,t._hypsometricSetting):_0x31fdf8(e.volImageBuffer.imageArray,t._hypsometricSetting)),s={volTexture:p=Se$8.CreateVolumeTexture(u,n,t._context,e.volImageBuffer,c),nFormat:e.volImageBuffer.nFormat,nSideBlockCount:e.volImageBuffer.nSideBlockCount,nBlockLength:e.volImageBuffer.nBlockLength,nLength:e.volImageBuffer.nLength,nWidth:e.volImageBuffer.nWidth,nHeight:e.volImageBuffer.nHeight,nDepth:e.volImageBuffer.nDepth,id:u,dataFloor:t._fMinValue,dataCeil:t._fMaxValue,volBounds:r},delete e.volImageBuffer.imageArray,e.volImageBuffer.imageArray=null,e$28(i._volObj)&&Se$8.DecRef(i._volObj.id),i._volObj=s}else t._bVolume&&(e$28(s=i._volObj)&&(r=i._volObj.volBounds));for(var _=t._matModel,m=o.pageLods,$=!0,g=0;g<m.length;g++){var v=new _0x575d8a;v._fileType=t._fileType;var y=m[g];if(""===y.childTile?v._isLeafNode=!0:$=!1,v._rangeMode=y.rangeMode,v._rangeDataList=y.childTile,v._rangeList=y.rangeList,-1===y.boundingSphere.radius&&(y.boundingSphere.radius=6378137),y.boundingSphere&&(t._dataVersion>2||!v._isLeafNode||14===t._fileType)&&(v._boundingSphere=new i$19(y.boundingSphere.center,y.boundingSphere.radius),v._originalBS=new i$19(y.boundingSphere.center,y.boundingSphere.radius),i$19.transform(v._boundingSphere,t._matModel,v._boundingSphere)),e$28(y._obb)){var x=t$X.fromElements(y._obb.obbCenter.x,y._obb.obbCenter.y,y._obb.obbCenter.z),b=e$25.fromElements(y._obb.xExtent.x,y._obb.xExtent.y,y._obb.xExtent.z,0),w=e$25.fromElements(y._obb.yExtent.x,y._obb.yExtent.y,y._obb.yExtent.z,0),C=e$25.fromElements(y._obb.zExtent.x,y._obb.zExtent.y,y._obb.zExtent.z,0);e$25.equals(b,e$25.ZERO)&&(b=new e$25(1,0,0,0)),e$25.equals(w,e$25.ZERO)&&(w=new e$25(0,1,0,0)),e$25.equals(C,e$25.ZERO)&&(C=new e$25(0,0,1,0));var T=new p$1a(b.x,w.x,C.x,b.y,w.y,C.y,b.z,w.z,C.z);v._orientedBoundingBox=new x$13(x,T),v._orientedBoundingBox._updateBBox(),v.min=v._orientedBoundingBox.bbox[0].clone(),v.max=v._orientedBoundingBox.bbox[0].clone();for(var S,E=1;E<8;E++)S=v._orientedBoundingBox.bbox[E],v.min.x>S.x&&(v.min.x=S.x),v.min.y>S.y&&(v.min.y=S.y),v.min.z>S.z&&(v.min.z=S.z),v.max.x<S.x&&(v.max.x=S.x),v.max.y<S.y&&(v.max.y=S.y),v.max.z<S.z&&(v.max.z=S.z);y$15.multiplyByPoint(t._matModel,x,x),y$15.multiplyByVector(t._matModel,b,b),y$15.multiplyByVector(t._matModel,w,w),y$15.multiplyByVector(t._matModel,C,C),T[0]=b.x,T[1]=b.y,T[2]=b.z,T[3]=w.x,T[4]=w.y,T[5]=w.z,T[6]=C.x,T[7]=C.y,T[8]=C.z,v._orientedBoundingBox.center=x,v._orientedBoundingBox.halfAxes=T,v._orientedBoundingBox.areaDirty=1}else if(e$28(y.min)){var A=[];A.push(new t$X(y.min.x,y.min.y,y.min.z)),A.push(new t$X(y.min.x,y.min.y,y.max.z)),A.push(new t$X(y.min.x,y.max.y,y.min.z)),A.push(new t$X(y.min.x,y.max.y,y.max.z)),A.push(new t$X(y.max.x,y.min.y,y.min.z)),A.push(new t$X(y.max.x,y.min.y,y.max.z)),A.push(new t$X(y.max.x,y.max.y,y.min.z)),A.push(new t$X(y.max.x,y.max.y,y.max.z)),v.obbMin=y.min,v.obbMax=y.max;for(var P=0;P<8;P++)A[P]=y$15.multiplyByPoint(t._matModel,A[P],A[P]);v._orientedBoundingBox=x$13.fromPoints(A,v._orientedBoundingBox)}var I=y.geodes,M=[],O=[];if(t._layerScheduler._prepareLoaded||!i._prepareLoad)for(var D=0;D<I.length;D++){var R,L=I[D],B=L.matrix;if(1===t._heightScale)R=y$15.multiply(_,B,new y$15);else{var N=y$15.multiplyByScale(B,new t$X(1,1,t._heightScale),new y$15);R=y$15.multiply(_,N,new y$15)}for(var F=L.skeletonNames,z=0;z<F.length;z++){var k=F[z],V=a[k],U=V.vertexPackage;if(_0x474b73(V,t)){var X,H;if(v._isLeafNode&&!e$28(v._boundingSphere)){var G=U.boundingSphere;e$28(G)?(H=new i$19(G.center,G.radius),X=i$19.transform(H,R,new i$19),H=i$19.transform(H,B,H)):(X=_0x4327f2.calcBoundingSphere(t,U,R),H=i$19.transform(X,y$15.inverse(R,new y$15),new i$19),i$19.transform(H,B,H)),M.push(X),O.push(H)}for(var W=_0x4327f2.calcBoundingRectangle(t,U),Y=V.arrIndexPackage,q=V.pickInfo,j={},Z=0;Z<Y.length;Z++){var K=Y[Z];if(e$28(K)){var Q=K.materialCode;if(e$28(Q)){var J=new _0x34bd01({});Q=Q.replace(/\0/,"");var ee=l[Q];e$28(ee)&&ee.clone(J),j[Q]=J;for(let e=0;e<J._textures.length;e++){let t=J._textures[e];i._texturesByteLength+=t._sizeInBytes,e$28(J.normalTexture)&&(i._texturesByteLength+=J.normalTexture._sizeInBytes),e$28(J.baseColorTexture)&&(i._texturesByteLength+=J.baseColorTexture._sizeInBytes),e$28(J.emissiveTexture)&&(i._texturesByteLength+=J.emissiveTexture._sizeInBytes),e$28(J.metallicRoughnessTexture)&&(i._texturesByteLength+=J.metallicRoughnessTexture._sizeInBytes),e$28(J.occlusionTexture)&&(i._texturesByteLength+=J.occlusionTexture._sizeInBytes)}}}}s&&(_0x96b644(U,t._oriMatModel,B,r),Se$8.AddRef(i._fileName));var te=u$Y(x$13.clone(v._orientedBoundingBox),i$19.clone(v._boundingSphere));te=u$Y(te,X);var ie={context:t._context,vertexPackage:U,arrIndexPackage:Y,edgeGeometry:V.edgeGeometry,pickInfo:q,version:e.version,mapPass:j,layer:t,entity:i,matModel:R,boundingVolume:te,boundingRectangle:W,volObj:s,volTexture:p,fileType:t._fileType,isS3MB:t._isS3MB,geoMatrix:B,dataType:t._dataType,level:t._level,row:d,col:f,geoName:k};if(t._fileType===f$r.PointCloudFile){var re=k.split("#");if(re.length>0&&"SupermapPointCloud"===re[0]){for(var ne={},oe=1;oe<re.length;oe++){var ae=re[oe].split("%");if(2===ae.length){var se=ae[0],le=ae[1].split("_");if(2===le.length){var ue=le[0],ce=le[1];ne[se]={start:parseInt(ue),end:parseInt(ce)}}}}ie.ptIndexGroup=ne}else if(k.lastIndexOf("_")>-1){var he=k.substring(0,k.lastIndexOf("_"));ie.groupName=he}}if(e$28(t.themeStyle)&&e$28(t.themeStyle._image)){var de=_0x3e8cbd.createRenderEntityPageLOD(ie,t);v._renderEntityList=v._renderEntityList.concat(de)}else if(U.vertexAttributes.length>0){var fe=new _0x1f65d5(ie);if(t._imageryLayer instanceof Array){for(var pe=[],_e=0;_e<t._imageryLayer.length;_e++){var me,$e=t._imageryLayer[_e];if(e$28($e)&&($e instanceof h$p||$e instanceof i$o))me=$e instanceof i$o?$e._inner.getImagery(V.cartographicBounds):$e.getImagery(V.cartographicBounds),pe=pe.concat(me)}pe.length>0&&fe.setImagerys(pe,V.cartographicBounds)}else{if(e$28(t._imageryLayer)&&(t._imageryLayer instanceof h$p||t._imageryLayer instanceof i$o))(pe=t._imageryLayer instanceof i$o?t._imageryLayer._inner.getImagery(V.cartographicBounds):t._imageryLayer.getImagery(V.cartographicBounds)).length>0&&fe.setImagerys(pe,V.cartographicBounds);else t._needCoverImageryLayer&&fe.setImagerys(pe,V.cartographicBounds)}v._renderEntityList.push(fe)}}}}if(v._isLeafNode&&!e$28(v._boundingSphere)&&(v._boundingSphere=i$19.fromBoundingSpheres(M,new i$19),v._originalBS=i$19.fromBoundingSpheres(O,new i$19)),t.LoadingPriority===U$p.UsePagedLodInfo){var ge=i._fileName;0===ge.indexOf("./")&&(ge=ge.substring(2));_e=ge.lastIndexOf("/");var ve=y.childTile;_e>0&&""!=ve&&(ve=ge.substring(0,_e+1)+ve),e$28(i._pagelodMap[ve])?i._pagelodMap[ve]._renderEntityList=v._renderEntityList:(i._leafChildren.push(v),v._isLeafNode=!0)}else i._childrenPageLod.push(v)}if(i._isLeafTile=$,!e$28(i._boundingSphere)||i._isLeafTile||i._hasLeafChild){for(var ye=[],xe=i._childrenPageLod.length;xe--;)ye.push(i._childrenPageLod[xe]._boundingSphere);for(var be=i._leafChildren.length;be--;)ye.push(i._leafChildren[be]._boundingSphere);i._boundingSphere=i$19.fromBoundingSpheres(ye),i._oriBoundingSphere=i$19.clone(i._boundingSphere)}for(var we in l)if(l.hasOwnProperty(we)){var Ce=l[we];if(!e$28(Ce))continue;Ce.destroy(),l[we]=null}i._s3mLoadState=I$F.PARSED}}))},_0x1eccda.parseResultInstance=async function(e,t){var i=t.instancePackage,r=t.skeletonPackages;e._version=i.version,e._gl;var n={},o=e._context,a=i.groupNode;for(M=0;M<r.length;M++){var s=(Q=r.values[M]).matrials.material;for(G=0;G<s.length;G++){var l=s[G].material,u=l.id;(Oe=new _0x34bd01({})).createPBRParamter(l),n[u]=Oe;var c=l.ambient;e$28(c)&&(Oe._ambientColor=new e$1S(c.r,c.g,c.b,c.a));var h=l.diffuse;e$28(h)&&(Oe._diffuseColor=new e$1S(h.r,h.g,h.b,h.a));var d=l.specular;e$28(d)&&(Oe._specularColor=new e$1S(d.r,d.g,d.b,d.a)),Oe._shininess=u$Y(l.shininess,Oe._shininess),Oe._bTransparentSorting=u$Y(l.transparentsorting,Oe._bTransparentSorting);var f=l.textureunitstates;for(te=0;te<f.length;te++){var p=f[te].textureunitstate,_=p.id,m=_.indexOf("PBRMaterialParam")>-1,$=Oe._baseColorTextureIndex===te,g=Oe._emissiveTextureIndex===te,v=Oe._normalTextureIndex===te,y=Oe._metallicRoughnessTextureIndex===te,x=Oe._occlusionTextureIndex===te;m&&(Oe._usePBRTextureBatch=!0);var b=0===p.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,w=0===p.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;Oe._texMatrix=y$15.unpack(p.texmodmatrix);var C=Q.texturePackage[_],T=_+e._id+e._context._id;if(e$28(C)&&C.width>0&&C.height>0&&C.imageBuffer.length>0){var S={isPBRMaterialParam:m,isEmissiveTex:g,isNormalTexture:v,isMetallicRoughnessTexture:y,isBaseColorTexture:$};switch(0===C.compressType&&(e._supportCompressType=0),C.compressType){case _0x493d0c.WEBP:Oe._RGBTOBGR=C.nFormat===_0x493d0c.ABGR,await Oe.createWebp(T,_,o,te,C.imageBuffer,C.width,C.height,b,w,C.mipmapLevel,e.mipmapEnabled);break;case _0x493d0c.CRN_DXT5:if(!e$28(await Oe.createCRN(T,_,o,te,C,b,w,!1,e.mipmapEnabled,S)))return void(t.parsingResult=Q);t.parsingResult=null;break;case _0x493d0c.STANDARD_CRN:if(!e$28(await Oe.createCRN(T,_,o,te,C,b,w,!0,e.mipmapEnabled)))return void(t.parsingResult=Q);t.parsingResult=null;break;case _0x493d0c.KTX2:await Oe.createKTX2(T,_,o,te,C,b,w,e.mipmapEnabled,S);break;default:var E=Se$8.CreateTexture(T,o,C.width,C.height,C.nFormat,C.compressType,C.imageBuffer,!1,b,w,e.mipmapEnabled,C.oriCompressType);m?Oe.pbrParamTexture=E:g?Oe.emissiveTexture=E:v?Oe.normalTexture=E:y?Oe.metallicRoughnessTexture=E:x?Oe.occlusionTexture=E:$?Oe.baseColorTexture=E:Oe._textures.push(E)}}}}}for(var A=e._matModel,P=a.pageLods,I=!0,M=0;M<P.length;M++){var O=new _0x575d8a;O._fileType=e._fileType;var D=P[M];if(""===D.childTile?O._isLeafNode=!0:I=!1,O._rangeMode=D.rangeMode,O._rangeDataList=D.childTile,O._rangeList=D.rangeList,-1===D.boundingSphere.radius&&(D.boundingSphere.radius=6378137),D.boundingSphere&&(O._boundingSphere=new i$19(D.boundingSphere.center,D.boundingSphere.radius),O._originalBS=new i$19(D.boundingSphere.center,D.boundingSphere.radius),i$19.transform(O._boundingSphere,e._matModel,O._boundingSphere)),e$28(D._obb)){var R=t$X.fromElements(D._obb.obbCenter.x,D._obb.obbCenter.y,D._obb.obbCenter.z),L=e$25.fromElements(D._obb.xExtent.x,D._obb.xExtent.y,D._obb.xExtent.z,0),B=e$25.fromElements(D._obb.yExtent.x,D._obb.yExtent.y,D._obb.yExtent.z,0),N=e$25.fromElements(D._obb.zExtent.x,D._obb.zExtent.y,D._obb.zExtent.z,0),F=new p$1a(L.x,B.x,N.x,L.y,B.y,N.y,L.z,B.z,N.z);if(t$X.equals(t$X.ZERO,L)||t$X.equals(t$X.ZERO,B)||t$X.equals(t$X.ZERO,N))O._orientedBoundingBox=void 0;else{O._orientedBoundingBox=new x$13(R,F),O._orientedBoundingBox._updateBBox(),O.min=O._orientedBoundingBox.bbox[0].clone(),O.max=O._orientedBoundingBox.bbox[0].clone();for(var z,k=1;k<8;k++)z=O._orientedBoundingBox.bbox[k],O.min.x>z.x&&(O.min.x=z.x),O.min.y>z.y&&(O.min.y=z.y),O.min.z>z.z&&(O.min.z=z.z),O.max.x<z.x&&(O.max.x=z.x),O.max.y<z.y&&(O.max.y=z.y),O.max.z<z.z&&(O.max.z=z.z);y$15.multiplyByPoint(e._matModel,R,R),y$15.multiplyByVector(e._matModel,L,L),y$15.multiplyByVector(e._matModel,B,B),y$15.multiplyByVector(e._matModel,N,N),F[0]=L.x,F[1]=L.y,F[2]=L.z,F[3]=B.x,F[4]=B.y,F[5]=B.z,F[6]=N.x,F[7]=N.y,F[8]=N.z,O._orientedBoundingBox.center=R,O._orientedBoundingBox.halfAxes=F,O._orientedBoundingBox.areaDirty=1}}else if(e$28(D.min)){var V=[];V.push(new t$X(D.min.x,D.min.y,D.min.z)),V.push(new t$X(D.min.x,D.min.y,D.max.z)),V.push(new t$X(D.min.x,D.max.y,D.min.z)),V.push(new t$X(D.min.x,D.max.y,D.max.z)),V.push(new t$X(D.max.x,D.min.y,D.min.z)),V.push(new t$X(D.max.x,D.min.y,D.max.z)),V.push(new t$X(D.max.x,D.max.y,D.min.z)),V.push(new t$X(D.max.x,D.max.y,D.max.z)),O.obbMin=D.min,O.obbMax=D.max;for(var U=0;U<8;U++)V[U]=y$15.multiplyByPoint(e._matModel,V[U],V[U]);O._orientedBoundingBox=x$13.fromPoints(V,O._orientedBoundingBox)}O._isLeafNode||(O._boundingSphere=new i$19(D.boundingSphere.center,D.boundingSphere.radius),i$19.transform(O._boundingSphere,e._matModel,O._boundingSphere));for(var X=D.geodes,H=[],G=0;G<X.length;G++){var W,Y=X[G],q=Y.matrix;if(1===e._heightScale)W=y$15.multiply(A,q,new y$15);else{var j=y$15.multiplyByScale(q,new t$X(1,1,e._heightScale),new y$15);W=y$15.multiply(A,j,new y$15)}for(var Z=Y.skeletonNames,K=0;K<Z.length;K++){var Q,J=Z[K],ee=J;if((Fe=J.indexOf("#"))>-1&&(ee=J.substring(0,Fe)),e$28(Q=r.get(ee))){var te,ie,re=[],ne={};for(te=0;te<Q.groupNode.pageLods.length;te++){var oe=Q.groupNode.pageLods[te].geodes;for(ie=0;ie<oe.length;ie++)for(var ae=oe[ie],se=y$15.unpack(ae.matrix,0,new y$15),le=0;le<ae.skeletonNames.length;le++){var ue=ae.skeletonNames[le];ne[ue]=se,re.push(ue)}}for(te=0;te<re.length;te++){var ce=re[te],he=ne[ce],de=Q.geoPackage[ce];if(e$28(de)){var fe=i.geoPackage[J],pe=l$1e(fe.pickInfo),_e=e$28(de.pickInfo)?Object.keys(de.pickInfo):[],me=_e.length;for(var $e in pe)pe.hasOwnProperty($e)&&(pe[$e].skeletonIds=_e);var ge=fe.vertexPackage,ve=de.vertexPackage,ye={},xe=[],be=ve.vertexAttributes.length;for(ie=0;ie<ve.vertexAttributes.length;ie++){var we=p$17({},Ce=ve.vertexAttributes[ie]);xe.push(we)}for(ie=0;ie<ge.vertexAttributes.length;ie++){var Ce;if((Ce=ge.vertexAttributes[ie]).instanceDivisor>0)(we=p$17({},Ce)).index=be++,xe.push(we)}for(var Te in be=ve.vertexAttributes.length,delete ge.attrLocation.aColor,ye=p$17({},ve.attrLocation),ge.attrLocation)ye[Te]=ge.attrLocation[Te]+be;var Se,Ee={attrLocation:ye,minVerticesValue:ve.minVerticesValue,nCompressOptions:ve.nCompressOptions,vertCompressConstant:ve.vertCompressConstant,vertexAttributes:xe,vertexColor:ve.vertexColor,verticesCount:ve.verticesCount,skeletonCount:me,texCoordCompressConstant:ve.texCoordCompressConstant,minTexCoordValue:ve.minTexCoordValue};if(Ee.instanceIndex=ge.instanceIndex,Ee.instanceCount=ge.instanceCount,Ee.instanceMode=ge.instanceMode,Ee.instanceBuffer=ge.instanceBuffer,Ee.instanceBounds=ge.instanceBounds,delete ge.attrLocation.aColor,O._isLeafNode&&!e$28(O._boundingSphere)){var Ae=Ee.boundingSphere;e$28(Ae)?(Se=new i$19(Ae.center,Ae.radius),i$19.transform(Se,W,Se)):Se=_0x4327f2.calcBoundingSphere(e,Ee,W),H.push(Se),_0x4327f2.calcBoundingRectangle(e,Ee)}var Pe=u$Y(e$28(O._orientedBoundingBox)?x$13.clone(O._orientedBoundingBox):void 0,i$19.clone(O._boundingSphere));Pe=u$Y(Pe,Se);var Ie=de.arrIndexPackage,Me={},Oe=n[u=Ie[0].materialCode],De=new _0x34bd01({});e$28(Oe)&&Oe.clone(De),Me[u]=De;var Re={context:e._context,version:i.version,vertexPackage:Ee,arrIndexPackage:Ie,pickInfo:pe,mapPass:Me,layer:e,entity:t,matModel:W,boundingVolume:Pe,fileType:e._fileType,isS3MB:e._isS3MB,geoMatrix:q,instanceSkeletonMatrix:he,dataType:e._dataType,instanceSkeletonManager:e.instanceSkeletonManager,geoName:ce,skeletonUrl:ee};if(e$28(e.themeStyle)){var Le=_0x3e8cbd.createRenderEntityPageLOD(Re,e);O._renderEntityList=O._renderEntityList.concat(Le)}else{var Be=new _0x1f65d5(Re);if(e._imageryLayer instanceof Array){for(var Ne=[],Fe=0;Fe<e._imageryLayer.length;Fe++){var ze,ke=e._imageryLayer[Fe];if(e$28(ke)&&(ke instanceof h$p||ke instanceof i$o))ze=e._imageryLayer instanceof i$o?ke._inner.getImagery(de.cartographicBounds):ke.getImagery(de.cartographicBounds),Ne=Ne.concat(ze)}Ne.length>0&&Be.setImagerys(Ne,de.cartographicBounds)}else{if(e$28(e._imageryLayer)&&(e._imageryLayer instanceof h$p||e._imageryLayer instanceof i$o))(Ne=e._imageryLayer instanceof i$o?e._imageryLayer._inner.getImagery(de.cartographicBounds):e._imageryLayer.getImagery(de.cartographicBounds)).length>0&&Be.setImagerys(Ne,de.cartographicBounds);else e._needCoverImageryLayer&&Be.setImagerys(Ne,de.cartographicBounds)}O._renderEntityList.push(Be)}}}}}}if(O._isLeafNode&&!e$28(O._boundingSphere)){O._boundingSphere=i$19.fromBoundingSpheres(H,new i$19);for(var Ve=0;Ve<O._renderEntityList.length;Ve++)O._renderEntityList[Ve]._boundingVolume=O._boundingSphere}t._childrenPageLod.push(O)}if(t._isLeafTile=I,!e$28(t._boundingSphere)||t._isLeafTile){for(var Ue=[],Xe=t._childrenPageLod.length;Xe--;)Ue.push(t._childrenPageLod[Xe]._boundingSphere);t._boundingSphere=i$19.fromBoundingSpheres(Ue)}if(!t$X.equals(e._boundingSphereOffset,t$X.ZERO)){var He=Math.max(Math.abs(e._boundingSphereOffset.x),Math.abs(e._boundingSphereOffset.y),Math.abs(e._boundingSphereOffset.z));t.extendRadius(He)}for(var Ge in n)if(n.hasOwnProperty(Ge)){var We=n[Ge];if(!e$28(We))continue;We.destroy(),n[Ge]=null}t._s3mLoadState=I$F.PARSED,t.instancePackage=void 0,t.skeletonPackages=void 0,t.skeletonState=void 0},_0x1eccda.parseChildGroup=_0x163c08,_0x1eccda.binaryDataParser=function(e,t,i,r){if(t._s3mLoadState===I$F.UNLOAD)return t.s3mBuffer=null,t.volBuffer=null,void(t.task=void 0);var n;(e._computeHeight||e._needCoverImageryLayer)&&(n=e._fileType!==f$r.OSGBFile&&e._fileType!==f$r.OSGBCacheFile||e$28(e.waterEffectSet)?void 0:y$15.pack(e._matModel,new Array(16)));var o,a=e._fileType!=f$r.ClampGroundRealtimeRasterCache&&e._fileType!=f$r.PolylineEffect;if(6378137!==t$V.WGS84.radii.z&&"Ellipsoid_WGS84"!==e._globeType&&a&&!e$28(e._animationInfo.duration)){var s=new t$V(6378137,6378137,6378137),l=t$X.fromDegrees(e.lon,e.lat,e.height+e.style3D.bottomAltitude,s);o={sphereMatrix:m$1b.eastNorthUpToFixedFrame(l,s),ellipsoidMatrix:e._matModel}}var u=!1;e$28(e._imageryLayer)&&(u=e._imageryLayer._imageryProvider._tilingScheme._projection instanceof t$M);var c={buffer:i,isS3MZ:e._isS3MZ,fileType:e._fileType,supportCompressType:e._supportCompressType,ignoreNormal:e._ignoreNormal,isJsonScp:e._isJsonScp,isRoot:t._isRootTile,rootBatchIdMap:t._rootBatchIdMap,ancestorMap:t._ancestorMap,isS3MBlock:e._isS3MBlock,modelMatrix:n,materialType:e._materialType,isOSGB:e._isOSGB,isCoverImageryLayer:e._needCoverImageryLayer,fileName:t._fileName,transformPar:o,ellipsoid:6378137!==t$V.WGS84.radii.z&&"Ellipsoid_WGS84"===e._globeType,sceneMode:e._frameState.mode,isMercatorProjection:u},h=[i];if(e$28(r)&&(c.bVolume=!0,c.volbuffer=r,h.push(r)),_0x333f13.init||_0x333f13.initWebAssembly(),_0x333f13.taskProcessorReady){e$28(t.task)||(t.task={data:c,transferableObjects:e._isS3MBlock?void 0:h,priority:t._disFromCamera,state:0,priorityFunction:_0x29ef52(t),processorName:"S3MBTilesParser"});var d=_0x333f13.startTask(t.task);!e$28(d)||(t._s3mLoadState=I$F.PARSING,e._layerScheduler._statistics.numberOfProcessingAttempted=0,e._layerScheduler._statistics.numberOfTilesProcessing++,d.then((function(i){if(t.s3mBuffer=null,t.volBuffer=null,t.task=void 0,t._s3mLoadState!==I$F.UNLOAD){if(e$28(window.Proxy)){var n=t._relativePath.toString()+t._fileName;if((!0===e._indexedDBSetting.isGeoTilesSave||e._indexedDBSetting.isGeoTilesRootNodeSave&&e._layerScheduler._isRootNode(n))&&e$28(e._layerScheduler._indexedDBScheduler)){if(e$28(e._layerScheduler._indexedDBScheduler.cachestatus)&&e$28(e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename])&&(1===e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename][n]||2===e._layerScheduler._indexedDBScheduler.cachestatus[e._layerScheduler.tablename][n]))return;var o={blob:i,key:n,tablename:e._layerScheduler.tablename,dbname:e._layerScheduler._indexedDBScheduler.dbname,reserveCount:e._localCacheMemoryReserveCount};_0x333f13.indexTaskProcessor.scheduleTask(o,[])}e.offlineDownload&&e$28(e._layerScheduler._indexedDBScheduler)&&(sumEntity++,e._layerScheduler._indexedDBScheduler.putElementInDB(e._layerScheduler.tablename,n,i).then((function(){savedEntity++,sumEntity===savedEntity&&console.log("complete")})).otherwise((function(e){})))}e._layerScheduler._statistics.numberOfTilesProcessing--,null==i&&(t._s3mLoadState,I$F.UNLOAD),"InstanceModel"===e._dataType?(t.skeletonState=_0x4a5bf1.STATE.SkeletonParsing,t.instancePackage=i):e._isS3MBlock?_0x163c08(i,e,t):_0x1eccda.parseResult(i,e,t,r)}})).otherwise((function(i){if(e._layerScheduler._statistics.numberOfTilesProcessing--,t.task=void 0,t._s3mLoadState==I$F.UNLOAD)return t.s3mBuffer=null,void(t.volBuffer=null);e$28(i)?(t.s3mBuffer=null,t.volBuffer=null,t._s3mLoadState=I$F.FAILED,console.log(i)):t._s3mLoadState=I$F.LOADED})))}},_0x1eccda.saveLocalCache=function(e,t){var i={tablename:e,dbname:t};_0x333f13.indexTaskProcessor.scheduleTask(i,[])},typeof WebAssembly<"u"&&"object"!=typeof window){let e=function(e){return t$h.locateFile?t$h.locateFile(e,x$t):x$t+e},t=function(e){t.shown||(t.shown={}),t.shown[e]||(t.shown[e]=1)},i=function(e,t,i){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return l$r[e>>0];case"i16":return A$w[e>>1];case"i32":case"i64":return E$r[e>>2];case"float":return ue$a[e>>2];case"double":return le$c[e>>3];default:Q("invalid type for getValue: "+t)}return null},r=function(e,t){e||Q("Assertion failed: "+t)},n=function(e){var t=t$h["_"+e];return r(t,"Cannot call unknown function "+e+", make sure it is exported"),t},o=function(e,t,i,o,a){var s={string:function(e){var t=0;if(null!=e&&0!==e){var i=1+(e.length<<2);t=$$l(i),c(e,t,i)}return t},array:function(e){var t=$$l(e.length);return h(e,t),t}};var u=n(e),d=[],f=0;if(r("array"!==t,'Return type should not be "array".'),o)for(var p=0;p<o.length;p++){var _=s[i[p]];_?(0===f&&(f=Te$c()),d[p]=_(o[p])):d[p]=o[p]}var m=u.apply(null,d);return m=function(e){return"string"===t?l(e):"boolean"===t?Boolean(e):e}(m),0!==f&&Ge$9(f),m},a=function(e,t,i,r){return function(){return o(e,t,i,arguments)}},s=function(e,i,r){for(var n=i+r,o=i;e[o]&&!(o>=n);)++o;if(o-i>16&&e.subarray&&De$e)return De$e.decode(e.subarray(i,o));for(var a="";i<o;){var s=e[i++];if(128&s){var l=63&e[i++];if(192!=(224&s)){var u=63&e[i++];if(224==(240&s)?s=(15&s)<<12|l<<6|u:(240!=(248&s)&&t("Invalid UTF-8 leading byte 0x"+s.toString(16)+" encountered when deserializing a UTF-8 string on the asm.js/wasm heap to a JS string!"),s=(7&s)<<18|l<<12|u<<6|63&e[i++]),s<65536)a+=String.fromCharCode(s);else{var c=s-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&s)<<6|l)}else a+=String.fromCharCode(s)}return a},l=function(e,t){return e?s(b$v,e,t):""},u=function(e,i,r,n){if(!(n>0))return 0;for(var o=r,a=r+n-1,s=0;s<e.length;++s){var l=e.charCodeAt(s);if(l>=55296&&l<=57343)l=65536+((1023&l)<<10)|1023&e.charCodeAt(++s);if(l<=127){if(r>=a)break;i[r++]=l}else if(l<=2047){if(r+1>=a)break;i[r++]=192|l>>6,i[r++]=128|63&l}else if(l<=65535){if(r+2>=a)break;i[r++]=224|l>>12,i[r++]=128|l>>6&63,i[r++]=128|63&l}else{if(r+3>=a)break;l>=2097152&&t("Invalid Unicode code point 0x"+l.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),i[r++]=240|l>>18,i[r++]=128|l>>12&63,i[r++]=128|l>>6&63,i[r++]=128|63&l}}return i[r]=0,r-o},c=function(e,t,i){return r("number"==typeof i,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),u(e,b$v,t,i)},h=function(e,t){r(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),l$r.set(e,t)},d=function(e){return e.replace(/__Z[\w\d_]+/g,(function(e){return e===e?e:e+" ["+e+"]"}))},f=function(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()},p=function(){var e=f();return t$h.extraStackTrace&&(e+="\n"+t$h.extraStackTrace()),d(e)},_=function(e,t){return e%t>0&&(e+=t-e%t),e},m=function(){t$h.HEAP8=l$r=new Int8Array(w$h),t$h.HEAP16=A$w=new Int16Array(w$h),t$h.HEAP32=E$r=new Int32Array(w$h),t$h.HEAPU8=b$v=new Uint8Array(w$h),t$h.HEAPU16=new Uint16Array(w$h),t$h.HEAPU32=I$B=new Uint32Array(w$h),t$h.HEAPF32=ue$a=new Float32Array(w$h),t$h.HEAPF64=le$c=new Float64Array(w$h)},$=function(){r(0==(3&U$n)),I$B[(U$n>>2)-1]=34821223,I$B[(U$n>>2)-2]=2310721022},g=function(){(34821223!=I$B[(U$n>>2)-1]||2310721022!=I$B[(U$n>>2)-2])&&Q("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+I$B[(U$n>>2)-2].toString(16)+" "+I$B[(U$n>>2)-1].toString(16)),1668509029!==E$r[0]&&Q("Runtime error: The application has corrupted its heap memory area (address zero)!")},v=function(e){Q("Stack overflow! Attempted to allocate "+e+" bytes on the stack, but stack has only "+(U$n-Te$c()+e)+" bytes available!")},y=function(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?t$h.dynCall_v(i):t$h.dynCall_vi(i,t.arg):i(void 0===t.arg?null:t.arg)}else t()}},x=function(){if(t$h.preRun)for("function"==typeof t$h.preRun&&(t$h.preRun=[t$h.preRun]);t$h.preRun.length;)T(t$h.preRun.shift());y(Le$b)},b=function(){g(),!h$o&&(h$o=!0,y(Qe$7))},w=function(){g(),y(Pe$a)},C=function(){if(g(),t$h.postRun)for("function"==typeof t$h.postRun&&(t$h.postRun=[t$h.postRun]);t$h.postRun.length;)S(t$h.postRun.shift());y(je$9)},T=function(e){Le$b.unshift(e)},S=function(e){je$9.unshift(e)},E=function(e){k$r++,t$h.monitorRunDependencies&&t$h.monitorRunDependencies(k$r),e&&(r(!P$n[e]),P$n[e]=1,null===C$p&&typeof setInterval<"u"&&(C$p=setInterval((function(){if(ee$g)return clearInterval(C$p),void(C$p=null)}),1e4)))},A=function(e){if(k$r--,t$h.monitorRunDependencies&&t$h.monitorRunDependencies(k$r),e?(r(P$n[e]),delete P$n[e]):v$r("warning: run dependency removed without ID"),0==k$r&&(null!==C$p&&(clearInterval(C$p),C$p=null),Y$g)){var t=Y$g;Y$g=null,t()}},P=function(e){return String.prototype.startsWith?e.startsWith(Be$d):0===e.indexOf(Be$d)},I=function(){try{if(t$h.wasmBinary)return new Uint8Array(t$h.wasmBinary);if(t$h.readBinary)return t$h.readBinary(D$u);throw"both async and sync fetching of the wasm failed"}catch(e){Q(e)}},M=function(){return t$h.wasmBinary||!W$m&&!N$j||"function"!=typeof fetch?new Promise((function(e,t){e(I())})):fetch(D$u,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+D$u+"'";return e.arrayBuffer()})).catch((function(){return I()}))},O=function(e){var t={env:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:Xt$2};function i(e,t){var i=e.exports;t$h.asm=i,A("wasm-instantiate")}E("wasm-instantiate");var n=t$h;function o(e){r(t$h===n,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),n=null,i(e.instance)}function a(e){return M().then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(e){}))}if(t$h.instantiateWasm)try{return t$h.instantiateWasm(t,i)}catch{return!1}return function(){if(t$h.wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||P(D$u)||"function"!=typeof fetch)return a(o);fetch(D$u,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(o,(function(e){a(o)}))}))}(),{}},D=function(){},R=function(e,t){p$n.varargs=t;try{p$n.getStreamFromFD(),p$n.get(),p$n.get(),p$n.get(),p$n.get();return Q("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"),0}catch(e){return(typeof y$p>"u"||!(e instanceof y$p.ErrnoError))&&Q(e),-e.errno}},L=function(){var e=t$h._fflush;e&&e(0);var t=p$n.buffers;t[1].length&&p$n.printChar(1,10),t[2].length&&p$n.printChar(2,10)},B=function(e,t){p$n.varargs=t;try{for(var i=p$n.get(),r=p$n.get(),n=p$n.get(),o=0,a=0;a<n;a++){for(var s=E$r[r+8*a>>2],l=E$r[r+(8*a+4)>>2],u=0;u<l;u++)p$n.printChar(i,b$v[s+u]);o+=l}return o}catch(e){return(typeof y$p>"u"||!(e instanceof y$p.ErrnoError))&&Q(e),-e.errno}},N=function(e,t){p$n.varargs=t;try{return 0}catch(e){return(typeof y$p>"u"||!(e instanceof y$p.ErrnoError))&&Q(e),-e.errno}},F=function(e,t){p$n.varargs=t;try{p$n.getStreamFromFD();return Q("it should not be possible to operate on streams when !SYSCALLS_REQUIRE_FILESYSTEM"),0}catch(e){return(typeof y$p>"u"||!(e instanceof y$p.ErrnoError))&&Q(e),-e.errno}},z=function(){},k=function(){return l$r.length},V=function(e,t,i){b$v.set(b$v.subarray(t,t+i),e)},U=function(e){return t$h.___errno_location?E$r[t$h.___errno_location()>>2]=e:v$r("failed to set errno from JS"),e},X=function(e){Q("Cannot enlarge memory arrays to size "+e+" bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+l$r.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},H=function(e){e=_(e,65536);var t=w$h.byteLength;try{return-1!==z$l.grow((e-t)/65536)&&(w$h=z$l.buffer,!0)}catch(i){return console.error("emscripten_realloc_buffer: Attempted to grow from "+t+" bytes to "+e+" bytes, but got error: "+i),!1}},G=function(e){var i=k();r(e>i);var n=65536,o=2147418112;if(e>o)return v$r("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+o+" bytes!"),!1;for(var a=Math.max(i,16777216);a<e;)(a=a<=536870912?_(2*a,n):Math.min(_((3*a+2147483648)/4,n),o))===i&&t("Cannot ask for more memory since we reached the practical limit in browsers (which is just below 2GB), so the request would have failed. Requesting only "+l$r.length);return H(a)?(m(),!0):(v$r("Failed to grow the heap from "+i+" bytes to "+a+" bytes, not enough memory!"),!1)},W=function(e){v$r("Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),v$r("Build with ASSERTIONS=2 for more info."),Q(e)},Y=function(e){v$r("Invalid function pointer called with signature 'iiii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),v$r("Build with ASSERTIONS=2 for more info."),Q(e)},q=function(e){v$r("Invalid function pointer called with signature 'jiji'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),v$r("Build with ASSERTIONS=2 for more info."),Q(e)},j=function(e){v$r("Invalid function pointer called with signature 'vii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)"),v$r("Build with ASSERTIONS=2 for more info."),Q(e)},Z=function(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e},K=function(e){function t(){t$h.calledRun||(t$h.calledRun=!0,!ee$g&&(b(),w(),t$h.onRuntimeInitialized&&t$h.onRuntimeInitialized(),r(!t$h._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),C()))}e=e||t$h.arguments,k$r>0||($(),x(),k$r>0)||t$h.calledRun||(t$h.setStatus?(t$h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t$h.setStatus("")}),1),t()}),1)):t(),g())},Q=function(e){t$h.onAbort&&t$h.onAbort(e),ee$g=!0;var t="abort("+(e=void 0!==e?'"'+e+'"':"")+") at "+p();throw qe$6&&qe$6.forEach((function(i){t=i(t,e)})),t};var t$h=typeof t$h<"u"?t$h:{},q$o={},S$l;for(S$l in t$h)t$h.hasOwnProperty(S$l)&&(q$o[S$l]=t$h[S$l]);t$h.arguments=[],t$h.thisProgram="./this.program",t$h.quit=function(e,t){throw t},t$h.preRun=[],t$h.postRun=[];var W$m=!1,N$j=!1,ie$c=!1,Oe$b=!1,xe$d=!1;if(W$m="object"==typeof window,N$j="function"==typeof importScripts,Oe$b="object"==typeof process&&"function"==typeof require,ie$c=Oe$b&&!W$m&&!N$j,xe$d=!W$m&&!ie$c&&!N$j,t$h.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var x$t="",oe$c,se$a;if(ie$c)x$t=__dirname+"/",t$h.read=function(e,t){var i;return oe$c||(oe$c=require("fs")),se$a||(se$a=require("path")),e=se$a.normalize(e),i=oe$c.readFileSync(e),t?i:i.toString()},t$h.readBinary=function(e){var t=t$h.read(e,!0);return t.buffer||(t=new Uint8Array(t)),r(t.buffer),t},process.argv.length>1&&(t$h.thisProgram=process.argv[1].replace(/\\/g,"/")),t$h.arguments=process.argv.slice(2),typeof module<"u"&&(module.exports=t$h),process.on("uncaughtException",(function(e){if(!(e instanceof Z))throw e})),process.on("unhandledRejection",Q),t$h.quit=function(e){process.exit(e)},t$h.inspect=function(){return"[Emscripten Module object]"};else if(xe$d)typeof read<"u"&&(t$h.read=function(e){return read(e)}),t$h.readBinary=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),r("object"==typeof t),t)},typeof scriptArgs<"u"?t$h.arguments=scriptArgs:typeof arguments<"u"&&(t$h.arguments=arguments),"function"==typeof quit&&(t$h.quit=function(e){quit(e)});else{if(!W$m&&!N$j)throw new Error("environment detection error");N$j?x$t=self.location.href:document.currentScript&&(x$t=document.currentScript.src),x$t=0!==x$t.indexOf("blob:")?x$t.substr(0,x$t.indexOf("/Workers")+1):"",t$h.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},N$j&&(t$h.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),t$h.readAsync=function(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)},t$h.setWindowTitle=function(e){document.title=e}}var V$k=t$h.print||(typeof console<"u"?console.log.bind(console):typeof print<"u"?print:null),v$r=t$h.printErr||(typeof printErr<"u"?printErr:typeof console<"u"&&console.warn.bind(console)||V$k);for(S$l in q$o)q$o.hasOwnProperty(S$l)&&(t$h[S$l]=q$o[S$l]);q$o=void 0,r(typeof t$h.memoryInitializerPrefixURL>"u","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),r(typeof t$h.pthreadMainPrefixURL>"u","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),r(typeof t$h.cdInitializerPrefixURL>"u","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),r(typeof t$h.filePackagePrefixURL>"u","Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),Te$c=Ge$9=$$l=function(){Q("cannot use the stack before compiled code is ready to run, and has provided stack access")};var Xt$2={"f64-rem":function(e,t){return e%t},debugger:function(){}};new Array(0);var Ae$c=0,Dt$6=function(e){Ae$c=e},Nt$4=function(){return Ae$c};"object"!=typeof WebAssembly&&Q("No WebAssembly support found. Build with -s WASM=0 to target JavaScript instead.");var z$l,ee$g=!1,De$e=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;typeof TextDecoder<"u"&&new TextDecoder("utf-16le");var Ie$b=65536,w$h,l$r,b$v,A$w,E$r,I$B,ue$a,le$c,ke$7=15104,U$n=5257984,Ce$a=5257984,J$p=15072;r(ke$7%16==0,"stack must start aligned"),r(Ce$a%16==0,"heap must start aligned");var he$b=5242880;t$h.TOTAL_STACK&&r(he$b===t$h.TOTAL_STACK,"the stack size can no longer be determined at runtime");var X$e=t$h.TOTAL_MEMORY||16777216;if(X$e<he$b&&v$r("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+X$e+"! (TOTAL_STACK="+he$b+")"),r(typeof Int32Array<"u"&&typeof Float64Array<"u"&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),t$h.buffer?(w$h=t$h.buffer,r(w$h.byteLength===X$e,"provided buffer should be "+X$e+" bytes, but it is "+w$h.byteLength)):("object"==typeof WebAssembly&&"function"==typeof WebAssembly.Memory?(r(X$e%Ie$b==0),z$l=new WebAssembly.Memory({initial:X$e/Ie$b}),w$h=z$l.buffer):w$h=new ArrayBuffer(X$e),r(w$h.byteLength===X$e)),m(),E$r[J$p>>2]=Ce$a,E$r[0]=1668509029,A$w[1]=25459,115!==b$v[2]||99!==b$v[3])throw"Runtime error: expected the system to be little-endian!";var Le$b=[],Qe$7=[],Pe$a=[],je$9=[],h$o=!1,_$o=!1;r(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),r(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),r(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),r(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var k$r=0,C$p=null,Y$g=null,P$n={};t$h.preloadedImages={},t$h.preloadedAudios={};var y$p={error:function(){Q("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -s FORCE_FILESYSTEM=1")},init:function(){y$p.error()},createDataFile:function(){y$p.error()},createPreloadedFile:function(){y$p.error()},createLazyFile:function(){y$p.error()},open:function(){y$p.error()},mkdev:function(){y$p.error()},registerDevice:function(){y$p.error()},analyzePath:function(){y$p.error()},loadFilesFromDB:function(){y$p.error()},ErrnoError:function(){y$p.error()}};t$h.FS_createDataFile=y$p.createDataFile,t$h.FS_createPreloadedFile=y$p.createPreloadedFile;var Be$d="data:application/octet-stream;base64,",D$u="ThirdParty/unzip.wasm";P(D$u)||(D$u=e(D$u)),t$h.asm=function(e,t,i){t.memory=z$l,t.table=new WebAssembly.Table({initial:22,maximum:22,element:"anyfunc"}),t.__memory_base=1024,t.__table_base=0;var n=O(t);return r(n,"binaryen setup failed (no wasm support?)"),n};var F$n=15088;r(F$n%8==0);var p$n={buffers:[null,[],[]],printChar:function(e,t){var i=p$n.buffers[e];r(i),0===t||10===t?((1===e?V$k:v$r)(s(i,0)),i.length=0):i.push(t)},varargs:0,get:function(e){return p$n.varargs+=4,E$r[p$n.varargs-4>>2]},getStr:function(){return l(p$n.get())},get64:function(){var e=p$n.get(),t=p$n.get();return r(e>=0?0===t:-1===t),e},getZero:function(){r(0===p$n.get())}},Bt$4={},Gt$2={abort:Q,setTempRet0:Dt$6,getTempRet0:Nt$4,abortStackOverflow:v,nullFunc_ii:W,nullFunc_iiii:Y,nullFunc_jiji:q,nullFunc_vii:j,___lock:D,___setErrNo:U,___syscall140:R,___syscall146:B,___syscall54:N,___syscall6:F,___unlock:z,_emscripten_get_heap_size:k,_emscripten_memcpy_big:V,_emscripten_resize_heap:G,abortOnCannotGrowMemory:X,emscripten_realloc_buffer:H,flush_NO_FILESYSTEM:L,tempDoublePtr:F$n,DYNAMICTOP_PTR:J$p},T$j=t$h.asm(Bt$4,Gt$2,w$h),qt$2=T$j.___errno_location;T$j.___errno_location=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),qt$2.apply(null,arguments)};var Wt$3=T$j._fflush;T$j._fflush=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Wt$3.apply(null,arguments)};var Vt$5=T$j._free;T$j._free=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Vt$5.apply(null,arguments)};var zt$2=T$j._freePointer;T$j._freePointer=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),zt$2.apply(null,arguments)};var Jt$2=T$j._llvm_bswap_i32;T$j._llvm_bswap_i32=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Jt$2.apply(null,arguments)};var Yt$1=T$j._malloc;T$j._malloc=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Yt$1.apply(null,arguments)};var Zt$2=T$j._sbrk;T$j._sbrk=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Zt$2.apply(null,arguments)};var $t$2=T$j._unzip;T$j._unzip=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),$t$2.apply(null,arguments)};var Ht$2=T$j.establishStackSpace;T$j.establishStackSpace=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Ht$2.apply(null,arguments)};var Kt$2=T$j.stackAlloc;T$j.stackAlloc=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Kt$2.apply(null,arguments)};var Mt$4=T$j.stackRestore;T$j.stackRestore=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),Mt$4.apply(null,arguments)};var en$1=T$j.stackSave;T$j.stackSave=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),en$1.apply(null,arguments)},t$h.asm=T$j,t$h.___errno_location=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.___errno_location.apply(null,arguments)},t$h._emscripten_replace_memory=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._emscripten_replace_memory.apply(null,arguments)},t$h._fflush=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._fflush.apply(null,arguments)},t$h._free=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._free.apply(null,arguments)},t$h._freePointer=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._freePointer.apply(null,arguments)},t$h._llvm_bswap_i32=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._llvm_bswap_i32.apply(null,arguments)},t$h._malloc=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._malloc.apply(null,arguments)},t$h._memcpy=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._memcpy.apply(null,arguments)},t$h._memset=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._memset.apply(null,arguments)},t$h._sbrk=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._sbrk.apply(null,arguments)},t$h._unzip=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm._unzip.apply(null,arguments)},t$h.establishStackSpace=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.establishStackSpace.apply(null,arguments)};var $$l=t$h.stackAlloc=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.stackAlloc.apply(null,arguments)},Ge$9=t$h.stackRestore=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.stackRestore.apply(null,arguments)},Te$c=t$h.stackSave=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.stackSave.apply(null,arguments)};t$h.dynCall_ii=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.dynCall_ii.apply(null,arguments)},t$h.dynCall_iiii=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.dynCall_iiii.apply(null,arguments)},t$h.dynCall_jiji=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.dynCall_jiji.apply(null,arguments)},t$h.dynCall_vii=function(){return r(h$o,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)"),r(!_$o,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),t$h.asm.dynCall_vii.apply(null,arguments)},t$h.asm=T$j,t$h.intArrayFromString||(t$h.intArrayFromString=function(){Q("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.intArrayToString||(t$h.intArrayToString=function(){Q("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.ccall=o,t$h.cwrap=a,t$h.setValue||(t$h.setValue=function(){Q("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getValue=i,t$h.allocate||(t$h.allocate=function(){Q("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getMemory||(t$h.getMemory=function(){Q("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.AsciiToString||(t$h.AsciiToString=function(){Q("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stringToAscii||(t$h.stringToAscii=function(){Q("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.UTF8ArrayToString||(t$h.UTF8ArrayToString=function(){Q("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.UTF8ToString||(t$h.UTF8ToString=function(){Q("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stringToUTF8Array||(t$h.stringToUTF8Array=function(){Q("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stringToUTF8||(t$h.stringToUTF8=function(){Q("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.lengthBytesUTF8||(t$h.lengthBytesUTF8=function(){Q("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.UTF16ToString||(t$h.UTF16ToString=function(){Q("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stringToUTF16||(t$h.stringToUTF16=function(){Q("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.lengthBytesUTF16||(t$h.lengthBytesUTF16=function(){Q("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.UTF32ToString||(t$h.UTF32ToString=function(){Q("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stringToUTF32||(t$h.stringToUTF32=function(){Q("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.lengthBytesUTF32||(t$h.lengthBytesUTF32=function(){Q("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.allocateUTF8||(t$h.allocateUTF8=function(){Q("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stackTrace||(t$h.stackTrace=function(){Q("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addOnPreRun||(t$h.addOnPreRun=function(){Q("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addOnInit||(t$h.addOnInit=function(){Q("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addOnPreMain||(t$h.addOnPreMain=function(){Q("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addOnExit||(t$h.addOnExit=function(){Q("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addOnPostRun||(t$h.addOnPostRun=function(){Q("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.writeStringToMemory||(t$h.writeStringToMemory=function(){Q("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.writeArrayToMemory||(t$h.writeArrayToMemory=function(){Q("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.writeAsciiToMemory||(t$h.writeAsciiToMemory=function(){Q("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addRunDependency||(t$h.addRunDependency=function(){Q("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.removeRunDependency||(t$h.removeRunDependency=function(){Q("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.ENV||(t$h.ENV=function(){Q("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.FS||(t$h.FS=function(){Q("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.FS_createFolder||(t$h.FS_createFolder=function(){Q("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createPath||(t$h.FS_createPath=function(){Q("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createDataFile||(t$h.FS_createDataFile=function(){Q("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createPreloadedFile||(t$h.FS_createPreloadedFile=function(){Q("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createLazyFile||(t$h.FS_createLazyFile=function(){Q("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createLink||(t$h.FS_createLink=function(){Q("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_createDevice||(t$h.FS_createDevice=function(){Q("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.FS_unlink||(t$h.FS_unlink=function(){Q("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}),t$h.GL||(t$h.GL=function(){Q("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.dynamicAlloc||(t$h.dynamicAlloc=function(){Q("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.warnOnce||(t$h.warnOnce=function(){Q("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.loadDynamicLibrary||(t$h.loadDynamicLibrary=function(){Q("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.loadWebAssemblyModule||(t$h.loadWebAssemblyModule=function(){Q("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getLEB||(t$h.getLEB=function(){Q("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getFunctionTables||(t$h.getFunctionTables=function(){Q("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.alignFunctionTables||(t$h.alignFunctionTables=function(){Q("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.registerFunctions||(t$h.registerFunctions=function(){Q("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.addFunction||(t$h.addFunction=function(){Q("'addFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.removeFunction||(t$h.removeFunction=function(){Q("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getFuncWrapper||(t$h.getFuncWrapper=function(){Q("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.prettyPrint||(t$h.prettyPrint=function(){Q("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.makeBigInt||(t$h.makeBigInt=function(){Q("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.dynCall||(t$h.dynCall=function(){Q("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getCompilerSetting||(t$h.getCompilerSetting=function(){Q("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stackSave||(t$h.stackSave=function(){Q("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stackRestore||(t$h.stackRestore=function(){Q("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.stackAlloc||(t$h.stackAlloc=function(){Q("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.establishStackSpace||(t$h.establishStackSpace=function(){Q("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.print||(t$h.print=function(){Q("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.printErr||(t$h.printErr=function(){Q("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.getTempRet0||(t$h.getTempRet0=function(){Q("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.setTempRet0||(t$h.setTempRet0=function(){Q("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.Pointer_stringify||(t$h.Pointer_stringify=function(){Q("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),t$h.ALLOC_NORMAL||Object.defineProperty(t$h,"ALLOC_NORMAL",{get:function(){Q("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),t$h.ALLOC_STACK||Object.defineProperty(t$h,"ALLOC_STACK",{get:function(){Q("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),t$h.ALLOC_DYNAMIC||Object.defineProperty(t$h,"ALLOC_DYNAMIC",{get:function(){Q("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),t$h.ALLOC_NONE||Object.defineProperty(t$h,"ALLOC_NONE",{get:function(){Q("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Z.prototype=new Error,Z.prototype.constructor=Z,Y$g=function e(){t$h.calledRun||K(),t$h.calledRun||(Y$g=e)},t$h.run=K;var qe$6=[];if(t$h.abort=Q,t$h.preInit)for("function"==typeof t$h.preInit&&(t$h.preInit=[t$h.preInit]);t$h.preInit.length>0;)t$h.preInit.pop()();t$h.noExitRuntime=!0,K()}else var t$h=null;var _0x175ffe=t$h,_0x4b274b=(_0x119458=!0,function(e,t){var i=_0x119458?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x119458=!1,i}),_0x2a9768=_0x4b274b(void 0,(function(){return _0x2a9768.toString().search("(((.+)+)+)+$").toString().constructor(_0x2a9768).search("(((.+)+)+)+$")})),_0x119458;_0x2a9768();var _0x37fa97={Normal:0,Add:1},_0x48d444={LOD_Loading:0,All_Loading:1};function _0x382b30(e){return function(){return e._disFromCamera}}function _0xdf062f(e){return function(){return e._priority}}function _0x527cb6(e,t){return function(){var i=t._currentMaxLevel,r=1/Math.pow(2,i-e._nLODLev);return e._disFromCamera*r}}var _0x151d57=function(e){e=e||{},this._gl=e.gl,this._layer=e.layer,this._customRequestHeaders=e.customRequestHeaders,this._renderQueue=[],this._cache=new e$1P,this._virtualRootTiles=[],this._rootEntities=[],this._cameraPos=new t$X,this._cameraDir=new t$X,this._cameraUp=new t$X,this._cacheEntityCount=u$Y(e.cacheEntityCount,0),this._sceneMode=P$$.SCENE3D,this._projection=null,this._oriRootEntities=e.rootEntities,this._initializeRootEntities(e.rootEntities),this._nLoadingPriority=this._layer._isS3MBlock?U$p.Child_Priority_NonLinear:U$p.Child_Priority,this.createPriorityFunction=_0x382b30,this._currentMaxLevel=0,this._replacementList=new h$P,this._replacementSentinel=this._replacementList.add(),this._cacheKey=e.cacheKey;var t=this._layer._baseUri.toString(),i=t.substring(0,t.indexOf("/datas"));this.tablename=t.substring(t.indexOf("datas/")+6,t.indexOf("/data/")),this._indexedDBSetting=this._layer._indexedDBSetting;var r=this,n=o$1q.defer();if(r._attributes={_errorNum:0,_reStoreTimes:0,_memoryCache:0,_redownload:!1,status:{promise:n.promise,needDownload:void 0}},this._scpUrl=e.scpUrl,e$28(window.Proxy)){var o=o$1q.defer();r._dpPromise=o.promise,new l$11({name:i+this.tablename}).then((function(e){e.checkObjectStoreExit(r.tablename)?e.checkObjectStoreExit(r.tablename+"Texture")?(_0x5bfeb0(e,r,n),r._indexedDBScheduler=e,o.resolve(!0)):e.createObjectStore(r.tablename+"Texture").then((function(){_0x5bfeb0(e,r,n),r._indexedDBScheduler=e,o.resolve(!0)})):e.createObjectStore(r.tablename).then((function(){e.checkObjectStoreExit(r.tablename+"Texture")?(_0x5bfeb0(e,r,n),r._indexedDBScheduler=e,o.resolve(!0)):e.createObjectStore(r.tablename+"Texture").then((function(){_0x5bfeb0(e,r,n),r._indexedDBScheduler=e,o.resolve(!0)}))}))}))}this._rasterFrequency=0,this._statistics={numberOfPendingRequests:0,numberOfAttemptedRequests:0,numberOfTilesProcessing:0,numberOfProcessingAttempted:0,numberOfCommands:0,numberOfColorChangePending:0,numberOfColorChangeAttempted:0,numberOfColorChangeProcessing:0,lastColorChangeTrigger:{time:Date.now(),done:!1}},this._statisticsLastRender=p$17({},this._statistics),this._packingRequest=!1,this._packRequestEntities=[],this._parsingEntities=[],this._attrloaded=!1,this._selectEntities=[],this._requestEntities=[],this.attrsave=!1,this._extrudedId=void 0,this._polygons=void 0,this._indexedDBRequestNum=0,this._indexedDBRequestLimit=3,this._requestByteLength=0,this._prepareLoaded=!0,this._prepareRatio=0,this._associatedFieldName=void 0,this._entityObjectId={},this._objectIdChange=!1,this._isFineLayer=!1,this._entityModelId={},this._stopLoadImagery=!1,this._rangeMode=_0x189b29.DISTANCE_FROM_EYE_POINT,this._savetoIndexDBDatas=[]};function _0x5bfeb0(e,t,i){e.checkObjectStoreExit("attributes")?!0===t._indexedDBSetting.isAttributesSave&&e.getElementFromDB("attributes","queryFieldNames").then((function(r){if("ALL"===r&&(t._attributes.status.needDownload=!1,i.resolve(!0)),e$28(t._layer.queryFieldNames)){for(var n=0;n<t._layer.queryFieldNames.length;n++)if(-1===r.indexOf(t._layer.queryFieldNames[n]))return t._attributes.status.needDownload=!0,e.updateElementInDB("attributes","queryFieldNames",r.concat(t._layer.queryFieldNames)),void i.resolve(!0);t._attributes.status.needDownload=!1,i.resolve(!0)}})).otherwise((function(){!0===t._indexedDBSetting.isAttributesSave&&(e$28(t._layer.queryFieldNames)?e.putElementInDB("attributes","queryFieldNames",t._layer.queryFieldNames):e.putElementInDB("attributes","queryFieldNames","ALL"),t._attributes.status.needDownload=!0,i.resolve(!0))})):e.createObjectStore("attributes").then((function(){i.resolve(!0),!0===t._indexedDBSetting.isAttributesSave&&(e$28(t._layer.queryFieldNames)?e.putElementInDB("attributes","queryFieldNames",t._layer.queryFieldNames):e.putElementInDB("attributes","queryFieldNames","ALL"),t._attributes.status.needDownload=!0)}))}function _0x509fc4(e,t){!e._indexedDBSetting.isAttributesSave||(e$28(e._indexedDBScheduler)?_0x53c99a(e,t):e._dpPromise.then((function(){_0x53c99a(e,t)})))}function _0x53c99a(e,t){var i=new TextEncoder("utf-8"),r=[],n=o$1q.defer();if(e._indexedDBScheduler.checkObjectStoreExit("attributes")){for(var o in t){try{var a=JSON.stringify(t[o]);a=i.encode(a).join(256)}catch{return n.reject(null),n.promise}r.push(e._indexedDBScheduler.putElementInDB("attributes",o,a))}o$1q.all(r,(function(t){0===e._savetoIndexDBDatas.length&&e._indexedDBScheduler.putElementInDB("attributes","saved",!0)}),(function(i){t._reStoreTimes<=3&&(t._reStoreTimes++,setTimeout((function(){_0x509fc4(e,t)}),2e3))}))}else e._indexedDBScheduler.createObjectStore("attributes").then((function(){for(var o in t){try{var a=JSON.stringify(t[o]);a=i.encode(a).join(256)}catch{return n.reject(null),n.promise}r.push(e._indexedDBScheduler.putElementInDB("attributes",o,a))}o$1q.all(r,(function(t){0===e._savetoIndexDBDatas.length&&e._indexedDBScheduler.putElementInDB("attributes","saved",!0)}),(function(i){t._reStoreTimes<=3&&(t._reStoreTimes++,setTimeout((function(){_0x509fc4(e,t)}),2e3))}))}))}function _0x325586(e,t){if(Array.isArray(e)){for(var i={},r=e.length,n=0;n<r;n++){o=e$28(t._layer.idFieldName)?e[n][t._layer.idFieldName]:e[n].id||e[n].SmID||e[n].SMID||e[n].smid,!t._attributes.hasOwnProperty(o)&&(t._attributes[o]=e[n],i[o]=e[n],r>500&&n&&n%500==0&&(t._savetoIndexDBDatas.push(i),i={}))}t._savetoIndexDBDatas.push(i)}else{var o;e$28(o=e.id||e.SmID||e.SMID)&&(t._attributes[o]=e)}t._attributes._memoryCache=1}function _0xf2225e(e,t){var i=[],r=e._layer,n="attribute"===r._attributeExtentName?".attribute":r._isS3MB?".s3md":".scvd",o=()=>{};e$28(a$Y.CREDENTIAL)&&(o=e$28(a$Y.CREDENTIAL._keymap[e._scpUrl])?t=>a$Y.addTokenWithKey(e._scpUrl,t):e=>a$Y.addToken(e));var a="";".attribute"===n&&(a=Object.keys(r._fieldsInfo._hash).join(";"),a=r._fieldsInfo._hash.hasOwnProperty("smid")?"?fields=smid;"+a.replace("smid;",""):"?fields=SmID;"+a.replace("SmID;",""));var s="",l=r._indexInfoAttributeMap;if(e$28(l)){var u=r._baseUri.toString();for(var c in l)for(var h=l[c],d=0;d<h.length;d++)o(s=u+h[d].url+a),i.push(o$$(s,e._customRequestHeaders))}else for(var f=0,p=e._rootEntities.length;f<p;f++)s=r._isS3MBlock?e._rootEntities[f]._relativePath.resolve(r._baseUri).toString()+e._rootEntities[f]._fileName:e._rootEntities[f]._relativePath.resolve(r._baseUri).toString()+f$V(e._rootEntities[f]._relativePath.toString().replace(/\/$/,"")),o(s+=n+a),i.push(o$$(s,e._customRequestHeaders));o$1q.all(i,(function(e){r.attrDatas=e}),(function(t){for(var i=0,o=e._rootEntities.length;i<o;i++){var a;if(a=r._isS3MBlock?e._rootEntities[i]._relativePath.resolve(r._baseUri).toString()+e._rootEntities[i]._fileName+n:e._rootEntities[i]._relativePath.resolve(r._baseUri).toString()+f$V(e._rootEntities[i]._relativePath.toString().replace(/\/$/,""))+n,".attribute"===n){var s=Object.keys(r._fieldsInfo._hash).join(";");r._fieldsInfo._hash.hasOwnProperty("smid")?a=a+"?fields=smid;"+(s=s.replace("smid;","")):a=a+"?fields=SmID;"+(s=s.replace("SmID;",""))}e$28(a$Y.CREDENTIAL)&&(a=e$28(a$Y.CREDENTIAL._keymap[e._scpUrl])?a$Y.addTokenWithKey(e._scpUrl,a):a$Y.addToken(a)),o$$(a,e._customRequestHeaders).then((function(e){r.attrDatas=[e]}))}}))}Object.defineProperties(_0x151d57.prototype,{LoadingPriority:{get:function(){return this._nLoadingPriority},set:function(e){this._nLoadingPriority=e,this.createPriorityFunction=this._nLoadingPriority===U$p.Root_Priority?_0x527cb6:_0x382b30,this._nLoadingPriority===U$p.UsePagedLodInfo&&(this.createPriorityFunction=_0xdf062f)}}}),_0x151d57.prototype._updatingTiles=function(){return this._statistics.numberOfPendingRequests+this._statistics.numberOfAttemptedRequests+this._statistics.numberOfTilesProcessing},_0x151d57.prototype._requestAllScvd=function(e){var t=this;if(e$28(this._indexedDBScheduler)){if(!t._indexedDBScheduler.checkObjectStoreExit("attributes")&&!e)return;_0xf2225e(t,t._layer._isS3MB)}else this._dpPromise.then((function(){e$28(t._indexedDBScheduler)&&t._indexedDBScheduler.checkObjectStoreExit("attributes")||_0xf2225e(t,t._layer._isS3MB)}))};var _0x2d8ac2=null,_0x4b0701=null,_0x3005ef=!1;function _0x7eeaae(e){var t=4*e.length,i=_0x175ffe._malloc(Uint8Array.BYTES_PER_ELEMENT*t),r=new Uint8Array(t);_0x175ffe.HEAPU8.set(r,i/Uint8Array.BYTES_PER_ELEMENT);var n,o=_0x175ffe._malloc(Uint8Array.BYTES_PER_ELEMENT*e.length);for(_0x175ffe.HEAPU8.set(e,o/Uint8Array.BYTES_PER_ELEMENT);0==(n=_0x2d8ac2(i,t,o,e.length));)_0x4b0701(i),t*=4,i=_0x175ffe._malloc(Uint8Array.BYTES_PER_ELEMENT*t),r=new Uint8Array(t),_0x175ffe.HEAPU8.set(r,i/Uint8Array.BYTES_PER_ELEMENT);var a=new Uint8Array(_0x175ffe.HEAPU8.buffer,i,n);e=null,r=null;var s=new Uint8Array(a).buffer;return _0x4b0701(i),_0x4b0701(o),s}function _0x482882(e,t,i){if(".attribute"===t){var r=new Int32Array(e,0,1);r=r[0];for(var n=new Int32Array(e,4,r),o=[],a=0;a<r;a++)o.push(n[a]);var s=Math.floor(o[0]/4.125),l=$=Math.ceil(s/8),u=new Int8Array(e,4*(r+1)+$,4*s),c=u.subarray(0,4*s),h=new Int8Array(c);u=new Int32Array(h.buffer);var d=4*(r+1)+o[0],f=[];for(a=1;a<r;a++){var p=(i=i)._array[a],_=p.type,m=Number(p.size);s=Math.floor(o[a]/(m+.125));var $=Math.ceil(s/8);(10==_||"ntext"===_||"text"===_)&&(m=1,$=l,s=o[a]-$);var g=new Int8Array(e,d+$,s*m).subarray(0,s*m);h=new Int8Array(g);if(4==_||"int32"===_)g=new Int32Array(h.buffer);else if(16==_||"int64"===_)g=new BigInt64Array(h.buffer);else if(6==_||"float"===_)g=new Float32Array(h.buffer);else if(7==_||"double"===_)g=new Float64Array(h.buffer);else if(10==_||"ntext"===_||"text"===_){for(var v=new DataView(g.buffer),y=0,x=[];y+g.byteOffset<v.byteLength;){var b=v.getInt32(y+g.byteOffset,!0);if((y+=4)+b>h.buffer.byteLength||b<0)break;var w=new Uint8Array(h.buffer,y,b);y+=b;var C=a$Z(w,void 0,void 0,"gbk");x.push(C)}g=x}d+=o[a],f.push(g)}var T=Object.keys(i._hash),S=[];for(a=0;a<u.length;a++){(D={})[T[0]]=u[a];for(var E=0;E<f.length;E++)D[T[E+1]]=f[E][a];S.push(D)}return S}var A,P=new Uint8Array(e,8);if(null!==_0x2d8ac2&&!0===_0x3005ef)try{A=_0x7eeaae(P)}catch{return[]}else A=nt$c.inflate(P).buffer;h=new Uint8Array(A);var I=new TextDecoder("utf-8").decode(h);if(".s3md"===t){var M,O=I.substring(4);try{M=JSON.parse(O)}catch{O=I.substring(I.indexOf("{")),M=JSON.parse(O)}for(var D=[],R=0,L=M.layerInfos.length;R<L;R++)for(var B=M.layerInfos[R].records,N=(a=0,B.length);a<N;a++){for(var F={},z=(E=0,(V=B[a]).values.length);E<z;E++)F[V.values[E].name]=V.values[E].field,F[V.values[E].name]=!isNaN(1*F[V.values[E].name])&1*F[V.values[E].name]<Number.MAX_SAFE_INTEGER?1*F[V.values[E].name]:F[V.values[E].name];D.push(F)}return D}D=[];var k=(new s$P).read(I).getElementsByTagName("Record");for(a=0,N=k.length;a<N;a++){for(F={},h=k[a].innerHTML.split("\n"),E=0;E<h.length;E++){var V;if(""!==(V=h[E]))if(-1!==V.indexOf("<ID>"))F.id=V.substring(V.indexOf(">")+1,V.indexOf("</"));else{var U=V.indexOf('"');U=V.indexOf('"',U+1);var X=V.substring(V.indexOf("Name=")+6,U);-1!==V.indexOf("/>")?F[X]="":F[X]=V.substring(V.indexOf(">")+1,V.indexOf("</"))}}D.push(F)}return D}function _0x402dc9(e,t,i){var r=new p$1a,n=new t$X(i.center.x,i.center.y,i.center.z),o=new e$25(i.xExtent.x,i.xExtent.y,i.xExtent.z,0),a=new e$25(i.yExtent.x,i.yExtent.y,i.yExtent.z,0),s=new e$25(i.zExtent.x,i.zExtent.y,i.zExtent.z,0);p$1a.setColumn(r,0,o,r),p$1a.setColumn(r,1,a,r),p$1a.setColumn(r,2,s,r);var l=new x$13(n,r);t._oriBoundingSphere=i$19.fromOrientedBoundingBox(l,new i$19),t._boundingSphere=i$19.transform(t._oriBoundingSphere,e._matModel,new i$19),n=y$15.multiplyByPoint(e._matModel,n,n),o=y$15.multiplyByVector(e._matModel,o,o),a=y$15.multiplyByVector(e._matModel,a,a),s=y$15.multiplyByVector(e._matModel,s,s),p$1a.setColumn(r,0,o,r),p$1a.setColumn(r,1,a,r),p$1a.setColumn(r,2,s,r),t._orientedBoundingBox=new x$13(n,r),t.obbMin=o,t.obbMax=a}function _0x4028fb(e,t){var i=new Int8Array(e);for(var r=t.split("").map((function(e){return e.charCodeAt(0)})),n=0;n<r.length;n++)i[n]=i[n]^r[n];return i.buffer}typeof WebAssembly<"u"&&e$28(_0x175ffe)&&(_0x175ffe.onRuntimeInitialized=function(){_0x3005ef=!0},_0x2d8ac2=_0x175ffe.cwrap("unzip","number",["number","number","number","number"]),_0x4b0701=_0x175ffe.cwrap("freePointer",null,["number"])),_0x151d57.prototype._updateRootBoundingSphere=function(e,t){for(var i=0,r=e.length;i<r;i++){var n=e[i],o=this._rootEntities[i];if(e$28(n.bSphere)&&n.bSphere.radius>0&&(o._boundingSphere=i$19.transform(n.bSphere,t,new i$19),e$28(n.min))){var a=[];a.push(new t$X(n.min.x,n.min.y,n.min.z)),a.push(new t$X(n.min.x,n.min.y,n.max.z)),a.push(new t$X(n.min.x,n.max.y,n.min.z)),a.push(new t$X(n.min.x,n.max.y,n.max.z)),a.push(new t$X(n.max.x,n.min.y,n.min.z)),a.push(new t$X(n.max.x,n.min.y,n.max.z)),a.push(new t$X(n.max.x,n.max.y,n.min.z)),a.push(new t$X(n.max.x,n.max.y,n.max.z));for(var s=0;s<8;s++)a[s]=y$15.multiplyByPoint(t,a[s],a[s]);o._orientedBoundingBox=x$13.fromPoints(a,o._orientedBoundingBox)}}},_0x151d57.prototype._initializeRootEntities=function(e){if(e$28(e)){this._rootNodeNameList=[];for(var t=this._layer,i=t._fileType,r=i===f$r.ClampGroundPolygon||i===f$r.ClampObjectPolygon||i===f$r.ClampGroundLine||i===f$r.ClampObjectLine,n=new t$X,o=new t$X,a=!1,s=[],l=0,u=e.length;l<u;l++){var c=e[l];let i=a$18(c.name);var h=new _0x100161;h.isVirtualNode="scp"===i,h.layer=t,h._isAncestorBlock=t._isS3MBlock,h._fileName=c.name,h._relativePath=c.relativePath,h._isRootTile=!0,h._nLODLev=0;var d=h._relativePath.toString()+h._fileName;if(this._rootNodeNameList.push(d),e$28(c.bSphere)&&c.bSphere.radius>0){if(h._originalBS=c.bSphere,h._boundingSphere=i$19.transform(c.bSphere,t._matModel,new i$19),h._oriBoundingSphere=i$19.clone(h._boundingSphere),s.push(h._boundingSphere),e$28(c.min)&&!t._isS3MBlock){var f=[];f.push(new t$X(c.min.x,c.min.y,c.min.z)),f.push(new t$X(c.min.x,c.min.y,c.max.z)),f.push(new t$X(c.min.x,c.max.y,c.min.z)),f.push(new t$X(c.min.x,c.max.y,c.max.z)),f.push(new t$X(c.max.x,c.min.y,c.min.z)),f.push(new t$X(c.max.x,c.min.y,c.max.z)),f.push(new t$X(c.max.x,c.max.y,c.min.z)),f.push(new t$X(c.max.x,c.max.y,c.max.z));for(var p=0;p<8;p++)f[p]=y$15.multiplyByPoint(t._matModel,f[p],f[p]);h._orientedBoundingBox=x$13.fromPoints(f,h._orientedBoundingBox),h.obbMin=c.min,h.obbMax=c.max,0==l?(n=c.max.clone(),o=c.min.clone()):(n.x=Math.max(n.x,c.max.x),n.y=Math.max(n.y,c.max.y),n.z=Math.max(n.z,c.max.z),o.x=Math.min(o.x,c.min.x),o.y=Math.min(o.y,c.min.y),o.z=Math.min(o.z,c.min.z),a=!0)}}else if(e$28(c.obb)){var _=c.obb,m=new p$1a,$=new t$X(_.center.x,_.center.y,_.center.z),g=new e$25(_.xExtent.x,_.xExtent.y,_.xExtent.z,0),v=new e$25(_.yExtent.x,_.yExtent.y,_.yExtent.z,0),y=new e$25(_.zExtent.x,_.zExtent.y,_.zExtent.z,0);p$1a.setColumn(m,0,g,m),p$1a.setColumn(m,1,v,m),p$1a.setColumn(m,2,y,m);var x=new x$13($,m);h._oriBoundingSphere=i$19.fromOrientedBoundingBox(x,new i$19),h._boundingSphere=i$19.transform(h._oriBoundingSphere,t._matModel,new i$19),$=y$15.multiplyByPoint(t._matModel,$,$),g=y$15.multiplyByVector(t._matModel,g,g),v=y$15.multiplyByVector(t._matModel,v,v),y=y$15.multiplyByVector(t._matModel,y,y),p$1a.setColumn(m,0,g,m),p$1a.setColumn(m,1,v,m),p$1a.setColumn(m,2,y,m),h._orientedBoundingBox=new x$13($,m),h.obbMin=g,h.obbMax=v}r&&e$28(h._boundingSphere)&&(h._boundingSphere.radius+=9e3),h._subdomainIndex=l,h.isVirtualNode?this._virtualRootTiles.push(h):this._rootEntities.push(h)}this._layer.max=n,this._layer.min=o,t._oriBoundingSphere=new i$19,a?i$19.fromCornerPoints(o,n,t._oriBoundingSphere):s.length>0&&i$19.fromBoundingSpheres(s,t._oriBoundingSphere),t._boundingSphere=i$19.transform(t._oriBoundingSphere,t._matModel,new i$19)}},_0x151d57.prototype._isRootNode=function(e){return!!e$28(this._rootNodeNameList)&&-1!==this._rootNodeNameList.indexOf(e)};var _0x460cc8=void 0;function _0x17ff81(e,t){if(e$28(e.xExtent)){var i=t$X.fromElements(e.center.x,e.center.y,e.center.z),r=e$25.fromElements(e.xExtent.x,e.xExtent.y,e.xExtent.z,0),n=e$25.fromElements(e.yExtent.x,e.yExtent.y,e.yExtent.z,0),o=e$25.fromElements(e.zExtent.x,e.zExtent.y,e.zExtent.z,0);if(e$25.equals(r,e$25.ZERO)&&(r=new e$25(1,0,0,0)),e$25.equals(n,e$25.ZERO)&&(n=new e$25(0,1,0,0)),e$25.equals(o,e$25.ZERO)&&(o=new e$25(0,0,1,0)),y$15.multiplyByPoint(t,i,i),y$15.multiplyByVector(t,r,r),y$15.multiplyByVector(t,n,n),y$15.multiplyByVector(t,o,o),e$28(_0x460cc8))_0x460cc8.center=i,_0x460cc8.halfAxes[0]=r.x,_0x460cc8.halfAxes[1]=r.y,_0x460cc8.halfAxes[2]=r.z,_0x460cc8.halfAxes[3]=n.x,_0x460cc8.halfAxes[4]=n.y,_0x460cc8.halfAxes[5]=n.z,_0x460cc8.halfAxes[6]=o.x,_0x460cc8.halfAxes[7]=o.y,_0x460cc8.halfAxes[8]=o.z,_0x460cc8.areaDirty=1;else{var a=new p$1a(r.x,n.x,o.x,r.y,n.y,o.y,r.z,n.z,o.z);_0x460cc8=new x$13(i,a)}_0x460cc8._updateBBox();var s=t$X.distance(_0x460cc8.center,_0x460cc8.bbox[0]);return m=new i$19(_0x460cc8.center,s)}var l=e.min.x,u=e.min.y,c=e.min.z,h=e.max.x,d=e.max.y,f=e.max.z,p=new t$X(l,u,c),_=new t$X(h,d,f),m=new i$19;return i$19.fromCornerPoints(p,_,m),i$19.transform(m,t,m),m}function _0xe514f2(e,t){var i,r=[];r.push(new t$X(e.min.x,e.min.y,e.min.z)),r.push(new t$X(e.min.x,e.min.y,e.max.z)),r.push(new t$X(e.min.x,e.max.y,e.min.z)),r.push(new t$X(e.min.x,e.max.y,e.max.z)),r.push(new t$X(e.max.x,e.min.y,e.min.z)),r.push(new t$X(e.max.x,e.min.y,e.max.z)),r.push(new t$X(e.max.x,e.max.y,e.min.z)),r.push(new t$X(e.max.x,e.max.y,e.max.z));for(var n=0;n<8;n++)r[n]=y$15.multiplyByPoint(t,r[n],r[n]);return i=x$13.fromPoints(r,i)}function _0x2bb67e(e,t,i,r,n,o){if(e$28(r)){var a=new _0x100161;if(i._entity=a,a._parent=t,a._relativePath=o,a._boundingSphere=i._boundingSphere,a._orientedBoundingBox=i._orientedBoundingBox,a._fileName=r.modelPath,a._fileName=a._fileName.replace(/.s3mb*|.s3m*../g,""),a._parentPagelod=i,a._depth=i._depth+1,a._index=t._childrenPageLod.length-1,a._rootName=t._rootName,a._subdomainIndex=t._subdomainIndex+a._index+1,a._indexFilePath=r.indexFilePath,e$28(r.state)&&"PartLeaf"===r.state&&(a._hasLeafChild=!0),e$28(r.state)&&"AllLeaf"===r.state)return void(a._isLeafTile=!0);if(e$28(r.indexFilePath))return void(a._hasConfig=!0);var s=r.children;if(!e$28(s))return a._isLeafTile=!0,void(a._boundingSphere=void 0);for(var l=0,u=s.length;l<u;l++){var c=s[l];if(e$28(c.tileInfo)){if(""===c.tileInfo.modelPath){a._hasLeafChild=!0;continue}var h=new _0x575d8a;if(h._fileType=e._fileType,h._rangeList=c.tileInfo.rangeValue,h._rangeDataList=c.tileInfo.modelPath,h._rangeDataList=h._rangeDataList.replace(/.s3mb*|.s3m*../g,""),0===h._rangeDataList.indexOf("./")&&(h._rangeDataList=h._rangeDataList.substring(2)),"pixelSizeOnScreen"===c.tileInfo.rangeMode?h._rangeMode=_0x189b29.PIXEL_SIZE_ON_SCREEN:"geometricError"===c.tileInfo.rangeMode&&(h._rangeMode=_0x189b29.GEOMETRY_ERROR),c.tileInfo.boundingBox.xExtent){var d=c.tileInfo.boundingBox,f=t$X.fromElements(d.center.x,d.center.y,d.center.z),p=e$25.fromElements(d.xExtent.x,d.xExtent.y,d.xExtent.z,0),_=e$25.fromElements(d.yExtent.x,d.yExtent.y,d.yExtent.z,0),m=e$25.fromElements(d.zExtent.x,d.zExtent.y,d.zExtent.z,0);e$25.equals(p,e$25.ZERO)&&(p=new e$25(1,0,0,0)),e$25.equals(_,e$25.ZERO)&&(_=new e$25(0,1,0,0)),e$25.equals(m,e$25.ZERO)&&(m=new e$25(0,0,1,0));var $=new p$1a(p.x,_.x,m.x,p.y,_.y,m.y,p.z,_.z,m.z);h._orientedBoundingBox=new x$13(f,$),h._orientedBoundingBox._updateBBox(),h.min=h._orientedBoundingBox.bbox[0].clone(),h.max=h._orientedBoundingBox.bbox[0].clone();for(var g,v=1;v<8;v++)g=h._orientedBoundingBox.bbox[v],h.min.x>g.x&&(h.min.x=g.x),h.min.y>g.y&&(h.min.y=g.y),h.min.z>g.z&&(h.min.z=g.z),h.max.x<g.x&&(h.max.x=g.x),h.max.y<g.y&&(h.max.y=g.y),h.max.z<g.z&&(h.max.z=g.z);var y=t$X.distance(h._orientedBoundingBox.center,h._orientedBoundingBox.bbox[0]);y$15.multiplyByPoint(n,f,f),y$15.multiplyByVector(n,p,p),y$15.multiplyByVector(n,_,_),y$15.multiplyByVector(n,m,m),h._orientedBoundingBox.center=f,h._orientedBoundingBox.halfAxes[0]=p.x,h._orientedBoundingBox.halfAxes[1]=p.y,h._orientedBoundingBox.halfAxes[2]=p.z,h._orientedBoundingBox.halfAxes[3]=_.x,h._orientedBoundingBox.halfAxes[4]=_.y,h._orientedBoundingBox.halfAxes[5]=_.z,h._orientedBoundingBox.halfAxes[6]=m.x,h._orientedBoundingBox.halfAxes[7]=m.y,h._orientedBoundingBox.halfAxes[8]=m.z,h._orientedBoundingBox.areaDirty=1,h._boundingSphere=new i$19(f,y)}else h._boundingSphere=_0x17ff81(c.tileInfo.boundingBox,n),h._orientedBoundingBox=_0xe514f2(c.tileInfo.boundingBox,n),h.max=t$X.fromElements(c.tileInfo.boundingBox.max.x,c.tileInfo.boundingBox.max.y,c.tileInfo.boundingBox.max.z),h.min=t$X.fromElements(c.tileInfo.boundingBox.min.x,c.tileInfo.boundingBox.min.y,c.tileInfo.boundingBox.min.z);h._parent=a._parentPagelod,h._depth=a._depth,(!e$28(r.state)||"AllLeaf"!=r.state)&&(a._childrenPageLod.push(h),a._pagelodMap[h._rangeDataList]=h,_0x2bb67e(e,a,h,c.tileInfo,n,o))}}}}function _0x3f9ae0(e){1==e._childrenPageLod.length?_0x3f9ae0(e._childrenPageLod[0]._entity):e._needLoad=!0}function _0x32ba9e(e,t,i){var r=i._matModel;t._configReady=!0,t._configLoadState=I$F.LOADED;var n=t._relativePath;if(e$28(e.lodTreeExport.tileInfo.children))for(var o=0,a=e.lodTreeExport.tileInfo.children.length;o<a;o++){t._boundingSphere=_0x17ff81(e.lodTreeExport.tileInfo.boundingBox,r);var s=e.lodTreeExport.tileInfo.children[o];if(e$28(s.tileInfo)&&(""===s.tileInfo.modelPath&&(t._hasLeafChild=!0),""!==s.tileInfo.modelPath)){var l=new _0x575d8a;if(l._fileType=i._fileType,l._rangeList=s.tileInfo.rangeValue,l._rangeDataList=s.tileInfo.modelPath,l._rangeDataList=l._rangeDataList.replace(/.s3mb*/g,""),0===l._rangeDataList.indexOf("./")&&(l._rangeDataList=l._rangeDataList.substring(2)),"pixelSizeOnScreen"===s.tileInfo.rangeMode?l._rangeMode=_0x189b29.PIXEL_SIZE_ON_SCREEN:"geometricError"===s.tileInfo.rangeMode&&(l._rangeMode=_0x189b29.GEOMETRY_ERROR),s.tileInfo.boundingBox.xExtent){var u=s.tileInfo.boundingBox,c=t$X.fromElements(u.center.x,u.center.y,u.center.z),h=e$25.fromElements(u.xExtent.x,u.xExtent.y,u.xExtent.z,0),d=e$25.fromElements(u.yExtent.x,u.yExtent.y,u.yExtent.z,0),f=e$25.fromElements(u.zExtent.x,u.zExtent.y,u.zExtent.z,0);e$25.equals(h,e$25.ZERO)&&(h=new e$25(1,0,0,0)),e$25.equals(d,e$25.ZERO)&&(d=new e$25(0,1,0,0)),e$25.equals(f,e$25.ZERO)&&(f=new e$25(0,0,1,0));var p=new p$1a(h.x,d.x,f.x,h.y,d.y,f.y,h.z,d.z,f.z);l._orientedBoundingBox=new x$13(c,p),l._orientedBoundingBox._updateBBox(),l.min=l._orientedBoundingBox.bbox[0].clone(),l.max=l._orientedBoundingBox.bbox[0].clone();for(var _,m=1;m<8;m++)_=l._orientedBoundingBox.bbox[m],l.min.x>_.x&&(l.min.x=_.x),l.min.y>_.y&&(l.min.y=_.y),l.min.z>_.z&&(l.min.z=_.z),l.max.x<_.x&&(l.max.x=_.x),l.max.y<_.y&&(l.max.y=_.y),l.max.z<_.z&&(l.max.z=_.z);var $=t$X.distance(l._orientedBoundingBox.center,l._orientedBoundingBox.bbox[0]);y$15.multiplyByPoint(r,c,c),y$15.multiplyByVector(r,h,h),y$15.multiplyByVector(r,d,d),y$15.multiplyByVector(r,f,f),l._orientedBoundingBox.center=c,l._orientedBoundingBox.halfAxes[0]=h.x,l._orientedBoundingBox.halfAxes[1]=h.y,l._orientedBoundingBox.halfAxes[2]=h.z,l._orientedBoundingBox.halfAxes[3]=d.x,l._orientedBoundingBox.halfAxes[4]=d.y,l._orientedBoundingBox.halfAxes[5]=d.z,l._orientedBoundingBox.halfAxes[6]=f.x,l._orientedBoundingBox.halfAxes[7]=f.y,l._orientedBoundingBox.halfAxes[8]=f.z,l._orientedBoundingBox.areaDirty=1,l._boundingSphere=new i$19(c,$)}else l._boundingSphere=_0x17ff81(s.tileInfo.boundingBox,r),l._orientedBoundingBox=_0xe514f2(s.tileInfo.boundingBox,r),l.max=t$X.fromElements(s.tileInfo.boundingBox.max.x,s.tileInfo.boundingBox.max.y,s.tileInfo.boundingBox.max.z),l.min=t$X.fromElements(s.tileInfo.boundingBox.min.x,s.tileInfo.boundingBox.min.y,s.tileInfo.boundingBox.min.z);l._parent=void 0,l._depth=t._depth,t._childrenPageLod.push(l),t._pagelodMap[l._rangeDataList]=l,e$28(t._parent)?t._rootName=t._parent._rootName:t._rootName=t._fileName,l._rootName=t._rootName,_0x2bb67e(i,t,l,s.tileInfo,r,n)}}t._isRootTile&&_0x3f9ae0(t)}function _0x23baa9(e,t){var i=u$Y(e._indexFilePath,e._fileName);i=i.replace(".json","");var r,n,o=e._relativePath.resolve(t._baseUri)+i+".json";(o=o.replace(/\+/g,"%2B"),e$28(t._wstTaskProcessor))?(n=t._isS3MBlock?o.substring(o.indexOf("data/path/")+9):o.substring(o.indexOf("/data/")+5),n=decodeURIComponent(n),r=t._wstTaskProcessor.scheduleTask({data:n,dataType:"json"})):(e$28(a$Y.CREDENTIAL)&&(o=e$28(a$Y.CREDENTIAL._keymap[this._scpUrl])?a$Y.addTokenWithKey(this._scpUrl,o):a$Y.addToken(o)),r=u$O(o,void 0,new r$1c({url:o,throttle:!1,throttleByServer:!0,serverKey:r$1b.getServerKey(o)})));e$28(r)&&(e._configLoadState=I$F.LOADING,r.then((function(i){e._needLoad=!1,_0x32ba9e(i,e,t);var r={blob:i,key:e._relativePath.toString()+e._fileName+".json",tablename:t._layerScheduler.tablename,dbname:t._layerScheduler._indexedDBScheduler.dbname};_0x333f13.indexTaskProcessor.scheduleTask(r,[])}),(function(t){e$28(t)?e._configLoadState=I$F.FAILED:e._configLoadState=I$F.UNLOAD})))}function _0x422f2e(e,t,i){const r=e._layer;let n=i.rootTiles,o=/\\+/g;for(let i=0,a=n.length;i<a;i++){let a=n[i],s=new _0x100161;s._parent=t,s.layer=r,s._isAncestorBlock=r._isS3MBlock;let l=a.url;l=l.replace("../","./"),l=l.replace(o,"/"),l=l.replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)|(\.osgb)/gi,"");let u=i$18(l);s._fileName=f$V(l),s._relativePath=new h$$(u),s._isRootTile=!0,s._nLODLev=0;let c=a.boundingbox;e$28(c)&&_0x402dc9(r,s,c),s._subdomainIndex=i,e._rootEntities.push(s)}}_0x151d57.prototype.loadConfig=function(e){if(e._configLoadState===I$F.UNLOAD){var t=this._layer,i=u$Y(e._indexFilePath,e._fileName);i=i.replace(".json","");var r=e._relativePath.toString()+i+".json";if(e$28(window.Proxy)&&(!0===this._indexedDBSetting.isGeoTilesSave||this._indexedDBSetting.isGeoTilesRootNodeSave&&this._isRootNode(r)))if(e$28(this._indexedDBScheduler)){var n=this._indexedDBScheduler.getElementFromDB(this.tablename,r);e$28(n)?(e._configLoadState=I$F.LOADING,n.then((function(i){e$28(i)?_0x32ba9e(i,e,t):(e._configLoadState=I$F.UNLOAD,_0x23baa9(e,t))}),(function(i){e._configLoadState=I$F.UNLOAD,_0x23baa9(e,t)}))):(e._configLoadState=I$F.UNLOAD,_0x23baa9(e,t))}else _0x23baa9(e,t);else _0x23baa9(e,t)}},_0x151d57.prototype.loadEntity=function(e){var t=e._s3mLoadState,i=this._layer;this._cacheKey;var r,n,o,a,s=this;if(_0x1ea9dc(e,i._frameState))if(e.isVirtualNode){if(!e.configLoading){let t=e._relativePath.resolve(i._baseUri)+e._fileName,r=t$S.createIfNeeded(t);e.configLoading=!0,r.fetchJson().then((t=>{e._ready=!0,_0x422f2e(this,e,t)}))}}else{if(I$F.UNLOAD===t)if(i._isS3MBlock&&i._blockCache.contains(i._id,e._blockKey))e.s3mBuffer=i._blockCache.get(i._id,e._blockKey),t=e._s3mLoadState=I$F.LOADED;else{if(!e$28(e.request)){var l=".s3m",u="s3m";i._isS3MBlock?l=".s3mblock":i._isS3MB?(l=i._isS3MZ?".s3mbz":".s3mb",u=i._isS3MZ?"s3mbz":"s3mb"):i._isOSGB&&(l=".osgb",l=".osgb"),e._fileName=e._fileName.replace(/\0/,"");var c=e._relativePath.resolve(i._baseUri)+e._fileName+l;if(i.subdomains&&(c=c.replace(/(.*realspace)/,i._subdomainsUrlScheme)),c=c.replace(/\+/g,"%2B"),i._urlType===fi$5.KEY_VALUE){r=e._relativePath.path.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,""),n=i._urlArguments;var h={layerName:i.name,rootTile:r,tile:e._fileName,suffix:u};o=m$1k(h=Object.assign(h,n),!0),(a=c.match(/(\S*)\/datas/)).length>0&&(c=a[0]+"?"+o)}e.request=new r$1c({url:c,throttle:!0,throttleByServer:!0,serverKey:r$1b.getServerKey(c),priorityFunction:this.createPriorityFunction(e,this)})}var d=e._relativePath.toString()+e._fileName;if(e$28(window.Proxy)&&(!0===this._indexedDBSetting.isGeoTilesSave||this._indexedDBSetting.isGeoTilesRootNodeSave&&this._isRootNode(d)))if(e$28(this._indexedDBScheduler)&&this._indexedDBRequestNum<this._indexedDBRequestLimit){this._indexedDBRequestNum++;s=this;var f=this._indexedDBScheduler.getElementFromDB(this.tablename,d);e$28(f)?(e._s3mLoadState=I$F.LOADING,f.then((function(t){s._indexedDBRequestNum--,e$28(t)?(e._s3mLoadState=I$F.PARSING,e.s3mBuffer=null,e.volBuffer=null,i._isS3MB?i._isS3MBlock?_0x1eccda.parseChildGroup(t,s._layer,e):_0x1eccda.parseResult(t,s._layer,e):_0x27cba5.parseResult(t,s._layer,e,e.volBuffer)):(e._s3mLoadState=I$F.UNLOAD,_0x14d00d(e,s))}),(function(t){s._indexedDBRequestNum--,e._s3mLoadState=I$F.UNLOAD,_0x14d00d(e,s)}))):(this._indexedDBRequestNum--,e._s3mLoadState=I$F.UNLOAD,_0x14d00d(e,s))}else _0x14d00d(e,s);else this._packingRequest?this._packRequestEntities.push(e):_0x14d00d(e,s)}if(I$F.PARSING===t&&"InstanceModel"===i._dataType&&(e.skeletonState===_0x4a5bf1.STATE.SkeletonParsing?_0x4a5bf1.parse(i,e):e.skeletonState===_0x4a5bf1.STATE.SkeletonReady&&_0x1eccda.parseResultInstance(i,e)),I$F.PARSING===t&&e$28(e.parsingResult)&&(i._isS3MB?i._isS3MBlock?_0x1eccda.parseChildGroup(e.parsingResult,i,e):_0x1eccda.parseResult(e.parsingResult,i,e):_0x27cba5.parseResult(e.parsingResult,i,e,e.volBuffer)),I$F.LOADED===t&&(!1!==i._bVolume&&i.loadVolumeData?e._s3mLoadState===I$F.LOST?e._s3mLoadState=I$F.UNLOAD:e._s3mLoadState=I$F.LOADVOL:this._packingRequest?this._parsingEntities.push(e):i._isS3MB||i._isOSGB?_0x1eccda.binaryDataParser(i,e,e.s3mBuffer,e.volBuffer):_0x27cba5.binaryDataParser(i,e,e.s3mBuffer,e.volBuffer),i._S3MTileLoadedEvent.raiseEvent(e._boundingSphere)),I$F.PARSED===t&&e.transformResource(i._frameState,i,Number.MAX_VALUE),I$F.LOADVOL===t&&"vol"===i._strVolumeExt){var p,_,m;if(""===i._volName?(p=e._relativePath.resolve(i._baseUri)+e._fileName+"."+i._strVolumeExt,_=e._fileName):(p=e._relativePath.resolve(i._baseUri)+e._fileName+"_"+i._volName+"."+i._strVolumeExt,_=e._fileName+"_"+i._volName),i._urlType===fi$5.KEY_VALUE){r=e._relativePath.path.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,""),n=i._urlArguments;h={layerName:i.name,rootTile:r,tile:_,suffix:i._strVolumeExt};o=m$1k(h=Object.assign(h,n),!0),(a=p.match(/(\S*)\/datas/)).length>0&&(p=a[0]+"?"+o)}e$28(a$Y.CREDENTIAL)&&(p=e$28(a$Y.CREDENTIAL._keymap[this._scpUrl])?a$Y.addTokenWithKey(this._scpUrl,p):a$Y.addToken(p)),e$28(e.request)||(e.request=new r$1c({url:p,throttle:!0,throttleByServer:!0,serverKey:r$1b.getServerKey(p),priorityFunction:this.createPriorityFunction(e,this)})),e$28(m="png"===i._strVolumeExt?t$D(e.request.url,this._customRequestHeaders,e.request):o$$(e.request.url,this._customRequestHeaders,e.request))&&(e._s3mLoadState=I$F.LOADING,this._statistics.numberOfPendingRequests++,e.request=null,m.then((function(t){e._s3mLoadState=I$F.VOLLOADED,"png"===i._strVolumeExt?e.volImage=t:e.volBuffer=t,s._statistics.numberOfPendingRequests--,s._statistics.numberOfProcessingAttempted++}),(function(t){e$28(t)?(s._statistics.numberOfPendingRequests--,e._s3mLoadState=I$F.VOLFAILED):(s._statistics.numberOfAttemptedRequests++,s._statistics.numberOfPendingRequests--,e._s3mLoadState=I$F.LOADVOL)})))}else I$F.LOADVOL===t&&("png"===i._strVolumeExt||"vol_texture_mapping"===i._strVolumeExt)&&(e._s3mLoadState=I$F.VOLLOADED);(I$F.VOLLOADED===t||I$F.VOLFAILED===t)&&e$28(e.s3mBuffer)&&("png"===i._strVolumeExt||"vol_texture_mapping"===i._strVolumeExt?i._isS3MB?_0x1eccda.binaryDataParser(i,e,e.s3mBuffer,e.volImage):_0x27cba5.binaryDataParser(i,e,e.s3mBuffer,e.volImage):i._isS3MB?_0x1eccda.binaryDataParser(i,e,e.s3mBuffer,e.volBuffer):_0x27cba5.binaryDataParser(i,e,e.s3mBuffer,e.volBuffer))}else this._statistics.numberOfAttemptedRequests++},_0x151d57.prototype.reloadVol=function(e){var t,i,r,n,o=this._layer;if(this._cacheKey,"vol"===o._strVolumeExt){var a,s,l;if(""===o._volName?(a=e._relativePath.resolve(o._baseUri)+e._fileName+"."+o._strVolumeExt,s=e._fileName):(a=e._relativePath.resolve(o._baseUri)+e._fileName+"_"+o._volName+"."+o._strVolumeExt,s=e._fileName+"_"+o._volName),o._urlType===fi$5.KEY_VALUE){t=e._relativePath.path.replace(/\//g,"").replace(".",""),i=o._urlArguments;var u={layerName:o.name,rootTile:t,tile:s,suffix:o._strVolumeExt};r=m$1k(u=Object.assign(u,i),!0),(n=a.match(/(\S*)\/datas/)).length>0&&(a=n[0]+"?"+r)}if(e$28(a$Y.CREDENTIAL)&&(a=e$28(a$Y.CREDENTIAL._keymap[this._scpUrl])?a$Y.addTokenWithKey(this._scpUrl,a):a$Y.addToken(a)),e$28(e.request)||(e.request=new r$1c({url:a,throttle:!0,throttleByServer:!0,serverKey:r$1b.getServerKey(a),priorityFunction:this.createPriorityFunction(e,this)})),l="png"===o._strVolumeExt?t$D(e.request.url,this._customRequestHeaders,e.request):o$$(e.request.url,this._customRequestHeaders,e.request),this._statistics.numberOfColorChangeProcessing++,e$28(l)){e.request=null,e._reloadVol=!1,this._statistics.numberOfColorChangePending++;var c=this;l.then((function(t){if(c._statistics.numberOfColorChangePending--,"vol"===o._strVolumeExt&&e$28(t)&&t.byteLength>7&&e$28(e._volObj)){var i,r=new Uint8Array(t,8);i=null!=_0x2d8ac2?_0x7eeaae(r):nt$c.inflate(r).buffer;var n=new Float64Array(i,0,1),a=new Uint32Array(i,48,1);if(0===n[0]||3200===a[0]||3201===a[0]){var s=0;0===n[0]&&(s=8);var l=new Float64Array(i,s,6),u=l[0],h=l[1],d=l[2],f=l[3],p=l[4]<l[5]?l[4]:l[5],_=l[4]>l[5]?l[4]:l[5],m={left:u,top:h,right:d,bottom:f,minHeight:p,maxHeight:_,width:d-u,length:h-f,height:_-p},$=new Uint32Array(i,48+s,7),g=$[0],v=$[1],y=$[2],x=$[3],b={nFormat:g,nSideBlockCount:v,nBlockLength:y,nLength:x,nWidth:$[4],nHeight:$[5],nDepth:$[6],imageArray:new Uint8Array(i,76+s,x*x*4)},w=o._context._id+"_"+o.id+"_"+e._relativePath.resolve(o._baseUri)+"_"+e._fileName,C=k$T.FilterMode.LINEAR;e$28(o._hypsometricSetting)&&o._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(C=k$T.FilterMode.NEAREST),3201===b.nFormat&&e$28(o._hypsometricSetting)&&_0x27cba5.convertFloat(b,o._hypsometricSetting,C);var T=Se$8.ReloadVolumeTexture(w,o._gl,o._context,b,C);e._volObj.volTexture=T,e._volObj.nFormat=b.nFormat,e._volObj.nSideBlockCount=b.nSideBlockCount,e._volObj.nBlockLength=b.nBlockLength,e._volObj.nLength=b.nLength,e._volObj.nWidth=b.nWidth,e._volObj.nHeight=b.nHeight,e._volObj.nDepth=b.nDepth,e._volObj.id=w,e._volObj.dataFloor=o._fMinValue,e._volObj.dataCeil=o._fMaxValue,e._volObj.volBounds=m}}c._statistics.numberOfColorChangeProcessing--}),(function(t){e$28(t)||(c._statistics.numberOfColorChangeAttempted++,e._reloadVol=!0),c._statistics.numberOfColorChangePending--,c._statistics.numberOfColorChangeProcessing--}))}else this._statistics.numberOfColorChangeProcessing--}},_0x151d57.prototype.reloadVolMapping=function(e){var t=this._layer;if("vol_texture_mapping"===t._strVolumeExt){var i=t._context;for(var r in e._volTextures){this._statistics.numberOfColorChangeProcessing++;var n=r,o=e._volTextures[n],a=t._id+i._id,s=n.substring(0,n.length-a.length)+"_"+e._fileName;s=""!==t._volName?s+"_"+t._volName:s,s+=".vol";var l=e._relativePath.resolve(t._baseUri)+s;if(0!=t.urlType){var u=t._urlArguments,c=l.indexOf("datas")+5,h=u.layer3DName,d=l.substring(l.indexOf("/path/")+6).split("/"),f=d[0],p=d[1].substring(0,d[1].indexOf(".")),_=d[1].substring(d[1].indexOf(".")+1,d[1].length);for(var r in l=l.substring(0,c)+"?layerName="+h+"&rootTile="+f+"&tile="+p+"&suffix="+_,u)l=l+"&"+r+"="+u[r]}var m=o$$(l,this._customRequestHeaders);if(e$28(m)){this._statistics.numberOfColorChangePending++;var $=this;m.then((function(i){if($._statistics.numberOfColorChangePending--,e$28(i)){var r,n=void 0,a=new Uint8Array(i,8);if(r=null!=_0x2d8ac2?_0x7eeaae(a):nt$c.inflate(a).buffer,1===new Float64Array(r,0,1)[0]){var s=new Uint32Array(r,8,4),l=s[0],u=s[1],c=s[2];n={nFormat:l,nWidth:u,nHeight:c,nPixelSize:s[3],imageArray:new Float32Array(r,24,u*c)}}if(e$28(n)){var h=_0x27cba5.convertFloatTexture(n,t._hypsometricSetting,t._hypsometricSetting.filterMode);o.copyFrom({width:n.nWidth,height:n.nHeight,arrayBufferView:h})}$._statistics.numberOfColorChangeProcessing--,i=null,e._reloadVol=!1}}),(function(e){$._statistics.numberOfColorChangePending--,$._statistics.numberOfColorChangeAttempted++,$._statistics.numberOfColorChangeProcessing--}))}else this._statistics.numberOfColorChangeProcessing--}}},_0x151d57.prototype.dealWithPrepareLoad=function(e){if(this._requestByteLength+=e,this._requestByteLength>this._layer._prepareLoadSize)this._layer._prepareLoadEvent.raiseEvent(100),this._prepareLoaded=!0,this.refreshPrepareLoad();else{var t=Math.floor(100*this._requestByteLength/this._layer._prepareLoadSize);t>this._prepareRatio&&(this._prepareRatio=t,this._layer._prepareLoadEvent.raiseEvent(t))}};var _0x4d7852=/({.*?})/g;function _0x14d00d(e,t){var i,r=e.request.url;if(e$28(t._layer._wstTaskProcessor)){var n;n=t._layer._isS3MBlock?e.request.url.substring(e.request.url.indexOf("data/path/")+9):e.request.url.substring(e.request.url.indexOf("/data/")+5),n=decodeURIComponent(n),i=t._layer._wstTaskProcessor.scheduleTask({dataType:"arraybuffer",data:n})}else{if(e$28(t._layer._subdomains)){var o=t._layer._subdomains,a=o[e._subdomainIndex%o.length];r=r.replace(_0x4d7852,(function(e,t){return"{s}"===t?a:e}))}e$28(a$Y.CREDENTIAL)&&(r=e$28(a$Y.CREDENTIAL._keymap[r])?a$Y.addTokenWithKey(t._scpUrl,r):a$Y.addToken(r)),i=o$$(r,t._customRequestHeaders,e.request)}e$28(i)?(e._s3mLoadState=I$F.LOADING,t._statistics.numberOfPendingRequests++,i.then((function(i){if(e$28(t._layer._wstTaskProcessor)&&(!e$28(i)||!e._isVisible||!to.update(t._layer._context.memorySize)))return e._s3mLoadState=I$F.UNLOAD,void(e.request=null);t._prepareLoaded||t.dealWithPrepareLoad(i.byteLength),e.request=null,t._statistics.numberOfPendingRequests--,e._s3mLoadState===I$F.LOADING&&(t._layer._isS3MBlock&&t._layer._blockCache.set(t._layer._id,e._blockKey,i),0!=t._cacheKey.length?e.s3mBuffer=_0x4028fb(i,t._cacheKey):e.s3mBuffer=i,e._s3mLoadState=I$F.LOADED,t._statistics.numberOfProcessingAttempted++)}),(function(i){e.request=null,e$28(i)?(t._statistics.numberOfPendingRequests--,e._s3mLoadState=I$F.FAILED):(t._statistics.numberOfAttemptedRequests++,t._statistics.numberOfPendingRequests--,e._s3mLoadState=I$F.UNLOAD)}))):e.request=null}function _0x19cdd4(e,t){if(e$28(t._cartographic))if(e instanceof Array){for(var i=[],r=0;r<e.length;r++){var n=e[r];if(e$28(n)&&(n instanceof h$p||n instanceof i$o)){var o=n.getImagery(t._cartographic);i=i.concat(o)}}i.length>0&&(t.setImagerys(i,t._cartographic),t._imageRasterFinish=!1,t._imageryLevels=[])}else{if(e$28(e)&&(e instanceof h$p||e instanceof i$o))(i=e.getImagery(t._cartographic)).length>0&&(t.setImagerys(i,t._cartographic),t._imageRasterFinish=!1,t._imageryLevels=[])}}function _0x4a6650(e){const t=e._layer,i=t.attrDatas;if(!e$28(i)||0===i.length)return;const r=t._fieldsInfo,n="attribute"===t._attributeExtentName?".attribute":t._isS3MB?".s3md":".scvd",o=performance.now();for(;i.length;){if(_0x325586(_0x482882(i.pop(),n,r),e),performance.now()-o>10)break}}function _0x5435b6(e){const t=e._layer,i=t.attrDatas,r=e._savetoIndexDBDatas;if(e$28(i)&&0===i.length&&0!==r.length&&0===i.length){e._attrloaded||(e._attrloaded=!0,t.attributeDownloaded.raiseEvent(t.name+" attribute downloaded."));const i=performance.now();for(;r.length;){if(_0x509fc4(e,r.pop()),performance.now()-i>1)break}}}function _0x2b8562(e,t){var i=e._layer,r=e._statistics,n=e._statisticsLastRender,o=r.numberOfPendingRequests,a=r.numberOfTilesProcessing,s=n.numberOfPendingRequests,l=n.numberOfTilesProcessing,u=o!==s||a!==l,c=0===r.numberOfPendingRequests&&0===r.numberOfTilesProcessing&&0===r.numberOfAttemptedRequests&&0===r.numberOfProcessingAttempted;i._tilesLoaded=c&&r.numberOfCommands>0;var h=r.numberOfColorChangePending,d=n.numberOfColorChangePending,f=r.numberOfColorChangeProcessing,p=n.numberOfColorChangeProcessing,_=(h!==d||f!==p)&&0===r.numberOfColorChangeAttempted&&0===h&&0===f;u&&i._tilesLoaded&&t.afterRender.push((function(){e._layer._allTilesLoaded.raiseEvent()})),Date.now()-r.lastColorChangeTrigger.time>2e3&&r.lastColorChangeTrigger.done&&t.afterRender.push((function(){e._layer._colorTableChanged.raiseEvent(),r.lastColorChangeTrigger.done=!1})),_&&c&&(r.lastColorChangeTrigger.done=!0,r.lastColorChangeTrigger.time=Date.now()),e._statisticsLastRender=p$17({},e._statistics)}_0x151d57.prototype._clearIndexedDBCache=function(){e$28(this._indexedDBScheduler)&&this._indexedDBScheduler.clear(this.tablename)},_0x151d57.prototype._refreshVolume=function(){if(this._layer._bVolume){var e=[],t={};if("vol"===this._layer._strVolumeExt){for(var i=0,r=this._rootEntities.length;i<r;i++){e$28(n=this._rootEntities[i])&&e$28(n._fileName)&&(t[n._relativePath.resolve(this._layer._baseUri)+n._fileName]=n,e.push(n))}for(;s=e.pop();)for(i=0,r=s._childrenPageLod.length;i<r;i++){if(e$28((o=s._childrenPageLod[i])._entity)&&e$28(o._entity._fileName))e$28(t[u=o._entity._relativePath.resolve(this._layer._baseUri)+o._entity._fileName])||(t[u]=o._entity),e.push(o._entity)}}else if("vol_texture_mapping"===this._layer._strVolumeExt){for(i=0,r=this._rootEntities.length;i<r;i++){var n;e$28((n=this._rootEntities[i])._volTextures)&&(t[n.name]=n,e.push(n))}for(;s=e.pop();)for(i=0,r=s._childrenPageLod.length;i<r;i++){var o;e$28((o=s._childrenPageLod[i])._entity)&&e$28(o._entity._volTextures)&&(t[n.name]=o._entity,e.push(o._entity))}}if(this._layer._refreshVolume)for(var a in this._layer._refreshVolume=!1,t)t[a]._reloadVol=!0;if("vol"===this._layer._strVolumeExt)for(var a in t){var s;if(e$28(s=t[a])&&s._isParsed&&e$28(s._volObj)&&s._reloadVol){var l=this._layer,u=l._context._id+"_"+l.id+"_"+s._relativePath.resolve(l._baseUri)+"_"+s._fileName;s._volObj.id==u&&this.reloadVol(s)}}else if("vol_texture_mapping"===this._layer._strVolumeExt)for(var a in t)t[a]._reloadVol&&this.reloadVolMapping(t[a]);e.length=0,t=[]}},_0x151d57.prototype._refreshImage=function(){if(e$28(this._layer._imageryLayer)){for(var e=[],t={},i=0;i<this._rootEntities.length;i++){var r=this._rootEntities[i];if(e$28(r)&&e$28(r._fileName))for(var n=0;n<r._childrenPageLod.length;n++)for(var o=r._childrenPageLod[n],a=0;a<o._renderEntityList.length;a++){_0x19cdd4(this._layer._imageryLayer,o._renderEntityList[a]);for(var s=o._renderEntityList[a]._imagerys.length,l=0;l<s;l++){for(var u=o._renderEntityList[a]._imagerys[l];e$28(u.parent)&&u.level>u.imageryLayer._imageryProvider.minimumLevel&&!(u=u.parent).rectangle.contains(this._layer.layerBounds););t[JSON.stringify([u.x,u.y,u.level,u.imageryLayer._layerIndex])]=u}e$28(o._entity)&&e$28(o._entity._fileName)&&e.push(o._entity)}}for(var c in t)t[c].processStateMachine(this._layer._frameState,!1);for(var h;h=e.pop();)for(i=0,n=h._childrenPageLod.length;i<n;i++){for(o=h._childrenPageLod[i],a=0;a<o._renderEntityList.length;a++)_0x19cdd4(this._layer._imageryLayer,o._renderEntityList[a]);e$28(o._entity)&&e$28(o._entity._fileName)&&e.push(o._entity)}e.length=0}},_0x151d57.prototype._hideImage=function(e){if(e$28(this._layer._imageryLayer)){for(var t=[],i=0,r=this._rootEntities.length;i<r;i++){var n=this._rootEntities[i];e$28(n)&&e$28(n._fileName)&&t.push(n)}for(var o;o=t.pop();)for(i=0,r=o._childrenPageLod.length;i<r;i++){for(var a=o._childrenPageLod[i],s=0;s<a._renderEntityList.length;s++)a._renderEntityList[s]._showImagerysImmediate=!1;e$28(a._entity)&&e$28(a._entity._fileName)&&t.push(a._entity)}t.length=0}},_0x151d57.prototype.update=function(e,t,i){this._updateSceneMode(t.camera);var r=t.passes.pick;this._statistics.numberOfAttemptedRequests=0,this._statistics.numberOfColorChangeAttempted=0,!r&&!t._fboState.enabled&&(this.LoadingPriority===U$p.UsePagedLodInfo?this._scheduleSkip(t):this._schedule(t)),this._refreshVolume(),this._updatePolygons(),this._updateRenderQueue(e,t,i),_0x4a6650(this),_0x5435b6(this)},_0x151d57.prototype.postPassesUpdate=function(e){_0x2b8562(this,e)},_0x151d57.prototype._updateRenderQueue=function(e,t,i){var r=this.LoadingPriority===U$p.UsePagedLodInfo&&this._layer._hasMixedContent&&t.context.stencilBuffer,n=i.length;if(this._layer._fileType===f$r.ClampGroundRealtimeRasterCache){var o=!1;this._rasterFrequency++,40==this._rasterFrequency&&(o=!0,this._rasterFrequency=0),t.rasterPerFrame=this._layer.rasterPerFrame;for(var a=0,s=this._renderQueue.length;a<s;a++){(h=this._renderQueue[a]).initialize(),h.createResources(t,this._layer),(h._rasterized||o)&&h.pushCommands(t,i,this._layer)}}else{var l=[];for(a=0,s=this._renderQueue.length;a<s;a++){(h=this._renderQueue[a]).isDestroyed()||(r&&!h.ownerPagelod._finalResolution&&e$28(h._clipBounds)&&h._clipBounds.length>0?l.push(h):h.update(e,t,i,this._layer))}if(l.length>0){var u=i.length,c=l.length;for(a=0,s=c;a<s;a++){var h;(h=l[a]).isDestroyed()||h.update(e,t,i,this._layer)}var d=this._layer._backfaceCommands,f=d.length;for(i.length+=f,a=c-1;a>=0;--a)i[u+a+f]=i[u+a];for(a=0;a<f;++a)i[u+a]=d[a]}}var p=i.length;this._statistics.numberOfCommands=p-n},_0x151d57.prototype._updatePolygons=function(){if(e$28(this._extrudedId)&&e$28(this._polygons)){for(var e=0,t=this._renderQueue.length;e<t;e++){var i=this._renderQueue[e],r=i._selectionInforMap._hash;if(e$28(i._polygonId)){var n={};n[i._polygonId]=0,i.updateObjsOperation(n)}e$28(r[this._extrudedId])?(i._polygons=this._polygons,i._polygonId=this._extrudedId):(i._polygons=void 0,i._polygonId=void 0,i._polygonCommands=[])}this._polygons=void 0}},_0x151d57.prototype.saveLocalCache=function(e){if((!0===this._layer._indexedDBSetting.isGeoTilesSave||!0===this._layer._indexedDBSetting.isGeoTilesRootNodeSave||!0===this._layer._indexedDBSetting.isAttributesSave)&&e$28(this._indexedDBScheduler)){var t={tablename:this.tablename,dbname:this._indexedDBScheduler.dbname};if(e.push(t),this._layer._isS3MBlock){t={tablename:this.tablename+"Texture",dbname:this._indexedDBScheduler.dbname};e.push(t)}}};var _0x4c5a66=function(e,t){return e._disFromCamera-t._disFromCamera},_0x40ce27=new t$X;function _0x278e9e(e,t,i){if(e$28(i._boundingSphere)){var r=e$28(i._orientedBoundingBox)?i._orientedBoundingBox:i._boundingSphere,n=e.cullingVolume.computeVisibility(r)!==pt$a.OUTSIDE,o=t$X.subtract(i._boundingSphere.center,e.camera.positionWC,_0x40ce27);i._centerZDepth=t$X.dot(e.camera.directionWC,o),i._isVisible=n}else i._isVisible=!0}function _0x4e4cc2(e,t){e._maximumPriority.distance=Math.max(t._disFromCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._disFromCamera,e._minimumPriority.distance),e._maximumPriority.foveatedFactor=Math.max(t._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.pixel=Math.max(t._avgPix,e._maximumPriority.pixel),e._minimumPriority.pixel=Math.min(t._avgPix,e._minimumPriority.pixel)}function _0x56cc7b(e){return e._isVisible}function _0x571109(e,t,i){for(var r=i._renderEntityList,n=0;n<r.length;n++){var o=r[n];o.ownerPagelod=i,t._renderQueue.push(o)}}function _0x30d354(e,t,i,r){var n=t._layer,o=!1,a=!1,s=r._leafChildren,l=s.length;if(r._ready)for(var u=0;u<l;u++){_0x278e9e(e,n,c=s[u]),c._isVisible&&_0x571109(e,t,c)}else(e$28(n._skipLevelSpan)&&r._depth%n._skipLevelSpan==1||r._needLoad||n.residentRootTile&&r._isRootTile||r._isLeafTile||r._hasLeafChild||l>0)&&(o=!0,a=!0);if(r._hasConfig&&!r._configReady&&(t.loadConfig(r),o=!1,a=!0),l=(s=r._childrenPageLod).length,a)return e$28(r._parentPagelod)&&(r._parentPagelod._ready?_0x571109(e,t,r._parentPagelod):(r._isUnready=!0,r._disvisibleOrUnreadyCount=0,t._unreadyEntitys[r._parentPagelod._rangeDataList]=r)),o;for(u=0;u<l;u++){var c;if(_0x278e9e(e,n,c=s[u]),c._isVisible){var h=c._entity;e$28(h)&&(c.calcPixFromCam(e.camera,n._gl,n._lodRangeScale,n._fileType,n.LoadingPriority),c._finalResolution=!0),c._isLessLodDis&&c._isFinalTraverse||!e$28(h)?r._ready||(h._isUnready=!0,h._disvisibleOrUnreadyCount=0,t._unreadyEntitys[c._rangeDataList]=h):(h._isUnready=!1,h._disvisibleOrUnreadyCount=0),e$28(h)?c._isLessLodDis?r._ready?(_0x571109(e,t,c),c._isFinalTraverse=!0,_0x415302(c)):(o=!0,c._isFinalTraverse||_0x1c8951(e,t,c)):(c._isFinalTraverse=!1,i.push(h)):(r._ready?_0x571109(e,t,c):o=!0,c._isFinalTraverse=!0)}else c._isFinalTraverse=!0,_0x415302(c),r._disvisibleOrUnreadyCount++}return o}function _0x415302(e){if(e$28(e._entity)){var t=e._entity._childrenPageLod;if(!e$28(t))return;for(var i=0;i<t.length;i++)t[i]._isFinalTraverse||(t[i]._isFinalTraverse=!0,_0x415302(t[i]))}}function _0x1c8951(e,t,i){for(var r=t._layer,n=[i];n.length>0;){var o=n.pop()._entity;_0x50eb07(t,o);var a=o._childrenPageLod,s=a.length,l=o._leafChildren,u=l.length;if(o._ready){for(var c=0;c<s;c++){_0x278e9e(e,r,i=a[c]),i._isVisible&&_0x571109(e,t,i)}for(c=0;c<u;c++){_0x278e9e(e,r,i=l[c]),i._isVisible&&_0x571109(e,t,i)}}else if(e$28(r._skipLevelSpan)&&o._depth%r._skipLevelSpan==1||o._hasConfig&&!o._configReady||o._needLoad||r.residentRootTile&&o._isRootTile||o._isLeafTile||o._hasLeafChild||u>0)o._isUnready=!0,o._disvisibleOrUnreadyCount=0,t._unreadyEntitys[o._parentPagelod._rangeDataList]=o;else for(c=0;c<s;++c)if(_0x278e9e(e,r,a[c]),_0x56cc7b(a[c])){var h=a[c]._entity;!a[c]._isFinalTraverse&&e$28(h)?(h._isUnready=!1,h._disvisibleOrUnreadyCount=0,n.push(a[c])):(h._isUnready=!0,h._disvisibleOrUnreadyCount=0,t._unreadyEntitys[a[c]._rangeDataList]=h)}else o._disvisibleOrUnreadyCount++}}function _0x1ea9dc(e,t){var i=e._boundingSphere;if(!e$28(i))return!0;!e$28(i)&&e$28(e._orientedBoundingBox)&&(i=e._boundingSphere=i$19.fromOrientedBoundingBox(e._orientedBoundingBox));var r=Math.max(2*i.radius,1),n=t.camera;return 60*(0!==n.positionWCDeltaMagnitude?n.positionWCDeltaMagnitude:n.positionWCDeltaMagnitudeLastFrame)/r<1}function _0x402b2a(e,t,i){_0x1ea9dc(i,e)&&t._requestEntities.push({entity:i,priority:i._priority,owner:t})}function _0x50eb07(e,t){var i=e._replacementList,r=e._replacementSentinel;e$28(t._replacementNode)?i.splice(r,t._replacementNode):t._replacementNode=i.add(t)}function _0x541e34(e,t,i){if(e$28(e)&&e._processFileType===_0x37fa97.Add){var r=e._entity;if(e$28(r)&&r._ready){var n=t.camera,o=n.positionWC,a=t.cullingVolume,s=i._layer,l=i._gl;if(e$28(r._boundingSphere)&&!r._isRootTile&&(r._isVisible=a.computeVisibility(r._boundingSphere)!==pt$a.OUTSIDE,!r._isVisible)){for(var u=0,c=r._childrenPageLod.length;u<c;u++)for(var h=r._childrenPageLod[u],d=0;d<h._renderEntityList.length;d++){var f=h._renderEntityList[d];h._renderEntityVisible[f._geoName]=!1}return}for(u=0,c=r._childrenPageLod.length;u<c;u++){if(_0x42ad31(h=r._childrenPageLod[u],s,o))if(a.computeVisibility(h._boundingSphere)!==pt$a.OUTSIDE||s._fileType==f$r.ClampGroundRealtimeRasterCache){if(h.calcPixFromCam(n,l,s._lodRangeScale,s._priorityScale,this._nLoadingPriority),i._prepareLoaded||(e$28(h._entity)&&h._isLessLodDis&&(h._entity._prepareLoad=!0),h._isLessLodDis=!1),!h._isLessLodDis&&e$28(h._entity))if(h._entity._s3mLoadState===I$F.PARSED){for(d=0;d<h._renderEntityList.length;d++){f=h._renderEntityList[d];h._renderEntityVisible[f._geoName]=!1}_0x541e34(h,t,i),_0x50fa4a(h);continue}for(d=0;d<h._renderEntityList.length;d++){f=h._renderEntityList[d];h._renderEntityVisible[f._geoName]=!0}}else for(var d=0;d<h._renderEntityList.length;d++){var f=h._renderEntityList[d];h._renderEntityVisible[f._geoName]=!1}else for(var d=0;d<h._renderEntityList.length;d++){var f=h._renderEntityList[d];h._renderEntityVisible[f._geoName]=!1}}}}}function _0x50fa4a(e){if(e$28(e)&&e$28(e._entity)){for(var t=e._entity,i={},r=0,n=t._childrenPageLod.length;r<n;r++){var o=t._childrenPageLod[r];if(0===Object.keys(o._renderEntityVisible).length)for(var a=0;a<o._renderEntityList.length;a++){i[(s=o._renderEntityList[a])._geoName]=!0}else for(a=0;a<o._renderEntityList.length;a++){i[(s=o._renderEntityList[a])._geoName]=o._renderEntityVisible[s._geoName]}}if(0!==Object.keys(i).length)for(a=0;a<e._renderEntityList.length;a++){var s;i[(s=e._renderEntityList[a])._geoName]?e._renderEntityVisible[s._geoName]=!0:e._renderEntityVisible[s._geoName]=!1}}}function _0x4cc871(e,t){if(e$28(e)&&e$28(e._entity)){for(var i=e._entity,r={},n=0,o=i._childrenPageLod.length;n<o;n++){var a=i._childrenPageLod[n];if(0===Object.keys(a._renderEntityVisible).length)for(var s=0;s<a._renderEntityList.length;s++){r[(l=a._renderEntityList[s])._geoName]=!0}else for(s=0;s<a._renderEntityList.length;s++){r[(l=a._renderEntityList[s])._geoName]=a._renderEntityVisible[l._geoName]}}if(0!==Object.keys(r).length)for(s=0;s<e._renderEntityList.length;s++){var l;r[(l=e._renderEntityList[s])._geoName]?(t.push(l),e._renderEntityVisible[l._geoName]=!0):e._renderEntityVisible[l._geoName]=!1}}}function _0x4096f8(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function _0x244849(e,t){var i=new DataView(e),r=0,n=i.getUint32(r,!0);if(!(t>n-1)){r+=4;var o,a,s=[];for(o=0;o<n;o++)a=i.getUint32(r,!0),s.push(a),r+=4;for(o=0;o<n;o++){if(a=s[o],o===t)return 0===a?void 0:new Uint8Array(e,r,a);r+=a}}}function _0x2cb3da(e,t){var i=t._fileName.split("_"),r=t.request.url;t.request.throttle=!0,t.request.throttleByServer=!0,t.request.type=$$13.PACK,t.request.quadKey=_0x4096f8(i[2],i[1],i[0]),t.request.providerName=r.substring(r.indexOf("datas/")+6,r.indexOf("/data/"));var n=t$S.createIfNeeded(r).getDerivedResource({url:r,request:t.request}).fetchArrayBuffer();e$28(n)?(t._s3mLoadState=I$F.LOADING,e._statistics.numberOfPendingRequests++,n.then((function(i){var r=_0x244849(i,t.request.quadKeyIndex);e$28(r)?(i=new Uint8Array(r).buffer,0!=e._cacheKey.length?t.s3mBuffer=_0x4028fb(i,e._cacheKey):t.s3mBuffer=i,t._s3mLoadState=I$F.LOADED,e._statistics.numberOfPendingRequests--,e._statistics.numberOfProcessingAttempted++,t.request=null):t._s3mLoadState=I$F.FAILED}),(function(i){e$28(i)?(e._statistics.numberOfPendingRequests--,t._s3mLoadState=I$F.FAILED):(e._statistics.numberOfAttemptedRequests++,e._statistics.numberOfPendingRequests--,t._s3mLoadState=I$F.UNLOAD,t.request=null)}))):t.request=null}function _0x1ab41e(e,t){e$28(t._replacementNode)?e.splice(e.tail,t._replacementNode):t._replacementNode=e.add(t)}function _0x215677(e,t){return t$X.distance(e.center,t.center)<=e.radius+t.radius}function _0x492387(e,t){if(e._flattening){var i=t._boundingSphere;if(e$28(i))for(var r=e._flattenRegions.values,n=0,o=r.length;n<o;n++){var a=r[n].boundingSphere;if(e$28(a)&&_0x215677(i,a)){t.isFlatten=!0;break}}}}function _0x25f794(e,t,i,r){var n,o=[];if(t instanceof Array)for(var a=0;a<t.length;a++){if(!t[a].imageryProvider.ready)return;var s=t[a].getMaxScaleLevel(e._cartographic);o.push(s),n=0===a?s:Math.max(n,s)}else{if(!t.imageryProvider.ready)return;n=t.getMaxScaleLevel(e._cartographic)}var l=Math.min(i,n);if(l>0&&!e.hasScaleImagerys(l)){var u=[];if(t instanceof Array)for(a=0;a<t.length;a++){var c=t[a].getImagery(e._cartographic,Math.min(o[a],l));u=u.concat(c)}else u=t.getImagery(e._cartographic,l);u.length>0&&e.setScaleImagerys(u,l)}e.resetScaleImagerys(l,r)}function _0x2bbbfb(e,t){var i=t.positionCartographic.height;return(i=i<0?0:i)<=e._maxVisibleAltitude&&i>=e._minVisibleAltitude}function _0x42ad31(e,t,i){var r;if(t._fileType===f$r.ClampGroundRealtimeRasterCache){var n=e._boundingSphere.center,o=e._boundingSphere.radius,a=t$X.fromRadians(e$27.toRadians(n.x),e$27.toRadians(n.y),n.z),s=t$X.fromRadians(e$27.toRadians(n.x),e$27.toRadians(n.y-o),n.z),l=t$X.distance(a,s);r=t$X.distance(a,i)-l}else r=t$X.distance(e._boundingSphere.center,i)-e._boundingSphere.radius;return(r=r<0?0:r)<=t._visibleDistanceMax&&r>=t._visibleDistanceMin}function _0x167feb(e,t,i){var r=t$X.distance(e._boundingSphere.center,i)-e._boundingSphere.radius;return(r=r<0?0:r)<=t._visibleDistanceMax&&r>=t._visibleDistanceMin}function _0x140690(e,t){var i=t.positionCartographic.height;return(i=i<0?0:i)<=e._maxVisibleAltitude&&i>=e._minVisibleAltitude}function _0x18151f(e,t,i){const r=t._maximumScreenSpaceError;var n,o=t._context,a=e._boundingSphere,s=e._orientedBoundingBox,l=1;if(t._fileType===f$r.ClampGroundRealtimeRasterCache){var u=a.center,c=a.radius,h=t$X.fromRadians(e$27.toRadians(u.x),e$27.toRadians(u.y),u.z),d=t$X.fromRadians(e$27.toRadians(u.x),e$27.toRadians(u.y-c),u.z),f=t$X.distance(h,d);n=t$X.distance(h,i)-f,l=f}else e$28(a)?(n=t$X.distance(a.center,i)-a.radius,l=a.radius):n=Math.sqrt(x$13.distanceSquaredTo(s,i));if(n=n<0?0:n,e._disFromCamera=n,n<0)return!0;var p=pixelsPerMeter(o,n)*l,_=t._translucencyByDistance?t._visibleDistanceMax+2e3:t._visibleDistanceMax;return n>=t._visibleDistanceMin&&n<=_&&p>r}_0x151d57.prototype._scheduleSkip=function(e){var t=this._layer;this._selectEntities.length=0,this._renderQueue.length=0,this._replacementList.splice(this._replacementList.tail,this._replacementSentinel);var i,r=[];for(h=0,i=this._rootEntities.length;h<i;h++){var n=this._rootEntities[h];if(e$28(n._boundingSphere)||e$28(n._orientedBoundingBox)){var o=e$28(n._orientedBoundingBox)?n._orientedBoundingBox:n._boundingSphere;n._isVisible=n.isFlatten||n.hasTranslate||e.cullingVolume.computeVisibility(o)!==pt$a.OUTSIDE}if(t.residentRootTile||_0x56cc7b(n)){if(!n._configReady){this.loadConfig(n);continue}r.push(n)}}for(r.sort(_0x4c5a66),this._unreadyEntitys={};l=r.pop();){_0x30d354(e,this,r,l)&&(l._ready||(_0x4e4cc2(t,l),_0x402b2a(e,this,l))),_0x50eb07(this,l)}var a={};for(var s in this._unreadyEntitys){for(var l=this._unreadyEntitys[s];e$28(l)&&(l._childrenPageLod.length===l._disvisibleOrUnreadyCount||l._isUnready);){if(l._isUnready=!0,!e$28(l._parent)||l._parent._ready){e$28(l._parentPagelod)&&(a[l._parentPagelod._rangeDataList]=l._parentPagelod),l=void 0;break}l._parent._disvisibleOrUnreadyCount++,l=l._parent}if(e$28(l)){for(;e$28(l._parent)&&!l._parent._ready;)l=l._parent;e$28(l._parentPagelod)&&(a[l._parentPagelod._rangeDataList]=l._parentPagelod)}}for(var s in a){var u=[],c=a[s];if(e$28(c._entity))for(r=[c._entity];l=r.pop();)if(l._isUnready)u.push(l._parentPagelod);else if(!l._ready&&!l._parentPagelod_isFinalTraverse)for(var h=0;h<l._childrenPageLod.length;h++){var d=l._childrenPageLod[h];d._isVisible&&e$28(d._entity)&&r.push(d._entity)}var f=c._renderEntityList,p=f.length;for(h=0;h<p;h++){var _=f[h];for(_._clipBounds=[],_.ownerPagelod=c,i=0;i<u.length;i++)c._rangeDataList!=u[i]._rangeDataList&&(_._clipBounds.push({max:u[i].max,min:u[i].min,name:u[i]._rangeDataList,boundingSphere:u[i]._boundingSphere,orientedBoundingBox:u[i]._orientedBoundingBox}),t._hasMixedContent=!0,c._finalResolution=!1);this._renderQueue.push(_)}}var m=this._requestEntities.length;for(h=0;h<m;h++)this._requestEntities[h].entity.updatePriority(t),e.requests.push(this._requestEntities[h]);this._requestEntities.length=0,e.passes.offscreen||this.freeResource(e)},_0x151d57.prototype._processPackRequests=function(){var e=this._packRequestEntities,t=e.length;if(!(t<1)){e.sort(_0x4c5a66);for(var i=0;i<t;i++){_0x2cb3da(this,e[i])}this._packRequestEntities.length=0}},_0x151d57.prototype._processParsingEntities=function(){var e=this._parsingEntities,t=e.length;if(!(t<1)){e.sort(_0x4c5a66);for(var i=this._layer,r=i._isS3MB?_0x1eccda.binaryDataParser:_0x27cba5.binaryDataParser,n=0;n<t;n++){var o=e[n];r(i,o,o.s3mBuffer,o.volBuffer)}this._parsingEntities.length=0}},_0x151d57.prototype._schedule=function(e){var t=e.camera,i=t.positionWC,r=e.cullingVolume,n=this._layer,o=this._gl,a=_0x2bbbfb(n,t),s=[],l=e.requests;const u=e.processingTiles,c=e.replacementList;if(this._renderQueue.length=0,a){for(let e=0,t=this._virtualRootTiles.length;e<t;e++){let t=this._virtualRootTiles[e];if(t._ready||!_0x18151f(t,n,i))continue;const o=t.boundingVolume;t._visibilityPlaneMask=e$28(o)?r.computeVisibilityWithPlaneMask(o,MASK_INDETERMINATE):0,t.isVisible=t._visibilityPlaneMask!==i$S.MASK_OUTSIDE,t.isVisible&&l.push({entity:t,priority:t._disFromCamera,owner:this})}for(var h=0,d=this._rootEntities.length;h<d;h++){var f=this._rootEntities[h];if(f._rootName=f._fileName,f._blockKey=f._fileName,e$28(f._boundingSphere)||e$28(f._orientedBoundingBox)){var p=e$28(f._orientedBoundingBox)?f._orientedBoundingBox:f._boundingSphere;if(f.isVisible=f.isFlatten||f.hasTranslate||r.computeVisibility(p)!==pt$a.OUTSIDE,n._fileType===f$r.ClampGroundRealtimeRasterCache&&(f.isVisible=!0),!_0x18151f(f,n,i)){e$28(this._entityObjectId[f._fileName])&&(this._entityObjectId[f._fileName]=void 0,this._objectIdChange=!0),e$28(this._entityModelId[f._fileName])&&(this._entityModelId[f._fileName]=void 0,this._objectIdChange=!0);continue}if(!f.isVisible){e$28(this._entityObjectId[f._fileName])&&(this._entityObjectId[f._fileName]=void 0,this._objectIdChange=!0),e$28(this._entityModelId[f._fileName])&&(this._entityModelId[f._fileName]=void 0,this._objectIdChange=!0);continue}}if(_0x1ab41e(c,f),f._s3mLoadState!==I$F.PARSED)if(f._ready){if(f.loadAttributes(n)){if(s.push(f),e$28(this._associatedFieldName)&&!e$28(this._entityObjectId[f._fileName])){for(var _={},m=0;m<f._childrenPageLod.length;m++)for(var $=0;$<f._childrenPageLod[m]._renderEntityList.length;$++){var g=f._childrenPageLod[m]._renderEntityList[$];for(var v in g._selectionInforMap._hash)_[v]=this._attributes[v][this._associatedFieldName]}this._entityObjectId[f._fileName]=_,this._objectIdChange=!0}if(this._isFineLayer&&!e$28(this._entityModelId[f._fileName])){for(_={},m=0;m<f._childrenPageLod.length;m++)for($=0;$<f._childrenPageLod[m]._renderEntityList.length;$++){g=f._childrenPageLod[m]._renderEntityList[$];for(var v in g._selectionInforMap._hash)_[v]=v}this._entityModelId[f._fileName]=_,this._objectIdChange=!0}}}else l.push({entity:f,priority:f._disFromCamera,owner:this}),e$28(this._entityObjectId[f._fileName])&&(this._entityObjectId[f._fileName]=void 0,this._objectIdChange=!0),e$28(this._entityModelId[f._fileName])&&(this._entityModelId[f._fileName]=void 0,this._objectIdChange=!0);else u.push(f)}n._nProcessType==_0x37fa97.Add&&n._nLoadingMode==_0x48d444.All_Loading&&this._getCameraChanged(t),s.sort(_0x4c5a66);for(var y,x=[];y=s.pop();){if(e$28(y._boundingSphere)&&!y._isRootTile){p=e$28(y._orientedBoundingBox)?y._orientedBoundingBox:y._boundingSphere;if(y._isVisible=y.isFlatten||y.hasTranslate||r.computeVisibility(p)!==pt$a.OUTSIDE,this._prepareLoaded||(y._isVisible||(y._prepareLoad=!0),y._isVisible=!0),!y._isVisible){this._layer._clearMemoryImmediately&&(!n._isS3MBlock||y._isAncestorBlock)&&(null!=y._replacementNode?this._replacementList.moveNodeBefore(this._replacementList.head,y._replacementNode):y._replacementNode=this._replacementList.addToHead(y));for(h=0,d=y._childrenPageLod.length;h<d;h++){var b=y._childrenPageLod[h];for($=0;$<b._renderEntityList.length;$++){g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!1}}continue}this._beginToLoadLeaf=!0}(!n._isS3MBlock||y._isAncestorBlock)&&_0x1ab41e(c,y);var w=y._nLODLev;for(h=0,d=y._childrenPageLod.length;h<d;h++){b=y._childrenPageLod[h];if(e$28(n._hypsometricSetting)){var C=_0x167feb(b,n._hypsometricSetting,i)&&_0x140690(n._hypsometricSetting,t);for($=0;$<b._renderEntityList.length;$++){(g=b._renderEntityList[$])._isHypsometricVisible=C}}p=e$28(b._orientedBoundingBox)?b._orientedBoundingBox:b._boundingSphere;if(y.isFlatten||y.hasTranslate||r.computeVisibility(p)!==pt$a.OUTSIDE||n._fileType==f$r.ClampGroundRealtimeRasterCache)if(y._isLeafTile){var T=void 0;e$28(n._imageryLayer)&&(0===b._rangeList&&(b._rangeList=2*y._parentPagelod._rangeList,b._rangeMode=y._parentPagelod._rangeMode),T=b.calcImageryScaleLevel(t,o,n._lodRangeScale,this._nLoadingPriority,this._rangeMode),T=Math.ceil(T)-1);for($=0;$<b._renderEntityList.length;$++){var S=b._renderEntityList[$];if(y.isFlatten||y.hasTranslate||r.computeVisibility(S._boundingVolume)!==pt$a.OUTSIDE||n._fileType==f$r.ClampGroundRealtimeRasterCache)for(var E in S._isLeaf=!0,e$28(T)&&e$28(S._cartographic)&&_0x25f794(S,n._imageryLayer,T,e),this._renderQueue.push(S),S._labelIndexs)if(S._labelIndexs.hasOwnProperty(E)){var A=E;x.push(A)}}}else{if(b._isLeafNode){T=void 0;e$28(n._imageryLayer)&&(0===b._rangeList&&(b._rangeList=2*y._parentPagelod._rangeList),T=b.calcImageryScaleLevel(t,o,n._lodRangeScale,this._nLoadingPriority,this._rangeMode),T=Math.ceil(T)-1);for($=0;$<b._renderEntityList.length;$++){S=b._renderEntityList[$];if(r.computeVisibility(S._boundingVolume)!=pt$a.OUTSIDE)for(var E in e$28(T)&&e$28(S._cartographic)&&_0x25f794(S,n._imageryLayer,T,e),this._renderQueue.push(S),S._labelIndexs)if(S._labelIndexs.hasOwnProperty(E)){A=E;x.push(A)}}continue}if(this._rangeMode=b._rangeMode,b.calcPixFromCam(t,o,n._adjustedLodRangeScale,n._priorityScale,this._nLoadingPriority),this._prepareLoaded||(b._isLessLodDis&&e$28(b._entity)&&(b._entity._prepareLoad=!0),b._isLessLodDis=!1),b._isLessLodDis)for($=0;$<b._renderEntityList.length;$++){this._renderQueue.push(b._renderEntityList[$]);g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!0}else if(e$28(b._entity)){if(b._entity._s3mLoadState===I$F.TRANSFORMED){if(n._nProcessType===_0x37fa97.Add)for($=0;$<b._renderEntityList.length;$++)this._renderQueue.push(b._renderEntityList[$]);else{for($=0;$<b._renderEntityList.length;$++){g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!1}b._processFileType===_0x37fa97.Add&&(_0x541e34(b,e,this),_0x4cc871(b,this._renderQueue))}s.push(b._entity)}else{(!n._isS3MBlock||b._entity._isAncestorBlock)&&_0x1ab41e(c,b._entity),b._entity._s3mLoadState===I$F.PARSED&&u.push(b._entity);for($=0;$<b._renderEntityList.length;$++){this._renderQueue.push(b._renderEntityList[$]);g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!0}if(!e$28(b._entity._volObj)&&e$28(y._volObj)&&(b._entity._volObj=y._volObj,Se$8.AddRef(y._volObj.id)),e$28(b._entity._boundingSphere)){p=e$28(b._entity._orientedBoundingBox)?b._entity._orientedBoundingBox:b._entity._boundingSphere;var P=b._entity.isFlatten||b._entity.hasTranslate||r.computeVisibility(p)!==pt$a.OUTSIDE;this._prepareLoaded||(P||(b._entity._prepareLoad=!0),P=!0),P&&l.push({entity:b._entity,priority:b._entity._disFromCamera,owner:this})}else l.push({entity:b._entity,priority:b._entity._disFromCamera,owner:this})}}else{var I=new _0x100161;I.root=y.root,I.layer=y.layer,I._subdomainIndex=y._subdomainIndex+h+1,!e$28(I._volObj)&&e$28(y._volObj)&&(I._volObj=y._volObj,Se$8.AddRef(y._volObj.id));var M=b._rangeDataList;if(M.indexOf("/")>-1){var O=M.lastIndexOf("/"),D=M.substring(0,O+1);I._fileName=M.substring(O+1),I._relativePath=new h$$(D).resolve(y._relativePath)}else I._relativePath=y._relativePath,I._fileName=M;I._avgPix=b._pix,I._disFromCamera=b._disFromCamera,I._nLODLev=w+1,I._boundingSphere=b._boundingSphere,I._originalBS=b._originalBS,I._orientedBoundingBox=b._orientedBoundingBox,_0x492387(n,I),this._currentMaxLevel=Math.max(this._currentMaxLevel,I._nLODLev),b._entity=I,I._parentPagelod=b;for($=0;$<b._renderEntityList.length;$++){this._renderQueue.push(b._renderEntityList[$]);g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!0}_0x1ab41e(c,I)}}else for(var $=0;$<b._renderEntityList.length;$++){var g=b._renderEntityList[$];b._renderEntityVisible[g._geoName]=!1}}}n._showLabel&&this._layer._labelCollection.setVisibleLabels(x),n._showIcon&&this._layer._iconCollection.setVisibleIcons(x),this._packingRequest&&(this._processPackRequests(),this._processParsingEntities())}else n._fileType===f$r.ClampGroundRealtimeRasterCache&&this.refreshRaster(e)},_0x151d57.prototype.loadImagery=function(e,t){if(!this._stopLoadImagery){for(var i=0,r=[],n=0,o=this._rootEntities.length;n<o;n++){var a=this._rootEntities[n];r.push(a)}for(var s;s=r.pop();){if((i+=s.loadImagery(e,t))>10)return;for(n=0,o=s._childrenPageLod.length;n<o;n++){var l=s._childrenPageLod[n];e$28(l._entity)&&r.push(l._entity)}}}},_0x151d57.prototype._getCameraChanged=function(e){var t=!t$X.equals(this._cameraPos,e.positionWC)||!t$X.equals(this._cameraDir,e.directionWC)||!t$X.equals(this._cameraUp,e.upWC);(this._cameraPos=t$X.clone(e.position,this._cameraPos),this._cameraDir=t$X.clone(e.direction,this._cameraDir),this._cameraUp=t$X.clone(e.up,this._cameraUp),t)?e._clockStart=(new Date).getTime():(new Date).getTime()-e._clockStart<200&&(t=!0);return t},_0x151d57.prototype.refresh=function(){this._renderQueue.length=0;for(var e=0,t=this._rootEntities.length;e<t;e++){for(var i=this._rootEntities[e],r=0;r<i._childrenPageLod.length;r++){var n=i._childrenPageLod[r];n=n&&!n.isDestroyed()&&n.destroy()}i._childrenPageLod.length=0,i.attributeBuffer=i.attributeBuffer&&!i.attributeBuffer.isDestroyed()&&i.attributeBuffer.destroy(),i._ready=!1,i._s3mLoadState=I$F.UNLOAD}},_0x151d57.prototype.refreshPrepareLoad=function(){for(var e=[],t=0,i=this._rootEntities.length;t<i;t++){var r=this._rootEntities[t];r._ready&&e.push(r)}for(var n;n=e.pop();)if(n._prepareLoad){for(var o=0;o<n._childrenPageLod.length;o++){var a=n._childrenPageLod[o];a=a&&!a.isDestroyed()&&a.destroy()}n._childrenPageLod.length=0,n.attributeBuffer=n.attributeBuffer&&!n.attributeBuffer.isDestroyed()&&n.attributeBuffer.destroy(),n._ready=!1,n._s3mLoadState=I$F.UNLOAD}else for(t=0,i=n._childrenPageLod.length;t<i;t++){var s=n._childrenPageLod[t];n._isLeafTile||s._entity&&e.push(s._entity)}},_0x151d57.prototype.getRenderQueueSize=function(){return this._renderQueue.length},_0x151d57.prototype._updateSceneMode=function(e){if(e._mode!==this._sceneMode){var t=this._layer,i=new y$15;y$15.inverse(t._matModel,i),this._sceneMode=e._mode,this._projection=e._projection,t.refresh();for(var r=0,n=this._rootEntities.length;r<n;r++){var o=this._rootEntities[r];!e$28(o)||!e$28(o._boundingSphere)||(i$19.transform(o._boundingSphere,i,o._boundingSphere),i$19.transform(o._boundingSphere,t._matModel,o._boundingSphere),e$28(o._orientedBoundingBox)&&(y$15.multiplyByPoint(i,o._orientedBoundingBox.center,o._orientedBoundingBox.center),y$15.multiplyByPoint(t._matModel,o._orientedBoundingBox.center,o._orientedBoundingBox.center)))}}},_0x151d57.prototype.traverseRenderEntity=function(e,t){for(var i=[],r=0,n=this._rootEntities.length;r<n;r++){var o=this._rootEntities[r];i.push(o)}for(var a;a=i.pop();)for(r=0,n=a._childrenPageLod.length;r<n;r++){for(var s=a._childrenPageLod[r],l=0;l<s._renderEntityList.length;l++)!e$28(s._renderEntityList[l])||(e.entity=a,t(s._renderEntityList[l],e));s._entity&&i.push(s._entity)}},_0x151d57.prototype.refreshRasterById=function(e,t){for(var i=[],r=0,n=this._rootEntities.length;r<n;r++){var o=this._rootEntities[r];o._ready&&i.push(o)}for(var a;a=i.pop();)for(r=0,n=a._childrenPageLod.length;r<n;r++){for(var s=a._childrenPageLod[r],l=0;l<s._renderEntityList.length;l++)if(e$28(s._renderEntityList[l])){var u=s._renderEntityList[l]._selectionInforMap;if(e$28(u))for(var c in u._hash){if(parseInt(c)===parseInt(e)){s._renderEntityList[l].refreshRaster(t,!0);break}}}a._isLeafTile||s._entity&&i.push(s._entity)}},_0x151d57.prototype.refreshRaster=function(e){for(var t=[],i=0,r=this._rootEntities.length;i<r;i++){var n=this._rootEntities[i];n._ready&&t.push(n)}for(var o;o=t.pop();)for(i=0,r=o._childrenPageLod.length;i<r;i++){for(var a=o._childrenPageLod[i],s=0;s<a._renderEntityList.length;s++)!e$28(a._renderEntityList[s])||a._renderEntityList[s].refreshRaster(e,!0);o._isLeafTile||a._entity&&t.push(a._entity)}},_0x151d57.prototype._getMemoryUsageInBytes=function(){for(var e=0,t=this._replacementList.head;e$28(t)&&(e$28(t.item)||e$28(t.next));){var i=t.item;e$28(i)&&(e+=i.memoryUsage()),t=t.next}return e},_0x151d57.prototype._getCacheMemoryUsageInBytes=function(){for(var e=0,t=this._replacementList.head;t!==this._replacementSentinel;){var i=t.item;e$28(i)&&(e+=i.memoryUsage()),t=t.next}return e},_0x151d57.prototype.freeResource=function(e){for(var t=this._getCacheMemoryUsageInBytes(),i=1024*to.getCacheSize()*1024,r=this._replacementList.head,n=0;e$28(r)&&r!==this._replacementSentinel&&n<5;){var o=r.item;if(r=r.next,e$28(o)&&(o._s3mLoadState===I$F.UNLOAD||this._layer._clearMemoryImmediately||t>i)&&(this._replacementList.remove(o._replacementNode),o._replacementNode=null,!(o._isRootTile&&this._layer.residentRootTile||o._s3mLoadState==I$F.UNLOAD))){var a={geoSize:0,texSize:0},s=o.memoryUsageEx(a);if(to._memGeometryRemoved(a.geoSize),o.freeResource(e),t-=s,n++,o._hasConfig&&o._configReady){for(var l,u=[o];l=u.pop();){var c=l._childrenPageLod;if(e$28(c))for(var h=0;h<c.length;h++)e$28(c[h]._entity)&&(this._replacementList.remove(c[h]._entity._replacementNode),c[h]._entity._replacementNode=null,c[h]._entity.destroy(e,!1),u.push(c[h]._entity))}o._configReady=!1,o._configLoadState=0,o._childrenPageLod=[],o._leafChildren=[]}}}},_0x151d57.prototype.isDestroyed=function(){return!1},_0x151d57.prototype.destroy=function(){this._renderQueue.length=0,this._replacementList.splice(this._replacementList.tail,this._replacementSentinel);var e=this._layer,t=void 0;e._fileType===f$r.ClampGroundRealtimeRasterCache&&(t=e._frameState);for(var i=this._replacementList.head;i!==this._replacementSentinel;){var r=i.item,n={geoSize:0,texSize:0};r.memoryUsageEx(n),to._memGeometryRemoved(n.geoSize),i=i.next,this._replacementList.remove(r._replacementNode),r.destroy(t)}return i$Z(this)};var _0x3771f3=(_0x5440cc=!0,function(e,t){var i=_0x5440cc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5440cc=!1,i}),_0x1a80d8=_0x3771f3(void 0,(function(){return _0x1a80d8.toString().search("(((.+)+)+)+$").toString().constructor(_0x1a80d8).search("(((.+)+)+)+$")})),_0x5440cc;_0x1a80d8();var _0x252df4="attribute vec4 position;\nuniform vec4 uRect;\nuniform vec4 uSingleRegion;\nvarying float fHeight;\nvarying vec2 vTexCoord;\n\nvoid main()\n{\n vec4 vPos = position;\n vec2 vBounds = uRect.zw - uRect.xy;\n vTexCoord = (vPos.xy - uSingleRegion.xy) / (uSingleRegion.zw - uSingleRegion.xy);\n vPos.xy = (vPos.xy - uRect.xy) / vBounds.xy * 2.0 - 1.0;\n gl_Position = vec4(vPos.xy, 0.5, 1.0);\n fHeight = vPos.z;\n}",_0x4f0c0e=(_0x445f5d=!0,function(e,t){var i=_0x445f5d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x445f5d=!1,i}),_0x5bbcb4=_0x4f0c0e(void 0,(function(){return _0x5bbcb4.toString().search("(((.+)+)+)+$").toString().constructor(_0x5bbcb4).search("(((.+)+)+)+$")})),_0x445f5d;function _0x5255c6(e){e=e||{},this._font=u$Y(e.font,"30px sans-serif"),this._fillColor=u$Y(e.fillColor,e$1S.WHITE),this._outlineColor=u$Y(e.outlineColor,e$1S.BLACK),this._outlineWidth=u$Y(e.outlineWidth,1),this._showBackground=u$Y(e.showBackground,!1),this._backgroundColor=u$Y(e.backgroundColor,new e$1S(.165,.165,.165,.8)),this._style=u$Y(e.fillStyle,R$t.FILL),this._pixelOffset=o$1k.clone(u$Y(e.pixelOffset,o$1k.ZERO)),this._scale=u$Y(e.scale,1),this._textField=u$Y(e.textField,"Name"),this._heightReference=u$Y(e.heightReference,k$_.NONE),this._distanceDisplayCondition=e.distanceDisplayCondition,this._textFieldChanged=!1}_0x5bbcb4(),Object.defineProperties(_0x5255c6.prototype,{font:{get:function(){return this._font},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._font!==e&&(this._font=e)}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._fillColor=e}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._outlineColor=e}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e)}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._showBackground!==e&&(this._showBackground=e)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._backgroundColor=e}},fillStyle:{get:function(){return this._style},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._style!==e&&(this._style=e)}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._pixelOffset=e}},scale:{get:function(){return this._scale},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._scale!==e&&(this._scale=e)}},textField:{get:function(){return this._textField},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._textField!==e?(this._textField=e,this._textFieldChanged=!0):this._textFieldChanged=!1}},heightReference:{get:function(){return this._heightReference},set:function(e){this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=e}}});var _0x4c894c=(_0x4a7684=!0,function(e,t){var i=_0x4a7684?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4a7684=!1,i}),_0x415dab=_0x4c894c(void 0,(function(){return _0x415dab.toString().search("(((.+)+)+)+$").toString().constructor(_0x415dab).search("(((.+)+)+)+$")})),_0x4a7684;_0x415dab();var _0x2d7fe8={Hide:0,Visible:1,ResetAll:2},_0x58b6ee=Object.freeze(_0x2d7fe8),_0x50f9dd=(_0x1a5dcc=!0,function(e,t){var i=_0x1a5dcc?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1a5dcc=!1,i}),_0x192b53=_0x50f9dd(void 0,(function(){return _0x192b53.toString().search("(((.+)+)+)+$").toString().constructor(_0x192b53).search("(((.+)+)+)+$")})),_0x1a5dcc;function _0x59d91c(e,t,i){this._id=e,this._type=t,this._pointCounts=i}_0x192b53(),Object.defineProperties(_0x59d91c.prototype,{id:{get:function(){return this._id},set:function(e){o$1u.defined("PointCloudClassificationInfo id",e),this._id=e}},type:{get:function(){return this._type},set:function(e){o$1u.defined("PointCloudClassificationInfo type",e),this._type=e}},pointCounts:{get:function(){return this._pointCounts},set:function(e){o$1u.defined("PointCloudClassificationInfo pointCounts",e),this._pointCounts=e}}}),_0x59d91c.prototype.isDestroyed=function(){return!1},_0x59d91c.prototype.destroy=function(){return i$Z(this)};var _0x1e092b=(_0x508667=!0,function(e,t){var i=_0x508667?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x508667=!1,i}),_0x3efe8b=_0x1e092b(void 0,(function(){return _0x3efe8b.toString().search("(((.+)+)+)+$").toString().constructor(_0x3efe8b).search("(((.+)+)+)+$")})),_0x508667;_0x3efe8b();var _0x1eefe1={CLIP_INSIDE:0,CLIP_OUTSIDE:1},Ge$8=Object.freeze(_0x1eefe1),_0x34c486=(_0x5365be=!0,function(e,t){var i=_0x5365be?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5365be=!1,i}),_0x5ca0f9=_0x34c486(void 0,(function(){return _0x5ca0f9.toString().search("(((.+)+)+)+$").toString().constructor(_0x5ca0f9).search("(((.+)+)+)+$")})),_0x5365be;_0x5ca0f9();var _0x1c77d9={NONE:0,COLOR:1,MODEL_COLOR:2},_0x3f3b8b=Object.freeze(_0x1c77d9),_0x4a7fc0=(_0xa05a4f=!0,function(e,t){var i=_0xa05a4f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xa05a4f=!1,i}),_0x3d3bc6=_0x4a7fc0(void 0,(function(){return _0x3d3bc6.toString().search("(((.+)+)+)+$").toString().constructor(_0x3d3bc6).search("(((.+)+)+)+$")})),_0xa05a4f;_0x3d3bc6();var _0x1e6ad3={NONE:0,STRIP:1,DOT:2,CHECKBOARD:3,GRID:4};function _0x31641(){this._rotationAngle=0,this._foreColor=new e$25(1,1,0,1),this._backColor=new e$25(1,0,1,1),this._type=_0x1e6ad3.DOT,this._lineWidthX=2,this._lineWidthY=2,this._offsetX=0,this._offsetY=0,this._repeatX=20,this._repeatY=20}_0x31641.prototype.setValue=function(e,t){"ForeColor"===e&&(this._foreColor=t),"BackColor"===e&&(this._backColor=t),"RegionType"===e&&(this._type=t),"RotationAngle"===e&&(this._rotationAngle=t),"WidthX"===e&&(this._lineWidthX=t),"WidthY"===e&&(this._lineWidthY=t),"OffsetX"===e&&(this._offsetX=t),"OffsetY"===e&&(this._offsetY=t),"RepeatX"===e&&(this._repeatX=t),"RepeatY"===e&&(this._repeatY=t)},_0x31641.prototype.getEffectSetting=function(){return[{name:"ForeColor",value:new e$25(1,1,0,1),description:"Region Fore Color",max:new e$25(1,1,1,1),min:new e$25(0,0,0,0),type:e$25},{name:"BackColor",value:new e$25(1,0,1,1),description:"Region Back Color",max:new e$25(1,1,1,1),min:new e$25(0,0,0,0),type:e$25},{name:"RegionType",value:_0x1e6ad3.DOT,description:"Region Effect Type",max:4,min:0,type:_0x1e6ad3},{name:"RotationAngle",value:0,description:"Region RotationAngle",max:0,min:1,type:Number},{name:"WidthX",value:2,description:"Region horizontal Line Width",max:20,min:1,type:Number},{name:"WidthY",value:2,description:"Region vertical Line Width",max:20,min:1,type:Number},{name:"OffsetX",value:0,description:"Region horizontal Offset",max:20,min:0,type:Number},{name:"OffsetY",value:0,description:"Region vertical Offset",max:20,min:0,type:Number},{name:"RepeatX",value:20,description:"Region horizontal Repeat",max:20,min:1,type:Number},{name:"RepeatY",value:20,description:"Region vertical Repeat",max:20,min:1,type:Number}]};var _0x540f0b=(_0x5f00ea=!0,function(e,t){var i=_0x5f00ea?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5f00ea=!1,i}),_0x1c9178=_0x540f0b(void 0,(function(){return _0x1c9178.toString().search("(((.+)+)+)+$").toString().constructor(_0x1c9178).search("(((.+)+)+)+$")})),_0x5f00ea;_0x1c9178();var _0x491447={NONE:0,DASH:1,OUTLINE:2,GLOW:3};function _0x300acb(){this._lineWidth=1,this._color=new e$25(1,1,1,1),this._type=_0x491447.NONE,this._outlineColor=new e$25(0,0,0,1),this._outlineWidth=1,this._gapColor=new e$25(1,1,1,0),this._dashLength=16,this._dashPattern=255,this._glowPower=.25,this._isArrow=!1,this._isMove=!1,this._frame=0}_0x300acb.prototype.setValue=function(e,t){"Color"===e&&(this._color=t),"Width"===e&&(this._lineWidth=t),"PolylineType"===e&&(this._type=t),"OutlineColor"===e&&(this._outlineColor=t),"OutlineWidth"===e&&(this._outlineWidth=t),"GapColor"===e&&(this._gapColor=t),"DashLength"===e&&(this._dashLength=t),"DashPattern"===e&&(this._dashPattern=t),"GlowPower"===e&&(this._glowPower=t),"IsArrow"===e&&(this._isArrow=t),"IsMove"===e&&(this._isMove=t)},_0x300acb.prototype.getEffectSetting=function(){return[{name:"Color",value:new e$25(1,1,1,1),description:"Polyline Color",max:new e$25(1,1,1,1),min:new e$25(0,0,0,0),type:e$25},{name:"Width",value:5,description:"Polyline Width",max:20,min:1,type:Number},{name:"PolylineType",value:_0x491447.DASH,description:"Polyline Type",max:3,min:0,type:_0x491447},{name:"OutlineColor",value:new e$25(0,0,0,1),description:"Polyline Outline Color",max:new e$25(1,1,1,1),min:new e$25(0,0,0,0),type:e$25},{name:"OutlineWidth",value:1,description:"Polyline Outline Width",max:10,min:1,type:Number},{name:"GapColor",value:new e$25(1,1,1,0),description:"Polyline Gap Color",max:new e$25(1,1,1,1),min:new e$25(0,0,0,0),type:e$25},{name:"DashLength",value:16,description:"Polyline Gap Dash Length",max:64,min:1,type:Number},{name:"DashPattern",value:255,description:"Polyline Gap Dash Pattern",max:65535,min:0,type:Number},{name:"GlowPower",value:.25,description:"Polyline Glow Power",max:1,min:0,type:Number},{name:"IsArrow",value:!1,description:"Polyline Is Have Arrow",max:!0,min:!1,type:Boolean},{name:"IsMove",value:!1,description:"Polyline Is Moving",max:!0,min:!1,type:Boolean}]};var _0x5d7428=(_0x2b7289=!0,function(e,t){var i=_0x2b7289?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2b7289=!1,i}),_0x2a5140=_0x5d7428(void 0,(function(){return _0x2a5140.toString().search("(((.+)+)+)+$").toString().constructor(_0x2a5140).search("(((.+)+)+)+$")})),_0x2b7289;function _0x294c83(){}_0x2a5140();var _0x2012f6="Assets/Textures/PBR_Material/",_0x349db5="",_0x22cb81="",_0x2fb8b1="",_0xd64646="",_0x4fb543="",_0x4b9a16="";_0x294c83.getMaterial=function(e){return e===je$b.TITANIUM_SCUFFED?(_0x349db5="titanium_scuffed/Titanium-Scuffed_metallic.png",_0x22cb81="titanium_scuffed/Titanium-Scuffed_roughness.png",_0x2fb8b1="titanium_scuffed/Titanium-Scuffed_basecolor.png"):e===je$b.METAL_PLATE&&(_0x349db5="metal_plate/metal_plate_disp_1k.jpg",_0x22cb81="metal_plate/metal_plate_rough_1k.jpg",_0x2fb8b1="metal_plate/metal_plate_diff_1k.jpg"),_0xd64646=n$17(_0x2012f6+_0x349db5),_0x4fb543=n$17(_0x2012f6+_0x22cb81),_0x4b9a16=n$17(_0x2012f6+_0x2fb8b1),{metalTextureUrl:_0xd64646,roughTextureUrl:_0x4fb543,albedoTextureUrl:_0x4b9a16}};var _0x40fbfa=(_0x491215=!0,function(e,t){var i=_0x491215?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x491215=!1,i}),_0x11f92c=_0x40fbfa(void 0,(function(){return _0x11f92c.toString().search("(((.+)+)+)+$").toString().constructor(_0x11f92c).search("(((.+)+)+)+$")})),_0x491215;_0x11f92c();var _0x2e1f09="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthTexture;\nuniform vec3 u_distancesAndEdlStrength;\nvarying vec2 v_textureCoordinates;\n\nvec2 neighborContribution(float log2Depth, vec2 padding)\n{\nfloat depthOrLogDepth = texture2D(u_pointCloud_depthTexture, v_textureCoordinates + padding).r;\nif (depthOrLogDepth == 1.0) {\nreturn vec2(0.0);\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(v_textureCoordinates + padding, depthOrLogDepth);\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\nvoid main()\n{\nfloat depthOrLogDepth = texture2D(u_pointCloud_depthTexture, v_textureCoordinates).r;\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat log2Depth = log2(-eyeCoordinate.z);\nif (depthOrLogDepth == 1.0)\n{\ndiscard;\n}\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\n#ifdef EDL_SHADING\nfloat distX = u_distancesAndEdlStrength.x;\nfloat distY = u_distancesAndEdlStrength.y;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(log2Depth, vec2(0, distY));\nresponseAndCount += neighborContribution(log2Depth, vec2(distX, 0));\nresponseAndCount += neighborContribution(log2Depth, vec2(0, -distY));\nresponseAndCount += neighborContribution(log2Depth, vec2(-distX, 0));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat shade = exp(-response * 300.0 * u_distancesAndEdlStrength.z);\ncolor.rgb *= shade;\n#endif\ngl_FragColor = vec4(color);\ngl_FragColor.a = 1.0;\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + (czm_projection * vec4(eyeCoordinate.xyz, 1.0)).w);\n#else\ngl_FragDepthEXT = czm_eyeToWindowCoordinates(vec4(eyeCoordinate.xyz, 1.0)).z;\n#endif\n}\n",W$l="#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",_0x339f29=(_0x44a9e0=!0,function(e,t){var i=_0x44a9e0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x44a9e0=!1,i}),_0x34088f=_0x339f29(void 0,(function(){return _0x34088f.toString().search("(((.+)+)+)+$").toString().constructor(_0x34088f).search("(((.+)+)+)+$")})),_0x44a9e0,_0x428af5;function _0x3bdbcf(e){return new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:e,magnificationFilter:e})}function _0xdced8(){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthTexture=void 0,this._blurXFrameBuffer=void 0,this._blurXTexture=void 0,this._blurYFrameBuffer=void 0,this._blurYTexture=void 0,this._useCount=0}_0x34088f(),_0xdced8._useCount=0,_0xdced8.addRef=function(){this._useCount++},_0xdced8.removeRef=function(){if(this._useCount--,0==this._useCount){var e=_0x428af5._framebuffer;if(!e$28(e))return;_0x428af5._colorGBuffer.destroy(),_0x428af5._depthTexture.destroy(),e.destroy()}this._useCount=Math.max(0,this._useCount)},_0xdced8.setCurrentFrameBuffer=function(e){_0x428af5=e},_0xdced8.createFrameBuffer=function(e,t){var i=e.drawingBufferWidth*t,r=e.drawingBufferHeight*t,n=new L$17({context:e,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:_0x3bdbcf(tt$h.LINEAR)});new L$17({context:e,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:_0x3bdbcf(tt$h.NEAREST)});var o=new L$17({context:e,width:i,height:r,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8,sampler:_0x3bdbcf(tt$h.NEAREST)});_0x428af5._framebuffer=new a$z({context:e,colorTextures:[n],depthStencilTexture:o,destroyAttachments:!1}),_0x428af5._colorGBuffer=n,_0x428af5._depthTexture=o,_0x428af5._blurXTexture=new L$17({context:e,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:_0x3bdbcf(tt$h.LINEAR)}),_0x428af5._blurXFrameBuffer=new a$z({context:e,colorTextures:[_0x428af5._blurXTexture],destroyAttachments:!1}),_0x428af5._blurYTexture=new L$17({context:e,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:_0x3bdbcf(tt$h.LINEAR)}),_0x428af5._blurYFrameBuffer=new a$z({context:e,colorTextures:[_0x428af5._blurYTexture],destroyAttachments:!1})},_0xdced8.getColorGBuffer=function(){return _0x428af5._colorGBuffer},_0xdced8.getDepthTexture=function(){return _0x428af5._depthTexture},_0xdced8.getFrameBuffer=function(){return _0x428af5._framebuffer},_0xdced8.getBlurXFrameBuffer=function(){return _0x428af5._blurXFrameBuffer},_0xdced8.getBlurYFrameBuffer=function(){return _0x428af5._blurYFrameBuffer},_0xdced8.getBlurXTexture=function(){return _0x428af5._blurXTexture},_0xdced8.getBlurYTexture=function(){return _0x428af5._blurYTexture},_0xdced8.destroyFrameBuffer=function(){var e=_0x428af5._framebuffer;!e$28(e)||(_0x428af5._colorGBuffer.destroy(),_0x428af5._depthTexture.destroy(),e.destroy(),_0x428af5._blurXTexture.destroy(),_0x428af5._blurYTexture.destroy(),_0x428af5._blurXFrameBuffer.destroy(),_0x428af5._blurYFrameBuffer.destroy())};var _0x1ff8c4=(_0x14002d=!0,function(e,t){var i=_0x14002d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x14002d=!1,i}),_0xc87535=_0x1ff8c4(void 0,(function(){return _0xc87535.toString().search("(((.+)+)+)+$").toString().constructor(_0xc87535).search("(((.+)+)+)+$")})),_0x14002d;_0xc87535();var _0x4e8a76=.5;function _0x4e48d2(e){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthTexture=void 0,this._blurXFrameBuffer=void 0,this._blurXTexture=void 0,this._blurYFrameBuffer=void 0,this._blurYTexture=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this.edlShading=!1,this._edlShading=!1,this._performance=!1,this._strength=1,this._radius=1,this._passType=Le$p.S3MTiles,this._screenWidth=0,this._screenHeight=0,this._renderStateCache={},_0xdced8.addRef(),this.textureScale=_0x4e8a76}var _0x4a06ab=new t$X,_0x223144=new o$1k;function _0x15e2b0(e,t){_0x223144.x=1/e._colorGBuffer.width,_0x223144.y=1/e._colorGBuffer.height;var i={delta:function(){return 1},sigma:function(){return 2},stepSize:function(){return 1},direction:function(){return 0},colorTexture:function(){return e._colorGBuffer}},r={delta:function(){return 1},sigma:function(){return 2},stepSize:function(){return 1},direction:function(){return 1},colorTexture:function(){return e._blurXTexture}},n="#define USE_STEP_SIZE\n"+W$l;e._blurXCommand=t.createViewportQuadCommand(n,{uniformMap:i,pass:e._passType,owner:e}),e._blurXCommand.framebuffer=e._blurXFrameBuffer,e._blurXCommand.renderState=u$R.fromCache({viewport:_0x3ead81}),e._blurYCommand=t.createViewportQuadCommand(n,{uniformMap:r,pass:e._passType,owner:e}),e._blurYCommand.framebuffer=e._blurYFrameBuffer,e._blurYCommand.renderState=u$R.fromCache({viewport:_0x3ead81});var o={u_pointCloud_colorGBuffer:function(){return e._performance?e._blurYTexture:e._colorGBuffer},u_pointCloud_depthTexture:function(){return e._depthTexture},u_distancesAndEdlStrength:function(){return _0x4a06ab.x=e._radius/(t.drawingBufferWidth*_0x4e8a76),_0x4a06ab.y=e._radius/(t.drawingBufferHeight*_0x4e8a76),_0x4a06ab.z=e._strength,_0x4a06ab}},a=u$R.fromCache({blending:Ee$n.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0}}),s=new a$$({name:"S3MPointCloudEDLFp",sources:[_0x2e1f09]});e._edlShading&&s.defines.push("EDL_SHADING"),e._drawCommand=t.createViewportQuadCommand(s,{uniformMap:o,renderState:a,pass:e._passType,owner:e}),e._clearCommand=new r$11({framebuffer:e._framebuffer,color:new e$1S(0,0,0,0),depth:1,renderState:u$R.fromCache(),pass:e._passType,owner:e})}function _0x3fc7f9(e,t){var i=t.drawingBufferWidth*_0x4e8a76,r=t.drawingBufferHeight*_0x4e8a76;_0x3ead81.width=i,_0x3ead81.height=r;var n=_0xdced8.getColorGBuffer(),o=!1,a=e$28(n)&&(n.width!==i||n.height!==r);(!e$28(n)||a)&&(_0xdced8.destroyFrameBuffer(),_0xdced8.createFrameBuffer(t,_0x4e8a76));var s=e._edlShading!=e.edlShading;e._edlShading=e.edlShading;var l=e._colorGBuffer;return a=e._screenWidth!==i||e._screenHeight!==r,(!e$28(l)||a||s)&&(e._colorGBuffer=_0xdced8.getColorGBuffer(),e._depthTexture=_0xdced8.getDepthTexture(),e._framebuffer=_0xdced8.getFrameBuffer(),e._blurXFrameBuffer=_0xdced8.getBlurXFrameBuffer(),e._blurYFrameBuffer=_0xdced8.getBlurYFrameBuffer(),e._blurXTexture=_0xdced8.getBlurXTexture(),e._blurYTexture=_0xdced8.getBlurYTexture(),_0x15e2b0(e,t),o=!0),e._screenWidth=i,e._screenHeight=r,o}function _0xacdb95(e){return e.drawBuffers&&e.fragmentDepth}_0x4e48d2.isSupported=_0xacdb95;var _0x3ead81=new f$10;function _0x41b711(e,t){var i=e[t.id];if(!e$28(i)||i.viewport.width!=_0x3ead81.width||i.viewport.height!=_0x3ead81.height){var r=u$R.getState(t);r.viewport=_0x3ead81,i=u$R.fromCache(r),e[t.id]=i}return i}_0x4e48d2.prototype.update=function(e,t,i){if(_0xacdb95(e.context)){_0xdced8.setCurrentFrameBuffer(e.context._sharedEDL),this._strength=i.eyeDomeLightingStrength,this._radius=i.eyeDomeLightingRadius,this._performance=i.performance,this.edlShading=i.eyeDomeLighting,_0x4e8a76=i.performance?.5:1,this.textureScale=_0x4e8a76;var r,n=_0x3fc7f9(this,e.context),o=e.commandList,a=o.length;for(r=t;r<a;++r){var s=o[r];if(s.primitiveType===W$_.POINTS&&s.pass!==Le$p.TRANSLUCENT){var l=s.derivedCommands.pointCloudProcessor;(!e$28(l)||s.dirty||n||l.framebuffer!==this._framebuffer)&&(l=r$15.shallowClone(s),s.derivedCommands.pointCloudProcessor=l,l.framebuffer=this._framebuffer,l.renderState=_0x41b711(this._renderStateCache,l.renderState),l.castShadows=!1,l.receiveShadows=!1,l._pointCloudEyeDomeLighting=!0),o[r]=l}}var u=this._clearCommand,c=this._drawCommand;i.performance&&(o.push(this._blurXCommand),o.push(this._blurYCommand)),o.push(c),o.push(u)}},_0x4e48d2.prototype.isDestroyed=function(){return!1},_0x4e48d2.prototype.destroy=function(){return _0xdced8.removeRef(),i$Z(this)};var _0x3abcc4=(_0x2ffc95=!0,function(e,t){var i=_0x2ffc95?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2ffc95=!1,i}),_0x4047aa=_0x3abcc4(void 0,(function(){return _0x4047aa.toString().search("(((.+)+)+)+$").toString().constructor(_0x4047aa).search("(((.+)+)+)+$")})),_0x2ffc95;_0x4047aa();var V$j="attribute vec4 aPosition;\nattribute vec3 aTexCoord;\n#ifdef Volume\n attribute vec3 aRatio;\n varying vec3 vecRotioCoord;\n\tvarying vec2 vecHypTexCoord;\n#endif\nuniform float uGeometryHeight;\nvarying vec2 v_texCoord;\nvarying float v_face;\nvoid main()\n{\n v_texCoord = aTexCoord.xy;\n v_face = aTexCoord.z;\n#ifdef GEOCYLINDER\n v_texCoord.y = aPosition.z / uGeometryHeight;\n#endif\n#ifdef Volume\nvecRotioCoord = aRatio;\n#endif\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}",_0x2a8bbe=(_0x3ffc6b=!0,function(e,t){var i=_0x3ffc6b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3ffc6b=!1,i}),_0x48ae60=_0x2a8bbe(void 0,(function(){return _0x48ae60.toString().search("(((.+)+)+)+$").toString().constructor(_0x48ae60).search("(((.+)+)+)+$")})),_0x3ffc6b;_0x48ae60();var _0x212d6e="uniform sampler2D uClampTexture;\nuniform vec4 uClipPlaneColor;\nuniform float uUseColor;\nvoid main()\n{\nvec2 center = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\nvec4 clampColor = texture2D(uClampTexture, center);\nif(clampColor.r < 0.01 && clampColor.g < 0.01 && clampColor.b < 0.01)\n{\n discard;\n}\ngl_FragColor = mix(clampColor, uClipPlaneColor, uUseColor);\n}",_0x10354d=(_0x342bf1=!0,function(e,t){var i=_0x342bf1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x342bf1=!1,i}),_0x10bb51=_0x10354d(void 0,(function(){return _0x10bb51.toString().search("(((.+)+)+)+$").toString().constructor(_0x10bb51).search("(((.+)+)+)+$")})),_0x342bf1;_0x10bb51();var _0x24c6ad="void main()\n{\ngl_FragColor = vec4(1.0);\n}",_0xf1817d=(_0x35fa8f=!0,function(e,t){var i=_0x35fa8f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x35fa8f=!1,i}),_0x2eb53e=_0xf1817d(void 0,(function(){return _0x2eb53e.toString().search("(((.+)+)+)+$").toString().constructor(_0x2eb53e).search("(((.+)+)+)+$")})),_0x35fa8f;function _0x5077e8(e){this._layer=e,this._colorCommand=void 0,this._depthCommand=void 0,this._firstPoint=void 0,this._secondPoint=void 0,this._thirdPoint=void 0,this._boundingSphere=new i$19(new t$X(0,0,0),6378137),this._matModel=y$15.IDENTITY,this._attributeLocations={}}_0x2eb53e(),Object.defineProperties(_0x5077e8.prototype,{}),_0x5077e8.prototype.initialize=function(e,t){this._initialize||(this.createCommand(e,t),this._initialize=!0)},_0x5077e8.prototype.update=function(e,t,i){if(this.initialize(e,t),!t.passes.pick&&!t.passes.depth){if(t._fboState.frameBufferType==L$T.CLAMP)return void(e$28(this._depthCommand)&&i.push(this._depthCommand));e$28(this._colorCommand)&&i.push(this._colorCommand)}};var _0x54dd39=new t$X;function _0x55a05c(e){e$28(e)&&(e.vertexArray=e.vertexArray&&!e.vertexArray.isDestroyed()&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),e.renderState=void 0,e.uniformMap=void 0)}_0x5077e8.prototype.createVertices=function(e){var t=S$W.createTypedArray(S$W.FLOAT,9),i=0,r=1e3;return t[i++]=(this._firstPoint.x-e.x)*r,t[i++]=(this._firstPoint.y-e.y)*r,t[i++]=(this._firstPoint.z-e.z)*r,t[i++]=(this._secondPoint.x-e.x)*r,t[i++]=(this._secondPoint.y-e.y)*r,t[i++]=(this._secondPoint.z-e.z)*r,t[i++]=(this._thirdPoint.x-e.x)*r,t[i++]=(this._thirdPoint.y-e.y)*r,t[i++]=(this._thirdPoint.z-e.z)*r,t},_0x5077e8.prototype.createCommand=function(e,t){_0x55a05c(this._colorCommand),_0x55a05c(this._depthCommand);var i=S$W.createTypedArray(S$W.UNSIGNED_SHORT,3);i[0]=0,i[1]=1,i[2]=2,_0x54dd39.x=(this._firstPoint.x+this._secondPoint.x+this._thirdPoint.x)/3,_0x54dd39.y=(this._firstPoint.y+this._secondPoint.y+this._thirdPoint.y)/3,_0x54dd39.z=(this._firstPoint.z+this._secondPoint.z+this._thirdPoint.z)/3;var r=this.createVertices(_0x54dd39),n=h$W.createVertexBuffer({context:e,typedArray:r,usage:A$1c.STATIC_DRAW}),o=[];this._attributeLocations.aPosition=0,o.push({index:this._attributeLocations.aPosition,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1});var a=h$W.createIndexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),s={};y$15.fromRotationTranslation(p$1a.IDENTITY,_0x54dd39,s),this._matModel=s,this._depthCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matModel,boundingVolume:this._boundingSphere,pass:Le$p.S3MTiles,cull:!1}),this._depthCommand.vertexArray=new m$19({context:e,attributes:o,indexBuffer:a}),this._depthCommand.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:V$j,fragmentShaderSource:_0x24c6ad,attributeLocations:this._attributeLocations}),this._depthCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},depthMask:!0,colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this.createColorCommand(e,t)},_0x5077e8.prototype.createColorCommand=function(e,t){var i=r$15.shallowClone(this._depthCommand),r=this._depthCommand.shaderProgram.vertexShaderSource.clone();i.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:_0x212d6e,attributeLocations:this._attributeLocations});var n=this;i.uniformMap={uClampTexture:function(){var i=t._framebufferList.clampTexture;return e$28(i)?i.renderTexture._fb.getColorTexture(0):e.defaultTexture},uClipPlaneColor:function(){return n._layer._clipPlaneColor},uUseColor:function(){var e=n._layer._clipPlaneMode;return e===_0x3f3b8b.COLOR?1:(_0x3f3b8b.MODEL_COLOR,0)}},i.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},depthMask:!0}),i.pass=Le$p.S3MTiles-1,this._colorCommand=i},_0x5077e8.prototype.setPoints=function(e,t,i){this._initialize=!1,this._firstPoint=e,this._secondPoint=t,this._thirdPoint=i},_0x5077e8.prototype.destroy=function(){return _0x55a05c(this._colorCommand),this._colorCommand=void 0,_0x55a05c(this._depthCommand),this._depthCommand=void 0,i$Z(this)};var _0x5bf4f1=(_0x4bfebf=!0,function(e,t){var i=_0x4bfebf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4bfebf=!1,i}),_0x467c53=_0x5bf4f1(void 0,(function(){return _0x467c53.toString().search("(((.+)+)+)+$").toString().constructor(_0x467c53).search("(((.+)+)+)+$")})),_0x4bfebf;function _0x369b4a(e){this._enable=!1,this._speed=100,this._period=0,this._layer=e}_0x467c53(),Object.defineProperties(_0x369b4a.prototype,{enable:{get:function(){return this._enable},set:function(e){e!=this._enable&&(this._enable=e,this._layer.bloomEnableChange(e))}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}},period:{get:function(){return this._period/1e3},set:function(e){this._period=1e3*e}},maxBloomHeight:{get:function(){if(0==this._period)return Number.MAX_VALUE;var e=performance.now()%this._period;return this._speed*e/1e3}}});var e$B={Disjoint:0,Intersects:1,Contains:2},j$l=Object.freeze(e$B),_0x25bace=(_0x4209d5=!0,function(e,t){var i=_0x4209d5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4209d5=!1,i}),_0x2cc24a=_0x25bace(void 0,(function(){return _0x2cc24a.toString().search("(((.+)+)+)+$").toString().constructor(_0x2cc24a).search("(((.+)+)+)+$")})),_0x4209d5;function _0x349de1(){this._cache={},this._queue=new r$_}_0x2cc24a();var _0x41cc62=0,_0xa3699=104857600;_0x349de1.prototype.set=function(e,t,i){var r=e+"_"+t;if(!e$28(this._cache[r])){var n={id:r,buffer:i};for(this._cache[r]=n,this._queue.enqueue(r),_0x41cc62+=i.byteLength;_0x41cc62>_0xa3699;){var o=this._queue.dequeue(),a=this._cache[o];_0x41cc62-=a.buffer.byteLength,delete this._cache[o]}}},_0x349de1.prototype.get=function(e,t){var i=e+"_"+t,r=this._cache[i];if(e$28(r))return r.buffer},_0x349de1.prototype.contains=function(e,t){var i=e+"_"+t;return e$28(this._cache[i])},_0x349de1._singleInstance=void 0,_0x349de1.getSingleInstance=function(){return e$28(_0x349de1._singleInstance)||(_0x349de1._singleInstance=new _0x349de1),_0x349de1._singleInstance};var e$A={KeepOutside:1,KeepInside:2},V$i=Object.freeze(e$A),_0x12e7e8=(_0x320fa4=!0,function(e,t){var i=_0x320fa4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x320fa4=!1,i}),_0x1073ae=_0x12e7e8(void 0,(function(){return _0x1073ae.toString().search("(((.+)+)+)+$").toString().constructor(_0x1073ae).search("(((.+)+)+)+$")})),_0x320fa4;_0x1073ae();var Z$k="attribute vec4 aPosition;\nattribute vec3 aTexCoord0;\nattribute vec2 aTexCoord1;\nvarying float vHeight;\nvarying float regionHeight;\nvarying vec2 vTexCoord0;\nvarying vec2 vTexCoord1;\nvarying vec4 v_positionMC;\nvarying vec3 v_positionEC;\nvoid main()\n{\n vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n vHeight = aPosition.w;\n vTexCoord0 = aTexCoord0.xy;\n vTexCoord1 = aTexCoord1;\n regionHeight = aTexCoord0.z;\n gl_Position = pos;\n v_positionMC = vec4(aPosition.xyz, 1.0);\n v_positionEC = (czm_modelView * vec4(aPosition.xyz, 1.0)).xyz;\n}",_0x5988cf=(_0x5d889=!0,function(e,t){var i=_0x5d889?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5d889=!1,i}),_0x504399=_0x5988cf(void 0,(function(){return _0x504399.toString().search("(((.+)+)+)+$").toString().constructor(_0x504399).search("(((.+)+)+)+$")})),_0x5d889;_0x504399();var $$k="uniform sampler2D uColorTexture;\nuniform sampler2D uRasterTexture;\nuniform float uExtractHeight;\nvarying float vHeight;\nvarying vec2 vTexCoord0;\nvarying vec2 vTexCoord1;\nvarying float regionHeight;\nvarying vec4 v_positionMC;\nvarying vec3 v_positionEC;\n#ifdef NormalTexture\n uniform sampler2D uNormalTexture;\n#endif\nvec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n srgbIn = srgbIn;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n vec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else\n return linearIn;\n#endif\n}\nconst float M_PI = 3.141592653589793;\nvec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\nfloat smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\nfloat GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\nvec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR\n return czm_acesTonemapping(linearIn);\n#else\n return linearIn;\n#endif\n}\nvoid main()\n{\n float terrainHeight = czm_unpackValue(texture2D(uRasterTexture, vTexCoord0));\n if(terrainHeight < -10000.0 || terrainHeight > 20000.0){\n terrainHeight = 0.0;\n }\n if (vHeight > terrainHeight || vHeight < regionHeight) { \n discard;\n }\n#ifdef IsExtract\n if (vHeight < uExtractHeight) { \n discard;\n }\n#endif\n vec4 baseColorWithAlpha = texture2D(uColorTexture, vTexCoord1);\n baseColorWithAlpha = SRGBtoLINEAR4(baseColorWithAlpha);\n vec3 ng = normalize(czm_normal * czm_computeNormal(v_positionMC.xyz));\n#ifdef NormalTexture\n vec3 pos_dx = dFdx(v_positionEC);\n vec3 pos_dy = dFdy(v_positionEC);\n vec3 tex_dx = dFdx(vec3(vTexCoord1.xy, 0.0));\n vec3 tex_dy = dFdy(vec3(vTexCoord1.xy, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n vec3 n = texture2D(uNormalTexture, vTexCoord1.xy).rgb;\n n = normalize(tbn * (2.0 * n - 1.0));\n#else\n vec3 n = ng;\n#endif\n if(gl_FrontFacing)\n {\n n = -n;\n }\n vec3 baseColor = baseColorWithAlpha.rgb;\n float roughness = 1.0;\n float metalness = 0.0;\n vec3 v = -normalize(v_positionEC);\n vec3 lightColorHdr = vec3(5.0);\n vec3 l = normalize(czm_lightDirectionEC);\n vec3 h = normalize(v + l);\n float NdotL = clamp(dot(n, l), 0.001, 1.0);\n float NdotV = abs(dot(n, v)) + 0.001;\n float NdotH = clamp(dot(n, h), 0.0, 1.0);\n float LdotH = clamp(dot(l, h), 0.0, 1.0);\n float VdotH = clamp(dot(v, h), 0.0, 1.0);\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n vec3 specularColor = mix(f0, baseColor, metalness);\n float alpha = roughness * roughness;\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 r0 = specularColor.rgb;\n vec3 F = fresnelSchlick2(r0, r90, VdotH);\n float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n float D = GGX(alpha, NdotH);\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n float S = acos(LdotZenith);\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n float gamma = acos(NdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = 0.2 * (numerator / denominator);\n vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 IBLColor = (diffuseIrradiance * diffuseColor * 1.0) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * 1.0);\n float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n IBLColor *= lightColor;\n color += IBLColor * luminance;\n color = applyTonemapping(color);\n color = LINEARtoSRGB(color);\n gl_FragColor = vec4(color, 1.0);\n}",E$q={RGBA4:de$y.RGBA4,RGBA:de$y.RGBA,RGB5_A1:de$y.RGB5_A1,RGB565:de$y.RGB565,DEPTH_COMPONENT16:de$y.DEPTH_COMPONENT16,DEPTH_COMPONENT24:de$y.DEPTH_COMPONENT24,STENCIL_INDEX8:de$y.STENCIL_INDEX8,DEPTH_STENCIL:de$y.DEPTH_STENCIL,validate:function(e){return e===E$q.RGBA4||e===E$q.RGBA||e===E$q.RGB5_A1||e===E$q.RGB565||e===E$q.DEPTH_COMPONENT16||e===E$q.DEPTH_COMPONENT24||e===E$q.STENCIL_INDEX8||e===E$q.DEPTH_STENCIL}},M$q=Object.freeze(E$q);function o$C(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.context",e.context);var t=e.context,i=t._gl,r=e$1U.maximumRenderbufferSize,n=u$Y(e.format,M$q.RGBA4),o=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE),a=e$28(e.width)?e.width:i.drawingBufferWidth,s=e$28(e.height)?e.height:i.drawingBufferHeight,l=!1,u=u$Y(e.samples,0);u>0&&t.webgl2&&(l=!0);var c=G$t(t,n,o);if(!M$q.validate(n))throw new t$Z("Invalid format.");if(o$1u.typeOf.number.greaterThan("width",a,0),a>r)throw new t$Z("Width must be less than or equal to the maximum renderbuffer size ("+r+"). Check maximumRenderbufferSize.");if(o$1u.typeOf.number.greaterThan("height",s,0),s>r)throw new t$Z("Height must be less than or equal to the maximum renderbuffer size ("+r+"). Check maximumRenderbufferSize.");this._gl=i,this._format=n,this._width=a,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,this._renderbuffer),l?i.renderbufferStorageMultisample(i.RENDERBUFFER,u,c,a,s):i.renderbufferStorage(i.RENDERBUFFER,c,a,s),i.bindRenderbuffer(i.RENDERBUFFER,null)}function G$t(e,t,i){if(!e.webgl2)return t;var r=t;return t===de$y.RED&&(i===de$y.FLOAT&&(r=de$y.R32F),i===de$y.HALF_FLOAT&&(r=de$y.R16F),i===de$y.UNSIGNED_BYTE&&(r=de$y.R8)),t===de$y.RGB&&(i===de$y.FLOAT&&(r=de$y.RGB32F),i===de$y.HALF_FLOAT&&(r=de$y.RGB16F),i===de$y.UNSIGNED_BYTE&&(r=de$y.RGB8)),t===de$y.RGBA&&(i===de$y.FLOAT&&(r=de$y.RGBA32F),i===de$y.HALF_FLOAT&&(r=de$y.RGBA16F),i===de$y.UNSIGNED_BYTE&&(r=de$y.RGBA8)),r===de$y.R16F||r===de$y.R32F||r===de$y.RGBA16F||r===de$y.RGBA32F?e.colorBufferFloat:(r===de$y.RGB16F||r===de$y.RGB32F)&&console.warn("WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),r===de$y.DEPTH_STENCIL?r=de$y.DEPTH24_STENCIL8:r===de$y.DEPTH_COMPONENT&&(i===de$y.UNSIGNED_SHORT?r=de$y.DEPTH_COMPONENT16:i===de$y.UNSIGNED_INT&&(r=de$y.DEPTH_COMPONENT24)),r}function o$B(e){var t=new n$p(e);t.blendingEnabled=!0,t.viewport=new f$10,this._context=e,this._pixelDatatype=y$U.UNSIGNED_BYTE,this._fb=new a$z({context:e,colorTextures:[new L$17({context:e,width:1,height:1})],depthStencilRenderbuffer:new o$C({context:e,format:M$q.DEPTH_STENCIL})}),this._passState=t,this.mrtSupport=e.drawBuffers&&e.colorBufferFloat&&e.depthTexture,this.mrt=!1,this._mrt=!1,this._width=1,this._height=1,this._clearCommand=new r$11({color:new e$1S(0,0,0,0),stencil:0,depth:1}),this._clearCommand.framebuffer=this._fb}function t$g(e){this._renderTexture=new o$B(e),this._context=e,this._isUpdate=!0,this._beginFunc=void 0,this._endFunc=void 0,this._useColor=!0,this._useHeight=!0,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!1,isUnderGlobeVisible:!1,isOnlyS3MObjectVisible:!1};var t=e._gl,i=e$28(e._currentFramebuffer)?e._currentFramebuffer._framebuffer:null;t.bindFramebuffer(t.FRAMEBUFFER,i)}Object.defineProperties(o$C.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),o$C.prototype._getRenderbuffer=function(){return this._renderbuffer},o$C.prototype.isDestroyed=function(){return!1},o$C.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),i$Z(this)},o$B.prototype.update=function(e){var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=de$y.FRAMEBUFFER_COMPLETE;if(!e$28(this._fb)||this._width!==i||this._height!==r||this.mrt!==this._mrt){this._width=i,this._height=r,this._fb=this._fb&&this._fb.destroy();var o=[new L$17({context:t,width:i,height:r,pixelDatatype:this._pixelDatatype,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})];this.mrt!==this._mrt&&this.mrt&&this.mrtSupport&&o.push(new L$17({context:t,width:i,height:r,pixelDatatype:this._pixelDatatype,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})),this._fb=new a$z({context:t,colorTextures:o,depthStencilRenderbuffer:new o$C({context:t,format:M$q.DEPTH_STENCIL})}),this._clearCommand.framebuffer=this._fb,this._passState.framebuffer=this._fb,this._mrt=this.mrt,this._fb.status!==n&&(this._fb=this._fb&&this._fb.destroy())}this._clearCommand.execute(t,this._passState)},o$B.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),i$Z(this)},Object.defineProperties(t$g.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},useType:{get:function(){return this._useHeight<<2|this._useColor<<1|this._isDepth},set:function(e){this._useHeight=(4&e)>0?1:0,this._useColor=(2&e)>0?1:0,this._isDepth=1&e}},frameBufferType:{get:function(){return L$T.RASTER}}}),t$g.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this._beginFunc&&this._beginFunc(e),this._renderTexture._passState},t$g.prototype.end=function(e){this._endFunc&&this._endFunc(e)},t$g.prototype.update=function(e,t){},t$g.prototype.isDestroyed=function(){return!1},t$g.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)};var Ee$9="attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n",Zi$1="uniform sampler2D u_LineTexture;\nuniform float u_texelOffset;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 maxValues = vec4(0.0);\nfloat halfCoreSize = float(CORESIZE) / 2.0;\nfor(int y = 0; y < CORESIZE; y++){\nfor(int x = 0; x < CORESIZE; x++){\nfloat offsetX = (-halfCoreSize + float(x)) * u_texelOffset;\nfloat offsetY = (-halfCoreSize + float(y)) * u_texelOffset;\nvec2 realTexCoord = v_textureCoordinates + vec2(offsetX, offsetY);\nif(realTexCoord.x > 1.0 || realTexCoord.x < 0.0 || realTexCoord.y > 1.0 || realTexCoord.y < 0.0){\ncontinue;\n}\nvec4 color = texture2D(u_LineTexture, realTexCoord);\nmaxValues = max(maxValues, color);\n}\n}\nif(maxValues.a < 0.01){\ndiscard;\n}\ngl_FragColor = maxValues;\n}\n",ji$3="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",X$d="#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",I$A={FAILED:0,UNLOADED:1,RECEIVING:2,UNZIP:3,UNZIPING:4,RECEIVED:5,TRANSFORMING:6,TRANSFORMED:7,READY:8,INVALID:9},De$d=Object.freeze(I$A),D$t={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>=D$t.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}},p$m=32767,L$q=p$m/2|0,te$f=new t$X,nt$8=new t$X,at$8=new t$X,o$A=new t$W,qe$5=new o$1k,st$4=[],Ge$7=[],ot$7=[],ht$5=[],dt$7=[],ut$6=[],ft$5=[],ct$6=new t$X,vt$5=new i$19,gt$6=new x$13,lt$6=new o$1k;function Ce$9(){}function He$b(e,t){var i;return"function"==typeof e.slice&&("function"!=typeof(i=e.slice()).sort&&(i=void 0)),e$28(i)||(i=Array.prototype.slice.call(e)),i.sort(t),i}function Ve$b(e,t,i,r,n,o,a,s,l,u,c){var h=s.north,d=s.south,f=s.east,p=s.west;f<p&&(f+=e$27.TWO_PI);for(var _=i.length,m=0;m<_;++m){var $=i[m],g=n[$],v=o[$];o$A.longitude=e$27.lerp(p,f,v.x)+u,o$A.latitude=e$27.lerp(d,h,v.y)+c,o$A.height=g-l;var y=a.cartographicToCartesian(o$A,te$f);t=r.encode(e,t,y,v,o$A.height,qe$5,0)}}function I$z(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}I$z.prototype.clone=function(e){return e$28(e)||(e=new I$z),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},I$z.prototype.initializeIndexed=function(e,t,i,r){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=i,this.index=r,this.first=void 0,this.second=void 0,this.ratio=void 0},I$z.prototype.initializeFromClipResult=function(e,t,i){var r=t+1;return-1!==e[t]?i[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=i[e[r]],++r,this.second=i[e[r]],++r,this.ratio=e[r],++r),r},I$z.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},I$z.prototype.isIndexed=function(){return e$28(this.index)},I$z.prototype.getH=function(){return e$28(this.index)?this.heightBuffer[this.index]:e$27.lerp(this.first.getH(),this.second.getH(),this.ratio)},I$z.prototype.getU=function(){return e$28(this.index)?this.uBuffer[this.index]:e$27.lerp(this.first.getU(),this.second.getU(),this.ratio)},I$z.prototype.getV=function(){return e$28(this.index)?this.vBuffer[this.index]:e$27.lerp(this.first.getV(),this.second.getV(),this.ratio)};var A$v=[];function We$9(e,t,i,r,n,o,a){if(0!==o.length){for(var s=0,l=0;l<o.length;)l=A$v[s++].initializeFromClipResult(o,l,a);for(var u=0;u<s;++u){var c=A$v[u];if(c.isIndexed())c.newIndex=n[c.index],c.uBuffer=e,c.vBuffer=t,c.heightBuffer=i;else{var h=c.getKey();if(e$28(n[h]))c.newIndex=n[h];else{var d=e.length;e.push(c.getU()),t.push(c.getV()),i.push(c.getH()),c.newIndex=d,n[h]=d}}}3===s?(r.push(A$v[0].newIndex),r.push(A$v[1].newIndex),r.push(A$v[2].newIndex)):4===s&&(r.push(A$v[0].newIndex),r.push(A$v[1].newIndex),r.push(A$v[2].newIndex),r.push(A$v[0].newIndex),r.push(A$v[2].newIndex),r.push(A$v[3].newIndex))}}A$v.push(new I$z),A$v.push(new I$z),A$v.push(new I$z),A$v.push(new I$z),Ce$9.createTerrainMesh=function(e,t){var i=e.tilingScheme.ellipsoid,r=e.rectangle,n=t._quantizedVertices,o=n.length/3,a=t._westIndices.length+t._eastIndices.length+t._southIndices.length+t._northIndices.length,s=r.west,l=r.south,u=r.east,c=r.north,h=1*t._minimumHeight,d=1*t._maximumHeight,f=t$M.geodeticLatitudeToMercatorAngle(l),p=1/(t$M.geodeticLatitudeToMercatorAngle(c)-f),_=t._boundingSphere.center,m=n.subarray(0,o),$=n.subarray(o,2*o),g=n.subarray(2*o,3*o),v=new Array(o),y=new Array(o),x=new Array(o),b=new Array(o),w=nt$8;w.x=Number.POSITIVE_INFINITY,w.y=Number.POSITIVE_INFINITY,w.z=Number.POSITIVE_INFINITY;var C=at$8;C.x=Number.NEGATIVE_INFINITY,C.y=Number.NEGATIVE_INFINITY,C.z=Number.NEGATIVE_INFINITY;for(var T=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,P=0;P<o;++P){var I,M;if(t.wasCreatedByUpsampling()){var O=m[P],D=$[P];I=O/p$m,M=D/p$m,o$A.longitude=e$27.lerp(s,u,I),o$A.latitude=e$27.lerp(l,c,M),o$A.height=g[P]}else o$A.longitude=m[P],o$A.latitude=$[P],o$A.height=g[P],I=(o$A.longitude-s)/r.width,M=(o$A.latitude-l)/r.height;T=Math.min(o$A.longitude,T),S=Math.max(o$A.longitude,S),E=Math.min(o$A.latitude,E),A=Math.max(o$A.latitude,A);var R=i.cartographicToCartesian(o$A);v[P]=new o$1k(I,M),y[P]=o$A.height,x[P]=R,b[P]=(t$M.geodeticLatitudeToMercatorAngle(o$A.latitude)-f)*p}var L,B,N=He$b(t._westIndices,(function(e,t){return v[e].y-v[t].y})),F=He$b(t._eastIndices,(function(e,t){return v[t].y-v[e].y})),z=He$b(t._southIndices,(function(e,t){return v[t].x-v[e].x})),k=He$b(t._northIndices,(function(e,t){return v[e].x-v[t].x}));B=i$19.fromPoints(x),L=x$13.fromRectangle(r,h,d,i),_=t$X.clone(B.center);var V=m$1b.eastNorthUpToFixedFrame(_,i),U=y$15.inverseTransformation(V,new y$15);for(P=0;P<o;P++){R=x[P];y$15.multiplyByPoint(U,R,te$f),t$X.minimumByComponent(te$f,w,w),t$X.maximumByComponent(te$f,C,C)}for(var X=new h$T(new e$1Y(w,C,_),h,d,V,!1,!0),H=X.getStride(),G=new Float32Array(o*H+a*H),W=0,Y=0;Y<o;++Y)W=X.encode(G,W,x[Y],v[Y],y[Y],qe$5,b[Y]);var q=Math.max(0,2*(a-4)),j=t._indices.length+3*q,Z=ce$v.createTypedArray(o+a,j);Z.set(t._indices,0);var K=1e-4,Q=(S-T)*K,J=(A-E)*K,ee=-Q,te=Q,ie=J,re=-J,ne=o*H;Ve$b(G,ne,N,X,y,v,i,r,t._westSkirtHeight,ee,0),Ve$b(G,ne+=t._westIndices.length*H,z,X,y,v,i,r,t._southSkirtHeight,0,re),Ve$b(G,ne+=t._southIndices.length*H,F,X,y,v,i,r,t._eastSkirtHeight,te,0),Ve$b(G,ne+=t._eastIndices.length*H,k,X,y,v,i,r,t._northSkirtHeight,0,ie),I$1i.addSkirtIndices(N,z,F,k,o,Z,t._indices.length,void 0);var oe=t._quantizedVertices.length/3,ae=oe+t._westIndices.length+t._southIndices.length+t._eastIndices.length+t._northIndices.length,se=ce$v.createTypedArray(ae,Z.buffer),le=0===se.length;return t._mesh=new T$T(_,G,se,t._indices.length,oe,h,d,B,void 0,H,L,X,1,N,z,F,k,le),t._quantizedVertices=void 0,t._encodedNormals=void 0,t._indices=void 0,t._uValues=void 0,t._vValues=void 0,t._heightValues=void 0,t._westIndices=void 0,t._southIndices=void 0,t._eastIndices=void 0,t._northIndices=void 0,t._mesh},Ce$9.upsampleTerrainData=function(e,t){var i=e.parent;if(e$28(i)&&e$28(i.data)&&e$28(t)){var r=t,n=i.x,o=i.y;i.level;var a=r._mesh;if(e$28(a)){var s=2*n!==e.x,l=2*o===e.y,u=e.tilingScheme,c=u.ellipsoid,h=u.tileXYToRectangle(e.x,e.y,e.level),d=s?L$q:0,f=s?p$m:L$q,p=l?L$q:0,_=l?p$m:L$q,m=ht$5,$=dt$7,g=ut$6;m.length=0,$.length=0,g.length=0;var v=ft$5;v.length=0;var y={},x=a.vertices,b=a.indices;b=b.subarray(0,a.indexCountWithoutSkirts);var w=a.encoding,C=a.exaggeration,T=0,S=a.vertexCountWithoutSkirts;r._minimumHeight,r._maximumHeight;var E,A,P,I,M,O=new Array(S),D=new Array(S),R=new Array(S);for(A=0,P=0;A<S;++A,P+=2){var L=w.decodeTextureCoordinates(x,A,lt$6);E=w.decodeHeight(x,A)/C,I=e$27.clamp(L.x*p$m|0,0,p$m),M=e$27.clamp(L.y*p$m|0,0,p$m),R[A]=E,I<20&&(I=0),M<20&&(M=0),p$m-I<20&&(I=p$m),p$m-M<20&&(M=p$m),O[A]=I,D[A]=M,(s&&I>=L$q||!s&&I<=L$q)&&(l&&M>=L$q||!l&&M<=L$q)&&(y[A]=T,m.push(I),$.push(M),g.push(R[A]),++T)}var B=[];B.push(new I$z),B.push(new I$z),B.push(new I$z);var N,F=[];for(F.push(new I$z),F.push(new I$z),F.push(new I$z),A=0;A<b.length;A+=3){var z=b[A],k=b[A+1],V=b[A+2],U=O[z],X=O[k],H=O[V];B[0].initializeIndexed(O,D,R,z),B[1].initializeIndexed(O,D,R,k),B[2].initializeIndexed(O,D,R,V);var G=d$19.clipTriangleAtAxisAlignedThreshold(L$q,s,U,X,H,st$4);!((N=0)>=G.length)&&(!((N=F[0].initializeFromClipResult(G,N,B))>=G.length)&&(!((N=F[1].initializeFromClipResult(G,N,B))>=G.length)&&(N=F[2].initializeFromClipResult(G,N,B),We$9(m,$,g,v,y,d$19.clipTriangleAtAxisAlignedThreshold(L$q,l,F[0].getV(),F[1].getV(),F[2].getV(),Ge$7),F),N<G.length&&(F[2].clone(F[1]),F[2].initializeFromClipResult(G,N,B),We$9(m,$,g,v,y,d$19.clipTriangleAtAxisAlignedThreshold(L$q,l,F[0].getV(),F[1].getV(),F[2].getV(),Ge$7),F)))))}var W=s?-p$m:0,Y=l?-p$m:0,q=[],j=[],Z=[],K=[],Q=Number.MAX_VALUE,J=-Q,ee=ot$7;ee.length=0;var te=h,ie=te.north,re=te.south,ne=te.east,oe=te.west;for(ne<oe&&(ne+=e$27.TWO_PI),A=0;A<m.length;++A)(I=Math.round(m[A]))<=d?(q.push(A),I=0):I>=f?(Z.push(A),I=p$m):I=2*I+W,m[A]=I,(M=Math.round($[A]))<=p?(j.push(A),M=0):M>=_?(K.push(A),M=p$m):M=2*M+Y,$[A]=M,(E=g[A])<Q&&(Q=E),E>J&&(J=E),g[A]=E,o$A.longitude=e$27.lerp(oe,ne,I/p$m),o$A.latitude=e$27.lerp(re,ie,M/p$m),o$A.height=E,c.cartographicToCartesian(o$A,te$f),ee.push(te$f.x),ee.push(te$f.y),ee.push(te$f.z);var ae=i$19.fromVertices(ee,t$X.ZERO,3,vt$5),se=x$13.fromRectangle(te,Q,J,c,gt$6),le=new s$W(c).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(ae.center,ee,3,ae.center,Q,ct$6),ue=new Float64Array(m.length+$.length+g.length);for(A=0;A<m.length;++A)ue[A]=m[A];var ce=m.length;for(A=0;A<$.length;++A)ue[ce+A]=$[A];for(ce+=$.length,A=0;A<g.length;++A)ue[ce+A]=g[A];var he=ce$v.createTypedArray(m.length,v),de=new Float64Array(ue.buffer),fe=ce$v.createTypedArray(de.length/3,he.buffer),pe=Math.min(r._westSkirtHeight,r._eastSkirtHeight);pe=Math.min(pe,r._southSkirtHeight),pe=Math.min(pe,r._northSkirtHeight);var _e=r._credits;if(0!==de.length)return new p$_({quantizedVertices:de,indices:fe,minimumHeight:Q,maximumHeight:J,boundingSphere:ae,orientedBoundingBox:se,horizonOcclusionPoint:le,westIndices:q,southIndices:j,eastIndices:Z,northIndices:K,westSkirtHeight:0,southSkirtHeight:0,eastSkirtHeight:0,northSkirtHeight:0,childTileMask:0,credits:_e,createdByUpsampling:!0})}}},Ce$9.createTerrainData=function(e,t,i,r,n){e.data,e.rectangle;var o=[].concat(t$X.unpackArray(t.attributes.position.values)),a=o.length,s=new Float64Array(3*a);for(let t=0;t<a;t++){var l=o[t];t$W.fromCartesian(l,void 0,o$A);var u=o$A.height;if(e$28(n)){var c=wt$6(e,o$A);u=n+(c>0?c:0)}s[t]=o$A.longitude,s[a+t]=o$A.latitude,s[2*a+t]=u}return new p$_({quantizedVertices:s,indices:t.indices,encodedNormals:void 0,minimumHeight:i,maximumHeight:r,boundingSphere:new i$19,orientedBoundingBox:new x$13,horizonOcclusionPoint:new t$X,westIndices:[],southIndices:[],eastIndices:[],northIndices:[],westSkirtHeight:0,southSkirtHeight:0,eastSkirtHeight:0,northSkirtHeight:0,childTileMask:0,credits:void 0,createdByUpsampling:!1})};var mt$3=new t$X,Ke$6=new t$X,pt$6=new t$W,It$6=new f$18;function wt$6(e,t){if(!e$28(t))throw new DeveloperError("cartographic is required");for(;e._lastSelectionResult===D$t.REFINED;)e=Ue$b(e.southwestChild,t)||Ue$b(e.southeastChild,t)||Ue$b(e.northwestChild,t)||e.northeastChild;if(e$28(e.data)&&e$28(e.data.renderedMesh)){var i=e.tilingScheme.ellipsoid,r=t$X.fromRadians(t.longitude,t.latitude,0,i,mt$3),n=It$6,o=i.geodeticSurfaceNormal(r,n.direction);if(!e$28(i.getSurfaceNormalIntersectionWithZAxis(r,11500,n.origin))){var a=Math.min(defaultValue(e.data.minimumHeight,0),-11500),s=t$X.multiplyByScalar(o,Math.abs(a)+1,Ke$6);t$X.subtract(r,s,n.origin)}if(e$28(e.data.terrainData)&&e.data.terrainData instanceof p$_)return e.data.terrainData.interpolateHeight(e.rectangle,t.longitude,t.latitude);var l=e.data.pick(n,void 0,void 0,!1,Ke$6);if(e$28(l))return i.cartesianToCartographic(l,pt$6).height}}function Ue$b(e,t){return h$10.contains(e.rectangle,t)?e:void 0}function x$s(e){this.terrainLayer=e,this.terrainData=void 0,this.vertexArray=void 0,this.terrainState=De$d.UNLOADED,this.mesh=void 0,this.orientedBoundingBox=void 0,this.occludeePointInScaledSpace=new t$X,this._rasterTerrainFBO=void 0,this._rasterTerrainTexture=void 0,this._rasterized=!1,this._rasterTextureSize=256}function $$j(e,t,i,r,n){function o(i){e.request=void 0,e$28(i)?"cacheError"!==i?"cacheInvalid"!==i?(e.terrainData=i,e.terrainState=De$d.RECEIVED,t._isTerrainZ&&0!==n&&(e.terrainState=De$d.UNZIP,e.zipTerrainData=i,e.terrainData=void 0)):e.terrainState=De$d.FAILED:s(!1):e.terrainState=De$d.FAILED}function a(){if(e.request.state===W$14.CANCELLED)return e.terrainData=void 0,e.terrainState=De$d.UNLOADED,void(e.request=void 0);e.terrainState=De$d.FAILED,e.request=void 0;var o="Failed to obtain terrain tile X: "+i+" Y: "+r+" Level: "+n+".";t._requestError=l$13.handleError(t._requestError,t,t.errorEvent,o,i,r,n,s)}function s(s){var l=new r$1c({throttle:!1,throttleByServer:!0,type:$$13.TERRAIN});l.cacheEnable=s,e.request=l;var u=t.requestTileGeometry(i,r,n,l);e$28(u)?(e.terrainState=De$d.RECEIVING,o$1q(u,o,a)):(e.terrainState=De$d.UNLOADED,e.request=void 0)}s(!0)}function ee$f(e,t,i,r,n,o,a){var s=t.parent;if(s){var l=s.data.terrain[e.terrainLayer.terrainProvider.tablename];if(e$28(l)){var u=l.terrainData,c=s.x,h=s.y,d=s.level;if(e$28(u)){var f=u.upsample(r.tilingScheme,c,h,d,n,o,a);!e$28(f)||(e.terrainState=De$d.RECEIVING,o$1q(f,(function(t){if(e$28(t)){var i=u.rasterVertex,r=u.rasterIndex,a=void 0,s=u.hasInvalid;if(e$28(i)){var l=new y$15(2,0,0,0,0,2,0,0,0,0,1,0,0,0,0,1);n%c==1&&(l[12]=-32767),o%h==0&&(l[13]=-32767),e$28(u.modelMatrix)?(a=new y$15,a=y$15.multiply(l,u.modelMatrix,a)):a=l,t.rasterVertex=i,t.rasterIndex=r,t.modelMatrix=a,t.hasInvalid=s}e.terrainData=t,e.terrainState=De$d.RECEIVED}else e.terrainState=De$d.INVALID}),(function(){e.terrainState=De$d.FAILED})))}}}else t.state=QuadtreeTileLoadState.FAILED}function re$a(e,t,i,r,n){var o=t.unzip(e.zipTerrainData.buffer);e$28(o)&&(e.terrainState=De$d.UNZIPING,o$1q(o,(function(i){if(!e$28(i))return e.terrainState=De$d.FAILED,e.zipTerrainData=void 0,void(e.terrainData=void 0);e.terrainState=De$d.RECEIVED,e.terrainData=t.createTerrainData(e.zipTerrainData,i.data.buffer,!0),e.zipTerrainData=void 0}),(function(t){e.terrainState=De$d.FAILED})))}function te$e(e,t,i,r,n,o){var a=i.tilingScheme,s=e.terrainData.createMesh(a,r,n,o,t.terrainExaggeration);!e$28(s)||(e.terrainState=De$d.TRANSFORMING,o$1q(s,(function(t){e.mesh=t,e.orientedBoundingBox=x$13.clone(t.orientedBoundingBox,e.orientedBoundingBox),e.occludeePointInScaledSpace=t$X.clone(t.occludeePointInScaledSpace,e.occludeePointInScaledSpace),e.terrainState=De$d.TRANSFORMED}),(function(){e.terrainState=De$d.FAILED})))}function R$m(){this.context=void 0,this.tileTerrain=void 0,this.mesh=void 0}x$s.prototype.freeResources=function(){this._rasterTerrainTexture=this._rasterTerrainTexture&&!this._rasterTerrainTexture.isDestroyed()&&this._rasterTerrainTexture.destroy(),this._rasterTerrainFBO=this._rasterTerrainFBO&&!this._rasterTerrainFBO.isDestroyed()&&this._rasterTerrainFBO.destroy(),this._rasterTerrainFBO=void 0},Object.defineProperties(x$s.prototype,{name:{get:function(){return this.terrainLayer.terrainProvider.tablename}}}),x$s.prototype.processStateMachine=function(e,t){var i=this.terrainLayer.terrainProvider;if(i._ready){var r=e.parent;if(e$28(r)&&e$28(r.data)){var n=r.data.terrain[i.tablename];if(e$28(n)&&this.terrainState===De$d.FAILED)void 0!==n.terrainData&&!1!==n.terrainData.canUpsample||n.processStateMachine(r,t)}this.terrainState===De$d.FAILED&&ee$f(this,e,t,i,e.x,e.y,e.level),this.terrainState===De$d.UNLOADED&&$$j(this,i,e.x,e.y,e.level),this.terrainState===De$d.UNZIP&&re$a(this,i,e.x,e.y,e.level),this.terrainState===De$d.RECEIVED&&te$e(this,t,i,e.x,e.y,e.level),this.terrainState===De$d.TRANSFORMED&&ae$d(t,this,t.context,i,e.x,e.y,e.level),this.terrainState,De$d.INVALID}},R$m.prototype.set=function(e,t,i,r){this.context=e,this.tileTerrain=t,this.mesh=i,this.terrainProvider=r},R$m.prototype.execute=function(){var e=this.context,t=this.mesh,i=this.tileTerrain;!1===this.terrainProvider.isShowGlobe&&t.invalid?i.vertexArray=void 0:i.vertexArray=c$l._createVertexArrayForMesh(e,t)};var C$o=new R$m;function ae$d(e,t,i,r,n,o,a){C$o.set(i,t,t.mesh,r),e.jobScheduler.execute(C$o,2)&&(t.terrainState=De$d.READY)}x$s.prototype.createRealtimeRasterTerrainFBO=function(e){this._rasterTerrainTexture=new L$17({context:e.context,width:this._rasterTextureSize,height:this._rasterTextureSize,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}),this._rasterTerrainFBO=new a$z({context:e.context,colorTextures:[this._rasterTerrainTexture],destroyAttachments:!1})};var ie$b=new f$10(0,0,256,256);function c$l(){this.terrain={},this.imagery=[],this.gridImagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new e$25(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 t$X,this.tileTerrainOrientedBoundingBox=void 0,this.terrainState=De$d.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new i$19,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1,this.normalTexture=void 0,this.normalTextureTranslationAndScale=new e$25(0,0,1,1),this.modifyTerrainData=void 0,this.modifyTerrainMesh=void 0,this.modifyTerrainVertexArray=void 0,this.modifyOrientedBoundingBox=void 0,this.subDivisionMesh=void 0,this.subDivisionVertexArray=void 0,this.invalid=!1,this.invalidMesh=void 0,this.invalidOrientedBoundingBox=void 0,this.invalidOccludeePointInScaledSpace=void 0,this.invalidVertexArray=void 0,this.invalidTerrainData=void 0}function C$n(e,t,i,r,n,o){if(e.decodePosition(r,n,o),e$28(t)&&t!==P$$.SCENE3D){var a=i.ellipsoid.cartesianToCartographic(o);i.project(a,o),t$X.fromElements(o.z,o.x,o.y,o)}return o}x$s.prototype.realtimeRasterValidTerrain=function(e,t,i){if(!(this._rasterized||i.level<2)&&e$28(this.terrainData)){this._rasterized=!0;var r=void 0,n=void 0,o=y$15.IDENTITY;if(e$28(this.terrainData)){r=this.terrainData.rasterIndex,n=this.terrainData.rasterVertex;e$28(this.terrainData.modelMatrix)&&(o=this.terrainData.modelMatrix)}if(!e$28(n))return void(e$28(this._rasterTerrainFBO)&&(i._clearCommand.framebuffer=this._rasterTerrainFBO,i._clearCommand.execute(e.context)));e$28(this._rasterTerrainTexture)||this.createRealtimeRasterTerrainFBO(e);var a=t._rasterAAFBOs[0];i._clearCommand.framebuffer=a,i._clearCommand.execute(e.context),i._clearCommand.framebuffer=this._rasterTerrainFBO,i._clearCommand.execute(e.context);var s=i.setRasterValidTerrainCamera(i,e);if(e$28(n)){var l=h$W.createVertexBuffer({context:e.context,typedArray:n,usage:A$1c.STATIC_DRAW}),u=h$W.createIndexBuffer({context:e.context,typedArray:r,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.fromSizeInBytes(r.BYTES_PER_ELEMENT)});u.vertexArrayDestroyable=!1,u.referenceCount=1;var c,h=[{index:0,vertexBuffer:l,componentDatatype:S$W.SHORT,componentsPerAttribute:3,offsetInBytes:0,strideInBytes:3*S$W.getSizeInBytes(S$W.SHORT)}],d=new m$19({context:e.context,attributes:h,indexBuffer:u}),f=["attribute vec4 position;","void main()","{"," gl_Position = czm_modelViewProjection * vec4(position.xy, 0.0, 1.0);","}"].join("\n"),p=["void main()","{"," gl_FragColor = czm_packValue(0.0);","}"].join("\n"),_=new a$$({sources:[f]}),m=new a$$({sources:[p]});(c=new r$15).cull=!1,c.boundingVolume=new i$19(t$X.ZERO,65535),c.shaderProgram=S$T.fromCache({context:e.context,vertexShaderSource:_,fragmentShaderSource:m,attributeLocations:{position:0}}),c.modelMatrix=o,c.primitiveType=W$_.TRIANGLES,c.vertexArray=d,c.count=r.length,c.pass=2,c.renderState=u$R.fromCache({viewport:ie$b}),c.framebuffer=this._rasterTerrainFBO,c.execute(e.context)}i.resetCamera(e,s)}},Object.defineProperties(c$l.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=!(e===De$d.RECEIVING||e===De$d.TRANSFORMING),i=this.imagery,r=0,n=i.length;t&&r<n;++r){var o=i[r];t=!e$28(o.loadingImagery)||o.loadingImagery.state!==_t$6.TRANSITIONING}return t}},renderedMesh:{get:function(){return e$28(this.subDivisionVertexArray)?this.subDivisionMesh:e$28(this.vertexArray)?this.mesh:e$28(this.fill)?this.fill.mesh:void 0}}});var te$d=new t$X,ie$a=new t$X,ne$g=new t$X;function oe$b(e,t,i,r){var n=t.getTileDataAvailable(e.x,e.y,e.level);if(!e$28(n)&&e$28(e.parent)){var o=e.parent,a=o.data;e$28(a)&&e$28(a.terrainData)&&(n=a.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}!1===n&&(e.data.terrainState=De$d.FAILED);for(var s=0,l=r.length;s<l;++s){var u=r.get(s);u.show&&u._createTileImagerySkeletons(e,t)}}function de$c(e){var t=void 0;return e$28(e.parent)&&e$28(e.parent._childTileMaskExt)&&(t=e.x%e.parent.x==0?e.y%e.parent.y==0?e.parent._childTileMaskExt[0]:e.parent._childTileMaskExt[2]:e.y%e.parent.y==0?e.parent._childTileMaskExt[1]:e.parent._childTileMaskExt[3]),t}function se$9(e,t,i,r,n,o){var a=e.data,s=e.parent,l=!1;for(var u in a.terrain)a.terrain[u].processStateMachine(e,t),a.terrain[u].terrainState===De$d.FAILED&&(l=!0);if((a.terrainState===De$d.FAILED||l)&&void 0!==s)if(void 0!==s.data&&void 0!==s.data.terrainData&&!1!==s.data.terrainData.canUpsample){if(l)for(var u in s.data.terrain)(!e$28(s.data.terrain[u].terrainData)||0==s.data.terrain[u].terrainData.canUpsample)&&s.data.terrain[u].processStateMachine(s,t)}else c$l.processStateMachine(s,t,i,r,n,!0);if(a.terrainState===De$d.FAILED&&fe$c(a,e,t,i,e.x,e.y,e.level),a.terrainState===De$d.UNLOADED){var c=de$c(e);ue$9(a,i,e.x,e.y,e.level,c)}if(a.terrainState===De$d.UNZIP&&he$a(a,i,e.x,e.y,e.level),a.terrainState===De$d.RECEIVED&&(e$28(a.terrainData)&&(e._childTileMaskExt=a.terrainData._childTileMaskExt),e.showInvalid&&!a.invalid&&a.setShowInvalid(),me$e(a,t,i,e.x,e.y,e.level)),a.terrainState===De$d.TRANSFORMED&&ce$d(t,a,t.context,i,e.x,e.y,e.level,o),a.terrainState!==De$d.INVALID){var h;if(a.terrainState>=De$d.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask)if(void 0!==a.terrainData.waterMask)le$b(t.context,a);else e$28(h=a._findAncestorTileWithTerrainData(e))&&e$28(h.data.waterMaskTexture)&&(a.waterMaskTexture=h.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,h,a.waterMaskTranslationAndScale));if(a.terrainState>=De$d.RECEIVED&&void 0===a.normalTexture&&i.hasNormalBuffer)if(void 0!==a.terrainData._normalTexture)ye$d(t.context,a);else e$28(h=a._findAncestorTileWithTerrainData(e))&&e$28(h.data.normalTexture)&&(a.normalTexture=h.data.normalTexture,++a.normalTexture.referenceCount,a._computeNormalTextureTranslationAndScale(e,h,a.normalTextureTranslationAndScale))}}function fe$c(e,t,i,r,n,o,a){var s=t.parent;if(s){var l=s.data.terrainData,u=s.x,c=s.y,h=s.level;if(e$28(l)){var d=l.upsample(r.tilingScheme,u,c,h,n,o,a);!e$28(d)||(e.terrainState=De$d.RECEIVING,o$1q(d,(function(t){if(e$28(t)){e.terrainData=t;var i=s.data.invalidTerrainData;if(e$28(i)){var l=i.upsample(r.tilingScheme,u,c,h,n,o,a);if(!e$28(l))return void(e.terrainState=De$d.FAILED);o$1q(l,(function(t){e$28(t)?(e.invalidTerrainData=t,e.terrainState=De$d.RECEIVED,e.invalid=s.data.invalid):e.terrainState=De$d.INVALID}))}else e.terrainState=De$d.RECEIVED,e.invalid=s.data.invalid}else e.terrainState=De$d.INVALID}),(function(){e.terrainState=De$d.FAILED})))}}else t.state=re$B.FAILED}function ue$9(e,t,i,r,n,o){function a(i){e.request=void 0,e$28(i)?"cacheError"!==i?"cacheInvalid"!==i?(e.terrainData=i,e.terrainState=De$d.RECEIVED,t._isTerrainZ&&0!==n&&(e.terrainState=De$d.UNZIP,e.zipTerrainData=i,e.terrainData=void 0)):e.terrainState=De$d.FAILED:l(!1):e.terrainState=De$d.FAILED}function s(){if(e.request.state===W$14.CANCELLED)return e.terrainData=void 0,e.terrainState=De$d.UNLOADED,void(e.request=void 0);e.terrainState=De$d.FAILED,e.request=void 0;var o="Failed to obtain terrain tile X: "+i+" Y: "+r+" Level: "+n+".";t._requestError=l$13.handleError(t._requestError,t,t.errorEvent,o,i,r,n,l)}function l(l){var u=new r$1c({throttle:!1,throttleByServer:!0,type:$$13.TERRAIN});u.cacheEnable=l,e.request=u;var c=t.requestTileGeometry(i,r,n,u,o);e$28(c)?(e.terrainState=De$d.RECEIVING,o$1q(c,a,s)):(e.terrainState=De$d.UNLOADED,e.request=void 0)}l(!0)}function he$a(e,t,i,r,n){var o=t.unzip(e.zipTerrainData.buffer);e$28(o)&&(e.terrainState=De$d.UNZIPING,o$1q(o,(function(i){if(!e$28(i))return e.terrainState=De$d.FAILED,e.zipTerrainData=void 0,void(e.terrainData=void 0);e.terrainState=De$d.RECEIVED,e.terrainData=t.createTerrainData(e.zipTerrainData,i.data.buffer),t._invisibility&&(e.invalidTerrainData=new T$S({buffer:new Uint8Array(256),width:16,height:16,skirtMode:!0,valid:!1})),e.zipTerrainData=void 0}),(function(t){e.terrainState=De$d.FAILED})))}function me$e(e,t,i,r,n,o){var a=i.tilingScheme,s=e.terrainData.createMesh(a,r,n,o,t.terrainExaggeration);!e$28(s)||(e.terrainState=De$d.TRANSFORMING,o$1q(s,(function(s){if(i._isSct&&i._extrudeTileBoundingBox&&i._levels[0]>12&&s.maximumHeight<1&&(s.maximumHeight=Math.max(i._maxHeight,s.maximumHeight)),e.mesh=s,e.orientedBoundingBox=x$13.clone(s.orientedBoundingBox,e.orientedBoundingBox),e.occludeePointInScaledSpace=t$X.clone(s.occludeePointInScaledSpace,e.occludeePointInScaledSpace),i._enablePrjArea&&(e$28(s.validOrientedBoundingBox)?e.tileBoundingRegion._orientedBoundingBox=x$13.clone(s.validOrientedBoundingBox,e.tileBoundingRegion._orientedBoundingBox):e.tileBoundingRegion._orientedBoundingBox=x$13.clone(e.orientedBoundingBox,e.tileBoundingRegion._orientedBoundingBox),e.tileBoundingRegion._boundingSphere=i$19.fromOrientedBoundingBox(e.tileBoundingRegion._orientedBoundingBox)),e$28(e.invalidTerrainData)){var l=e.invalidTerrainData.createMesh(a,r,n,o,t.terrainExaggeration);if(!e$28(l))return void(e.terrainState=De$d.RECEIVED);o$1q(l,(function(t){e.invalidMesh=t,e.invalidOrientedBoundingBox=x$13.clone(t.orientedBoundingBox,e.invalidOrientedBoundingBox),e.invalidOccludeePointInScaledSpace=t$X.clone(t.occludeePointInScaledSpace,e.invalidOccludeePointInScaledSpace),e.terrainState=De$d.TRANSFORMED}))}else e.terrainState=De$d.TRANSFORMED}),(function(){e.terrainState=De$d.FAILED})))}function b$u(){this.context=void 0,this.surfaceTile=void 0,this.mesh=void 0}c$l.prototype.pick=function(e,t,i,r,n){var o=this.renderedMesh;if(e$28(o)){for(var a=o.vertices,s=o.indices,l=o.encoding,u=s.length,c=Number.MAX_VALUE,h=0;h<u;h+=3){var d=s[h],f=s[h+1],p=s[h+2],_=C$n(l,t,i,a,d,te$d),m=C$n(l,t,i,a,f,ie$a),$=C$n(l,t,i,a,p,ne$g),g=g$10.rayTriangleParametric(e,_,m,$,r);e$28(g)&&g<c&&g>=0&&(c=g)}return c!==Number.MAX_VALUE?f$18.getPoint(e,c,n):void 0}},c$l.prototype.freeResources=function(){e$28(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),e$28(this.normalTexture)&&(--this.normalTexture.referenceCount,0===this.normalTexture.referenceCount&&this.normalTexture.destroy(),this.normalTexture=void 0),this.terrainData=void 0,this.modifyTerrainData=void 0,this.terrainState=De$d.UNLOADED,this.mesh=void 0,this.modifyTerrainMesh=void 0,this.subDivisionMesh=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();for(var r in this.imagery.length=0,this.terrain)this.terrain[r].freeResources();this.terrain={};var n=this.gridImagery;for(t=0,i=n.length;t<i;++t)n[t].freeResources();this.gridImagery.length=0,this.freeVertexArray(),this.invalid=!1,this.invalidMesh=void 0,this.invalidOrientedBoundingBox=void 0,this.invalidOccludeePointInScaledSpace=void 0,this.invalidVertexArray=void 0,this.invalidTerrainData=void 0},c$l.prototype.freeVertexArray=function(){if(c$l._freeVertexArray(this.vertexArray),this.vertexArray=void 0,c$l._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0,e$28(this.modifyTerrainVertexArray))for(let e=0;e<this.modifyTerrainVertexArray.length;e++)c$l._freeVertexArray(this.modifyTerrainVertexArray[e]);this.modifyTerrainVertexArray=void 0,c$l._freeVertexArray(this.subDivisionVertexArray),this.subDivisionVertexArray=void 0},c$l.initialize=function(e,t,i,r){var n=e.data;e$28(n)||(n=e.data=new c$l),e.state===re$B.START&&(oe$b(e,t,i,r),e.state=re$B.LOADING)},c$l.processStateMachine=function(e,t,i,r,n,o,a){c$l.initialize(e,i,r,n);var s=e.data;if(e.state===re$B.LOADING&&se$9(e,t,i,r,n,o),!a||0==e.level){var l=e.renderable;e.renderable=e$28(s.vertexArray)||!1===i.isShowGlobe&&e$28(s.mesh)&&s.mesh.invalid;var u=s.terrainState===De$d.READY;for(var c in s.terrain)if(s.terrain[c].terrainState!==De$d.READY){u=!1;break}e.upsampledFromParent=e$28(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();var h=!0,d=n._maxDetailLevelOffset();if(d>0){var f=e.level-d;f=Math.max(0,f);for(var p=e.level,_=e;p>f&&e$28(_);)e$28(_=_.parent)&&(c$l.initialize(_,i,r,n),h=s.processImagery(_,i,t)&&h),p=_.level}var m=s.processImagery(e,i,t)&&h,$=s.processGridTile(e,t);if(u&&m&&$||s.terrainState===De$d.INVALID){var g=e._loadedCallbacks,v={};for(var y in g)g.hasOwnProperty(y)&&(g[y](e)||(v[y]=g[y]));e._loadedCallbacks=v,e.state=re$B.DONE}l&&(e.renderable=!0)}},c$l.prototype.processImagery=function(e,t,i,r){var n,o,a=e.data,s=e.upsampledFromParent,l=!1,u=!0,c=a.imagery,h=!1,d=!1;for(n=0,o=c.length;n<o;++n){var f=c[n];if(!e$28(f.loadingImagery)&&!e$28(f.readyImagery)&&e$28(f.imageryLayer)&&(f.loadingImagery=f.imageryLayer.getImageryFromCache(e.x,e.y,e.level),f.imageryLayer=void 0),e$28(f.loadingImagery)){if(f.loadingImagery.state===_t$6.PLACEHOLDER){var p=f.loadingImagery.imageryLayer;if(p.imageryProvider.ready){f.freeResources(),c.splice(n,1),p._createTileImagerySkeletons(e,t,n),--n,o=c.length;continue}s=!1}var _,m=void 0;if(f.loadingImagery.imageryLayer._imageryProvider instanceof M$X&&(m=f.loadingImagery.imageryLayer._imageryProvider,h=!0),i.camera._scene._mvtVisibleControl){var $=i.camera._scene._mvtVisibleLevel;!e$28(m)||e._level>i.camera._endLevel-$?(_=f.processStateMachine(e,i,r))&&e$28(m)&&(d=!0):_=!0}else _=f.processStateMachine(e,i,r);u=u&&_,l=l||_||e$28(f.readyImagery),s=s&&e$28(f.loadingImagery)&&(f.loadingImagery.state===_t$6.FAILED||f.loadingImagery.state===_t$6.INVALID)}else s=!1}return(!h||d)&&(e._mvtLoaded=!0),e.upsampledFromParent=s,e.renderable=e.renderable&&(l||u),u},new h$10,b$u.prototype.set=function(e,t,i,r){this.context=e,this.surfaceTile=t,this.mesh=i,this.terrainProvider=r},b$u.prototype.execute=function(){var e=this.context,t=this.mesh,i=this.surfaceTile;!1===this.terrainProvider.isShowGlobe&&t.invalid?i.vertexArray=void 0:(i.vertexArray=c$l._createVertexArrayForMesh(e,t),e$28(i.invalidMesh)&&(i.invalidVertexArray=c$l._createVertexArrayForMesh(e,i.invalidMesh)))};var q$n=new b$u;function ce$d(e,t,i,r,n,o,a,s){q$n.set(i,t,t.mesh,r),e.jobScheduler.execute(q$n,2)&&(t.terrainState=De$d.READY,t.fill=t.fill&&t.fill.destroy(s))}function ve$a(e){var t=e.cache.tile_waterMaskData;if(!e$28(t)){var i=L$17.create({context:e,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1,t={allWaterTexture:i,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function le$b(e,t){var i,r=t.terrainData.waterMask,n=ve$a(e),o=r.length;if(1===o){if(0===r[0])return;i=n.allWaterTexture}else{var a=Math.sqrt(o);(i=L$17.create({context:e,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.UNSIGNED_BYTE,source:{width:a,height:a,arrayBufferView:r},sampler:n.sampler,flipY:!1})).referenceCount=0}++i.referenceCount,t.waterMaskTexture=i,e$25.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}function xe$c(e){var t=e.cache.tile_normalTextureData;if(!e$28(t)){var i=new L$17({context:e,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([0,0,255]),width:1,height:1}});i.referenceCount=1,t={allNormalTexture:i,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR}),destroy:function(){this.allNormalTexture.destroy()}},e.cache.tile_normalTextureData=t}return t}function ye$d(e,t){var i=t.normalTexture;if(e$28(i)&&(--i.referenceCount,0===i.referenceCount&&i.destroy(),t.normalTexture=void 0),e$28(t.terrainData)){var r=t.terrainData.normalTexture;if(e$28(r)){var n,o=xe$c(e),a=r.length/3,s=Math.sqrt(a);(n=new L$17({context:e,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:r},sampler:o.sampler})).referenceCount=0,++n.referenceCount,t.normalTexture=n,e$25.fromElements(0,0,1,1,t.normalTextureTranslationAndScale)}}}function pe$e(e,t){t=e.data;var i=Number.MAX_VALUE,r=Number.MIN_VALUE;for(let e=0,o=t.modifyTerrainMesh.length;e<o;e++){var n=t.modifyTerrainMesh[e];i=Math.min(i,n.minimumHeight),r=Math.max(r,n.maximumHeight)}for(var o=i,a=r,s=t.mesh,l=e.parent;!e$28(s)&&e$28(l)&&e$28(l.data);)s=(t=l.data).mesh,l=l.parent;if(e$28(s)){i=Math.min(s.minimumHeight,o),r=Math.max(s.maximumHeight,a);return x$13.fromRectangle(e.rectangle,i,r)}}function ge$d(e,t,i){var r=t.data;e$28(r.modifyTerrainVertexArray)||(r.modifyTerrainVertexArray=[]);const n=c$l._createVertexArrayForMesh(e,i);r.modifyTerrainVertexArray.push(n),r.modifyOrientedBoundingBox=pe$e(t,r),t.isModified=!0}function Q$n(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 e$25}c$l.prototype.processGridTile=function(e,t,i){for(var r=!0,n=e.data.gridImagery,o=0;o<n.length;o++){var a=n[o]._processStateMachine(e,t,i);r=r&&a}return r},c$l._createVertexArrayForMesh=function(e,t){var i=t.vertices,r=h$W.createVertexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW}),n=t.encoding.getAttributes(r),o=t.indices.indexBuffers||{},a=o[e.id];if(!e$28(a)||a.isDestroyed()){var s=t.indices;(a=h$W.createIndexBuffer({context:e,typedArray:s,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.fromSizeInBytes(s.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,a.referenceCount=1,o[e.id]=a,t.indices.indexBuffers=o}else++a.referenceCount;return new m$19({context:e,attributes:n,indexBuffer:a})},c$l._freeVertexArray=function(e){if(e$28(e)){var t=e.indexBuffer;e.destroy(),e$28(t)&&!t.isDestroyed()&&e$28(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}},c$l.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;e$28(t)&&(!e$28(t.data)||!e$28(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},c$l.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return i.x=s*(n.west-r.west)/o,i.y=l*(n.south-r.south)/a,i.z=s,i.w=l,i},c$l.prototype._computeNormalTextureTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,o=n.width,a=n.height,s=o/r.width,l=a/r.height;return i.x=s*(n.west-r.west)/o,i.y=l*(n.south-r.south)/a,i.z=s,i.w=l,i},c$l.prototype.createModifyVertexArray=function(e,t,i,r,n){const o=u$Y(r.geometry_extract,r.geometry),a=r.minimumHeight,s=r.maximumHeight;if(e$28(i.modifyRegionsMap)||(i.modifyRegionsMap={}),i.modifyRegionsMap[r.name])return!0;var l;if(n){const e=i.parent.data.modifyTerrainData[r.name];l=Ce$9.upsampleTerrainData(i,e)}else l=Ce$9.createTerrainData(i,o,a,s,t._extractExtendHeight);if(!e$28(l))return!1;e$28(this.modifyTerrainData)||(this.modifyTerrainData={}),this.modifyTerrainData[r.name]=l,e$28(this.modifyTerrainMesh)||(this.modifyTerrainMesh=[]);const u=Ce$9.createTerrainMesh(i,l);this.modifyTerrainMesh.push(u),ge$d(e,i,u);var c=i._level+"_"+i._x+"_"+i._y;return t._modifyTilesMap[c]=i,i.modifyRegionsMap[r.name]=!0,!0},c$l.prototype.freeModifyResource=function(){if(e$28(this.modifyTerrainVertexArray))for(let e=0,t=this.modifyTerrainVertexArray.length;e<t;e++)c$l._freeVertexArray(this.modifyTerrainVertexArray[e]);this.modifyTerrainVertexArray=void 0,c$l._freeVertexArray(this.subDivisionVertexArray),this.subDivisionVertexArray=void 0,this.modifyTerrainData=void 0,this.modifyOrientedBoundingBox=void 0,this.subDivisionMesh=void 0},c$l.prototype.setShowInvalid=function(e){if(this.invalid!==e){if(e$28(this.vertexArray)&&e$28(this.invalidVertexArray)){var t=this.invalidOrientedBoundingBox,i=this.invalidOccludeePointInScaledSpace,r=this.invalidVertexArray,n=this.invalidMesh,o=this.invalidTerrainData;this.invalidOrientedBoundingBox=this.orientedBoundingBox,this.invalidOccludeePointInScaledSpace=this.occludeePointInScaledSpace,this.invalidVertexArray=this.vertexArray,this.invalidMesh=this.mesh,this.invalidTerrainData=this.terrainData,this.orientedBoundingBox=t,this.occludeePointInScaledSpace=i,this.vertexArray=r,this.mesh=n,this.terrainData=o,this.invalid=e}else if(this.terrainState===De$d.RECEIVED){if(e$28(this.terrainData)&&e$28(this.invalidTerrainData)){o=this.invalidTerrainData;this.invalidTerrainData=this.terrainData,this.terrainData=o,this.invalid=e}}else if(this.terrainState===De$d.TRANSFORMED&&e$28(this.mesh)&&e$28(this.invalidMesh)){t=this.invalidOrientedBoundingBox,i=this.invalidOccludeePointInScaledSpace,n=this.invalidMesh,o=this.invalidTerrainData;this.invalidOrientedBoundingBox=this.orientedBoundingBox,this.invalidOccludeePointInScaledSpace=this.occludeePointInScaledSpace,this.invalidMesh=this.mesh,this.invalidTerrainData=this.terrainData,this.orientedBoundingBox=t,this.occludeePointInScaledSpace=i,this.mesh=n,this.terrainData=o,this.invalid=e}this.boundingVolumeSourceTile=void 0}},Q$n.prototype.update=function(e,t,i){this.changedThisFrame&&(Le$a(e,t,this.tile,i),this.changedThisFrame=!1)},Q$n.prototype.destroy=function(e){e$28(this.vertexArray)&&(e$28(e)?e.push(this.vertexArray):c$l._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),e$28(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var Qe$6=new r$_;function k$q(e,t,i,r,n,o,a,s,l){if(void 0!==r){for(var u=r;u&&(u._lastSelectionResultFrame!==n||D$t.wasKicked(u._lastSelectionResult)||D$t.originalResult(u._lastSelectionResult)===D$t.CULLED);){if(a)return;var c=u.parent;if(o>=T$G.NORTHWEST&&void 0!==c)switch(o){case T$G.NORTHWEST:u=u===c.northwestChild?c:void 0;break;case T$G.NORTHEAST:u=u===c.northeastChild?c:void 0;break;case T$G.SOUTHWEST:u=u===c.southwestChild?c:void 0;break;case T$G.SOUTHEAST:u=u===c.southeastChild?c:void 0}else u=c}if(void 0!==u){if(u._lastSelectionResult===D$t.RENDERED){if(e$28(u.data.vertexArray))return;return void De$c(e,t,i,u,o,n,s,l)}if(D$t.originalResult(r._lastSelectionResult)!==D$t.CULLED)switch(o){case T$G.WEST:k$q(e,t,i,r.northwestChild,n,o,!0,s,l),k$q(e,t,i,r.southwestChild,n,o,!0,s,l);break;case T$G.EAST:k$q(e,t,i,r.southeastChild,n,o,!0,s,l),k$q(e,t,i,r.northeastChild,n,o,!0,s,l);break;case T$G.SOUTH:k$q(e,t,i,r.southwestChild,n,o,!0,s,l),k$q(e,t,i,r.southeastChild,n,o,!0,s,l);break;case T$G.NORTH:k$q(e,t,i,r.northeastChild,n,o,!0,s,l),k$q(e,t,i,r.northwestChild,n,o,!0,s,l);break;case T$G.NORTHWEST:k$q(e,t,i,r.northwestChild,n,o,!0,s,l);break;case T$G.NORTHEAST:k$q(e,t,i,r.northeastChild,n,o,!0,s,l);break;case T$G.SOUTHWEST:k$q(e,t,i,r.southwestChild,n,o,!0,s,l);break;case T$G.SOUTHEAST:k$q(e,t,i,r.southeastChild,n,o,!0,s,l);break;default:throw new t$Z("Invalid edge")}}}}function De$c(e,t,i,r,n,o,a,s){var l=r.data;if(void 0===l.fill)l.fill=new Q$n(r);else if(l.fill.visitedFrame===o)return;l.fill.enqueuedFrame!==o&&(l.fill.enqueuedFrame=o,l.fill.changedThisFrame=!1,a.enqueue(r)),ye$c(e,t,i,r,n,s)}function ye$c(e,t,i,r,n,o){var a,s,l,u=r.data.fill,c=i.data.fill;switch(e$28(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Le$a(e,t,i,o),c.changedThisFrame=!1),a=i.data.fill.mesh):a=i.data.mesh,n){case T$G.WEST:s=u.westMeshes,l=u.westTiles;break;case T$G.SOUTH:s=u.southMeshes,l=u.southTiles;break;case T$G.EAST:s=u.eastMeshes,l=u.eastTiles;break;case T$G.NORTH:s=u.northMeshes,l=u.northTiles;break;case T$G.NORTHWEST:return u.changedThisFrame=u.changedThisFrame||u.northwestMesh!==a,u.northwestMesh=a,void(u.northwestTile=i);case T$G.NORTHEAST:return u.changedThisFrame=u.changedThisFrame||u.northeastMesh!==a,u.northeastMesh=a,void(u.northeastTile=i);case T$G.SOUTHWEST:return u.changedThisFrame=u.changedThisFrame||u.southwestMesh!==a,u.southwestMesh=a,void(u.southwestTile=i);case T$G.SOUTHEAST:return u.changedThisFrame=u.changedThisFrame||u.southeastMesh!==a,u.southeastMesh=a,void(u.southeastTile=i)}if(i.level<=r.level)return u.changedThisFrame=u.changedThisFrame||s[0]!==a||1!==s.length,s[0]=a,l[0]=i,s.length=1,void(l.length=1);var h,d,f,p,_=i.rectangle,m=r.rectangle;switch(n){case T$G.WEST:for(p=(m.north-m.south)*e$27.EPSILON5,h=0;h<l.length&&(f=l[h].rectangle,!e$27.greaterThan(_.north,f.south,p));++h);for(d=h;d<l.length&&(f=l[d].rectangle,!e$27.greaterThanOrEquals(_.south,f.north,p));++d);break;case T$G.SOUTH:for(p=(m.east-m.west)*e$27.EPSILON5,h=0;h<l.length&&(f=l[h].rectangle,!e$27.lessThan(_.west,f.east,p));++h);for(d=h;d<l.length&&(f=l[d].rectangle,!e$27.lessThanOrEquals(_.east,f.west,p));++d);break;case T$G.EAST:for(p=(m.north-m.south)*e$27.EPSILON5,h=0;h<l.length&&(f=l[h].rectangle,!e$27.lessThan(_.south,f.north,p));++h);for(d=h;d<l.length&&(f=l[d].rectangle,!e$27.lessThanOrEquals(_.north,f.south,p));++d);break;case T$G.NORTH:for(p=(m.east-m.west)*e$27.EPSILON5,h=0;h<l.length&&(f=l[h].rectangle,!e$27.greaterThan(_.east,f.west,p));++h);for(d=h;d<l.length&&(f=l[d].rectangle,!e$27.greaterThanOrEquals(_.west,f.east,p));++d);}d-h==1?(u.changedThisFrame=u.changedThisFrame||s[h]!==a,s[h]=a,l[h]=i):(u.changedThisFrame=!0,s.splice(h,d-h,a),l.splice(h,d-h,i))}Q$n.updateFillTiles=function(e,t,i,r){var n=e._quadtree,o=n._levelZeroTiles,a=n._lastSelectionFrameNumber,s=Qe$6;s.clear();for(var l=0;l<t.length;++l){e$28(t[l].data.vertexArray)&&s.enqueue(t[l])}for(var u=s.dequeue();void 0!==u;){var c=u.findTileToWest(o),h=u.findTileToSouth(o),d=u.findTileToEast(o),f=u.findTileToNorth(o);k$q(e,i,u,c,a,T$G.EAST,!1,s,r),k$q(e,i,u,h,a,T$G.NORTH,!1,s,r),k$q(e,i,u,d,a,T$G.WEST,!1,s,r),k$q(e,i,u,f,a,T$G.SOUTH,!1,s,r);var p=c.findTileToNorth(o),_=c.findTileToSouth(o),m=d.findTileToNorth(o),$=d.findTileToSouth(o);k$q(e,i,u,p,a,T$G.SOUTHEAST,!1,s,r),k$q(e,i,u,m,a,T$G.SOUTHWEST,!1,s,r),k$q(e,i,u,_,a,T$G.NORTHEAST,!1,s,r),k$q(e,i,u,$,a,T$G.NORTHWEST,!1,s,r),u=s.dequeue()}};var G$s=new t$W,xe$b=new t$W,$$i=new t$X,ke$6=new t$X,de$b=new o$1k,Te$b=new o$1k,C$m=new o$1k;function re$9(){this.height=0,this.encodedNormal=new o$1k}function he$9(e,t,i,r,n,o,a,s,l){if(e$28(n))return n;var u;if(e$28(o)&&e$28(a))u=.5*(o.height+a.height);else if(e$28(o))u=o.height;else if(e$28(a))u=a.height;else if(e$28(s))u=s.height;else{var c=e.tile.data.tileBoundingRegion,h=0,d=0;e$28(c)&&(h=c.minimumHeight,d=c.maximumHeight),u=.5*(h+d)}return Ce$8(e,t,i,r,u,l),l}var et$7={minimumHeight:0,maximumHeight:0},pe$d=new re$9,We$8=new re$9,be$c=new re$9,Ue$a=new re$9,tt$9=typeof Uint8Array<"u"?new Uint8Array(81):void 0;function Le$a(e,t,i,r){c$l.initialize(i,e.terrainProvider,e._terrainLayers,e._imageryLayers);var n=i.data,o=n.fill,a=i.rectangle,s=i.tilingScheme.ellipsoid,l=ne$f(o,s,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,be$c),u=ne$f(o,s,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,pe$d),c=ne$f(o,s,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,We$8),h=ne$f(o,s,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Ue$a);l=he$9(o,s,0,1,l,u,h,c,be$c),u=he$9(o,s,0,0,u,l,c,h,pe$d),c=he$9(o,s,1,1,c,u,h,l,We$8),h=he$9(o,s,1,1,h,c,l,u,Ue$a);var d,f,p=u.height,_=c.height,m=l.height,$=h.height,g=Math.min(p,_,m,$),v=Math.max(p,_,m,$),y=.5*(g+v),x=e.getLevelMaximumGeometricError(i.level),b=s.maximumRadius-x,w=4*Math.acos(b/s.maximumRadius);if(w*=1.5,a.width>w&&v-g<=x){var C=new T$S({width:9,height:9,buffer:tt$9,structure:{heightOffset:v}});o.mesh=C._createMeshSync(i.tilingScheme,i.x,i.y,i.level,1)}else{var T=new h$T(void 0,void 0,void 0,void 0,!0,!0),S=xe$b;S.longitude=.5*(a.east+a.west),S.latitude=.5*(a.north+a.south),S.height=y,T.center=s.cartographicToCartesian(S,T.center);var E,A=5;for(d=0,f=(E=o.westMeshes).length;d<f;++d)e$28(E[d])&&(A+=E[d].eastIndicesNorthToSouth.length);for(d=0,f=(E=o.southMeshes).length;d<f;++d)e$28(E[d])&&(A+=E[d].northIndicesWestToEast.length);for(d=0,f=(E=o.eastMeshes).length;d<f;++d)e$28(E[d])&&(A+=E[d].westIndicesSouthToNorth.length);for(d=0,f=(E=o.northMeshes).length;d<f;++d)e$28(E[d])&&(A+=E[d].southIndicesEastToWest.length);var P=et$7;P.minimumHeight=g,P.maximumHeight=v;var I=T.getStride(),M=new Float32Array(A*I),O=0,D=O;e$28(l.height)&&!isNaN(l.height)&&(O=ce$c(o,s,T,M,O=ie$9(s,a,T,M,O,0,1,l.height,l.encodedNormal,1,P),o.westTiles,o.westMeshes,T$G.EAST,P));var R=O;e$28(u.height)&&!isNaN(u.height)&&(O=ce$c(o,s,T,M,O=ie$9(s,a,T,M,O,0,0,u.height,u.encodedNormal,0,P),o.southTiles,o.southMeshes,T$G.NORTH,P));var L=O;e$28(c.height)&&!isNaN(c.height)&&(O=ce$c(o,s,T,M,O=ie$9(s,a,T,M,O,1,0,c.height,c.encodedNormal,0,P),o.eastTiles,o.eastMeshes,T$G.WEST,P));var B=O;e$28(h.height)&&!isNaN(h.height)&&(O=ce$c(o,s,T,M,O=ie$9(s,a,T,M,O,1,1,h.height,h.encodedNormal,1,P),o.northTiles,o.northMeshes,T$G.SOUTH,P)),g=isNaN(P.minimumHeight)?0:P.minimumHeight,v=isNaN(P.maximumHeight)?0:P.maximumHeight;var N=x$13.fromRectangle(a,g,v,i.tilingScheme.ellipsoid),F=t$M.geodeticLatitudeToMercatorAngle(a.south),z=1/(t$M.geodeticLatitudeToMercatorAngle(a.north)-F),k=(t$M.geodeticLatitudeToMercatorAngle(S.latitude)-F)*z;s.geodeticSurfaceNormalCartographic(G$s,ke$6);var V=t$N.octEncode(ke$6,de$b),U=O;T.encode(M,O*I,N.center,o$1k.fromElements(.5,.5,C$m),y,V,k);var X,H=++O,G=3*(H-1),W=G*(H<256?1:2);if((M.length-H*I)*Float32Array.BYTES_PER_ELEMENT>=W){var Y=H*I*Float32Array.BYTES_PER_ELEMENT;X=H<256?new Uint8Array(M.buffer,Y,G):new Uint16Array(M.buffer,Y,G)}else X=H<256?new Uint8Array(G):new Uint16Array(G);M=new Float32Array(M.buffer,0,H*I);var q=0;for(d=0;d<H-2;++d)X[q++]=U,X[q++]=d,X[q++]=d+1;X[q++]=U,X[q++]=d,X[q++]=0;var j=[];for(d=R;d>=D;--d)j.push(d);var Z=[];for(d=L;d>=R;--d)Z.push(d);var K=[];for(d=B;d>=L;--d)K.push(d);var Q=[];for(Q.push(0),d=U-1;d>=B;--d)Q.push(d);o.mesh=new T$T(T.center,M,X,G,H,g,v,i$19.fromOrientedBoundingBox(N),nt$7(e,N.center,a,g,v),T.getStride(),N,T,t.terrainExaggeration,j,Z,K,Q)}var J=t.context;e$28(o.vertexArray)&&(e$28(r)?0!==o.mesh.vertices.length&&0!==o.mesh.indices.length&&r.push(o.vertexArray):c$l._freeVertexArray(o.vertexArray)),0!==o.mesh.vertices.length&&0!==o.mesh.indices.length&&(o.vertexArray=c$l._createVertexArrayForMesh(J,o.mesh)),n.processImagery(i,e.terrainProvider,t,!0);var ee=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){var te=n._findAncestorTileWithTerrainData(i);e$28(te)&&e$28(te.data.waterMaskTexture)&&(o.waterMaskTexture=te.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,n._computeWaterMaskTranslationAndScale(i,te,o.waterMaskTranslationAndScale))}e$28(ee)&&(--ee.referenceCount,0===ee.referenceCount&&ee.destroy())}function ie$9(e,t,i,r,n,o,a,s,l,u,c){var h=G$s;h.longitude=e$27.lerp(t.west,t.east,o),h.latitude=e$27.lerp(t.south,t.north,a),h.height=s;var d=e.cartographicToCartesian(h,$$i),f=Te$b;return f.x=o,f.y=a,i.encode(r,n*i.getStride(),d,f,s,l,u),c.minimumHeight=Math.min(c.minimumHeight,s),c.maximumHeight=Math.max(c.maximumHeight,s),n+1}var oe$a=new h$10;function D$s(e,t,i,r){var n=e.rectangle,o=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?((n=h$10.clone(e.rectangle,oe$a)).west-=e$27.TWO_PI,n.east-=e$27.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&((n=h$10.clone(e.rectangle,oe$a)).west+=e$27.TWO_PI,n.east+=e$27.TWO_PI);var a=n.east-n.west,s=(o.west-n.west)/a,l=(o.east-n.west)/a,u=n.north-n.south,c=(o.south-n.south)/u,h=(o.north-n.south)/u,d=(i.x-s)/(l-s),f=(i.y-c)/(h-c);return Math.abs(d)<Math.EPSILON5?d=0:Math.abs(d-1)<Math.EPSILON5&&(d=1),Math.abs(f)<Math.EPSILON5?f=0:Math.abs(f-1)<Math.EPSILON5&&(f=1),r.x=d,r.y=f,r}var at$7=new o$1k;function ge$c(e,t,i,r,n){var o=e.encoding,a=e.vertices;if(n.height=o.decodeHeight(a,t),o.hasVertexNormals)o.getOctEncodedNormal(a,t,n.encodedNormal);else{var s=n.encodedNormal;s.x=0,s.y=0}}var st$3=new o$1k,rt$9=new t$X;function ht$4(e,t,i,r,n,o,a,s,l,u){var c,h=r.encoding,d=r.vertices,f=D$s(t,i,h.decodeTextureCoordinates(d,n,C$m),C$m),p=D$s(t,i,h.decodeTextureCoordinates(d,o,Te$b),Te$b);c=l?(a-f.x)/(p.x-f.x):(s-f.y)/(p.y-f.y);var _,m=h.decodeHeight(d,n),$=h.decodeHeight(d,o),g=i.rectangle;if(G$s.longitude=e$27.lerp(g.west,g.east,a),G$s.latitude=e$27.lerp(g.south,g.north,s),u.height=G$s.height=e$27.lerp(m,$,c),!h.isModify)if(h.hasVertexNormals){var v=h.getOctEncodedNormal(d,n,at$7),y=h.getOctEncodedNormal(d,o,st$3),x=t$N.octDecode(v.x,v.y,$$i),b=t$N.octDecode(y.x,y.y,rt$9);_=t$X.lerp(x,b,c,$$i),t$X.normalize(_,_),t$N.octEncode(_,u.encodedNormal)}else _=e.geodeticSurfaceNormalCartographic(G$s,$$i),t$N.octEncode(_,u.encodedNormal)}function Ce$8(e,t,i,r,n,o){o.height=n;var a=t.geodeticSurfaceNormalCartographic(G$s,$$i);t$N.octEncode(a,o.encodedNormal)}function ne$f(e,t,i,r,n,o,a,s,l,u,c){var h;return _e$9(e,t,s,a,!1,i,r,c)||_e$9(e,t,u,l,!0,i,r,c)?c:ve$9(n,o)?(ge$c(o,0===i?0===r?o.eastIndicesNorthToSouth[0]:o.southIndicesEastToWest[0]:0===r?o.northIndicesWestToEast[0]:o.westIndicesSouthToNorth[0],i,r,c),c):e$28(h=0===i?0===r?fe$b(e.westMeshes,e.westTiles,T$G.EAST,e.southMeshes,e.southTiles,T$G.NORTH):fe$b(e.northMeshes,e.northTiles,T$G.SOUTH,e.westMeshes,e.westTiles,T$G.EAST):0===r?fe$b(e.southMeshes,e.southTiles,T$G.NORTH,e.eastMeshes,e.eastTiles,T$G.WEST):fe$b(e.eastMeshes,e.eastTiles,T$G.WEST,e.northMeshes,e.northTiles,T$G.SOUTH))?(Ce$8(e,t,i,r,h,c),c):void 0}function fe$b(e,t,i,r,n,o,a,s){var l=Re$8(e,t,!1,i),u=Re$8(r,n,!0,o);return e$28(l)&&e$28(u)?.5*(l+u):e$28(l)?l:u}function ce$c(e,t,i,r,n,o,a,s,l){for(var u=0;u<o.length;++u)e$28(a[u])&&(n=it$4(e,t,i,r,n,o[u],a[u],s,l));return n}function it$4(e,t,i,r,n,o,a,s,l){var u=o.rectangle;s===T$G.EAST&&0===e.tile.x?((u=h$10.clone(o.rectangle,oe$a)).west-=e$27.TWO_PI,u.east-=e$27.TWO_PI):s===T$G.WEST&&0===o.x&&((u=h$10.clone(o.rectangle,oe$a)).west+=e$27.TWO_PI,u.east+=e$27.TWO_PI);var c,h,d,f,p=e.tile.rectangle;switch(n>0&&(i.decodeTextureCoordinates(r,n-1,C$m),c=C$m.x,h=C$m.y),s){case T$G.WEST:d=a.westIndicesSouthToNorth,f=!1;break;case T$G.NORTH:d=a.northIndicesWestToEast,f=!0;break;case T$G.EAST:d=a.eastIndicesNorthToSouth,f=!1;break;case T$G.SOUTH:d=a.southIndicesEastToWest,f=!0}var _,m,$=o,g=e.tile,v=a.encoding,y=a.vertices,x=i.getStride();v.hasWebMercatorT&&(_=t$M.geodeticLatitudeToMercatorAngle(p.south),m=1/(t$M.geodeticLatitudeToMercatorAngle(p.north)-_));for(var b=0;b<d.length;++b){var w=d[b],C=v.decodeTextureCoordinates(y,w,C$m);D$s($,g,C,C);var T=C.x,S=C.y,E=f?T:S;if(!(E<0||E>1||Math.abs(T-c)<e$27.EPSILON5&&Math.abs(S-h)<e$27.EPSILON5)){var A=Math.abs(T)<e$27.EPSILON5||Math.abs(T-1)<e$27.EPSILON5,P=Math.abs(S)<e$27.EPSILON5||Math.abs(S-1)<e$27.EPSILON5;if(!A||!P){var I,M=v.decodePosition(y,w,$$i),O=v.decodeHeight(y,w);v.hasVertexNormals?I=v.getOctEncodedNormal(y,w,de$b):((I=de$b).x=0,I.y=0);var D=S;if(v.hasWebMercatorT){var R=e$27.lerp(p.south,p.north,S);D=(t$M.geodeticLatitudeToMercatorAngle(R)-_)*m}i.encode(r,n*x,M,C,O,I,D),l.minimumHeight=Math.min(l.minimumHeight,O),l.maximumHeight=Math.max(l.maximumHeight,O),++n}}}return n}function Re$8(e,t,i,r,n,o){var a,s,l;i?(a=0,s=e.length,l=1):(a=e.length-1,s=-1,l=-1);for(var u=a;u!==s;u+=l){var c=e[u];if(ve$9(t[u],c)){var h;switch(r){case T$G.WEST:h=c.westIndicesSouthToNorth;break;case T$G.SOUTH:h=c.southIndicesEastToWest;break;case T$G.EAST:h=c.eastIndicesNorthToSouth;break;case T$G.NORTH:h=c.northIndicesWestToEast}var d=h[i?0:h.length-1];if(e$28(d))return c.encoding.decodeHeight(c.vertices,d)}}}function ve$9(e,t){return e$28(t)&&(!e$28(e.data.fill)||!e.data.fill.changedThisFrame)}function _e$9(e,t,i,r,n,o,a,s){var l,u,c,h,d,f=r[n?0:i.length-1],p=i[n?0:i.length-1];if(ve$9(f,p)&&(0===o?0===a?(l=n?p.northIndicesWestToEast:p.eastIndicesNorthToSouth,u=n,c=n):(l=n?p.eastIndicesNorthToSouth:p.southIndicesEastToWest,u=!n,c=!1):0===a?(l=n?p.westIndicesSouthToNorth:p.northIndicesWestToEast,u=!n,c=!0):(l=n?p.southIndicesEastToWest:p.westIndicesSouthToNorth,u=n,c=!n),l.length>0)){d=l[h=n?0:l.length-1],p.encoding.decodeTextureCoordinates(p.vertices,d,C$m);var _=D$s(f,e.tile,C$m,C$m);if(_.x===o&&_.y===a)return ge$c(p,d,o,a,s),!0;if(h=a$14(l,u?o:a,(function(t,i){p.encoding.decodeTextureCoordinates(p.vertices,t,C$m);var r=D$s(f,e.tile,C$m,C$m);return c?u?r.x-o:r.y-a:u?o-r.x:a-r.y})),!(h<0))return ge$c(p,l[h],o,a,s),!0;if((h=~h)>0&&h<l.length)return ht$4(t,f,e.tile,p,l[h-1],l[h],o,a,u,s),!0}return!1}var ot$6=[new t$X,new t$X,new t$X,new t$X];function nt$7(e,t,i,r,n,o){var a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,l=ot$6;return t$X.fromRadians(i.west,i.south,n,s,l[0]),t$X.fromRadians(i.east,i.south,n,s,l[1]),t$X.fromRadians(i.west,i.north,n,s,l[2]),t$X.fromRadians(i.east,i.north,n,s,l[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,r,o)}var _0x2e1323=(_0xe76302=!0,function(e,t){var i=_0xe76302?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xe76302=!1,i}),_0x4e7392=_0x2e1323(void 0,(function(){return _0x4e7392.toString().search("(((.+)+)+)+$").toString().constructor(_0x4e7392).search("(((.+)+)+)+$")})),_0xe76302;_0x4e7392();var ua$1="attribute vec4 position;\nattribute vec2 texCoord;\nvarying vec2 v_texCoord;\nvarying vec4 v_positionMC;\nvarying vec3 v_positionEC;\nvoid main()\n{\n v_texCoord = texCoord;\n gl_Position = czm_modelViewProjection * vec4(position.xyz, 1.0);\n v_positionMC = vec4(position.xyz, 1.0);\n v_positionEC = (czm_modelView * vec4(position.xyz, 1.0)).xyz;\n}",_0x337e1b=(_0x3cfc67=!0,function(e,t){var i=_0x3cfc67?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3cfc67=!1,i}),_0xa21580=_0x337e1b(void 0,(function(){return _0xa21580.toString().search("(((.+)+)+)+$").toString().constructor(_0xa21580).search("(((.+)+)+)+$")})),_0x3cfc67;_0xa21580();var da="varying vec2 v_texCoord;\nuniform sampler2D texture1;\nvarying vec4 v_positionMC;\nvarying vec3 v_positionEC;\n#ifdef NormalTexture\n uniform sampler2D uNormalTexture;\n#endif\nvec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\n srgbIn = srgbIn;\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n vec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else\n return linearIn;\n#endif\n}\nconst float M_PI = 3.141592653589793;\nvec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\nfloat smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\nfloat GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\nvec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR\n return czm_acesTonemapping(linearIn);\n#else\n return linearIn;\n#endif\n}\nvoid main()\n{\n vec4 baseColorWithAlpha = texture2D(texture1, v_texCoord);\n baseColorWithAlpha = SRGBtoLINEAR4(baseColorWithAlpha);\n vec3 ng = normalize(czm_normal * czm_computeNormal(v_positionMC.xyz));\n#ifdef NormalTexture\n vec3 pos_dx = dFdx(v_positionEC);\n vec3 pos_dy = dFdy(v_positionEC);\n vec3 tex_dx = dFdx(vec3(v_texCoord.xy, 0.0));\n vec3 tex_dy = dFdy(vec3(v_texCoord.xy, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n vec3 n = texture2D(uNormalTexture, v_texCoord.xy).rgb;\n n = normalize(tbn * (2.0 * n - 1.0));\n#else\n vec3 n = ng;\n#endif\n vec3 baseColor = baseColorWithAlpha.rgb;\n float roughness = 1.0;\n float metalness = 0.0;\n vec3 v = -normalize(v_positionEC);\n vec3 lightColorHdr = vec3(5.0);\n vec3 l = normalize(czm_lightDirectionEC);\n vec3 h = normalize(v + l);\n float NdotL = clamp(dot(n, l), 0.001, 1.0);\n float NdotV = abs(dot(n, v)) + 0.001;\n float NdotH = clamp(dot(n, h), 0.0, 1.0);\n float LdotH = clamp(dot(l, h), 0.0, 1.0);\n float VdotH = clamp(dot(v, h), 0.0, 1.0);\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n vec3 specularColor = mix(f0, baseColor, metalness);\n float alpha = roughness * roughness;\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 r0 = specularColor.rgb;\n vec3 F = fresnelSchlick2(r0, r90, VdotH);\n float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n float D = GGX(alpha, NdotH);\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n float S = acos(LdotZenith);\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n float gamma = acos(NdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = 0.2 * (numerator / denominator);\n vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 IBLColor = (diffuseIrradiance * diffuseColor * 1.0) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * 1.0);\n float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n IBLColor *= lightColor;\n color += IBLColor * luminance;\n color = applyTonemapping(color);\n color = LINEARtoSRGB(color);\n gl_FragColor = vec4(color, 1.0);\n}";function R$l(e){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.terrainProvider))throw new t$Z("options.terrainProvider is required.");if(!e$28(e.imageryLayers))throw new t$Z("options.imageryLayers is required.");if(!e$28(e.surfaceShaderSet))throw new t$Z("options.surfaceShaderSet is required.");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=q$L.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._oriTerrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._terrainLayers=e.terrainLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._pickRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new o$1o,this._imageryLayers.layerAdded.addEventListener(R$l.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(R$l.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(R$l.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(R$l.prototype._onLayerShownOrHidden,this),this._imageryLayers.layerUpdate.addEventListener(R$l.prototype._onLayerUpdate,this),this._tileLoadedEvent=new o$1o,this._imageryLayersUpdatedEvent=new o$1o,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._modifyUniformMaps=[],this._modifyDrawCommands=[],this._modifyUsedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new e$1S(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=h$10.clone(h$10.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._flattenTextureWidth=1024,this._flattenTexture=void 0,this._hypsometricSetting=void 0,this._hypsometricTexture=void 0,this._hypsometricRenderTexture=void 0,this._hypsometricRegion=void 0,this._hypsometricBound=new e$25,this._bUseHypColorTable=!1,this._bUseHypRegion=!1,this._hypsometricRegionUpdate=!1,this._hypAnalysisMode=k$T.AnalysisRegionMode.ARM_NONE,this._hypMaxInstensity=e.MaxInstensity,this._hypMinInstensity=e.MinInstensity,this._hypMaxHeight=e.MaxHeight,this._hypMinHeight=e.MinHeight,this._hypUseColorByHeight=!0,this._geoBounds=new e$25,this.globeAlpha=1,this._style3D=new e$E,this._slopeSetting=void 0,this._slopeColorTexture=void 0,this._slopeArrowsTexture=void 0,this._slopePolygonTexture=void 0,this._slopeRegion=void 0,this._slopeBound=new e$25,this._bUseSlopeColorTable=!1,this._slopeRegionUpdate=!1,this._slopeAnalysisMode=k$T.AnalysisRegionMode.ARM_NONE,this._slopeArrowUrl=n$17("Assets/Textures/arrow.png"),this._excavateRectangle=new h$10,this._clipRasterTilesMap={},this._modifyRegions=new e$1P,this._modifyTilesMap={},this._modifyRegionUpdate=!1,this.clippingType=V$i.KeepOutside,this._excavateRegions=new e$1P,this._excavateRegionUpdate=!1,this._extractRegions=new e$1P,this._extractRegionsUpdate=!1,this._excavationGeometrys=new e$1P,this._imageryClipRegions=new e$1P,this._imageryClipRegionUpate=!1,this._oriClipPlane=[],this._clipPlane=[];for(var t=0;t<6;t++)this._clipPlane[t]=new e$25(0,0,0,0),this._oriClipPlane[t]=new e$25(0,0,0,0);this._clipMode=0,this._clipLineColor=new e$25(1,0,0,1),this._clipping=!1,this._splitDirection=new o$1k,this._cullEnabled=!0,this._rasterTextureSizes=[256,512],this._rasterLineWidth=1,this._rasterLineFBOs=[],this._rasterAAFBOs=[],this._rasterCurrentFBOIdx=0,this._lineExpandCommand=void 0,this._lineFXAACommand=void 0,this._swipeRegion=new e$25(0,0,1,1),this._swipeEnabled=!1,this._polygonOffset={enabled:!1,value:new o$1k(0,0)},this._excavateRegionCommands=new e$1P,this._pbrParameter=je$b.NONE,this._PBRMaterialParams={metallic:0,roughness:0,baseColorFactor:new e$25(1,1,1,1),baseColorTextureIndex:-1,emissionFactor:t$X.UNIT_XYZ,emissionTextureIndex:-1,occlusionTextureIndex:-1,normalTextureIndex:-1},this._excavationSideTextureUrl=n$17("Assets/Textures/excavationregion_side.jpg"),this._excavationBottomTextureUrl=n$17("Assets/Textures/excavationregion_top.jpg")}function ha$1(e,t){var i=e.loadingImagery;e$28(i)||(i=e.readyImagery);var r=t.loadingImagery;return e$28(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function ca(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&e$28(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function fa(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&e$28(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,o=r.length;n<o;++n){var a=r.get(n).imageryProvider;e$28(a)&&a.ready&&e$28(a.credit)&&i.addCredit(a.credit);var s=r.get(n).gridProvider;e$28(s)&&s.ready&&e$28(s.credit)&&i.addCredit(s.credit)}}function Xr(e,t){var i=t.data.mesh;if(e$28(i)&&!i.isModified){for(var r=e.context,n=i.encoding,o=i.vertices,a=(new o$1k,new t$X),s=new t$X,l=i.center,u=new t$W,c=i.stride,h=o.length,d=new Array(h/c),f=0;f<h;f+=c){var p=f/c;d[p]=t$X.unpack(o,f,d[p]),d[p]=t$X.add(d[p],l,d[p])}for(var _=t.rectangle.width/50,m=new Array(i.indices.length),$=(f=0,m.length);f<$;f++)m[f]=i.indices[f];var g=A$1d.computeSubdivision(t$V.WGS84,d,m,_,!0),v=g.attributes.position.values;h=v.length;var y=t.rectangle,x=y.width,b=y.height,w=new Float32Array(h/3*c),C=t$M.geodeticLatitudeToMercatorAngle(y.south),T=1/(t$M.geodeticLatitudeToMercatorAngle(y.north)-C),S=0;for(f=0;f<h;f+=3){t$X.unpack(v,f,a),t$W.fromCartesian(a,void 0,u);var E=(u.longitude-y.west)/x,A=(u.latitude-y.south)/b,P={x:E=e$27.clamp(E,0,1),y:A=e$27.clamp(A,0,1)};let e=!1;t.regions&&t.regions.forEach((t=>{e=e||pa(t.cartographics,u)})),t$X.fromRadians(u.longitude,u.latitude,0,void 0,s);var I=(t$M.geodeticLatitudeToMercatorAngle(u.latitude)-C)*T;S=e?n.encode(w,S,s,P,u.height,new o$1k,I):n.encode(w,S,a,P,u.height,new o$1k,I)}var M=new T$T;M.encoding=i.encoding,M.vertices=w,M.indices=new Uint16Array(g.indices),M.center=t$X.clone(l),t.data.subDivisionMesh=M,t.data.subDivisionVertexArray=t.data.subDivisionVertexArray&&t.data.subDivisionVertexArray.destroy(),t.data.subDivisionVertexArray=c$l._createVertexArrayForMesh(r,t.data.subDivisionMesh),i.isModified=!0}}function pa(e,t){let i=t.longitude,r=t.latitude,n=!1;for(let t=0,o=e.length-1;t<e.length;o=t++){let a=e[t].longitude,s=e[t].latitude,l=e[o].longitude,u=e[o].latitude;s>r!=u>r&&i<(l-a)*(r-s)/(u-s)+a&&(n=!n)}return n}Object.defineProperties(R$l.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._baseColor=e,this._firstPassInitialColor=e$25.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!e$28(e))throw new t$Z("value is required.");this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},tileLoadedEvent:{get:function(){return this._tileLoadedEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){if(this._terrainProvider!==e||e._isSkirtDirty){if(!e$28(e))throw new t$Z("terrainProvider is required.");this._terrainProvider=e,this._terrainProvider instanceof se$r&&(this._terrainProvider._quadtree=this._quadtree),e$28(this._quadtree)&&this._quadtree.invalidateAllTiles()}}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){h$C.setOwner(e,this,"_clippingPlanes")}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection.x=e.x,this._splitDirection.y=e.y}},excavationSideTextureUrl:{get:function(){return this._excavationSideTextureUrl},set:function(e){this._excavationSideTextureUrl=e}},excavationBottomTextureUrl:{get:function(){return this._excavationBottomTextureUrl},set:function(e){this._excavationBottomTextureUrl=e}}}),R$l.prototype.update=function(e){this._imageryLayers._update(),this.terrainProvider._isSkirtDirty&&(this.terrainProvider=this.terrainProvider,this.terrainProvider._isSkirtDirty=!1)},R$l.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile((function(e){e.data.imagery.sort(ha$1)}))),fa(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)ca(t[r]);t.length=0,e._quadtree=this._quadtree},R$l.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];e$28(n)&&(n.length=0)}var o=this._clippingPlanes;e$28(o)&&o.enabled&&o.update(e),this._usedDrawCommands=0,this._modifyUsedDrawCommands=0},R$l.prototype.createTexture=function(e){if(e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:e,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1}),e$28(this._hypsometricSetting)&&this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._hypsometricSetting.ColorTable._imageBuffer})),e$28(this._slopeSetting)&&!e$28(this._slopeColorTexture)&&(this._slopeColorTexture=new L$17({context:e,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1}),e$28(this._slopeSetting)&&this._slopeColorTexture.copyFrom({width:1024,height:64,arrayBufferView:this._slopeSetting.ColorTable._imageBuffer})),e$28(this._slopeSetting)&&!e$28(this._slopeArrowsTexture)&&(this._slopeArrowsTexture=this._slopeArrowsTexture&&this._slopeArrowsTexture.destroy(),e$28(this._slopeArrowUrl))){var t=this;o$1q(t$D(this._slopeArrowUrl),(function(i){t._slopeArrowUrl==t._slopeArrowUrl&&(t._slopeArrowsTexture=new L$17({context:e,source:i,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT})}))}))}},R$l.prototype.updateHypRegionFrameBuffer=function(e){if(this._hypsometricRegionUpdate){if(!e$28(this._hypsometricRegion))return void(this._bUseHypRegion=!1);this._hypsometricRegionUpdate=!1,this._bUseHypRegion=!0,Ue$9(e.context,this._hypsometricRegion)}},R$l.prototype.updateSlopeRegionFrameBuffer=function(e){if(this._slopeRegionUpdate){if(!e$28(this._slopeRegion))return void(this._bUseSlopeRegion=!1);this._slopeRegionUpdate=!1,this._bUseSlopeRegion=!0,Ue$9(e.context,this._slopeRegion)}},R$l.prototype.endUpdate=function(e){if(e$28(this._renderState)||(this._renderState=u$R.fromCache({cull:{enabled:this._cullEnabled},depthTest:{enabled:!0,func:Me$l.LESS}}),this._blendRenderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Me$l.LESS_OR_EQUAL},blending:Ee$n.ALPHA_BLEND})),e._fboState.frameBufferType!=L$T.CLAMP){if(!this.backFaceCulling&&!e$28(this._disableCullingRenderState)){var t=l$1e(this._renderState,!0);t.cull.enabled=!1,this._disableCullingRenderState=u$R.fromCache(t),(t=l$1e(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=u$R.fromCache(t)}this.createTexture(e.context),this.updateHypRegionFrameBuffer(e),this.updateSlopeRegionFrameBuffer(e),this._updateExcavateRegions(e),this._updateModifyRegions(e),this._updateExcavateGeometrys(e),this._updateImageryClipRegions(e),this._updateExtractRegions(e),Ga$1(this,e),Wa$1(this,e),e.rasterLineWidth>1&&e$28(e.commandListRealtimeRaster)&&e.commandListRealtimeRaster.length>0&&(Oa(this,e),za(this,e)),this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&!1!==this.terrainProvider.isShowGlobe&&Q$n.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var i=0,r=this._tilesToRenderByTextureCount,n=0,o=r.length;n<o;++n){var a=r[n];if(e$28(a)){var s=0;a.length>0&&(s=a[a.length-1]._level);for(var l=0,u=a.length;l<u;++l){a[l].realtimeRasterVectors(e,this),a[l].renderVectorBy2DCanvas(e,this);var c=a[l],h=c.data.tileBoundingRegion;if(c.data.terrainState!==De$d.INVALID){if(c.rasterClipRegion(e,this),e$28(c.data.modifyTerrainVertexArray)&&(!e._fboState.enabled||e._fboState.name.indexOf("_excavationGlobeHeight2")>-1)){this.vaIndex=-1;for(let t=0;t<c.data.modifyTerrainVertexArray.length;t++)this.vaIndex++,er$3(this,c,void 0,s,e,!0);this.vaIndex=-1,Xr(e,c)}for(var d=void 0,f=!1,p=e.camera._scene.terrainLayers._layers,_=1;_<p.length;_++){var m=p[_]._terrainProvider.tablename,$=c.data.terrain[m];if(e$28($)){if(e$28($.terrainData)&&e$28($.terrainData.hasInvalid)){if(!$.terrainData.hasInvalid){e$28($.terrainData)&&e$28($.vertexArray)&&e$28($.mesh)&&(c.data.terrainData=$.terrainData,c.data.vertexArray=$.vertexArray,c.data.mesh=$.mesh);break}f=!0}er$3(this,c,$,s,e,!1,d),e$28($)&&(e$28($.mesh)&&!$.mesh.invalid&&e$28($.vertexArray)?($.realtimeRasterValidTerrain(e,this,c),d=$._rasterTerrainTexture):d=void 0)}}f&&Xr(e,c),er$3(this,c,void 0,s,e,!1,d),e$28(c.data)&&e$28(c.data.terrainData)&&e$28(c.data.terrainData._maximumHeight)&&e$28(c.data.terrainData._minimumHeight)&&(0==l?i=.5*(c.data.terrainData._maximumHeight+c.data.terrainData._minimumHeight):i+=.5*(c.data.terrainData._maximumHeight+c.data.terrainData._minimumHeight))}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,h.minimumHeight)}u>1&&(i/=u,e.averageTerrainHeight=i)}}if(e.commandListRealtimeRaster.length=0,!e.camera.bReflect)for(var g in this._excavateRegionCommands._hash)if((e$28(this._excavationSideTextureUrl)||!(g.indexOf("side")>-1))&&(e$28(this._excavationBottomTextureUrl)||!(g.indexOf("bottom")>-1))){var v=this._excavateRegionCommands._hash[g];e.commandList.push(v)}if(this._clipping){var y=e.camera.inverseViewMatrix,x=new y$15;y$15.transpose(y,x);for(_=0;_<6;_++)y$15.multiplyByVector(x,this._oriClipPlane[_],this._clipPlane[_])}}},R$l.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)e.commandList.push(t[i])},R$l.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},R$l.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},R$l.prototype.loadTile=function(e,t){var i=t.parent,r=t.data;if(e$28(i)&&e$28(i.data)&&i.data.terrainState===De$d.INVALID)return r.terrainState=De$d.INVALID,void(t.state=re$B.DONE);var n,o=!0;e$28(r)&&(o=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===D$t.CULLED_BUT_NEEDED,n=r.terrainState);var a=t.level<3?this._oriTerrainProvider:this.terrainProvider;c$l.processStateMachine(t,e,a,this._terrainLayers,this._imageryLayers,this._vertexArraysToDestroy,o),r=t.data,o&&n!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)&&r.boundingVolumeSourceTile===t&&(o=!1,c$l.processStateMachine(t,e,this.terrainProvider,this._terrainLayers,this._imageryLayers,this._vertexArraysToDestroy,o)),t.renderable&&this._tileLoadedEvent.raiseEvent(t)};var ga=new i$19,Kr=new h$10,ma$1=new h$10,xa$1=new t$W;function $t$1(e,t){if(t.west<t.east)return t;var i=h$10.clone(t,ma$1);return h$10.center(e,xa$1).longitude>0?i.east=e$27.PI:i.west=-e$27.PI,i}R$l.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&e$27.fog(r,t.fog.density)>=1)return fe$s.NONE;var n=e.data,o=n.tileBoundingRegion;if(void 0===n.boundingVolumeSourceTile)return fe$s.PARTIAL;var a=t.cullingVolume,s=u$Y(n.modifyOrientedBoundingBox,n.orientedBoundingBox);if(!e$28(s)&&e$28(n.renderedMesh))for(var l in s=n.renderedMesh.boundingSphere3D,n.terrain)s=i$19.union(e,n.terrain[l].mesh.boundingSphere3D,s,s);n.clippedByBoundaries=!1;var u=$t$1(e.rectangle,this.cartographicLimitRectangle),c=h$10.simpleIntersection(u,e.rectangle,Kr);if(!e$28(c))return fe$s.NONE;if(h$10.equals(c,e.rectangle)||(n.clippedByBoundaries=!0),t.mode!==P$$.SCENE3D)for(var l in s=ga,i$19.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,o.minimumHeight,o.maximumHeight,s),t$X.fromElements(s.center.z,s.center.x,s.center.y,s.center),t.mode===P$$.MORPHING&&e$28(n.renderedMesh)&&(s=i$19.union(n.renderedMesh.boundingSphere3D,s,s)),n.terrain)s=i$19.union(e,n.terrain[l].mesh.boundingSphere3D,s,s);var h=this._clippingPlanes;if(e$28(h)&&h.enabled&&e$28(s)){var d=h.computeIntersectionWithBoundingVolume(s);if(e.isClipped=d!==pt$a.INSIDE,d===pt$a.OUTSIDE)return fe$s.NONE}var f=pt$a.INTERSECTING;if(e$28(s)){if((f=a.computeVisibility(s))===pt$a.OUTSIDE)for(var l in n.terrain)if(e$28(s=n.terrain[l].orientedBoundingBox)||(s=n.tileTerrainOrientedBoundingBox),e$28(s)&&(f=a.computeVisibility(s))!==pt$a.OUTSIDE)break;if(f===pt$a.OUTSIDE)return e$28(e.parent)&&e$28(e.parent.data.modifyOrientedBoundingBox)?a.computeVisibility(e.parent.data.modifyOrientedBoundingBox):fe$s.NONE}if(e.isModified)return f;var p=t.mode===P$$.SCENE3D&&t.camera.frustum instanceof a$X;if(t.mode===P$$.SCENE3D&&!p&&e$28(i)){var _=n.occludeePointInScaledSpace;return!e$28(_)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,o.minimumHeight)?f:fe$s.NONE}return f},R$l.prototype.canRefine=function(e){return!!e$28(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var va=[],ya$1=[];R$l.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=va;r.length=this._imageryLayers.length;var n,o,a,s=!1,l=!1;for(e$28(i)&&(s=i.terrainState===De$d.READY,l=!0,n=i.imagery),o=0,a=r.length;o<a;++o)r[o]=l;if(e$28(n))for(o=0,a=n.length;o<a;++o){var u=n[o];if(!e$28(u.imageryLayer)){var c=u.loadingImagery,h=!e$28(c)||c.state===_t$6.FAILED||c.state===_t$6.INVALID,d=(u.loadingImagery||u.readyImagery).imageryLayer._layerIndex;r[d]=h&&r[d]}}var f=this.quadtree._lastSelectionFrameNumber,p=ya$1;for(p.length=0,p.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);p.length>0;){var _=p.pop(),m=_._lastSelectionResultFrame===f?_._lastSelectionResult:D$t.NONE;if(m===D$t.RENDERED){if(!e$28(_.data))continue;if(!s&&_.data.terrainState===De$d.READY)return!1;var $=_.data.imagery;for(o=0,a=$.length;o<a;++o){var g=$[o];if(!e$28(g.imageryLayer)){var v=g.loadingImagery,y=!e$28(v)||v.state===_t$6.FAILED||v.state===_t$6.INVALID,x=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(y&&!r[x])return!1}}}else m===D$t.REFINED&&p.push(_.southwestChild,_.southeastChild,_.northwestChild,_.northeastChild)}return!0};var _a$1=new t$X;R$l.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;var n=t.camera.positionWC,o=t.camera.directionWC,a=t$X.subtract(r.center,n,_a$1),s=t$X.magnitude(a);return s<e$27.EPSILON5?0:(t$X.divideByScalar(a,s,a),(1-t$X.dot(a,o))*e._distance)};var Zr=new y$15,wt$5=new y$15,Ta$1=new e$25,wa$1=new e$25,Ra$1=new t$X,jr$2=new t$X,Aa$1=new t$X,Ca$1=new t$X;R$l.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];e$28(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];e$28(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e),e$28(e.data.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;var l=this._debug;++l.tilesRendered,l.texturesRendered+=i};var ba=[new t$X,new t$X,new t$X,new t$X];function Sa(e,t,i,r,n,o){var a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,l=ba;return t$X.fromRadians(i.west,i.south,n,s,l[0]),t$X.fromRadians(i.east,i.south,n,s,l[1]),t$X.fromRadians(i.west,i.north,n,s,l[2]),t$X.fromRadians(i.east,i.north,n,s,l[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,r,o)}function Ba$1(e,t,i){var r=e.data;void 0===r&&(r=e.data=new c$l),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new y$z({computeBoundingVolumes:t._enablePrjArea,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:.1}));var n=r.terrainData,o=r.mesh,a=r.tileBoundingRegion,s=!1;for(var l in void 0!==o&&void 0!==o.minimumHeight&&void 0!==o.maximumHeight?(a.minimumHeight=o.minimumHeight,a.maximumHeight=o.maximumHeight,s=!0):void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight?(a.minimumHeight=n._minimumHeight*i.terrainExaggeration,a.maximumHeight=n._maximumHeight*i.terrainExaggeration,s=!0):e.showInvalid&&(a.minimumHeight=0,a.maximumHeight=0,s=!0),r.terrain)e$28(r.terrain[l].mesh)?(a.minimumHeight=Math.min(r.terrain[l].mesh.minimumHeight,a.minimumHeight),a.maximumHeight=Math.max(r.terrain[l].mesh.maximumHeight,a.maximumHeight)):e$28(r.terrain[l].terrainData)?(a.minimumHeight=Math.min(r.terrain[l].terrainData._minimumHeight,a.minimumHeight),a.maximumHeight=Math.max(r.terrain[l].terrainData._maximumHeight,a.maximumHeight)):s=!1;if(s)return e;a.minimumHeight=Number.NaN,a.maximumHeight=Number.NaN;for(var u=e.parent;void 0!==u;){var c=u.data;if(void 0!==c){var h=c.mesh;if(void 0!==h&&void 0!==h.minimumHeight&&void 0!==h.maximumHeight)a.minimumHeight=h.minimumHeight,a.maximumHeight=h.maximumHeight,s=!0;else{var d=c.terrainData;void 0!==d&&void 0!==d._minimumHeight&&void 0!==d._maximumHeight&&(a.minimumHeight=d._minimumHeight*i.terrainExaggeration,a.maximumHeight=d._maximumHeight*i.terrainExaggeration,s=!0)}for(var l in c.terrain)e$28(c.terrain[l].mesh)?(a.minimumHeight=Math.min(c.terrain[l].mesh.minimumHeight,a.minimumHeight),a.maximumHeight=Math.max(c.terrain[l].mesh.maximumHeight,a.maximumHeight)):e$28(c.terrain[l].terrainData)?(a.minimumHeight=Math.min(c.terrain[l].terrainData._minimumHeight,a.minimumHeight),a.maximumHeight=Math.max(c.terrain[l].terrainData._maximumHeight,a.maximumHeight)):s=!1;if(s)return u}u=u.parent}}function Jr(e,t,i){return function(r){var n,o,a,s=-1,l=r.data.imagery,u=l.length;for(a=0;a<u;++a)if((o=u$Y((n=l[a]).readyImagery,n.loadingImagery)).imageryLayer===t){s=a;break}if(-1!==s){var c=s+e;if(o=e$28(n=l[c])?u$Y(n.readyImagery,n.loadingImagery):void 0,!e$28(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(r,i,c);for(a=s;a<c;++a)l[a].freeResources();l.splice(s,e)}return!0}}R$l.prototype.computeDistanceToTile=function(e,t){var i=Ba$1(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;r.boundingVolumeSourceTile!==i&&(r.boundingVolumeSourceTile=i,e$28(e.rectangle)&&(r.orientedBoundingBox=x$13.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=Sa(this,r.orientedBoundingBox.center,e.rectangle,n.minimumHeight,n.maximumHeight,r.occludeePointInScaledSpace),r.tileTerrainOrientedBoundingBox=new x$13(r.orientedBoundingBox.center,r.orientedBoundingBox.halfAxes)));var o=n.minimumHeight,a=n.maximumHeight;if(r.boundingVolumeSourceTile!==e){var s=t.camera.positionCartographic.height;Math.abs(s-o)>Math.abs(s-a)?(n.minimumHeight=o,n.maximumHeight=o):(n.minimumHeight=a,n.maximumHeight=a)}var l=n.distanceToCamera(t);return n.minimumHeight=o,n.maximumHeight=a,l},R$l.prototype._onLayerAdded=function(e,t){e.show&&(this._terrainProvider,this._imageLayerAdded(e,t),this._gridLayerAdded(e,t))},R$l.prototype._onLayerRemoved=function(e,t){e$28(e.imageryProvider)&&(this._quadtree.forEachLoadedTile((function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],l=s.loadingImagery;if(e$28(l)||(l=s.readyImagery),l.imageryLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)})),e$28(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()),e$28(e.gridProvider)&&(this._quadtree.forEachLoadedTile((function(t){for(var i=t.data.gridImagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],l=s.loadingGrid;if(e$28(l)||(l=s.readyGrid),l.gridLayer===e)-1===r&&(r=o),s.freeResources(),++n;else if(-1!==r)break}-1!==r&&i.splice(r,n)})),e$28(e.gridProvider)&&(e.gridProvider._reload=void 0))},R$l.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},R$l.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)},R$l.prototype._imageLayerAdded=function(e,t){var i=this._terrainProvider,r=this,n=e.imageryProvider;if(e$28(n)){var o=this._imageryLayersUpdatedEvent;n._reload=function(){e._imageryCache={},r._quadtree.forEachLoadedTile((function(t){if(!e$28(t._loadedCallbacks[e._layerIndex])){var r,n=t.data.imagery,o=n.length,a=-1,s=0;for(r=0;r<o;++r){var l=n[r];if(u$Y(l.readyImagery,l.loadingImagery).imageryLayer===e)-1===a&&(a=r),++s;else if(-1!==a)break}if(-1!==a){var u=a+s;e._createTileImagerySkeletons(t,i,u)&&(t._loadedCallbacks[e._layerIndex]=Jr(s,e,i),t.state=re$B.LOADING)}}}))},this._quadtree.forEachLoadedTile((function(t){e._createTileImagerySkeletons(t,i)&&(t.state=re$B.LOADING,0!==t.level&&(t._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||t._lastSelectionResult!==D$t.RENDERED)&&(t.renderable=!1))})),this._layerOrderChanged=!0,o.raiseEvent()}},R$l.prototype._gridLayerAdded=function(e,t){var i=this._terrainProvider,r=this,n=e.gridProvider;if(e$28(n)){var o=this._imageryLayersUpdatedEvent;n._reload=function(){e._gridCache={},r._quadtree.forEachLoadedTile((function(t){if(!e$28(t._loadedCallbacks[e._layerIndex])){var r,n=t.data.gridImagery,o=n.length,a=-1,s=0;for(r=0;r<o;++r){var l=n[r];if(u$Y(l.readyGrid,l.loadingGrid).gridLayer===e)-1===a&&(a=r),++s;else if(-1!==a)break}if(-1!==a){var u=a+s;e._createTileImagerySkeletons(t,i,u)&&(t._loadedCallbacks[e._layerIndex]=Jr(s,e,i),t.state=re$B.LOADING)}}}))},this._quadtree.forEachLoadedTile((function(t){e._createTileImagerySkeletons(t,i)&&(t.state=re$B.LOADING,0!==t.level&&(t._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||t._lastSelectionResult!==D$t.RENDERED)&&(t.renderable=!1))})),this._layerOrderChanged=!0,o.raiseEvent()}},R$l.prototype._onLayerUpdate=function(e,t){e$28(e.gridProvider)&&(this._quadtree.forEachLoadedTile((function(e){e.data.gridImagery.length>0&&(e.state=re$B.LOADING)})),e._isUpdate=!1)};var La$1=new y$15,je$8=new e$25,$r,Pr$1,Rt$4;function Ea$1(e,t){var i={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 t=e.context.uniformState.view,i=y$15.multiplyByPoint(t,this.properties.rtc,jr$2);return y$15.setTranslation(t,i,Zr),Zr},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=y$15.multiplyByPoint(t,this.properties.rtc,jr$2);return y$15.setTranslation(t,r,wt$5),y$15.multiply(i,wt$5,wt$5),wt$5},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_transparentBackColor:function(){return this.properties.transparentBackColor},u_imageryClipEnable:function(){return this.properties.imageryClipEnable},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureFlipY:function(){return this.properties.dayTextureFlipY},u_dayTextureAlpha:function(){var e=this.properties.morphingParentIndex;if(e>0){this.properties.morphingBeginTime<0&&(this.properties.morphingBeginTime=performance.now());var t=(performance.now()-this.properties.morphingBeginTime)/1e3;t=Math.min(t,1),this.properties.dayTextureAlpha[e]=1-t}return this.properties.dayTextureAlpha},u_dayMinAlphaFilters:function(){return this.properties.dayMinAlphaFilters},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_dayTextureSwipeRegion:function(){return this.properties.dayTextureSwipeRegion},u_GlobeAlpha:function(){return this.properties.globeAlpha},u_normalTexture:function(){return this.properties.normalTexture},u_normalTextureTranslationAndScale:function(){return this.properties.normalTextureTranslationAndScale},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){var i=t._clippingPlanes;return e$28(i)&&e$28(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var i=t._clippingPlanes;return e$28(i)?y$15.multiply(e.context.uniformState.view,i.modelMatrix,La$1):y$15.IDENTITY},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_GlobeSplitDirection:function(){return this.properties.globeSplitDirection},u_GlobeSwipeRegion:function(){return je$8.x=this.properties.globeSwipeRegion.x*e.context.drawingBufferWidth,je$8.y=(1-this.properties.globeSwipeRegion.y)*e.context.drawingBufferHeight,je$8.z=this.properties.globeSwipeRegion.z*e.context.drawingBufferWidth,je$8.w=(1-this.properties.globeSwipeRegion.w)*e.context.drawingBufferHeight,je$8},u_polygonOffset:function(){return this.properties.polygonOffset},u_pickIDColor:function(){return e.pickIDColor},uHypContourFillMode:function(){return this.properties.hypContourFillMode},uHypContourInterval:function(){return this.properties.hypContourInterval},uHypFloor:function(){return this.properties.hypFloor},uHypCeil:function(){return this.properties.hypCeil},uHypOpacity:function(){return this.properties.hypOpacity},uHypLineColor:function(){return this.properties.hypLineColor},uHypsometricTexture:function(){return this.properties.hypsometricTexture},uHypsometricRenderTexture:function(){return this.properties.hypsometricRenderTexture},uHypHasAnalysisRegion:function(){return this.properties.hypHasAnalysisRegion},uHypRect:function(){return this.properties.hypRect},uHypMaxVisibleValue:function(){return this.properties.hypMaxVisibleValue},uHypMinVisibleValue:function(){return this.properties.hypMinVisibleValue},uHypHasColorTable:function(){return this.properties.hypHasColorTable},uSlopeFillMode:function(){return this.properties.slopeFillMode},uSlopeRect:function(){return this.properties.slopeRect},uSlopeFloor:function(){return this.properties.slopeFloor},uSlopeCeil:function(){return this.properties.slopeCeil},uSlopeOpacity:function(){return this.properties.slopeOpacity},uSlopeArrowsColor:function(){return this.properties.slopeArrowsColor},uSlopeColorTexture:function(){return this.properties.slopeColorTexture},uSlopePolygonTexture:function(){return this.properties.slopePolygonTexture},uSlopeArrowsTexture:function(){return this.properties.slopeArrowsTexture},uHasSlopeRegion:function(){return this.properties.hasSlopeRegion},uSlopeMaxVisibleValue:function(){return this.properties.slopeMaxVisibleValue},uSlopeMinVisibleValue:function(){return this.properties.slopeMinVisibleValue},uSlopeHasColorTable:function(){return this.properties.slopeHasColorTable},uLevel:function(){return this.properties.level},uTopLevel:function(){return this.properties.topLevel},clip_mode:function(){return this.properties.clip_mode},clip_planes:function(){return this.properties.clip_planes},clip_line_color:function(){return this.properties.clip_line_color},flattenTexture:function(){return this.properties.flattenTexture},uTileBounds:function(){return this.properties.tileBounds},u_gridTextures:function(){return this.properties.gridTextures},u_gridTextureTranslationAndScale:function(){return this.properties.gridTextureTranslationAndScale},u_gridTextureUseWebMercatorT:function(){return this.properties.gridTextureUseWebMercatorT},u_gridTextureTexCoordsRectangle:function(){return this.properties.gridTextureTexCoordsRectangle},uModifyRasterTexture:function(){return this.properties.modifyRasterTexture},uParentMixDirection:function(){return this.properties.parentMixDirection},uBaseColorFactor:function(){return this.properties.baseColorFactor},uMetallicFactor:function(){return this.properties.metallic},uRoughnessFactor:function(){return this.properties.roughness},uEmissionFactor:function(){return this.properties.emissionFactor},uFloodTexture:function(){return this.properties.floodTexture},uFloodRect:function(){return this.properties.floodRect},u_sunLightColor:function(){return this.properties.sunLightColor},u_ambientLightColor:function(){return this.properties.ambientLightColor},uFrontDepthTexture:function(){return this.properties.frontDepthTexture},uBackDepthTexture:function(){return this.properties.backDepthTexture},uFrontColorTexture:function(){return this.properties.frontColorTexture},properties:{initialColor:new e$25(0,0,.5,1),fillHighlightColor:new e$1S(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new o$1k(65e5,9e6),nightFadeDistance:new o$1k(1e7,4e7),hsbShift:new t$X,center3D:void 0,rtc:new t$X,modifiedModelView:new y$15,tileRectangle:new e$25,dayTextures:[],dayTextureTranslationAndScale:[],transparentBackColor:[],imageryClipEnable:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureFlipY:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureSwipeRegion:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],dayMinAlphaFilters:[],southAndNorthLatitude:new o$1k,southMercatorYAndOneOverHeight:new o$1k,waterMask:void 0,waterMaskTranslationAndScale:new e$25,minMaxHeight:new o$1k,scaleAndBias:new y$15,clippingPlanesEdgeColor:e$1S.clone(e$1S.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new e$25,globeAlpha:1,normalTexture:void 0,normalTextureTranslationAndScale:new e$25,tileBounds:new e$25,hypContourFillMode:0,uHypContourInterval:0,hypFloor:0,hypCeil:0,hypOpacity:1,hypLineColor:new e$1S,hypsometricTexture:void 0,hypsometricRenderTexture:void 0,hypHasAnalysisRegion:new e$25,hypRect:new e$25,hypMaxVisibleValue:0,hypMinVisibleValue:0,hypHasColorTable:!1,slopeFillMode:0,slopeRect:new e$25,slopeFloor:0,slopeCeil:0,slopeOpacity:1,slopeColorTexture:void 0,slopePolygonTexture:void 0,slopeArrowsTexture:void 0,hasSlopeRegion:!1,slopeMaxVisibleValue:0,slopeMinVisibleValue:0,slopeHasColorTable:!1,level:0,topLevel:0,clip_mode:0,clip_planes:void 0,clip_line_color:new e$1S,flattenTexture:void 0,gridTextures:[],gridTextureTranslationAndScale:[],gridTextureTexCoordsRectangle:[],gridTextureUseWebMercatorT:[],modifyRasterTexture:void 0,morphingParentIndex:-1,morphingBeginTime:-1,parentMixDirection:0,baseColorFactor:new e$25(1,1,1,1),metallic:0,roughness:0,emissionFactor:t$X.UNIT_XYZ,floodRect:new e$25,floodTexture:void 0,sunLightColor:new e$1S,ambientLightColor:new e$1S,frontDepthTexture:void 0,backDepthTexture:void 0,frontColorTexture:void 0}};return i}function Fa$1(e,t,i){var r,n,o=i.data;if(e$28(o.vertexArray)?(r=o.mesh,n=o.vertexArray):e$28(o.fill)&&e$28(o.fill.vertexArray)&&(r=o.fill.mesh,n=o.fill.vertexArray),e$28(r)&&e$28(n)){if(e$28(o.wireframeVertexArray)){if(o.wireframeVertexArray.mesh===r)return;o.wireframeVertexArray.destroy(),o.wireframeVertexArray=void 0}o.wireframeVertexArray=Ha$1(e,n,r),o.wireframeVertexArray.mesh=r}}function Ha$1(e,t,i){var r={indices:i.indices,primitiveType:W$_.TRIANGLES};k$Z.toWireframe(r);var n=r.indices,o=h$W.createIndexBuffer({context:e,typedArray:n,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.fromSizeInBytes(n.BYTES_PER_ELEMENT)});return new m$19({context:e,attributes:t._attributes,indexBuffer:o})}!function(){var e,t,i=new d$15({geometry:o$1c.fromDimensions({dimensions:new t$X(2,2,2)})}),r=new d$15({geometry:new a$Q({radius:1})}),n=new y$15;function o(e){return new v$C({geometryInstances:e,appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1})}$r=function(r,a){return r===e||(Rt$4(),e=r,n=y$15.fromRotationTranslation(r.halfAxes,r.center,n),i.modelMatrix=n,i.attributes.color=o$18.fromColor(a),t=o(i)),t},Pr$1=function(i,a){return i===e||(Rt$4(),e=i,n=y$15.fromTranslation(i.center,n),n=y$15.multiplyByUniformScale(n,i.radius,n),r.modelMatrix=n,r.attributes.color=o$18.fromColor(a),t=o(r)),t},Rt$4=function(){e$28(t)&&(t.destroy(),t=void 0,e=void 0)}}();var Ia$1=new e$25(0,0,0,0),Da={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,applySplit:void 0,applySwipe: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,numberOfGridTextures:void 0,gridUpdate:!1,applyMinAlphaFilter:!1},Je$4=new e$25;function er$3(e,t,i,r,n,o,a){var s=t.data;if(s.terrainState!==De$d.INVALID&&(!1!==e.terrainProvider.isShowGlobe||e$28(s.mesh)&&!s.mesh.invalid)&&(!e$28(i)||e$28(i.mesh)&&!i.mesh.invalid&&e$28(i.vertexArray))&&(e$28(s.vertexArray)||(void 0===s.fill&&(s.fill=new Q$n(t)),s.fill.update(e,n),e$28(t.data.fill.vertexArray)))){var l=n.creditDisplay,u=s.terrainData;if(e$28(i))u=i.terrainData;if(e$28(u)&&e$28(u.credits))for(var c=u.credits,h=0,d=c.length;h<d;++h)l.addCredit(c[h]);var f=e$1U.maximumTextureImageUnits,p=s.waterMaskTexture,_=s.waterMaskTranslationAndScale;!e$28(p)&&e$28(s.fill)&&(p=s.fill.waterMaskTexture,_=s.fill.waterMaskTranslationAndScale);var m=e.hasWaterMask&&e$28(p),$=e.oceanNormalMap,g=m&&e$28($),v=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,y=e$28(e._PBRMaterialParams)&&e._PBRMaterialParams.roughness>0,x=n.fog.enabled,b=e.showGroundAtmosphere,w=q$L.castShadows(e.shadows),C=q$L.receiveShadows(e.shadows),T=e.hueShift,S=e.saturationShift,E=e.brightnessShift,A=!(e$27.equalsEpsilon(T,0,e$27.EPSILON7)&&e$27.equalsEpsilon(S,0,e$27.EPSILON7)&&e$27.equalsEpsilon(E,0,e$27.EPSILON7)),P=!1;if(b){var I,M=n.mode,O=n.camera;I=M===P$$.SCENE2D||M===P$$.COLUMBUS_VIEW?O.positionCartographic.height:t$X.magnitude(O.positionWC);var D=e.nightFadeOutDistance;M!==P$$.SCENE3D&&(D-=n.mapProjection.ellipsoid.maximumRadius),P=I>D}var R=s.normalTexture,L=e$28(R),B=e$28(e._slopeSetting)&&e._slopeSetting.DisplayMode!==Vi$3.DisplayMode.NONE&&e._bUseSlopeColorTable&&e$28(e._slopeArrowsTexture),N=e$28(e._hypsometricSetting)&&e._hypsometricSetting.DisplayMode!==k$T.DisplayMode.NONE&&e._bUseHypColorTable,F=e$28(n.camera._scene.globe._floodFlagTexture);m&&--f,g&&--f,L&&--f,B&&(f-=3),N&&(f-=2),n.shadowMaps.length>0&&--f,F&&--f;var z=!o&&t._clipRegionRasterized&&t.isModified,k=!o&&t._clipRegionRasterized&&(e._excavateRegions.length>0||e._extractRegions.length>0),V=!o&&t._clipRegionRasterized&&e._extractRegions.length>0,U=!o&&t._clipRegionRasterized&&!t.isModified&&e._imageryClipRegions.length>0,X=!o&&B&&!t.isModified&&e$28(e._slopeRegion),H=!o&&N&&!t.isModified&&e$28(e._hypsometricRegion)&&e$28(t._clipRasterTexture),G=!1,W=!1;k&&-1===n._fboState.name.indexOf("_excavationGlobeHeight")&&(--f,G=e.clippingType===V$i.KeepOutside,W=e.clippingType===V$i.KeepInside),z||(z=!e$28(i)&&e$28(a)),G||(G=!e$28(i)&&e$28(a)),U&&--f;var Y=o?s.modifyTerrainMesh[e.vaIndex]:s.renderedMesh;e$28(i)&&i.mesh&&(Y=i.mesh);var q=Y.center,j=Y.encoding,Z=Ta$1,K=0,Q=0,J=0,ee=0,te=!1;if(n.mode!==P$$.SCENE3D){var ie=n.mapProjection,re=ie.project(h$10.southwest(t.rectangle),Aa$1),ne=ie.project(h$10.northeast(t.rectangle),Ca$1);if(Z.x=re.x,Z.y=re.y,Z.z=ne.x,Z.w=ne.y,n.mode!==P$$.MORPHING&&((q=Ra$1).x=0,q.y=.5*(Z.z+Z.x),q.z=.5*(Z.w+Z.y),Z.x-=q.y,Z.y-=q.z,Z.z-=q.y,Z.w-=q.z),n.mode===P$$.SCENE2D&&j.quantization===ye$s.BITS12){var oe=1/(Math.pow(2,12)-1)*.5,ae=(Z.z-Z.x)*oe,se=(Z.w-Z.y)*oe;Z.x-=ae,Z.y-=se,Z.z+=ae,Z.w+=se}ie instanceof t$M&&(K=t.rectangle.south,Q=t.rectangle.north,J=t$M.geodeticLatitudeToMercatorAngle(K),ee=1/(t$M.geodeticLatitudeToMercatorAngle(Q)-J),te=!0)}var le=Da;le.frameState=n,le.surfaceTile=s,le.showReflectiveOcean=m,le.showOceanWaves=g,le.enableLighting=e.enableLighting,le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,le.showGroundAtmosphere=b,le.perFragmentGroundAtmosphere=P,le.hasVertexNormals=v,le.hasRoughness=y,le.useWebMercatorProjection=te,le.clippedByBoundaries=s.clippedByBoundaries,le.applyModify=z,le.applyExtract=V,le.excavationRegion=G,le.excavationOuter=W;var ue=s.imagery;le.excavationGeometry=!1;var ce=[];if(t._useParentImage){ue=[];for(var he=0;he<s.imagery.length;he++){var de=!1,fe=s.imagery[he].readyImagery;if(e$28(fe)&&fe.imageryLayer.featherEdgesEnabled){var pe=t.parent;if(e$28(pe))for(var _e=fe.imageryLayer.imageryProvider.tablename,me=0;me<pe.data.imagery.length;me++){var $e=pe.data.imagery[me],ge=$e.readyImagery;if(e$28(ge))if((vt=ge.imageryLayer).imageryProvider.tablename===_e){ce[he]=vt._calculateTextureTranslationAndScale(t,$e),ue.push($e),de=!0;break}}}de||ue.push(s.imagery[he])}}var ve=0,ye=0,xe=ue.length,be=s.gridImagery,we=be.length,Ce=[],Te=[],Se=[];e$28(t._rasterTexture)&&(Ce.push(t._rasterTexture),Te.push(new e$25(0,0,0,0)),Se.push(1),xe+=1),e$28(t._2DRasterTexture)&&(Ce.push(t._2DRasterTexture),Te.push(new e$25(0,0,0,.1)),Se.push(t._2DRasterTexture.textureAlpha),xe+=1);var Ee=Ce.length,Ae=e.backFaceCulling?e._renderState:e._disableCullingRenderState,Pe=e.backFaceCulling?e._blendRenderState:e._disableCullingBlendRenderState,Ie=Ae,Me=e._firstPassInitialColor,Oe=n.context;e$28(e._debug.boundingSphereTile)||Rt$4();var De=(4&n.useType)>0?1:0;De&&--f;var Re=(2&n.useType)>0?1:0;Re&&--f,e$28(n.mvtLayerCount)&&n.mvtLayerCount>0&&f--;var Le=n.multiViewportIndex>-1,Be=o?e._modifyDrawCommands:e._drawCommands,Ne=o?e._modifyUniformMaps:e._uniformMaps;do{var Fe,ze,ke=o?e._modifyUsedDrawCommands:e._usedDrawCommands,Ve=0;Be.length<=ke?((Fe=new r$15).owner=t,Fe.cull=!1,Fe.boundingVolume=new i$19,Fe.orientedBoundingBox=void 0,ze=Ea$1(n,e),Be.push(Fe),Ne.push(ze)):(Fe=Be[ke],ze=Ne[ke]),Fe.owner=t,o?++e._modifyUsedDrawCommands:++e._usedDrawCommands,t===e._debug.boundingSphereTile&&(e$28(s.orientedBoundingBox)?$r(s.orientedBoundingBox,e$1S.RED).update(n):e$28(s.boundingSphere3D)&&Pr$1(s.boundingSphere3D,e$1S.RED).update(n));var Ue=ze.properties;if(Ue.globeAlpha=e.globeAlpha,e$25.clone(Me,Ue.initialColor),e$1S.clone(n.lightSource.sunLightColor,Ue.sunLightColor),e$1S.clone(n.lightSource.ambientLightColor,Ue.ambientLightColor),Ue.oceanNormalMap=$,Ue.lightingFadeDistance.x=e.lightingFadeOutDistance,Ue.lightingFadeDistance.y=e.lightingFadeInDistance,Ue.nightFadeDistance.x=e.nightFadeOutDistance,Ue.nightFadeDistance.y=e.nightFadeInDistance,Ue.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity,Ue.tileBounds.x=t.rectangle.west,Ue.tileBounds.y=t.rectangle.south,Ue.tileBounds.z=t.rectangle.east,Ue.tileBounds.w=t.rectangle.north,e$28(e._hypsometricSetting)&&(Ue.hypContourFillMode=e._hypsometricSetting.DisplayMode,Ue.hypContourInterval=e._hypsometricSetting.LineInterval,Ue.hypFloor=e._hypsometricSetting.ColorTableMinKey,Ue.hypCeil=e._hypsometricSetting.ColorTableMaxKey,Ue.hypOpacity=e._hypsometricSetting.Opacity,Ue.hypLineColor=e._hypsometricSetting.LineColor,Ue.hypsometricTexture=e._hypsometricTexture,Ue.hypsometricRenderTexture=e._hypsometricRenderTexture,Ue.hypHasAnalysisRegion=e._bUseHypRegion,Ue.hypRect=e._geoBounds,Ue.hypMaxVisibleValue=e._hypsometricSetting.MaxVisibleValue,Ue.hypMinVisibleValue=e._hypsometricSetting.MinVisibleValue,Ue.hypHasColorTable=e._bUseHypColorTable&&!Re),y&&(Ue.baseColorFactor=e._PBRMaterialParams.baseColorFactor,Ue.metallic=e._PBRMaterialParams.metallic,Ue.roughness=e._PBRMaterialParams.roughness,Ue.emissionFactor=e._PBRMaterialParams.emissionFactor),e$28(e._slopeSetting)&&(Ue.slopeFillMode=e._slopeSetting.DisplayMode,Ue.slopeRect=e._slopeBound,Ue.slopeFloor=e$27.toRadians(e._slopeSetting.ColorTableMinKey),Ue.slopeCeil=e$27.toRadians(e._slopeSetting.ColorTableMaxKey),Ue.slopeOpacity=e._slopeSetting.Opacity,Ue.slopeColorTexture=e._slopeColorTexture,Ue.slopePolygonTexture=e._slopePolygonTexture,Ue.slopeArrowsTexture=e._slopeArrowsTexture,Ue.hasSlopeRegion=e._bUseSlopeRegion,Ue.slopeMaxVisibleValue=e$27.toRadians(e._slopeSetting.MaxVisibleValue),Ue.slopeMinVisibleValue=e$27.toRadians(e._slopeSetting.MinVisibleValue),Ue.slopeHasColorTable=e._bUseSlopeColorTable,Ue.slopeArrowsColor=e._slopeSetting.SlopeArrowsColor,Ue.level=t.level,Ue.topLevel=r),e$28(n.camera._scene.globe._floodFlagTexture)&&(Ue.floodRect=n.camera._scene.globe._floodRect,Ue.floodTexture=n.camera._scene.globe._floodFlagTexture),e$28(t._clipRasterTexture)?Ue.modifyRasterTexture=t._clipRasterTexture:!e$28(i)&&e$28(a)&&(Ue.modifyRasterTexture=a),e._excavationGeometrys&&e._excavationGeometrys.length>0){var Xe=e._excavationGeometrys.values[0];3===Xe.spatialQuery._textures.length&&(Ue.frontDepthTexture=Xe.spatialQuery._textures[0],Ue.backDepthTexture=Xe.spatialQuery._textures[1],Ue.frontColorTexture=Xe.spatialQuery._textures[2],le.excavationGeometry=!0)}Ue.clip_mode=e._clipMode,Ue.clip_planes=e._clipPlane,Ue.clip_line_color=e._clipLineColor,Ue.flattenTexture=e._flattenTexture;var He=!e$28(s.vertexArray)&&e$28(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;He&&e$1S.clone(e.fillHighlightColor,Ue.fillHighlightColor),Ue.center3D=Y.center,t$X.clone(q,Ue.rtc),e$25.clone(Z,Ue.tileRectangle),Ue.southAndNorthLatitude.x=K,Ue.southAndNorthLatitude.y=Q,Ue.southMercatorYAndOneOverHeight.x=J,Ue.southMercatorYAndOneOverHeight.y=ee,Ue.globeSplitDirection=e.splitDirection,Ue.globeSwipeRegion=e._swipeRegion,Ue.polygonOffset=e._polygonOffset.value;var Ge=wa$1,We=$t$1(t.rectangle,e.cartographicLimitRectangle);t$X.fromElements(T,S,E,Ue.hsbShift);var Ye=t.rectangle,qe=1/Ye.width,je=1/Ye.height;Ge.x=(We.west-Ye.west)*qe,Ge.y=(We.south-Ye.south)*je,Ge.z=(We.east-Ye.west)*qe,Ge.w=(We.north-Ye.south)*je,e$25.clone(Ge,Ue.localizedCartographicLimitRectangle);var Ze=x&&e$27.fog(t._distance,n.fog.density)>e$27.EPSILON3;A=A&&(Ze||b);for(var Ke=!1,Qe=!1,Je=!1,et=!1,tt=!1,it=!1,rt=!1,nt=!1,ot=!1,at=!1,st=!1,lt=!o$1k.equals(e.splitDirection,o$1k.ZERO),ut=e._swipeEnabled,ct=[],ht=e._polygonOffset.enabled;Ve<f&&ve<xe;)if(ve!=xe-Ee||0==Ee){var dt=ue[ve],ft=ce[ve],pt=dt.readyImagery;if(++ve,!e$28(pt)||dt.discard)continue;var _t=n.camera._positionCartographic.height,mt=pt.imageryLayer.maxHeight,$t=pt.imageryLayer.minHeight;if(pt.imageryLayer._inVisibleHeightRange=_t>mt||_t<$t?0:1,pt.imageryLayer.alpha*pt.imageryLayer._inVisibleHeightRange==0||(pt.setVisible(!0),Le&&!pt.imageryLayer._isBaseLayer&&!pt.imageryLayer.getVisibleInViewport(n.multiViewportIndex)))continue;if(n.camera._scene._mvtVisibleControl){var gt=n.camera._scene._mvtVisibleLevel;if(e$28(pt.isMvtTexture)&&pt.isMvtTexture&&!(t._level>n.camera._endLevel-gt))continue}if(!e$28(Rt=dt.useWebMercatorT?pt.textureWebMercator:pt.texture))throw new t$Z("readyImagery is not actually ready!");var vt=pt.imageryLayer;if(e$28(pt.isMvtTexture)&&pt.isMvtTexture){var yt=pt.imageryLayer._selectColor;ct.push({textureIndex:Ve,selectColor:yt})}if(e$28(dt.textureTranslationAndScale)||(dt.textureTranslationAndScale=vt._calculateTextureTranslationAndScale(t,dt)),Ue.dayTextures[Ve]=Rt,Ue.dayTextureTranslationAndScale[Ve]=dt.textureTranslationAndScale,Ue.dayTextureTexCoordsRectangle[Ve]=dt.textureCoordinateRectangle,e$28(ft)&&(Ue.dayTextureTranslationAndScale[Ve]=ft,Ue.dayTextureTexCoordsRectangle[Ve]=new e$25(0,0,1,1)),Ue.dayTextureUseWebMercatorT[Ve]=dt.useWebMercatorT,Ue.dayTextureFlipY[Ve]=dt.flipY,(Tt=new e$25).x=vt.transparentBackColor.red,Tt.y=vt.transparentBackColor.green,Tt.z=vt.transparentBackColor.blue,Tt.w=vt.transparentBackColorTolerance,Ue.transparentBackColor[Ve]=Tt,Ue.imageryClipEnable[Ve]=vt.enableImageryClip,Ue.dayTextureAlpha[Ve]=u$Y(dt.morphingAlpha,vt.alpha),rt=rt||1!==Ue.dayTextureAlpha[Ve],dt.morphingAlpha<1){var xt=ue[ve-1];e$28(xt)&&!e$28(xt.loadingImagery)&&(Ue.morphingParentIndex=Ve,Ue.morphingBeginTime=xt.morphingBeginTime)}Ue.dayMinAlphaFilters[Ve]=vt.minTextureAlphaFilter,Ke=Ke||vt.minTextureAlphaFilter>0,Ue.dayTextureBrightness[Ve]=vt.brightness,Qe=Qe||Ue.dayTextureBrightness[Ve]!==h$p.DEFAULT_BRIGHTNESS,Ue.dayTextureContrast[Ve]=vt.contrast,Je=Je||Ue.dayTextureContrast[Ve]!==h$p.DEFAULT_CONTRAST,Ue.dayTextureHue[Ve]=vt.hue,et=et||Ue.dayTextureHue[Ve]!==h$p.DEFAULT_HUE,Ue.dayTextureSaturation[Ve]=vt.saturation,tt=tt||Ue.dayTextureSaturation[Ve]!==h$p.DEFAULT_SATURATION,Ue.dayTextureOneOverGamma[Ve]=1/vt.gamma,it=it||Ue.dayTextureOneOverGamma[Ve]!==1/h$p.DEFAULT_GAMMA,Ue.dayTextureSplit[Ve]=vt.splitDirection,Je$4.x=vt._swipeRegion.x*n.context.drawingBufferWidth,Je$4.y=(1-vt._swipeRegion.y)*n.context.drawingBufferHeight,Je$4.z=vt._swipeRegion.z*n.context.drawingBufferWidth,Je$4.w=(1-vt._swipeRegion.w)*n.context.drawingBufferHeight,Ue.dayTextureSwipeRegion[Ve]=e$25.clone(Je$4,new e$25),nt=nt||!o$1k.equals(Ue.dayTextureSplit[Ve],o$1k.ZERO),ot=ot||vt.swipeEnabled;var bt=Ue.dayTextureCutoutRectangles[Ve];if(e$28(bt)||(bt=Ue.dayTextureCutoutRectangles[Ve]=new e$25),e$25.clone(e$25.ZERO,bt),e$28(vt.cutoutRectangle)){var wt=$t$1(Ye,vt.cutoutRectangle);at=e$28(h$10.simpleIntersection(wt,Ye,Kr))||at,bt.x=(wt.west-Ye.west)*qe,bt.y=(wt.south-Ye.south)*je,bt.z=(wt.east-Ye.west)*qe,bt.w=(wt.north-Ye.south)*je}var Ct=Ue.colorsToAlpha[Ve];e$28(Ct)||(Ct=Ue.colorsToAlpha[Ve]=new e$25);var Tt,St=e$28(vt.colorToAlpha)&&vt.colorToAlphaThreshold>0;if(st=st||St,St){var Et=vt.colorToAlpha;Ct.x=Et.red,Ct.y=Et.green,Ct.z=Et.blue,Ct.w=vt.colorToAlphaThreshold}else Ct.w=-1;if(++Ve,e$28(pt.idTexture))Ue.dayTextures[Ve]=pt.idTexture,Ue.dayTextureTranslationAndScale[Ve]=dt.textureTranslationAndScale,Ue.dayTextureTexCoordsRectangle[Ve]=dt.textureCoordinateRectangle,Ue.dayTextureUseWebMercatorT[Ve]=dt.useWebMercatorT,(Tt=new e$25).x=vt.transparentBackColor.red,Tt.y=vt.transparentBackColor.green,Tt.z=vt.transparentBackColor.blue,Tt.w=vt.transparentBackColor,Ue.transparentBackColor[Ve]=Tt,Ue.dayTextureAlpha[Ve]=vt.alpha,Ue.dayTextureBrightness[Ve]=vt.brightness,Ue.dayTextureContrast[Ve]=vt.contrast,Ue.dayTextureHue[Ve]=vt.hue,Ue.dayTextureSaturation[Ve]=vt.saturation,Ue.dayTextureOneOverGamma[Ve]=1/vt.gamma,Ue.dayTextureSplit[Ve]=vt.splitDirection,Ue.dayTextureSwipeRegion[Ve]=vt._swipeRegion,Ue.dayMinAlphaFilters[Ve]=vt.minTextureAlphaFilter,Ve++;if(e$28(pt.credits))for(var At=pt.credits,Pt=0,It=At.length;Pt<It;++Pt)l.addCredit(At[Pt])}else{if(++ve,!e$28(Rt=Ce[ye]))throw new t$Z("readyImagery is not actually ready!");Ue.dayTextures[Ve]=Rt,Ue.dayTextureTranslationAndScale[Ve]=new e$25(0,0,1,1),Ue.transparentBackColor[Ve]=Te[ye],Ue.dayTextureTexCoordsRectangle[Ve]=new e$25(0,0,1,1),Ue.dayTextureUseWebMercatorT[Ve]=!1,Ue.dayTextureAlpha[Ve]=Se[ye],rt=rt||1!==Se[ye],Ue.dayTextureBrightness[Ve]=1,Qe=!1,Ue.dayTextureContrast[Ve]=1,Je=!1,Ue.dayTextureHue[Ve]=0,et=!1,Ue.dayTextureSaturation[Ve]=1,tt=!1,Ue.dayTextureOneOverGamma[Ve]=1,it=!1,Ue.dayTextureSplit[Ve]=new o$1k(0,0),Ue.dayTextureSwipeRegion[Ve]=n.realtimeRasterSwipeParams.swipeRegion,Ue.dayMinAlphaFilters[Ve]=0,Ke=!1,nt=!0,ot=n.realtimeRasterSwipeParams.swipeEnabled,ye++,++Ve}for(var Mt=0,Ot=0,Dt=!1;Mt<f-Ve&&Ot<we;){var Rt,Lt=be[Ot],Bt=Lt.readyGrid;if(++Ot,null!=Bt&&(!Le||Bt.gridLayer.getVisibleInViewport(n.multiViewportIndex)))if(null!=(Rt=Lt.useWebMercatorT?Bt.textureWebMercator:Bt.texture)){Bt.needUpdate&&(Dt=!0,Bt.needUpdate=!1);var Nt=Bt.gridLayer;e$28(Lt.textureTranslationAndScale)||(Lt.textureTranslationAndScale=Nt._calculateTextureTranslationAndScale(t,Lt)),Ue.gridTextures[Mt]=Rt,Ue.gridTextureTranslationAndScale[Mt]=Lt.textureTranslationAndScale,Ue.gridTextureTexCoordsRectangle[Mt]=Lt.textureCoordinateRectangle,Ue.gridTextureUseWebMercatorT[Mt]=Lt.useWebMercatorT,Mt++}}Ue.gridTextures.length=Mt,Ue.dayTextures.length=Ve,Ue.waterMask=p,e$25.clone(_,Ue.waterMaskTranslationAndScale),Ue.minMaxHeight.x=j.minimumHeight,Ue.minMaxHeight.y=j.maximumHeight,y$15.clone(j.matrix,Ue.scaleAndBias);var Ft=e._clippingPlanes,zt=e$28(Ft)&&Ft.enabled&&t.isClipped;zt&&(Ue.clippingPlanesEdgeColor=e$1S.clone(Ft.edgeColor,Ue.clippingPlanesEdgeColor),Ue.clippingPlanesEdgeWidth=Ft.edgeWidth),e$28(e.uniformMap)&&(ze=p$17(ze,e.uniformMap)),le.numberOfDayTextures=Ve,le.applyBrightness=Qe,le.applyContrast=Je,le.applyHue=et,le.applySaturation=tt,le.applyGamma=it,le.applyAlpha=rt,le.applySplit=nt,le.applySwipe=ot,le.applyGlobeSwipe=ut,le.applyGlobeSplit=lt,le.enableFog=Ze,le.enableClippingPlanes=zt,le.clippingPlanes=Ft,le.hasImageryLayerCutout=at,le.colorCorrect=A,le.isHeight=De,le.isColor=Re,le.hasNormalMap=L,le.hasHypsometricSetting=N,le.hasSlopeAnalysis=B,le.highlightFillTile=He,le.colorToAlpha=st,le.mvtTextureObj=ct,le.numberOfGridTextures=Mt,le.gridUpdate=Dt,le.applyPolygonOffset=ht,le.mixDirection=0,le.mixIndex=0,le.hasFlood=F,le.applyImageryClip=U,le.hasHypsometricRegion=H,le.applySlopeRegion=X,le.applyMinAlphaFilter=Ke;var kt=Y.indices.length;e.showSkirts||(kt=Y.indexCountWithoutSkirts),kt=o?s.modifyTerrainVertexArray[e.vaIndex]._indexBuffer.numberOfIndices:kt,Ue.normalTexture=R,e$25.clone(s.normalTextureTranslationAndScale,Ue.normalTextureTranslationAndScale),Fe.shaderProgram=e._surfaceShaderSet.getShaderProgram(le),Fe.castShadows=w,Fe.receiveShadows=C,Fe.renderState=e.globeAlpha<1&&n.camera.positionCartographic.height<1e5?Pe:Ie,Fe.primitiveType=W$_.TRIANGLES,e$28(i)?Fe.vertexArray=o?s.modifyTerrainVertexArray[e.vaIndex]:i.vertexArray:Fe.vertexArray=o?s.modifyTerrainVertexArray[e.vaIndex]:s.subDivisionVertexArray||s.vertexArray||s.fill.vertexArray,Fe.count=kt,Fe.uniformMap=ze,Fe.pass=e.globeAlpha<1?Le$p.TRANSLUCENT:Le$p.GLOBE,Fe.opaquePass=Le$p.GLOBE,e._debug.wireframe&&(Fa$1(Oe,e,t),e$28(s.wireframeVertexArray)&&(Fe.vertexArray=s.wireframeVertexArray,Fe.primitiveType=W$_.LINES));var Vt=Fe.boundingVolume,Ut=Fe.orientedBoundingBox;if(n.mode!==P$$.SCENE3D){var Xt=s.tileBoundingRegion;i$19.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Xt.minimumHeight,Xt.maximumHeight,Vt),t$X.fromElements(Vt.center.z,Vt.center.x,Vt.center.y,Vt.center),n.mode===P$$.MORPHING&&(Vt=i$19.union(Y.boundingSphere3D,Vt,Vt))}else Fe.boundingVolume=i$19.clone(Y.boundingSphere3D,Vt),Fe.orientedBoundingBox=x$13.clone(s.orientedBoundingBox,Ut),e$28(Fe.boundingVolume)||(Fe.boundingVolume=i$19.fromOrientedBoundingBox(Fe.orientedBoundingBox));Fe.dirty=!0,Fe.invalid=u$Y(t.invalid,!1),n.commandList.push(Fe),Ie=Pe,Me=Ia$1}while(ve<xe)}}var ei$1=new t$X,At$3=new t$W;function Na(e,t){for(var i=y$15.getTranslation(t,new t$X),r=e.attributes.position.values,n=r.length,o=0;o<n;o+=3){t$X.unpack(r,o,ei$1),t$W.fromCartesian(ei$1,void 0,At$3);var a=e$27.toDegrees(At$3.longitude);a-=i.x;var s=e$27.toDegrees(At$3.latitude);s-=i.y,r[o]=a,r[o+1]=s,r[o+2]=At$3.height-1}}function Ue$9(e,t){if(!e$28(t.command)){var i=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:t.modelMatrix});Na(t.worldGeometry,t.modelMatrix),i.vertexArray=m$19.fromGeometry({context:e,geometry:t.worldGeometry,attributeLocations:{position:0},bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var r=["attribute vec4 position;","varying float vHeight;","void main()","{"," vHeight = position.z;"," gl_Position = czm_modelViewProjection * vec4(position.xy, 0.0, 1.0);","}"].join("\n"),n=["varying float vHeight;","void main()","{"," gl_FragColor = czm_packValue(vHeight);","}"].join("\n"),o=new a$$({sources:[r]}),a=new a$$({sources:[n]});i.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:{position:0}}),t.command=i}}function Ve$a(e){var t=e._clipRasterTilesMap;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];r._clipRasterTexture=r._clipRasterTexture&&!r._clipRasterTexture.isDestroyed()&&r._clipRasterTexture.destroy(),r._clipRasterFbo=r._clipRasterFbo&&!r._clipRasterFbo.isDestroyed()&&r._clipRasterFbo.destroy(),r._clipRegionsCount=0,r._clipRegionRasterized=!1}}function tr$2(e,t){var i=e._clipRasterTilesMap;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];e$28(h$10.intersection(t,n.rectangle))||(n._clipRasterTexture=n._clipRasterTexture&&!n._clipRasterTexture.isDestroyed()&&n._clipRasterTexture.destroy(),n._clipRasterFbo=n._clipRasterFbo&&!n._clipRasterFbo.isDestroyed()&&n._clipRasterFbo.destroy(),n._clipRegionsCount=0,n._clipRegionRasterized=!1)}}function rr$2(e,t,i){if(i){var r=e.camera._projection.project(t$W.fromDegrees(t.positions[0],t.positions[1]));r=new t$X(r.z,r.x,r.y),t._excavateMatrix=y$15.fromTranslation(r)}else t._excavateMatrix=m$1b.eastNorthUpToFixedFrame(t$X.fromDegrees(t.positions[0],t.positions[1]))}function ti$2(e,t){!t._excavationSideTexture&&e$28(t._excavationSideTextureUrl)&&o$1q(t$S.createIfNeeded(t._excavationSideTextureUrl).fetchImage(),(function(i){t._excavationSideTexture=new L$17({context:e.context,source:i,sampler:new n$Y({wrapS:t._excavateTextureWrap,wrapT:t._excavateTextureWrap})}),t._excavationSideTexture.generateMipmap(S$N.NICEST)}))}function ri$1(e,t){!t._excavationBottomTexture&&e$28(t._excavationBottomTextureUrl)&&o$1q(t$S.createIfNeeded(t._excavationBottomTextureUrl).fetchImage(),(function(i){t._excavationBottomTexture=new L$17({context:e.context,source:i})}))}function ii$2(e,t){!t._excavationNormalTexture&&e$28(t.excavationNormalTextureUrl)&&o$1q(t$S.createIfNeeded(t.excavationNormalTextureUrl).fetchImage(),(function(i){t._excavationNormalTexture=new L$17({context:e.context,source:i})}));!t._excavationSideNormalTexture&&e$28(t.excavationSideNormalTextureUrl)&&o$1q(t$S.createIfNeeded(t.excavationSideNormalTextureUrl).fetchImage(),(function(i){t._excavationSideNormalTexture=new L$17({context:e.context,source:i,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT})})}))}R$l.prototype._updateExcavateRegions=function(e){if(!(!this._excavateRegionUpdate||e.camera.bReflect||this._tilesToRenderByTextureCount.length<1)){for(var t in this._excavateRegionUpdate=!1,e._framebufferList)t.indexOf("_excavationGlobeHeight")>-1&&!e$28(this._excavateRegions.get(t.slice(22)))&&(e._framebufferList[t]=!e._framebufferList[t].isDestroyed()&&e._framebufferList[t].destroy(),delete e._framebufferList[t]);if(this._excavateRegions.length<1)return void Ve$a(this);this._onceExcavateRegionsEmpty&&(Ve$a(this),this._onceExcavateRegionsEmpty=!1);var i=!1;e.camera._scene.mode===P$$.COLUMBUS_VIEW&&(i=!0);var r=nr$2(this._excavateRegions.values);tr$2(this,r),this._excavateRectangle=r,ti$2(e,this),ri$1(e,this),ii$2(e,this);for(var n=this._excavateRegions.length,o=0;o<n;o++){var a=this._excavateRegions.values[o];rr$2(e,a,i),Ue$9(e.context,a),this._excavateTransparent||(ir$2(e,this,a,i),ar$3(e,this,a,i))}}},R$l.prototype._updateExcavateGeometrys=function(e){if(!this._excavationGeometrys||0!==this._excavationGeometrys.length){var t=this._excavationGeometrys.values[0];t.spatialQuery._updateTextures(e.context,e),t.spatialQuery.update(e.context,e,e.commandList)}},R$l.prototype._updateExtractRegions=function(e){if(this._extractRegionsUpdate&&!e.camera.bReflect){for(var t in this._extractRegionsUpdate=!1,e._framebufferList)t.indexOf("_excavationGlobeHeight")>-1&&!e$28(this._extractRegions.get(t.slice(22)))&&(e._framebufferList[t]=!e._framebufferList[t].isDestroyed()&&e._framebufferList[t].destroy(),delete e._framebufferList[t]);if(this._extractRegions.length<1)return void Ve$a(this);this._onceExcavateRegionsEmpty&&(Ve$a(this),this._onceExcavateRegionsEmpty=!1);var i=!1;e.camera._scene.mode===P$$.COLUMBUS_VIEW&&(i=!0);var r=nr$2(this._extractRegions.values);tr$2(this,r),this._excavateRectangle=r,ti$2(e,this),ri$1(e,this),ii$2(e,this);for(var n=this._extractRegions.length,o=0;o<n;o++){var a=this._extractRegions.values[o];rr$2(e,a,i),Ue$9(e.context,a),this._extractTransparent||(ir$2(e,this,a,i),ar$3(e,this,a,i),ir$2(e,this,a,i,!0),ar$3(e,this,a,i,!0))}if(0!==this._quadtree._tilesToRender.length&&!(this._quadtree._tilesToRender[0].level<10)){if(n<1)return void or$2(this);Ma(this,r);var s=e.context;for(let e=0;e<n;e++){const t=this._extractRegions.values[e];if(t.isCreateModifyTerrain)continue;const i=t.rectangle,r=ai$1(this._quadtree._tilesToRender,i);e$28(r)&&e$28(r.data)&&(r.data.createModifyVertexArray(s,this,r,t,!1)&&this.upsampleParent(s,r,t),t.isCreateModifyTerrain=!0)}}}},R$l.prototype._updateImageryClipRegions=function(e){if(this._imageryClipRegionUpate&&!e.camera.bReflect){if(this._imageryClipRegionUpate=!1,this._imageryClipRegions.length<1)return void Ve$a(this);this._onceImageryClipRegionsEmpty&&(Ve$a(this),this._onceImageryClipRegionsEmpty=!1),tr$2(this,nr$2(this._imageryClipRegions.values));for(var t=this._imageryClipRegions.length,i=0;i<t;i++){var r=this._imageryClipRegions.values[i];rr$2(e,r,false),Ue$9(e.context,r)}}},R$l.prototype._removeAllExcavationCommands=function(){for(var e=Object.keys(this._excavateRegions._hash),t=0,i=e.length;t<i;t++){var r=e[t];this._removeExcavationCommands(r)}},R$l.prototype._removeAllExtractCommands=function(){for(var e=Object.keys(this._extractRegions._hash),t=0,i=e.length;t<i;t++){var r=e[t];this._removeExtractCommands(r)}this.modifyParentTiles=void 0},R$l.prototype._removeExcavationCommands=function(e){var t=this._excavateRegions.get(e);t.heightBuffer=t.heightBuffer&&!t.heightBuffer.isDestroyed()&&t.heightBuffer.destroy();var i=this._excavateRegionCommands.get(e+"side"),r=this._excavateRegionCommands.get(e+"bottom");i&&(i.vertexArray=i.vertexArray&&!i.vertexArray.isDestroyed()&&i.vertexArray.destroy()),r&&(r.vertexArray=r.vertexArray&&!r.vertexArray.isDestroyed()&&r.vertexArray.destroy()),this._excavateRegionCommands.remove(e+"side"),this._excavateRegionCommands.remove(e+"bottom")},R$l.prototype._removeExtractCommands=function(e){var t=this._extractRegions.get(e);t.heightBuffer=t.heightBuffer&&!t.heightBuffer.isDestroyed()&&t.heightBuffer.destroy(),t.heightBuffer2=t.heightBuffer2&&!t.heightBuffer2.isDestroyed()&&t.heightBuffer2.destroy();var i=this._excavateRegionCommands.get(e+"side"),r=this._excavateRegionCommands.get(e+"side_extract"),n=this._excavateRegionCommands.get(e+"bottom"),o=this._excavateRegionCommands.get(e+"bottom_extract");i&&(i.vertexArray=i.vertexArray&&!i.vertexArray.isDestroyed()&&i.vertexArray.destroy()),r&&(r.vertexArray=r.vertexArray&&!r.vertexArray.isDestroyed()&&r.vertexArray.destroy()),n&&(n.vertexArray=n.vertexArray&&!n.vertexArray.isDestroyed()&&n.vertexArray.destroy()),o&&(o.vertexArray=o.vertexArray&&!o.vertexArray.isDestroyed()&&o.vertexArray.destroy()),this._excavateRegionCommands.remove(e+"side"),this._excavateRegionCommands.remove(e+"bottom"),this._excavateRegionCommands.remove(e+"side_extract"),this._excavateRegionCommands.remove(e+"bottom_extract"),this.modifyParentTiles=void 0};var Te$a=new a$X,Ua$1=new o$15;function Va$1(e,t,i,r){var n=e.camera._projection,o=e.camera;if(!o.bReflect){var a=t,s=a.width,l=a.height,u=6378137*Math.cos(a.south+.5*l)*Math.sin(s)*.5,c=6378137*Math.sin(l)*.5;if(s=u,l=c,r){var h=n.project(new t$W(a.west,a.south)),d=n.project(new t$W(a.east,a.north));s=(d.x-h.x)/2,l=(d.y-h.y)/2}var f=o.frustum.clone(Ua$1),p=o._scene.globe.globeAlpha,_=new t$X,m=new t$X,$=new t$X,g=new y$15;i.isUpdate=!0,e$28(i._beginFunc)||(i._beginFunc=function(){p=o._scene.globe.globeAlpha,o._scene.globe.globeAlpha=1,t$X.clone(o.position,_),t$X.clone(o.direction,m),t$X.clone(o.up,$),y$15.clone(o.transform,g),o._setTransform(y$15.IDENTITY),o.setView({destination:t$X.fromRadians(a.west+.5*a.width,a.south+.5*a.height,1e4)}),Te$a.width=2*s,Te$a.height=2*l,Te$a.near=1,Te$a.far=1e6,Te$a.aspectRatio=s/l,o.frustum=Te$a,e.context.uniformState.updateFrustum(Te$a)}),e$28(i._endFunc)||(i._endFunc=function(){o._scene.globe.globeAlpha=p,i.isUpdate=!1,o.frustum=f,o._setTransform(g),t$X.clone(_,o.position),t$X.clone(m,o.direction),t$X.clone($,o.up),t$X.cross(m,$,o.right),e.context.uniformState.updateFrustum(o.frustum)})}}function ir$2(e,t,i,r,n){var o=e.camera._projection,a=t._excavateRegionCommands;if((!a.contains(i.name+"side")||n)&&(!a.contains(i.name+"side_extract")||!n)){var s=e.context,l=y$15.inverse(i._excavateMatrix,new y$15),u=i.positions,c=i.rectangle,h=c.east-c.west,d=c.north-c.south,f=u.length/3,p=new Float32Array(8*f),_=new Float32Array(6*f),m=new Float32Array(4*f),$=new Uint16Array(6*f),g=new t$X,v=f$10.fromRectangle(i.rectangle);Math.max(v.width/100,1),Math.max(v.height/100,1);for(var y=0;y<f;y++){var x,b;r?(x=new t$X((x=o.project(t$W.fromDegrees(u[3*y+0],u[3*y+1],-1e4))).z,x.x,x.y),b=new t$X((b=o.project(t$W.fromDegrees(u[3*y+0],u[3*y+1],1e4))).z,b.x,b.y)):(x=t$X.fromDegrees(u[3*y+0],u[3*y+1],-1e4),b=t$X.fromDegrees(u[3*y+0],u[3*y+1],1e4)),g.x=x.x,g.y=x.y,g.z=x.z,g.w=1,y$15.multiplyByVector(l,g,g),x.x=g.x,x.y=g.y,x.z=g.z,g.x=b.x,g.y=b.y,g.z=b.z,g.w=1,y$15.multiplyByVector(l,g,g),b.x=g.x,b.y=g.y,b.z=g.z,p[8*y]=b.x,p[8*y+1]=b.y,p[8*y+2]=b.z,p[8*y+3]=1e4,p[8*y+4]=x.x,p[8*y+5]=x.y,p[8*y+6]=x.z,p[8*y+7]=-1e4,_[6*y+0]=_[6*y+3]=(e$27.toRadians(u[3*y+0])-c.west)/h,_[6*y+1]=_[6*y+4]=(e$27.toRadians(u[3*y+1])-c.south)/d,_[6*y+2]=_[6*y+5]=i.height;let e=i.sideLengths[y]?i.sideLengths[y]/i.round:0,n=(i.sideLengths[y]-(i.sideLengths[y-1]||0))/100,a=t._excavateTextureWrap===q$11.CLAMP_TO_EDGE;m[4*y+0]=a?1-e:y%2==0?0:n,m[4*y+1]=a?1:200,m[4*y+2]=a?1-e:y%2==0?0:n,m[4*y+3]=0}for(y=0;y<f-1;y++)$[6*y+0]=0+2*y,$[6*y+1]=2+2*y,$[6*y+2]=3+2*y,$[6*y+3]=0+2*y,$[6*y+4]=3+2*y,$[6*y+5]=1+2*y;$[6*(f-1)+0]=0+2*(f-1),$[6*(f-1)+1]=0,$[6*(f-1)+2]=1,$[6*(f-1)+3]=0+2*(f-1),$[6*(f-1)+4]=1,$[6*(f-1)+5]=1+2*(f-1);var w=h$W.createVertexBuffer({context:s,typedArray:p,usage:A$1c.STATIC_DRAW}),C=h$W.createVertexBuffer({context:s,typedArray:_,usage:A$1c.STATIC_DRAW}),T=h$W.createVertexBuffer({context:s,typedArray:m,usage:A$1c.STATIC_DRAW}),S=[],E={aPosition:0,aTexCoord0:1,aTexCoord1:2};S.push({index:E.aPosition,vertexBuffer:w,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:16,normalize:!1}),S.push({index:E.aTexCoord0,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),S.push({index:E.aTexCoord1,vertexBuffer:T,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var A=h$W.createIndexBuffer({context:s,typedArray:$,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),P=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:i._excavateMatrix,pass:Le$p.TERRAIN_CLASSIFICATION,owner:t,cull:!1});P.vertexArray=new m$19({context:s,attributes:S,indexBuffer:A});var I=new a$$({sources:[Z$k]}),M=new a$$({sources:[$$k]});n&&M.defines.push("IsExtract"),e$28(t.excavationNormalTextureUrl)&&M.defines.push("NormalTexture"),P.shaderProgram=S$T.fromCache({context:s,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:E}),P.renderState=u$R.fromCache({cull:{enabled:!1,face:de$y.BACK},depthTest:{enabled:!0}}),P.uniformMap={uRasterTexture:function(){return n?i.heightBuffer2._renderTexture._fb.getColorTexture(0):i.heightBuffer._renderTexture._fb.getColorTexture(0)},uColorTexture:function(){return e$28(t._excavationSideTexture)?t._excavationSideTexture:s.defaultTexture},uNormalTexture:function(){return t._excavationSideNormalTexture||s.defaultTexture},uExtractHeight:function(){return i.height+t._extractExtendHeight}};var O=new t$g(e.context);O.useType=4,O.environmentVisible.isGlobalVisible=!0,Va$1(e,i.rectangle,O,r),e$28(i.removeListenerFunc)||(i.removeListenerFunc=t.tileLoadedEvent.addEventListener((function(e){e$28(h$10.intersection(e.rectangle,i.rectangle))&&(O.isUpdate=!0)}))),n?(a.set(i.name+"side_extract",P),i.heightBuffer2=O,e._framebufferList["_excavationGlobeHeight2"+i.name]=O):(a.set(i.name+"side",P),i.heightBuffer=O,e._framebufferList["_excavationGlobeHeight"+i.name]=O)}}function ar$3(e,t,i,r,n){var o=e.camera._projection,a=t._excavateRegionCommands;if((!a.contains(i.name+"bottom")||n)&&(!a.contains(i.name+"bottom_extract")||!n)){for(var s=i._excavateMatrix,l=e.context,u=new r$15({primitiveType:W$_.TRIANGLES,pass:Le$p.TERRAIN_CLASSIFICATION,modelMatrix:s}),c=new t$X,h=[],d=i.worldGeometry,f=y$15.getTranslation(i.modelMatrix,new t$X),p=0;p<d.attributes.position.values.length;p+=3)h.push(d.attributes.position.values[p]+f.x),h.push(d.attributes.position.values[p+1]+f.y),h.push(i.height);var _=y$15.inverse(s,new y$15),m=[];if(r){p=0;for(var $=h.length;p<$;p+=3){var g=o.project(t$W.fromDegrees(h[p],h[p+1],h[p+2]));m.push(new t$X(g.z,g.x,g.y))}}else m=t$X.fromDegreesArrayHeights(h);var v=new Float32Array(4*m.length);for(p=0;p<m.length;p++)c.x=m[p].x,c.y=m[p].y,c.z=m[p].z,c.w=1,y$15.multiplyByVector(_,c,c),v[4*p]=c.x,v[4*p+1]=c.y,v[4*p+2]=c.z,v[4*p+3]=c.z;var y=i.colorGeometry.attributes.position;y.values=v,y.componentsPerAttribute=4,y.componentDatatype=S$W.FLOAT,u.vertexArray=m$19.fromGeometry({context:l,geometry:i.colorGeometry,attributeLocations:{position:0,st:1},bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var x=new a$$({sources:[ua$1]}),b=new a$$({sources:[da]});if(e$28(t.excavationNormalTextureUrl)&&b.defines.push("NormalTexture"),u.shaderProgram=S$T.fromCache({context:l,vertexShaderSource:x,fragmentShaderSource:b,attributeLocations:{position:0,texCoord:1}}),u.uniformMap={texture1:function(){return e$28(t._excavationBottomTexture)?t._excavationBottomTexture:l.defaultTexture},uNormalTexture:function(){return t._excavationNormalTexture||l.defaultTexture}},u.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),n){var w=t._extractExtendHeight,C=t$X.fromArray([0,0,w]),T=y$15.fromTranslation(C);y$15.multiply(u.modelMatrix,T,T),u.modelMatrix=T,a.set(i.name+"bottom_extract",u)}else a.set(i.name+"bottom",u)}}function nr$2(e){for(var t=h$10.clone(e[0].rectangle),i=1,r=e.length;i<r;i++){var n=e[i];t=h$10.union(t,n.rectangle)}return t}function ai$1(e,t){for(var i,r=!1,n=0,o=e.length;n<o;n++){if(i=e[n],e$28(h$10.simpleIntersection(i.rectangle,t))){r=!0;break}}if(e$28(i)&&r)for(;e$28(i);){if(i.rectangle.contains(t))return i;i=i.parent}}function or$2(e){var t=e._modifyTilesMap;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];r._clipRasterTexture=r._clipRasterTexture&&!r._clipRasterTexture.isDestroyed()&&r._clipRasterTexture.destroy(),r._clipRasterFbo=r._clipRasterFbo&&!r._clipRasterFbo.isDestroyed()&&r._clipRasterFbo.destroy(),r._clipRegionsCount=0,r._clipRegionRasterized=!1,r.isModified=!1,r.data.modifyTerrainData=void 0,r.data.modifyTerrainMesh=void 0,r.data.mesh&&(r.data.mesh.isModified=!1),r.data.freeModifyResource(),r.modifyRegionsMap=void 0}e._modifyTilesMap={}}function Ma(e,t){var i=e._modifyTilesMap;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];h$10.intersection(t,n.rectangle)||(n._clipRasterTexture=n._clipRasterTexture&&!n._clipRasterTexture.isDestroyed()&&n._clipRasterTexture.destroy(),n._clipRasterFbo=n._clipRasterFbo&&!n._clipRasterFbo.isDestroyed()&&n._clipRasterFbo.destroy(),n._clipRegionsCount=0,n._clipRegionRasterized=!1,n.isModified=!1,n.data.freeModifyResource(),delete i[r])}}function Me$b(e,t,i){var r=new t$X,n=new t$X;t$X.subtract(t,e,r),t$X.subtract(i,e,n);var o=new t$X;t$X.cross(r,n,o),t$X.normalize(o,o);var a=-t$X.dot(o,e);return new e$25(o.x,o.y,o.z,a)}function ni$3(e,t){var i=t.context;return new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:e,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})],destroyAttachments:!0,depthStencilRenderbuffer:new o$C({context:t.context,width:e,height:e,format:M$q.DEPTH_STENCIL})})}function Oa(e,t){if(!(e._rasterLineFBOs.length>0))for(var i=0;i<e._rasterTextureSizes.length;i++)e._rasterLineFBOs.push(ni$3(e._rasterTextureSizes[i],t))}function Ga$1(e,t){if(!(e._rasterAAFBOs.length>0))for(var i=0;i<e._rasterTextureSizes.length;i++)e._rasterAAFBOs.push(ni$3(e._rasterTextureSizes[i],t))}function za(e,t){if(!e$28(e._lineExpandCommand)||e._rasterLineWidth!==t.rasterLineWidth){e._rasterLineWidth=t.rasterLineWidth;var i=t.context,r=Math.ceil(t.rasterLineWidth),n="#define CORESIZE "+r+"\n",o=new a$$({name:"RasterImageExpandFS_width_"+r,sources:[n+=Zi$1]}),a=new a$$({name:"ViewportQuadVS",sources:[Ee$9]});e._lineExpandCommand=i.createCustomViewportQuadCommand(a,o,{uniformMap:{},owner:e}),e._lineExpandCommand.uniformMap.u_LineTexture=function(){return e._rasterLineFBOs[e._rasterCurrentFBOIdx].getColorTexture(0)},e._lineExpandCommand.uniformMap.u_texelOffset=function(){return 1/e._rasterTextureSizes[e._rasterCurrentFBOIdx]}}}function Wa$1(e,t){if(!e$28(e._lineFXAACommand)){var i=t.context,r="#define FXAA_QUALITY_PRESET 39 \n"+X$d+"\n"+ji$3;e._lineFXAACommand=i.createViewportQuadCommand(r,{uniformMap:{},owner:e}),e._lineFXAACommand.uniformMap.colorTexture=function(){return e._rasterAAFBOs[e._rasterCurrentFBOIdx].getColorTexture(0)}}}function S$k(){}new t$X,R$l.prototype.upsampleParent=function(e,t,i){const r=this,n=i.rectangle;var o=t._southwestChild;e$28(o)&&e$28(o.data)&&(e$28(h$10.intersection(o.rectangle,n))&&o.data.createModifyVertexArray(e,r,o,i,!0)&&this.upsampleParent(e,o,i)),e$28(o=t._southeastChild)&&e$28(o.data)&&(e$28(h$10.intersection(o.rectangle,n))&&o.data.createModifyVertexArray(e,r,o,i,!0)&&this.upsampleParent(e,o,i)),e$28(o=t._northwestChild)&&e$28(o.data)&&(e$28(h$10.intersection(o.rectangle,n))&&o.data.createModifyVertexArray(e,r,o,i,!0)&&this.upsampleParent(e,o,i)),e$28(o=t._northeastChild)&&e$28(o.data)&&(e$28(h$10.intersection(o.rectangle,n))&&o.data.createModifyVertexArray(e,r,o,i,!0)&&this.upsampleParent(e,o,i))},R$l.prototype._updateModifyRegions=function(e){if(!this._modifyRegionUpdate||e.camera.bReflect||0===this._quadtree._tilesToRender.length||this._quadtree._tilesToRender[0].level<10)return;this._modifyRegionUpdate=!1;var t=this._modifyRegions.values,i=t.length;if(i<1)return void or$2(this);const r=e.context;for(let e=0;e<i;e++){const i=t[e];if(i.isCreateModifyTerrain)continue;const n=i.rectangle;Ue$9(r,i);const o=ai$1(this._quadtree._tilesToRender,n);e$28(o)&&e$28(o.data)&&(o.data.createModifyVertexArray(r,this,o,i,!1)&&this.upsampleParent(r,o,i),i.isCreateModifyTerrain=!0)}},R$l.prototype.clearModifyTerrain=function(){or$2(this)},R$l.prototype.clearCustomClipBox=function(){this._clipping=!1,this._clipMode=0},R$l.prototype.setCustomClipBox=function(e){if(!((e=e||{}).dimensions&&e.position||e.planePos&&e.planeNormal))throw new t$Z("dimensions position is required to create CustomClipBox");if(this._clipMode=2,e$28(e.clipMode))switch(e.clipMode){case"clip_behind_any_plane":this._clipMode=1;break;case"clip_behind_all_plane":this._clipMode=2;break;case"only_keep_line":this._clipMode=3}if(e.clipLineColor&&e.clipLineColor instanceof e$1S&&(this._clipLineColor=new e$25(e.clipLineColor.red,e.clipLineColor.green,e.clipLineColor.blue,e.clipLineColor.alpha)),e.dimensions){var t=new y$15,i=e.position,r=new i$10(e.heading||0,e.pitch||0,e.roll||0);m$1b.headingPitchRollToFixedFrame(i,r,t$V.WGS84,t);var n=.5*e.dimensions.x,o=.5*e.dimensions.y,a=.5*e.dimensions.z,s=[];s[0]=new e$25,s[0].x=-n,s[0].y=o,s[0].z=a,s[0].w=1,s[1]=new e$25,s[1].x=n,s[1].y=o,s[1].z=a,s[1].w=1,s[2]=new e$25,s[2].x=n,s[2].y=-o,s[2].z=a,s[2].w=1,s[3]=new e$25,s[3].x=-n,s[3].y=-o,s[3].z=a,s[3].w=1,s[4]=new e$25,s[4].x=-n,s[4].y=o,s[4].z=-a,s[4].w=1,s[5]=new e$25,s[5].x=n,s[5].y=o,s[5].z=-a,s[5].w=1,s[6]=new e$25,s[6].x=n,s[6].y=-o,s[6].z=-a,s[6].w=1,s[7]=new e$25,s[7].x=-n,s[7].y=-o,s[7].z=-a,s[7].w=1;for(var l=0;l<8;l++)y$15.multiplyByVector(t,s[l],s[l]);this._oriClipPlane[0]=e$25.clone(Me$b(s[0],s[1],s[2])),this._oriClipPlane[1]=e$25.clone(Me$b(s[0],s[4],s[1])),this._oriClipPlane[2]=e$25.clone(Me$b(s[0],s[3],s[4])),this._oriClipPlane[3]=e$25.clone(Me$b(s[6],s[2],s[5])),this._oriClipPlane[4]=e$25.clone(Me$b(s[6],s[7],s[2])),this._oriClipPlane[5]=e$25.clone(Me$b(s[6],s[5],s[7]))}else for(l=0;l<e.planePos.length;l++){var u=e.planePos[l],c=e.planeNormal[l];this._oriClipPlane[l].x=c.x,this._oriClipPlane[l].y=c.y,this._oriClipPlane[l].z=c.z,this._oriClipPlane[l].w=-t$X.dot(u,c)}this._clipping=!0},R$l.prototype.removeAllModifyRegion=function(){for(var e=this._modifyRegions.values,t=0;t<e.length;t++){var i=e[t];e$28(i.command)&&(i.command.vertexArray=i.command.vertexArray&&!i.command.vertexArray.isDestroyed()&&i.command.vertexArray.destroy(),i.command.shaderProgram=i.command.shaderProgram&&!i.command.shaderProgram.isDestroyed()&&i.command.shaderProgram.destroy()),i.command=void 0}this._modifyRegions.removeAll(),this._modifyTilesMap={},this._modifyRegionUpdate=!1},R$l.prototype.removeAllExcavationRegion=function(){},R$l.prototype.removeAllExtractRegion=function(){},R$l.prototype.isDestroyed=function(){return!1},R$l.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this.removeAllExcavationRegion(),this.removeAllModifyRegion(),this.removeAllExtractRegion(),this._hypsometricTexture=this._hypsometricTexture&&this._hypsometricTexture.destroy(),this._slopeArrowsTexture=this._slopeArrowsTexture&&this._slopeArrowsTexture.destroy(),this._slopeColorTexture=this._slopeColorTexture&&this._slopeColorTexture.destroy();for(var e=0;e<this._rasterTextureSizes.length;e++)e$28(this._rasterLineFBOs[e])&&this._rasterLineFBOs[e].destroy(),this._rasterAAFBOs.length>0&&this._rasterAAFBOs[e].destroy();return i$Z(this)};var _$n=new a$X,ne$e=new o$15,se$8=new t$X;function ue$8(e,t,i){if(!(u=e.camera).bReflect){var r=t,n=r.width,o=r.height,a=6378137*Math.cos(r.south+.5*o)*Math.sin(n)*.5,s=6378137*Math.sin(o)*.5;n=a,o=s;var l=u.frustum.clone(ne$e),u=e.camera;i.isUpdate=!0,e$28(i._beginFunc)||(i._beginFunc=function(){i.oldCameraParameter={destination:t$X.clone(u.position,se$8),orientation:{heading:u.heading,pitch:u.pitch,roll:u.roll}},u.setView({destination:t$X.fromRadians(r.west+.5*r.width,r.south+.5*r.height,1e3)}),_$n.width=2*n,_$n.height=2*o,_$n.near=1,_$n.far=1e4,_$n.aspectRatio=n/o,u.frustum=_$n,e.context.uniformState.updateFrustum(_$n)}),e$28(i._endFunc)||(i._endFunc=function(){i.isUpdate=!1,u.frustum=l,u.setView(i.oldCameraParameter),e.context.uniformState.updateFrustum(u.frustum)})}}S$k._createExcavationSideCommand=function(e,t,i){var r=t._excavateRegionCommands;if(!r.contains(i.name+"side")){for(var n=e.context,o=y$15.inverse(i._excavateMatrix,new y$15),a=i.positions,s=i.rectangle,l=s.east-s.west,u=s.north-s.south,c=a.length/3,h=new Float32Array(8*c),d=new Float32Array(6*c),f=new Float32Array(4*c),p=new Uint16Array(6*c),_=new t$X,m=0;m<c;m++){var $=t$X.fromDegrees(a[3*m+0],a[3*m+1],-1e3),g=t$X.fromDegrees(a[3*m+0],a[3*m+1],1e3);_.x=$.x,_.y=$.y,_.z=$.z,_.w=1,y$15.multiplyByVector(o,_,_),$.x=_.x,$.y=_.y,$.z=_.z,_.x=g.x,_.y=g.y,_.z=g.z,_.w=1,y$15.multiplyByVector(o,_,_),g.x=_.x,g.y=_.y,g.z=_.z,h[8*m]=g.x,h[8*m+1]=g.y,h[8*m+2]=g.z,h[8*m+3]=1e3,h[8*m+4]=$.x,h[8*m+5]=$.y,h[8*m+6]=$.z,h[8*m+7]=-1e3,d[6*m+0]=d[6*m+3]=(e$27.toRadians(a[3*m+0])-s.west)/l,d[6*m+1]=d[6*m+4]=(e$27.toRadians(a[3*m+1])-s.south)/u,d[6*m+2]=d[6*m+5]=i.height,f[4*m+0]=m/(c-1),f[4*m+1]=1,f[4*m+2]=m/(c-1),f[4*m+3]=0}for(m=0;m<c-1;m++)p[6*m+0]=0+2*m,p[6*m+1]=2+2*m,p[6*m+2]=3+2*m,p[6*m+3]=0+2*m,p[6*m+4]=3+2*m,p[6*m+5]=1+2*m;p[6*(c-1)+0]=0+2*(c-1),p[6*(c-1)+1]=0,p[6*(c-1)+2]=1,p[6*(c-1)+3]=0+2*(c-1),p[6*(c-1)+4]=1,p[6*(c-1)+5]=1+2*(c-1);var v=h$W.createVertexBuffer({context:n,typedArray:h,usage:A$1c.STATIC_DRAW}),y=h$W.createVertexBuffer({context:n,typedArray:d,usage:A$1c.STATIC_DRAW}),x=h$W.createVertexBuffer({context:n,typedArray:f,usage:A$1c.STATIC_DRAW}),b=[],w={aPosition:0,aTexCoord0:1,aTexCoord1:2};b.push({index:w.aPosition,vertexBuffer:v,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:16,normalize:!1}),b.push({index:w.aTexCoord0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),b.push({index:w.aTexCoord1,vertexBuffer:x,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var C=h$W.createIndexBuffer({context:n,typedArray:p,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),T=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:i._excavateMatrix,pass:Le$p.OPAQUE,owner:t,cull:!1});T.vertexArray=new m$19({context:n,attributes:b,indexBuffer:C});var S=new a$$({sources:[Z$k]}),E=new a$$({sources:[$$k]});T.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:S,fragmentShaderSource:E,attributeLocations:w}),T.renderState=u$R.fromCache({cull:{enabled:!1,face:de$y.BACK},depthTest:{enabled:!0}}),T.uniformMap={uRasterTexture:function(){return window.texture11=i.heightBuffer._renderTexture._fb.getColorTexture(0),window.texture11},uColorTexture:function(){return e$28(t._excavationSideTexture)?t._excavationSideTexture:n.defaultTexture}},r.set(i.name+"side",T);var A=new t$g(e.context);i.heightBuffer=A,A.useType=4,A.environmentVisible.isOnlyS3MObjectVisible=!0;var P=t instanceof R$l?"Globe":"Layer";e._framebufferList["_excavationHeight"+P+i.name]=A,ue$8(e,i.rectangle,A)}},S$k._createExcavationBottomCommand=function(e,t,i){var r=t._excavateRegionCommands;if(!r.contains(i.name+"bottom")){var n=e.context,o=new r$15({primitiveType:W$_.TRIANGLES,pass:Le$p.OPAQUE,modelMatrix:i._excavateMatrix});r.set(i.name+"bottom",o);for(var a=new t$X,s=[],l=i._geometry,u=0;u<l.attributes.position.values.length;u+=3)a.x=l.attributes.position.values[u],a.y=l.attributes.position.values[u+1],a.z=l.attributes.position.values[u+2],y$15.multiplyByPoint(t._matModel,a,a),a=t$W.fromCartesian(a),s.push(e$27.toDegrees(a.longitude)),s.push(e$27.toDegrees(a.latitude)),s.push(i.height);var c=y$15.inverse(i._excavateMatrix,new y$15),h=t$X.fromDegreesArrayHeights(s),d=new Float32Array(4*h.length);for(u=0;u<h.length;u++)a.x=h[u].x,a.y=h[u].y,a.z=h[u].z,a.w=1,y$15.multiplyByVector(c,a,a),d[4*u]=a.x,d[4*u+1]=a.y,d[4*u+2]=a.z,d[4*u+3]=a.z;var f=i.colorGeometry.attributes.position;f.values=d,f.componentsPerAttribute=4,f.componentDatatype=S$W.FLOAT,o.vertexArray=m$19.fromGeometry({context:n,geometry:i.colorGeometry,attributeLocations:{position:0,st:1,normal:2},bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var p=["attribute vec3 position;","attribute vec2 texCoord;","varying vec2 v_texCoord;","void main()","{"," v_texCoord = texCoord;"," gl_Position = czm_modelViewProjection * vec4(position.xyz, 1.0);","}"].join("\n"),_=["varying vec2 v_texCoord;","uniform sampler2D texture1;","void main()","{"," gl_FragColor = texture2D(texture1, v_texCoord);","}"].join("\n"),m=new a$$({sources:[p]}),$=new a$$({sources:[_]});o.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:m,fragmentShaderSource:$,attributeLocations:{position:0,texCoord:1}}),o.uniformMap={texture1:function(){return e$28(t._excavationBottomTexture)?t._excavationBottomTexture:n.defaultTexture}},o.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND})}},S$k.createExcavationSideTexture=function(e,t){t._excavationSideTexture||o$1q(t$S.createIfNeeded(n$17("Assets/Textures/excavationregion_side.jpg")).fetchImage(),(function(i){t._excavationSideTexture=new L$17({context:e.context,source:i})}))},S$k.createExcavationBottomTexture=function(e,t){t._excavationBottomTexture||o$1q(t$S.createIfNeeded(n$17("Assets/Textures/excavationregion_top.jpg")).fetchImage(),(function(i){t._excavationBottomTexture=new L$17({context:e.context,source:i})}))};var _0x395fda=(_0x2951e1=!0,function(e,t){var i=_0x2951e1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2951e1=!1,i}),_0xe926ef=_0x395fda(void 0,(function(){return _0xe926ef.toString().search("(((.+)+)+)+$").toString().constructor(_0xe926ef).search("(((.+)+)+)+$")})),_0x2951e1;_0xe926ef();var _0xe8f189={Linear:0,Acceleration:1,Deceleration:2,CubicSpline:3,SmoothStep:4},_0x3eee90=Object.freeze(_0xe8f189),_0x18698a=(_0xf2e9b4=!0,function(e,t){var i=_0xf2e9b4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xf2e9b4=!1,i}),_0x971dbe=_0x18698a(void 0,(function(){return _0x971dbe.toString().search("(((.+)+)+)+$").toString().constructor(_0x971dbe).search("(((.+)+)+)+$")})),_0xf2e9b4;_0x971dbe();var _0x3ca79d={None:0,First:1,Second:2},_0x97cdd3=Object.freeze(_0x3ca79d),_0x30043c=(_0x4566c6=!0,function(e,t){var i=_0x4566c6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4566c6=!1,i}),_0x5ace16=_0x30043c(void 0,(function(){return _0x5ace16.toString().search("(((.+)+)+)+$").toString().constructor(_0x5ace16).search("(((.+)+)+)+$")})),_0x4566c6;_0x5ace16(),new t$W;var _0x5e0ddd=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),_0x252611={CLIP_NOTHING:0,CLIP_BEHIND_ANY_PLANE:1,CLIP_BEHIND_ALL_PLANE:2,ONLY_KEEP_LINE:3},_0xb9525f={Altitude:0,Color:1,Texture:2},_0x56b17e={Normal:0,Add:1},_0x3e1db9={LOD_Loading:0,All_Loading:1},_0x152628={DEGREE:"Degree",METER:"Meter"},_0xbf0df=-1e3,_0x312142=9e3,_0x47d916=function(e){var t=(e=e||{}).gl,i=e.name,r=e.position;if(this._materialType=e.materialType,this._isS3MB=e.isS3MB,this._isOSGB=e.isOSGB,this._isS3MZ=e.isS3MZ,this._isS3MBlock=e.isS3MBlock,this._context=e.context,this._gl=t,this._name=i,this._globeType=e.globeType,this._groupName=e.groupName,this._id=-1,this._version=void 0,this._baseUri=e.baseUri,this._dataType=e.dataType,this._isTextureShare=u$Y(e.isTextureShare,!1),this._associateMaterialUrl=e.associateMaterialUrl,this._isTransparencyOptimization=u$Y(e.isTransparencyOptimization,!1),this._vertexCompressionType=e.vertexCompressionType,e$28(e.vertexWeightMode))switch(e.vertexWeightMode){case"DatasetField":default:this._vertexWeightMode=_0x4a384f.DatasetField;break;case"EdgeLengthMin":this._vertexWeightMode=_0x4a384f.EdgeLengthMin}if(this._triangleFiltratePixel=0,this._urlType=u$Y(e.urlType,fi$5.REST),this._urlArguments=e.urlArguments,this._fileType=f$r.OSGBFile,this._RGBTOBGR=!1,this._tilesLoaded=!1,this._statistics=void 0,this._S3MTileLoadedEvent=new o$1o,this._allTilesLoaded=new o$1o,this._colorTableChanged=new o$1o,this._attributeDownloaded=new o$1o,this._prepareLoadSize=0,this._prepareLoadEvent=void 0,e.pointCloudLayerNames&&e.pointCloudLayerNames.length>0){this._pointCloudLayerVisible={};for(var n=0,o=e.pointCloudLayerNames.length;n<o;n++)this._pointCloudLayerVisible[e.pointCloudLayerNames[n]]=!0;this._pointCloudLayerNames=e.pointCloudLayerNames.slice(0)}if(e$28(e.fileType))switch(e.fileType){case"ClampGroundLineCache":this._fileType=f$r.ClampGroundLine;break;case"ClampObjectLineCache":this._fileType=f$r.ClampObjectLine;break;case"ClampGroundPolygonCache":this._fileType=f$r.ClampGroundPolygon;break;case"ClampObjectPolygonCache":this._fileType=f$r.ClampObjectPolygon;break;case"ExtendClampPolygonCache":this._fileType=f$r.ExtendClampPolygonCache;break;case"IconPointCache":this._fileType=f$r.IconPoint;break;case"TextCache":this._fileType=f$r.Text;break;case"PointCloudFile":this._fileType=f$r.PointCloudFile;break;case"OSGBCacheFile":this._fileType=f$r.OSGBCacheFile;break;case"ExtendRegionCache":this._fileType=f$r.ExtendRegion3D;break;case"RegionEffect":this._fileType=f$r.RegionEffect;break;case"PolylineEffect":this._fileType=f$r.PolylineEffect;break;case"ClampGroundAndObjectLineCache":this._fileType=f$r.ClampGroundAndObjectLineCache;break;case"ClampGroundRealtimeRasterCache":this._fileType=f$r.ClampGroundRealtimeRasterCache}this._supportCompressType=e.supportCompressType,this.lon=r.lon,this.lat=r.lat,this.height=r.height,this.positionUnits=r.units,this._layerBounds=e.layerBounds;var a=.5*(this._layerBounds.north+this._layerBounds.south);switch(this._layerRange=t$W.sphericalDistance(e$27.toDegrees(this._layerBounds.east),e$27.toDegrees(a),e$27.toDegrees(this._layerBounds.west),e$27.toDegrees(a)),this._style3D=u$Y(e.style3D,new e$E),this._style3D._owner=this,this._lodRangeScale=u$Y(e.lodRangeScale,1),this._adjustedLodRangeScale=this._lodRangeScale,this._maximumScreenSpaceError=20,this._selectColorType=Ya$1.MIX,this._mixColorType=_0x125991.MIX,this._brightness=u$Y(e.brightness,1),this._contrast=u$Y(e.constrast,1),this._hue=u$Y(e.hue,0),this._saturation=u$Y(e.saturation,1),this._gamma=u$Y(e.gamma,1),this._visibleDistanceMax=u$Y(e.maxVisibleDistance,Number.MAX_VALUE),this._visibleDistanceMin=u$Y(e.minVisibleDistance,0),this._minVisibleAltitude=u$Y(e.minVisibleAltitude,0),this._maxVisibleAltitude=u$Y(e.maxVisibleAltitude,Number.MAX_VALUE),this._hasLight=!(this._fileType===f$r.OSGBFile||this._fileType===f$r.PointCloudFile),this._selectEnabled=u$Y(e.selectEnable,!0),this._enableHighlight=u$Y(e.enableHighlight,!0),this._heading=u$Y(e.heading,0),this._cullEnabled=u$Y(e.cullEnabled,!1),e.cullMode){case"CCW":this._cullMode=_0x4a48d8.COUNTER_CLOCKWISE;break;case"CW":this._cullMode=_0x4a48d8.CLOCKWISE;break;default:this._cullMode=_0x4a48d8.NONE}this._shadowType=u$Y(e.shadowType,_0x121e29.NONE),this._visibleViewport=4095,this._visible=u$Y(e.isVisible,!0),this._sceneMode=u$Y(e.sceneMode,P$$.SCENE3D),this._selections=[],this._multiChoose=!1,this._selectedColor=new e$1S(.7,.7,1,1),this._selectedLineColor=new e$1S(1,1,1),this._skeletonSelectedColor=new e$1S(1,0,0,1),this._selectedTranslate=new t$X(0,0,0),this._objsColorList={},this._objsOffsetList={},this._objsVisibleList=new e$1P,this._objsHideList=new e$1P,this._objsVisibleMap={},this._objsOperationList={},this._operationType=_0xfef200.RESET,this._fileType===f$r.ExtendRegion3D&&(this._objsHeightList=new e$1P),e$28(e.effect)?this._effect=e.effect:this._fileType===f$r.RegionEffect?this._effect=new _0x31641:this._fileType===f$r.PolylineEffect&&(this._effect=new _0x300acb),this._bloomEffect=new _0x369b4a(this),this.waterEffectSet=e.waterEffectSet,this._noiseMapUrl=n$17("Assets/Textures/noise.png"),this._noiseMapTexture=void 0,this._flattenTextureWidth=1024,this._flattening=!1,this._flattenBounds=new e$25,this._flattenTexture=void 0,this._flattenRegions=new e$1P,this._flattenUpdate=!1,this._flattenVisibleViewport=255,this._hasExcavation=!1,this._hasServerExcavation=!1,this._excavationBounds=new e$25,this._excavationTexture=void 0,this._excavationRegions=new e$1P,this._excavationUpdate=!1,this._excavationMode=Ge$8.CLIP_INSIDE,this._serverExcavationMode=Ge$8.CLIP_OUTSIDE,this._serverExcavationBounds=new e$25,this._serverExcavationRegions=new e$1P,this._hasOverlay=!1,this._overlayBounds=new e$25,this._overlayRegions=new e$1P,this._overlayTextures=new e$1P,this._overlayTexture=void 0,this.__overlayUpdate=!1,this._hypsometricSetting=void 0,this._hypsometricTexture=void 0,this._hypsometricRenderTexture=void 0,this._hypsometricRegion=void 0,this._hypsometricBound=new e$25,this._bUseHypColorTable=!1,this._bUseHypRegion=!1,this._hypsometricRegionUpdate=!1,this._hypAnalysisMode=k$T.AnalysisRegionMode.ARM_NONE,this._hypMaxInstensity=e.maxInstensity,this._hypMinInstensity=e.minInstensity,this._hypMaxHeight=e.maxHeight,this._hypMinHeight=e.minHeight,this._hypMaxCategory=e.maxCategory,this._hypMinCategory=e.minCategory,this._hypUseColorByHeight=!0,this._categorieTexture=void 0,this._categoryHideList=new e$1P,this._fHorizontalLine=e.horizontalLine,this._oriClipPlane=[],this._renderClipPlaneArray=new e$1P,this._clipPlane=[];for(n=0;n<6;n++)this._clipPlane[n]=new e$25(0,0,0,0),this._oriClipPlane[n]=new e$25(0,0,0,0);this._clipMode=_0x252611.CLIP_NOTHING,this._clipLineColor=new e$25(1,0,0,0),this._clipping=!1,this._section=!1,this._clipPlaneMode=_0x3f3b8b.NONE,this._clipPlaneColor=new e$25(1,0,0,1),this._matModel=new y$15,this._oriMatModel=new y$15,this._bReleaseColor=u$Y(e.bReleaseColor,!1),this._fileType===f$r.OSGBFile||this._fileType===f$r.OSGBCacheFile?this._ignoreNormal=u$Y(e.ignoreNormal,!1):this._ignoreNormal=!1,this._textureLod=u$Y(e.textureLod,!0);var s=u$Y(e.processType,"Normal");if(this._nProcessType="Normal"===s?_0x56b17e.Normal:_0x56b17e.Add,this._nLoadingMode=_0x3e1db9.All_Loading,this._clockStart=0,this._polygonOffsetConfig=e.polygonOffset,this._wireFrameType=_0x255091.Quad,this._bVolume=!1,e$28(e.volumeObj)&&(this._bVolume=e.volumeObj.bVolume,this._strVolumeExts=e.volumeObj.strVolumeExts,this._volNames=e.volumeObj.volNames,this._maxVolumeValues=e.volumeObj.maxValues,this._minVolumeValues=e.volumeObj.minValues,this._volName=this._volNames[0],this._fMaxValue=this._maxVolumeValues[0],this._fMinValue=this._minVolumeValues[0],this._strVolumeExt=this._strVolumeExts[0]),this._maps=e.maps,this._volData=void 0,this._splitDirection=u$Y(e.splitDirection,_0x171baa.NONE),this._splitPosition=u$Y(e.splitPosition,.5*this._context.drawingBufferWidth),this._pickPosition=new e$25,this._selectionFiltrateByTransparency=.01,this._receiveObjectClamp=!0,this._edgeCurrentTotalLength=0,this._edgeCurrentCount=0,this._edgeDistanceFalloffFactor=0,this._enableDepthTest=!0,this.initialize(),this.hasQueryAttrAction=!1,e$28(window.Proxy)){var l=this,u={isAttributesSave:!1,isGeoTilesSave:!1,isGeoTilesRootNodeSave:!1,clear:function(){l._layerScheduler._clearIndexedDBCache()}};this._indexedDBSetting=new Proxy(u,{get:function(e,t){return e[t]},set:function(e,t,i){return e[t]=i,!0}}),this._isJsonScp=e._isJson||!1}this._queryFieldNames=e.queryFieldNames,this._fieldsInfo=e.fieldsInfo,this._indexInfoMap=e.indexInfoMap,this._indexInfoAttributeMap=e.indexInfoAttributeMap,this._attributeExtentName=u$Y(e.attributeExtentName,""),this._layerScheduler=new _0x151d57({gl:this._gl,layer:this,rootEntities:e.rootEntities,cacheEntityCount:e.cacheEntityCount,cacheKey:u$Y(e.cacheKey,""),customRequestHeaders:e.customRequestHeaders,scpUrl:e.scpUrl}),this._clearMemoryImmediately=!1,this._totalMemoryUsageInBytes=0,this._maximumMemoryUsage=512,this._PBRMaterialType=je$b.NONE,this._pbrMetalTexture=void 0,this._pbrRoughTexture=void 0,this._PBRMaterialParams={pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:0,baseColor:new e$25(1,1,1,1),baseColorTextureIndex:-1,emissiveFactor:t$X.ZERO,emissiveTextureIndex:-1,occlusionTextureIndex:-1,normalTextureIndex:-1,normalTexture:void 0,baseColorTexture:void 0}},this._localCacheMemoryReserveCount=500,this._fileType===f$r.Text&&(this._id2RectangleList=new e$1P),this._textureUVSpeed=new o$1k(0,0),this._pointCloudEyeDomeLighting=new _0x4e48d2(this._context),this._pointCloudShading=new o$O({attenuation:!0,geometricErrorScale:1,maximumAttenuation:8,eyeDomeLighting:!0}),this._pointCloudClassificationInfos=void 0,this._styleEngine=new e$N,this._manualShadowVolumeBottomHeight=_0xbf0df,this._manualShadowVolumeTopHeight=_0x312142,this._shadowVolumeBottomHeight=_0xbf0df,this._shadowVolumeTopHeight=_0x312142,"InstanceModel"===this._dataType&&(this.instanceSkeletonManager=new _0x4a5bf1),this._level=e.level,this._refreshVolume=!1,this._useMercatorProject=u$Y(e.useMercatorProject,!1),this._groupNameBounds=e.groupNameBounds,this._skeletonSelectEnable=!1,this._lastSelectSkeletonId=-1,this._minTransparentAlpha=.1,this._maxTransparentAlpha=.98,this._selectRect=void 0,this._selectUpdate=!1,this._matSelectViewProj=new y$15,this._useOIT=!0,this._partlyTransparent=!1,this._showLabel=!1,this._s3MTilesLabelStyle=new _0x5255c6,this._labelCollection=new w$p({scene:e.scene,isS3MTileLabels:!0,selectedColor:this._selectedColor}),this._scene=e.scene,this._transparentBackColor=u$Y(e.transparentBackColor,_0x47d916.DEFAULT_TRANSPARENT_BACK_COLOR),this._transparentBackColorTolerance=u$Y(e.transparentBackColorTolerance,_0x47d916.DEFAULT_TRANSPARENT_BACK_COLOR_TOLERANCE),this._shadowDarkness=.5,this._spatialQueryEnable=!1,this._spatialClipEnable=!1,this._sqTextures=[],this._sqViewMatirx=new y$15,this._sqPrjMatirx=new y$15,this._sqMode=j$l.Disjoint,this._swipeRegion=new e$25(0,0,1,1),this._swipeEnabled=!1,this._allObjsHide=!1,this._residentRootTile=!1,this._idFieldName=u$Y(e.idFieldName,"SmID"),this._imageryLayer=void 0,this._needCoverImageryLayer=!1,this._iconCollection=new B$q({scene:e.scene,style3D:this._style3D}),this._showIcon=u$Y(e.showIcon,!1),this._boundingSphereOffset=t$X.ZERO,this._loadVolumeData=u$Y(e.loadVolumeData,!0),this._hasWireframe=!1,this._edgeStrokesTexture=void 0;var c=u$Y(e.subdomainConfig,{});this._subdomains=c.subdomains,this._subdomainsUrlScheme=c.urlScheme,this._isOverlapDisplayed=!1,this._iconRelatedTextLayerID=void 0,this._priorityScale=u$Y(e.priorityScale,1),this._blockCache=_0x349de1.getSingleInstance(),this._clippingType=V$i.KeepOutside,this._spatialQuery=void 0,this._pickObjs={},this._hasMixedContent=!1,this._backfaceCommands=[],this._excavateRegionCommands=new e$1P,this._rasterPerFrame=!1,this._animationInfo={startTime:void 0,array:[],defers:void 0,duration:void 0,defaultInterpolation:void 0,done:!0},this._textureEmissionUnit=_0x97cdd3.None,this._pbrParameter=je$b.NONE,this._maxSkipNum=256,this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,pixel:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,pixel:Number.MAX_VALUE},this._computeHeight=!1,this._polygonsTranslate={},this._maxSkipLevel=22,this._skipLevelSpan=void 0,this._mipmapEnabled=!0,this._enableFusion=!1,this._floodFlagTexture=void 0,this._floodRect=void 0,this._matFloodInvertMatrix=y$15.IDENTITY,this._heightScale=1,this._useRasterCull=!1,this._temporalCount=e$28(e.temporalCount)?e.temporalCount:0,this._temporalSetting=void 0,this._translucencyByDistance=!1,this._overlapWeightAttributeName=void 0,this._heightRangeAttributeName=void 0,this.hasAttributeIndex=e.hasAttributeIndex,this._envMapIntensity=1,this._historyCommands=[],this._showCallout=!1};function _0x11223a(e,t,i,r){for(var n={times:[],points:[],interpolations:[]},o=0,a=i.length;o<a;o++){var s=i[o],l=+s.slice(0,-1)/100*e.duration,u=r[s],c=u$Y(u.interpolationType,e.defaultInterpolation);(h=u[t])&&(n.times.push(l),n.points.push(h),n.interpolations.push(c))}var h=_0xf92175(n=_0x53d814(n),e,t);return e.array.push(h),n}function _0x53d814(e){var t=e.interpolations,i=e.times,r=e.points;e=[];for(var n=0,o=t.length-1;n<o;n++)e.push({times:[i[n],i[n+1]],points:[r[n],r[n+1]],interpolationType:t[n]});return e}function _0xf92175(e,t,i){for(var r=[],n=0,o=e.length;n<o;n++){var a=e[n];r.push(_0x26f757(i,a.interpolationType,a.times,a.points))}return{type:i,splines:r}}function _0x26f757(e,t,i,r){var n;if("rotation"===e)return r.forEach((function(e,t){r[t]=n$14.fromHeadingPitchRoll(e)})),new r$Q({times:i,points:r});switch(t){case _0x3eee90.Linear:n=new r$12({times:i,points:r});break;case _0x3eee90.Acceleration:n=new n$K({times:i,points:r,mode:0});break;case _0x3eee90.Deceleration:n=new n$K({times:i,points:r,mode:1});break;case _0x3eee90.CubicSpline:n=new c$_({times:i,points:r});break;case _0x3eee90.SmoothStep:n=new r$O({times:i,points:r});break;default:n=new r$12({times:i,points:r})}return n}function _0x308f5d(e,t){!t||!e$28(h$10.intersection(e.layerBounds,t.rectangle))||(t._rasterized=!1,_0x308f5d(e,t._southwestChild),_0x308f5d(e,t._southeastChild),_0x308f5d(e,t._northwestChild),_0x308f5d(e,t._northeastChild))}function _0x26f9c7(e){var t=0;e$28(e.style3D)&&(t=e.style3D.bottomAltitude);var i=e.height+t;if(e._sceneMode===P$$.SCENE3D)if(e._fileType===f$r.ClampGroundRealtimeRasterCache)e._position=new t$X(e.lon,e.lat,i),y$15.fromTranslation(e._position,e._matModel);else{var r=t$X.fromDegrees(e.lon,e.lat,i),n=t$X.fromDegrees(e.lon,e.lat,e.height);e._position=r;var o=new i$10(e._heading,0,0);m$1b.headingPitchRollToFixedFrame(r,o,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,e._matModel),m$1b.headingPitchRollToFixedFrame(n,o,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,e._oriMatModel)}else if(e._fileType!==f$r.ClampGroundRealtimeRasterCache){if(e.lon>180||e.lon<-180||e.lat>180||e.lat<-180||e.positionUnits===_0x152628.METER)if(e.useMercatorProject){var a=(u=new t$M).unproject(new t$X(e.lon,e.lat,0));e._position=e._scene.camera._projection.project(a)}else{var s=e.lon,l=e.lat;s>20037508.342789244&&(t$X.globalOffset.x=20037508.342789244*Math.floor(s/20037508.342789244),s-=t$X.globalOffset.x),l>10018754.171394622&&(t$X.globalOffset.y=20037508.342789244*Math.floor((l+10018754.171394622)/20037508.342789244),l-=t$X.globalOffset.y),e._position=new t$X(s,l,i)}else{var u=new n$1b;r=t$X.fromDegrees(e.lon,e.lat,i),a=u.ellipsoid.cartesianToCartographic(r);e._position=u.project(a)}y$15.fromTranslation(e._position,e._matModel),y$15.multiply(_0x5e0ddd,e._matModel,e._matModel)}else e._position=new t$X(e.lon,e.lat,i),y$15.fromTranslation(e._position,e._matModel);e._style3D._dirty&&e$28(e._layerScheduler)&&(e._layerScheduler._updateRootBoundingSphere(e._layerScheduler._oriRootEntities,e._matModel),e._style3D._dirty=!1),e$28(e._layerScheduler)&&e._layerScheduler.traverseRenderEntity({},(function(t){!t._colorCommand||(t._colorCommand.modelMatrix=y$15.multiply(e._matModel,t._geoMatrix,t._colorCommand.modelMatrix))}))}function _0x30ca0f(e,t){var i=e._hypsometricSetting;if(e$28(i)&&i._emissionTextureChanged){e$28(i._emissionTextureAtlas)&&!i._emissionTextureAtlas.isDestroyed()&&i._emissionTextureAtlas.destroy(),i._emissionTextureAtlas=new w$q({context:t});var r={};r.layer=e,r.textureCount=1,e$28(i._emissionTextureArray)&&i._emissionTextureArray.length>0?i._emissionTextureArray.map((function(t){i._emissionTextureAtlas.addImage(t.url,t.url).then((function(n){t.textureAtlasID=n,i._loadedEmissionTexture++,i._loadedEmissionTexture==i._emissionTextureArray.length&&(r.enable=!0,r.textureCount=i._loadedEmissionTexture,e.traverseRenderEntity(r,_0x53e3cb))}))})):(r.enable=!1,r.textureCount=0,e.traverseRenderEntity(r,_0x53e3cb)),i._emissionTextureChanged=!1}}function _0x1a6060(e,t){e._manualShadowVolumeBottomHeight===_0xbf0df&&e._manualShadowVolumeTopHeight===_0x312142?0===t.minTerrainHeight&&0===t.maxTerrainHeight?(e._shadowVolumeBottomHeight=_0xbf0df,e._shadowVolumeTopHeight=_0x312142):(e._shadowVolumeBottomHeight=t.minTerrainHeight-10,e._shadowVolumeTopHeight=t.maxTerrainHeight+10):(e._shadowVolumeBottomHeight=e._manualShadowVolumeBottomHeight,e._shadowVolumeTopHeight=e._manualShadowVolumeTopHeight)}function _0x33e201(e,t,i,r,n){var o=t$S.createIfNeeded(t).fetchImage().then((function(t){var o=new L$17({context:e,source:t,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT,minificationFilter:tt$h.LINEAR_MIPMAP_LINEAR,magnificationFilter:tt$h.LINEAR})});!e$27.isPowerOfTwo(o.width)||!e$27.isPowerOfTwo(o.height)||o.generateMipmap(S$N.NICEST),r[n]=o,i.readyTextureCount++})).otherwise((function(){i.pendingTextureCount--}));r[n]=o}function _0x37e662(e){if(!e._animationInfo.done){var t=(Date.now()-e._animationInfo.startTime)/1e3;t>=e._animationInfo.duration&&(e._animationInfo.defer.resolve(),e._animationInfo.done=!0,t=e._animationInfo.duration);for(var i=0,r=e._animationInfo.array.length;i<r;i++){var n=e._animationInfo.array[i];_0x115b5e(e,n,t),_0x3cc37c(e,n,t),_0x1b8f1c(e,n,t)}_0x1af5b3(e)}}function _0x1af5b3(e){for(var t=[],i=0,r=e._layerScheduler._rootEntities.length;i<r;i++){(n=e._layerScheduler._rootEntities[i]).hasTranslate=!0,t.push(n)}for(;t.length;){var n;if(e$28(n=t.pop()))for(i=0,r=n._childrenPageLod.length;i<r;i++){for(var o=n._childrenPageLod[i],a=0,s=o._renderEntityList.length;a<s;a++){var l=o._renderEntityList[a];!e$28(l)||!e$28(l._colorCommand)||(l._entity.hasTranslate=!0,y$15.multiply(e._matModel,l._geoMatrix,l._colorCommand.modelMatrix),l._colorCommand._boundingVolume=void 0)}t.push(o._entity)}}}function _0x3b9224(e,t,i){for(var r,n=0,o=e.length;n<o;n++){var a=e[n],s=a.times;if(t>=s[0]&&t<=s[s.length-1]){r=a;break}}r&&r.evaluate(t,i)}_0x47d916.DEFAULT_TRANSPARENT_BACK_COLOR=e$1S.BLACK,_0x47d916.DEFAULT_TRANSPARENT_BACK_COLOR_TOLERANCE=0,Object.defineProperties(_0x47d916.prototype,{needLoadAttributes:{get:function(){return e$28(this._queryFieldNames)||this.indexedDBSetting.isAttributesSave&&this.hasQueryAttrAction}},overlapWeightAttributeName:{get:function(){return this._overlapWeightAttributeName},set:function(e){this._overlapWeightAttributeName=e}},heightRangeAttributeName:{get:function(){return this._heightRangeAttributeName},set:function(e){this._heightRangeAttributeName=e}},urlType:{get:function(){return this._urlType},set:function(e){this._urlType=e}},minVisibleAltitude:{get:function(){return this._minVisibleAltitude},set:function(e){o$1u.typeOf.number("min visible altitude",e),this._minVisibleAltitude=e}},maxVisibleAltitude:{get:function(){return this._maxVisibleAltitude},set:function(e){o$1u.typeOf.number("max visible altitude",e),this._maxVisibleAltitude=e}},heading:{get:function(){return this._heading},set:function(e){o$1u.typeOf.number("heading",e),this._heading=e,this.initialize()}},lodRangeScale:{get:function(){return this._lodRangeScale},set:function(e){this._historyCommands.push({func:"lodRangeScale",arguments:[e]}),this._lodRangeScale=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},priorityScale:{get:function(){return this._priorityScale},set:function(e){this._priorityScale=e}},customRequestHeaders:{get:function(){return this._layerScheduler._customRequestHeaders},set:function(e){this._layerScheduler._customRequestHeaders=e}},style3D:{get:function(){return this._style3D},set:function(e){e&&(this._historyCommands.push({func:"style3D",arguments:[e]}),this._style3D=e,this._style3D._owner=this,this._iconCollection.style3D=this._style3D)}},themeStyle:{get:function(){return this._styleEngine.style},set:function(e){this._historyCommands.push({func:"themeStyle",arguments:[e]}),this._styleEngine.style=e}},wireFrameMode:{get:function(){return this._wireFrameType},set:function(e){if(this._historyCommands.push({func:"wireFrameMode",arguments:[e]}),e!==this._wireFrameType){if(e===_0x255091.Quad&&(e=_0x255091.EffectOutline),e===_0x255091.Sketch||this._wireFrameType===_0x255091.Sketch){var t={};t.edgeMode=e===_0x255091.Sketch?1:0,t.layer=this,this.traverseRenderEntity(t,_0x87ff23)}this._wireFrameType=e}}},visible:{get:function(){return this._visible},set:function(e){this._fileType===f$r.ClampGroundRealtimeRasterCache&&this._visible!=e&&this._layerScheduler.refreshRaster(this._frameState),this._visible=e}},dataMaxValue:{get:function(){return e$28(this._hypMaxCategory)?this._hypMaxCategory:this._hypMaxHeight}},dataMinValue:{get:function(){return e$28(this._hypMinCategory)?this._hypMinCategory:this._hypMinHeight}},ColorDictTableMode:{set:function(e){this._hypUseColorByHeight=e}},hypsometricSetting:{get:function(){return LicenseChecker.LICENSECHECKER.verify("S3MTilesLayer_hypsometricSetting"),{hypsometricSetting:this._hypsometricSetting,analysisMode:this._hypAnalysisMode}},set:function(e){LicenseChecker.LICENSECHECKER.verify("S3MTilesLayer_hypsometricSetting"),this._bUseHypColorTable=!1,this._hypsometricRegionUpdate=!0,e$28(this._hypsometricRegion)&&(this._hypsometricRegion.destroy(),this._hypsometricRegion=null),e$28(this._hypsometricRenderTexture)||(this._hypsometricRenderTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA})),e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:this._context,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1}));var t={};if(t.layer=this,!e$28(e)||!e$28(e.hypsometricSetting))return e$28(this._hypsometricSetting)&&(this._hypsometricSetting.destroy(),this._hypsometricSetting=void 0),void this.traverseRenderEntity(t,_0x586985);if(this._hypAnalysisMode=e.analysisMode||this._hypAnalysisMode,this._hypsometricSetting=u$K.clone(e.hypsometricSetting,this._hypsometricSetting),this._hypsometricSetting._emissionTextureChanged=!0,e$28(this._hypsometricSetting.ColorTable)&&(this._hypsometricSetting.ColorTable.generateBuffer(),e$28(this._hypsometricTexture)&&this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._hypsometricSetting.ColorTable._imageBuffer})),this._hypAnalysisMode!==k$T.AnalysisRegionMode.ARM_NONE?(this._bUseHypColorTable=!0,this.traverseRenderEntity(t,_0x53da50)):this.traverseRenderEntity(t,_0x586985),this._hypsometricSetting.UpdatePolygonRegion&&this._hypAnalysisMode===k$T.AnalysisRegionMode.ARM_REGION&&this._hypsometricSetting.CoverageArea.length>0){var i=this._hypsometricSetting.CoverageArea,r=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)}}),n=U$Q.createGeometry(r),o=new y$15;y$15.inverse(this._matModel,o),f$X.updateGeometry(n,i,o,this._frameState.mode===P$$.COLUMBUS_VIEW);var a=f$X.updateGeoBounds(n),s=.01*(a.z-a.x);a.w,a.y,this._hypsometricRegion=new f$X,this._hypsometricRegion._geometry=n,this._hypsometricRegion._bounds.x=a.x-s,this._hypsometricRegion._bounds.y=a.y-s,this._hypsometricRegion._bounds.z=a.z+s,this._hypsometricRegion._bounds.w=a.w+s,e$25.clone(this._hypsometricRegion._bounds,this._hypsometricBound)}this._bVolume||this._colorTableChanged.raiseEvent()}},layerBounds:{get:function(){return this._layerBounds},set:function(e){this._layerBounds=e}},LoadingMode:{get:function(){return this._nLoadingMode},set:function(e){this._nLoadingMode=e}},LoadingPriority:{get:function(){return e$28(this._layerScheduler)?this._layerScheduler.LoadingPriority:U$p.Child_Priority},set:function(e){e$28(this._layerScheduler)&&(this._layerScheduler.LoadingPriority=e)}},bReleaseColor:{get:function(){return this._bReleaseColor},set:function(e){this._bReleaseColor=e}},ignoreNormal:{get:function(){return this._ignoreNormal},set:function(e){this._ignoreNormal!==e&&(this._ignoreNormal=e,this.refresh())}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(e){this._visibleDistanceMax=e}},visibleDistanceMin:{get:function(){return this._visibleDistanceMin},set:function(e){this._visibleDistanceMin=e}},clipLineColor:{get:function(){return new e$1S(this._clipLineColor.x,this._clipLineColor.y,this._clipLineColor.z,this._clipLineColor.w)},set:function(e){e instanceof e$1S&&(this._clipLineColor=new e$25(e.red,e.green,e.blue,e.alpha))}},clipPlaneColor:{get:function(){return new e$1S(this._clipPlaneColor.x,this._clipPlaneColor.y,this._clipPlaneColor.z,this._clipPlaneColor.w)},set:function(e){e instanceof e$1S&&(this._clipPlaneColor=new e$25(e.red,e.green,e.blue,e.alpha))}},shadowType:{get:function(){return this._shadowType},set:function(e){this._historyCommands.push({func:"shadowType",arguments:[e]}),this._shadowType!==e&&(this._shadowType=e,this.updateShadow())}},horizontalline:{get:function(){return this._fHorizontalLine},set:function(e){this._fHorizontalLine=e}},horizontalColor:{get:function(){return new e$1S(this._HorizontalColor.x,this._HorizontalColor.y,this._HorizontalColor.z,this._HorizontalColor.w)},set:function(e){e instanceof e$1S&&(this._HorizontalColor=new e$25(e.red,e.green,e.blue,e.alpha))}},hasLight:{get:function(){return this._hasLight},set:function(e){if(this._historyCommands.push({func:"hasLight",arguments:[e]}),e$28(e)){this._hasLight=e;var t={};t.layer=this,t.enable=e,this.traverseRenderEntity(t,_0x849afa)}}},cullEnabled:{get:function(){return this._cullEnabled},set:function(e){this.cullMode=e?_0x4a48d8.COUNTER_CLOCKWISE:_0x4a48d8.NONE}},cullMode:{get:function(){return this._cullMode},set:function(e){this._cullMode=e;var t=u$R.getState(this._rsColor);t.cull.enabled=e!==_0x4a48d8.NONE,t.frontFace=e!==_0x4a48d8.NONE?e:_0x4a48d8.COUNTER_CLOCKWISE,this._rsColor=u$R.fromCache(t)}},enableDepthTest:{get:function(){return this._enableDepthTest},set:function(e){this._enableDepthTest=e;var t=u$R.getState(this._rsColor);t.depthTest.enabled=e,this._rsColor=u$R.fromCache(t)}},selectColorType:{get:function(){return this._selectColorType},set:function(e){if(this._selectColorType!==e){this._selectColorType=e,this.isSilhouette()?this._context.numNormalAndDepthObject++:(this._context.numNormalAndDepthObject--,this._context.numNormalAndDepthObject=Math.max(this._context.numNormalAndDepthObject,0));var t={};t.layer=this,t.selectColorType=e,this.traverseRenderEntity(t,_0x3eaa50)}}},mixColorType:{get:function(){return this._mixColorType},set:function(e){if(this._historyCommands.push({func:"mixColorType",arguments:[e]}),this._mixColorType!==e){this._mixColorType=e;var t={layer:this,mixColorType:e};this.traverseRenderEntity(t,_0x1368e8)}}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},groupName:{get:function(){return this._groupName}},selectEnabled:{get:function(){return this._selectEnabled},set:function(e){this._historyCommands.push({func:"selectEnabled",arguments:[e]}),o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._selectEnabled=e}},enableHighlight:{get:function(){return this._enableHighlight},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._enableHighlight=e}},skeletonSelectEnable:{get:function(){return this._skeletonSelectEnable},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._skeletonSelectEnable=e,this.refresh()}},selectedColor:{get:function(){return this._selectedColor},set:function(e){this._historyCommands.push({func:"selectedColor",arguments:[e]}),o$1u.defined("selectedColor value",e),this._selectedColor=e$1S.clone(e),this._labelCollection.selectedColor=e$1S.clone(e)}},selectedLineColor:{get:function(){return this._selectedLineColor},set:function(e){o$1u.defined("selectedColor value",e),this._selectedLineColor=e$1S.clone(e)}},skeletonSelectedColor:{get:function(){return this._skeletonSelectedColor},set:function(e){o$1u.defined("skeletonSelectedColor value",e),this._skeletonSelectedColor=e$1S.clone(e)}},selectedSkeletonId:{get:function(){return this._lastSelectSkeletonId},set:function(e){o$1u.defined("selectSkeletonId value",e),this._lastSelectSkeletonId=e}},multiChoose:{get:function(){return this._multiChoose},set:function(e){o$1u.defined("multiChoose",e),o$1u.typeOf.bool("multiChoose",e),this._multiChoose=e}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x17c547)}},contrast:{get:function(){return this._contrast},set:function(e){this._contrast=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x17c547)}},hue:{get:function(){return this._hue},set:function(e){this._hue=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x17c547)}},saturation:{get:function(){return this._saturation},set:function(e){this._saturation=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x17c547)}},gamma:{get:function(){return this._gamma},set:function(e){this._gamma=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x17c547)}},transparentBackColor:{get:function(){return this._transparentBackColor},set:function(e){if(this._transparentBackColor!==e){this._transparentBackColor=e;var t={};t.layer=this,this.traverseRenderEntity(t,_0x5b512f)}}},transparentBackColorTolerance:{get:function(){return this._transparentBackColorTolerance},set:function(e){if(this._transparentBackColorTolerance!==e){this._transparentBackColorTolerance=e;var t={};t.layer=this,0===this._transparentBackColorTolerance?this.traverseRenderEntity(t,_0x34e580):this.traverseRenderEntity(t,_0x5b512f)}}},volName:{get:function(){return this._volName},set:function(e){for(var t=0;t<this._volNames.length;t++)this._volNames[t]==e&&(this._volName=e,this._fMaxValue=this._maxVolumeValues[t],this._fMinValue=this._minVolumeValues[t],this._strVolumeExt=this._strVolumeExts[t],this.refreshVolume())}},coverImageryLayer:{get:function(){return this._imageryLayer},set:function(e){if(e$28(e))if(e$28(this._imageryLayer)){!(this._imageryLayer instanceof Array)&&!this._imageryLayer.show&&this._layerScheduler._hideImage(),this._imageryLayer=e;var t=this;if(this._imageryLayer instanceof Array){for(var i=[],r=0;r<this._imageryLayer.length;r++)i.push(this._imageryLayer[r]._imageryProvider._readyPromise);t._layerScheduler._stopLoadImagery=!0,Promise.all(i).then((function(){t._layerScheduler._refreshImage(),t._layerScheduler._stopLoadImagery=!1}))}else t._layerScheduler._stopLoadImagery=!0,this._imageryLayer._imageryProvider._readyPromise.then((function(){t._layerScheduler._refreshImage(),t._layerScheduler._stopLoadImagery=!1}))}else{if(!this._needCoverImageryLayer)return this.refresh(),this._imageryLayer=e,void(this._needCoverImageryLayer=!0);var n=!1;e$28(this._imageryLayer)||(n=!0),this._imageryLayer=e;t=this;if(this._imageryLayer instanceof Array){for(i=[],r=0;r<this._imageryLayer.length;r++)i.push(this._imageryLayer[r]._imageryProvider._readyPromise);t._layerScheduler._stopLoadImagery=!0,Promise.all(i).then((function(){t._layerScheduler._refreshImage(),t._layerScheduler._stopLoadImagery=!1,n&&t._updateCoverImageryLayer(!1)}))}else t._layerScheduler._stopLoadImagery=!0,this._imageryLayer._imageryProvider._readyPromise.then((function(){t._layerScheduler._refreshImage(),t._layerScheduler._stopLoadImagery=!1,n&&t._updateCoverImageryLayer(!1)}));this._needCoverImageryLayer=!0}else e$28(this._imageryLayer)&&(this._updateCoverImageryLayer(!0),this._imageryLayer=void 0)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){if(o$1u.typeOf.number("splitDirection",e),this._splitDirection!==e){this._splitDirection=e;var t={layer:this,enableSplit:e!==_0x171baa.NONE};this.traverseRenderEntity(t,_0x3f4395)}}},splitPosition:{get:function(){return this._splitPosition},set:function(e){o$1u.typeOf.number("splitPosition",e),this._splitPosition=e}},selectionFiltrateByTransparency:{get:function(){return this._selectionFiltrateByTransparency},set:function(e){this._historyCommands.push({func:"selectionFiltrateByTransparency",arguments:[e]}),o$1u.typeOf.number("selectionFiltrateByTransparency value",e),this._selectionFiltrateByTransparency=e}},effect:{get:function(){return this._effect},set:function(e){this._effect=e}},bloomEffect:{get:function(){return e$28(this._bloomEffect)||(this._bloomEffect=new _0x369b4a),this._bloomEffect}},bloomEnable:{get:function(){return!!e$28(this._bloomEffect)&&this._bloomEffect.enable}},selectedTranslate:{get:function(){return this._selectedTranslate},set:function(e){o$1u.typeOf.object("selected translate",e),!t$X.equals(e,this._selectedTranslate)&&(this._selectedTranslate=e)}},clearMemoryImmediately:{get:function(){return this._clearMemoryImmediately},set:function(e){this._historyCommands.push({func:"clearMemoryImmediately",arguments:[e]}),this._clearMemoryImmediately=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMemoryUsage=e}},PBRMaterialType:{get:function(){return this._PBRMaterialType},set:function(e){if(this._PBRMaterialType!==e){this._PBRMaterialType=e;var t=_0x294c83.getMaterial(e),i=this;e$28(this._pbrMetalTexture)&&(this._pbrMetalTexture.destroy(),this._pbrMetalTexture=null),e$28(this._pbrRoughTexture)&&(this._pbrRoughTexture.destroy(),this._pbrRoughTexture=null),o$1q(t$D(t.metalTextureUrl),(function(e){i._pbrMetalTexture=new L$17({context:i._frameState.context,source:e,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.UNSIGNED_BYTE})})),o$1q(t$D(t.roughTextureUrl),(function(e){i._pbrRoughTexture=new L$17({context:i._frameState.context,source:e,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.UNSIGNED_BYTE})}));var r={};r.layer=this,r.PBRType=e,this.traverseRenderEntity(r,_0xcbba6)}}},PBRMetallic:{get:function(){return this._PBRMaterialParams.pbrMetallicRoughness.metallicFactor},set:function(e){this._PBRMaterialParams.pbrMetallicRoughness.metallicFactor=e}},PBRRoughness:{get:function(){return this._PBRMaterialParams.pbrMetallicRoughness.roughnessFactor},set:function(e){this._PBRMaterialParams.pbrMetallicRoughness.roughnessFactor=e}},emissiveFactor:{get:function(){return this._PBRMaterialParams.pbrMetallicRoughness.emissiveFactor},set:function(e){this._PBRMaterialParams.pbrMetallicRoughness.emissiveFactor=e}},textureUVSpeed:{get:function(){return this._textureUVSpeed},set:function(e){o$1u.typeOf.object("textureUVSpeed value",e),o$1k.clone(e,this._textureUVSpeed);var t={};t.layer=this,t.enable=0!==this._textureUVSpeed.x||0!==this._textureUVSpeed.y,this.traverseRenderEntity(t,_0x2446a5)}},indexedDBSetting:{get:function(){return this._indexedDBSetting},set:function(e){if(this._historyCommands.push({func:"indexedDBSetting",arguments:[e]}),e$28(window.Proxy)){var t=this;if(e$28(e)&&"boolean"==typeof e.isGeoTilesSave&&"boolean"==typeof e.isAttributesSave&&"boolean"==typeof e.isGeoTilesRootNodeSave){(i={}).isGeoTilesSave=e.isGeoTilesSave,i.isAttributesSave=e.isAttributesSave,i.isGeoTilesRootNodeSave=e.isGeoTilesRootNodeSave,i.clear=function(){t._layerScheduler._clearIndexedDBCache()};var i={isAttributesSave:!1,isGeoTilesSave:!1,isGeoTilesRootNodeSave:!1,clear:function(){t._layerScheduler._clearIndexedDBCache()}};this._indexedDBSetting=new Proxy(i,{get:function(e,t){return e[t]},set:function(e,i,r){"isAttributesSave"===i&&!1===e.isAttributesSave&&!0===r&&(e$28(t._layerScheduler._indexedDBScheduler)?t._layerScheduler._indexedDBScheduler.getElementFromDB("attributes","saved").then((function(e){!e&&0==t._layerScheduler._attributes._memoryCache&&t._layerScheduler._requestAllScvd()}),(function(){0==t._layerScheduler._attributes._memoryCache&&t._layerScheduler._requestAllScvd()})):t._layerScheduler._dpPromise.then((function(){t._layerScheduler._indexedDBScheduler.getElementFromDB("attributes","saved").then((function(e){!e&&0==t._layerScheduler._attributes._memoryCache&&t._layerScheduler._requestAllScvd()}),(function(){0==t._layerScheduler._attributes._memoryCache&&t._layerScheduler._requestAllScvd()}))}))),e[i]=r}}),this._layerScheduler._indexedDBSetting=this._indexedDBSetting}}else this._indexedDBSetting={isAttributesSave:!1,isGeoTilesSave:!1,isGeoTilesRootNodeSave:!1},this._layerScheduler._indexedDBSetting=this._indexedDBSetting}},pointCloudShading:{get:function(){return this._pointCloudShading}},shadowVolumeTopHeight:{get:function(){return this._manualShadowVolumeTopHeight},set:function(e){this._manualShadowVolumeTopHeight=e}},shadowVolumeBottomHeight:{get:function(){return this._manualShadowVolumeBottomHeight},set:function(e){this._manualShadowVolumeBottomHeight=e}},triangleFiltratePixel:{get:function(){return this._triangleFiltratePixel},set:function(e){var t=parseFloat(e),i=this._triangleFiltratePixel>0,r=t>0;if(this._triangleFiltratePixel=t,this._vertexWeightMode===_0x4a384f.EdgeLengthMin&&i!=r){var n={};n.layer=this,n.enable=r,this.traverseRenderEntity(n,_0x14c364)}}},useMercatorProject:{get:function(){return this._useMercatorProject},set:function(e){this._useMercatorProject=e,this.refresh()}},minTransparentAlpha:{get:function(){return this._minTransparentAlpha},set:function(e){this._minTransparentAlpha=e}},maxTransparentAlpha:{get:function(){return this._maxTransparentAlpha},set:function(e){this._maxTransparentAlpha=e}},selectBound:{get:function(){return this._selectRect},set:function(e){this._selectRect=e,this._selectUpdate=!0,this._selectEnabled=!0}},S3MTileLoadedEvent:{get:function(){return this._S3MTileLoadedEvent}},attributeDownloaded:{get:function(){return this._attributeDownloaded}},allTilesLoaded:{get:function(){return this._allTilesLoaded}},tilesLoaded:{get:function(){return this._tilesLoaded}},statistics:{get:function(){return this._layerScheduler._statistics}},prepareLoadEvent:{get:function(){return this._prepareLoadEvent}},prepareLoadDataSize:{get:function(){return this._prepareLoadSize},set:function(e){o$1u.typeOf.number("value",e),e>0&&(this._prepareLoadSize=e,e$28(this._prepareLoadEvent)||(this._prepareLoadEvent=new o$1o),this._layerScheduler._prepareLoaded=!1)}},colorTableChanged:{get:function(){return this._colorTableChanged}},receiveObjectClamp:{get:function(){return this._receiveObjectClamp},set:function(e){this._receiveObjectClamp=e;var t=u$R.getState(this._rsColor);t.stencilTest=_0x17966c.createReceiveClampObjectStencilTest(e),this._rsColor=u$R.fromCache(t)}},orderIndependentTranslucency:{get:function(){return this._useOIT},set:function(e){this._historyCommands.push({func:"orderIndependentTranslucency",arguments:[e]}),o$1u.typeOf.bool("value",e),this._useOIT=e}},partlyTransparent:{get:function(){return this._partlyTransparent},set:function(e){o$1u.typeOf.bool("value",e),this._partlyTransparent=e}},showLabel:{get:function(){return this._showLabel},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._showLabel=e,this._showLabel&&0===Object.keys(this._layerScheduler._attributes).length&&this._layerScheduler._requestAllScvd()}},labelStyle:{get:function(){return this._s3MTilesLabelStyle},set:function(e){o$1u.defined("value",e),(this._s3MTilesLabelStyle._textFieldChanged||e$28(e._textField)&&this._s3MTilesLabelStyle._textField!==e._textField)&&this._labelCollection.removeAll(),this._s3MTilesLabelStyle=e,e$28(this._labelCollection)&&this._labelCollection.setLabelStyle(this._s3MTilesLabelStyle)}},swipeRegion:{get:function(){return new f$10(this._swipeRegion.x,this._swipeRegion.y,this._swipeRegion.z-this._swipeRegion.x,this._swipeRegion.w-this._swipeRegion.y)},set:function(e){if(e$28(e)){if(!(e instanceof f$10))throw new t$Z("swipeRegion must be a instance of BoundingRectangle.");e$25.fromElements(e.x,e.y,e.x+e.width,e.y+e.height,this._swipeRegion)}}},swipeEnabled:{get:function(){return this._swipeEnabled},set:function(e){e!==this._swipeEnabled&&(e?this.splitDirection=_0x171baa.NONE:e$25.fromElements(0,0,1,1,this._swipeRegion),this._swipeEnabled=e,this.traverseRenderEntity({layer:this,enableSwipe:e},_0x2a43b8))}},allObjsHide:{get:function(){return this._allObjsHide}},residentRootTile:{get:function(){return this._residentRootTile},set:function(e){this._historyCommands.push({func:"residentRootTile",arguments:[e]}),o$1u.typeOf.bool("residentRootTile",e),this._residentRootTile=e}},idFieldName:{get:function(){return this._idFieldName}},loadVolumeData:{get:function(){return this._loadVolumeData},set:function(e){this._loadVolumeData=e}},showIcon:{get:function(){return this._showIcon},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._showIcon=e}},showCallout:{get:function(){return this._iconCollection?this._iconCollection.showCallout:this._showCallout},set:function(e){o$1u.defined("value",e),o$1u.typeOf.bool("value",e),this._iconCollection&&(this._iconCollection.showCallout=e),this._showCallout=e}},waterColor:{get:function(){return this._waterParamter&&this._waterParamter.waterColour},set:function(e){if(!e$28(this._waterParamter))throw new t$Z("No water exists in this layer");if(o$1u.defined("value",e),!(e instanceof e$1S))throw new t$Z("Expected waterColor to be typeof color");this._waterParamter.waterColour=e}},waterSpeed:{get:function(){return this._waterParamter&&this._waterParamter.bumpSpeed},set:function(e){if(!this._waterParamter)throw new t$Z("No water exists in this layer");if(o$1u.defined("value",e),!(e instanceof o$1k))throw new t$Z("Expected waterSpeed to be typeof Cartesian2");this._waterParamter.bumpSpeed=e}},waterWaveScale:{get:function(){return this._waterParamter&&this._waterParamter.noiseScale},set:function(e){if(!this._waterParamter)throw new t$Z("No water exists in this layer");o$1u.defined("value",e),o$1u.typeOf.number("value",e),this._waterParamter.noiseScale=e}},attributeFieldNames:{get:function(){return e$28(this._fieldsInfo)?Object.keys(this._fieldsInfo._hash):void 0}},queryFieldNames:{get:function(){return this._queryFieldNames},set:function(e){if(this._historyCommands.push({func:"queryFieldNames",arguments:[e]}),e$28(this._queryFieldNames)&&this._queryFieldNames.sort().toString()!==e.sort().toString())for(var t=e.filter((e=>!this._queryFieldNames.includes(e))),i=this._layerScheduler,r=0;r<i._rootEntities.length;r++){var n=i._rootEntities[r];n._attrAppend=t,n.attrLoadState=I$F.UNLOAD}this._queryFieldNames=e}},hasWireframe:{get:function(){return this._hasWireframe}},subdomains:{get:function(){return this._subdomains},set:function(e){if(e$28(e)&&!e$28(e.length))throw new t$Z("Excepted S3MTilesLayer.subdomains to be type of Array.");this._subdomains=e}},iconRelatedTextLayerID:{get:function(){return this._iconRelatedTextLayerID},set:function(e){if(typeof e<"u"&&"number"!=typeof e)throw new t$Z("Excepted S3MTilesLayer.iconRelatedTextLayerID to be type of number or undefined");this._iconRelatedTextLayerID=e}},isOverlapDisplayed:{get:function(){return this._isOverlapDisplayed},set:function(e){o$1u.typeOf.bool("isOverlapDisplayed",e),this._isOverlapDisplayed=e,this._isOverlapDisplayed?this.setOnlyObjsVisible([],!1,!1,!0):this.setOnlyObjsVisible([],!0,!1,!0)}},clippingType:{get:function(){return this._clippingType},set:function(e){o$1u.defined("clipping type",e),this._clippingType=e,e$28(this._spatialQuery)&&(this._spatialQuery.positionMode=_0x297b1a(e))}},rasterPerFrame:{get:function(){return this._rasterPerFrame&&this._fileType===f$r.ClampGroundRealtimeRasterCache},set:function(e){o$1u.typeOf.bool("rasterPerFrame",e),this._rasterPerFrame=e}},RGBTOBGR:{get:function(){return this._RGBTOBGR},set:function(e){o$1u.typeOf.bool("RGBTOBGR",e),this._RGBTOBGR=e}},textureEmissionUnit:{get:function(){return this._textureEmissionUnit},set:function(e){this._textureEmissionUnit=e}},computeHeight:{get:function(){return this._computeHeight},set:function(e){this._computeHeight=e}},mipmapEnabled:{get:function(){return this._mipmapEnabled},set:function(e){this._mipmapEnabled=e}},enableFusion:{get:function(){return this._enableFusion},set:function(e){e!==this._enableFusion&&(this._enableFusion=e,this.traverseRenderEntity({enable:e,layer:this},_0xa0bb8))}},heightScale:{get:function(){return this._heightScale},set:function(e){if(e!==this._heightScale){e=Math.max(e,1e-5),this._heightScale=e;var t=y$15.fromScale(new t$X(1,1,e),new y$15);this.traverseRenderEntity({scaleMatrix:t,layerMatrix:this._matModel},_0x41facf)}}},temporalCount:{get:function(){return this._temporalCount}},temporalSetting:{get:function(){return this._temporalSetting},set:function(e){this._temporalSetting=e}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=e}}}),_0x47d916.prototype.initialize=function(){_0x26f9c7(this);var e,t=this._fileType,i=_0x17966c.createClampGroundStencilRenderState();if(t===f$r.ClampGroundLine||t===f$r.ClampGroundPolygon||t===f$r.ExtendClampPolygonCache?(e=_0x17966c.createClampGroundColorRenderState(),i=_0x17966c.createClampGroundStencilRenderState()):t===f$r.ClampObjectPolygon||t===f$r.ClampObjectLine?(e=_0x17966c.createClampObjectColorRenderState(),i=_0x17966c.createClampObjectStencilRenderState()):t===f$r.ClampGroundAndObjectLineCache?e=_0x17966c.createClampGroundAndObjectLineRenderState():(e=_0x17966c.createNormalColorRenderState(this.cullMode)).stencilTest=_0x17966c.createReceiveClampObjectStencilTest(this._receiveObjectClamp),e$28(this._polygonOffsetConfig)&&!0===this._polygonOffsetConfig.enabled&&(e.polygonOffset=this._polygonOffsetConfig),this._rsColor=u$R.fromCache(e),this._rsClampColor=u$R.fromCache(_0x17966c.createClampGroundColorRenderState()),this._rsClampLineColor=u$R.fromCache(_0x17966c.createClampGroundAndObjectLineRenderState()),this._rsStencil=u$R.fromCache(i),e$28(this.waterEffectSet)){this._waterPlanes=new e$1P,this._waterParamter=[];for(var r=0;r<this.waterEffectSet[0].gpuProgramParameters.length;r++){for(var n=this.waterEffectSet[0].gpuProgramParameters[r],o=0;o<n.atuoConstants.length;o++){var a=n.atuoConstants[o];if("timeVal"===a.name){this._waterParamter[a.name]=a.fData;break}}for(o=0;o<n.gpuConstants.length;o++){var s=n.gpuConstants[o],l=null;switch(s.arraySize){case 1:l=s.arrayFloat[0];break;case 2:l=new o$1k,o$1k.unpack(s.arrayFloat,0,l);break;case 3:l=new t$X,t$X.unpack(s.arrayFloat,0,l);break;case 4:l=new e$25,e$25.unpack(s.arrayFloat,0,l)}!e$28(l)||(this._waterParamter[s.name]=l)}}this._waterUniformBuffer=_0x3fa369.createWaterUniformBuffer(this._context,this)}this._computeLayerModelBounds()},_0x47d916.prototype._updateCoverImageryLayer=function(e){for(var t=this._layerScheduler,i=[],r=0;r<t._rootEntities.length;r++){var n=t._rootEntities[r];i.push(n)}for(var o,a={layer:this};o=i.pop();)for(var s=0;s<o._childrenPageLod.length;s++){for(var l=o._childrenPageLod[s]._renderEntityList,u=l.length,c=0;c<u;c++)e?(l[c]._imagerys=void 0,l[c].removeProgramDefineForCommand(l[c]._colorCommand,a,!0,!0,"IMAGERY"),l[c]._imageRasterFinish=!1,l[c]._imageryLevels=[],l[c].destroyScaleImagerys()):l[c].appendProgramDefineForCommand(l[c]._colorCommand,a,!0,!0,"IMAGERY");o._childrenPageLod[s]._entity&&i.push(o._childrenPageLod[s]._entity)}},_0x47d916.prototype.appendQueryFieldName=function(e){if(e$28(e.length)||new t$Z("Expected value to be type of Array"),!e$28(this._queryFieldNames))return this._queryFieldNames=[].concat(e),o$1q.resolve();for(var t=this._queryFieldNames,i=[],r=0,n=e.length;r<n;r++){var o=e[r];-1===t.indexOf(o)&&i.push(o)}if(0===i.length)return o$1q.resolve();this._queryFieldNames=this._queryFieldNames.concat(i);const a=this._layerScheduler._rootEntities;for(let e=0,t=a.length;e<t;e++)a[e].resetAttrLoadState();return o$1q.resolve()},_0x47d916.prototype.getPointCloudClassificationInfos=function(){if(e$28(this._pointCloudClassificationInfos))return this._pointCloudClassificationInfos;if(this._isS3MB){var e=u$O(i=new h$$("./attribute.json").resolve(this._baseUri).toString()),t=this;return e.then((function(e){var i=[];if(!e$28(e.classificationInfos))return t._pointCloudClassificationInfos=i,i;for(var r=0,n=e.classificationInfos.length;r<n;r++){var o=e.classificationInfos[r].id,a=e.classificationInfos[r].name,s=e.classificationInfos[r].pointCount;i.push(new _0x59d91c(o,a,s))}return t._pointCloudClassificationInfos=i,i})).otherwise((function(e){console.log(e)}))}var i=new h$$("./indexData.dat").resolve(this._baseUri).toString();e$28(a$Y.CREDENTIAL)&&(i=a$Y.addToken(i));e=d$17(i),t=this;return e.then((function(e){for(var i=e.firstChild,r=i.namespaceURI,n=s$P.queryNodes(i,"PointCloudClassification",r),o=[],a=0,s=n.length;a<s;a++){var l=n[a],u=s$P.queryStringAttribute(l,"ID"),c=s$P.queryStringAttribute(l,"Name"),h=s$P.queryNumericAttribute(l,"PointCounts");o.push(new _0x59d91c(u,c,h))}return t._pointCloudClassificationInfos=o,o})).otherwise((function(e){console.log(e)}))},_0x47d916.prototype.setPolygonoffset=function(e,t){if(this._rsColor._applyFunctions.length=0,this._rsColor.polygonOffset.factor!==e||this._rsColor.polygonOffset.units!==t){var i=u$R.getState(this._rsColor);i.polygonOffset={enabled:!0,factor:u$Y(e,0),units:u$Y(t,0)},this._rsColor=u$R.fromCache(i)}},_0x47d916.prototype.getVolNames=function(){return this._volNames},_0x47d916.prototype.setQueryParameter=function(e){if(!e$28((e=e||{}).url))throw new t$Z("options.url is required!");if(!e$28(e.dataSourceName))throw new t$Z("options.dataSourceName is required!");if(!e$28(e.dataSetName)&&!0!==e.isMerge)throw new t$Z("options.dataSetName is required or isMerge must be true!");if(e.keyWord=u$Y(e.keyWord,"SmID"),e.hasGeometry=u$Y(e.hasGeometry,!1),this.queryParameter=l$1e(e),!e$28(this.queryParameter.dataSetName)&&1==this.queryParameter.isMerge){var t=this;this.datasetInfo().then((function(e){t.queryParameter.datasetList=e}))}},_0x47d916.prototype.getQueryParameter=function(){return this.queryParameter},_0x47d916.prototype.datasetInfo=function(){var e=o$1q.defer();if(this._isS3MB){var t=this._baseUri+"attribute.json";e$28(a$Y.CREDENTIAL)&&(t=a$Y.addToken(t)),u$O(t).then((function(t){for(var i=t.layerInfos,r=new Array,n=0;n<i.length;n++){var o=i[n],a={};a.datasetName=o.layerName,a.startID=parseInt(o.idRange.minID),a.endID=parseInt(o.idRange.maxID),r.push(a)}e.resolve(r)}))}else{var i=this._baseUri+"indexData.dat";e$28(a$Y.CREDENTIAL)&&(i=a$Y.addToken(i));e=o$1q.defer();o$1q(d$17(i),(function(t){for(var i=s$P.getElementsByTagNameNS(t,"*","DatasetName"),r=s$P.getElementsByTagNameNS(t,"*","DatasetIDRange"),n=new Array,o=0;o<i.length;o++){var a={};a.datasetName=i[o].innerHTML;var s=r[o].innerHTML,l=s.indexOf("_");a.startID=parseInt(s.substr(0,l)),a.endID=parseInt(s.substr(l+1,s.length-l-1)),n.push(a)}e.resolve(n)}))}return e.promise},_0x47d916.prototype.getLodRangeScale=function(){return this._lodRangeScale},_0x47d916.prototype.setAnimation=function(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.keyframes",e.keyframes),o$1u.typeOf.number.greaterThan("options.duration",e.duration,0);var t=e.keyframes,i=e.duration,r=e.interpolationType;if("0%"in t){var n=t["0%"];n.scale=u$Y(n.scale,new t$X(1,1,1)),n.rotation=u$Y(n.rotation,new i$10(this._heading,0,0)),n.translation=u$Y(n.translation,t$X.fromDegrees(this.lon,this.lat,this.style3D.bottomAltitude))}else t["0%"]={translation:t$X.fromDegrees(this.lon,this.lat,this.style3D.bottomAltitude),scale:new t$X(1,1,1),rotation:new i$10(this._heading,0,0)};var o=Object.keys(t);return(o=o.filter((function(e){return"%"===e[e.length-1]}))).sort((function(e,t){return(e=+e.slice(0,-1))-(t=+t.slice(0,-1))})),this._animationInfo={startTime:Date.now(),array:[],duration:i,defer:o$1q.defer(),defaultInterpolation:u$Y(r,_0x3eee90.Linear),done:!1},_0x11223a(this._animationInfo,"rotation",o,t),_0x11223a(this._animationInfo,"scale",o,t),_0x11223a(this._animationInfo,"translation",o,t),this._animationInfo.defer},_0x47d916.prototype.setLodRangeScale=function(e){this._lodRangeScale=e},_0x47d916.prototype.refreshRaster=function(){if(e$28(this._frameState)){var e=this._frameState._quadtree._levelZeroTiles;e[0]&&_0x308f5d(this,e[0]),e[1]&&_0x308f5d(this,e[1])}},_0x47d916.prototype._isNeedUpdate=function(e,t){return!(!e$28(e)||!e$28(t)||!this._visible||e$28(this.waterEffectSet)&&t._fboState.enabled&&"water"===t._fboState.name)},_0x47d916.prototype._loadMaterialTexture=function(e,t){e.loadingTexture=!0;var i=e.pbrMetallicRoughness,r=e.textureunitstates,n=i.baseColorTextureIndex;e$28(e.pendingTextureCount)||(e.pendingTextureCount=0),e$28(e.readyTextureCount)||(e.readyTextureCount=0);var o=this._context,a=e$28(t)?t:this._baseUri+this._materialRelativePath;n>-1&&!e$28(i.baseColorTexture)&&(_0x33e201(o,a+r[n].textureunitstate.url,e,e.pbrMetallicRoughness,"baseColorTexture"),e.pendingTextureCount++);var s=i.emissiveTextureIndex;s>-1&&!e$28(i.emissiveTexture)&&(_0x33e201(o,a+r[s].textureunitstate.url,e,e.pbrMetallicRoughness,"emissiveTexture"),e.pendingTextureCount++);var l=i.normalTextureIndex;l>-1&&!e$28(i.normalTexture)&&(_0x33e201(o,a+r[l].textureunitstate.url,e,e.pbrMetallicRoughness,"normalTexture"),e.pendingTextureCount++);var u=i.metallicRoughnessTextureIndex;u>-1&&!e$28(i.metallicRoughnessTexture)&&(_0x33e201(o,a+r[u].textureunitstate.url,e,e.pbrMetallicRoughness,"metallicRoughnessTexture"),e.pendingTextureCount++);var c=i.occlusionTextureIndex;c>-1&&!e$28(i.occlusionTexture)&&(_0x33e201(o,a+r[c].textureunitstate.url,e,e.pbrMetallicRoughness,"occlusionTexture"),e.pendingTextureCount++)},_0x47d916.prototype._loadMaterial=function(e,t){var i=this;t$S.createIfNeeded(e).fetchJson().then((function(e){e$28(i._materialMap)||(i._materialMap={}),e.material.ready=!1,i._materialMap[t]=e,i.readyMaterialCount++}))},_0x47d916.prototype._loadMaterialMap=function(e){if(e$28(this._materialMapInfo)){this.readyMaterialCount=0;for(var t=0,i=this._materialMapInfo.length;t<i;t++){var r=this._materialMapInfo[t],n=this._baseUri+this._materialRelativePath+r.AssociateMaterial+".json";this._loadMaterial(n,r.OriginalMaterial)}this.pendingMaterialCount=this._materialMapInfo.length,this._materialMapInfo=void 0}if(e$28(this._materialMap)&&this.pendingMaterialCount===this.readyMaterialCount){var o=!0;for(var a in this._materialMap)if(this._materialMap.hasOwnProperty(a)){var s=this._materialMap[a].material;s.loadingTexture||this._loadMaterialTexture(s),s.pendingTextureCount===s.readyTextureCount&&(s.ready=!0),o=o&&s.ready}this._materialMapReady=o}if(!e$28(this._associateMaterialPromise)){var l=this,u=e.lastIndexOf("/");this._materialRelativePath=e.substring(0,u+1),e=this._baseUri+e;var c=t$S.createIfNeeded(e);this._associateMaterialPromise=c.fetchJson().then((function(e){l._materialMapInfo=e.Scenes[0].Layers[0].Materials.MaterialExportedMap}))}},_0x47d916.prototype.update=function(e,t,i,r){if(this._fileType!==f$r.Text&&this._fileType!==f$r.IconPoint||!t.passes.pick||!t.passes.offscreen){if(e$28(this._associateMaterialUrl)&&!this._materialMapReady)return void this._loadMaterialMap(this._associateMaterialUrl);if(this._PBRMaterialParams.loadingTexture&&this._updatePBRMaterial(),_0x37e662(this),this._isNeedUpdate(e,t)){this._style3D._dirty&&(_0x26f9c7(this),this._style3D._dirty=!1),this._style3D.billboardMode===$r$4.FixedXYZ&&(this._isOverlapDisplayed=!0),_0x30ca0f(this,e);var n=t.camera;this._sceneMode=n._mode,this._projection=n._projection,this._picking=t.passes.pick,this._frameState=t,this._backfaceCommands.length=0,this._hasMixedContent=!1;var o,a=i.length;for(l=0,o=this._renderClipPlaneArray.length;l<o;l++){this._renderClipPlaneArray.values[l].update(e,t,i)}if(this._layerScheduler.update(e,t,i),this._shadowDarkness=t.shadowDarkness,this._showIcon&&this._iconCollection.length>0&&this._iconCollection.update(t,e,i),r=u$Y(r,!1),this._showLabel&&!0!==r&&(this._labelCollection.s3MlayerId=this._id,this._labelCollection.update(t,e,i)),this._fileType===f$r.PointCloudFile&&t.passes.render)i.length-a>0&&(this._pointCloudShading.eyeDomeLighting||this._pointCloudShading.performance)&&this._pointCloudEyeDomeLighting.update(t,a,this._pointCloudShading);this._fileType===f$r.ClampGroundRealtimeRasterCache&&(t.rasterLineWidth=this.style3D.lineWidth),_0x1a6060(this,t),this._updateEdgeDistanceFalloffFactor();for(var s=this._excavateRegionCommands.values.length,l=0;l<s;l++){var u=this._excavateRegionCommands.values[l];t.commandList.push(u)}_0x50918e(t,this);var c=this._objsVisibleMap;this._hasObjsVisibleMap=Object.keys(c).length>0,this._hasHeightRangeAttributeName=e$28(this._heightRangeAttributeName)}}},_0x47d916.prototype.postPassesUpdate=function(e){!this.visible||this._layerScheduler.postPassesUpdate(e)};var _0x52f5c=n$14.clone(n$14.IDENTITY),_0x291ef6=new i$10,_0x16a5c0=new y$15,_0x1f4f84=new p$1a,_0x481cba=new p$1a,_0x3a04ba=new t$X;function _0x115b5e(e,t,i){"rotation"===t.type&&(_0x3b9224(t.splines,i,_0x52f5c),p$1a.fromQuaternion(_0x52f5c,_0x481cba),m$1b.headingPitchRollToFixedFrame(e._position,_0x291ef6,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,_0x16a5c0),y$15.getRotation(_0x16a5c0,_0x1f4f84),p$1a.multiply(_0x1f4f84,_0x481cba,_0x1f4f84),y$15.getTranslation(e._matModel,_0x3a04ba),y$15.fromRotationTranslation(_0x1f4f84,_0x3a04ba,e._matModel))}var _0x35aea3=new t$X(1,1,1);function _0x3cc37c(e,t,i){"scale"===t.type&&(_0x3b9224(t.splines,i,_0x35aea3),y$15.setScale(e._matModel,_0x35aea3,e._matModel))}function _0x1b8f1c(e,t,i){"translation"===t.type&&(_0x3b9224(t.splines,i,e._position),y$15.setTranslation(e._matModel,e._position,e._matModel))}var _0x310e1b=new e$25;function _0x50918e(e,t){e$28(e.realtimeRasterSwipeParams)||(e.realtimeRasterSwipeParams={}),_0x310e1b.x=t._swipeRegion.x*e.context.drawingBufferWidth,_0x310e1b.y=(1-t._swipeRegion.y)*e.context.drawingBufferHeight,_0x310e1b.z=t._swipeRegion.z*e.context.drawingBufferWidth,_0x310e1b.w=(1-t._swipeRegion.w)*e.context.drawingBufferHeight,e.realtimeRasterSwipeParams.swipeRegion=_0x310e1b,e.realtimeRasterSwipeParams.swipeEnabled=t._swipeEnabled}var _0x1c1c2e=new e$25;function _0x4a5c3a(e,t){e.updateAllObjsVisible(t.layer,t.isVisible)}function _0x1f4b3c(e,t){e.updateTheme(t.layer)}function _0x438ba1(e,t){e.updateObjsColor(t.ids)}function _0x3067ef(e,t){e.updateObjsTranslate(t.ids)}function _0x46377c(e,t){e.updateExtendHeight(t.ids)}function _0x1552c9(e,t){e.removeExtendHeight(t.ids)}function _0x134b0f(e,t){e.removeAllExtendHeight()}function _0x56dd56(e,t){e.updateObjsOperation(t.ids,t)}function _0x4d02f2(e,t,i){var r=new t$X,n=new t$X;t$X.subtract(t,e,r),t$X.subtract(i,e,n);var o=new t$X;t$X.cross(r,n,o),t$X.normalize(o,o);var a=-t$X.dot(o,e);return new e$25(o.x,o.y,o.z,a)}function _0x2f6a0a(e,t){var i=e._projection,r=i.ellipsoid,n=new t$X,o=new t$W;return r.cartesianToCartographic(t,o),i.project(o,n),t$X.fromElements(n.z,n.x,n.y)}_0x47d916.prototype.render=function(e,t){if(e$28(e)&&e$28(t)){if(t.passes.pick){_0x1c1c2e.x=e._pickPosition[0],_0x1c1c2e.y=e._pickPosition[1],_0x1c1c2e.z=e._pickPosition[2],_0x1c1c2e.w=1;var i=new y$15;y$15.inverse(this._matModel,i),y$15.multiplyByVector(i,_0x1c1c2e,_0x1c1c2e),_0x1c1c2e.z=_0x1c1c2e.z+this.height<0?2:_0x1c1c2e.z+this.height,e$25.clone(_0x1c1c2e,this._pickPosition)}if(this._picking=t.passes.pick,this.updateFlattenFrameBuffer(e,t),this._updateExcavationFrameBuffer(e,t),this.updateHypRegionFrameBuffer(e,t),this.updateOverlayFrameBuffer(e,t),this._clipping){var r=t.camera.inverseViewMatrix,n=new y$15;y$15.transpose(r,n);for(var o=0;o<6;o++)y$15.multiplyByVector(n,this._oriClipPlane[o],this._clipPlane[o])}this._spatialClipEnable&&e$28(this._spatialQuery)&&this._spatialQuery._updateTextures(e,t)}},_0x47d916.prototype.setSelection=function(e,t){if(this._historyCommands.push({func:"setSelection",arguments:[e,t]}),_0x2528fb.S3M!==this._version&&(o$1u.defined("setSelection ids",e),this._selectEnabled&&this._enableHighlight)){if(Array.isArray(e)||(e=[e]),this.multiChoose||this.releaseSelection(),this._lastSelectSkeletonId=u$Y(t,-1),this._fileType===f$r.ClampGroundRealtimeRasterCache)for(var i=0,r=e.length;i<r;i++)this._layerScheduler.refreshRasterById(e[i],this._frameState);this._scene._layers.setSelectedLayer(this),this._selections=this._selections.concat(e),this.setObjectsOperationByID(e,_0xfef200.SELECTED)}},_0x47d916.prototype.getSelection=function(){return[].concat(this._selections)},_0x47d916.prototype.releaseSelection=function(){if(_0x2528fb.S3M!==this._version&&(this._showLabel&&this._labelCollection.releaseSelection(),!(this._selections.length<1))){if(this._fileType===f$r.ClampGroundRealtimeRasterCache)for(var e=0,t=this._selections.length;e<t;e++)this._layerScheduler.refreshRasterById(this._selections[e],this._frameState);this.removeObjectsOperation(this._selections,_0xfef200.SELECTED),this._selections.length=0}},_0x47d916.prototype.setSkeletonSelection=function(e){},_0x47d916.prototype.setRenderSelectionTexBySkeletonId=function(e){var t={};t.layer=this,t.enable=e,this.traverseRenderEntity(t,_0xcf9623)},_0x47d916.prototype.setObjsColor=function(e,t){if(this._historyCommands.push({func:"setObjsColor",arguments:[e,t]}),_0x2528fb.S3M!==this._version&&this._fileType!==f$r.ClampObjectPolygon){o$1u.defined("setObjsColor ids",e),o$1u.defined("setObjsColor color",t),o$1u.typeOf.object("setObjsColor color",t),Array.isArray(e)||(e=[e]);for(var i={},r=0,n=e.length;r<n;r++){var o=e[r]+"";!e$28(o)||(this._objsColorList[o]=t,i[o]=t)}this.updateObjsColor(i)}},_0x47d916.prototype.getObjsColor=function(e){if(!e$28(e))throw new Error("id is required");return _0x2528fb.S3M===this._version?null:this._objsColorList[e]},_0x47d916.prototype.removeObjsColor=function(e){o$1u.defined("removeObjsColor ids",e),Array.isArray(e)||(e=[e]);for(var t={},i=0,r=e.length;i<r;i++){var n=e[i];e$28(this._objsColorList[n])&&(t[n]=e$1S.TRANSPARENT,delete this._objsColorList[n])}this.removeObjectsOperation(e,_0xfef200.SetColor),this.updateObjsColor(t)},_0x47d916.prototype.removeAllObjsColor=function(){if(!(Object.keys(this._objsColorList).length<1)){var e={};for(var t in this._objsColorList)this._objsColorList.hasOwnProperty(t)&&(e[t]=e$1S.TRANSPARENT);this._objsColorList={},this.updateObjsColor(e)}},_0x47d916.prototype.setObjsExtendHeight=function(e,t){if(_0x2528fb.S3M!=this._version&&e$28(this._objsHeightList)){o$1u.defined("setObjsExtendHeight ids",e),o$1u.defined("setObjsExtendHeight height",t),Array.isArray(e)||(e=[e]);for(var i=new e$1P,r=0,n=e.length;r<n;r++){var o=e[r];this._objsHeightList.set(o,t),i.set(o,t)}this.updateExtendHeight(i)}},_0x47d916.prototype.removeAllObjsExtendHeight=function(){!e$28(this._objsHeightList)||(this._objsHeightList.removeAll(),this.removeAllExtendHeight())},_0x47d916.prototype.removeObjsExtendHeight=function(e){if(e$28(this._objsHeightList)){o$1u.defined("removeObjsExtendHeight ids",e),Array.isArray(e)||(e=[e]);for(var t=0,i=e.length;t<i;t++){var r=e[t];this._objsHeightList.remove(r)}this.removeExtendHeight(e)}},_0x47d916.prototype.setOnlyObjsVisible=function(e,t,i,r){if(this._historyCommands.push({func:"setOnlyObjsVisible",arguments:[e,t,i,r]}),i=u$Y(i,!0),r=u$Y(r,!1),_0x2528fb.S3M===this._version)return null;o$1u.defined("setOnlyObjsVisible ids",e),o$1u.typeOf.bool("setOnlyObjsVisible isVisible",t),Array.isArray(e)||(e=[e]);var n=this._objsVisibleList,o=this._objsHideList,a=this._objsVisibleMap;if(0!==e.length)t?(e.map((function(e){n.set(e,!0),o.remove(e),i&&(a[e]=!0)})),this.removeObjectsOperation(e,_0xfef200.HIDE)):(e.map((function(e){n.remove(e),o.set(e,!0),i&&(a[e]=!1)})),this.setObjectsOperationByID(e,_0xfef200.HIDE));else{if(i){this._allObjsHide=t,this._objsVisibleList.removeAll();var s=Object.keys(this._objsHideList._hash);return this.removeObjectsOperation(s,_0xfef200.HIDE),this._objsHideList.removeAll(),this.updateAllObjsVisible(!t),this._objsVisibleMap={},void(this._objsVisibleMap._allObjsHide=t)}if(t)this._allObjsHide=t,this._objsVisibleList.removeAll(),this._objsHideList.removeAll(),r&&this.updateAllObjsVisible(!t);else{if(a._allObjsHide)return;if(r){let e=Object.keys(this._objsHideList._hash).filter((e=>!1!==a[e]));return void this.removeObjectsOperation(e,_0xfef200.HIDE)}let e=Object.keys(a).filter((e=>a[e]));this.removeObjectsOperation(e,_0xfef200.HIDE)}}},_0x47d916.prototype.setObjsVisible=function(e,t,i){this._historyCommands.push({func:"setObjsVisible",arguments:[e,t,i]}),0!==e.length?(this.setOnlyObjsVisible([],t,i),this.setOnlyObjsVisible(e,t,i)):this.setOnlyObjsVisible([],t,i)},_0x47d916.prototype.setPointCloudGroupsVisible=function(e,t){if(this._fileType===f$r.PointCloudFile&&e$28(this._pointCloudLayerVisible)){o$1u.defined("setPointCloudGroupsVisible groupNames",e),o$1u.typeOf.bool("setPointCloudGroupsVisible isVisible",t),Array.isArray(e)||(e=[e]);for(var i=0,r=e.length;i<r;i++)this._pointCloudLayerVisible.hasOwnProperty(e[i])&&(this._pointCloudLayerVisible[e[i]]=t)}},_0x47d916.prototype.getPointCloudGroupInfos=function(){if(this._fileType!==f$r.PointCloudFile)return[];if(!e$28(this._pointCloudLayerVisible))return[];var e=[];for(var t in this._pointCloudLayerVisible)this._pointCloudLayerVisible.hasOwnProperty(t)&&e.push(t);return e},_0x47d916.prototype.getPointCloudGroupBounds=function(e){if(this._fileType===f$r.PointCloudFile&&e$28(this._groupNameBounds))return this._groupNameBounds.get(e)},_0x47d916.prototype.getObjsVisible=function(e){if(!this.visible)return!1;if(_0x2528fb.S3M===this._version)return!0;var t=this._objsColorList[e],i=!0;return e$28(t)&&(i&=t.alpha),i},_0x47d916.prototype.setObjsOffset=function(e){if(this._historyCommands.push({func:"setObjsOffset",arguments:[e]}),e$28(this._layerScheduler._extrudedId))if(Array.isArray(e))for(var t=0;t<e.length;t++)this._polygonsTranslate[e[t]]=t$X.clone(this._selectedTranslate);else this._polygonsTranslate[e]=t$X.clone(this._selectedTranslate);else this._boundingSphereOffset=t$X.clone(this._selectedTranslate),this.setObjectsOperationByID(e,_0xfef200.OFFSET)},_0x47d916.prototype.setObjsTranslate=function(e,t){if(_0x2528fb.S3M!==this._version){o$1u.defined("setObjsTranslate ids",e),o$1u.defined("setObjsTranslate translate",t),o$1u.typeOf.object("setObjsTranslate translate",t),Array.isArray(e)||(e=[e]);for(var i={},r=0,n=e.length;r<n;r++){var o=e[r];!e$28(o)||(this._objsOffsetList[o]=t,i[o]=t)}Object.keys(i).length>0&&(this.traverseRenderEntity({ids:i},_0x3067ef),this.setObjectsOperationByID(e,_0xfef200.OFFSET))}},_0x47d916.prototype.setBatchObjsTranslate=function(e){_0x2528fb.S3M!==this._version&&(o$1u.defined("setObjsTranslate option",e),Object.getPrototypeOf(e)===Object.prototype&&(Object.assign(this._objsOffsetList,e),Object.keys(e).length>0&&(this.traverseRenderEntity({ids:e},_0x3067ef),this.setObjectsOperationByID(Object.keys(e),_0xfef200.OFFSET))))},_0x47d916.prototype.removeObjsTranslate=function(e){o$1u.defined("removeObjsTranslate ids",e),Array.isArray(e)||(e=[e]);for(var t={},i=0,r=e.length;i<r;i++){var n=e[i];e$28(this._objsOffsetList[n])&&(delete this._objsOffsetList[n],t[n]=t$X.ZERO)}this.removeObjectsOperation(e,_0xfef200.OFFSET),Object.keys(t).length>0&&this.traverseRenderEntity({ids:t},_0x3067ef)},_0x47d916.prototype.removeAllObjsTranslate=function(){var e={};for(var t in this._objsOffsetList)this._objsOffsetList.hasOwnProperty(t)&&(e[t]=t$X.ZERO);this.traverseRenderEntity({ids:e},_0x3067ef),this._objsOffsetList={}},_0x47d916.prototype.removeObjsOffset=function(e){this.removeObjectsOperation(e,_0xfef200.OFFSET)},_0x47d916.prototype.removeAllObjsOffset=function(){this._boundingSphereOffset=t$X.ZERO,this.removeAllObjectsOperation(_0xfef200.OFFSET)},_0x47d916.prototype.setObjectsOperationByID=function(e,t){if(_0x2528fb.S3M!==this._version){o$1u.defined("set Objs Operation ids",e),o$1u.defined("set Objs Operation operationType",t),Array.isArray(e)||(e=[e]),t===_0xfef200.CLIP&&(this._operationType&_0xfef200.CLIP)===_0xfef200.RESET&&(this._operationType|=t,this.traverseRenderEntity({layer:this,enable:!0},_0x5e84ed));for(var i,r=new e$1P,n=0,o=e.length;n<o;n++)if(e$28(i=e[n])){var a=u$Y(this._objsOperationList[i],0);a!==t&&(a|=t,this._objsOperationList[i]=a,r.set(i,a))}r.length>0&&this.updateObjsOperation(r._hash)}},_0x47d916.prototype.removeObjectsOperation=function(e,t){if(_0x2528fb.S3M!==this._version){o$1u.defined("set Objs Operation ids",e),Array.isArray(e)||(e=[e]);for(var i,r=_0xfef200.ALL^t,n=new e$1P,o=0,a=e.length;o<a;o++){i=e[o];var s=this._objsOperationList[i];!e$28(s)||((s&=r)===_0xfef200.RESET?delete this._objsOperationList[i]:this._objsOperationList[i]=s,n.set(i,s))}n.length>0&&this.updateObjsOperation(n._hash)}},_0x47d916.prototype.removeAllObjectsOperation=function(e){if(_0x2528fb.S3M!==this._version&&!(Object.keys(this._objsOperationList).length<1)){var t=_0xfef200.ALL^e,i=new e$1P,r=this._objsOperationList;for(var n in r)if(r.hasOwnProperty(n)){var o=this._objsOperationList[n];if(!e$28(o))continue;(o&=t)===_0xfef200.RESET?delete this._objsOperationList[n]:this._objsOperationList[n]=o,i.set(n,o)}i.length>0&&this.updateObjsOperation(i._hash)}},_0x47d916.prototype.setCategoriesVisible=function(e,t){o$1u.defined("set Categories Visible",e),Array.isArray(e)||(e=[e]);var i=this._hypMaxCategory,r=this._hypMinCategory,n=256,o=Math.max(Math.ceil((i-r)/n),1);e$28(this._categorieTexture)||(this._categorieTexture=new L$17({context:this._context,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,width:n,height:o,flipY:!1,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),this.traverseRenderEntity({layer:this},_0x17e83d));var a=new Uint8Array(n*o*4);if(t!==_0x58b6ee.ResetAll){var s,l,u;if(t===_0x58b6ee.Hide)for(s=0,l=e.length;s<l;s++)u=e[s],this._categoryHideList.set(u,u);else for(s=0,l=e.length;s<l;s++)u=e[s],this._categoryHideList.contains(u)&&this._categoryHideList.remove(u);for(s=0;s<this._categoryHideList.values.length;s++){var c=(u=this._categoryHideList.values[s])-r;a[4*c]=255,a[4*c+1]=255,a[4*c+2]=255,a[4*c+3]=255}this._categorieTexture.copyFrom({width:n,height:o,arrayBufferView:a})}else this._categorieTexture.copyFrom({width:n,height:o,arrayBufferView:a})},_0x47d916.prototype.addFlattenRegion=function(e){var t=e.name,i=e.position;if(!e$28(t)||!e$28(i))return!1;if(e$28(this._flattenRegions.get(t)))return!1;e$28(this._flattenTexture)||(this._flattenTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA,pixelDatatype:this._context.floatingPointTexture?y$U.FLOAT:void 0}));var r=this._createRasterRegion(i),n=t$X.fromDegreesArrayHeights(i),o=i$19.fromPoints(n,new i$19);if(r.boundingSphere=o,this._flattenRegions.set(t,r),this._flattenUpdate=!0,1===this._flattenRegions.values.length){var a={};a.layer=this,a.boundingSphere=o,this.traverseRenderEntity(a,_0x321baa)}return!0},_0x47d916.prototype.removeFlattenRegion=function(e){if(!this._flattenRegions.remove(e))return!1;if(this._flattenUpdate=!0,0===this._flattenRegions.values.length){var t={};t.layer=this,this.traverseRenderEntity(t,_0x45a9a7)}return!0},_0x47d916.prototype.removeAllFlattenRegion=function(){for(var e=0;e<this._flattenRegions.values.length;e++)this._flattenRegions.values[e].destroy(),this._flattenRegions.values[e]=null;this._flattenRegions.removeAll(),this._flattenUpdate=!0;var t={};t.layer=this,this.traverseRenderEntity(t,_0x45a9a7)},_0x47d916.prototype.addOverlayImage=function(e){var t=(e=u$Y(e,{})).name,i=e.bounds,r=e.image;if(!e$28(t)||!e$28(i)||!e$28(e.image))return!1;var n=this._overlayRegions.get(t);if(e$28(n))return!1;e$28(this._overlayTexture)||(this._overlayTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA}));var o=new L$17({context:this._context,width:r.width,height:r.height,pixelFormat:V$O.RGBA,source:r});if(this._overlayTextures.set(t,o),n=this._createRasterBounds(i),this._overlayRegions.set(t,n),this._overlayUpdate=!0,1===this._overlayRegions.values.length){var a={};a.layer=this,this.traverseRenderEntity(a,_0x361e47)}return!0},_0x47d916.prototype.removeOverlayImage=function(e){if(!e$28(e))return!1;if(!e$28(this._overlayRegions.get(e)))return!1;if(this._overlayTextures.remove(e),this._overlayRegions.remove(e),this._overlayUpdate=!0,1===this._overlayRegions.values.length){var t={};t.layer=this,this.traverseRenderEntity(t,_0x361e47)}return!0},_0x47d916.prototype.setModifyRegions=function(e,t){if(this._historyCommands.push({func:"setModifyRegions",arguments:[e,t]}),this.clearModifyRegions(),t==Ge$8.CLIP_INSIDE||t==Ge$8.CLIP_OUTSIDE)for(var i=e.length,r=0;r<i;r++){var n={position:e[r],name:"modify_"+r};this.addExcavationRegion(n)}this._excavationMode=t},_0x47d916.prototype._setServerClipRegions=function(e,t){for(var i=0,r=e.length;i<r;i++){var n={position:e[i],name:"server_clipregion_"+i};this._addServerExcavationRegion(n)}this._serverExcavationMode=u$Y(t,Ge$8.CLIP_OUTSIDE)},_0x47d916.prototype.setClipRegions=function(e){if(!(e instanceof Array))throw new t$Z("regions must be a georegion3d array");var t=this._baseUri.toString();new t$S(a={url:t.substring(0,t.indexOf("/data/path"))+"/config",method:"POST",data:JSON.stringify({clipRegions:e})})._makeRequest({method:"POST",data:a.data});for(var i=0;i<e.length;i++){for(var r=[],n=e[i],o=0;o<n.points.length;o++)r.push(n.points[o].x),r.push(n.points[o].y),r.push(n.points[o].z);var a={position:r,name:"server_clipregion_x"+i};this._addServerExcavationRegion(a)}},_0x47d916.prototype.clearModifyRegions=function(){for(var e=Object.keys(this._excavationRegions._hash),t=0,i=e.length;t<i;t++){var r=e[t];r.startsWith("modify_")&&this.removeExcavationRegion(r)}},_0x47d916.prototype.addExcavationRegion=function(e){var t=e.name,i=e.position,r=e.height;if(e$28(t)||o$1u.typeOf.string("options.name",t),e$28(i)||o$1u.typeOf.string("options.position",i),e$28(this._excavationRegions.get(t)))return!1;e$28(this._excavationTexture)||(this._excavationTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA}));var n=this._createRasterRegion(i,r,e$28(r));if(n.name=t,this._excavationRegions.set(t,n),this._excavationUpdate=!0,this._hasExcavation=!0,1===this._excavationRegions.values.length){var o={};o.layer=this,this.traverseRenderEntity(o,_0x22ce4b)}return!0},_0x47d916.prototype._addServerExcavationRegion=function(e){var t=e.name,i=e.position,r=e.height;if(e$28(t)||o$1u.typeOf.string("options.name",t),e$28(i)||o$1u.typeOf.string("options.position",i),e$28(this._serverExcavationRegions.get(t)))return!1;e$28(this._excavationTexture)||(this._excavationTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA}));var n=this._createRasterRegion(i,r,e$28(r));if(n.name=t,this._serverExcavationRegions.set(t,n),this._excavationUpdate=!0,this._hasServerExcavation=!0,1===this._serverExcavationRegions.values.length){var o={};o.layer=this,this.traverseRenderEntity(o,_0x24c751)}return!0},_0x47d916.prototype.removeExcavationRegion=function(e){var t=this._excavationRegions.get(e);if(!this._excavationRegions.remove(e))return!1;if(t.destroy(),this._removeExcavationCommands(e),this._excavationUpdate=!0,0===this._excavationRegions.values.length){var i={};i.layer=this,this.traverseRenderEntity(i,_0x295ee4)}return!0},_0x47d916.prototype._removeServerExcavationRegion=function(e){var t=this._serverExcavationRegions.get(e);if(!this._serverExcavationRegions.remove(e))return!1;if(t.destroy(),this._removeExcavationCommands(e),this._excavationUpdate=!0,0===this._serverExcavationRegions.values.length){var i={};i.layer=this,this.traverseRenderEntity(i,_0x4e3b7c)}return!0},_0x47d916.prototype._removeExcavationCommands=function(e){var t=this._excavateRegionCommands.get(e+"side"),i=this._excavateRegionCommands.get(e+"bottom");t&&(t.vertexArray=t.vertexArray&&!t.vertexArray.isDestroyed()&&t.vertexArray.destroy()),i&&(i.vertexArray=i.vertexArray&&!i.vertexArray.isDestroyed()&&i.vertexArray.destroy()),this._excavateRegionCommands.remove(e+"side"),this._excavateRegionCommands.remove(e+"bottom")},_0x47d916.prototype.removeAllExcavationRegion=function(){for(var e=Object.keys(this._excavationRegions._hash),t=0,i=e.length;t<i;t++){var r=e[t];this.removeExcavationRegion(r)}this._excavationRegions.removeAll()},_0x47d916.prototype._createRasterRegion=function(e,t,i){var r=t$X.fromDegreesArrayHeights(e);if(this._sceneMode!==P$$.SCENE3D)for(var n=0;n<r.length;n++)r[n]=_0x2f6a0a(this,r[n]);var o=new U$Q({polygonHierarchy:{positions:r},perPositionHeight:!0}),a=U$Q.createGeometry(o),s=new y$15;y$15.inverse(this._matModel,s),f$X.updateGeometry(a,e,s);var l=new f$X;if(l._geometry=a,l._bounds=f$X.updateGeoBounds(a),i){l.worldGeometry=U$Q.createGeometry(o),l.colorGeometry=U$Q.createGeometry(o);var u=t$X.fromDegrees(e[0],e[1],0),c=new i$10(0,0,0);l._excavateMatrix=m$1b.headingPitchRollToFixedFrame(u,c,t$V.WGS84),l.modelMatrix=y$15.fromTranslation(new t$X(e[0],e[1],0),new y$15);for(var h=Number.MAX_VALUE,d=(n=0,e.length);n<d;n+=3)h=Math.min(h,e[n+2]);l.height=h-t,l.rectangle=h$10.fromCartesianArray(r),l.positions=e}return l},_0x47d916.prototype._createRasterBounds=function(e){var t=new j$N({rectangle:e}),i=j$N.createGeometry(t),r=new y$15;if(y$15.inverse(this._matModel,r),this._sceneMode===P$$.COLUMBUS_VIEW)for(var n=0;n<i.attributes.position.values.length;n+=i.attributes.position.componentsPerAttribute){var o=new t$X(i.attributes.position.values[n],i.attributes.position.values[n+1],i.attributes.position.values[n+2]),a=t$W.fromCartesian(o),s=new t$X;this._projection.project(a,s),i.attributes.position.values[n]=s.z,i.attributes.position.values[n+1]=s.x,i.attributes.position.values[n+2]=s.y}f$X.updateGeometry(i,void 0,r);var l=new f$X;return l._geometry=i,l._bounds=f$X.updateGeoBounds(i),l},_0x47d916.prototype._computeLayerModelBounds=function(){var e=new t$X.fromRadians(this._layerBounds.west,this._layerBounds.south,0),t=new t$X.fromRadians(this._layerBounds.west,this._layerBounds.north,0),i=new t$X.fromRadians(this._layerBounds.east,this._layerBounds.south,0),r=new t$X.fromRadians(this._layerBounds.east,this._layerBounds.north,0),n=[];n.push(e),n.push(t),n.push(i),n.push(r);var o=new y$15;y$15.inverse(this._matModel,o),this._layerModelBounds=new e$25(Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var a=0;a<4;a++)y$15.multiplyByPoint(o,n[a],n[a]),this._layerModelBounds.x=Math.min(n[a].x,this._layerModelBounds.x),this._layerModelBounds.y=Math.min(n[a].y,this._layerModelBounds.y),this._layerModelBounds.z=Math.max(n[a].x,this._layerModelBounds.z),this._layerModelBounds.w=Math.max(n[a].y,this._layerModelBounds.w)},_0x47d916.prototype._combineRegionBounds=function(e){for(var t=new e$25(Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),i=0;i<e.length;i++){var r=e[i]._bounds;t.x=Math.min(r.x,t.x),t.y=Math.min(r.y,t.y),t.z=Math.max(r.z,t.z),t.w=Math.max(r.w,t.w)}return t},_0x47d916.prototype.createRasterRegionDrawCommand=function(e,t,i,r){if(e$28(t)&&!e$28(t._command)){var n=new r$15({primitiveType:W$_.TRIANGLES});t._command=n;var o={position:0};n.vertexArray=m$19.fromGeometry({context:e,geometry:t._geometry,attributeLocations:o,bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var a=new a$$({sources:[_0x5e5993]});r==_0xb9525f.Altitude?(a.defines.push("Mode_Height"),i.pixelDatatype===y$U.FLOAT&&a.defines.push("UseFloatTexture"),n.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:_0xc1bb56,fragmentShaderSource:a,attributeLocations:o})):r==_0xb9525f.Texture?(a.defines.push("OVERLAY"),n.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:_0x252df4,fragmentShaderSource:a,attributeLocations:o})):n.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:_0x2a32b0,fragmentShaderSource:a,attributeLocations:o}),n.framebuffer=new a$z({context:e,colorTextures:[i],destroyAttachments:!1}),n.renderState=u$R.fromCache({viewport:new f$10(0,0,this._flattenTextureWidth,this._flattenTextureWidth)})}},_0x47d916.prototype.updateHypRegionFrameBuffer=function(e,t){if(this._hypsometricRegionUpdate){if(!e$28(this._hypsometricRegion))return void(this._bUseHypRegion=!1);this._bUseHypRegion=!0,this._hypsometricRegionUpdate=!1;var i=new r$11({color:new e$1S(0,0,0,0),depth:1});i.framebuffer=new a$z({context:e,colorTextures:[this._hypsometricRenderTexture],destroyAttachments:!1}),i.renderState=u$R.fromCache(),i.execute(e),this.createRasterRegionDrawCommand(e,this._hypsometricRegion,this._hypsometricRenderTexture,_0xb9525f.Color);var r=this;this._hypsometricRegion._command.uniformMap={uRect:function(){return r._hypsometricBound}},this._hypsometricRegion._command.execute(e),i.framebuffer.destroy()}},_0x47d916.prototype.updateFlattenFrameBuffer=function(e,t){if(this._flattenUpdate){this._flattening=!0,this._flattenUpdate=!1,this._flattenBounds=this._combineRegionBounds(this._flattenRegions.values);var i=new r$11({color:new e$1S(0,0,0,0),depth:1});e$28(this._flattenTexture)||(this._flattenTexture=new L$17({context:this._context,width:this._flattenTextureWidth,height:this._flattenTextureWidth,pixelFormat:V$O.RGBA,pixelDatatype:this._context.floatingPointTexture?y$U.FLOAT:void 0})),i.framebuffer=new a$z({context:e,colorTextures:[this._flattenTexture],destroyAttachments:!1}),i.renderState=u$R.fromCache(),i.execute(e);var r=this._flattenRegions.values.length;r<1&&(this._flattening=!1);for(var n=0;n<r;n++){var o=this._flattenRegions.values[n];this.createRasterRegionDrawCommand(e,o,this._flattenTexture,_0xb9525f.Altitude);var a=this;o._command.uniformMap={uRect:function(){return a._flattenBounds}},o._command.execute(e)}i.framebuffer.destroy()}},_0x47d916.prototype.updateOverlayFrameBuffer=function(e,t){if(this._overlayUpdate){this._overlayUpdate=!1,this._overlayBounds=this._combineRegionBounds(this._overlayRegions.values),this._hasOverlay=this._overlayRegions.length>0;var i=new r$11({color:new e$1S(1,1,1,1),depth:1});i.framebuffer=new a$z({context:e,colorTextures:[this._overlayTexture],destroyAttachments:!1}),i.renderState=u$R.fromCache(),i.execute(e);for(var r=this._overlayRegions.values.length,n=0;n<r;n++){var o=this._overlayRegions.values[n],a=this._overlayTextures.values[n];this.createRasterRegionDrawCommand(e,o,this._overlayTexture,_0xb9525f.Texture),o._command.uniformMap=s(this._overlayBounds,a,o._bounds),o._command.execute(e)}i.framebuffer.destroy()}function s(e,t,i){return{uRect:function(){return e},uTexture:function(){return t},uSingleRegion:function(){return i}}}},_0x47d916.prototype._updateExcavationFrameBuffer=function(e,t){if(this._excavationUpdate){for(var i in t._framebufferList)i.indexOf("_excavationHeightLayer")>-1&&!e$28(this._excavationRegions.get(i.slice(22)))&&(t._framebufferList[i]=!t._framebufferList[i].isDestroyed()&&t._framebufferList[i].destroy(),delete t._framebufferList[i]);var r=this._excavationRegions.values.length;this._hasExcavation=r>0,this._excavationUpdate=!1,this._excavationBounds=this._combineRegionBounds(this._excavationRegions.values);var n=this._serverExcavationRegions.values.length;if(this._hasServerExcavation=n>0,this._serverExcavationBounds=this._combineRegionBounds(this._serverExcavationRegions.values),0!=r||0!=n){var o=new r$11({color:new e$1S(0,0,0,0),depth:1});o.framebuffer=new a$z({context:e,colorTextures:[this._excavationTexture],destroyAttachments:!1}),o.renderState=u$R.fromCache(),o.execute(e),S$k.createExcavationSideTexture(t,this),S$k.createExcavationBottomTexture(t,this);for(var a=0;a<r;a++){var s=this._excavationRegions.values[a];this.createRasterRegionDrawCommand(e,s,this._excavationTexture,_0xb9525f.Color),e$28(s.height)&&(S$k._createExcavationSideCommand(t,this,s),S$k._createExcavationBottomCommand(t,this,s));var l=this;s._command.uniformMap={uRect:function(){return l._excavationBounds}},s._command.execute(e)}for(var u=0;u<n;u++){s=this._serverExcavationRegions.values[u];this.createRasterRegionDrawCommand(e,s,this._excavationTexture,_0xb9525f.Color),e$28(s.height)&&(S$k._createExcavationSideCommand(t,this,s),S$k._createExcavationBottomCommand(t,this,s));l=this;s._command.uniformMap={uRect:function(){return l._serverExcavationBounds}},s._command.execute(e)}o.framebuffer.destroy()}}},_0x47d916.prototype.updateAllObjsVisible=function(e){this.traverseRenderEntity({layer:this,isVisible:e},_0x4a5c3a)},_0x47d916.prototype.updateObjsTheme=function(){var e={layer:this};this.traverseRenderEntity(e,_0x1f4b3c)},_0x47d916.prototype.updateObjsColor=function(e){var t={ids:e};this.traverseRenderEntity(t,_0x438ba1)},_0x47d916.prototype.updateExtendHeight=function(e){var t={ids:e};this.traverseRenderEntity(t,_0x46377c)},_0x47d916.prototype.removeExtendHeight=function(e){var t={ids:e};this.traverseRenderEntity(t,_0x1552c9)},_0x47d916.prototype.removeAllExtendHeight=function(){this.traverseRenderEntity({},_0x134b0f)},_0x47d916.prototype.updateObjsOperation=function(e){var t={ids:e,offset:Math.max(Math.abs(this.selectedTranslate.x),Math.abs(this.selectedTranslate.y),Math.abs(this.selectedTranslate.z))};this.traverseRenderEntity(t,_0x56dd56)},_0x47d916.prototype.refresh=function(){this._layerScheduler.refresh(),this.initialize()},_0x47d916.prototype.refreshVolume=function(){this._refreshVolume=!0},_0x47d916.prototype.clearCustomClipBox=function(){this.isRenderClipSection()&&this._context.numClampClipPlaneLayer--;for(var e=0,t=this._renderClipPlaneArray.values.length;e<t;e++)this._renderClipPlaneArray.values[e].destroy(),this._renderClipPlaneArray.values[e]=null;this._renderClipPlaneArray.removeAll(),this._clipping=!1,this._section=!1;var i={layer:this,enable:!1};this.traverseRenderEntity(i,_0x21b530)};var _0x3a8e02=new t$W;function _0x297b1a(e){return e===V$i.KeepOutside?j$l.Disjoint:j$l.Intersects}function _0x47c886(e,t){let i=e._layerScheduler._rootEntities;for(let e=0,r=i.length;e<r;e++){let r=i[e]._attributes[t];if(e$28(r))return r}}function _0x25bf53(e,t){e.lightSourceChanged(t)}function _0x5d95ad(e,t){e.updateShadow(t.layer)}function _0x21b530(e,t){e.setCustomClipBox(t.layer,t.enable)}function _0x17c547(e,t){e.enableAdjustColor(t)}function _0x22ce4b(e,t){e.enableExcavation(t)}function _0x295ee4(e,t){e.disableExcavation(t)}function _0x24c751(e,t){e.enableServerExcavation(t)}function _0x4e3b7c(e,t){e.disableServerExcavation(t)}function _0x321baa(e,t){e.enableFlatten(t)}function _0x361e47(e,t){e.enableOverlay(t)}function _0x5b512f(e,t){e.enableAjustTransparentBackColor(t)}function _0x34e580(e,t){e.disableAjustTransparentBackColor(t)}function _0x45a9a7(e,t){e.disableFlatten(t)}function _0x53da50(e,t){e.enableHypsometric(t)}function _0x586985(e,t){e.disableHypsometric(t)}function _0x849afa(e,t){e.hasLightChange(t)}function _0xcf9623(e,t){e.skeletonSelectEnable(t)}function _0x3eaa50(e,t){e.selectColorTypeChange(t)}function _0x1368e8(e,t){e.mixColorTypeChange(t)}function _0x3f4395(e,t){e.splitDirectionChange(t)}function _0x2a43b8(e,t){e.swipeStateChange(t)}function _0xcbba6(e,t){e.PBRMaterialTypeChange(t)}function _0x17e83d(e,t){e.enableCategoryVisible(t)}function _0x53e3cb(e,t){e.emissionTextureChange(t)}function _0x2446a5(e,t){e.enableTextureMove(t)}function _0x14c364(e,t){e.enableTriangleFiltrate(t)}function _0x5e84ed(e,t){e.enableClipFilt(t)}function _0xa0bb8(e,t){e.enableFusionChange(t)}function _0x52dbe9(e,t){e.enableFlood(t)}function _0x12ea5c(e,t){e.disableFlood(t)}function _0x1f07dc(e){for(var t=1;t<e;)t<<=1;return t}function _0x442bc7(e,t){e.emissionTextureUnitChange(t)}function _0x41facf(e,t){var i=y$15.multiply(e._geoMatrix,t.scaleMatrix,new y$15);y$15.multiply(t.layerMatrix,i,e._matModel)}function _0x16a0a2(e,t){e.pbrParameterChange(t)}function _0x87ff23(e,t){e.edgeWireFrameModeChange(t)}function _0x4a0002(e,t){var i=t,r=i._PBRMaterialParams.baseUri;i._PBRMaterialParams=e.material,i._PBRMaterialParams.baseUri=r,i._loadMaterialTexture(i._PBRMaterialParams,r);var n=i._PBRMaterialParams.pbrMetallicRoughness,o=i._PBRMaterialParams.textureunitstates;if(e$28(n.volume)&&(i._PBRMaterialParams.pbrMetallicRoughness.volume={thickness:1,tintColor:e$25.fromElements(1,1,1,1),diffusionDistance:e$25.fromElements(1,1,1,1),transmissionFactor:1}),e$28(n.clearcoat)&&(i._PBRMaterialParams.pbrMetallicRoughness.clearcoat={clearcoatFactor:0,clearcoatRoughnessFactor:0}),e$28(n.snowEffect)&&-1!==n.snowEffect.snowNormalTextureIndex){var a=r+o[n.snowEffect.snowNormalTextureIndex].textureunitstate.url;i._PBRMaterialParams.pendingTextureCount++,_0x33e201(i._context,a,i._PBRMaterialParams,i._PBRMaterialParams.pbrMetallicRoughness.snowEffect,"snowNormalTexture")}if(e$28(n.snowEffect)&&-1!==n.snowEffect.snowMaskTextureIndex){a=r+o[n.snowEffect.snowMaskTextureIndex].textureunitstate.url;i._PBRMaterialParams.pendingTextureCount++,_0x33e201(i._context,a,i._PBRMaterialParams,i._PBRMaterialParams.pbrMetallicRoughness.snowEffect,"snowMaskTexture")}if(e$28(n.rainEffect)&&-1!==n.rainEffect.rippleTextureIndex){a=r+o[n.rainEffect.rippleTextureIndex].textureunitstate.url;i._PBRMaterialParams.pendingTextureCount++,_0x33e201(i._context,a,i._PBRMaterialParams,i._PBRMaterialParams.pbrMetallicRoughness.rainEffect,"rippleTexture")}}_0x47d916.prototype.setCustomClipBox=function(e){if(!((e=e||{}).dimensions&&e.position||e.planePos&&e.planeNormal))throw new t$Z("dimensions position is required to create CustomClipBox");if(this._clipMode=_0x252611.CLIP_BEHIND_ALL_PLANE,e$28(e.clipMode))switch(e.clipMode){case"clip_behind_any_plane":this._clipMode=_0x252611.CLIP_BEHIND_ANY_PLANE;break;case"clip_behind_all_plane":this._clipMode=_0x252611.CLIP_BEHIND_ALL_PLANE;break;case"only_keep_line":this._clipMode=_0x252611.ONLY_KEEP_LINE}if(e.dimensions){var t=new y$15,i=e.position,r=new i$10(e.heading||0,e.pitch||0,e.roll||0);t=m$1b.headingPitchRollToFixedFrame(i,r,t$V.WGS84);var n=.5*e.dimensions.x,o=.5*e.dimensions.y,a=.5*e.dimensions.z,s=[];s[0]=new e$25,s[0].x=-n,s[0].y=o,s[0].z=a,s[0].w=1,s[1]=new e$25,s[1].x=n,s[1].y=o,s[1].z=a,s[1].w=1,s[2]=new e$25,s[2].x=n,s[2].y=-o,s[2].z=a,s[2].w=1,s[3]=new e$25,s[3].x=-n,s[3].y=-o,s[3].z=a,s[3].w=1,s[4]=new e$25,s[4].x=-n,s[4].y=o,s[4].z=-a,s[4].w=1,s[5]=new e$25,s[5].x=n,s[5].y=o,s[5].z=-a,s[5].w=1,s[6]=new e$25,s[6].x=n,s[6].y=-o,s[6].z=-a,s[6].w=1,s[7]=new e$25,s[7].x=-n,s[7].y=-o,s[7].z=-a,s[7].w=1;for(var l=0;l<8;l++)y$15.multiplyByVector(t,s[l],s[l]);if(this._sceneMode!==P$$.SCENE3D){var u=new n$1b;for(l=0;l<8;l++){var c=s[l],h=t$W.fromCartesian(c,void 0,_0x3a8e02),d=u.project(h,s[l]);y$15.multiplyByPoint(_0x5e0ddd,d,s[l])}}this._oriClipPlane[0]=e$25.clone(_0x4d02f2(s[0],s[1],s[2])),this._oriClipPlane[1]=e$25.clone(_0x4d02f2(s[0],s[4],s[1])),this._oriClipPlane[2]=e$25.clone(_0x4d02f2(s[0],s[3],s[4])),this._oriClipPlane[3]=e$25.clone(_0x4d02f2(s[6],s[2],s[5])),this._oriClipPlane[4]=e$25.clone(_0x4d02f2(s[6],s[7],s[2])),this._oriClipPlane[5]=e$25.clone(_0x4d02f2(s[6],s[5],s[7]))}else for(l=0;l<e.planePos.length;l++){var f=e.planePos[l],p=e.planeNormal[l];this._oriClipPlane[l].x=p.x,this._oriClipPlane[l].y=p.y,this._oriClipPlane[l].z=p.z,this._oriClipPlane[l].w=-t$X.dot(f,p)}if(!this._clipping){e={layer:this,enable:!0};this.traverseRenderEntity(e,_0x21b530)}this._clipping=!0},_0x47d916.prototype.setClipSection=function(e,t,i,r){var n=u$Y(r,_0x3f3b8b.NONE);if(this._clipPlaneMode!==n&&(n!==_0x3f3b8b.NONE?this._context.numClampClipPlaneLayer++:this._context.numClampClipPlaneLayer--),this._clipPlaneMode=n,this.isRenderClipSection()){var o=this._renderClipPlaneArray.get(0);e$28(o)||(o=new _0x5077e8(this),this._renderClipPlaneArray.set(0,o)),o.setPoints(e,t,i),this._section||this._context.numClampClipPlaneLayer++}},_0x47d916.prototype.setCustomClipPlane=function(e,t,i,r){if(this._sceneMode===P$$.COLUMBUS_VIEW&&(e=_0x2f6a0a(this,e),t=_0x2f6a0a(this,t),i=_0x2f6a0a(this,i)),this.setClipSection(e,t,i,r),this._oriClipPlane[0]=_0x4d02f2(e,t,i),this._clipMode=_0x252611.CLIP_BEHIND_ALL_PLANE,this._section=!0,!this._clipping){var n={layer:this,enable:!0};this.traverseRenderEntity(n,_0x21b530)}this._clipping=!0},_0x47d916.prototype.setCustomClipGeometry=function(e){var t=(e=e||{}).geometry;this._spatialClipEnable=!0;var i=e.spatialQuery,r=e.clippingType;i.geometry=t,i.positionMode=_0x297b1a(r),i._profile=!0,i._clipLayers.set(this.name,this),this._sqMode=i.positionMode,this._spatialQuery=i,this._clippingType=r},_0x47d916.prototype.clearCustomClipGeometry=function(){this._spatialClipEnable=!1},_0x47d916.prototype.setCustomClipCross=function(e){if(!(e=e||{}).dimensions||!e.position)throw new t$Z("dimensions position is required to create CustomClipBox");this._clipMode=_0x252611.CLIP_BEHIND_ALL_PLANE;var t,i,r,n=new y$15,o=e.position;t=e.heading||0,i=e.pitch||0,r=e.roll||0;var a,s,l,u=u$Y(e.extrudeDistance,.1),c=new i$10(e$27.toRadians(t),e$27.toRadians(i),e$27.toRadians(r));if(this._sceneMode===P$$.SCENE3D)n=m$1b.headingPitchRollToFixedFrame(o,c,t$V.WGS84);else{var h=_0x2f6a0a(this,o);y$15.setTranslation(y$15.clone(y$15.IDENTITY),h,n);var d=p$1a.fromHeadingPitchRoll(c);y$15.multiplyByMatrix3(n,d,n)}a=.5*e.dimensions.x,s=.5*e.dimensions.y,l=u;var f=[];f[0]=new e$25,f[0].x=-a,f[0].y=s,f[0].z=l,f[0].w=1,f[1]=new e$25,f[1].x=a,f[1].y=s,f[1].z=l,f[1].w=1,f[2]=new e$25,f[2].x=a,f[2].y=-s,f[2].z=l,f[2].w=1,f[3]=new e$25,f[3].x=-a,f[3].y=-s,f[3].z=l,f[3].w=1,f[4]=new e$25,f[4].x=-a,f[4].y=s,f[4].z=-l,f[4].w=1,f[5]=new e$25,f[5].x=a,f[5].y=s,f[5].z=-l,f[5].w=1,f[6]=new e$25,f[6].x=a,f[6].y=-s,f[6].z=-l,f[6].w=1,f[7]=new e$25,f[7].x=-a,f[7].y=-s,f[7].z=-l,f[7].w=1;for(var p=0;p<8;p++)y$15.multiplyByVector(n,f[p],f[p]);this._oriClipPlane[0]=new e$25(0,0,0,0),this._oriClipPlane[1]=e$25.clone(_0x4d02f2(f[0],f[4],f[1])),this._oriClipPlane[2]=e$25.clone(_0x4d02f2(f[0],f[3],f[4])),this._oriClipPlane[3]=e$25.clone(_0x4d02f2(f[6],f[2],f[5])),this._oriClipPlane[4]=e$25.clone(_0x4d02f2(f[6],f[7],f[2])),this._oriClipPlane[5]=e$25.clone(_0x4d02f2(f[6],f[5],f[7])),this._clipping||this.traverseRenderEntity({layer:this,enable:!0},_0x21b530),this._clipping=!0},_0x47d916.prototype.getClipRegion=function(){if(this._clipping){var e=o$1i.fromCartesian4(this._oriClipPlane[0]),t=this._layerBounds;if(e$28(t)){var i=h$10.southwest(t),r=h$10.northwest(t),n=h$10.northeast(t),o=h$10.southeast(t);i=t$X.fromRadians(i.longitude,i.latitude,i.height),r=t$X.fromRadians(r.longitude,r.latitude,r.height),n=t$X.fromRadians(n.longitude,n.latitude,n.height),o=t$X.fromRadians(o.longitude,o.latitude,o.height);var a=new t$X(0,0,0),s=t$X.normalize(i,new t$X),l=t$X.normalize(r,new t$X),u=t$X.normalize(n,new t$X),c=t$X.normalize(o,new t$X),h=new f$18(a,s),d=new f$18(a,l),f=new f$18(a,u),p=new f$18(a,c),_=g$10.rayPlane(h,e),m=g$10.rayPlane(d,e),$=g$10.rayPlane(f,e),g=g$10.rayPlane(p,e);if(e$28(_)&&e$28(m)&&e$28($)&&e$28(g))return{polygon:{hierarchy:[_,m,$,g],material:e$1S.WHITE.withAlpha(.5),perPositionHeight:!0}}}}},_0x47d916.prototype.addWaterPlane=function(e){if(!(e=e||{}).boundingVolume)throw new t$Z("position radius distance is required to add the plane");var t=this._waterPlanes.length;return this._waterPlanes.set(t,e),t},_0x47d916.prototype.removeWaterPlane=function(e){this._waterPlanes.remove(e)},_0x47d916.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},_0x47d916.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~3");return 1<<e&this._visibleViewport},_0x47d916.prototype.setFlattenRegionVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._flattenVisibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},_0x47d916.prototype.updateShadow=function(){var e={layer:this};this.traverseRenderEntity(e,_0x5d95ad)},_0x47d916.prototype.isSilhouette=function(){return this._selectColorType===Ya$1.SILHOUETTE||this._selectColorType===Ya$1.ALWAYS_SHOW_SILHOUETTE},_0x47d916.prototype.isRenderClipSection=function(){return this._clipPlaneMode!==_0x3f3b8b.NONE},_0x47d916.prototype.bloomEnableChange=function(e){e?this._context.numPostEffectFilterObject++:this._context.numPostEffectFilterObject--},_0x47d916.prototype.lightSourceChanged=function(e){this.traverseRenderEntity({changedList:e,layer:this},_0x25bf53)},_0x47d916.prototype.getAttributesById=function(e){if(0===(e=parseInt(e))||void 0===e)throw new t$Z("id must be a number!");this.hasQueryAttrAction=!0;let t=this.queryAttrDeferred;e$28(t)||(t=this.queryAttrDeferred=o$1q.defer()),this.curQueryId=e;let i=_0x47c886(this,e);return e$28(i)?t.resolve(i):t.promise},_0x47d916.prototype.traverseRenderEntity=function(e,t){this._layerScheduler.traverseRenderEntity(e,t)},_0x47d916.prototype.isDestroyed=function(){return!1},_0x47d916.prototype.destroy=function(){this.residentRootTile=!1,this.clearMemoryImmediately=!0,e$28(this._layerScheduler)&&(this._layerScheduler.destroy(),this._layerScheduler=null);for(var e=0;e<this._flattenRegions.values.length;e++)this._flattenRegions.values[e].destroy(),this._flattenRegions.values[e]=null;this._flattenRegions.removeAll(),delete this._flattenBounds,this._flattenBounds=null,e$28(this._flattenTexture)&&(this._flattenTexture.destroy(),this._flattenTexture=null);for(var t=Object.keys(this._excavationRegions._hash),i=(e=0,t.length);e<i;e++){var r=t[e];this._excavationRegions.get(r).destroy(),this._removeExcavationCommands(r)}if(this._excavationRegions.removeAll(),delete this._excavationBounds,this._excavationBounds=null,e$28(this._excavationTexture)&&(this._excavationTexture.destroy(),this._excavationTexture=null),e$28(this._excavationSideTexture)&&(this._excavationSideTexture.destroy(),this._excavationSideTexture=null),e$28(this._excavationBottomTexture)&&(this._excavationBottomTexture.destroy(),this._excavationBottomTexture=null),e$28(this._hypsometricTexture)&&(this._hypsometricTexture.destroy(),this._hypsometricTexture=null),e$28(this._hypsometricRenderTexture)&&(this._hypsometricRenderTexture.destroy(),this._hypsometricRenderTexture=null),e$28(this._hypsometricSetting)&&(this._hypsometricSetting.destroy(),this._hypsometricSetting=null),e$28(this._hypsometricRegion)&&(this._hypsometricRegion.destroy(),this._hypsometricRegion=null),e$28(this._noiseMapTexture)&&(this._noiseMapTexture.destroy(),this._noiseMapTexture=null),e$28(this._pbrMetalTexture)&&(this._pbrMetalTexture.destroy(),this._pbrMetalTexture=null),e$28(this._pbrRoughTexture)&&(this._pbrRoughTexture.destroy(),this._pbrRoughTexture=null),this._fileType===f$r.ClampGroundRealtimeRasterCache&&this.refreshRaster(),e$28(this._spatialQuery)&&e$28(this._spatialQuery._clipLayers)&&this._spatialQuery._clipLayers.remove(this.name),e$28(this._commonLayerUniformBuffer)&&(this._commonLayerUniformBuffer.destroy(),this._commonLayerUniformBuffer=null),e$28(this._materialMap))for(var n in this._materialMap)if(this._materialMap.hasOwnProperty(n)){var o=this._materialMap[n].material.pbrMetallicRoughness;if(!e$28(o))continue;e$28(o.baseColorTexture)&&o.baseColorTexture.destroy(),e$28(o.normalTexture)&&o.normalTexture.destroy(),e$28(o.emissiveTexture)&&o.emissiveTexture.destroy(),e$28(o.metallicRoughnessTexture)&&o.metallicRoughnessTexture.destroy(),e$28(o.occlusionTexture)&&o.occlusionTexture.destroy()}if(e$28(this._spatialQuery)&&e$28(this._spatialQuery._clipLayers)&&this._spatialQuery._clipLayers.remove(this.name),e$28(this.instanceSkeletonManager)){for(var n in this.instanceSkeletonManager.skeletons._hash)this.instanceSkeletonManager.skeletons._hash.hasOwnProperty(n)&&this.instanceSkeletonManager.remove(n);this.instanceSkeletonManager=void 0}return i$Z(this)},_0x47d916.prototype.setVolume=function(e){if(!(e$28(e.values)&&e$28(e.width)&&e$28(e.height)&&e$28(e.depth)&&e$28(e.maxValue)&&e$28(e.minValue)&&e$28(e.maxHeight)&&e$28(e.minHeight)&&e$28(e.bounds)))throw new t$Z("invalid volume object");this._volData={};var t=e.width,i=e.height,r=e.depth,n=Math.ceil(Math.sqrt(r));this._volData._nSideBlockCount=n;var o=Math.max(t,i)+2;this._volData._nBlockLength=o;var a=_0x1f07dc(o*n-2);this._volData._nLength=a;var s=e.maxValue,l=e.minValue;this._volData._maxValue=s,this._volData._minValue=l,this._volData._width=t,this._volData._height=i,this._volData._depth=r;var u=e.bounds.leftBottom.x,c=e.bounds.rightTop.y,h=e.bounds.rightTop.x,d=e.bounds.leftBottom.y;this._volData._volBounds={left:u,top:c,right:h,bottom:d,minHeight:e.minHeight,maxHeight:e.maxHeight,width:h-u,length:c-d,height:e.maxHeight-e.minHeight};var f=a*a,p=new Array(f);p.fill(-1);for(var _=s-l,m=0;m<r;m++)for(var $=parseInt(m/n)*o,g=m%n*o,v=0;v<o-2;v++)for(var y=0;y<o-2;y++){var x=Math.min(y,t-1),b=m*i*t+(i-1-Math.min(v,i-1))*t+x,w=e.values[b];new e$25(0,0,0,0),-9999!=w&&(w=(w-l)/_,p[b=($+v)*a+g+y]=w)}var C=new Float32Array(p,0,f);this._volData._buffer=new Uint8Array(C.buffer,0,4*f),this._fMaxValue=s,this._fMinValue=l},_0x47d916.prototype._setSQTextures=function(e){this._sqTextures=e},_0x47d916.prototype._setSQViewPrjMatrix=function(e,t){this._sqViewMatirx=e,this._sqPrjMatirx=t},_0x47d916.prototype._setSQMode=function(e){this._sqMode=e},_0x47d916.prototype._updateEdgeDistanceFalloffFactor=function(){0!=this._edgeCurrentCount?(this._edgeDistanceFalloffFactor=this._edgeCurrentTotalLength/this._edgeCurrentCount*40,this._edgeCurrentTotalLength=0,this._edgeCurrentCount=0):this._edgeCurrentTotalLength=0},_0x47d916.prototype._addRenderedEdge=function(e,t){this._edgeCurrentTotalLength+=e,this._edgeCurrentCount+=t},_0x47d916.prototype.setTextureEmissive=function(e){if(e!==this.textureEmissionUnit){this.textureEmissionUnit=e;var t={enable:!0};t.layer=this,this.traverseRenderEntity(t,_0x442bc7)}},_0x47d916.prototype.setPBRMaterial=function(e){LicenseChecker.LICENSECHECKER.verify("S3MTilesLayer_setPBRMaterial");var t=this._pbrParameter;if(this._pbrParameter|=e,t!==this._pbrParameter){var i={enable:!0};i.layer=this,this.traverseRenderEntity(i,_0x16a0a2)}},_0x47d916.prototype.setPBRMaterialFromJSON=function(e){if(LicenseChecker.LICENSECHECKER.verify("S3MTilesLayer_setPBRMaterial"),this._pbrParameter===je$b.NONE){var t=this,i="string"==typeof e;t._PBRMaterialParams.baseUri=i?i$18(e):"",i?u$O(e).then((function(e){_0x4a0002(e,t)})):_0x4a0002(e,t)}},_0x47d916.prototype._updatePBRMaterial=function(){if(e$28(this._PBRMaterialParams)&&e$28(this._PBRMaterialParams.pendingTextureCount)&&this._PBRMaterialParams.pendingTextureCount===this._PBRMaterialParams.readyTextureCount){var e={enable:!0};e.layer=this,this.traverseRenderEntity(e,_0x16a0a2),this._PBRMaterialParams.loadingTexture=!1}},_0x47d916.prototype.removePBRMaterial=function(){var e=this._PBRMaterialParams.pbrMetallicRoughness;for(var t in e)e.hasOwnProperty(t)&&e[t]instanceof L$17&&e[t].destroy();this._PBRMaterialParams={pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:0,baseColor:new e$25(1,1,1,1),baseColorTextureIndex:-1,emissiveFactor:t$X.ZERO,emissiveTextureIndex:-1,occlusionTextureIndex:-1,metallicRoughnessTextureIndex:-1,normalTextureIndex:-1,normalTexture:void 0,baseColorTexture:void 0,intensityScale:1,snowEffect:void 0,rainEffect:void 0,volume:void 0,clearcoat:void 0,anisotropy:void 0},loadingTexture:void 0};var i={enable:!0};i.layer=this,this.traverseRenderEntity(i,_0x16a0a2)},_0x47d916.prototype.setExtrudedPolygons=function(e,t){this._layerScheduler._extrudedId=e,this._layerScheduler._polygons=t},_0x47d916.prototype._initEdgeTexture=function(){var e=[1,256,65536,16777216];function t(t,i,r){var n,o,a,s;r=u$Y(r,0),n=t,o=0,a=1,t=Math.min(Math.max(n,o),a);for(var l=0;l<4;l++)i[r+l]=Math.floor(256*((s=t*e[l])-Math.floor(s)))}const i=8,r=256,n=[{distance:[-1.59027,-1.59426,-1.59674,-1.59766,-1.59702,-1.59479,-1.59095,-1.5855,-1.57843,-1.56973,-1.55942,-1.5475,-1.53398,-1.5189,-1.50226,-1.4841,-1.46446,-1.44337,-1.42088,-1.39703,-1.37188,-1.34547,-1.31786,-1.28912,-1.2593,-1.22847,-1.19668,-1.16402,-1.13053,-1.09629,-1.06137,-1.02582,-.98972,-.95313,-.91611,-.87872,-.84102,-.80306,-.76488,-.72654,-.68807,-.64952,-.61092,-.57232,-.53375,-.49527,-.45692,-.41874,-.38078,-.34309,-.3057,-.26867,-.23204,-.19585,-.16015,-.12497,-.09036,-.05634,-.02296,.00977,.04183,.07321,.10389,.13386,.16313,.19169,.21956,.24672,.27321,.299,.32413,.34858,.37237,.3955,.41798,.43981,.461,.48154,.50145,.52073,.53939,.55744,.57488,.5917,.6079,.62347,.63837,.65259,.66609,.67885,.69083,.70201,.71235,.72183,.73042,.73812,.7449,.75076,.7557,.75973,.76284,.76507,.76642,.76692,.76659,.76545,.76352,.76083,.7574,.75324,.74837,.74279,.73652,.72959,.72199,.71377,.70493,.69553,.68558,.67515,.66426,.65298,.64135,.62944,.6173,.60499,.59257,.58008,.56759,.55513,.54275,.5305,.51842,.50654,.4949,.48353,.47246,.4617,.45128,.44121,.43149,.42213,.41313,.40448,.39617,.38818,.3805,.37309,.36594,.35902,.35229,.34572,.33927,.33292,.32663,.32035,.31407,.30774,.30135,.29486,.28824,.28148,.27454,.26739,.26002,.25241,.24454,.23639,.22796,.21922,.21016,.20076,.19098,.18082,.17023,.1592,.14768,.13566,.1231,.10996,.09624,.08188,.06688,.05121,.03485,.01778,0,-.0185,-.03771,-.05763,-.07824,-.09952,-.12144,-.14396,-.16706,-.19069,-.21481,-.23938,-.26436,-.28971,-.31539,-.34136,-.36759,-.39404,-.42067,-.44746,-.47437,-.50136,-.52839,-.55544,-.58248,-.60948,-.63642,-.66329,-.6901,-.71684,-.74352,-.77015,-.79675,-.82332,-.84988,-.87644,-.90301,-.92958,-.95615,-.98272,-1.00926,-1.03575,-1.06217,-1.08847,-1.11463,-1.1406,-1.16633,-1.19178,-1.2169,-1.24164,-1.26595,-1.28979,-1.31312,-1.3359,-1.35809,-1.37963,-1.4005,-1.42064,-1.44,-1.45853,-1.47616,-1.49285,-1.50853,-1.52313,-1.53659,-1.54886,-1.55986,-1.56955,-1.57788,-1.5848],pressure:[-.01365,-.00206,.01025,.02327,.03696,.05129,.06619,.08163,.09755,.11393,.1307,.14784,.16531,.18308,.20111,.21938,.23786,.25651,.2753,.29419,.31315,.33215,.35115,.37015,.38913,.40806,.42694,.44576,.46449,.48313,.50167,.5201,.53839,.55653,.57448,.59222,.60971,.62692,.6438,.66033,.67648,.69221,.70753,.72242,.73688,.75093,.76456,.77779,.79063,.80309,.81517,.82686,.83817,.84911,.85967,.86987,.87972,.88924,.89845,.90734,.91594,.92425,.93229,.94005,.94754,.95475,.96166,.96826,.97451,.9804,.98588,.99092,.99549,.99957,.99685,.99381,.99131,.98936,.98796,.98711,.98681,.98706,.98787,.98923,.99113,.99357,.99654,1,.99607,.99171,.98695,.98181,.97634,.97057,.96452,.95824,.95175,.94506,.93818,.93113,.92389,.91647,.90887,.90109,.89314,.88501,.87672,.86831,.85978,.85119,.84256,.83393,.82533,.8168,.80836,.80002,.79181,.78374,.77582,.7681,.76059,.75331,.74629,.73955,.73311,.72697,.72116,.71568,.71054,.70572,.70121,.697,.69304,.68931,.68576,.68236,.67905,.67582,.67262,.66941,.66619,.66291,.65957,.65613,.65259,.64892,.6451,.6411,.6369,.63248,.62783,.62295,.61783,.61247,.60688,.60104,.59498,.58868,.58216,.57542,.56845,.56125,.5538,.5461,.53813,.52986,.52129,.51239,.50316,.49359,.4837,.47349,.46299,.45223,.44124,.43005,.41869,.40719,.39557,.38386,.37207,.36023,.34836,.33648,.32464,.31287,.30119,.28963,.27822,.26698,.25594,.2451,.23448,.22409,.21391,.20394,.19415,.18452,.17503,.16565,.15636,.14713,.13794,.1288,.11968,.11058,.10151,.09247,.08346,.07447,.06552,.05659,.0477,.03885,.03007,.02137,.01278,.00433,-.00393,-.012,-.01983,-.02738,-.03463,-.04155,-.0481,-.05429,-.0601,-.06553,-.07057,-.07524,-.07954,-.08347,-.08703,-.09022,-.09303,-.09544,-.09744,-.09898,-.10004,-.10059,-.1006,-.10005,-.09892,-.0972,-.09487,-.09192,-.08833,-.08409,-.07918,-.07357,-.06724,-.06019,-.0524,-.04386,-.03455,-.02448]},{distance:[-3.46259,-3.47131,-3.47668,-3.47863,-3.47712,-3.4721,-3.46352,-3.45138,-3.43566,-3.41635,-3.39347,-3.36704,-3.33709,-3.30368,-3.26684,-3.22667,-3.18322,-3.1366,-3.08689,-3.0342,-2.97865,-2.92036,-2.85946,-2.79607,-2.73034,-2.66241,-2.59242,-2.52052,-2.44686,-2.37159,-2.29485,-2.2168,-2.13757,-2.05731,-1.97616,-1.89426,-1.81174,-1.72875,-1.64543,-1.56191,-1.47833,-1.39483,-1.3115,-1.22847,-1.14581,-1.06361,-.98193,-.90083,-.82036,-.74054,-.66141,-.583,-.50532,-.4284,-.35228,-.277,-.20261,-.12916,-.05672,.01463,.08485,.15384,.22153,.28784,.35269,.41602,.47776,.53787,.59629,.653,.70799,.76123,.81274,.86253,.9106,.95698,1.0017,1.04477,1.0862,1.126,1.16415,1.20065,1.23546,1.26857,1.29994,1.32953,1.35731,1.38321,1.40719,1.42921,1.44922,1.46719,1.48309,1.49691,1.50862,1.51825,1.52581,1.53133,1.53486,1.53644,1.53616,1.53409,1.53031,1.52493,1.51803,1.50972,1.50009,1.48924,1.47725,1.46421,1.45019,1.43527,1.4195,1.40295,1.38568,1.36778,1.34929,1.3303,1.31087,1.29108,1.27099,1.25066,1.23018,1.2096,1.18898,1.16838,1.14785,1.12745,1.10721,1.08719,1.06741,1.04791,1.02871,1.00986,.99136,.97324,.95551,.93819,.92127,.90476,.88866,.87296,.85767,.84277,.82823,.81406,.80022,.7867,.77346,.76049,.74774,.73519,.72278,.71049,.69827,.68606,.67381,.66145,.64893,.63618,.62313,.60973,.5959,.5816,.56675,.5513,.53516,.51826,.50053,.4819,.46231,.44169,.42002,.39725,.37336,.34834,.32219,.2949,.2665,.23698,.20638,.17469,.14193,.10809,.07316,.03714,0,-.03827,-.07772,-.11836,-.16022,-.20332,-.24768,-.29332,-.34024,-.38844,-.43788,-.48854,-.54036,-.59329,-.64724,-.70211,-.75782,-.81425,-.87128,-.92881,-.98674,-1.04498,-1.10346,-1.1621,-1.22086,-1.27969,-1.33854,-1.3974,-1.45625,-1.51511,-1.57396,-1.63283,-1.69173,-1.75067,-1.80968,-1.86875,-1.9279,-1.98712,-2.04639,-2.10568,-2.16495,-2.22416,-2.28322,-2.34208,-2.40063,-2.4588,-2.51647,-2.57354,-2.62989,-2.68543,-2.74002,-2.79357,-2.84597,-2.89711,-2.94689,-2.99521,-3.04195,-3.087,-3.13023,-3.17152,-3.21075,-3.24779,-3.28252,-3.3148,-3.34451,-3.37154,-3.39577,-3.41709,-3.43539,-3.45059],pressure:[.87183,.87151,.87129,.87118,.87117,.87128,.87149,.87182,.87225,.8728,.87347,.87424,.87513,.87613,.87723,.87845,.87978,.88122,.88276,.88441,.88616,.88801,.88996,.892,.89414,.89637,.89868,.90108,.90356,.90611,.90874,.91144,.91421,.91704,.91993,.92287,.92587,.92892,.93201,.93514,.93831,.94151,.94474,.94799,.95126,.95456,.95786,.96118,.9645,.96783,.97116,.97448,.9778,.98111,.98441,.9877,.99096,.99421,.99742,.99938,.99622,.9931,.99001,.98697,.98397,.98101,.97811,.97526,.97246,.96972,.96703,.96441,.96185,.95935,.95691,.95455,.95225,.95002,.94786,.94577,.94376,.94182,.93995,.93817,.93646,.93483,.93328,.93181,.93042,.92911,.92788,.92673,.92566,.92467,.92376,.92293,.92217,.92149,.92088,.92034,.91987,.91947,.91913,.91886,.91864,.91849,.91838,.91833,.91834,.91839,.91849,.91863,.91883,.91907,.91935,.91968,.92005,.92046,.92092,.92142,.92195,.92253,.92314,.9238,.92449,.92521,.92598,.92677,.9276,.92847,.92936,.93029,.93125,.93224,.93325,.9343,.93537,.93646,.93758,.93872,.93988,.94106,.94225,.94346,.94469,.94593,.94718,.94844,.94971,.95098,.95226,.95354,.95482,.9561,.95738,.95867,.95995,.96122,.9625,.96377,.96504,.9663,.96757,.96883,.97009,.97135,.97261,.97387,.97513,.9764,.97767,.97895,.98023,.98153,.98284,.98416,.98549,.98684,.98821,.9896,.99101,.99244,.99389,.99537,.99688,.99842,1,.99839,.99675,.99508,.99336,.99161,.98982,.98799,.98613,.98422,.98228,.98029,.97827,.97622,.97414,.97202,.96987,.9677,.96551,.9633,.96107,.95882,.95656,.9543,.95202,.94975,.94747,.94519,.94292,.94065,.93838,.93613,.93388,.93164,.92941,.9272,.92499,.9228,.92062,.91846,.91631,.91418,.91207,.90998,.90792,.90588,.90387,.90189,.89995,.89804,.89617,.89434,.89256,.89083,.88914,.88752,.88595,.88443,.88299,.88161,.8803,.87907,.87791,.87683,.87584,.87494,.87412,.8734,.87278,.87225]},{distance:[.39335,.43437,.47737,.52234,.56923,.61801,.66864,.72109,.7753,.83123,.88882,.94801,1.00875,1.07097,1.13461,1.1996,1.26586,1.33333,1.40193,1.47158,1.54221,1.61373,1.68607,1.75913,1.83284,1.90711,1.98186,2.05699,2.13243,2.20809,2.28387,2.35971,2.4355,2.51117,2.58663,2.66179,2.73658,2.81092,2.88473,2.95792,3.03043,3.10217,3.17308,3.24309,3.31211,3.3801,3.44697,3.51267,3.57712,3.64028,3.70208,3.76247,3.8214,3.87881,3.93467,3.98892,4.04152,4.09244,4.14164,4.18908,4.23474,4.27859,4.32061,4.36077,4.39905,4.43544,4.46992,4.50249,4.53314,4.56185,4.58864,4.61349,4.63642,4.65745,4.67657,4.69381,4.7092,4.72274,4.73447,4.74441,4.75259,4.75903,4.76376,4.76682,4.76822,4.768,4.76618,4.76279,4.75786,4.75142,4.74348,4.73409,4.72326,4.71102,4.69739,4.68241,4.6661,4.64849,4.6296,4.60948,4.58816,4.56567,4.54204,4.51732,4.49154,4.46473,4.43694,4.4082,4.37854,4.348,4.31662,4.28443,4.25145,4.21773,4.1833,4.14819,4.11243,4.07606,4.03912,4.00162,3.96361,3.92512,3.88618,3.84683,3.80708,3.76697,3.72653,3.68579,3.64478,3.60351,3.56202,3.52033,3.47845,3.43642,3.39425,3.35196,3.30957,3.2671,3.22455,3.18196,3.13933,3.09668,3.05402,3.01136,2.96873,2.92613,2.88357,2.84108,2.79865,2.75631,2.71407,2.67195,2.62994,2.58807,2.54634,2.50477,2.46338,2.42216,2.38114,2.34032,2.29971,2.25933,2.21916,2.17923,2.13954,2.10008,2.06087,2.02189,1.98316,1.94468,1.90644,1.86845,1.83069,1.79316,1.75586,1.71877,1.68189,1.6452,1.60868,1.57232,1.53611,1.50004,1.46407,1.4282,1.39241,1.35668,1.321,1.28535,1.24972,1.2141,1.17849,1.14286,1.10723,1.07158,1.03593,1.00028,.96464,.92902,.89344,.85793,.8225,.78719,.75203,.71705,.68231,.64784,.61369,.57991,.54656,.51368,.48134,.44959,.41849,.3881,.35848,.32967,.30174,.27474,.24872,.22373,.19982,.17702,.15539,.13497,.11579,.09791,.08137,.06621,.05248,.04022,.02948,.02029,.01271,.00677,.00252,0,-76e-5,27e-5,.00314,.00788,.01451,.02307,.03357,.04604,.0605,.07697,.09546,.11599,.13858,.16322,.18992,.21869,.24952,.28241,.31735,.35434],pressure:[.95248,.95236,.95228,.95223,.95222,.95224,.95231,.95241,.95256,.95274,.95296,.95322,.95352,.95385,.95423,.95465,.9551,.9556,.95613,.9567,.95731,.95796,.95864,.95936,.96012,.96091,.96173,.96259,.96348,.9644,.96535,.96633,.96734,.96838,.96944,.97053,.97164,.97277,.97393,.9751,.97629,.9775,.97873,.97997,.98122,.98249,.98376,.98505,.98634,.98763,.98893,.99023,.99154,.99284,.99414,.99544,.99673,.99802,.9993,.99942,.99816,.99691,.99568,.99445,.99324,.99205,.99087,.98972,.98858,.98746,.98636,.98528,.98423,.9832,.98219,.98121,.98025,.97931,.9784,.97752,.97666,.97582,.97501,.97423,.97347,.97274,.97203,.97135,.9707,.97007,.96948,.9689,.96836,.96784,.96735,.96689,.96646,.96605,.96567,.96533,.965,.96471,.96445,.96421,.964,.96382,.96367,.96355,.96346,.96339,.96335,.96334,.96336,.9634,.96348,.96358,.9637,.96385,.96403,.96423,.96446,.96471,.96499,.96529,.96561,.96595,.96631,.96669,.96709,.96751,.96795,.9684,.96887,.96935,.96984,.97035,.97087,.9714,.97194,.97249,.97304,.97361,.97418,.97476,.97534,.97592,.97651,.97711,.9777,.9783,.9789,.9795,.9801,.9807,.9813,.9819,.9825,.98309,.98369,.98428,.98486,.98545,.98603,.98661,.98718,.98775,.98832,.98888,.98944,.99,.99056,.99112,.99167,.99223,.99279,.99335,.99392,.99449,.99507,.99565,.99624,.99684,.99745,.99807,.9987,.99934,1,.99933,.99866,.99797,.99727,.99656,.99583,.9951,.99435,.99359,.99283,.99205,.99126,.99046,.98966,.98885,.98803,.9872,.98637,.98554,.9847,.98387,.98303,.98219,.98134,.9805,.97967,.97883,.978,.97717,.97634,.97552,.97471,.97389,.97309,.97229,.9715,.97071,.96993,.96915,.96838,.96762,.96687,.96612,.96539,.96466,.96395,.96324,.96255,.96187,.9612,.96055,.95991,.95929,.95869,.95811,.95754,.957,.95648,.95599,.95552,.95508,.95467,.95428,.95393,.9536,.95331,.95305,.95283,.95264]},{distance:[2.85606,2.86149,2.86432,2.8645,2.862,2.85686,2.84912,2.83886,2.82618,2.81117,2.79393,2.77456,2.75314,2.72975,2.70447,2.67734,2.64844,2.61784,2.58564,2.55196,2.5169,2.48057,2.44305,2.40438,2.36462,2.32383,2.28208,2.23943,2.19591,2.15153,2.10628,2.06016,2.01321,1.96548,1.91702,1.86793,1.8183,1.76829,1.71803,1.66767,1.61737,1.56726,1.51746,1.46803,1.41902,1.37044,1.32228,1.27452,1.22716,1.18023,1.13376,1.08781,1.04244,.99769,.95357,.91003,.86701,.82447,.78238,.74069,.69938,.65836,.61758,.57699,.53656,.49627,.45611,.41611,.37632,.33683,.29776,.25924,.22141,.18441,.14839,.11346,.07972,.04727,.01619,-.01348,-.0417,-.0684,-.09351,-.11698,-.13875,-.1588,-.17713,-.19381,-.20889,-.22242,-.23444,-.24501,-.25421,-.26216,-.26897,-.27473,-.27951,-.28336,-.28631,-.28836,-.28948,-.28963,-.28873,-.28673,-.28355,-.27916,-.27354,-.26673,-.25878,-.2498,-.23992,-.22929,-.21802,-.20623,-.19398,-.18134,-.16836,-.1551,-.14163,-.12809,-.11461,-.1013,-.08826,-.07557,-.06335,-.0517,-.04077,-.03065,-.02143,-.01321,-.00606,0,.00496,.00888,.01181,.01385,.01511,.0157,.01574,.01533,.01458,.01358,.0124,.01112,.00979,.00851,.00738,.0065,.006,.00596,.00646,.00754,.00924,.01161,.01471,.01858,.02323,.02865,.03481,.04169,.0493,.05765,.06677,.07671,.08754,.09934,.11222,.12628,.14159,.15823,.17624,.19561,.21632,.23828,.26142,.28563,.31083,.33696,.36397,.39185,.42057,.4501,.48036,.51125,.54264,.5744,.60646,.63871,.67105,.70337,.73556,.76751,.79918,.83048,.86139,.8919,.92202,.95184,.98144,1.01094,1.04045,1.0701,1.10002,1.13029,1.16103,1.1923,1.22416,1.25664,1.28979,1.32364,1.35824,1.39363,1.42985,1.4669,1.50475,1.54332,1.58252,1.62227,1.6625,1.70312,1.744,1.78501,1.82598,1.8668,1.90734,1.94754,1.98732,2.02666,2.06555,2.10402,2.1421,2.17985,2.2173,2.25448,2.29139,2.328,2.36424,2.4,2.43515,2.46955,2.50309,2.53565,2.56717,2.59761,2.62692,2.65505,2.68191,2.7074,2.73138,2.75375,2.7744,2.79324,2.81017,2.82504,2.83772,2.8481],pressure:[.22758,.23641,.24578,.25568,.26609,.27699,.28835,.30016,.31237,.32495,.33789,.35113,.36466,.37843,.39241,.40658,.4209,.43535,.44989,.4645,.47916,.49385,.50853,.5232,.53784,.55243,.56696,.58141,.59578,.61004,.62419,.63821,.65209,.6658,.67934,.69268,.70582,.71873,.73139,.7438,.75594,.76779,.77935,.79061,.80156,.81221,.82254,.83258,.84231,.85176,.86091,.86978,.87837,.88669,.89473,.9025,.91,.91725,.92425,.931,.93752,.9438,.94985,.95566,.96124,.96658,.97168,.97652,.98109,.98539,.98939,.99309,.99646,.99949,.99783,.99552,.99361,.99209,.99098,.99029,.99003,.99019,.99079,.99181,.99324,.9951,.99735,1,.99698,.99361,.98992,.98592,.98163,.97709,.97231,.96731,.96212,.95676,.95122,.94554,.93973,.93378,.92773,.92157,.91532,.90899,.90258,.89612,.88961,.88308,.87653,.87,.8635,.85705,.85068,.8444,.83823,.83219,.82628,.82052,.81493,.80952,.8043,.79929,.7945,.78994,.78561,.78151,.77765,.77402,.77062,.76742,.76443,.76161,.75896,.75645,.75406,.75175,.74951,.7473,.74511,.74289,.74064,.73833,.73592,.73341,.73078,.728,.72507,.72197,.71869,.71522,.71156,.70769,.70363,.69936,.69489,.69021,.68533,.68023,.67492,.66939,.66363,.65765,.65145,.64501,.63833,.63143,.62428,.61691,.60931,.60148,.59344,.58521,.57679,.5682,.55948,.55063,.54167,.53264,.52354,.51439,.50522,.49603,.48686,.47773,.46865,.45964,.45072,.44192,.43324,.42469,.41629,.40804,.39994,.392,.3842,.37655,.36903,.36164,.35437,.3472,.34012,.33312,.3262,.31933,.31251,.30574,.299,.2923,.28563,.27899,.27239,.26583,.25933,.25288,.24652,.24025,.2341,.22808,.22221,.21653,.21104,.20576,.20072,.19592,.19138,.18712,.18313,.17943,.17602,.17292,.17013,.16766,.16551,.16369,.16222,.1611,.16036,.16001,.16007,.16055,.16148,.16286,.16471,.16705,.16988,.17321,.17706,.18144,.18636,.19182,.19785,.20443,.21158,.2193]},{distance:[-2.31317,-2.3191,-2.32189,-2.32154,-2.31811,-2.31174,-2.30254,-2.29062,-2.27609,-2.25904,-2.23954,-2.21767,-2.19355,-2.16732,-2.13907,-2.10885,-2.07672,-2.04268,-2.00677,-1.96911,-1.92985,-1.88914,-1.84713,-1.80397,-1.75979,-1.71467,-1.66864,-1.62171,-1.57395,-1.52546,-1.47625,-1.42628,-1.3755,-1.32384,-1.27131,-1.218,-1.16408,-1.10972,-1.05508,-1.00031,-.94551,-.89077,-.83615,-.7817,-.72757,-.6739,-.62076,-.56821,-.51625,-.46484,-.41397,-.36366,-.314,-.26506,-.21689,-.16957,-.12316,-.07766,-.03301,.01085,.05399,.09643,.13827,.17967,.22079,.26176,.30265,.34342,.38397,.42414,.46381,.50285,.54115,.57863,.61524,.65093,.6856,.71914,.75153,.78275,.81283,.84182,.86972,.89651,.92208,.94634,.96919,.99052,1.01025,1.02835,1.04484,1.05976,1.07309,1.08479,1.09492,1.1036,1.11096,1.11714,1.12224,1.12627,1.12916,1.13083,1.13125,1.13036,1.12816,1.12466,1.11992,1.11397,1.10677,1.09827,1.08849,1.07746,1.06527,1.05203,1.03786,1.02283,1.00695,.99025,.97279,.9546,.93573,.9163,.8965,.8765,.85647,.83652,.81687,.79775,.77939,.76199,.74568,.73049,.71635,.70316,.69082,.67925,.66834,.65804,.64831,.63911,.63032,.62184,.61363,.60564,.59788,.59036,.58308,.57597,.5689,.56177,.55447,.5469,.53896,.53062,.5219,.51283,.5034,.49355,.48335,.47287,.46223,.45154,.44085,.43012,.41923,.40805,.39648,.38441,.37176,.35849,.34458,.32999,.31461,.29833,.28109,.26288,.2437,.22361,.20265,.18082,.15807,.13434,.1096,.0838,.0569,.02894,0,-.0298,-.0604,-.09173,-.12364,-.15594,-.18843,-.22092,-.25331,-.28559,-.31781,-.35006,-.38244,-.41502,-.44785,-.48098,-.5144,-.54811,-.58218,-.61666,-.65153,-.68677,-.72232,-.75807,-.79397,-.83002,-.86628,-.90281,-.93968,-.97693,-1.01465,-1.05282,-1.09139,-1.13031,-1.16956,-1.20917,-1.24905,-1.28907,-1.32908,-1.36891,-1.40844,-1.44765,-1.48658,-1.52527,-1.56376,-1.60206,-1.64016,-1.67801,-1.71552,-1.75264,-1.78936,-1.8257,-1.86161,-1.89702,-1.93182,-1.96584,-1.99894,-2.03102,-2.06203,-2.0919,-2.12056,-2.14794,-2.17397,-2.19852,-2.22138,-2.24235,-2.26129,-2.27805,-2.29243,-2.30422],pressure:[.9681,.97424,.98046,.98674,.99309,.9995,.99404,.98754,.981,.97444,.96785,.96124,.95462,.94801,.94139,.93479,.92822,.92167,.91515,.90868,.90225,.89589,.88959,.88336,.87722,.87115,.86519,.85932,.85356,.84792,.84239,.83699,.83173,.8266,.82162,.81679,.81211,.80759,.80324,.79906,.79505,.79121,.78756,.78409,.78081,.77771,.77481,.77211,.76959,.76728,.76516,.76324,.76153,.76001,.75869,.75757,.75665,.75593,.7554,.75507,.75493,.75498,.75523,.75565,.75627,.75706,.75803,.75917,.76049,.76197,.76361,.76541,.76737,.76947,.77172,.77409,.7766,.77923,.78198,.78484,.7878,.79086,.79401,.79724,.80055,.80394,.8074,.81092,.8145,.81813,.82182,.82556,.82934,.83317,.83703,.84093,.84487,.84884,.85284,.85687,.86094,.86503,.86915,.87329,.87746,.88166,.88587,.89011,.89436,.89863,.90291,.9072,.91149,.91579,.92009,.92438,.92867,.93295,.9372,.94144,.94566,.94985,.954,.95812,.96219,.96623,.97021,.97415,.97802,.98184,.9856,.9893,.99293,.9965,1,.99657,.9932,.98991,.98668,.98352,.98042,.97738,.9744,.97148,.9686,.96577,.96298,.96023,.95751,.95482,.95214,.94949,.94684,.9442,.94156,.93892,.93627,.93361,.93094,.92825,.92555,.92284,.9201,.91735,.91458,.91179,.90899,.90616,.90332,.90047,.8976,.89472,.89183,.88893,.88603,.88314,.88024,.87735,.87448,.87162,.86878,.86597,.86319,.86044,.85774,.85508,.85247,.84993,.84744,.84503,.84269,.84042,.83825,.83616,.83417,.83227,.83048,.8288,.82724,.82578,.82445,.82324,.82215,.82119,.82037,.81967,.81911,.81868,.81839,.81824,.81823,.81835,.81862,.81903,.81957,.82026,.82109,.82206,.82317,.82443,.82583,.82737,.82906,.83089,.83287,.83499,.83726,.83968,.84223,.84494,.84778,.85077,.8539,.85717,.86058,.86412,.86781,.87163,.87559,.87968,.88391,.88826,.89275,.89737,.90211,.90698,.91198,.91709,.92233,.92768,.93315,.93873,.94441,.95019,.95607,.96205]},{distance:[4.72925,4.81721,4.9037,4.98859,5.07177,5.15311,5.23249,5.3098,5.38491,5.45772,5.52811,5.59598,5.66122,5.72375,5.78346,5.84028,5.8941,5.94486,5.99248,6.03689,6.07803,6.11584,6.15028,6.18128,6.20882,6.23285,6.25336,6.27031,6.28369,6.29348,6.29969,6.3023,6.30133,6.29678,6.28867,6.27703,6.26187,6.24324,6.22116,6.19567,6.16683,6.13468,6.09928,6.06068,6.01896,5.97417,5.92639,5.87569,5.82217,5.76589,5.70696,5.64545,5.58147,5.5151,5.44644,5.37559,5.30265,5.2277,5.15085,5.0722,4.99184,4.90987,4.82639,4.74151,4.65533,4.56794,4.47945,4.38996,4.29959,4.20843,4.11658,4.02416,3.93125,3.83796,3.74437,3.65057,3.55666,3.46272,3.36884,3.27509,3.18155,3.08831,2.99545,2.90303,2.81114,2.71984,2.62922,2.53933,2.45026,2.36207,2.27484,2.18862,2.10349,2.01951,1.93675,1.85528,1.77515,1.69644,1.61919,1.54348,1.46935,1.39685,1.32605,1.25698,1.18967,1.12417,1.06049,.99863,.93862,.88044,.82408,.76953,.71676,.66574,.61644,.56882,.52282,.47841,.43553,.39413,.35414,.31551,.27817,.24206,.20712,.17328,.14048,.10866,.07776,.04772,.01848,-.00999,-.03776,-.06487,-.09134,-.11721,-.14251,-.16725,-.19144,-.21509,-.2382,-.26076,-.28275,-.30416,-.32496,-.34511,-.36459,-.38334,-.40134,-.41852,-.43485,-.45026,-.46471,-.47815,-.49052,-.50179,-.51189,-.52081,-.52849,-.5349,-.54003,-.54383,-.54627,-.54734,-.54702,-.54528,-.54211,-.53752,-.53149,-.52403,-.51515,-.50487,-.4932,-.48015,-.46575,-.45001,-.43297,-.41463,-.39503,-.37419,-.35213,-.32887,-.30443,-.27885,-.25214,-.22432,-.19541,-.16544,-.13442,-.10235,-.06926,-.03514,0,.03616,.07336,.11159,.15088,.19125,.23272,.27531,.31906,.36401,.41019,.45764,.5064,.55651,.60802,.66096,.71538,.77129,.82874,.88776,.94836,1.01056,1.07438,1.13982,1.20687,1.27554,1.34581,1.41766,1.49107,1.56599,1.64239,1.72025,1.79951,1.88013,1.96209,2.04532,2.12979,2.21546,2.30226,2.39017,2.47911,2.56905,2.65991,2.75164,2.84416,2.93742,3.03133,3.12582,3.2208,3.31619,3.41191,3.50785,3.60393,3.70006,3.79612,3.89202,3.98765,4.08291,4.17767,4.27182,4.36525,4.45783,4.54944,4.63995],pressure:[.30942,.30838,.30765,.30724,.30715,.30738,.30795,.30884,.31007,.31164,.31354,.31578,.31837,.32129,.32455,.32815,.33209,.33636,.34097,.34591,.35117,.35675,.36265,.36887,.37539,.38221,.38933,.39674,.40442,.41238,.4206,.42907,.43779,.44675,.45593,.46533,.47493,.48473,.49471,.50486,.51517,.52563,.53623,.54694,.55777,.5687,.57971,.59079,.60194,.61313,.62435,.6356,.64686,.65811,.66935,.68056,.69174,.70286,.71391,.72489,.73579,.74659,.75728,.76785,.7783,.7886,.79876,.80877,.81861,.82827,.83776,.84706,.85617,.86507,.87378,.88227,.89056,.89863,.90649,.91412,.92153,.92872,.93568,.94241,.94892,.95519,.96122,.96702,.97258,.97791,.98299,.98783,.99242,.99677,.99911,.99525,.99164,.98827,.98515,.98228,.97966,.97728,.97514,.97324,.97159,.97017,.96898,.96801,.96727,.96674,.96641,.96629,.96635,.96661,.96703,.96762,.96838,.96928,.97032,.97149,.97279,.9742,.97572,.97734,.97905,.98085,.98273,.98468,.98669,.98877,.99091,.99311,.99535,.99765,1,.9976,.99516,.99267,.99014,.98755,.98491,.98222,.97947,.97666,.97378,.97083,.96781,.96471,.96153,.95826,.9549,.95144,.94787,.9442,.94042,.93651,.93249,.92834,.92407,.91966,.91512,.91045,.90564,.90069,.8956,.89037,.885,.87949,.87384,.86806,.86214,.85608,.84988,.84356,.83711,.83053,.82383,.81702,.81009,.80306,.79594,.78872,.78141,.77403,.76657,.75905,.75148,.74385,.73619,.72849,.72076,.71302,.70526,.69749,.68972,.68195,.67419,.66644,.65871,.65099,.64329,.63561,.62795,.62032,.61271,.60512,.59755,.59001,.58248,.57497,.56749,.56002,.55256,.54512,.5377,.5303,.52291,.51554,.50819,.50087,.49358,.48632,.4791,.47192,.4648,.45773,.45072,.44378,.43692,.43015,.42346,.41687,.41039,.40403,.39779,.39168,.38571,.37989,.37423,.36873,.36342,.35828,.35335,.34862,.34409,.3398,.33573,.3319,.32831,.32498,.32192,.31912,.3166,.31436,.31242,.31077]}];function o(e,t){if(!e)return null;var i=e.length/2;const r=.1*i;i=Array(i);let n=0;t=1===t;for(let o=0;o<e.length;o+=2){const a=(e[o]+e[o+1])/2;i[n++]=t?Math.min(r,1-.5*(1-a)):Math.min(r,.5*a)}return i}var a=function(){var e=r,a=e/2;const s=new Uint8Array(4*e*e),l=4*e*a,u=2*(a=i),c=4*e,h=n.length;let d=8*h*c;for(var f of n){var p=f.distance,_=f.pressure;let e=d;for(let i=0;i<9;i++){0!==i&&(p=o(p,0),_=o(_,1));for(let i=0;i<r;i++){const r=_?_[i%_.length]:1;t(.5+(p?p[i%p.length]/u:0),s,e),t(r,s,e+l),e+=4}e-=c*(h+1)}d+=c}return s}(),s=new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR});this._edgeStrokesTexture=new L$17({context:this._frameState.context,source:{width:256,height:256,arrayBufferView:a},sampler:s,flipY:!1})},_0x47d916.prototype._setFloodTexture=function(e,t,i){this._floodFlagTexture=e,this._floodRect=t;var r=new y$15;y$15.inverse(i,r),this._matFloodInvertMatrix=r;var n={};n.layer=this,this.traverseRenderEntity(n,_0x52dbe9)},_0x47d916.prototype._removeFloodTexture=function(){this._floodFlagTexture=void 0,this._floodRect=void 0,this._matFloodInvertMatrix=y$15.IDENTITY;var e={};e.layer=this,this.traverseRenderEntity(e,_0x12ea5c)};var r$t=function(){if(this._layers=null,this.minQuality=1,this._jsHeapSizeLimitRatio=1,this._maxMemory=1024,s$V.isPCBroswer()&&(this._maxMemory=4096),window.performance&&window.performance.memory){var e=window.performance.memory.usedJSHeapSize/1048576,t=window.performance.memory.jsHeapSizeLimit/1048576;this._maxMemory=(t-e)*this._jsHeapSizeLimitRatio}this._cacheSize=1024,this._memoryUsed=0,this._memoryPredicted=0,this._quality=1,this._canFastRecover=0,this._downscaleMemoryUsed=this._stableQuality=0,this._QualityShrinkRatio=1.3,this._QualityIncreaseStep=.01,this._updating=0,this._geoMemoryEstimate=0,this._texMemoryEstimate=0,this._EMA=0,this._learningWeight=.9,this._beta=1-this._learningWeight,this._logTime=0,this._showMemoryInfo=!1};r$t.showMemoryInfo=function(e){e$z._showMemoryInfo=e},r$t.setCacheSize=function(e){e$z._cacheSize=Math.min(e,e$z._maxMemory)},r$t.getCacheSize=function(){return e$z._cacheSize},r$t.reAllocateMaxMemory=function(e){if(e$z._jsHeapSizeLimitRatio=e,window.performance&&window.performance.memory){var t=window.performance.memory.usedJSHeapSize/1048576,i=window.performance.memory.jsHeapSizeLimit/1048576;e$z._maxMemory=(i-t)*e$z._jsHeapSizeLimitRatio}},r$t.setMaxMemory=function(e){e$z._maxMemory=e},r$t.getMaxMemory=function(){return e$z._maxMemory};const d$y={GeForce:{1050:3,1060:3,1070:8,1080:8,1650:4,1660:6,2060:6,2070:8,2080:8,3050:8,3060:8,3080:12,3090:24,4070:12,4080:16,4090:24},AMD:{7900:24,7600:8,6950:16,6900:16,6800:16,6750:12,6700:12,6650:8,6600:8,6500:4,6400:4,5700:8,5600:6,5500:8,64:8,56:8,590:8,580:4,570:4,560:4,550:4,480:4,470:4,390:8,380:4,7990:6,7970:3,7950:3,6990:4}};r$t._autoSetMaxMemory=function(e){var t=e.split(" "),i=t.filter((function(e,t){return/^[1-9]/g.test(e)}));if(i.length>0){var r,n=t.indexOf("GeForce")>-1,o=t.indexOf("AMD")>-1,a=i[0];n?r=d$y.GeForce[a]:o&&(r=d$y.AMD[a]),r=e$28(r)?.9*r:2,r*=1024,r$t.setMaxMemory(r)}},r$t.setMinQuality=function(e){e$z.minQuality=Math.min(e,1)},r$t.getMinQuality=function(){return e$z.minQuality},r$t._memGeometryAdded=function(e){e$z._geoMemoryEstimate+=e},r$t._memGeometryRemoved=function(e){e$z._geoMemoryEstimate-=e},r$t._memTextureAdded=function(e){e$z._texMemoryEstimate+=e},r$t._memTextureRemoved=function(e){e$z._texMemoryEstimate-=e},r$t._attachLayers=function(e){e$z._layers=e},r$t._updateMemory=function(e){var t=1048576*e$z._maxMemory,i=e$z._memoryUsed*t;if(e$z._memoryUsed=e,e$z._memoryPredicted=e$z._memoryUsed-i,e$z._memoryPredicted=0==e$z._EMA?e$z._memoryPredicted:e$z._memoryPredicted*e$z._learningWeight+e$z._EMA*(1-e$z._learningWeight),e$z._EMA=e$z._memoryPredicted,e$z._showMemoryInfo&&e$z._memoryUsed>t){var r=kt$7();r-e$z._logTime>1e4&&(console.log(r$t.getStatistics()),e$z._logTime=r)}e$z._memoryPredicted=(e$z._memoryUsed+e$z._memoryPredicted)/t,e$z._memoryUsed=e$z._memoryUsed/t},r$t.getStatistics=function(){var e="内å˜ä¸Šé™�(MB): "+e$z._maxMemory,t=e$z._memoryUsed;e$z._memoryUsed<1&&(t=1048576*e$z._maxMemory*t);for(var i="当å‰�å� 用内å˜(MB): "+t/1048576,r="缓å˜ä¸Šé™�(MB): "+e$z._cacheSize,n="当å‰�缓å˜å� 用(MB): ",o=0;o<e$z._layers._layerQueue.length;o++){var a=e$z._layers._layerQueue[o];if(a instanceof _0x47d916){var s=a._layerScheduler._getCacheMemoryUsageInBytes()/1048576;n+="ç¬?"+o+"å±?, 图层å��:"+a._name+",缓å˜å� 用:"+s+","}}var l=e+","+i+","+("渲染质é‡�ï¼?"+e$z._quality)+"\n"+r+","+n;if(window.performance&&window.performance.memory){var u=window.performance.memory.totalJSHeapSize/1048576,c=window.performance.memory.usedJSHeapSize/1048576;l+="\næµ�览器最大内å?(MB)ï¼?"+window.performance.memory.jsHeapSizeLimit/1048576+",已分é…�内å?(MB)ï¼?"+c+",å †æ´»è·ƒå†…å?(MB)ï¼?"+u}return l},r$t.getMemoryUsed=function(){return e$z._memoryUsed},r$t.getQuality=function(){return e$z._quality},r$t._updateQuality=function(e){return(e=Math.min(Math.max(e,e$z.minQuality),1))===e$z._quality?0:(e$z._quality=e,1)},r$t._layersUpdating=function(){for(var e=e$z._layers._layerQueue.length,t=0;t<e;t++){var i=e$z._layers._layerQueue[t];if(i instanceof _0x47d916&&i._layerScheduler._updatingTiles()>0)return!0}return!1},r$t.update=function(e){e$z._layers._setMaxMemory(e$z._maxMemory),e$z._layers._setCacheMemory(e$z._cacheSize),this._updateMemory(e);var t=!0;if(e$z._memoryPredicted>0||e$z._updating){var i=this._layersUpdating();e$z._memoryPredicted<.6&&e$z._canFastRecover?(e$z._stableQuality=e$z._downscaleMemoryUsed=0,e$z._canFastRecover=0,this._updateQuality(1)):i?(e$z._memoryPredicted>1.1||e$z._memoryUsed>1)&&(e$z._stableQuality>0?(e$z._downscaleMemoryUsed=0,this._updateQuality(e$z._stableQuality)):e$z._quality>e$z.minQuality&&e$z._downscaleMemoryUsed<e$z._memoryUsed?(t=i=this._updateQuality(e$z._quality/e$z._QualityShrinkRatio),e$z._downscaleMemoryUsed=e$z._memoryUsed,e$z._canFastRecover=0):t=!1):(i=this._layersUpdating(),e$z._downscaleMemoryUsed=0,e$z._memoryUsed>1?(e$z._stableQuality=0,e$z._canFastRecover=0,t=i=this._updateQuality(e$z._quality/e$z._QualityShrinkRatio),e$z._downscaleMemoryUsed=e$z._memoryPredicted):e$z._stableQuality!=e$z._quality&&(e$z._memoryUsed<.8&&e$z._quality<1?(e$z._stableQuality=e$z._quality,i=this._updateQuality(e$z._quality+e$z._QualityIncreaseStep)):e$z._quality<1&&(e$z._canFastRecover=1))),e$z._updating=i}return t};var e$z=new r$t;r$t.memManager=e$z;var to=r$t,_0x6a2fab=(_0x36899d=!0,function(e,t){var i=_0x36899d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x36899d=!1,i}),_0x2c5fd1=_0x6a2fab(void 0,(function(){return _0x2c5fd1.toString().search("(((.+)+)+)+$").toString().constructor(_0x2c5fd1).search("(((.+)+)+)+$")})),_0x36899d;_0x2c5fd1();var _0x10da10=273;function _0x1df420(e,t){var i=["","WEBKIT_","MOZ_"],r=null;for(var n in i)if(r=e.getExtension(i[n]+t))break;return r}var _0x582590=function(){this.textures={},this.refCounts={},this.unUsedTextures={},this.unUsedSize=0,this.dxtExt=null,this.pvrtcExt=null,this.etc1Ext=null,this.bInitialised=!1};_0x582590.reservedMemorySize=50,_0x582590.CreateTexture=function(e,t,i,r,n,o,a,s,l,u,c,h){var d=t._gl;0==_0x5a5cc3.bInitialised&&(_0x5a5cc3.bInitialised=!0,_0x5a5cc3.dxtExt=_0x1df420(d,"WEBGL_compressed_texture_s3tc"),_0x5a5cc3.pvrtcExt=_0x1df420(d,"WEBGL_compressed_texture_pvrtc"),_0x5a5cc3.etc1Ext=_0x1df420(d,"WEBGL_compressed_texture_etc1"));var f=_0x5a5cc3.textures[e];if(f)_0x5a5cc3.refCounts[e]++;else{var p=null;switch(o){case _0xbc8ee1.enrS3TCDXTN:p=n===_0x493d0c.BGR||n===_0x493d0c.RGB?V$O.RGB_DXT1:V$O.RGBA_DXT5;break;case _0xbc8ee1.enrPVRTPF_PVRTC2:case _0xbc8ee1.enrPVRTPF_PVRTC:p=n===_0x493d0c.BGR||n===_0x493d0c.RGB?V$O.RGB_PVRTC_2BPPV1:V$O.RGBA_PVRTC_2BPPV1;break;case _0xbc8ee1.enrPVRTPF_PVRTC_4bpp:p=V$O.RGBA_PVRTC_4BPPV1;break;case _0xbc8ee1.enrPVRTPF_ETC1:p=V$O.RGB_ETC1;break;case _0xbc8ee1.encNONE:p=n===_0x493d0c.BGR||n===_0x493d0c.RGB?h===_0xbc8ee1.encNONE?V$O.RGB:_0x10da10:n===_0x493d0c.LUMINANCE_ALPHA?V$O.LUMINANCE_ALPHA:V$O.RGBA}var _=25===n?y$U.FLOAT:y$U.UNSIGNED_BYTE;e$28(_0x5a5cc3.unUsedTextures[e])?(f=_0x5a5cc3.unUsedTextures[e],_0x5a5cc3.unUsedSize-=f._size,delete _0x5a5cc3.unUsedTextures[e]):(s||(f=this.UseTexture(e,t,i,r,p,a,l,u,_)),null==f&&(f=new _0x33f6d6(e,t,i,r,p,a,s,l,u,_,c,h),to._memTextureAdded(f._sizeInBytes))),_0x5a5cc3.refCounts[e]=1,_0x5a5cc3.textures[e]=f}return f},_0x582590.UseTexture=function(e,t,i,r,n,o,a,s,l){var u=t._gl;for(var c in _0x5a5cc3.unUsedTextures)if(_0x5a5cc3.unUsedTextures[c]._size===o.length){var h=_0x5a5cc3.unUsedTextures[c];if(h._context.id!==t.id)return;if(t.webgl2&&(i!==h._width||r!==h._height))continue;return _0x5a5cc3.unUsedSize-=h._size,delete _0x5a5cc3.unUsedTextures[c],h._gl=u,h._width=i,h._height=r,h._internalFormat=n,h._wrapS=u$Y(a,q$11.CLAMP_TO_EDGE),h._wrapT=u$Y(s,q$11.CLAMP_TO_EDGE),h._pixelDataType=u$Y(l,y$U.UNSIGNED_BYTE),h._pixelDataType===y$U.FLOAT&&(h._wrapS=q$11.CLAMP_TO_EDGE,h._wrapT=q$11.CLAMP_TO_EDGE),h.ready=!1,h._target=h._gl.TEXTURE_2D,h.updateTexture(e,o),h}},_0x582590.CreateVolumeTexture=function(e,t,i,r,n){var o=_0x5a5cc3.textures[e],a=tt$h.LINEAR,s=rt$g.LINEAR;if(n===k$T.FilterMode.NEAREST&&(a=tt$h.NEAREST,s=rt$g.NEAREST),o&&!e$28(r.imageArray))_0x5a5cc3.refCounts[e]++,o.sampler=new n$Y({minificationFilter:a,magnificationFilter:s});else{var l=r.nLength,u=r.imageArray;(o=new L$17({context:i,width:l,height:l,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:a,magnificationFilter:s})})).copyFrom({width:l,height:l,arrayBufferView:u}),_0x5a5cc3.refCounts[e]=1,_0x5a5cc3.textures[e]=o,to._memTextureAdded(o._sizeInBytes)}return o},_0x582590.ReloadVolumeTexture=function(e,t,i,r,n){var o=_0x5a5cc3.textures[e];if(o){var a=r.nLength,s=r.imageArray;o.copyFrom({width:a,height:a,arrayBufferView:s})}return o},_0x582590.AddRef=function(e){_0x5a5cc3.refCounts[e]++},_0x582590.DecRef=function(e){_0x5a5cc3.refCounts[e]--},_0x582590.DestroyTexture=function(e){var t=_0x5a5cc3.refCounts[e];_0x5a5cc3.refCounts[e]=t-1,0==_0x5a5cc3.refCounts[e]&&(_0x5a5cc3.textures[e].is3D||e$28(_0x5a5cc3.textures[e].sampler)?(to._memTextureRemoved(_0x5a5cc3.textures[e]._sizeInBytes),_0x5a5cc3.textures[e].destroy()):(_0x5a5cc3.unUsedTextures[e]=_0x5a5cc3.textures[e],_0x5a5cc3.unUsedSize+=_0x5a5cc3.textures[e]._size),delete _0x5a5cc3.textures[e],delete _0x5a5cc3.refCounts[e])},_0x582590.GetUnusedSize=function(){return _0x5a5cc3.unUsedSize},_0x582590.DeleteUnusedTextures=function(){for(var e in _0x5a5cc3.unUsedTextures)_0x5a5cc3.unUsedTextures[e]._is3D&&(_0x5a5cc3.unUsedSize-=_0x5a5cc3.unUsedTextures[e]._size,to._memTextureRemoved(_0x5a5cc3.textures[e]._sizeInBytes),_0x5a5cc3.unUsedTextures[e].destroy(),delete _0x5a5cc3.unUsedTextures[e]);var t=1024*_0x582590.reservedMemorySize*1024;for(var e in _0x5a5cc3.unUsedTextures){if(t>_0x5a5cc3.unUsedSize)break;var i=_0x5a5cc3.unUsedTextures[e];_0x5a5cc3.unUsedSize-=i._size,to._memTextureRemoved(i._sizeInBytes),i.destroy(),delete _0x5a5cc3.unUsedTextures[e]}};var _0x5a5cc3=new _0x582590;_0x582590.textureManager=_0x5a5cc3,_0x582590._shareTexturePromiseCache={};var Se$8=_0x582590,_0x282c3b=(_0x4d32bd=!0,function(e,t){var i=_0x4d32bd?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4d32bd=!1,i}),_0xc26ab6=_0x282c3b(void 0,(function(){return _0xc26ab6.toString().search("(((.+)+)+)+$").toString().constructor(_0xc26ab6).search("(((.+)+)+)+$")})),_0x4d32bd;_0xc26ab6();var _0x58c43c={INSTANCED_LAYER:"Instanced_Layer",INSTANCED_OBJECT:"Instanced_Object"},oi$2=Object.freeze(_0x58c43c),_0x31a15a=(_0x3b4b60=!0,function(e,t){var i=_0x3b4b60?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3b4b60=!1,i}),_0x1489d7=_0x31a15a(void 0,(function(){return _0x1489d7.toString().search("(((.+)+)+)+$").toString().constructor(_0x1489d7).search("(((.+)+)+)+$")})),_0x3b4b60;_0x1489d7();var _0x3fda7a=new e$1S(.7,.7,1,1);function _0x375cb8(e,t,i,r){r=u$Y(r,u$Y.EMPTY_OBJECT),o$1u.defined("options.position",r.position),this._type=oi$2.INSTANCED_OBJECT,this._ownerGroup=i,this._position=r.position,this._color=new e$1S(1,1,1,1),r.color&&e$1S.clone(r.color,this._color),this._scale=u$Y(r.scale,new t$X(1,1,1)),this._offset=u$Y(r.offset,new t$X(0,0,0));var n=u$Y(r.hpr,new i$10);this._hpr=n,this._feature=u$Y(r.feature,u$Y.EMPTY_OBJECT);var o=t$W.fromCartesian(this._position);o.longitude+=this._offset.x,o.latitude+=this._offset.y,o.height+=this._offset.z,this._offsetPosition=t$X.fromRadians(o.longitude,o.latitude,o.height),this._mode=r.sceneMode,this._mode===P$$.COLUMBUS_VIEW&&(this._position=m$1b.convertToColumbusCartesian(this._position),this._offsetPosition=m$1b.convertToColumbusCartesian(this._offsetPosition)),this._quaternion=m$1b.headingPitchRollQuaternion(this._position,n);var a={id:t,primitive:this},s=e.createPickId(a).color,l=new e$1S;l.x=e$1S.floatToByte(s.red),l.y=e$1S.floatToByte(s.green),l.z=e$1S.floatToByte(s.blue),l.w=e$1S.floatToByte(s.alpha),this._pickColor=l,this._isSelected=!1,this._preColor=e$1S.clone(this._color),this._oriCenter=void 0,this._oriRadius=1,this._boundingSphere=void 0,this._id=t,this._index=-1,this._isDeleted=!1,this._visible=u$Y(r.visible,!0),this._distanceVisible=!0,this._localTransform=void 0,this._localTranslation=void 0,this._localQuaternion=void 0}Object.defineProperties(_0x375cb8.prototype,{type:{get:function(){return this._type}},position:{get:function(){return this._position}},color:{get:function(){return this._color}},scale:{get:function(){return this._scale}},hpr:{get:function(){return this._hpr}},visible:{get:function(){return this._visible},set:function(e){o$1u.typeOf.bool("S3M Instance visible",e),e!==this._visible&&(this._visible=e,this.updatePosition(this._position))}},show:{get:function(){return this.visible},set:function(e){this.visible=e}},distanceVisible:{get:function(){return this._distanceVisible},set:function(e){o$1u.typeOf.bool("S3M Instance distanceVisible",e),e!==this._distanceVisible&&(this._distanceVisible=e,this.updatePosition(this._position))}},offset:{get:function(){return this._offset}},feature:{get:function(){return this._feature}},isSelected:{get:function(){return this._isSelected}},oriCenter:{get:function(){return this._oriCenter},set:function(e){!e$28(e)||(this._oriCenter=e)}},oriRadius:{get:function(){return this._oriRadius},set:function(e){!e$28(e)||(this._oriRadius=e)}},boundingSphere:{get:function(){return this._boundingSphere},set:function(e){!e$28(e)||(this._boundingSphere=e)}},index:{get:function(){return this._index},set:function(e){this._index=e}},id:{get:function(){return this._id},set:function(e){!e$28(e)||(this._id=e)}},isDeleted:{get:function(){return this._isDeleted},set:function(e){e$28(e)&&(this._isDeleted=e)}},localTransform:{get:function(){return this._localTransform}},localTranslation:{get:function(){return this._localTranslation}},localQuaternion:{get:function(){return this._localQuaternion}}}),_0x375cb8.prototype.updatePosition=function(e){if(e$28(e)){var t=this._index;this._position=t$X.clone(e);var i=t$W.fromCartesian(this._position);i.longitude+=this._offset.x,i.latitude+=this._offset.y,i.height+=this._offset.z,this._offsetPosition=t$X.fromRadians(i.longitude,i.latitude,i.height);var r=this._ownerGroup.renderEntities;if(e$28(r)&&!(r.length<1)){for(var n=this._visible&&this._distanceVisible?1:0,o=t$X.multiplyByScalar(e,n,new t$X),a=0,s=r.length;a<s;a++){var l=r[a],u=l._colorCommand.vertexArray.getAttribute(l._attributeLocations.aPosHigh),c=t*u.strideInBytes+u.offsetInBytes,h=S$W.createTypedArray(u.componentDatatype,2*u.componentsPerAttribute),d=i$Q.fromCartesian(o),f=d.high,p=d.low;h[0]=f.x,h[1]=f.y,h[2]=f.z,h[3]=p.x,h[4]=p.y,h[5]=p.z,u.vertexBuffer.copyFromArrayView(h,c)}t$X.clone(e,this._boundingSphere.center)}}},_0x375cb8.prototype.updateColor=function(e){if(e$28(e)&&!this._isDeleted){var t=this._index;if(!e$1S.equals(this._color,e)){this._color=e$1S.clone(e,this._color),this._preColor=e$1S.clone(e);var i=this._ownerGroup.renderEntities;if(e$28(i)&&!(i.length<1))for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o._colorCommand.vertexArray.getAttribute(o._attributeLocations.aColor2),s=t*a.strideInBytes+a.offsetInBytes,l=S$W.createTypedArray(a.componentDatatype,a.componentsPerAttribute);l[0]=e.red,l[1]=e.green,l[2]=e.blue,l[3]=e.alpha,a.vertexBuffer.copyFromArrayView(l,s)}}}},_0x375cb8.prototype.updateScale=function(e){if(e$28(e)){var t=this._index;if(!t$X.equals(this._scale,e)){this._scale=t$X.clone(e);var i=this._ownerGroup.renderEntities;if(e$28(i)&&!(i.length<1)){for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o._colorCommand.vertexArray.getAttribute(o._attributeLocations.aScaleAndRadius),s=t*a.strideInBytes+a.offsetInBytes,l=S$W.createTypedArray(a.componentDatatype,a.componentsPerAttribute);l[0]=e.x,l[1]=e.y,l[2]=e.z,l[3]=this._oriRadius,a.vertexBuffer.copyFromArrayView(l,s)}var u=t$X.maximumComponent(e);this._boundingSphere.radius=this.oriRadius*u}}}},_0x375cb8.prototype.updateRotation=function(e){if(e$28(e)){var t=this._index;if(!i$10.equals(this._hpr,e)){if(this._hpr=i$10.clone(e),this._quaternion=m$1b.headingPitchRollQuaternion(this._position,e),this._mode===P$$.COLUMBUS_VIEW){var i=p$1a.fromRotationY(-Math.PI/2),r=n$14.fromRotationMatrix(i);this._quaternion=n$14.multiply(this._quaternion,r,this._quaternion)}var n=this._ownerGroup.renderEntities;if(e$28(n)&&!(n.length<1))for(var o=0,a=n.length;o<a;o++){var s=n[o],l=s._colorCommand.vertexArray.getAttribute(s._attributeLocations.aQuaternion),u=t*l.strideInBytes+l.offsetInBytes,c=S$W.createTypedArray(l.componentDatatype,l.componentsPerAttribute);c[0]=this._quaternion.x,c[1]=this._quaternion.y,c[2]=this._quaternion.z,c[3]=this._quaternion.w,l.vertexBuffer.copyFromArrayView(c,u)}}}},_0x375cb8.prototype.updateModelMatrix=function(e){var t=y$15.getScale(e,new t$X);this.updateScale(t),this._localTransform=y$15.clone(e),this._localTranslation=y$15.getTranslation(e,new t$X);var i=y$15.setScale(e,new t$X(1,1,1),new y$15),r=y$15.getRotation(i,new p$1a);this._localQuaternion=n$14.fromRotationMatrix(r,new n$14)},_0x375cb8.prototype.setSelected=function(){var e=this._index;if(e$28(e)&&!(e<0)&&!e$1S.equals(this._color,_0x3fda7a)){var t=e$1S.multiply(_0x3fda7a,this._preColor,new e$1S),i=this._ownerGroup.renderEntities;if(e$28(i)&&!(i.length<1)){for(var r=0,n=i.length;r<n;r++){var o=i[r],a=o._colorCommand.vertexArray.getAttribute(o._attributeLocations.aColor2),s=e*a.strideInBytes+a.offsetInBytes,l=S$W.createTypedArray(a.componentDatatype,a.componentsPerAttribute);l[0]=t.red,l[1]=t.green,l[2]=t.blue,l[3]=t.alpha,a.vertexBuffer.copyFromArrayView(l,s)}this._isSelected=!0}}},_0x375cb8.prototype.setUnSelected=function(){var e=this._index;if(e$28(e)&&!(e<0)&&this._isSelected){this._isSelected=!1,this._color=e$1S.clone(this._preColor);var t=this._ownerGroup.renderEntities;if(e$28(t)&&!(t.length<1))for(var i=0,r=t.length;i<r;i++){var n=t[i],o=n._colorCommand.vertexArray.getAttribute(n._attributeLocations.aColor2),a=e*o.strideInBytes+o.offsetInBytes,s=S$W.createTypedArray(o.componentDatatype,o.componentsPerAttribute);s[0]=this._preColor.red,s[1]=this._preColor.green,s[2]=this._preColor.blue,s[3]=this._preColor.alpha,o.vertexBuffer.copyFromArrayView(s,a)}}};var _0x441534=(_0x22edbf=!0,function(e,t){var i=_0x22edbf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x22edbf=!1,i}),_0x3c10b4=_0x441534(void 0,(function(){return _0x3c10b4.toString().search("(((.+)+)+)+$").toString().constructor(_0x3c10b4).search("(((.+)+)+)+$")})),_0x22edbf;_0x3c10b4();var _0x9293b3="\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#extension GL_EXT_shader_texture_lod : enable\n#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef ClampObject\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\n#ifdef TEXTURE\nuniform sampler2D uTexture;\n#endif\nvarying vec2 vTexCoord;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\nvarying vec4 vPositionWC;\nvarying vec3 vNormalEC;\nvarying mat4 vModelMatrix;\n\n#ifdef SQRESULT\nuniform sampler2D uFrontColorTexture;\nuniform sampler2D uFrontDepthTexture;\nuniform sampler2D uBackDepthTexture;\nuniform float uSQMode; \n#endif\n#ifdef Volume2\nvarying vec3 vecRotioCoord;\n#endif\nfloat computeDepth()\n{\n#ifdef LOG_DEPTH\n return log2(v_depthFromNearPlusOne) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#else\n return gl_FragCoord.z;\n#endif\n}\n#ifdef SQRESULT\nbool isPointInObject(vec2 texCoord)\n{\n bool bIn = false;\n vec4 colorInClipTexture = texture2D(uFrontColorTexture,texCoord.xy);\n if(colorInClipTexture.r > 0.99 && colorInClipTexture.g < 0.01 && colorInClipTexture.b < 0.01)\n {\n float depthNear = czm_unpackDepth(texture2D(uFrontDepthTexture, texCoord.xy)) - 0.00001;\n float depthFar = czm_unpackDepth(texture2D(uBackDepthTexture, texCoord.xy)) + 0.00001;\n float currentDepth = computeDepth();\n if(currentDepth > depthNear && currentDepth < depthFar){\n bIn = true;\n }\n }\n return uSQMode < 0.5 ? !bIn : bIn;\n}\n#endif\n\nuniform vec3 uAmbientLightColor;\nuniform vec4 uSunLightColor;\nuniform float uSunLightON;\nuniform vec4 uAmbientColor;\nuniform vec4 uDiffuseColor;\n\nvec4 SRGBtoLinear(vec4 srgbIn) \n{\n return vec4(pow(srgbIn.rgb, vec3(2.2)), srgbIn.a);\n}\nvec4 LineartoSRGB(vec4 linearIn) \n{\n#ifndef HDR \n return vec4(pow(linearIn.rgb, vec3(1.0/2.2)), linearIn.a);\n#else \n return linearIn;\n#endif \n}\n\n#include <brdf>\n\nvoid main()\n{\n czm_s3mMaterialInput material;\n material.ambientColor = uAmbientColor;\n material.diffuseColor = uDiffuseColor;\n material.ambientLightColor.rgb = uAmbientLightColor;\n material.ambientLightColor.a = 1.0;\n material.sunLightColor = uSunLightColor;\n material.sunLightON = uSunLightON;\n material.sunDirectionEC = czm_sunDirectionEC;\n#ifdef ClampObject\n czm_writeDepthClampedToFarPlane();\n#endif\n vec4 color = vColor;\n#ifdef ClampObject\n #ifdef PROFILE\n #ifdef MRT\n gl_FragData[0] = vec4(vPickColor.xyz, 1.0);\n gl_FragData[1] = color;\n #else\n gl_FragColor = vec4(vPickColor.xyz, 1.0);\n #endif\n #else\n gl_FragColor = color;\n #endif\n#else\n vec2 vecTexCoord = vec2(0.0);\n #ifdef SQRESULT\n vec2 texCoord = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\n if(!isPointInObject(texCoord)) \n { \n discard; \n } \n #endif\n \n\t#ifdef TEXTURE\n #ifdef FLIP_Y\n vecTexCoord = vec2(vTexCoord.x,1.0-vTexCoord.y);\n #else\n vecTexCoord = vec2(vTexCoord.x,vTexCoord.y);\n #endif\n #endif\n \n #ifdef TEXTURE\n color = SRGBtoLinear(texture2D(uTexture, vecTexCoord.xy, 0.0)) * color;\n #endif\n vec3 normalEC;\n if(vPositionMC.w > 0.9)\n {\n normalEC = normalize(vNormalEC);\n }\n else\n {\n vec3 normalMC = czm_computeNormal(vPositionMC.xyz);\n mat4 modelViewMatrix4 = czm_view * vModelMatrix;\n modelViewMatrix4 = czm_inverseMatrix(modelViewMatrix4);\n mat3 modelViewMatrix3 = mat3(modelViewMatrix4);\n modelViewMatrix3 = czm_transpose(modelViewMatrix3);\n normalEC = normalize(modelViewMatrix3 * normalMC);\n }\n vec3 positionEC = vec3(czm_modelView * vec4(vPositionMC.xyz,1.0)).xyz;\n \n #ifdef Volume\n #ifdef Volume2\n if((vecRotioCoord.x < 1.0 && vecRotioCoord.x >0.0) && (vecRotioCoord.y < 1.0 && vecRotioCoord.y >0.0) && (vecRotioCoord.z < 1.0 && vecRotioCoord.z >0.0))\n {\n vec4 volumeColor = czm_getVolumeValue(vecRotioCoord);\n if (volumeColor.r * volumeColor.g * volumeColor.b * volumeColor.a < 0.99) {\n gl_FragColor = volumeColor;\n }\n }\n #else\n float wValue = 0.0;\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, wValue);\n #endif\n #endif\n \n #ifdef BRDF\n gl_FragColor = brdf(color, vecTexCoord, vecTexCoord, vPositionEC, vPositionMC.xyz, normalEC, uSunLightColor, uSunLightON);\n #else\n gl_FragColor = color * czm_directionLight(material, normalEC, -positionEC, vPositionMC.xyz);\n #ifdef TEXTURE\n gl_FragColor = LineartoSRGB(gl_FragColor);\n #endif\n #endif\n \n \n#endif\n\n#ifndef MRT\n gl_FragColor = czm_gammaCorrect(gl_FragColor);\n if(gl_FragColor.a < 0.1)\n {\n discard;\n }\n#endif\n}",_0x303b48=(_0x4f0c3e=!0,function(e,t){var i=_0x4f0c3e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4f0c3e=!1,i}),_0x2aae67=_0x303b48(void 0,(function(){return _0x2aae67.toString().search("(((.+)+)+)+$").toString().constructor(_0x2aae67).search("(((.+)+)+)+$")})),_0x4f0c3e;_0x2aae67();var _0x11c7a0={getDataShape:function(e,t){for(var i=-1/0,r=0,n=0,o=0,a=0;a<e.length;a++){var s=0;if(e[a].value&&(s=e[a].value[3]),s<i){if(o&&o!==n)throw new Error("Invalid data. data should be a row major 2d array.");o=n,n=0,r++}i=s,n++}return{row:r+1,column:n}}},_0x1fc685=[],_0xf457e4=[],_0x5de381=[];function _0x45ccdf(e){var t;return/^#([A-Fa-f0-9]{3}){1,2}$/.test(e)?(3==(t=e.substring(1).split("")).length&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]),[((t="0x"+t.join(""))>>16&255)/255,(t>>8&255)/255,(255&t)/255,1]):[255,255,255,1]}_0x11c7a0.updateSurfaceMesh=function(e,t,i){for(var r=new Float32Array(3*e.length),n=-900,o=900,a=-900,s=900,l=-900,u=900,c=0;c<e.length;c+=3)n=Math.max(e[c].value[0],n),o=Math.min(e[c].value[0],o),a=Math.max(e[c].value[1],a),s=Math.min(e[c].value[1],s),l=Math.max(e[c].value[2],l),u=Math.min(e[c].value[2],u);var h=_0x3d39c0(o,n);_0x1fc685=_0x384998(o,n,h);var d=_0x3d39c0(s,a);_0xf457e4=_0x384998(s,a,d);var f=_0x3d39c0(u,l);_0x5de381=_0x384998(u,l,f);var p=0;e.forEach((function(e){e.value&&e.value instanceof Array&&_0x3c7991(e.value[0],e.value[1],e.value[2],p,r),p++}));var _=_0x497ccc(0,null,[-50,50],_0x1fc685),m=_0x497ccc(0,null,[50,-50],_0xf457e4),$=_0x497ccc(0,null,[-50,50],_0x5de381),g=null,v=null,y=null,x=null,b=null,w=t.row,C=t.column,T=(w-1)*(C-1)*4;g=new Float32Array(3*T),x=new Float32Array(4*T),b=new Float32Array(4*T),y=new Float32Array(2*T);var S,E,A,P,I,M,O,D,R,L,B,N,F,z,k,V=[0,3,1,1,3,2],U=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],X=new(T>65535?Uint32Array:Uint16Array)((w-1)*(C-1)*6),H=function(e,t,i){i[1]=e*C+t,i[0]=e*C+t+1,i[3]=(e+1)*C+t+1,i[2]=(e+1)*C+t},G=[],W=[],Y=0;v=new Float32Array(3*T);var q=[[],[],[]],j=[],Z=[],K=[0,0,0],Q=function(e,t,i){var r=3*t;return i[0]=e[r],i[1]=e[r+1],i[2]=e[r+2],i},J=new Float32Array(r.length),ee=new Float32Array(r.length/3*4),te=[0,0,0,1];for(c=0;c<e.length;c++){e[c].itemStyle&&"string"==typeof e[c].itemStyle.color?te=ue=_0x45ccdf(e[c].itemStyle.color):ue=te;ue[3]*=1,ue[3];for(var ie=0;ie<4;ie++)ee[4*c+ie]=ue[ie]}for(c=0;c<w-1;c++)for(var re=0;re<C-1;re++){var ne=4*(c*(C-1)+re)*3;H(c,re,G);for(ie=0;ie<4;ie++)Q(r,G[ie],W);for(ie=0;ie<4;ie++)Q(r,G[ie],W),g.set(W,ne+3*ie),x.set(U[ie],ne/3*4+ie);for(ie=0;ie<6;ie++)X[Y++]=V[ie]+ne/3;for(ie=0;ie<2;ie++){for(var oe=3*ie,ae=0;ae<3;ae++){Q(r,he=G[V[oe]+ae],q[ae])}var se=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e};se(j,q[0],q[1]),se(Z,q[1],q[2]);O=K,R=Z,L=void 0,B=void 0,N=void 0,F=void 0,z=void 0,k=void 0,L=(D=j)[0],B=D[1],N=D[2],F=R[0],z=R[1],k=R[2],O[0]=B*k-N*z,O[1]=N*F-L*k,O[2]=L*z-B*F;for(ae=0;ae<3;ae++){var le=3*G[V[oe]+ae];J[le]=J[le]+K[0],J[le+1]=J[le+1]+K[1],J[le+2]=J[le+2]+K[2]}}}for(c=0;c<J.length/3;c++){Q(J,c,K);S=K,A=void 0,P=void 0,I=void 0,M=void 0,A=(E=K)[0],P=E[1],I=E[2],(M=A*A+P*P+I*I)>0&&(M=1/Math.sqrt(M),S[0]=E[0]*M,S[1]=E[1]*M,S[2]=E[2]*M),J[3*c]=K[0],J[3*c+1]=K[1],J[3*c+2]=K[2]}var ue=[],ce=[];for(c=0;c<w-1;c++)for(re=0;re<C-1;re++){ne=4*(c*(C-1)+re)*4;H(c,re,G);for(ie=0;ie<4;ie++){for(ae=0;ae<4;ae++)ue[ae]=ee[4*G[ie]+ae];b.set(ue,ne+4*ie),Q(J,G[ie],K),v.set(K,ne/4*3+3*ie);var he=G[ie];ce[0]=he%C/(C-1),ce[1]=Math.floor(he/C)/(w-1),y.set(ce,ne/4*2+2*ie)}0}for(c=0;c<g.length;c+=3){g[c]-=_,g[c+1]-=m,g[c+2]-=$;var de=g[c+1],fe=g[c+2];g[c+2]=de,g[c+1]=fe}return{positionAttr:g,normalAttr:v,texcoordAttr:y,barycentricAttr:x,colorAttr:b,indices:X,vertexColors:ee,vertexNormals:J,vertexCount:T}};var _0x28edb2=[0,1];function _0x4c71b9(e,t,i,r){return(i=i||[])[0]=_0x497ccc(e[0],r,[-50,50],_0x1fc685),i[1]=_0x497ccc(e[1],r,[50,-50],_0xf457e4),i[2]=_0x497ccc(e[2],r,[-50,50],_0x5de381),i}function _0x497ccc(e,t,i,r){return _0x143f0b(e=_0x5f29df(e,r),_0x28edb2,i,t)}function _0x5f29df(e,t){var i=t;return i[1]===i[0]?.5:(e-i[0])/(i[1]-i[0])}function _0x143f0b(e,t,i,r){var n=t[1]-t[0],o=i[1]-i[0];if(0===n)return 0===o?i[0]:(i[0]+i[1])/2;if(r)if(n>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/n*o+i[0]}function _0x3c7991(e,t,i,r,n,o){var a;a=_0x4c71b9([e,t,i]),n[3*r]=a[0],n[3*r+1]=a[1],n[3*r+2]=a[2]}function _0x3d39c0(e,t){var i=(t-e)/5,r=_0x3bbecf(i),n=Math.pow(10,r),o=i/n;return i=(o<1.5?1:o<2.5?2:o<4?3:o<7?5:10)*n,r>=-20?+i.toFixed(r<0?-r:0):i}function _0x3bbecf(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}function _0x384998(e,t,i){var r=[];return r[0]=_0x344c28(Math.floor(e/i)*i),r[1]=_0x344c28(Math.ceil(t/i)*i),r}function _0x344c28(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e}var _0x37ec89=(_0x5425f2=!0,function(e,t){var i=_0x5425f2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5425f2=!1,i}),_0x42ef85=_0x37ec89(void 0,(function(){return _0x42ef85.toString().search("(((.+)+)+)+$").toString().constructor(_0x42ef85).search("(((.+)+)+)+$")})),_0x5425f2;_0x42ef85();var _0xf5782b={UNLOAD:0,LOADING:1,LOADED:2,PARSING:3,READY:4,LOST:5},_0x5306a1=new s$P,_0x5c7bd8=25;function _0x4e218d(e,t,i){var r=e.vertexAttributes[0],n=r.typedArray,o=new Float32Array(n.buffer,n.byteOffset,n.byteLength/4),a=r.componentsPerAttribute,s=e.verticesCount,l=new Float32Array(3*s),u=e.attrLocation;u.aRatio=Object.keys(u).length;for(var c=0;c<s;c++){var h=new t$X(o[c*a],o[c*a+1],o[c*a+2]),d=new t$X;y$15.multiplyByPoint(t,h,d);var f=t$W.fromCartesian(d),p=e$27.toDegrees(f.longitude),_=e$27.toDegrees(f.latitude),m=f.height,$=(p-i.left)/(i.right-i.left),g=(_-i.bottom)/(i.top-i.bottom),v=(m-i.minHeight)/(i.maxHeight-i.minHeight);l[3*c]=$,l[3*c+1]=g,l[3*c+2]=v}e.vertexAttributes.push({index:u.aRatio,typedArray:l,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1})}function _0x36e54b(e){if(!e$28(e))throw new t$Z("context is required.");this._context=e,this._gl=e._gl,this._type=oi$2.INSTANCED_LAYER,this._group={},this._visible=!0,this._picking=!1,this._clampToObject=!1,this._profile=!1,this._visibleViewport=4095,this._maxVisibleAltitude=Number.MAX_VALUE,this._maxVisibleDistance=Number.MAX_VALUE,this._minVisibleAltitude=0,this._minVisibleDistance=0,this._filterMode=_0x189b29.DISTANCE_FROM_EYE_POINT,this._filterPixel=0,null!==e.s3tc?this._supportCompressType=1:null!==e.pvrtc?this._supportCompressType=2:null!==e.etc1&&(this._supportCompressType=3),this._isOverLay=!1,this._spatialQueryEnable=!1,this._sqTextures=[],this._sqMode=j$l.Disjoint,this._allColorCommand=[],this._shadowType=_0x121e29.NONE,this._needToRender=!0,this._addedEvent=new o$1o,this._volume=void 0,this._PBRMaterialParams={},this._pbrParameter=je$b.NONE,this._mixColorType=_0x125991.MIX,this._envMapIntensity=1,_0x333f13.S3MBTaskProcessor.scheduleTask({})}function _0x4c82ee(e,t,i){if(e$28(e._profileCommand)||e.createProfileCommand(t),e._profileCommand.derivedCommands={},i){var r=_0x17966c.createClampObjectColorRenderState();e._profileCommand.renderState=u$R.fromCache(r),e._profileCommand.pass=Le$p.ClampObject,e$28(e._stencilCommand)||e.createClampCommand()}else e._profileCommand.renderState=u$R.fromCache({cull:{enabled:group.cullEnabled,face:group.cullFace},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),e.removeProgramDefine(!0,!0,"ClampObject",!0)}function _0x328cb9(e,t){var i=e._group[t],r=e.customRequestHeaders,n=i.state;if(_0xf5782b.UNLOAD==n){var o=o$U(t,(function(e){return o$$(e,r)}));e$28(o)&&(i.state=_0xf5782b.LOADING,o.then((function(e){i._arrayBuffer=e,i.state=_0xf5782b.LOADED}),(function(e){i.state=_0xf5782b.LOST})))}_0xf5782b.LOADED==n&&(e$28(i._arrayBuffer)?_0x298c9f(e,i,i._arrayBuffer):e$28(i._threedmodeling)&&_0x45ddca(e,i._threedmodeling,i))}function _0x23327e(e){return e._shadowType==_0x121e29.SELECTION||e._shadowType==_0x121e29.ALL}function _0x8202b7(e,t){var i=e.instances.length,r=e.renderEntities;if(r&&!(r.length<1)&&0!==i){var n=e.instances.values[0];if(e$28(n)){var o=e$28(n.localTransform)?_0x5c7bd8+8:_0x5c7bd8,a=e.oriCenter,s=e.oriRadius;e.instanceBuffer&&e.instanceBuffer.destroy();for(var l=new Float32Array(i*o),u=0;u<i;u++){(m=e.instances.values[u]).index=u,_0x3e3dff(l,m,u*o)}e.instanceBuffer=h$W.createVertexBuffer({context:t,typedArray:l,usage:A$1c.STATIC_DRAW}),e.instanceBuffer.vertexArrayDestroyable=!1;u=0;for(var c=r.length;u<c;u++){var h=r[u],d=h._colorCommand;d.vertexArray.destroy();for(var f=0;f<h.attributes.length;f++){var p=h.attributes[f];e$28(p.instanceDivisor)&&p.instanceDivisor>0&&(p.vertexBuffer=e.instanceBuffer)}d.vertexArray=new m$19({context:t,attributes:h.attributes,indexBuffer:h.indexBuffer}),d.instanceCount=i;for(var _=0;_<i;_++){var m;if((m=e.instances.values[_]).index=_,m.oriCenter=a,m.oriRadius=s,!e$28(m.boundingSphere)){m.boundingSphere=new i$19;var $=t$X.maximumComponent(m.scale);m.boundingSphere.radius=s*$;var g=m$1b.eastNorthUpToFixedFrame(m.position,t$V.WGS84,new y$15);y$15.multiplyByPoint(g,a,m.boundingSphere.center)}}}e.instanceCount=i,e.dirty=!1}}}function _0x3e3dff(e,t,i){var r=t$X.clone(t._offsetPosition),n=t._quaternion;if(t._mode===P$$.COLUMBUS_VIEW){var o=p$1a.fromRotationY(-Math.PI/2),a=n$14.fromRotationMatrix(o);n$14.multiply(n,a,n)}var s=t._scale,l=i$Q.fromCartesian(r),u=t.visible?l.high:t$X.ZERO,c=t.visible?l.low:t$X.ZERO,h=t._color,d=t._pickColor,f=t._offset,p=t.oriRadius,_=t.localTranslation,m=t.localQuaternion,$=0;e[i+$++]=u.x,e[i+$++]=u.y,e[i+$++]=u.z,e[i+$++]=c.x,e[i+$++]=c.y,e[i+$++]=c.z,e[i+$++]=n.x,e[i+$++]=n.y,e[i+$++]=n.z,e[i+$++]=n.w,e[i+$++]=s.x,e[i+$++]=s.y,e[i+$++]=s.z,e[i+$++]=p,e[i+$++]=h.red,e[i+$++]=h.green,e[i+$++]=h.blue,e[i+$++]=h.alpha,e[i+$++]=d.x,e[i+$++]=d.y,e[i+$++]=d.z,e[i+$++]=d.w,e[i+$++]=f.x,e[i+$++]=f.y,e[i+$++]=f.z,e$28(_)&&(e[i+$++]=_.x,e[i+$++]=_.y,e[i+$++]=_.z,e[i+$++]=1),e$28(m)&&(e[i+$++]=m.x,e[i+$++]=m.y,e[i+$++]=m.z,e[i+$++]=m.w)}function _0x15dbff(e){var t=(e=e||{}).arrIndexPackage,i=e.vertexPackage,r=e.mapPass;if(!(e.arrIndexPackage&&e.vertexPackage&&e.collection&&e.mapPass))throw new t$Z("gl texture indexes vertexes collection is required to create RenderEntityPagelod");this._arrIndexPackage=t,this._vertexPackage=i,this._collection=e.collection,this._attributeLocations={},this._initialize=!1,this._matModel=u$Y(e.matModel,y$15.IDENTITY),this._mapPass=r,this._colorCommand=void 0,this._stencilCommand=void 0,this._profileCommand=void 0,this._spatialQueryCommand=void 0,this._boundingVolume=e.boundingVolume,this._ownerGroup=e.ownerGroup}function _0x45ddca(e,t,i){i.state=_0xf5782b.PARSING;for(var r=new t$X,n=[],o=Number.MAX_VALUE,a=Number.MIN_VALUE,s=0;s<t.vertexCount;s++)t$X.fromArray(t.positionAttr,3*s,r),n.push(t$X.clone(r)),o=Math.min(o,r.y),a=Math.max(a,r.y);var l=y$15.clone(y$15.IDENTITY,new y$15),u=i$19.fromPoints(n,new i$19);i$19.transform(u,l,u);var c=new _0x15dbff({vertexPackage:{vertexAttributes:[{index:0,typedArray:t.positionAttr,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1},{index:1,typedArray:t.colorAttr,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0},{index:2,typedArray:t.normalAttr,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0}],attrLocation:{aPosition:0,aColor:1,aNormal:2},instanceCount:0,instanceMode:0,instanceIndex:-1,verticesCount:t.vertexCount},arrIndexPackage:[{indicesTypedArray:t.indices,indexType:0,primitiveType:4}],mapPass:{},boundingVolume:u,collection:e,ownerGroup:i,matModel:l});c.initialize(e),i.renderEntities.push(c),i._threedmodeling=void 0,i.state=_0xf5782b.READY,i.ready=!0,e._addedEvent.raiseEvent(i.url)}function _0x5ddd99(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function _0x79a6c7(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function _0x298c9f(e,t,i){var r,n={buffer:i,supportCompressType:e._supportCompressType},o=!1;if(t.url.endsWith("s3mb")||/\.(x|X|dae|DAE|osgb)$/.test(t.url)){if(/\.(x|X|dae|DAE|osgb)$/.test(t.url)&&(n.isOSGB=!0),n.suffix=t.url.substring(t.url.lastIndexOf(".")+1),o=!0,_0x333f13.init||_0x333f13.initWebAssembly(),!_0x333f13.taskProcessorReady)return;r=_0x333f13.S3MBTaskProcessor.scheduleTask(n,[i])}else r=_0x333f13.S3MTaskProcessor.scheduleTask(n,[i]);e$28(r)?(t.state=_0xf5782b.PARSING,t._arrayBuffer=void 0,r.then((function(i){i.result?(o?_0x46db9d(i,t,e):_0x336bc6(i,t,e),t.ready=!0,t.dirty=!1,t.state=_0xf5782b.READY):t.state=_0xf5782b.UNLOAD})).otherwise((function(e){console.log(e)})).then((function(){e._addedEvent.raiseEvent(t.url)}))):t.state=_0xf5782b.LOADED}function _0x46db9d(e,t,i){i._gl;var r=i._context,n=e.groupNode,o=e.geoPackage,a=e.matrials.material,s={},l=0,u=0,c=o$1q.defer();a.map((function(i){var n=i.material,o=n.id,a=new _0x34bd01({});s[o]=a,a.createCommonParamter(n),a.createPBRParamter(n);var h=n.textureunitstates;l+=h.length;for(var d=0;d<h.length;d++){var f=h[d].textureunitstate,p=f.id,_=0===f.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,m=0===f.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;a._texMatrix=y$15.unpack(f.texmodmatrix);var $=e.texturePackage[p],g=p;if(e$28($))(!e$27.isPowerOfTwo($.width)||!e$27.isPowerOfTwo($.height))&&(_=q$11.CLAMP_TO_EDGE,m=q$11.CLAMP_TO_EDGE);if(e$28($)||!p.endsWith("jpg")&&!p.endsWith("png")){if(e$28($)&&$.width>0&&$.height>0&&$.imageBuffer.length>0){var v=Se$8.CreateTexture(g,r,$.width,$.height,$.nFormat,$.compressType,$.imageBuffer,!1,_,m),y=p.indexOf("PBRMaterialParam")>-1,x=a._emissiveTextureIndex===d,b=a._normalTextureIndex===d,w=a._metallicRoughnessTextureIndex===d,C=a._occlusionTextureIndex===d;y?(a._usePBRTextureBatch=!0,a.pbrParamTexture=v):x?a.emissiveTexture=v:b?a.normalTexture=v:w?a.metallicRoughnessTexture=v:C?a.occlusionTexture=v:a._textures.push(v)}c.resolve()}else{var T=t.url.substring(0,t.url.lastIndexOf("/")+1)+p;o$$(T).then((function(e){var t=T.endsWith("jpg")?"jpg":"png";a.createJPGPNG(g,r,d,e,_,m,t).then((function(e){++u==l&&c.resolve()})).otherwise((function(){++u==l&&c.resolve()}))})).otherwise((function(){++u==l&&c.resolve()}))}}c.resolve()})),c.promise.then((function(){var r=n.pageLods,a=[],l=new i$19;r.forEach((e=>{e.boundingSphere&&a.push(e.boundingSphere)})),i$19.fromBoundingSpheres(a,l);for(var u=0;u<r.length;u++){r[u].geodes.map((function(r){for(var n=r.matrix,a=r.skeletonNames,u=0;u<t.instances.length;u++){var c=t.instances.values[u];c.oriCenter=t$X.clone(l.center),c.oriRadius=l.radius,e$28(t.oriCenter)||(t.oriCenter=c.oriCenter,t.oriRadius=c.oriRadius);var h=c.position,d=m$1b.eastNorthUpToFixedFrame(h,t$V.WGS84,new y$15),f=i$19.transform(l,d,new i$19);c.boundingSphere=f}for(var p=0;p<a.length;p++){for(var _=a[p],m=o[_],$=m.vertexPackage,g=m.arrIndexPackage,v={},y=0;y<g.length;y++){var x=g[y];if(e$28(x)){var b=x.materialCode,w=s[b];v[b]=w}}var C=new _0x15dbff({vertexPackage:$,arrIndexPackage:g,version:e.version,mapPass:v,collection:i,ownerGroup:t,matModel:n});C.initialize(i),t.renderEntities.push(C)}}))}}))}function _0x336bc6(e,t,i){i._gl;for(var r=i._context,n=_0x5306a1.read(e.xmlDoc).firstChild,o=n.namespaceURI,a=_0x52b0e4(_0x2ea73a(n,"Material3Ds",o),"material",o),s={},l=0,u=a.length;l<u;l++){var c=a[l],h=_0x3f8b86(c,"name",o),d=new _0x34bd01({});s[h]=d;var f=_0x2ea73a(c,"Ambient",o),p=_0x2286b7(f,"AmbientR",o),_=_0x2286b7(f,"AmbientG",o),m=_0x2286b7(f,"AmbientB",o),$=_0x2286b7(f,"AmbientA",o);d._ambientColor=new e$1S(p,_,m,$);var g=_0x2ea73a(c,"Diffuse",o);p=_0x2286b7(g,"DiffuseR",o),_=_0x2286b7(g,"DiffuseG",o),m=_0x2286b7(g,"DiffuseB",o),$=_0x2286b7(g,"DiffuseA",o),d._diffuseColor=new e$1S(p,_,m,$);var v=_0x2ea73a(c,"Specular",o);p=_0x2286b7(v,"SpecularR",o),_=_0x2286b7(v,"SpecularG",o),m=_0x2286b7(v,"SpecularB",o),$=_0x2286b7(v,"SpecularA",o),d._specularColor=new e$1S(p,_,m,$);var y=_0x2286b7(c,"Shininess",o);d._shininess=y,_0x2ea73a(c,"TransparentSorting",o),d._bTransparentSorting=_0x778b46(c,"TransparentSorting",o)||d._diffuseColor.alpha<1;var x=_0x2ea73a(c,"texture",o),b=_0x3f8b86(x,"name",o),w=_0x2ea73a(x,"AddressMode",o),C=_0x3f8b86(w,"u",o),T=_0x3f8b86(w,"v",o);C="TAM_WRAP"===C?q$11.REPEAT:q$11.CLAMP_TO_EDGE,T="TAM_WRAP"===T?q$11.REPEAT:q$11.CLAMP_TO_EDGE;var S=e.texturePackage[b];if(e$28(S)){b=r._id+"_"+b,(!e$27.isPowerOfTwo(S.width)||!e$27.isPowerOfTwo(S.height))&&(C=q$11.CLAMP_TO_EDGE,T=q$11.CLAMP_TO_EDGE);var E=Se$8.CreateTexture(b,r,S.width,S.height,S.nFormat,S.compressType,S.imageBuffer,!1,C,T);d._textures.push(E),0===S.compressType&&(i._supportCompressType=0)}}var A=_0x2da67f(_0x2ea73a(n,"PageLods",o),"Geode",o);for(l=0,u=A.length;l<u;l++){for(var P=[],I=A[l],M=_0x3f8b86(I,"GeoDeModMatrix",o).split(","),O=0;O<16;O++)M[O]=parseFloat(M[O]);M=y$15.unpack(M,0);for(var D=_0x2da67f(I,"GeoName",o),R=[],L=0,B=D.length;L<B;L++){var N=D[L].textContent.trim();-1===R.indexOf(N)&&R.push(N)}for(var F=new i$19,z=0;z<R.length;z++){if(e$28(J=e.geoPackage[R[z]])){var k=_0x37bd5f(ee=J.vertexPackage,M);P.push(k)}}if(P.length>0){var V=i$19.fromBoundingSpheres(P,new i$19),U=!1;t.instances.length>0&&e$28(t.instances.values[0].localTransform)&&(i$19.transform(V,t.instances.values[0].localTransform,V),U=!0);for(var X=[],H=0;H<t.instances.length;H++){var G=t.instances.values[H];G.oriCenter=t$X.clone(V.center),G.oriRadius=V.radius,e$28(t.oriCenter)||(t.oriCenter=G.oriCenter,t.oriRadius=G.oriRadius);var W=G.position,Y=m$1b.eastNorthUpToFixedFrame(W,t$V.WGS84,new y$15),q=i$19.transform(V,Y,new i$19),j=U?1:t$X.maximumComponent(G.scale);q.radius=q.radius*j,G.boundingSphere=q,X.push(q)}i$19.fromBoundingSpheres(X,F)}var Z=new y$15;if(e$28(i._volume)){var K=t.instances.values[0]._offsetPosition,Q=new i$10;Y=m$1b.headingPitchRollToFixedFrame(K,Q,t$V.WGS84,m$1b.eastNorthUpToFixedFrame);Z=y$15.multiply(Y,M,Z),Z=y$15.multiplyByScale(Z,t.instances.values[0].scale,Z)}for(B=0;B<R.length;B++){var J;if(e$28(J=e.geoPackage[R[B]])){var ee=J.vertexPackage,te=J.arrIndexPackage,ie={};for(var re in te){var ne=te[re];if(e$28(ne)){d=s[h=ne.materialCode];ie[h]=d}}e$28(i._volume)&&_0x4e218d(ee,Z,i._volume._volBounds);var oe=new _0x15dbff({vertexPackage:ee,arrIndexPackage:te,version:e.version,mapPass:ie,boundingVolume:F,collection:i,ownerGroup:t,matModel:M});oe.initialize(i),t.renderEntities.push(oe)}}}}function _0x37bd5f(e,t){for(var i=[],r=new i$19,n=new t$X,o=(new t$X,e.vertexAttributes[0]),a=o.componentsPerAttribute,s=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4),l=0;l<e.verticesCount;l++)t$X.fromArray(s,a*l,n),i.push(t$X.clone(n));return i$19.fromPoints(i,r),i.length=0,i$19.transform(r,t,r),r}function _0x2ea73a(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(e$28(i)){if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}else if(a.localName===t)return a}}function _0x2da67f(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];e$28(i)?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}}function _0x52b0e4(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];e$28(i)?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}function _0x2286b7(e,t,i){var r=_0x2ea73a(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function _0x3f8b86(e,t,i){var r=_0x2ea73a(e,t,i);if(e$28(r))return r.textContent.trim()}function _0x778b46(e,t,i){var r=_0x2ea73a(e,t,i);if(e$28(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function _0x5dced0(e,t,i,r,n){var o=e$28(n)?_0x5c7bd8+8:_0x5c7bd8,a=S$W.getSizeInBytes(S$W.FLOAT),s=0;t.aPosHigh=i++,e.push({index:t.aPosHigh,vertexBuffer:r.instanceBuffer,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:s,strideInBytes:a*o,instanceDivisor:1}),s+=3,t.aPosLow=i++,e.push({index:t.aPosLow,vertexBuffer:r.instanceBuffer,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=3,t.aQuaternion=i++,e.push({index:t.aQuaternion,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4,t.aScaleAndRadius=i++,e.push({index:t.aScaleAndRadius,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4,t.aColor2=i++,e.push({index:t.aColor2,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4,t.aPickColor=i++,e.push({index:t.aPickColor,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4,t.aOffset=i++,e.push({index:t.aOffset,vertexBuffer:r.instanceBuffer,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=3,e$28(n)&&(t.aLocalTranslation=i++,e.push({index:t.aLocalTranslation,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4,t.aLocalQuaternion=i++,e.push({index:t.aLocalQuaternion,vertexBuffer:r.instanceBuffer,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:a*s,strideInBytes:a*o,instanceDivisor:1}),s+=4)}function _0x520314(e,t,i){var r=t.layer,n={uTexture:function(){return t.texture||r._context._defaultTexture},uHasNormal:function(){return t.hasNormal},uAmbientColor:function(){return r._mixColorType===_0x125991.REPLACE?e$1S.WHITE:t.ambientColor},uDiffuseColor:function(){return r._mixColorType===_0x125991.REPLACE?e$1S.WHITE:t.diffuseColor},uSpecularColor:function(){return t.specularColor},uShininess:function(){return t.shininess},uPicking:function(){return t.layer._picking},uGeoMat:function(){return t.geoMat},uRangeMode:function(){return r.filterMode},uVisibleDistance:function(){return new o$1k(r.maxVisibleDistance,r.minVisibleDistance)},uFilterPixel:function(){return r.filterPixel},uFillColor:function(){return t.diffuseColor},uVolumeTexture:function(){return r._volume._volTexture},width:function(){return r._volume._volImageBuffer.nWidth},height:function(){return r._volume._volImageBuffer.nHeight},depth:function(){return r._volume._volImageBuffer.nDepth},sideBlockCount:function(){return r._volume._volImageBuffer.nSideBlockCount},blockLength:function(){return r._volume._volImageBuffer.nBlockLength},texLength:function(){return r._volume._volImageBuffer.nLength},uFilterMode:function(){var e=0;return e$28(r._volume.hypsometricSetting)&&r._volume.hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(e=1),e},uMixColorType:function(){return r._mixColorType},uDataFloor:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.ColorTableMinKey:0},uDataCeil:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.ColorTableMaxKey:0},uVolumeType:function(){return e$28(r._volume.hypsometricSetting)&&r._volume.hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?0:1},uHypOpacity:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.Opacity:1},uHypContourInterval:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.LineInterval:100},uHypLineColor:function(){var e=new e$25(0,1,1,1);return e$28(r._volume.hypsometricSetting)&&(e.x=r._volume.hypsometricSetting.LineColor.red,e.y=r._volume.hypsometricSetting.LineColor.green,e.z=r._volume.hypsometricSetting.LineColor.blue,e.w=r._volume.hypsometricSetting.LineColor.alpha),e},uHypContourFillMode:function(){var e=1;if(e$28(r._volume.hypsometricSetting))switch(r._volume.hypsometricSetting.DisplayMode){case k$T.DisplayMode.NONE:e=0;break;case k$T.DisplayMode.FACE:e=1;break;case k$T.DisplayMode.LINE:e=2;break;case k$T.DisplayMode.FACE_AND_LINE:e=3}return e},uHypFloor:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.ColorTableMinKey:0},uHypCeil:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.ColorTableMaxKey:0},uHypMaxVisibleValue:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.MaxVisibleValue:0},uHypMinVisibleValue:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.MinVisibleValue:0},uNoValueColor:function(){return e$28(r._volume.hypsometricSetting)?r._volume.hypsometricSetting.noValueColor:e$1S.WHITE},uHypsometricVisible:function(){return 1},uHypHasAnalysisRegion:function(){return 0},uHypsometricRenderTexture:function(){return 0},uHypsometricTexture:function(){return r._volume._hypsometricTexture},uBaseColorFactor:function(){return e$28(i._baseColor)?i._baseColor:r._PBRMaterialParams[t.groupName].baseColorFactor},uBaseColorTextureIndex:function(){return i._baseColorTextureIndex>-1?i._baseColorTextureIndex:r._PBRMaterialParams[t.groupName].baseColorTextureIndex},uMetallicFactor:function(){return e$28(i._metallicFactor)?i._metallicFactor:r._PBRMaterialParams[t.groupName].metallic},uRoughnessFactor:function(){return e$28(i._roughnessFactor)?i._roughnessFactor:r._PBRMaterialParams[t.groupName].roughness},uEmissiveFactor:function(){return e$28(i._emissiveFactor)?i._emissiveFactor:r._PBRMaterialParams[t.groupName].emissionFactor},uNormalTextureScale:function(){return e$28(i._normalTextureScale)?i._normalTextureScale:r._PBRMaterialParams[t.groupName].normalTextureScale},uEmissionTexture:function(){return e$28(i.emissiveTexture)&&i._emissiveTextureIndex>-1?i.emissiveTexture:i._textures[i._emissiveTextureIndex]},uEmissiveUVOffsetAndTiling:function(){var e=i._emissiveTextureMotion,t=new e$25,r=performance.now()/1e3,n=e.OffsetPeriod,o=e.OffsetSpeedU,a=e.OffsetSpeedV,s=e.TilingPeriod,l=e.TilingSpeedU,u=e.TilingSpeedV;if(e&&n>0){var c=r%n;t.x=c*o,t.y=c*a}else t.x=0,t.y=0;if(e&&s>0){var h=r%s;t.z=1+h*l,t.w=1+h*u}else t.z=1,t.w=1;return t},uBaseTexture:function(){return e$28(i.baseColorTexture)&&i._baseColorTextureIndex>-1?i.baseColorTexture:r._PBRMaterialParams[t.groupName].baseTexture},uNormalTexture:function(){return e$28(i.normalTexture)&&i._normalTextureIndex>-1?i.normalTexture:r._PBRMaterialParams[t.groupName].normalTexture},uMetallicRoughnessTexture:function(){return e$28(i.metallicRoughnessTexture)&&i._metallicRoughnessTextureIndex>-1?i.metallicRoughnessTexture:r._PBRMaterialParams[t.groupName].metallicRoughnessTexture},uOcclusionTexture:function(){return e$28(i.occlusionTexture)&&i._occlusionTextureIndex>-1?i.occlusionTexture:r._PBRMaterialParams[t.groupName].occlusionTexture},uEnvMapIntensity:function(){return r._envMapIntensity},uCameraReflect:function(){return r._frameState.camera.bReflect?-1:1}};n=p$17(n,i.createPBRUniformMap()),n=p$17(n,r._frameState.lightSource.createUniformMap()),e.uniformMap=n}function _0x3d266a(e,t,i,r){var n=t$S.createIfNeeded(t).fetchImage().then((function(t){var n=new L$17({context:e,source:t,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT,minificationFilter:tt$h.LINEAR_MIPMAP_LINEAR,magnificationFilter:tt$h.LINEAR})});!e$27.isPowerOfTwo(n.width)||!e$27.isPowerOfTwo(n.height)||n.generateMipmap(S$N.NICEST),i[r]=n})).otherwise((function(){i[r]=void 0}));i[r]=n}function _0x182a4d(e,t){if(e$28(e._group[t])&&e._group[t].renderEntities.length>0)for(var i=e._group[t].renderEntities,r=0;r<i.length;r++)e$28(i[r]._colorCommand)&&(e$28(e._PBRMaterialParams[t])&&e$28(e._PBRMaterialParams[t].roughness)?(i[r].appendProgramDefine(!1,!0,H$r.BRDF,!1),e._PBRMaterialParams[t].baseColorTextureIndex>-1&&e$28(e._PBRMaterialParams[t].baseTexture)&&i[r].appendProgramDefine(!1,!0,H$r.HAS_BASE_TEXTURE,!1),e._PBRMaterialParams[t].normalTextureIndex>-1&&e$28(e._PBRMaterialParams[t].normalTexture)&&i[r].appendProgramDefine(!1,!0,H$r.HAS_NORMAL_TEXTURE,!1),e._PBRMaterialParams[t].emissionTextureIndex>-1&&i[r].appendProgramDefine(!1,!0,H$r.HAS_EMISSIVE_TEXTURE,!1),e$28(e._frameState.specularEnvironmentMaps)&&i[r].appendProgramDefine(!1,!0,H$r.IBL,!1)):(i[r].removeProgramDefine(!1,!0,H$r.BRDF,!1),i[r].removeProgramDefine(!1,!0,H$r.HAS_BASE_TEXTURE,!1),i[r].removeProgramDefine(!1,!0,H$r.HAS_NORMAL_TEXTURE,!1),i[r].removeProgramDefine(!1,!0,H$r.HAS_EMISSIVE_TEXTURE,!1),i[r].removeProgramDefine(!1,!0,H$r.IBL,!1)))}Object.defineProperties(_0x36e54b.prototype,{type:{get:function(){return this._type}},group:{get:function(){return this._group}},visible:{get:function(){return this._visible},set:function(e){o$1u.typeOf.bool("value",e),this._visible=e}},maxVisibleAltitude:{get:function(){return this._maxVisibleAltitude},set:function(e){o$1u.typeOf.number("maxVisibleAltitude",e),this._maxVisibleAltitude=e}},maxVisibleDistance:{get:function(){return this._maxVisibleDistance},set:function(e){o$1u.typeOf.number("maxVisibleDistance",e),this._maxVisibleDistance=e}},minVisibleDistance:{get:function(){return this._minVisibleDistance},set:function(e){o$1u.typeOf.number("minVisibleDistance",e),this._minVisibleDistance=e}},minVisibleAltitude:{get:function(){return this._minVisibleAltitude},set:function(e){o$1u.typeOf.number("minVisibleAltitude",e),this._minVisibleAltitude=e}},filterMode:{get:function(){return this._filterMode},set:function(e){o$1u.typeOf.number("filterMode",e),this._filterMode=e}},filterPixel:{get:function(){return this._filterPixel},set:function(e){o$1u.typeOf.number("filterPixel",e),this._filterPixel=e}},isOverLay:{get:function(){return this._isOverLay},set:function(e){o$1u.typeOf.bool("value",e),this._isOverLay=e}},clampToObject:{get:function(){return this._clampToObject},set:function(e){if(o$1u.typeOf.bool("value",e),this._clampToObject!==e){this._clampToObject=e;var t=this._group;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(!r.ready)continue;for(var n=0,o=r.renderEntities.length;n<o;n++){var a=r.renderEntities[n];this._profile?_0x4c82ee(a,this,e):e$28(a._colorCommand)&&(a._colorCommand.derivedCommands={},a.createColorRenderState(r,e),e?(a._colorCommand.pass=Le$p.ClampObject,e$28(a._stencilCommand)||a.createClampCommand(),a.appendProgramDefine(!0,!0,"ClampObject",!1)):a.removeProgramDefine(!0,!0,"ClampObject",!1))}}}}},shadowType:{get:function(){return this._shadowType},set:function(e){this._shadowType!==e&&(this._shadowType=e,this._updateShadow(this))}},addedEvent:{get:function(){return this._addedEvent}},mixColorType:{get:function(){return this._mixColorType},set:function(e){this._mixColorType!==e&&(this._mixColorType=e)}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders!==e&&(this._customRequestHeaders=e)}}}),_0x36e54b.prototype.add=function(e,t,i,r){o$1u.defined("url",e),o$1u.typeOf.string("url",e),o$1u.defined("attrs",t),Array.isArray(t)||(t=[t]),e$28(this._group[e])||(this._group[e]={instances:new e$1P,ready:!1,state:e$28(i)?_0xf5782b.LOADED:_0xf5782b.UNLOAD,instanceCount:0,instanceBuffer:void 0,renderEntities:[],cullEnabled:!1,cullFace:k$11.BACK,oriCenter:void 0,oriRadius:void 0,dirty:!1,url:e});for(var n=this._group[e],o=this._context,a=0,s=t.length;a<s;a++){var l=t[a],u=u$Y(l.id,n.instances.length);if(n.instances.contains(u))console.log("id "+u+" exist");else{l.sceneMode=this._context._us._mode;var c=new _0x375cb8(o,u,n,l);n.instances.set(u,c)}}if(e$28(i))if(r=u$Y(r,!0),i instanceof Blob){var h=new FileReader,d=this;h.addEventListener("load",(function(){if(r){var t=new Uint8Array(h.result).buffer;d._group[e]._arrayBuffer=t}else d._group[e]._arrayBuffer=h.result})),h.addEventListener("error",(function(){})),h.readAsArrayBuffer(i)}else if(i instanceof ArrayBuffer)if(r){var f=i;this._group[e]._arrayBuffer=f}else this._group[e]._arrayBuffer=i;else{var p=_0x11c7a0.getDataShape(i);n=_0x11c7a0.updateSurfaceMesh(i,p,!0);this._group[e]._threedmodeling=n}n.dirty=!0},_0x36e54b.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},_0x36e54b.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},_0x36e54b.prototype.removeCollection=function(e){o$1u.defined("removeCollection url",e);var t=this._group[e];if(!e$28(t))return!1;for(var i=0,r=t.renderEntities.length;i<r;i++)t.renderEntities[i].destroy();return t.renderEntities.length=0,t.instances.removeAll(),this._group[e]=null,delete this._group[e],!0},_0x36e54b.prototype.getInstance=function(e,t){o$1u.defined("S3MInstanceCollection getInstance url",e),o$1u.defined("S3MInstanceCollection getInstance id",t);var i=this._group[e];if(e$28(i))return i.instances.get(t)},_0x36e54b.prototype.removeInstance=function(e,t){o$1u.defined("removeInstance url",e),o$1u.defined("removeInstance ids",t),Array.isArray(t)||(t=[t]);var i=this._group[e];if(!e$28(i))return!1;for(var r,n=0,o=t.length;n<o;n++){var a=t[n];e$28(r=i.instances.get(a))&&(r.updateColor(e$1S.WHITE.withAlpha(0),r.id),r.isDeleted=!0,i.instances.remove(a),r=null,this._group[e].dirty=!0)}return!0},_0x36e54b.prototype.setCullEnabled=function(e,t){o$1u.typeOf.string("S3MInstanceCollection setCullEnabled url",e),t=u$Y(t,k$11.BACK);var i=this._group[e];if(e$28(i)&&(!i.cullEnabled||i.cullFace!==t)&&(i.cullEnabled=!0,i.cullFace=t,i.ready))for(var r=0,n=i.renderEntities.length;r<n;r++){var o=i.renderEntities[r],a=u$R.getState(o._colorCommand.renderState);a.cull.enabled=!0,a.cull.face=t,o._colorCommand.renderState=u$R.fromCache(a)}},_0x36e54b.prototype.setUnSelected=function(){var e=this._group;if(e$28(e))for(var t in e){var i=e[t];if(e$28(i.instances)&&!(i.instances.length<1))for(var r=0,n=i.instances.length;r<n;r++){i.instances.values[r].setUnSelected()}}},_0x36e54b.prototype.update=function(e){if(e.multiViewportIndex>-1&&!this.getVisibleInViewport(e.multiViewportIndex))return;if(this._visible){if(e$28(this._volume)){if(!this._volume._ready)return;this._volume.loadTexture(this._context)}var t=e.camera;if(!(t.positionCartographic.height>this._maxVisibleAltitude||t.positionCartographic.height<this._minVisibleAltitude)){this._frameState=e;var i=e.commandList,r=this._group,n=e.passes;for(var o in this._picking=n.pick,this._allColorCommand=[],r){var a=r[o];if(_0x328cb9(this,o),a.ready){a.dirty&&_0x8202b7(a,this._context);for(var s=[],l=!1,u=0;u<a.instances.length;u++){var c=a.instances.values[u];0===u&&(l=c.color.alpha<1);var h=c.boundingSphere;s.push(h)}for(var d=i$19.fromBoundingSpheres(s,new i$19),f=0,p=a.renderEntities.length;f<p;f++){var _=a.renderEntities[f];if(this._clampToObject&&this._profile){if(e._fboState.frameBufferType===L$T.CLAMP)_._stencilCommand.boundingVolume=d,i.push(_._stencilCommand),_._profileCommand.boundingVolume=d,_._profileCommand.instanceCount=a.instanceCount,_._profileCommand.pass=Le$p.ClampObject,i.push(_._profileCommand);else if(this._spatialQueryEnable){e$28(_._spatialQueryCommand)||_.createSpatialQueryCommand(this);var m=3===this._sqTextures.length?_._spatialQueryCommand:_._colorCommand;m.boundingVolume=d,m.instanceCount=a.instanceCount,m.pass=this._isOverLay?Le$p.OVERLAY_AGAINST_DEPTH:l?Le$p.TRANSLUCENT:Le$p.OPAQUE,e._fboState.enabled||i.push(m)}}else this._clampToObject&&(_._stencilCommand.boundingVolume=d,i.push(_._stencilCommand)),_._colorCommand.boundingVolume=d,_._colorCommand.instanceCount=a.instanceCount,_._colorCommand.pass=this._isOverLay?Le$p.OVERLAY_AGAINST_DEPTH:this._clampToObject?Le$p.ClampObject:l?Le$p.TRANSLUCENT:Le$p.OPAQUE,this._needToRender&&i.push(_._colorCommand),this._allColorCommand.push(_._colorCommand)}}}}}},_0x36e54b.prototype.isDestroyed=function(){return!1},_0x36e54b.prototype._updateShadow=function(e){var t=_0x23327e(e),i=e._group;for(var r in i){var n=i[r];if(n.ready)for(var o=0,a=n.renderEntities.length;o<a;o++){var s=n.renderEntities[o];s._colorCommand.castShadows=t,s._colorCommand.receiveShadows=t}}},_0x36e54b.prototype.destroy=function(){for(var e in this._group){var t=this._group[e];if(t.ready){for(var i=0;i<t.renderEntities.length;i++){var r=t.renderEntities[i]._colorCommand;if(e$28(r.vertexArray)&&!r.vertexArray.isDestroyed()){r.vertexArray._indexBuffer.vertexArrayDestroyable=!0;for(var n=0;n<r.vertexArray._attributes.length;n++){r.vertexArray._attributes[n].vertexBuffer.vertexArrayDestroyable=!0}r.vertexArray=r.vertexArray.destroy()}r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy()}t.instanceBuffer=t.instanceBuffer&&!t.instanceBuffer.isDestroyed()&&t.instanceBuffer.destroy()}}return this._group=void 0,this._allColorCommand=[],i$Z(this)},_0x15dbff.prototype.initialize=function(e){this._initialize||(this.createCommand(e),this._initialize=!0)},_0x15dbff.prototype.createVertexData=function(e){for(var t=this._vertexPackage.vertexAttributes,i=0,r=t.length;i<r;i++){var n=t[i];!e$28(n.typedArray)||(n.vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:n.typedArray,usage:A$1c.STATIC_DRAW}),n.vertexBuffer.vertexArrayDestroyable=!1,n.typedArray=null,delete n.typedArray)}if(!e$28(this._ownerGroup.instanceBuffer)){var o=this._ownerGroup.instances,a=void 0;o.length>0&&(a=o.values[0].localTransform);var s=o.length;this._ownerGroup.instanceCount=s;var l=e$28(a)?_0x5c7bd8+8:_0x5c7bd8,u=new Float32Array(s*l);for(i=0;i<s;i++){var c=o.values[i];c.index=i,_0x3e3dff(u,c,i*l)}this._ownerGroup.instanceBuffer=h$W.createVertexBuffer({context:e,typedArray:u,usage:A$1c.STATIC_DRAW})}this._attributeLocations=this._vertexPackage.attrLocation;var h=Object.keys(this._attributeLocations).length;return _0x5dced0(t,this._attributeLocations,h,this._ownerGroup,a),t},_0x15dbff.prototype.createCommand=function(e){var t=e._context,i=this.createVertexData(t),r=Le$p.S3MTiles+2;if(e$28(this._arrIndexPackage)&&e$28(this._arrIndexPackage[0])){var n=this._arrIndexPackage[0],o=this._vertexPackage.verticesCount,a=ce$v.UNSIGNED_SHORT;(1===n.indexType||o>=e$27.SIXTY_FOUR_KILOBYTES)&&t.elementIndexUint&&(a=ce$v.UNSIGNED_INT);var s=h$W.createIndexBuffer({context:t,typedArray:n.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:a});s.vertexArrayDestroyable=!1,this.indexBuffer=s,this.attributes=i;var l=this._mapPass[n.materialCode]||_0x34bd01.Default;this._arrIndexPackage[0]=null,!0===l._bTransparentSorting&&(r=Le$p.S3MTiles+3);var u=W$_.TRIANGLES;switch(n.primitiveType){case 1:u=W$_.POINTS;break;case 2:u=W$_.LINES;break;case 4:u=W$_.TRIANGLES}r=e._isOverLay?Le$p.OVERLAY_AGAINST_DEPTH:r;var c=new r$15({primitiveType:u,boundingVolume:this._boundingVolume,pass:r,owner:this,cull:!0});e._shadowType===_0x121e29.ALL||e._shadowType===_0x121e29.SELECTION?(c.castShadows=!0,c.receiveShadows=!0):(c.castShadows=!1,c.receiveShadows=!1),c.pickId="vPickColor",c.instanceCount=this._ownerGroup.instances.length,c.vertexArray=new m$19({context:t,attributes:i,indexBuffer:s});var h=new a$$({name:"S3MInstanceCollectionVertex",sources:[_0x5a8ca1]}),d=new a$$({name:"S3ModelFP",sources:[_0x9293b3]});if(0===this._collection._supportCompressType&&d.defines.push("FLIP_Y"),e$28(this._attributeLocations.aColor)&&h.defines.push("VertexColor"),l._textures.length>0&&e$28(this._attributeLocations.aTexCoord0)&&d.defines.push("TEXTURE"),e$28(this._attributeLocations.aNormal)&&(h.defines.push(H$r.HAS_NORMAL),d.defines.push(H$r.HAS_NORMAL)),e$28(e._volume)&&(h.defines.push(H$r.VOLUME),d.defines.push(H$r.VOLUME),e._volume.hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(h.defines.push(H$r.VOLUME2),d.defines.push(H$r.VOLUME2))),this._collection.clampToObject&&(h.defines.push("ClampObject"),d.defines.push("ClampObject")),e$28(e._frameState.lightSource)){var f=e._frameState.lightSource.directionalLight;h.defines.push(H$r.DIR_LIGHTS+f.length),d.defines.push(H$r.DIR_LIGHTS+f.length);var p=e._frameState.lightSource.pointLight;h.defines.push(H$r.POINT_LIGHTS+p.length),d.defines.push(H$r.POINT_LIGHTS+p.length);var _=e._frameState.lightSource.spotLight;h.defines.push(H$r.SPOT_LIGHTS+_.length),d.defines.push(H$r.SPOT_LIGHTS+_.length);var m=e._frameState.lightSource.hemisphereLight;d.defines.push(H$r.HEMISPHERE_LIGHTS+m.length)}this._ownerGroup.instances.length>0&&e$28(this._ownerGroup.instances.values[0].localTransform)&&h.defines.push("LocalTransform");var $=this._ownerGroup.url;(l._usePBR||e$28(e._PBRMaterialParams[$])&&e._PBRMaterialParams[$].roughness>0)&&(d.defines.push(H$r.BRDF),(l.baseColorTexture||e._PBRMaterialParams[$]&&e._PBRMaterialParams[$].baseColorTextureIndex>-1&&e$28(e._PBRMaterialParams[$].baseTexture))&&d.defines.push(H$r.HAS_BASE_TEXTURE),(l.uNormalTexture||e._PBRMaterialParams[$]&&e._PBRMaterialParams[$].normalTextureIndex>-1&&e$28(e._PBRMaterialParams[$].normalTexture))&&d.defines.push(H$r.HAS_NORMAL_TEXTURE),(l.emissiveTexture||e._PBRMaterialParams[$]&&e._PBRMaterialParams[$].emissionTextureIndex>-1)&&d.defines.push(H$r.HAS_EMISSIVE_TEXTURE),(l.metallicRoughnessTexture||e._PBRMaterialParams[$]&&e._PBRMaterialParams[$]._metallicRoughnessTextureIndex>-1)&&d.defines.push(H$r.HAS_MetallicRoughness_TEXTURE),(l.occlusionTexture||e._PBRMaterialParams[$]&&e._PBRMaterialParams[$]._occlusionTextureIndex>-1)&&d.defines.push(H$r.HAS_OCCLUSION_TEXTURE),e$28(e._frameState.specularEnvironmentMaps)&&d.defines.push(H$r.IBL)),l.appendPBRMacroToShader(h,d);var g=e$28(this._attributeLocations.aNormal);c.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:this._attributeLocations});var v=l._diffuseColor,y=l._diffuseColor,x=l._specularColor,b=l._shininess;_0x520314(c,{texture:l._textures[0],hasNormal:g,ambientColor:v,diffuseColor:y,specularColor:x,shininess:b,layer:this._collection,geoMat:this._matModel,groupName:$},l),this._texture=l._textures[0],this._colorCommand=c,this._vertexPackage=void 0,this._arrIndexPackage.length=0,this.createColorRenderState(this._ownerGroup,this._collection._clampToObject),this._collection._clampToObject&&(c.pass=Le$p.ClampObject,this.createClampCommand())}},_0x15dbff.prototype.appendProgramDefine=function(e,t,i,r){var n=this._collection._context,o=r?this._profileCommand:this._colorCommand;if(e$28(o)){var a=o.shaderProgram.fragmentShaderSource,s=o.shaderProgram.vertexShaderSource;e&&_0x5ddd99(s,i),t&&_0x5ddd99(a,i),o.shaderProgram.destroy(),o.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),e$28(this._stencilCommand)&&(this._stencilCommand.shaderProgram=o.shaderProgram)}},_0x15dbff.prototype.removeProgramDefine=function(e,t,i,r){var n=this._collection._context,o=r?this._profileCommand:this._colorCommand;if(e$28(o)){var a=o.shaderProgram.fragmentShaderSource,s=o.shaderProgram.vertexShaderSource;e&&_0x79a6c7(s,i),t&&_0x79a6c7(a,i),o.shaderProgram.destroy(),o.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:this._attributeLocations})}},_0x15dbff.prototype.createColorRenderState=function(e,t){if(t){var i=_0x17966c.createClampObjectColorRenderState();this._colorCommand.renderState=u$R.fromCache(i)}else this._colorCommand.renderState=u$R.fromCache({cull:{enabled:e.cullEnabled,face:e.cullFace},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND})},_0x15dbff.prototype.createClampCommand=function(){if(!e$28(this._stencilCommand)){var e=_0x17966c.createClampObjectStencilRenderState(),t=e$28(this._profileCommand)?this._profileCommand:this._colorCommand,i=r$15.shallowClone(t);i.renderState=u$R.fromCache(e),this._stencilCommand=i}},_0x15dbff.prototype.createProfileCommand=function(e){if(!e$28(this._profileCommand)){var t=this._colorCommand,i=t.shaderProgram.vertexShaderSource.clone(),r=t.shaderProgram.fragmentShaderSource.clone();i.defines.push("ClampObject"),r.defines.push("ClampObject"),i.defines.push("PROFILE"),r.defines.push("PROFILE");var n=e._context;n.drawBuffers&&n.colorBufferFloat&&n.depthTexture&&r.defines.push("MRT");var o=r$15.shallowClone(t);o.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:i,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._profileCommand=o}},_0x15dbff.prototype.createSpatialQueryCommand=function(e){if(!e$28(this._spatialQueryCommand)){var t=this._colorCommand,i=t.shaderProgram.vertexShaderSource.clone(),r=t.shaderProgram.fragmentShaderSource.clone();i.defines.push("SQRESULT"),r.defines.push("SQRESULT"),e._frameState.useLogDepth&&r.defines.push("LOG_DEPTH");var n=r$15.shallowClone(t);n.uniformMap.uFrontDepthTexture=function(){return e._sqTextures[0]},n.uniformMap.uBackDepthTexture=function(){return e._sqTextures[1]},n.uniformMap.uFrontColorTexture=function(){return e._sqTextures[2]},n.uniformMap.uSQMode=function(){return e._sqMode},n.shaderProgram=S$T.fromCache({context:e._context,vertexShaderSource:i,fragmentShaderSource:r,attributeLocations:this._attributeLocations}),this._spatialQueryCommand=n}},_0x15dbff.prototype.destroy=function(){for(var e in this._mapPass)this._mapPass.hasOwnProperty(e)&&(this._mapPass[e]=this._mapPass[e]&&!this._mapPass[e].isDestroyed()&&this._mapPass[e].destroy());this._mapPass=void 0;var t=this._colorCommand;e$28(t)&&(t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._colorCommand=void 0),e$28(t=this._stencilCommand)&&(t.vertexArray=t.vertexArray&&!t.vertexArray.isDestroyed()&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&!t.shaderProgram.isDestroyed()&&t.shaderProgram.destroy(),this._stencilCommand=void 0),e$28(t=this._profileCommand)&&(t.vertexArray=t.vertexArray&&!t.vertexArray.isDestroyed()&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&!t.shaderProgram.isDestroyed()&&t.shaderProgram.destroy(),this._profileCommand=void 0),this._vertexPackage=null,this._arrIndexPackage.length=0},_0x36e54b.prototype._setSQTextures=function(e){this._sqTextures=e},_0x36e54b.prototype._setSQMode=function(e){this._sqMode=e},_0x36e54b.prototype._getAllColorCommand=function(){return this._allColorCommand},_0x36e54b.prototype.setPBRMaterialFromJSON=function(e,t){if(this._pbrParameter===je$b.NONE){var i=this;e in i._PBRMaterialParams||(i._PBRMaterialParams[e]={metallic:0,roughness:0,baseColorFactor:new e$25(1,1,1,1),baseColorTextureIndex:-1,baseTexture:void 0,emissionFactor:t$X.UNIT_XYZ,emissionTextureIndex:-1,occlusionTextureIndex:-1,normalTextureIndex:-1,normalTexture:void 0,baseUri:""}),i._PBRMaterialParams[e].baseUri=i$18(t),u$O(t).then((function(t){var r=t.material,n=r.pbrMetallicRoughness,o=r.textureunitstates;if(i._PBRMaterialParams[e].baseColorFactor=e$28(n.baseColor)?e$25.fromElements(n.baseColor.x,n.baseColor.y,n.baseColor.z,n.baseColor.w):i._PBRMaterialParams[e].baseColorFactor,i._PBRMaterialParams[e].baseColorTextureIndex=e$28(n.baseColorTextureIndex)?n.baseColorTextureIndex:-1,i._PBRMaterialParams[e].emissionFactor=e$28(n.emissiveFactor)?t$X.fromElements(n.emissiveFactor.x,n.emissiveFactor.y,n.emissiveFactor.z):t$X.UNIT_XYZ,i._PBRMaterialParams[e].emissionTextureIndex=e$28(n.emissiveTextureIndex)?n.emissiveTextureIndex:i._PBRMaterialParams[e].emissionTextureIndex,i._PBRMaterialParams[e].metallic=e$28(n.metallicFactor)?n.metallicFactor:i._PBRMaterialParams[e].metallic,i._PBRMaterialParams[e].roughness=e$28(n.roughnessFactor)?n.roughnessFactor:i._PBRMaterialParams[e].roughness,i._PBRMaterialParams[e].occlusionTextureIndex=e$28(n.occlusionTextureIndex)?n.occlusionTextureIndex:-1,i._PBRMaterialParams[e].normalTextureIndex=e$28(n.normalTextureIndex)?n.normalTextureIndex:-1,-1!==n.baseColorTextureIndex){var a=i._PBRMaterialParams[e].baseUri+o[n.baseColorTextureIndex].textureunitstate.url;_0x3d266a(i._context,a,i._PBRMaterialParams[e],"baseTexture")}if(-1!==n.normalTextureIndex){a=i._PBRMaterialParams[e].baseUri+o[n.normalTextureIndex].textureunitstate.url;_0x3d266a(i._context,a,i._PBRMaterialParams[e],"normalTexture")}if(-1!==n.emissiveTextureIndex){a=i._PBRMaterialParams[e].baseUri+o[n.emissiveTextureIndex].textureunitstate.url;_0x3d266a(i._context,a,i._PBRMaterialParams[e],"emissiveTexture")}if(-1!==n.metallicRoughnessTextureIndex){a=i._PBRMaterialParams[e].baseUri+o[n.metallicRoughnessTextureIndex].textureunitstate.url;_0x3d266a(i._context,a,i._PBRMaterialParams[e],"metallicRoughnessTexture")}if(-1!==n.occlusionTextureIndex){a=i._PBRMaterialParams[e].baseUri+o[n.occlusionTextureIndex].textureunitstate.url;_0x3d266a(i._context,a,i._PBRMaterialParams[e],"occlusionTexture")}_0x182a4d(i,e)}))}},_0x36e54b.prototype.removePBRMaterial=function(e){delete this._PBRMaterialParams[e],_0x182a4d(this,e)};var ir$1={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=a$18(t),ir$1[t]}},xe$a;typeof DOMParser<"u"&&(xe$a=new DOMParser);var dt$6=new zr$1({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),ee$e=32,ar$2=2414016,nr$1=1,or$1=16093e3,lr$1=.1,sr=[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"],mr$2=["http://www.google.com/kml/ext/2.2"],vt$4=["http://www.w3.org/2005/Atom"],m$r={kml:sr,gx:mr$2,atom:vt$4,kmlgx:sr.concat(mr$2)},Ue$8={Document:Er,Folder:Ct$4,Placemark:Et$4,NetworkLink:At$2,GroundOverlay:Dt$5,PhotoOverlay:We$7,ScreenOverlay:We$7,Tour:Pt$5};function Q$m(e){this._dataSource=e,this._deferred=o$1q.defer(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function pt$5(e){var t=e.slice(0,Math.min(4,e.size)),i=o$1q.defer(),r=new FileReader;return r.addEventListener("load",(function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))})),r.addEventListener("error",(function(){i.reject(r.error)})),r.readAsArrayBuffer(t),i.promise}function fr$1(e){var t=o$1q.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 ur$1(e){var t,i,r,n={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(var o in n)n.hasOwnProperty(o)&&(r="xmlns:"+o+"=",RegExp("[< ]"+o+":").test(e)&&-1===e.indexOf(r)&&(e$28(t)||(t=e.substr(0,e.indexOf("<kml")+4),i=e.substr(t.length)),t+=" "+r+'"'+n[o]+'"'));return e$28(t)&&(e=t+i),e}function dr$2(e){for(var t,i,r,n=e.indexOf("xmlns:"),o=e.indexOf(">",n);-1!==n&&n<o;)t=e.slice(n,e.indexOf('"',n)),i=n,-1!==(n=e.indexOf(t,n+1))?(r=e.indexOf('"',e.indexOf('"',n)+1),n=(e=e.slice(0,n-1)+e.slice(r+1,e.length)).indexOf("xmlns:",i-1)):n=e.indexOf("xmlns:",i+1);return e}function ct$5(e,t,i){e.getData(new he$c.TextWriter,(function(e){e=dr$2(e=ur$1(e)),t.kml=xe$a.parseFromString(e,"application/xml"),i.resolve()}))}function Ae$b(e,t,i){var r=u$Y(ir$1.detectFromFilename(e.filename),"application/octet-stream");e.getData(new he$c.Data64URIWriter(r),(function(r){t[e.filename]=r,i.resolve()}))}function vr(e,t,i,r){for(var n=r.keys,o=new h$$("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=new h$$(l.getAttribute(i)).resolve(o).toString(),c=n.indexOf(u);if(-1!==c){var h=n[c];l.setAttribute(i,r[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function pr$2(e,t,i,r){for(var n=e.querySelectorAll(t),o=0;o<n.length;o++){var a=n[o],s=we$b(a.getAttribute(i),r);a.setAttribute(i,s.url)}}function cr$1(e,t,i){var r=W$k(e,"id");r=e$28(r)&&0!==r.length?r:e$1K(),e$28(i)&&(r=i+r);var n=t.getById(r);return e$28(n)&&(r=e$1K(),e$28(i)&&(r=i+r)),e$28((n=t.add(new h$F({id:r}))).kml)||(n.addProperty("kml"),n.kml=new Kt$1),n}function pe$c(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function fe$a(e,t){if(!e$28(e))return t$X.fromDegrees(0,0,0,t);var i=e.match(/[^\s,\n]+/g);if(!e$28(i))return t$X.fromDegrees(0,0,0,t);var r=parseFloat(i[0]),n=parseFloat(i[1]),o=parseFloat(i[2]);return r=isNaN(r)?0:r,n=isNaN(n)?0:n,o=isNaN(o)?0:o,t$X.fromDegrees(r,n,o,t)}function Te$9(e,t){if(e$28(e)){var i=e.textContent.match(/[^\s\n]+/g);if(e$28(i)){for(var r=i.length,n=new Array(r),o=0,a=0;a<r;a++)n[o++]=fe$a(i[a],t);return n}}}function hr$2(e,t){if(e$28(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function W$k(e,t){if(e$28(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function y$o(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function gr$2(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function H$p(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function I$y(e,t,i){var r=y$o(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function T$i(e,t,i){var r=y$o(e,t,i);if(e$28(r))return r.textContent.trim()}function q$m(e,t,i){var r=y$o(e,t,i);if(e$28(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function we$b(e,t,i){if(e$28(e)){var r;if(e$28(i)){var n=i[e=e.replace(/\\/g,"/")];if(e$28(n))r=new t$S({url:n});else{var o=new h$$(t.getUrlComponent());e$28(n=i[new h$$(e).resolve(o)])&&(r=new t$S({url:n}))}}return e$28(r)||(r=e$28(t)?t.getDerivedResource({url:e}):new t$S({url:e})),r}}Object.defineProperties(Q$m.prototype,{dataSource:{get:function(){return this._dataSource}}}),Q$m.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0},Q$m.prototype.addPromise=function(e){this._promises.push(e)},Q$m.prototype.wait=function(){var e=this._deferred;return this._used||e.resolve(),o$1q.join(e.promise,o$1q.all(this._promises))},Q$m.prototype.process=function(){var e=1===this._stack.length;return e&&(this._started=U$m._getTimestamp()),this._process(e)},Q$m.prototype._giveUpTime=function(){if(!this._timeoutSet){this._timeoutSet=!0,this._timeThreshold=50;var e=this;setTimeout((function(){e._timeoutSet=!1,e._started=U$m._getTimestamp(),e._process(!0)}),0)}},Q$m.prototype._nextNode=function(){var e=this._stack,t=e[e.length-1],i=t.index,r=t.nodes;if(i!==r.length)return++t.index,r[i]},Q$m.prototype._pop=function(){var e=this._stack;return e.pop(),0!==e.length||(this._deferred.resolve(),!1)},Q$m.prototype._process=function(e){for(var t=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();e$28(r);){var n=Ue$8[r.localName];if(e$28(n)&&(-1!==m$r.kml.indexOf(r.namespaceURI)||-1!==m$r.gx.indexOf(r.namespaceURI))&&(n(t,r,i,this),this._timeoutSet||U$m._getTimestamp()>this._started+this._timeThreshold))return void this._giveUpTime();r=this._nextNode()}this._pop()&&e&&this._process(!0)};var G$r={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Fe$9(e,t){if(e$28(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,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(G$r.maximumRed=o,G$r.red=void 0):(G$r.maximumRed=void 0,G$r.red=0),n>0?(G$r.maximumGreen=n,G$r.green=void 0):(G$r.maximumGreen=void 0,G$r.green=0),r>0?(G$r.maximumBlue=r,G$r.blue=void 0):(G$r.maximumBlue=void 0,G$r.blue=0),G$r.alpha=i,e$1S.fromRandom(G$r)):new e$1S(o,n,r,i)}}function ne$d(e,t,i){var r=T$i(e,t,i);if(e$28(r))return Fe$9(r,"random"===T$i(e,"colorMode",i))}function ht$3(e){var t=y$o(e,"TimeStamp",m$r.kmlgx),i=T$i(t,"when",m$r.kmlgx);if(e$28(t)&&e$28(i)&&0!==i.length){var r=a$12.fromIso8601(i),n=new c$L;return n.addInterval(new d$_({start:r,stop:o$11.MAXIMUM_VALUE})),n}}function gt$5(e){var t=y$o(e,"TimeSpan",m$r.kmlgx);if(e$28(t)){var i,r=y$o(t,"begin",m$r.kmlgx),n=e$28(r)?a$12.fromIso8601(r.textContent):void 0,o=y$o(t,"end",m$r.kmlgx),a=e$28(o)?a$12.fromIso8601(o.textContent):void 0;if(e$28(n)&&e$28(a)){if(a$12.lessThan(a,n)){var s=n;n=a,a=s}(i=new c$L).addInterval(new d$_({start:n,stop:a}))}else e$28(n)?(i=new c$L).addInterval(new d$_({start:n,stop:o$11.MAXIMUM_VALUE})):e$28(a)&&(i=new c$L).addInterval(new d$_({start:o$11.MINIMUM_VALUE,stop:a}));return i}}function kr$1(){var e=new n$I;return e.width=ee$e,e.height=ee$e,e.scaleByDistance=new o$1b(ar$2,nr$1,or$1,lr$1),e.pixelOffsetScaleByDistance=new o$1b(ar$2,nr$1,or$1,lr$1),e}function Ve$9(){var e=new u$B;return e.outline=!0,e.outlineColor=e$1S.WHITE,e}function _r(){var e=new n$B;return e.translucencyByDistance=new o$1b(3e6,1,5e6,0),e.distanceDisplayCondition=new r$10(0,8e4),e.pixelOffset=new o$1k(17,0),e.horizontalOrigin=j$13.LEFT,e.font="16px sans-serif",e.style=R$t.FILL_AND_OUTLINE,e}function xr$1(e,t,i,r,n){var o=T$i(e,"href",m$r.kml);if(e$28(o)&&0!==o.length){var a=we$b(o,i,r);if(n){var s=T$i(e,"refreshMode",m$r.kml),l=T$i(e,"viewRefreshMode",m$r.kml);"onInterval"===s||"onExpire"===s?e$1$("kml-refreshMode-"+s,"KML - Unsupported Icon refreshMode: "+s):("onStop"===l||"onRegion"===l)&&e$1$("kml-refreshMode-"+l,"KML - Unsupported Icon viewRefreshMode: "+l);var u=u$Y(T$i(e,"viewBoundScale",m$r.kml),1),c="onStop"===l?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=u$Y(T$i(e,"viewFormat",m$r.kml),c),d=T$i(e,"httpQuery",m$r.kml);e$28(h)&&a.setQueryParameters(m$1j(Le$9(h))),e$28(d)&&a.setQueryParameters(m$1j(Le$9(d)));var f=t._ellipsoid;return He$a(a,t._camera,t._canvas,u,t._lastCameraView.bbox,f),a}return a}}function kt$3(e,t,i,r,n){var o=I$y(t,"scale",m$r.kml),a=I$y(t,"heading",m$r.kml),s=ne$d(t,"color",m$r.kml),l=y$o(t,"Icon",m$r.kml),u=xr$1(l,e,r,n,!1);e$28(l)&&!e$28(u)&&(u=!1);var c,h,d=I$y(l,"x",m$r.gx),f=I$y(l,"y",m$r.gx),p=I$y(l,"w",m$r.gx),_=I$y(l,"h",m$r.gx),m=y$o(t,"hotSpot",m$r.kml),$=hr$2(m,"x"),g=hr$2(m,"y"),v=W$k(m,"xunits"),y=W$k(m,"yunits"),x=i.billboard;e$28(x)||(x=kr$1(),i.billboard=x),x.image=u,x.scale=o,x.color=s,(e$28(d)||e$28(f)||e$28(p)||e$28(_))&&(x.imageSubRegion=new f$10(d,f,p,_)),e$28(a)&&0!==a&&(x.rotation=e$27.toRadians(-a),x.alignedAxis=t$X.UNIT_Z),o=u$Y(o,1),e$28($)&&("pixels"===v?c=-$*o:"insetPixels"===v?c=($-ee$e)*o:"fraction"===v&&(c=-$*ee$e*o),c+=.5*ee$e*o),e$28(g)&&("pixels"===y?h=g*o:"insetPixels"===y?h=(-g+ee$e)*o:"fraction"===y&&(h=g*ee$e*o),h-=.5*ee$e*o),(e$28(c)||e$28(h))&&(x.pixelOffset=new o$1k(c,h))}function Me$a(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o<a;o++){var s=t.childNodes.item(o);if("IconStyle"===s.localName)kt$3(e,s,i,r,n);else if("LabelStyle"===s.localName){var l=i.label;e$28(l)||(l=_r(),i.label=l),l.scale=u$Y(I$y(s,"scale",m$r.kml),l.scale),l.fillColor=u$Y(ne$d(s,"color",m$r.kml),l.fillColor),l.text=i.name}else if("LineStyle"===s.localName){var u=i.polyline;e$28(u)||(u=new a$I,i.polyline=u),u.width=I$y(s,"width",m$r.kml),u.material=ne$d(s,"color",m$r.kml),e$28(ne$d(s,"outerColor",m$r.gx))&&e$1$("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),e$28(I$y(s,"outerWidth",m$r.gx))&&e$1$("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),e$28(I$y(s,"physicalWidth",m$r.gx))&&e$1$("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),e$28(q$m(s,"labelVisibility",m$r.gx))&&e$1$("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===s.localName){var c=i.polygon;e$28(c)||(c=Ve$9(),i.polygon=c),c.material=u$Y(ne$d(s,"color",m$r.kml),c.material),c.fill=u$Y(q$m(s,"fill",m$r.kml),c.fill),c.outline=u$Y(q$m(s,"outline",m$r.kml),c.outline)}else if("BalloonStyle"===s.localName){var h=u$Y(Fe$9(T$i(s,"bgColor",m$r.kml)),e$1S.WHITE),d=u$Y(Fe$9(T$i(s,"textColor",m$r.kml)),e$1S.BLACK),f=T$i(s,"text",m$r.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:h,textColor:d,text:f}}else if("ListStyle"===s.localName){var p=T$i(s,"listItemType",m$r.kml);("radioFolder"===p||"checkOffOnly"===p)&&e$1$("kml-listStyle-"+p,"KML - Unsupported ListStyle with listItemType: "+p)}}}function _t$5(e,t,i,r,n){for(var o,a=new h$F,s=-1,l=t.childNodes,u=l.length,c=0;c<u;c++){var h=l[c];("Style"===h.localName||"StyleMap"===h.localName)&&(s=c)}if(-1!==s){var d=l[s];if("Style"===d.localName)Me$a(e,d,a,r,n);else for(var f=H$p(d,"Pair",m$r.kml),p=0;p<f.length;p++){var _=f[p],m=T$i(_,"key",m$r.kml);if("normal"===m){var $=T$i(_,"styleUrl",m$r.kml);if(e$28($))e$28(o=i.getById($))||(o=i.getById("#"+$)),e$28(o)&&a.merge(o);else Me$a(e,y$o(_,"Style",m$r.kml),a,r,n)}else e$1$("kml-styleMap-"+m,"KML - Unsupported StyleMap key: "+m)}}var g=T$i(t,"styleUrl",m$r.kml);if(e$28(g)){var v=g;if("#"!==g[0]&&-1!==g.indexOf("#")){var y=g.split("#"),x=y[0];v=r.getDerivedResource({url:x}).getUrlComponent()+"#"+y[1]}e$28(o=i.getById(v))||(o=i.getById("#"+v)),e$28(o)&&a.merge(o)}return a}function xt$3(e,t,i){return t.fetchXML().then((function(r){return Tr(e,r,i,t,!0)}))}function Tr(e,t,i,r,n,o){var a,s,l,u,c=gr$2(t,"Style",m$r.kml);if(e$28(c)){var h=c.length;for(a=0;a<h;a++)e$28(s=W$k(u=c[a],"id"))&&(s="#"+s,n&&e$28(r)&&(s=r.getUrlComponent()+s),e$28(i.getById(s))||(l=new h$F({id:s}),i.add(l),Me$a(e,u,l,r,o)))}var d=gr$2(t,"StyleMap",m$r.kml);if(e$28(d)){var f=d.length;for(a=0;a<f;a++){var p=d[a];if(e$28(s=W$k(p,"id")))for(var _=H$p(p,"Pair",m$r.kml),m=0;m<_.length;m++){var $=_[m],g=T$i($,"key",m$r.kml);if("normal"===g){if(s="#"+s,n&&e$28(r)&&(s=r.getUrlComponent()+s),!e$28(i.getById(s))){l=i.getOrCreateEntity(s);var v=T$i($,"styleUrl",m$r.kml);if(e$28(v)){"#"!==v[0]&&(v="#"+v),n&&e$28(r)&&(v=r.getUrlComponent()+v);var y=i.getById(v);e$28(y)&&l.merge(y)}else Me$a(e,u=y$o($,"Style",m$r.kml),l,r,o)}}else e$1$("kml-styleMap-"+g,"KML - Unsupported StyleMap key: "+g)}}}var x=[],b=t.getElementsByTagName("styleUrl"),w=b.length;for(a=0;a<w;a++){var C=b[a].textContent;if("#"!==C[0]){var T=C.split("#");if(2===T.length){var S=T[0],E=r.getDerivedResource({url:S});x.push(xt$3(e,E,i))}}}return x}function Be$c(e,t,i){var r=new a$t(e,t.id,["position"]),n=new i$r(t.position);t.polyline=e$28(i.polyline)?i.polyline.clone():new a$I,t.polyline.positions=new n$r([r,n])}function wr$1(e,t){return!e$28(e)&&!e$28(t)||"clampToGround"===e?k$_.CLAMP_TO_GROUND:"relativeToGround"===e?k$_.RELATIVE_TO_GROUND:"absolute"===e?k$_.NONE:"clampToSeaFloor"===t?(e$1$("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),k$_.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(e$1$("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),k$_.RELATIVE_TO_GROUND):(e$28(e)?e$1$("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):e$1$("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),k$_.CLAMP_TO_GROUND)}function Mr(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((e$28(t)&&"clampToGround"!==t||e$28(i)&&"clampToSeaFloor"!==i)&&e$1$("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u$Y(t,i)),new i$r(e))}function Tt$4(e,t,i,r){if(e$28(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(e$28(t)&&"clampToGround"!==t||e$28(i)&&"clampToSeaFloor"!==i)&&e$1$("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u$Y(t,i));for(var n=e.length,o=0;o<n;o++){var a=e[o];r.scaleToGeodeticSurface(a,a)}return e}}function be$b(e,t,i,r){var n=t.label;e$28(n)||(n=e$28(i.label)?i.label.clone():_r(),t.label=n),n.text=t.name;var o=t.billboard;e$28(o)||(o=e$28(i.billboard)?i.billboard.clone():kr$1(),t.billboard=o),e$28(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(e$1S.YELLOW,64);var a=1;e$28(o.scale)&&(0!==(a=o.scale.getValue())?n.pixelOffset=new o$1k(16*a+1,-16):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)),e$28(r)&&e._clampToGround&&(o.heightReference=r,n.heightReference=r,n.pixelOffset=new o$1k(16*a+1,-16))}function br$1(e,t){var i=e.path;e$28(i)||((i=new n$A).leadTime=0,e.path=i);var r=t.polyline;e$28(r)&&(i.material=r.material,i.width=r.width)}function wt$4(e,t,i,r,n){var o=T$i(i,"coordinates",m$r.kml),a=T$i(i,"altitudeMode",m$r.kml),s=T$i(i,"altitudeMode",m$r.gx),l=q$m(i,"extrude",m$r.kml),u=fe$a(o,e._ellipsoid);return r.position=u,be$b(e,r,n,wr$1(a,s)),l&&pe$c(a,s)&&Be$c(t,r,n),!0}function Ir(e,t,i,r,n){var o=y$o(i,"coordinates",m$r.kml),a=T$i(i,"altitudeMode",m$r.kml),s=T$i(i,"altitudeMode",m$r.gx),l=q$m(i,"extrude",m$r.kml),u=q$m(i,"tessellate",m$r.kml),c=pe$c(a,s),h=I$y(i,"drawOrder",m$r.gx),d=e._ellipsoid,f=Te$9(o,d),p=n.polyline;if(c&&l){var _=new e$12;r.wall=_,_.positions=f;var m=n.polygon;e$28(m)&&(_.fill=m.fill,_.material=m.material),_.outline=!0,e$28(p)?(_.outlineColor=e$28(p.material)?p.material.color:e$1S.WHITE,_.outlineWidth=p.width):e$28(m)&&(_.outlineColor=e$28(m.material)?m.material.color:e$1S.WHITE)}else if(!e._clampToS3M&&!e._clampToGround||c)e$28(h)&&e$1$("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),p=e$28(p)?p.clone():new a$I,r.polyline=p,p.positions=Tt$4(f,a,s,d),(!u||c)&&(p.arcType=m$_.NONE);else{e._clampToS3M&&(r.clampToS3M=!0,r.classificationType=L$V.S3M_TILE);var $=new a$I;e._clampToGround&&($.clampToGround=!0,$.classificationType=e._classificationType),r.polyline=$,$.positions=f,e$28(p)?($.material=e$28(p.material)?p.material.color.getValue(o$11.MINIMUM_VALUE):e$1S.WHITE,$.width=u$Y(p.width,1)):($.material=e$1S.WHITE,$.width=1),$.zIndex=h}return!0}function Mt$3(e,t,i,r,n){var o=y$o(i,"outerBoundaryIs",m$r.kml),a=y$o(o,"LinearRing",m$r.kml),s=y$o(a,"coordinates",m$r.kml),l=e._ellipsoid,u=Te$9(s,l),c=q$m(i,"extrude",m$r.kml),h=pe$c(T$i(i,"altitudeMode",m$r.kml),T$i(i,"altitudeMode",m$r.gx)),d=e$28(n.polygon)?n.polygon.clone():Ve$9(),f=n.polyline;if(e$28(f)&&(d.outlineColor=e$28(f.material)?f.material.color:e$1S.WHITE,d.outlineWidth=f.width),r.polygon=d,h?(d.perPositionHeight=!0,d.extrudedHeight=c?0:void 0):!e._clampToGround&&!e._clampToS3M&&(d.height=0),e._clampToS3M&&(d.classificationType=L$V.S3M_TILE),e._clampToGround&&(d.classificationType=L$V.TERRAIN),e$28(u)){for(var p=new e$1m(u),_=H$p(i,"innerBoundaryIs",m$r.kml),m=0;m<_.length;m++){a=H$p(_[m],"LinearRing",m$r.kml);for(var $=0;$<a.length;$++)e$28(u=Te$9(s=y$o(a[$],"coordinates",m$r.kml),l))&&p.holes.push(new e$1m(u))}d.hierarchy=p}return!0}function bt$3(e,t,i,r,n){var o=T$i(i,"altitudeMode",m$r.kml),a=T$i(i,"altitudeMode",m$r.gx),s=H$p(i,"coord",m$r.gx),l=H$p(i,"angles",m$r.gx),u=H$p(i,"when",m$r.kml),c=q$m(i,"extrude",m$r.kml),h=pe$c(o,a),d=e._ellipsoid;l.length>0&&e$1$("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var f=Math.min(s.length,u.length),p=[],_=[],m=0;m<f;m++){var $=fe$a(s[m].textContent,d);p.push($),_.push(a$12.fromIso8601(u[m].textContent))}var g=new o$J;return g.addSamples(_,p),r.position=g,be$b(e,r,n,wr$1(o,a)),br$1(r,n),r.availability=new c$L,u.length>0&&r.availability.addInterval(new d$_({start:_[0],stop:_[_.length-1]})),h&&c&&Be$c(t,r,n),!0}function Lr$1(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new o$J;h.addSamples(e,t),i.intervals.addInterval(new d$_({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Mr(h,a,s)})),r.addInterval(new d$_({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new d$_({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function yr$1(e,t,i,r,n){for(var o,a,s,l=q$m(i,"interpolate",m$r.gx),u=H$p(i,"Track",m$r.gx),c=!1,h=new t$k,d=new c$L,f=new t$q,p=e._ellipsoid,_=0,m=u.length;_<m;_++){var $=u[_],g=H$p($,"when",m$r.kml),v=H$p($,"coord",m$r.gx),y=T$i($,"altitudeMode",m$r.kml),x=T$i($,"altitudeMode",m$r.gx),b=pe$c(y,x),w=q$m($,"extrude",m$r.kml),C=Math.min(v.length,g.length),T=[];o=[];for(var S=0;S<C;S++){var E=fe$a(v[S].textContent,p);T.push(E),o.push(a$12.fromIso8601(g[S].textContent))}l&&(e$28(a)&&Lr$1([a,o[0]],[s,T[0]],f,d,h,!1,"absolute",void 0,!1),a=o[C-1],s=T[T.length-1]),Lr$1(o,T,f,d,h,b&&w,y,x,!0),c=c||b&&w}return r.availability=d,r.position=f,be$b(e,r,n),br$1(r,n),c&&(Be$c(t,r,n),r.polyline.show=h),!0}var Cr={Point:wt$4,LineString:Ir,LinearRing:Ir,Polygon:Mt$3,Track:bt$3,MultiTrack:yr$1,MultiGeometry:It$5,Model:Gt$1},J$o;function It$5(e,t,i,r,n,o){for(var a=i.childNodes,s=!1,l=0,u=a.length;l<u;l++){var c=a.item(l),h=Cr[c.localName];if(e$28(h)){var d=cr$1(c,t,o);d.parent=r,d.name=r.name,d.availability=r.availability,d.description=r.description,d.kml=r.kml,h(e,t,c,d,n)&&(s=!0)}}return s}function Lt$4(e,t){var i=y$o(e,"ExtendedData",m$r.kml);if(e$28(i)){e$28(y$o(i,"SchemaData",m$r.kml))&&e$1$("kml-schemaData","KML - SchemaData is unsupported"),e$28(W$k(i,"xmlns:prefix"))&&e$1$("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=H$p(i,"Data",m$r.kml);if(e$28(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=W$k(s,"name");e$28(l)&&(r[l]={displayName:T$i(s,"displayName",m$r.kml),value:T$i(s,"value",m$r.kml)})}t.kml.extendedData=r}}function yt$2(e,t,i,r,n){var o,a,s,l,u=t.kml,c=u.extendedData,h=T$i(e,"description",m$r.kml),d=u$Y(t.balloonStyle,i.balloonStyle),f=e$1S.WHITE,p=e$1S.BLACK,_=h;if(e$28(d)&&(f=u$Y(d.bgColor,e$1S.WHITE),p=u$Y(d.textColor,e$1S.BLACK),_=u$Y(d.text,h)),e$28(_)){if(_=(_=(_=(_=(_=(_=_.replace("$[name]",u$Y(t.name,""))).replace("$[description]",u$Y(h,""))).replace("$[address]",u$Y(u.address,""))).replace("$[Snippet]",u$Y(u.snippet,""))).replace("$[id]",t.id)).replace("$[geDirections]",""),e$28(c)){var m=_.match(/\$\[.+?\]/g);if(null!==m)for(o=0;o<m.length;o++){var $=m[o],g=$.substr(2,$.length-3),v=/\/displayName$/.test(g);e$28(l=c[g=g.replace(/\/displayName$/,"")])&&(l=v?l.displayName:l.value),e$28(l)&&(_=_.replace($,u$Y(l,"")))}}}else if(e$28(c)&&(s=Object.keys(c)).length>0){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<s.length;o++)_+="<tr><th>"+u$Y((l=c[a=s[o]]).displayName,a)+"</th><td>"+u$Y(l.value,"")+"</td></tr>";_+="</tbody></table>"}if(e$28(_)){_=dt$6.link(_),J$o.innerHTML=_;var y=J$o.querySelectorAll("a");for(o=0;o<y.length;o++)y[o].setAttribute("target","_blank");e$28(r)&&r.keys.length>1&&(vr(J$o,"a","href",r),vr(J$o,"img","src",r)),pr$2(J$o,"a","href",n),pr$2(J$o,"img","src",n);var x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+="background-color:"+f.toCssColorString()+";",x+="color:"+p.toCssColorString()+";",x+='">',x+=J$o.innerHTML+"</div>",J$o.innerHTML="",t.description=x}}function Ie$a(e,t,i){var r=i.entityCollection,n=i.parentEntity,o=i.sourceResource,a=i.uriResolver,s=cr$1(t,r,i.context),l=s.kml,u=_t$5(e,t,i.styleCollection,o,a),c=T$i(t,"name",m$r.kml);s.name=c,s.parent=n;var h=gt$5(t);e$28(h)||(h=ht$3(t)),s.availability=h,ze$6(s);var d=q$m(t,"visibility",m$r.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(n)&&u$Y(d,!0);var f=y$o(t,"author",m$r.atom),p=l.author;p.name=T$i(f,"name",m$r.atom),p.uri=T$i(f,"uri",m$r.atom),p.email=T$i(f,"email",m$r.atom);var _=y$o(t,"link",m$r.atom),m=l.link;m.href=W$k(_,"href"),m.hreflang=W$k(_,"hreflang"),m.rel=W$k(_,"rel"),m.type=W$k(_,"type"),m.title=W$k(_,"title"),m.length=W$k(_,"length"),l.address=T$i(t,"address",m$r.kml),l.phoneNumber=T$i(t,"phoneNumber",m$r.kml),l.snippet=T$i(t,"Snippet",m$r.kml),Lt$4(t,s),yt$2(t,s,u,a,o);var $=e._ellipsoid;return Pr(t,s,$),Sr$1(t,s,$),e$28(y$o(t,"Region",m$r.kml))&&e$1$("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function Er(e,t,i,r){r.addNodes(t.childNodes,i),r.process()}function Ct$4(e,t,i,r){var n=Ie$a(e,t,i),o=l$1e(i);o.parentEntity=n.entity,Er(e,t,o,r)}function Et$4(e,t,i,r){for(var n=Ie$a(e,t,i),o=n.entity,a=n.styleEntity,s=!1,l=t.childNodes,u=0,c=l.length;u<c&&!s;u++){var h=l.item(u),d=Cr[h.localName];e$28(d)&&(d(e,i.entityCollection,h,o,a,o.id,i.sourceResource),s=!0)}s||(o.merge(a),be$b(e,o,a))}typeof document<"u"&&(J$o=document.createElement("div"));var St$3={FlyTo:Nt$3,Wait:Ot$2,SoundCue:Ke$5,AnimatedUpdate:Ke$5,TourControl:Ke$5};function Pt$5(e,t,i,r){var n=new l$u(T$i(t,"name",m$r.kml),W$k(t,"id")),o=y$o(t,"Playlist",m$r.gx);if(o)for(var a=e._ellipsoid,s=o.childNodes,l=0;l<s.length;l++){var u=s[l];if(u.localName){var c=St$3[u.localName];c?c(n,u,a):console.log("Unknown KML Tour playlist entry type "+u.localName)}}e$28(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(n)}function Ke$5(e,t){e$1$("KML Tour unsupported node "+t.localName)}function Ot$2(e,t){var i=I$y(t,"duration",m$r.gx);e.addPlaylistEntry(new i$q(i))}function Nt$3(e,t,i){var r=I$y(t,"duration",m$r.gx),n=T$i(t,"flyToMode",m$r.gx),o={kml:{}};Pr(t,o,i),Sr$1(t,o,i);var a=new a$q(r,n,o.kml.lookAt||o.kml.camera);e.addPlaylistEntry(a)}function Sr$1(e,t,i){var r=y$o(e,"Camera",m$r.kml);if(e$28(r)){var n=u$Y(I$y(r,"longitude",m$r.kml),0),o=u$Y(I$y(r,"latitude",m$r.kml),0),a=u$Y(I$y(r,"altitude",m$r.kml),0),s=u$Y(I$y(r,"heading",m$r.kml),0),l=u$Y(I$y(r,"tilt",m$r.kml),0),u=u$Y(I$y(r,"roll",m$r.kml),0),c=t$X.fromDegrees(n,o,a,i),h=i$10.fromDegrees(s,l-90,u);t.kml.camera=new o$G(c,h)}}function Pr(e,t,i){var r=y$o(e,"LookAt",m$r.kml);if(e$28(r)){var n=u$Y(I$y(r,"longitude",m$r.kml),0),o=u$Y(I$y(r,"latitude",m$r.kml),0),a=u$Y(I$y(r,"altitude",m$r.kml),0),s=I$y(r,"heading",m$r.kml),l=I$y(r,"tilt",m$r.kml),u=u$Y(I$y(r,"range",m$r.kml),0);l=e$27.toRadians(u$Y(l,0));var c=new a$S(s=e$27.toRadians(u$Y(s,0)),l-e$27.PI_OVER_TWO,u),h=t$X.fromDegrees(n,o,a,i);t.kml.lookAt=new o$F(h,c)}}function Dt$5(e,t,i,r){var n,o=Ie$a(e,t,i).entity,a=!1,s=e._ellipsoid,l=Te$9(y$o(t,"LatLonQuad",m$r.gx),s),u=I$y(t,"drawOrder",m$r.kml);if(e$28(l))(n=Ve$9()).hierarchy=new e$1m(l),n.zIndex=u,o.polygon=n,a=!0;else{(n=new n$y).zIndex=u,o.rectangle=n;var c=y$o(t,"LatLonBox",m$r.kml);if(e$28(c)){var h=I$y(c,"west",m$r.kml),d=I$y(c,"south",m$r.kml),f=I$y(c,"east",m$r.kml),p=I$y(c,"north",m$r.kml);e$28(h)&&(h=e$27.negativePiToPi(e$27.toRadians(h))),e$28(d)&&(d=e$27.clampToLatitudeRange(e$27.toRadians(d))),e$28(f)&&(f=e$27.negativePiToPi(e$27.toRadians(f))),e$28(p)&&(p=e$27.clampToLatitudeRange(e$27.toRadians(p))),n.coordinates=new h$10(h,d,f,p);var _=I$y(c,"rotation",m$r.kml);if(e$28(_)){var m=e$27.toRadians(_);n.rotation=m,n.stRotation=m}}}var $=y$o(t,"Icon",m$r.kml),g=xr$1($,e,i.sourceResource,i.uriResolver,!0);if(e$28(g)){a&&e$1$("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");var v=I$y($,"x",m$r.gx),y=I$y($,"y",m$r.gx),x=I$y($,"w",m$r.gx),b=I$y($,"h",m$r.gx);(e$28(v)||e$28(y)||e$28(x)||e$28(b))&&e$1$("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),n.material=g,n.material.color=ne$d(t,"color",m$r.kml),n.material.transparent=!0}else n.material=ne$d(t,"color",m$r.kml);var w=T$i(t,"altitudeMode",m$r.kml);e$28(w)?"absolute"===w?(n.height=I$y(t,"altitude",m$r.kml),n.zIndex=void 0):"clampToGround"!==w&&e$1$("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+w):"relativeToSeaFloor"===(w=T$i(t,"altitudeMode",m$r.gx))?(e$1$("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),n.height=I$y(t,"altitude",m$r.kml),n.zIndex=void 0):"clampToSeaFloor"===w?e$1$("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):e$28(w)&&e$1$("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+w)}function We$7(e,t,i,r){e._unsupportedNode.raiseEvent(e,i.parentEntity,t,i.entityCollection,i.styleCollection,i.sourceResource,i.uriResolver),e$1$("kml-unsupportedFeature-"+t.nodeName,"KML - Unsupported feature: "+t.nodeName)}var re$8={INTERVAL:0,EXPIRE:1,STOP:2};function Le$9(e){if(!e$28(e)||0===e.length)return"";var t=e[0];return("&"===t||"?"===t)&&(e=e.substring(1)),e}var Rt$3=new h$10,ue$7=new t$W,Ge$6=new o$1k,Ut$1=new t$X;function He$a(e,t,i,r,n,o){function a(e){return e<-e$27.PI_OVER_TWO?-e$27.PI_OVER_TWO:e>e$27.PI_OVER_TWO?e$27.PI_OVER_TWO:e}function s(e){return e>e$27.PI?e-e$27.TWO_PI:e<-e$27.PI?e+e$27.TWO_PI:e}var l=m$1k(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),e$28(t)&&t._mode!==P$$.MORPHING){var u,c;if(n=u$Y(n,Rt$3),e$28(i)&&(Ge$6.x=.5*i.clientWidth,Ge$6.y=.5*i.clientHeight,u=t.pickEllipsoid(Ge$6,o,Ut$1)),e$28(u)?c=o.cartesianToCartographic(u,ue$7):(c=h$10.center(n,ue$7),u=o.cartographicToCartesian(c)),e$28(r)&&!e$27.equalsEpsilon(r,1,e$27.EPSILON9)){var h=n.width*r*.5,d=n.height*r*.5;n=new h$10(s(c.longitude-h),a(c.latitude-d),s(c.longitude+h),a(c.latitude+d))}l=(l=(l=(l=l.replace("[bboxWest]",e$27.toDegrees(n.west).toString())).replace("[bboxSouth]",e$27.toDegrees(n.south).toString())).replace("[bboxEast]",e$27.toDegrees(n.east).toString())).replace("[bboxNorth]",e$27.toDegrees(n.north).toString());var f=e$27.toDegrees(c.longitude).toString(),p=e$27.toDegrees(c.latitude).toString();l=(l=(l=(l=(l=(l=(l=(l=l.replace("[lookatLon]",f)).replace("[lookatLat]",p)).replace("[lookatTilt]",e$27.toDegrees(t.pitch).toString())).replace("[lookatHeading]",e$27.toDegrees(t.heading).toString())).replace("[lookatRange]",t$X.distance(t.positionWC,u))).replace("[lookatTerrainLon]",f)).replace("[lookatTerrainLat]",p)).replace("[lookatTerrainAlt]",c.height.toString()),o.cartesianToCartographic(t.positionWC,ue$7),l=(l=(l=l.replace("[cameraLon]",e$27.toDegrees(ue$7.longitude).toString())).replace("[cameraLat]",e$27.toDegrees(ue$7.latitude).toString())).replace("[cameraAlt]",e$27.toDegrees(ue$7.height).toString());var _=t.frustum,m=_.aspectRatio,$="",g="";if(e$28(m)){var v=e$27.toDegrees(_.fov);m>1?($=v,g=v/m):(g=v,$=v*m)}l=(l=l.replace("[horizFov]",$.toString())).replace("[vertFov]",g.toString())}else l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=l.replace("[bboxWest]","-180")).replace("[bboxSouth]","-90")).replace("[bboxEast]","180")).replace("[bboxNorth]","90")).replace("[lookatLon]","")).replace("[lookatLat]","")).replace("[lookatRange]","")).replace("[lookatTilt]","")).replace("[lookatHeading]","")).replace("[lookatTerrainLon]","")).replace("[lookatTerrainLat]","")).replace("[lookatTerrainAlt]","")).replace("[cameraLon]","")).replace("[cameraLat]","")).replace("[cameraAlt]","")).replace("[horizFov]","")).replace("[vertFov]","");e$28(i)?l=(l=l.replace("[horizPixels]",i.clientWidth)).replace("[vertPixels]",i.clientHeight):l=(l=l.replace("[horizPixels]","")).replace("[vertPixels]",""),l=(l=(l=(l=(l=l.replace("[terrainEnabled]","1")).replace("[clientVersion]","1")).replace("[kmlVersion]","2.2")).replace("[clientName]","Cesium")).replace("[language]","English"),e.setQueryParameters(m$1j(l))}function At$2(e,t,i,r){var n=Ie$a(e,t,i).entity,o=i.sourceResource,a=i.uriResolver,s=y$o(t,"Link",m$r.kml);if(e$28(s)||(s=y$o(t,"Url",m$r.kml)),e$28(s)){var l,u,c=T$i(s,"href",m$r.kml);if(e$28(c)){var h=c;if(c=we$b(c,o,i.uriResolver),/^data:/.test(c.getUrlComponent()))/\.kmz/i.test(o.getUrlComponent())||(h=o.getDerivedResource({url:h}));else{h=c.clone(),l=T$i(s,"viewRefreshMode",m$r.kml),u=u$Y(T$i(s,"viewBoundScale",m$r.kml),1);var d="onStop"===l?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",f=u$Y(T$i(s,"viewFormat",m$r.kml),d),p=T$i(s,"httpQuery",m$r.kml);e$28(f)&&c.setQueryParameters(m$1j(Le$9(f))),e$28(p)&&c.setQueryParameters(m$1j(Le$9(p)));var _=e._ellipsoid;He$a(c,e._camera,e._canvas,u,e._lastCameraView.bbox,_)}var m={sourceUri:h,uriResolver:a,context:n.id},$=new r$z,g=qe$4(e,$,c,m).then((function(t){var i=e._entityCollection,r=$.values;i.suspendEvents();for(var o=0;o<r.length;o++){var a=r[o];e$28(a.parent)||(a.parent=n,ze$6(a)),i.add(a)}i.resumeEvents();var h=T$i(s,"refreshMode",m$r.kml),d=u$Y(I$y(s,"refreshInterval",m$r.kml),0);if("onInterval"===h&&d>0||"onExpire"===h||"onStop"===l){var f=y$o(t,"NetworkLinkControl",m$r.kml),p=e$28(f),_=a$12.now(),m={id:e$1K(),href:c,cookie:{},lastUpdated:_,updating:!1,entity:n,viewBoundScale:u,needsUpdate:!1,cameraUpdateTime:_},g=0;if(p&&(m.cookie=m$1j(u$Y(T$i(f,"cookie",m$r.kml),"")),g=u$Y(I$y(f,"minRefreshPeriod",m$r.kml),0)),"onInterval"===h)p&&(d=Math.max(g,d)),m.refreshMode=re$8.INTERVAL,m.time=d;else if("onExpire"===h){var v;if(p&&(v=T$i(f,"expires",m$r.kml)),e$28(v))try{var y=a$12.fromIso8601(v),x=a$12.secondsDifference(y,_);x>0&&x<g&&a$12.addSeconds(_,g,y),m.refreshMode=re$8.EXPIRE,m.time=y}catch{e$1$("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else e$1$("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(m.refreshMode=re$8.STOP,m.time=u$Y(I$y(s,"viewRefreshTime",m$r.kml),0)):e$1$("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");e$28(m.refreshMode)&&e._networkLinks.set(m.id,m)}else"onRegion"===l&&e$1$("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")})).otherwise((function(t){e$1$("An error occured during loading "+c.url),e._error.raiseEvent(e,t)}));r.addPromise(g)}}}function Ft$3(e,t,i,r){var n=Ue$8[t.localName];return e$28(n)?n(e,t,i,r):We$7(e,t,i)}function ye$b(e,t,i,r,n,o){t.removeAll();var a=i.documentElement,s=T$i("Document"===a.localName?a:y$o(a,"Document",m$r.kml),"name",m$r.kml);e$28(s)||(s=f$V(r.getUrlComponent())),e$28(e._name)||(e._name=s);var l=new U$m._DeferredLoading(e),u=new r$z(e);return o$1q.all(Tr(e,i,u,r,!1,n)).then((function(){var a=i.documentElement;if("kml"===a.localName)for(var s=a.childNodes,c=0;c<s.length;c++){var h=s[c];if(e$28(Ue$8[h.localName])){a=h;break}}var d={parentEntity:void 0,entityCollection:t,styleCollection:u,sourceResource:r,uriResolver:n,context:o};return t.suspendEvents(),Ft$3(e,a,d,l),t.resumeEvents(),l.wait().then((function(){return i.documentElement}))}))}function Vt$4(e,t,i,r){var n=o$1q.defer();return he$c.createReader(new he$c.BlobReader(i),(function(i){i.getEntries((function(o){for(var a,s,l=[],u={},c=0;c<o.length;c++){var h=o[c];if(!h.directory){var d=o$1q.defer();l.push(d.promise),!/\.kml$/i.test(h.filename)||e$28(a)&&/\//i.test(h.filename)?Ae$b(h,u,d):(e$28(a)&&Ae$b(a,u,s),a=h,s=d)}}e$28(a)&&ct$5(a,u,s),o$1q.all(l).then((function(){if(i.close(),e$28(u.kml))return u.keys=Object.keys(u),ye$b(e,t,u.kml,r,u);n.reject(new t$U("KMZ file does not contain a KML document."))})).then(n.resolve).otherwise(n.reject)}))}),(function(e){n.reject(e)})),n.promise}function qe$4(e,t,i,r){var n=(r=u$Y(r,u$Y.EMPTY_OBJECT)).sourceUri,o=r.uriResolver,a=r.context,s=i;if("string"==typeof i||i instanceof t$S){s=(i=t$S.createIfNeeded(i)).fetchBlob(),n=u$Y(n,i.clone());var l=e._resourceCredits,u=i.credits;if(e$28(u))for(var c=u.length,h=0;h<c;h++)l.push(u[h])}else n=u$Y(n,t$S.DEFAULT.clone());return n=t$S.createIfNeeded(n),o$1q(s).then((function(i){return i instanceof Blob?pt$5(i).then((function(r){return r?Vt$4(e,t,i,n):fr$1(i).then((function(i){var r,s;i=dr$2(i=ur$1(i));try{r=xe$a.parseFromString(i,"application/xml")}catch(e){s=e.toString()}if(e$28(s)||r.body||"parsererror"===r.documentElement.tagName){var l=e$28(s)?s:r.documentElement.firstChild.nodeValue;throw l||(l=r.body.innerText),new t$U(l)}return ye$b(e,t,r,n,o,a)}))})):ye$b(e,t,i,n,o,a)})).otherwise((function(t){return e._error.raiseEvent(e,t),console.log(t),o$1q.reject(t)}))}function U$m(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).camera,i=e.canvas;if(!e$28(t))throw new t$Z("options.camera is required.");if(!e$28(i))throw new t$Z("options.canvas is required.");this._changed=new o$1o,this._error=new o$1o,this._loading=new o$1o,this._refresh=new o$1o,this._unsupportedNode=new o$1o,this._clock=void 0,this._entityCollection=new r$z(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new s$H,this._networkLinks=new e$1P,this._entityCluster=new a$v,this._canvas=i,this._camera=t,this._lastCameraView={position:e$28(t)?t$X.clone(t.positionWC):void 0,direction:e$28(t)?t$X.clone(t.directionWC):void 0,up:e$28(t)?t$X.clone(t.upWC):void 0,bbox:e$28(t)?t.computeViewRectangle():h$10.clone(h$10.MAX_VALUE)},this._ellipsoid=u$Y(e.ellipsoid,t$V.WGS84),this._visibleViewport=4095;var r=e.credit;"string"==typeof r&&(r=new r$1a(r)),this._credit=r,this._resourceCredits=[]}function ze$6(e){var t=e.parent;if(e$28(t)){var i=t.availability;if(e$28(i)){var r=e.availability;e$28(r)?r.intersect(i):e.availability=i}}}function Bt$3(e,t,i,r,n){return function(o){if(r.contains(t.id)){var a=!1,s=y$o(o,"NetworkLinkControl",m$r.kml),l=0;if(e$28(s)){if(e$28(y$o(s,"Update",m$r.kml)))return e$1$("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void r.remove(t.id);t.cookie=m$1j(u$Y(T$i(s,"cookie",m$r.kml),"")),l=u$Y(I$y(s,"minRefreshPeriod",m$r.kml),0)}var u=a$12.now(),c=t.refreshMode;if(c===re$8.INTERVAL)e$28(s)&&(t.time=Math.max(l,t.time));else if(c===re$8.EXPIRE){var h;if(e$28(s)&&(h=T$i(s,"expires",m$r.kml)),e$28(h))try{var d=a$12.fromIso8601(h),f=a$12.secondsDifference(d,u);f>0&&f<l&&a$12.addSeconds(u,l,d),t.time=d}catch{e$1$("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else e$1$("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}var p=t.entity,_=e._entityCollection,m=i.values;_.suspendEvents();var $,g=_.values.slice();for($=0;$<g.length;++$){var v=g[$];v.parent===p&&(v.parent=void 0,E(v))}for(_.resumeEvents(),_.suspendEvents(),$=0;$<m.length;$++){var y=m[$];e$28(y.parent)||(y.parent=p,ze$6(y)),_.add(y)}_.resumeEvents(),a?r.remove(t.id):t.lastUpdated=u;var x=_.computeAvailability(),b=x.start,w=x.stop,C=a$12.equals(b,o$11.MINIMUM_VALUE),T=a$12.equals(w,o$11.MAXIMUM_VALUE);if(!C||!T){var S=e._clock;(S.startTime!==b||S.stopTime!==w)&&(S.startTime=b,S.stopTime=w,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n.getUrlComponent(!0))}function E(e){_.remove(e);for(var t=e._children,i=t.length,r=0;r<i;++r)E(t[r])}}}U$m.load=function(e,t){return new U$m(t=u$Y(t,u$Y.EMPTY_OBJECT)).load(e,t)},Object.defineProperties(U$m.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},s3mInstanceCollection:{get:function(){return this._s3mInstanceCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!e$28(e))throw new t$Z("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}}),U$m.prototype.load=function(e,t){if(!e$28(e))throw new t$Z("data is required.");t=u$Y(t,u$Y.EMPTY_OBJECT),o$L.setLoading(this,!0);var i=this._name;this._name=void 0,this._clampToGround=u$Y(t.clampToGround,!1),this._clampToS3M=u$Y(t.clampToS3M,!1),this._classificationType=u$Y(t.classificationType,L$V.TERRAIN);var r=this;return qe$4(this,this._entityCollection,e,t).then((function(){var e,t,n=r._entityCollection.computeAvailability(),o=n.start,a=n.stop,s=a$12.equals(o,o$11.MINIMUM_VALUE),l=a$12.equals(a,o$11.MAXIMUM_VALUE);s&&l||(s&&((t=new Date).setHours(0,0,0,0),o=a$12.fromDate(t)),l&&((t=new Date).setHours(24,0,0,0),a=a$12.fromDate(t)),(e=new e$J).startTime=o,e.stopTime=a,e.currentTime=a$12.clone(o),e.clockRange=tt$f.LOOP_STOP,e.clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(a$12.secondsDifference(a,o)/60,1),31556900)));var u=!1;return e!==r._clock&&(r._clock=e,u=!0),i!==r._name&&(u=!0),u&&r._changed.raiseEvent(r),o$L.setLoading(r,!1),r})).otherwise((function(e){return o$L.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),o$1q.reject(e)}))};var je$7=new e$1P;function Kt$1(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}function Wt$2(e,t,i,r){var n=(r=u$Y(r,u$Y.EMPTY_OBJECT)).sourceUri;return o$1q(fr$1(i)).then((function(i){var r,o;try{r=xe$a.parseFromString(i,"application/xml")}catch(e){o=e.toString()}if(e$28(o)||r.body||"parsererror"===r.documentElement.tagName){var a=e$28(o)?o:r.documentElement.firstChild.nodeValue;throw a||(a=r.body.innerText),new t$U(a)}return ye$b(e,t,r,n,void 0)}))}function Gt$1(e,t,i,r,n,o,a,s){var l,u=y$o(i,"Location",m$r.kml),c=T$i(i,"altitudeMode",m$r.kml),h=T$i(i,"altitudeMode",m$r.gx),d=y$o(i,"Orientation",m$r.kml),f=I$y(d,"heading",m$r.kml),p=I$y(d,"tilt",m$r.kml),_=I$y(d,"roll",m$r.kml),m=y$o(i,"Scale",m$r.kml),$=I$y(m,"x",m$r.kml),g=I$y(m,"y",m$r.kml),v=I$y(m,"z",m$r.kml),y=T$i(y$o(i,"Link",m$r.kml),"href",m$r.kml);if(e$28(s)&&(l=s[y]),-1!==(y=we$b(y,a,s)).url.indexOf(".s3m")){e$28(e._s3mInstanceCollection)||(e._s3mInstanceCollection=new _0x36e54b(e._camera._scene.context),e._camera._scene.primitives.add(e._s3mInstanceCollection));var x=fe$a(T$i(u,"longitude",m$r.kml)+","+T$i(u,"latitude",m$r.kml)+","+T$i(u,"altitude",m$r.kml)),b=-e$27.toRadians(f),w=e$27.toRadians(p),C=e$27.toRadians(_);return e._s3mInstanceCollection.add(y.url,[{position:x,scale:new t$X($,g,v),hpr:new i$10(b,w,C)}]),!0}var T=y$o(u,"MultiTrack",m$r.gx);if(e$28(T))n.billboard=new n$I({show:!1}),n.label=new n$B({show:!1}),yr$1(e,t,T,r,n),r.orientation=new e$G(r.position);else{x=fe$a(T$i(u,"longitude",m$r.kml)+","+T$i(u,"latitude",m$r.kml)+","+T$i(u,"altitude",m$r.kml));r.position=Mr(new r$G(x),c,h);var S=m$1b.headingPitchRollQuaternion(x,i$10.fromDegrees(f,p,_));r.orientation=S}return r.model={uri:y.url,minimumPixelSize:16,maximumScale:16,scale:new t$X($,g,v),blob:l},!0}U$m.prototype.update=function(e){var t=this._networkLinks;if(0===t.length)return!0;var i=a$12.now(),r=this;function n(e){for(var t=e._children,i=t.length,r=0;r<i;++r){var o=t[r];je$7.set(o.id,o),n(o)}}je$7.removeAll();var o=!1,a=this._lastCameraView,s=this._camera;e$28(s)&&!(s.positionWC.equalsEpsilon(a.position,e$27.EPSILON7)&&s.directionWC.equalsEpsilon(a.direction,e$27.EPSILON7)&&s.upWC.equalsEpsilon(a.up,e$27.EPSILON7))&&(a.position=t$X.clone(s.positionWC),a.direction=t$X.clone(s.directionWC),a.up=t$X.clone(s.upWC),a.bbox=s.computeViewRectangle(),o=!0);var l=new e$1P,u=!1;return t.values.forEach((function(e){var t=e.entity;if(!je$7.contains(t.id)){if(!e.updating){var s=!1;if(e.refreshMode===re$8.INTERVAL?a$12.secondsDifference(i,e.lastUpdated)>e.time&&(s=!0):e.refreshMode===re$8.EXPIRE?a$12.greaterThan(i,e.time)&&(s=!0):e.refreshMode===re$8.STOP&&(o&&(e.needsUpdate=!0,e.cameraUpdateTime=i),e.needsUpdate&&a$12.secondsDifference(i,e.cameraUpdateTime)>=e.time&&(s=!0)),s){n(t),e.updating=!0;var c=new r$z,h=e.href.clone();h.setQueryParameters(e.cookie);var d=u$Y(r._ellipsoid,t$V.WGS84);He$a(h,r._camera,r._canvas,e.viewBoundScale,a.bbox,d),qe$4(r,c,h,{context:t.id}).then(Bt$3(r,e,c,l,h)).otherwise((function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),r._error.raiseEvent(r,i)})),u=!0}}l.set(e.id,e)}})),u&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0},U$m.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},U$m.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport,e$28(this._s3mInstanceCollection)&&this._s3mInstanceCollection.setVisibleInViewport(e,t)},U$m.importFile=function(e,t){return new U$m(t=u$Y(t,u$Y.EMPTY_OBJECT)).read(e,t)},U$m.prototype.read=function(e,t){if(!e$28(e))throw new t$Z("data is required.");o$L.setLoading(this,!0);var i=this._name;this._name=void 0,this._promises=[];var r=this;return Wt$2(this,this._entityCollection,e,t).then((function(){return o$1q.all(r._promises,(function(){var e,t,n=r._entityCollection.computeAvailability(),o=n.start,a=n.stop,s=a$12.equals(o,o$11.MINIMUM_VALUE),l=a$12.equals(a,o$11.MAXIMUM_VALUE);s&&l||(s&&((t=new Date).setHours(0,0,0,0),o=a$12.fromDate(t)),l&&((t=new Date).setHours(24,0,0,0),a=a$12.fromDate(t)),(e=new e$J).startTime=o,e.stopTime=a,e.currentTime=a$12.clone(o),e.clockRange=tt$f.LOOP_STOP,e.clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(a$12.secondsDifference(a,o)/60,1),31556900)));var u=!1;return e!==r._clock&&(r._clock=e,u=!0),i!==r._name&&(u=!0),u&&r._changed.raiseEvent(r),o$L.setLoading(r,!1),r._promises=void 0,r}))})).otherwise((function(e){return o$L.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),o$1q.reject(e)}))},U$m._DeferredLoading=Q$m,U$m._getTimestamp=kt$7;var a$o=e$1S.WHITE,h$n=e$1S.BLACK,s$i=1;function e$y(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._definitionChanged=new o$1o,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth,this.vtime=3.14*Math.random(),this._bAsy=u$Y(e.bAsy,!0),this._speedRatio=u$Y(e.speedRatio,1)}function r$s(){t$Z.throwInstantiationError()}Object.defineProperties(e$y.prototype,{isConstant:{get:function(){return r$K.isConstant(this._color)&&r$K.isConstant(this._outlineColor)&&r$K.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:C$H("color"),outlineColor:C$H("outlineColor"),outlineWidth:C$H("outlineWidth")}),e$y.prototype.getType=function(e){return"PolylineDynamic"},e$y.prototype.getValue=function(e,t){return e$28(t)||(t={}),t.color=r$K.getValueOrClonedDefault(this._color,e,a$o,t.color),t.outlineColor=r$K.getValueOrClonedDefault(this._outlineColor,e,h$n,t.outlineColor),t.outlineWidth=r$K.getValueOrDefault(this._outlineWidth,e,s$i),t.bAsy=1==this._bAsy?1:0,t.v_time=618e-6*performance.now()-1.9788000000000001-this.vtime,t.v_time*=this._speedRatio,t},e$y.prototype.equals=function(e){return this===e||e instanceof e$y&&r$K.equals(this._color,e._color)&&r$K.equals(this._outlineColor,e._outlineColor)&&r$K.equals(this._outlineWidth,e._outlineWidth)},r$s.prototype.update=t$Z.throwInstantiationError,r$s.prototype.getBoundingSphere=t$Z.throwInstantiationError,r$s.prototype.isDestroyed=t$Z.throwInstantiationError,r$s.prototype.destroy=t$Z.throwInstantiationError;var e$x={NONE:0,CATMULL_ROM:1},hi$3=Object.freeze(e$x),e$w={StopPause:"StopPause",StopAround:"StopAround"},A$u=Object.freeze(e$w);function e$v(e){this._duration=u$Y(e.duration,10),this._waitTime=u$Y(e.waitTime,0),this._point=e.point,this._heading=u$Y(e.heading,0),this._tilt=u$Y(e.tilt,0),this._stopName=e.stopName,this._speed=u$Y(e.speed,0),this._stopPlayMode=e.stopPlayMode||A$u.StopPause,this._surroundDuration=u$Y(e.surroundDuration,0),this._promise=void 0,this._index=u$Y(e.index,0),this._nextStopIndex=void 0,this._preStopIndex=void 0,this._isConvert=u$Y(e.isConvert,!0)}Object.defineProperties(e$v.prototype,{duration:{get:function(){return this._duration},set:function(e){e&&(this._duration=e)}},waitTime:{get:function(){return this._waitTime},set:function(e){e&&!this._isGenerated&&(this._waitTime=e)}},heading:{get:function(){return this._heading},set:function(e){e&&(this._heading=e)}},tilt:{get:function(){return this._tilt},set:function(e){e&&(this._tilt=e)}},stopName:{get:function(){return this._stopName},set:function(e){e&&(this._stopName=e)}},point:{get:function(){return this._point},set:function(e){this._point=e}},speed:{get:function(){return this._speed},set:function(e){e&&(this._speed=e)}},stopPlayMode:{get:function(){return this._stopPlayMode},set:function(e){e&&(this._stopPlayMode=e)}},surroundDuration:{get:function(){return this._surroundDuration},set:function(e){e&&(this._surroundDuration=e)}},index:{get:function(){return this._index}},promise:{get:function(){return this._promise},set:function(e){e&&(this._promise=e)}}});var e$u={Smoothly:0,Directly:1},v$q=Object.freeze(e$u),n$n={Playing:0,Pause:1,Stop:2,Wait:3},m$q;function l$q(e){var t=e.scene,i=e.routes;if(!t)throw new t$Z("scene is required!");if(!i)throw new t$Z("routes is required!");this._routes=i,this._scene=t,this._currentStopIndex=0,this._dynamicCurrentStopIndex=0,this._currentTween=void 0,this._stopArrived=new o$1o,this._playRate=1,this._flyStatus=n$n.Stop,this._turningMode=v$q.Smoothly,this._interpolationMode=hi$3.NONE}function c$k(e,t,i){e._flyStatus=n$n.Playing;var r=e._scene.camera,n=e._routes.routes[0],o=n._catmullRomSpline,a=e._interpolationMode,s=n.isFlyLoop,l=n.isHeadingFree,u=n.isTiltFree,c=n.isAltitudeFree,h=u$Y(n._stopCollection.get(t),n._stopCollection._array[t]);if(!h)return!0===s?(t=n._stopCollection._array[0].index,e$28(o)&&(o._lastTimeIndex=0),e._dynamicCurrentStopIndex=t,e.currentStopIndex=t,void c$k(e,t)):void(e._flyStatus=n$n.Stop);if(t===e.currentStopIndex){var d=n.isAlongline&&e$28(h.direction)&&!u?{direction:h.direction,up:h.up}:{heading:h.heading,pitch:h.tilt,roll:0};r.setView({destination:h.point,orientation:d,convert:h._isConvert}),t++,c$k(e,t)}else{if(h._bImmediately){d=n.isAlongline&&e$28(h.direction)&&!u?{direction:h.direction,up:h.up}:{heading:h.heading,pitch:h.tilt,roll:0};return r.setView({destination:h.point,orientation:d,convert:h._isConvert}),void g$o(e,h,t)}var f=u$Y(n._stopCollection.get(t-1),n._stopCollection.get(h._preStopIndex));e$28(i)&&(f=i);var p,_=f.altitude<h.altitude?f.altitude:h.altitude;if(f.stopPlayMode===A$u.StopAround)p=f.surroundDuration;else{if(e$28(i)){var m=t$X.distance(i.point,h.point);f.duration=m/f.speed}p=f.duration}p/=e._playRate;d=n.isAlongline&&e$28(h.direction)&&!u?{direction:h.direction,up:h.up}:{heading:h.heading,pitch:h.tilt,roll:0};var $=!1;if(e._turningMode===v$q.Directly&&e$28(f.direction)){d={direction:f.direction,up:f.up};$=!0}r.flyTo({convert:h._isConvert,destination:h.point,orientation:d,maximumHeight:_,duration:p,headingFree:l,pitchFree:u,altitudeFree:c,directTurning:$,catmullRomSpline:o,preStopIndex:t-1,interpolationMode:a,easingFunction:m$S.LINEAR_NONE,complete:function(){g$o(e,h,t)}})}}function g$o(e,t,i){if(m$q&&clearTimeout(m$q),e._dynamicCurrentStopIndex=t._index,i=u$Y(t._nextStopIndex,t._index+1),e._stopArrived.raiseEvent(t),t.promise)o$1q(t.promise,(function(){var r=t.waitTime;r>0?setTimeout((function(){c$k(e,i)}),1e3*r):c$k(e,i)}));else{var r=t.waitTime;r>0?(e._flyStatus=n$n.Wait,m$q=setTimeout((function(){e._flyStatus===n$n.Wait&&(e._flyStatus=n$n.Playing,c$k(e,i))}),1e3*r)):c$k(e,i)}}function f$o(e){e=e||{},this._stopCollection=new e$1P,this._isStopVisible=u$Y(e.isStopVisible,!1),this._stopMarkCollection=[],this._isFlyLoop=u$Y(e.isFlyLoop,!1),this._isLineVisible=u$Y(e.isLineVisible,!1),this._lineEntity=void 0,this._routeName=u$Y(e.routeName,""),this._speed=u$Y(e.speed,50),this._isAlongline=u$Y(e.isAlongline,!1),this._totalDuration=u$Y(e.totalDuration,0),this._isHeadingFree=!this._isAlongline&&u$Y(e.isHeadingFree,!1),this._isTiltFree=u$Y(e.isTiltFree,!1),this._isAltitudeFree=u$Y(e.isAltitudeFree,!1),this._entityCollection=e.entityCollection,this._catmullRomSpline=void 0,this._isCleared=!1,this._stopsInfo=u$Y(e.stopsInfo,{}),this._removeIndex=[],this._addedStops=[]}function d$x(e){this._entityCollection=e,this._routes=[],this._ready=!1,this._readyPromise=o$1q.defer()}function p$l(e,t){for(var i=e,r=t.firstChild,n=r.namespaceURI,o=h$m(r,"route",n),a=0,s=o.length;a<s;a++){var l=o[a],u=h$m(l,"routestop",n),c=I$x(l,"speed"),h=O$k(l,"name"),d=l$p(l,"showroutestop"),f=l$p(l,"showrouteline"),p=l$p(l,"flycircle"),_=l$p(l,"alongline"),m=l$p(l,"headingfree"),$=l$p(l,"tiltfree"),g=l$p(l,"altitudefree"),v=new f$o({entityCollection:i._entityCollection,routeName:h,speed:c,isLineVisible:f,isFlyLoop:p,isStopVisible:d,isAlongline:_,isHeadingFree:m,isTiltFree:$,isAltitudeFree:g,stopsInfo:{stopNodes:u,namespace:n}});v.init(),i.addRoute(v),i._ready=!0}i._readyPromise.resolve()}function I$x(e,t){if(e$28(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function O$k(e,t){if(e$28(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function l$p(e,t){if(e$28(e)){var i=e.getAttribute(t);if("false"===(i=i.toLowerCase()))return!1;if("true"===i)return!0}}function h$m(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function o$z(){this.Name="",this.NumParts=0,this.NumPoints=0,this.Parts=[],this.Points=[],this.Description="",this.Color=new e$1S(1,1,1),this.Radius=.02}function z$k(e,t){this.a0=80,this.r=35.187*.001,e$28(t)?(this.a0=e,this.r=t,this.m_sag=new d$w(e,t)):e$28(e)&&(this.m_sag=new d$w(e)),this.enuCenters=[]}Object.defineProperties(l$q.prototype,{routes:{get:function(){return this._routes},set:function(e){e&&(this._routes=e)}},stopArrived:{get:function(){return this._stopArrived}},currentStopIndex:{get:function(){return e$28(this._routes.routes[0]._stopCollection.get(this._currentStopIndex))||(this._dynamicCurrentStopIndex=this._currentStopIndex=this._routes.routes[0]._stopCollection._array[0].index),this._currentStopIndex},set:function(e){if(e$28(e)&&1==this._routes.ready){var t=this._routes.routes[0].stopCollection.length-1;e=(e=e>t?t:e)<0?0:e,this._currentStopIndex=e}}},currentRoute:{get:function(){if(this._routes.ready)return this._routes.routes[0]}},readyPromise:{get:function(){return this._routes.readyPromise}},playRate:{get:function(){return this._playRate},set:function(e){if(e&&0!==e&&this._playRate!==e&&(this._playRate=e,this._flyStatus===n$n.Playing)){this._scene.camera.cancelFlight();var t=this._routes.routes[0].get(this._dynamicCurrentStopIndex),i=new e$v({});for(var r in t)i[r]=t[r];i.point=this._scene.camera._position,c$k(this,this._dynamicCurrentStopIndex+1,i)}}},turningMode:{get:function(){return this._turningMode},set:function(e){this._turningMode=e}},interpolationMode:{get:function(){return this._interpolationMode},set:function(e){this._interpolationMode=e}}}),l$q.prototype.play=function(){if(this.currentRoute&&this._flyStatus!==n$n.Playing)if(this._flyStatus===n$n.Pause||this._flyStatus===n$n.Wait)this._currentTween&&this._scene.camera._currentFlight?(this._currentTween.tweenjs.endPause(),this._flyStatus=n$n.Playing):c$k(this,this._dynamicCurrentStopIndex+1);else{if(this.currentStopIndex>=this._routes.routes[0].stopCollection[this._routes.routes[0].stopCollection.length-1].index)return void(this._flyStatus=n$n.Stop);c$k(this,this.currentStopIndex)}},l$q.prototype.pause=function(){this._flyStatus===n$n.Playing?(this._currentTween=this._scene.camera._currentFlight,this._currentTween&&this._currentTween.tweenjs&&this._currentTween.tweenjs.pause(),this._flyStatus=n$n.Pause):this._flyStatus===n$n.Wait&&(this._flyStatus=n$n.Pause)},l$q.prototype.stop=function(){this._currentTween=this._scene.tweens.get(0),this._currentTween&&this._flyStatus!==n$n.Stop?(this._currentTween.cancelTween(),this._flyStatus=n$n.Stop,this._currentTween=void 0):this._flyStatus===n$n.Wait&&(this._flyStatus=n$n.Stop),this._dynamicCurrentStopIndex=this._currentStopIndex},l$q.prototype.viewToStop=function(e){if(e&&this._flyStatus!==n$n.Playing){var t=this._scene.camera,i={heading:e.heading,pitch:e.tilt,roll:0};t.setView({destination:e.point,orientation:i,convert:e._isConvert}),this._dynamicCurrentStopIndex=e.index}},l$q.prototype.getAllRouteStops=function(){return this.currentRoute?this.currentRoute.stopCollection:[]},Object.defineProperties(f$o.prototype,{stopCollection:{get:function(){return this._stopCollection.values}},isStopVisible:{get:function(){return this._isStopVisible},set:function(e){e$28(e)&&e!==this._isStopVisible&&(this._isStopVisible=e,this.setStopVisible())}},isFlyLoop:{get:function(){return this._isFlyLoop},set:function(e){e&&(this._isFlyLoop=e)}},isLineVisible:{get:function(){return this._isLineVisible},set:function(e){e$28(e)&&e!==this._isLineVisible&&(this._isLineVisible=e,this.setLineVisible())}},lineEntity:{get:function(){return this._lineEntity},set:function(e){e$28(e)&&(this._lineEntity=e)}},routeName:{get:function(){return this._routeName},set:function(e){e&&(this._routeName=e)}},speed:{get:function(){return this._speed},set:function(e){if(e&&e!=this._speed){this._speed=e;for(var t=this.speed,i=this.stopCollection,r=0,n=i.length;r<n-1;r++){var o=i[r];o.duration=Math.ceil(o.distanceToNext/t)}}}},stopCount:{get:function(){return this._stopCollection.length}},isAlongline:{get:function(){return this._isAlongline},set:function(e){e$28(e)&&(this._isAlongline=e)}},totalDuration:{get:function(){return this._totalDuration}},isHeadingFree:{get:function(){return this._isHeadingFree},set:function(e){e$28(e)&&(this._isHeadingFree=e)}},isTiltFree:{get:function(){return this._isTiltFree},set:function(e){e$28(e)&&(this._isTiltFree=e)}},isAltitudeFree:{get:function(){return this._isAltitudeFree},set:function(e){e$28(e)&&(this._isAltitudeFree=e)}}}),f$o.prototype.init=function(){var e=0,t=[0],i=[],r=this._stopsInfo.stopNodes,n=this._stopsInfo.namespace;r=e$28(r)?r.concat(this._addedStops):this._addedStops;for(var o=0;o<r.length;o++)if(!(this._removeIndex.indexOf(o)>-1)){var a,s=r[o];if(s instanceof e$v){if(-1!==(a=s)._preStopIndex){var l=(T=this._stopCollection._array[a._preStopIndex]).point,u=t$X.distance(l,a.point);T.distanceToNext=u}}else{var c=s$P.queryFirstNode(s,"camera",n),h=s$P.queryNumericValue(c,"longitude",n),d=s$P.queryNumericValue(c,"latitude",n),f=s$P.queryNumericValue(c,"altitude",n),p=s$P.queryNumericValue(c,"heading",n);p=e$27.toRadians(p);var _=s$P.queryNumericValue(c,"tilt",n);_=e$27.toRadians(_-90),s$P.queryStringValue(c,"altitudeMode",n);var m,$=s$P.queryStringAttribute(s,"name"),g=s$P.queryNumericAttribute(s,"speed",n),v=s$P.queryFirstNode(s,"setting",n),y=s$P.queryStringValue(v,"stopPlayMode",n),x=s$P.queryNumericValue(v,"pauseTime",n),b=s$P.queryNumericValue(v,"angularSpeed",n),w=s$P.queryFirstNode(v,"stopViews",n),C=!0;h>180||d>180?(m=new t$X(h,d,f),C=!1):m=t$X.fromDegrees(h,d,f),i.push(m);var T,S=this.stopCount;if(o>0&&S>0)if((T=this._stopCollection._array[this._stopCollection.length-1]).stopPlayMode!=A$u.StopAround){l=T.point,u=t$X.distance(l,m);T.distanceToNext=u;var E,A=T.speed;E=0<A?A:this._speed,T.duration=u/E,T.speed=E,e+=T.duration,t.push(e)}(a=new e$v({index:o,point:m,heading:p,tilt:_,stopName:$,waitTime:x,speed:g,isConvert:C})).altitude=f}if(this._addStop(a),e$28(T)&&(T._nextStopIndex=o,a._preStopIndex=T.index),y===A$u.StopAround&&w){var P=queryChildNodes(w,"view",n);if(2==P.length){var I=P[0],M=P[1],O=s$P.queryNumericAttribute(I,"heading",n),D=s$P.queryNumericAttribute(M,"heading",n);s$P.queryNumericAttribute(I,"tilt",n),s$P.queryNumericAttribute(M,"tilt",n),s$P.queryNumericAttribute(I,"altitude",n),s$P.queryNumericAttribute(M,"altitude",n);var R=s$P.queryStringAttribute(I,"direction",n);s$P.queryStringAttribute(M,"direction",n);var L,B="Clockwise"===R?1:-1;e$27.equalsEpsilon(O,D,e$27.EPSILON15)?L=360:((L=D-O)<0&&"Clockwise"===R?L+=360:L>0&&"Clockwise"!==R&&(L=360-L),L=Math.abs(L));var N=L/b;a.surroundDuration=N/3,a.stopPlayMode=A$u.StopAround;var F=e$27.toRadians(O),z=e$27.toRadians(O+B*L/3),k=e$27.toRadians(O+B*L*2/3),V=e$27.toRadians(D),U=new e$v({point:m,heading:F,tilt:_,stopName:$,waitTime:x,speed:g,surroundDuration:N/3,stopPlayMode:A$u.StopAround});U._bImmediately=!0,U._isGenerated=!0,this._addStop(U);var X=new e$v({point:m,heading:z,tilt:_,stopName:$,waitTime:0,speed:g,surroundDuration:N/3,stopPlayMode:A$u.StopAround});X._isGenerated=!0,this._addStop(X);var H=new e$v({point:m,heading:k,tilt:_,stopName:$,waitTime:0,speed:g,surroundDuration:N/3,stopPlayMode:A$u.StopAround});H._isGenerated=!0,this._addStop(H);var G=new e$v({point:m,heading:V,tilt:_,stopName:$,waitTime:x,speed:g});this._addStop(G),e+=N}}}for(var W=0;W<this.stopCount-1;W++){var Y=this.stopCollection[W],q=this.stopCollection[W+1],j=new t$X(q.point.x-Y.point.x,q.point.y-Y.point.y,q.point.z-Y.point.z);j.equals(t$X.ZERO)||(t$X.normalize(j,j),Y.direction=j,Y.up=m$1b.buildUp(Y.point,j),this._isTiltFree&&(Y.heading=m$1b.getHeading(Y.direction,Y.up)-e$27.PI))}if(this.stopCount>2){var Z=this.stopCollection[this.stopCollection.length-1],K=this.stopCollection[this.stopCollection.length-2];Z.direction=K.direction,Z.up=K.up,this._isTiltFree&&(Z.heading=m$1b.getHeading(Z.direction,Z.up)-e$27.PI)}i.length>=2&&(this._catmullRomSpline=new c$_({times:t,points:i})),this.setStopVisible(),this._totalDuration=e},f$o.prototype._addStop=function(e){if(!e)throw new t$Z("parameter stop is required!");if(!(e instanceof e$v))throw new t$Z("parameter stop must be instanceof RouteStop!");if(this._stopCollection.set(e.index,e),e$28(this._entityCollection)&&this._isStopVisible){var t=this._entityCollection.add({position:e.point,billboard:{image:n$17("Assets/Textures/maki/grepin.png"),scale:.5}});this._stopMarkCollection.push(t)}if(this._isCleared&&this._stopCollection.length>2)if(e$28(this._catmullRomSpline)){var i=[].concat(this._catmullRomSpline.times),r=[].concat(this._catmullRomSpline.points),n=this._stopCollection.length>0?this._stopCollection._array[this._stopCollection.length-2]._duration:0,o=i.length>0?i[i.length-1]:0;i.push(o+n),r.push(e.point),this._catmullRomSpline=new c$_({times:i,points:r})}else{for(var a=[0],s=[this._stopCollection._array[0].point],l=0,u=1;u<this._stopCollection.length;u++){var c=this._stopCollection._array[u],h=this._stopCollection._array[u-1];s.push(c.point),l+=h.duration,a.push(l)}this._catmullRomSpline=new c$_({times:a,points:s})}return!0},f$o.prototype.addStop=function(e){if(!e)throw new t$Z("parameter stop is required!");if(!(e instanceof e$v))throw new t$Z("parameter stop must be instanceof RouteStop!");e._preStopIndex=this._stopsInfo.stopNodes.length+this._addedStops.length-1,e._index=e._preStopIndex+1,this._addedStops.push(e),this.clear(),this.init(),this.setLineVisible()},f$o.prototype.removeStop=function(e){this.clear(),-1===this._removeIndex.indexOf(e.index)&&this._removeIndex.push(e.index),this.init(),this.setLineVisible()},f$o.prototype.setLineVisible=function(){if(e$28(this._entityCollection)){if(!e$28(this._lineEntity)){for(var e=this.stopCollection,t=e.length,i=[];t--;)i.push(e[t].point);this._lineEntity=this._entityCollection.add({name:this.routeName,polyline:{positions:i,width:5}})}this._lineEntity.show=this._isLineVisible}},f$o.prototype.setStopVisible=function(){if(e$28(this._entityCollection)){if(0===this._stopMarkCollection.length&&this._isStopVisible)for(var e=this.stopCollection,t=e.length;t--;){var i=e[t],r=this._entityCollection.add({position:i.point,billboard:{image:n$17("Assets/Textures/maki/grepin.png"),scale:.5}});this._stopMarkCollection.push(r)}for(var n=0,o=this._stopMarkCollection.length;n<o;n++){(r=this._stopMarkCollection[n]).show=this._isStopVisible}}},f$o.prototype.get=function(e){return void 0===this._stopCollection.get(e)?this.stopCollection[e]:this._stopCollection.get(e)},f$o.prototype.clear=function(){this._isCleared=!0;for(var e=0;e<this._stopMarkCollection.length;e++)this._entityCollection.remove(this._stopMarkCollection[e]);e$28(this._lineEntity)&&(this._entityCollection.remove(this._lineEntity),this._lineEntity=void 0),this._stopCollection.removeAll(),e$28(this._catmullRomSpline)&&(this._catmullRomSpline=void 0)},Object.defineProperties(d$x.prototype,{routes:{get:function(){return this._routes}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}}}),d$x.prototype.addRoute=function(e){if(e&&(this._routes.push(e),e.isLineVisible&&e$28(this._entityCollection))){for(var t=e.stopCollection,i=t.length,r=[];i--;)r.push(t[i].point);e.lineEntity=this._entityCollection.add({name:e.routeName,polyline:{positions:r,width:5}})}},d$x.prototype.get=function(e){return this._routes[e]},d$x.prototype.fromFile=function(e){var t=this;o$1q(d$17(e),(function(e){p$l(t,e)}),(function(){t._readyPromise.reject()}))},d$x.prototype.fromXML=function(e){if(!e$28(e))throw new t$Z("xml content is required to create routes!");var t=(new DOMParser).parseFromString(e,"text/xml");try{p$l(this,t)}catch(e){throw new t$Z(e)}},o$z.prototype.Clone=function(){var e=new o$z;if(e.Name=this.Name,e.Description=this.Description,e.NumParts=this.NumParts,e.NumPoints=this.NumPoints,e.Color=this.Color,e.Radius=this.Radius,null!=this.Parts){for(var t=[],i=0;i<this.Parts.length;i++)t.push(this.Parts[i]);e.Parts=t}e.Points=[];for(i=0;i<this.NumPoints;i++)e.Points[i]=new t$X,e.Points[i].x=this.Points[i].x,e.Points[i].y=this.Points[i].y,e.Points[i].z=this.Points[i].z;return e},o$z.prototype.ComputeBox=function(e,t){e=new t$X(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t=new t$X(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE);for(var i=0,r=this.Points.length;i<r;i++){var n=this.Points[i];e.x>n.x&&(e.x=n.x),e.y>n.y&&(e.y=n.y),e.z>n.z&&(e.z=n.z),t.x<n.x&&(t.x=n.x),t.y<n.y&&(t.y=n.y),t.z<n.z&&(t.z=n.z)}},z$k.enuCenter=void 0;var M$p={sh:function(e){return(Math.pow(Math.E,e)-Math.pow(Math.E,-e))/2},arsh:function(e){return Math.log(e+Math.sqrt(e*e+1),Math.E)}};function N$i(e){return new t$X(parseFloat(e.x)||0,parseFloat(e.y)||0,parseFloat(e.z)||0)}z$k.prototype.GetPowerline=function(e){if(!e instanceof o$z||null==e.Points||e.Points.Length<2)return null},z$k.prototype.gernerateCatenarylines=function(e){if(!(e.points instanceof Array&&e$28(e.points[0].begin)&&e$28(e.points[0].end)))throw new t$Z("options.points is required and must like [{begin : 0, end : 1}, {begin : 1, end : 2}]");for(var t=[],i=u$Y(e.imageUrl,""),r=u$Y(e.imageRepeat,new o$1k(30,1)),n=u$Y(e.imageTransparent,!1),o=u$Y(e.volumeDisplayCondition,new o$1k(0,500)),a=u$Y(e.lineDisplayCondition,new o$1k(500,5e4)),s=u$Y(e.lineColor,e$1S.WHITE),l=0,u=e.points.length;l<u;l++){var c=e.points[l].begin,h=e.points[l].end;c=N$i(c),h=N$i(h);var d=this.InsertTwoPoints(c,h),f=[],p=null,_=t$X.fromDegrees(d[0].x,d[0].y,d[0].z);if(0===this.enuCenters.length)this.enuCenters.push(_),p=this.enuCenters[0];else{for(var m=0;m<this.enuCenters.length;m++)if(t$X.distance(this.enuCenters[m],_)<1e4){p=this.enuCenters[m];break}e$28(p)||(p=_,this.enuCenters.push(_))}for(var $=0;$<d.length;$++){var g=t$X.fromDegrees(d[$].x,d[$].y,d[$].z);f.push(g)}if(f.length>1){var v=new h$F({polylineVolume:new e$13({positions:f,enuCenter:p,shape:U$l(this.r),material:new a$N({image:i,repeat:r,transparent:n}),distanceDisplayCondition:new r$10(o.x,o.y)}),polyline:new a$I({positions:f,distanceDisplayCondition:new r$10(a.x,a.y),width:2,material:s})});t.push(v)}}return t};var q$l={};function U$l(e){if(e$28(q$l["_"+e]))return q$l["_"+e];for(var t=[],i=0;i<360;){var r=e$27.toRadians(i);t.push(new o$1k(e*Math.cos(r),e*Math.sin(r))),i+=11.25}return q$l["_"+e]=t,t}function T$h(e,t,i,r){return.5*r-e/t*M$p.arsh(t*i/(2*e*M$p.sh(t*r/(2*e))))}function H$o(e,t,i){return e*e+t*t+i*i}function S$j(e,t,i){return Math.sqrt(H$o(e,t,i))}function J$n(e,t,i){var r=S$j(e,t,i);return new t$X(e/r,t/r,i/r)}function O$j(e,t,i){e*=Math.PI/180,t*=Math.PI/180;var r=i*Math.cos(e);return new t$X(r*Math.cos(t),r*Math.sin(t),i*Math.sin(e))}function D$r(e){new t$X;return O$j(e.y,e.x,e.z+6378137)}function d$w(e,t){this.l=0,this.h=0,e$28(t)?(this.a0=e,this.r=t,this.k=Q$l(e,t)):(this.k=e,this.a0=0,this.r=0)}function Q$l(e,t){return t*Math.pow(10,5)/(8*e)}function i$n(){this.init()}function r$r(e,t,i){e=parseFloat(e)||0,t=parseFloat(t)||0,i=parseFloat(i)||0,this.init(e,t,i)}function i$m(e){e=parseFloat(e)||0,this.init(e)}function r$q(e,t){e=parseFloat(e)||0,t=parseFloat(t)||0,this._vertex=void 0,this._rotateOrigin=O$r.CENTER,this.init(e,t)}function i$l(e,t,i){e=parseFloat(e)||0,t=parseFloat(t)||0,i=parseFloat(i)||0,this.init(e,t,i)}function i$k(e,t,i){e=parseFloat(e)||0,t=parseFloat(t)||0,i=parseFloat(i)||0,this.init(e,t,i)}function t$f(){this.init()}function e$t(e){e=e||{},this.init(e)}function e$s(e){e=parseFloat(e)||0,this.init(e)}z$k.prototype.InsertTwoPoints=function(e,t){if(!(e instanceof t$X&&t instanceof t$X))throw new t$Z("startPos and endPos must be Cartesian3!");if(e.x==t.x&&e.y==t.y&&e.z==t.z)return[new t$X(e.x,e.y,e.z)];var i=D$r(e),r=D$r(t),n=t$X.subtract(r,i,new t$X),o=t$X.magnitude(n),a=Math.max(Math.floor(o/10),2);a=a%2==0?a:a+1;var s=new Array(a+2),l=t.z-e.z,u=l/o,c=Math.sqrt(1-u*u)||1;T$h(this.a0,this.r,l,o*c);var h=o/(a+1);this.m_sag.l=o*c,this.m_sag.h=l;for(var d=0;d<=a+1;d++){var f=new t$X((t.x-e.x)*d/(a+1),(t.y-e.y)*d/(a+1),(t.z-e.z)*d/(a+1));if(s[d]=new t$X(e.x+f.x,e.y+f.y,e.z+f.z),0!=d||d!=this.segments+1){var p=h*d;this.m_sag.fx(p*c),s[d].z=s[d].z-this.m_sag.fx(p*c)}}return s},z$k.prototype.CalcPoint=function(e,t,i){var r=D$r(e),n=D$r(t),o=new t$X(n.x-r.x,n.y-r.y,n.z-r.z),a=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),s=null,l=t.z-e.z,u=l/a,c=Math.sqrt(1-u*u);T$h(this.a0,this.r,l,a*c),this.m_sag.l=a*c,this.m_sag.h=l;var h=i/this.m_sag.l,d=new t$X(t.x-e.x,t.y-e.y,t.z-e.z);o=new t$X((d=J$n(d.x,d.y,d.z)).x*a*h,d.y*a*h,d.z*a*h);return(s=new t$X(e.x+o.x,e.y+o.y,e.z+o.z)).z=s.z-this.m_sag.fx(i),s},d$w.prototype.fx=function(e){var t=8*Math.pow(10,-5)*this.k,i=this.Loa();return e*(this.h/this.l)+2/t*(M$p.sh(t*(2*i-e)/2)*M$p.sh(t*e/2))},d$w.prototype.Loa=function(){var e=8*Math.pow(10,-5)*this.k;return.5*this.l-1/e*M$p.arsh(this.h*e/2/M$p.sh(e*this.l/2))},i$n.prototype=new o$M,i$n.prototype.constructor=i$n,Object.defineProperties(i$n.prototype,{geoImagePath:{get:function(){return this.imagePath},set:function(e){"string"==typeof e&&(this.imagePath=e,this.billboard.image=e)}},geoWidth:{get:function(){return this.width},set:function(e){"number"==typeof e&&(this.width=e,this.billboard.width=e)}},geoHeight:{get:function(){return this.height},set:function(e){"number"==typeof e&&(this.height=e,this.billboard.height=e)}}}),i$n.prototype.init=function(){this.type=P$v.GEOBILLBOARD,this.height=100,this.width=100,this.imagePath="",this.billboard={image:"",width:100,height:100}},r$r.prototype=new o$M,r$r.prototype.constructor=r$r,Object.defineProperties(r$r.prototype,{geoLength:{get:function(){return this.length},set:function(e){"number"==typeof e&&(this.length=e,this.box.dimensions.x=e,this._isGeometryDirty=!0)}},geoWidth:{get:function(){return this.width},set:function(e){"number"==typeof e&&(this.width=e,this.box.dimensions.y=e,this._isGeometryDirty=!0)}},geoHeight:{get:function(){return this.height},set:function(e){"number"==typeof e&&(this.height=e,this.box.dimensions.z=e,this._isGeometryDirty=!0)}}}),r$r.prototype.init=function(e,t,i){this.type=P$v.GEOBOX,this.length=e,this.width=t,this.height=i,this.box={dimensions:new t$X(e,t,i),vertexFormat:n$10.POSITION_NORMAL_AND_ST}},r$r.prototype.isValid=function(){return this.length>0&&this.width&&this.height>0},r$r.prototype._createGeometry=function(){let e=O$H.fromDimensions(this.box);this._geometry=O$H.createGeometry(e),this._isGeometryDirty=!1,this._vertexBuffer&&!this._vertexBuffer.isDestroyed()&&(this._vertexBuffer=this._vertexBuffer.destroy())},r$r.prototype.getCenter=function(){return new s$q(this.position.x,this.position.y,this.position.z+this.height/2)},r$r.prototype.getOutlineVertexArray=function(e){let t=new Uint16Array(24);t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,t[8]=4,t[9]=5,t[10]=5,t[11]=6,t[12]=6,t[13]=7,t[14]=7,t[15]=4,t[16]=1,t[17]=5,t[18]=2,t[19]=6,t[20]=0,t[21]=4,t[22]=3,t[23]=7;let i=h$W.createIndexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),r=[];return r.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}),new m$19({context:e,attributes:r,indexBuffer:i})},i$m.prototype=new o$M,i$m.prototype.constructor=i$m,Object.defineProperties(i$m.prototype,{geoRadius:{get:function(){return this.radius},set:function(e){"number"==typeof e&&(this.radius=e,this.ellipse.semiMinorAxis=e,this.ellipse.semiMajorAxis=e)}}}),i$m.prototype.init=function(e){this.type=P$v.GEOCIRCLE3D,this.radius=e,this.ellipse={semiMinorAxis:e,semiMajorAxis:e}},i$m.prototype.isValid=function(){return this.radius>0},i$m.prototype.getCenter=function(){return new Point3D(this.position.x,this.position.y,this.position.z)},r$q.prototype=new o$M,r$q.prototype.constructor=r$q,Object.defineProperties(r$q.prototype,{geoBottomRadius:{get:function(){return this.bottomRadius},set:function(e){"number"==typeof e&&(this.bottomRadius=e,this.cylinder.bottomRadius=e,this._isGeometryDirty=!0)}},geoHeight:{get:function(){return this.height},set:function(e){"number"==typeof e&&(this.height=e,this.cylinder.length=e,this._isGeometryDirty=!0)}},rotateOrigin:{get:function(){return this._rotateOrigin},set:function(e){o$1u.typeOf.number("GeoCone rotateOrigin",e),this._rotateOrigin=e}}}),r$q.prototype.init=function(e,t){this.type=P$v.GEOCONE,this.height=t,this.bottomRadius=e,this.cylinder={length:t,topRadius:0,bottomRadius:e,vertexFormat:n$10.POSITION_NORMAL_AND_ST}},r$q.prototype.clone=function(){return new r$q(this.bottomRadius,this.height)},r$q.prototype._createGeometry=function(){var e=new l$_(this.cylinder);this._geometry=l$_.createGeometry(e),this._vertex=t$X.fromDegrees(this.position.x,this.position.y,this.position.z+this.height/2),this._isGeometryDirty=!1},r$q.prototype.getOutlineVertexArray=function(e){let t=new Uint16Array(768),i=0;for(let e=0;e<256;e+=2)t[i++]=e,t[i++]=e+1,t[i++]=e,t[i++]=e+2,t[i++]=e+1,t[i++]=e+3;t[i-1]=1;let r=h$W.createIndexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),n=[];return n.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}),new m$19({context:e,attributes:n,indexBuffer:r})},i$l.prototype=new o$M,i$l.prototype.constructor=i$l,Object.defineProperties(i$l.prototype,{geoTopRadius:{get:function(){return this.topRadius},set:function(e){"number"==typeof e&&(this.topRadius=e,this.cylinder.topRadius=e,this._isGeometryDirty=!0)}},geoBottomRadius:{get:function(){return this.bottomRadius},set:function(e){"number"==typeof e&&(this.bottomRadius=e,this.cylinder.bottomRadius=e,this._isGeometryDirty=!0)}},geoHeight:{get:function(){return this.height},set:function(e){"number"==typeof e&&(this.height=e,this.cylinder.length=e,this._isGeometryDirty=!0)}}}),i$l.prototype.init=function(e,t,i){this.type=P$v.GEOCYLINDER,this.height=i,this.topRadius=e,this.bottomRadius=t,this.cylinder={length:i,topRadius:e,bottomRadius:t,vertexFormat:n$10.POSITION_NORMAL_AND_ST}},i$l.prototype.clone=function(){return new i$l(this.topRadius,this.bottomRadius,this.height)},i$l.prototype._createGeometry=function(){var e=new l$_(this.cylinder);this._geometry=l$_.createGeometry(e),this._isGeometryDirty=!1},i$l.prototype.getOutlineVertexArray=function(e){let t=new Uint16Array(768),i=0;for(let e=0;e<256;e+=2)t[i++]=e,t[i++]=e+1,t[i++]=e,t[i++]=e+2,t[i++]=e+1,t[i++]=e+3;t[i-1]=1;let r=h$W.createIndexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),n=[];return n.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}),new m$19({context:e,attributes:n,indexBuffer:r})},i$k.prototype=new o$M,i$k.prototype.constructor=i$k,Object.defineProperties(i$k.prototype,{geoXAxis:{get:function(){return this.xAxis},set:function(e){"number"==typeof e&&(this.xAxis=e,this.ellipsoid.radii.x=e,this._isGeometryDirty=!0)}},geoYAxis:{get:function(){return this.yAxis},set:function(e){"number"==typeof e&&(this.yAxis=e,this.ellipsoid.radii.z=e,this._isGeometryDirty=!0)}},geoZAxis:{get:function(){return this.zAxis},set:function(e){"number"==typeof e&&(this.zAxis=e,this.ellipsoid.radii.y=e,this._isGeometryDirty=!0)}}}),i$k.prototype.init=function(e,t,i){this.type=P$v.GEOELLIPSOID,this.xAxis=e,this.yAxis=t,this.zAxis=i,this.ellipsoid={radii:new t$X(e,i,t),vertexFormat:n$10.POSITION_NORMAL_AND_ST}},i$k.prototype.isValid=function(){return this.xAxis>0&&this.yAxis&&this.zAxis>0},i$k.prototype.getCenter=function(){return new s$q(this.position.x,this.position.y,this.position.z+this.zAxis)},i$k.prototype._createGeometry=function(){var e=new b$Y(this.ellipsoid);this._geometry=b$Y.createGeometry(e),this._isGeometryDirty=!1},i$k.prototype.getOutlineVertexArray=function(e){this._getGeometry();let t=0,i=new Uint16Array(17956);for(let e=0;e<67;e++){var r=67*e;for(let e=0;e<66;e++)i[t++]=r+e,i[t++]=r+e+1}for(let e=0;e<67;e++)for(let r=0;r<65;r++)i[t++]=67+e+67*r,i[t++]=67+e+67*(r+1);let n=h$W.createIndexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),o=[];return o.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}),new m$19({context:e,attributes:o,indexBuffer:n})},t$f.prototype=new o$M,t$f.prototype.constructor=t$f,t$f.prototype.parent=o$M.prototype,Object.defineProperties(t$f.prototype,{geoFilePath:{get:function(){return this.modelUrl},set:function(e){"string"==typeof e&&(this.modelUrl=e)}},geoModel:{get:function(){return this._geoModel},set:function(e){this._geoModel=e}}}),t$f.prototype.init=function(){this.modelUrl="",this._geoModel=void 0,this.type=P$v.GEOMODEL3D},e$t.prototype=new o$M,e$t.prototype.constructor=e$t,e$t.prototype.parent=o$M.prototype,Object.defineProperties(e$t.prototype,{X:{get:function(){return this.x},set:function(e){"number"==typeof e&&(this.x=e)}},Y:{get:function(){return this.y},set:function(e){"number"==typeof e&&(this.y=e)}},Z:{get:function(){return this.z},set:function(e){"number"==typeof e&&(this.z=e)}}}),e$t.prototype.init=function(e){this.x=u$Y(e.x,0),this.y=u$Y(e.y,0),this.z=u$Y(e.z,0),this.type=P$v.GEOPOINT3D},e$s.prototype=new o$M,e$s.prototype.constructor=e$s,Object.defineProperties(e$s.prototype,{geoRadius:{get:function(){return this.radius},set:function(e){"number"==typeof e&&(this.radius=e,this.ellipsoid.radii.x=e,this.ellipsoid.radii.y=e,this.ellipsoid.radii.z=e,this.sphere.radius=e,this._isGeometryDirty=!0)}}}),e$s.prototype.init=function(e){this.type=P$v.GEOSPHERE,this.radius=e,this.ellipsoid={radii:new t$X(e,e,e)},this.sphere={radius:e,vertexFormat:n$10.POSITION_NORMAL_AND_ST}},e$s.prototype.isValid=function(){return this.radius>0},e$s.prototype.getCenter=function(){return new s$q(this.position.x,this.position.y,this.position.z+this.radius)},e$s.prototype._createGeometry=function(){var e=new n$M(this.sphere);this._geometry=n$M.createGeometry(e),this._isGeometryDirty=!1},e$s.prototype.getOutlineVertexArray=function(e){this._getGeometry();let t=0,i=new Uint16Array(17956);for(let e=0;e<67;e++){var r=67*e;for(let e=0;e<66;e++)i[t++]=r+e,i[t++]=r+e+1}for(let e=0;e<67;e++)for(let r=0;r<65;r++)i[t++]=67+e+67*r,i[t++]=67+e+67*(r+1);let n=h$W.createIndexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),o=[];return o.push({index:0,vertexBuffer:this._getVertexBuffer(e),componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1}),new m$19({context:e,attributes:o,indexBuffer:n})};var xn$1=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function A$t(e,t){if(!e$28(e)||!e$28(t))throw new t$Z("No viewer or box provided.");if(!e$28(t.box))throw new t$Z("Expected object to be a box.");this.handler=new g$G(e.scene.canvas),this.viewer=e,this.editEvt=new o$1o,this._distanceDisplayCondition=void 0,this._id=e$1K(),rn$1(this,t),an$1(this),this.activate()}function rn$1(e,t){e.box=t,e.hpr=dn$1(t),e.center=t.position.getValue(0),e.dimensions=t.box.dimensions.getValue(0),e._rotateCircleRadius=Math.max(Math.min(e.dimensions.x,e.dimensions.y)/7,.01),e._unifiedMoveBarLength=Math.max(Math.max(Math.max(e.dimensions.x,e.dimensions.y),e.dimensions.z)/6,.1),e._movePolygonDimension=e._rotateCircleRadius/2,e._moveBarXLength=e._unifiedMoveBarLength,e._moveBarYLength=e._unifiedMoveBarLength,e._moveBarZLength=e._unifiedMoveBarLength,e.isActive=!1,e._color=e$1S.WHITE.withAlpha(.1),e._lineColor=e$1S.fromCssColorString("rgba(250, 158, 62, 1)"),e._outlineColor=e$1S.fromCssColorString("rgba(1, 107, 185, 1)"),e._lineWidth=5,e._modelMatrix=m$1b.headingPitchRollToFixedFrame(e.center,e.hpr),e._modelMatrixInverse=y$15.inverse(e._modelMatrix,new y$15),e._hoverColor=e$1S.RED,e._linesHover=[]}function dn$1(e){if(!e$28(e.orientation))return new i$10;var t=p$1a.fromQuaternion(e.orientation.getValue(0),new p$1a),i=y$15.fromRotationTranslation(t,t$X.ZERO,new y$15),r=y$15.inverse(m$1b.eastNorthUpToFixedFrame(e.position.getValue(0)),new y$15),n=y$15.multiply(r,i,new y$15),o=y$15.getMatrix3(n,new p$1a);return i$10.fromQuaternion(n$14.fromRotationMatrix(o))}function an$1(e){var t=e;t.positions=bn$1(t),t.polylines=new X$v({opaqueRS:u$R.fromCache({depthMask:!0,depthTest:{enabled:!0}}),modelMatrix:e._modelMatrix}),t.translucentPolylines=new X$v({translucentRS:u$R.fromCache({depthMask:!1,depthTest:{enabled:!1}}),modelMatrix:e._modelMatrix}),t.translucentPolylines._canAlwaysPick=!0;for(var i=0;i<7;i++)t.polylines.add({id:"box-editor-prim"+i+e._id,width:t._lineWidth,positions:e.positions[i],material:a$O.fromType(a$O.ColorType,{color:t._lineColor})});for(i=0;i<7;i++)t.translucentPolylines.add({id:"box-editor-prim"+i+e._id,width:t._lineWidth,positions:e.positions[i],material:a$O.fromType(a$O.ColorType,{color:t._lineColor.withAlpha(.2)})});t.boundingBox=Bn$1(t,"edit_box"),t.viewer.entities.add(t.boundingBox),t.viewer.scene.primitives.add(t.polylines),t.viewer.scene.primitives.add(t.translucentPolylines),t._polygon=new F$m(t),t.viewer.scene.primitives.add(t._polygon)}function F$m(e){this.editor=e,this.show=!0,this._color=e$1S.clone(e._lineColor),this._isCustomPolygon=!0}function kn$1(e,t,i){var r=new P$W({polygonHierarchy:{positions:e.positions[7]}}),n=P$W.createGeometry(r),o=y$15.clone(e._modelMatrix);if(e.viewer.scene.mode===P$$.COLUMBUS_VIEW){var a=new n$1b,s=a.ellipsoid.cartesianToCartographic(e.center),l=a.project(s);y$15.fromTranslation(l,o),y$15.multiply(xn$1,o,o)}let u=[];var c=h$W.createVertexBuffer({context:t,typedArray:S$W.createTypedArray(S$W.FLOAT,n.attributes.position.values),usage:A$1c.STATIC_DRAW});u.push({index:0,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1});var h=new m$19({context:t,attributes:u,indexBuffer:h$W.createIndexBuffer({context:t,typedArray:n.indices,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})}),d=S$T.fromCache({context:t,vertexShaderSource:"attribute vec4 aPosition;\nuniform vec4 uColor;\nuniform vec4 uPickColor;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvoid main()\n{\n vColor = uColor;\n vPickColor = uPickColor;\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}",fragmentShaderSource:"varying vec4 vColor;\nvarying vec4 vPickColor;\nvoid main()\n{\n gl_FragColor = vColor;\n}\n",attributeLocations:{aPosition:0}}),f=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:o,pass:Le$p.LOG_DEPTH_OVERLAY,owner:i});f.vertexArray=h,f.shaderProgram=d;var p={id:"box-editor-prim7"+e._id,primitive:i},_=t.createPickId(p);f.pickId="vPickColor",f.uniformMap={uColor:function(){return i._color},uPickColor:function(){return _.color}},f.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var m=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:o,pass:Le$p.OPAQUE+1,owner:i});m.vertexArray=h,m.shaderProgram=d;var $={id:"box-editor-prim7"+e._id,primitive:i},g=t.createPickId($);m.pickId="vPickColor",m.uniformMap={uColor:function(){return i._color.withAlpha(.2)},uPickColor:function(){return g.color}},m.renderState=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1},blending:Ee$n.ALPHA_BLEND}),i._colorCommandAlpha=m,i._colorCommand=f}function bn$1(e){var t=[];t.push([new t$X(0,0,e.dimensions.z/2),new t$X(0,0,e.dimensions.z/2+e._moveBarZLength)]),t.push([new t$X(0,0,-e.dimensions.z/2),new t$X(0,0,-e.dimensions.z/2-e._moveBarZLength)]),t.push([new t$X(e.dimensions.x/2,0,0),new t$X(e.dimensions.x/2+e._moveBarXLength,0,0)]),t.push([new t$X(-e.dimensions.x/2,0,0),new t$X(-e.dimensions.x/2-e._moveBarXLength,0,0)]),t.push([new t$X(0,e.dimensions.y/2,0),new t$X(0,e.dimensions.y/2+e._moveBarYLength,0)]),t.push([new t$X(0,-e.dimensions.y/2,0),new t$X(0,-e.dimensions.y/2-e._moveBarYLength,0)]);for(var i=Mn$1(e._rotateCircleRadius,64),r=0;r<i.length;r++)i[r].z=e.dimensions.z/2;t.push(i);var n=e._movePolygonDimension;return t.push([new t$X(n,n,.505*e.dimensions.z+.01),new t$X(-n,n,.505*e.dimensions.z+.01),new t$X(-n,-n,.505*e.dimensions.z+.01),new t$X(n,-n,.505*e.dimensions.z+.01)]),t}function Mn$1(e,t){var i=[];const r=2*Math.PI/t;for(var n=0;n<t+1;n++){var o=new t$X,a=r*n;o.x=e*Math.sin(a),o.y=e*Math.cos(a),i.push(o)}return i}function Bn$1(e,t){var i=m$1b.headingPitchRollQuaternion(e.center,e.hpr);return new h$F({id:t+e._id,position:new n$G((function(){return e.center}),!1),orientation:new n$G((function(){return i}),!1),box:{material:e._color,outline:!0,outlineWidth:2,outlineColor:e._outlineColor,dimensions:new n$G((function(){return e.dimensions}),!1)}})}Object.defineProperties(A$t.prototype,{distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(e$28(e)&&!(e instanceof r$10))throw new t$Z("Expected BoxEditor.distanceDisplayCondition to be type of DistanceDisplayCondition!");this._distanceDisplayCondition=e}},color:{get:function(){return this._color},set:function(e){this._color=e,this.boundingBox.box.material=e}},hoverColor:{get:function(){return this._hoverColor},set:function(e){this._hoverColor=e}}}),Object.defineProperties(F$m.prototype,{color:{get:function(){return this._color},set:function(e){this._color=e,this.dirty=!0}}}),F$m.prototype.update=function(e){(!this._colorCommand||this.dirty)&&(kn$1(this.editor,e.context,this),this.dirty=!1);var t=this.editor;if(e$28(t._distanceDisplayCondition)&&t.isActive){var i=t.viewer.scene.camera.positionWC;if(e.mode===P$$.COLUMBUS_VIEW&&(i=m$1b.convertTo3DCartesian(i)),t$X.distance(t.center,i)<t._distanceDisplayCondition.far){t._polygon.show=!0;for(var r=0;r<t.polylines._polylines.length;r++)t.polylines._polylines[r].show=!0,t.translucentPolylines._polylines[r].show=!0}else{t._polygon.show=!1;for(r=0;r<t.polylines._polylines.length;r++)t.polylines._polylines[r].show=!1,t.translucentPolylines._polylines[r].show=!1}}this.show&&(e.commandList.push(this._colorCommand),e.commandList.push(this._colorCommandAlpha))},F$m.prototype.destroy=function(e){};var G$q=new t$X,sn$1=new i$19,ln$1=new t$X,Tn$1=new o$1k,In$1=new o$1k,En$1=new f$18,On$1=new t$X,Rn$1=new t$X,Sn$1=new f$18,An$1=new t$X,Ln$1=new t$X,Vn$1=new o$1i(t$X.UNIT_X,0);function zn$1(e,t){t.endPosition,e.currentPickObject;var i=+e.currentPickObject.id.slice(15,16),r=e.viewer.camera,n=o$1k.clone(t.startPosition,Tn$1),o=o$1k.clone(t.endPosition,In$1),a=t$X.clone(t$X.ZERO,On$1),s=t$X.UNIT_X;(0===i||1===i)&&(s=t$X.UNIT_Y);var l=m$1b.convertToColumbusCartesian(e.center);e$28(l)&&(a.x=l.x,(0===i||1===i)&&(a.y=l.y));var u=o$1i.fromPointNormal(a,s,Vn$1),c=r.getPickRay(n,En$1),h=g$10.rayPlane(c,u,Rn$1),d=r.getPickRay(o,Sn$1),f=g$10.rayPlane(d,u,An$1),p=t$X.subtract(h,f,Ln$1),_=p.x;if(p.x=p.y,p.y=p.z,p.z=_,t$X.magnitude(p)>e$27.EPSILON6&&(f=m$1b.convertTo3DCartesian(f),e.currentPickPos=f),0===i||1===i){var m=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X),$=(w=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).z-m.z,g=new t$X(0,0,$/2);1===i&&(g=new t$X(0,0,-($=m.z-w.z)/2)),e.dimensions.z+=$,e.dimensions.z<=0&&($=0,e.dimensions.z=0,g=new t$X(0,0,0)),e.positions[0][0].z+=$/2,e.positions[0][1].z+=$/2,e.positions[1][0].z-=$/2,e.positions[1][1].z-=$/2;for(var v=e.positions[6],y=0;y<v.length;y++)v[y].z+=$/2;var x=e.positions[7];for(y=0;y<x.length;y++)x[y].z+=$/2;y$15.multiplyByPoint(e._modelMatrix,g,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}if(2===i||3===i){m=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X);var b=(w=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).x-m.x;g=new t$X(b/2,0,0);3===i&&(g=new t$X(-(b=m.x-w.x)/2)),e.dimensions.x+=b,e.dimensions.x<0&&(e.dimensions.x=0,g=new t$X(0,0,0),b=0),e.positions[2][0].x+=b/2,e.positions[2][1].x+=b/2,e.positions[3][0].x-=b/2,e.positions[3][1].x-=b/2,y$15.multiplyByPoint(e._modelMatrix,g,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}if(4===i||5===i){e.viewer.camera.getPickRay(t.endPosition);m=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X);var w,C=(w=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).y-m.y;g=new t$X(0,C/2,0);5===i&&(g=new t$X(0,-(C=m.y-w.y)/2,0)),e.dimensions.y+=C,e.dimensions.y<0&&(e.dimensions.y=0,g=new t$X(0,0,0),C=0),e.positions[4][0].y+=C/2,e.positions[4][1].y+=C/2,e.positions[5][0].y-=C/2,e.positions[5][1].y-=C/2,y$15.multiplyByPoint(e._modelMatrix,g,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}}function Un$1(e,t){var i=t.endPosition;e.currentPickObject;var r=+e.currentPickObject.id.slice(15,16);if(0===r||1===r){var n=e.viewer.scene.camera,o=n.getPickRay(i),a=o$1k.fromElements(i.x+5,i.y,new o$1k),s=n.getPickRay(a),l=t$X.normalize(t$X.cross(o.direction,s.direction,ln$1),ln$1),u=o$1i.fromPointNormal(n.positionWC,l),c=new f$18(t$X.ZERO,e.currentPickPos);e.currentPickPos=g$10.rayPlane(c,u);var h=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X),d=(y=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).z-h.z,f=new t$X(0,0,d/2);1===r&&(f=new t$X(0,0,-(d=h.z-y.z)/2)),e.dimensions.z+=d,e.dimensions.z<=0&&(d=0,e.dimensions.z=0,f=new t$X(0,0,0)),e.positions[0][0].z+=d/2,e.positions[0][1].z+=d/2,e.positions[1][0].z-=d/2,e.positions[1][1].z-=d/2;for(var p=e.positions[6],_=0;_<p.length;_++)p[_].z+=d/2;var m=e.positions[7];for(_=0;_<m.length;_++)m[_].z+=d/2;y$15.multiplyByPoint(e._modelMatrix,f,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}if(2===r||3===r){c=e.viewer.camera.getPickRay(t.endPosition);var $=i$19.unpack([0,0,0,t$X.distance(e.lastPickPos,t$X.ZERO)],0,sn$1),g=g$10.raySphere(c,$);e.currentPickPos=f$18.getPoint(c,g.start);h=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X);var v=(y=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).x-h.x;f=new t$X(v/2,0,0);3===r&&(f=new t$X(-(v=h.x-y.x)/2)),e.dimensions.x+=v,e.dimensions.x<0&&(e.dimensions.x=0,f=new t$X(0,0,0),v=0),e.positions[2][0].x+=v/2,e.positions[2][1].x+=v/2,e.positions[3][0].x-=v/2,e.positions[3][1].x-=v/2,y$15.multiplyByPoint(e._modelMatrix,f,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}if(4===r||5===r){c=e.viewer.camera.getPickRay(t.endPosition),$=i$19.unpack([0,0,0,t$X.distance(e.lastPickPos,t$X.ZERO)],0,sn$1),g=g$10.raySphere(c,$);e.currentPickPos=f$18.getPoint(c,g.start);h=y$15.multiplyByPoint(e._modelMatrixInverse,e.lastPickPos,new t$X);var y,x=(y=y$15.multiplyByPoint(e._modelMatrixInverse,e.currentPickPos,new t$X)).y-h.y;f=new t$X(0,x/2,0);5===r&&(f=new t$X(0,-(x=h.y-y.y)/2,0)),e.dimensions.y+=x,e.dimensions.y<0&&(e.dimensions.y=0,f=new t$X(0,0,0),x=0),e.positions[4][0].y+=x/2,e.positions[4][1].y+=x/2,e.positions[5][0].y-=x/2,e.positions[5][1].y-=x/2,y$15.multiplyByPoint(e._modelMatrix,f,e.center),t$X.clone(e.currentPickPos,e.lastPickPos)}}function Nn$1(e,t){var i=y$15.multiplyByPoint(e._modelMatrix,e.positions[0][0],new t$X),r=m$1b.convertToColumbusCartesian(i),n=m$1b.convertToColumbusCartesian(e.lastPickPos);n.x=r.x;var o=t$X.subtract(n,r,new t$X);e.tangent=t$X.cross(t$X.UNIT_X,o,new t$X);var a=t.endPosition;t$X.clone(e.lastPickPos,G$q);var s=e.viewer.camera.getPickRay(a),l=o$1i.fromPointNormal(r,t$X.UNIT_X),u=g$10.rayPlane(s,l),c=t$X.subtract(n,r,new t$X),h=t$X.subtract(u,r,new t$X),d=t$X.dot(t$X.normalize(c,c),t$X.normalize(h,h)),f=Math.acos(d);t$X.cross(t$X.UNIT_X,c,e.tangent);var p=t$X.dot(e.tangent,t$X.subtract(u,n,new t$X));f*=p=p<0?1:-1,e.hpr.heading+=f;var _=m$1b.headingPitchRollQuaternion(e.center,e.hpr);e.boundingBox.orientation=_;var m=m$1b.convertTo3DCartesian(u);t$X.clone(m,e.lastPickPos)}function jn$1(e,t){var i=y$15.multiplyByPoint(e._modelMatrix,e.positions[0][0],new t$X),r=t$X.subtract(e.lastPickPos,i,new t$X);e.tangent=t$X.cross(t$X.UNIT_Z,r,new t$X);var n=t.endPosition,o=t$X.clone(e.lastPickPos,G$q),a=e.viewer.camera.getPickRay(n),s=new i$19(t$X.ZERO,t$X.distance(o,t$X.ZERO)),l=g$10.raySphere(a,s);o=f$18.getPoint(a,l.start);var u=t$X.subtract(e.lastPickPos,i,new t$X),c=t$X.subtract(o,i,new t$X),h=t$X.dot(t$X.normalize(u,u),t$X.normalize(c,c)),d=Math.acos(h);t$X.cross(t$X.UNIT_Z,u,e.tangent);var f=t$X.dot(e.tangent,t$X.subtract(o,e.lastPickPos,new t$X));d*=f=f<0?1:-1,e.hpr.heading+=d;var p=m$1b.headingPitchRollQuaternion(e.center,e.hpr);e.boundingBox.orientation=p,t$X.clone(o,e.lastPickPos)}function Wn$1(e,t){var i=t.endPosition;t$X.clone(e.lastPickPos,G$q);var r=e.viewer.camera.getPickRay(i),n=m$1b.convertToColumbusCartesian(e.lastPickPos),o=o$1i.fromPointNormal(n,t$X.UNIT_X),a=g$10.rayPlane(r,o),s=a.y-n.y,l=a.z-n.z,u=m$1b.convertToColumbusCartesian(e.center);u.y+=s,u.z+=l,e.center=m$1b.convertTo3DCartesian(u);var c=m$1b.convertTo3DCartesian(a);t$X.clone(c,e.lastPickPos)}function Hn$1(e,t){var i=t.endPosition,r=t$X.clone(e.lastPickPos,G$q),n=e.viewer.camera.getPickRay(i),o=new i$19(t$X.ZERO,t$X.distance(r,t$X.ZERO)),a=g$10.raySphere(n,o),s=f$18.getPoint(n,a.start),l=y$15.multiplyByPoint(e._modelMatrixInverse,r,new t$X),u=y$15.multiplyByPoint(e._modelMatrixInverse,s,new t$X),c=new t$X(u.x-l.x,u.y-l.y,0);y$15.multiplyByPoint(e._modelMatrix,c,e.center),t$X.clone(s,e.lastPickPos)}function Zn(e){for(var t=0;t<e._linesHover.length;t++){var i=e._linesHover[t];i._isCustomPolygon?i.color=e._lineColor:i.material.uniforms.color.alpha<1?i.material=a$O.fromType(a$O.ColorType,{color:e._lineColor.withAlpha(.2)}):i.material=a$O.fromType(a$O.ColorType,{color:e._lineColor})}e._linesHover.length=0;var r=e.currentPickObject=e.viewer.scene.pick(e.viewer.scene.screenSpaceCameraController._aggregator._currentMousePosition);if(r&&"string"==typeof r.id&&r.id.indexOf("box-editor-prim")>-1&&r.id.indexOf(e._id)>-1){var n=r.primitive._index;if(e$28(n)){var o=e.polylines.get(n),a=e.translucentPolylines.get(n);o.material=a$O.fromType(a$O.ColorType,{color:e._hoverColor}),a.material=a$O.fromType(a$O.ColorType,{color:e._hoverColor.withAlpha(.2)}),e._linesHover.push(o),e._linesHover.push(a)}else r.primitive.color=e._hoverColor,e._linesHover.push(r.primitive)}}A$t.prototype.destroy=function(){this.viewer.scene.screenSpaceCameraController.enableInputs=!0,this.deactivate(),this.clear(),this.handler.destroy(),i$Z(this)},A$t.prototype.activate=function(){if(!this.isActive){this.isActive=!0;for(var e=0;e<this.polylines._polylines.length;e++)this.polylines._polylines[e].show=!0,this.translucentPolylines._polylines[e].show=!0;var t=this;t.boundingBox.show=!0,t._polygon.show=!0,t.handler.setInputAction((function(e){t.startPickPos=t.viewer.scene.pickPosition(e.position),t._isOperate=!1,e$28(t.startPickPos)&&t.currentPickObject&&"string"==typeof t.currentPickObject.id&&t.currentPickObject.id.slice(-36)===t._id&&"box-editor"===t.currentPickObject.id.slice(0,10)&&(t._isOperate=!0,t.lastPickPos=t$X.clone(t.startPickPos,new t$X),t.currentPickPos=t$X.clone(t.startPickPos,new t$X))}),J$P.LEFT_DOWN),t.handler.setInputAction((function(e){if(t._isOperate){t.viewer.scene.screenSpaceCameraController.enableInputs=!1;var i=+t.currentPickObject.id.slice(15,16);i>=0&&i<6?t.viewer.scene.mode===P$$.COLUMBUS_VIEW?zn$1(t,e):Un$1(t,e):6===i?t.viewer.scene.mode===P$$.COLUMBUS_VIEW?Nn$1(t,e):jn$1(t,e):7===i&&(t.viewer.scene.mode===P$$.COLUMBUS_VIEW?Wn$1(t,e):Hn$1(t,e)),t._polygon.dirty=!0,t._modelMatrix=m$1b.headingPitchRollToFixedFrame(t.center,t.hpr),t._modelMatrixInverse=y$15.inverse(t._modelMatrix,t._modelMatrixInverse),t.polylines.modelMatrix=t._modelMatrix,t.translucentPolylines.modelMatrix=t._modelMatrix,t.box.orientation=new n$G((function(e,i){return t.boundingBox.orientation.getValue(0)}),!1),t.box.position=new n$G((function(e,i){return t.boundingBox.position.getValue(0)}),!1),t.box.box.dimensions=new n$G((function(e,i){return t.boundingBox.box.dimensions.getValue(0)}),!1),t.editEvt.raiseEvent({position:t.boundingBox.position.getValue(0),dimensions:t.boundingBox.box.dimensions.getValue(0),orientation:t.boundingBox.orientation.getValue(0)})}else Zn(t)}),J$P.MOUSE_MOVE),t.handler.setInputAction((function(e){t._isOperate=!1,t.viewer.scene.screenSpaceCameraController.enableInputs=!0,t.currentPickObject=void 0}),J$P.LEFT_UP)}},A$t.prototype.deactivate=function(){if(this.isActive){this.isActive=!1,this.boundingBox.show=!1,this._polygon.show=!1;for(var e=0;e<this.polylines._polylines.length;e++)this.polylines._polylines[e].show=!1,this.translucentPolylines._polylines[e].show=!1;this.handler.removeInputAction(J$P.LEFT_CLICK),this.handler.removeInputAction(J$P.MOUSE_MOVE),this.handler.removeInputAction(J$P.RIGHT_CLICK)}},A$t.prototype.clear=function(){this.polylines.removeAll(),this.viewer.scene.primitives.remove(this.polylines),this.polylines=void 0,this.translucentPolylines.removeAll(),this.viewer.scene.primitives.remove(this.translucentPolylines),this.viewer.scene.primitives.remove(this._polygon),this._polygon=void 0,this.translucentPolylines=void 0,this.viewer.entities.remove(this.boundingBox)},A$t.prototype.setEditObject=function(e){if(this.isActive){if(o$1u.typeOf.object("editObject",e),!e$28(e.box))throw new t$Z("Expected editObject to be a box.");var t=this.boundingBox.orientation.getValue(0),i=this.boundingBox.position.getValue(0),r=this.boundingBox.box.dimensions.getValue(0);this.box.orientation=new n$G((function(){return t}),!1),this.box.position=new n$G((function(){return i}),!1),this.box.box.dimensions=new n$G((function(){return r}),!1),rn$1(this,e),this.deactivate(),this.clear(),an$1(this),this.activate()}};var e$r={Space:0,Ground:1,S3mModel:2,Raster:3,Both:4},l$o=Object.freeze(e$r),e$q={Point:0,Line:1,Polygon:2,Marker:3,Box:4},o$y=Object.freeze(e$q),e$p={POLYLINE:0,POLYGON:1,POLYGON_HOLE:2},C$l=Object.freeze(e$p),P$m=function(e,t,i){if(!e$28(e)||!e$28(t))throw new t$Z("viewer and mode is required!");this.handler=new g$G(e.scene.canvas),this.viewer=e,this.mode=t,this._clampMode=u$Y(i,l$o.Space),this.isDrawing=!1,this.active=!1,this._drawEvt=new o$1o,this._activeEvt=new o$1o,this._enableDepthTest=!0,this.movingEvt=new o$1o,this.positions=[],this._positions=[],this._lineColor=e$1S.fromCssColorString("#51ff00"),this._lineWidth=3,this._lineMaterial=new t$z(this._lineColor)};function se$7(e,t){var i=t;if(i&&i.active){var r=i.viewer.scene;if(!r.pickPositionSupported)return void console.log("your browser not supported pickPosition!");var n=r.pickPosition(e.position);if(n)if(i.isDrawing){var o=new o$1k(e.position.x,e.position.y);switch(i.mode){case o$y.Line:X$c(o,i,!0);break;case o$y.Polygon:Y$f(o,i,!0)}}else switch(i.isDrawing=!0,i.positions.length=0,i.positions.push(n.clone()),i.mode){case o$y.Point:ae$c(n,i);break;case o$y.Line:F$l(n,i);break;case o$y.Polygon:le$a(n,i);break;case o$y.Marker:ce$b(n,i)}i.mode===o$y.Box&&pe$b(n,i)}}function ae$c(e,t){var i=t;e$28(i.points)?i.point.position=e:(i.points=new D$B({depthTestEnabled:!1}),i.point=i.points.add({position:e,pixelSize:10,color:e$1S.WHITE}),i.viewer.scene.primitives.add(i.points)),i.deactivate(),i.drawEvt.raiseEvent({object:i.point})}function F$l(e,t){var i=t;if(i._positions=[e,e],e$28(i.polyline))i.polyline.show=!0;else{var r=i._clampMode>0,n=i._clampMode<l$o.S3mModel?L$V.TERRAIN:i._clampMode<l$o.Both?L$V.S3M_TILE:L$V.BOTH;i.polyline=i.viewer.entities.add({polyline:{positions:new n$G((function(){return e$28(i.polygon)?i._positions.concat([i._positions[0]]):i._positions}),!1),width:i._lineWidth,material:i._lineMaterial,clampToGround:r,classificationType:n}})}}function le$a(e,t){var i=t;if(i._positions=[e,e],F$l(e,t),e$28(i.polygon))i.polygon.show=!0,i.polyline.show=!0,e$28(i.rasterPolygon)&&i.viewer.scene.rasterVectorCollection.remove(i.rasterPolygon),e$28(i.rasterPolylines)&&i.viewer.scene.rasterVectorCollection.remove(i.rasterPolylines);else{var r=l$o.Space===i._clampMode,n=i._clampMode<l$o.S3mModel?L$V.TERRAIN:i._clampMode<l$o.Both?L$V.S3M_TILE:L$V.BOTH;i.polygon=i.viewer.entities.add({polygon:{hierarchy:new n$G((function(){return{positions:i._positions,holes:[]}}),!1),material:e$1S.ORANGE.withAlpha(.5),perPositionHeight:r,classificationType:n},depthTestEnabled:i._enableDepthTest})}}function ce$b(e,t){var i=t;t$W.fromCartesian(e).height,e$28(i.marker)?i.marker.position=e:(i.markers=new B$q,i.marker=i.markers.add({position:e,image:n$17("Assets/Textures/maki/grepin.png"),verticalOrigin:S$L.BOTTOM,scale:.5}),i.viewer.scene.primitives.add(i.markers)),i.deactivate(),i.drawEvt.raiseEvent({object:i.marker})}function pe$b(e,t){e$28(t.boxConfig)||(t.boxConfig={leftClickTimes:0,scratchPosition:new t$X,length:0,width:0,height:0}),e$28(t.boxes)||(t.boxes=[]);var i=t.boxConfig;if(0!==i.leftClickTimes||e$28(e))if(i.leftClickTimes++,i.firstPoint=e,1===i.leftClickTimes)i.enu=m$1b.eastNorthUpToFixedFrame(e),i.enuInverse=y$15.inverse(i.enu,new y$15),t$X.clone(e,i.scratchPosition),t.box=i.entity=t.viewer.entities.add({position:new n$G((function(){return i.scratchPosition}),!1),box:{dimensions:new n$G((function(e,t){return(t=t||new t$X(i.length,i.width,i.height)).x=i.length,t.y=i.width,t.z=i.height,t}),!1),material:e$1S.fromCssColorString("rgba(0, 160, 233, 0.5)"),outline:!0,outlineColor:e$1S.BLACK}}),t.boxes.push(t.box),i.box=i.entity.box;else if(2===i.leftClickTimes){var r=y$15.multiplyByPoint(i.enuInverse,i.scratchPosition,new t$X);t$X.multiplyByScalar(r,2,r),i.secondPoint=y$15.multiplyByPoint(i.enu,r,r)}}function he$8(e,t){var i=t;if(i&&i.active&&i.isDrawing){var r=new o$1k(e.endPosition.x,e.endPosition.y);switch(i.mode){case o$y.Line:X$c(r,i,!1);break;case o$y.Polygon:Y$f(r,i,!1);break;case o$y.Box:ve$8(r,i)}}i.movingEvt.raiseEvent(new o$1k(e.endPosition.x,e.endPosition.y))}function X$c(e,t,i){var r=t,n=r.viewer.scene.pickPosition(e);if(e$28(n)){var o=r._positions.length;1==i?(r._positions[o]=n,r.positions.push(n.clone())):r._positions[o-1]=n}}function Y$f(e,t,i){var r=t,n=r.viewer.scene.pickPosition(e);if(e$28(n)){var o=r._positions.length;1==i?(r.positions.push(n.clone()),r._positions[o]=n):r._positions[o-1]=n}}Object.defineProperties(P$m.prototype,{drawEvt:{get:function(){return this._drawEvt}},activeEvt:{get:function(){return this._activeEvt}},clampMode:{get:function(){return this._clampMode},set:function(e){if(this._clampMode!==l$o.Raster&&e!==l$o.Raster){if(e$28(e)&&e!=this._clampMode){if(this._clampMode=e,e$28(this.polyline)&&e$28(this.polyline.polyline)){var t=e!==l$o.Space,i=that._clampMode<l$o.S3mModel?L$V.TERRAIN:that._clampMode<l$o.Both?L$V.S3M_TILE:L$V.BOTH;this.polyline.polyline.clampToGround=t,this.polyline.polyline.classificationType=i}if(e$28(this.polygon)){var r=l$o.Space===this._clampMode;i=that._clampMode<l$o.S3mModel?L$V.TERRAIN:that._clampMode<l$o.Both?L$V.S3M_TILE:L$V.BOTH;this.polygon.polygon.perPositionHeight=r,this.polygon.polygon.classificationType=i}}}else this._clampMode=l$o.Raster}},enableDepthTest:{get:function(){return this._enableDepthTest},set:function(e){this._enableDepthTest=e}},lineColor:{get:function(){return this._lineColor},set:function(e){if(o$1u.defined("lineColor value",e),!(e instanceof e$1S))throw new t$Z("lineColor must be a instance of Color.");this._lineColor=e,this._lineMaterial=new t$z(e),e$28(this.polyline)&&(this.polyline.polyline.material=new t$z(e))}},lineWidth:{get:function(){return this._lineWidth},set:function(e){o$1u.typeOf.number("handlerLineWidth",e),e!=this._lineWidth&&(this._lineWidth=e,e$28(this.polyline)&&(this.polyline.polyline.width=e))}},lineMaterial:{get:function(){return this._lineMaterial},set:function(e){if(o$1u.defined("handlerLineMatrial value",e),e instanceof a$O){let t=e.type,i=e.uniforms;t===a$O.ColorType?this._lineMaterial=new t$z(i.color):t===a$O.PolylineArrowType?this._lineMaterial=new t$n(i.color):t===a$O.PolylineDashType?this._lineMaterial=new o$K(i):t===a$O.PolylineOutlineType&&(this._lineMaterial=new e$I(i))}else this._lineMaterial=e;e$28(this.polyline)&&(this.polyline.polyline.material=this._lineMaterial)}}}),P$m.prototype.activate=function(){if(1!=this.active){this.active=!0;var e=this;this.handler.setInputAction((function(t){se$7(t,e)}),J$P.LEFT_CLICK),this.handler.setInputAction((function(t){he$8(t,e)}),J$P.MOUSE_MOVE),this.handler.setInputAction((function(t){ye$a(t,e)}),J$P.RIGHT_CLICK),this.activeEvt.raiseEvent(!0)}},P$m.prototype.deactivate=function(){this.active=!1,this.isDrawing=!1,this.handler.removeInputAction(J$P.LEFT_CLICK),this.handler.removeInputAction(J$P.MOUSE_MOVE),this.handler.removeInputAction(J$P.RIGHT_CLICK),this.activeEvt.raiseEvent(!1)},P$m.prototype.clear=function(){if(this.deactivate(),this.positions.length=0,this._positions.length=0,e$28(this.rasterPolylines)&&(this.viewer.scene.rasterVectorCollection.remove(this.rasterPolylines),this.rasterPolylines=void 0),e$28(this.rasterPolygon)&&(this.viewer.scene.rasterVectorCollection.remove(this.rasterPolygon),this.rasterPolygon=void 0),e$28(this.polygon)&&(this.viewer.entities.remove(this.polygon),this.polygon=void 0),e$28(this.polyline)&&(this.viewer.entities.remove(this.polyline),this.polyline=void 0),e$28(this.points)&&(this.points.removeAll(),this.viewer.scene.primitives.remove(this.points),this.points=void 0),e$28(this.markers)&&(this.viewer.scene.primitives.remove(this.markers),this.markers=void 0,e$28(this.marker)&&(this.marker=void 0)),e$28(this.corridor)&&this.viewer.entities.remove(this.corridor),e$28(this.boxes)){for(var e=0,t=this.boxes.length;e<t;e++)this.viewer.entities.remove(this.boxes[e]);this.boxes=void 0,this.box=void 0,this.boxConfig=void 0}};var fe$9=new t$X,I$w=new t$X,Z$j=new o$1k,me$d=new i$19;function ve$8(e,t,i){var r=t.boxConfig;if(e$28(r))if(1==r.leftClickTimes)if(t.viewer.scene.mode===P$$.COLUMBUS_VIEW){var n=(v=t.viewer.scene.camera).getPickRay(e),o=m$1b.convertToColumbusCartesian(r.firstPoint);e$28(r.first)||(r.first=t$X.clone(r.firstPoint));var a=o$1i.fromPointNormal(o,t$X.UNIT_X);if(!e$28(h=g$10.rayPlane(n,a)))return;t$W.fromCartesian(r.firstPoint);var s=m$1b.convertTo3DCartesian(h);r.second=t$X.clone(s),s=t$W.fromCartesian(s);var l=Math.cos(s.latitude);r.ratio=l,s=t$W.toCartesian(s),h=m$1b.convertToColumbusCartesian(s),r.scratchPosition=t$X.midpoint(h,o,new t$X),r.scratchPosition=m$1b.convertTo3DCartesian(r.scratchPosition),r.length=Math.abs(h.y-o.y)*l,r.width=Math.abs(h.z-o.z),r.height=0}else{n=t.viewer.camera.getPickRay(e);var u=i$19.unpack([0,0,0,t$X.distance(r.firstPoint,t$X.ZERO)],0,me$d),c=g$10.raySphere(n,u),h=f$18.getPoint(n,c.start),d=y$15.multiplyByPoint(r.enuInverse,h,fe$9);d.z=0,r.scratchPosition=y$15.multiplyByPoint(r.enu,t$X.divideByScalar(d,2,d),r.scratchPosition),y$15.multiplyByPoint(r.enuInverse,r.scratchPosition,d),r.length=2*(d.x>0?d.x:-d.x),r.width=2*(d.y>0?d.y:-d.y),r.height=0}else if(r.leftClickTimes>1)if(t.viewer.scene.mode===P$$.COLUMBUS_VIEW){var f=(v=t.viewer.scene.camera).getPickRay(e),p=o$1k.fromElements(e.x+5,e.y,Z$j),_=v.getPickRay(p),m=t$X.normalize(t$X.cross(f.direction,_.direction,I$w),I$w),$=(a=o$1i.fromPointNormal(v.positionWC,m),m$1b.convertToColumbusCartesian(r.second));$.x=.1;n=new f$18($,t$X.UNIT_X);var g=g$10.rayPlane(n,a);if(!e$28(g))return;o=m$1b.convertToColumbusCartesian(r.first);r.scratchPosition=t$X.midpoint(o,g,new t$X),r.scratchPosition=m$1b.convertTo3DCartesian(r.scratchPosition),r.secondPoint=m$1b.convertTo3DCartesian(g),r.height=Math.abs(o.x-g.x)}else{var v;f=(v=t.viewer.scene.camera).getPickRay(e),p=o$1k.fromElements(e.x+5,e.y,Z$j),_=v.getPickRay(p),m=t$X.normalize(t$X.cross(f.direction,_.direction,I$w),I$w),a=o$1i.fromPointNormal(v.positionWC,m),n=new f$18(t$X.ZERO,r.secondPoint);r.secondPoint=g$10.rayPlane(n,a);var y=y$15.multiplyByPoint(r.enuInverse,r.secondPoint,new t$X);t$X.divideByScalar(y,2,y),Cesium.Matrix4.multiplyByPoint(r.enu,y,r.scratchPosition),r.length=2*(y.x>0?y.x:-y.x),r.width=2*(y.y>0?y.y:-y.y),r.height=2*(y.z>0?y.z:-y.z)}}var V$h=0;function ye$a(e,t){var i=t;if(i&&i.active&&i.isDrawing){if(i.deactivate(),i.mode===o$y.Box)return t.boxConfig=void 0,void i.drawEvt.raiseEvent({object:i.box,positions:i._positions});if(!e$28(i.polyline))return;if(i._positions=i._positions.slice(0,i._positions.length-1),i.mode===o$y.Polygon){if(i._positions.length<3)return void(i._positions.length=0);var r=[].concat(i._positions);if(i.polygon.polygon.hierarchy={positions:r,holes:i.polygon.polygon.hierarchy.getValue().holes},i.polygon.positions=r,l$o.Raster===i._clampMode){i._positions.length=0,e$28(i.polyline)&&(i.polyline.show=!1),e$28(i.polygon)&&(i.polygon.show=!1);for(var n=[],o=0;o<r.length;o++)n.push(t$W.fromCartesian(r[o]));V$h+=1,i.rasterPolygon=V$h,i.viewer.scene.rasterVectorCollection.add({name:i.rasterPolygon,pickId:i.rasterPolygon,positions:n,fillColor:e$1S.ORANGE.withAlpha(.5),geometryType:C$l.POLYGON});var a=[];for(o=0;o<n.length;o++)a.push(n[o]);a.push(n[0]),i.rasterPolylines=V$h,i.viewer.scene.rasterVectorCollection.add({name:i.rasterPolylines,pickId:i.rasterPolylines,positions:a,lineColor:i._lineColor,lineWidth:i._lineWidth,geometryType:C$l.POLYLINE}),i.drawEvt.raiseEvent({object:r,positions:i.positions})}else i.drawEvt.raiseEvent({object:i.polygon,positions:i.positions})}else i.mode===o$y.Line&&(i.polyline.positions=i._positions,i.drawEvt.raiseEvent({object:i.polyline,positions:i.positions}))}}P$m.prototype.getLinePositions=function(){return e$28(this.polyline)?this.polyline.positions:[]};var w$g="referencePoint",I$v="referenceAddPoint",_$m=function(e,t){if(!e$28(e)||!e$28(t))throw new t$Z("viewer and mode is required!");this.handler=new g$G(e.scene.canvas),this.viewer=e,this.active=!1,this.referencePointColor=e$1S.WHITE,this.editPointColor=e$1S.VIOLET,this.setEditObject(t),this._editZ=!1,this._changedEvt=new o$1o};function C$k(e,t){if(!e.scene.pickRasterData(t.position).isS3MTilesLayerSel){var i=e.scene.pick(t.position);if(e$28(i)){var r=u$Y(i.id,i.primitive.id);if(r instanceof h$F)return r;if(e$28(i.primitive))return i}}}function U$k(e,t){var i=t;if(i&&i.active){var r=C$k(i.viewer,e);if(e$28(r)){var n=r.id;if(!e$28(n))return;var o=n.split("_");2==o.length&&o[0]===w$g&&(i._editPointIndex=parseInt(o[1]),i._editPoint=r.primitive,i._editPoint.color=i.editPointColor,i.viewer.scene._screenSpaceCameraController.enableRotate=!1)}else t.clear()}}function K$j(e,t){var i=t;i&&i.active&&(i._editPointIndex=-1,e$28(i._editPoint)&&(i._editPoint.color=i.referencePointColor,i._editPoint=void 0),i.viewer.scene._screenSpaceCameraController.enableRotate=!0,i._changedEvt.raiseEvent({}))}function N$h(e,t){var i=t;if(i&&i.active&&i._editPointIndex>-1&&i.viewer.scene._screenSpaceCameraController._aggregator._isDown[0]){var r,n=new o$1k(e.endPosition.x,e.endPosition.y),o=i._polyline,a=i._polygon,s=!0;if(e$28(o)&&(s=o.clampToGround),e$28(a)&&(s=!a.perPositionHeight),s)r=i.viewer.scene.pickPosition(n);else if(i._editZ){var l=i.viewer.camera.getPickRay(n),u=new o$1k(n.x+5,n.y),c=i.viewer.camera.getPickRay(u),h=new t$X;h=t$X.cross(l.direction,c.direction,h);var d=new t$X;t$X.normalize(h,d);var f=o$1i.fromPointNormal(i.viewer.camera.position,d),p=new f$18(t$X.ZERO,i._editPoint.position);r=g$10.rayPlane(p,f)}else{p=i.viewer.camera.getPickRay(n);var _=new i$19(t$X.ZERO,t$X.distance(i._editPoint.position,t$X.ZERO)),m=g$10.raySphere(p,_);r=f$18.getPoint(p,m.start)}i._editPoint.position=r;var $=i._positions;$[i._editPointIndex]=r,e$28(o)&&(o.positions=new n$G((function(){return $}),!1)),e$28(a)&&(a.hierarchy=new n$G((function(){return{positions:$,holes:[]}}),!1)),i.refreshReferenceAddPoint()}}function q$k(e,t){var i=t;if(i&&i.active){var r=C$k(i.viewer,e);if(e$28(r)){var n=r.id;if(!e$28(n))return;var o=n.split("_");if(2==o.length&&o[0]===I$v){var a=parseInt(o[1]),s=i._addPositions[a];(h=i._positions).splice(a+1,0,s);var l=i._polyline;e$28(l)&&(l.positions=new n$G((function(){return h}),!1));var u=i._polygon;if(e$28(u)){var c=new n$G((function(){return h}),!1),h=u.hierarchy.getValue(0);Array.isArray(h)?u.hierarchy=c:u.hierarchy.positions=c}i.refreshReferencePoint(),i.refreshReferenceAddPoint()}}}}function j$k(e,t){var i=t;if(i&&i.active){var r=C$k(i.viewer,e);if(e$28(r)){var n=r.id;if(!e$28(n))return;var o=n.split("_");if(2==o.length&&o[0]===w$g){var a=parseInt(o[1]),s=i._positions;s.splice(a,1);var l=i._polyline;e$28(l)&&(l.positions=new n$G((function(){return s}),!1));var u=i._polygon;e$28(u)&&(u.hierarchy=new n$G((function(){return s}),!1)),i.refreshReferencePoint(),i.refreshReferenceAddPoint()}}}}Object.defineProperties(_$m.prototype,{isEditZ:{get:function(){return this._editZ},set:function(e){this._editZ=e}},changedEvt:{get:function(){return this._changedEvt}}}),_$m.prototype.setEditObject=function(e){if(e$28(e._polygon)||e$28(e._polyline)){if(this.clear(),this._editObject=e,this._polygon=e._polygon,e$28(this._polygon)){var t=this._polygon.hierarchy.getValue(0);if(!Array.isArray(t)){if(!Array.isArray(t.positions))throw new t$Z("positions is required!");t=t.positions}if(this._polygon.classificationType&&(this._polygon.classificationType===L$V.BOTH||this._polygon.classificationType===L$V.TERRAIN)||!e$28(this._polygon.height)&&!e$28(this._polygon.extrudedHeight)&&e$28(this._polygon.perPositionHeight)&&!this._polygon.perPositionHeight.getValue()){for(var i=[],r=0;r<t.length;r++){var n=t$W.fromCartesian(t[r]);n.height=this.viewer.scene.globe.getHeight(n),i.push(t$W.toCartesian(n))}this._positions=i}else this._positions=t}this._polyline=e._polyline,e$28(this._polyline)&&(this._positions=this._polyline.positions.getValue(0)),this._editPoints=this.viewer.scene.primitives.add(new B$q({depthTestEnable:!1}));for(r=0;r<this._positions.length;r++)this._editPoints.add({id:w$g+"_"+r,position:this._positions[r],image:n$17("Assets/Textures/vertex-edit.png")});this._editPointIndex=-1,this._editPoint=void 0,this._addPositions=[],this._addPoints=this.viewer.scene.primitives.add(new B$q({depthTestEnable:!1}));for(r=0;r<this._positions.length-1;r++){var o=new t$X;t$X.add(this._positions[r],this._positions[r+1],o),t$X.multiplyByScalar(o,.5,o),this._addPositions.push(o)}if(e$28(this._polygon)){o=new t$X;t$X.add(this._positions[0],this._positions[this._positions.length-1],o),t$X.multiplyByScalar(o,.5,o),this._addPositions.push(o)}for(r=0;r<this._addPositions.length;r++)this._addPoints.add({id:I$v+"_"+r,position:this._addPositions[r],image:n$17("Assets/Textures/middle-edit.png")});this.activate()}},_$m.prototype.activate=function(){if(1!=this.active){this.active=!0;var e=this;this.handler.setInputAction((function(t){U$k(t,e)}),J$P.LEFT_DOWN),this.handler.setInputAction((function(t){K$j(t,e)}),J$P.LEFT_UP),this.handler.setInputAction((function(t){N$h(t,e)}),J$P.MOUSE_MOVE),this.handler.setInputAction((function(t){q$k(t,e)}),J$P.LEFT_CLICK),this.handler.setInputAction((function(t){j$k(t,e)}),J$P.RIGHT_CLICK)}},_$m.prototype.deactivate=function(){this.active=!1,this.handler.removeInputAction(J$P.LEFT_DOWN),this.handler.removeInputAction(J$P.LEFT_UP),this.handler.removeInputAction(J$P.MOUSE_MOVE),this.handler.removeInputAction(J$P.LEFT_CLICK),this.handler.removeInputAction(J$P.RIGHT_CLICK)},_$m.prototype.clear=function(){this.deactivate(),e$28(this._editPoints)&&this._editPoints.removeAll(),e$28(this._editPointIndex)&&(this._editPointIndex=-1),e$28(this._editPoint)&&(this._editPoint=void 0),e$28(this._editObject)&&(this._editObject=void 0),e$28(this._polygon)&&(this._polygon=void 0),e$28(this._polyline)&&(this._polyline=void 0),e$28(this._addPoints)&&this._addPoints.removeAll(),e$28(this._addPositions)&&(this._addPositions.length=0),e$28(this._positions)&&(this._positions=void 0)},_$m.prototype.refreshReferencePoint=function(){e$28(this._editPoints)&&this._editPoints.removeAll(),this._editPoints=this.viewer.scene.primitives.add(new B$q({depthTestEnable:!1}));for(var e=0;e<this._positions.length;e++)this._editPoints.add({id:w$g+"_"+e,position:this._positions[e],image:n$17("Assets/Textures/vertex-edit.png")});e$28(this._editPointIndex)&&(this._editPointIndex=-1),e$28(this._editPoint)&&(this._editPoint=void 0)},_$m.prototype.refreshReferenceAddPoint=function(){e$28(this._addPoints)&&this._addPoints.removeAll(),this._addPositions=[],this._addPoints=this.viewer.scene.primitives.add(new B$q({depthTestEnable:!1}));for(var e=0;e<this._positions.length-1;e++){var t=new t$X;t$X.add(this._positions[e],this._positions[e+1],t),t$X.multiplyByScalar(t,.5,t),this._addPositions.push(t)}if(e$28(this._polygon)){t=new t$X;t$X.add(this._positions[0],this._positions[this._positions.length-1],t),t$X.multiplyByScalar(t,.5,t),this._addPositions.push(t)}for(e=0;e<this._addPositions.length;e++)this._addPoints.add({position:this._addPositions[e],id:I$v+"_"+e,image:n$17("Assets/Textures/middle-edit.png")})};var e$o={Distance:0,Area:1,DVH:2,DVHX:3},d$v=Object.freeze(e$o),P$l=function(e,t,i,r){if(!e$28(e)||!e$28(t))throw new t$Z("viewer and mode is required!");this.handler=new g$G(e.scene.canvas),this.viewer=e,this._clampMode=u$Y(i,l$o.Space),this.mode=t,this.isDrawing=!1,this.active=!1,this.tmpEntities=[],this._areaLabel=void 0,this._disLabel=void 0,this._vLabel=void 0,this._hLabel=void 0,this._measureEvt=new o$1o,this._activeEvt=new o$1o,this._enableDepthTest=!1,this._labelBackgroundColor=e$1S.fromCssColorString("rgba(38, 38, 38, 0.85)"),this._labelPixelOffsetScaleByDistance=new o$1b(150,3,15e6,.5),this._labelPixelOffset=new o$1k(15,0),this._lineColor=e$1S.fromCssColorString("#51ff00"),this._fillColor=e$1S.ORANGE.withAlpha(.5),this._lineWidth=2,this._dblclickListener=void 0,this._showMeasureResult=u$Y(r,!0),this._lineDisplayType=Q$G.NON_OCCLUDED,this._lineMaterial=new t$z(this._lineColor)};function Me$9(e,t){var i=t;if(i&&i.active){var r=i.viewer.scene,n=r.pickPosition(e.position);!e$28(n)&&r.mode===P$$.SCENE2D&&(n=r.camera.pickEllipsoid(e.position));var o=r.pickPointEnabled?u$Y(t$X.clone(r.pickPoint),n):n;if(o)if(i.isDrawing)if(i.mode==d$v.DVH||i.mode==d$v.DVHX)i.deactivate();else{var a=o;if(i&&i.active&&i.isDrawing&&e$28(a))switch(i.mode){case d$v.Distance:pe$a(a,i);break;case d$v.Area:ae$b(a,i);break;case d$v.DVH:fe$8(a,i)}Se$7(o,i)}else switch(i.isDrawing=!0,i.mode){case d$v.Distance:Oe$a(o,i);break;case d$v.Area:Te$8(o,i);break;case d$v.DVH:ke$5(o,i);break;case d$v.DVHX:Ae$a(o,i)}}}function De$b(e,t){var i=t,r=i.viewer.scene,n=r.pickPosition(e.endPosition);!e$28(n)&&r.mode===P$$.SCENE2D&&(n=r.camera.pickEllipsoid(e.endPosition));var o=r.pickPointEnabled?u$Y(t$X.clone(r.pickPoint),n):n;if(i&&i.active&&i.isDrawing&&e$28(o))switch(i.mode){case d$v.Distance:pe$a(o,i);break;case d$v.Area:ae$b(o,i);break;case d$v.DVH:fe$8(o,i)}}function Pe$9(e,t){var i=t,r=i.viewer.scene;if(i&&i.active&&i.isDrawing){var n;if(i.deactivate(),e$28(i.polyline)&&(i.mode===d$v.Distance?(n=i._accumulationPositions,1===i.polyline.positions.length&&i.viewer.entities.remove(i.spEntity)):(i.mode===d$v.Area?i.polyline.positions.push(i.polyline.positions[0]):i.polyline.positions=i.polyline.positions.slice(0,i.polyline.positions.length-1),1===i.polyline.positions.length&&i.viewer.entities.remove(i.spEntity),n=i.polyline.positions),i.viewer.entities.remove(i.epEntity),!e$28(i.polygon))){i.polylinePositions=n,i._disLabel.position=n[n.length-1];var o=0;if(t._clampMode===l$o.Ground)o=Be$b(i.viewer.scene,i._accumulationPositions);else for(var a=0,s=n.length-1;a<s;a++)r.mode===P$$.COLUMBUS_VIEW?o+=t$X.distance(S$i(n[a],r.mapProjection),S$i(n[a+1],r.mapProjection)):o+=t$X.distance(n[a],n[a+1]);i._disLabel.show=!0,i.measureEvt.raiseEvent({distance:o.toFixed(8),positions:n})}if(e$28(i.polygon)){if(n.length<3){i._areaLabel.show=!1,i.viewer.entities.remove(i.spEntity);for(a=0,s=i.tmpEntities.length;a<s;a++)i.viewer.entities.remove(i.tmpEntities[a]);i.tmpEntities.length=0,i.viewer.entities.remove(i.epEntity),i.polyline.positions.length=0}if(i._areaLabel.show=!0,(i._clampMode==l$o.Ground||i._clampMode==l$o.S3mModel)&&(i.polyline.show=!0),i.polygonPositions=i.polyline.positions,i.polygon.show=!0,n.length>2){if(i._clampMode!==l$o.Ground)i._areaLabel.position=i.polyline.positions[i.polyline.positions.length-1];else{var l=i.tmpEntities[i.tmpEntities.length-1]._position._value;i._areaLabel.position=l}if(i._clampMode===l$o.Ground){var u=He$9(i.viewer.scene,i.polyline.positions);return void i.measureEvt.raiseEvent({area:u.toFixed(8),positions:n})}var c,h,d,f=A$1d.triangulate(n),p=f.length/3,_=0;for(a=0;a<p;a++)c=n[f[3*a]],h=n[f[3*a+1]],d=n[f[3*a+2]],r.mode===P$$.COLUMBUS_VIEW?(g$n=t$X.subtract(S$i(h,r.mapProjection),S$i(c,r.mapProjection),g$n),b$t=t$X.subtract(S$i(d,r.mapProjection),S$i(c,r.mapProjection),b$t),E$p=t$X.cross(g$n,b$t,E$p),_+=.5*t$X.magnitude(E$p)):(g$n=t$X.subtract(h,c,g$n),b$t=t$X.subtract(d,c,b$t),E$p=t$X.cross(g$n,b$t,E$p),_+=.5*t$X.magnitude(E$p));i.measureEvt.raiseEvent({area:_.toFixed(8),positions:n})}}}}function Se$7(e,t){var i=t;i.mode===d$v.Distance?(i.polyline.positions.push(e),i._accumulationPositions.push(e)):(i.mode===d$v.Area&&(i._accumulationArea=i._currentArea),i.polyline.positions.pop(),i.polyline.positions.push(e),i.polyline.positions.push(i.polyline.positions[0])),e$28(i.polygon)&&(i.polygonPositions=i.polyline.positions),i.tmpEntities.push(i.viewer.entities.add({show:i._showMeasureResult,position:e,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}))}Object.defineProperties(P$l.prototype,{activeEvt:{get:function(){return this._activeEvt}},measureEvt:{get:function(){return this._measureEvt}},disLabel:{get:function(){return this._disLabel}},areaLabel:{get:function(){return this._areaLabel}},hLabel:{get:function(){return this._hLabel}},vLabel:{get:function(){return this._vLabel}},clampMode:{get:function(){return this._clampMode},set:function(e){e$28(e)&&e!=this._clampMode&&(this._clampMode=e,e$28(this.polygon)&&(e==l$o.Space?(this.polygon.polygon.perPositionHeight.setValue(!0),this.polygon.clampToS3M=!1):e==l$o.Ground?(this.polygon.polygon.perPositionHeight.setValue(!1),this.polygon.clampToS3M=!1):e==l$o.S3mModel&&(this.polygon.polygon.perPositionHeight.setValue(!1),this.polygon.clampToS3M=!0)),e$28(this.polyline)&&(e==l$o.Ground?this.polyline._polyline.clampToGround=!0:this.polyline._polyline.clampToGround=!1))}},enableDepthTest:{get:function(){return this._enableDepthTest},set:function(e){console.warn("MeasureHandler.enableDepthTest is deprecated, use MeasureHandler.lineDisplayType instead."),o$1u.typeOf.bool("MeasureHandler.enableDepthTest",e),this._enableDepthTest=e,this._lineDisplayType=e?Q$G.OCCLUDED:Q$G.NON_OCCLUDED}},capturePointSize:{get:function(){return this.viewer._capturePointSize},set:function(e){this.viewer._capturePointSize=e}},capturePointColor:{get:function(){return this.viewer._capturePointColor},set:function(e){this.viewer._capturePointColor=e}},lineColor:{get:function(){return this._lineColor},set:function(e){if(o$1u.defined("lineColor value",e),!(e instanceof e$1S))throw new t$Z("lineColor must be a instance of Color.");e$1S.equals(this._lineColor,e)||(this._lineColor=e,this._lineMaterial=new t$z(e),e$28(this.polyline)&&(this.polyline.polyline.material=new t$z(e)))}},fillColor:{get:function(){return this._fillColor},set:function(e){this._fillColor=e}},lineWidth:{get:function(){return this._lineWidth},set:function(e){o$1u.typeOf.number("handlerLineWidth",e),e!=this._lineWidth&&(this._lineWidth=e,e$28(this.polyline)&&(this.polyline.polyline.width=e))}},lineDisplayType:{get:function(){return this._lineDisplayType},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("MeasureHandler.lineDisplayType",e,0),o$1u.typeOf.number.lessThanOrEquals("MeasureHandler.lineDisplayType",e,2),this._lineDisplayType=e,this.polylines&&(this.polylines.lineDisplayType=e)}},points:{get:function(){return this.tmpEntities}},lineMaterial:{get:function(){return this._lineMaterial},set:function(e){if(o$1u.defined("handlerLineMatrial value",e),e instanceof a$O){let t=e.type,i=e.uniforms;t===a$O.ColorType?this._lineMaterial=new t$z(i.color):t===a$O.PolylineArrowType?this._lineMaterial=new t$n(i.color):t===a$O.PolylineDashType?this._lineMaterial=new o$K(i):t===a$O.PolylineOutlineType&&(this._lineMaterial=new e$I(i))}else this._lineMaterial=e;e$28(this.polyline)&&(this.polyline.polyline.material=this._lineMaterial)}}}),P$l.prototype.activate=function(){if(this.mode!==d$v.DVH&&this.clear(),1!=this.active){this.active=!0;var e=this;this.handler.setInputAction((function(t){Me$9(t,e)}),J$P.LEFT_CLICK),this.handler.setInputAction((function(t){De$b(t,e)}),J$P.MOUSE_MOVE),this.handler.setInputAction((function(t){Pe$9(t,e)}),J$P.RIGHT_CLICK),this.activeEvt.raiseEvent(!0),this._dblclickListener=this.viewer.screenSpaceEventHandler.getInputAction(J$P.LEFT_DOUBLE_CLICK),this.viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)}},P$l.prototype.deactivate=function(){!0===this.active&&this.activeEvt.raiseEvent(!1),this.active=!1,this.isDrawing=!1,this.handler.removeInputAction(J$P.LEFT_CLICK),this.handler.removeInputAction(J$P.MOUSE_MOVE),this.handler.removeInputAction(J$P.RIGHT_CLICK),e$28(this._dblclickListener)&&(this.viewer.screenSpaceEventHandler.setInputAction(this._dblclickListener,J$P.LEFT_DOUBLE_CLICK),this._dblclickListener=void 0)},P$l.prototype.clear=function(){this.deactivate();for(var e=0,t=this.tmpEntities.length;e<t;e++)this.viewer.entities.remove(this.tmpEntities[e]);if(e$28(this.clampToGroundPolyline)&&(this.viewer.entities.remove(this.clampToGroundPolyline),this.clampToGroundPolyline=null),this.tmpEntities.length=0,e$28(this.polylines)&&(this.polylines.removeAll(),this.viewer.scene.primitives.remove(this.polylines),this.polylines=void 0),e$28(this.spEntity)&&(this.viewer.entities.remove(this.spEntity),this.spEntity=void 0),e$28(this.epEntity)&&(this.viewer.entities.remove(this.epEntity),this.epEntity=void 0),e$28(this.fpEntity)&&(this.viewer.entities.remove(this.fpEntity),this.fpEntity=void 0),e$28(this.labels))switch(this.mode){case d$v.Distance:this.labels.remove(this._disLabel);break;case d$v.Area:this.labels.remove(this._areaLabel);break;case d$v.DVH:this.labels.removeAll()}e$28(this.polygon)&&(this.viewer.entities.remove(this.polygon),this.polygon=void 0),e$28(this.polyline)&&(this.viewer.entities.remove(this.polyline),this.polyline=void 0)};var g$n=new t$X,b$t=new t$X,E$p=new t$X;function ae$b(e,t){var i=t,r=i.viewer.scene;if(e$28(e)){i.endPoint=e;var n=i.polyline.positions,o=n.length;if(o>3?(n[o-2]=e,n.pop()):n[o-1]=e,o>2&&(e$28(i._areaLabel)&&(i._areaLabel.show=!0),i.polygonPositions=n),i.polyline.positions=n,n.length>2){var a;if(i.epEntity.position=e,i._areaLabel.position=e,i._areaLabel.show=t._clampMode!==l$o.Ground,i.polyline.positions.push(i.polyline.positions[0]),t._clampMode===l$o.Ground)return;if(r.mode===P$$.COLUMBUS_VIEW){var s=n.map((function(e){return S$i(e,r.mapProjection)}));a=P$l.computeArea(s)}else a=P$l.computeArea(n);i.measureEvt.raiseEvent({area:a.toFixed(8),positions:n})}}}function Te$8(e,t){var i=t;i.polygonPositions=[],i.polylineCoord=[e,e],i.tmpEntities.length=0;var r=i._enableDepthTest;i.polyline=i.viewer.entities.add({polyline:{positions:new n$G((function(){return i.polylineCoord}),!1),width:i._lineWidth,material:i._lineMaterial,loop:!0,clampToGround:i._clampMode===l$o.Ground}}),i.polyline.positions=i.polylineCoord,i.spEntity=i.viewer.entities.add({position:e,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.epEntity=i.viewer.entities.add({position:e,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}});var n=i.viewer.scene.primitives.add(new w$p({depthTestEnable:!1}));i._areaLabel=n.add({position:e,font:"100 20px SimSun",fillColor:e$1S.WHITE,style:R$t.FILL_AND_OUTLINE,showBackground:!0,outlineWidth:1,outlineColor:e$1S.BLUE,pixelOffset:i._labelPixelOffset,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT});var o=i._clampMode,a=!1,s=!1;o==l$o.Space?a=!0:o==l$o.S3mModel&&(s=!0),i.polygon=i.viewer.entities.add({polygon:{hierarchy:new n$G((function(){return{positions:JSON.parse(JSON.stringify(i.polygonPositions)),holes:[]}}),!1),material:i._fillColor,perPositionHeight:a},clampToS3M:s,depthTestEnabled:r,show:!0}),i.labels=n,t._clampMode===l$o.Ground&&(i.polyline.show=!0),i._areaLabel.show=!1,i.tmpEntities.push(i.spEntity)}function Oe$a(e,t){var i=t;i.polylinePositions=[e,e],i.polyline=i.viewer.entities.add({polyline:{positions:new n$G((function(){return i.polylinePositions}),!1),width:i._lineWidth,material:i._lineMaterial,clampToGround:t._clampMode===l$o.Ground}}),i.polyline.positions=i.polylinePositions,i.tmpEntities.length=0,i._accumulationPositions=[e],i.spEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.epEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}});var r=i.viewer.scene.primitives.add(new w$p({depthTestEnable:!1}));i._disLabel=r.add({position:e,font:"100 20px SimSun",fillColor:e$1S.WHITE,style:R$t.FILL_AND_OUTLINE,showBackground:!0,backgroundColor:i._labelBackgroundColor,outlineWidth:1,outlineColor:e$1S.BLUE,pixelOffset:i._labelPixelOffset,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT}),i.labels=r,i.tmpEntities.push(i.spEntity)}function pe$a(e,t){var i=t,r=i.viewer.scene;i.endPoint=e;var n=i.polyline.positions,o=n.length;i.polylinePositions=n,n[o-1]=e,i.polyline.positions=n,i.epEntity.position=e;var a=0,s=i._accumulationPositions.concat([e]);if(i.polyline._distance=a,i._disLabel.position=e,i._disLabel.show=t._clampMode!==l$o.Ground,t._clampMode!==l$o.Ground){for(var l=0,u=s.length-1;l<u;l++)r.mode===P$$.COLUMBUS_VIEW?a+=t$X.distance(S$i(s[l],r.mapProjection),S$i(s[l+1],r.mapProjection)):a+=t$X.distance(s[l],s[l+1]);i.measureEvt.raiseEvent({distance:a.toFixed(8),positions:s})}}function ke$5(e,t){var i=t;if(!e$28(i.polylines)){var r=i._enableDepthTest;i.polylines=new X$v({opaqueRS:u$R.fromCache({depthMask:r,depthTest:{enabled:r}}),lineDisplayType:i._lineDisplayType}),i.viewer.scene.primitives.add(i.polylines)}i.horizontalPolyline=i.polylines.add({width:2,show:i._showMeasureResult,positions:[e,e],material:a$O.fromType(a$O.ColorType,{color:i._lineColor})}),i.verticalPolyline=i.polylines.add({width:2,show:i._showMeasureResult,positions:[e,e],material:a$O.fromType(a$O.ColorType,{color:i._lineColor})}),i.dirPolyline=i.polylines.add({width:2,show:i._showMeasureResult,positions:[e,e],material:a$O.fromType(a$O.ColorType,{color:i._lineColor})}),i.spEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.epEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.fpEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.tmpEntities.push(i.spEntity),i.tmpEntities.push(i.epEntity),i.tmpEntities.push(i.fpEntity),e$28(i.labels)||(i.labels=i.viewer.scene.primitives.add(new w$p({depthTestEnable:!1}))),i._disLabel=i.labels.add({position:e,font:"500 16px sans-serif",style:R$t.FILL_AND_OUTLINE,outlineWidth:1,outlineColor:e$1S.BLACK,showBackground:!0,backgroundColor:i._labelBackgroundColor,pixelOffset:i._labelPixelOffset,pixelOffsetScaleByDistance:i._labelPixelOffsetScaleByDistance,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT}),i._vLabel=i.labels.add({position:e,font:"500 16px sans-serif",style:R$t.FILL_AND_OUTLINE,outlineWidth:1,outlineColor:e$1S.BLACK,showBackground:!0,backgroundColor:i._labelBackgroundColor,pixelOffset:i._labelPixelOffset,pixelOffsetScaleByDistance:i._labelPixelOffsetScaleByDistance,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT}),i._hLabel=i.labels.add({position:e,font:"500 16px sans-serif",style:R$t.FILL_AND_OUTLINE,outlineWidth:1,outlineColor:e$1S.BLACK,showBackground:!0,backgroundColor:i._labelBackgroundColor,pixelOffset:i._labelPixelOffset,pixelOffsetScaleByDistance:i._labelPixelOffsetScaleByDistance,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT});var n=new t$X;t$X.normalize(e,n),i.plane=o$1i.fromPointNormal(e,n),i.startPoint=e,i.startHeight=t$W.fromCartesian(e).height,i.normal=n;var o=new t$X;t$X.negate(n,o),i.negateNormal=o,i.spEntity.position=e}function Ae$a(e,t){var i=t;if(!e$28(i.polylines)){i.polylines=new X$v,i.verticalPolyline=i.polylines.add({width:2,show:i._showMeasureResult,positions:[e,e],material:a$O.fromType(a$O.ColorType,{color:i._lineColor})}),i.startPoint=e,i.spEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}}),i.fpEntity=i.viewer.entities.add({position:e,show:i._showMeasureResult,point:{pixelSize:8,color:e$1S.fromCssColorString("#ffe500")}});var r=i.viewer.scene.primitives.add(new w$p({depthTestEnable:!1}));i._vLabel=r.add({position:e,font:"500 16px sans-serif",style:R$t.FILL_AND_OUTLINE,outlineWidth:1,outlineColor:e$1S.BLACK,showBackground:!0,backgroundColor:i._labelBackgroundColor,pixelOffset:i._labelPixelOffset,pixelOffsetScaleByDistance:i._labelPixelOffsetScaleByDistance,text:"",show:i._showMeasureResult,horizontalOrigin:j$13.LEFT}),i.viewer.scene.primitives.add(i.polylines),i.labels=r}i.startPoint=e,i.spEntity.position=e}var xe$9=new t$X;function fe$8(e,t){var i=t;if(i.viewer.scene,e$28(e)){i.endPoint=e;var r,n,o=t$W.fromCartesian(e).height;if(o>i.startHeight){var a=t$X.normalize(e,xe$9);r=o$1i.fromPointNormal(e,a),n=new f$18(i.startPoint,a)}else r=i.plane,n=new f$18(e,i.normal);var s=g$10.rayPlane(n,r);if(e$28(s)||(n=new f$18(e,i.normal),s=g$10.rayPlane(n,i.plane))){o>i.startHeight?(i.horizontalPolyline.positions=[e,s],i.verticalPolyline.positions=[i.startPoint,s]):(i.horizontalPolyline.positions=[i.startPoint,s],i.verticalPolyline.positions=[e,s]),i.dirPolyline.positions=[i.startPoint,e],i.epEntity.position=e,i.fpEntity.position=s;var l=t$X.distance(i.startPoint,e).toFixed(8),u=t$X.distance(i.startPoint,s).toFixed(8),c=t$X.distance(e,s).toFixed(8);o>i.startHeight?(t$X.lerp(i.startPoint,e,.5,i._disLabel.position),t$X.lerp(i.startPoint,s,.5,i._vLabel.position),t$X.lerp(e,s,.5,i._hLabel.position)):(t$X.lerp(i.startPoint,e,.5,i._disLabel.position),t$X.lerp(e,s,.5,i._vLabel.position),t$X.lerp(i.startPoint,s,.5,i._hLabel.position),u=t$X.distance(e,s).toFixed(8),c=t$X.distance(i.startPoint,s).toFixed(8)),i.measureEvt.raiseEvent({distance:l,directionalPositions:i.dirPolyline.positions,verticalHeight:u,verticalPositions:i.verticalPolyline.positions,horizontalDistance:c,horizontalPositions:i.horizontalPolyline.positions,endHeight:o})}}}function S$i(e,t){if(e$28(e)){var i=t.ellipsoid.cartesianToCartographic(e);return t.project(i)}}function He$9(e,t){for(var i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=0;a<t.length;a++){var s=t$W.fromCartesian(t[a]);i=Math.min(s.longitude,i),r=Math.max(s.longitude,r),n=Math.min(s.latitude,n),o=Math.max(s.latitude,o)}for(var l=t$W.toCartesian(new t$W(i,n,0)),u=t$W.toCartesian(new t$W(r,o,0)),c=t$X.angleBetween(l,u),h=U$Q.fromPositions({positions:t,granularity:c/32}),d=U$Q.createGeometry(h),f=0,p={},_=0;_<d.indices.length;_+=3){var m,$=d.indices[_];if(e$28(p[$]))m=p[$];else{m=new t$X(d.attributes.position.values[3*$],d.attributes.position.values[3*$+1],d.attributes.position.values[3*$+2]);var g=t$W.fromCartesian(m),v=e.globe.getHeight(g);if(!e$28(v))continue;g=t$W.fromRadians(g.longitude,g.latitude,v),m=t$W.toCartesian(g),p[$]=t$X.clone(m)}var y,x=d.indices[_+1];if(e$28(p[x]))y=p[x];else{y=new t$X(d.attributes.position.values[3*x],d.attributes.position.values[3*x+1],d.attributes.position.values[3*x+2]);var b=t$W.fromCartesian(y),w=e.globe.getHeight(b);if(!e$28(w))continue;b=t$W.fromRadians(b.longitude,b.latitude,w),y=t$W.toCartesian(b),p[x]=t$X.clone(y)}var C,T=d.indices[_+2];if(e$28(p[T]))C=p[T];else{C=new t$X(d.attributes.position.values[3*T],d.attributes.position.values[3*T+1],d.attributes.position.values[3*T+2]);var S=t$W.fromCartesian(C),E=e.globe.getHeight(S);if(!e$28(E))continue;S=t$W.fromRadians(S.longitude,S.latitude,E),C=t$W.toCartesian(S),p[T]=t$X.clone(C)}g$n=t$X.subtract(y,m,g$n),b$t=t$X.subtract(C,m,b$t),E$p=t$X.cross(g$n,b$t,E$p),f+=.5*t$X.magnitude(E$p)}return f}function Be$b(e,t){for(var i=0,r=[],n=t.length-1,o=0;o<n;o++){var a=t[o],s=t[o+1],l=t$X.angleBetween(a,s);if(!(l<e$27.EPSILON10)){var u=l/64,c=e$27.chordLength(u,6378137),h=y$Q.subdivideLine(a,s,c,r);h.push(s.x),h.push(s.y),h.push(s.z);for(var d=t$X.unpackArray(h),f=d.length-1,p=0;p<f;p++){var _=d[p],m=t$W.fromCartesian(_),$=e.globe.getHeight(m);m=t$W.fromRadians(m.longitude,m.latitude,$);var g=t$W.toCartesian(m),v=d[p+1];m=t$W.fromCartesian(v),$=e.globe.getHeight(m),m=t$W.fromRadians(m.longitude,m.latitude,$);var y=t$W.toCartesian(m);i+=t$X.distance(g,y)}}}return i}P$l.computeArea=function(e){for(var t,i,r,n=A$1d.triangulate(e),o=n.length/3,a=0,s=0;s<o;s++)t=e[n[3*s]],i=e[n[3*s+1]],r=e[n[3*s+2]],g$n=t$X.subtract(i,t,g$n),b$t=t$X.subtract(r,t,b$t),E$p=t$X.cross(g$n,b$t,E$p),a+=.5*t$X.magnitude(E$p);return a},P$l.prototype.getLinePositions=function(){return e$28(this.polyline)?this.polyline.positions:[]};var l$n={LINE_X:1,LINE_Y:2,LINE_Z:3,CIRCLE_X:4,CIRCLE_Y:5,CIRCLE_Z:6,SCALE_LINE_X:7,SCALE_LINE_Y:8,SCALE_LINE_Z:9,UNIFORM_SCALE:10},U$j={ENTITY:1,S3MINSTANCE:2},q$j=new t$X,J$m=new t$X,K$i=new t$X,de$a=new t$X,I$u=new t$X;new y$15;var Te$7=new t$X,Y$e=new p$1a,me$c=new n$14,g$m=new y$15,Re$7=new y$15,be$a=new y$15,Ae$9=new t$X,Oe$9=new t$X,Ze$5=new t$X,Ue$7=new t$X,S$h=new i$10,Ye$6=new y$15;new t$X;var $$h=new t$X;function z$j(e,t){for(var i=e.attributes.position.values,r=0,n=i.length;r<n;r+=3)i[r+2]+=t}function De$a(e,t,i){var r=y$15.getMatrix3(e,Y$e),n=n$14.fromRotationMatrix(r,me$c),o=p$1a.fromQuaternion(n,Y$e),a=y$15.fromRotationTranslation(o,t$X.ZERO,Ye$6),s=y$15.inverse(t,g$m),l=y$15.multiply(s,a,g$m),u=y$15.getMatrix3(l,Y$e);return y$15.fromRotationTranslation(u,t$X.ZERO,i)}function ve$7(e,t){return y$15.getMatrix3(e,Y$e),n$14.fromRotationMatrix(Y$e,t),t}function A$s(e,t,i,r){var n=e.getPickRay(t),o=o$1i.fromPointNormal(i,r);return g$10.rayPlane(n,o)}function We$6(e,t,i){var r=[],n=h$W.createVertexBuffer({context:e,typedArray:S$W.createTypedArray(S$W.FLOAT,i.attributes.position.values),usage:A$1c.STATIC_DRAW});r.push({index:0,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1});var o=new m$19({context:e,attributes:r,indexBuffer:h$W.createIndexBuffer({context:e,typedArray:i.indices,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})}),a=S$T.fromCache({context:e,vertexShaderSource:"attribute vec4 aPosition;\nuniform vec4 uColor;\nuniform vec4 uPickColor;\nuniform float uScale;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvoid main()\n{\n vColor = uColor;\n vPickColor = uPickColor;\n mat4 scaleMatrix;\n scaleMatrix[0] = vec4(uScale, 0.0, 0.0, 0.0);\n scaleMatrix[1] = vec4(0.0, uScale, 0.0, 0.0);\n scaleMatrix[2] = vec4(0.0, 0.0, uScale, 0.0);\n scaleMatrix[3] = vec4(0.0, 0.0, 0.0, 1.0);\n gl_Position = czm_modelViewProjection * scaleMatrix * vec4(aPosition.xyz, 1.0);\n}",fragmentShaderSource:"varying vec4 vColor;\nvarying vec4 vPickColor;\nvoid main()\n{\n gl_FragColor = vColor;\n}\n",attributeLocations:{aPosition:0}}),s=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:t._modelMatrix,pass:Le$p.LOG_DEPTH_OVERLAY,owner:t});s.vertexArray=o,s.shaderProgram=a;var l={id:t._id,primitive:t},u=e.createPickId(l);s.pickId="vPickColor",s.uniformMap={uColor:function(){return t._uColor},uPickColor:function(){return u.color},uScale:function(){return t._scaleAdjusted}},s.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var c=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:t._modelMatrix,pass:Le$p.OPAQUE+2,owner:t});c.vertexArray=o,c.shaderProgram=a;var h={id:t._id+"#2",primitive:t},d=e.createPickId(h);c.pickId="vPickColor",c.uniformMap={uColor:function(){return t._uColor.withAlpha(.2)},uPickColor:function(){return d.color},uScale:function(){return t._scaleAdjusted}},c.renderState=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1},blending:Ee$n.ALPHA_BLEND}),t._commands.push(c),t._commands.push(s)}var ke$4=new n$14;function Be$a(e,t){var i=t.modelMatrix,r=t$X.negate(e._offset,K$i),n=y$15.fromTranslation(r,be$a),o=m$1b.eastNorthUpToFixedFrame(e._position,void 0,Re$7),a=De$a(i,o,g$m),s=ve$7(a,ke$4);y$15.multiply(o,y$15.multiply(a,n,a),g$m);var l=y$15.getTranslation(g$m,Te$7);Xe$3(e,l,ve$7(g$m,me$c),t.nonUniformScaleAddition,t.uniformScaleAddition,n),Fe$8(e,l,s,t.nonUniformScaleAddition,t.uniformScaleAddition)}function Xe$3(e,t,i,r,n,o){if(e._modelType===U$j.ENTITY){e._model.model._offsetMatrix=o,e._model.position=t,e._model.orientation=i;var a=r;r||(a=t$X.clone(t$X.ZERO)),n&&(a.x+=n,a.y+=n,a.z+=n),e._model.model.scale||(e._model.model.scale=t$X.clone(t$X.UNIT_XYZ));var s=e._model.model.scale.getValue(0);s instanceof t$X?(t$X.add(a,s,a),e._model.model.scale=a):(a.x+=s,a.y+=s,a.z+=s,e._model.model.scale=a)}}function Fe$8(e,t,i,r,n){if(e._modelType===U$j.S3MINSTANCE){e._model.updatePosition(t);var o=i$10.fromQuaternion(i);e._model.updateRotation(o);var a=t$X.clone(e._model.scale);e$28(n)&&(a.x+=n,a.y+=n,a.z+=n),e$28(r)&&t$X.add(a,r,a),e._model.updateScale(a)}}function D$q(e,t){e.prototype.__proto__=Object.create(t.prototype),e.prototype.__proto__.constructor=e}function E$o(e){this._owner=e.owner,this._color=e$1S.clone(u$Y(e.color,e$1S.WHITE)),this._hoverColor=e$1S.clone(u$Y(e.hoverColor,e$1S.WHITE)),this._uColor=e$1S.clone(this._color),this._visible=u$Y(e.visible,!0),this._scale=u$Y(e.scale,t$X.UNIT_XYZ),this._initTransition=u$Y(e.transition,new t$X),this._initHpr=u$Y(e.headingPitchRoll,new i$10),this._initModelMatrix=y$15.clone(y$15.IDENTITY),this._initModelMatrixInverse=y$15.clone(y$15.IDENTITY),this._modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._id=u$Y(e.id,e$1K()),this._typeForModelEditor=u$Y(e.type,-1),this._commands=[],this._geometries=[],this._updateMatrix(),this._setChangeEvt(),this._adjustAxisLength=void 0,this._scaleAdjusted=1}function je$6(e,t){return function(i){if(!(e$28(i)&&i<.05)){var r=150*Ge$5(e,t._owner._model._position||t._owner._model._position._value);t._scaleAdjusted=Math.max(r/10,1),t._scaleAdjusted=t._scaleAdjusted>1e3?1:t._scaleAdjusted}}}function W$j(e){this._color=u$Y(e.color,e$1S.WHITE),this._lineWidth=u$Y(e.lineWidth,.02),this._lineLength=u$Y(e.lineLength,5),this._arrowWidth=u$Y(e.arrowWidth,.2),this._arrowLength=u$Y(e.arrowLength,1),this._lineWidth=this._lineWidth*u$Y(e.lineWidthScale,4),E$o.call(this,e)}function k$p(e){this._lineWidth=u$Y(e.lineWidth,.02),this._lineLength=u$Y(e.lineLength,10),this._headDimension=u$Y(e.headDimension,.2),E$o.call(this,e)}function ee$d(e){this._dimensions=u$Y(e.dimensions,.2),this._color=u$Y(e.color,e$1S.WHITE),E$o.call(this,e)}function B$d(e){this._width=u$Y(e.width,.02),this._radius=u$Y(e.radius,7.5),this._width=this._width*u$Y(e.lineWidthScale,4),E$o.call(this,e)}function X$b(e){this._dimensions=u$Y(e.dimensions,.2),E$o.call(this,e)}function u$l(e){o$1u.typeOf.object("options",e),o$1u.typeOf.object("options.scene",e.scene),o$1u.typeOf.object("options.model",e.model);var t=e.model,i=t instanceof h$F;if(!i&&!(t instanceof _0x375cb8))throw new t$Z("Unsupported model type.");this._scene=e.scene,this._modelType=i?U$j.ENTITY:U$j.S3MINSTANCE,this._offset=u$Y(e.offset,t$X.ZERO),this._hoverColor=u$Y(e.hoverColor,e$1S.WHITE),this._scale=u$Y(e.scale,1),this._model=t,this._active=!1,this._hpr=void 0,this._handler=new g$G(this._scene.canvas),this._primitives=[],this._axesShow=p$17(e.axesShow,{translation:!0,rotation:!0,scale:!0}),this._lineWidthScale=u$Y(e.lineWidthScale,4),this._modelType===U$j.ENTITY?(this._position=t.position.getValue(0),this._orientation=t.orientation?t.orientation.getValue(0):new n$14,this._calcHpr()):(this._position=t.position,this._hpr=i$10.clone(t.hpr)),this._fromEnu=m$1b.eastNorthUpToFixedFrame(this._position),y$15.multiplyByPoint(this._fromEnu,this._offset,this._position),this._modelMatrix=m$1b.headingPitchRollToFixedFrame(this._position,this._hpr),this._modelMatrixInverse=y$15.inverse(this._modelMatrix,new y$15),!e$28(this._changedEvt)&&(this._changedEvt=new o$1o),!e$28(this._hoverChanged)&&(this._hoverChanged=new o$1o),this._axesCreated=!1;var r=this;this._changedEvt.addEventListener((function(e){Be$a(r,e)}))}function Ge$5(e,t){var i=e.context._us,r=i._viewport,n=r.width,o=r.height,a=new t$X;y$15.multiplyByPoint(i._view,t,a);var s,l,u=i.frustumPlanes,c=u.x,h=u.y,d=u.z,f=u.w;if(e.mode===P$$.COLUMBUS_VIEW||i.orthographicIn3D){s=(f-d)/n,l=(c-h)/o}else{var p=-a.z,_=1/i.currentFrustum.x,m=c*_;l=2*p*m/o,s=2*p*(m=f*_)/n}return Math.max(s,l)}E$o.prototype._setChangeEvt=function(){var e=this;this._owner._changedEvt.addEventListener((function(t){y$15.multiply(t.modelMatrix,e._initModelMatrix,e._modelMatrix)})),this._owner._hoverChanged.addEventListener((function(t){t===e._typeForModelEditor?e$1S.clone(e._hoverColor,e._uColor):e$1S.clone(e._color,e._uColor),t>=1&&t<=10&&t!==e._typeForModelEditor?e._color=e._color.withAlpha(.05,e._color):e._color=e._color.withAlpha(1,e._color)}))},E$o.prototype._createGeometry=function(){},E$o.prototype._updateMatrix=function(){y$15.fromTranslationQuaternionRotationScale(this._initTransition,n$14.fromHeadingPitchRoll(this._initHpr),this._scale,this._initModelMatrix),y$15.inverse(this._initModelMatrix,this._initModelMatrixInverse),y$15.multiply(this._modelMatrix,this._initModelMatrix,this._modelMatrix)},E$o.prototype.update=function(e){if(e$28(this._adjustAxisLength)||(this._adjustAxisLength=je$6(e,this),e.camera.changed.addEventListener(this._adjustAxisLength)),0===this._commands.length){this._createGeometry();for(var t=0,i=this._geometries.length;t<i;t++){var r=this._geometries[t];We$6(e.context,this,r)}}if(this._visible)for(t=0,i=this._commands.length;t<i;t++){var n=this._commands[t];e.commandList.push(n)}},E$o.prototype.destroy=function(){this._geometries.length=0;for(var e=0,t=this._commands.length;e<t;e++){var i=this._commands[e];i.vertexArray=i.vertexArray&&!i.vertexArray.isDestroyed()&&i.vertexArray.destroy(),i.shaderProgram=i.shaderProgram&&!i.shaderProgram.isDestroyed()&&i.shaderProgram.destroy()}this._commands.length=0},W$j.prototype._createGeometry=function(){var e=l$_.createGeometry(new l$_({length:this._lineLength,topRadius:this._lineWidth,bottomRadius:this._lineWidth})),t=l$_.createGeometry(new l$_({length:this._arrowLength,topRadius:.01,bottomRadius:this._arrowWidth}));z$j(e,this._lineLength/2),z$j(t,this._lineLength),this._geometries.push(e),this._geometries.push(t)},D$q(W$j,E$o),k$p.prototype._createGeometry=function(){var e=l$_.createGeometry(new l$_({length:this._lineLength,topRadius:this._lineWidth,bottomRadius:this._lineWidth})),t=O$H.createGeometry(new O$H({minimum:new t$X(-this._headDimension,-this._headDimension,-this._headDimension),maximum:new t$X(this._headDimension,this._headDimension,this._headDimension),vertexFormat:n$10.POSITION_AND_NORMAL}));z$j(e,this._lineLength/2),z$j(t,this._lineLength),this._geometries.push(e),this._geometries.push(t)},D$q(k$p,E$o),ee$d.prototype._createGeometry=function(){var e=O$H.createGeometry(new O$H({minimum:new t$X(-this._dimensions,-this._dimensions,-this._dimensions),maximum:new t$X(this._dimensions,this._dimensions,this._dimensions),vertexFormat:n$10.POSITION_AND_NORMAL}));this._geometries.push(e)},D$q(ee$d,E$o),B$d.prototype._createGeometry=function(){var e=N$G.createGeometry(new N$G({polylinePositions:function(e){for(var t=[],i=0;i<=360;i+=3){var r=e$27.toRadians(i),n=new t$X(e*Math.cos(r),e*Math.sin(r),0);t.push(n)}return t}(this._radius),shapePositions:function(e){for(var t=[],i=0;i<=360;i+=10){var r=e$27.toRadians(i);t.push(new o$1k(e*Math.cos(r),e*Math.sin(r)))}return t}(this._width),vertexFormat:n$10.POSITION_AND_NORMAL}));this._geometries.push(e)},D$q(B$d,E$o),X$b.prototype._createGeometry=function(){var e=this._dimensions,t=P$W.createGeometry(new P$W({polygonHierarchy:new e$1m([new t$X(-e,e,0),new t$X(-e,-e,0),new t$X(e,-e,0),new t$X(e,e,0)]),perPositionHeight:!0,vertexFormat:n$10.POSITION_AND_NORMAL}));this._geometries.push(t)},D$q(X$b,E$o),Object.defineProperties(u$l.prototype,{changedEvt:{get:function(){return this._changedEvt}}}),u$l.prototype.setEditObject=function(e){this._clearEditObject(),this.constructor({model:e,scene:this._scene,offset:this._offset,axesShow:this._axesShow}),this.activate()},u$l.prototype._clearEditObject=function(){for(var e=0;e<this._primitives.length;e++)this._scene.primitives.remove(this._primitives[e]),this._primitives[e]=void 0;this._primitives=[],this._handler.destroy()},u$l.prototype._calcHpr=function(){var e=p$1a.fromQuaternion(this._orientation,new p$1a),t=y$15.fromRotationTranslation(e,t$X.ZERO,new y$15),i=y$15.inverse(m$1b.eastNorthUpToFixedFrame(this._position),new y$15),r=y$15.multiply(i,t,new y$15),n=y$15.getMatrix3(r,new p$1a);this._hpr=i$10.fromQuaternion(n$14.fromRotationMatrix(n))},u$l.prototype._createAxes=function(){this._axisX=new W$j({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,-90,0),color:e$1S.RED,hoverColor:this._hoverColor,type:l$n.LINE_X,visible:this._axesShow.translation,lineWidthScale:this._lineWidthScale}),this._axisY=new W$j({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,-90),color:e$1S.GREEN,hoverColor:this._hoverColor,type:l$n.LINE_Y,visible:this._axesShow.translation,lineWidthScale:this._lineWidthScale}),this._axisZ=new W$j({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,0),color:e$1S.BLUE,hoverColor:this._hoverColor,type:l$n.LINE_Z,visible:this._axesShow.translation,lineWidthScale:this._lineWidthScale}),this._scaleLineX=new k$p({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,-90,0),color:e$1S.RED,hoverColor:this._hoverColor,type:l$n.SCALE_LINE_X,visible:this._axesShow.scale,lineWidthScale:this._lineWidthScale}),this._scaleLineY=new k$p({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,-90),color:e$1S.GREEN,hoverColor:this._hoverColor,type:l$n.SCALE_LINE_Y,visible:this._axesShow.scale}),this._scaleLineZ=new k$p({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,0),color:e$1S.BLUE,hoverColor:this._hoverColor,type:l$n.SCALE_LINE_Z,visible:this._axesShow.scale,lineWidthScale:this._lineWidthScale}),this._axisCircleX=new B$d({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,-90,0),color:e$1S.RED,hoverColor:this._hoverColor,type:l$n.CIRCLE_X,visible:this._axesShow.rotation,lineWidthScale:this._lineWidthScale}),this._axisCircleY=new B$d({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,-90),color:e$1S.GREEN,hoverColor:this._hoverColor,type:l$n.CIRCLE_Y,visible:this._axesShow.rotation,lineWidthScale:this._lineWidthScale}),this._axisCircleZ=new B$d({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),headingPitchRoll:i$10.fromDegrees(0,0,0),color:e$1S.BLUE,hoverColor:this._hoverColor,type:l$n.CIRCLE_Z,visible:this._axesShow.rotation,lineWidthScale:this._lineWidthScale}),this._transitionPlaneX=new X$b({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),dimensions:.4,transition:new t$X(0,.4,.4),headingPitchRoll:i$10.fromDegrees(0,-90,0),color:e$1S.RED,hoverColor:this._hoverColor,type:l$n.CIRCLE_Z}),this._transitionPlaneY=new X$b({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),dimensions:.4,transition:new t$X(.4,0,.4),headingPitchRoll:i$10.fromDegrees(0,0,90),color:e$1S.GREEN,hoverColor:this._hoverColor,type:l$n.CIRCLE_Z}),this._transitionPlaneZ=new X$b({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),dimensions:.4,transition:new t$X(.4,.4,0),headingPitchRoll:i$10.fromDegrees(0,0,0),color:e$1S.BLUE,hoverColor:this._hoverColor,type:l$n.CIRCLE_Z}),this._uniformScale=new ee$d({owner:this,modelMatrix:this._modelMatrix,scale:t$X.multiplyByScalar(t$X.UNIT_XYZ,this._scale,new t$X),dimensions:.2,transition:new t$X(.2001,.2,.2),headingPitchRoll:i$10.fromDegrees(0,0,0),type:l$n.UNIFORM_SCALE,hoverColor:this._hoverColor,color:e$1S.ORANGE,visible:this._axesShow.scale,lineWidthScale:this._lineWidthScale}),this._primitives=[this._scaleLineX,this._scaleLineY,this._scaleLineZ,this._axisCircleX,this._axisCircleY,this._axisCircleZ,this._uniformScale,this._axisX,this._axisY,this._axisZ],this._scene.primitives.add(this._scaleLineX),this._scene.primitives.add(this._scaleLineY),this._scene.primitives.add(this._scaleLineZ),this._scene.primitives.add(this._axisCircleX),this._scene.primitives.add(this._axisCircleY),this._scene.primitives.add(this._axisCircleZ),this._scene.primitives.add(this._uniformScale),this._scene.primitives.add(this._axisX),this._scene.primitives.add(this._axisY),this._scene.primitives.add(this._axisZ)},u$l.prototype._initEvent=function(){var e=this._scene,t=this,i=this._handler;i.setInputAction((function(i){var r=t._pickObj;!r||!r.primitive||!r.primitive._typeForModelEditor||(t._isEdit=!0,t._pickObj=r,e.screenSpaceCameraController.enableInputs=!1)}),J$P.LEFT_DOWN),i.setInputAction((function(e){t._isEdit?(t._handleTransition(e),t._handleRotation(e),t._handleScale(e),t._handleUniformScale(e)):t._handleHover(e)}),J$P.MOUSE_MOVE),i.setInputAction((function(i){e.screenSpaceCameraController.enableInputs=!0,t._isEdit=!1,t._pickObj=void 0}),J$P.LEFT_UP)},u$l.prototype._handleTransition=function(e){var t=this._pickObj.primitive._typeForModelEditor;if(t===l$n.LINE_X||t===l$n.LINE_Y||t===l$n.LINE_Z){var i,r;switch(t){case l$n.LINE_X:i=t$X.UNIT_Z,r=t$X.UNIT_Z;break;case l$n.LINE_Y:i=t$X.UNIT_X,r=t$X.UNIT_X;break;case l$n.LINE_Z:i=t$X.UNIT_Y,r=t$X.UNIT_Y}var n=this._scene,o=e.startPosition,a=e.endPosition,s=y$15.multiplyByPoint(this._modelMatrix,i,q$j),l=y$15.multiplyByPoint(this._modelMatrix,t$X.ZERO,J$m);r=y$15.multiplyByPoint(this._modelMatrix,r,$$h),t$X.subtract(s,l,s);var u=t$X.normalize(s,s),c=A$s(n.camera,o,r,u),h=A$s(n.camera,a,r,u),d=y$15.multiplyByPoint(this._modelMatrixInverse,c,de$a),f=y$15.multiplyByPoint(this._modelMatrixInverse,h,K$i);switch(t){case l$n.LINE_X:I$u.x=f.x-d.x;break;case l$n.LINE_Y:I$u.y=f.y-d.y;break;case l$n.LINE_Z:I$u.z=f.z-d.z}y$15.multiply(this._modelMatrix,y$15.fromTranslation(I$u,g$m),this._modelMatrix),this._changedEvt.raiseEvent({modelMatrix:this._modelMatrix,transitionAddtion:I$u}),y$15.getTranslation(this._modelMatrix,this._position),t$X.clone(t$X.ZERO,I$u)}},u$l.prototype._handleRotation=function(e){var t=this._pickObj.primitive._typeForModelEditor;if(t===l$n.CIRCLE_X||t===l$n.CIRCLE_Y||t===l$n.CIRCLE_Z){var i,r,n=this._scene,o=e.startPosition,a=e.endPosition,s=this._position;switch(t){case l$n.CIRCLE_X:i=t$X.UNIT_X,r=t$X.UNIT_Y;break;case l$n.CIRCLE_Y:i=t$X.UNIT_Y,r=t$X.UNIT_Z;break;case l$n.CIRCLE_Z:i=t$X.UNIT_Z,r=t$X.UNIT_X}var l=y$15.multiplyByPoint(this._modelMatrix,i,q$j),u=y$15.multiplyByPoint(this._modelMatrix,t$X.ZERO,J$m);r=y$15.multiplyByPoint(this._modelMatrix,r,$$h),t$X.subtract(l,u,l);var c=t$X.normalize(l,l),h=A$s(n.camera,a,r,c),d=A$s(n.camera,o,r,c),f=t$X.subtract(h,s,Oe$9),p=t$X.subtract(d,s,Ze$5),_=t$X.dot(t$X.normalize(f,f),t$X.normalize(p,p)),m=Math.acos(_),$=t$X.cross(l,f,Ae$9),g=t$X.subtract(d,h,Ue$7),v=t$X.dot($,t$X.normalize(g,g));switch(m*=v=v>0?1:-1,t){case l$n.CIRCLE_X:S$h.roll=-m;break;case l$n.CIRCLE_Y:S$h.pitch=m;break;case l$n.CIRCLE_Z:S$h.heading=m}y$15.multiply(this._modelMatrix,y$15.fromRotationTranslation(p$1a.fromHeadingPitchRoll(S$h),t$X.ZERO,g$m),this._modelMatrix),y$15.inverse(this._modelMatrix,this._modelMatrixInverse),this._changedEvt.raiseEvent({modelMatrix:this._modelMatrix,rotationAddtion:S$h}),S$h.heading=0,S$h.pitch=0,S$h.roll=0}},u$l.prototype._handleScale=function(e){var t=this._pickObj.primitive._typeForModelEditor;if(t===l$n.SCALE_LINE_X||t===l$n.SCALE_LINE_Y||t===l$n.SCALE_LINE_Z){var i,r;switch(t){case l$n.SCALE_LINE_X:i=t$X.UNIT_Z,r=t$X.UNIT_Z;break;case l$n.SCALE_LINE_Y:i=t$X.UNIT_X,r=t$X.UNIT_X;break;case l$n.SCALE_LINE_Z:i=t$X.UNIT_Y,r=t$X.UNIT_Y}var n=this._scene,o=e.startPosition,a=e.endPosition,s=y$15.multiplyByPoint(this._modelMatrix,i,q$j),l=y$15.multiplyByPoint(this._modelMatrix,t$X.ZERO,J$m);r=y$15.multiplyByPoint(this._modelMatrix,r,$$h),t$X.subtract(s,l,s);var u=t$X.normalize(s,s),c=A$s(n.camera,o,r,u),h=A$s(n.camera,a,r,u),d=y$15.multiplyByPoint(this._modelMatrixInverse,c,de$a),f=y$15.multiplyByPoint(this._modelMatrixInverse,h,K$i);switch(t){case l$n.SCALE_LINE_X:I$u.x=f.x-d.x;break;case l$n.SCALE_LINE_Y:I$u.y=f.y-d.y;break;case l$n.SCALE_LINE_Z:I$u.z=f.z-d.z}this._changedEvt.raiseEvent({modelMatrix:this._modelMatrix,nonUniformScaleAddition:t$X.clone(I$u)}),t$X.clone(t$X.ZERO,I$u)}},u$l.prototype._handleHover=function(e){var t=this._scene.pick(e.startPosition);if(this._pickObj=t,!t||!t.primitive||t.primitive._typeForModelEditor<1||t.primitive._typeForModelEditor>10)this._hoverChanged.raiseEvent(-1);else{var i=t.primitive._typeForModelEditor;this._hoverChanged.raiseEvent(i)}},u$l.prototype._handleUniformScale=function(e){if(this._pickObj.primitive._typeForModelEditor===l$n.UNIFORM_SCALE){this._scene;var t=e.startPosition,i=e.endPosition.x-t.x;this._changedEvt.raiseEvent({modelMatrix:this._modelMatrix,uniformScaleAddition:i/50})}},u$l.prototype.activate=function(){this._active||(this._axesCreated||(this._createAxes(),this._axesCreated=!0),this._initEvent(),this._active=!0)},u$l.prototype.deactivate=function(){if(this._active){this._disableEvent(),this._active=!1;for(var e=0,t=this._primitives.length;e<t;e++){this._primitives[e]._visible=!1}this._scene.screenSpaceCameraController.enableInputs=!0,this._isEdit=!1,this._pickObj=void 0}},u$l.prototype._disableEvent=function(){var e=this._handler;e.removeInputAction(J$P.LEFT_UP),e.removeInputAction(J$P.LEFT_DOWN),e.removeInputAction(J$P.MOUSE_MOVE)},u$l.prototype.destroy=function(){this.deactivate();for(var e=0,t=this._primitives.length;e<t;e++){this._primitives[e].destroy()}this._handler.destroy(),i$Z(this)},u$l.prototype.isDestroyed=function(){return!1};var d$u=function(e){t$T("PointHandler","PointHandler is deprecated,please use DrawHandler.");var t=new P$m(e,o$y.Point,l$o.Space);return t.drawCompletedEvent=t.drawEvt,t},l$m=function(e){t$T("PolygonHandler","PolygonHandler is deprecated,please use DrawHandler.");var t=new P$m(e,o$y.Polygon,l$o.Space);return t.drawCompletedEvent=t.drawEvt,t},d$t=function(e){t$T("PolylineHandler","PolylineHandler is deprecated,please use DrawHandler.");var t=new P$m(e,o$y.Line,l$o.Space);return t.drawCompletedEvent=t.drawEvt,t};function c$j(e,t){if(LicenseChecker.LICENSECHECKER.verify("DirectionalLight"),t=u$Y(t,{}),o$1u.defined("PointLight Position",e),t$X.equals(e,t$X.ZERO))throw new t$Z("directional light position equals zero");this._id=e$1K(),this._position=t$X.clone(e),this._positionCV=new t$X,this._targetPosition=u$Y(t.targetPosition,new t$X),this._targetPositionCV=new t$X,this._color=u$Y(t.color,new e$1S(1,1,1,1)),this._intensity=u$Y(t.intensity,1),this._direction=new t$X,t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction),this._lightColor=e$1S.multiplyByScalar(this._color,this._intensity,new e$1S),this._directionEC=new t$X,this._sceneMode=P$$.SCENE3D}function e$n(e){e=u$Y(e,{}),this._id=e$1K(),this._skyColor=u$Y(e.skyColor,new e$1S(.7,.7,.7)),this._groundColor=u$Y(e.groundColor,new e$1S(.2,.2,.2)),this._groundLightColor=new e$1S,this._skyLightColor=new e$1S,this._intensity=u$Y(e.intensity,1),this._sceneMode=P$$.SCENE3D}function h$l(e){this._lightList={},this._lightList[w$i.DIRECTIONAL]=new e$1P,this._lightList[w$i.POINT]=new e$1P,this._lightList[w$i.SPOT]=new e$1P,this._lightList[w$i.HEMISPHERE]=new e$1P,this._visibleLightList={},this._visibleLightList[w$i.POINT]=new e$1P,this._visibleLightList[w$i.SPOT]=new e$1P,this._visiblePointLightCount=0,this._visibleSpotLightCount=0,this._visibleDirectionalLightCount=0,this._visibleHemisphereLightCount=0,this._ambientLightColor=new e$1S(0,0,0,1),this._sunLightColor=new e$1S(.8,.8,.8,1),this._sunLightON=1,this._changedLightList=new e$1P,this._pointLightDistanceDecay=[],this._spotLightDistanceDecayCosPenumbra=[],this._context=e,this._uniformBuffer=_0x3fa369.createLightSourceUniformBuffer(e,this),this._visibleDistanceMax=1e4,this._visibleCountAllowed=100,this._enableAmbientLightColor=!1,this._enableSunLightColor=!1}function c$i(e,t){LicenseChecker.LICENSECHECKER.verify("PointLight"),t=u$Y(t,{}),o$1u.defined("PointLight Position",e),this._id=e$1K(),this._position=t$X.clone(e),this._positionCV=new t$X,this._positionEC=new t$X,this._color=u$Y(t.color,new e$1S(1,1,1,1)),this._intensity=u$Y(t.intensity,2),this._cutoffDistance=u$Y(t.cutoffDistance,10),this._decay=u$Y(t.decay,1),this._lightColor=e$1S.multiplyByScalar(this._color,this._intensity,new e$1S),this._visibleInCullingVolume=1,this._sceneMode=P$$.SCENE3D}Object.defineProperties(c$j.prototype,{id:{get:function(){return this._id}},position:{get:function(){return this._sceneMode===P$$.SCENE3D?this._position:this._positionCV},set:function(e){o$1u.defined("directional light position",e),!t$X.equals(e,this._targetPosition)&&(this._position=e,this._sceneMode===P$$.COLUMBUS_VIEW?(this._positionCV=m$1b.convertToColumbusCartesian(this._position),t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)):t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction))}},targetPosition:{get:function(){return this._sceneMode===P$$.SCENE3D?this._targetPosition:this._targetPositionCV},set:function(e){o$1u.defined("directional light target position",e),!t$X.equals(e,this._position)&&(this._targetPosition=e,this._sceneMode===P$$.COLUMBUS_VIEW?(this._targetPositionCV=m$1b.convertToColumbusCartesian(this._targetPosition),t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)):t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction))}},color:{get:function(){return this._color},set:function(e){o$1u.defined("directional light color",e),this._color=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},intensity:{get:function(){return this._intensity},set:function(e){o$1u.typeOf.number("directional light intensity",e),this._intensity=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},direction:{get:function(){return this._direction}},lightColor:{get:function(){return this._lightColor}},directionEC:{get:function(){return this._directionEC},set:function(e){o$1u.defined("directioinal light directionEC",e),this._directionEC=e}},lightType:{get:function(){return w$i.DIRECTIONAL}},sceneMode:{get:function(){return this._sceneMode},set:function(e){if(o$1u.typeOf.number("spot light sceneMode",e),this._sceneMode!==e){if(this._sceneMode=e,this._sceneMode===P$$.COLUMBUS_VIEW){if(this._positionCV=m$1b.convertToColumbusCartesian(this._position),this._targetPositionCV=m$1b.convertToColumbusCartesian(this._targetPosition),t$X.equals(this._positionCV,this._targetPositionCV))return;t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)}else t$X.subtract(this._position,this._targetPosition,this._direction);t$X.normalize(this._direction,this._direction)}}}}),Object.defineProperties(e$n.prototype,{id:{get:function(){return this._id}},lightType:{get:function(){return w$i.HEMISPHERE}},skyColor:{get:function(){return e$1S.multiplyByScalar(this._skyColor,this._intensity,this._skyLightColor)},set:function(e){o$1u.defined("skyColor color",e),e$1S.clone(e,this._skyColor)}},groundColor:{get:function(){return e$1S.multiplyByScalar(this._groundColor,this._intensity,this._groundLightColor)},set:function(e){o$1u.defined("groundColor color",e),e$1S.clone(e,this._groundColor)}}}),Object.defineProperties(h$l.prototype,{pointLight:{get:function(){return this._lightList[w$i.POINT]}},spotLight:{get:function(){return this._lightList[w$i.SPOT]}},directionalLight:{get:function(){return this._lightList[w$i.DIRECTIONAL]}},hemisphereLight:{get:function(){return this._lightList[w$i.HEMISPHERE]}},ambientLightColor:{get:function(){return this._ambientLightColor},set:function(e){o$1u.defined("Light source ambientLightColor",e),e$1S.clone(e,this._ambientLightColor),this._enableAmbientLightColor=!0}},sunLightColor:{get:function(){return this._sunLightColor},set:function(e){o$1u.defined("Light source sunLightColor",e),e$1S.clone(e,this._sunLightColor),this._enableSunLightColor=!0}},sunLightON:{get:function(){return this._sunLightON},set:function(e){o$1u.typeOf.bool("Light source sun light on",e),this._sunLightON=e?1:0}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(e){this._visibleDistanceMax=e}}}),h$l.prototype.addLightSource=function(e){var t=this._lightList[e.lightType];return t.set(e.id,e),t.length},h$l.prototype.removeLightSource=function(e){var t=this._lightList[e.lightType];return t.get(e.id)?(t.remove(e.id),t.length):-1},h$l.prototype.updateVisiblities=function(e){var t,i=this._lightList[w$i.POINT].values;for(t=0;t<i.length;t++)i[t].computeVisiblityInCullingVolume(e);for(i=this._lightList[w$i.SPOT].values,t=0;t<i.length;t++)i[t].computeVisiblityInCullingVolume(e)},h$l.prototype.hasChange=function(){return this._changedLightList.values.length>0},h$l.prototype.resetChange=function(){this._changedLightList.removeAll()},h$l.prototype.combineUniformValue=function(){this._pointLightDistanceDecay=[],this._spotLightDistanceDecayCosPenumbra=[];var e,t=this._visibleLightList[w$i.POINT].values,i=t.length;for(e=0;e<i;e++){var r=new o$1k;r.x=t[e].cutoffDistance,r.y=t[e].decay,this._pointLightDistanceDecay.push(r)}var n=this._visibleLightList[w$i.SPOT].values;for(i=n.length,e=0;e<i;e++){var o=new e$25;o.x=n[e].distance,o.y=n[e].decay,o.z=n[e].angleCos,o.w=n[e].penumbraCos,this._spotLightDistanceDecayCosPenumbra.push(o)}},h$l.prototype.createUniformMap=function(){var e={},t=this;return e.uAmbientLightColor=function(){return t.ambientLightColor},e.uSunLightColor=function(){return t.sunLightColor},e.uSunLightON=function(){return t.sunLightON},e.uDirectionalLightDirectionEC=function(){for(var e=[],i=t.directionalLight.values,r=i.length,n=0;n<r;n++)e.push(i[n].directionEC);return e},e.uDirectionalLightColor=function(){for(var e=[],i=t.directionalLight.values,r=i.length,n=0;n<r;n++)e.push(i[n].lightColor);return e},e.uPointLightPositionEC=function(){for(var e=[],i=t._visibleLightList[w$i.POINT].values,r=i.length,n=0;n<r;n++)e.push(i[n].positionEC);return e},e.uPointLightColor=function(){for(var e=[],i=t._visibleLightList[w$i.POINT].values,r=i.length,n=0;n<r;n++)e.push(i[n].lightColor);return e},e.uDirectionalLightDirection=function(){for(var e=[],i=t.directionalLight.values,r=0;r<i.length;r++)e.push(i[r].direction);return e},e.uPointLightDistanceAndDecay=function(){return t._pointLightDistanceDecay},e.uSpotLightColor=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].lightColor);return e},e.uSpotLightPositionEC=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].positionEC);return e},e.uSpotLightPosition=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].position);return e},e.uSpotLightDirection=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].direction);return e},e.uSpotLightDirectionEC=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].directionEC);return e},e.uSpotLightDistanceDecayCosPenumbra=function(){return t._spotLightDistanceDecayCosPenumbra},e.uSpotLightExponent=function(){for(var e=[],i=t._visibleLightList[w$i.SPOT].values,r=i.length,n=0;n<r;n++)e.push(i[n].exponent);return e},e.uSkyColor=function(){for(var e=[],i=t._lightList[w$i.HEMISPHERE].values,r=i.length,n=0;n<r;n++)e.push(i[n].skyColor);return e},e.uGroundColor=function(){for(var e=[],i=t._lightList[w$i.HEMISPHERE].values,r=i.length,n=0;n<r;n++)e.push(i[n].groundColor);return e},e},Object.defineProperties(c$i.prototype,{id:{get:function(){return this._id}},position:{get:function(){return this._sceneMode===P$$.SCENE3D?this._position:this._positionCV},set:function(e){o$1u.defined("point light position",e),this._position=e,this._sceneMode===P$$.COLUMBUS_VIEW&&(this._positionCV=m$1b.convertToColumbusCartesian(this._position))}},color:{get:function(){return this._color},set:function(e){o$1u.defined("point color color",e),this._color=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},intensity:{get:function(){return this._intensity},set:function(e){o$1u.typeOf.number("point light intensity",e),this._intensity=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},cutoffDistance:{get:function(){return this._cutoffDistance},set:function(e){o$1u.typeOf.number("point light cutoffDistance",e),this._cutoffDistance=e}},decay:{get:function(){return this._decay},set:function(e){o$1u.typeOf.number("point light decay",e),this._decay=e}},lightColor:{get:function(){return this._lightColor}},positionEC:{get:function(){return this._positionEC},set:function(e){o$1u.defined("point light positionEC",e),this._positionEC=e}},lightType:{get:function(){return w$i.POINT}},visibleInCullingVolume:{get:function(){return this._visibleInCullingVolume}},sceneMode:{get:function(){return this._sceneMode},set:function(e){o$1u.typeOf.number("point light sceneMode",e),this._sceneMode!==e&&(this._sceneMode=e,this._sceneMode===P$$.COLUMBUS_VIEW&&(this._positionCV=m$1b.convertToColumbusCartesian(this._position)))}}});var h$k=new i$19;function _$l(e,t,i){if(LicenseChecker.LICENSECHECKER.verify("SpotLight"),i=u$Y(i,{}),o$1u.defined("SpotLight Position",e),o$1u.defined("SpotLight target position",t),t$X.equals(e,t))throw new t$Z("position equals targetPosition");this._id=e$1K(),this._position=t$X.clone(e),this._positionCV=new t$X,this._targetPosition=t$X.clone(t),this._targetPositionCV=new t$X,this._color=u$Y(i.color,new e$1S(1,1,1,1)),this._intensity=u$Y(i.intensity,2),this._distance=u$Y(i.distance,100),this._angle=u$Y(i.angle,Math.PI/6),this._penumbra=u$Y(i.penumbra,0),this._exponent=u$Y(i.exponent,10),this._decay=u$Y(i.decay,1),this._direction=new t$X,this._directionEC=new t$X,t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction),this._lightColor=e$1S.multiplyByScalar(this._color,this._intensity,new e$1S),this._angleCos=Math.cos(this._angle),this._penumbraCos=Math.cos(this._angle*(1-this._penumbra)),this._positionEC=new t$X,this._visibleInCullingVolume=1,this._sceneMode=P$$.SCENE3D}c$i.prototype.computeVisiblityInCullingVolume=function(e){return h$k.radius=this._cutoffDistance,h$k.center=this.position,this._visibleInCullingVolume=e.computeVisibility(h$k)!==pt$a.OUTSIDE?1:0,!!this._visibleInCullingVolume},Object.defineProperties(_$l.prototype,{id:{get:function(){return this._id}},position:{get:function(){return this._sceneMode===P$$.SCENE3D?this._position:this._positionCV},set:function(e){o$1u.defined("spot light position",e),!t$X.equals(e,this._targetPosition)&&(this._position=e,this._sceneMode===P$$.COLUMBUS_VIEW?(this._positionCV=m$1b.convertToColumbusCartesian(this._position),t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)):t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction))}},targetPosition:{get:function(){return this._sceneMode===P$$.SCENE3D?this._targetPosition:this._targetPositionCV},set:function(e){o$1u.defined("spot light target position",e),!t$X.equals(e,this._position)&&(this._targetPosition=e,this._sceneMode===P$$.COLUMBUS_VIEW?(this._targetPositionCV=m$1b.convertToColumbusCartesian(this._targetPosition),t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)):t$X.subtract(this._position,this._targetPosition,this._direction),t$X.normalize(this._direction,this._direction))}},color:{get:function(){return this._color},set:function(e){o$1u.defined("spot color color",e),this._color=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},intensity:{get:function(){return this._intensity},set:function(e){o$1u.typeOf.number("spot light intensity",e),this._intensity=e,e$1S.multiplyByScalar(this._color,this._intensity,this._lightColor)}},distance:{get:function(){return this._distance},set:function(e){o$1u.typeOf.number("spot light istance",e),this._distance=e}},angle:{get:function(){return this._angle},set:function(e){o$1u.typeOf.number("spot light angle",e),this._angle=e,this._angleCos=Math.cos(this._angle)}},exponent:{get:function(){return this._exponent},set:function(e){o$1u.typeOf.number("spot light exponent",e),this._exponent=e}},decay:{get:function(){return this._decay},set:function(e){o$1u.typeOf.number("spot light decay",e),this._decay=e}},direction:{get:function(){return this._direction}},lightColor:{get:function(){return this._lightColor}},angleCos:{get:function(){return this._angleCos}},penumbra:{get:function(){return this._penumbra},set:function(e){o$1u.typeOf.number("spot light angle",e),this._penumbra=e,this._penumbraCos=Math.cos(this._angle*(1-this._penumbra))}},penumbraCos:{get:function(){return this._penumbraCos}},positionEC:{get:function(){return this._positionEC},set:function(e){o$1u.defined("spot light positionEC",e),this._positionEC=e}},directionEC:{get:function(){return this._directionEC}},lightType:{get:function(){return w$i.SPOT}},visibleInCullingVolume:{get:function(){return this._visibleInCullingVolume}},sceneMode:{get:function(){return this._sceneMode},set:function(e){if(o$1u.typeOf.number("spot light sceneMode",e),this._sceneMode!==e){if(this._sceneMode=e,this._sceneMode===P$$.COLUMBUS_VIEW){if(this._positionCV=m$1b.convertToColumbusCartesian(this._position),this._targetPositionCV=m$1b.convertToColumbusCartesian(this._targetPosition),t$X.equals(this._positionCV,this._targetPositionCV))return;t$X.subtract(this._positionCV,this._targetPositionCV,this._direction)}else t$X.subtract(this._position,this._targetPosition,this._direction);t$X.normalize(this._direction,this._direction)}}}});var u$k=new i$19;_$l.prototype.computeVisiblityInCullingVolume=function(e){return u$k.radius=this._distance,u$k.center=this.position,this._visibleInCullingVolume=e.computeVisibility(u$k)!==pt$a.OUTSIDE?1:0,!!this._visibleInCullingVolume};var x$r="uniform sampler2D u_floatTexture;\nvoid main()\n{\nfloat actual = texture2D(u_floatTexture, vec2(0.5, 0.5)).r;\nfloat expected = 123456.0;\ngl_FragColor = vec4(abs(actual - expected), 0.0, 0.0, 1.0);\n}\n";function f$n(e){this._context=e}var i$j,R$k=new r$15({primitiveType:W$_.TRIANGLES}),D$p=new r$11({color:new e$1S(0,0,0,0)});function M$o(e,t){return new a$z({context:e,colorTextures:[t],destroyAttachments:!1})}function Q$k(e,t){return S$T.fromCache({context:e,vertexShaderSource:Ee$9,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function F$k(e,t){return(!e$28(i$j)||i$j.viewport.width!==e||i$j.viewport.height!==t)&&(i$j=u$R.fromCache({viewport:new f$10(0,0,e,t)})),i$j}function r$p(e){if(!e.floatingPointTexture)return!1;var t=new f$n(e),i=new L$17({context:e,width:1,height:1,pixelFormat:V$O.RGBA}),r=new L$17({context:e,width:1,height:1,pixelFormat:V$O.RGBA,pixelDatatype:r$p._getFloatPixelType(),source:{width:1,height:1,arrayBufferView:r$p._getArray([123456,0,0,0])}}),n=new a$z({context:e,colorTextures:[i],destroyAttachments:!1}),o={framebuffer:n,x:0,y:0,width:1,height:1},a=!1,s=new t$u({fragmentShaderSource:x$r,outputTexture:i,uniformMap:{u_floatTexture:function(){return r}},persists:!1,postExecute:function(){var t=e.readPixels(o);a=0===t[0]}});return s.execute(t),t.destroy(),n.destroy(),a}function t$e(e){this._renderTexture=new o$B(e),this._renderTexture._pixelDatatype=y$U.UNSIGNED_BYTE,this._context=e,this._isUpdate=!0,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0};var t=e._gl,i=e$28(e._currentFramebuffer)?e._currentFramebuffer._framebuffer:null;t.bindFramebuffer(t.FRAMEBUFFER,i)}function a$n(e){this._context=e,this._frameBuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._upSampleWidth=Math.max(Math.pow(2,Math.ceil(Math.log(e.drawingBufferWidth)/Math.log(10))),8),this._upSampleHeight=Math.max(Math.pow(2,Math.ceil(Math.log(e.drawingBufferHeight)/Math.log(10))),8),this._upSampleViewport=new f$10(0,0,this._upSampleWidth,this._upSampleHeight)}f$n.prototype.execute=function(e){if(o$1u.defined("computeCommand",e),e$28(e.preExecute)&&e.preExecute(e),!e$28(e.fragmentShaderSource)&&!e$28(e.shaderProgram))throw new t$Z("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");o$1u.defined("computeCommand.outputTexture",e.outputTexture);var t=e.outputTexture,i=t.width,r=t.height,n=this._context,o=e$28(e.vertexArray)?e.vertexArray:n.getViewportQuadVertexArray(),a=e$28(e.shaderProgram)?e.shaderProgram:Q$k(n,e.fragmentShaderSource),s=M$o(n,t),l=u$Y(e.renderState,F$k(i,r)),u=e.uniformMap;if(e.clear){var c=D$p;c.framebuffer=s,c.renderState=l,c.execute(n)}var h=R$k;h.vertexArray=o,h.renderState=l,h.shaderProgram=a,h.uniformMap=u,h.framebuffer=s,h.execute(n),s.destroy(),e.persists||(a.destroy(),e$28(e.vertexArray)&&o.destroy()),e$28(e.postExecute)&&e.postExecute(t)},f$n.prototype.isDestroyed=function(){return!1},f$n.prototype.destroy=function(){return i$Z(this)},r$p._getFloatPixelType=function(){return y$U.FLOAT},r$p._getArray=function(e){return new Float32Array(e)},Object.defineProperties(t$e.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},useType:{get:function(){return 32},set:function(e){}},frameBufferType:{get:function(){return L$T.CLAMP}}}),t$e.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this._renderTexture._passState},t$e.prototype.end=function(e){this._isUpdate=!0},t$e.prototype.update=function(e,t){},t$e.prototype.isDestroyed=function(){return!1},t$e.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)};var Q$j=new e$25,U$i=new e$25(1,1/255,1/65025,1/16581375);function C$j(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function v$p(e){e._frameBuffer=e._frameBuffer&&!e._frameBuffer.isDestroyed()&&e._frameBuffer.destroy()}function Y$d(e,t){e._depthTexture=new L$17({context:t,width:e._upSampleWidth,height:e._upSampleHeight,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE})}function q$i(e,t){C$j(e),v$p(e),Y$d(e,t),e._frameBuffer=new a$z({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function J$l(e,t){(!e$28(e._frameBuffer)||!e$28(e._depthTexture))&&q$i(e,t)}function K$h(e,t,i){if(!e$28(e._copyDepthCommand)){e._copyDepthCommand=t.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:u$R.fromCache({viewport:e._upSampleViewport}),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._frameBuffer,e$28(e._clearCommand)||(e._clearCommand=new r$11({color:new e$1S(0,0,0,1),stencil:0,depth:1,owner:e})),e._clearCommand.framebuffer=e._frameBuffer}function i$i(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function b$s(e){const t=Object.keys(e).sort();return JSON.stringify(e,t)}function _$k(e,t){for(var i=t.derivedKeywords,r=i.length,n=0;n<r;++n){var o=i[n]+t.keyword;_$k(e,e._shaders[o])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}function r$o(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}function i$h(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.color=e$28(e.color)?e$1S.clone(e.color):e$1S.WHITE,this.intensity=u$Y(e.intensity,2)}function P$k(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new f$10,this._viewportCartesian4=new e$25,this._viewportDirty=!1,this._viewportOrthographicMatrix=y$15.clone(y$15.IDENTITY),this._viewportTransformation=y$15.clone(y$15.IDENTITY),this._model=y$15.clone(y$15.IDENTITY),this._view=y$15.clone(y$15.IDENTITY),this._inverseView=y$15.clone(y$15.IDENTITY),this._projection=y$15.clone(y$15.IDENTITY),this._infiniteProjection=y$15.clone(y$15.IDENTITY),this._entireFrustum=new o$1k,this._currentFrustum=new o$1k,this._frustumPlanes=new e$25,this._frameState=void 0,this._temeToPseudoFixed=p$1a.clone(y$15.IDENTITY),this._view3DDirty=!0,this._view3D=new y$15,this._inverseView3DDirty=!0,this._inverseView3D=new y$15,this._inverseModelDirty=!0,this._inverseModel=new y$15,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new p$1a,this._viewRotation=new p$1a,this._inverseViewRotation=new p$1a,this._viewRotation3D=new p$1a,this._inverseViewRotation3D=new p$1a,this._inverseProjectionDirty=!0,this._inverseProjection=new y$15,this._modelViewDirty=!0,this._modelView=new y$15,this._modelView3DDirty=!0,this._modelView3D=new y$15,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new y$15,this._inverseModelViewDirty=!0,this._inverseModelView=new y$15,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new y$15,this._viewProjectionDirty=!0,this._viewProjection=new y$15,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new y$15,this._modelViewProjectionDirty=!0,this._modelViewProjection=new y$15,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new y$15,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new y$15,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new y$15,this._mvpViewPortDirty=!0,this._mvpViewPort=new y$15,this._normalDirty=!0,this._normal=new p$1a,this._normal3DDirty=!0,this._normal3D=new p$1a,this._inverseNormalDirty=!0,this._inverseNormal=new p$1a,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new p$1a,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new i$Q,this._cameraPosition=new t$X,this._sunPositionWC=new t$X,this._sunPositionColumbusView=new t$X,this._sunDirectionWC=new t$X,this._sunDirectionEC=new t$X,this._sunColor=new t$X,this._moonDirectionEC=new t$X,this._lightDirectionWC=new t$X,this._lightDirectionEC=new t$X,this._lightColor=new t$X,this._lightColorHdr=new t$X,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new t$X,this._cameraRight=new t$X,this._cameraUp=new t$X,this._frustum2DWidth=0,this._eyeHeight2D=new o$1k,this._resolutionScale=1,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new e$1S,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new o$1k,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=new o$1k,this._globeSplitPosition=new o$1k,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0,this._globeDepthTextureDim=new o$1k,this._silverLightingAtmosphere=void 0,this._hdrEnvMap=void 0,this._toneMappingExposure=1}function A$r(e,t){y$15.clone(t,e._view),y$15.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0,e._mvpViewPortDirty=!0}function Y$c(e,t){y$15.clone(t,e._inverseView),y$15.getRotation(t,e._inverseViewRotation)}function U$h(e){var t=e._frameState;if(e$28(t)&&t.TAAEnable&&"normal"===t._fboState.name){var i=e._projection;i[8]+=t.jitter.x,i[9]+=t.jitter.y}}function k$o(e,t){y$15.clone(t,e._projection),U$h(e),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._mvpViewPortDirty=!0}function G$p(e,t){y$15.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function q$h(e,t){t$X.clone(t.positionWC,e._cameraPosition),t$X.clone(t.directionWC,e._cameraDirection),t$X.clone(t.rightWC,e._cameraRight),t$X.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}a$n.prototype.end=function(e,t,i){for(var r,n=e._context,o=n.drawingBufferWidth,a=n.drawingBufferHeight,s=this._upSampleWidth,l=this._upSampleHeight,u=Math.max(s,l),c=u*u,h=Math.floor(t/o*s),d=Math.floor(i/a*l),f=0,p=0,_=0,m=-1,$=this._frameBuffer,g=n.readPixels({x:0,y:0,width:s,height:l,framebuffer:$}),v=0,y=0;y<c;++y){if(-h<=f&&f<=h&&-d<=p&&p<=d){var x=4*((d-p)*s+f+h);if(r=e$25.unpack(g,x,Q$j),e$25.divideByScalar(r,255,r),(v=e$25.dot(r,U$i))>0&&v<1)break}if(f===p||f<0&&-f===p||f>0&&f===1-p){var b=_;_=-m,m=b}f+=_,p+=m}if(v>0&&v<1&&e._frustumCommandsList.length>0){var w=e._frustumCommandsList[0];e._context.uniformState.updateFrustum(w);var C=new o$1k(t,i);return m$W.drawingBufferToWgs84Coordinates(e,C,v,new t$X)}},a$n.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},a$n.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},a$n.prototype.clear=function(e,t){this._clearCommand.execute(e,t)},a$n.prototype.update=function(e,t){J$l(this,e),K$h(this,e,t)},a$n.prototype.isDestroyed=function(){return!1},a$n.prototype.destroy=function(){return C$j(this),v$p(this),this._copyDepthCommand.shaderProgram=e$28(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i$Z(this)},Object.defineProperties(i$i.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),i$i.prototype.replaceShaderProgram=function(e){return e$28(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)},i$i.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,r=e.attributeLocations,n=e.varyings,o=e.bufferMode;"string"==typeof t&&(t=new a$$({sources:[t]})),"string"==typeof i&&(i=new a$$({sources:[i]}));const a=`${t.getCacheKey(this._context)}:${i.getCacheKey(this._context)}:${e$28(r)?b$s(r):""}`;var s;if(e$28(this._shaders[a]))s=this._shaders[a],delete this._shadersToRelease[a];else{var l=t.createCombinedVertexShader(this._context),u=i.createCombinedFragmentShader(this._context),c=this._context,h=new S$T({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:l,fragmentShaderSource:i,fragmentShaderText:u,attributeLocations:r,varyings:n,bufferMode:o});s={cache:this,shaderProgram:h,keyword:a,derivedKeywords:[],count:0},h._cachedShader=s,this._shaders[a]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},i$i.prototype.replaceDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,o=this._shaders[n];if(e$28(o)){_$k(this,o);var a=r.derivedKeywords.indexOf(t);a>-1&&r.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,i)},i$i.prototype.getDerivedShaderProgram=function(e,t){var i=t+e._cachedShader.keyword,r=this._shaders[i];if(e$28(r))return r.shaderProgram},i$i.prototype.createDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,o=i.vertexShaderSource,a=i.fragmentShaderSource,s=i.attributeLocations,l=i.varyings,u=i.bufferMode;"string"==typeof o&&(o=new a$$({sources:[o]})),"string"==typeof a&&(a=new a$$({sources:[a]}));var c=this._context,h=o.createCombinedVertexShader(c),d=a.createCombinedFragmentShader(c),f=new S$T({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:h,fragmentShaderSource:a,fragmentShaderText:d,attributeLocations:s,varyings:l,bufferMode:u}),p={cache:this,shaderProgram:f,keyword:n,derivedKeywords:[],count:0};return r.derivedKeywords.push(t),f._cachedShader=p,this._shaders[n]=p,f},i$i.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){_$k(this,e[t]),--this._numberOfShaders}this._shadersToRelease={}},i$i.prototype.releaseShaderProgram=function(e){if(e$28(e)){var t=e._cachedShader;t&&0==--t.count&&(this._shadersToRelease[t.keyword]=t)}},i$i.prototype.isDestroyed=function(){return!1},i$i.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i$Z(this)},Object.defineProperties(r$o.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),r$o.prototype.getTexture=function(e){var t=this._textures[e];if(e$28(t))return delete this._texturesToRelease[e],++t.count,t.texture},r$o.prototype.addTexture=function(e,t){var i={texture:t,count:1};t.finalDestroy=t.destroy;var r=this;t.destroy=function(){0==--i.count&&(r._texturesToRelease[e]=i)},this._textures[e]=i,++this._numberOfTextures},r$o.prototype.destroyReleasedTextures=function(){var e=this._texturesToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._textures[t],i.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}},r$o.prototype.isDestroyed=function(){return!1},r$o.prototype.destroy=function(){var e=this._textures;for(var t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return i$Z(this)},Object.defineProperties(P$k.prototype,{toneMappingExposure:{get:function(){return this._toneMappingExposure}},frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!f$10.equals(e,this._viewport)){f$10.clone(e,this._viewport);var t=this._viewport,i=this._viewportCartesian4;i.x=t.x,i.y=t.y,i.z=t.width,i.w=t.height,this._viewportDirty=!0,this._mvpViewPortDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return O$i(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return O$i(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){y$15.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0,this._mvpViewPortDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,y$15.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,y$15.getRotation(this.inverseModel,e),p$1a.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return x$q(this),this._view3D}},viewRotation:{get:function(){return x$q(this),this._viewRotation}},viewRotation3D:{get:function(){return x$q(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return z$i(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return z$i(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return X$a(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return $$g(this),this._modelView}},modelView3D:{get:function(){return S$g(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return si$1(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return ii$1(this),this._inverseModelView}},inverseModelView3D:{get:function(){return ei(this),this._inverseModelView3D}},viewProjection:{get:function(){return ti$1(this),this._viewProjection}},inverseViewProjection:{get:function(){return ni$2(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return oi$1(this),this._modelViewProjection}},mvpViewPort:{get:function(){return ri(this),this._mvpViewPort}},inverseModelViewProjection:{get:function(){return li$2(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return hi$2(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return ci$3(this),this._modelViewInfiniteProjection}},normal:{get:function(){return _i$3(this),this._normal}},normal3D:{get:function(){return ai(this),this._normal3D}},inverseNormal:{get:function(){return ui$2(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Di$3(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},sunColor:{get:function(){return this._sunColor}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return H$n(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return H$n(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},globeSplitPosition:{get:function(){return this._globeSplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},globeDepthTextureDim:{get:function(){return this._globeDepthTextureDim}},hdrEnvMap:{get:function(){return this._hdrEnvMap}}});var M$n=new p$1a,Z$i=new t$W;function J$k(e,t){e$28(m$1b.computeIcrfToFixedMatrix(t.time,M$n))||(M$n=m$1b.computeTemeToPseudoFixedMatrix(t.time,M$n));var i=F$T.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);p$1a.multiplyByVector(M$n,i,i),t$X.normalize(i,e._sunDirectionWC),i=p$1a.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),t$X.normalize(i,i),i=F$T.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),p$1a.multiplyByVector(M$n,i,i),p$1a.multiplyByVector(e.viewRotation3D,i,i),t$X.normalize(i,i);var r=t.mapProjection,n=r.ellipsoid.cartesianToCartographic(e._sunPositionWC,Z$i);r.project(n,e._sunPositionColumbusView)}P$k.prototype.updateCamera=function(e){A$r(this,e.viewMatrix),Y$c(this,e.inverseViewMatrix),q$h(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==P$$.SCENE2D&&e.frustum instanceof a$X},P$k.prototype.updateFrustum=function(e){k$o(this,e.projectionMatrix),e$28(e.infiniteProjectionMatrix)&&G$p(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=e$27.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne,e$28(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},P$k.prototype.updatePass=function(e){this._pass=e},P$k.prototype.updateLightSource=function(e){if(e$28(e)){var t=e.pointLight.values,i=e.spotLight.values,r=e.directionalLight.values,n=e.hemisphereLight.values,o=e._visibleLightList[w$i.POINT],a=e._visibleLightList[w$i.SPOT];o.removeAll(),a.removeAll();var s,l,u,c,h,d=[];for(s=0,l=t.length;s<l;s++){(c=t[s]).sceneMode=this._frameState.mode,y$15.multiplyByPoint(this._view,c.position,c._positionEC),(h=t$X.distance(this._frameState.camera.positionWC,c.position))<e.visibleDistanceMax&&d.push([h,c])}for(d.length>e._visibleCountAllowed&&(d.sort((function(e,t){return e[0]-t[0]})),d=d.slice(0,e._visibleCountAllowed)),u=0;u<d.length;u++)c=d[u][1],o.set(c.id,c);for(d=[],s=0,l=i.length;s<l;s++){(c=i[s]).sceneMode=this._frameState.mode,y$15.multiplyByPoint(this._view,c.position,c._positionEC),p$1a.multiplyByVector(this.viewRotation,c.direction,c._directionEC),t$X.normalize(c._directionEC,c._directionEC),h=t$X.distance(this._frameState.camera.positionWC,c.position),c.computeVisiblityInCullingVolume(this._frameState.cullingVolume)&&h<e.visibleDistanceMax&&d.push([h,c])}for(d.length>e._visibleCountAllowed&&(d.sort((function(e,t){return e[0]-t[0]})),d=d.slice(0,e._visibleCountAllowed)),u=0;u<d.length;u++)c=d[u][1],a.set(c.id,c);for(s=0,l=r.length;s<l;s++)(c=r[s]).sceneMode=this._frameState.mode,p$1a.multiplyByVector(this.viewRotation,c.direction,c._directionEC),t$X.normalize(c._directionEC,c._directionEC);o.length!==e._visiblePointLightCount&&(e._changedLightList.set(w$i.POINT,{count:o.length,type:w$i.POINT}),e._visiblePointLightCount=o.length),a.length!==e._visibleSpotLightCount&&(e._changedLightList.set(w$i.SPOT,{count:a.length,type:w$i.SPOT}),e._visibleSpotLightCount=a.length),r.length!==e._visibleDirectionalLightCount&&(e._changedLightList.set(w$i.DIRECTIONAL,{count:r.length,type:w$i.DIRECTIONAL}),e._visibleDirectionalLightCount=r.length),n.length!==e._visibleHemisphereLightCount&&(e._changedLightList.set(w$i.HEMISPHERE,{count:n.length,type:w$i.HEMISPHERE}),e._visibleHemisphereLightCount=n.length),e.combineUniformValue()}};var K$g=[],Q$i=new i$h;function O$i(e){if(e._viewportDirty){var t=e._viewport;y$15.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),y$15.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1,e._mvpViewPortDirty=!0}}function X$a(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===P$$.SCENE2D||e._mode===P$$.MORPHING||e._orthographicIn3D?y$15.clone(y$15.ZERO,e._inverseProjection):y$15.inverse(e._projection,e._inverseProjection))}function $$g(e){e._modelViewDirty&&(e._modelViewDirty=!1,y$15.multiplyTransformation(e._view,e._model,e._modelView))}function S$g(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,y$15.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function ii$1(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,y$15.inverse(e.modelView,e._inverseModelView))}function ei(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,y$15.inverse(e.modelView3D,e._inverseModelView3D))}function ti$1(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,y$15.multiply(e._projection,e._view,e._viewProjection))}function ni$2(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,y$15.inverse(e.viewProjection,e._inverseViewProjection))}function oi$1(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,y$15.multiply(e._projection,e.modelView,e._modelViewProjection),e._mvpViewPortDirty=!0)}function ri(e){e._mvpViewPortDirty&&(y$15.multiply(e.viewportTransformation,e.modelViewProjection,e._mvpViewPort),e._mvpViewPortDirty=!1)}function si$1(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function li$2(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,y$15.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function hi$2(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,y$15.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function ci$3(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,y$15.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function _i$3(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;y$15.getRotation(e.inverseModelView,t),p$1a.transpose(t,t)}}function ai(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;y$15.getRotation(e.inverseModelView3D,t),p$1a.transpose(t,t)}}function ui$2(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,y$15.getRotation(e.inverseModelView,e._inverseNormal))}function Di$3(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,y$15.getRotation(e.inverseModelView3D,e._inverseNormal3D))}P$k.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,e.context._canvas,this._resolutionScale=e.pixelRatio,this._pixelRatio=e.pixelRatio;var t=e.camera;this.updateCamera(t),e.mode===P$$.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),J$k(this,e);var i=u$Y(e.light,Q$i);i instanceof i$h?(this._lightDirectionWC=t$X.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=t$X.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=t$X.normalize(t$X.negate(i.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=p$1a.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));var r=i.color,n=t$X.fromElements(r.red,r.green,r.blue,this._lightColorHdr);n=t$X.multiplyByScalar(n,i.intensity,n);var o=t$X.maximumComponent(n);o>1?t$X.divideByScalar(n,o,this._lightColor):t$X.clone(n,this._lightColor),this._sunColor=t$X.clone(e.sunColor,this._sunColor);var a=e.brdfLutGenerator;e$28(a)&&a.update(e);var s=e$28(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=u$Y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=u$Y(e.sphericalHarmonicCoefficients,K$g),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._hdrEnvMap=e.hdrEnvMap,this._toneMappingExposure=e.toneMappingExposure,e$28(this._specularEnvironmentMaps)&&o$1k.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=m$1b.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition.x=e.imagerySplitPosition.x*e.context.drawingBufferWidth,this._imagerySplitPosition.y=e.imagerySplitPosition.y*e.context.drawingBufferHeight,this._globeSplitPosition.x=e.globeSplitPosition.x*e.context.drawingBufferWidth,this._globeSplitPosition.y=e.globeSplitPosition.y*e.context.drawingBufferHeight;var l,u=t.frustum.fov,c=this._viewport;l=c.height>c.width?2*Math.tan(.5*u)/c.height:2*Math.tan(.5*u)/c.width,this._geometricToleranceOverMeter=l*e.maximumScreenSpaceError,e$1S.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1),this.updateLightSource(e.lightSource),e$28(this.globeDepthTexture)&&(this._globeDepthTextureDim.x=this.globeDepthTexture.width,this._globeDepthTextureDim.y=this.globeDepthTexture.height)};var W$i=new t$X;function H$n(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,y$15.multiplyByPoint(e.inverseModel,e._cameraPosition,W$i),i$Q.fromCartesian(W$i,e._encodedCameraPositionMC))}var di$2=new t$X,vi$3=new t$X,pi$3=new t$X,wi$3=new t$X,mi$3=new t$W,gi$3=new t$X,yi$3=new y$15;function Pi$3(e,t,i,r,n,o,a,s){var l=di$2;l.x=e.y,l.y=e.z,l.z=e.x;var u=vi$3;u.x=i.y,u.y=i.z,u.z=i.x;var c=pi$3;c.x=r.y,c.y=r.z,c.z=r.x;var h=wi$3;h.x=t.y,h.y=t.z,h.z=t.x,o===P$$.SCENE2D&&(l.z=.5*n);var d=a.unproject(l,mi$3);d.longitude=e$27.clamp(d.longitude,-Math.PI,Math.PI),d.latitude=e$27.clamp(d.latitude,-e$27.PI_OVER_TWO,e$27.PI_OVER_TWO);var f=a.ellipsoid,p=f.cartographicToCartesian(d,gi$3),_=m$1b.eastNorthUpToFixedFrame(p,f,yi$3);return y$15.multiplyByPointAsVector(_,u,u),y$15.multiplyByPointAsVector(_,c,c),y$15.multiplyByPointAsVector(_,h,h),e$28(s)||(s=new y$15),s[0]=u.x,s[1]=c.x,s[2]=-h.x,s[3]=0,s[4]=u.y,s[5]=c.y,s[6]=-h.y,s[7]=0,s[8]=u.z,s[9]=c.z,s[10]=-h.z,s[11]=0,s[12]=-t$X.dot(u,p),s[13]=-t$X.dot(c,p),s[14]=t$X.dot(h,p),s[15]=1,s}function x$q(e){e._view3DDirty&&(e._mode===P$$.SCENE3D?y$15.clone(e._view,e._view3D):Pi$3(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),y$15.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function z$i(e){e._inverseView3DDirty&&(y$15.inverseTransformation(e.view3D,e._inverseView3D),y$15.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function i$g(e){if(this._renderTexture=new o$B(e),this._context=e,this.waterNormalMapUrl=n$17("Assets/Textures/waterNormalsSmall.jpg"),this._waterNormalMapUrl=void 0,this._waterNormalMap=void 0,this._reflectPlane=new o$1i(t$X.UNIT_Z,6378137),this._isUpdate=!0,this._environmentVisible={isSunVisible:!0,isMoonVisible:!0,isSkyAtmosphereVisible:!0,isSkyBoxVisible:!0,isGlobalVisible:!1,isObjectVisible:!0},this.waterNormalMapUrl!==this._waterNormalMapUrl){var t=this.waterNormalMapUrl;if(this._waterNormalMapUrl=t,e$28(t)){var i=this;o$1q(t$D(t),(function(r){if(t===i.waterNormalMapUrl){var n=new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT});i._waterNormalMap=i._waterNormalMap&&i._waterNormalMap.destroy(),i._waterNormalMap=new L$17({context:e,source:r,sampler:n})}}))}else this._waterNormalMap=this._waterNormalMap&&this._waterNormalMap.destroy()}}function r$n(e){this._renderTexture=new o$B(e),this._renderTexture._pixelDatatype=y$U.UNSIGNED_BYTE,this._context=e,this._isUpdate=!1,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0,isBillboardVisible:!1,isOnlyS3MObjectVisible:!0}}function t$d(e){this._renderTexture=new o$B(e),this._renderTexture._pixelDatatype=y$U.FLOAT,this._context=e,this._isUpdate=!1,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0}}function t$c(e){this._renderTexture=new o$B(e),this._renderTexture._passState.blendingEnabled=!1,this._context=e,this._isUpdate=!1,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0,isBillboardVisible:!1,isOnlyS3MObjectVisible:!0}}function Xe$2(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 ke$3(e,t,i,r){for(var n=Xe$2(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function He$8(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new t$U(ke$3(e,t,i,r))}function je$5(e,t,i){return{get:function(){var r=e[t];return i(e,"get: "+t,r),e[t]},set:function(r){e[t]=r,i(e,"set: "+t,r)}}}function Ye$5(e,t){if(!e$28(t))return e;function i(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}var r={};for(var n in e){var o=e[n];o instanceof Function?r[n]=i(o):Object.defineProperty(r,n,je$5(e,n,t))}return r}function l$l(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function qe$3(e,t,i,r){var n=e,o=t;(n>i||o>r)&&(n/i>o/r?(n=i,o=t/e*i):(n=e/t*r,o=r));return{width:n,height:o}}Object.defineProperties(i$g.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},frameBufferType:{get:function(){return L$T.REFLECT}}}),i$g.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=e.camera,r=t.drawingBufferWidth,n=t.drawingBufferHeight,o=this._reflectPlane;return this._renderTexture._passState.viewport.width=r,this._renderTexture._passState.viewport.height=n,i.enableReflection(o),this._oriUseLogDepth=e.useLogDepth,e.useLogDepth=!1,this._renderTexture._passState},i$g.prototype.end=function(e){e.camera.disableReflection(),e.useLogDepth=this._oriUseLogDepth},i$g.prototype.update=function(e,t){},i$g.prototype.isDestroyed=function(){return!1},i$g.prototype.destroy=function(){return this._waterNormalMap=this._waterNormalMap&&this._waterNormalMap.destroy(),this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)},Object.defineProperties(r$n.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},useType:{get:function(){return 8},set:function(e){}},frameBufferType:{get:function(){return L$T.NORMAL_AND_DEPTH}}}),r$n.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this._renderTexture._passState},r$n.prototype.end=function(e){var t=this._context.readPixels({x:e.x,y:e.y,width:e.width,height:e.height,framebuffer:this._renderTexture._fb}),i=new e$25(t[0]/255,t[1]/255,t[2]/255,t[3]/255);if(0!==i.w){var r=t$X.divideByScalar(i,i.w,new t$X);return t$X.subtract(t$X.multiplyByScalar(r,2,new t$X),new t$X(1,1,1),r),t$X.normalize(r,r),r}},r$n.prototype.update=function(e,t){},r$n.prototype.isDestroyed=function(){return!1},r$n.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)},Object.defineProperties(t$d.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},useType:{get:function(){return 16},set:function(e){}},frameBufferType:{get:function(){return L$T.POSTEFFECT_FILTER}}}),t$d.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this._renderTexture._passState},t$d.prototype.end=function(e){},t$d.prototype.update=function(e,t){},t$d.prototype.isDestroyed=function(){return!1},t$d.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)},Object.defineProperties(t$c.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},frameBufferType:{get:function(){return L$T.PICKRECT}}}),t$c.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this.beginFunc&&this.beginFunc.call(this),this._renderTexture._passState},t$c.prototype.end=function(e){},t$c.prototype.update=function(e,t){},t$c.prototype.isDestroyed=function(){return!1},t$c.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)};var ze$5=1073741824;function d$s(e,t){if(typeof WebGLRenderingContext>"u")throw new t$U("The browser does not support WebGL.");o$1u.defined("canvas",e),this._canvas=e;var i=t&&t.monitorTable||{};this._rows=i.rows||1,this._cols=i.cols||1,this._curRow=i.curRow||0,this._curCol=i.curCol||0;var r=e.width*this._cols,n=e.height*this._rows,o=3840,a=1080;e$28(t)&&(o=u$Y(t.maxDrawingBufferWidth,o),a=u$Y(t.maxDrawingBufferHeight,a));var s=qe$3(r,n,o,a);r=s.width,n=s.height,e.maxWidth=o,e.maxHeight=a,e.width=300,e.height=150,(t=u$Y(t=l$1e(t,!0),{})).allowTextureFilterAnisotropic=u$Y(t.allowTextureFilterAnisotropic,!0);var l=u$Y(t.webgl,{});l.alpha=u$Y(l.alpha,!1),l.stencil=u$Y(l.stencil,!0);var u,c=u$Y(t.requestWebgl2,!1)&&typeof WebGL2RenderingContext<"u",h=!1,d=t.getWebGLStub;if(e$28(d))u=d(e,l);else if(c&&(e$28(u=e.getContext("webgl2",l)||e.getContext("experimental-webgl2",l)||void 0)&&(h=!0)),e$28(u)||(u=e.getContext("webgl",l)||e.getContext("experimental-webgl",l)||void 0),!e$28(u))throw new t$U("The browser supports WebGL, but initialization failed.");this.webglOptions=l,e.width=r,e.height=n,this._originalGLContext=u,this._gl=u,this._webgl2=h,this._id=e$1K(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new i$i(this),this._textureCache=new r$o;var f=u;this._stencilBits=f.getParameter(f.STENCIL_BITS),e$1U._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),e$1U._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),e$1U._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),e$1U._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),e$1U._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),e$1U._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),e$1U._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),e$1U._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),e$1U._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),e$1U._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS);var p=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);e$1U._minimumAliasedLineWidth=p[0],e$1U._maximumAliasedLineWidth=p[1];var _=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);e$1U._minimumAliasedPointSize=_[0],e$1U._maximumAliasedPointSize=_[1];var m=f.getParameter(f.MAX_VIEWPORT_DIMS);e$1U._maximumViewportWidth=m[0],e$1U._maximumViewportHeight=m[1];var $=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);e$1U._highpFloatSupported=0!==$.precision;var g=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);e$1U._highpIntSupported=0!==g.rangeMax,h&&(e$1U._uniformBufferOffsetAlignment=f.getParameter(f.UNIFORM_BUFFER_OFFSET_ALIGNMENT),e$1U._maxUniformBufferBinding=f.getParameter(f.MAX_UNIFORM_BUFFER_BINDINGS),e$1U._maxArrayTextureLayers=f.getParameter(f.MAX_ARRAY_TEXTURE_LAYERS)),this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=h||!!l$l(f,["OES_standard_derivatives"]),this._blendMinmax=!!l$l(f,["EXT_blend_minmax"]),this._elementIndexUint=!!l$l(f,["OES_element_index_uint"]),this._depthTexture=!!l$l(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=h||!!l$l(f,["EXT_frag_depth"]),this._debugShaders=l$l(f,["WEBGL_debug_shaders"]);var v=l$l(f,["EXT_shader_texture_lod"]);this._textureFloat=!!l$l(f,["OES_texture_float"]),this._textureHalfFloat=!!l$l(f,["OES_texture_half_float"]),this._textureFloatLinear=!!l$l(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!l$l(f,["OES_texture_half_float_linear"]),this._sysShaderDefines=[],e$28(this._standardDerivatives)&&this._standardDerivatives&&this._sysShaderDefines.push("GL_OES_standard_derivatives"),e$28(this._fragDepth)&&this._fragDepth&&this._sysShaderDefines.push("GL_EXT_frag_depth"),e$28(v)&&this._sysShaderDefines.push("GL_EXT_shader_texture_lod"),h&&this._sysShaderDefines.push("WEBEL2"),this._colorBufferFloat=!!l$l(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!l$l(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!l$l(f,["EXT_color_buffer_half_float"]),this._s3tc=!!l$l(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!l$l(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!l$l(f,["WEBGL_compressed_texture_etc1"]),this._astc=!!l$l(f,["WEBGL_compressed_texture_astc"]),this._etc=!!l$l(f,["WEBG_compressed_texture_etc"]),this._bc7=!!l$l(f,["EXT_texture_compression_bptc"]),f$U.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);var y,x,b,w,C,T,S,E,A,P,I=t.allowTextureFilterAnisotropic?l$l(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;if(this._textureFilterAnisotropic=I,e$1U._maximumTextureFilterAnisotropy=e$28(I)?f.getParameter(I.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,h){var M=this;y=function(){return M._gl.createVertexArray()},x=function(e){M._gl.bindVertexArray(e)},b=function(e){M._gl.deleteVertexArray(e)},w=function(e,t,i,r,n){f.drawElementsInstanced(e,t,i,r,n)},C=function(e,t,i,r){f.drawArraysInstanced(e,t,i,r)},T=function(e,t){f.vertexAttribDivisor(e,t)},S=function(e){f.drawBuffers(e)}}else e$28(E=l$l(f,["OES_vertex_array_object"]))&&(y=function(){return E.createVertexArrayOES()},x=function(e){E.bindVertexArrayOES(e)},b=function(e){E.deleteVertexArrayOES(e)}),e$28(A=l$l(f,["ANGLE_instanced_arrays"]))&&(w=function(e,t,i,r,n){A.drawElementsInstancedANGLE(e,t,i,r,n)},C=function(e,t,i,r){A.drawArraysInstancedANGLE(e,t,i,r)},T=function(e,t){A.vertexAttribDivisorANGLE(e,t)}),e$28(P=l$l(f,["WEBGL_draw_buffers"]))&&(S=function(e){P.drawBuffersWEBGL(e)});this.glCreateVertexArray=y,this.glBindVertexArray=x,this.glDeleteVertexArray=b,this.glDrawElementsInstanced=w,this.glDrawArraysInstanced=C,this.glVertexAttribDivisor=T,this.glDrawBuffers=S,this._vertexArrayObject=!!E,this._instancedArrays=!!A,this._drawBuffers=!!P,e$1U._maximumDrawBuffers=this.drawBuffers?f.getParameter(de$y.MAX_DRAW_BUFFERS):1,e$1U._maximumColorAttachments=this.drawBuffers?f.getParameter(de$y.MAX_COLOR_ATTACHMENTS):1,e$1U._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):1,this._clearColor=new e$1S(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var O=new P$k,D=new n$p(this),R=u$R.fromCache();this._defaultPassState=D,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._defaultTransparentTexture=void 0,this._us=O,this._currentRenderState=R,this._currentPassState=D,this._currentViewport=void 0,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var L=0;L<e$1U._maximumVertexAttributes;L++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=t,this.cache={},this._pickPosition=new Float64Array(3),this._pickPositionHeight=0,this.pixels=new Uint8Array(4),this.shaderPreprocess=!0,this.numNormalAndDepthObject=0,this.numPostEffectFilterObject=0,this.numClampClipPlaneLayer=0,u$R.apply(f,R,D);var B=u$Y(t.fsaaLevel,1);B=Math.max(1,B),this.ssaaLevel=Math.sqrt(B),this.msaaLevel=1,this._webgl2&&(this.msaaLevel=u$Y(t.msaaLevel,1),this.msaaLevel=Math.min(this.msaaLevel,e$1U._maximumSamples)),this._floatTexSixPlaces=r$p(this),this._sharedEDL=this.createSharedEDLFrameBuffer();const N=f.getExtension("WEBGL_debug_renderer_info");if(N){var F=f.getParameter(N.UNMASKED_RENDERER_WEBGL);to._autoSetMaxMemory(F)}this.memorySize=0,this.memoryThreshold=4,this.currentWarnFrameNumber=-99999}var Qe$5={},Q$h;function Ke$4(e){if(e.validateFramebuffer){var t=e._gl,i=t.checkFramebufferStatus(t.FRAMEBUFFER);if(i!==t.FRAMEBUFFER_COMPLETE){var r;switch(i){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:r="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:r="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:r="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:r="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."}throw new t$Z(r)}}}function fe$7(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState,a=e._currentViewport;e._currentRenderState=t,e._currentPassState=i,e._currentViewport=i.viewport,u$R.partialApply(e._gl,n,t,o,i,a,i.viewport,r)}function K$f(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=Q$h;if(e$28(t))t._bind(),Ke$4(e),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}Object.defineProperties(d$s.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},floatTextureSixPlaces:{get:function(){return this._floatTexSixPlaces}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Ye$5(this._originalGLContext,e?He$8:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new L$17({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultTransparentTexture:{get:function(){return void 0===this._defaultTransparentTexture&&(this._defaultTransparentTexture=new L$17({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0,0])},flipY:!1})),this._defaultTransparentTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new X$z({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return Math.floor(this._gl.drawingBufferHeight*this.ssaaLevel)}},drawingBufferWidth:{get:function(){return Math.floor(this._gl.drawingBufferWidth*this.ssaaLevel)}},realDrawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight*this._rows}},realDrawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth*this._cols}},defaultFramebuffer:{get:function(){return Qe$5}},memoryThresholdValue:{get:function(){return this.memoryThreshold*ze$5}}}),typeof WebGLRenderingContext<"u"&&(Q$h=[de$y.BACK]);var Ze$4=new r$11;function Je$3(e,t,i,r,n){if(e$28(t)&&n.depthTest&&n.depthTest.enabled&&!t.hasDepthAttachment)throw new t$Z("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");K$f(e,t),fe$7(e,n,i,!1),r._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,r.maximumTextureUnitIndex)}function $e$3(e,t,i,r){var n=t._primitiveType,o=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;if(!W$_.validate(n))throw new t$Z("drawCommand.primitiveType is required and must be valid.");if(o$1u.defined("drawCommand.vertexArray",o),o$1u.typeOf.number.greaterThanOrEquals("drawCommand.offset",a,0),e$28(s)&&o$1u.typeOf.number.greaterThanOrEquals("drawCommand.count",s,0),o$1u.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new t$Z("Instanced arrays extension is not supported");e._us.model=u$Y(t._modelMatrix,y$15.IDENTITY),i._setUniforms(r,e._us,e.validateShaderProgram),o._bind();var u=o.indexBuffer;e$28(u)?(a*=u.bytesPerIndex,s=u$Y(s,u.numberOfIndices),e._trangleCount+=s/3,0===l?e._gl.drawElements(n,s,u.indexDatatype,a):e.glDrawElementsInstanced(n,s,u.indexDatatype,a,l)):(s=u$Y(s,o.numberOfVertices),0===l?e._gl.drawArrays(n,a,s):e.glDrawArraysInstanced(n,a,s,l)),o._unBind()}d$s.prototype.clear=function(e,t){e=u$Y(e,Ze$4),t=u$Y(t,this._defaultPassState);var i=this._gl,r=0,n=e.color,o=e.depth,a=e.stencil;e$28(n)&&(e$1S.equals(this._clearColor,n)||(e$1S.clone(n,this._clearColor),i.clearColor(n.red,n.green,n.blue,n.alpha)),r|=i.COLOR_BUFFER_BIT),e$28(o)&&(o!==this._clearDepth&&(this._clearDepth=o,i.clearDepth(o)),r|=i.DEPTH_BUFFER_BIT),e$28(a)&&(a!==this._clearStencil&&(this._clearStencil=a,i.clearStencil(a)),r|=i.STENCIL_BUFFER_BIT),fe$7(this,u$Y(e.renderState,this._defaultRenderState),t,!0),K$f(this,u$Y(e.framebuffer,t.framebuffer)),i.clear(r)},d$s.prototype.draw=function(e,t,i,r){o$1u.defined("drawCommand",e),o$1u.defined("drawCommand.shaderProgram",e._shaderProgram),t=u$Y(t,this._defaultPassState);var n=u$Y(e._framebuffer,t.framebuffer),o=u$Y(e._renderState,this._defaultRenderState);i=u$Y(i,e._shaderProgram),r=u$Y(r,e._uniformMap),Je$3(this,n,t,i,o);var a=e._uniformBuffers;if(e$28(a)&&a.length>0)for(var s=0;s<a.length;s++)a[s].bindProgram(i);$e$3(this,e,i,r)},d$s.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=Q$h;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r<i;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},d$s.prototype.readPixels=function(e){var t=this._gl;e=u$Y(e,u$Y.EMPTY_OBJECT);var i=Math.max(u$Y(e.x,0),0),r=Math.max(u$Y(e.y,0),0),n=u$Y(e.width,t.drawingBufferWidth*this.ssaaLevel),o=u$Y(e.height,t.drawingBufferHeight*this.ssaaLevel),a=e.framebuffer;o$1u.typeOf.number.greaterThan("readState.width",n,0),o$1u.typeOf.number.greaterThan("readState.height",o,0);var s=y$U.UNSIGNED_BYTE;e$28(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype);var l=V$O.createTypedArray(V$O.RGBA,s,n,o);return K$f(this,a),t.readPixels(i,r,n,o,V$O.RGBA,s,l),l};var ue$6={position:0,textureCoordinates:1};function Z$h(e,t,i){this._pickObjects=e,this.key=t,this.color=i}let I$t,R$j;d$s.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!e$28(e)){var t=new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:W$_.TRIANGLES});e=m$19.fromGeometry({context:this,geometry:t,attributeLocations:ue$6,bufferUsage:A$1c.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},d$s.prototype.createViewportQuadCommand=function(e,t){return this.createCustomViewportQuadCommand(Ee$9,e,t)},d$s.prototype.createCustomViewportQuadCommand=function(e,t,i){return i=u$Y(i,u$Y.EMPTY_OBJECT),new r$15({vertexArray:this.getViewportQuadVertexArray(),primitiveType:W$_.TRIANGLES,renderState:i.renderState,shaderProgram:S$T.fromCache({context:this,vertexShaderSource:e,fragmentShaderSource:t,attributeLocations:ue$6}),uniformMap:i.uniformMap,owner:i.owner,framebuffer:i.framebuffer,pass:i.pass})},d$s.prototype.createReflectFramebuffer=function(){return new i$g(this)},d$s.prototype.createNormalFramebuffer=function(){return new r$n(this)},d$s.prototype.createPostEffectFilterlFramebuffer=function(){return new t$d(this)},d$s.prototype.createClampFramebuffer=function(){return new t$e(this)},d$s.prototype.createClosedDepthFramebuffer=function(){return new a$n(this)},d$s.prototype.createPickRectFramebuffer=function(){return new t$c(this)},d$s.prototype.createSharedEDLFrameBuffer=function(){return new _0xdced8},d$s.prototype.getObjectByPickColor=function(e){return o$1u.defined("pickColor",e),this._pickObjects[e.toRgba()]},d$s.prototype.getObjectByPickId=function(e){return o$1u.defined("pickId",e),this._pickObjects[e]},Object.defineProperties(Z$h.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),Z$h.prototype.destroy=function(){delete this._pickObjects[this.key]},d$s.prototype.createPickId=function(e){o$1u.defined("object",e),++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new t$U("Out of unique Pick IDs.");return this._pickObjects[t]=e,new Z$h(this._pickObjects,t,e$1S.fromRgba(t))},d$s.prototype.createBillboardPointIndexBuffer=function(){if(!I$t){var e=new Uint16Array(6),t=0;e[t++]=0,e[t++]=1,e[t++]=2,e[t++]=0,e[t++]=2,e[t++]=3,I$t=h$W.createIndexBuffer({context:this,typedArray:e,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),I$t.vertexArrayDestroyable=!1}return I$t},d$s.prototype.createBillboardOffsetVertexBuffer=function(){if(!R$j){var e=new Float32Array([-.5,-.5,.5,-.5,.5,.5,-.5,.5]);R$j=h$W.createVertexBuffer({context:this,typedArray:e,usage:A$1c.STATIC_DRAW}),R$j.vertexArrayDestroyable=!1}return R$j},d$s.prototype.isDestroyed=function(){return!1},d$s.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];e$28(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),this._defaultTransparentTexture=this._defaultTransparentTexture&&this._defaultTransparentTexture.destroy(),i$Z(this)};var E$n="uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n",I$s,c$h,tt$8,rt$8,et$6;function s$h(e){this._depthTexture=void 0,this._framebuffer=void 0,this._copyDepthCommand=void 0,this._viewport=new f$10,this._rs=void 0,this._passState=new n$p(e),this._passState.viewport=this._viewport,this._context=e,this._isUpdate=!1,this._beginFunc=void 0,this._endFunc=void 0,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!1,isUnderGlobeVisible:!1},this._depthTextureToCopy=void 0,this._manualDepth=!0;var t=new n$p(e);t.blendingEnabled=!1,t.viewport=new f$10,this._passState=t}function E$m(e,t,i,r,n){(!e$28(e._framebuffer)||e.width!==r||e.height!==n)&&(e.width=r,e.height=n,e._depthTexture=e._depthTexture&&e._depthTexture.destroy(),e._depthTexture=new L$17({context:t,width:r,height:n,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._framebuffer=new a$z({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1}),t.depthTexture||(e._depthTextureCopyFrom=e._depthTextureCopyFrom&&e._depthTextureCopyFrom.destroy(),e._depthTextureCopyFrom=new L$17({context:t,width:r,height:n,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),e._framebufferCopyFrom=e._framebufferCopyFrom&&e._framebufferCopyFrom.destroy(),e._framebufferCopyFrom=new a$z({context:t,colorTextures:[e._depthTextureCopyFrom],depthStencilRenderbuffer:new o$C({context:t,width:r,height:n,format:M$q.DEPTH_STENCIL}),destroyAttachments:!1})))}function S$f(e,t,i,r){if(e._viewport.width=i,e._viewport.height=r,(!e$28(e._rs)||!f$10.equals(e._viewport,e._rs.viewport))&&(e._rs=u$R.fromCache({viewport:e._viewport})),t.depthTexture)e$28(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(E$n,{uniformMap:{u_depthTexture:function(){return e._depthTextureToCopy}},owner:e}));else{e._copyDepthCommand=t.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",{renderState:u$R.fromCache(),uniformMap:{u_texture:function(){return e._depthTextureToCopy}},owner:e})}e$28(e._clearCommand)||(e._clearCommand=new r$11({color:new e$1S(0,0,0,0),stencil:0,owner:e})),e._copyDepthCommand.renderState=e._rs,e._clearCommand.framebuffer=e._framebuffer,e._copyDepthCommand.framebuffer=e._framebuffer}function C$i(e){this._scene=e,this._startPoint=void 0,this._endPoint=void 0,this._maxHeight=100,this._farDistance=500,this._showBound=!0,this._fbo=void 0,this._readyPromise=o$1q.defer(),this._hintBoundColor=new e$1S(0,1,1,.1),this._hintBoundOutlineColor=new e$1S(1,0,0,1),this._colorCommand=void 0,this._outlineCommand=void 0,this._update=!1,this._name="",this._frameState=void 0,this._visibleViewport=4095,this._buffers=new e$1P}function k$n(e){e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0),e$28(e._outlineCommand)&&(e._outlineCommand.vertexArray=e._outlineCommand.vertexArray&&e._outlineCommand.vertexArray.destroy(),e._outlineCommand.shaderProgram=e._outlineCommand.shaderProgram&&e._outlineCommand.shaderProgram.destroy(),e._outlineCommand=void 0)}function wt$3(e){var t=e._scene.camera,i=t$X.subtract(e._endPoint,e._startPoint,new t$X),r=t$X.midpoint(e._startPoint,e._endPoint,new t$X);t$X.normalize(i,i);var n=t$X.normalize(r,new t$X),o=t$X.cross(n,i,new t$X);t$X.normalize(o,o),t$X.cross(i,o,n),t$X.normalize(n,n);var a=t$X.multiplyByScalar(n,e._maxHeight/2,new t$X),s=new t$X;t$X.clone(r,s),t$X.add(s,a,s);var l=t$X.distance(e._endPoint,e._startPoint),u=1,c=0,h=e._maxHeight;l*e._scene.context.drawingBufferHeight/e._scene.context.drawingBufferWidth<e._maxHeight&&(h=l*e._scene.context.drawingBufferHeight/e._scene.context.drawingBufferWidth,u=Math.ceil(e._maxHeight/h)),e$28(e._fbo)||(e._fbo=new t$g(e._scene.context),e._fbo.environmentVisible.isObjectVisible=!0,e._fbo.environmentVisible.isOnlyS3MObjectVisible=!0,e._fbo._useHeight=!1,e._scene.frameState._framebufferList[e._name]=e._fbo,e._frameState=e._scene._frameState),e._buffers.removeAll(),e._fbo._isUpdate=!0,e._fbo._beginFunc=function(i){e._readyPromise=o$1q.defer(),I$s=t$X.clone(t.position),c$h=t$X.clone(t.direction),tt$8=t$X.clone(t.up),rt$8=t.frustum.clone(new o$15),et$6=i.useLogDepth,i.useLogDepth=!1,t$X.clone(r,s),a=t$X.multiplyByScalar(n,h/2+h*c,new t$X),t$X.add(s,a,s),t.setView({destination:s,orientation:{direction:o,up:n}});var l=new a$X,u=t$X.distance(e._endPoint,e._startPoint);l.width=u,l.near=.01,l.far=e._farDistance,l.aspectRatio=i.context.drawingBufferWidth/i.context.drawingBufferHeight,t.frustum=l,i.context.uniformState.updateFrustum(l)},e._fbo._endFunc=function(i){t.frustum=rt$8,t.setView({destination:I$s,orientation:{direction:c$h,up:tt$8},convert:!1}),i.context.uniformState.updateFrustum(t.frustum),i.useLogDepth=et$6;var r=e._scene._context,n=r.readPixels({x:0,y:0,width:r.drawingBufferWidth,height:r.drawingBufferHeight,framebuffer:e._fbo._renderTexture._fb});if(e._buffers.set(c,n),c++,0==--u){for(var o=new Uint8Array(n.length*e._buffers.length),a=0;a<e._buffers.length;a++)o.set(e._buffers.get(a),n.length*a);var s=document.createElement("canvas");s.height=r.drawingBufferHeight*e._buffers.length,s.width=r.drawingBufferWidth;var l=s.getContext("2d"),d=l.createImageData(s.width,s.height);d.data.set(o),l.putImageData(d,0,0);for(var f=t$X.distance(e._endPoint,e._startPoint)/e._maxHeight,p=i.context.drawingBufferWidth/f,_=l.getImageData(0,0,s.width,s.height),m=e._maxHeight/h-Math.floor(e._maxHeight/h),$=(1-m)*_.height/e._buffers.length,g=0;g<_.height/2;++g)for(var v=0;v<_.width;++v){var y=4*g*_.width+4*v,x=4*(_.height-g)*_.width+4*v,b=_.data[y],w=_.data[y+1],C=_.data[y+2],T=_.data[y+3];_.data[y]=_.data[x],_.data[y+1]=_.data[x+1],_.data[y+2]=_.data[x+2],_.data[y+3]=_.data[x+3],_.data[x]=b,_.data[x+1]=w,_.data[x+2]=C,_.data[x+3]=T,1===e._buffers.length&&g<_.height/2-p/2&&(_.data[y]=0,_.data[y+1]=0,_.data[y+2]=0,_.data[y+3]=0),e._buffers.length>1&&m>0&&g<$&&(_.data[y]=0,_.data[y+1]=0,_.data[y+2]=0,_.data[y+3]=0)}l.clearRect(0,0,_.width,_.height),l.putImageData(_,0,0);var S=s.toDataURL();e._readyPromise.resolve(S),e._fbo._isUpdate=!1}}}function lt$5(e){if(e._showBound){var t=e._scene._context,i=t$X.subtract(e._endPoint,e._startPoint,new t$X),r=t$X.midpoint(e._startPoint,e._endPoint,new t$X);t$X.normalize(i,i);var n=t$X.normalize(r,new t$X),o=t$X.multiplyByScalar(n,e._maxHeight,new t$X),a=t$X.cross(n,i,new t$X);t$X.normalize(a,a);var s=t$X.multiplyByScalar(a,e._farDistance,new t$X),l=new t$X;t$X.add(e._startPoint,s,l);var u=new t$X;t$X.add(e._endPoint,s,u);var c=new t$X;t$X.add(e._startPoint,o,c);var h=new t$X;t$X.add(e._endPoint,o,h);var d=new t$X;t$X.add(u,o,d);var f=new t$X;t$X.add(l,o,f);var p=new y$15,_=new y$15,m=[e._startPoint,e._endPoint,u,l,c,h,d,f];if(e._scene.mode===P$$.COLUMBUS_VIEW){var $=m$1b.convertToColumbusCartesian(e._startPoint);y$15.fromTranslation($,p);var g=t$X.negate($,new t$X);y$15.fromTranslation(g,_),m=m.map((e=>m$1b.convertToColumbusCartesian(e)))}else p=m$1b.eastNorthUpToFixedFrame(e._startPoint),_=y$15.inverse(p,new y$15);e._colorCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:p,pass:Le$p.OPAQUE,owner:e});for(var v=S$W.createTypedArray(S$W.FLOAT,24),y=0;y<m.length;y++){var x=y$15.multiplyByPoint(_,m[y],new t$X);v[3*y]=x.x,v[3*y+1]=x.y,v[3*y+2]=x.z}var b=h$W.createVertexBuffer({context:t,typedArray:v,usage:A$1c.STATIC_DRAW}),w=new a$$({sources:["attribute vec4 aPosition;\nvoid main()\n{\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}\n"]}),C=new a$$({sources:["uniform vec4 uColor;\nvoid main(){\n gl_FragColor = uColor;\n}\n"]}),T=S$T.fromCache({context:t,vertexShaderSource:w,fragmentShaderSource:C,attributeLocations:{aPosition:0}}),S=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),E=[];E.push({index:0,vertexBuffer:b,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:0,normalize:!1});var A=S$W.createTypedArray(S$W.UNSIGNED_SHORT,36);A[0]=0,A[1]=1,A[2]=2,A[3]=0,A[4]=2,A[5]=3,A[6]=4,A[7]=5,A[8]=6,A[9]=4,A[10]=6,A[11]=7,A[12]=0,A[13]=1,A[14]=5,A[15]=0,A[16]=5,A[17]=4,A[18]=3,A[19]=2,A[20]=6,A[21]=3,A[22]=6,A[23]=7,A[24]=3,A[25]=0,A[26]=4,A[27]=3,A[28]=4,A[29]=7,A[30]=1,A[31]=2,A[32]=6,A[33]=1,A[34]=6,A[35]=5;var P=S$W.createTypedArray(S$W.UNSIGNED_SHORT,24);P[0]=0,P[1]=1,P[2]=1,P[3]=2,P[4]=2,P[5]=3,P[6]=3,P[7]=0,P[8]=4,P[9]=5,P[10]=5,P[11]=6,P[12]=6,P[13]=7,P[14]=7,P[15]=4,P[16]=0,P[17]=4,P[18]=1,P[19]=5,P[20]=2,P[21]=6,P[22]=3,P[23]=7;var I=new m$19({context:t,attributes:E,indexBuffer:h$W.createIndexBuffer({context:t,typedArray:A,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})});e._colorCommand.vertexArray=I,e._colorCommand.shaderProgram=T,e._colorCommand.renderState=S,e._colorCommand.uniformMap={uColor:function(){return e._hintBoundColor}},e._outlineCommand=new r$15({primitiveType:W$_.LINES,modelMatrix:p,pass:Le$p.OPAQUE,owner:e}),e._outlineCommand.shaderProgram=T;var M=new m$19({context:t,attributes:E,indexBuffer:h$W.createIndexBuffer({context:t,typedArray:P,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})});e._outlineCommand.vertexArray=M,e._outlineCommand.renderState=S,e._outlineCommand.uniformMap={uColor:function(){return e._hintBoundOutlineColor}}}}Object.defineProperties(s$h.prototype,{framebuffer:{get:function(){return this._framebuffer}},depthTexture:{get:function(){return this._depthTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isManualDepth:{get:function(){return this._manualDepth},set:function(e){this._manualDepth!==e&&(this._manualDepth=e,this._isUpdate=!0)}},useType:{get:function(){return 1},set:function(e){}},frameBufferType:{get:function(){return L$T.DEPTH}}}),s$h.prototype.begin=function(e){var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._passState.viewport.width=i,this._passState.viewport.height=r,E$m(this,t,e,i,r),S$f(this,t,i,r),this._beginFunc&&this._beginFunc(e),t.depthTexture||(e.passes.depth=!0,e.passes.pick=!0,this._passState.framebuffer=this._framebufferCopyFrom),this._passState},s$h.prototype.end=function(e){e.context.depthTexture||(e.passes.depth=!1,e.passes.pick=!1),this._endFunc&&this._endFunc(e)},s$h.prototype.update=function(e,t,i){this._depthTextureToCopy=e.depthTexture?i.depthStencilTexture:this._depthTextureCopyFrom,e$28(this._clearCommand)&&this._clearCommand.execute(e,t),e$28(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},s$h.prototype.destroy=function(){return this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._depthTextureCopyFrom=this._depthTextureCopyFrom&&this._depthTextureCopyFrom.destroy(),this._framebufferCopyFrom=this._framebufferCopyFrom&&this._framebufferCopyFrom.destroy(),e$28(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),this._depthTextureToCopy=void 0,i$Z(this)},s$h.prototype.isDestroyed=function(){return!1},Object.defineProperties(C$i.prototype,{readyPromise:{get:function(){return this._readyPromise}},farDistance:{get:function(){return this._farDistance},set:function(e){this._farDistance=e,this._update=!0}},maxHeight:{get:function(){return this._maxHeight},set:function(e){this._maxHeight=e,this._update=!0}},startPoint:{get:function(){return this._startPoint},set:function(e){this._startPoint=e,this._update=!0}},endPoint:{get:function(){return this._endPoint},set:function(e){this._endPoint=e,this._update=!0}}}),C$i.prototype.clear=function(){this._startPoint=void 0,this._endPoint=void 0,k$n(this)},C$i.prototype.setVisibleInViewport=function(e){if(e>8)throw new DeveloperError("the index is 0~8");this._visibleViewport=1<<e},C$i.prototype.getVisibleInViewport=function(e){if(e>8)throw new DeveloperError("the index is 0~8");return 1<<e&this._visibleViewport},C$i.prototype.destroy=function(){return this.clear(),e$28(this._frameState)&&(e$28(this._fbo)&&delete this._frameState._framebufferList[this._name],this._frameState=void 0),this._fbo=this._fbo&&this._fbo.destroy(),this._scene._analyst3D.remove(this._name,!0),i$Z(this)},C$i.prototype.update=function(e,t,i){!e$28(this._startPoint)||!e$28(this._endPoint)||(this._update&&(k$n(this),wt$3(this),lt$5(this),this._update=!1),this._showBound&&e$28(this._colorCommand)&&e$28(this._outlineCommand)&&!t.passes.pick&&(i.push(this._colorCommand),i.push(this._outlineCommand)))},C$i.prototype.setBoundByPoints=function(e,t){this._startPoint=e,this._endPoint=t,this._update=!0},C$i.prototype.build=function(){""===this._name&&(this._name="facade"+this._scene._analyst3D._layerIndex,this._scene._analyst3D.add(this))};var _0x449f1e=(_0x1e6d6b=!0,function(e,t){var i=_0x1e6d6b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1e6d6b=!1,i}),_0x3ed8c7=_0x449f1e(void 0,(function(){return _0x3ed8c7.toString().search("(((.+)+)+)+$").toString().constructor(_0x3ed8c7).search("(((.+)+)+)+$")})),_0x1e6d6b;_0x3ed8c7();var He$7="attribute vec4 aPosition;\n\nuniform vec4 uDiffuseColor;\n\nvarying vec4 vColor;\nvarying vec4 clip_vertex;\nvarying float fWindowZ;\n\n#ifdef NormalVertex\nvarying vec3 normal_vertex;\n#endif\n\nvec4 depthClampFarPlane(vec4 clipPos)\n{\n\tfWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\n\tclipPos.z = min(clipPos.z, clipPos.w);\n\treturn clipPos;\n}\nvoid main()\n{\n vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n gl_Position = depthClampFarPlane(pos);\n clip_vertex = czm_modelView * vec4(aPosition.xyz, 1.0);\n vColor = uDiffuseColor;\n#ifdef NormalVertex\n normal_vertex = aPosition.xyz;\n#endif\n}",_0xed043c=(_0x20b5e9=!0,function(e,t){var i=_0x20b5e9?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x20b5e9=!1,i}),_0x451675=_0xed043c(void 0,(function(){return _0x451675.toString().search("(((.+)+)+)+$").toString().constructor(_0x451675).search("(((.+)+)+)+$")})),_0x20b5e9;_0x451675();var Ye$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\nvarying vec4 vColor;\nvarying float fWindowZ;\n\n#ifdef NormalVertex\nvarying vec3 normal_vertex;\nconst vec4 LIGHT_COLOR = vec4(0.8, 0.8, 0.8, 1.0);\n#endif\n\nvoid main()\n{\n#ifdef GL_EXT_frag_depth\n\tgl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n#ifdef WEBGL2\n\tgl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n gl_FragColor = vColor;\n#ifdef NormalVertex\n vec3 normal = normalize(czm_computeNormal(normal_vertex));\n vec4 eyePosition = czm_modelView * vec4(normal_vertex.xyz, 1.0);\n vec3 lightDirection = normalize(czm_sunPositionWC - vec3(eyePosition));\n float nDotL = max(dot(lightDirection, normal), 0.0);\n vec4 diffuse = vColor * LIGHT_COLOR * nDotL;\n vec4 ambient = vColor * LIGHT_COLOR;\n gl_FragColor = clamp(diffuse + ambient, vec4(0.0), vec4(1.0));\n#endif\n}";function C$h(e,t){this._positions=e,this._skyline=t,this._command=void 0,this._initialize=!1,this._matWorldMatrix=y$15.IDENTITY.clone(),this._vertexArray=void 0,this._normalArray=void 0,this._texcoordArray=void 0}function ar$1(e,t,i,r){var n=t$X.fromRadians(e.longitude,e.latitude,0),o=t$X.fromRadians(e.longitude,e.latitude,100),a=new e$25(n.x,n.y,n.z,1);y$15.multiplyByVector(t,a,a),e$25.divideByScalar(a,a.w,a),i.push(.5*a.x+.5),i.push(.5*a.y+.5),a=new e$25(o.x,o.y,o.z,1),y$15.multiplyByVector(t,a,a),e$25.divideByScalar(a,a.w,a),r.push(.5*a.x+.5),r.push(.5*a.y+.5)}function d$r(e,t){if(o$1u.defined("context",e),!(e$28(t)&&e$28(t.positiveX)&&e$28(t.negativeX)&&e$28(t.positiveY)&&e$28(t.negativeY)&&e$28(t.positiveZ)&&e$28(t.negativeZ)))throw new t$Z("urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");var i=[t$S.createIfNeeded(t.positiveX).fetchImage(),t$S.createIfNeeded(t.negativeX).fetchImage(),t$S.createIfNeeded(t.positiveY).fetchImage(),t$S.createIfNeeded(t.negativeY).fetchImage(),t$S.createIfNeeded(t.positiveZ).fetchImage(),t$S.createIfNeeded(t.negativeZ).fetchImage()];return o$1q.all(i,(function(t){return new X$z({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})}))}function o$x(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._viewSheds=[],this._boundingSphere=new i$19,this._frameState=void 0,this._update=!0,this._id=0,this._name="",this._sceneName="",this._checking=!1,this._visibleViewport=4095}function v$o(e,t,i,r){if(t._isUpdateCommand){for(var n=[],o=[],a=0;a<r.length;a++)n.push(i[r[a]]._cameraDepthBuffer.depthTexture),o.push(i[r[a]]._renderTextureMatrix);t._colorCommand.uniformMap={uVisibleAreaColor:function(){return t._visibleAreaColor},textureCount:function(){return r.length},uHiddenAreaColor:function(){return t._hiddenAreaColor},uRenderTextureMatrixs:function(){return o},uTexture1_size:function(){var e=t._cameraDepthBuffer.depthTexture;return new o$1k(e.width,e.height)},uTextures:function(){return n},uGlobalDepthTexture:function(){return t._globalDepthBuffer.depthTexture},uGlobeTextureSize:function(){return new o$1k(t._globalDepthBuffer.depthTexture.width,t._globalDepthBuffer.depthTexture.height)}},t._isUpdateCommand=!1}}function m$p(e,t,i){for(var r=e._viewSheds,n=0;n<r.length;n++){for(var o=[],a=[],s=r[n]._boundingSphere,l=0;l<r.length;l++)n!=l&&S$e(s,r[l]._boundingSphere)&&(o.push(r[l]._name),a.push(l));o.length>0&&(o.push(r[n]._name),a.push(n)),t.push(o),i.push(a)}}function S$e(e,t){var i=e.radius,r=t.radius,n=e.center,o=t.center;return t$X.distance(n,o)<i+r}C$h.prototype.destroy=function(){e$28(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy(),this._command=void 0),this._vertexArray=void 0,this._normalArray=void 0,this._texcoordArray=void 0},C$h.prototype.initialize=function(e){if(!this._initialize){e$28(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy(),this._command=void 0),this._typeArray=null,this._initialize=!0;var t=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArray(this._positions)},extrudedHeight:100,granularity:1e-6}),i=U$Q.createGeometry(t);y$15.setTranslation(this._matWorldMatrix,i.boundingSphere.center,this._matWorldMatrix),this._vertexArray=i.attributes.position.values,this._normalArray=i.attributes.normal.values,this._texcoordArray=i.attributes.st.values,this._command=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matWorldMatrix,pass:Le$p.ANALYSIS,boundingVolume:i.boundingSphere,cull:!1});var r={aPosition:0};this._command.vertexArray=m$19.fromGeometry({context:e,geometry:i,attributeLocations:r,bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var n=new a$$({sources:[He$7]}),o=new a$$({sources:[Ye$4]});n.defines.push("NormalVertex"),o.defines.push("NormalVertex"),this._command.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:r}),this._command.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}});var a=new e$25(128/255,1,235/255,1);this._command.uniformMap={uDiffuseColor:function(){return a}}}},C$h.prototype.update=function(e,t){this.initialize(e);var i=e.readPixels({framebuffer:this._skyline._depthBuffer.framebuffer}),r=y$15.IDENTITY.clone();y$15.inverse(this._matWorldMatrix,r);for(var n=e$27.toDegrees(t.positionCartographic.longitude),o=e$27.toDegrees(t.positionCartographic.latitude),a=t.positionCartographic.height,s=this._vertexArray.length/3,l=this._command.vertexArray.getAttribute(0),u=new Float32Array(8*s),c=new e$25,h=new e$25(1,1/255,1/65025,1/160581375),d=e.uniformState,f=d.viewProjection,p=d.inverseViewProjection,_=d.currentFrustum,m=_.x,$=_.y,g=0;g<s;g++){var v=new e$25(this._vertexArray[3*g],this._vertexArray[3*g+1],this._vertexArray[3*g+2],1),y=t$W.fromCartesian(v);if(y.height<50)y$15.multiplyByVector(r,v,v),u[8*g]=v.x,u[8*g+1]=v.y,u[8*g+2]=v.z,u[8*g+3]=this._texcoordArray[2*g],u[8*g+4]=this._texcoordArray[2*g+1],u[8*g+5]=this._normalArray[3*g],u[8*g+6]=this._normalArray[3*g+1],u[8*g+7]=this._normalArray[3*g+2];else{var x=[],b=[];ar$1(y,f,x,b);var w=0;b[0]!=x[0]&&b[1]!=x[1]&&(w=(b[1]-x[1])/(b[0]-x[0]));for(var C=new e$25(0,0,0,1),T=0,S=e.drawingBufferHeight-1;S>-1;S--){var E=0;if(0===w)E=Math.round(x[0]*e.drawingBufferWidth);else{var A=(S/e.drawingBufferHeight-x[1])/w+x[0];E=Math.round(A*e.drawingBufferWidth)}E=e$27.clamp(E,0,e.drawingBufferWidth-1);var P=e.drawingBufferWidth*S+E,I=e$25.unpack(i,4*P,c);if(e$25.divideByScalar(I,255,I),(T=e$25.dot(I,h))>0){C.x=E/e.drawingBufferWidth*2-1,C.y=S/e.drawingBufferHeight*2-1;break}}if(this._skyline._scene.frameState.useLogDepth&&T>0){var M=T*d.log2FarDepthFromNearPlusOne;T=$*(1-m/(Math.pow(2,M)-1+m))/($-m)}T=2*T-1,C.z=T,y$15.multiplyByVector(p,C,C),e$25.divideByScalar(C,C.w,C);var O=t$W.fromCartesian(C);O.longitude=e$27.toDegrees(O.longitude),O.latitude=e$27.toDegrees(O.latitude),y.longitude=e$27.toDegrees(y.longitude),y.latitude=e$27.toDegrees(y.latitude);var D=t$W.sphericalDistance(n,o,O.longitude,O.latitude),R=t$W.sphericalDistance(n,o,y.longitude,y.latitude)/D*(O.height-a)+a,L=t$X.fromDegrees(y.longitude,y.latitude,R);v.x=L.x,v.y=L.y,v.z=L.z,v.w=1,y$15.multiplyByVector(r,v,v),u[8*g]=v.x,u[8*g+1]=v.y,u[8*g+2]=v.z,u[8*g+3]=this._texcoordArray[2*g],u[8*g+4]=this._texcoordArray[2*g+1],u[8*g+5]=this._normalArray[3*g],u[8*g+6]=this._normalArray[3*g+1],u[8*g+7]=this._normalArray[3*g+2]}}l.vertexBuffer.copyFromArrayView(u,0)},Object.defineProperties(o$x.prototype,{ViewShedCount:{get:function(){return this._viewSheds.length}}}),o$x.prototype.addViewShed=function(e){e$28(e)&&this._viewSheds.push(e)},o$x.prototype.getViewShed=function(e){if(this._viewSheds.length<=e)throw new t$Z("index is outrange.");return this._viewSheds[e]},o$x.prototype.removeViewShed=function(e,t){if(this._viewSheds.length<=e)throw new t$Z("index is outrange.");t?this._viewSheds[e].destroy():this._viewSheds[e].clear(),this._viewSheds.splice(e,1)},o$x.prototype.destroy=function(){for(var e=0;e<this._viewSheds.length;e++)this._viewSheds[e].destroy();this._viewSheds=[],this._scene._analyst3D.remove(this._name,!0)},o$x.prototype.clear=function(){for(var e=0;e<this._viewSheds.length;e++)this._viewSheds[e].clear();this._viewSheds=[],this._scene._analyst3D.remove(this._name,!1)},o$x.prototype.build=function(){if(""===this._name&&!this._checking){for(var e=0;e<this._viewSheds.length;e++)""!=this._viewSheds[e]._name?this._scene._analyst3D.add(this._viewSheds[e]):this._viewSheds[e].build();this._name="multiviewshed3d"+this._scene._analyst3D._layerIndex,this._scene._analyst3D.add(this)}},o$x.prototype.update=function(e,t,i){if("normal"===t._fboState.name&&!t.passes.pick&&!t.camera.bReflect){var r=[],n=[];m$p(this,r,n);for(var o=this._viewSheds.length,a=0;a<o;a++){var s=r[a],l=n[a];s.length>0&&(this._viewSheds[a]._setMultiViewShedNames(s),v$o(e,this._viewSheds[a],this._viewSheds,l))}}};class U$g{constructor(){}parse(e){const t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},i=function(e,t,i){t=t||1024;let r=e.pos,n=-1,o=0,a="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));for(;0>(n=s.indexOf("\n"))&&o<t&&r<e.byteLength;)a+=s,o+=s.length,r+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<n&&(!1!==i&&(e.pos+=o+n+1),a+s.slice(0,n))};const r=function(){const e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),r=new Uint32Array(512),n=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,n[e]=24,n[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,n[e]=-t-1,n[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,n[e]=13,n[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,n[e]=24,n[256|e]=24):(r[e]=31744,r[256|e]=64512,n[e]=13,n[256|e]=13)}const o=new Uint32Array(2048),a=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;0==(8388608&t);)t<<=1,i-=8388608;t&=-8388609,i+=947912704,o[e]=t|i}for(let e=1024;e<2048;++e)o[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(s[e]=1024);return{floatView:t,uint32View:i,baseTable:r,shiftTable:n,mantissaTable:o,exponentTable:a,offsetTable:s}}();function n(e){Math.abs(e)>65504&&console.warn("rgbe : toHalfFloat(): Value out of range."),e=function(e,t,i){return Math.max(t,Math.min(i,e))}(e,-65504,65504),r.floatView[0]=e;const t=r.uint32View[0],i=t>>23&511;return r.baseTable[i]+((8388607&t)>>r.shiftTable[i])}const o=function(e,t,i,r){const o=e[t+3],a=Math.pow(2,o-128)/255;i[r+0]=n(Math.min(e[t+0]*a,65504)),i[r+1]=n(Math.min(e[t+1]*a,65504)),i[r+2]=n(Math.min(e[t+2]*a,65504)),i[r+3]=n(1)},a=new Uint8Array(e);a.pos=0;const s=function(e){const r=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,n=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,a=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,s={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let l,u;if(e.pos>=e.byteLength||!(l=i(e)))return t(1,"no header found");if(!(u=l.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(s.valid|=1,s.programtype=u[1],s.string+=l+"\n";l=i(e),!1!==l;)if(s.string+=l+"\n","#"!==l.charAt(0)){if((u=l.match(r))&&(s.gamma=parseFloat(u[1])),(u=l.match(n))&&(s.exposure=parseFloat(u[1])),(u=l.match(o))&&(s.valid|=2,s.format=u[1]),(u=l.match(a))&&(s.valid|=4,s.height=parseInt(u[1],10),s.width=parseInt(u[2],10)),2&s.valid&&4&s.valid)break}else s.comments+=l+"\n";return 2&s.valid?4&s.valid?s:t(3,"missing image size specifier"):t(3,"missing format specifier")}(a);if(-1!==s){const e=s.width,i=s.height,r=function(e,i,r){const n=i;if(n<8||n>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(n!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");const o=new Uint8Array(4*i*r);if(!o.length)return t(4,"unable to allocate buffer space");let a=0,s=0;const l=4*n,u=new Uint8Array(4),c=new Uint8Array(l);let h=r;for(;h>0&&s<e.byteLength;){if(s+4>e.byteLength)return t(1);if(u[0]=e[s++],u[1]=e[s++],u[2]=e[s++],u[3]=e[s++],2!=u[0]||2!=u[1]||(u[2]<<8|u[3])!=n)return t(3,"bad rgbe scanline format");let i,r=0;for(;r<l&&s<e.byteLength;){i=e[s++];const n=i>128;if(n&&(i-=128),0===i||r+i>l)return t(3,"bad scanline data");if(n){const t=e[s++];for(let e=0;e<i;e++)c[r++]=t}else c.set(e.subarray(s,s+i),r),r+=i,s+=i}const d=n;for(let e=0;e<d;e++){let t=0;o[a]=c[e+t],t+=n,o[a+1]=c[e+t],t+=n,o[a+2]=c[e+t],t+=n,o[a+3]=c[e+t],a+=4}h--}return o}(a.subarray(a.pos),e,i);if(-1!==r){let t;const n=r.length/4,a=new Uint16Array(4*n);for(let e=0;e<n;e++)o(r,4*e,a,4*e);return t=a,{width:e,height:i,data:t,header:s.string,gamma:s.gamma,exposure:s.exposure}}}return null}}var mr$1={};function Nr$1(e,t,i){var r,n,o;if(e instanceof o$15){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof l$X?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}var yr=new t$X,pr$1=new t$X;function Sr(e,t,i,r){if(e$28(r)&&i(.5)>r){var n=i(0),o=i(1),a=i(.5),s=a-n,l=a-o;return function(r){var a=i(r);if(r<=.5){var u=(a-n)/s;return e$27.lerp(e,-e$27.PI_OVER_TWO,u)}var c=(a-o)/l;return e$27.lerp(-e$27.PI_OVER_TWO,t,1-c)}}return function(i){return e$27.lerp(e,t,i)}}function er$2(e,t,i,r,n){var o=n,a=Math.max(i,r);if(!e$28(o)){var s=e.position,l=t,u=e.up,c=e.right,h=e.frustum,d=t$X.subtract(s,l,yr),f=t$X.magnitude(t$X.multiplyByScalar(u,t$X.dot(d,u),pr$1)),p=t$X.magnitude(t$X.multiplyByScalar(c,t$X.dot(d,c),pr$1));o=Math.min(.2*Nr$1(h,f,p),1e9)}if(a<o){var _=1e6,m=-Math.pow((o-i)*_,1/8),$=Math.pow((o-r)*_,1/8);return function(e){var t=e*($-m)+m;return-Math.pow(t,8)/_+o}}return function(e){return e$27.lerp(i,r,e)}}function x$p(e,t){return e$27.equalsEpsilon(e,e$27.TWO_PI,e$27.EPSILON11)&&(e=0),t>e+Math.PI?e+=e$27.TWO_PI:t<e-Math.PI&&(e-=e$27.TWO_PI),e}var dr$1=new t$X;function Lr(e,t,i,r,n,o,a){var s=e.camera,l=t$X.clone(s.position,dr$1),u=s.pitch,c=x$p(s.heading,r),h=x$p(s.roll,o),d=er$2(s,i,l.z,i.z,a);return function(e){var a=e.time/t;s.setView({orientation:{heading:e$27.lerp(c,r,a),pitch:e$27.lerp(u,n,a),roll:e$27.lerp(h,o,a)}}),o$1k.lerp(l,i,a,s.position),s.position.z=d(a)}}function Wr(e,t){e.longitude<t.longitude?e.longitude+=e$27.TWO_PI:t.longitude+=e$27.TWO_PI}function zr(e,t){var i=e.longitude-t.longitude;i<-e$27.PI?e.longitude+=e$27.TWO_PI:i>e$27.PI&&(t.longitude+=e$27.TWO_PI)}var br=new t$W,Vr=new t$W;function jr$1(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$,g){var v=e.camera,y=e.mapProjection.ellipsoid,x=t$W.clone(v.positionCartographic,br),b=v.pitch,w=x$p(v.heading,r),C=x$p(v.roll,o),T=y.cartesianToCartographic(i,Vr);x.longitude=e$27.zeroToTwoPi(x.longitude),T.longitude=e$27.zeroToTwoPi(T.longitude);var S=!1;if(e$28(s)){var E=e$27.zeroToTwoPi(s),A=Math.min(x.longitude,T.longitude),P=Math.max(x.longitude,T.longitude),I=E>=A&&E<=P;if(e$28(l)){var M=Math.abs(x.longitude-T.longitude),O=e$27.TWO_PI-M;(I?M:O)<(I?O:M)*l&&!I&&(S=!0)}else I||(S=!0)}S?Wr(x,T):zr(x,T);var D=er$2(v,i,x.height,T.height,a),R=Sr(b,n,D,u);return function(){var i=x.longitude,n=T.longitude,a=x.latitude,s=T.latitude;return function(l){var u,y,x=l.time/t,b=d?v.positionCartographic.height:D(x);if(m!==hi$3.NONE&&e$28(g)){if((u=$._times[g]+l.time)>$._times[$._times.length-1])return;var T=$.evaluate(u),S=t$W.fromCartesian(T);y=t$X.fromRadians(S.longitude,S.latitude,b)}else y=t$X.fromRadians(e$27.lerp(i,n,x),e$27.lerp(a,s,x),b);if(f){var E=t$W.fromCartesian(y),A=e.globe.getHeight(E);if(!e$28(A))return;(b<A||b-A>0&&b-A<p)&&(E.height=A+p,y=t$W.toCartesian(E))}var P=c?v.heading:e$27.lerp(w,r,x),I=h?v.pitch:R(x),M=e$27.lerp(C,o,x);if(_&&(P=c?v.heading:r,M=o),m!==hi$3.NONE&&e$28(g)){var O=u+.001;if(O>$._times[$._times.length-1])v.setView({destination:y,orientation:{heading:P,pitch:I,roll:M}});else{var L=$.evaluate(O),B=t$W.fromCartesian(L);L=t$X.fromRadians(B.longitude,B.latitude,b);var N=new t$X(L.x-y.x,L.y-y.y,L.z-y.z);t$X.normalize(N,N);var F=m$1b.buildUp(y,N);v.setView({destination:y,orientation:{direction:N,up:F}})}}else v.setView({destination:y,orientation:{heading:P,pitch:I,roll:M}})}}()}function Rr(e,t,i,r,n,o,a){var s=e.camera,l=t$X.clone(s.position,dr$1),u=x$p(s.heading,r),c=s.frustum.right-s.frustum.left,h=er$2(s,i,c,i.z,a);return function(e){var n=e.time/t;s.setView({orientation:{heading:e$27.lerp(u,r,n)}}),o$1k.lerp(l,i,n,s.position);var o=h(n),a=s.frustum,c=a.top/a.right,d=.5*(o-(a.right-a.left));a.right+=d,a.left-=d,a.top=c*a.right,a.bottom=-a.top}}var hr$1=new t$W,Ur$1=new t$X;function tr$1(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function gr$1(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}mr$1.createTween=function(e,t){var i=(t=u$Y(t,u$Y.EMPTY_OBJECT)).destination;if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(i))throw new t$Z("destination is required.");var r=e.mode;if(r===P$$.MORPHING)return tr$1();var n=u$Y(t.convert,!0),o=e.mapProjection,a=o.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,c=t.pitchAdjustHeight,h=t.easingFunction,d=t.flyClampToGround,f=t.flyRelativeHeight,p=t.interpolationMode,_=t.catmullRomSpline,m=t.preStopIndex;n&&r!==P$$.SCENE3D&&(a.cartesianToCartographic(i,hr$1),i=o.project(hr$1,Ur$1));var $=e.camera,g=t.endTransform;e$28(g)&&$._setTransform(g);var v=t.duration;e$28(v)||(v=Math.ceil(t$X.distance($.position,i)/1e6)+2,v=Math.min(v,3));var y=u$Y(t.heading,0),x=u$Y(t.pitch,-e$27.PI_OVER_TWO),b=u$Y(t.roll,0),w=u$Y(t.headingFree,!1),C=u$Y(t.pitchFree,!1),T=u$Y(t.altitudeFree,!1),S=u$Y(t.directTurning,!1),E=e.screenSpaceCameraController;E.enableInputs=t.headingFree||t.pitchFree||t.altitudeFree;var A=gr$1(E,t.complete),P=gr$1(E,t.cancel),I=$.frustum,M=e.mode===P$$.SCENE2D;if(M=(M=(M=(M=M&&o$1k.equalsEpsilon($.position,i,e$27.EPSILON6))&&e$27.equalsEpsilon(Math.max(I.right-I.left,I.top-I.bottom),i.z,e$27.EPSILON6))||e.mode!==P$$.SCENE2D&&t$X.equalsEpsilon(i,$.position,e$27.EPSILON10))&&e$27.equalsEpsilon(e$27.negativePiToPi(y),e$27.negativePiToPi($.heading),e$27.EPSILON10)&&e$27.equalsEpsilon(e$27.negativePiToPi(x),e$27.negativePiToPi($.pitch),e$27.EPSILON10)&&e$27.equalsEpsilon(e$27.negativePiToPi(b),e$27.negativePiToPi($.roll),e$27.EPSILON10))return tr$1(A,P);var O=new Array(4);if(O[P$$.SCENE2D]=Rr,O[P$$.SCENE3D]=jr$1,O[P$$.COLUMBUS_VIEW]=Lr,v<=0){return tr$1((function(){O[r](e,1,i,y,x,b,s,l,u,c)({time:1}),"function"==typeof A&&A()}),P)}var D=O[r](e,v,i,y,x,b,s,l,u,c,w,C,T,d,f,S,p,_,m);if(!e$28(h)){var R=$.positionCartographic.height;h=R>(r===P$$.SCENE3D?a.cartesianToCartographic(i).height:i.z)&&R>11500?m$S.CUBIC_OUT:m$S.QUINTIC_IN_OUT}return{duration:v,easingFunction:h,startObject:{time:0},stopObject:{time:v},update:D,complete:A,cancel:P}};var e$m={ROTATE:0,INFINITE_SCROLL:1},Jt$1=Object.freeze(e$m);function v$n(e){if(!e$28(e))throw new t$Z("scene is required.");this._scene=e,this._transform=y$15.clone(y$15.IDENTITY),this._invTransform=y$15.clone(y$15.IDENTITY),this._actualTransform=y$15.clone(y$15.IDENTITY),this._actualInvTransform=y$15.clone(y$15.IDENTITY),this._transformChanged=!1,this.position=new t$X,this._position=new t$X,this._positionWC=new t$X,this._positionCartographic=new t$W,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.direction=new t$X,this._direction=new t$X,this._directionWC=new t$X,this.up=new t$X,this._up=new t$X,this._upWC=new t$X,this.right=new t$X,this._right=new t$X,this._rightWC=new t$X,this.frustum=new o$15,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=e$27.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new o$1o,this._moveEnd=new o$1o,this._changed=new o$1o,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._refinePercentageChanged=.001,this._viewMatrix=new y$15,this._invViewMatrix=new y$15,zt$1(this),this._mode=P$$.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new t$W(Math.PI,e$27.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,Xt$1(this,v$n.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=t$X.magnitude(this.position);i+=i*v$n.DEFAULT_VIEW_FACTOR,t$X.normalize(this.position,this.position),t$X.multiplyByScalar(this.position,i,this.position),this.bReflect=!1,this._bReflect=!1,this._reflectMatrix=new y$15,this._reflectPosition=new t$X,this._reflectUp=new t$X,this._reflectDirection=new t$X,this._reflectRight=new t$X,this._isFlyCircle=!1,this._flyCircleCenter=new t$X,this._flyCircleLoop=!1,this._isResetFlyCircleParm=!1,this._speedRatio=1,this._flyClampToGround=!1,this._flyRelativeHeight=10,this._sensitivePosition=void 0,this._sensitivePositionRatio=0,this._sensitiveRegionRatio=0,this._endLevel=22,this._stateChanged=!0,this._preciseSensitivePosition=!1,this._enableIndoorColliDetection=!1,this.zoomLevel=1}function zt$1(e){y$15.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y$15.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),e.bReflect&&y$15.multiply(e._viewMatrix,e._reflectMatrix,e._viewMatrix),y$15.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function ui$1(e){if(e$28(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;var t=t$X.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=t$X.magnitude(t),e._oldPositionWC=t$X.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=kt$7()):e.timeSinceMoved=Math.max(kt$7()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=t$X.clone(e.positionWC,e._oldPositionWC)}v$n.TRANSFORM_2D=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),v$n.TRANSFORM_2D_INVERSE=y$15.inverseTransformation(v$n.TRANSFORM_2D,new y$15),v$n.DEFAULT_VIEW_RECTANGLE=h$10.fromDegrees(70,0,140,60),v$n.DEFAULT_VIEW_FACTOR=.5,v$n.DEFAULT_OFFSET=new a$S(0,-e$27.PI_OVER_FOUR,0),v$n.prototype.canPreloadFlight=function(){return e$28(this._currentFlight)&&this._mode!==P$$.SCENE2D},v$n.prototype._updateCameraChanged=function(){var e=this;if(ui$1(e),this._stateChanged=!1,0!==e._changed.numberOfListeners){var t=e.percentageChanged,i=e._refinePercentageChanged;if(e._mode===P$$.SCENE2D){if(!e$28(e._changedFrustum))return e._changedPosition=t$X.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,a=e.frustum,s=e._changedFrustum,l=n.x+a.left,u=n.x+a.right,c=o.x+s.left,h=o.x+s.right,d=n.y+a.bottom,f=n.y+a.top,p=o.y+s.bottom,_=o.y+s.top,m=Math.max(l,c),$=Math.min(u,h),g=Math.max(d,p),v=Math.min(f,_);if(m>=$||g>=f)r=1;else{var y=s;l<c&&u>h&&d<p&&f>_&&(y=a),r=1-($-m)*(v-g)/((y.right-y.left)*(y.top-y.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=t$X.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!e$28(e._changedDirection))return e._changedPosition=t$X.clone(e.positionWC,e._changedPosition),void(e._changedDirection=t$X.clone(e.directionWC,e._changedDirection));var x,b=e$27.acosClamped(t$X.dot(e.directionWC,e._changedDirection));x=e$28(e.frustum.fovy)?b/(.5*e.frustum.fovy):b;var w=t$X.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(x>t||w>t)&&(e._changed.raiseEvent(Math.max(x,w)),e._changedPosition=t$X.clone(e.positionWC,e._changedPosition),e._changedDirection=t$X.clone(e.directionWC,e._changedDirection)),(x>i||w>i)&&(e._changed.raiseEvent(Math.max(x,w)),this._stateChanged=!0,e._changedPosition=t$X.clone(e.positionWC,e._changedPosition),e._changedDirection=t$X.clone(e.directionWC,e._changedDirection))}};var ci$2=new y$15,fi$1=new t$W;function di$1(e){m$1b.basisTo2D(e._projection,e._transform,e._actualTransform)}v$n.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,i=t.enableCollisionDetection,r=t.minimumCollisionTerrainHeight,n=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&i){var o=this._mode,a=e.globe;if(e$28(a)&&o!==P$$.SCENE2D&&o!==P$$.MORPHING){var s,l,u=a.ellipsoid,c=e.mapProjection;y$15.equals(this.transform,y$15.IDENTITY)||(s=y$15.clone(this.transform,ci$2),l=t$X.magnitude(this.position),this._setTransform(y$15.IDENTITY));var h=fi$1;o===P$$.SCENE3D?u.cartesianToCartographic(this.position,h):c.unproject(this.position,h);var d=!1;if(h.height<r){var f=a.getHeight(h);e$28(f)&&(f+=n,h.height<f&&(h.height=f,o===P$$.SCENE3D?u.cartographicToCartesian(h,this.position):c.project(h,this.position),d=!0))}e$28(s)&&(this._setTransform(s),d&&(t$X.normalize(this.position,this.position),t$X.negate(this.position,this.direction),t$X.multiplyByScalar(this.position,Math.max(l,n),this.position),t$X.normalize(this.direction,this.direction),t$X.cross(this.direction,this.up,this.right),t$X.cross(this.right,this.direction,this.up)))}}};var li$1=new t$W,vi$2=new t$X,ut$5=new t$X,pi$2=new e$25,gi$2=new e$25,_i$2=new e$25,mi$2=new e$25,Ci$2=new e$25;function yi$2(e){var t=e._projection,i=t.ellipsoid,r=y$15.getColumn(e._transform,3,pi$2),n=i.cartesianToCartographic(r,li$1),o=t.project(n,vi$2),a=gi$2;a.x=o.z,a.y=o.x,a.z=o.y,a.w=1;var s=e$25.clone(e$25.UNIT_X,Ci$2),l=e$25.add(y$15.getColumn(e._transform,0,ut$5),r,ut$5);i.cartesianToCartographic(l,n),t.project(n,o);var u=_i$2;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,t$X.subtract(u,a,u),u.x=0;var c=mi$2;if(t$X.magnitudeSquared(u)>e$27.EPSILON10)t$X.cross(s,u,c);else{var h=e$25.add(y$15.getColumn(e._transform,1,ut$5),r,ut$5);i.cartesianToCartographic(h,n),t.project(n,o),c.x=o.z,c.y=o.x,c.z=o.y,c.w=0,t$X.subtract(c,a,c),c.x=0,t$X.magnitudeSquared(c)<e$27.EPSILON10&&(e$25.clone(e$25.UNIT_Y,u),e$25.clone(e$25.UNIT_Z,c))}t$X.cross(c,s,u),t$X.normalize(u,u),t$X.cross(s,u,c),t$X.normalize(c,c),y$15.setColumn(e._actualTransform,0,u,e._actualTransform),y$15.setColumn(e._actualTransform,1,c,e._actualTransform),y$15.setColumn(e._actualTransform,2,s,e._actualTransform),y$15.setColumn(e._actualTransform,3,a,e._actualTransform)}var Tt$3=new t$X;function D$o(e){var t=e._mode,i=!1,r=0;t===P$$.SCENE2D&&(i=(r=e.frustum.right-e.frustum.left)!==e._positionCartographic.height);var n=e._position,o=!t$X.equals(n,e.position)||i;o&&(n=t$X.clone(e.position,e._position));var a=e._direction,s=!t$X.equals(a,e.direction);s&&(t$X.normalize(e.direction,e.direction),a=t$X.clone(e.direction,e._direction));var l=e._up,u=!t$X.equals(l,e.up);u&&(t$X.normalize(e.up,e.up),l=t$X.clone(e.up,e._up));var c=e._right,h=!t$X.equals(c,e.right);h&&(t$X.normalize(e.right,e.right),c=t$X.clone(e.right,e._right));var d=!1;e.bReflect!=e._bReflect&&(e._bReflect=e.bReflect,d=!0);var f=e._transformChanged||e._modeChanged;e._transformChanged=!1,f&&(y$15.inverseTransformation(e._transform,e._invTransform),e._mode===P$$.COLUMBUS_VIEW||e._mode===P$$.SCENE2D?y$15.equals(y$15.IDENTITY,e._transform)?y$15.clone(v$n.TRANSFORM_2D,e._actualTransform):e._mode===P$$.COLUMBUS_VIEW?di$1(e):yi$2(e):y$15.clone(e._transform,e._actualTransform),y$15.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var p=e._actualTransform;if(o||f)if(e._positionWC=y$15.multiplyByPoint(p,n,e._positionWC),t===P$$.SCENE3D||t===P$$.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var _=Tt$3;_.x=e._positionWC.y,_.y=e._positionWC.z,_.z=e._positionWC.x,t===P$$.SCENE2D&&(_.z=r),e._projection.unproject(_,e._positionCartographic)}if(s||u||h){var m=t$X.dot(a,t$X.cross(l,c,Tt$3));if(Math.abs(1-m)>e$27.EPSILON2){var $=1/t$X.magnitudeSquared(l),g=t$X.dot(l,a)*$,v=t$X.multiplyByScalar(a,g,Tt$3);l=t$X.normalize(t$X.subtract(l,v,e._up),e._up),t$X.clone(l,e.up),c=t$X.cross(a,l,e._right),t$X.clone(c,e.right)}}(s||f)&&(e._directionWC=y$15.multiplyByPointAsVector(p,a,e._directionWC),t$X.normalize(e._directionWC,e._directionWC)),(u||f)&&(e._upWC=y$15.multiplyByPointAsVector(p,l,e._upWC),t$X.normalize(e._upWC,e._upWC)),(h||f)&&(e._rightWC=y$15.multiplyByPointAsVector(p,c,e._rightWC),t$X.normalize(e._rightWC,e._rightWC)),(o||s||u||h||f||d)&&zt$1(e)}function bt$2(e,t){var i;return i=e$27.equalsEpsilon(Math.abs(e.z),1,e$27.EPSILON3)?Math.atan2(t.y,t.x)-e$27.PI_OVER_TWO:Math.atan2(e.y,e.x)-e$27.PI_OVER_TWO,e$27.TWO_PI-e$27.zeroToTwoPi(i)}function Bt$2(e){return e$27.PI_OVER_TWO-e$27.acosClamped(e.z)}function Lt$3(e,t,i){var r=0;return e$27.equalsEpsilon(Math.abs(e.z),1,e$27.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=e$27.zeroToTwoPi(r+e$27.TWO_PI)),r}var ct$4=new y$15,ft$4=new y$15;Object.defineProperties(v$n.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return D$o(this),this._invTransform}},viewMatrix:{get:function(){return D$o(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return D$o(this),this._invViewMatrix}},positionCartographic:{get:function(){return D$o(this),this._positionCartographic}},positionWC:{get:function(){return D$o(this),this._positionWC}},directionWC:{get:function(){return D$o(this),this._directionWC}},upWC:{get:function(){return D$o(this),this._upWC}},rightWC:{get:function(){return D$o(this),this._rightWC}},heading:{get:function(){if(this._mode!==P$$.MORPHING){var e=this._projection.ellipsoid,t=y$15.clone(this._transform,ct$4),i=m$1b.eastNorthUpToFixedFrame(this.positionWC,e,ft$4);this._setTransform(i);var r=bt$2(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==P$$.MORPHING){var e=this._projection.ellipsoid,t=y$15.clone(this._transform,ct$4),i=m$1b.eastNorthUpToFixedFrame(this.positionWC,e,ft$4);this._setTransform(i);var r=Bt$2(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==P$$.MORPHING){var e=this._projection.ellipsoid,t=y$15.clone(this._transform,ct$4),i=m$1b.eastNorthUpToFixedFrame(this.positionWC,e,ft$4);this._setTransform(i);var r=Lt$3(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}},flyCircleLoop:{set:function(e){this._flyCircleLoop!==e&&(this._isResetFlyCircleParm=!0),this._flyCircleLoop=e},get:function(){return this._flyCircleLoop}},speedRatio:{get:function(){return this._speedRatio},set:function(e){this._speedRatio=e}},flyClampToGround:{set:function(e){this._flyClampToGround=e},get:function(){return this._flyClampToGround}},flyRelativeHeight:{set:function(e){this._flyRelativeHeight=e},get:function(){return this._flyRelativeHeight}},sensitivePositionRatio:{set:function(e){this._sensitivePositionRatio=e$27.clamp(e,0,1)},get:function(){return this._sensitivePositionRatio}},preciseSensitivePosition:{set:function(e){e$28(e)&&"boolean"==typeof e&&(this._preciseSensitivePosition=e)},get:function(){return this._preciseSensitivePosition}},sensitiveRegionRatio:{set:function(e){this._sensitiveRegionRatio=e},get:function(){return this._sensitiveRegionRatio}}}),v$n.prototype._computeSensitivePosition=function(){if(this._scene.mode===P$$.SCENE3D){var e=this._scene.canvas,t=this._scene.frameState;dt$5.x=e.clientWidth/2,dt$5.y=e.clientHeight/2;var i=void 0;if(e$28(this._scene.globe)&&this._preciseSensitivePosition&&(e$28(i=this._scene.pickPositionWorldCoordinates(dt$5,wi$2,!0))&&(this._sensitivePosition=i)),!e$28(i)){var r=this.getPickRay(dt$5),n=t$V.WGS84;e$28(t.averageTerrainHeight)&&0!=t.averageTerrainHeight&&(n=new t$V(e$27.Radius+t.averageTerrainHeight,e$27.Radius+t.averageTerrainHeight,e$27.Radius+t.averageTerrainHeight));var o=g$10.rayEllipsoid(r,n);if(e$28(o)){Et$3.x=e.clientWidth/2,Et$3.y=0;var a=this.getPickRay(Et$3);if(e$28(g$10.rayEllipsoid(a,n)))this._sensitivePosition=f$18.getPoint(r,o.start);else{var s,l=t$X.magnitude(this.position);s=l<e$27.Radius?e$27.PI_OVER_TWO:Math.asin(e$27.Radius/l);var u=new f$18(this.position,new t$X(-this.position.x,-this.position.y,-this.position.z)),c=new t$X(u.origin.x+u.direction.x,u.origin.y+u.direction.y,u.origin.z+u.direction.z),h=new t$X(r.origin.x+r.direction.x,r.origin.y+r.direction.y,r.origin.z+r.direction.z),d=t$X.distance(c,h),f=2*Math.asin(.5*d),p=(.5*this.frustum.fov-(s-f))/this.frustum.fov,_=e.clientHeight*(1+p)*.5;if(!Number.isNaN(_)){var m=new o$1k(.5*e.clientWidth,_),$=this.getPickRay(m),g=g$10.rayEllipsoid($,n);e$28(g)?this._sensitivePosition=f$18.getPoint($,g.start):this._sensitivePosition=void 0}}}else this._sensitivePosition=void 0}var v=t._quadtree;if(e$28(v)){_=t.context.drawingBufferHeight;var y=this.frustum.sseDenominator;if(this._positionCartographic.height,e$28(this._sensitivePosition)){var x=t$X.distance(this.positionWC,this._sensitivePosition),b=v._tileProvider.getLevelMaximumGeometricError(0);this.zoomLevel=e$27.log2(b*_/(2*v.maximumScreenSpaceError*x*y))}}}};var Et$3=new o$1k,dt$5=new o$1k,wi$2=new t$X;v$n.prototype.update=function(e){if(!e$28(e))throw new t$Z("mode is required.");if(e===P$$.SCENE2D&&!(this.frustum instanceof l$$))throw new t$Z("An OrthographicOffCenterFrustum is required in 2D.");if(!(e!==P$$.SCENE3D&&e!==P$$.COLUMBUS_VIEW||this.frustum instanceof o$15||this.frustum instanceof a$X))throw new t$Z("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==P$$.MORPHING,t=this._mode===P$$.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone();if(!(i instanceof l$$))throw new t$Z("The camera frustum is expected to be orthographic for 2D camera control.");var r=i.top/i.right;i.right=2*this._maxCoord.x,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top}this._mode===P$$.SCENE2D&&jt(this,this.position);var n=this._scene.globe,o=!e$28(n)||n._surface.tileProvider.ready&&0===n._surface._tileLoadQueueHigh.length&&0===n._surface._tileLoadQueueMedium.length&&0===n._surface._tileLoadQueueLow.length&&0===n._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!o),o&&this._adjustHeightForTerrain(),this._isFlyCircle&&this._flyCircle(this._flyCircleCenter)};var Ti$2=new t$X,Ei$2=new t$X,Pi$2=new t$X;v$n.prototype._setTransform=function(e){var t=t$X.clone(this.positionWC,Ti$2),i=t$X.clone(this.upWC,Ei$2),r=t$X.clone(this.directionWC,Pi$2);y$15.clone(e,this._transform),this._transformChanged=!0,D$o(this);var n=this._actualInvTransform;y$15.multiplyByPoint(n,t,this.position),y$15.multiplyByPointAsVector(n,r,this.direction),y$15.multiplyByPointAsVector(n,i,this.up),t$X.cross(this.direction,this.up,this.right),D$o(this)};var Ri$2=new o$1k,Si$2=new f$18,Mi$2=new t$X,Ii$2=new t$X;v$n.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof a$X&&(e||!(this._positionCartographic.height<15e4))){if(!y$15.equals(y$15.IDENTITY,this.transform))return void(this.frustum.width=t$X.magnitude(this.position));var t,i,r=this._scene,n=r.globe;if(e$28(n)){var o=Ri$2;o.x=r.drawingBufferWidth/2,o.y=r.drawingBufferHeight/2;var a=this.getPickRay(o,Si$2);if(t=n.pickWorldCoordinates(a,r,Mi$2),r.pickPositionSupported&&(i=r.pickPositionWorldCoordinates(o,Ii$2)),e$28(t)&&e$28(i)){var s=e$28(i)?t$X.distance(i,this.positionWC):Number.POSITIVE_INFINITY,l=e$28(t)?t$X.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(s,l)}else e$28(i)?this.frustum.width=t$X.distance(i,this.positionWC):e$28(t)&&(this.frustum.width=t$X.distance(t,this.positionWC))}if(!e$28(n)||!e$28(t)&&!e$28(i)){var u=Math.max(this.positionCartographic.height,0);this.frustum.width=u}}};var lt$4=new t$X,Pt$4=new y$15,Wi$1=new y$15,Rt$2=new n$14,St$2=new p$1a,Ht$1=new t$W;function Di$2(e,t,i){var r=y$15.clone(e.transform,Pt$4),n=m$1b.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Wi$1);e._setTransform(n),t$X.clone(t$X.ZERO,e.position),i.heading=i.heading-e$27.PI_OVER_TWO;var o=n$14.fromHeadingPitchRoll(i,Rt$2),a=p$1a.fromQuaternion(o,St$2);p$1a.getColumn(a,0,e.direction),p$1a.getColumn(a,2,e.up),t$X.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function xi$2(e,t,i,r){var n=y$15.clone(e.transform,Pt$4);if(e._setTransform(y$15.IDENTITY),!t$X.equals(t,e.positionWC)){if(r){var o=e._projection,a=o.ellipsoid.cartesianToCartographic(t,Ht$1);t=o.project(a,lt$4)}t$X.clone(t,e.position)}i.heading=i.heading-e$27.PI_OVER_TWO;var s=n$14.fromHeadingPitchRoll(i,Rt$2),l=p$1a.fromQuaternion(s,St$2);p$1a.getColumn(l,0,e.direction),p$1a.getColumn(l,2,e.up),t$X.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function Oi$1(e,t,i,r){var n=y$15.clone(e.transform,Pt$4);if(e._setTransform(y$15.IDENTITY),!t$X.equals(t,e.positionWC)){if(r){var o=e._projection,a=o.ellipsoid.cartesianToCartographic(t,Ht$1);t=o.project(a,lt$4)}o$1k.clone(t,e.position);var s=.5*-t.z,l=-s,u=e.frustum;if(l>s){var c=u.top/u.right;u.right=l,u.left=s,u.top=u.right*c,u.bottom=-u.top}}if(e._scene.mapMode2D===Jt$1.ROTATE){i.heading=i.heading-e$27.PI_OVER_TWO,i.pitch=-e$27.PI_OVER_TWO,i.roll=0;var h=n$14.fromHeadingPitchRoll(i,Rt$2),d=p$1a.fromQuaternion(h,St$2);p$1a.getColumn(d,2,e.up),t$X.cross(e.direction,e.up,e.right)}e._setTransform(n)}var Ni$1=new t$X,Ai$1=new t$X,Fi$1=new t$X;function Ut(e,t,i,r){var n=t$X.clone(i.direction,Ni$1),o=t$X.clone(i.up,Ai$1);if(e._scene.mode===P$$.SCENE3D){var a=e._projection.ellipsoid,s=m$1b.eastNorthUpToFixedFrame(t,a,ct$4),l=y$15.inverseTransformation(s,ft$4);y$15.multiplyByPointAsVector(l,n,n),y$15.multiplyByPointAsVector(l,o,o)}var u=t$X.cross(n,o,Fi$1);return r.heading=bt$2(n,o),r.pitch=Bt$2(n),r.roll=Lt$3(n,o,u),r}var Mt$2={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},tt$7=new i$10;v$n.prototype.setView=function(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.orientation,u$Y.EMPTY_OBJECT),i=this._mode;if(i!==P$$.MORPHING){e$28(e.endTransform)&&this._setTransform(e.endTransform);var r=u$Y(e.convert,!0),n=u$Y(e.destination,t$X.clone(this.positionWC,lt$4));e$28(n)&&e$28(n.west)&&(n=this.getRectangleCameraCoordinates(n,lt$4),r=!1),e$28(t.direction)&&(t=Ut(this,n,t,Mt$2.orientation)),tt$7.heading=u$Y(t.heading,0),tt$7.pitch=u$Y(t.pitch,-e$27.PI_OVER_TWO),tt$7.roll=u$Y(t.roll,0),this._suspendTerrainAdjustment=!0,i===P$$.SCENE3D?Di$2(this,n,tt$7):i===P$$.SCENE2D?Oi$1(this,n,tt$7,r):xi$2(this,n,tt$7,r)}};var Vi$1=new t$X;function jt(e,t){var i,r,n=e._scene.mapMode2D===Jt$1.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?i=-(r=o):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}v$n.prototype.flyHome=function(e){var t=this._mode;if(t===P$$.MORPHING&&this._scene.completeMorph(),t===P$$.SCENE2D)this.flyTo({destination:v$n.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:y$15.IDENTITY});else if(t===P$$.SCENE3D){var i=this.getRectangleCameraCoordinates(v$n.DEFAULT_VIEW_RECTANGLE),r=t$X.magnitude(i);r+=r*v$n.DEFAULT_VIEW_FACTOR,t$X.normalize(i,i),t$X.multiplyByScalar(i,r,i),this.flyTo({destination:i,duration:e,endTransform:y$15.IDENTITY})}else if(t===P$$.COLUMBUS_VIEW){var n=this._projection.ellipsoid.maximumRadius,o=new t$X(0,-1,1);o=t$X.multiplyByScalar(t$X.normalize(o,o),5*n,o),this.flyTo({destination:o,duration:e,orientation:{heading:0,pitch:-Math.acos(t$X.normalize(o,Vi$1).z),roll:0},endTransform:y$15.IDENTITY,convert:!1})}},v$n.prototype.worldToCameraCoordinates=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new e$25),D$o(this),y$15.multiplyByVector(this._actualInvTransform,e,t)},v$n.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new t$X),D$o(this),y$15.multiplyByPoint(this._actualInvTransform,e,t)},v$n.prototype.worldToCameraCoordinatesVector=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new t$X),D$o(this),y$15.multiplyByPointAsVector(this._actualInvTransform,e,t)},v$n.prototype.cameraToWorldCoordinates=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new e$25),D$o(this),y$15.multiplyByVector(this._actualTransform,e,t)},v$n.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new t$X),D$o(this),y$15.multiplyByPoint(this._actualTransform,e,t)},v$n.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!e$28(e))throw new t$Z("cartesian is required.");return e$28(t)||(t=new t$X),D$o(this),y$15.multiplyByPointAsVector(this._actualTransform,e,t)};var vt$3=new t$X;v$n.prototype.move=function(e,t){if(!e$28(e))throw new t$Z("direction is required.");var i=this._scene;if(this._enableIndoorColliDetection){t$X.multiplyByScalar(e,Math.sign(t),vt$3);var r=i.collideDetection(vt$3);if(e$28(r))if(t$X.distance(this.position,r)<1)return}var n=this.position;t$X.multiplyByScalar(e,t,vt$3),t$X.add(n,vt$3,n),this._mode===P$$.SCENE2D&&jt(this,n),this._adjustOrthographicFrustum(!0)},v$n.prototype.moveForward=function(e){e=u$Y(e,this.defaultMoveAmount),this._mode===P$$.SCENE2D?pt$4(this,e):this.move(this.direction,e)},v$n.prototype.moveBackward=function(e){e=u$Y(e,this.defaultMoveAmount),this._mode===P$$.SCENE2D?pt$4(this,-e):this.move(this.direction,-e)},v$n.prototype.moveUp=function(e){e=u$Y(e,this.defaultMoveAmount),this.move(this.up,e)},v$n.prototype.moveDown=function(e){e=u$Y(e,this.defaultMoveAmount),this.move(this.up,-e)},v$n.prototype.moveRight=function(e){e=u$Y(e,this.defaultMoveAmount),this.move(this.right,e)},v$n.prototype.moveLeft=function(e){e=u$Y(e,this.defaultMoveAmount),this.move(this.right,-e)},v$n.prototype.lookLeft=function(e){e=u$Y(e,this.defaultLookAmount),this._mode!==P$$.SCENE2D&&this.look(this.up,-e)},v$n.prototype.lookRight=function(e){e=u$Y(e,this.defaultLookAmount),this._mode!==P$$.SCENE2D&&this.look(this.up,e)},v$n.prototype.lookUp=function(e){e=u$Y(e,this.defaultLookAmount),this._mode!==P$$.SCENE2D&&this.look(this.right,-e)},v$n.prototype.lookDown=function(e){e=u$Y(e,this.defaultLookAmount),this._mode!==P$$.SCENE2D&&this.look(this.right,e)};var zi$1=new n$14,bi$1=new p$1a;v$n.prototype.look=function(e,t){if(!e$28(e))throw new t$Z("axis is required.");var i=u$Y(t,this.defaultLookAmount),r=n$14.fromAxisAngle(e,-i,zi$1),n=p$1a.fromQuaternion(r,bi$1),o=this.direction,a=this.up,s=this.right;p$1a.multiplyByVector(n,o,o),p$1a.multiplyByVector(n,a,a),p$1a.multiplyByVector(n,s,s)},v$n.prototype.twistLeft=function(e){e=u$Y(e,this.defaultLookAmount),this.look(this.direction,e)},v$n.prototype.twistRight=function(e){e=u$Y(e,this.defaultLookAmount),this.look(this.direction,-e)};var Bi$1=new n$14,Li$1=new p$1a;v$n.prototype.rotate=function(e,t){if(!e$28(e))throw new t$Z("axis is required.");var i=u$Y(t,this.defaultRotateAmount),r=n$14.fromAxisAngle(e,-i,Bi$1),n=p$1a.fromQuaternion(r,Li$1);p$1a.multiplyByVector(n,this.position,this.position),p$1a.multiplyByVector(n,this.direction,this.direction),p$1a.multiplyByVector(n,this.up,this.up),t$X.cross(this.direction,this.up,this.right),t$X.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},v$n.prototype.rotateDown=function(e){Zt$1(this,e=u$Y(e,this.defaultRotateAmount))},v$n.prototype.rotateUp=function(e){Zt$1(this,-(e=u$Y(e,this.defaultRotateAmount)))};var Hi$1=new t$X,Ui$1=new t$X,ji$2=new t$X,kt$2=new t$X;function Zt$1(e,t){var i=e.position,r=t$X.normalize(i,Hi$1);if(e$28(e.constrainedAxis)){var n=t$X.equalsEpsilon(r,e.constrainedAxis,e$27.EPSILON2),o=t$X.equalsEpsilon(r,t$X.negate(e.constrainedAxis,kt$2),e$27.EPSILON2);if(n||o)(n&&t<0||o&&t>0)&&e.rotate(e.right,t);else{var a=t$X.normalize(e.constrainedAxis,Ui$1),s=t$X.dot(r,a),l=e$27.acosClamped(s);t>0&&t>l&&(t=l-e$27.EPSILON4),s=t$X.dot(r,t$X.negate(a,kt$2)),l=e$27.acosClamped(s),t<0&&-t>l&&(t=-l+e$27.EPSILON4);var u=t$X.cross(a,r,ji$2),c=t$X.dot(u,e.right);if(c<0&&t>0)return;u=c<0?t$X.negate(u,u):u,e.rotate(u,t)}}else e.rotate(e.right,t)}function Yt(e,t){e$28(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function pt$4(e,t){var i,r=e.frustum;if(!(r instanceof l$$&&e$28(r.left)&&e$28(r.right)&&e$28(r.bottom)&&e$28(r.top)))throw new t$Z("The camera frustum is expected to be orthographic for 2D camera control.");if(t*=.5,Math.abs(r.top)+Math.abs(r.bottom)>Math.abs(r.left)+Math.abs(r.right)){var n=r.top-t,o=r.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===Jt$1.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,n=-a),n<=o&&(n=1,o=-1),i=r.right/r.top,r.top=n,r.bottom=o,r.right=r.top*i,r.left=-r.right}else{var s=r.right-t,l=r.left+t,u=e._maxCoord.x;e._scene.mapMode2D===Jt$1.ROTATE&&(u*=e.maximumZoomFactor),s>u&&(s=u,l=-u),s<=l&&(s=1,l=-1),i=r.top/r.right,r.right=s,r.left=l,r.top=r.right*i,r.bottom=-r.top}}function Gt(e,t){e.move(e.direction,t)}v$n.prototype.rotateRight=function(e){Yt(this,-(e=u$Y(e,this.defaultRotateAmount)))},v$n.prototype.rotateLeft=function(e){Yt(this,e=u$Y(e,this.defaultRotateAmount))},v$n.prototype.zoomIn=function(e){e=u$Y(e,this.defaultZoomAmount),this._mode===P$$.SCENE2D?pt$4(this,e):Gt(this,e)},v$n.prototype.zoomOut=function(e){e=u$Y(e,this.defaultZoomAmount),this._mode===P$$.SCENE2D?pt$4(this,-e):Gt(this,-e)},v$n.prototype.getMagnitude=function(){return this._mode===P$$.SCENE3D?t$X.magnitude(this.position):this._mode===P$$.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===P$$.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var ki$2=new y$15;v$n.prototype.lookAt=function(e,t){if(!e$28(e))throw new t$Z("target is required");if(!e$28(t))throw new t$Z("offset is required");if(this._mode===P$$.MORPHING)throw new t$Z("lookAt is not supported while morphing.");var i=m$1b.eastNorthUpToFixedFrame(e,t$V.WGS84,ki$2);this.lookAtTransform(i,t)};var Zi=new t$X,Yi=new n$14,Gi$1=new n$14,Qi=new p$1a;function Qt(e,t,i){t=e$27.clamp(t,-e$27.PI_OVER_TWO,e$27.PI_OVER_TWO),e=e$27.zeroToTwoPi(e)-e$27.PI_OVER_TWO;var r=n$14.fromAxisAngle(t$X.UNIT_Y,-t,Yi),n=n$14.fromAxisAngle(t$X.UNIT_Z,-e,Gi$1),o=n$14.multiply(n,r,n),a=p$1a.fromQuaternion(o,Qi),s=t$X.clone(t$X.UNIT_X,Zi);return p$1a.multiplyByVector(a,s,s),t$X.negate(s,s),t$X.multiplyByScalar(s,i,s),s}v$n.prototype.lookAtTransform=function(e,t){if(!e$28(e))throw new t$Z("transform is required");if(this._mode===P$$.MORPHING)throw new t$Z("lookAtTransform is not supported while morphing.");if(this._setTransform(e),e$28(t)){var i;if(i=e$28(t.heading)?Qt(t.heading,t.pitch,t.range):t,this._mode===P$$.SCENE2D){o$1k.clone(o$1k.ZERO,this.position),t$X.negate(i,this.up),this.up.z=0,t$X.magnitudeSquared(this.up)<e$27.EPSILON10&&t$X.clone(t$X.UNIT_Y,this.up),t$X.normalize(this.up,this.up),this._setTransform(y$15.IDENTITY),t$X.negate(t$X.UNIT_Z,this.direction),t$X.cross(this.direction,this.up,this.right),t$X.normalize(this.right,this.right);var r=this.frustum,n=r.top/r.right;return r.right=.5*t$X.magnitude(i),r.left=-r.right,r.top=n*r.right,r.bottom=-r.top,void this._setTransform(e)}t$X.clone(i,this.position),t$X.negate(this.position,this.direction),t$X.normalize(this.direction,this.direction),t$X.cross(this.direction,t$X.UNIT_Z,this.right),t$X.magnitudeSquared(this.right)<e$27.EPSILON10&&t$X.clone(t$X.UNIT_X,this.right),t$X.normalize(this.right,this.right),t$X.cross(this.right,this.direction,this.up),t$X.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var rt$7=new t$W,qi$1=new t$W,Xi$1=new t$X,Ji$1=new t$X,Ki$1=new t$X,$i$1=new t$X,te$c=new t$X,ie$8=new t$X,ee$c=new t$X,It$4=new t$X,re$7={direction:new t$X,right:new t$X,up:new t$X},qt$1;function N$g(e,t,i,r){return Math.abs(t$X.dot(t,i))/r-t$X.dot(e,i)}function Xt$1(e,t,i,r){var n=e._projection.ellipsoid,o=r?e:re$7,a=t.north,s=t.south,l=t.east,u=t.west;u>l&&(l+=e$27.TWO_PI);var c,h=.5*(u+l);if(s<-e$27.PI_OVER_TWO+e$27.RADIANS_PER_DEGREE&&a>e$27.PI_OVER_TWO-e$27.RADIANS_PER_DEGREE)c=0;else{var d=rt$7;d.longitude=h,d.latitude=a,d.height=0;var f=qi$1;f.longitude=h,f.latitude=s,f.height=0;var p=qt$1;(!e$28(p)||p.ellipsoid!==n)&&(qt$1=p=new E$$(void 0,void 0,n)),p.setEndPoints(d,f),c=p.interpolateUsingFraction(.5,rt$7).latitude}var _=rt$7;_.longitude=h,_.latitude=c,_.height=0;var m=n.cartographicToCartesian(_,ee$c),$=rt$7;$.longitude=l,$.latitude=a;var g=n.cartographicToCartesian($,Xi$1);$.longitude=u;var v=n.cartographicToCartesian($,Ki$1);$.longitude=h;var y=n.cartographicToCartesian($,te$c);$.latitude=s;var x=n.cartographicToCartesian($,ie$8);$.longitude=l;var b=n.cartographicToCartesian($,$i$1);$.longitude=u;var w=n.cartographicToCartesian($,Ji$1);t$X.subtract(v,m,v),t$X.subtract(b,m,b),t$X.subtract(g,m,g),t$X.subtract(w,m,w),t$X.subtract(y,m,y),t$X.subtract(x,m,x);var C=n.geodeticSurfaceNormal(m,o.direction);t$X.negate(C,C);var T=t$X.cross(C,t$X.UNIT_Z,o.right);t$X.normalize(T,T);var S,E=t$X.cross(T,C,o.up);if(e.frustum instanceof a$X){var A,P,I=Math.max(t$X.distance(g,v),t$X.distance(b,w)),M=Math.max(t$X.distance(g,b),t$X.distance(v,w)),O=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,D=M*O;I>D?P=(A=I)/O:(P=M,A=D),S=Math.max(A,P)}else{var R=Math.tan(.5*e.frustum.fovy),L=e.frustum.aspectRatio*R;if(S=Math.max(N$g(C,E,v,R),N$g(C,E,b,R),N$g(C,E,g,R),N$g(C,E,w,R),N$g(C,E,y,R),N$g(C,E,x,R),N$g(C,T,v,L),N$g(C,T,b,L),N$g(C,T,g,L),N$g(C,T,w,L),N$g(C,T,y,L),N$g(C,T,x,L)),s<0&&a>0){var B=rt$7;B.longitude=u,B.latitude=0,B.height=0;var N=n.cartographicToCartesian(B,It$4);t$X.subtract(N,m,N),S=Math.max(S,N$g(C,E,N,R),N$g(C,T,N,L)),B.longitude=l,N=n.cartographicToCartesian(B,It$4),t$X.subtract(N,m,N),S=Math.max(S,N$g(C,E,N,R),N$g(C,T,N,L))}}return t$X.add(m,t$X.multiplyByScalar(C,-S,It$4),i)}var ne$c=new t$W,oe$9=new t$X,se$6=new t$X;function ae$a(e,t,i){var r=e._projection;t.west>t.east&&(t=h$10.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=ne$c;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,oe$9);y$15.multiplyByPoint(n,s,s),y$15.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,se$6);if(y$15.multiplyByPoint(n,l,l),y$15.multiplyByPoint(o,l,l),i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,e$28(e.frustum.fovy)){var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u)}else{var h=s.x-l.x,d=s.y-l.y;i.z=Math.max(h,d)}return i}var he$7=new t$W,ue$5=new t$X,ce$a=new t$X;function fe$6(e,t,i){var r=e._projection;t.west>t.east&&(t=h$10.MAX_VALUE);var n=he$7;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ue$5);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,ce$a),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?s=(a=u)/h:(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,(n=r.unproject(i,n)).height=c,i=r.project(n,i)}v$n.prototype.getRectangleCameraCoordinates=function(e,t){if(!e$28(e))throw new t$Z("rectangle is required");var i=this._mode;return e$28(t)||(t=new t$X),i===P$$.SCENE3D?Xt$1(this,e,t):i===P$$.COLUMBUS_VIEW?ae$a(this,e,t):i===P$$.SCENE2D?fe$6(this,e,t):void 0};var de$9=new f$18;function le$9(e,t,i,r){i=u$Y(i,t$V.WGS84);var n=e.getPickRay(t,de$9),o=g$10.rayEllipsoid(n,i);if(o){var a=o.start>0?o.start:o.stop;return f$18.getPoint(n,a,r)}}var ve$6=new f$18;function pe$9(e,t,i,r){var n=e.getPickRay(t,ve$6).origin;n=t$X.fromElements(n.y,n.z,0,n);var o=i.unproject(n);if(!(o.latitude<-e$27.PI_OVER_TWO||o.latitude>e$27.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(o,r)}var ge$b=new f$18;function _e$8(e,t,i,r){var n=e.getPickRay(t,ge$b),o=-n.origin.x/n.direction.x;f$18.getPoint(n,o,r);var a=i.unproject(new t$X(r.y,r.z,0));if(!(a.latitude<-e$27.PI_OVER_TWO||a.latitude>e$27.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(a,r)}v$n.prototype.pickEllipsoid=function(e,t,i){if(!e$28(e))throw new t$Z("windowPosition is required.");var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(e$28(i)||(i=new t$X),t=u$Y(t,t$V.WGS84),this._mode===P$$.SCENE3D)i=le$9(this,e,t,i);else if(this._mode===P$$.SCENE2D)i=pe$9(this,e,this._projection,i);else{if(this._mode!==P$$.COLUMBUS_VIEW)return;i=_e$8(this,e,this._projection,i)}return i}};var me$b=new t$X,Ce$7=new t$X,ye$9=new t$X;function we$a(e,t,i){var r=e._scene.canvas,n=r.clientWidth,o=r.clientHeight,a=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*a,l=e.frustum.near,u=2/n*t.x-1,c=2/o*(o-t.y)-1,h=e.positionWC;t$X.clone(h,i.origin);var d=t$X.multiplyByScalar(e.directionWC,l,me$b);t$X.add(h,d,d);var f=t$X.multiplyByScalar(e.rightWC,u*l*s,Ce$7),p=t$X.multiplyByScalar(e.upWC,c*l*a,ye$9),_=t$X.add(d,f,i.direction);return t$X.add(_,p,_),t$X.subtract(_,h,_),t$X.normalize(_,_),i}var gt$4=new t$X;function Te$6(e,t,i){var r=e._scene.canvas,n=r.clientWidth,o=r.clientHeight,a=e.frustum;e$28(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=2/n*t.x-1;s*=.5*(a.right-a.left);var l=2/o*(o-t.y)-1;l*=.5*(a.top-a.bottom);var u=i.origin;return t$X.clone(e.position,u),t$X.multiplyByScalar(e.right,s,gt$4),t$X.add(gt$4,u,u),t$X.multiplyByScalar(e.up,l,gt$4),t$X.add(gt$4,u,u),t$X.clone(e.directionWC,i.direction),(e._mode===P$$.COLUMBUS_VIEW||e._mode===P$$.SCENE2D)&&t$X.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}v$n.prototype.getPickRay=function(e,t){if(!e$28(e))throw new t$Z("windowPosition is required.");e$28(t)||(t=new f$18);const i=this._scene.canvas;if(!(i.clientWidth<=0||i.clientHeight<=0)){var r=this.frustum;return e$28(r.aspectRatio)&&e$28(r.fov)&&e$28(r.near)?we$a(this,e,t):Te$6(this,e,t)}};var Ee$8=new t$X,Pe$8=new t$X;v$n.prototype.distanceToBoundingSphere=function(e){if(!e$28(e))throw new t$Z("boundingSphere is required.");var t=t$X.subtract(this.positionWC,e.center,Ee$8),i=t$X.multiplyByScalar(this.directionWC,t$X.dot(t,this.directionWC),Pe$8);return Math.max(0,t$X.magnitude(i)-e.radius)};var Re$6=new o$1k;function Se$6(e,t,i,r,n,o){var a=t$X.clone(t);return i.y>r?a.y-=i.y-r:i.y<-r&&(a.y+=-r-i.y),i.z>n?a.z-=i.z-n:i.z<-n&&(a.z+=-n-i.z),{easingFunction:m$S.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:function(i){var r=t$X.lerp(t,a,i.time,new t$X);e.worldToCameraCoordinatesPoint(r,e.position)}}}v$n.prototype.getPixelSize=function(e,t,i){if(!e$28(e))throw new t$Z("boundingSphere is required.");if(!e$28(t))throw new t$Z("drawingBufferWidth is required.");if(!e$28(i))throw new t$Z("drawingBufferHeight is required.");var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,this._scene.pixelRatio,Re$6);return Math.max(n.x,n.y)};var Me$8=new t$X,Jt=new t$X,Ie$9=new t$X,We$5=new t$X;function De$9(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(t$X.UNIT_X,Me$8),o=-t$X.dot(n,i)/t$X.dot(n,r),a=t$X.add(i,t$X.multiplyByScalar(r,o,Jt),Jt);e.cameraToWorldCoordinatesPoint(a,a),i=e.cameraToWorldCoordinatesPoint(e.position,Ie$9);var s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=t$X.magnitude(t$X.subtract(i,a,We$5)),c=l*u,h=s*u,d=e._maxCoord.x,f=e._maxCoord.y,p=Math.max(c-d,d),_=Math.max(h-f,f);if(i.z<-p||i.z>p||i.y<-_||i.y>_){var m=a.y<-p||a.y>p,$=a.z<-_||a.z>_;if(m||$)return Se$6(e,i,a,p,_,t)}}v$n.prototype.createCorrectPositionTween=function(e){if(!e$28(e))throw new t$Z("duration is required.");if(this._mode===P$$.COLUMBUS_VIEW)return De$9(this,e)};var xe$8=new t$X,I$r={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 Oe$8(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function Ne$5(e,t){var i=e.frustum;e$28(i._offCenterFrustum)&&(i=i._offCenterFrustum);var r,n,o=i.right/i.top,a=t*o;return t>a?n=(r=t)/o:(n=t,r=a),1.5*Math.max(r,n)}v$n.prototype.cancelFlight=function(){e$28(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},v$n.prototype.flyTo=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).destination;if(!e$28(t))throw new t$Z("destination is required.");if(this._mode!==P$$.MORPHING){this.cancelFlight();var i=u$Y(e.orientation,u$Y.EMPTY_OBJECT);if(e$28(i.direction)&&(i=Ut(this,t,i,Mt$2.orientation)),e$28(e.duration)&&e.duration<=0){var r=Mt$2;return r.destination=e.destination,r.orientation.heading=i.heading,r.orientation.pitch=i.pitch,r.orientation.roll=i.roll,r.convert=e.convert,r.endTransform=e.endTransform,this.setView(r),void("function"==typeof e.complete&&e.complete())}var n=e$28(t.west);n&&(t=this.getRectangleCameraCoordinates(t,xe$8));var o,a=this;I$r.destination=t,I$r.heading=i.heading,I$r.pitch=i.pitch,I$r.roll=i.roll,I$r.duration=e.duration,I$r.complete=function(){o===a._currentFlight&&(a._currentFlight=void 0),e$28(e.complete)&&e.complete()},I$r.cancel=e.cancel,I$r.endTransform=e.endTransform,I$r.convert=!n&&e.convert,I$r.maximumHeight=e.maximumHeight,I$r.pitchAdjustHeight=e.pitchAdjustHeight,I$r.flyOverLongitude=e.flyOverLongitude,I$r.flyOverLongitudeWeight=e.flyOverLongitudeWeight,I$r.easingFunction=e.easingFunction,I$r.headingFree=u$Y(e.headingFree,!1),I$r.pitchFree=u$Y(e.pitchFree,!1),I$r.altitudeFree=u$Y(e.altitudeFree,!1),I$r.directTurning=u$Y(e.directTurning,!1),I$r.interpolationMode=u$Y(e.interpolationMode,hi$3.NONE),I$r.catmullRomSpline=e.catmullRomSpline,I$r.preStopIndex=e.preStopIndex,I$r.flyClampToGround=this._flyClampToGround,I$r.flyRelativeHeight=this._flyRelativeHeight;var s=this._scene,l=mr$1.createTween(s,I$r);if(0===l.duration)return void("function"==typeof l.complete&&l.complete());o=s.tweens.add(l),this._currentFlight=o;var u=this._scene.preloadFlightCamera;this._mode!==P$$.SCENE2D&&(e$28(u)||(u=v$n.clone(this)),u.setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))}};var Ae$8=100;function Kt(e,t,i){e$28(i)||(i=a$S.clone(v$n.DEFAULT_OFFSET));var r=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,o=i.range;if(!e$28(o)||0===o){var a=t.radius;0===a?i.range=Ae$8:e.frustum instanceof a$X||e._mode===P$$.SCENE2D?i.range=Ne$5(e,a):i.range=Oe$8(e,a),i.range=e$27.clamp(i.range,r,n)}return i}v$n.prototype.viewBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("boundingSphere is required.");if(this._mode===P$$.MORPHING)throw new t$Z("viewBoundingSphere is not supported while morphing.");t=Kt(this,e,t),this.lookAt(e.center,t)};var Fe$7=new y$15,Ve$8=new t$X,ze$4=new t$X,be$9=new t$X,Be$9=new t$X,Le$8=new e$25,He$6=new n$14,Ue$6=new p$1a;v$n.prototype.flyToBoundingSphere=function(e,t){if(!e$28(e))throw new t$Z("boundingSphere is required.");t=u$Y(t,u$Y.EMPTY_OBJECT);var i=this._mode===P$$.SCENE2D||this._mode===P$$.COLUMBUS_VIEW;this._setTransform(y$15.IDENTITY);var r,n=Kt(this,e,t.offset);r=i?t$X.multiplyByScalar(t$X.UNIT_Z,n.range,Ve$8):Qt(n.heading,n.pitch,n.range);var o,a,s=m$1b.eastNorthUpToFixedFrame(e.center,t$V.WGS84,Fe$7);if(y$15.multiplyByPoint(s,r,r),!i){if(o=t$X.subtract(e.center,r,ze$4),t$X.normalize(o,o),a=y$15.multiplyByPointAsVector(s,t$X.UNIT_Z,be$9),1-Math.abs(t$X.dot(o,a))<e$27.EPSILON6){var l=n$14.fromAxisAngle(o,n.heading,He$6),u=p$1a.fromQuaternion(l,Ue$6);t$X.fromCartesian4(y$15.getColumn(s,1,Le$8),a),p$1a.multiplyByVector(u,a,a)}var c=t$X.cross(o,a,Be$9);t$X.cross(c,o,a),t$X.normalize(a,a)}this.flyTo({destination:r,orientation:{direction:o,up:a},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var $t=new t$X,ti=new t$X,Wt$1=new t$X,ii=new t$X,nt$6=[new t$X,new t$X,new t$X,new t$X];function je$4(e,t){var i,r,n=t.radii,o=e.positionWC,a=t$X.multiplyComponents(t.oneOverRadii,o,$t),s=t$X.magnitude(a),l=t$X.normalize(a,ti);t$X.equalsEpsilon(l,t$X.UNIT_Z,e$27.EPSILON10)?(i=new t$X(0,1,0),r=new t$X(0,0,1)):(i=t$X.normalize(t$X.cross(t$X.UNIT_Z,l,Wt$1),Wt$1),r=t$X.normalize(t$X.cross(l,i,ii),ii));var u=Math.sqrt(t$X.magnitudeSquared(a)-1),c=t$X.multiplyByScalar(l,1/s,$t),h=u/s,d=t$X.multiplyByScalar(i,h,ti),f=t$X.multiplyByScalar(r,h,Wt$1),p=t$X.add(c,f,nt$6[0]);t$X.subtract(p,d,p),t$X.multiplyComponents(n,p,p);var _=t$X.subtract(c,f,nt$6[1]);t$X.subtract(_,d,_),t$X.multiplyComponents(n,_,_);var m=t$X.subtract(c,f,nt$6[2]);t$X.add(m,d,m),t$X.multiplyComponents(n,m,m);var $=t$X.add(c,f,nt$6[3]);return t$X.add($,d,$),t$X.multiplyComponents(n,$,$),nt$6}var Dt$4=new o$1k,ke$2=new t$X,q$g=[new t$W,new t$W,new t$W,new t$W];function _t$4(e,t,i,r,n,o){Dt$4.x=e,Dt$4.y=t;var a=r.pickEllipsoid(Dt$4,n,ke$2);return e$28(a)?(q$g[i]=n.cartesianToCartographic(a,q$g[i]),1):(q$g[i]=n.cartesianToCartographic(o[i],q$g[i]),0)}function Ze$3(e,t){var i=e.distance,r=e.normal;t[0]=-2*r.x*r.x+1,t[1]=-2*r.y*r.x,t[2]=-2*r.z*r.x,t[3]=0,t[4]=-2*r.x*r.y,t[5]=-2*r.y*r.y+1,t[6]=-2*r.z*r.y,t[7]=0,t[8]=-2*r.x*r.z,t[9]=-2*r.y*r.z,t[10]=-2*r.z*r.z+1,t[11]=0,t[12]=-2*r.x*i,t[13]=-2*r.y*i,t[14]=-2*r.z*i,t[15]=1}v$n.prototype.computeViewRectangle=function(e,t){e=u$Y(e,t$V.WGS84);var i=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),r=new i$19(t$X.ZERO,e.maximumRadius);if(i.computeVisibility(r)!==pt$a.OUTSIDE){var n=this._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=0,l=je$4(this,e);if(s+=_t$4(0,0,0,this,e,l),s+=_t$4(0,a,1,this,e,l),s+=_t$4(o,a,2,this,e,l),(s+=_t$4(o,0,3,this,e,l))<2)return h$10.MAX_VALUE;t=h$10.fromCartographicArray(q$g,t);for(var u=0,c=q$g[3].longitude,h=0;h<4;++h){var d=q$g[h].longitude,f=Math.abs(d-c);f>e$27.PI?u+=e$27.TWO_PI-f:u+=f,c=d}return e$27.equalsEpsilon(Math.abs(u),e$27.TWO_PI,e$27.EPSILON9)&&(t.west=-e$27.PI,t.east=e$27.PI,q$g[0].latitude>=0?t.north=e$27.PI_OVER_TWO:t.south=-e$27.PI_OVER_TWO),t}},v$n.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===P$$.SCENE2D||this.frustum instanceof o$15)){var e=this._scene;this.frustum=new o$15,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=e$27.toRadians(60)}},v$n.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===P$$.SCENE2D||this.frustum instanceof a$X)){var e=this._scene;this.frustum=new a$X,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=t$X.magnitude(this.position),e$28(this.frustum.projectionMatrix)&&this._adjustOrthographicFrustum(!0)}},v$n.clone=function(e,t){return e$28(t)||(t=new v$n(e._scene)),t$X.clone(e.position,t.position),t$X.clone(e.direction,t.direction),t$X.clone(e.up,t.up),t$X.clone(e.right,t.right),y$15.clone(e._transform,t.transform),t._mode=e._mode,t._transformChanged=!0,t.frustum=e.frustum.clone(),t},v$n.prototype.enableReflection=function(e){this.bReflect=!0,Ze$3(e,this._reflectMatrix),D$o(this),this.frustum.reflect=!0,this.frustum.clipPlane=e,this.frustum.currentViewMatrix=this._viewMatrix},v$n.prototype.disableReflection=function(){this.bReflect=!1,this.frustum.reflect=!1,this.frustum instanceof o$15&&this.frustum.resetProjectionMatrix(),D$o(this)};var Ye$3=new y$15,Ge$4=new y$15,J$j=0,mt$2=!1;function b$r(e,t){if(o$1u.defined("context",e),!e$28(t))throw new t$Z("urls is required and must have the url of image.");this._context=e,this._size=0,this._cubeVs=void 0,this._cubeUniformMap=void 0,this._cubeRenderState=void 0,this._inputTexture=void 0,this._cubeMap=void 0,this._sourceData=void 0,this._loading=!1,this._url=t,this._rgbeLoader=new U$g,this._inputTexture=void 0,this._ready=!1,this._position=t$X.fromDegrees(113,23,1),this._modelMatrix=m$1b.eastNorthUpToFixedFrame(this._position)}function ye$8(e){let t=[],i=[],r=0;function n(e,n,o,a,s,l,u,c,h,d,f){const p=l/h,_=u/d,m=l/2,$=u/2,g=c/2,v=h+1,y=d+1;let x=0;const b=new t$X;for(let i=0;i<y;i++){const r=i*_-$;for(let i=0;i<v;i++){const l=i*p-m;b[e]=l*a,b[n]=r*s,b[o]=g,t.push(b.x,b.y,b.z),b[e]=0,b[n]=0,b[o]=c>0?1:-1,x+=1}}for(let e=0;e<d;e++)for(let t=0;t<h;t++){const n=r+t+v*e,o=r+t+v*(e+1),a=r+(t+1)+v*(e+1),s=r+(t+1)+v*e;i.push(n,o,s),i.push(o,a,s)}r+=x}n("z","y","x",-1,-1,1,1,1,1,1),n("z","y","x",1,-1,1,1,-1,1,1),n("x","z","y",1,1,1,1,1,1,1),n("x","z","y",1,-1,1,1,-1,1,1),n("x","y","z",1,-1,1,1,1,1,1),n("x","y","z",-1,-1,1,1,-1,1,1);let o=new Uint16Array(i),a=new Float32Array(t),s=new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:a})},indices:o,primitiveType:W$_.TRIANGLES,boundingSphere:i$19.fromVertices(a)});return m$19.fromGeometry({context:e,geometry:s,attributeLocations:{position:0},bufferUsage:A$1c.STATIC_DRAW})}function ge$a(e){return S$T.fromCache({context:e,vertexShaderSource:"\n precision mediump float;\n precision mediump int;\n\n attribute vec3 position;\n uniform mat4 projectionMat4;\n\n varying vec3 vWorldDirection;\n\n void main() {\n vWorldDirection = normalize(position);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n ",fragmentShaderSource:"\n precision mediump float;\n precision mediump int;\n\n varying vec3 vWorldDirection;\n uniform sampler2D tEquirect;\n\n #define RECIPROCAL_PI 0.3183098861837907\n #define RECIPROCAL_PI2 0.15915494309189535\n\n vec2 equirectUv( in vec3 dir ) {\n // dir is assumed to be unit length\n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n return vec2( u, v );\n }\n\n void main() {\n vec3 direction = normalize( vWorldDirection );\n vec2 sampleUV = equirectUv( direction );\n gl_FragColor = texture2D( tEquirect, sampleUV );\n }\n",attributeLocations:{position:0}})}function be$8(e,t){let i=t;const r=e.context;i._cubeVs=ye$8(r),i._cubeSp=ge$a(r),i._cubeUniformMap={tEquirect:function(){return i._inputTexture}},i._cubeRenderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!1},viewport:new f$10(0,0,i._size,i._size)}),i._cubeMap=new X$z({context:r,width:i._size,height:i._size,pixelFormat:V$O.RGBA,pixelDatatype:y$U.HALF_FLOAT,flipY:!0});let n=y$15.getRotation(i._modelMatrix,new p$1a),o=p$1a.getColumn(n,0,new t$X),a=p$1a.getColumn(n,1,new t$X),s=p$1a.getColumn(n,2,new t$X);e.mode===P$$.COLUMBUS_VIEW&&(o=t$X.UNIT_X,a=t$X.UNIT_Y,s=t$X.UNIT_Z);let l=t$X.multiplyByScalar(s,-1,new t$X),u=t$X.multiplyByScalar(a,-1,new t$X),c=t$X.multiplyByScalar(o,-1,new t$X),h=new v$n(e.camera._scene);h.frustum.near=.1,h.frustum.aspectRatio=1,h.frustum.fov=90*e$27.RADIANS_PER_DEGREE,i._projectionMat4=y$15.clone(h.frustum.projectionMatrix,i._projectionMat4);let d=[o,l,a,c,s,u],f=[s,a,s,s,a,s],p=[i._cubeMap.positiveX,i._cubeMap.positiveY,i._cubeMap.positiveZ,i._cubeMap.negativeX,i._cubeMap.negativeY,i._cubeMap.negativeZ];for(let t=0;t<6;t++){let n=new a$z({context:r,colorTextures:[p[t]]}),o=new r$15({vertexArray:i._cubeVs,shaderProgram:i._cubeSp,uniformMap:i._cubeUniformMap,pass:Le$p.OPAQUE,primitiveType:W$_.TRIANGLES,renderState:i._cubeRenderState,modelMatrix:i._modelMatrix,cull:!1,owner:i,framebuffer:n,pickOnly:!0});h.setView({destination:i._position,orientation:{direction:d[t],up:f[t]}}),e.context.uniformState.updateCamera(h);let a=new n$p(e.context);e.context.draw(o,a)}}v$n.prototype.flyCircle=function(e){J$j=0,mt$2=!1,this._isFlyCircle=!1,this._flyCircle(e)},v$n.prototype._flyCircle=function(e){if(this._flyCircleLoop||!mt$2){(!this._isFlyCircle||this._isResetFlyCircleParm)&&(kt$7(),J$j=0,mt$2=!1,this._flyCircleCenter=t$X.clone(e),this._isFlyCircle=!0,this._isResetFlyCircleParm=!1);var t=this.constrainedAxis,i=y$15.clone(this.transform,Ge$4),r=m$1b.eastNorthUpToFixedFrame(e,t$V.WGS84,Ye$3);this._setTransform(r),this.constrainedAxis=t$X.UNIT_Z,kt$7();var n=.01;n*=this._speedRatio;var o=2*Math.PI-Math.abs(J$j);J$j<0&&(o*=-1),!this._flyCircleLoop&&Math.abs(J$j)>=2*Math.PI&&(n=o,mt$2=!0),J$j+=n,this.rotateRight(-n),this.constrainedAxis=t,this._setTransform(i)}else J$j=0},v$n.prototype.stopFlyCircle=function(){this._isFlyCircle=!1},Object.defineProperties(b$r.prototype,{cubeMap:{get:function(){return this._cubeMap}},ready:{get:function(){return this._ready}}});let ve$5=/(\.hdr$)/i,we$9=/(\.jpg$)/i;function V$g(e){if(!e$28(e))throw new t$Z("scene are required.");if(!e.context.depthTexture)throw new t$Z("the depth buffer is not supported.");this._scene=e,this._depthBuffer=void 0,this._depthDownBuffer=void 0,this._depthDownReverBuffer=void 0,this._depthLeftBuffer=void 0,this._depthLeftReverBuffer=void 0,this._depthTopBuffer=void 0,this._depthValue=void 0,this._dataBuffer=void 0,this._frameState=void 0,this._textureWidth=1024,this._textureHeight=1024,this._startPoint3D=[0,0,0],this._endPoint3D=[0,0,0],this._extendHeight=0,this._bManualChangeExtendHeight=!1,this._v3ProfileDir=new t$X(0,0,0),this._v3MiddlePosition=new t$X(0,0,0),this._v3ProfileNormal=new t$X(0,0,0),this._viewMatrix=new y$15,this._projMatrix=new y$15,this._update=!0,this._visibleViewport=4095,this._id=0,this._name="",this._downName="",this._downReverName="",this._leftName="",this._leftReverName="",this._topName="",this._func=void 0,this._isGetPositions=!1,this._positions=[]}function J$i(e,t,i){var r=i.camera._projection,n=.5*(e.startPoint[2]+e.endPoint[2]),o=new t$X;if(o.x=.5*(e.endPoint[0]-e.startPoint[0])+e.startPoint[0],o.y=.5*(e.endPoint[1]-e.startPoint[1])+e.startPoint[1],o.z=n,e._scene.mode===P$$.SCENE3D){var a=t$X.fromDegreesArrayHeights([e.startPoint[0],e.startPoint[1],n])[0],s=t$X.fromDegreesArrayHeights([e.endPoint[0],e.endPoint[1],n])[0];t$X.subtract(s,a,e._v3ProfileDir),e._v3MiddlePosition=t$X.fromDegreesArrayHeights([o.x,o.y,n])[0];var l=new t$X;e._v3MiddlePosition.clone(l),t$X.normalize(l,l)}else{a=r.project(t$W.fromDegrees(e.startPoint[0],e.startPoint[1],e.startPoint[2]),new t$X),s=r.project(t$W.fromDegrees(e.endPoint[0],e.endPoint[1],e.startPoint[2]),new t$X);t$X.subtract(s,a,e._v3ProfileDir);var u=t$W.fromDegrees(o.x,o.y,n);e._v3MiddlePosition=r.project(u,new t$X),e._oriPos=r.project(t$W.fromDegrees(o.x,o.y,-6378137),new t$X);l=new t$X;t$X.subtract(e._v3MiddlePosition,e._oriPos,l),t$X.normalize(l,l)}var c=new t$X;e._v3ProfileDir.clone(c),t$X.normalize(c,c),t$X.cross(c,l,e._v3ProfileNormal),t$X.normalize(e._v3ProfileNormal,e._v3ProfileNormal)}function k$m(e,t,i){e._textureWidth=t.drawingBufferWidth,e._textureHeight=t.drawingBufferHeight,e._textureWidth=e._textureWidth<=1?1:e._textureWidth,e._textureHeight=e._textureHeight<=1?1:e._textureHeight;var r=e._textureWidth*e._textureHeight;e._depthValue=new Float32Array(r),e._dataBuffer=new Uint8Array(4*r);for(var n=0;n<r;n++)e._depthValue[n]=1,e._dataBuffer[4*n]=0,e._dataBuffer[4*n+1]=0,e._dataBuffer[4*n+2]=0,e._dataBuffer[4*n+3]=255}function $$f(e,t){var i=t.depthData,r=t.viewProjection,n=t.invViewProjection;y$15.multiply(e._projMatrix,e._viewMatrix,r);for(var o=new e$25,a=new e$25(1,1/255,1/65025,1/160581375),s=e._scene.context.uniformState,l=s.currentFrustum,u=l.x,c=l.y,h=0;h<e._textureHeight;h++)for(var d=0;d<e._textureWidth;d++){var f=h*e._textureWidth+d,p=e$25.unpack(i,4*f,o);e$25.divideByScalar(p,255,p);var _=e$25.dot(p,a);if(!(_<=0)){if(e._scene.frameState.useLogDepth){var m=_*s.log2FarDepthFromNearPlusOne;_=c*(1-u/(Math.pow(2,m)-1+u))/(c-u)}o.x=d/e._textureWidth*2-1,o.y=h/e._textureHeight*2-1,o.z=2*_-1,o.w=1,y$15.multiplyByVector(n,o,o),e$25.divideByScalar(o,o.w,o);var $=new t$X(o.x,o.y,o.z);y$15.multiplyByVector(r,o,o),e$25.divideByScalar(o,o.w,o),o.x=.5*o.x+.5,o.y=.5*o.y+.5;var g=Math.round(o.x*e._textureWidth),v=Math.round(o.y*e._textureHeight);if(g>=0&&g<e._textureWidth&&v>=0&&v<e._textureHeight){var y=o.z;if(y<=1&&y>=-1){var x=g+(e._textureHeight-v)*e._textureWidth;e._dataBuffer[4*x]=0,e._dataBuffer[4*x+1]=255,e._dataBuffer[4*x+2]=255,e._dataBuffer[4*x+3]=255;var b=e._depthValue[x];e._depthValue[x]=y<b?y:b,e._isGetPositions&&e._positions.push($)}}}}}function ee$b(e){for(var t=1;t<e._textureHeight-1;t++)for(var i=1;i<e._textureWidth-1;i++){var r=t*e._textureWidth+i,n=e._dataBuffer[4*r+1],o=e._dataBuffer[4*(r-e._textureWidth)+1],a=e._dataBuffer[4*(r+e._textureWidth)+1],s=e._dataBuffer[4*(r-e._textureWidth-1)+1],l=e._dataBuffer[4*(r+e._textureWidth+1)+1],u=e._dataBuffer[4*(r-e._textureWidth+1)+1],c=e._dataBuffer[4*(r+e._textureWidth-1)+1],h=e._dataBuffer[4*(r-1)+1],d=e._dataBuffer[4*(r+1)+1];if(0==n&&(255==o&&255==a||255==s&&255==l||255==u&&255==c||255==h&&255==d)){e._dataBuffer[4*r]=0,e._dataBuffer[4*r+1]=255,e._dataBuffer[4*r+2]=255,e._dataBuffer[4*r+3]=255;for(var f=-1;f<=1;f++)for(var p=-1;p<=1;p++)r+f*e._textureWidth+p>0&&(e._dataBuffer[4*(r+f*e._textureWidth+p)]=0,e._dataBuffer[4*(r+f*e._textureWidth+p)+1]=255,e._dataBuffer[4*(r+f*e._textureWidth+p)+2]=255,e._dataBuffer[4*(r+f*e._textureWidth+p)+3]=255)}}for(t=1;t<e._textureHeight-1;t++)for(i=1;i<e._textureWidth-1;i++){r=t*e._textureWidth+i,n=e._dataBuffer[4*r+1],o=e._dataBuffer[4*(r-e._textureWidth)+1],a=e._dataBuffer[4*(r+e._textureWidth)+1],s=e._dataBuffer[4*(r-e._textureWidth-1)+1],l=e._dataBuffer[4*(r+e._textureWidth+1)+1],u=e._dataBuffer[4*(r-e._textureWidth+1)+1],c=e._dataBuffer[4*(r+e._textureWidth-1)+1],h=e._dataBuffer[4*(r-1)+1],d=e._dataBuffer[4*(r+1)+1];if(n<255){var _=(u+l+s+c)/9+(o+h+d+a)/9+n/9;_=Math.round(_),e._dataBuffer[4*r]=0,e._dataBuffer[4*r+1]=_,e._dataBuffer[4*r+2]=_,e._dataBuffer[4*r+3]=255}}}function N$f(e,t,i,r){var n=e._scene,o=45*e$27.RADIANS_PER_DEGREE,a=.5*t$X.magnitude(e._v3ProfileDir),s=e._extendHeight,l=new t$X;e._v3ProfileNormal.clone(l),t$X.multiplyByScalar(l,a,l);var u=new t$X;if(t.downOblique&&!t.leftOblique)t$X.UNIT_Z.clone(u),t.secondDrawing?t$X.subtract(e._v3MiddlePosition,l,u):t$X.add(e._v3MiddlePosition,l,u),I$q(e,u,u),t$X.multiplyByScalar(u,a*Math.tan(o),u),t$X.add(l,u,u),t.secondDrawing&&t$X.negate(u,u);else if(t.leftOblique&&!t.downOblique)e._v3ProfileDir.clone(u),t$X.normalize(u,u),t$X.multiplyByScalar(u,a*Math.tan(o),u),t$X.add(l,u,u),t.secondDrawing||t$X.negate(u,u);else if(t.leftOblique||t.downOblique){var c=new t$X;I$q(e,e._v3MiddlePosition,c),t$X.multiplyByScalar(c,.5*s,u)}else l.clone(u);var h=new t$X;t$X.add(e._v3MiddlePosition,u,h);var d=new t$X;t$X.subtract(e._v3MiddlePosition,h,d);var f=t$X.magnitude(d),p=f-t.cameraWidth,_=f+t.cameraWidth;t$X.normalize(d,d);var m=d.clone(),$=new t$X;e._v3ProfileDir.clone($),t$X.negate($,$);var g=new t$X;t$X.cross(m,$,g),g=t$X.normalize(g,g),t.downOblique&&t.leftOblique&&(p=.5,_=s),p=p<.5?.5:p;var v=r.camera,y=v.frustum.near,x=v.frustum.far,b=v.frustum.fov,w=new t$X,C=v.heading,T=v.pitch,S=v.frustum.aspectRatio,E=[],A=n.globe.showSkirts,P=n.globe.backFaceCulling;t$X.clone(v.position,w),t.depthBuffer.isUpdate=!0,t.depthBuffer._beginFunc=function(){(e._textureWidth!=i.drawingBufferWidth||e._textureHeight!=i.drawingBufferHeight)&&k$m(e,i),y=v.frustum.near,x=v.frustum.far,b=v.frustum.fov,C=v.heading,T=v.pitch,S=v.frustum.aspectRatio,t$X.clone(v.position,w),v.frustum.near=p,v.frustum.far=_,v.frustum.fov=90*e$27.RADIANS_PER_DEGREE,v.frustum.aspectRatio=e._textureWidth/e._textureHeight,v.setView({destination:h,orientation:{direction:m,up:g},convert:!1}),!t.downOblique&&!t.leftOblique&&(y$15.clone(v.viewMatrix,e._viewMatrix),y$15.clone(v.frustum.projectionMatrix,e._projMatrix));for(var r=0;r<n.layers._layerQueue.length;r++){var o=n.layers._layerQueue[r];E[r]=o.clipLineColor,o.clipLineColor=new e$1S(1,1,1,1),o.setCustomClipBox(t.clipOptions)}n.globe.showSkirts=!1,n.globe.backFaceCulling=!1,n.globe.setCustomClipBox(t.clipOptions)},t.depthBuffer._endFunc=function(){if(t.downOblique||t.leftOblique){var r=i.readPixels({framebuffer:t.depthBuffer.framebuffer}),o=i.uniformState,a={invViewProjection:o.inverseViewProjection,viewProjection:o.viewProjection,depthData:r};$$f(e,a)}v.setView({destination:w,orientation:{heading:C,pitch:T,roll:v.roll},convert:!1}),v.frustum.near=y,v.frustum.far=x,v.frustum.fov=b,v.frustum.aspectRatio=S,t.depthBuffer.isUpdate=!1;for(var s=0;s<n.layers._layerQueue.length;s++){var l=n.layers._layerQueue[s];l.clipLineColor=E[s],l.clearCustomClipBox()}n.globe.clearCustomClipBox(),n.globe.showSkirts=A,n.globe.backFaceCulling=P,t.leftOblique&&t.downOblique&&(ee$b(e),!e._isGetPositions&&e._func(e._dataBuffer),e._isGetPositions&&e._getPositionsFunc(e._positions))}}function I$q(e,t,i){return e._scene.mode===P$$.SCENE3D?t$X.normalize(t,i):(t$X.subtract(t,e._oriPos,i),t$X.normalize(i,i)),i}function j$j(e){var t=e.x;e.x=e.z,e.z=e.y,e.y=t}function te$b(e,t,i){J$i(e,t,i),k$m(e,t);var r=t$X.magnitude(e._v3ProfileDir);e._bManualChangeExtendHeight||(e._extendHeight=r);var n=e._extendHeight,o=Math.sqrt(2),a=r/e._textureWidth*o;a<.1&&(a=.1);var s=new t$X;s.x=.5*(e.startPoint[0]+e.endPoint[0]),s.y=.5*(e.startPoint[1]+e.endPoint[1]),s.z=.5*(e.startPoint[2]+e.endPoint[2]);var l=[],u=[],c=new t$X,h=e._v3ProfileNormal.clone(),d=t$X.negate(h,new t$X);u.push(d),t$X.multiplyByScalar(e._v3ProfileNormal,a,c),t$X.add(e._v3MiddlePosition,c,c),l.push(c);var f=e._v3ProfileNormal.clone();f=t$X.negate(f,f),d=t$X.negate(f,new t$X),u.push(d);var p=new t$X;t$X.multiplyByScalar(f,a,p),t$X.add(e._v3MiddlePosition,p,p),l.push(p),e._scene.mode!==P$$.SCENE3D&&(j$j(h),j$j(f),j$j(c),j$j(p));var _={planePos:l,planeNormal:u,clipMode:"clip_behind_any_plane"};N$f(e,{downOblique:!1,leftOblique:!1,secondDrawing:!1,cameraWidth:10*a,depthBuffer:e._depthBuffer,clipOptions:_},t,i);var m=(a+.5*n)/o;N$f(e,{downOblique:!0,leftOblique:!1,secondDrawing:!1,cameraWidth:m,depthBuffer:e._depthDownBuffer,clipOptions:_},t,i),N$f(e,{downOblique:!0,leftOblique:!1,secondDrawing:!0,cameraWidth:m,depthBuffer:e._depthDownReverBuffer,clipOptions:_},t,i),N$f(e,{downOblique:!1,leftOblique:!0,secondDrawing:!1,cameraWidth:m=(a+.5*r)/o,depthBuffer:e._depthLeftBuffer,clipOptions:_},t,i),N$f(e,{downOblique:!1,leftOblique:!0,secondDrawing:!0,cameraWidth:m,depthBuffer:e._depthLeftReverBuffer,clipOptions:_},t,i),N$f(e,{downOblique:!0,leftOblique:!0,secondDrawing:!1,cameraWidth:a,depthBuffer:e._depthTopBuffer,clipOptions:_},t,i)}b$r.prototype.update=function(e){if(!e$28(this._sourceData)&&!this._loading){let e=t$S.createIfNeeded(this._url);ve$5.test(this._url)?e.fetchArrayBuffer().then((e=>{this._sourceData=this._rgbeLoader.parse(e)})).otherwise((e=>{this._loading=!1})):we$9.test(this._url)&&e.fetchImage().then((e=>{this._sourceData=e})).otherwise((e=>{this._loading=!1})),this._loading=!0}if(e$28(this._sourceData)){if(!e$28(this._inputTexture)){let t=this._sourceData.data?{arrayBufferView:this._sourceData.data,width:this._sourceData.width,height:this._sourceData.height}:this._sourceData;this._inputTexture=new L$17({context:e.context,pixelFormat:V$O.RGBA,pixelDatatype:y$U.HALF_FLOAT,flipY:!0,source:t}),this._size=Math.min(this._sourceData.width,this._sourceData.height)}this._ready||(be$8(e,this),this._ready=!0)}},b$r.prototype.isDestroyed=function(){return!1},b$r.prototype.destroy=function(){return this._inputTexture=this._inputTexture&&this._inputTexture.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),destroyObject(this)},Object.defineProperties(V$g.prototype,{startPoint:{get:function(){return this._startPoint3D},set:function(e){this._startPoint3D=e,this._update=!0}},endPoint:{get:function(){return this._endPoint3D},set:function(e){this._endPoint3D=e,this._update=!0}},extendHeight:{get:function(){return this._extendHeight},set:function(e){this._extendHeight=e,this._bManualChangeExtendHeight=!0,this._update=!0}}}),V$g.prototype.getPositions=function(e){this._positions=[],this._isGetPositions=!0,this._getPositionsFunc=function(t){e(t),this._isGetPositions=!1},this._update=!0},V$g.prototype.update=function(e,t,i){LicenseChecker.LICENSECHECKER.verify("Profile"),!t._fboState.enabled&&this._update&&(this._frameState=t,e$28(this._depthBuffer)||(this._depthBuffer=new s$h(e),this._depthBuffer.environmentVisible.isObjectVisible=!0,this._depthBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthBuffer.environmentVisible.isGlobalVisible=!0,this._depthBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._name]=this._depthBuffer),e$28(this._depthDownBuffer)||(this._depthDownBuffer=new s$h(e),this._depthDownBuffer.environmentVisible.isObjectVisible=!0,this._depthDownBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthDownBuffer.environmentVisible.isGlobalVisible=!0,this._depthDownBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._downName]=this._depthDownBuffer),e$28(this._depthDownReverBuffer)||(this._depthDownReverBuffer=new s$h(e),this._depthDownReverBuffer.environmentVisible.isObjectVisible=!0,this._depthDownReverBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthDownReverBuffer.environmentVisible.isGlobalVisible=!0,this._depthDownReverBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._downReverName]=this._depthDownReverBuffer),e$28(this._depthLeftBuffer)||(this._depthLeftBuffer=new s$h(e),this._depthLeftBuffer.environmentVisible.isObjectVisible=!0,this._depthLeftBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthLeftBuffer.environmentVisible.isGlobalVisible=!0,this._depthLeftBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._leftName]=this._depthLeftBuffer),e$28(this._depthLeftReverBuffer)||(this._depthLeftReverBuffer=new s$h(e,this._scene.farToNearRatio),this._depthLeftReverBuffer.environmentVisible.isObjectVisible=!0,this._depthLeftReverBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthLeftReverBuffer.environmentVisible.isGlobalVisible=!0,this._depthLeftReverBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._leftReverName]=this._depthLeftReverBuffer),e$28(this._depthTopBuffer)||(this._depthTopBuffer=new s$h(e),this._depthTopBuffer.environmentVisible.isObjectVisible=!0,this._depthTopBuffer.environmentVisible.isOnlyS3MObjectVisible=!0,this._depthTopBuffer.environmentVisible.isGlobalVisible=!0,this._depthTopBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._topName]=this._depthTopBuffer),this._update=!1,te$b(this,e,t))},V$g.prototype.getBuffer=function(e){this._func=e},V$g.prototype.build=function(){""===this._name&&(this._name="profile"+this._scene._analyst3D._layerIndex,this._downName=this._name+"_down",this._downReverName=this._name+"_downRever",this._leftName=this._name+"_left",this._leftReverName=this._name+"_leftRever",this._topName=this._name+"_top",this._scene._analyst3D.add(this))},V$g.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport,e$28(this._depthBuffer)&&(this._depthBuffer._visibleViewport=this._visibleViewport),e$28(this._depthDownBuffer)&&(this._depthDownBuffer._visibleViewport=this._visibleViewport),e$28(this._depthDownReverBuffer)&&(this._depthDownReverBuffer._visibleViewport=this._visibleViewport),e$28(this._depthLeftBuffer)&&(this._depthLeftBuffer._visibleViewport=this._visibleViewport),e$28(this._depthLeftReverBuffer)&&(this._depthLeftReverBuffer._visibleViewport=this._visibleViewport),e$28(this._depthTopBuffer)&&(this._depthTopBuffer._visibleViewport=this._visibleViewport)},V$g.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},V$g.prototype.destroy=function(){return e$28(this._frameState)&&(e$28(this._depthBuffer)&&delete this._frameState._framebufferList[this._name],e$28(this._depthDownBuffer)&&delete this._frameState._framebufferList[this._downName],e$28(this._depthDownReverBuffer)&&delete this._frameState._framebufferList[this._downReverName],e$28(this._depthLeftBuffer)&&delete this._frameState._framebufferList[this._leftName],e$28(this._depthLeftReverBuffer)&&delete this._frameState._framebufferList[this._leftReverName],e$28(this._depthTopBuffer)&&delete this._frameState._framebufferList[this._topName],this._frameState=void 0),this._depthBuffer=this._depthBuffer&&this._depthBuffer.destroy(),this._depthDownBuffer=this._depthDownBuffer&&this._depthDownBuffer.destroy(),this._depthDownReverBuffer=this._depthDownReverBuffer&&this._depthDownReverBuffer.destroy(),this._depthLeftBuffer=this._depthLeftBuffer&&this._depthLeftBuffer.destroy(),this._depthLeftReverBuffer=this._depthLeftReverBuffer&&this._depthLeftReverBuffer.destroy(),this._depthTopBuffer=this._depthTopBuffer&&this._depthTopBuffer.destroy(),this._depthValue=null,this._dataBuffer=null,this._func=void 0,this._scene._analyst3D.remove(this._name,!0),i$Z(this)};var _0x3dd5eb=(_0x266e47=!0,function(e,t){var i=_0x266e47?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x266e47=!1,i}),_0x38fc44=_0x3dd5eb(void 0,(function(){return _0x38fc44.toString().search("(((.+)+)+)+$").toString().constructor(_0x38fc44).search("(((.+)+)+)+$")})),_0x266e47;_0x38fc44();var Ee$7="attribute vec4 aPosition;\n\nvarying vec4 vClip_pos;\nvoid main()\n{\n\tvClip_pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n\tgl_Position = czm_depthClampFarPlane(vClip_pos);\n}",_0x3aa467=(_0x4a2203=!0,function(e,t){var i=_0x4a2203?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4a2203=!1,i}),_0x18e8fe=_0x3aa467(void 0,(function(){return _0x18e8fe.toString().search("(((.+)+)+)+$").toString().constructor(_0x18e8fe).search("(((.+)+)+)+$")})),_0x4a2203;_0x18e8fe();var We$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform mat4 uRenderTextureMatrix;\nuniform vec2 uTexture1_size;\nuniform sampler2D uTexture1;\nuniform sampler2D uDiffuseTexture;\nuniform float uFeatheringScale;\nuniform vec3 uV3AffineX;\nuniform vec3 uV3AffineY;\n#ifdef CLIPPOLYGON\nuniform sampler2D uPolygonTexture;\nuniform mat4 uPolygonTextureMatrix;\nuniform float uPolygonMode;\n#endif\n\nvarying vec4 vClip_pos;\n\nconst float oldFeatureingRadius = 0.707;\nvec4 feathering(vec4 oldColor, vec2 texCoord){\n float disToCenter = length(texCoord - vec2(0.5));\n float roundRadius = oldFeatureingRadius * (1.0 - uFeatheringScale);\n float disToRoundBounds = disToCenter - roundRadius;\n float featheringAlpha = min(1.0, 1.0 - disToRoundBounds / (oldFeatureingRadius - roundRadius));\n return vec4(oldColor.rgb, featheringAlpha);\n}\nfloat getDepth(in vec4 depth)\n{\n\tfloat z_window = czm_unpackDepth(depth);\n\tfloat n_range = czm_depthRange.near;\n\tfloat f_range = czm_depthRange.far;\n\treturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\n\nfloat getDepthFromShadowMap(in sampler2D viewShedTexture, in vec4 texCoord)\n{\n\tvec2 tCoord;\n tCoord = texCoord.xy * uTexture1_size - 0.5;\n\tfloat x0 = floor(tCoord.x);\n\tfloat x1 = ceil(tCoord.x);\n\tfloat y0 = floor(tCoord.y);\n\tfloat y1 = ceil(tCoord.y);\n\tvec2 invTexSize = 1.0 / uTexture1_size;\n\tvec2 t00 = vec2((x0 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t10 = vec2((x1 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t01 = vec2((x0 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tvec2 t11 = vec2((x1 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tfloat z00 = getDepth(texture2D(uTexture1, t00));\n\tfloat z10 = getDepth(texture2D(uTexture1, t01));\n\tfloat z01 = getDepth(texture2D(uTexture1, t10));\n\tfloat z11 = getDepth(texture2D(uTexture1, t11));\n\tfloat depth = max(max(z00, z01), max(z10, z11));\n\treturn depth;\n}\n#ifdef CLIPPOLYGON\nbool isClipValid(vec2 texcoord)\n{\n bool clipInside = (uPolygonMode < 0.5);\n if(clipInside)\n {\n return texture2D(uPolygonTexture, texcoord).r > 0.5;\n }\n else\n {\n return texture2D(uPolygonTexture, texcoord).r < 0.5;\n }\n}\n#endif\n\nvoid main()\n{\n czm_writeDepthClampedToFarPlane();\n\tvec4 depthTexCoord = vClip_pos / vClip_pos.w;\n\tdepthTexCoord.xy = depthTexCoord.xy * 0.5 + 0.5;\n\tfloat sceneDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, depthTexCoord.xy));\n\tsceneDepth = czm_reverseLogDepth(sceneDepth);\n\tsceneDepth = sceneDepth * 2.0 - 1.0;\n\tvec4 pos = vClip_pos;\n\tpos.z = sceneDepth * pos.w;\n\tvec4 viewPos = czm_inverseProjection * pos;\n\tvec4 renderTextureCoord = uRenderTextureMatrix * viewPos;\n\tvec4 texCoord = renderTextureCoord / renderTextureCoord.w;\n\ttexCoord.xyz = texCoord.xyz * 0.5 + 0.5;\n\tif(texCoord.x < 0.0 || texCoord.x > 1.0 || texCoord.y < 0.0 || texCoord.y > 1.0)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIPPOLYGON\n vec4 polygonTextureCoord = uPolygonTextureMatrix * viewPos;\n\tvec4 texCoordPolygon = polygonTextureCoord / polygonTextureCoord.w;\n\ttexCoordPolygon.xyz = texCoordPolygon.xyz * 0.5 + 0.5;\n\tif(texCoordPolygon.x < 0.0 || texCoordPolygon.x > 1.0 || texCoordPolygon.y < 0.0 || texCoordPolygon.y > 1.0)\n\t{\n\t\tdiscard;\n }\n\tif(!isClipValid(texCoordPolygon.xy))\n {\n discard;\n }\n#endif\n\tfloat depth = getDepthFromShadowMap(uTexture1, texCoord);\n\tdepth = depth * 0.5 + 0.5;\n\tfloat dxc = abs(dFdx(texCoord.z));\n\tfloat dyc = abs(dFdy(texCoord.z));\n\tfloat dF = max(dxc, dyc) * 3.0;\n\tfloat bias = 1.0e-6 + dF;\n\tif(depth + 0.00002 < texCoord.z)\n\t{\n\t\tdiscard;\n\t}\n\tvec2 finalTexCoord = texCoord.xy;\n texCoord.x = uV3AffineX.x * finalTexCoord.x + uV3AffineX.y * finalTexCoord.y + uV3AffineX.z;\n texCoord.y = uV3AffineY.x * finalTexCoord.x + uV3AffineY.y * finalTexCoord.y + uV3AffineY.z;\n if(texCoord.x > 1.0 || texCoord.y > 1.0 || texCoord.x < 0.0 || texCoord.y < 0.0)\n {\n discard;\n }\n\tgl_FragColor = texture2D(uDiffuseTexture, texCoord.xy);\n\tgl_FragColor = feathering(gl_FragColor, texCoord.xy);\n\tgl_FragColor.rgb = czm_adjustColor(gl_FragColor.rgb);\n}",_0x2d018=(_0x1f5bc6=!0,function(e,t){var i=_0x1f5bc6?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1f5bc6=!1,i}),_0x2f73ad=_0x2d018(void 0,(function(){return _0x2f73ad.toString().search("(((.+)+)+)+$").toString().constructor(_0x2f73ad).search("(((.+)+)+)+$")})),_0x1f5bc6;_0x2f73ad();var _0x5bc7ed={ProjectToScene:0,ProjectToPlane:1},Q$g=Object.freeze(_0x5bc7ed);function b$q(e){if(!e$28(e))throw new t$Z("scene are required.");if(!e.context.depthTexture)throw new t$Z("the depth buffer is not supported.");this._scene=e,this._cameraDepthBuffer=void 0,this._clearStencilCommand=new r$11({stencil:0}),this._clearStencilCommand.pass=Le$p.ANALYSIS,this._lineCommand=void 0,this._stencilCommand=void 0,this._colorCommand=void 0,this._boundingSphere=new i$19,this._frameState=void 0,this._viewPosition=[0,0,0],this._direction=0,this._pitch=0,this._roll=0,this._horizontalFov=90,this._verticalFov=60,this._distance=200,this._hintLineColor=new e$25(1,1,1,1),this._hintLineVisible=!0,this._texture=void 0,this._segmentCount=20,this._invertViewMatrix=new y$15,this._viewProjMatrix=new y$15,this._renderTextureMatrix=new y$15,this._update=!0,this._id=0,this._name="",this._cameraName="",this._visibleViewport=4095,this._video=void 0,this._hasExcavation=!1,this._polygonTexture=void 0,this._polygonRegions=new e$1P,this._polygonTextureMatrix=new y$15,this._polygonViewProjMatrix=new y$15,this._polygonUpdate=!1,this._polygonMode=Ge$8.CLIP_OUTSIDE,this._brightness=1,this._contrast=1,this._hue=0,this._saturation=1,this._gamma=1,this._featheringScale=0,this._v3AffineX=new t$X(1,0,0),this._v3AffineY=new t$X(0,1,0),this._visible=!0,this._boundingSphereFromXML=void 0,this._visibleDistanceMax=500,this._mode=Q$g.ProjectToScene,this._planeRegions=void 0,this._projectEvent=new o$1o,this._projectPlaneOffset=1,this._guid=e$1K(),this._fusionAlpha=1,this._minDepth=.9999}function Ce$6(e){e$28(e._stencilCommand)&&(e._stencilCommand.vertexArray=e._stencilCommand.vertexArray&&e._stencilCommand.vertexArray.destroy(),e._stencilCommand.shaderProgram=e._stencilCommand.shaderProgram&&e._stencilCommand.shaderProgram.destroy(),e._stencilCommand=void 0),e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0),e$28(e._lineCommand)&&(e._lineCommand.vertexArray=e._lineCommand.vertexArray&&e._lineCommand.vertexArray.destroy(),e._lineCommand.shaderProgram=e._lineCommand.shaderProgram&&e._lineCommand.shaderProgram.destroy(),e._lineCommand=void 0),e$28(e._planeCommand)&&(e._planeCommand.vertexArray=e._planeCommand.vertexArray&&e._planeCommand.vertexArray.destroy(),e._planeCommand.shaderProgram=e._planeCommand.shaderProgram&&e._planeCommand.shaderProgram.destroy(),e._planeCommand=void 0)}function Ke$3(e,t,i){var r=e._horizontalFov*e$27.RADIANS_PER_DEGREE,n=e._verticalFov*e$27.RADIANS_PER_DEGREE,o=Math.tan(.5*r)/Math.tan(.5*n);e._distance;var a=Math.max(e._distance,10),s=e._direction*e$27.RADIANS_PER_DEGREE,l=e._pitch*e$27.RADIANS_PER_DEGREE,u=e._roll*e$27.RADIANS_PER_DEGREE,c=t$X.fromDegreesArrayHeights(e._viewPosition,e._scene._globe.ellipsoid)[0],h=i.camera,d=h.frustum.aspectRatio,f=h.frustum.fov,p=h.frustum.near,_=h.frustum.far,m=new t$X,$=h.heading,g=h.pitch,v=h.roll;t$X.clone(h.position,m),e._cameraDepthBuffer.isUpdate=!0;var y=i.useLogDepth;e._cameraDepthBuffer._beginFunc=function(){i.useLogDepth=!1,d=h.frustum.aspectRatio,f=h.frustum.fov,p=h.frustum.near,_=h.frustum.far,$=h.heading,g=h.pitch,v=h.roll,t$X.clone(h.position,m),h.frustum.aspectRatio=o,h.frustum.fov=o>=1?r:n,h.frustum.near=1,h.frustum.far=a,y&&(h.frustum.near=.1,h.frustum.far=1e8),h.setView({destination:c,orientation:{heading:s,pitch:l,roll:u}}),y$15.multiply(h.frustum.projectionMatrix,h.viewMatrix,e._viewProjMatrix),y$15.clone(h.inverseViewMatrix,e._invertViewMatrix),t$X.clone(t$X.ZERO,e._boundingSphere.center),e._boundingSphere.radius=e._distance,i$19.transform(e._boundingSphere,e._invertViewMatrix,e._boundingSphere)},e._cameraDepthBuffer._endFunc=function(){h.setView({destination:m,orientation:{heading:$,pitch:g,roll:v},convert:!1}),h.frustum.aspectRatio=d,h.frustum.fov=f,h.frustum.near=p,h.frustum.far=_,i.useLogDepth=y,e._cameraDepthBuffer.isUpdate=!1}}Object.defineProperties(b$q.prototype,{viewPosition:{get:function(){return this._viewPosition},set:function(e){this._viewPosition=e,this._update=!0}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._update=!0}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._update=!0}},roll:{get:function(){return this._roll},set:function(e){this._roll=e,this._update=!0}},horizontalFov:{get:function(){return this._horizontalFov},set:function(e){this._horizontalFov=e,this._update=!0}},verticalFov:{get:function(){return this._verticalFov},set:function(e){this._verticalFov=e,this._update=!0}},distance:{get:function(){return this._distance},set:function(e){if(e<=0)throw new t$Z("the distance is greater than 0.0");this._distance=e,this._update=!0}},featheringScale:{get:function(){return this._featheringScale},set:function(e){if(e<0||e>1)throw new t$Z("the distance is greater than 0.0 an less than 1.0");this._featheringScale=e}},hintLineColor:{get:function(){var e=new e$1S;return e.red=this._hintLineColor.x,e.green=this._hintLineColor.y,e.blue=this._hintLineColor.z,e.alpha=this._hintLineColor.w,e},set:function(e){this._hintLineColor.x=e.red,this._hintLineColor.y=e.green,this._hintLineColor.z=e.blue,this._hintLineColor.w=e.alpha}},hintLineVisible:{get:function(){return this._hintLineVisible},set:function(e){this._hintLineVisible=e}},brightness:{get:function(){return this._brightness},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("ProjectionImage.brightness",e,0),this._brightness=e}},contrast:{get:function(){return this._contrast},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("ProjectionImage.contrast",e,0),this._contrast=e}},hue:{get:function(){return this._hue},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("ProjectionImage.hue",e,0),this._hue=e}},saturation:{get:function(){return this._saturation},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("ProjectionImage.saturation",e,0),this._saturation=e}},gamma:{get:function(){return this._gamma},set:function(e){o$1u.typeOf.number.greaterThan("ProjectionImage.gamma",e,0),this._gamma=e}},visible:{get:function(){return this._visible},set:function(e){o$1u.typeOf.bool("ProjectionImage.visible",e),this._visible=e}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(e){o$1u.typeOf.number("ProjectionImage.visibleDistance",e),this._visibleDistanceMax=e}},mode:{get:function(){return this._mode},set:function(e){this._mode=e}},projectEvent:{get:function(){return this._projectEvent}},fusionAlpha:{get:function(){return this._fusionAlpha},set:function(e){this._fusionAlpha=e}}});var we$8=new e$25,ge$9=new e$25(1,1/255,1/65025,1/16581375);function I$p(e,t,i,r,n,o){var a=t.context.readPixels({x:i,y:r,width:1,height:1,framebuffer:e._cameraDepthBuffer._framebuffer}),s=e$25.unpack(a,0,we$8);e$25.divideByScalar(s,255,s);var l=e$25.dot(s,ge$9);0!==l?e._minDepth=Math.min(e._minDepth,l):l=e._minDepth;var u=new e$25(n,o,2*l-1,1),c=new e$25,h=y$15.inverse(e._viewProjMatrix,new y$15),d=y$15.multiplyByVector(h,u,c),f=1/d.w;return t$X.multiplyByScalar(d,f,d)}function Pe$7(e,t){var i=e._scene,r=i.screenSpaceCameraController;r.enableFusion||(r.enableFusion=!0),e$28(t.curFusionViewMatrix)||(t.curFusionViewMatrix=y$15.clone(t.uniformState.view,new y$15));var n=I$p(e,i,0,0,-1,-1),o=I$p(e,i,i.drawingBufferWidth-1,0,1,-1),a=I$p(e,i,i.drawingBufferWidth-1,i.drawingBufferHeight-1,1,1),s=I$p(e,i,0,i.drawingBufferHeight-1,-1,1);if(m$W.wgs84ToDrawingBufferCoordinates(i,n,n),m$W.wgs84ToDrawingBufferCoordinates(i,o,o),m$W.wgs84ToDrawingBufferCoordinates(i,a,a),m$W.wgs84ToDrawingBufferCoordinates(i,s,s),e$28(n)&&e$28(o)&&e$28(a)&&e$28(s)){e$28(r.panOffset)&&(n.x+=r.panOffset.x,o.x+=r.panOffset.x,a.x+=r.panOffset.x,s.x+=r.panOffset.x,n.y+=r.panOffset.y,o.y+=r.panOffset.y,a.y+=r.panOffset.y,s.y+=r.panOffset.y),r.zoomDirty=!1,r.panDirty=!1;for(var l=[n.x,n.y,o.x,o.y,a.x,a.y,s.x,s.y],u=i.drawingBufferWidth,c=i.drawingBufferHeight,h=0,d=l.length;h<d;h++){var f=l[h];f=2*(f=h%2==0?f/u:1-f/c)-1,l[h]=f}var p=new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:l}),textureCoordinates:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:W$_.TRIANGLES}),_=new r$15({vertexArray:m$19.fromGeometry({context:t,geometry:p,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:A$1c.STATIC_DRAW,interleave:!0}),primitiveType:W$_.TRIANGLES,renderState:u$R.fromCache({blending:Ee$n.ALPHA_BLEND}),shaderProgram:S$T.fromCache({context:t,vertexShaderSource:"\n attribute vec4 position;\n attribute vec2 textureCoordinates;\n varying vec2 v_textureCoordinates;\n void main() \n {\n gl_Position = position;\n v_textureCoordinates = textureCoordinates;\n }\n ",fragmentShaderSource:"\n uniform sampler2D u_Texture;\n uniform float uFusionAlpha;\n varying vec2 v_textureCoordinates;\n void main()\n {\n gl_FragColor = texture2D(u_Texture, v_textureCoordinates);\n gl_FragColor.a = uFusionAlpha;\n }\n ",attributeLocations:{position:0,textureCoordinates:1}}),uniformMap:{u_Texture:function(){return e._texture},uFusionAlpha:function(){return e._fusionAlpha}},owner:e});_.pass=Le$p.OVERLAY_AGAINST_DEPTH,e._planeCommand=_}}function Qe$4(e,t,i){for(var r=(e._segmentCount+1)*(e._segmentCount+1)+1,n=S$W.createTypedArray(S$W.FLOAT,3*r),o=3,a=e._horizontalFov*e$27.RADIANS_PER_DEGREE,s=e._verticalFov*e$27.RADIANS_PER_DEGREE,l=Math.tan(.5*a),u=Math.tan(.5*s),c=(e._distance,e._distance*u),h=Math.PI-.5*a,d=0,f=0,p=a/e._segmentCount,_=0;_<e._segmentCount+1;_++){d=h+_*p;for(var m=c/(e._distance/Math.cos(d)),$=Math.atan(m),g=-$,v=2*$/e._segmentCount,y=0;y<e._segmentCount+1;y++)f=g+y*v,n[o++]=e._distance*Math.cos(f)*Math.sin(d),n[o++]=e._distance*Math.sin(f),n[o++]=e._distance*Math.cos(f)*Math.cos(d)}var x=2*(4+5*e._segmentCount+2*e._segmentCount*3),b=e._segmentCount*e._segmentCount*3*2+3*e._segmentCount*4,w=S$W.createTypedArray(S$W.UNSIGNED_SHORT,x),C=S$W.createTypedArray(S$W.UNSIGNED_SHORT,b),T=0;for(_=0;_<e._segmentCount;_++)for(y=0;y<e._segmentCount;y++)C[T++]=1+_+y*(e._segmentCount+1),C[T++]=1+_+1+y*(e._segmentCount+1),C[T++]=1+_+(y+1)*(e._segmentCount+1),C[T++]=1+_+1+y*(e._segmentCount+1),C[T++]=1+_+1+(y+1)*(e._segmentCount+1),C[T++]=1+_+(y+1)*(e._segmentCount+1);for(_=0;_<e._segmentCount;_++)C[T++]=_+1+1,C[T++]=_+1,C[T++]=0,C[T++]=0,C[T++]=_+e._segmentCount*(e._segmentCount+1)+1,C[T++]=_+1+e._segmentCount*(e._segmentCount+1)+1;for(_=0;_<e._segmentCount;_++)C[T++]=0,C[T++]=_*(e._segmentCount+1)+1,C[T++]=(_+1)*(e._segmentCount+1)+1,C[T++]=e._segmentCount+(_+1)*(e._segmentCount+1)+1,C[T++]=e._segmentCount+_*(e._segmentCount+1)+1,C[T++]=0;T=0,w[T++]=0,w[T++]=1,w[T++]=0,w[T++]=e._segmentCount+1,w[T++]=0,w[T++]=e._segmentCount*(e._segmentCount+1)+1,w[T++]=0,w[T++]=(e._segmentCount+1)*(e._segmentCount+1);for(_=0;_<5;_++)for(y=0;y<e._segmentCount;y++)w[T++]=1+y+5*(e._segmentCount+1)*_,w[T++]=1+(y+1)+5*(e._segmentCount+1)*_;for(_=0;_<5;_++)for(y=0;y<e._segmentCount;y++)w[T++]=1+(e._segmentCount+1)*y+5*_,w[T++]=1+(e._segmentCount+1)*(y+1)+5*_;var S=h$W.createVertexBuffer({context:t,typedArray:n,usage:A$1c.STATIC_DRAW}),E=[],A={aPosition:0};E.push({index:A.aPosition,vertexBuffer:S,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1});var P=h$W.createIndexBuffer({context:t,typedArray:w,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),I=h$W.createIndexBuffer({context:t,typedArray:C,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});e._lineCommand=new r$15({primitiveType:W$_.LINES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!0}),e._lineCommand.vertexArray=new m$19({context:t,attributes:E,indexBuffer:P}),e._lineCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:A}),e._lineCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}});var M=[];for(_=0;_<6;_++)M[_]=new e$25(0,0,0,0);e._lineCommand.uniformMap={uDiffuseColor:function(){return e._hintLineColor},clip_mode:function(){return 0},clip_planes:function(){return M},clip_line_color:function(){return e$25.UNIT_W}},e._stencilCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ProjectionImage,owner:e,cull:!0}),e._stencilCommand.vertexArray=new m$19({context:t,attributes:E,indexBuffer:I}),e._stencilCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:A});var O=e._mode===Q$g.ProjectToPlane?{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.DECREMENT_WRAP,zPass:n$12.KEEP},reference:0,mask:1}:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.INCREMENT_WRAP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:-1};e._stencilCommand.renderState=u$R.fromCache({depthMask:!1,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0},stencilTest:O,stencilMask:1}),e._stencilCommand.uniformMap={uDiffuseColor:function(){return e$25.UNIT_W},clip_mode:function(){return 0},clip_planes:function(){return M},clip_line_color:function(){return e$25.UNIT_W}},e._colorCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ProjectionImage,owner:e,cull:!0}),e._colorCommand.vertexArray=new m$19({context:t,attributes:E,indexBuffer:I});var D=new a$$({name:"ViewShedAnalysisVp",sources:[Ee$7]});e._colorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:D,fragmentShaderSource:We$4,attributeLocations:A}),O=e._mode===Q$g.ProjectToPlane?{enabled:!0,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:3,mask:3}:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:-1},e._colorCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!1},depthMask:!1,stencilTest:O,blending:Ee$n.ALPHA_BLEND}),e._colorCommand.uniformMap={uRenderTextureMatrix:function(){return e._renderTextureMatrix},uPolygonTextureMatrix:function(){return e._polygonTextureMatrix},uTexture1_size:function(){var t=e._cameraDepthBuffer.depthTexture;return new o$1k(t.width,t.height)},uTexture1:function(){return e._cameraDepthBuffer.depthTexture},uDiffuseTexture:function(){return e._texture},uPolygonTexture:function(){return e._polygonTexture},uPolygonMode:function(){return e._polygonMode},uBrightness:function(){return e._brightness},uContrast:function(){return e._contrast},uHue:function(){return e._hue},uSaturation:function(){return e._saturation},uOneOverGamma:function(){return 1/e._gamma},uFeatheringScale:function(){return e._featheringScale},uV3AffineX:function(){return e._v3AffineX},uV3AffineY:function(){return e._v3AffineY}}}function be$7(e,t,i){return t$X.distance(e.positionWC,t.center)>i||e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC).computeVisibility(t)===pt$a.OUTSIDE}function Ae$7(e){var t=s$P.queryStringValue(e,"VideoName"),i=s$P.queryFirstNode(e,"Fov"),r=s$P.queryNumericValue(i,"Horizontal"),n=s$P.queryNumericValue(i,"Vertical"),o=s$P.queryNumericValue(e,"Distance"),a=s$P.queryNumericValue(e,"Heading"),s=s$P.queryNumericValue(e,"Pitch"),l=s$P.queryNumericValue(e,"Roll"),u=s$P.queryFirstNode(e,"ViewPosition"),c=[0,0,0];c[0]=s$P.queryNumericValue(u,"X"),c[1]=s$P.queryNumericValue(u,"Y"),c[2]=s$P.queryNumericValue(u,"Z");var h=s$P.queryFirstNode(e,"Matrix"),d=s$P.queryStringValue(h,"U"),f=s$P.queryStringValue(h,"V");s$P.queryStringValue(h,"W");var p=d.split(","),_=new t$X(parseFloat(p[0]),parseFloat(p[1]),parseFloat(p[2])),m=f.split(","),$=new t$X(parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])),g=s$P.queryFirstNode(e,"Bounds"),v=void 0;if(g){var y=e$27.toRadians(s$P.queryNumericValue(g,"Left")),x=e$27.toRadians(s$P.queryNumericValue(g,"Top")),b=e$27.toRadians(s$P.queryNumericValue(g,"Right")),w=new h$10(y,e$27.toRadians(s$P.queryNumericValue(g,"Bottom")),b,x),C=o*Math.cos(e$27.toRadians(s));C=s<0?-C:C;var T=c[2]+C;v=i$19.fromRectangle3D(w,void 0,T)}return{videoName:t,viewPosition:c,heading:a,pitch:s,roll:l,horizontalFov:r,verticalFov:n,matrixU:_,matrixV:$,distance:o,boundingSphere:v}}function Ze$2(e,t){var i=document.getElementById("projection-image");e$28(i)||((i=document.createElement("div")).setAttribute("id","projection-image"),document.body.appendChild(i));var r=document.createElement("video");return r.style="visibility:hidden;position:absolute;top:0px;left:0px;",r.setAttribute("width","320"),r.setAttribute("height","240"),r.setAttribute("autoplay","autoplay"),r.setAttribute("loop","loop"),r.setAttribute("crossorigin","crossorigin"),r.setAttribute("src",e),r.setAttribute("id","projection-image-"+t),i.appendChild(r),r}function Je$2(e,t){for(var i=t$X.fromDegreesArrayHeights(t),r=new U$Q({polygonHierarchy:{positions:i},vertexFormat:{bitangent:!1,color:!1,normal:!1,position:!0,st:!1,tangent:!1},perPositionHeight:!0}),n=U$Q.createGeometry(r),o=[],a=1;a<i.length-1;a++)o.push(0),o.push(a),o.push(a+1);n.indices=o;var s=new y$15;y$15.inverse(e._invertViewMatrix,s),f$X.updateGeometry(n,t,s);var l=new f$X;return l._geometry=n,l}function $e$2(e,t,i){if(e._polygonUpdate&&0!==e._polygonRegions.values.length){e._polygonUpdate=!1;var r=new r$11({color:new e$1S(0,0,0,0),depth:1});r.framebuffer=new a$z({context:t,colorTextures:[e._polygonTexture],destroyAttachments:!1}),r.renderState=u$R.fromCache(),r.execute(t);for(var n=0;n<e._polygonRegions.values.length;n++){var o=e._polygonRegions.values[n];Ie$8(e,t,o,e._polygonTexture),o._command.execute(t)}r.framebuffer.destroy()}}function Ie$8(e,t,i,r){if(e$28(i)&&!e$28(i._command)){var n=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix});i._command=n;var o={position:0};n.vertexArray=m$19.fromGeometry({context:t,geometry:i._geometry,attributeLocations:o,bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var a=new a$$({sources:["attribute vec4 position;\nvoid main()\n{\n gl_Position = czm_modelViewProjection * vec4(position.xyz, 1.0);\n}\n"]}),s=new a$$({sources:["void main()\n{\n gl_FragColor = vec4(1.0);\n}\n"]});n.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:o}),n.framebuffer=new a$z({context:t,colorTextures:[r],destroyAttachments:!1}),n.renderState=u$R.fromCache({cull:{enabled:!1}})}}function ne$b(e,t){if(e$28(e._colorCommand)){var i=e._scene._context,r=e._colorCommand.shaderProgram.fragmentShaderSource,n=e._colorCommand.shaderProgram.vertexShaderSource,o=r.defines.indexOf("CLIPPOLYGON");t?o<0&&r.defines.push("CLIPPOLYGON"):o>=0&&r.defines.splice(o,1),e._colorCommand.shaderProgram.destroy(),e._colorCommand.shaderProgram=S$T.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:e._attributeLocations})}}function t$b(){}b$q.prototype.update=function(e,t,i){if(!t._fboState.enabled&&this._visible){var r=t.camera;if(!r.bReflect&&(!e$28(this._boundingSphereFromXML)||!be$7(r,this._boundingSphereFromXML,this._visibleDistanceMax))&&(0===this._boundingSphere.radius||this._update||!be$7(r,this._boundingSphere,this._visibleDistanceMax))&&(y$15.multiply(this._viewProjMatrix,r.inverseViewMatrix,this._renderTextureMatrix),y$15.multiply(this._polygonViewProjMatrix,r.inverseViewMatrix,this._polygonTextureMatrix),e$28(this._video)&&this._video.readyState>=2&&(e$28(this._texture)&&this._texture!==e.defaultTexture?this._texture.copyFrom(this._video):this._texture=new L$17({context:e,source:this._video})),e$28(this._texture))){var n=this._scene;if(this._update&&(this._frameState=t,e$28(this._cameraDepthBuffer)||(this._cameraDepthBuffer=new s$h(e),this._cameraDepthBuffer.environmentVisible.isGlobalVisible=!0,this._cameraDepthBuffer.environmentVisible.isObjectVisible=!0,t._framebufferList[this._cameraName]=this._cameraDepthBuffer),this._update=!1,Ce$6(this),Ke$3(this,e,t),Qe$4(this,e)),this._polygonUpdate&&$e$2(this,e),e$28(this._cameraDepthBuffer.depthTexture)){if(!e$28(this._planeCommand)&&this._mode===Q$g.ProjectToPlane&&(Pe$7(this,e),e$28(this._fusionLayers)&&this._fusionLayers.length>0))for(var o=0,a=this._fusionLayers.length;o<a;o++){var s=this._fusionLayers[o];s.enableFusion=!0,s.panOffset=n.screenSpaceCameraController.panOffset}if(e$28(this._planeCommand)&&this._mode===Q$g.ProjectToPlane)return(n.screenSpaceCameraController.panDirty||n.screenSpaceCameraController.zoomDirty)&&(this._planeCommand.vertexArray=this._planeCommand.vertexArray&&this._planeCommand.vertexArray.destroy(),this._planeCommand.shaderProgram=this._planeCommand.shaderProgram&&this._planeCommand.shaderProgram.destroy(),Pe$7(this,e)),void i.push(this._planeCommand);var l=i.pop();if(!e$28(l))return;e$28(this._clearStencilCommand)&&i.push(this._clearStencilCommand),e$28(this._stencilCommand)&&i.push(this._stencilCommand),e$28(this._colorCommand)&&i.push(this._colorCommand),e$28(this._lineCommand)&&this._hintLineVisible&&i.push(this._lineCommand),i.push(l)}}}},b$q.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~3");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport,e$28(this._cameraDepthBuffer)&&(this._cameraDepthBuffer._visibleViewport=this._visibleViewport)},b$q.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~3");return 1<<e&this._visibleViewport},b$q.prototype.setImage=function(e){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.url)&&!e$28(e.video)&&!e$28(e.image))throw new t$Z("options.url or options.video or options.image are required.");if(e$28(e.url)){var t=e.url,i=this;o$1q(t$D(t),(function(e){i._texture!==i._scene._context.defaultTexture&&(i._texture=i._texture&&i._texture.destroy()),i._texture=new L$17({context:i._scene._context,source:e})}))}else e$28(e.image)?e$28(this._texture)?this._texture.copyFrom(e.image):this._texture=new L$17({context:this._scene._context,source:e.image}):this._video=e.video},b$q.prototype.setDistDirByPoint=function(e){if(e[0]===this._viewPosition[0]&&e[1]===this._viewPosition[1]&&e[2]===this._viewPosition[2])throw new t$Z("the position is [longitude, latitude ,height] and is not equals viewPosition");var t,i,r=(l=this._scene._frameState.camera)._projection;if(this._scene.mode===P$$.SCENE3D)t=t$X.fromDegreesArrayHeights(e)[0],i=t$X.fromDegreesArrayHeights(this._viewPosition)[0];else{var n=t$W.fromDegrees(e[0],e[1],e[2]);t=r.project(n,new t$X);var o=t$W.fromDegrees(this._viewPosition[0],this._viewPosition[1],this._viewPosition[2]);i=r.project(o,new t$X)}var a=new t$X;t$X.subtract(t,i,a);var s=t$X.magnitude(a);t$X.normalize(a,a),this.distance=s;var l,u=(l=this._scene._frameState.camera).heading,c=l.pitch,h=l.roll,d=new t$X;t$X.clone(l.position,d);var f=a.clone(),p=i.clone();p=t$X.normalize(p,p),Math.abs(t$X.dot(p,f))>=1&&(p=Math.abs(t$X.dot(f,t$X.UNIT_Y))<1?t$X.clone(t$X.UNIT_Y,p):t$X.clone(t$X.UNIT_Z,p));var _=new t$X;t$X.cross(p,f,_),_=t$X.normalize(_,_),t$X.cross(f,_,p),p=t$X.normalize(p,p),l.setView({destination:i,orientation:{direction:f,up:p},convert:!1}),this.direction=l.heading*e$27.DEGREES_PER_RADIAN,this.pitch=l.pitch*e$27.DEGREES_PER_RADIAN,l.setView({destination:d,orientation:{heading:u,pitch:c,roll:h},convert:!1})},b$q.prototype.pixelToWorldCoordinates=function(e,t){var i=this._scene.context,r=this._texture.width,n=this._texture.height,o=e/r*i.drawingBufferWidth,a=i.drawingBufferHeight-t/n*i.drawingBufferHeight;i.drawingBufferHeight;var s=i.readPixels({x:o,y:a,width:1,height:1,framebuffer:this._cameraDepthBuffer.framebuffer}),l=e$25.unpack(s,0,we$8);e$25.divideByScalar(l,255,l);var u=e$25.dot(l,ge$9),c=y$15.inverse(this._viewProjMatrix,new y$15),h=new e$25,d=this._scene._view.passState.viewport;h.x=(o-d.x)/d.width*2-1,h.y=(a-d.y)/d.height*2-1,h.z=2*u-1,h.w=1;var f=y$15.multiplyByVector(c,h,new e$25);r=1/f.w;return t$X.multiplyByScalar(f,r,f),t$X.fromCartesian4(f,new t$X)},b$q.prototype.build=function(){""===this._name&&(this._name="projectionimage"+this._scene._analyst3D._layerIndex,this._cameraName=this._name+"_camera",this._scene._analyst3D.add(this))},b$q.prototype.setInfo=function(e){if(!e$28(e))throw new t$Z("No url provided.");var t=this;return d$17(e).then((function(e){var i=Ae$7(e.firstChild);t.direction=i.heading,t.pitch=u$Y(i.pitch,t.pitch),t._roll=u$Y(i.roll,t._roll),t.horizontalFov=i.horizontalFov,t.verticalFov=i.verticalFov,t$X.clone(i.matrixU,t._v3AffineX),t$X.clone(i.matrixV,t._v3AffineY),t.distance=i.distance,t.viewPosition=i.viewPosition,t._boundingSphereFromXML=i.boundingSphere})).otherwise((function(e){console.error(e)}))},b$q.fromInfo=function(e,t,i){if(!e$28(e))throw new t$Z("No scene provided.");if(!e$28(t))throw new t$Z("No url provided.");return d$17(t).then((function(r){for(var n={},o=r.firstChild,a=0,s=o.children.length;a<s;a++){var l=Ae$7(o.children[a]),u=l.videoName;u=e$28(i)?n$1c(i)+l.videoName:t.slice(0,t.lastIndexOf("/")+1)+l.videoName;var c=new b$q(e),h=Ze$2(u,c._guid);c.viewPosition=l.viewPosition,c.direction=l.heading,c.pitch=l.pitch,c.horizontalFov=l.horizontalFov,c.verticalFov=l.verticalFov,t$X.clone(l.matrixU,c._v3AffineX),t$X.clone(l.matrixV,c._v3AffineY),c.distance=l.distance,c.setImage({video:h}),c._boundingSphereFromXML=l.boundingSphere,h.addEventListener("loadeddata",function(e){e.build()}.bind(h,c)),n[l.videoName]=c}return n})).otherwise((function(e){console.error(e)}))},b$q.prototype.destroy=function(){var e=document.getElementById("projection-image-"+this._guid);if(e){var t=e.parentNode;t.removeChild(e),0===t.children.length&&t.parentNode.removeChild(t)}e$28(this._frameState)&&(e$28(this._cameraDepthBuffer)&&delete this._frameState._framebufferList[this._cameraName],this._frameState=void 0),this._cameraDepthBuffer=this._cameraDepthBuffer&&this._cameraDepthBuffer.destroy(),Ce$6(this),this._clearStencilCommand=void 0,this._texture!==this._scene._context.defaultTexture&&(this._texture=this._texture&&this._texture.destroy());for(var i=0;i<this._polygonRegions.values.length;i++)this._polygonRegions.values[i].destroy(),this._polygonRegions.values[i]=null;if(e$28(this._polygonTexture)&&(this._polygonTexture.destroy(),this._polygonTexture=null),this._scene._analyst3D.remove(this._name,!0),this._scene.context.curFusionViewMatrix=void 0,this._scene.screenSpaceCameraController.enableFusion=!1,e$28(this._fusionLayers)){i=0;for(var r=this._fusionLayers.length;i<r;i++){var n=this._fusionLayers[i];n.enableFusion&&(n.enableFusion=!1)}}return this._fusionLayers=void 0,i$Z(this)},b$q.prototype.setClipMode=function(e){this._polygonMode=e},b$q.prototype.addClipRegion=function(e){var t=e.name,i=e.position;if(!e$28(t)||!e$28(i))return!1;if(e$28(this._polygonRegions.get(t)))return!1;var r=this._scene._context.drawingBufferWidth,n=this._scene._context.drawingBufferHeight;e$28(this._polygonTexture)||(this._polygonTexture=new L$17({context:this._scene._context,width:r,height:n,pixelFormat:V$O.RGBA}));var o=Je$2(this,i);this._polygonRegions.set(t,o),this._polygonUpdate=!0;var a=this._frameState.camera;return y$15.multiply(a.frustum.projectionMatrix,a.viewMatrix,this._polygonViewProjMatrix),ne$b(this,!0),!0},b$q.prototype.removeClipRegion=function(e){return!!this._polygonRegions.remove(e)&&(this._polygonUpdate=!0,0===this._polygonRegions.values.length&&ne$b(this,!1),!0)},b$q.prototype.removeAllClipRegion=function(){for(var e=0;e<this._polygonRegions.values.length;e++)this._polygonRegions.values[e].destroy(),this._polygonRegions.values[e]=null;this._polygonRegions.removeAll(),this._polygonUpdate=!0,ne$b(this,!1)},b$q.prototype.setFusionLayers=function(e){Array.isArray(e)||(e=[e]),this._fusionLayers=e},t$b.drawSimplePolyline=function(e,t){var i,r=t.canvasPostions,n=u$Y(t.lineWidth,1),o=u$Y(t.lineColor,e$1S.WHITE),a=r.length;for(e.lineWidth=n,e.strokeStyle=o.toCssColorString(),e.beginPath(),e.moveTo(r[0].x,r[0].y),i=1;i<a;i++)e.lineTo(r[i].x,r[i].y);e.stroke()},t$b.drawPolygon=function(e,t){var i,r=t.canvasPostions,n=u$Y(t.lineWidth,1),o=u$Y(t.lineColor,e$1S.WHITE),a=u$Y(t.fillColor,e$1S.RED),s=r.length;for(e.lineWidth=n,e.strokeStyle=o.toCssColorString(),e.fillStyle=a.toCssColorString(),e.beginPath(),e.moveTo(r[0].x,r[0].y),i=1;i<s;i++)e.lineTo(r[i].x,r[i].y);e.closePath(),e.stroke(),e.fill()},Object.defineProperties(t$b.prototype,{}),t$b.prototype.destroy=function(){return i$Z(this)};var _0x10b0f7=(_0x47025f=!0,function(e,t){var i=_0x47025f?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x47025f=!1,i}),_0x44d727=_0x10b0f7(void 0,(function(){return _0x44d727.toString().search("(((.+)+)+)+$").toString().constructor(_0x44d727).search("(((.+)+)+)+$")})),_0x47025f;_0x44d727();var de$8="attribute vec4 aPosition;\nattribute vec2 aTexCoord0;\n#ifdef RENDER_POINT\nuniform float uPointSize;\n#endif\n\nvarying vec4 clip_vertex;\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\n\nvec4 depthClampFarPlane(vec4 clipPos)\n{\n\tfWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\n\tclipPos.z = min(clipPos.z, clipPos.w);\n\treturn clipPos;\n}\nvoid main()\n{\n vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n gl_Position = depthClampFarPlane(pos);\n vTexCoord = aTexCoord0.xy;\n clip_vertex = czm_modelView * vec4(aPosition.xyz, 1.0);\n#ifdef RENDER_POINT\n gl_PointSize = uPointSize;\n#endif\n}",_0x3ff797=(_0x39abc2=!0,function(e,t){var i=_0x39abc2?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x39abc2=!1,i}),_0x1755f8=_0x3ff797(void 0,(function(){return _0x1755f8.toString().search("(((.+)+)+)+$").toString().constructor(_0x1755f8).search("(((.+)+)+)+$")})),_0x39abc2;_0x1755f8();var ve$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform sampler2D uTexture0;\n\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\n\nfloat fade(in float low, in float high, in float value)\n{\n\tfloat mid = (low + high) * 0.5;\n\tfloat range = (high - low) * 0.5;\n\tfloat x = 1.0 - clamp(abs(mid - value) / range, 0.0, 1.0);\n\treturn x;\n}\n\nvec3 getColor(in float intensity)\n{\n\tvec3 blue = vec3(0.0, 0.0, 1.0);\n\tvec3 cyan = vec3(0.0, 1.0, 1.0);\n\tvec3 green = vec3(0.0, 1.0, 0.0);\n\tvec3 yellow = vec3(1.0, 1.0, 0.0);\n\tvec3 red = vec3(1.0, 0.0, 0.0);\n\tvec3 color = fade(-0.25, 0.25, intensity) * blue + fade(0.0, 0.5, intensity) * cyan + fade(0.25, 0.75, intensity) * green + \n\t\t\t\tfade(0.5, 1.0, intensity) * yellow + smoothstep(0.75, 1.0, intensity) * red;\n\treturn color;\n}\n#ifdef COLOR_TABLE\nuniform sampler2D uHypsometricTexture;\nvec4 getContourMapColor(in float intensity){\n float count = floor(intensity * 16.0);\n float y = (count * 2.0 + 1.0) / 32.0;\n float x = fract(intensity * 16.0);\n return texture2D(uHypsometricTexture, vec2(x, y));\n}\n#endif\n\nvoid main()\n{\n\tvec2 alphaTd = (gl_PointCoord - 0.5) * 2.0;\n float dist = 1.0 - length(alphaTd);\n\tif(dist < 0.1)\n\t{\n\t\tdiscard;\n\t}\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n#ifdef WEBGL2\n gl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n\tvec2 texcoord = vTexCoord.xy * 0.5 + 0.5;\n\tfloat fIntensity = czm_unpackDepth(texture2D(uTexture0, texcoord.xy));\n#ifdef COLOR_TABLE\n\tgl_FragColor = getContourMapColor(fIntensity);\n#else\n\tgl_FragColor = vec4(getColor(fIntensity), 1.0);\n#endif\n}",_0x330d24=(_0x8b9d84=!0,function(e,t){var i=_0x8b9d84?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x8b9d84=!1,i}),_0x40a1de=_0x330d24(void 0,(function(){return _0x40a1de.toString().search("(((.+)+)+)+$").toString().constructor(_0x40a1de).search("(((.+)+)+)+$")})),_0x8b9d84;_0x40a1de();var ce$9="attribute vec4 aPosition;\nattribute vec2 aTexCoord0;\n\n#ifdef RENDER_POINT\nuniform float uPointSize;\n#endif\n\nvarying vec4 vPositionEC;\nvarying vec2 vTexcoord;\n\nvoid main()\n{\n\tvTexcoord = aTexCoord0.xy * 0.5 + 0.5;\n\t//vTexcoord.y = 1.0 - vTexcoord.y;\n\tvPositionEC = czm_view * czm_model * vec4(aPosition.xyz, 1.0);\n\tgl_Position = vec4(aTexCoord0.xy, 0.5, 1.0);\n#ifdef RENDER_POINT\n\tgl_PointSize = uPointSize;\n#endif\n}",_0x11f6e9=(_0x1e6adf=!0,function(e,t){var i=_0x1e6adf?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1e6adf=!1,i}),_0x2d2cda=_0x11f6e9(void 0,(function(){return _0x2d2cda.toString().search("(((.+)+)+)+$").toString().constructor(_0x2d2cda).search("(((.+)+)+)+$")})),_0x1e6adf;_0x2d2cda();var ge$8="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform float uSpacing;\nuniform sampler2D shadowMap_texture;\nuniform sampler2D uAssisTexture;\n\nvarying vec4 vPositionEC;\nvarying vec2 vTexcoord;\n\nvoid main()\n{\n\tgl_FragColor = texture2D(uAssisTexture, vTexcoord);\n\tvec4 positionEC = vPositionEC;\n\tfloat depth = -positionEC.z;\n\tif(depth > shadowMap_cascadeSplits[1].w)\n\t{\n\t\treturn;\n\t}\n\tvec4 weights = czm_cascadeWeights(depth);\n\tvec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;\n\tfloat visibility = czm_shadowDepthCompare(shadowMap_texture, shadowPosition.xy, shadowPosition.z);\n\tif(visibility < 0.001)\n\t{\n\t\treturn;\n\t}\n\tfloat oldIntensity = czm_unpackDepth(gl_FragColor);\n\tfloat intensity = oldIntensity + uSpacing;\n\tintensity = clamp(intensity, 0.0, 0.9999);\n\tgl_FragColor = czm_packDepth(intensity);\n}";function p$k(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).camera))throw new t$Z("options.camera is required.");this._camera=e.camera,this._color=u$Y(e.color,e$1S.CYAN),this._updateOnChange=u$Y(e.updateOnChange,!0),this.show=u$Y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var k$l=new t$X,T$g=new p$1a,Y$b=new n$14,j$i=new o$15,q$f=new l$X,B$c=new a$X,J$h=new l$$,Q$f=new e$1S,V$f=[1,1e5];function p$j(){}function F$j(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).context;if(!e$28(t))throw new t$Z("context is required.");if(!e$28(e.lightCamera))throw new t$Z("lightCamera is required.");if(e$28(e.numberOfCascades)&&1!==e.numberOfCascades&&4!==e.numberOfCascades)throw new t$Z("Only one or four cascades are supported.");this._enabled=u$Y(e.enabled,!0),this._softShadows=u$Y(e.softShadows,!1),this._normalOffset=u$Y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=u$Y(e.fromLightSource,!0),this.darkness=u$Y(e.darkness,.5),this._darkness=this.darkness,this.maximumDistance=u$Y(e.maximumDistance,1e3),this.minimumDistance=void 0,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var i,r=!0;(s$V.isInternetExplorer()||s$V.isEdge()||(s$V.isChrome()||s$V.isFirefox())&&s$V.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 y$15,this._shadowMapTexture=void 0,this._lightDirectionEC=new t$X,this._lightPositionEC=new e$25,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new q$e,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new i$19,this._isPointLight=u$Y(e.isPointLight,!1),this._pointLightRadius=u$Y(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&u$Y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?u$Y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new o$1k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new l$$:e$28(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new e$25,new e$25],this._cascadeMatrices=[new y$15,new y$15,new y$15,new y$15],this._cascadeDistances=new e$25,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 tt$6(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,ie$7(this),this._clearCommand=new r$11({depth:1,color:new e$1S}),this._clearPassState=new n$p(t),this._size=u$Y(e.size,2048),this.size=this._size}function tt$6(e){this.camera=new q$e,this.passState=new n$p(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function re$6(e,t){return u$R.fromCache({cull:{enabled:!0,face:k$11.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 ie$7(e){var t=!e._usesDepthTexture;e._primitiveRenderState=re$6(t,e._primitiveBias),e._terrainRenderState=re$6(t,e._terrainBias),e._pointRenderState=re$6(t,e._pointBias)}function ne$a(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;e$28(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ae$9(){return new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}function rt$6(e,t){for(var i=new o$C({context:t,width:e._textureSize.x,height:e._textureSize.y,format:M$q.DEPTH_COMPONENT16}),r=new L$17({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:ae$9()}),n=new a$z({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function it$3(e,t){for(var i=new L$17({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8,sampler:ae$9()}),r=new a$z({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function nt$5(e,t){for(var i=new o$C({context:t,width:e._textureSize.x,height:e._textureSize.y,format:M$q.DEPTH_COMPONENT16}),r=new X$z({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:ae$9()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new a$z({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ye$7(e,t){e._isPointLight?nt$5(e,t):e._usesDepthTexture?it$3(e,t):rt$6(e,t)}function at$6(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==de$y.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ie$7(e),ne$a(e),ye$7(e,t))}function st$2(e,t){(!e$28(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(ne$a(e),ye$7(e,t),at$6(e,t),we$7(e,t))}function we$7(e,t,i){i=u$Y(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ot$5(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=e$1U.maximumCubeMapSize>=t?t:e$1U.maximumCubeMapSize,n.x=t,n.y=t;var o=new f$10(0,0,t,t);i[0].passState.viewport=o,i[1].passState.viewport=o,i[2].passState.viewport=o,i[3].passState.viewport=o,i[4].passState.viewport=o,i[5].passState.viewport=o}else 1===r?(t=e$1U.maximumTextureSize>=t?t:e$1U.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new f$10(0,0,t,t)):4===r&&(t=e$1U.maximumTextureSize>=2*t?t:e$1U.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new f$10(0,0,t,t),i[1].passState.viewport=new f$10(t,0,t,t),i[2].passState.viewport=new f$10(0,t,t,t),i[3].passState.viewport=new f$10(t,t,t,t));e._clearPassState.viewport=new f$10(0,0,n.x,n.y);for(var a=0;a<r;++a){var s=i[a],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,h=l.width/n.x,d=l.height/n.y;s.textureOffsets=new y$15(h,0,0,u,0,d,0,c,0,0,1,0,0,0,0,1)}}p$k.prototype.update=function(e){if(this.show){var t,i,r=this._planesPrimitives,n=this._outlinePrimitives;if(this._updateOnChange){for(i=r.length,t=0;t<i;++t)n[t]=n[t]&&n[t].destroy(),r[t]=r[t]&&r[t].destroy();r.length=0,n.length=0}if(0===r.length){var o,a=this._camera,s=a.frustum;o=s instanceof o$15?j$i:s instanceof l$X?q$f:s instanceof a$X?B$c:J$h,o=s.clone(o);var l=e.frustumSplits,u=l.length-1;u<=0&&((l=V$f)[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,u=1);var c=a.positionWC,h=a.directionWC,d=a.upWC,f=a.rightWC;f=t$X.negate(f,k$l);var p=T$g;p$1a.setColumn(p,0,f,p),p$1a.setColumn(p,1,d,p),p$1a.setColumn(p,2,h,p);var _=n$14.fromRotationMatrix(p,Y$b);for(r.length=n.length=u,t=0;t<u;++t)o.near=l[t],o.far=l[t+1],r[t]=new v$C({geometryInstances:new d$15({geometry:new z$M({origin:c,orientation:_,frustum:o,_drawNearPlane:0===t}),attributes:{color:o$18.fromColor(e$1S.fromAlpha(this._color,.1,Q$f))},id:this.id,pickPrimitive:this}),appearance:new r$J({translucent:!0,flat:!0}),asynchronous:!1}),n[t]=new v$C({geometryInstances:new d$15({geometry:new s$L({origin:c,orientation:_,frustum:o,_drawNearPlane:0===t}),attributes:{color:o$18.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1})}for(i=r.length,t=0;t<i;++t)n[t].update(e),r[t].update(e)}},p$k.prototype.isDestroyed=function(){return!1},p$k.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return i$Z(this)},p$j.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},p$j.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");var o=e$28(a$$.findPositionVarying(e));if(t&&!o){for(var a=n.length,s=0;s<a;++s)n[s]=a$$.replaceMain(n[s],"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 a$$({defines:r,sources:n})},p$j.createShadowCastFragmentShader=function(e,t,i,r,n,o){var a=e.defines.slice(0),s=e.sources.slice(0),l=a$$.findPositionVarying(e),u=e$28(l);u||(l="v_positionEC");for(var c=s.length,h=0;h<c;++h)s[h]=a$$.replaceMain(s[h],"czm_shadow_cast_main");var d="";return t&&(u||(d+="varying vec3 v_positionEC; \n"),d+="uniform vec4 shadowMap_lightPositionEC; \n"),o&&(d+="uniform float uSelectCastShadow; \nuniform vec4 uPixels;\nuniform float uLayerID;\nvoid selectCastShadow() \n{ \n if(vColor.a < 0.1) \n { \n discard; \n } \n if(0.5 > uSelectCastShadow) \n { \n return; \n } \n if(255.0 > uPixels.r) \n { \n vec4 rgba = abs(vSecondColor * 255.0 - vec4(uPixels.rgb, uLayerID)); \n if(0.5 > rgba.r && 0.5 > rgba.g && 0.5 > rgba.b && 0.5 > rgba.a) \n { \n return; \n } \n } \n discard; \n} \n"),d+=r&&!o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",o&&(d+=" selectCastShadow(); \n"),t?d+=" float distance = length("+l+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?(e$28(n.pickId)&&"vSecondColor"===n.pickId&&(d+=" if(vColor.a < 0.1)\n {\n discard;\n }\n"),d+=" gl_FragColor = vec4(1.0); \n"):d+=" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",d+="} \n",s.push(d),new a$$({defines:a,sources:s})},p$j.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(e._numberOfCascades>1)+e.debugCascadeColors+e.softShadows+t+i+r},p$j.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new a$$({defines:r,sources:n})},p$j.createShadowReceiveFragmentShader=function(e,t,i,r,n,o){for(var a=a$$.findNormalVarying(e),s=!r&&e$28(a)||r&&n,l=a$$.findPositionVarying(e),u=e$28(l),c=t._usesDepthTexture,h=t._polygonOffsetSupported,d=t._isPointLight,f=t._isSpotLight,p=t._numberOfCascades>1,_=t.debugCascadeColors,m=t.softShadows,$=d?t._pointBias:r?t._terrainBias:t._primitiveBias,g=e.defines.slice(0),v=e.sources.slice(0),y=v.length,x=0;x<y;++x)v[x]=a$$.replaceMain(v[x],"czm_shadow_receive_main");d?g.push("USE_CUBE_MAP_SHADOW"):c&&g.push("USE_SHADOW_DEPTH_TEXTURE"),m&&!d&&g.push("USE_SOFT_SHADOWS"),p&&i&&r&&(s?g.push("ENABLE_VERTEX_LIGHTING"):g.push("ENABLE_DAYNIGHT_SHADING")),i&&$.normalShading&&(s||o)&&(g.push("USE_NORMAL_SHADING"),$.normalShadingSmooth>0&&g.push("USE_NORMAL_SHADING_SMOOTH"));var b="";b+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n";var w=e.defines.indexOf("LOG_DEPTH")>-1;return b+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n"+(w?"varying vec3 v_logPositionEC; \n":"\n")+"vec4 getPositionEC() \n{ \n"+(u?" return vec4("+l+", 1.0); \n":w?" return vec4(v_logPositionEC, 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(s?" return normalize("+a+"); \n":o?" return normalize(czm_normal*czm_computeNormal(vPositionMC.xyz)); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+($.normalOffset&&s||o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",b+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",b+=" 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?b+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(b+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),b+=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":f?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":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 shadowParameters.depthBias = 0.0001 * (1.0 - 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"+(_?" 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",b+=" gl_FragColor.rgb *= visibility; \n} \n",v.push(b),new a$$({defines:g,sources:v})},F$j.MAXIMUM_DISTANCE=2e4,F$j.prototype.debugCreateRenderStates=function(){ie$7(this)},Object.defineProperties(F$j.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){ot$5(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 ut$4=new f$10;function mt$1(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Le$p.OVERLAY,r}function ft$3(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,o=.3*Math.min(r,n),a=ut$4;a.x=r-o,a.y=0,a.width=o,a.height=o;var s=e._debugShadowViewCommand;e$28(s)||(s=mt$1(e,i),e._debugShadowViewCommand=s),(!e$28(s.renderState)||!f$10.equals(s.renderState.viewport,a))&&(s.renderState=u$R.fromCache({viewport:f$10.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}var E$l=new Array(8);E$l[0]=new e$25(-1,-1,-1,1),E$l[1]=new e$25(1,-1,-1,1),E$l[2]=new e$25(1,1,-1,1),E$l[3]=new e$25(-1,1,-1,1),E$l[4]=new e$25(-1,-1,1,1),E$l[5]=new e$25(1,-1,1,1),E$l[6]=new e$25(1,1,1,1),E$l[7]=new e$25(-1,1,1,1);for(var A$q=new y$15,se$5=new Array(8),oe$8=0;oe$8<8;++oe$8)se$5[oe$8]=new e$25;function ct$3(e,t){return new v$C({geometryInstances:[new d$15({geometry:new o$1c({minimum:new t$X(-.5,-.5,-.5),maximum:new t$X(.5,.5,.5)}),attributes:{color:o$18.fromColor(t)}}),new d$15({geometry:new a$Q({radius:.5}),attributes:{color:o$18.fromColor(t)}})],appearance:new r$J({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var ht$2=[e$1S.RED,e$1S.GREEN,e$1S.BLUE,e$1S.MAGENTA],dt$4=new t$X;function lt$3(e,t){ft$3(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new p$k({camera:e._sceneCamera,color:e$1S.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new p$k({camera:e._shadowMapCamera,color:e$1S.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new p$k({camera:e._passes[r].camera,color:ht$2[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!e$28(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,o=n$14.IDENTITY,a=2*e._pointLightRadius,s=t$X.fromElements(a,a,a,dt$4),l=y$15.fromTranslationQuaternionRotationScale(n,o,s,A$q);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ct$3(l,e$1S.YELLOW)}e._debugLightFrustum.update(t)}else(!e$28(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new p$k({camera:e._shadowMapCamera,color:e$1S.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function q$e(){this.viewMatrix=new y$15,this.inverseViewMatrix=new y$15,this.frustum=void 0,this.positionCartographic=new t$W,this.positionWC=new t$X,this.directionWC=t$X.clone(t$X.UNIT_Z),this.upWC=t$X.clone(t$X.UNIT_Y),this.rightWC=t$X.clone(t$X.UNIT_X),this.viewProjectionMatrix=new y$15}q$e.prototype.clone=function(e){y$15.clone(e.viewMatrix,this.viewMatrix),y$15.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),t$W.clone(e.positionCartographic,this.positionCartographic),t$X.clone(e.positionWC,this.positionWC),t$X.clone(e.directionWC,this.directionWC),t$X.clone(e.upWC,this.upWC),t$X.clone(e.rightWC,this.rightWC)};var _t$3=new y$15(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);q$e.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return y$15.multiply(t,e,this.viewProjectionMatrix),y$15.multiply(_t$3,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var vt$2=new Array(5),gt$3=new o$15,Ct$3=new Array(4),Oe$7=new t$X,Fe$6=new t$X;function pt$3(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,o=n.frustum.near,a=n.frustum.far,s=e._numberOfCascades,l=a-o,u=a/o,c=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,c=.9);var d=Ct$3,f=vt$2;for(f[0]=o,f[s]=a,i=0;i<s;++i){var p=(i+1)/s,_=o*Math.pow(u,p),m=o+l*p,$=e$27.lerp(m,_,c);f[i+1]=$,d[i]=$-f[i]}if(h){for(i=0;i<s;++i)d[i]=Math.min(d[i],e._maximumCascadeDistances[i]);var g=f[0];for(i=0;i<s-1;++i)g+=d[i],f[i+1]=g}e$25.unpack(f,0,e._cascadeSplits[0]),e$25.unpack(f,1,e._cascadeSplits[1]),e$25.unpack(d,0,e._cascadeDistances);var v=r.frustum,y=v.left,x=v.right,b=v.bottom,w=v.top,C=v.near,T=v.far,S=r.positionWC,E=r.directionWC,A=r.upWC,P=n.frustum.clone(gt$3),I=r.getViewProjection();for(i=0;i<s;++i){P.near=f[i],P.far=f[i+1];for(var M=y$15.multiply(P.projectionMatrix,n.viewMatrix,A$q),O=y$15.inverse(M,A$q),D=y$15.multiply(I,O,A$q),R=t$X.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Oe$7),L=t$X.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe$6),B=0;B<8;++B){var N=e$25.clone(E$l[B],se$5[B]);y$15.multiplyByVector(D,N,N),t$X.divideByScalar(N,N.w,N),t$X.minimumByComponent(N,R,R),t$X.maximumByComponent(N,L,L)}R.x=Math.max(R.x,0),R.y=Math.max(R.y,0),R.z=0,L.x=Math.min(L.x,1),L.y=Math.min(L.y,1),L.z=Math.min(L.z,1);var F=e._passes[i],z=F.camera;z.clone(r);var k=z.frustum;k.left=y+R.x*(x-y),k.right=y+L.x*(x-y),k.bottom=b+R.y*(w-b),k.top=b+L.y*(w-b),k.near=C+R.z*(T-C),k.far=C+L.z*(T-C),F.cullingVolume=z.frustum.computeCullingVolume(S,E,A);var V=e._cascadeMatrices[i];y$15.multiply(z.getViewProjection(),n.inverseViewMatrix,V),y$15.multiply(F.textureOffsets,V,V)}}var St$1=new y$15,xt$2=new t$X,bt$1=new t$X,Ee$6=new t$X;function yt$1(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=y$15.multiply(r.frustum.projectionMatrix,r.viewMatrix,A$q),o=y$15.inverse(n,A$q),a=i.directionWC,s=r.directionWC,l=t$X.cross(a,s,xt$2);s=t$X.cross(l,a,bt$1),t$X.normalize(s,s),t$X.normalize(l,l);for(var u=t$X.fromElements(0,0,0,Ee$6),c=y$15.computeView(u,a,s,l,St$1),h=y$15.multiply(c,o,A$q),d=t$X.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Oe$7),f=t$X.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe$6),p=0;p<8;++p){var _=e$25.clone(E$l[p],se$5[p]);y$15.multiplyByVector(h,_,_),t$X.divideByScalar(_,_.w,_),t$X.minimumByComponent(_,d,d),t$X.maximumByComponent(_,f,f)}f.z+=1e3,d.z-=10;var m=Ee$6;m.x=-.5*(d.x+f.x),m.y=-.5*(d.y+f.y),m.z=-f.z;var $=y$15.fromTranslation(m,A$q);c=y$15.multiply($,c,c);var g=.5*(f.x-d.x),v=.5*(f.y-d.y),y=f.z-d.z,x=i.frustum;x.left=-g,x.right=g,x.bottom=-v,x.top=v,x.near=.01,x.far=y,y$15.clone(c,i.viewMatrix),y$15.inverse(c,i.inverseViewMatrix),y$15.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),t$X.clone(a,i.directionWC),t$X.clone(s,i.upWC),t$X.clone(l,i.rightWC)}var wt$2=[new t$X(-1,0,0),new t$X(0,-1,0),new t$X(0,0,-1),new t$X(1,0,0),new t$X(0,1,0),new t$X(0,0,1)],Ot$1=[new t$X(0,-1,0),new t$X(0,0,-1),new t$X(0,-1,0),new t$X(0,-1,0),new t$X(0,0,1),new t$X(0,-1,0)],Ft$2=[new t$X(0,0,1),new t$X(1,0,0),new t$X(-1,0,0),new t$X(0,0,-1),new t$X(1,0,0),new t$X(1,0,0)];function Et$2(e,t){var i=new o$15;i.fov=e$27.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=wt$2[r],n.upWC=Ot$1[r],n.rightWC=Ft$2[r],y$15.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),y$15.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var Pt$3=new t$X,Lt$2=new t$X,Pe$6=new i$19,Le$7=Pe$6.center;function Vt$3(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=Pe$6;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,Pt$3),a=t$X.negate(r.directionWC,Lt$2),s=t$X.dot(o,a),l=e$27.clamp(s/.1,0,1);if(e._darkness=e$27.lerp(1,e.darkness,l),s<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===pt$a.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),i$19.clone(n,e._boundingSphere);else{var u=r.frustum.far/2,c=t$X.add(r.positionWC,t$X.multiplyByScalar(r.directionWC,u,Le$7),Le$7);n.center=c,n.radius=u,e._outOfView=t.cullingVolume.computeVisibility(n)===pt$a.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),i$19.clone(n,e._boundingSphere)}}function Dt$3(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?t$X.clone(r.directionWC,o.directionWC):e._isPointLight?t$X.clone(r.positionWC,o.positionWC):o.clone(r);var a,s,l=e._lightDirectionEC;y$15.multiplyByPointAsVector(i.viewMatrix,o.directionWC,l),t$X.normalize(l,l),t$X.negate(l,l),y$15.multiplyByPoint(i.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),s=Math.min(t.shadowState.farPlane,e.maximumDistance+1),s=Math.max(s,a+1)):(a=i.frustum.near,s=e.maximumDistance),e._sceneCamera=v$n.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=s,e._distance=s-a,Vt$3(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}F$j.prototype.update=function(e){if(Dt$3(this,e),this._needsUpdate)if(st$2(this,e.context),this._isPointLight&&Et$2(this,e),this._cascadesEnabled&&(yt$1(this,e),this._numberOfCascades>1&&pt$3(this,e)),this._isPointLight)this._shadowMapCullingVolume=i$S.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;y$15.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&<$3(this,e)},F$j.prototype.updatePass=function(e,t){we$7(this,e,t)};var Tt$2=new o$1k;function Ve$7(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=Tt$2;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,e$25.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return e$25.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new e$25,combinedUniforms2:new e$25};return p$17(t,n,!1)}function At$1(e,t,i,r,n,o){var a,s,l;if(e$28(o)&&(a=o.shaderProgram,s=o.renderState,l=o.uniformMap),(o=r$15.shallowClone(i,o)).castShadows=!0,o.receiveShadows=!1,!e$28(a)||n!==i.shaderProgram.id||t){var u=i.shaderProgram,c=i.pass===Le$p.GLOBE,h=i.pass!==Le$p.TRANSLUCENT,d=e._isPointLight,f=e._usesDepthTexture,p=i.selectCastShadows,_=p$j.getShadowCastShaderKeyword(d,c,f,h);if(!e$28(a=r.shaderCache.getDerivedShaderProgram(u,_))){var m=u.vertexShaderSource,$=u.fragmentShaderSource,g=p$j.createShadowCastVertexShader(m,d,c),v=p$j.createShadowCastFragmentShader($,d,f,h,o,p);a=r.shaderCache.createDerivedShaderProgram(u,_,{vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,d?s=e._pointRenderState:c&&(s=e._terrainRenderState),i.renderState.cull.enabled||((s=l$1e(s,!1)).cull=l$1e(s.cull,!1),s.cull.enabled=!1,s=u$R.fromCache(s)),l=Ve$7(e,i.uniformMap,c)}return o.shaderProgram=a,o.renderState=s,o.uniformMap=l,o}F$j.createReceiveDerivedCommand=function(e,t,i,r,n){e$28(n)||(n={});var o=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,l=a.fragmentShaderSource,u=t.pass===Le$p.GLOBE,c=t.pass===Le$p.S3MTiles,h=!1;if(u&&(h=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){var d,f;e$28(n.receiveCommand)&&(d=n.receiveCommand.shaderProgram,f=n.receiveCommand.uniformMap),n.receiveCommand=r$15.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0;var p=n.receiveShaderCastShadows!==t.castShadows,_=n.receiveShaderProgramId!==t.shaderProgram.id;if(!e$28(d)||_||i||p){var m=p$j.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,h);if(!e$28(d=r.shaderCache.getDerivedShaderProgram(a,m))){var $=p$j.createShadowReceiveVertexShader(s,u,h),g=p$j.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,h,c);d=r.shaderCache.createDerivedShaderProgram(a,m,{vertexShaderSource:$,fragmentShaderSource:g,attributeLocations:a._attributeLocations})}f=Ve$7(e[0],t.uniformMap,u)}n.receiveCommand.shaderProgram=d,n.receiveCommand.uniformMap=f,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows}return n},F$j.createCastDerivedCommand=function(e,t,i,r,n){if(e$28(n)||(n={}),t.castShadows){var o=n.castCommands;e$28(o)||(o=n.castCommands=[]);var a=n.castShaderProgramId,s=e.length;o.length=s;for(var l=0;l<s;++l)o[l]=At$1(e[l],i,t,r,a,o[l]);n.castShaderProgramId=t.shaderProgram.id}return n},F$j.prototype.isDestroyed=function(){return!1},F$j.prototype.destroy=function(){ne$a(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 i$Z(this)};var Ce$5=new i$W("computeShadowRatio");function M$m(e){if(!e$28(e))throw new t$Z("scene are required.");if(!e.context.depthTexture)throw new t$Z("the depth buffer is not supported.");this._scene=e,this._depthBuffer=void 0,this._globalDepthBuffer=void 0,this._frameState=void 0,this._qureyRegion=[],this._bottom=0,this._extend=0,this._arrPointCommand=[],this._arrRasterPointCommand=[],this._boundingSphere=new i$19,this._bounds=[],this._worldMatrix=y$15.IDENTITY.clone(),this._spacing=10,this._arrRasterTexture=[],this._arrAssisTexture=[],this._startTime=a$12.now(),this._endTime=a$12.now(),this._currentTime=0,this._timeInterval=1,this._timeUpdate=!1,this._update=!1,this._id=0,this._name="",this._sceneName="",this._checking=!1,this._visibleViewport=4095,this._points=[],this._queryPointsEvent=new o$1o,this._enuPoints=[],this._shadowMapParams={oriMaxDis:100,oriSize:128,analysisSize:Math.min(8192,e$1U.maximumTextureSize)},this.shadowMap=new F$j({context:this._scene.context,lightCamera:this._scene._sunCamera,enabled:!0,maximumDistance:this._shadowMapParams.oriMaxDis,size:this._shadowMapParams.oriSize,pcss:!1,softShadows:!1}),this._shadowMapMaxDistance=this._shadowMapParams.oriMaxDis,this._isPointsVisible=!0,this._colorTable=void 0,this._hypsometricTexture=void 0,this._voxelData={},this._volDirty=!1}function Be$8(e,t){var i=!1,r=t.split(" ");if(r.length>1){var n=r[0],o=r[1];for(var a in e.defines)if(-1!==e.defines[a].indexOf(n))return void(e.defines[a]=n+" "+o);e.defines.push(t)}else{for(var a in e.defines)if(e.defines[a]===t){i=!0;break}i||e.defines.push(t)}}function Ae$6(e,t,i){if(e$28(t)){var r=t.shaderProgram.fragmentShaderSource,n=t.shaderProgram.vertexShaderSource;Be$8(r,i);var o=t.shaderProgram._attributeLocations;t.shaderProgram.destroy(),t.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:o})}}function Ee$5(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function Re$5(e,t,i){if(e$28(t)){var r=t.shaderProgram.vertexShaderSource,n=t.shaderProgram.fragmentShaderSource;Ee$5(n,i);var o=t.shaderProgram._attributeLocations;t.shaderProgram.destroy(),t.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:o})}}function W$h(e){for(var t=0;t<e._arrPointCommand.length;t++)e$28(e._arrPointCommand[t])&&(e._arrPointCommand[t].vertexArray=e._arrPointCommand[t].vertexArray&&e._arrPointCommand[t].vertexArray.destroy(),e._arrPointCommand[t].shaderProgram=e._arrPointCommand[t].shaderProgram&&e._arrPointCommand[t].shaderProgram.destroy(),e._arrPointCommand[t]=void 0);e._arrPointCommand.length=0;for(t=0;t<e._arrRasterPointCommand.length;t++)e$28(e._arrRasterPointCommand[t])&&(e._arrRasterPointCommand[t].vertexArray=e._arrRasterPointCommand[t].vertexArray&&e._arrRasterPointCommand[t].vertexArray.destroy(),e._arrRasterPointCommand[t].shaderProgram=e._arrRasterPointCommand[t].shaderProgram&&e._arrRasterPointCommand[t].shaderProgram.destroy(),e._arrRasterPointCommand[t]=void 0);e._arrRasterPointCommand.length=0}function y$n(e){for(var t=0;t<e._arrRasterTexture.length;t++)e$28(e._arrRasterTexture[t])&&(e._arrRasterTexture[t].destroy(),e._arrRasterTexture[t]=null);e._arrRasterTexture.length=0;for(t=0;t<e._arrAssisTexture.length;t++)e$28(e._arrAssisTexture[t])&&(e._arrAssisTexture[t].destroy(),e._arrAssisTexture[t]=null);e._arrAssisTexture.length=0}function Ve$6(e,t){var i=t.length/2,r=0,n=0,o=0;for(r=0,n=i-1;r<i;n=r++){var a=t[2*r],s=t[2*r+1],l=t[2*n],u=t[2*n+1],c=Math.min(a,l),h=Math.max(a,l),d=Math.min(s,u),f=Math.max(s,u);if(u!=s){if(d>e.y==f<e.y){var p=(l-a)*(e.y-s)/(u-s)+a;if(e.x<p)o=!o;else if(e.x==p)return!0}}else if(e.y==s&&e.x>=c&&e.x<=h)return!0}return o}function Le$6(e,t,i){var r=e._bounds[0],n=e._bounds[1],o=e._bounds[2],a=e._bounds[3],s=0,l=0,u=t$X.fromDegrees(r,n,t),c=new i$10(0,0,0),h=new y$15,d=new y$15,f=new t$X,p=new t$X,_=new t$X;m$1b.headingPitchRollToFixedFrame(u,c,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,h),y$15.inverse(h,d);var m=t$X.fromDegrees(o,n,e._bottom);y$15.multiplyByPoint(d,m,p);var $=t$X.fromDegrees(r,a,e._bottom);y$15.multiplyByPoint(d,$,_);for(var g=t$X.distance(new t$X(0,0,0),p),v=t$X.distance(new t$X(0,0,0),_),y=(Math.floor(v/e._spacing),0);y<g;y+=e._spacing){l=0;for(var x=0;x<v;x+=e._spacing){y$15.multiplyByPoint(h,new t$X(e._spacing*s,e._spacing*l,0),f);var b=t$W.fromCartesian(f),w=e._getVolValue(b,i);e._voxelData.values.push(w),l++}s++}e._voxelData.width=s,e._voxelData.height=l,e._voxelData.bounds={leftBottom:{x:r,y:n},rightTop:{x:o,y:a}}}function P$j(e){if(0===e._qureyRegion.length/2||0===e._bounds.length)return[];if(e._enuPoints.length>0)return e._enuPoints;var t=e._bounds[0],i=e._bounds[1],r=e._bounds[2],n=e._bounds[3],o=0,a=0,s=0,l=t$X.fromDegrees(t,i,e._bottom),u=new i$10(0,0,0),c=new y$15,h=new y$15,d=new t$X,f=new t$X,p=new t$X;m$1b.headingPitchRollToFixedFrame(l,u,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,c),y$15.inverse(c,h);var _=t$X.fromDegrees(r,i,e._bottom);y$15.multiplyByPoint(h,_,f);var m=t$X.fromDegrees(t,n,e._bottom);y$15.multiplyByPoint(h,m,p);for(var $=t$X.distance(new t$X(0,0,0),f),g=t$X.distance(new t$X(0,0,0),p),v=0;v<$;v+=e._spacing){a++,s=0;for(var y=0;y<g;y+=e._spacing){s++,y$15.multiplyByPoint(c,new t$X(e._spacing*a,e._spacing*s,0),d);var x=t$W.fromCartesian(d),b=e$27.toDegrees(x.longitude),w=e$27.toDegrees(x.latitude);!Ve$6({x:b,y:w},e._qureyRegion)||(e._enuPoints[o++]=b,e._enuPoints[o++]=w)}}return e._enuPoints}function Ne$4(e){var t=e._qureyRegion.length/2;if(0===t)return[];if(t<3)return new i$19;for(var i=Number.MAX_VALUE,r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=-Number.MAX_VALUE,a=0;a<t;a++)i=Math.min(e._qureyRegion[2*a],i),r=Math.min(e._qureyRegion[2*a+1],r),n=Math.max(e._qureyRegion[2*a],n),o=Math.max(e._qureyRegion[2*a+1],o);e._bounds.length=0,e._bounds.push(i),e._bounds.push(r),e._bounds.push(n),e._bounds.push(o);var s=t$X.fromDegrees(.5*(n+i),.5*(o+r),e._bottom+.5*e._extend);t$X.clone(s,e._boundingSphere.center),y$15.setTranslation(e._worldMatrix,s,e._worldMatrix);var l=t$X.fromDegrees(i,r,e._bottom),u=t$X.fromDegrees(n,o,e._bottom+e._extend);return t$X.subtract(u,l,s),e._boundingSphere.radius=.5*t$X.magnitude(s),e._boundingSphere}function Fe$5(e,t,i,r){var n=i.length/2,o=S$W.createTypedArray(S$W.FLOAT,3*n),a=S$W.createTypedArray(S$W.FLOAT,2*n),s=null,l=ce$v.UNSIGNED_SHORT;n<65535?s=S$W.createTypedArray(S$W.UNSIGNED_SHORT,n):(s=S$W.createTypedArray(S$W.UNSIGNED_INT,n),l=ce$v.UNSIGNED_INT);var u=e._bounds[2]-e._bounds[0],c=e._bounds[3]-e._bounds[1],h=e._bounds[0]-.025*u,d=e._bounds[1]-.025*c;u+=.05*u,c+=.05*c;var f=new e$25(0,0,0,1),p=new y$15;y$15.inverse(e._worldMatrix,p);for(var _=0;_<n;_++){var m=t$X.fromDegrees(i[2*_],i[2*_+1],r);e._points.push(m),f.x=m.x,f.y=m.y,f.z=m.z,y$15.multiplyByVector(p,f,f),o[3*_]=f.x,o[3*_+1]=f.y,o[3*_+2]=f.z,a[2*_]=(i[2*_]-h)/u*2-1,a[2*_+1]=(i[2*_+1]-d)/c*2-1,s[_]=_}var $=h$W.createVertexBuffer({context:t,typedArray:o,usage:A$1c.STATIC_DRAW}),g=h$W.createVertexBuffer({context:t,typedArray:a,usage:A$1c.STATIC_DRAW}),v=[],y={aPosition:0,aTexCoord0:1};v.push({index:y.aPosition,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),v.push({index:y.aTexCoord0,vertexBuffer:g,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var x=h$W.createIndexBuffer({context:t,typedArray:s,usage:A$1c.STATIC_DRAW,indexDatatype:l}),b=new L$17({context:t,width:1024,height:1024,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),flipY:!1});e._arrRasterTexture.push(b);var w=new L$17({context:t,width:1024,height:1024,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),flipY:!1});e._arrAssisTexture.push(w);var C=new r$15({primitiveType:W$_.POINTS,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.OPAQUE,owner:e,cull:!0});e._arrPointCommand.push(C),C.vertexArray=new m$19({context:t,attributes:v,indexBuffer:x});var T=new a$$({sources:[de$8]});T.defines.push("RENDER_POINT");var S=new a$$({sources:[ve$4]});e$28(e._colorTable)&&S.defines.push("COLOR_TABLE"),C.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:y}),C.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),C.uniformMap={uPointSize:function(){return 10},uTexture0:function(){return b},uHypsometricTexture:function(){return e._hypsometricTexture}};var E=new r$15({primitiveType:W$_.POINTS,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.OPAQUE,owner:e,cull:!1});e._arrRasterPointCommand.push(E),E.vertexArray=new m$19({context:t,attributes:v,indexBuffer:x}),(T=new a$$({sources:[ce$9]})).defines.push("RENDER_POINT"),E.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:T,fragmentShaderSource:ge$8,attributeLocations:y}),E.renderState=u$R.fromCache({viewport:new f$10(0,0,1024,1024),cull:{enabled:!1},depthTest:{enabled:!1}});var A=1/e._currentTime,P=e.shadowMap;E.uniformMap={uPointSize:function(){return 4},uSpacing:function(){return A},shadowMap_texture:function(){return P._shadowMapTexture},shadowMap_textureCube:function(){return P._shadowMapTexture},shadowMap_matrix:function(){return P._shadowMapMatrix},shadowMap_cascadeSplits:function(){return P._cascadeSplits},shadowMap_cascadeMatrices:function(){return P._cascadeMatrices},shadowMap_lightDirectionEC:function(){return P._lightDirectionEC},shadowMap_lightPositionEC:function(){return P._lightPositionEC},shadowMap_cascadeDistances:function(){return P._cascadeDistances},uAssisTexture:function(){return w}},E.framebuffer=new a$z({context:t,colorTextures:[b],destroyAttachments:!1})}function Ie$7(e,t,i){e._globalDepthBuffer.isUpdate=!0,i.camera,e._globalDepthBuffer._beginFunc=function(e){},e._globalDepthBuffer._endFunc=function(t){e._globalDepthBuffer.isUpdate=!1,e._depthBuffer.isUpdate=!0}}function Oe$6(e,t,i){var r=i.time.clone(),n=0,o=i.useLogDepth;e._depthBuffer._beginFunc=function(){i.useLogDepth=!1,e.shadowMap.enabled=!0,r=i.time.clone(),i.time=a$12.addMinutes(e._startTime,n,new a$12),n+=e._timeInterval,i.passes.pick=!1},e._depthBuffer._endFunc=function(){i.useLogDepth=o;for(var n=[],a=0;a<e._arrRasterPointCommand.length;a++){e._arrRasterPointCommand[a].execute(t);var s=t.readPixels({x:0,y:0,width:1024,height:1024,framebuffer:e._arrRasterPointCommand[a].framebuffer});n.push(s),e._arrAssisTexture[a].copyFrom({width:1024,height:1024,arrayBufferView:s})}if(i.time=r,--e._currentTime<1){e._depthBuffer.isUpdate=!1,e._timeUpdate=!1;if(e.shadowMap.maximumDistance=e._shadowMapParams.oriMaxDis,e.shadowMap.minimumDistance=void 0,e.shadowMap.size=e._shadowMapParams.oriSize,e._points.length>0){var l={},u=P$j(e);l.points=e._points,l.enuPoints=u,l.bounds=e._bounds,l.extend=e._extend,l.spacing=e._spacing,l.bottom=e._bottom,l.pixelsArray=n;var c=Ce$5.scheduleTask(l,[]);if(!e$28(c))return[];c.then((function(t){var i=t.resultData;i.length>0&&e._queryPointsEvent.raiseEvent(i)})).otherwise((function(e){}))}else e._queryPointsEvent.raiseEvent({resultData:[]})}}}Object.defineProperties(M$m.prototype,{startTime:{get:function(){return this._startTime},set:function(e){this._startTime=e.clone(),this._update=!0}},endTime:{get:function(){return this._endTime},set:function(e){this._endTime=e.clone(),this._update=!0}},timeInterval:{get:function(){return this._timeInterval},set:function(e){this._timeInterval=e,this._update=!0}},spacing:{get:function(){return this._spacing},set:function(e){this._spacing=e,this._update=!0}},queryPointsEvent:{get:function(){return this._queryPointsEvent}},isPointsVisible:{get:function(){return this._isPointsVisible},set:function(e){this._isPointsVisible=e}},colorTable:{get:function(){return this._colorTable},set:function(e){if(e$28(e)){e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:this._scene.context,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1})),this._colorTable=e,this._colorTable.generateBuffer(),this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._colorTable._imageBuffer});for(i=0,r=(t=this._arrPointCommand).length;i<r;i++)Ae$6(this._scene.context,t[i],"COLOR_TABLE")}else for(var t,i=0,r=(t=this._arrPointCommand).length;i<r;i++)Re$5(this._scene.context,t[i],"COLOR_TABLE")}},voxelData:{get:function(){return this._volDirty=!0,this._getVoxelData(),this._voxelData}}}),M$m.prototype._getVolValue=function(e,t){var i=e.longitude,r=e.latitude,n=e.height;i=e$27.toDegrees(i),r=e$27.toDegrees(r);var o=this._bounds[2]-this._bounds[0],a=(n=this._bounds[3]-this._bounds[1],this._bounds[0]-.025*o),s=this._bounds[1]-.025*n;o+=.05*o,n+=.05*n;var l=parseInt((i-a)/o*1024),u=parseInt((r-s)/n*1024);l=l<1?1:l,u=u<1?1:u;for(var c=0,h=new e$25(1,1/255,1/65025,1/160581375),d=-1;d<2;d++)for(var f=-1;f<2;f++){var p=this._scene.context.readPixels({x:l+d,y:u+f,width:1,height:1,framebuffer:this._arrRasterPointCommand[t].framebuffer}),_=e$25.unpack(p,0);e$25.divideByScalar(_,255,_),c=Math.max(c,e$25.dot(_,h))}return 1-(c=c>.999?1:c)},M$m.prototype.update=function(e,t,i){if(!t._fboState.enabled&&!t.camera.bReflect){if(this._update){if(!this.shadowMap.enabled)throw new t$Z("ShadowQueryPoints must be shadow.");if(this._scene.mode!==P$$.SCENE3D)throw new t$Z("Shadow anaylsis is not supported for non-3D scenes.");if(this._frameState=t,e$28(this._depthBuffer)||(this._depthBuffer=new s$h(e),this._depthBuffer.environmentVisible.isSunVisible=!0,this._depthBuffer.environmentVisible.isGlobalVisible=!0,this._depthBuffer.environmentVisible.isObjectVisible=!0,this._depthBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._sceneName]=this._depthBuffer),!e$28(this._globalDepthBuffer)){this._globalDepthBuffer=new s$h(e),this._globalDepthBuffer.environmentVisible.isObjectVisible=!0,this._globalDepthBuffer.environmentVisible.isGlobalVisible=!0,this._globalDepthBuffer._visibleViewport=this._visibleViewport;var r=this._name+"_global";t._framebufferList[r]=this._globalDepthBuffer}this._update=!1,this._timeUpdate=!0,this._currentTime=1;var n=new a$12,o=0;for(this.shadowMap.maximumDistance=this._shadowMapMaxDistance;a$12.addMinutes(this._startTime,o,n),o+=this._timeInterval,!a$12.lessThan(this._endTime,n);)this._currentTime++;W$h(this),y$n(this);var a=P$j(this);if(this._points.length=0,a.length>0){for(var s=0;s<=this._extend;s+=this._spacing)Fe$5(this,e,a,this._bottom+s);Ie$7(this,e,t),Oe$6(this,e,t)}}if(!this._timeUpdate&&this._isPointsVisible){for(var l=0;l<this._arrPointCommand.length;l++)i.push(this._arrPointCommand[l]);this._getVoxelData()}}},M$m.prototype._getVoxelData=function(){if(this._arrPointCommand.length>0&&this._volDirty){this._volDirty=!1,this._voxelData={values:[]};for(var e=0,t=0;t<=this._extend;t+=this._spacing)Le$6(this,t,e),e++;this._voxelData.values=new Float32Array(this._voxelData.values),this._voxelData.depth=Math.ceil(this._extend/this._spacing)+1,this._voxelData.minValue=0,this._voxelData.maxValue=1,this._voxelData.minHeight=this._bottom,this._voxelData.maxHeight=this._bottom+this._extend}},M$m.prototype.setVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=1<<e,e$28(this._depthBuffer)&&(this._depthBuffer._visibleViewport=this._visibleViewport)},M$m.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},M$m.prototype.getShadowRadio=function(e){if(!e$28(e)||this._timeUpdate)return-1;var t=e.longitude,i=e.latitude,r=e.height;if(!e$28(t)||!e$28(i)||!e$28(r)||(t=e$27.toDegrees(t),i=e$27.toDegrees(i),t<this._bounds[0]||t>this._bounds[2]||i<this._bounds[1]||i>this._bounds[3]))return-1;for(var n=!1,o=0,a=.1*this._spacing,s=0;s<=this._extend;s+=this._spacing){if(Math.abs(this._bottom+s-r)<a){n=!0;break}o++}if(!n)return-1;var l=P$j(this);if(l.length<0)return-1;n=!1;for(var u=0;u<l.length;u+=2){var c=t$X.fromDegrees(t,i,r),h=t$X.fromDegrees(l[u+0],l[u+1],r);if(t$X.distance(c,h)<a){n=!0;break}}if(!n||o>=this._arrRasterPointCommand.length)return-1;var d=this._bounds[2]-this._bounds[0],f=(r=this._bounds[3]-this._bounds[1],this._bounds[0]-.025*d),p=this._bounds[1]-.025*r;d+=.05*d,r+=.05*r;var _=parseInt((t-f)/d*1024),m=parseInt((i-p)/r*1024);_=_<1?1:_,m=m<1?1:m;var $=0,g=new e$25(1,1/255,1/65025,1/160581375),v=this._arrRasterPointCommand[o].framebuffer;for(u=-1;u<2;u++)for(var y=-1;y<2;y++){var x=this._scene.context.readPixels({x:_+u,y:m+y,width:1,height:1,framebuffer:v}),b=e$25.unpack(x,0);e$25.divideByScalar(b,255,b),$=Math.max($,e$25.dot(b,g))}return $=$>.999?1:$},M$m.prototype.qureyRegion=function(e){if(!e$28(e)||!e$28(e.position))throw new t$Z("the options is required");this._qureyRegion=e.position,this._bottom=u$Y(e.bottom,this._bottom),this._extend=u$Y(e.extend,this._extend),this._update=!0,this._enuPoints=[];var t=Ne$4(this),i=t$X.distance(t.center,this._scene.camera.position);i+=this._boundingSphere.radius,this.shadowMap.maximumDistance=i,this.shadowMap.size=this._shadowMapParams.analysisSize,this._shadowMapMaxDistance=i},M$m.prototype.clear=function(){W$h(this),y$n(this)},M$m.prototype.build=function(){LicenseChecker.LICENSECHECKER.verify("ShadowQueryPoints"),""!==this._name||this._checking?e$28(this._scene._analyst3D.find(this._name))||this._scene._analyst3D.add(this):(this._name="ShadowQueryPoints"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_scene",this._scene._analyst3D.add(this),this._scene._analysisShadowMap=this.shadowMap)},M$m.prototype.destroy=function(){return e$28(this._frameState)&&(e$28(this._depthBuffer)&&delete this._frameState._framebufferList[this._sceneName],this._frameState=void 0),this._depthBuffer=this._depthBuffer&&this._depthBuffer.destroy(),W$h(this),y$n(this),e$28(this._hypsometricTexture)&&(this._hypsometricTexture=this._hypsometricTexture.destroy()),this._scene._analyst3D.remove(this._name,!0),e$28(this.shadowMap)&&(this.shadowMap.destroy(),this.shadowMap=void 0,this._scene._analysisShadowMap=void 0),i$Z(this)};var he$6="attribute vec2 aSideness;\nattribute vec3 aPosition0;\nattribute vec3 aPosition1;\nuniform float uLineWidth;\nuniform mat4 uRenderTextureMatrix;\nvarying vec4 renderTextureCoord;\nvec4 resolvePosition(vec4 viewPosV0, vec4 viewPosV1, vec2 sidenessNorm) {\nvec2 sideness = sidenessNorm * 2.0 - 1.0;\nvec4 viewPos = mix(viewPosV0, viewPosV1, sidenessNorm.y);\nvec4 projPosV0 = czm_projection * viewPosV0;\nvec4 projPosV1 = czm_projection * viewPosV1;\nvec4 projPos = czm_projection * viewPos;\nvec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w);\nvec2 uNDCToPixel = vec2(czm_viewport.z / 2.0, czm_viewport.w / 2.0);\nvec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * uNDCToPixel;\nfloat lineLengthPixels = length(screenSpaceLinePixels);\nfloat dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels;\nvec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels;\nvec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x;\nvec2 uPixelToNDC = vec2(2.0 / czm_viewport.z, 2.0 / czm_viewport.w);\nfloat halfLineWidth = max(uLineWidth, 1.0) * 0.5;\nvec2 halfLineWidthNDC = halfLineWidth * uPixelToNDC;\nvec2 ndcOffset = screenSpaceDirection * halfLineWidthNDC + perpendicularScreenSpaceDirection * halfLineWidthNDC;\nprojPos.xy += ndcOffset * projPos.w;\nprojPos.z += (dzPerPixel * halfLineWidth) * sideness.y * projPos.w;\nreturn projPos;\n}\nvoid main() {\nvec4 viewPosV0 = czm_modelView * vec4(aPosition0, 1.0);\nvec4 viewPosV1 = czm_modelView * vec4(aPosition1, 1.0);\ngl_Position = resolvePosition(viewPosV0, viewPosV1, aSideness);\nvec4 viewPos = czm_inverseProjection * gl_Position;\nrenderTextureCoord = uRenderTextureMatrix * viewPos;\n}\n",_e$7="uniform sampler2D uTexture0;\nuniform vec4 uVisibleColor;\nuniform vec4 uHiddenColor;\nvarying vec4 renderTextureCoord;\nvoid main() {\nvec4 resultColor = uVisibleColor;\nvec4 texCoord = renderTextureCoord / renderTextureCoord.w;\nfloat depth = texCoord.z * 0.5 + 0.5;\ntexCoord.xy = texCoord.xy * 0.5 + 0.5;\nfloat z_window = czm_unpackDepth(texture2D(uTexture0, texCoord.xy));\nif(z_window < depth && z_window > 0.0 && z_window < 1.0)\n{\nresultColor = uHiddenColor;\n}\ngl_FragColor = resultColor;\n}\n";function x$o(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._depthBuffer=void 0,this._command=void 0,this._frameState=void 0,this._viewPosition=[0,0,0],this._cameraDir=new t$X,this._viewProjMatrix=new y$15,this._viewProjMatrixs=new e$1P,this._renderTextureMatrix=new y$15,this._renderTextureMatrixs=new e$1P,this._visibleColor=new e$25(0,1,0,1),this._hiddenColor=new e$25(1,0,0,1),this._targetPoints=new e$1P,this._sightlineCameras=new e$1P,this._update=!0,this._updateAll=!0,this._id=0,this._name="",this._visibleViewport=4095,this._barrierPointArray=new e$1P,this._depthBuffers=new e$1P,this._commands=new e$1P,this._lineWidth=1}function J$g(e,t,i){var r,n=i.camera,o=n._projection;if(e._scene.mode===P$$.SCENE3D)r=t$X.fromDegreesArrayHeights(e._viewPosition,e._scene._globe.ellipsoid)[0];else{var a=t$W.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]);r=o.project(a,new t$X)}var s=new t$X(0,0,0);e._targetPoints._hash;var l,u=0,c=e._currentTargetPoint;if(e._scene.mode===P$$.SCENE3D)l=t$X.fromDegreesArrayHeights(c,e._scene._globe.ellipsoid)[0];else{var h=t$W.fromDegrees(c[0],c[1],c[2]);l=o.project(h,new t$X)}var d=new t$X;t$X.subtract(l,r,d),t$X.normalize(d,d),t$X.add(s,d,s),u=Math.max(u,t$X.distance(l,r)),t$X.normalize(s,s),t$X.clone(s,e._cameraDir);var f=new t$X,p=new t$X,_=new t$X,m=n.frustum.fov;t$X.clone(n.position,f),t$X.clone(n.direction,p),t$X.clone(n.up,_);var $=2*e$27.PI/3,g=n.frustum.near,v=n.frustum.far,y=i.useLogDepth,x=e._currentTargetName,b=e._depthBuffers.get(x);e$28(b)||((b=new s$h(t)).environmentVisible.isObjectVisible=!0,b.environmentVisible.isGlobalVisible=!0,b._visibleViewport=e._visibleViewport,i._framebufferList[x]=b,e._depthBuffers.set(x,b)),b.isUpdate=!0,b._beginFunc=function(){i.useLogDepth=!1,t$X.clone(n.position,f),t$X.clone(n.direction,p),t$X.clone(n.up,_),m=n.frustum.fov,n.frustum.fov=$;var t=s,o=new t$X;o=t$X.clone(r,o),o=t$X.normalize(o,o),Math.abs(t$X.dot(o,t))>=1&&(o=Math.abs(t$X.dot(t,t$X.UNIT_Y))<1?t$X.clone(t$X.UNIT_Y,o):t$X.clone(t$X.UNIT_Z,o));var a=new t$X;t$X.cross(o,t,a),a=t$X.normalize(a,a),t$X.cross(t,a,o),o=t$X.normalize(o,o);var l={destination:r,orientation:{direction:t,up:o},convert:!1};n.setView(l),e._sightlineCameras.set(x,l),n.frustum.near=1,n.frustum.far=Math.ceil(Math.max(u,10));var c=new y$15;y$15.multiply(n.frustum.projectionMatrix,n.viewMatrix,c),e._viewProjMatrixs.set(x,c),e._renderTextureMatrixs.set(x,new y$15)},b._endFunc=function(){if(i.useLogDepth=y,n.frustum.fov=m,n.setView({destination:f,orientation:{direction:p,up:_},convert:!1}),n.frustum.near=g,n.frustum.far=v,b.isUpdate=!1,!e._update){var t=ee$a(e,x);e._barrierPointArray.set(x,t)}}}Object.defineProperties(x$o.prototype,{viewPosition:{get:function(){return this._viewPosition},set:function(e){this._viewPosition=e,this._updateAll=!0,this._update=!0}},visibleColor:{get:function(){var e=new e$1S;return e.red=this._visibleColor.x,e.green=this._visibleColor.y,e.blue=this._visibleColor.z,e.alpha=this._visibleColor.w,e},set:function(e){this._visibleColor.x=e.red,this._visibleColor.y=e.green,this._visibleColor.z=e.blue,this._visibleColor.w=e.alpha}},hiddenColor:{get:function(){var e=new e$1S;return e.red=this._hiddenColor.x,e.green=this._hiddenColor.y,e.blue=this._hiddenColor.z,e.alpha=this._hiddenColor.w,e},set:function(e){this._hiddenColor.x=e.red,this._hiddenColor.y=e.green,this._hiddenColor.z=e.blue,this._hiddenColor.w=e.alpha}},lineWidth:{get:function(){return this._lineWidth},set:function(e){o$1u.typeOf.number.greaterThan("Sightline.lineWidth",e,0),this._lineWidth=e}}}),x$o.prototype.addTargetPoint=function(e){var t=e.name,i=e.position;return!(!e$28(t)||!e$28(i))&&(this._targetPoints.set(t,i),this._currentTargetName=t,this._currentTargetPoint=i,this._update=!0,this._barrierPointArray.set(t,{}),!0)},x$o.prototype.removeTargetPoint=function(e){this._barrierPointArray.remove(e);var t=this._targetPoints.remove(e);if(this._sightlineCameras.remove(e),!t)return!1;this._viewProjMatrixs.remove(e),this._renderTextureMatrixs.remove(e);var i=this._depthBuffers.get(e);e$28(i)&&(i.destroy(),this._depthBuffers.remove(e),delete this._frameState._framebufferList[e]);var r=this._commands.get(e);if(e$28(r)){for(var n=0;n<r.length;n++){var o=r[n];o.shaderProgram=o.shaderProgram&&!o.shaderProgram.isDestroyed()&&o.shaderProgram.destroy(),o.vertexArray=o.vertexArray&&!o.vertexArray.isDestroyed()&&o.vertexArray.destroy();var a=this._frameState.commandList.indexOf(o);-1!==a&&this._frameState.commandList.splice(a,1)}this._commands.remove(e)}return this._update=!0,!0},x$o.prototype.removeAllTargetPoint=function(){for(var e in this._barrierPointArray.removeAll(),this._targetPoints.removeAll(),this._sightlineCameras.removeAll(),this._depthBuffers._hash)this._depthBuffers._hash.hasOwnProperty(e)&&(this._depthBuffers._hash[e].destroy(),delete this._frameState._framebufferList[e],delete this._frameState._framebufferList[e]);this._depthBuffers.removeAll();for(var t=0,i=this._commands.length;t<i;t++)for(var r=this._commands.values[t],n=0;n<r.length;n++){var o=r[n];o.shaderProgram=o.shaderProgram&&!o.shaderProgram.isDestroyed()&&o.shaderProgram.destroy(),o.vertexArray=o.vertexArray&&!o.vertexArray.isDestroyed()&&o.vertexArray.destroy()}this._commands.removeAll(),this._viewProjMatrixs.removeAll(),this._renderTextureMatrixs.removeAll(),this._update=!0};var me$a=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),N$e=null;function we$6(e){if(e$28(N$e))return N$e;var t=new Float32Array(8),i=0;return t[i++]=0,t[i++]=0,t[i++]=0,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=1,t[i++]=0,(N$e=h$W.createVertexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW})).vertexArrayDestroyable=!1,N$e}function ye$6(e,t){var i=S$W.createTypedArray(S$W.FLOAT,6);return i[0]=0,i[1]=0,i[2]=0,i[3]=t.x,i[4]=t.y,i[5]=t.z,h$W.createVertexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW})}function Pe$5(){var e=new Uint16Array(6),t=0;return e[t++]=2,e[t++]=1,e[t++]=0,e[t++]=3,e[t++]=2,e[t++]=0,e}var F$i=null;function xe$7(e){return e$28(F$i)||((F$i=h$W.createIndexBuffer({context:e,typedArray:Pe$5(),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1),F$i}var k$k=new e$25,G$o=new e$25;function $$e(e,t,i){var r,n=i.camera._projection;if(e._scene.mode===P$$.SCENE3D)r=t$X.fromDegreesArrayHeights(e._viewPosition,e._scene._globe.ellipsoid)[0];else{var o=t$W.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]);r=n.project(o,new t$X)}var a,s=e._currentTargetPoint;if(e._scene.mode===P$$.SCENE3D)a=t$X.fromDegreesArrayHeights(s,e._scene._globe.ellipsoid)[0];else{var l=t$W.fromDegrees(s[0],s[1],s[2]);a=n.project(l,new t$X)}var u=new t$X;t$X.subtract(a,r,u);var c=we$6(t),h=ye$6(t,u),d=[],f={aSideness:0};d.push({index:f.aSideness,vertexBuffer:c,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1}),f.aPosition0=1,d.push({index:f.aPosition0,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1,instanceDivisor:1}),f.aPosition1=2,d.push({index:f.aPosition1,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:12,strideInBytes:12,normalize:!1,instanceDivisor:1});var p=xe$7(t),_=new r$15({primitiveType:W$_.TRIANGLES,pass:Le$p.OPAQUE,owner:e,cull:!1}),m=new y$15;y$15.clone(y$15.IDENTITY,m),y$15.setTranslation(m,r,m),e._scene.mode!==P$$.SCENE3D&&y$15.multiply(me$a,m,m),_.modelMatrix=m,_.vertexArray=new m$19({context:t,attributes:d,indexBuffer:p}),_.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:he$6,fragmentShaderSource:_e$7,attributeLocations:f}),_.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}});var $=e._currentTargetName,g={uRenderTextureMatrix:function(){return e._renderTextureMatrixs.get($)},uTexture0:function(){return e._depthBuffers.get($).depthTexture},uVisibleColor:function(){return e._visibleColor},uHiddenColor:function(){return e._hiddenColor},uLineWidth:function(){return e._lineWidth}};_.uniformMap=g;var v=r$15.shallowClone(_);v.pass=Le$p.ANALYSIS,v.renderState=u$R.fromCache({depthMask:!1,depthTest:{enabled:!1},blending:Ee$n.ALPHA_BLEND}),v.uniformMap.uHiddenColor=function(){return e$25.clone(e._hiddenColor,k$k),k$k.w=.2,k$k},v.uniformMap.uVisibleColor=function(){return e$25.clone(e._visibleColor,G$o),G$o.w=.2,G$o},e._commands.set($,[v,_])}function ee$a(e,t){var i=e._targetPoints.get(t);if(e$28(i)){var r={isViewer:!0},n=t$X.fromDegreesArrayHeights(i,e._scene._globe.ellipsoid)[0],o=new e$25(n.x,n.y,n.z,1),a=e._viewProjMatrixs.get(t);if(y$15.multiplyByVector(a,o,o),e$25.divideByScalar(o,o.w,o),o.x>1||o.x<-1||o.y>1||o.y<-1)return r;var s=e._scene.context,l=s.drawingBufferWidth,u=s.drawingBufferHeight,c=(.5*o.x+.5)*l-.5,h=(.5*o.y+.5)*u-.5;if(c<0||h<0)return r;for(var d=Math.floor(c),f=c-d,p=Math.floor(h),_=h-p,m=e._depthBuffers.get(t),$=s.readPixels({framebuffer:m.framebuffer,x:d,y:p,width:2,height:2}),g=new e$25,v=(new t$X,new e$25(1/255,1/65025,1/160581375,1/4228250625)),y=[],x=(e._scene,s.uniformState.currentFrustum),b=(x.x,x.y,0);b<4;b++){var w=e$25.unpack($,4*b,g),C=e$25.dot(w,v);if(!(C<1&&C>0))return r;y[b]=2*C-1}var T=(1-_)*((1-f)*y[0]+f*y[1])+_*((1-f)*y[2]+f*y[3]);if(o.z-T>1e-6){var S=new y$15;y$15.inverse(a,S),o.z=T,y$15.multiplyByVector(S,o,o),e$25.divideByScalar(o,o.w,o);var E=t$W.fromCartesian(o,e._scene._globe.ellipsoid);r.position=E,r.isViewer=!1,r.st=new o$1k(d,p)}return r}}function be$6(e,t){var i=ee$a(e,t);if(e$28(i)&&e$28(i.position)&&e$28(i.st))return i.st}x$o.prototype.update=function(e,t,i){if(!t._fboState.enabled){var r=t.camera;for(var n in this._viewProjMatrixs._hash)y$15.multiply(this._viewProjMatrixs.get(n),r.inverseViewMatrix,this._renderTextureMatrixs.get(n));if(this._update){if(this._update=!1,this._frameState=t,this._targetPoints.values.length<1)return;if(this._updateAll)for(var o in this._updateAll=!1,this._targetPoints._hash){var a=this._targetPoints.get(o);this._currentTargetPoint=a,this._currentTargetName=o,J$g(this,e,t),$$e(this,e,t)}else J$g(this,e,t),$$e(this,e,t)}if(!t.passes.pick){var s=this._commands.length;for(o=0;o<s;o++)if(e$28(this._depthBuffers.values[o].framebuffer)){var l=this._commands.values[o];i.push(l[0]),i.push(l[1])}}}},x$o.prototype.setVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=1<<e,e$28(this._depthBuffer)&&(this._depthBuffer._visibleViewport=this._visibleViewport)},x$o.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},x$o.prototype.getBarrierPoint=function(e,t){var i=this._barrierPointArray.get(e);return e$28(t)&&t.bind(null,i)(),i},x$o.prototype.getObjectIds=function(){for(var e={},t=Object.keys(this._targetPoints._hash),i=0,r=t.length;i<r;i++){var n=t[i];this._scene.renderIds(this._sightlineCameras.get(n));var o=this._scene._defaultView.pickFramebuffer,a=this._scene._context,s=be$6(this,n);if(e$28(s)){var l=a.readPixels({x:s.x,y:s.y,width:1,height:1,framebuffer:o._fb}),u=e$1S.byteToRgba(l[0],l[1],l[2],l[3]),c=a.getObjectByPickId(u);if(e$28(c)){var h=c.primitive.id;u=c.id;e$28(e[h])||(e[h]=[]),-1===e[h].indexOf(u)&&e[h].push(u)}}}return e},x$o.prototype.build=function(){LicenseChecker.LICENSECHECKER.verify("Sightline"),""===this._name&&!this._checking&&(this._name="sightline"+this._scene._analyst3D._layerIndex,this._scene._analyst3D.add(this))},x$o.prototype.destroy=function(){return this.removeAllTargetPoint(),this._scene._analyst3D.remove(this._name,!0),i$Z(this)};var _0x95425e=(_0x35166e=!0,function(e,t){var i=_0x35166e?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x35166e=!1,i}),_0x1f6e72=_0x95425e(void 0,(function(){return _0x1f6e72.toString().search("(((.+)+)+)+$").toString().constructor(_0x1f6e72).search("(((.+)+)+)+$")})),_0x35166e;_0x1f6e72();var oe$7="attribute vec4 aPosition;\nattribute vec4 aTexCoord0;\n\nvoid main()\n{\n gl_Position = czm_modelViewProjection * aPosition;\n}",_0x56424d=(_0x46ddd1=!0,function(e,t){var i=_0x46ddd1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x46ddd1=!1,i}),_0x5ab8d1=_0x56424d(void 0,(function(){return _0x5ab8d1.toString().search("(((.+)+)+)+$").toString().constructor(_0x5ab8d1).search("(((.+)+)+)+$")})),_0x46ddd1;_0x5ab8d1();var ae$8="uniform vec4 uSkylineColor;\n\nvoid main()\n{\n gl_FragColor = uSkylineColor;\n}";function c$g(e){if(!e$28(e))throw new t$Z("scene are required.");if(!e.context.depthTexture)throw new t$Z("the depth buffer is not supported.");if(e$1U.maximumVertexTextureImageUnits<1)throw new t$Z("the max of vertexTextureImageUnits less 1, function is not supported.");this._displayMode={LINE:0,FACE:1},this._scene=e,this._depthBuffer=void 0,this._command=void 0,this._lineCommand=void 0,this._viewerCommand=void 0,this._viewerLineCommand=void 0,this._boundingSphere=new i$19,this._frameState=void 0,this._viewPosition=[0,0,0],this._direction=0,this._pitch=0,this._displayStyle=this._displayMode.LINE,this._invertViewMatrix=new y$15,this._invertViewProjectionMatrix=new y$15,this._color=new e$25(1,0,0,1),this._radius=-1,this._ignoreGlobe=!1,this._limitBodys=new e$1P,this._update=!1,this._visibleViewport=4095,this._id=0,this._name="",this._points=[],this._lineWidth=1,this._lineStripCollection=e.primitives.add(new X$v)}function H$m(e){e$28(e._command)&&(e._command.vertexArray=e._command.vertexArray&&e._command.vertexArray.destroy(),e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e$28(e._lineCommand)&&(e._lineCommand.vertexArray=e._lineCommand.vertexArray&&e._lineCommand.vertexArray.destroy(),e._lineCommand.shaderProgram=e._lineCommand.shaderProgram&&e._lineCommand.shaderProgram.destroy(),e._lineCommand=void 0),e$28(e._faceCommand)&&(e._faceCommand.vertexArray=e._faceCommand.vertexArray&&e._faceCommand.vertexArray.destroy(),e._faceCommand.shaderProgram=e._faceCommand.shaderProgram&&e._faceCommand.shaderProgram.destroy(),e._faceCommand=void 0)}function Z$g(e){e$28(e._viewerCommand)&&(e._viewerCommand.vertexArray=e._viewerCommand.vertexArray&&e._viewerCommand.vertexArray.destroy(),e._viewerCommand.shaderProgram=e._viewerCommand.shaderProgram&&e._viewerCommand.shaderProgram.destroy(),e._viewerCommand=void 0),e$28(e._viewerLineCommand)&&(e._viewerLineCommand.vertexArray=e._viewerLineCommand.vertexArray&&e._viewerLineCommand.vertexArray.destroy(),e._viewerLineCommand.shaderProgram=e._viewerLineCommand.shaderProgram&&e._viewerLineCommand.shaderProgram.destroy(),e._viewerLineCommand=void 0)}function Ie$6(e,t,i){var r=e._viewPosition[2],n=5e-4*r;n=n<1?1:n;var o=Math.abs(r)+6378137,a=Math.sqrt((o-6378137)*(o+6378137));r<0&&a<5e4?a=5e4:r<100&&r>0&&(a*=50);var s,l=e._direction*e$27.RADIANS_PER_DEGREE,u=e._pitch*e$27.RADIANS_PER_DEGREE,c=i.camera,h=c._projection;if(e._scene.mode===P$$.SCENE3D)s=t$X.fromDegreesArrayHeights(e._viewPosition,e._scene._globe.ellipsoid)[0];else{var d=t$W.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]);s=h.project(d,new t$X)}var f=c.frustum.near,p=c.frustum.far,_=new t$X,m=c.heading,$=c.pitch;t$X.clone(c.position,_),e._depthBuffer.isUpdate=!0,e._depthBuffer._beginFunc=function(){f=c.frustum.near,p=c.frustum.far,m=c.heading,$=c.pitch,t$X.clone(c.position,_),c.frustum.near=n,c.frustum.far=a;var t={destination:s,orientation:{heading:l,pitch:u},convert:!1};if(c.setView(t),e.skylineCamera=t,y$15.clone(c.inverseViewMatrix,e._invertViewMatrix),y$15.multiply(c.frustum.projectionMatrix,c.viewMatrix,e._invertViewProjectionMatrix),y$15.inverse(e._invertViewProjectionMatrix,e._invertViewProjectionMatrix),e._scene.mode===P$$.SCENE3D)t$X.clone(s,e._boundingSphere.center);else{var i=m$1b.convertToColumbusCartesian(t$X.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]));t$X.clone(i,e._boundingSphere.center)}e._boundingSphere.radius=a},e._depthBuffer._endFunc=function(){if(e$28(e._lineCommand)){e._points.length=0;var i=t.readPixels({framebuffer:e._depthBuffer.framebuffer}),r=e._lineCommand.vertexArray.getAttribute(0),n=4*(t.drawingBufferWidth+1),o=S$W.createTypedArray(r.componentDatatype,n);o[0]=0,o[1]=0,o[2]=0,o[3]=1,4*n!==r.vertexBuffer.sizeInBytes&&(H$m(e),me$9(e,t),r=e._lineCommand.vertexArray.getAttribute(0));for(var a=new e$25,s=new e$25(1,1/255,1/65025,1/160581375),l=t.uniformState,u=l.inverseProjection,h=l.currentFrustum,d=h.x,g=h.y,v=0;v<t.drawingBufferWidth;v++){for(var y=0,x=t.drawingBufferHeight-1;x>-1;x--){var b=4*(t.drawingBufferWidth*x+v),w=e$25.unpack(i,b,a);if(e$25.divideByScalar(w,255,w),(y=e$25.dot(w,s))>0)break;y=0}if(e._scene.frameState.useLogDepth&&y>0){var C=y*l.log2FarDepthFromNearPlusOne;y=g*(1-d/(Math.pow(2,C)-1+d))/(g-d)}a.x=v/t.drawingBufferWidth*2-1,a.y=x/t.drawingBufferHeight*2-1,a.z=2*y-1,a.w=1,y$15.multiplyByVector(u,a,a);var T=new t$X(a.x,a.y,a.z);t$X.divideByScalar(T,a.w,T);var S=t$X.magnitude(T);e._radius>0&&S>e._radius&&(t$X.normalize(T,T),T.x*=e._radius,T.y*=e._radius,T.z*=e._radius),a.x=T.x,a.y=T.y,a.z=T.z,a.w=1;var E=t$X.fromCartesian4(y$15.multiplyByVector(e._invertViewMatrix,a,new e$25));e._scene.mode===P$$.COLUMBUS_VIEW&&(E=m$1b.convertTo3DCartesian(E)),e._points.push(E),o[4*(v+1)]=a.x,o[4*(v+1)+1]=a.y,o[4*(v+1)+2]=a.z,o[4*(v+1)+3]=a.w}r.vertexBuffer.copyFromArrayView(o,0);for(var A=0;A<e._limitBodys.values.length;A++)e._limitBodys.values[A].update(t,c);e._lineStripCollection.removeAll(),e._lineWidth>=2&&e._lineStripCollection.add({width:e._lineWidth,positions:e._points,material:a$O.fromType(a$O.ColorType,{color:e$1S.fromCartesian4(e._color)})})}c.setView({destination:_,orientation:{heading:m,pitch:$,roll:c.roll},convert:!1}),c.frustum.near=f,c.frustum.far=p,e._depthBuffer.isUpdate=!1}}function Le$5(e,t,i){var r=i.camera.frustum,n=10,o=2*Math.atan(r.aspectRatio*Math.tan(.5*r.fovy)),a=n*Math.tan(.5*o),s=n*Math.tan(.5*r.fovy),l=S$W.createTypedArray(S$W.UNSIGNED_SHORT,12),u=S$W.createTypedArray(S$W.UNSIGNED_SHORT,16);l[0]=0,l[1]=2,l[2]=1,l[3]=0,l[4]=4,l[5]=2,l[6]=0,l[7]=3,l[8]=4,l[9]=0,l[10]=1,l[11]=3,u[0]=0,u[1]=1,u[2]=0,u[3]=2,u[4]=0,u[5]=3,u[6]=0,u[7]=4,u[8]=1,u[9]=2,u[10]=1,u[11]=3,u[12]=2,u[13]=4,u[14]=3,u[15]=4;var c=S$W.createTypedArray(S$W.FLOAT,15);c[0]=c[1]=c[2]=0,c[3]=-a,c[4]=-s,c[5]=-n,c[6]=-a,c[7]=s,c[8]=-n,c[9]=a,c[10]=-s,c[11]=-n,c[12]=a,c[13]=s,c[14]=-n;var h=h$W.createVertexBuffer({context:t,typedArray:c,usage:A$1c.STATIC_DRAW}),d=[],f={aPosition:0};d.push({index:f.aPosition,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1});var p=h$W.createIndexBuffer({context:t,typedArray:l,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),_=h$W.createIndexBuffer({context:t,typedArray:u,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});e._viewerLineCommand=new r$15({primitiveType:W$_.LINES,modelMatrix:e._invertViewMatrix,pass:Le$p.ANALYSIS,owner:e,cull:!1}),e._viewerLineCommand.vertexArray=new m$19({context:t,attributes:d,indexBuffer:_}),e._viewerLineCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:f}),e._viewerLineCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}});for(var m=[],$=0;$<6;$++)m[$]=new e$25(0,0,0,0);var g=new e$25(128/255,1,235/255,1);e._viewerLineCommand.uniformMap={uDiffuseColor:function(){return g},clip_mode:function(){return 0},clip_planes:function(){return m},clip_line_color:function(){return e$25.UNIT_W}},e._viewerCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix,pass:Le$p.ANALYSIS,owner:e,cull:!1}),e._viewerCommand.vertexArray=new m$19({context:t,attributes:d,indexBuffer:p}),e._viewerCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:f}),e._viewerCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}});var v=new e$25(68/255,222/255,158/255,1);e._viewerCommand.uniformMap={uDiffuseColor:function(){return v},clip_mode:function(){return 0},clip_planes:function(){return m},clip_line_color:function(){return e$25.UNIT_W}}}function me$9(e,t,i){var r=t.drawingBufferWidth+1,n=S$W.createTypedArray(S$W.FLOAT,4*r),o=S$W.createTypedArray(S$W.FLOAT,2*r),a=S$W.createTypedArray(S$W.UNSIGNED_SHORT,r-1),s=S$W.createTypedArray(S$W.UNSIGNED_SHORT,r);o[0]=-1;for(var l=1;l<r;l++)o[2*l]=l/(r-1),o[2*l+1]=0;for(l=0;l<r-1;l++)a[l]=l+1,s[l]=l;s[r-1]=r-1;var u=h$W.createVertexBuffer({context:t,typedArray:n,usage:A$1c.STATIC_DRAW}),c=[],h={aPosition:0};c.push({index:h.aPosition,vertexBuffer:u,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:16,normalize:!1}),h.aTexCoord0=1;var d=h$W.createVertexBuffer({context:t,typedArray:o,usage:A$1c.STATIC_DRAW});c.push({index:h.aTexCoord0,vertexBuffer:d,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var f=h$W.createIndexBuffer({context:t,typedArray:a,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),p=h$W.createIndexBuffer({context:t,typedArray:s,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),_={uSkylineColor:function(){return e._color}};e._lineCommand=new r$15({primitiveType:W$_.LINE_STRIP,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!1}),e._lineCommand.vertexArray=new m$19({context:t,attributes:c,indexBuffer:f}),e._lineCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:oe$7,fragmentShaderSource:ae$8,attributeLocations:h}),e._lineCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}}),e._lineCommand.uniformMap=_,e._faceCommand=new r$15({primitiveType:W$_.TRIANGLE_FAN,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!1}),e._faceCommand.vertexArray=new m$19({context:t,attributes:c,indexBuffer:p}),e._faceCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:oe$7,fragmentShaderSource:ae$8,attributeLocations:h}),e._faceCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0}}),e._faceCommand.uniformMap=_}function t$a(e){this._renderTexture=new o$B(e),this._renderTexture._passState.blendingEnabled=!1,this._context=e,this._isUpdate=!1,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0,isBillboardVisible:!1,isOnlyS3MObjectVisible:!0},this._type=L$T.SQRESULT,this._beginFunc=void 0,this._endFunc=void 0}Object.defineProperties(c$g.prototype,{viewPosition:{get:function(){return this._viewPosition},set:function(e){this._viewPosition=e,this._update=!0}},color:{get:function(){var e=new e$1S;return e.red=this._color.x,e.green=this._color.y,e.blue=this._color.z,e.alpha=this._color.w,e},set:function(e){this._color.x=e.red,this._color.y=e.green,this._color.z=e.blue,this._color.w=e.alpha,this._lineWidth>=2&&(this._update=!0)}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._update=!0}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._update=!0}},displayMode:{get:function(){return this._displayMode}},displayStyle:{get:function(){return this._displayStyle},set:function(e){this._displayStyle=e}},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this._update=!0}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=e,this._update=!0}},ignoreGlobe:{get:function(){return this._ignoreGlobe},set:function(e){this._ignoreGlobe=e,e$28(this._depthBuffer)&&(this._depthBuffer.environmentVisible.isGlobalVisible=!this._ignoreGlobe,this._update=!0)}}}),c$g.prototype.update=function(e,t,i){if(!t._fboState.enabled){this._update&&(e$28(this._depthBuffer)||(this._depthBuffer=new s$h(e),this._depthBuffer.environmentVisible.isGlobalVisible=!this._ignoreGlobe,this._depthBuffer.environmentVisible.isObjectVisible=!0,t._framebufferList[this._name]=this._depthBuffer,this._frameState=t),this._update=!1,H$m(this),Z$g(this),Ie$6(this,e,t),Le$5(this,e,t),me$9(this,e));for(var r=0;r<this._limitBodys.values.length;r++){var n=this._limitBodys.values[r];e$28(n)&&e$28(n._command)&&i.push(n._command)}e$28(this._viewerCommand),e$28(this._viewerLineCommand),this._displayStyle===this._displayMode.LINE?e$28(this._lineCommand)&&this._lineWidth<2&&i.push(this._lineCommand):e$28(this._faceCommand)&&i.push(this._faceCommand)}},c$g.prototype.setVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=1<<e,e$28(this._depthBuffer)&&(this._depthBuffer._visibleViewport=this._visibleViewport)},c$g.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},c$g.prototype.getSkyline2D=function(){if(!this._update){for(var e=this._scene.context,t=e.readPixels({framebuffer:this._depthBuffer.framebuffer}),i=(e.drawingBufferWidth,[]),r=[],n=[],o=[],a=new e$25,s=new e$25(1,1/255,1/65025,1/160581375),l=0;l<e.drawingBufferWidth;l++)for(var u=e.drawingBufferHeight-1;u>-1;u--){var c=4*(e.drawingBufferWidth*u+l),h=e$25.unpack(t,c,a);if(e$25.divideByScalar(h,255,h),e$25.dot(h,s)>0){i.push(l/e.drawingBufferWidth),r.push(u/e.drawingBufferHeight),n.push(l),o.push(u);break}}return{x:i,y:r,drawingBufferXArr:n,drawingBufferYArr:o}}},c$g.prototype.getSkyline3D=function(){if(!this._update&&0!==this._points.length){for(var e,t=[],i=[],r=[],n=0,o=this._points.length;n<o;n++)e=t$W.fromCartesian(this._points[n]),t.push(e.longitude*e$27.DEGREES_PER_RADIAN),i.push(e.latitude*e$27.DEGREES_PER_RADIAN),r.push(e.height);return{x:t,y:i,z:r}}},c$g.prototype.addLimitbody=function(e){var t=e.name,i=e.position;if(!e$28(t)||!e$28(i))return!1;var r=this._limitBodys.get(t);if(e$28(r))return!1;r=new C$h(i,this),this._limitBodys.set(t,r),e$28(this._depthBuffer)&&(this._depthBuffer.isUpdate=!0)},c$g.prototype.removeLimitbody=function(e){return!!this._limitBodys.remove(e)},c$g.prototype.removeAllLimitBody=function(){for(var e=0;e<this._limitBodys.values.length;e++)this._limitBodys.values[e].destroy(),this._limitBodys.values[e]=null;this._limitBodys.removeAll()},c$g.prototype.clear=function(){this.removeAllLimitBody(),this._update=!1,this._lineStripCollection.removeAll(),this._points=[],H$m(this),Z$g(this)},c$g.prototype.getObjectIds=function(){this._scene.renderIds(this.skylineCamera);var e=this._scene._defaultView.pickFramebuffer;if(e$28(e)){var t=this._scene._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=t.readPixels({x:0,y:0,width:i,height:r,framebuffer:e._fb}),o=this.getSkyline2D();if(e$28(o)){for(var a,s,l=o.drawingBufferXArr,u=o.drawingBufferYArr,c=l.length,h={};c--;){a=l[c],s=u[c];var d=e$25.fromArray(n,4*i*s+4*a),f=e$1S.byteToRgba(d.x,d.y,d.z,d.w),p=t.getObjectByPickId(f);if(e$28(p)){var _=p.primitive.id;f=p.id;e$28(h[_])||(h[_]=[]),-1===h[_].indexOf(f)&&h[_].push(f)}}return h}}},c$g.prototype.getSkylineSectorParameter=function(){var e=this.getSkyline3D();if(e$28(e)){for(var t,i,r,n=e.x,o=e.y,a=e.z,s=new t$p,l=0,u=n.length;l<u;l++)t=n[l],i=o[l],r=a[l],s.add(new s$q(t,i,r));return{geoLine3D:new p$x([s]),viewPos:new s$q(this._viewPosition[0],this._viewPosition[1],this._viewPosition[2])}}},c$g.prototype.build=function(){LicenseChecker.LICENSECHECKER.verify("Skyline"),""===this._name&&(this._name="skyline"+this._scene._analyst3D._layerIndex,this._scene._analyst3D.add(this))},c$g.prototype.destroy=function(){return e$28(this._frameState)&&(e$28(this._depthBuffer)&&delete this._frameState._framebufferList[this._name],this._frameState=void 0),this._depthBuffer=this._depthBuffer&&this._depthBuffer.destroy(),H$m(this),Z$g(this),this.removeAllLimitBody(),this._scene._analyst3D.remove(this._name,!0),i$Z(this)},Object.defineProperties(t$a.prototype,{renderTexture:{get:function(){return this._renderTexture}},environmentVisible:{get:function(){return this._environmentVisible}},isUpdate:{get:function(){return this._isUpdate},set:function(e){this._isUpdate=e}},isDepth:{get:function(){return!1}},isHeight:{get:function(){return!1}},frameBufferType:{get:function(){return this._type},set:function(e){this._type=e}}}),t$a.prototype.begin=function(e){this._renderTexture.update(e);var t=this._context,i=t.drawingBufferWidth,r=t.drawingBufferHeight;return this._renderTexture._passState.viewport.width=i,this._renderTexture._passState.viewport.height=r,this._beginFunc&&this._beginFunc(e),this._renderTexture._passState},t$a.prototype.end=function(e){this._endFunc&&this._endFunc(e)},t$a.prototype.update=function(e,t){},t$a.prototype.isDestroyed=function(){return!1},t$a.prototype.destroy=function(){return this._renderTexture=this._renderTexture&&this._renderTexture.destroy(),i$Z(this)};var _0x41149e=(_0xb92819=!0,function(e,t){var i=_0xb92819?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xb92819=!1,i}),_0x20e37f=_0x41149e(void 0,(function(){return _0x20e37f.toString().search("(((.+)+)+)+$").toString().constructor(_0x20e37f).search("(((.+)+)+)+$")})),_0xb92819;_0x20e37f();var he$5="attribute vec4 aPosition;\nattribute vec4 aNormal;\nuniform vec4 uDiffuseColor;\nvarying vec4 vColor;\nvarying vec3 normalEC;\nvarying vec3 positionEC;\nvoid main()\n{\n normalEC = czm_normal * aNormal.xyz;\n positionEC = (czm_modelView * aPosition).xyz;\n vColor = uDiffuseColor;\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}",_0x2282ff=(_0x29316b=!0,function(e,t){var i=_0x29316b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x29316b=!1,i}),_0x49495c=_0x2282ff(void 0,(function(){return _0x49495c.toString().search("(((.+)+)+)+$").toString().constructor(_0x49495c).search("(((.+)+)+)+$")})),_0x29316b;_0x49495c();var me$8="varying vec4 vColor;\nvarying vec3 normalEC;\nvarying vec3 positionEC;\nvoid main()\n{\n vec3 positionToEyeEC = -positionEC;\n vec4 color = czm_gammaCorrect(vColor);\n czm_materialInput materialInput;\n materialInput.normalEC = normalize(normalEC);\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = vColor.rgb;\n material.alpha = vColor.a;\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}";function p$i(e){if(!e$28(e))throw new t$Z("scene are required.");if(!e.context.depthTexture)throw new t$Z("the depth buffer is not supported.");this._scene=e,this._name="",this._frameState=void 0,this._isInitlized=!1,this._depthDirty=!1,this._bufferDirty=!1,this._updateIDs=!1,this._disjointIDs=[],this._intersectsIDs=[],this._ids=[],this._textures=[],this._depthBuffers=[],this._resultBuffer=void 0,this._disjointBuffer=void 0,this._worldMatrix=new y$15(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this._matDepthView=new y$15(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this._matDepthProject=new y$15(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this._boundingSphere=new i$19,this._depthCommands=[],this._colorCommand=void 0,this._clearCommand=new r$11({color:new e$1S(0,0,0,0),stencil:0,depth:1}),this._geometry=void 0,this._layers=[],this._fillColor=new e$1S(1,1,0,.5),this._outlineColor=new e$1S(1,0,0,1),this._positionMode=j$l.Disjoint,this._fillStyle=yt$3.Fill,this._positionMode=j$l.Disjoint,this._beQueryCollection=void 0,this._queryCollection=void 0,this._allS3MColorCommand=[],this._profile=!1,this._clipLayers=new e$1P,this._curFrameNumber=-1,this._width=1,this._height=1}function N$d(e){e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&!e._colorCommand.vertexArray.isDestroyed()&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&!e._colorCommand.shaderProgram.isDestroyed()&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0);for(var t=0;t<e._depthCommands.length;t++)e._depthCommands[t].vertexArray=e._depthCommands[t].vertexArray&&!e._depthCommands[t].vertexArray.isDestroyed()&&e._depthCommands[t].vertexArray.destroy(),e._depthCommands[t].shaderProgram=e._depthCommands[t].shaderProgram&&!e._depthCommands[t].shaderProgram.isDestroyed()&&e._depthCommands[t].shaderProgram.destroy(),e._depthCommands[t]=void 0;e._depthCommands=[],e$28(e._outlineCommand)&&(e._outlineCommand.vertexArray=e._outlineCommand.vertexArray&&!e._outlineCommand.vertexArray.isDestroyed()&&e._outlineCommand.vertexArray.destroy(),e._outlineCommand.shaderProgram=e._outlineCommand.shaderProgram&&!e._outlineCommand.shaderProgram.isDestroyed()&&e._outlineCommand.shaderProgram.destroy(),e._outlineCommand=void 0)}function X$9(e){for(var t=0;t<e._textures.length;t++)e$28(e._textures[t])&&(e._textures[t]=e._textures[t]&&e._textures[t].destroy(),e._textures[t]=null);e._textures=[]}function Z$f(e){e$28(e._frameState)&&(e$28(e._disjointBuffer)&&delete e._frameState._framebufferList.sqDisjoinTexture,e$28(e._resultBuffer)&&delete e._frameState._framebufferList.sqResultTexture,e._frameState=void 0),e._disjointBuffer=e._disjointBuffer&&e._disjointBuffer.destroy(),e._resultBuffer=e._resultBuffer&&e._resultBuffer.destroy();for(var t=0;t<e._depthBuffers.length;t++)e._depthBuffers[t]=e._depthBuffers[t]&&e._depthBuffers[t].destroy();e._depthBuffers=[]}function Se$5(e){return!!e$28(e)&&(e.geoType===P$v.GEOCONE||e.geoType===P$v.GEOBOX||e.geoType===P$v.GEOCYLINDER||e.geoType===P$v.GEOSPHERE||e.geoType===P$v.GEOREGION3D||e.geoType===P$v.GEOELLIPSOID||e.geoType===P$v.GEOMODEL3D||e instanceof v$C)}function De$8(e,t,i){Z$f(e),N$d(e),X$9(e),be$5(e,t,i),xe$6(e,t,i);for(var r=0;r<e._layers.length;r++)e._layers[r]._spatialQueryEnable=!0,e._layers[r]._setSQTextures(e._textures),e._layers[r].selectEnabled=!0;r=0;for(var n=e._clipLayers.length;r<n;r++){e._clipLayers.values[r]._setSQTextures(e._textures)}e._isInitlized=!0}function be$5(e,t,i){var r=t.drawingBufferWidth,n=t.drawingBufferHeight;if(0===e._textures.length)for(var o=0;o<3;o++){var a=new L$17({context:t,width:r,height:n,pixelFormat:V$O.UNSIGNED_BYTE,sampler:new n$Y({minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})});e._textures.push(a)}var s=new t$a(t);s.isUpdate=!1,i._framebufferList.sqResultTexture=s,e._resultBuffer=s;var l=new t$a(t);l.isUpdate=!1,i._framebufferList.sqDisjoinTexture=l,e._disjointBuffer=l}function xe$6(e,t,i){if(!e$28(e._colorCommand)||!e$28(e._outlineCommand))if(N$d(e),e._allS3MColorCommand.length>0)for(var r=0;r<e._allS3MColorCommand.length;r++)K$e(e,t),J$f(e,t,i,e._allS3MColorCommand[r]);else we$5(e,t,i)}function we$5(e,t,i){var r=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.TRANSLUCENT,owner:e}),n={aPosition:0};r.vertexArray=e._geometry.getVertexArray(t),r.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:he$5,fragmentShaderSource:me$8,attributeLocations:n}),r.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),r.uniformMap={uDiffuseColor:function(){return e._fillColor}},e._colorCommand=r,K$e(e,t),J$f(e,t,i,r);var o=new r$15({primitiveType:W$_.LINES,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.LOG_DEPTH_OVERLAY,owner:e});o.vertexArray=e._geometry.getOutlineVertexArray(t),o.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:n}),o.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),o.uniformMap={uDiffuseColor:function(){return e._outlineColor}},e._outlineCommand=o}function J$f(e,t,i,r){var n=r.shaderProgram.vertexShaderSource.clone(),o=new a$$({name:"SpatialQueryFp",sources:[z$m]});if(o.defines.push("DEPTH"),i.useLogDepth){n.defines.push("LOG_DEPTH");for(var a=n.sources,s=0;s<a.length;++s)a[s]=a$$.replaceMain(a[s],"czm_log_depth_main");a.push("\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n"),o.defines.push("LOG_DEPTH")}var l=r.shaderProgram._attributeLocations,u=r$15.shallowClone(r);u.renderState=u$R.fromCache({depthTest:{enabled:!0},cull:{enabled:!0,face:de$y.BACK}}),u.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:l}),u.framebuffer=e._depthBuffers[0],e._depthCommands.push(u);var c=r$15.shallowClone(r);c.renderState=u$R.fromCache({depthTest:{enabled:!0},cull:{enabled:!0,face:de$y.FRONT}}),c.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:l}),c.framebuffer=e._depthBuffers[1],e._depthCommands.push(c);var h=r$15.shallowClone(r),d=new a$$({name:"SpatialQueryFp",sources:[z$m]});d.defines.push("COLOR"),h.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!1}}),h.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:n,fragmentShaderSource:d,attributeLocations:l}),h.framebuffer=e._depthBuffers[2],e._depthCommands.push(h)}function K$e(e,t){var i=new a$z({context:t,colorTextures:[e._textures[0]],destroyAttachments:!1,depthStencilRenderbuffer:new o$C({context:t,format:M$q.DEPTH_STENCIL})});e._depthBuffers.push(i);var r=new a$z({context:t,colorTextures:[e._textures[1]],destroyAttachments:!1,depthStencilRenderbuffer:new o$C({context:t,format:M$q.DEPTH_STENCIL})});e._depthBuffers.push(r);var n=new a$z({context:t,colorTextures:[e._textures[2]],destroyAttachments:!1,depthStencilRenderbuffer:new o$C({context:t,format:M$q.DEPTH_STENCIL})});e._depthBuffers.push(n)}function $$d(e,t,i,r){if(e$28(i)){var n=[];if(Te$5(e._scene._context,i,e._layers,r,n),e._positionMode===j$l.Intersects)for(var o=Object.keys(r),a=0;a<o.length;a++){var s=n[o[a]],l=e._layers[s],u=r[o[a]];u.length>0&&l.setSelection(u)}}}function Te$5(e,t,i,r,n){if(e$28(t)&&t.isUpdate){for(var o=t.renderTexture._width,a=t.renderTexture._height,s=e.readPixels({framebuffer:t.renderTexture._fb,x:0,y:0,width:o,height:a}),l=[],u=0;u<i.length;u++){n[$=P$i(_=i[u].id)]=u,l.push($),r[$]=[]}for(var c=0;c<o;c++)for(var h=0;h<a;h++){var d=4*(h*o+c);if(0!==s[d]||0!==s[d+1]||0!==s[d+2]){var f=e$1S.byteToRgba(s[d],s[d+1],s[d+2],s[d+3]),p=e.getObjectByPickId(f);if(e$28(p)){var _=p.primitive.id,m=p.id,$=P$i(_),g=l.indexOf($);if(g>=0)if(i[n[$]],0==r[$].length){var v=[];v.push(m),r[$]=v}else(g=r[$].indexOf(m))<0&&r[$].push(m)}}}}}function P$i(e){return"id_"+e}function ye$5(e,t,i){if(e._profile){e$28(e._beQueryCollection)&&e._beQueryCollection._setSQMode(e._positionMode);for(var r=0,n=e._clipLayers.length;r<n;r++){e._clipLayers.values[r]._setSQMode(e._positionMode)}}else e._frameState=i,0!==e._textures.length&&e._bufferDirty&&!e._depthDirty&&(e._resultBuffer.isUpdate=!0,e._resultBuffer._beginFunc=function(t){for(var i=0;i<e._layers.length;i++)e._layers[i]._setSQMode(j$l.Intersects)},e._resultBuffer._endFunc=function(t){e._intersectsIDs=[],$$d(e,t,e._resultBuffer,e._intersectsIDs),e._resultBuffer.isUpdate=!1,e._updateIDs=!0},e._positionMode!==j$l.Intersects&&(e._disjointBuffer.isUpdate=!0,e._disjointBuffer._beginFunc=function(t){for(var i=0;i<e._layers.length;i++)e._layers[i]._setSQMode(j$l.Disjoint)},e._disjointBuffer._endFunc=function(t){e._disjointIDs=[],$$d(e,t,e._disjointBuffer,e._disjointIDs),Be$7(e),Me$7(e),e._disjointBuffer.isUpdate=!1,e._updateIDs=!0}),e._bufferDirty=!1)}function Be$7(e){if(e._positionMode===j$l.Disjoint)for(var t=Object.keys(e._disjointIDs),i=Object.keys(e._intersectsIDs),r=0;r<e._layers.length;r++){var n=e._layers[r],o=P$i(n.id);if(!(t.indexOf(o)<0)){if(i.indexOf(o)<0){n.setSelection(e._disjointIDs[o]);continue}for(var a=e._intersectsIDs[o],s=e._disjointIDs[o],l=0;l<a.length;l++){var u=s.indexOf(a[l]);u>=0&&s.splice(u,1)}n.setSelection(s)}}}function Me$7(e){if(e._positionMode===j$l.Contains)for(var t=Object.keys(e._disjointIDs),i=Object.keys(e._intersectsIDs),r=0;r<e._layers.length;r++){var n=e._layers[r],o=P$i(n.id);if(!(i.indexOf(o)<0)){if(t.indexOf(o)<0){n.setSelection(e._intersectsIDs[o]);continue}for(var a=e._intersectsIDs[o],s=e._disjointIDs[o],l=0;l<s.length;l++){var u=a.indexOf(s[l]);u>=0&&a.splice(u,1)}n.setSelection(a)}}}function f$m(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).context,i=e.width,r=e.height,n=e.depth,o=e.mipmapLevels,a=e.is3D,s=u$Y(e.pixelFormat,V$O.RGBA),l=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE),u=s,c=V$O.isCompressedFormat(u);if(s===V$O.DEPTH_STENCIL?u=de$y.DEPTH24_STENCIL8:s===V$O.DEPTH_COMPONENT&&(l===y$U.UNSIGNED_SHORT?u=de$y.DEPTH_COMPONENT16:l===y$U.UNSIGNED_INT&&(u=de$y.DEPTH_COMPONENT24)),l===y$U.FLOAT)switch(s){case V$O.RGBA:u=de$y.RGBA32F;break;case V$O.RGB:u=de$y.RGB32F;break;case V$O.RG:u=de$y.RG32F;break;case V$O.R:u=de$y.R32F}else if(l===y$U.HALF_FLOAT)switch(s){case V$O.RGBA:u=de$y.RGBA16F;break;case V$O.RGB:u=de$y.RGB16F;break;case V$O.RG:u=de$y.RG16F;break;case V$O.R:u=de$y.R16F}if(!e$28(i)||!e$28(r))throw new t$Z("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(o$1u.typeOf.number.greaterThan("width",i,0),i>e$1U.maximumTextureSize)throw new t$Z("Width must be less than or equal to the maximum texture size ("+e$1U.maximumTextureSize+"). Check maximumTextureSize.");if(o$1u.typeOf.number.greaterThan("height",r,0),r>e$1U.maximumTextureSize)throw new t$Z("Height must be less than or equal to the maximum texture size ("+e$1U.maximumTextureSize+"). Check maximumTextureSize.");if(!V$O.validate(s))throw new t$Z("Invalid options.pixelFormat.");if(!c&&!y$U.validate(l))throw new t$Z("Invalid options.pixelDatatype.");if(s===V$O.DEPTH_COMPONENT&&l!==y$U.UNSIGNED_SHORT&&l!==y$U.UNSIGNED_INT)throw new t$Z("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(s===V$O.DEPTH_STENCIL&&l!==y$U.UNSIGNED_INT_24_8)throw new t$Z("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(l===y$U.FLOAT&&!t.floatingPointTexture)throw new t$Z("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(l===y$U.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new t$Z("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(V$O.isDepthFormat(s)&&!t.depthTexture)throw new t$Z("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.");if(c){if(V$O.isDXTFormat(u)&&!t.s3tc)throw new t$Z("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_texture_compression_s3tc extension. Check context.s3tc.");if(V$O.isPVRTCFormat(u)&&!t.pvrtc)throw new t$Z("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_texture_compression_pvrtc extension. Check context.pvrtc.");if(V$O.isETC1Format(u)&&!t.etc1)throw new t$Z("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_texture_compression_etc1 extension. Check context.etc1.")}var h,d=e.preMultiplyAlpha||s===V$O.RGB||s===V$O.LUMINANCE,f=u$Y(e.flipY,!0),p=t._gl,_=a?p.TEXTURE_3D:p.TEXTURE_2D_ARRAY,m=p.createTexture();p.activeTexture(p.TEXTURE0),p.bindTexture(_,m),p.texStorage3D(_,o,u,i,r,n),p.bindTexture(_,null),h=c?V$O.compressedTextureSizeInBytes(s,i,r,n):V$O.textureSizeInBytes(s,l,i,r,n),this._id=e$1K(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_,this._texture=m,this._pixelFormat=s,this._internalFormat=u,this._pixelDatatype=l,this._width=i,this._height=r,this._depth=n,this._dimensions=new t$X(i,r,n),this._hasMipmap=!1,this._sizeInBytes=h,this._preMultiplyAlpha=d,this._flipY=f,this._sampler=void 0,this.ignoreWEBGL2=!1,this._isCompressed=c,this.sampler=e$28(e.sampler)?e.sampler:new n$Y,t.memorySize+=h}function L$p(e,t,i,r){if(!e$27.isPowerOfTwo(i)||!e$27.isPowerOfTwo(r))return!1;for(var n=e.length,o=i,a=r,s=0;;){if(s+=V$O.compressedTextureSizeInBytes(t,o,a),a>>=1,0==(o>>=1)&&0==a)break;o=Math.max(o,1),a=Math.max(a,1)}return s==n}function b$p(e,t,i){switch(e){case V$O.RGB_DXT1:case V$O.RGB_ETC1:return(t+3>>2)*(i+3>>2)*8;case V$O.RGBA_DXT5:return(t+3>>2)*(i+3>>2)*16;case V$O.RGB_PVRTC_4BPPV1:case V$O.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case V$O.RGB_PVRTC_2BPPV1:case V$O.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);case de$y.RGB565:return t*i*2;case V$O.RGBA:return t*i*4;case V$O.LUMINANCE_ALPHA:return t*i*2;default:return 0}}function g$l(e,t){if(t!==e._currentFramebuffer){var i;e._currentFramebuffer=t,typeof WebGLRenderingContext<"u"&&(i=[de$y.BACK]);var r=i;if(e$28(t))t._bind(),r=t._getActiveColorAttachments();else{var n=e._gl;n.bindFramebuffer(n.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(r)}}function B$b(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState,a=e._currentViewport;e._currentRenderState=t,e._currentPassState=i,e._currentViewport=i.viewport,u$R.partialApply(e._gl,n,t,o,i,a,i.viewport,r)}function u$j(e,t,i,r){var n=u$Y(i._renderState,e._defaultRenderState);if(e$28(t)&&n.depthTest&&n.depthTest.enabled&&!t.hasDepthAttachment)throw new t$Z("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");g$l(e,t),B$b(e,n,r,!1)}function s$g(e){this._pointCount=e.pointCount,this._primitiveMode=e.primitiveMode,this._feedbackShaderProgram=e.feedbackShader,this._normalShaderProgram=e.normalShader,this._modelMatrix=e.modelMatrix,this._normalShaderUniformMap=e.normalShaderUniformMap,this._feedbackShaderUniformMap=e.feedbackShaderUniformMap,this._attributes=e.attributes,this._framebuffer=e.framebuffer,this._renderState=e.renderState,this._indices=e.indices,this._textureEffect=e.textureEffect,this._frameIdx=0,this._VBOs=new Array,this._VBOs[0]=new Array,this._VBOs[1]=new Array,this._indexBuffer=null,this._pass=Le$p.ANALYSIS,this._handle=void 0,this._gl=void 0,this.initialized=!1,this._drawEvent=new o$1o}Object.defineProperties(p$i.prototype,{geometry:{get:function(){return this._geometry},set:function(e){if(this._geometry&&this._geometry.type===P$v.GEOMODEL3D&&(this._queryCollection.removeCollection(this._name),this._queryCollection.destroy(),this._allS3MColorCommand=[],this._queryCollection=void 0),this._geometry=e,this._depthDirty=!0,this._isInitlized=!1,this._geometry.type===P$v.GEOMODEL3D)e$28(this._queryCollection)&&(this._queryCollection.removeCollection(this._name),this._queryCollection.destroy(),this._allS3MColorCommand=[]),this._queryCollection=new _0x36e54b(this._scene.context),this._queryCollection._needToRender=!1,this._requestModel(e);else if(e$28(this._geometry._shape)){var t=new v$C({geometryInstances:new d$15({attributes:{color:new o$18},geometry:this._geometry}),appearance:new r$J({translucent:!1})});this._scene.primitives.add(t),this._geometry=t}}},layers:{get:function(){return this._layers},set:function(e){for(var t=0;t<this._layers.length;t++)this._layers[t]._spatialQueryEnable=!1;this._layers=e,this._bufferDirty=!0}},fillColor:{get:function(){return this._fillColor},set:function(e){this._fillColor=e}},outlineColor:{get:function(){return this._outlineColor},set:function(e){this._outlineColor=e}},positionMode:{get:function(){return this._positionMode},set:function(e){this._positionMode=e,this._bufferDirty=!0}},fillStyle:{get:function(){return this._fillStyle},set:function(e){this._fillStyle=e}}}),p$i.prototype.destroy=function(){return Z$f(this),N$d(this),X$9(this),e$28(this._geometry)&&this._geometry.type===P$v.GEOMODEL3D?(this._queryCollection.removeCollection(this._name),this._queryCollection.destroy(),this._allS3MColorCommand=[]):this._beQueryCollection=void 0,this._profile=!1,this._scene._analyst3D.remove(this._name,!0),i$Z(this)},p$i.prototype.clear=function(){this._scene._analyst3D.remove(this._name,!1)},p$i.prototype.build=function(){LicenseChecker.LICENSECHECKER.verify("SpatialQuery3D"),""===this._name?(this._name="spatialQuery3D"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_scene",this._cameraName=this._name+"_camera",this._scene._analyst3D.add(this)):e$28(this._scene._analyst3D.find(this._name))||this._scene._analyst3D.add(this)},p$i.prototype.update=function(e,t,i){if(this._curFrameNumber!==t.frameNumber&&(this._curFrameNumber=t,!t._fboState.enabled&&e$28(this._geometry)&&(0!==this._clipLayers.length||0!==this._layers.length||e$28(this._beQueryCollection)))){if(!Se$5(this._geometry))throw new t$Z("the geometry type is not supported.");var r=e.drawingBufferWidth,n=e.drawingBufferHeight;if((this._width!==r||this._height!==n)&&(this._geometry.isGeometryDirty=!0,this._width=r,this._height=n),this._geometry.isGeometryDirty&&(this._isInitlized=!1),this._geometry.type===P$v.GEOMODEL3D){if(this._queryCollection.update(t),this._allS3MColorCommand=this._queryCollection._getAllColorCommand(),0===this._allS3MColorCommand.length)return}else if(this._geometry instanceof v$C){if(this._allS3MColorCommand=this._geometry._colorCommands,0===this._allS3MColorCommand.length)return;this._geometry._state=ce$o.FAILED}else{y$15.equalsEpsilon(this._worldMatrix,this._geometry.modelMatrix,e$27.EPSILON8)?0==this._boundingSphere.radius&&(this._boundingSphere=this.geometry._getGeometry().boundingSphere):(y$15.clone(this._geometry.modelMatrix,this._worldMatrix),i$19.transform(this.geometry._getGeometry().boundingSphere,this._worldMatrix,this._boundingSphere),this._depthDirty=!0)}this._isInitlized||(De$8(this,e,t),this._geometry.isGeometryDirty=!1),this._profile||this._updateTextures(e,t),ye$5(this,e,t),e$28(this._colorCommand)&&(this.fillStyle===yt$3.Fill||this.fillStyle===yt$3.Fill_And_WireFrame)&&!this._profile&&i.push(this._colorCommand),e$28(this._outlineCommand)&&(this.fillStyle===yt$3.WireFrame||this.fillStyle===yt$3.Fill_And_WireFrame)&&i.push(this._outlineCommand)}},p$i.prototype.getQueryIDs=function(){if(!this._updateIDs)return this._ids;this._ids=[];for(var e=new e$1P;;){this._bufferDirty=!0,this._resultBuffer.isUpdate=!0,this._scene.initializeFrame(),this._scene._renderForQuery();for(var t=!1,i=0;i<this._layers.length;i++){var r=(s=this._layers[i]).getSelection();if(!(r.length<=0)){if(e.contains(s.id)){var n;n=r.concat(e.get(s.id).ids),r=n}var o={layerName:s.name,layerIndex:i,ids:r};e.set(s.id,o),t=!0,s.releaseSelection(),s.setObjsVisible(r,!1)}}if(!t){this._bufferDirty=!1,this._resultBuffer.isUpdate=!1;break}}for(var a=0;a<e.values.length;a++){var s;(s=this._layers[e.values[a].layerIndex]).setObjsVisible([],!1);var l={layerName:e.values[a].layerName,ids:e.values[a].ids};this._ids.push(l)}return this._updateIDs=!1,this._ids},p$i.prototype._requestModel=function(){var e=this,t=this._geometry.geoModel;if(e$28(t)){var i=new Uint8Array(t.model);this._queryCollection.add(this._name,{position:t$X.fromDegrees(t.position.x,t.position.y,t.position.z),id:this._dataIndex,color:this._fillColor,scale:new t$X(t.scaleX,t.scaleY,t.scaleZ)},i.buffer)}else if(""!==this._geometry.geoFilePath){var r=this._geometry.geoFilePath,n=r.replace(/\?returnContent=.*$/,"");".json"===(n=n.substring(n.length-5).toLowerCase())?u$O(this._geometry.geoFilePath).then((function(t){if(null!=t.geometry){e._geometry.geoModel=t.geometry;var i=new Uint8Array(t.geometry.model);e._queryCollection.add(e._name,{position:t$X.fromDegrees(t.geometry.position.x,t.geometry.position.y,t.geometry.position.z),id:e._dataIndex,color:e._fillColor,scale:new t$X(t.geometry.scaleX,t.geometry.scaleY,t.geometry.scaleZ)},i.buffer)}})):o$$(r).then((function(t){var i=new DataView(t),n=0,o=i.getInt32(n,!0);n+=4;var a=a$Z(new Uint8Array(t,n,o)),s=JSON.parse(a).geometry;if(null!=s){n+=o;var l=i.getInt32(n,!0);n+=4;var u,c,h=[];for(u=0;u<l;u++)c=i.getInt32(n,!0),h.push(c),n+=4;var d=[];for(u=0;u<l;u++){if(0===(c=h[u]))d.push(null);else{var f=new Uint8Array(t,n,c);d.push(new Uint8Array(f).buffer)}n+=c}e._queryCollection.add(r,{position:t$X.fromDegrees(s.position.x,s.position.y,s.position.z),id:e._dataIndex,scale:new t$X(s.scaleX,s.scaleY,s.scaleZ),hpr:i$10.fromDegrees(-s.rotationZ,s.rotationX,s.rotationY)},d[0],!1)}}))}},p$i.prototype._updateTextures=function(e,t){if(this._curFrameNumber!==t.frameNumber&&(this._curFrameNumber=t,!(!this._depthDirty||e$28(this._resultBuffer)&&this._resultBuffer.isUpdate||e$28(this._disjointBuffer)&&this._disjointBuffer.isUpdate)||this._profile)){for(var i=t.camera,r=this._depthBuffers.length,n=0;n<r;n++)this._clearCommand.framebuffer=this._depthBuffers[n],this._clearCommand.execute(e);for(var o=0;o<r;o++)this._depthCommands[o].execute(e);e$28(this._beQueryCollection)&&3===this._textures.length&&this._beQueryCollection._setSQTextures(this._textures),this._clearCommand.framebuffer=void 0,y$15.clone(i.viewMatrix,this._matDepthView),y$15.clone(e.uniformState.projection,this._matDepthProject);for(n=0;n<this._layers.length;n++)this._layers[n]._setSQViewPrjMatrix(this._matDepthView,this._matDepthProject);this._depthDirty=!1,this._bufferDirty=!0}},f$m.create=function(e){return new Texture(e)},Object.defineProperties(f$m.prototype,{id:{set:function(e){this._id=e},get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,i=e.magnificationFilter,r=t===tt$h.NEAREST_MIPMAP_NEAREST||t===tt$h.NEAREST_MIPMAP_LINEAR||t===tt$h.LINEAR_MIPMAP_NEAREST||t===tt$h.LINEAR_MIPMAP_LINEAR,n=this._context,o=this._pixelDatatype;(o===y$U.FLOAT&&!n.textureFloatLinear||o===y$U.HALF_FLOAT&&!n.textureHalfFloatLinear)&&(t=r?tt$h.NEAREST_MIPMAP_NEAREST:tt$h.NEAREST,i=rt$g.NEAREST),!this.ignoreWEBGL2&&this._context.webgl2&&(!e$27.isPowerOfTwo(this._width)||!e$27.isPowerOfTwo(this._height))&&(t!=de$y.NEAREST&&(t=de$y.NEAREST),i!=de$y.NEAREST&&(i=de$y.NEAREST));var a=n._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.texParameteri(s,a.TEXTURE_MIN_FILTER,t),a.texParameteri(s,a.TEXTURE_MAG_FILTER,i),a.texParameteri(s,a.TEXTURE_WRAP_S,e.wrapS),a.texParameteri(s,a.TEXTURE_WRAP_T,e.wrapT),e$28(this._textureFilterAnisotropic)&&a.texParameteri(s,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),a.bindTexture(s,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),f$m.prototype.setDataBufferWithMipmap=function(e,t){var i=this._context._gl;i.activeTexture(i.TEXTURE0),i.bindTexture(this._textureTarget,this._texture);var r=this._width,n=this._height,o=L$p(t,this._internalFormat,r,n),a=0,s=0;do{var l,u=b$p(this._internalFormat,r,n);l=this._internalFormat==V$O.RGBA&&this._pixelDatatype===y$U.FLOAT?new Float32Array(t.buffer,t.byteOffset+a,u):new Uint8Array(t.buffer,t.byteOffset+a,u),this._isCompressed?i.compressedTexSubImage3D(this._textureTarget,s++,0,0,e,r,n,1,this._internalFormat,l):i.texSubImage3D(this._textureTarget,s++,0,0,e,r,n,1,this._internalFormat,this._pixelDatatype,l),r=Math.max(r>>1,1),n=Math.max(n>>1,1),a+=u}while(a<t.length&&o);i.bindTexture(this._textureTarget,null)},f$m.prototype.generateMipmap=function(e){if(e=u$Y(e,S$N.DONT_CARE),this._width>1&&!e$27.isPowerOfTwo(this._width))throw new t$Z("width must be a power of two to call generateMipmap().");if(this._height>1&&!e$27.isPowerOfTwo(this._height))throw new t$Z("height must be a power of two to call generateMipmap().");var t=this._gl,i=this._target;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(i,this._texture),t.generateMipmap(i)},f$m.prototype.isDestroyed=function(){return!1},f$m.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._context.memorySize-=this._sizeInBytes,i$Z(this)},s$g.prototype.beginDraw=function(e,t,i,r){u$j(e,t,i,r)},s$g.prototype.execute=function(e,t){var i=e._gl;if(this._gl=i,!this.initialized){for(var r=this._attributes.length,n=0;n<r;++n)this._addAttribute(e,this._attributes[n]);this._textureEffect&&this._createIndexBuffer(e),e$28(this._handle)||(this._handle=i.createTransformFeedback()),this.initialized=!0}u$j(e,u$Y(this._framebuffer,t.framebuffer),this,t),this._bindVBOToVertexAttribute(e),this._enableVertexAttribArray(e,!0),this._drawTransformFeedback(e),this._drawNormal(e,t),this._drawEvent.raiseEvent(e,t),this._enableVertexAttribArray(e,!1),this._frameIdx=1-this._frameIdx},s$g.prototype._drawNormal=function(e,t){var i=e._gl;this._normalShaderProgram._bind(),e._us.model=u$Y(this._modelMatrix,y$15.IDENTITY),this._normalShaderProgram._setUniforms(this._normalShaderUniformMap,e._us,e.validateShaderProgram),this._textureEffect?(i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,this._indexBuffer),i.drawElements(this._primitiveMode,this._indices.length,i.UNSIGNED_INT,0)):i.drawArrays(this._primitiveMode,0,this._pointCount)},s$g.prototype._drawTransformFeedback=function(e){var t=e._gl;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,this._handle),this._bindVBOToTransformFeedback(e,!0),this._feedbackShaderProgram._bind(),e._us.model=u$Y(this._modelMatrix,y$15.IDENTITY),this._feedbackShaderProgram._setUniforms(this._feedbackShaderUniformMap,e._us,e.validateShaderProgram),t.enable(t.RASTERIZER_DISCARD),t.beginTransformFeedback(this._primitiveMode),this._textureEffect?t.drawArrays(this._primitiveMode,0,4*this._pointCount):t.drawArrays(this._primitiveMode,0,this._pointCount),t.endTransformFeedback(),t.disable(t.RASTERIZER_DISCARD),this._bindVBOToTransformFeedback(e,!1)},s$g.prototype._enableVertexAttribArray=function(e,t){for(var i=e._gl,r=0;r<this._attributes.length;r++){var n=this._attributes[r].index;t?i.enableVertexAttribArray(n):i.disableVertexAttribArray(n)}},s$g.prototype._bindVBOToVertexAttribute=function(e){for(var t=e._gl,i=0;i<this._attributes.length;i++){var r=this._attributes[i],n=r.index,o=r.componentsPerAttribute;t.bindBuffer(t.ARRAY_BUFFER,this._VBOs[this._frameIdx][n]._getBuffer()),t.vertexAttribPointer(n,o,t.FLOAT,!1,0,0)}},s$g.prototype._bindVBOToTransformFeedback=function(e,t){for(var i=e._gl,r=0;r<this._attributes.length;r++){var n=this._attributes[r].index,o=t?this._VBOs[1-this._frameIdx][n]._getBuffer():null;i.bindBufferBase(i.TRANSFORM_FEEDBACK_BUFFER,n,o)}},s$g.prototype._addAttribute=function(e,t){var i=t.data,r=t.index;this._VBOs[0][r]=this._createVBO(e,i),this._VBOs[1][r]=this._createVBO(e,i)},s$g.prototype._createVBO=function(e,t){return new h$W({context:e,bufferTarget:de$y.ARRAY_BUFFER,usage:de$y.DYNAMIC_DRAW,typedArray:t})},s$g.prototype._createIndexBuffer=function(e){var t=e._gl;this._indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this._indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this._indices,t.STATIC_DRAW)},s$g.prototype.isDestroyed=function(){return!1},s$g.prototype.destroy=function(){e$28(this._normalShaderProgram)&&(this._normalShaderProgram=this._normalShaderProgram&&this._normalShaderProgram.destroy()),e$28(this._feedbackShaderProgram)&&(this._feedbackShaderProgram=this._feedbackShaderProgram&&this._feedbackShaderProgram.destroy());for(var e=0;e<this._attributes.length;e++){var t=this._attributes[e].index;this._VBOs[0][t].destroy(),this._VBOs[1][t].destroy()}return e$28(this._indexBuffer)&&this._gl.deleteBuffer(this._indexBuffer),e$28(this._handle)&&(this._handle=this._gl.deleteTransformFeedback(this._handle),this._handle=void 0),i$Z(this)},Object.defineProperties(s$g.prototype,{pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e)}}});var _0x2aeea3=(_0x8ddc05=!0,function(e,t){var i=_0x8ddc05?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x8ddc05=!1,i}),_0x57028a=_0x2aeea3(void 0,(function(){return _0x57028a.toString().search("(((.+)+)+)+$").toString().constructor(_0x57028a).search("(((.+)+)+)+$")})),_0x8ddc05;_0x57028a();var D$n="\nattribute vec4 aPosition;\nuniform mat4 uTexWorldViewProjMatrix0;\nuniform mat4 uTexWorldViewProjMatrix1;\nuniform mat4 uTexWorldViewProjMatrix2;\nuniform mat4 uTexWorldViewProjMatrix3;\nuniform mat4 uTexWorldViewProjMatrix4;\n\nuniform mat4 worldview_matrix;\nuniform mat4 projection_matrix;\nuniform float uRadius;\n\nvarying vec4 renderTextureCoord0;\nvarying vec4 renderTextureCoord1;\nvarying vec4 renderTextureCoord2;\nvarying vec4 renderTextureCoord3;\nvarying vec4 renderTextureCoord4;\n\nvarying vec4 vexPos;\nvarying vec3 vPositionToEyeEC;\n\nvec4 GetUV(const mat4 renderTextureMatrix)\n{\n\tvec4 texCoord = renderTextureMatrix * vec4(vexPos.xyz, 1.0);\n\ttexCoord = texCoord / texCoord.w;\n\ttexCoord.xyz = texCoord.xyz * 0.5 + 0.5;\n\treturn texCoord;\n}\n\nvoid main()\n{\t\n vec3 newPos = vec3(aPosition.xyz);\n\tnewPos = newPos * uRadius;\n\tvexPos = vec4(newPos.xyz, 1.0);\n\trenderTextureCoord0 = GetUV(uTexWorldViewProjMatrix0);\n\trenderTextureCoord1 = GetUV(uTexWorldViewProjMatrix1);\n\trenderTextureCoord2 = GetUV(uTexWorldViewProjMatrix2);\n\trenderTextureCoord3 = GetUV(uTexWorldViewProjMatrix3);\n\trenderTextureCoord4 = GetUV(uTexWorldViewProjMatrix4);\n\n\tgl_Position = czm_modelViewProjection * vexPos;\n\t\n}",_0x15b506=(_0xbf836a=!0,function(e,t){var i=_0xbf836a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xbf836a=!1,i}),_0x13b912=_0x15b506(void 0,(function(){return _0x13b912.toString().search("(((.+)+)+)+$").toString().constructor(_0x13b912).search("(((.+)+)+)+$")})),_0xbf836a;_0x13b912();var rr$1="\nuniform mat4 uTexWorldViewMatrix0;\nuniform mat4 uTexWorldViewMatrix1;\nuniform mat4 uTexWorldViewMatrix2;\nuniform mat4 uTexWorldViewMatrix3;\nuniform mat4 uTexWorldViewMatrix4;\n\nuniform mat4 uTexProjMatrix0;\nuniform mat4 uTexProjMatrix1;\nuniform mat4 uTexProjMatrix2;\nuniform mat4 uTexProjMatrix3;\nuniform mat4 uTexProjMatrix4;\nuniform sampler2D uDepthMap0;\nuniform sampler2D uDepthMap1;\nuniform sampler2D uDepthMap2;\nuniform sampler2D uDepthMap3;\nuniform sampler2D uDepthMap4;\nuniform int uDomeType;\nuniform float uRadius;\nuniform vec4 uVisibleAreaColor;\nuniform vec4 uHiddenAreaColor;\n\nvarying vec4 renderTextureCoord0;\nvarying vec4 renderTextureCoord1;\nvarying vec4 renderTextureCoord2;\nvarying vec4 renderTextureCoord3;\nvarying vec4 renderTextureCoord4;\n\nvarying vec4 vexPos;\n\nbool IsValidUV(vec4 texCoord)\n{\n\tif ((texCoord.x<=1.0)&&(texCoord.x>=0.0)&&(texCoord.y<=1.0)&&(texCoord.y>=0.0)&&(texCoord.z<=1.0)&&(texCoord.z>=0.0))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}\n\nbool IsVisible(sampler2D shadowMap, vec4 uv)\n{\n bool isVisible = true;\n\tfloat depth = czm_unpackDepth(texture2D(shadowMap, uv.xy));\n\tif(depth < 0.00001)\n {\n return isVisible;\n }\n\tif(uv.z > (depth + 0.00001))\n {\n isVisible = false;\n }\n\treturn isVisible;\n}\n\nbool GetVisibleFlag()\n{\n\tif(IsValidUV(renderTextureCoord0))\n\t{\n\t\treturn IsVisible(uDepthMap0, renderTextureCoord0);\n\t}\n\t\n\tif(IsValidUV(renderTextureCoord1))\n\t{\n\t\treturn IsVisible(uDepthMap1, renderTextureCoord1);\n\t}\n\t\n\tif(IsValidUV(renderTextureCoord2))\n\t{\n\t\treturn IsVisible(uDepthMap2, renderTextureCoord2);\n\t}\n\t\n\tif(IsValidUV(renderTextureCoord3))\n\t{\n\t\treturn IsVisible(uDepthMap3, renderTextureCoord3);\n\t}\n\t\n\tif(IsValidUV(renderTextureCoord4))\n\t{\n\t\treturn IsVisible(uDepthMap4, renderTextureCoord4);\n\t}\n\treturn true;\n}\n\nvoid main()\n{\n\tbool isVisible = GetVisibleFlag();\n\tif(uDomeType == 0)\n\t{\n if (!isVisible)\n {\n discard;\n }\n else\n {\n gl_FragColor = uVisibleAreaColor;\n }\n\t}\n\telse if(uDomeType == 1)\n\t{\n\t\tif (!isVisible)\n\t\t{\n\t\t\tgl_FragColor = uHiddenAreaColor;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdiscard;\n\t\t}\n\t}\n\telse\n\t{\n\t if (!isVisible)\n\t\t{\n\t\t\tgl_FragColor = uHiddenAreaColor;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tgl_FragColor = uVisibleAreaColor;\n\t\t}\n\t}\n}",e$l={VISIBLEDOME:0,HIDDENDOME:1,ALLDOME:2},ur=Object.freeze(e$l),fr=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function b$o(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._cameraDepthBuffer=[],this._cameraNames=[],this._renderTextureMatrix=[],this._texWorldViewMatrix=[],this._texPrjMatrix=[],this._dirRadian=[],this._dPitch=[],this._colorCommand=void 0,this._boundingSphere=new i$19,this._frameState=void 0,this._viewPosition=[0,0,0],this._startAngle=0,this._endAngle=360,this._visibleAreaColor=new e$25(0,1,0,.5),this._hiddenAreaColor=new e$25(1,0,0,.5),this._domeType=ur.ALLDOME,this._quality=0,this._displayMode=0,this._name="",this._checking=!1,this._sceneName="",this._updateCamera=!0,this._isRecreateTexture=!0,this._targetPoints=[],this._worldMatrix=y$15.IDENTITY.clone(),this._initialize=!1,this._id=0,this._isUpdateCommand=!1,this._textureFinish=!1,this._isClosed=!1}function dr(e){e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0)}function v$m(e){if(e$28(e._frameState)){for(var t in e._cameraDepthBuffer)e$28(e._cameraDepthBuffer[t])&&delete e._frameState._framebufferList[t];e._frameState=void 0}for(var t in e._cameraDepthBuffer)e._cameraDepthBuffer[t]=e._cameraDepthBuffer[t]&&e._cameraDepthBuffer[t].destroy()}function cr(e,t,i){var r=i.camera,n=r.frustum.aspectRatio,o=r.frustum.fov,a=r.frustum.near,s=r.frustum.far,l=new t$X,u=r.heading,c=r.pitch,h=e._scene.globe.cullEnabled;t$X.clone(r.position,l);for(var d=0;d<5;d++){var f=90*e$27.RADIANS_PER_DEGREE,p=90*e$27.RADIANS_PER_DEGREE,_=Math.tan(.5*f)/Math.tan(.5*p),m=.001*e._distance,$=Math.max(e._distance,10),g=t$X.fromDegreesArrayHeights(e._viewPosition)[0],v=e._cameraNames[d];e._cameraDepthBuffer[v].isUpdate=!0;var y=i.useLogDepth;e._cameraDepthBuffer[v]._beginFunc=function(t){e._scene.globe.cullEnabled=!1,t.useLogDepth=!1,e._textureFinish=!1;var i=t._fboState.name,n=e._dirRadian[i]*e$27.RADIANS_PER_DEGREE,o=e._dPitch[i]*e$27.RADIANS_PER_DEGREE;r.frustum.aspectRatio=_,r.frustum.fov=f,r.frustum.near=m,r.frustum.far=$+100,r.setView({destination:g,orientation:{heading:n,pitch:o,roll:r.roll}}),y$15.multiply(r.viewMatrix,e._worldMatrix,e._texWorldViewMatrix[i]),y$15.multiply(r.frustum.projectionMatrix,e._texWorldViewMatrix[i],e._renderTextureMatrix[i]),y$15.clone(r.frustum.projectionMatrix,e._texPrjMatrix[i])},e._cameraDepthBuffer[v]._endFunc=function(i){r.setView({destination:l,orientation:{heading:u,pitch:c,roll:r.roll},convert:!1}),e._scene.globe.cullEnabled=h,r.frustum.aspectRatio=n,r.frustum.fov=o,r.frustum.near=a,r.frustum.far=s;var d=i._fboState.name;for(var f in e._cameraDepthBuffer[d]._isUpdate=!1,e._cameraDepthBuffer)if(e._cameraDepthBuffer[f]._isUpdate)return void(i.useLogDepth=y);if(e._textureFinish=!0,e._textureFinish){if(!e$28(e._colorCommand))return;var p=e._colorCommand.shaderProgram.fragmentShaderSource,_=e._colorCommand.shaderProgram.vertexShaderSource,m={aPosition:0};e._colorCommand.shaderProgram.destroy(),e._colorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:_,fragmentShaderSource:p,attributeLocations:m})}i.useLogDepth=y}}}function hr(e,t){var i=lr(e);xr(e),q$d(e,t),gr(e,t,i.vertexPackage,i.indexPackage)}function lr(e){return{vertexPackage:pr(129,129,1,e._startAngle,e._endAngle,e._isClosed),indexPackage:mr(129,129,e._startAngle,e._endAngle,e._isClosed)}}function pr(e,t,i,r,n,o){var a=e,s=t,l=(n-r)*e$27.RADIANS_PER_DEGREE/s,u=Math.PI/(2*a),c=0,h=0,d=!1;o&&(0!=r||360!=n)&&(d=!0);for(var f=0,p=d?(e+1)*t+1:(e+1)*t,_=S$W.createTypedArray(S$W.FLOAT,3*p),m=0;m<s;m++){h=m*l+r*e$27.RADIANS_PER_DEGREE;for(var $=0;$<=a;$++){c=$*u;var g=i*Math.sin(c)*Math.cos(h),v=i*Math.sin(c)*Math.sin(h),y=i*Math.cos(c);_[f++]=v,_[f++]=g,_[f++]=y}}return d&&(_[f++]=0,_[f++]=0,_[f++]=0),_}function mr(e,t,i,r,n){for(var o=[],a=0==i&&360==r?t:t-1,s=0;s<e;s++)for(var l=0;l<a;l++){var u=s+l*(e+1),c=u+1,h=l==t-1?s+1:u+e+2;o.push(u),o.push(c),o.push(h),o.push(u),o.push(h),o.push(h-1)}if(n&&(0!=i||360!=r)){var d=(e+1)*t,f=a*(e+1);for(s=0;s<e;s++)o.push(s),o.push(s+1),o.push(d),o.push(s+f+1),o.push(s+f),o.push(d)}for(var p=0,_=S$W.createTypedArray(S$W.UNSIGNED_SHORT,o.length),m=0;m<o.length;m++)_[p++]=o[m];return _}function xr(e){if(e._scene.mode===P$$.SCENE3D){var t=t$X.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]),i=new i$10(0,0,0);m$1b.headingPitchRollToFixedFrame(t,i,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,e._worldMatrix)}else if(e._viewPosition[0]>180||e._viewPosition[0]<-180||e._viewPosition[1]>180||e._viewPosition[1]<-180)layer._position=new t$X(layer.lon,layer.lat,height);else{var r=e._scene._frameState.camera._projection,n=t$X.fromDegrees(e._viewPosition[0],e._viewPosition[1],e._viewPosition[2]),o=r.ellipsoid.cartesianToCartographic(n);n=r.project(o),y$15.fromTranslation(n,e._worldMatrix),y$15.multiply(fr,e._worldMatrix,e._worldMatrix)}t$X.clone(t$X.ZERO,e._boundingSphere.center),e._boundingSphere.radius=e._distance,i$19.transform(e._boundingSphere,e._worldMatrix,e._boundingSphere)}function q$d(e,t){if(e._isRecreateTexture){var i=e._frameState;v$m(e),e._frameState=i;for(var r=0;r<5;r++){var n=new s$h(t);n.environmentVisible.isObjectVisible=!0,n.environmentVisible.isGlobalVisible=!0,n._visibleViewport=e._visibleViewport;var o=e._cameraNames[r];e._cameraDepthBuffer[o]=n,e._frameState._framebufferList[o]=e._cameraDepthBuffer[o],e._renderTextureMatrix[o]=new y$15,e._texWorldViewMatrix[o]=new y$15,e._texPrjMatrix[o]=new y$15,e._dirRadian[o]=90*r,e._dPitch[o]=4==r?90:0}e._isRecreateTexture=!1}}function gr(e,t,i,r){var n=h$W.createVertexBuffer({context:t,typedArray:i,usage:A$1c.STATIC_DRAW}),o=[],a={aPosition:0};o.push({index:a.aPosition,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1});var s=h$W.createIndexBuffer({context:t,typedArray:r,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});e._colorCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!1}),e._colorCommand.vertexArray=new m$19({context:t,attributes:o,indexBuffer:s});var l=new a$$({name:"ViewDomeVp",sources:[D$n]}),u=new a$$({name:"ViewDomeFp",sources:[rr$1]});e._colorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a}),e._colorCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),e._colorCommand.uniformMap={uVisibleAreaColor:function(){return e._visibleAreaColor},uHiddenAreaColor:function(){return e._hiddenAreaColor},uTexWorldViewProjMatrix0:function(){return e._renderTextureMatrix[e._cameraNames[0]]},uTexWorldViewProjMatrix1:function(){return e._renderTextureMatrix[e._cameraNames[1]]},uTexWorldViewProjMatrix2:function(){return e._renderTextureMatrix[e._cameraNames[2]]},uTexWorldViewProjMatrix3:function(){return e._renderTextureMatrix[e._cameraNames[3]]},uTexWorldViewProjMatrix4:function(){return e._renderTextureMatrix[e._cameraNames[4]]},uTexWorldViewMatrix0:function(){return e._texWorldViewMatrix[e._cameraNames[0]]},uTexWorldViewMatrix1:function(){return e._texWorldViewMatrix[e._cameraNames[1]]},uTexWorldViewMatrix2:function(){return e._texWorldViewMatrix[e._cameraNames[2]]},uTexWorldViewMatrix3:function(){return e._texWorldViewMatrix[e._cameraNames[3]]},uTexWorldViewMatrix4:function(){return e._texWorldViewMatrix[e._cameraNames[4]]},uTexProjMatrix0:function(){return e._texPrjMatrix[e._cameraNames[0]]},uTexProjMatrix1:function(){return e._texPrjMatrix[e._cameraNames[1]]},uTexProjMatrix2:function(){return e._texPrjMatrix[e._cameraNames[2]]},uTexProjMatrix3:function(){return e._texPrjMatrix[e._cameraNames[3]]},uTexProjMatrix4:function(){return e._texPrjMatrix[e._cameraNames[4]]},uDepthMap0:function(){return e._cameraDepthBuffer[e._cameraNames[0]].depthTexture},uDepthMap1:function(){return e._cameraDepthBuffer[e._cameraNames[1]].depthTexture},uDepthMap2:function(){return e._cameraDepthBuffer[e._cameraNames[2]].depthTexture},uDepthMap3:function(){return e._cameraDepthBuffer[e._cameraNames[3]].depthTexture},uDepthMap4:function(){return e._cameraDepthBuffer[e._cameraNames[4]].depthTexture},uRadius:function(){return e._distance},uDomeType:function(){return e._domeType}}}Object.defineProperties(b$o.prototype,{viewPosition:{get:function(){return this._viewPosition},set:function(e){this._viewPosition=e,this._updateCamera=!0}},distance:{get:function(){return this._distance},set:function(e){if(e<=0)throw new t$Z("the distance is greater than 0.0");this._distance=e,this._updateCamera=!0}},startAngle:{get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._initialize=!1,this._updateCamera=!0}},endAngle:{get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._initialize=!1,this._updateCamera=!0}},visibleAreaColor:{get:function(){var e=new e$1S;return e.red=this._visibleAreaColor.x,e.green=this._visibleAreaColor.y,e.blue=this._visibleAreaColor.z,e.alpha=this._visibleAreaColor.w,e},set:function(e){this._visibleAreaColor.x=e.red,this._visibleAreaColor.y=e.green,this._visibleAreaColor.z=e.blue,this._visibleAreaColor.w=e.alpha}},hiddenAreaColor:{get:function(){var e=new e$1S;return e.red=this._hiddenAreaColor.x,e.green=this._hiddenAreaColor.y,e.blue=this._hiddenAreaColor.z,e.alpha=this._hiddenAreaColor.w,e},set:function(e){this._hiddenAreaColor.x=e.red,this._hiddenAreaColor.y=e.green,this._hiddenAreaColor.z=e.blue,this._hiddenAreaColor.w=e.alpha}},domeType:{get:function(){return this._domeType},set:function(e){this._domeType=e}},isClosed:{get:function(){return this._isClosed},set:function(e){this._isClosed=e,this._initialize=!1,this._updateCamera=!0,this._isRecreateTexture=!0}}}),b$o.prototype.destroy=function(){return v$m(this),dr(this),this._scene.farToNearRatio=1e3,this._scene._analyst3D.remove(this._name,!0),i$Z(this)},b$o.prototype.build=function(){if(LicenseChecker.LICENSECHECKER.verify("ViewDome"),""===this._name&&!this._checking){this._name="ViewDome"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_scene";for(var e=0;e<5;e++)this._cameraNames.push(this._name+"_camera"+e);this._scene._analyst3D.add(this)}},b$o.prototype.update=function(e,t,i){"water"===t._fboState.name||t.passes.pick||t._fboState.enabled||(t.camera.bReflect||(this._initialize||(this._frameState=t,hr(this,e),this._initialize=!0,this._textureFinish=!1),this._updateCamera&&(this._frameState=t,this._isRecreateTexture&&(q$d(this),this._isRecreateTexture=!1),cr(this,e,this._frameState),this._update=!1,this._updateCamera=!1),e$28(this._colorCommand)&&this._textureFinish&&i.push(this._colorCommand)))},b$o.prototype.clear=function(){this._scene._analyst3D.remove(this._name,!1)};var _0x59e350=(_0x15127c=!0,function(e,t){var i=_0x15127c?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x15127c=!1,i}),_0x5319eb=_0x59e350(void 0,(function(){return _0x5319eb.toString().search("(((.+)+)+)+$").toString().constructor(_0x5319eb).search("(((.+)+)+)+$")})),_0x15127c;_0x5319eb();var Re$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 uVisibleAreaColor;\nuniform vec4 uHiddenAreaColor;\nuniform mat4 uRenderTextureMatrix;\nuniform vec2 uTexture1_size;\nuniform sampler2D uTexture1;\nuniform sampler2D uGlobalDepthTexture;\nuniform vec2 uGlobeTextureSize;\nvarying vec4 vClip_pos;\n\nfloat getDepth(in vec4 depth)\n{\n float z_window = czm_unpackDepth(depth);\n#ifdef LOG_DEPTH\n\t// float n_range = czm_depthRange.near;\n\t// float f_range = czm_depthRange.far;\n\t// float depthLog = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n // depthLog = depthLog * 0.5 + 0.5;\n // return depthLog;\n // return czm_reverseLogDepth(z_window);\n#endif\n return z_window;\n}\n\nfloat getDepthFromShadowMap(in sampler2D viewShedTexture, in vec4 texCoord)\n{\n\tvec2 tCoord;\n tCoord = texCoord.xy * uTexture1_size - 0.5;\n\tfloat x0 = floor(tCoord.x);\n\tfloat x1 = ceil(tCoord.x);\n\tfloat y0 = floor(tCoord.y);\n\tfloat y1 = ceil(tCoord.y);\n\tvec2 invTexSize = 1.0 / uTexture1_size;\n\tvec2 t00 = vec2((x0 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t10 = vec2((x1 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t01 = vec2((x0 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tvec2 t11 = vec2((x1 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tfloat z00 = getDepth(texture2D(uTexture1, t00));\n\tfloat z10 = getDepth(texture2D(uTexture1, t01));\n\tfloat z01 = getDepth(texture2D(uTexture1, t10));\n\tfloat z11 = getDepth(texture2D(uTexture1, t11));\n\tfloat depth = max(max(z00, z01), max(z10, z11));\n\treturn depth;\n}\n\n#ifdef CLIPPOLYGON\nuniform sampler2D uPolygonTexture;\nuniform mat4 uPolygonTextureMatrix;\nuniform float uPolygonMode;\nbool isClipValid(vec2 texcoord)\n{\n bool keepInside = (uPolygonMode > 1.5);\n if(keepInside)\n {\n return texture2D(uPolygonTexture, texcoord).r > 0.5;\n }\n else\n {\n return texture2D(uPolygonTexture, texcoord).r < 0.5;\n }\n}\n#endif\nvoid main()\n{\n czm_writeDepthClampedToFarPlane();\n\tvec4 depthTexCoord = vClip_pos / vClip_pos.w;\n\tdepthTexCoord.xy = depthTexCoord.xy * 0.5 + 0.5;\n// #ifdef LOG_DEPTH\n// depthTexCoord.x = depthTexCoord.x * czm_viewport.z / uGlobeTextureSize.x + czm_viewport.x / uGlobeTextureSize.x;\n// depthTexCoord.y = depthTexCoord.y * czm_viewport.w / uGlobeTextureSize.y + czm_viewport.y / uGlobeTextureSize.y;\n// #endif\n\tfloat sceneDepth = czm_unpackDepth(texture2D(uGlobalDepthTexture, depthTexCoord.xy));\n// #ifdef LOG_DEPTH\n// sceneDepth = czm_reverseLogDepth(sceneDepth);\n// #endif\n\tsceneDepth = sceneDepth * 2.0 - 1.0;\n\tvec4 pos = vClip_pos;\n\tpos.z = sceneDepth * pos.w;\n\t//vec4 viewPos = czm_inverseProjection * pos;\n\tvec4 renderTextureCoord = uRenderTextureMatrix * pos;\n\tvec4 texCoord = renderTextureCoord / renderTextureCoord.w;\n\ttexCoord.xyz = texCoord.xyz * 0.5 + 0.5;\n\tfloat depth = getDepthFromShadowMap(uTexture1, texCoord);\n\tfloat dxc = abs(dFdx(texCoord.z));\n\tfloat dyc = abs(dFdy(texCoord.z));\n\tfloat dF = max(dxc, dyc) * 3.0;\n\tfloat bias = 1.0e-6 + dF;\n\tfloat c = float(depth + bias < texCoord.z);\n\tvec4 resultColor = mix(uVisibleAreaColor, uHiddenAreaColor, vec4(c));\n\tif(resultColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n#ifdef CLIPPOLYGON\n vec4 polygonTextureCoord = uPolygonTextureMatrix * pos;\n\tvec4 texCoordPolygon = polygonTextureCoord / polygonTextureCoord.w;\n\ttexCoordPolygon.xyz = texCoordPolygon.xyz * 0.5 + 0.5;\n\tif(texCoordPolygon.x < 0.0 || texCoordPolygon.x > 1.0 || texCoordPolygon.y < 0.0 || texCoordPolygon.y > 1.0)\n\t{\n\t\tdiscard;\n }\n\tif(!isClipValid(texCoordPolygon.xy))\n {\n discard;\n }\n#endif\n\tgl_FragColor = resultColor;\n\tgl_FragColor = czm_gammaCorrect(gl_FragColor);\n}",_0x1731b1=(_0x423ac1=!0,function(e,t){var i=_0x423ac1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x423ac1=!1,i}),_0x29c981=_0x1731b1(void 0,(function(){return _0x29c981.toString().search("(((.+)+)+)+$").toString().constructor(_0x29c981).search("(((.+)+)+)+$")})),_0x423ac1;_0x29c981();var se$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 uVisibleAreaColor;\nuniform vec4 uHiddenAreaColor;\nuniform vec2 uTexture1_size;\n#if TEXTURE_UNITS > 0\nuniform sampler2D uTextures[TEXTURE_UNITS];\nuniform mat4 uRenderTextureMatrixs[TEXTURE_UNITS];\n#endif\nuniform sampler2D uGlobalDepthTexture;\nuniform vec2 uGlobeTextureSize;\nuniform int textureCount;\nvarying vec4 vClip_pos;\n\nfloat getDepth(in vec4 depth)\n{\n\tfloat z_window = czm_unpackDepth(depth);\n\tfloat n_range = czm_depthRange.near;\n\tfloat f_range = czm_depthRange.far;\n\treturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n}\n\nfloat getDepthFromShadowMap(in sampler2D viewShedTexture, in vec4 texCoord)\n{\n\tvec2 tCoord;\n tCoord = texCoord.xy * uTexture1_size - 0.5;\n\tfloat x0 = floor(tCoord.x);\n\tfloat x1 = ceil(tCoord.x);\n\tfloat y0 = floor(tCoord.y);\n\tfloat y1 = ceil(tCoord.y);\n\tvec2 invTexSize = 1.0 / uTexture1_size;\n\tvec2 t00 = vec2((x0 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t10 = vec2((x1 + 0.5) * invTexSize.x, (y0 + 0.5) * invTexSize.y);\n\tvec2 t01 = vec2((x0 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tvec2 t11 = vec2((x1 + 0.5) * invTexSize.x, (y1 + 0.5) * invTexSize.y);\n\tfloat z00 = getDepth(texture2D(viewShedTexture, t00));\n\tfloat z10 = getDepth(texture2D(viewShedTexture, t01));\n\tfloat z01 = getDepth(texture2D(viewShedTexture, t10));\n\tfloat z11 = getDepth(texture2D(viewShedTexture, t11));\n\tfloat depth = max(max(z00, z01), max(z10, z11));\n\treturn depth;\n}\n\nfloat isVisibleForOneViewShed(in sampler2D viewShedTexture, in vec4 viewPos, in mat4 renderTextureMatrix1)\n{\n vec4 renderTextureCoord = renderTextureMatrix1 * viewPos;\n\tvec4 texCoord = renderTextureCoord / renderTextureCoord.w;\n\ttexCoord.xyz = texCoord.xyz * 0.5 + 0.5;\n\n if (texCoord.x<0.0 || texCoord.x>1.0\n || texCoord.y<0.0 || texCoord.y>1.0)\n {\n return 1.0;\n }\n\n float depth = getDepthFromShadowMap(viewShedTexture, texCoord);\n depth = depth * 0.5 + 0.5;\n float dxc = abs(dFdx(texCoord.z));\n float dyc = abs(dFdy(texCoord.z));\n float dF = max(dxc, dyc) * 3.0;\n float bias = 1.0e-6 + dF;\n float c = float(depth+bias < texCoord.z);\n return c;\n}\nvoid main()\n{\n czm_writeDepthClampedToFarPlane();\n\tvec4 depthTexCoord = vClip_pos / vClip_pos.w;\n\tdepthTexCoord.xy = depthTexCoord.xy * 0.5 + 0.5;\n\tdepthTexCoord.x = depthTexCoord.x * czm_viewport.z / uGlobeTextureSize.x + czm_viewport.x / uGlobeTextureSize.x;\n\tdepthTexCoord.y = depthTexCoord.y * czm_viewport.w / uGlobeTextureSize.y + czm_viewport.y / uGlobeTextureSize.y;\n\tfloat sceneDepth = czm_unpackDepth(texture2D(uGlobalDepthTexture, depthTexCoord.xy));\n // sceneDepth = czm_reverseLogDepth(sceneDepth);\n\tsceneDepth = sceneDepth * 2.0 - 1.0;\n\tvec4 pos = vClip_pos;\n\tpos.z = sceneDepth * pos.w;\n\t//vec4 viewPos = czm_inverseProjection * pos;\n float c = isVisibleForMultiViewShed(pos);\n\tvec4 resultColor = mix(uVisibleAreaColor, uHiddenAreaColor, vec4(c));\n\tif(resultColor.a < 0.1)\n\t{\n\t\tdiscard;\n\t}\n\tgl_FragColor = resultColor;\n\tgl_FragColor = czm_gammaCorrect(gl_FragColor);\n}";function x$n(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._globalDepthBuffer=void 0,this._cameraDepthBuffer=void 0,this._clearStencilCommand=new r$11({stencil:0}),this._clearStencilCommand.pass=Le$p.ANALYSIS,this._lineCommand=void 0,this._stencilCommand=void 0,this._colorCommand=void 0,this._boundingSphere=new i$19,this._frameState=void 0,this._viewPosition=[0,0,0],this._direction=0,this._pitch=0,this._horizontalFov=90,this._verticalFov=60,this._distance=200,this._visibleAreaColor=new e$25(0,1,0,.5),this._hiddenAreaColor=new e$25(1,0,0,.5),this._hintLineColor=new e$25(1,1,1,1),this._segmentCount=20,this._invertViewMatrix=new y$15,this._viewProjMatrix=new y$15,this._matProj=new y$15,this._renderTextureMatrix=new y$15,this._update=!0,this._id=0,this._name="",this._sceneName="",this._cameraName="",this._checking=!1,this._visibleViewport=4095,this._targetPoints=[],this._multiNames=[],this._isUpdateCommand=!1,this._isShowLine=!0,this._polygonTexture=void 0,this._polygonRegions=new e$1P,this._polygonTextureMatrix=new y$15,this._polygonViewProjMatrix=new y$15,this._polygonUpdate=!1,this._polygonMode=V$i.KeepInside}function Ae$5(e){e$28(e._stencilCommand)&&(e._stencilCommand.vertexArray=e._stencilCommand.vertexArray&&e._stencilCommand.vertexArray.destroy(),e._stencilCommand.shaderProgram=e._stencilCommand.shaderProgram&&e._stencilCommand.shaderProgram.destroy(),e._stencilCommand=void 0),e$28(e._colorCommand)&&(e._colorCommand.vertexArray=e._colorCommand.vertexArray&&e._colorCommand.vertexArray.destroy(),e._colorCommand.shaderProgram=e._colorCommand.shaderProgram&&e._colorCommand.shaderProgram.destroy(),e._colorCommand=void 0),e$28(e._lineCommand)&&(e._lineCommand.vertexArray=e._lineCommand.vertexArray&&e._lineCommand.vertexArray.destroy(),e._lineCommand.shaderProgram=e._lineCommand.shaderProgram&&e._lineCommand.shaderProgram.destroy(),e._lineCommand=void 0)}function ze$3(e,t,i){var r=e._horizontalFov*e$27.RADIANS_PER_DEGREE,n=e._verticalFov*e$27.RADIANS_PER_DEGREE,o=Math.tan(.5*r)/Math.tan(.5*n);e._distance;var a=Math.max(e._distance,10),s=e._direction*e$27.RADIANS_PER_DEGREE,l=e._pitch*e$27.RADIANS_PER_DEGREE,u=t$X.fromDegreesArrayHeights(e._viewPosition)[0],c=i.camera,h=c.frustum.aspectRatio,d=c.frustum.fov,f=c.frustum.near,p=c.frustum.far,_=new t$X,m=c.heading,$=c.pitch,g=y$15.clone(c.transform,g);t$X.clone(c.position,_),e._cameraDepthBuffer.isUpdate=!0;var v=i.useLogDepth,y=e._scene.globe.depthTestAgainstTerrain;e._cameraDepthBuffer._beginFunc=function(t){t.useLogDepth=!1,e._scene.globe.depthTestAgainstTerrain=!0,h=c.frustum.aspectRatio,d=c.frustum.fov,f=c.frustum.near,p=c.frustum.far,m=c.heading,$=c.pitch,g=y$15.clone(c.transform,g),c._setTransform(y$15.IDENTITY),t$X.clone(c.position,_),c.frustum.aspectRatio=o,c.frustum.fov=r,c.frustum.near=1,c.frustum.far=a+100,c.setView({destination:u,orientation:{heading:s,pitch:l,roll:c.roll}}),y$15.multiply(c.frustum.projectionMatrix,c.viewMatrix,e._viewProjMatrix),y$15.clone(c.inverseViewMatrix,e._invertViewMatrix),y$15.clone(c.frustum.projectionMatrix,e._matProj),t$X.clone(t$X.ZERO,e._boundingSphere.center),e._boundingSphere.radius=e._distance,i$19.transform(e._boundingSphere,e._invertViewMatrix,e._boundingSphere)},e._cameraDepthBuffer._endFunc=function(t){c.setView({destination:_,orientation:{heading:m,pitch:$,roll:c.roll},convert:!1}),c.frustum.aspectRatio=h,c.frustum.fov=d,c.frustum.near=f,c.frustum.far=p,c._setTransform(g),e._cameraDepthBuffer.isUpdate=!1,t.useLogDepth=v,e._scene.globe.depthTestAgainstTerrain=y},e$28(e._globalDepthBuffer)&&(e._globalDepthBuffer.isUpdate=!0,e._globalDepthBuffer._beginFunc=function(t){e._scene.globe.depthTestAgainstTerrain=!0,t.useLogDepth=!1;var i=t$X.distance(c.positionWC,e._boundingSphere.center),r=i<e._boundingSphere.radius?2:i-e._boundingSphere.radius,n=i+e._boundingSphere.radius;c.frustum.near=r,c.frustum.far=n,e._globalDepthProjMatrix=c.frustum.projectionMatrix,e._globalDepthProjMatrixInv=y$15.inverse(e._globalDepthProjMatrix,new y$15);var o=y$15.multiply(c.inverseViewMatrix,e._globalDepthProjMatrixInv,new y$15);y$15.multiply(e._viewProjMatrix,o,e._renderTextureMatrix),e$28(e._polygonViewProjMatrix)&&y$15.multiply(e._polygonViewProjMatrix,o,e._polygonTextureMatrix)},e._globalDepthBuffer._endFunc=function(t){t.useLogDepth=v,c.frustum.near=f,c.frustum.far=p,e._scene.globe.depthTestAgainstTerrain=y})}function Ge$3(e,t,i){var r=(e._segmentCount+1)*(e._segmentCount+1)+1,n=S$W.createTypedArray(S$W.FLOAT,3*r),o=3,a=e._horizontalFov*e$27.RADIANS_PER_DEGREE,s=e._verticalFov*e$27.RADIANS_PER_DEGREE,l=(Math.tan(.5*a),Math.tan(.5*s));e._distance;var u=e._distance*l,c=Math.PI-.5*a,h=0,d=0,f=a/e._segmentCount;e._targetPoints.length=0;for(var p=0;p<e._segmentCount+1;p++){h=c+p*f;for(var _=u/(e._distance/Math.cos(h)),m=Math.atan(_),$=-m,g=2*m/e._segmentCount,v=new t$p,y=0;y<e._segmentCount+1;y++){d=$+y*g;var x=e._distance*Math.cos(d)*Math.sin(h),b=e._distance*Math.sin(d),w=e._distance*Math.cos(d)*Math.cos(h);n[o++]=x,n[o++]=b,n[o++]=w,v.add(new s$q(x,b,w))}e._targetPoints.push(v)}e._targetPoints.reverse();var C=2*(4+5*e._segmentCount+2*e._segmentCount*3),T=e._segmentCount*e._segmentCount*3*2+3*e._segmentCount*4,S=S$W.createTypedArray(S$W.UNSIGNED_SHORT,C),E=S$W.createTypedArray(S$W.UNSIGNED_SHORT,T),A=0;for(p=0;p<e._segmentCount;p++)for(y=0;y<e._segmentCount;y++)E[A++]=1+p+y*(e._segmentCount+1),E[A++]=1+p+1+y*(e._segmentCount+1),E[A++]=1+p+(y+1)*(e._segmentCount+1),E[A++]=1+p+1+y*(e._segmentCount+1),E[A++]=1+p+1+(y+1)*(e._segmentCount+1),E[A++]=1+p+(y+1)*(e._segmentCount+1);for(p=0;p<e._segmentCount;p++)E[A++]=p+1+1,E[A++]=p+1,E[A++]=0,E[A++]=0,E[A++]=p+e._segmentCount*(e._segmentCount+1)+1,E[A++]=p+1+e._segmentCount*(e._segmentCount+1)+1;for(p=0;p<e._segmentCount;p++)E[A++]=0,E[A++]=p*(e._segmentCount+1)+1,E[A++]=(p+1)*(e._segmentCount+1)+1,E[A++]=e._segmentCount+(p+1)*(e._segmentCount+1)+1,E[A++]=e._segmentCount+p*(e._segmentCount+1)+1,E[A++]=0;A=0,S[A++]=0,S[A++]=1,S[A++]=0,S[A++]=e._segmentCount+1,S[A++]=0,S[A++]=e._segmentCount*(e._segmentCount+1)+1,S[A++]=0,S[A++]=(e._segmentCount+1)*(e._segmentCount+1);for(p=0;p<5;p++)for(y=0;y<e._segmentCount;y++)S[A++]=1+y+5*(e._segmentCount+1)*p,S[A++]=1+(y+1)+5*(e._segmentCount+1)*p;for(p=0;p<5;p++)for(y=0;y<e._segmentCount;y++)S[A++]=1+(e._segmentCount+1)*y+5*p,S[A++]=1+(e._segmentCount+1)*(y+1)+5*p;var P=h$W.createVertexBuffer({context:t,typedArray:n,usage:A$1c.STATIC_DRAW}),I=[],M={aPosition:0};I.push({index:M.aPosition,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1});var O=h$W.createIndexBuffer({context:t,typedArray:S,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),D=h$W.createIndexBuffer({context:t,typedArray:E,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});e._lineCommand=new r$15({primitiveType:W$_.LINES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!0}),e._lineCommand.vertexArray=new m$19({context:t,attributes:I,indexBuffer:O}),e._lineCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:M}),e._lineCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var R=[];for(p=0;p<6;p++)R[p]=new e$25(0,0,0,0);e._lineCommand.uniformMap={uDiffuseColor:function(){return e._hintLineColor},clip_mode:function(){return 0},clip_planes:function(){return R},clip_line_color:function(){return e$25.UNIT_W}},e._stencilCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!0}),e._stencilCommand.vertexArray=new m$19({context:t,attributes:I,indexBuffer:D}),e._stencilCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:M}),e._stencilCommand.renderState=u$R.fromCache({depthMask:!1,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0,func:Me$l.GREATER},stencilTest:{enabled:!0,frontFunction:m$12.ALWAYS,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.INCREMENT_WRAP},backFunction:m$12.ALWAYS,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:65535}}),e._stencilCommand.uniformMap={uDiffuseColor:function(){return e$25.UNIT_W},clip_mode:function(){return 0},clip_planes:function(){return R},clip_line_color:function(){return e$25.UNIT_W}},e._colorCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!0}),e._colorCommand.vertexArray=new m$19({context:t,attributes:I,indexBuffer:D});var L=void 0,B=new a$$({name:"ViewShedAnalysisVp",sources:[Ee$7]});if(e._multiNames.length>1){let t=se$4.indexOf("void main");var N="float isVisibleForMultiViewShed(vec4 viewPos) {\n float c = 1.0;\n #if TEXTURE_UNITS > 0\n";for(let t=0;t<e._multiNames.length;t++)N+=` c = isVisibleForOneViewShed(uTextures[${t}], viewPos, uRenderTextureMatrixs[${t}]);\n if(c == 0.0 || textureCount == 1)\n {\n return c;\n }\n`;N+=" #endif\n return c;\n }",L=new a$$({sources:[se$4.slice(0,t)+N+se$4.slice(t)],defines:["TEXTURE_UNITS "+e._multiNames.length]})}else L=new a$$({sources:[Re$4]});e._colorCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:B,fragmentShaderSource:L,attributeLocations:M}),e._colorCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!1},depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},backFunction:m$12.NOT_EQUAL,backOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.DECREMENT_WRAP},reference:0,mask:65535},blending:Ee$n.ALPHA_BLEND}),e._multiNames.length<=1?e._colorCommand.uniformMap={uVisibleAreaColor:function(){return e._visibleAreaColor},uHiddenAreaColor:function(){return e._hiddenAreaColor},uRenderTextureMatrix:function(){return e._renderTextureMatrix},uTexture1_size:function(){var t=e._cameraDepthBuffer.depthTexture;return new o$1k(t.width,t.height)},uTexture1:function(){return e._cameraDepthBuffer.depthTexture},uGlobalDepthTexture:function(){return e._globalDepthBuffer.depthTexture},uGlobeTextureSize:function(){return new o$1k(e._globalDepthBuffer.depthTexture.width,e._globalDepthBuffer.depthTexture.height)},uPolygonTexture:function(){return e._polygonTexture},uPolygonMode:function(){return e._polygonMode},uPolygonTextureMatrix:function(){return e._polygonTextureMatrix}}:e._isUpdateCommand=!0}function Ue$5(e,t,i,r){if(e$28(i)&&!e$28(i._command)){var n=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._invertViewMatrix});i._command=n;var o={position:0};n.vertexArray=m$19.fromGeometry({context:t,geometry:i._geometry,attributeLocations:o,bufferUsage:A$1c.STATIC_DRAW,interleave:!0});var a=new a$$({sources:["attribute vec4 position;\nvoid main()\n{\n gl_Position = czm_modelViewProjection * vec4(position.xyz, 1.0);\n}\n"]}),s=new a$$({sources:["void main()\n{\n gl_FragColor = vec4(1.0);\n}\n"]});n.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:o}),n.framebuffer=new a$z({context:t,colorTextures:[r],destroyAttachments:!1}),n.renderState=u$R.fromCache({cull:{enabled:!1}})}}function je$3(e,t,i){if(e._polygonUpdate&&0!==e._polygonRegions.length){e._polygonUpdate=!1;var r=new r$11({color:new e$1S(0,0,0,0),depth:1});r.framebuffer=new a$z({context:t,colorTextures:[e._polygonTexture],destroyAttachments:!1}),r.renderState=u$R.fromCache(),r.execute(t);for(var n=0;n<e._polygonRegions.values.length;n++){var o=e._polygonRegions.values[n];Ue$5(e,t,o,e._polygonTexture),o._command.execute(t)}r.framebuffer.destroy()}}Object.defineProperties(x$n.prototype,{viewPosition:{get:function(){return this._viewPosition},set:function(e){this._viewPosition=e,this._update=!0}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._update=!0}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._update=!0}},horizontalFov:{get:function(){return this._horizontalFov},set:function(e){this._horizontalFov=e,this._update=!0}},verticalFov:{get:function(){return this._verticalFov},set:function(e){this._verticalFov=e,this._update=!0}},distance:{get:function(){return this._distance},set:function(e){if(e<=0)throw new t$Z("the distance is greater than 0.0");this._distance=e,this._update=!0}},visibleAreaColor:{get:function(){var e=new e$1S;return e.red=this._visibleAreaColor.x,e.green=this._visibleAreaColor.y,e.blue=this._visibleAreaColor.z,e.alpha=this._visibleAreaColor.w,e},set:function(e){this._visibleAreaColor.x=e.red,this._visibleAreaColor.y=e.green,this._visibleAreaColor.z=e.blue,this._visibleAreaColor.w=e.alpha}},hiddenAreaColor:{get:function(){var e=new e$1S;return e.red=this._hiddenAreaColor.x,e.green=this._hiddenAreaColor.y,e.blue=this._hiddenAreaColor.z,e.alpha=this._hiddenAreaColor.w,e},set:function(e){this._hiddenAreaColor.x=e.red,this._hiddenAreaColor.y=e.green,this._hiddenAreaColor.z=e.blue,this._hiddenAreaColor.w=e.alpha}},hintLineColor:{get:function(){var e=new e$1S;return e.red=this._hintLineColor.x,e.green=this._hintLineColor.y,e.blue=this._hintLineColor.z,e.alpha=this._hintLineColor.w,e},set:function(e){this._hintLineColor.x=e.red,this._hintLineColor.y=e.green,this._hintLineColor.z=e.blue,this._hintLineColor.w=e.alpha}},isShowLine:{get:function(){return this._isShowLine},set:function(e){this._isShowLine=e}}}),x$n.prototype.destroy=function(){return e$28(this._frameState)&&(e$28(this._globalDepthBuffer)&&delete this._frameState._framebufferList[this._sceneName],e$28(this._cameraDepthBuffer)&&delete this._frameState._framebufferList[this._cameraName],this._frameState=void 0),this._globalDepthBuffer=this._globalDepthBuffer&&this._globalDepthBuffer.destroy(),this._cameraDepthBuffer=this._cameraDepthBuffer&&this._cameraDepthBuffer.destroy(),Ae$5(this),this._clearStencilCommand=void 0,this._scene.farToNearRatio=1e3,this._scene._analyst3D.remove(this._name,!0),e$28(this._polygonTexture)&&(this._polygonTexture.destroy(),this._polygonTexture=null),i$Z(this)},x$n.prototype.clear=function(){this._scene._analyst3D.remove(this._name,!1)},x$n.prototype.build=function(){LicenseChecker.LICENSECHECKER.verify("ViewShed3D"),""===this._name&&!this._checking&&(this._name="viewshed3d"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_global",this._cameraName=this._name+"_camera",this._scene._analyst3D.add(this))},x$n.prototype.setDistDirByPoint=function(e){if(e[0]===this._viewPosition[0]&&e[1]===this._viewPosition[1]&&e[2]===this._viewPosition[2])throw new t$Z("the position is [longitude, latitude ,height] and is not equals viewPosition");var t,i,r=this._scene._frameState.camera,n=r._projection;if(this._scene.mode===P$$.SCENE3D)t=t$X.fromDegreesArrayHeights(e)[0],i=t$X.fromDegreesArrayHeights(this._viewPosition)[0];else{var o=t$W.fromDegrees(e[0],e[1],e[2]);t=n.project(o,new t$X);var a=t$W.fromDegrees(this._viewPosition[0],this._viewPosition[1],this._viewPosition[2]);i=n.project(a,new t$X)}var s=new t$X;t$X.subtract(t,i,s);var l=t$X.magnitude(s);t$X.normalize(s,s),this.distance=l;var u=r.heading,c=r.pitch,h=r.roll,d=new t$X;t$X.clone(r.position,d);var f=s.clone(),p=i.clone();p=t$X.normalize(p,p),Math.abs(t$X.dot(p,f))>=1&&(p=Math.abs(t$X.dot(f,t$X.UNIT_Y))<1?t$X.clone(t$X.UNIT_Y,p):t$X.clone(t$X.UNIT_Z,p));var _=new t$X;t$X.cross(p,f,_),_=t$X.normalize(_,_),t$X.cross(f,_,p),p=t$X.normalize(p,p),r.setView({destination:i,orientation:{direction:f,up:p},convert:!1}),this.direction=r.heading*e$27.DEGREES_PER_RADIAN,this.pitch=r.pitch*e$27.DEGREES_PER_RADIAN,r.setView({destination:d,orientation:{heading:u,pitch:c,roll:h},convert:!1})},x$n.prototype.update=function(e,t,i){if("normal"===t._fboState.name&&!t.passes.pick){if(t._fboState.enabled&&(t._fboState.name===this._sceneName||t._fboState.name===this._cameraName))return void(t._fboState.name===this._sceneName&&e$28(this._stencilCommand)&&i.push(this._stencilCommand));if(!t.camera.bReflect&&(this._update&&(this._frameState=t,e$28(this._cameraDepthBuffer)||(this._cameraDepthBuffer=new s$h(e),this._cameraDepthBuffer.environmentVisible.isObjectVisible=!0,this._cameraDepthBuffer.environmentVisible.isGlobalVisible=!0,this._cameraDepthBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._cameraName]=this._cameraDepthBuffer),e$28(this._globalDepthBuffer)||(this._globalDepthBuffer=new s$h(e),this._globalDepthBuffer.environmentVisible.isObjectVisible=!0,this._globalDepthBuffer.environmentVisible.isGlobalVisible=!0,this._globalDepthBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._sceneName]=this._globalDepthBuffer),this._update=!1,Ae$5(this),ze$3(this,e,t),Ge$3(this,e)),e$28(this._cameraDepthBuffer.framebuffer))){var r=i.pop();!e$28(r)||(e$28(this._clearStencilCommand)&&i.push(this._clearStencilCommand),e$28(this._stencilCommand)&&i.push(this._stencilCommand),e$28(this._colorCommand)&&i.push(this._colorCommand),e$28(this._lineCommand)&&this._isShowLine&&i.push(this._lineCommand),i.push(r))}}},x$n.prototype.setVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=1<<e,e$28(this._cameraDepthBuffer)&&(this._cameraDepthBuffer._visibleViewport=this._visibleViewport)},x$n.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},x$n.prototype.getViewshedParameter=function(){for(var e=[],t=this._invertViewMatrix,i=0,r=this._targetPoints.length;i<r;i++){for(var n=this._targetPoints[i].pntArray,o=new t$p,a=0,s=n.length;a<s;a++){var l=this.getBarrierPoint(n[a]);if(e$28(l))o.add(l);else{var u=y$15.multiplyByPoint(t,n[a],new t$X),c=t$W.fromCartesian(u),h=c.longitude*e$27.DEGREES_PER_RADIAN,d=c.latitude*e$27.DEGREES_PER_RADIAN;o.add(new s$q(h,d,c.height))}}e.push(o)}return{viewPosition:new s$q(this._viewPosition[0],this._viewPosition[1],this._viewPosition[2]),point3DList:e,distance:this._distance}};var Oe$5=new e$25(1/255,1/65025,1/160581375,1/4228250625);function He$5(e,t){for(var i=t$X.fromDegreesArrayHeights(t),r=new U$Q({polygonHierarchy:{positions:i},vertexFormat:{bitangent:!1,color:!1,normal:!1,position:!0,st:!1,tangent:!1},perPositionHeight:!0}),n=U$Q.createGeometry(r),o=t$X.fromDegreesArrayHeights(t),a=h$10.fromCartesianArray(o),s=[],l=1;l<i.length-1;l++)s.push(0),s.push(l),s.push(l+1);n.indices=s;var u=new y$15;y$15.inverse(e._invertViewMatrix,u),f$X.updateGeometry(n,t,u);var c=new f$X;return c._geometry=n,c._rectangle=a,c}function le$8(e,t){if(e$28(e._colorCommand)){var i=e._scene._context,r=e._colorCommand.shaderProgram.fragmentShaderSource,n=e._colorCommand.shaderProgram.vertexShaderSource,o=r.defines.indexOf("CLIPPOLYGON");t?o<0&&r.defines.push("CLIPPOLYGON"):o>=0&&r.defines.splice(o,1),e._colorCommand.shaderProgram.destroy(),e._colorCommand.shaderProgram=S$T.fromCache({context:i,vertexShaderSource:n,fragmentShaderSource:r,attributeLocations:e._attributeLocations})}}x$n.prototype.getBarrierPoint=function(e){var t=new e$25(e.x,e.y,e.z,1);if(y$15.multiplyByVector(this._matProj,t,t),e$25.divideByScalar(t,t.w,t),!(t.x>1||t.x<-1||t.y>1||t.y<-1)){var i=this._scene.context,r=i.drawingBufferWidth,n=i.drawingBufferHeight,o=(.5*t.x+.5)*r-.5,a=(.5*t.y+.5)*n-.5;if(!(o<0||a<0)){for(var s=Math.floor(o),l=o-s,u=Math.floor(a),c=a-u,h=i.readPixels({framebuffer:this._cameraDepthBuffer.framebuffer,x:s,y:u,width:2,height:2}),d=new e$25,f=[],p=0;p<4;p++){var _=e$25.unpack(h,4*p,d);if(f[p]=2*e$25.dot(_,Oe$5)-1,!(f[p]<1&&f[p]>0))return}var m=(1-c)*((1-l)*f[0]+l*f[1])+c*((1-l)*f[2]+l*f[3]);if(t.z-m>1e-6){var $=new y$15;y$15.inverse(this._viewProjMatrix,$),t.z=m,y$15.multiplyByVector($,t,t),e$25.divideByScalar(t,t.w,t);var g=t$W.fromCartesian(t);return new s$q(g.longitude*e$27.DEGREES_PER_RADIAN,g.latitude*e$27.DEGREES_PER_RADIAN,g.height)}}}},x$n.prototype._setMultiViewShedNames=function(e){if(this._multiNames.length!=e.length)return this._update=!0,void(this._multiNames=e);for(var t=0;t<this._multiNames.length;t++)if(this._multiNames[t]!=e[t])return this._update=!0,void(this._multiNames=e)},x$n.prototype.addClipRegion=function(e){var t=e.name,i=e.position;if(!e$28(t)||!e$28(i))return!1;if(e$28(this._polygonRegions.get(t)))return!1;var r=this._scene._context.drawingBufferWidth,n=this._scene._context.drawingBufferHeight;e$28(this._polygonTexture)||(this._polygonTexture=new L$17({context:this._scene._context,width:r,height:n}));var o=He$5(this,i);this._polygonRegions.set(t,o),this._polygonUpdate=!0;var a=this._frameState.camera,s=o._rectangle,l=new t$X,u=a.heading,c=a.pitch,h=a._positionCartographic.height;t$X.clone(a.position,l),a.setView({destination:t$X.fromRadians(s.west+.5*s.width,s.south+.5*s.height,h+1e3)}),y$15.multiply(a.frustum.projectionMatrix,a.viewMatrix,this._polygonViewProjMatrix),this._scene._context.uniformState.update(this._frameState),je$3(this,this._scene._context,this._frameState),le$8(this,!0),a.setView({destination:l,orientation:{heading:u,pitch:c,roll:a.roll}})},x$n.prototype.removeClipRegion=function(e){return!!this._polygonRegions.remove(e)&&(this._polygonUpdate=!0,0===this._polygonRegions.values.length&&le$8(this,!1),!0)},x$n.prototype.removeAllClipRegion=function(){for(var e=0;e<this._polygonRegions.values.length;e++)this._polygonRegions.values[e].destroy(),this._polygonRegions.values[e]=null;this._polygonRegions.removeAll(),this._polygonUpdate=!0,le$8(this,!1)},x$n.prototype.setClipMode=function(e){this._polygonMode=e};var _0x1810f3=(_0x2ca794=!0,function(e,t){var i=_0x2ca794?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2ca794=!1,i}),_0x411d4b=_0x1810f3(void 0,(function(){return _0x411d4b.toString().search("(((.+)+)+)+$").toString().constructor(_0x411d4b).search("(((.+)+)+)+$")})),_0x2ca794;function _0x26554f(){}_0x411d4b(),_0x26554f.maxVBOSize=0;var _0x31c8dd=0,_0xd2afdb=0,_0x2da224=1048576,_0x1b7362={},_0x48ddca=new e$1P;_0x26554f.createVertexBuffer=function(e,t){var i;if(e$28(_0x1b7362[e.id])){i=_0x1b7362[e.id];for(var r,n=t.byteLength,o=Object.keys(i._hash),a=!1,s=0,l=o.length;s<l;s++)if((r=Number(o[s]))>=n&&r<n+1024){a=!0;break}var u;if(a){var c=i.get(r);(u=c.pop()).isCached=!1,u.copyFromArrayView(t,0),_0x31c8dd-=r,c.length<1&&i.remove(r)}return u}},_0x26554f.createIndexBuffer=function(e,t){var i;if(e$28(_0x48ddca[e.id])){i=_0x48ddca[e.id];for(var r,n=t.byteLength,o=Object.keys(i._hash),a=!1,s=0,l=o.length;s<l;s++)if((r=Number(o[s]))===n){a=!0;break}var u;if(a){var c=i.get(r);(u=c.pop()).isCached=!1,u.copyFromArrayView(t,0),_0xd2afdb-=r,c.length<1&&i.remove(r)}return u}},_0x26554f.deleteBuffer=function(e){if(e$28(_0x1b7362[e.id])){var t,i,r,n,o=_0x1b7362[e.id],a=_0x2da224*_0x26554f.maxVBOSize*.9;if(_0x31c8dd>a*_0x2da224){var s=a*_0x2da224;for(i=(t=Object.keys(o._hash)).length,r=0;r<i&&_0x31c8dd>s;){n=t[r];for(var l=o.get(n);l.length&&_0x31c8dd>s;){l.pop().destroy(),_0x31c8dd-=n}l.length<1&&o.remove(n),++r}}if(e$28(_0x48ddca[e.id])){var u=_0x48ddca[e.id],c=_0x2da224*_0x26554f.maxVBOSize*.1;if(_0xd2afdb>c*_0x2da224){var h=c*_0x2da224;for(i=(t=Object.keys(u._hash)).length,r=0;r<i&&_0xd2afdb>h;){n=t[r];for(var d=u.get(n);d.length&&_0xd2afdb>h;){d.pop().destroy(),_0xd2afdb-=n}d.length<1&&u.remove(n),++r}}}}},_0x26554f.deleteVertexArray=function(e,t){var i,r;e$28(_0x1b7362[e.id])||(_0x1b7362[e.id]=new e$1P),i=_0x1b7362[e.id];for(var n=t._attributes,o=.9*_0x26554f.maxVBOSize,a=0;a<n.length;++a){var s=n[a].vertexBuffer;if(!(_0x31c8dd>=o||s.isCached||s.vertexArrayDestroyable)){var l=s.sizeInBytes;i.contains(l)?i.get(l).push(s):i.set(l,[s]),s.isCached=!0,_0x31c8dd+=l}}e$28(_0x48ddca[e.id])||(_0x48ddca[e.id]=new e$1P),r=_0x48ddca[e.id];var u=t._indexBuffer;return.1*_0x26554f.maxVBOSize>_0xd2afdb&&e$28(u)&&!u.isCached&&!u.vertexArrayDestroyable&&(r.contains(u.sizeInBytes)?r.get(u.sizeInBytes).push(u):r.set(u.sizeInBytes,[u]),u.isCached=!0,_0xd2afdb+=u.sizeInBytes),t.destroy()};var _0x39eae7=(_0xecb412=!0,function(e,t){var i=_0xecb412?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xecb412=!1,i}),_0x2c20a2=_0x39eae7(void 0,(function(){return _0x2c20a2.toString().search("(((.+)+)+)+$").toString().constructor(_0x2c20a2).search("(((.+)+)+)+$")})),_0xecb412;function _0x78f1ab(e){this._longitude=u$Y(e.longitude,0),this._latitude=u$Y(e.latitude,0),this._altitude=u$Y(e.altitude,0),this._scale=u$Y(e.scale,new t$X(1,1,1)),this._color=u$Y(e.color,e$1S.WHITE),this._heading=u$Y(e.heading,Math.PI/2),this._pitch=u$Y(e.pitch,0),this._roll=u$Y(e.roll,0),this._startDirection=u$Y(e.startDirection,0),this._offset=u$Y(e.offset,new t$X),this._timeStamp=u$Y(e.timeStamp,-1),this._id=u$Y(e.id,e$1K()),this._description=e.description,this._lockOrientation=u$Y(e.lockOrientation,!1)}_0x2c20a2(),Object.defineProperties(_0x78f1ab.prototype,{longitude:{get:function(){return this._longitude},set:function(e){this._longitude=e}},latitude:{get:function(){return this._latitude},set:function(e){this._latitude=e}},altitude:{get:function(){return this._altitude},set:function(e){this._altitude=e}},scale:{get:function(){return this._scale},set:function(e){this._scale=e}},color:{get:function(){return this._color},set:function(e){this._color=e}},heading:{get:function(){return this._heading},set:function(e){this._heading=e}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e}},roll:{get:function(){return this._roll},set:function(e){this._roll=e}},startDirection:{get:function(){return this._startDirection},set:function(e){this._startDirection=e}},offset:{get:function(){return this._offset},set:function(e){this._offset=e}},timeStamp:{get:function(){return this._timeStamp},set:function(e){this._timeStamp=e}},id:{get:function(){return this._id},set:function(e){this._id=e}},description:{get:function(){return this._description},set:function(e){this._description=e}},lockOrientation:{get:function(){return this._lockOrientation},set:function(e){this._lockOrientation=e}}}),_0x78f1ab.clone=function(e){return new _0x78f1ab({longitude:e._longitude,latitude:e._latitude,altitude:e._altitude,scale:e._scale,color:e._color,heading:e._heading,pitch:e._pitch,roll:e._roll,startDirection:e._startDirection,offset:e._offset,lockOrientation:e._lockOrientation})};var _0x451cac=(_0x23cf60=!0,function(e,t){var i=_0x23cf60?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x23cf60=!1,i}),_0x1b5faa=_0x451cac(void 0,(function(){return _0x1b5faa.toString().search("(((.+)+)+)+$").toString().constructor(_0x1b5faa).search("(((.+)+)+)+$")})),_0x23cf60;_0x1b5faa();var _0x2517ed="attribute vec4 aPosition;\n#ifdef HAS_NORMAL\n attribute vec3 aNormal;\n#endif\nattribute vec4 aTexCoord0;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\nattribute vec4 aPreHxyzLx;\nattribute vec4 aPreLyzNextHxy;\nattribute vec4 aNextHzLxyz;\nattribute vec4 aPreOrientation;\nattribute vec4 aNextOrientation;\nattribute vec4 aColorAndPickColor;\nattribute vec3 aPreHpr;\nattribute vec3 aNextHpr;\nattribute vec3 aScale;\nuniform vec3 uOffset;\nuniform mat4 uGeoMatrix;\nuniform float uInterval;\nuniform float uFilterMode;\nuniform float uMaxVisibleDistance;\nuniform float uFilterPixel;\nuniform float uRadius;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\nvarying vec2 vTexCoord;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvarying vec3 vNormalEC;\nvarying mat4 vModelMatrix;\n\nvec4 vertexColor = vec4(1.0);\nvec4 quaternionfromAxisAngle(vec3 axis, float angle)\n{\n float halfAngle = angle * 0.5;\n float s = sin(halfAngle);\n vec3 fromAxis = normalize(axis);\n return vec4(fromAxis * s, cos(halfAngle));\n}\nvec4 quaternionMultiply(vec4 left, vec4 right)\n{\n float x = left.w * right.x + left.x * right.w + left.y * right.z - left.z * right.y;\n float y = left.w * right.y - left.x * right.z + left.y * right.w + left.z * right.x;\n float z = left.w * right.z + left.x * right.y - left.y * right.x + left.z * right.w;\n float w = left.w * right.w - left.x * right.x - left.y * right.y - left.z * right.z;\n return vec4(x, y, z, w);\n}\nmat4 rotationFromQuaternion(vec4 q)\n{\n float x2 = q.x * q.x;\n float xy = q.x * q.y;\n float xz = q.x * q.z;\n float xw = q.x * q.w;\n float y2 = q.y * q.y;\n float yz = q.y * q.z;\n float yw = q.y * q.w;\n float z2 = q.z * q.z;\n float zw = q.z * q.w;\n float w2 = q.w * q.w;\n float m00 = x2 - y2 - z2 + w2;\n float m01 = 2.0 * (xy - zw);\n float m02 = 2.0 * (xz + yw);\n float m10 = 2.0 * (xy + zw);\n float m11 = -x2 + y2 - z2 + w2;\n float m12 = 2.0 * (yz - xw);\n float m20 = 2.0 * (xz - yw);\n float m21 = 2.0 * (yz + xw);\n float m22 = -x2 - y2 + z2 + w2;\n return mat4(m00, m10, m20, 0.0, m01, m11, m21, 0.0, m02, m12, m22, 0.0, 0.0, 0.0, 0.0, 1.0);\n}\nvec4 lerp(vec4 start, vec4 end, float t)\n{\n vec4 tmp = end * t;\n vec4 result = start * (1.0 - t);\n return result + tmp;\n}\nvec4 slerp(vec4 start, vec4 end, float t)\n{\n float dot = dot(start, end);\n vec4 r = end;\n if(dot < 0.0){\n dot = -dot;\n r = end * -1.0;\n }\n if(1.0 - dot < 0.000001){\n return mix(start, r, t);\n }\n float theta = acos(dot);\n float angle = (1.0 - t) * theta;\n vec4 scaledP = start * sin(angle);\n vec4 scaledR = r * (sin(t * theta));\n vec4 result = scaledP + scaledR;\n return result * (1.0 / sin(theta));\n}\nfloat filterTest(vec3 rte, float radius)\n{\n if(uFilterMode > 0.0)\n {\n float distance = length(rte);\n float theta = czm_piOverFour * 0.5;\n float screenPix = max(czm_globeDepthTextureDim.x, czm_globeDepthTextureDim.y) * 0.5;\n float lamat = screenPix / tan(theta);\n return lamat * radius / distance > uFilterPixel ? 1.0 : 0.0;\n }\n return length(rte) < uMaxVisibleDistance ? 1.0 : 0.0;\n}\nvoid main()\n{\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n vec3 prePosHigh = aPreHxyzLx.xyz;\n vec3 prePosLow = vec3(aPreHxyzLx.w, aPreLyzNextHxy.xy);\n vec3 nextPosHigh = vec3(aPreLyzNextHxy.zw, aNextHzLxyz.x);\n vec3 nextPosLow = aNextHzLxyz.yzw;\n vTexCoord = aTexCoord0.xy;\n vec4 vertexPos = aPosition - vec4(uOffset.xyz,0.0);\n //vertexPos.xyz *= aScale;\n vec4 positionMC = uGeoMatrix * vertexPos;\n vec4 preRte = czm_translateRelativeToEye(prePosHigh,prePosLow);\n vec4 nextRte = czm_translateRelativeToEye(nextPosHigh,nextPosLow);\n vec4 rte = mix(preRte, nextRte, uInterval);\n float show = filterTest(rte.xyz, uRadius * aScale.x);\n vec3 hpr = mix(aPreHpr, aNextHpr, uInterval);\n vec4 rollQuaternion = quaternionfromAxisAngle(vec3(1.0, 0.0, 0.0), hpr.z);\n vec4 pitchQuaternion = quaternionfromAxisAngle(vec3(0.0, 1.0, 0.0), -hpr.y);\n vec4 headingQuaternion = quaternionfromAxisAngle(vec3(0.0, 0.0, 1.0), -hpr.x);\n vec4 q = quaternionMultiply(rollQuaternion, pitchQuaternion);\n q = quaternionMultiply(headingQuaternion, q);\n mat4 rotationMat = rotationFromQuaternion(q);\n vec4 orientation = slerp(aPreOrientation, aNextOrientation, uInterval);\n mat3 velocityMat = mat3(rotationFromQuaternion(orientation)); mat3 rotationMatrix = velocityMat * mat3(rotationMat); mat4 scaleMatrix = mat4(aScale.x, 0, 0, 0, 0, aScale.y, 0, 0, 0, 0, aScale.z, 0, 0, 0, 0, 1);\n mat4 worldMatrix;\n worldMatrix[0] = vec4(rotationMatrix[0], 0.0);\n worldMatrix[1] = vec4(rotationMatrix[1], 0.0);\n worldMatrix[2] = vec4(rotationMatrix[2], 0.0);\n worldMatrix[3] = vec4(rte.xyz, 1.0);\n mat4 modelMatrix = worldMatrix * scaleMatrix;\n vModelMatrix = modelMatrix * uGeoMatrix;\n vertexPos = modelMatrix * positionMC;\n vertexPos.w = 1.0;\n vPositionMC.xyz = rotationMatrix * positionMC.xyz;\n vPositionMC.w = 0.0;\n gl_Position = show * czm_modelViewProjectionRelativeToEye * vertexPos;\n vec4 color, pickColor;\n color.xy = czm_decompressTextureCoordinates(aColorAndPickColor.x);\n color.zw = czm_decompressTextureCoordinates(aColorAndPickColor.y);\n pickColor.xy = czm_decompressTextureCoordinates(aColorAndPickColor.z);\n pickColor.zw = czm_decompressTextureCoordinates(aColorAndPickColor.w);\n vColor = vertexColor * color;\n vPositionEC = (czm_modelViewRelativeToEye * vec4(vPositionMC.xyz, 1.0)).xyz;\n#ifdef HAS_NORMAL\n if(length(aNormal) > 0.8)\n {\n vec3 normal = rotationMatrix * aNormal;\n mat4 realModelViewMatrix4 = czm_view * vModelMatrix;\n realModelViewMatrix4 = czm_inverseMatrix(realModelViewMatrix4);\n mat3 realModelViewMatrix3 = mat3(realModelViewMatrix4);\n realModelViewMatrix3 = czm_transpose(realModelViewMatrix3);\n vNormalEC = normalize(realModelViewMatrix3 * aNormal);\n vPositionMC.w = 1.0;\n }\n#endif\n vPickColor = pickColor;\n}",_0x1f937e=(_0x5c9adb=!0,function(e,t){var i=_0x5c9adb?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5c9adb=!1,i}),_0x4da793=_0x1f937e(void 0,(function(){return _0x4da793.toString().search("(((.+)+)+)+$").toString().constructor(_0x4da793).search("(((.+)+)+)+$")})),_0x5c9adb;_0x4da793();var _0x48dbdc=34,_0xcaffe3=new e$1S(.7,.7,1,1),_0x28b313={UNLOAD:0,LOADING:1,LOADED:2,PARSING:3,READY:4,FAILED:5};function _0x335c8a(e,t){LicenseChecker.LICENSECHECKER.verify("DynamicLayer3D"),o$1u.defined("context",e),o$1u.defined("context",t),Array.isArray(t)||(t=[t]),this._context=e,this._gl=e._gl,this._updateInterval=1e3,this._xmlParser=new s$P,this._visible=!0,this._type=oi$2.INSTANCED_LAYER,this._group={};for(var i=0,r=t.length;i<r;i++){var n=t[i];o$1u.typeOf.string("url",n),this._group[n]={url:n,ready:!1,visible:!0,pickEnable:!0,cullEnabled:!1,polygonOffset:{enabled:!1,factor:0,units:0},cullFace:k$11.BACK,loadState:_0x28b313.UNLOAD,buffer:void 0,offset:new t$X,radius:0,instanceCount:0,stateList:new e$1P,instanceList:new e$1P,removedList:new e$1P,renderEntities:[],boundingSphere:new i$19,beginTime:-1,interval:0}}this._maxVisibleAltitude=Number.MAX_VALUE,this._maxVisibleDistance=Number.MAX_VALUE,this._filterMode=_0x189b29.DISTANCE_FROM_EYE_POINT,this._filterPixel=0,this._enableLocalOffset=!0,this._visibleViewport=4095,null!==e.s3tc?this._supportCompressType=1:null!==e.pvrtc?this._supportCompressType=2:null!==e.etc1&&(this._supportCompressType=3),this._shadowType=_0x121e29.NONE,this._PBRMaterialParams={pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1,baseColor:new e$25(1,1,1,1),baseColorTextureIndex:-1,emissiveFactor:new t$X,emissiveTextureIndex:-1,occlusionTextureIndex:-1,normalTextureIndex:-1,normalTexture:void 0,baseColorTexture:void 0}},this._envMapIntensity=1}function _0x5960d8(e){return e._shadowType==_0x121e29.SELECTION||e._shadowType==_0x121e29.ALL}function _0x406685(e){e._times.length>3&&(e._times.splice(0,1),e._values.splice(0,e._packedLength))}function _0xf26872(e,t,i){for(var r=0;r<e._times.length;r++){var n=a$12.addSeconds(t,r*i,new a$12);e._times[r]=n}}function _0x55d468(e,t){for(var i=a$12.now(),r=0,n=e.stateList.length;r<n;r++){var o=e.stateList.values[r];_0xf26872(o.position._property,i,t),_0xf26872(o.heading,i,t),_0xf26872(o.pitch,i,t),_0xf26872(o.roll,i,t),_0xf26872(o.scale,i,t),_0xf26872(o.color,i,t)}}function _0x35b424(e){var t={};return e$28(e.a_position)&&(t.aPosition=e.a_position.index),e$28(e.a_normal)&&(t.aNormal=e.a_normal.index),e$28(e.a_vertexColor)&&(t.aColor=e.a_vertexColor.index),e$28(e.a_texcoord_0)&&(t.aTexCoord0=e.a_texcoord_0.index),e$28(e.a_texcoord0)&&(t.aTexCoord0=e.a_texcoord0.index),t}function _0x4ea447(e,t,i,r){var n=t.buffer;if(!e$28(n)){var o=0===t.instanceCount?1:t.instanceCount,a=4*_0x48dbdc*o;(n=h$W.createVertexBuffer({context:e,sizeInBytes:a,usage:A$1c.DYNAMIC_DRAW})).vertexArrayDestroyable=!1,t.buffer=n}_0x44c260(n,i,r,Object.keys(i).length)}Object.defineProperties(_0x335c8a.prototype,{updateInterval:{get:function(){return this._updateInterval},set:function(e){this._updateInterval=e}},group:{get:function(){return this._group}},visible:{get:function(){return this._visible},set:function(e){this._visible=e}},maxVisibleAltitude:{get:function(){return this._maxVisibleAltitude},set:function(e){!e$28(e)||(this._maxVisibleAltitude=e)}},type:{get:function(){return this._type}},enableLocalOffset:{get:function(){return this._enableLocalOffset},set:function(e){this._enableLocalOffset=e}},maxVisibleDistance:{get:function(){return this._maxVisibleDistance},set:function(e){o$1u.typeOf.number("maxVisibleDistance",e),this._maxVisibleDistance=e}},filterMode:{get:function(){return this._filterMode},set:function(e){o$1u.typeOf.number("filterMode",e),this._filterMode=e}},filterPixel:{get:function(){return this._filterPixel},set:function(e){o$1u.typeOf.number("filterPixel",e),this._filterPixel=e}},shadowType:{get:function(){return this._shadowType},set:function(e){this._shadowType!==e&&(this._shadowType=e,this._updateShadow(this))}}}),_0x335c8a.prototype.setPolygonOffset=function(e,t,i){o$1u.typeOf.string("dynamicLayer setPolygonoffset url",e),o$1u.typeOf.number("dynamicLayer setPolygonoffset factor",t),o$1u.typeOf.number("dynamicLayer setPolygonoffset units",i);var r=this._group[e];if(e$28(r)&&(r.polygonOffset.factor!==t||r.polygonOffset.units!==i)&&(r.polygonOffset={enabled:!0,factor:u$Y(t,0),units:u$Y(i,0)},r.ready))for(var n=0,o=r.renderEntities.length;n<o;n++){var a=r.renderEntities[n].command,s=u$R.getState(a.renderState);s.polygonOffset={enabled:!0,factor:u$Y(t,0),units:u$Y(i,0)},a.renderState=u$R.fromCache(s)}},_0x335c8a.prototype.update=function(e){if((LicenseChecker.LICENSECHECKER.verify("DynamicLayer3D"),this._visible)&&e._fboState.frameBufferType!==L$T.NORMAL_AND_DEPTH){var t=!0;if(e.multiViewportIndex>-1)t=this.getVisibleInViewport(e.multiViewportIndex);this._frameState=e,this._picking=e.passes.pick;var i=e.camera.positionCartographic.height<this._maxVisibleAltitude;for(var r in this._group)if(this._group.hasOwnProperty(r)){var n=this._group[r];if(n.ready){if(!n.visible||(this._picking||(_0x4ab64d(e,this,n),_0x3da0d6(n,e)),n.instanceCount<1)||!i||!t)continue;for(var o=0,a=n.renderEntities.length;o<a;o++){var s=n.renderEntities[o].command;s.instanceCount=n.instanceCount,s.boundingVolume=n.boundingSphere,e.commandList.push(s)}}else _0x2d64ac(e,this,r)}}},_0x335c8a.prototype.setCullEnabled=function(e,t){o$1u.typeOf.string("dynamicLayer setCullEnabled url",e),t=u$Y(t,k$11.BACK);var i=this._group[e];if(e$28(i)&&(!i.cullEnabled||i.cullFace!==t)&&(i.cullEnabled=!0,i.cullFace=t,i.ready))for(var r=0,n=i.renderEntities.length;r<n;r++){var o=i.renderEntities[r].command,a=u$R.getState(o.renderState);a.cull.enabled=!0,a.cull.face=t,o.renderState=u$R.fromCache(a)}},_0x335c8a.prototype.getCullEnabled=function(e){o$1u.typeOf.string("dynamicLayer getCullEnabled url",e);var t=this._group[e];if(e$28(t))return t.cullEnabled},_0x335c8a.prototype.clear=function(e,t){t$T("DynamicLayer3D.prototype.clear","clear() will be deprecated, please use clearState()"),this.clearState(e,t)},_0x335c8a.prototype.clearAll=function(){t$T("DynamicLayer3D.prototype.clearAll","clearAll() will be deprecated, please use clearAllState()"),this.clearAllState()},_0x335c8a.prototype.clearAllState=function(){for(var e in this._group)this._group.hasOwnProperty(e)&&(this._group[e].stateList.removeAll(),this._group[e].instanceList.removeAll(),_0x3c8dc9(this,this._group[e]))},_0x335c8a.prototype.clearState=function(e,t){o$1u.typeOf.string("dynamicLayer3D.clear url",e),o$1u.defined("dynamicLayer3D.clear ids",t),Array.isArray(t)||(t=[t]);var i=this._group[e];if(e$28(i)){var r=i.stateList,n=i.instanceList;if(e$28(r)&&e$28(n)){for(var o,a=0,s=t.length;a<s;a++)o=t[a],r.contains(o)&&r.remove(o),n.contains(o)&&n.remove(o);_0x3c8dc9(this,i)}}},_0x335c8a.prototype.deleteObjects=function(e,t){o$1u.typeOf.string("dynamicLayer3D.delete url",e),o$1u.defined("dynamicLayer3D.delete ids",t),Array.isArray(t)||(t=[t]);var i=this._group[e];if(e$28(i)){var r=i.instanceList,n=i.removedList,o=i.stateList;if(e$28(r)&&e$28(n)&&e$28(o)){for(var a,s=0,l=t.length;s<l;s++)a=t[s],o.remove(a),r.contains(a)&&(r.remove(a),n.set(a,!0));_0x3c8dc9(this,i)}}},_0x335c8a.prototype.deleteAllObjects=function(){for(var e in this._group)if(this._group.hasOwnProperty(e)){for(var t=this._group[e],i=t.instanceList,r=Object.keys(i._hash),n=r.length;n--;)t.removedList.set(r[n],!0);i.removeAll(),t.stateList.removeAll(),_0x3c8dc9(this,t)}},_0x335c8a.prototype._updateShadow=function(e){var t=_0x5960d8(e),i=e._group;for(var r in i){var n=i[r];if(n.ready)for(var o=0,a=n.renderEntities.length;o<a;o++){var s=n.renderEntities[o];s.command.castShadows=t,s.command.receiveShadows=t}}},_0x335c8a.prototype.setVisibleByUrl=function(e,t){var i=this._group[e];e$28(i)&&(i.visible=t)},_0x335c8a.prototype.setPickEnable=function(e,t){this._group[e].pickEnable=t},_0x335c8a.prototype.updateObjectWithModel=function(e,t){if(o$1u.typeOf.string("url",e),Array.isArray(t)){var i=this._group[e];if(e$28(i)){e$28(i.stateList)||(i.stateList=new e$1P);for(var r,n=0,o=t.length;n<o;n++)if((r=t[n])instanceof _0x78f1ab){var a=r.id;if(i.removedList.contains(a))continue;var s=i.stateList.get(a);e$28(s)||(i.offset=t$X.clone(r.offset,i.offset),i.stateList.set(a,{position:new o$J,scale:new g$q(t$X),heading:new g$q(Number),pitch:new g$q(Number),roll:new g$q(Number),color:new g$q(e$1S),offset:r.offset,description:r.description,lockOrientation:r.lockOrientation,id:a}),(s=i.stateList.get(a)).position.setInterpolationOptions({interpolationDegree:10}),s.position.backwardExtrapolationType=_0x33054b.HOLD,s.position.forwardExtrapolationType=_0x33054b.HOLD,s.scale.backwardExtrapolationType=_0x33054b.HOLD,s.scale.forwardExtrapolationType=_0x33054b.HOLD,s.heading.backwardExtrapolationType=_0x33054b.HOLD,s.heading.forwardExtrapolationType=_0x33054b.HOLD,s.pitch.backwardExtrapolationType=_0x33054b.HOLD,s.pitch.forwardExtrapolationType=_0x33054b.HOLD,s.roll.backwardExtrapolationType=_0x33054b.HOLD,s.roll.forwardExtrapolationType=_0x33054b.HOLD,s.color.backwardExtrapolationType=_0x33054b.HOLD,s.color.forwardExtrapolationType=_0x33054b.HOLD,s.startDirection=r.startDirection);var l=a$12.now(),u=t$X.fromDegrees(r.longitude,r.latitude,r.altitude);_0x406685(s.position._property),_0x406685(s.heading),_0x406685(s.pitch),_0x406685(s.roll),_0x406685(s.scale),_0x406685(s.color),s.position.addSample(l,u),s.heading.addSample(l,r.heading),s.pitch.addSample(l,r.pitch),s.roll.addSample(l,r.roll),s.scale.addSample(l,r.scale),s.color.addSample(l,r.color),s.lockOrientation=r.lockOrientation}}}},_0x335c8a.prototype.setUnSelected=function(){var e=this._group;if(e$28(e))for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];if(!e$28(i.instanceList)||i.instanceCount<1||!i.pickEnable)continue;for(var r=i.instanceList,n=0;n<r.length;n++){var o=r.values[n];e$28(o)&&o.setUnSelected()}}},_0x335c8a.prototype.getVisibleInViewport=function(e){return!(e>8)&&1<<e&this._visibleViewport},_0x335c8a.prototype.setVisibleInViewport=function(e,t){e>8||(this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport)};var _0x3a50d7=new e$25(1,1,1,1);function _0x5255d2(e,t,i){i.localMatrix=i.modelMatrix.clone();var r=i.uniformMap,n={uInterval:function(){return e.interval},uAmbientColor:function(){return _0x3a50d7},uDiffuseColor:function(){return _0x3a50d7},uSpecularColor:function(){return _0x3a50d7},uShininess:function(){return 1},uPicking:function(){return t._picking},uGeoMatrix:function(){return i.localMatrix},uFilterMode:function(){return t.filterMode},uMaxVisibleDistance:function(){return t.maxVisibleDistance},uFilterPixel:function(){return t.filterPixel},uRadius:function(){return i.boundingVolume.radius},uOffset:function(){return e.offset}};return e$28(r.u_baseColorTexture)?n.uTexture=r.u_baseColorTexture:e$28(r.u_diffuse)&&(n.uTexture=r.u_diffuse),e$28(r.u_specular)&&(n.uSpecularColor=r.u_specular),e$28(r.u_shininess)&&(n.uShininess=r.u_shininess),n}function _0x3da0d6(e,t){if(e$28(e.model)){e.boundingSphere=e.boundingSphere.clone(),e.model.updateAnimation(t);var i=e.model._nodeCommands,r=i.length;if(!t._fboState.enabled)for(var n=0;n<r;++n){var o=i[n].command;o.localMatrix=y$15.equals(o.modelMatrix,y$15.IDENTITY)?o.localMatrix:o.modelMatrix,o.modelMatrix=y$15.IDENTITY.clone()}}}function _0x1b0314(e,t){for(var i=t._context,r=e.model._nodeCommands,n=r.length,o=[],a=0;a<n;++a){var s=r[a].command;t._shadowType==_0x121e29.ALL||t._shadowType==_0x121e29.SELECTION?(s.castShadows=!0,s.receiveShadows=!0):(s.castShadows=!1,s.receiveShadows=!1),s.pickId="vPickColor",s.instanceCount=e.instanceCount,s.pass=Le$p.S3MTiles+2,s.renderState=_0x61bae2(e);var l=s.vertexArray,u=l._attributes,c=l.indexBuffer;if(u.length<9){var h=_0x35b424(s.shaderProgram.vertexAttributes);_0x4ea447(i,e,h,u),s.vertexArray=new m$19({context:i,attributes:u,indexBuffer:c})}var d=new a$$({name:"DynamicLayerVertex",sources:[_0x2517ed]}),f=new a$$({name:"S3ModelFP",sources:[_0x9293b3]});if(e$28(h.aColor)&&d.defines.push("VertexColor"),e$28(h.aNormal)&&(d.defines.push(H$r.HAS_NORMAL),f.defines.push(H$r.HAS_NORMAL)),e$28(h.aTexCoord0)&&(d.defines.push("TEXTURE"),f.defines.push("TEXTURE")),e$28(t._frameState.lightSource)){var p=t._frameState.lightSource.directionalLight;d.defines.push(H$r.DIR_LIGHTS+p.length),f.defines.push(H$r.DIR_LIGHTS+p.length);var _=t._frameState.lightSource.pointLight;d.defines.push(H$r.POINT_LIGHTS+_.length),f.defines.push(H$r.POINT_LIGHTS+_.length);var m=t._frameState.lightSource.spotLight;d.defines.push(H$r.SPOT_LIGHTS+m.length),f.defines.push(H$r.SPOT_LIGHTS+m.length);var $=t._frameState.lightSource.hemisphereLight;f.defines.push(H$r.HEMISPHERE_LIGHTS+$.length)}s.shaderProgram=S$T.fromCache({context:i,vertexShaderSource:d,fragmentShaderSource:f,attributeLocations:h});var g=_0x5255d2(e,t,s);g=p$17(g,t._frameState.lightSource.createUniformMap()),s.uniformMap=g,s.modelMatrix=y$15.IDENTITY.clone(),e.renderEntities.push({command:s,attributes:u,indexBuffer:c}),o.push(s.boundingVolume)}var v=new i$19;i$19.fromBoundingSpheres(o,v),e.oriBoundingSphere=v}function _0x2d64ac(e,t,i){var r=t._group[i],n=r.loadState;if(i.indexOf(".gltf")>0||i.indexOf(".glb")>0)_0x28b313.UNLOAD==n&&(e$28(r.model)||(r.model=D$G.fromGltf({url:i,incrementallyLoadTextures:!1,cacheKey:e$1K()})),r.model.update(e),r.model.ready&&(r.ready=!0,r.loadState=_0x28b313.READY,_0x55d468(r,t.updateInterval/1e3),_0x1b0314(r,t),r.model.activeAnimations.addAll({loop:_0x3df4ed.REPEAT})));else{var o=i.indexOf(".s3mb")>-1;if(_0x28b313.UNLOAD==n){var a=o$U(i,(function(e){return o$$(e)}));e$28(a)?(r.loadState=_0x28b313.LOADING,a.then((function(e){r.loadState=_0x28b313.LOADED,r.contentBuffer=e}),(function(e){e$28(e)?r.loadState=_0x28b313.FAILED:r.loadState=_0x28b313.UNLOAD}))):r.loadState=_0x28b313.UNLOAD}_0x28b313.LOADED===n&&(o?_0x5189ee(t,r):_0x2a078e(t,r))}}function _0x4ab64d(e,t,i){if(!(i.stateList.length<1)){var r=t._context,n=!1;i.beginTime<0&&(n=!0,i.beginTime=window.performance.now());var o=kt$7()-i.beginTime,a=t._updateInterval;if(i.interval=o/a,i.interval=e$27.clamp(i.interval,0,1),n||o>=a){i.interval=0;var s=a$12.now();o=a$12.addSeconds(s,-t._updateInterval/1e3,new a$12);i.beginTime=window.performance.now();for(var l,u=i.stateList,c=[],h=0;h<u.length;h++){var d=u.values[h];l=d.id;var f=i.instanceList.get(l);if(i.removedList.contains(l))return;e$28(f)||(i.instanceList.set(l,new _0x4a0814(r,d,i,l)),f=i.instanceList.get(l)),f.update(e,d,o,c)}if(c.length>0){var p=i$19.fromBoundingSpheres(c,new i$19);i$19.clone(p,i.boundingSphere)}i.instanceCount=c.length,_0x3c8dc9(t,i)}}}function _0x3c8dc9(e,t){var i=t.instanceCount;if(!(i<1)){var r=_0x48dbdc*i,n=t.buffer,o=e._context,a=S$W.getSizeInBytes(S$W.FLOAT);if(n.sizeInBytes/(a*_0x48dbdc)<i){t.buffer&&t.buffer.destroy(),(n=h$W.createVertexBuffer({context:o,sizeInBytes:r*a,usage:A$1c.DYNAMIC_DRAW})).vertexArrayDestroyable=!1,t.buffer=n;for(var s=0,l=t.renderEntities.length;s<l;s++){var u=t.renderEntities[s],c=u.command;if(e$28(c)){c.vertexArray.isDestroyed()||c.vertexArray.destroy();for(var h=0;h<u.attributes.length;h++){var d=u.attributes[h];e$28(d.instanceDivisor)&&d.instanceDivisor>0&&(d.vertexBuffer=t.buffer)}c.vertexArray=new m$19({context:o,attributes:u.attributes,indexBuffer:u.indexBuffer})}}}var f=new Float32Array(r),p=t.instanceList,_=0;for(s=0,l=p.length;s<l;s++){var m=p.values[s];if(e$28(m)&&m._ready){m._index=_;var $=i$Q.fromCartesian(m._prePosition),g=$.high,v=$.low,y=i$Q.fromCartesian(m._nextPosition),x=y.high,b=y.low,w=m._preOrientation,C=m._nextOrientation,T=m._pickColor,S=m._color,E=m._scale,A=m._preHpr,P=m._nextHpr,I=new e$1S;I.red=t$N.compressTextureCoordinates({x:S.red,y:S.green}),I.green=t$N.compressTextureCoordinates({x:S.blue,y:S.alpha}),I.blue=t$N.compressTextureCoordinates({x:T.red,y:T.green}),I.alpha=t$N.compressTextureCoordinates({x:T.blue,y:T.alpha}),_0x15ee4c(f,_,g,v,x,b,w,C,I,A,P,E),_++}}n.copyFromArrayView(f,0)}}function _0x15ee4c(e,t,i,r,n,o,a,s,l,u,c,h){var d=0;e[(t*=_0x48dbdc)+d++]=i.x,e[t+d++]=i.y,e[t+d++]=i.z,e[t+d++]=r.x,e[t+d++]=r.y,e[t+d++]=r.z,e[t+d++]=n.x,e[t+d++]=n.y,e[t+d++]=n.z,e[t+d++]=o.x,e[t+d++]=o.y,e[t+d++]=o.z,e[t+d++]=a.x,e[t+d++]=a.y,e[t+d++]=a.z,e[t+d++]=a.w,e[t+d++]=s.x,e[t+d++]=s.y,e[t+d++]=s.z,e[t+d++]=s.w,e[t+d++]=l.red,e[t+d++]=l.green,e[t+d++]=l.blue,e[t+d++]=l.alpha,e[t+d++]=u.heading,e[t+d++]=u.pitch,e[t+d++]=u.roll,e[t+d++]=c.heading,e[t+d++]=c.pitch,e[t+d++]=c.roll,e[t+d++]=h.x,e[t+d++]=h.y,e[t+d++]=h.z}var _0x4d4a16=new n$14,_0x38cd29=new t$X;function _0x4a0814(e,t,i,r){this.type=oi$2.INSTANCED_OBJECT,this._ownerGroup=i,this._id=r,this._index=-1,this._description=t.description;var n=t.position.getValue(0);e$28(n)||(n=new t$X),this._scale=t$X.clone(t.scale.getValue(0));var o=t$X.maximumComponent(this._scale);this._offset=t.offset,this._lockOrientation=t.lockOrientation,this._preOrientation=new n$14,this._nextOrientation=new n$14,this._orientation=void 0,this._velocityOrientation=new e$G(t.position);var a=m$1b.headingPitchRollToFixedFrame(n,new i$10(t.startDirection,0,0),t$V.WGS84,m$1b.eastNorthUpToFixedFrame,new y$15),s=y$15.getRotation(a,new p$1a),l=n$14.fromRotationMatrix(s);n$14.clone(l,this._preOrientation),n$14.clone(this._preOrientation,this._nextOrientation);var u=t$X.multiplyByScalar(this._offset,o,new t$X);this._prePosition=y$15.multiplyByPoint(a,u,new t$X),this._nextPosition=t$X.clone(this._prePosition);var c=t.heading.getValue(0),h=t.pitch.getValue(0),d=t.roll.getValue(0);this._preHpr=new i$10(c,h,d),this._nextHpr=i$10.clone(this._preHpr),this._dynamicColor=t.color.getValue(0);var f=i.oriBoundingSphere.radius*o;this._boundingSphere=new i$19(this._prePosition,f);var p={id:r,primitive:this},_=e.createPickId(p);this._pickColor=_.color,this._selColor=new e$1S,this._color=e$1S.multiply(this._dynamicColor,this._selColor,new e$1S),this._isSelected=!1,this._ready=!1}function _0x2a078e(e,t){var i=t.contentBuffer;if(e$28(i)){var r={buffer:i,supportCompressType:e._supportCompressType},n=_0x333f13.S3MTaskProcessor.scheduleTask(r,[i]);e$28(n)?(t.contentBuffer=void 0,t._loadState=_0x28b313.PARSING,n.then((function(i){if(i.result){e._gl;for(var r=e._xmlParser.read(i.xmlDoc).firstChild,n=r.namespaceURI,o=s$P.queryFirstNode(r,"Material3Ds",n),a=s$P.queryChildNodes(o,"material",n),s={},l=e._context,u=0,c=a.length;u<c;u++){var h=a[u],d=s$P.queryStringValue(h,"name",n),f=new _0x34bd01({});s[d]=f;var p=s$P.queryFirstNode(h,"Ambient",n),_=s$P.queryNumericValue(p,"AmbientR",n),m=s$P.queryNumericValue(p,"AmbientG",n),$=s$P.queryNumericValue(p,"AmbientB",n),g=s$P.queryNumericValue(p,"AmbientA",n);f._ambientColor=new e$1S(_,m,$,g);var v=s$P.queryFirstNode(h,"Diffuse",n);_=s$P.queryNumericValue(v,"DiffuseR",n),m=s$P.queryNumericValue(v,"DiffuseG",n),$=s$P.queryNumericValue(v,"DiffuseB",n),g=s$P.queryNumericValue(v,"DiffuseA",n),f._diffuseColor=new e$1S(_,m,$,g);var y=s$P.queryFirstNode(h,"Specular",n);_=s$P.queryNumericValue(y,"SpecularR",n),m=s$P.queryNumericValue(y,"SpecularG",n),$=s$P.queryNumericValue(y,"SpecularB",n),g=s$P.queryNumericValue(y,"SpecularA",n),f._specularColor=new e$1S(_,m,$,g);var x=s$P.queryNumericValue(h,"Shininess",n);f._shininess=x,s$P.queryFirstNode(h,"TransparentSorting",n),f._bTransparentSorting=s$P.queryBooleanValue(h,"TransparentSorting",n);var b=s$P.queryFirstNode(h,"texture",n),w=s$P.queryStringValue(b,"name",n),C=s$P.queryFirstNode(b,"AddressMode",n),T=s$P.queryStringValue(C,"u",n),S=s$P.queryStringValue(C,"v",n);T="TAM_WRAP"===T?q$11.REPEAT:q$11.CLAMP_TO_EDGE,S="TAM_WRAP"===S?q$11.REPEAT:q$11.CLAMP_TO_EDGE;var E=i.texturePackage[w];if(w+=l.id,e$28(E)){var A=Se$8.CreateTexture(w,l,E.width,E.height,E.nFormat,E.compressType,E.imageBuffer,!1,T,S);f._textures.push(A),0===E.compressType&&(e._supportCompressType=0)}}var P=s$P.queryFirstNode(r,"PageLods",n),I=s$P.queryNodes(P,"Geode",n);for(u=0,c=I.length;u<c;u++){for(var M=I[u],O=s$P.queryStringValue(M,"GeoDeModMatrix",n).split(","),D=0;D<16;D++)O[D]=parseFloat(O[D]);if(O=y$15.unpack(O,0),t.enableOffset){var R=y$15.fromTranslation(new t$X(0,0,-690));O=y$15.multiplyTransformation(O,R,new y$15)}for(var L=s$P.queryNodes(M,"GeoName",n),B=[],N=0,F=L.length;N<F;N++){var z=L[N].textContent.trim();B.push(z)}for(var k=[],V=new i$19,U=0;U<B.length;U++){var X=_0x157a81(G=(H=i.geoPackage[B[U]]).vertexPackage,O);k.push(X)}k.length>0&&(i$19.fromBoundingSpheres(k,V),t.oriBoundingSphere=V,k.length=0);for(F=0;F<B.length;F++){var H,G=(H=i.geoPackage[B[F]]).vertexPackage,W=H.arrIndexPackage,Y={};for(var q in W){var j=W[q];if(e$28(j)){f=s[d=j.materialCode];Y[d]=f}}e.enableLocalOffset||(O=y$15.IDENTITY),_0x16242a(e,t,G,W,V,Y,O)}t.boundingSphere=i$19.clone(V)}t.ready=!0,t.loadState=_0x28b313.READY,_0x55d468(t,e.updateInterval/1e3)}else t._loadState=_0x28b313.UNLOAD}))):t._loadState=_0x28b313.LOADED}else t._loadState=_0x28b313.FAILED}function _0x5189ee(e,t){var i=t.contentBuffer;if(e$28(i)){if(_0x333f13.init||_0x333f13.initWebAssembly(),_0x333f13.taskProcessorReady){var r=_0x333f13.S3MBTaskProcessor.scheduleTask({buffer:i,supportCompressType:e._supportCompressType},[i]);if(!e$28(r))return void(t._loadState=_0x28b313.LOADED);t.contentBuffer=void 0,t._loadState=_0x28b313.PARSING,r.then((function(i){if(i.result){for(var r=e._context,n={},o=0,a=i.matrials.material.length;o<a;o++){var s=i.matrials.material[o].material,l=s.id,u=new _0x34bd01({});n[l]=u,u.createCommonParamter(s),u.createPBRParamter(s);for(var c=s.textureunitstates,h=0;h<c.length;h++){var d=c[h].textureunitstate,f=d.id,p=0===d.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,_=0===d.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;u._texMatrix=y$15.unpack(d.texmodmatrix);var m=i.texturePackage[f];if(f+=r.id,e$28(m)&&m.width>0&&m.height>0&&m.imageBuffer.length>0){var $=Se$8.CreateTexture(f,r,m.width,m.height,m.nFormat,m.compressType,m.imageBuffer,!1,p,_),g=f.indexOf("PBRMaterialParam")>-1,v=u._emissiveTextureIndex===h,y=u._normalTextureIndex===h,x=u._metallicRoughnessTextureIndex===h,b=u._occlusionTextureIndex===h;g?(u._usePBRTextureBatch=!0,u.pbrParamTexture=$):v?u.emissiveTexture=$:y?u.normalTexture=$:x?u.metallicRoughnessTexture=$:b?u.occlusionTexture=$:u._textures.push($),0===m.compressType&&(e._supportCompressType=0)}}}var w=i.groupNode.pageLods;if(e$28(w))for(o=0,a=w.length;o<a;o++){for(var C=w[o].geodes[0],T=C.matrix,S=0;S<16;S++)T[S]=parseFloat(T[S]);if(T=y$15.unpack(T,0),t.enableOffset){var E=y$15.fromTranslation(new t$X(0,0,-690));T=y$15.multiplyTransformation(T,E,new y$15)}for(var A=C.skeletonNames,P=[],I=0,M=A.length;I<M;I++){var O=A[I].trim();P.push(O)}var D=[],R=new i$19;for(h=0;h<P.length;h++){var L=_0x157a81(N=(B=i.geoPackage[P[h]]).vertexPackage,T);D.push(L)}D.length>0&&(i$19.fromBoundingSpheres(D,R),t.oriBoundingSphere=R,D.length=0);for(I=0,M=P.length;I<M;I++){O=P[I];var B,N=(B=i.geoPackage[O]).vertexPackage,F=B.arrIndexPackage,z=F[0];if(e$28(z)){var k={};u=n[l=z.materialCode];k[l]=u,e.enableLocalOffset||(T=y$15.IDENTITY),_0x16242a(e,t,N,F,R,k,T)}}t.boundingSphere=i$19.clone(R)}t.ready=!0,t.loadState=_0x28b313.READY,_0x55d468(t,e.updateInterval/1e3)}else t._loadState=_0x28b313.UNLOAD}))}}else t._loadState=_0x28b313.FAILED}function _0x157a81(e,t){for(var i=[],r=new i$19,n=new t$X,o=(new t$X,e.vertexAttributes[0]),a=o.componentsPerAttribute,s=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4),l=0;l<e.verticesCount;l++)t$X.fromArray(s,a*l,n),i.push(t$X.clone(n));return i$19.fromPoints(i,r),i.length=0,i$19.transform(r,t,r),r}function _0x61bae2(e){return u$R.fromCache({cull:{enabled:e.cullEnabled,face:e.cullFace},polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND})}function _0x3a4657(e,t,i){for(var r=i.vertexAttributes,n=0,o=r.length;n<o;n++){var a=r[n];!e$28(a.typedArray)||(a.vertexBuffer=h$W.createVertexBuffer({context:t,typedArray:a.typedArray,usage:A$1c.STATIC_DRAW}),a.vertexBuffer.vertexArrayDestroyable=!1,a.typedArray=null,delete a.typedArray)}var s=i.attrLocation,l=Object.keys(s).length,u=e.buffer;if(!e$28(u)){var c=0===e.instanceCount?1:e.instanceCount,h=4*_0x48dbdc*c;(u=h$W.createVertexBuffer({context:t,sizeInBytes:h,usage:A$1c.DYNAMIC_DRAW})).vertexArrayDestroyable=!1,e.buffer=u}return _0x44c260(u,s,r,l),{attributes:r,attrLocation:s}}function _0x44c260(e,t,i,r){var n=r,o=0,a=S$W.getSizeInBytes(S$W.FLOAT);t.aPreHxyzLx=n++,i.push({index:t.aPreHxyzLx,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aPreLyzNextHxy=n++,i.push({index:t.aPreLyzNextHxy,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aNextHzLxyz=n++,i.push({index:t.aNextHzLxyz,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aPreOrientation=n++,i.push({index:t.aPreOrientation,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aNextOrientation=n++,i.push({index:t.aNextOrientation,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aColorAndPickColor=n++,i.push({index:t.aColorAndPickColor,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=4*a,t.aPreHpr=n++,i.push({index:t.aPreHpr,vertexBuffer:e,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=3*a,t.aNextHpr=n++,i.push({index:t.aNextHpr,vertexBuffer:e,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=3*a,t.aScale=n++,i.push({index:t.aScale,vertexBuffer:e,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:o,strideInBytes:4*_0x48dbdc,instanceDivisor:1}),o+=3*a}function _0x16242a(e,t,i,r,n,o,a){var s=e._context,l=_0x3a4657(t,s,i),u=l.attributes,c=l.attrLocation,h=Le$p.S3MTiles+2,d=_0x61bae2(t),f=i.verticesCount,p=r[0];if(e$28(p)){var _=ce$v.UNSIGNED_SHORT;(1===p.indexType||f>=e$27.SIXTY_FOUR_KILOBYTES)&&s.elementIndexUint&&(_=ce$v.UNSIGNED_INT);var m=h$W.createIndexBuffer({context:s,typedArray:p.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:_});m.vertexArrayDestroyable=!1;var $=o[p.materialCode]||_0x34bd01.Default,g=new r$15({primitiveType:W$_.TRIANGLES,boundingVolume:n,pass:h,owner:e});e._shadowType===_0x121e29.ALL||e._shadowType===_0x121e29.SELECTION?(g.castShadows=!0,g.receiveShadows=!0):(g.castShadows=!1,g.receiveShadows=!1),g.pickId="vPickColor",g.instanceCount=t.instanceCount,g.vertexArray=new m$19({context:s,attributes:u,indexBuffer:m});var v=new a$$({name:"DynamicLayerVertex",sources:[_0x2517ed]}),y=new a$$({name:"S3ModelFP",sources:[_0x9293b3]}),x=e$28(c.aTexCoord0)&&$._textures.length>0;if(0===e._supportCompressType&&y.defines.push("FLIP_Y"),e$28(c.aColor)&&v.defines.push("VertexColor"),e$28(c.aNormal)&&(v.defines.push(H$r.HAS_NORMAL),y.defines.push(H$r.HAS_NORMAL)),x&&(v.defines.push("TEXTURE"),y.defines.push("TEXTURE")),e$28(e._frameState.lightSource)){var b=e._frameState.lightSource.directionalLight;v.defines.push(H$r.DIR_LIGHTS+b.length),y.defines.push(H$r.DIR_LIGHTS+b.length);var w=e._frameState.lightSource.pointLight;v.defines.push(H$r.POINT_LIGHTS+w.length),y.defines.push(H$r.POINT_LIGHTS+w.length);var C=e._frameState.lightSource.spotLight;v.defines.push(H$r.SPOT_LIGHTS+C.length),y.defines.push(H$r.SPOT_LIGHTS+C.length);var T=e._frameState.lightSource.hemisphereLight;y.defines.push(H$r.HEMISPHERE_LIGHTS+T.length)}var S=t.url;($._usePBR||e$28(e._PBRMaterialParams[S])&&e._PBRMaterialParams[S].roughness>0)&&(y.defines.push(H$r.BRDF),($.baseColorTexture||e._PBRMaterialParams[S]&&e._PBRMaterialParams[S].baseColorTextureIndex>-1&&e$28(e._PBRMaterialParams[S].baseTexture))&&y.defines.push(H$r.HAS_BASE_TEXTURE),($.uNormalTexture||e._PBRMaterialParams[S]&&e._PBRMaterialParams[S].normalTextureIndex>-1&&e$28(e._PBRMaterialParams[S].normalTexture))&&y.defines.push(H$r.HAS_NORMAL_TEXTURE),($.emissiveTexture||e._PBRMaterialParams[S]&&e._PBRMaterialParams[S].emissionTextureIndex>-1)&&y.defines.push(H$r.HAS_EMISSIVE_TEXTURE),($.metallicRoughnessTexture||e._PBRMaterialParams[S]&&e._PBRMaterialParams[S]._metallicRoughnessTextureIndex>-1)&&y.defines.push(H$r.HAS_MetallicRoughness_TEXTURE),($.occlusionTexture||e._PBRMaterialParams[S]&&e._PBRMaterialParams[S]._occlusionTextureIndex>-1)&&y.defines.push(H$r.HAS_OCCLUSION_TEXTURE),(e$28(e._frameState.specularEnvironmentMaps)||e$28(e._frameState.hdrEnvMap))&&(y.defines.push(H$r.IBL),e$28(e._frameState.specularEnvironmentMaps)&&y.defines.push(H$r.KtxEnvMap)),e$28($._alphaMode)&&$._alphaMode===_0x9df4c2.MASK&&y.defines.push(H$r.MASK)),$.appendPBRMacroToShader(v,y),g.shaderProgram=S$T.fromCache({context:s,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:c});var E=$._diffuseColor,A=$._diffuseColor,P=$._specularColor,I=$._shininess,M=e$28(c.aNormal),O=n.radius,D={uTexture:function(){return $._textures[0]},uInterval:function(){return t.interval},uAmbientColor:function(){return E},uDiffuseColor:function(){return A},uSpecularColor:function(){return P},uShininess:function(){return I},uPicking:function(){return e._picking},uHasNormal:function(){return M},uGeoMatrix:function(){return a},uFilterMode:function(){return e.filterMode},uMaxVisibleDistance:function(){return e.maxVisibleDistance},uFilterPixel:function(){return e.filterPixel},uRadius:function(){return O},uOffset:function(){return t.offset},uBaseColorFactor:function(){return e$28($._baseColor)?$._baseColor:e._PBRMaterialParams[S].baseColorFactor},uBaseColorTextureIndex:function(){return $._baseColorTextureIndex>-1?$._baseColorTextureIndex:e._PBRMaterialParams[S].baseColorTextureIndex},uMetallicFactor:function(){return e$28($._metallicFactor)?$._metallicFactor:e._PBRMaterialParams[S].metallic},uRoughnessFactor:function(){return e$28($._roughnessFactor)?$._roughnessFactor:e._PBRMaterialParams[S].roughness},uEmissiveFactor:function(){return e$28($._emissiveFactor)?$._emissiveFactor:e._PBRMaterialParams[S].emissionFactor},uNormalTextureScale:function(){return e$28($._normalTextureScale)?$._normalTextureScale:e._PBRMaterialParams[options.groupName].normalTextureScale},uAlphaCutoff:function(){return e$28($._alphaCutoff)?$._alphaCutoff:e._PBRMaterialParams[options.groupName].alphaCutoff},uEmissionTexture:function(){return e$28($.emissiveTexture)&&$._emissiveTextureIndex>-1?$.emissiveTexture:e._PBRMaterialParams[S].emissiveTexture},uEmissiveUVOffsetAndTiling:function(){var e=$._emissiveTextureMotion,t=new e$25,i=performance.now()/1e3,r=e.OffsetPeriod,n=e.OffsetSpeedU,o=e.OffsetSpeedV,a=e.TilingPeriod,s=e.TilingSpeedU,l=e.TilingSpeedV;if(e&&r>0){var u=i%r;t.x=u*n,t.y=u*o}else t.x=0,t.y=0;if(e&&a>0){var c=i%a;t.z=1+c*s,t.w=1+c*l}else t.z=1,t.w=1;return t},uBaseTexture:function(){return e$28($.baseColorTexture)&&$._baseColorTextureIndex>-1?$.baseColorTexture:e._PBRMaterialParams[S].baseTexture},uNormalTexture:function(){return e$28($.normalTexture)&&$._normalTextureIndex>-1?$.normalTexture:e._PBRMaterialParams[S].normalTexture},uMetallicRoughnessTexture:function(){return e$28($.metallicRoughnessTexture)&&$._metallicRoughnessTextureIndex>-1?$.metallicRoughnessTexture:e._PBRMaterialParams[S].metallicRoughnessTexture},uOcclusionTexture:function(){return e$28($.occlusionTexture)&&$._occlusionTextureIndex>-1?$.occlusionTexture:e._PBRMaterialParams[S].occlusionTexture},uEnvMapIntensity:function(){return e._envMapIntensity},uCameraReflect:function(){return e._frameState.camera.bReflect?-1:1}};D=p$17(D,e._frameState.lightSource.createUniformMap()),g.uniformMap=D,g.renderState=d,t.renderEntities.push({command:g,attributes:u,indexBuffer:m})}}_0x4a0814.prototype.setSelected=function(){var e=this._index;if(e$28(e)&&this._ownerGroup.pickEnable&&!(e<0)&&(o$1u.typeOf.number.greaterThanOrEquals("offset",e,0),!e$1S.equals(this._selColor,_0xcaffe3))){this._selColor=e$1S.clone(_0xcaffe3),this._color=e$1S.multiply(this._selColor,this._dynamicColor,this._color);var t=new e$1S;t.red=t$N.compressTextureCoordinates({x:this._color.red,y:this._color.green}),t.green=t$N.compressTextureCoordinates({x:this._color.blue,y:this._color.alpha}),t.blue=t$N.compressTextureCoordinates({x:this._pickColor.red,y:this._pickColor.green}),t.alpha=t$N.compressTextureCoordinates({x:this._pickColor.blue,y:this._pickColor.alpha});var i=this._ownerGroup.renderEntities;if(e$28(i)&&!(i.length<1)){for(var r=0,n=i.length;r<n;r++){var o=i[r].command,a=o.shaderProgram.vertexAttributes.aColorAndPickColor.index,s=o.vertexArray.getAttribute(a),l=e*s.strideInBytes+s.offsetInBytes,u=S$W.createTypedArray(s.componentDatatype,s.componentsPerAttribute);u[0]=t.red,u[1]=t.green,u[2]=t.blue,u[3]=t.alpha,s.vertexBuffer.copyFromArrayView(u,l)}this._isSelected=!0}}},_0x4a0814.prototype.setUnSelected=function(){var e=this._index;if(e$28(e)&&this._ownerGroup.pickEnable&&!(e<0)&&this._isSelected){this._isSelected=!1,this._selColor=e$1S.WHITE,this._color=e$1S.clone(this._dynamicColor);var t=new e$1S;t.red=t$N.compressTextureCoordinates({x:this._color.red,y:this._color.green}),t.green=t$N.compressTextureCoordinates({x:this._color.blue,y:this._color.alpha}),t.blue=t$N.compressTextureCoordinates({x:this._pickColor.red,y:this._pickColor.green}),t.alpha=t$N.compressTextureCoordinates({x:this._pickColor.blue,y:this._pickColor.alpha});var i=this._ownerGroup.renderEntities;if(e$28(i)&&!(i.length<1))for(var r=0,n=i.length;r<n;r++){var o=i[r].command,a=o.shaderProgram.vertexAttributes.aColorAndPickColor.index,s=o.vertexArray.getAttribute(a),l=e*s.strideInBytes+s.offsetInBytes,u=S$W.createTypedArray(s.componentDatatype,s.componentsPerAttribute);u[0]=t.red,u[1]=t.green,u[2]=t.blue,u[3]=t.alpha,s.vertexBuffer.copyFromArrayView(u,l)}}},_0x4a0814.prototype.update=function(e,t,i,r){var n=t.position,o=r$K.getValueOrUndefined(n,i,_0x38cd29);if(e$28(o)){var a=t$X.equalsEpsilon(o,this._nextPosition,e$27.EPSILON8)||t$X.distance(o,this._nextPosition)<.5;this._scale=t$X.clone(t.scale.getValue(i),this._scale);var s=t$X.maximumComponent(t.scale.getValue(i)),l=t$X.multiplyByScalar(this._offset,s,new t$X),u=m$1b.headingPitchRollToFixedFrame(o,new i$10,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,new y$15);if(this._prePosition=t$X.clone(this._nextPosition,this._prePosition),y$15.multiplyByPoint(u,l,this._nextPosition),i$10.clone(this._nextHpr,this._preHpr),this._nextHpr.heading=t.heading.getValue(i),this._nextHpr.pitch=t.pitch.getValue(i),this._nextHpr.roll=t.roll.getValue(i),this._lockOrientation=t.lockOrientation,n$14.clone(this._nextOrientation,this._preOrientation),!this._lockOrientation)if(e$28(h=a?void 0:r$K.getValueOrUndefined(this._velocityOrientation,i,_0x4d4a16)))this._orientation=n$14.clone(h),n$14.clone(this._orientation,this._nextOrientation);else if(e$28(this._orientation))n$14.clone(this._orientation,this._nextOrientation);else{var c=y$15.getRotation(u,new p$1a);n$14.fromRotationMatrix(c,this._nextOrientation);u=m$1b.headingPitchRollToFixedFrame(o,new i$10(t.startDirection,0,0),t$V.WGS84,m$1b.eastNorthUpToFixedFrame,new y$15),c=y$15.getRotation(u,new p$1a);var h=n$14.fromRotationMatrix(c);this._preOrientation=h,this._nextOrientation=h}var d=t.color.getValue(i);this._dynamicColor=e$1S.clone(d),this._color=e$1S.multiply(this._dynamicColor,this._selColor,this._color),t$X.clone(this._nextPosition,this._boundingSphere.center),this._boundingSphere.radius=this._ownerGroup.oriBoundingSphere.radius*s;var f=e.cullingVolume.computeVisibility(this._boundingSphere)!==pt$a.OUTSIDE;f&&r.push(this._boundingSphere),this._ready=f}else this._ready=!1},_0x335c8a.prototype.isDestroyed=function(){return!1},_0x335c8a.prototype.destroy=function(){for(var e in this._group){var t=this._group[e];if(t.ready){for(var i=0,r=t.renderEntities.length;i<r;i++){var n=t.renderEntities[i].command;n.vertexArray=n.vertexArray&&!n.vertexArray.isDestroyed()&&n.vertexArray.destroy(),n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy()}t.renderEntities.length=0,e$28(t.stateList)&&t.stateList.removeAll()}}return this._group=void 0,i$Z(this)};var _0x27829a=(_0x448037=!0,function(e,t){var i=_0x448037?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x448037=!1,i}),_0x40e726=_0x27829a(void 0,(function(){return _0x40e726.toString().search("(((.+)+)+)+$").toString().constructor(_0x40e726).search("(((.+)+)+)+$")})),_0x448037;_0x40e726();var _0x1093ce={UnLoad:0,Loading:1,Loaded:2,Parsing:3,Ready:4,LoadedFailed:5,ParseFailed:6},_0x5aa9da=Object.freeze(_0x1093ce),_0x26fd85=(_0x2641d4=!0,function(e,t){var i=_0x2641d4?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x2641d4=!1,i}),_0x4e4a6e=_0x26fd85(void 0,(function(){return _0x4e4a6e.toString().search("(((.+)+)+)+$").toString().constructor(_0x4e4a6e).search("(((.+)+)+)+$")})),_0x2641d4;function _0x9790ee(e){this.url=e,this._isGlTF=!0,this.model=void 0,this.state=_0x5aa9da.UnLoad,this.ready=!1}_0x4e4a6e(),_0x9790ee.prototype.isDestroyed=function(){return!1},_0x9790ee.prototype.destroy=function(){return e$28(this.model)&&!this.model.isDestroyed()&&this.model.destroy(),i$Z(this)};var _0xccaa94=(_0x4da9f0=!0,function(e,t){var i=_0x4da9f0?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4da9f0=!1,i}),_0x59c9e3=_0xccaa94(void 0,(function(){return _0x59c9e3.toString().search("(((.+)+)+)+$").toString().constructor(_0x59c9e3).search("(((.+)+)+)+$")})),_0x4da9f0;function _0x5ab4c8(){}_0x59c9e3(),_0x5ab4c8.load=function(e,t){if(e$28(t.model)||(t.model=D$G.fromGltf({url:t.url,incrementallyLoadTextures:!1,headers:e.customRequestHeaders})),t.model.update(e._frameState),t.model.ready){t.state=_0x5aa9da.Ready,t.ready=!0;for(var i=e._skeletonTileMap.get(t.url),r=0,n=i.length;r<n;r++)i[r].dirty=!0}},_0x5ab4c8.parse=function(e,t){};var _0xe0a6af=(_0x4b89e5=!0,function(e,t){var i=_0x4b89e5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4b89e5=!1,i}),_0x5a996e=_0xe0a6af(void 0,(function(){return _0x5a996e.toString().search("(((.+)+)+)+$").toString().constructor(_0x5a996e).search("(((.+)+)+)+$")})),_0x4b89e5;function _0x4ca9cd(e,t,i,r){this.url=t,this.id=r,this.index=-1,this.type=oi$2.INSTANCED_OBJECT,this.position=t$X.clone(i.position),this.geoPosition=t$W.fromCartesian(this.position),this.offset=u$Y(i.offset,new t$X(0,0,0)),this.color=u$Y(i.color,new e$1S),this.scale=u$Y(i.scale,new t$X(1,1,1));var n=u$Y(i.hpr,new i$10);this.hpr=n,this.quaternion=n$14.fromHeadingPitchRoll(n),this.feature=u$Y(i.feature,u$Y.EMPTY_OBJECT),this.isSelected=!1,this.selectedColor=new e$1S,this.preColor=e$1S.clone(this.color),this.tile=void 0,this.instanceInfo=void 0,this.layer=void 0;var o={id:r,primitive:this},a=e.createPickId(o).color,s=new e$1S;s.x=e$1S.floatToByte(a.red),s.y=e$1S.floatToByte(a.green),s.z=e$1S.floatToByte(a.blue),s.w=e$1S.floatToByte(a.alpha),this.pickColor=s}_0x5a996e(),_0x4ca9cd.prototype.setSelected=function(){if(e$28(this.layer)&&this.layer.pickEnable){var e=this.index;if(e$28(e)&&!(e<0)&&!e$1S.equals(this.color,this.selectedColor)){this.color=e$1S.clone(this.selectedColor,new e$1S);var t=e$1S.multiply(this.color,this.preColor,new e$1S),i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aColor2];if(e$28(n)){var o=e*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=t.red,a[1]=t.green,a[2]=t.blue,a[3]=t.alpha,i.instanceBuffer.copyFromArrayView(a,o),this.isSelected=!0}}}}},_0x4ca9cd.prototype.setUnSelected=function(){var e=this.index;if(e$28(e)&&!(e<0)&&this.isSelected){this.isSelected=!1,this.color=e$1S.clone(this.preColor,this.color);var t=this.instanceInfo;if(e$28(t)&&e$28(t.instanceBuffer)){var i=t.attributeLocation,r=t.attributes[i.aColor2];if(e$28(r)){var n=e*r.strideInBytes+r.offsetInBytes,o=S$W.createTypedArray(r.componentDatatype,r.componentsPerAttribute);o[0]=this.preColor.red,o[1]=this.preColor.green,o[2]=this.preColor.blue,o[3]=this.preColor.alpha,t.instanceBuffer.copyFromArrayView(o,n)}}}},_0x4ca9cd.prototype.updateOffsetPosition=function(e){if(e$28(e)){var t=this.index;this.offset=t$X.clone(e,this.offset);var i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aOffsetPosition];if(e$28(n)){var o=t*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=this.offset.x,a[1]=this.offset.y,a[2]=this.offset.z,i.instanceBuffer.copyFromArrayView(a,o)}}}},_0x4ca9cd.prototype.updatePosition=function(e){if(e$28(e)){var t=this.index;if(this.position=t$X.clone(e,this.position),this.geoPosition=t$W.fromCartesian(this.position),e$28(this.tile)&&e$28(this.tile.inverseTransform)){this.offset=y$15.multiplyByPoint(this.tile.inverseTransform,this.position,this.offset);var i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aOffsetPosition];if(e$28(n)){var o=t*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=this.offset.x,a[1]=this.offset.y,a[2]=this.offset.z,i.instanceBuffer.copyFromArrayView(a,o)}}}}},_0x4ca9cd.prototype.updateRotation=function(e){if(e$28(e)){var t=this.index;if(!i$10.equals(this.hpr,e)){this.hpr=i$10.clone(e,this.hpr),this.quaternion=n$14.fromHeadingPitchRoll(e,this.quaternion);var i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aQuaternion];if(e$28(n)){var o=t*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=this.quaternion.x,a[1]=this.quaternion.y,a[2]=this.quaternion.z,a[3]=this.quaternion.w,i.instanceBuffer.copyFromArrayView(a,o)}}}}},_0x4ca9cd.prototype.updateColor=function(e){if(e$28(e)){var t=this.index;if(!e$1S.equals(this.color,e)){this.color=e$1S.clone(e,this.color),this.preColor=e$1S.clone(e,this.preColor);var i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aColor2];if(e$28(n)){var o=t*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=this.color.red,a[1]=this.color.green,a[2]=this.color.blue,a[3]=this.color.alpha,i.instanceBuffer.copyFromArrayView(a,o)}}}}},_0x4ca9cd.prototype.updateScale=function(e){if(e$28(e)){var t=this.index;if(!t$X.equals(this.scale,e)){t$X.clone(e,this.scale);var i=this.instanceInfo;if(e$28(i)&&e$28(i.instanceBuffer)){var r=i.attributeLocation,n=i.attributes[r.aScale];if(e$28(n)){var o=t*n.strideInBytes+n.offsetInBytes,a=S$W.createTypedArray(n.componentDatatype,n.componentsPerAttribute);a[0]=e.x,a[1]=e.y,a[2]=e.z,i.instanceBuffer.copyFromArrayView(a,o)}}}}},_0x4ca9cd.prototype.updateModelMatrix=function(e){var t=y$15.getScale(e,new t$X);this.updateScale(t);var i=y$15.setScale(e,new t$X(1,1,1),new y$15),r=y$15.getRotation(i,new p$1a);n$14.fromRotationMatrix(r,this.quaternion);var n=i$10.fromQuaternion(this.quaternion,new i$10);this.updateRotation(n);var o=y$15.getTranslation(e,new t$X);t$X.add(this.offset,o,this.offset),this.updateOffsetPosition(this.offset)},_0x4ca9cd.prototype.write=function(e,t){var i=this.offset,r=this.quaternion,n=this.scale,o=this.color,a=this.pickColor,s=0;e[t+s++]=i.x,e[t+s++]=i.y,e[t+s++]=i.z,e[t+s++]=r.x,e[t+s++]=r.y,e[t+s++]=r.z,e[t+s++]=r.w,e[t+s++]=n.x,e[t+s++]=n.y,e[t+s++]=n.z,e[t+s++]=o.red,e[t+s++]=o.green,e[t+s++]=o.blue,e[t+s++]=o.alpha,e[t+s++]=a.x,e[t+s++]=a.y,e[t+s++]=a.z,e[t+s++]=a.w},_0x4ca9cd.prototype.isDestroyed=function(){return!1},_0x4ca9cd.prototype.destroy=function(){i$Z(this)};var _0x5d3ea0=(_0x39f0e3=!0,function(e,t){var i=_0x39f0e3?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x39f0e3=!1,i}),_0x3d5c0b=_0x5d3ea0(void 0,(function(){return _0x3d5c0b.toString().search("(((.+)+)+)+$").toString().constructor(_0x3d5c0b).search("(((.+)+)+)+$")})),_0x39f0e3;function _0x214eb4(e,t){this.url=e,this.stride=t,this.instances=[],this.instanceBuffer=void 0,this.attributes=void 0,this.attributeLocation=void 0,this.inverseTransform=void 0,this.dirty=!1}function _0x4f6b07(e,t){for(var i=e.length,r=new Float32Array(i*t),n=0;n<i;n++){var o=e[n];o.index=n;var a=n*t;o.write(r,a)}return r}function _0x94ff31(e,t,i){var r=_0x4f6b07(t,i),n=h$W.createVertexBuffer({context:e,typedArray:r,usage:A$1c.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function _0x589401(e,t){var i=S$W.getSizeInBytes(S$W.FLOAT),r=0,n=[],o=0,a={};return a.aOffsetPosition=o++,n.push({index:a.aOffsetPosition,vertexBuffer:e,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:r,strideInBytes:i*t,instanceDivisor:1}),r+=3,a.aQuaternion=o++,n.push({index:a.aQuaternion,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:i*r,strideInBytes:i*t,instanceDivisor:1}),r+=4,a.aScale=o++,n.push({index:a.aScale,vertexBuffer:e,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:i*r,strideInBytes:i*t,instanceDivisor:1}),r+=3,a.aColor2=o++,n.push({index:a.aColor2,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:i*r,strideInBytes:i*t,instanceDivisor:1}),r+=4,a.aPickColor=o++,n.push({index:a.aPickColor,vertexBuffer:e,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,normalize:!1,offsetInBytes:i*r,strideInBytes:i*t,instanceDivisor:1}),r+=4,{attributes:n,attributeLocation:a}}_0x3d5c0b(),_0x214eb4.prototype.getHeightRange=function(){for(var e=Number.MAX_VALUE,t=Number.MIN_VALUE,i=this.instances.length,r=0;r<i;r++){var n=this.instances[r];e=Math.min(e,n.geoPosition.height),t=Math.max(t,n.geoPosition.height)}return{minHeight:e,maxHeight:t}},_0x214eb4.prototype.update=function(e){if(e$28(this.instanceBuffer)&&(this.instanceBuffer=this.instanceBuffer.destroy()),this.instances.length>0)if(this.instanceBuffer=_0x94ff31(e,this.instances,this.stride),e$28(this.attributes))for(var t=0,i=this.attributes.length;t<i;t++){this.attributes[t].vertexBuffer=this.instanceBuffer}else{var r=_0x589401(this.instanceBuffer,this.stride);this.attributes=r.attributes,this.attributeLocation=r.attributeLocation}this.dirty=!1},_0x214eb4.prototype.isDestroyed=function(){return!1},_0x214eb4.prototype.destroy=function(){this.instanceBuffer=this.instanceBuffer&&!this.instanceBuffer.isDestroyed()&&this.instanceBuffer.destroy(),this.instances=null,this.attributes=null,this.attributeLocation=null,this.inverseTransform=null,i$Z(this)};var _0x30458b=(_0x4c2c08=!0,function(e,t){var i=_0x4c2c08?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4c2c08=!1,i}),_0x1ea32f=_0x30458b(void 0,(function(){return _0x1ea32f.toString().search("(((.+)+)+)+$").toString().constructor(_0x1ea32f).search("(((.+)+)+)+$")})),_0x4c2c08;_0x1ea32f();var _0x2f95b3="attribute vec4 aPosition;\n#ifdef HAS_NORMAL\n attribute vec3 aNormal;\n#endif\nattribute vec4 aTexCoord0;\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\nattribute vec3 aOffsetPosition;\nattribute vec4 aQuaternion;\nattribute vec3 aScale;\nattribute vec4 aColor2;\nattribute vec4 aPickColor;\n#ifdef LocalTransform\nattribute vec4 aLocalTranslation;\nattribute vec4 aLocalQuaternion;\n#endif\nuniform mat4 uGeoMat;\nvarying vec4 vPositionMC;\nvarying vec3 vPositionEC;\nvarying vec3 vNormalEC;\nvarying vec2 vTexCoord;\nvarying vec4 vColor;\nvarying vec4 vPickColor;\nvarying mat4 vModelMatrix;\nmat4 transfromFromQuaternion(vec4 q, vec4 translation)\n{\n float x2 = q.x * q.x;\n float xy = q.x * q.y;\n float xz = q.x * q.z;\n float xw = q.x * q.w;\n float y2 = q.y * q.y;\n float yz = q.y * q.z;\n float yw = q.y * q.w;\n float z2 = q.z * q.z;\n float zw = q.z * q.w;\n float w2 = q.w * q.w;\n float m00 = x2 - y2 - z2 + w2;\n float m01 = 2.0 * (xy - zw);\n float m02 = 2.0 * (xz + yw);\n float m10 = 2.0 * (xy + zw);\n float m11 = -x2 + y2 - z2 + w2;\n float m12 = 2.0 * (yz - xw);\n float m20 = 2.0 * (xz - yw);\n float m21 = 2.0 * (yz + xw);\n float m22 = -x2 - y2 + z2 + w2;\n return mat4(m00, m10, m20, 0.0, m01, m11, m21, 0.0, m02, m12, m22, 0.0, translation.x, translation.y, translation.z, 1.0);\n}\nvoid main()\n{\n vec4 vertexPos = vec4(aPosition.xyz, 1.0);\n vec4 positionMC = uGeoMat * vertexPos;\n vTexCoord = aTexCoord0.xy;\n mat3 rotationMat = mat3(transfromFromQuaternion(aQuaternion, vec4(0.0)));\n mat4 worldMatrix;\n worldMatrix[0] = vec4(rotationMat[0], 0.0);\n worldMatrix[1] = vec4(rotationMat[1], 0.0);\n worldMatrix[2] = vec4(rotationMat[2], 0.0);\n worldMatrix[3] = vec4(aOffsetPosition, 1.0);\n mat4 scaleMatrix;\n vec3 scale = aScale.xyz;\n scaleMatrix[0] = vec4(scale.x,0,0,0.0);\n scaleMatrix[1] = vec4(0,scale.y,0,0.0);\n scaleMatrix[2] = vec4(0,0,scale.z,0.0);\n scaleMatrix[3] = vec4(0,0,0,1.0);\n mat4 modelMatrix = worldMatrix;\n#ifdef LocalTransform\n mat4 localTransformMat = transfromFromQuaternion(aLocalQuaternion, aLocalTranslation);\n modelMatrix *= localTransformMat;\n#endif\n modelMatrix *= scaleMatrix;\n mat3 rotationMatrix = mat3(modelMatrix);\n vModelMatrix = modelMatrix * uGeoMat;\n positionMC = modelMatrix * vec4(positionMC.xyz, 1.0);\n positionMC.w = 1.0;\n gl_Position = czm_modelViewProjection * positionMC;\n vPositionMC.xyz = positionMC.xyz;\n vPositionMC.w = 0.0;\n vec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n vColor = vertexColor * aColor2;\n vPickColor = aPickColor / 255.0;\n#ifdef HAS_NORMAL\n if(length(aNormal) > 0.8)\n {\n vec3 normal = rotationMatrix * aNormal;\n mat4 realModelViewMatrix4 = czm_modelView * vModelMatrix;\n realModelViewMatrix4 = czm_inverseMatrix(realModelViewMatrix4);\n mat3 realModelViewMatrix3 = mat3(realModelViewMatrix4);\n realModelViewMatrix3 = czm_transpose(realModelViewMatrix3);\n vNormalEC = realModelViewMatrix3 * aNormal;\n vPositionMC.w = 1.0;\n vPositionEC = (czm_modelView * vPositionMC).xyz;\n }\n#endif\n}",_0x195558=(_0x15cd60=!0,function(e,t){var i=_0x15cd60?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x15cd60=!1,i}),_0x2c9270=_0x195558(void 0,(function(){return _0x2c9270.toString().search("(((.+)+)+)+$").toString().constructor(_0x2c9270).search("(((.+)+)+)+$")})),_0x15cd60;function _0x3ae5d1(e){this.ready=!1,this.state=_0x5aa9da.UnLoad,this.url=e,this.subSkeletons=[]}function _0x5c13fb(){this.attributes=void 0,this.attributeLocation=void 0,this.indexBuffer=void 0,this.sp=void 0,this.colorCommand=void 0,this.boundingVolume=void 0}function _0x380506(e,t,i){var r=ce$v.UNSIGNED_SHORT;(1===t.indexType||i>=e$27.SIXTY_FOUR_KILOBYTES)&&e.elementIndexUint&&(r=ce$v.UNSIGNED_INT);var n=h$W.createIndexBuffer({context:e,typedArray:t.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:r});return n.vertexArrayDestroyable=!1,n}function _0x474397(e,t){for(var i=t.vertexAttributes,r=0,n=i.length;r<n;r++){var o=i[r];!e$28(o.typedArray)||(o.vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:o.typedArray,usage:A$1c.STATIC_DRAW}),o.vertexBuffer.vertexArrayDestroyable=!1,o.typedArray=null,delete o.typedArray)}return i}function _0x1911e5(e,t,i){var r=t.hasTexture,n=t.hasNormal,o=t.hasVertexColor,a=t.flipY,s=t.attributeLocation,l=new a$$({name:"S3MInstanceCollectionVertex",sources:[_0x2f95b3]}),u=new a$$({name:"S3ModelFP",sources:[_0x9293b3]});if(a&&u.defines.push("FLIP_Y"),r&&u.defines.push("TEXTURE"),n&&(l.defines.push(H$r.HAS_NORMAL),u.defines.push(H$r.HAS_NORMAL)),o&&l.defines.push("VertexColor"),e$28(e._frameState.lightSource)){var c=e._frameState.lightSource.directionalLight;l.defines.push(H$r.DIR_LIGHTS+c.length),u.defines.push(H$r.DIR_LIGHTS+c.length);var h=e._frameState.lightSource.pointLight;l.defines.push(H$r.POINT_LIGHTS+h.length),u.defines.push(H$r.POINT_LIGHTS+h.length);var d=e._frameState.lightSource.spotLight;l.defines.push(H$r.SPOT_LIGHTS+d.length),u.defines.push(H$r.SPOT_LIGHTS+d.length);var f=e._frameState.lightSource.hemisphereLight;u.defines.push(H$r.HEMISPHERE_LIGHTS+f.length)}return i.appendPBRMacroToShader(l,u),S$T.fromCache({context:e._context,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:s})}function _0x538ae9(e,t,i,r){var n=new r$15({primitiveType:W$_.TRIANGLES,boundingVolume:r,modelMatrix:t,pass:i._bTransparentSorting?Le$p.S3MTiles+3:Le$p.S3MTiles+2,cull:!0});e._shadowType===_0x121e29.ALL||e._shadowType===_0x121e29.SELECTION?(n.castShadows=!0,n.receiveShadows=!0):(n.castShadows=!1,n.receiveShadows=!1),n.pickId="vPickColor";var o=i._diffuseColor,a=i._diffuseColor,s=i._specularColor,l=i._shininess,u=i._textures[0],c={uTexture:function(){return u},uAmbientColor:function(){return o},uDiffuseColor:function(){return a},uSpecularColor:function(){return s},uShininess:function(){return l},uGeoMat:function(){return t}};return c=p$17(c,i.createPBRUniformMap()),c=p$17(c,e._frameState.lightSource.createUniformMap()),n.uniformMap=c,n.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND}),n}_0x2c9270(),_0x5c13fb.prototype.isDestroyed=function(){return!1},_0x5c13fb.prototype.destroy=function(){this.sp=this.sp&&!this.sp.isDestroyed()&&this.sp.destroy(),this.indexBuffer=this.indexBuffer&&!this.indexBuffer.isDestroyed()&&this.indexBuffer.destroy();for(var e=0,t=this.attributes.length;e<t;e++)this.attributes[e].vertexBuffer.destroy();return this.attributes.length=0,this.colorCommand=void 0,i$Z(this)},_0x3ae5d1.prototype.createSubSkeleton=function(e,t,i,r,n,o){var a=e._context,s=new _0x5c13fb;s.attributes=_0x474397(a,r),s.indexBuffer=_0x380506(a,n,r.verticesCount),s.attributeLocation=r.attrLocation,s.sp=_0x1911e5(e,{hasTexture:e$28(s.attributeLocation.aTexCoord0)&&i._textures.length>0,hasNormal:e$28(s.attributeLocation.aNormal),hasVertexColor:e$28(s.attributeLocation.aColor),flipY:0===e._supportCompressType,attributeLocation:s.attributeLocation},i),s.colorCommand=_0x538ae9(e,t,i,o),s.boundingVolume=i$19.clone(o),this.subSkeletons.push(s)},_0x3ae5d1.prototype.isDestroyed=function(){return!1},_0x3ae5d1.prototype.destroy=function(){for(var e=0,t=this.subSkeletons.length;e<t;e++)this.subSkeletons[e].destroy();i$Z(this)};var _0xc4a66c=(_0x4e440a=!0,function(e,t){var i=_0x4e440a?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4e440a=!1,i}),_0x337249=_0xc4a66c(void 0,(function(){return _0x337249.toString().search("(((.+)+)+)+$").toString().constructor(_0x337249).search("(((.+)+)+)+$")})),_0x4e440a;function _0x12b3b7(e,t,i){this.tileX=e,this.tileY=t,this.level=i,this.rectangle=void 0,this.boundingVolume=void 0,this.transform=void 0,this.inverseTransform=void 0,this.tileBoundingRegion=void 0,this.distanceToCamera=0,this.instanceGroup=new e$1P,this.skeletonGroup=new e$1P,this.commandGroup=new e$1P,this.dirty=!1}function _0x12c7f6(e,t){var i={},r=0;for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n],++r);for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]+r);return i}function _0x4fcf4f(e,t){for(var i=e.length,r=e.slice(0),n=0,o=t.length;n<o;n++)t[n].index=i+n,r.push(t[n]);return r}function _0x2b7797(e,t,i,r){var n=r.instances[0],o=t$X.maximumComponent(n.scale);e$28(l=e.commandGroup.get(r.url))||(l=new Array(t.subSkeletons.length),e.commandGroup.set(r.url,l));for(var a=0,s=t.subSkeletons.length;a<s;a++){var l,u=t.subSkeletons[a],c=(l=e.commandGroup.get(r.url))[a];e$28(c)||((c=r$15.shallowClone(u.colorCommand)).modelMatrix=y$15.clone(u.colorCommand.modelMatrix),l[a]=c),e$28(c.vertexArray)&&!c.vertexArray.isDestroyed()&&c.vertexArray.destroy();var h=_0x4fcf4f(u.attributes,r.attributes),d=_0x12c7f6(u.attributeLocation,r.attributeLocation);c.vertexArray=new m$19({context:i,attributes:h,indexBuffer:u.indexBuffer}),c.shaderProgram=S$T.fromCache({context:i,shaderProgram:u.sp,vertexShaderSource:u.sp.vertexShaderSource,fragmentShaderSource:u.sp.fragmentShaderSource,attributeLocations:d}),y$15.clone(e.transform,c.modelMatrix),c.instanceCount=r.instances.length,c.radius=u.boundingVolume.radius*o,c.boundingVolume=e.boundingVolume}}_0x337249(),_0x12b3b7.prototype.updateDrawCommand=function(e,t){var i=this.skeletonGroup.get(t.url);e$28(i)&&i.ready&&(!e$28(t.instances[0])||(i._isGlTF?(i.transformed=!0,_0x509e42(this,i,e,t),i.model.activeAnimations.addAll({loop:_0x3df4ed.REPEAT})):_0x2b7797(this,i,e,t)))};var _0x318cc9=new e$25(1,1,1,1);function _0x509e42(e,t,i,r){var n=e.layer,o=t.model._nodeCommands,a=o.length,s=r.instances[0],l=t$X.maximumComponent(s.scale),u=e.commandGroup.get(r.url);e$28(u)||(u=new Array(a),e.commandGroup.set(r.url,u));for(var c=0;c<a;++c){var h=o[c],d=r$15.shallowClone(h.command);u[c]=d,d._isGltfCommand=!0,d.castShadows=!1,d.receiveShadows=!1,d.pickId="vPickColor",d.instanceCount=r.instances.length,d.pass=Le$p.S3MTiles+2,d.cull=!1;var f=_0x41b1fd(d.shaderProgram.vertexAttributes);f=_0x12c7f6(f,r.attributeLocation);var p=d.vertexArray,_=p._attributes,m=p.indexBuffer;_=_0x4fcf4f(_,r.attributes),d.vertexArray=new m$19({context:i,attributes:_,indexBuffer:m});var $=new a$$({name:"InstanceTilesLayerVS",sources:[_0x2f95b3]}),g=new a$$({name:"S3ModelFP",sources:[_0x9293b3]});if(g.defines.push("BRDF"),e$28(n._frameState.specularEnvironmentMaps)&&g.defines.push(H$r.IBL),e$28(n._frameState.lightSource)){var v=n._frameState.lightSource.directionalLight;$.defines.push(H$r.DIR_LIGHTS+v.length),g.defines.push(H$r.DIR_LIGHTS+v.length);var y=n._frameState.lightSource.pointLight;$.defines.push(H$r.POINT_LIGHTS+y.length),g.defines.push(H$r.POINT_LIGHTS+y.length);var x=n._frameState.lightSource.spotLight;$.defines.push(H$r.SPOT_LIGHTS+x.length),g.defines.push(H$r.SPOT_LIGHTS+x.length);var b=n._frameState.lightSource.hemisphereLight;g.defines.push(H$r.HEMISPHERE_LIGHTS+b.length)}e$28(f.aColor)&&$.defines.push("VertexColor"),e$28(f.aNormal)&&($.defines.push(H$r.HAS_NORMAL),g.defines.push(H$r.HAS_NORMAL)),e$28(f.aTexCoord0)&&(e$28(d.uniformMap.u_baseColorTexture)||e$28(d.uniformMap.u_diffuse))&&($.defines.push("TEXTURE"),g.defines.push("TEXTURE")),e$28(d.uniformMap.u_metallicRoughnessTexture)&&g.defines.push("HAS_MetallicRoughness_TEXTURE"),e$28(d.uniformMap.u_normalTexture)&&g.defines.push("HAS_NORMAL_TEXTURE"),e$28(d.uniformMap.u_emissiveTexture)&&g.defines.push("HAS_EMISSIVE_TEXTURE"),e$28(d.uniformMap.u_occlusionTexture)&&g.defines.push("HAS_OCCLUSION_TEXTURE"),d.shaderProgram=S$T.fromCache({context:i,vertexShaderSource:$,fragmentShaderSource:g,attributeLocations:f});var w=new e$25(1,1,1,1),C={uAmbientColor:function(){return _0x318cc9},uDiffuseColor:function(){return _0x318cc9},uSpecularColor:function(){return _0x318cc9},uShininess:function(){return 1},uGeoMat:function(e){return function(){return u[e].localMatrix}}(c),uFilterMode:function(){return n.filterMode},uVisibleDistance:function(){return Number.MAX_VALUE},uFilterPixel:function(){return n.filterPixel},uFillColor:function(){return _0x318cc9},uTransformMatrix:function(){return e.transform},uBaseColorFactor:function(){return w},uEmissiveFactor:function(){return t$X.ZERO},uMetallicFactor:function(){return 0},uRoughnessFactor:function(){return 1},uNormalTextureScale:function(){return 1},uEmissiveUVOffsetAndTiling:function(){return new e$25(0,0,1,1)},uEnvMapIntensity:function(){return 1},uCameraReflect:function(){return n._frameState.camera.bReflect?-1:1}},T=d.uniformMap;e$28(T.u_baseColorTexture)?C.uTexture=T.u_baseColorTexture:e$28(T.u_diffuse)&&(C.uTexture=T.u_diffuse),e$28(T.u_specular)&&(C.uSpecularColor=T.u_specular),e$28(T.u_shininess)&&(C.uShininess=T.u_shininess),e$28(T.u_baseColorFactor)&&(C.uBaseColorFactor=T.u_baseColorFactor),e$28(T.u_emissiveFactor)&&(C.uEmissiveFactor=T.u_emissiveFactor),e$28(T.u_metallicFactor)&&(C.uMetallicFactor=T.u_metallicFactor),e$28(T.u_roughnessFactor)&&(C.uRoughnessFactor=T.u_roughnessFactor),e$28(T.u_metallicRoughnessTexture)&&(C.uMetallicRoughnessTexture=T.u_metallicRoughnessTexture),e$28(T.u_normalTexture)&&(C.uNormalTexture=T.u_normalTexture),e$28(T.u_emissiveTexture)&&(C.uEmissionTexture=T.u_emissiveTexture),e$28(T.u_occlusionTexture)&&(C.uOcclusionTexture=T.u_occlusionTexture),d.uniformMap=p$17(C,n._frameState.lightSource.createUniformMap()),d.localMatrix=y$15.IDENTITY.clone(),d._transformMatrix=y$15.IDENTITY.clone(),d.modelMatrix=y$15.clone(y$15.IDENTITY,new y$15),d.radius=d.boundingVolume.radius*l,d.boundingVolume=x$13.clone(e.boundingVolume,new x$13)}}function _0x41b1fd(e){var t={};return e$28(e.a_position)&&(t.aPosition=e.a_position.index),e$28(e.a_normal)&&(t.aNormal=e.a_normal.index),e$28(e.a_vertexColor)&&(t.aColor=e.a_vertexColor.index),e$28(e.a_tangent)&&(t.aTangent=e.a_tangent.index),e$28(e.a_texcoord_0)&&(t.aTexCoord0=e.a_texcoord_0.index),e$28(e.a_texcoord0)&&(t.aTexCoord0=e.a_texcoord0.index),t}_0x12b3b7.prototype.updateBoundingVolume=function(e,t){this.boundingVolume=x$13.fromRectangle(this.rectangle,e,t)},_0x12b3b7.prototype.remove=function(e){var t=this.instanceGroup.get(e);e$28(t)&&(t.destroy(),this.instanceGroup.remove(e)),this.skeletonGroup.remove(e);var i=this.commandGroup.get(e);if(e$28(i)){for(var r=0,n=i.length;r<n;r++){var o=i[r];o.vertexArray=o.vertexArray&&!o.vertexArray.isDestroyed()&&o.vertexArray.destroy(),o.shaderProgram=o.shaderProgram&&!o.shaderProgram.isDestroyed()&&o.shaderProgram.destroy()}this.commandGroup.remove(e)}},_0x12b3b7.prototype.update=function(e){this.dirty=!1;var t=Number.MAX_VALUE,i=Number.MIN_VALUE;for(var r in this.instanceGroup._hash)if(this.instanceGroup._hash.hasOwnProperty(r)){var n=this.instanceGroup.get(r);n.dirty&&n.update(e);var o=n.getHeightRange();t=Math.min(t,o.minHeight),i=Math.max(i,o.maxHeight),this.updateDrawCommand(e,n)}this.updateBoundingVolume(t,i)},_0x12b3b7.prototype.isDestroyed=function(){return!1},_0x12b3b7.prototype.destroy=function(){var e,t,i,r;for(e=0,t=this.instanceGroup.length;e<t;e++){this.instanceGroup.values[e].destroy()}for(this.instanceGroup.removeAll(),this.skeletonGroup.removeAll(),e=0,t=this.commandGroup.length;e<t;e++){var n=this.commandGroup.values[e];for(i=0,r=n.length;i<r;i++){var o=n[i];o.vertexArray=o.vertexArray&&!o.vertexArray.isDestroyed()&&o.vertexArray.destroy(),o.shaderProgram=o.shaderProgram&&!o.shaderProgram.isDestroyed()&&o.shaderProgram.destroy()}}this.commandGroup.removeAll(),i$Z(this)};var _0x38a647=(_0x46571d=!0,function(e,t){var i=_0x46571d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x46571d=!1,i}),_0x242f8f=_0x38a647(void 0,(function(){return _0x242f8f.toString().search("(((.+)+)+)+$").toString().constructor(_0x242f8f).search("(((.+)+)+)+$")})),_0x46571d;function _0x387fb6(){}function _0x5b97cc(e,t){for(var i=[],r=new i$19,n=new t$X,o=e.vertexAttributes[0],a=o.componentsPerAttribute,s=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4),l=0;l<e.verticesCount;l++)t$X.fromArray(s,a*l,n),i.push(t$X.clone(n));return i$19.fromPoints(i,r),i.length=0,i$19.transform(r,t,r),r}_0x242f8f(),_0x387fb6.load=function(e,t){var i=t$S.fetchArrayBuffer({url:t.url});e$28(i)||(t.state=_0x5aa9da.UnLoad),t.state=_0x5aa9da.Loading,i.then((function(e){t.state=_0x5aa9da.Loaded,t.skeletonBuffer=e}),(function(e){t.state=_0x5aa9da.Failed}))},_0x387fb6.parse=function(e,t){if(_0x333f13.init||_0x333f13.initWebAssembly(),_0x333f13.taskProcessorReady){var i=_0x333f13.S3MBTaskProcessor.scheduleTask({buffer:t.skeletonBuffer,supportCompressType:e._supportCompressType},[t.skeletonBuffer]);if(!e$28(i))return void(t.state=_0x5aa9da.Loaded);t.skeletonBuffer=void 0,t.state=_0x5aa9da.Parsing,i.then((function(i){if(i.result){for(var r=e._context,n={},o=0,a=i.matrials.material.length;o<a;o++){var s=i.matrials.material[o].material,l=s.id,u=new _0x34bd01({});n[l]=u,u.createCommonParamter(s),u.createPBRParamter(s);for(var c=s.textureunitstates,h=0;h<c.length;h++){var d=c[h].textureunitstate,f=d.id,p=0===d.addressmode.u?q$11.REPEAT:q$11.CLAMP_TO_EDGE,_=0===d.addressmode.v?q$11.REPEAT:q$11.CLAMP_TO_EDGE;u._texMatrix=y$15.unpack(d.texmodmatrix);var m=i.texturePackage[f];if(e$28(m)){var $=Se$8.CreateTexture(f,r,m.width,m.height,m.nFormat,m.compressType,m.imageBuffer,!1,p,_);u._textures.push($),0===m.compressType&&(e._supportCompressType=0)}}}var g=i.groupNode.pageLods;if(e$28(g))for(o=0,a=g.length;o<a;o++){for(var v=g[o].geodes[0],y=v.matrix,x=0;x<16;x++)y[x]=parseFloat(y[x]);y=y$15.unpack(y,0);for(var b=v.skeletonNames,w=[],C=0,T=b.length;C<T;C++){var S=b[C].trim();w.push(S);var E=i.geoPackage[S],A=E.vertexPackage,P=_0x5b97cc(A,y),I=E.arrIndexPackage[0];if(e$28(I)){u=n[l=I.materialCode];t.createSubSkeleton(e,y,u,A,I,P)}}}t.ready=!0,t.state=_0x5aa9da.Ready;var M=e._skeletonTileMap.get(t.url);for(o=0,a=M.length;o<a;o++)M[o].dirty=!0;e._skeletonTileMap.remove(t.url)}else t.state=_0x5aa9da.Failed})).otherwise((function(e){console.log(e)}))}};var _0x2b81fb=(_0x396413=!0,function(e,t){var i=_0x396413?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x396413=!1,i}),_0xc4ba83=_0x2b81fb(void 0,(function(){return _0xc4ba83.toString().search("(((.+)+)+)+$").toString().constructor(_0xc4ba83).search("(((.+)+)+)+$")})),_0x396413;function _0x35f716(){}_0xc4ba83();var _0x2f8054=new s$P;function _0xe4f797(e,t){for(var i=[],r=new i$19,n=new t$X,o=(new t$X,e.vertexAttributes[0]),a=o.componentsPerAttribute,s=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4),l=0;l<e.verticesCount;l++)t$X.fromArray(s,a*l,n),i.push(t$X.clone(n));return i$19.fromPoints(i,r),i.length=0,i$19.transform(r,t,r),r}_0x35f716.load=function(e,t){var i=t$S.fetchArrayBuffer({url:t.url,headers:e.customRequestHeaders});e$28(i)||(t.state=_0x5aa9da.UnLoad),t.state=_0x5aa9da.Loading,i.then((function(e){t.state=_0x5aa9da.Loaded,t.skeletonBuffer=e}),(function(e){t.state=_0x5aa9da.Failed}))},_0x35f716.parse=function(e,t){var i=_0x333f13.S3MTaskProcessor.scheduleTask({buffer:t.skeletonBuffer,supportCompressType:e._supportCompressType},[t.skeletonBuffer]);e$28(i)?(t.skeletonBuffer=void 0,t.state=_0x5aa9da.Parsing,i.then((function(i){if(i.result){e._gl;for(var r=e._context,n=_0x2f8054.read(i.xmlDoc).firstChild,o=n.namespaceURI,a=s$P.queryFirstNode(n,"Material3Ds",o),s=s$P.queryChildNodes(a,"material",o),l={},u=0,c=s.length;u<c;u++){var h=s[u],d=s$P.queryStringValue(h,"name",o),f=new _0x34bd01({});l[d]=f;var p=s$P.queryFirstNode(h,"Ambient",o),_=s$P.queryNumericValue(p,"AmbientR",o),m=s$P.queryNumericValue(p,"AmbientG",o),$=s$P.queryNumericValue(p,"AmbientB",o),g=s$P.queryNumericValue(p,"AmbientA",o);f._ambientColor=new e$1S(_,m,$,g);var v=s$P.queryFirstNode(h,"Diffuse",o);_=s$P.queryNumericValue(v,"DiffuseR",o),m=s$P.queryNumericValue(v,"DiffuseG",o),$=s$P.queryNumericValue(v,"DiffuseB",o),g=s$P.queryNumericValue(v,"DiffuseA",o),f._diffuseColor=new e$1S(_,m,$,g);var y=s$P.queryFirstNode(h,"Specular",o);_=s$P.queryNumericValue(y,"SpecularR",o),m=s$P.queryNumericValue(y,"SpecularG",o),$=s$P.queryNumericValue(y,"SpecularB",o),g=s$P.queryNumericValue(y,"SpecularA",o),f._specularColor=new e$1S(_,m,$,g);var x=s$P.queryNumericValue(h,"Shininess",o);f._shininess=x,s$P.queryFirstNode(h,"TransparentSorting",o),f._bTransparentSorting=s$P.queryBooleanValue(h,"TransparentSorting",o)||f._diffuseColor.alpha<1;var b=s$P.queryFirstNode(h,"texture",o),w=s$P.queryStringValue(b,"name",o),C=s$P.queryFirstNode(b,"AddressMode",o),T=s$P.queryStringValue(C,"u",o),S=s$P.queryStringValue(C,"v",o);T="TAM_WRAP"===T?q$11.REPEAT:q$11.CLAMP_TO_EDGE,S="TAM_WRAP"===S?q$11.REPEAT:q$11.CLAMP_TO_EDGE;var E=i.texturePackage[w];if(e$28(E)){var A=Se$8.CreateTexture(w,r,E.width,E.height,E.nFormat,E.compressType,E.imageBuffer,!1,T,S);f._textures.push(A),0===E.compressType&&(e._supportCompressType=0)}}var P=s$P.queryFirstNode(n,"PageLods",o),I=s$P.queryNodes(P,"Geode",o);for(u=0,c=I.length;u<c;u++){for(var M=I[u],O=s$P.queryStringValue(M,"GeoDeModMatrix",o).split(","),D=0;D<16;D++)O[D]=parseFloat(O[D]);O=y$15.unpack(O,0);for(var R=s$P.queryNodes(M,"GeoName",o),L=[],B=0,N=R.length;B<N;B++){var F=R[B].textContent.trim();L.push(F);var z=i.geoPackage[F],k=_0xe4f797(V=z.vertexPackage,O),V=z.vertexPackage,U=z.arrIndexPackage[0];if(e$28(U)){f=l[d=U.materialCode];t.createSubSkeleton(e,O,f,V,U,k)}}}t.ready=!0,t.state=_0x5aa9da.Ready;var X=e._skeletonTileMap.get(t.url);for(u=0,c=X.length;u<c;u++)X[u].dirty=!0;e._skeletonTileMap.remove(t.url)}else t.state=_0x5aa9da.Failed})).otherwise((function(e){console.log(e)}))):t.state=_0x5aa9da.Loaded};var _0xc8eafa=(_0xbe901=!0,function(e,t){var i=_0xbe901?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0xbe901=!1,i}),_0x9a28e=_0xc8eafa(void 0,(function(){return _0x9a28e.toString().search("(((.+)+)+)+$").toString().constructor(_0x9a28e).search("(((.+)+)+)+$")})),_0xbe901;function _0x5ddad8(){}_0x9a28e(),_0x5ddad8.load=function(e,t){t._isGlTF?_0x5ab4c8.load(e,t):_0x35f716.load(e,t)},_0x5ddad8.parse=function(e,t){t.url.endsWith("s3mb")?_0x387fb6.parse(e,t):_0x35f716.parse(e,t)};var _0x50d47a=(_0x52614d=!0,function(e,t){var i=_0x52614d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x52614d=!1,i}),_0x221146=_0x50d47a(void 0,(function(){return _0x221146.toString().search("(((.+)+)+)+$").toString().constructor(_0x221146).search("(((.+)+)+)+$")})),_0x52614d;function _0x3d23f1(e){this._context=e,this._gl=e._gl,this.type=oi$2.INSTANCED_LAYER,this._tilingScheme=new g$14,this._modelSkeletons=new e$1P,this._tiles=new e$1P,this._instances=new e$1P,this._skeletonTileMap=new e$1P,this._tileWidth=1e3,this._level=10,this._maxGeometricError=0,this._level=this.computeLevel(this._tileWidth),this._minVisibleAltitude=0,this._maxVisibleAltitude=Number.MAX_VALUE,this._filterMode=_0x189b29.PIXEL_SIZE_ON_SCREEN,this._filterDistance=Number.MAX_VALUE,this._filterPixel=0,this._selectedColor=new e$1S(.7,.7,1,1),this._pickEnable=!0,this._visibleViewport=4095,this._supportCompressType=e$28(e.s3tc)?1:e$28(e.pvrtc)?2:3,this._shadowType=_0x121e29.NONE,this._visible=!0}function _0x24d35c(e,t,i){var r=e.camera,n=e.context.drawingBufferWidth,o=e.context.drawingBufferHeight,a=Math.max(n,o),s=.5*r.frustum.fov,l=.5*a/Math.tan(s);return Math.ceil(l*t/i)}function _0x504044(e,t,i){if(!e$28(i.boundingVolume))return!1;if(!(e.cullingVolume.computeVisibility(i.boundingVolume)!==pt$a.OUTSIDE))return!1;var r=i.tileBoundingRegion.distanceToCamera(e);if(i.distanceToCamera=r,e.fog.enabled&&e$27.fog(r,e.fog.density)>=1)return!1;var n=e.context.drawingBufferHeight,o=e.camera.frustum.sseDenominator,a=t._maxGeometricError*n/(r*o);return e.fog.enabled&&(a-=e$27.fog(r,e.fog.density)*e.fog.sse),!(a<2)}function _0x1faf57(e,t){t.state===_0x5aa9da.UnLoad&&_0x5ddad8.load(e,t),t.state===_0x5aa9da.Loaded&&_0x5ddad8.parse(e,t)}function _0x5268dd(e,t,i){for(var r=0;r<i.commandGroup.length;r++)for(var n=i.commandGroup.values[r],o=0;o<n.length;o++){var a=n[o];if(t._filterMode===_0x189b29.PIXEL_SIZE_ON_SCREEN){if(_0x24d35c(e,a.radius,i.distanceToCamera)<t.filterPixel)continue}else if(i.distanceToCamera>t.filterDistance)continue;e.commandList.push(a)}}_0x221146(),Object.defineProperties(_0x3d23f1.prototype,{visible:{get:function(){return this._visible},set:function(e){o$1u.typeOf.bool("Instance visible",e),e!==this._visible&&(this._visible=e)}},minVisibleAltitude:{get:function(){return this._minVisibleAltitude},set:function(e){o$1u.typeOf.number("InstanceLayer minVisibleAltitude",e),this._minVisibleAltitude=e}},maxVisibleAltitude:{get:function(){return this._maxVisibleAltitude},set:function(e){o$1u.typeOf.number("InstanceLayer maxVisibleAltitude",e),this._maxVisibleAltitude=e}},filterMode:{get:function(){return this._filterMode},set:function(e){o$1u.typeOf.number("InstanceLayer filterMode",e),this._filterMode=e}},filterDistance:{get:function(){return this._filterDistance},set:function(e){o$1u.typeOf.number("InstanceLayer filterPixel",e),this._filterDistance=e}},filterPixel:{get:function(){return this._filterPixel},set:function(e){o$1u.typeOf.number("InstanceLayer filterPixel",e),this._filterPixel=e}},selectedColor:{get:function(){return this._selectedColor},set:function(e){o$1u.typeOf.object("InstanceLayer selectedColor",e),this._selectedColor=e$1S.clone(e,this._selectedColor)}},pickEnable:{get:function(){return this._pickEnable},set:function(e){o$1u.typeOf.bool("InstanceLayer pickEnable",e),this._pickEnable=e}},tileWidth:{get:function(){return this._tileWidth},set:function(e){o$1u.typeOf.number("InstanceLayer tileWidth",e),this._tileWidth=e;var t=this.computeLevel(e);t!==this._level&&(this._level=t,this.updateTiles())}},shadowType:{get:function(){return this._shadowType},set:function(e){this._shadowType!==e&&(this._shadowType=e,this._updateShadow(this))}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders!==e&&(this._customRequestHeaders=e)}}});var _0x1146ae=78271.51696402048;function _0xb20d38(e){return e._shadowType==_0x121e29.SELECTION||e._shadowType==_0x121e29.ALL}_0x3d23f1.prototype.computeLevel=function(e){var t=10,i=this._tilingScheme.tileXYToRectangle(0,0,10),r=this._tilingScheme._projection,n=h$10.southwest(i),o=h$10.northeast(i);n=r.project(n);var a=(o=r.project(o)).x-n.x;for(o.y,n.y;a>e;)++t,a*=.5;return t-=1,this._maxGeometricError=_0x1146ae/(1<<t),t},_0x3d23f1.prototype.updateTiles=function(){var e,t,i,r;for(e=0,t=this._tiles.length;e<t;e++)this._tiles.values[e].destroy();this._tiles.removeAll(),this._skeletonTileMap.removeAll();var n=this._tilingScheme;for(e=0,t=this._instances.length;e<t;e++){var o=this._instances.values[e];for(i=0,r=o.length;i<r;i++){var a=o.values[i];a.tile=void 0,a.instanceInfo=void 0;var s=a.url,l=n.positionToTileXY(a.geoPosition,this._level),u=l.x+"_"+l.y;if(!e$28(p=this._tiles.get(u))){(p=new _0x12b3b7(l.x,l.y)).layer=this;var c=n.tileXYToRectangle(l.x,l.y,this._level);p.rectangle=h$10.clone(c),p.boundingVolume=x$13.fromRectangle(c,0,0),p.transform=m$1b.eastNorthUpToFixedFrame(p.boundingVolume.center,void 0,new y$15),p.inverseTransform=y$15.inverse(p.transform,new y$15),p.tileBoundingRegion=new y$z({computeBoundingVolumes:!1,rectangle:c,ellipsoid:n.ellipsoid,minimumHeight:0,maximumHeight:0}),this._tiles.set(u,p)}a.offset=y$15.multiplyByPoint(p.inverseTransform,a.position,a.offset),p.dirty=!0;var h=this._skeletonTileMap.get(s);e$28(h)||(h=[],this._skeletonTileMap.set(s,h)),h.push(p);var d=p.instanceGroup.get(s);e$28(d)||(d=new _0x214eb4(s,_0x3d23f1.STRIDE),p.instanceGroup.set(s,d)),d.instances.push(a),a.instanceInfo=d,a.tile=p,d.dirty=!0;var f=p.skeletonGroup.get(s);e$28(f)||(f=this._modelSkeletons.get(s),p.skeletonGroup.set(s,f))}}for(e=0,t=this._tiles.length;e<t;e++){var p;(p=this._tiles.values[e]).dirty&&p.update(this._context)}},_0x3d23f1.prototype.add=function(e,t,i){if(o$1u.typeOf.string("url",e),o$1u.defined("attrs",t),Array.isArray(t)||(t=[t]),!this._modelSkeletons.contains(e)){var r=!1;(e.indexOf(".gltf")>0||e.indexOf(".glb")>0)&&(r=!0),e$28(i)&&(r="gltf"===i),r?this._modelSkeletons.set(e,new _0x9790ee(e)):this._modelSkeletons.set(e,new _0x3ae5d1(e))}for(var n=this._tilingScheme,o=0,a=t.length;o<a;o++){var s=t[o],l=u$Y(s.id,e$1K()),u=new _0x4ca9cd(this._context,e,s,l),c=n.positionToTileXY(u.geoPosition,this._level),h=c.x+"_"+c.y;if(!e$28($=this._tiles.get(h))){($=new _0x12b3b7(c.x,c.y)).layer=this;var d=this._tilingScheme.tileXYToRectangle(c.x,c.y,this._level);$.rectangle=h$10.clone(d),$.boundingVolume=x$13.fromRectangle(d,0,0),$.transform=m$1b.eastNorthUpToFixedFrame($.boundingVolume.center,void 0,new y$15),$.inverseTransform=y$15.inverse($.transform,new y$15),$.tileBoundingRegion=new y$z({computeBoundingVolumes:!1,rectangle:d,ellipsoid:n.ellipsoid,minimumHeight:0,maximumHeight:0}),this._tiles.set(h,$)}u.offset=y$15.multiplyByPoint($.inverseTransform,u.position,u.offset),u.selectedColor=e$1S.clone(this._selectedColor,u.selectedColor),$.dirty=!0;var f=this._skeletonTileMap.get(e);e$28(f)||(f=[],this._skeletonTileMap.set(e,f)),f.push($);var p=$.instanceGroup.get(u.url);e$28(p)||(p=new _0x214eb4(u.url,_0x3d23f1.STRIDE),$.instanceGroup.set(u.url,p)),p.instances.push(u),u.instanceInfo=p,u.tile=$,u.layer=this,p.dirty=!0;var _=$.skeletonGroup.get(u.url);e$28(_)||(_=this._modelSkeletons.get(u.url),$.skeletonGroup.set(u.url,_));var m=this._instances.get(e);e$28(m)||(m=new e$1P,this._instances.set(e,m)),m.set(l,u)}for(o=0,a=this._tiles.length;o<a;o++){var $;($=this._tiles.values[o]).dirty&&$.update(this._context)}},_0x3d23f1.prototype.getInstance=function(e,t){o$1u.defined("InstanceLayer getInstance url",e),o$1u.defined("InstanceLayer getInstance id",t);var i=this._instances.get(e);if(e$28(i))return i.get(t)},_0x3d23f1.prototype._updateShadow=function(e){var t=_0xb20d38(e),i=e._modelSkeletons._hash;for(var r in i){var n=i[r];if(n.ready)for(var o=0,a=n.subSkeletons.length;o<a;o++){var s=n.subSkeletons[o];s.colorCommand.castShadows=t,s.colorCommand.receiveShadows=t}}},_0x3d23f1.prototype.removeInstance=function(e,t){o$1u.defined("InstanceLayer removeInstance url",e),o$1u.defined("InstanceLayer removeInstance ids",t),Array.isArray(t)||(t=[t]);for(var i=0,r=t.length;i<r;i++){var n=t[i],o=this.getInstance(e,n);if(e$28(o)&&e$28(o.tile)){var a=o.tile;a.dirty=!0;var s=a.instanceGroup.get(e);if(e$28(s)){s.dirty=!0;var l=s.instances.indexOf(o);s.instances.splice(l,1),this._instances.get(e).remove(o.id)}}}0===this._instances.get(e).length&&this.removeAll(e)},_0x3d23f1.prototype.removeAll=function(e){var t,i;if(e$28(e)){if(!this._modelSkeletons.contains(e))return;for(this._modelSkeletons.get(e).destroy(),this._modelSkeletons.remove(e),this._instances.remove(e),this._skeletonTileMap.remove(e),t=0,i=this._tiles.length;t<i;t++){var r=this._tiles.values[t];r.remove(e),r.dirty=!0}}else{for(t=0,i=this._modelSkeletons.length;t<i;t++){var n=this._modelSkeletons.values[t];n._isGlTF?!n.model.isDestroyed()&&n.model.destroy():this._modelSkeletons.values[t].destroy()}for(this._modelSkeletons.removeAll(),t=0,i=this._tiles.length;t<i;t++)this._tiles.values[t].destroy();this._tiles.removeAll(),this._instances.removeAll(),this._skeletonTileMap.removeAll()}},_0x3d23f1.prototype.setUnSelected=function(){var e=this._instances;if(e$28(e)&&!(e.length<1))for(var t=0,i=e.length;t<i;t++)for(var r=e.values[t],n=0,o=r.length;n<o;n++){r.values[n].setUnSelected()}},_0x3d23f1.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},_0x3d23f1.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},_0x3d23f1.prototype.update=function(e){if(e.multiViewportIndex>-1&&!this.getVisibleInViewport(e.multiViewportIndex))return;var t=e.camera;if(!(t.positionCartographic.height>this._maxVisibleAltitude||t.positionCartographic.height<this._minVisibleAltitude)&&(!e.passes.pick||this._pickEnable)&&this._visible){for(var i in this._frameState=e,this._modelSkeletons._hash)if(this._modelSkeletons._hash.hasOwnProperty(i)){var r=this._modelSkeletons.get(i);r.ready||_0x1faf57(this,r),r._isGlTF&&r.transformed&&r.model.updateAnimation(e)}for(var n=0,o=this._tiles.length;n<o;n++){var a=this._tiles.values[n];if(_0x504044(e,this,a)){for(var i in a.dirty&&a.update(this._context),a.commandGroup._hash){var s=this._modelSkeletons.get(i).model;if(e$28(s))for(var l=s._nodeCommands,u=a.commandGroup.get(i),c=0,h=u.length;c<h;c++){var d=u[c],f=l[c].command;y$15.clone(f.modelMatrix,d.localMatrix),y$15.clone(a.transform,d.modelMatrix),x$13.clone(a.boundingVolume,d.boundingVolume)}}_0x5268dd(e,this,a)}}}},_0x3d23f1.STRIDE=18,_0x3d23f1.prototype.isDestroyed=function(){return!1},_0x3d23f1.prototype.destroy=function(){this.removeAll(),i$Z(this)};var _0x25523d=(_0x59e2a5=!0,function(e,t){var i=_0x59e2a5?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x59e2a5=!1,i}),_0x33550a=_0x25523d(void 0,(function(){return _0x33550a.toString().search("(((.+)+)+)+$").toString().constructor(_0x33550a).search("(((.+)+)+)+$")})),_0x59e2a5;function _0x5d30f9(e,t){this.id=e,this.buffer=t}_0x33550a();var _0x1acfec=(_0x353531=!0,function(e,t){var i=_0x353531?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x353531=!1,i}),_0x5ce108=_0x1acfec(void 0,(function(){return _0x5ce108.toString().search("(((.+)+)+)+$").toString().constructor(_0x5ce108).search("(((.+)+)+)+$")})),_0x353531,_0x2f231f;function _0x5562dc(){}function _0x576478(e,t){for(var i=e.num_points(),r=e.num_faces(),n=new _0x2f231f.DracoInt32Array,o=3*r,a=ce$v.createTypedArray(i,o),s=0,l=0;l<r;++l)t.GetFaceFromMesh(e,l,n),a[s+0]=n.GetValue(0),a[s+1]=n.GetValue(1),a[s+2]=n.GetValue(2),s+=3;var u=ce$v.UNSIGNED_SHORT;return a instanceof Uint32Array&&(u=ce$v.UNSIGNED_INT),_0x2f231f.destroy(n),{typedArray:a,numberOfIndices:o,indexDataType:u}}function _0x1419f0(e,t,i,r,n){var o,a;r.quantizationBits<=8?(a=new _0x2f231f.DracoUInt8Array,o=new Uint8Array(n),t.GetAttributeUInt8ForAllPoints(e,i,a)):(a=new _0x2f231f.DracoUInt16Array,o=new Uint16Array(n),t.GetAttributeUInt16ForAllPoints(e,i,a));for(var s=0;s<n;++s)o[s]=a.GetValue(s);return _0x2f231f.destroy(a),o}function _0x5b27b8(e,t,i,r){var n,o;switch(i.data_type()){case 1:case 11:o=new _0x2f231f.DracoInt8Array,n=new Int8Array(r),t.GetAttributeInt8ForAllPoints(e,i,o);break;case 2:o=new _0x2f231f.DracoUInt8Array,n=new Uint8Array(r),t.GetAttributeUInt8ForAllPoints(e,i,o);break;case 3:o=new _0x2f231f.DracoInt16Array,n=new Int16Array(r),t.GetAttributeInt16ForAllPoints(e,i,o);break;case 4:o=new _0x2f231f.DracoUInt16Array,n=new Uint16Array(r),t.GetAttributeUInt16ForAllPoints(e,i,o);break;case 5:case 7:o=new _0x2f231f.DracoInt32Array,n=new Int32Array(r),t.GetAttributeInt32ForAllPoints(e,i,o);break;case 6:case 8:o=new _0x2f231f.DracoUInt32Array,n=new Uint32Array(r),t.GetAttributeUInt32ForAllPoints(e,i,o);break;case 9:case 10:o=new _0x2f231f.DracoFloat32Array,n=new Float32Array(r),t.GetAttributeFloatForAllPoints(e,i,o)}for(var a=0;a<r;++a)n[a]=o.GetValue(a);return _0x2f231f.destroy(o),n}function _0x54b89b(e,t,i){var r,n=e.num_points(),o=i.num_components(),a=new _0x2f231f.AttributeQuantizationTransform;if(a.InitFromAttribute(i)){for(var s=new Array(o),l=0;l<o;++l)s[l]=a.min_value(l);r={quantizationBits:a.quantization_bits(),minValues:s,range:a.range(),octEncoded:!1}}_0x2f231f.destroy(a),(a=new _0x2f231f.AttributeOctahedronTransform).InitFromAttribute(i)&&(r={quantizationBits:a.quantization_bits(),octEncoded:!0}),_0x2f231f.destroy(a);var u,c=n*o;u=e$28(r)?_0x1419f0(e,t,i,r,c):_0x5b27b8(e,t,i,c);var h=S$W.fromTypedArray(u);return{array:u,data:{componentsPerAttribute:o,componentDatatype:h,byteOffset:i.byte_offset(),byteStride:S$W.getSizeInBytes(h)*o,normalized:i.normalized(),quantization:r}}}_0x5ce108();var _0x36067e=new t$X(40680631590769,40680631590769,40408299984661.445),_0xbb5bf8=new t$X,_0xd7ed7d=new t$X;function _0x2fd5e1(e,t,i,r){var n=Math.cos(t);_0xbb5bf8.x=n*Math.cos(e),_0xbb5bf8.y=n*Math.sin(e),_0xbb5bf8.z=Math.sin(t),_0xbb5bf8=t$X.normalize(_0xbb5bf8,_0xbb5bf8),t$X.multiplyComponents(_0x36067e,_0xbb5bf8,_0xd7ed7d);var o=Math.sqrt(t$X.dot(_0xbb5bf8,_0xd7ed7d));return _0xd7ed7d=t$X.divideByScalar(_0xd7ed7d,o,_0xd7ed7d),_0xbb5bf8=t$X.multiplyByScalar(_0xbb5bf8,i,_0xbb5bf8),e$28(r)||(r=new t$X),t$X.add(_0xd7ed7d,_0xbb5bf8,r)}var _0x3a27e8=new y$15,_0x4e6164=new y$15,_0x1570f8=new t$X,_0x33e7c9=new t$W;function _0x18a080(e,t,i,r,n,o,a,s){var l=void 0,u=void 0,c=void 0,h=void 0,d=i.vertexAttributes,f=i.attrLocation;if(i.nCompressOptions=0,e$28(r.posUniqueID)&&r.posUniqueID>=0){e$28(s)||(i.nCompressOptions|=_0x33a28d.SVC_Vertex);var p=t.GetAttribute(e,r.posUniqueID),_=_0x54b89b(e,t,p),m=_.data.componentsPerAttribute;i.verticesCount=_.array.length/m,i.vertCompressConstant=_.data.quantization.range/(1<<_.data.quantization.quantizationBits);var $=_.data.quantization.minValues;i.minVerticesValue=new e$25($[0],$[1],$[2],1),m>3&&(i.minVerticesValue.w=$[3]);var g=i.verticesCount;if(o&&(l=new t$W,u=new t$W,c=new Float32Array(2*g),h=new Float64Array(2*g)),e$28(s)){var v=_.array,y=3===m?t$X.unpackArray(v):e$25.unpackArray(v);for(let e=0,t=y.length;e<t;e++){let t=y[e];t$X.multiplyByScalar(t,i.vertCompressConstant,t),t$X.add(t,i.minVerticesValue,t)}var x=y$15.multiply(s.sphereMatrix,s.geoMatrix,_0x3a27e8),b=y$15.multiply(s.ellipsoidMatrix,s.geoMatrix,_0x4e6164);y$15.inverse(b,b);var w=new t$V(6378137,6378137,6378137);for(let e=0,t=y.length;e<t;e++){let t=y[e];y$15.multiplyByPoint(x,t,_0x1570f8);let i=w.cartesianToCartographic(_0x1570f8,_0x33e7c9);o&&(h[2*e]=i.longitude,h[2*e+1]=i.latitude,0===e?(l.longitude=i.longitude,l.latitude=i.latitude,u.longitude=i.longitude,u.latitude=i.latitude):(l.longitude=Math.max(i.longitude,l.longitude),l.latitude=Math.max(i.latitude,l.latitude),u.longitude=Math.min(i.longitude,u.longitude),u.latitude=Math.min(i.latitude,u.latitude)));let r=_0x2fd5e1(i.longitude,i.latitude,i.height,_0x1570f8);y$15.multiplyByPoint(b,r,t)}var C=new Array(3*y.length);3===m?t$X.packArray(y,C):e$25.packArray(y,C),_.array=new Float32Array(C),_.data.componentDatatype=S$W.FLOAT,_.data.byteStride=4*m}if(f.aPosition=d.length,d.push({index:f.aPosition,typedArray:_.array,componentsPerAttribute:m,componentDatatype:_.data.componentDatatype,offsetInBytes:_.data.byteOffset,strideInBytes:_.data.byteStride,normalize:_.data.normalized}),!e$28(s)&&o)for(var T=new t$X,S=new t$X,E=new t$W,A=0;A<g;A++)y$15.multiplyByPoint(n,t$X.fromElements(_.array[3*A]*i.vertCompressConstant+$[0],_.array[3*A+1]*i.vertCompressConstant+$[1],_.array[3*A+2]*i.vertCompressConstant+$[2],T),S),E=t$W.fromCartesian(S),h[2*A]=E.longitude,h[2*A+1]=E.latitude,0===A?(l.longitude=E.longitude,l.latitude=E.latitude,u.longitude=E.longitude,u.latitude=E.latitude):(l.longitude=Math.max(E.longitude,l.longitude),l.latitude=Math.max(E.latitude,l.latitude),u.longitude=Math.min(E.longitude,u.longitude),u.latitude=Math.min(E.latitude,u.latitude));if(o){for(A=0;A<g;A++)c[2*A]=h[2*A]-u.longitude,c[2*A+1]=h[2*A+1]-u.latitude;f.img=d.length,d.push({index:f.img,typedArray:c,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:2*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),a.max=l,a.min=u}}if(e$28(r.normalUniqueID)&&r.normalUniqueID>=0){i.nCompressOptions|=_0x33a28d.SVC_Normal;var P=t.GetAttribute(e,r.normalUniqueID),I=_0x54b89b(e,t,P),M=I.data.quantization;i.normalRangeConstant=(1<<M.quantizationBits)-1,f.aNormal=d.length,d.push({index:f.aNormal,typedArray:I.array,componentsPerAttribute:I.data.componentsPerAttribute,componentDatatype:I.data.componentDatatype,offsetInBytes:I.data.byteOffset,strideInBytes:I.data.byteStride,normalize:I.data.normalized})}if(e$28(r.colorUniqueID)&&r.colorUniqueID>=0){i.nCompressOptions|=_0x33a28d.SVC_VertexColor;var O=t.GetAttribute(e,r.colorUniqueID),D=_0x54b89b(e,t,O),R=D.array,L=D.data.componentDatatype,B=D.data.byteOffset,N=D.data.byteStride,F=D.data.normalized;if(D.array instanceof Int32Array){R=new Uint8Array(D.array.length);for(let e=0,t=D.array.length;e<t;e++)R[e]=D.array[e];L=5121,B=0,N=4,F=!0}f.aColor=d.length,d.push({index:f.aColor,typedArray:R,componentsPerAttribute:D.data.componentsPerAttribute,componentDatatype:L,offsetInBytes:B,strideInBytes:N,normalize:F})}for(A=0;A<r.texCoordUniqueIDs.length;A++){i.texCoordCompressConstant=[],i.minTexCoordValue=[];var z=r.texCoordUniqueIDs[A];if(!(z<0)){var k=t.GetAttribute(e,z),V=_0x54b89b(e,t,k);if(e$28(V.data.quantization)){i.nCompressOptions|=_0x33a28d.SVC_TexutreCoord,i.texCoordCompressConstant.push(V.data.quantization.range/(1<<V.data.quantization.quantizationBits));$=V.data.quantization.minValues;i.minTexCoordValue.push(new o$1k($[0],$[1]))}var U="aTexCoord"+A;f[U]=d.length,d.push({index:f[U],typedArray:V.array,componentsPerAttribute:V.data.componentsPerAttribute,componentDatatype:V.data.componentDatatype,offsetInBytes:V.data.byteOffset,strideInBytes:V.data.byteStride,normalize:V.data.normalized}),i.textureCoordIsW=!0}}for(A=0;A<r.vertexAttrUniqueIDs.length;A++){var X=r.vertexAttrUniqueIDs[A];if(!(X<0)){var H=t.GetAttribute(e,X),G=_0x54b89b(e,t,H);f.aVertexWeight=d.length,d.push({index:f.aVertexWeight,typedArray:G.array,componentsPerAttribute:G.data.componentsPerAttribute,componentDatatype:G.data.componentDatatype,offsetInBytes:G.data.byteOffset,strideInBytes:G.data.byteStride,normalize:G.data.normalized}),i.customVertexAttribute={VertexWeight:0}}}}_0x5562dc.dracoDecodePointCloud=function(e,t,i,r,n){for(var o=new(_0x2f231f=e).Decoder,a=["POSITION","NORMAL","COLOR"],s=0;s<a.length;++s)o.SkipAttributeTransform(_0x2f231f[a[s]]);var l=new _0x2f231f.DecoderBuffer;if(l.Init(t,i),o.GetEncodedGeometryType(l)!==_0x2f231f.POINT_CLOUD)throw new t$U("Draco geometry type must be POINT_CLOUD.");var u=new _0x2f231f.PointCloud,c=o.DecodeBufferToPointCloud(l,u);if(!c.ok()||0===u.ptr)throw new t$U("Error decoding draco point cloud: "+c.error_msg());_0x2f231f.destroy(l),_0x18a080(u,o,r,n),_0x2f231f.destroy(u),_0x2f231f.destroy(o)},_0x5562dc.dracoDecodeMesh=function(e,t,i,r,n,o,a,s,l,u){for(var c=new(_0x2f231f=e).Decoder,h=["POSITION","NORMAL","COLOR","TEX_COORD"],d=0;d<h.length;++d)c.SkipAttributeTransform(_0x2f231f[h[d]]);var f=new _0x2f231f.DecoderBuffer;if(f.Init(t,i),c.GetEncodedGeometryType(f)!==_0x2f231f.TRIANGULAR_MESH)throw new t$U("Unsupported draco mesh geometry type.");var p=new _0x2f231f.Mesh;if(!c.DecodeBufferToMesh(f,p).ok()||0===p.ptr)return!1;_0x2f231f.destroy(f),_0x18a080(p,c,r,o,a,s,l,u);var _=_0x576478(p,c);n.indicesTypedArray=_.typedArray,n.indicesCount=_.numberOfIndices,n.indexType=_.indexDataType,n.primitiveType=W$_.TRIANGLES,_0x2f231f.destroy(p),_0x2f231f.destroy(c)};var _0x3bfc6d=(_0x41a671=!0,function(e,t){var i=_0x41a671?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x41a671=!1,i}),_0x4f937a=_0x3bfc6d(void 0,(function(){return _0x4f937a.toString().search("(((.+)+)+)+$").toString().constructor(_0x4f937a).search("(((.+)+)+)+$")})),_0x41a671;_0x4f937a();var _0x2564e5=function(e){e=e||{},this._scene=e.scene,this._name=e.name,this._layerConfigs=new e$1P,this._s3mLayers=new e$1P,this._s3mURLs=[],this._associatedFieldName=void 0,this._resetVisible=!1,this._associatedLayerIds=[],this._visible=u$Y(e.isVisible,!0)};Object.defineProperties(_0x2564e5.prototype,{size:{get:function(){return this._s3mLayers.length}},associatedField:{get:function(){return this._associatedFieldName},set:function(e){this._associatedFieldName=e}},visible:{get:function(){return this._visible},set:function(e){for(var t in this._visible=e,this._s3mLayers._hash){this._s3mLayers.get(t).visible=e}}}}),_0x2564e5.prototype.getLayer=function(e){return this._s3mLayers._array[e]},_0x2564e5.prototype.getSubLayer=function(e){var t,i=o$1q.defer();if(!e$28(e))throw new t$Z("name is required.");for(var r in this._layerConfigs._hash){var n=this._layerConfigs.get(r);if(n.name===e){if(n.ready){t=this._s3mLayers.get(r);break}t=this._scene.addS3MTilesLayerByScp(r+"?t=1",n,n.index,!0),n.ready=!0;break}}return e$28(t)?o$1q(t,(function(e){i.resolve(e)})):i.resolve(),i.promise},_0x2564e5.prototype.findByIndex=function(e){if(!e$28(e))throw new t$Z("index is required.");if(e>this._s3mLayers.length-1)throw new t$Z("index is out of bounds.");return this._s3mLayers._array[e]},_0x2564e5.prototype.releaseSelection=function(){},_0x2564e5.prototype.remove=function(e,t){if(t=u$Y(t,!0),!e$28(e))return!1;var i,r;for(var n in this._s3mLayers._hash){var o=this._s3mLayers.get(n);if(o.name===e){i=n,r=o;break}}return e$28(i)?(this._s3mLayers.remove(i),t&&r.destroy(),!0):void 0};var _0x772891=.25,_0x2809b5=64,_0x16cc3e=2,_0x47a2f4=6378137,_0x369b73=2*_0x47a2f4*Math.PI*_0x772891/(_0x2809b5*_0x16cc3e),_0x22f484=2;function _0x14be91(e,t,i){return _0x369b73/(1<<t)*e.context.drawingBufferHeight/(i*e.camera.frustum.sseDenominator)}function _0x199bbb(e,t,i){e._scene.addS3MTilesLayerByScp(t+"?t=1",i,i.index,!0).then((function(r){if(e$28(r)){if(r.visible=e.visible,r._id=e._id+"_"+i.index,e._s3mLayers.set(t,r),e$28(i.historyCommands)){for(var n=0,o=i.historyCommands.length;n<o;n++)r[i.historyCommands[n].func].apply(r,i.historyCommands[n].arguments);r._historyCommands=i.historyCommands}if(e$28(e._associatedFieldName)&&("attribute"===r._attributeExtentName?(r._queryFieldNames=[e._associatedFieldName],r._layerScheduler._indexedDBSetting.isAttributesSave=!0):r._layerScheduler._downloadAttributes(),r._layerScheduler._associatedFieldName=e._associatedFieldName),e._associatedLayerIds.length>0){var a=void 0;for(n=0;n<e._associatedLayerIds.length;n++)if(e$28(a=e._associatedLayerIds[n].fineLayer)&&a===r.name){r._layerScheduler._isFineLayer=!0;break}r._layerScheduler._isFineLayer=!0}}}))}_0x2564e5.prototype.setSelection=function(e,t,i,r){for(var n=!1,o=this._s3mURLs.length-1;o>=0;o--)if(e$28(this._s3mURLs[o])){var a=this._s3mLayers.get(this._s3mURLs[o]);!e$28(a)||(a.id===i&&a.selectEnabled&&a.name===r?(a.setSelection(e,t),n=!0):a.releaseSelection())}return n},_0x2564e5.prototype.releaseSelection=function(){for(var e=this._s3mURLs.length-1;e>=0;e--)if(e$28(this._s3mURLs[e])){var t=this._s3mLayers.get(this._s3mURLs[e]);!e$28(t)||t.releaseSelection()}},_0x2564e5.prototype.getSelection=function(){for(var e=[],t=this._s3mURLs.length-1;t>=0;t--)if(e$28(this._s3mURLs[t])){var i=this._s3mLayers.get(this._s3mURLs[t]);!e$28(i)||(e=e.concat(i.getSelection()))}return e},_0x2564e5.prototype.update=function(e,t,i,r){var n=this,o=this._layerConfigs;for(var a in o._hash){var s=o.get(a),l=t.camera.positionWC,u=i$19.fromRectangle3D(s.layerBounds),c=t$X.distance(u.center,l);c>u.radius&&(c-=u.radius);for(var h=Math.max(s.layerBounds.width,s.layerBounds.height),d=0,f=Math.PI;f>h;)f*=.5,d++;var p=_0x14be91(t,d-=1,c)<_0x22f484;if(s.ready){var _=n._s3mLayers.get(a);if(!e$28(_))return;p?(e$28(_._flattenTexture)||e$28(_._excavationTexture)?_.refresh():(n.remove(_._name,!0),s.historyCommands=_._historyCommands,s.ready=!1),n._resetVisible=!0):_.update(e,t,i,r)}else p||(_0x199bbb(this,a,s),s.ready=!0)}},_0x2564e5.prototype.render=function(e,t){for(var i=void 0,r={},n={},o=this._s3mURLs.length-1;o>=0;o--)if(e$28(this._s3mURLs[o])){var a=this._s3mLayers.get(this._s3mURLs[o]);if(e$28(a)){if(this._resetVisible){var s=[];for(var l in a._layerScheduler._attributes){e$28(r[a._layerScheduler._attributes[l][this._associatedFieldName]])&&s.push(l)}if(a.setObjsVisible(s,!1),this._associatedLayerIds.length>0){var u,c=void 0;for(u=0;u<this._associatedLayerIds.length&&(!e$28(c=this._associatedLayerIds[u].coarseLayer)||c!==a.name);u++)c=void 0;if(e$28(c)){var h=[];for(var l in n){var d=this._associatedLayerIds[u].idMapping[l];e$28(d)&&h.push(d)}a.setObjsVisible(h,!1)}}this._resetVisible=!1}if(a._fileType===f$r.OSGBFile&&e$28(this._associatedFieldName)&&e$28(i)){var f=e$27.toDegrees(i.east),p=e$27.toDegrees(i.north),_=e$27.toDegrees(i.south),m=e$27.toDegrees(i.west),$=[m,p,0,f,p,0,f,_,0,m,_,0,m,p,0];a.addFlattenRegion({position:$,name:"flatten"})}if(a.render(e,t),i=a._layerBounds,a._layerScheduler._objectIdChange){for(var g in a._layerScheduler._entityObjectId){var v=a._layerScheduler._entityObjectId[g];for(var l in v)r[v[l]]=l}for(var g in a._layerScheduler._entityModelId){v=a._layerScheduler._entityModelId[g];for(var l in v)n[l]=l}this._resetVisible=!0,a._layerScheduler._objectIdChange=!1}}}},_0x2564e5.prototype.destroy=function(){for(var e=this._s3mURLs.length-1;e>=0;e--)if(e$28(this._s3mURLs[e])){var t=this._s3mLayers.get(this._s3mURLs[e]);e$28(t)&&t.destroy()}return i$Z(this)};var _0x3a8906=(_0x1ede6d=!0,function(e,t){var i=_0x1ede6d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1ede6d=!1,i}),_0x573a59=_0x3a8906(void 0,(function(){return _0x573a59.toString().search("(((.+)+)+)+$").toString().constructor(_0x573a59).search("(((.+)+)+)+$")})),_0x1ede6d;function _0x37db74(){this._cache={},this._cacheHeap=new o$1n({comparator:sortComparator}),this._cacheHeap.maximumLength=100}function u$i(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).missingImageUrl))throw new t$Z("options.missingImageUrl is required.");if(!e$28(e.pixelsToCheck))throw new t$Z("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var t=t$S.createIfNeeded(e.missingImageUrl),i=this;t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then((function(t){e$28(t.blob)&&(i._missingImageByteLength=t.blob.size);var r=d$11(t);if(e.disableCheckIfAllPixelsAreTransparent){for(var n=!0,o=t.width,a=e.pixelsToCheck,s=0,l=a.length;n&&s<l;++s){var u=a[s];r[4*u.x+u.y*o+3]>0&&(n=!1)}n&&(r=void 0)}i._missingImagePixels=r,i._isReady=!0})).otherwise((function(){i._missingImagePixels=void 0,i._isReady=!0}))}function o$w(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}function e$k(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,t$Z.throwInstantiationError()}_0x573a59(),_0x37db74.prototype.set=function(e,t){var i={id:e,buffer:t,priority:kt$7()};this._cache[e]=i;var r=this._cacheHeap.insert(i);e$28(r)&&delete this._cache[r.id]},_0x37db74.prototype.get=function(e){var t=this._cache[e];if(e$28(t))return t},_0x37db74.prototype.contains=function(e){return e$28(this._cache[e])},u$i.prototype.isReady=function(){return this._isReady},u$i.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new t$Z("shouldDiscardImage must not be called before the discard policy is ready.");var t=this._pixelsToCheck,i=this._missingImagePixels;if(!e$28(i)||e$28(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var r=d$11(e),n=e.width,o=0,a=t.length;o<a;++o)for(var s=t[o],l=4*s.x+s.y*n,u=0;u<4;++u){var c=l+u;if(r[c]!==i[c])return!1}return!0},o$w.prototype.configureNameFromProperties=function(e){var t,i=10;for(var r in e)if(e.hasOwnProperty(r)&&e[r]){var n=r.toLowerCase();i>1&&"name"===n?(i=1,t=r):i>2&&"title"===n?(i=2,t=r):i>3&&/name/i.test(r)?(i=3,t=r):i>4&&/title/i.test(r)&&(i=4,t=r)}e$28(t)&&(this.name=e[t])},o$w.prototype.configureDescriptionFromProperties=function(e){this.description=function e(t){var i='<table class="cesium-infoBox-defaultTable">';for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];e$28(n)&&(i+="object"==typeof n?"<tr><td>"+r+"</td><td>"+e(n)+"</td></tr>":"<tr><td>"+r+"</td><td>"+n+"</td></tr>")}return i+="</table>"}(e)},Object.defineProperties(e$k.prototype,{ready:{get:t$Z.throwInstantiationError},readyPromise:{get:t$Z.throwInstantiationError},rectangle:{get:t$Z.throwInstantiationError},tileWidth:{get:t$Z.throwInstantiationError},tileHeight:{get:t$Z.throwInstantiationError},maximumLevel:{get:t$Z.throwInstantiationError},minimumLevel:{get:t$Z.throwInstantiationError},tilingScheme:{get:t$Z.throwInstantiationError},tileDiscardPolicy:{get:t$Z.throwInstantiationError},errorEvent:{get:t$Z.throwInstantiationError},credit:{get:t$Z.throwInstantiationError},proxy:{get:t$Z.throwInstantiationError},hasAlphaChannel:{get:t$Z.throwInstantiationError}}),e$k.prototype.getTileCredits=t$Z.throwInstantiationError,e$k.prototype.requestImage=t$Z.throwInstantiationError,e$k.prototype.pickFeatures=t$Z.throwInstantiationError;var m$o=/\.ktx$/i,p$h=/\.crn$/i,c$f=/\.dxtz$/i;function b$n(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");this._baseUrl=e.url;var t=t$S.createIfNeeded(e.url);t.appendForwardSlash(),e$28(e.token)&&t.setQueryParameters({token:e.token}),this._resource=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=u$Y(e.tilingScheme,new g$14({ellipsoid:e.ellipsoid})),this._useTiles=u$Y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=u$Y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._customRequestHeaders=e.customRequestHeaders;var i=e.credit;"string"==typeof i&&(i=new r$1a(i)),this._credit=i,this.enablePickFeatures=u$Y(e.enablePickFeatures,!0),this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer();var r,n=this,o=e.url;function a(t){var i=t.tileInfo;if(e$28(i)){if(n._tileWidth=i.rows,n._tileHeight=i.cols,102100===i.spatialReference.wkid||102113===i.spatialReference.wkid)n._tilingScheme=new c$10({ellipsoid:e.ellipsoid});else{if(4326!==t.tileInfo.spatialReference.wkid){var o="Tile spatial reference WKID "+t.tileInfo.spatialReference.wkid+" is not supported.";return void(r=l$13.handleError(r,n,n._errorEvent,o,void 0,void 0,void 0,l))}n._tilingScheme=new g$14({ellipsoid:e.ellipsoid})}if(n._maximumLevel=t.tileInfo.lods.length-1,e$28(t.fullExtent)){if(e$28(t.fullExtent.spatialReference)&&e$28(t.fullExtent.spatialReference.wkid))if(102100===t.fullExtent.spatialReference.wkid||102113===t.fullExtent.spatialReference.wkid){var a=new t$M,s=t.fullExtent,u=a.unproject(new t$X(Math.max(s.xmin,-n._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(s.ymin,-n._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),c=a.unproject(new t$X(Math.min(s.xmax,n._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(s.ymax,n._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));n._rectangle=new h$10(u.longitude,u.latitude,c.longitude,c.latitude)}else{if(4326!==t.fullExtent.spatialReference.wkid){var h="fullExtent.spatialReference WKID "+t.fullExtent.spatialReference.wkid+" is not supported.";return void(r=l$13.handleError(r,n,n._errorEvent,h,void 0,void 0,void 0,l))}n._rectangle=h$10.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax)}}else n._rectangle=n._tilingScheme.rectangle;e$28(n._tileDiscardPolicy)||(n._tileDiscardPolicy=new u$i({missingImageUrl:B$a(n,0,0,n._maximumLevel).url,pixelsToCheck:[new o$1k(0,0),new o$1k(200,20),new o$1k(20,200),new o$1k(80,110),new o$1k(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),n._useTiles=!0}else n._useTiles=!1;e$28(t.copyrightText)&&t.copyrightText.length>0&&(n._credit=new r$1a(t.copyrightText)),n._ready=!0,n._readyPromise.resolve(!0),l$13.handleSuccess(r)}function s(e){var t="An error occurred while accessing "+n._resource.url+".";r=l$13.handleError(r,n,n._errorEvent,t,void 0,void 0,void 0,l),n._readyPromise.reject(new t$U(t))}function l(){o$1q(n._resource.getDerivedResource({queryParameters:{f:"json",headers:n._customRequestHeaders}}).fetchJsonp(),a,s)}n.tablename=e.url,new l$11({name:o}).then((function(e){e.checkObjectStoreExit(n.tablename)?n._indexedDBScheduler=e:e.createObjectStore(n.tablename).then((function(){n._indexedDBScheduler=e}))})),n._indexedDBSetting={isOpen:!1,clear:function(){n._indexedDBScheduler.clear(n.tablename)},cache:[]},this._useTiles?l():(this._ready=!0,this._readyPromise.resolve(!0))}function B$a(e,t,i,r,n){var o;if(e._useTiles)o=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,headers:e._customRequestHeaders,request:n});else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:a.west+","+a.south+","+a.east+","+a.north,size:e._tileWidth+","+e._tileHeight,format:"png",transparent:!0,f:"image"};e._tilingScheme.projection instanceof n$1b?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers),o=e._resource.getDerivedResource({url:"export",headers:e._customRequestHeaders,request:n,queryParameters:s})}return o}function Y$a(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function a$m(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=void 0,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new o$1k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function v$l(e){var t=e._framebuffers;if(e$28(t)){for(var i=t.length,r=0;r<i;++r)t[r].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}}function D$m(e,t){v$l(e);for(var i=e._width,r=e._height,n=V$O.RGBA,o=t.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT,a=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),s=Math.ceil(Math.log(Math.max(i,r))/Math.log(3)),l=new Array(s),u=0;u<s;++u)i=Math.max(Math.ceil(i/3),1),r=Math.max(Math.ceil(r/3),1),l[u]=new a$z({context:t,colorTextures:[new L$17({context:t,width:i,height:r,pixelFormat:n,pixelDatatype:o,sampler:a})]});var c=l[s-1].getColorTexture(0);e._previousLuminance=new a$z({context:t,colorTextures:[new L$17({context:t,width:c.width,height:c.height,pixelFormat:n,pixelDatatype:o,sampler:a})]}),e._framebuffers=l}function x$m(e){var t=e._commands;if(e$28(t)){for(var i=t.length,r=0;r<i;++r)t[r].shaderProgram.destroy();e._commands=void 0}}function F$h(e,t){var i;if(0===t)i={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{var r=e._framebuffers[t-1].getColorTexture(0);i={colorTexture:function(){return r},colorTextureDimensions:function(){return r.dimensions}}}return i.minMaxLuminance=function(){return e._minMaxLuminance},i.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},i}function S$d(e,t){var i="uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return i+=0===e?" vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \n return czm_luminance(color.rgb); \n":" return texture2D(colorTexture, v_textureCoordinates + offset).r; \n",i+="}\n\n",i+="uniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n float color = 0.0; \n float xStep = 1.0 / colorTextureDimensions.x; \n float yStep = 1.0 / colorTextureDimensions.y; \n int count = 0; \n for (int i = 0; i < 3; ++i) { \n for (int j = 0; j < 3; ++j) { \n vec2 offset; \n offset.x = -xStep + float(i) * xStep; \n offset.y = -yStep + float(j) * yStep; \n if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n continue; \n } \n color += sampleTexture(offset); \n ++count; \n } \n } \n if (count > 0) { \n color /= float(count); \n } \n",e===t-1&&(i+=" float previous = texture2D(previousLuminance, vec2(0.5)).r; \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n color = previous + (color - previous) / (60.0 * 1.5); \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),i+=" gl_FragColor = vec4(color); \n} \n"}function A$p(e,t){x$m(e);for(var i=e._framebuffers,r=i.length,n=new Array(r),o=0;o<r;++o)n[o]=t.createViewportQuadCommand(S$d(o,r),{framebuffer:i[o],uniformMap:F$h(e,o)});e._commands=n}e$k.loadImage=function(e,t,i){o$1u.defined("url",t);var r=t$S.createIfNeeded(t);return e$28(i)?r.fetchArrayBuffer():m$o.test(r.url)?k$R(r):p$h.test(r.url)?a$R(r):c$f.test(r.url)?(e.flipY=!0,B$E(r)):e$28(e.tileDiscardPolicy)?r.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):(e$28(e._customRequestHeaders)&&(r.headers=p$17(r.headers,e._customRequestHeaders)),r.fetchBlob())},e$k.prototype.onAlphaChanged=function(){},Object.defineProperties(b$n.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),b$n.prototype.getTileCredits=function(e,t,i){},b$n.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=B$a(this,e,t,i,r);if(e$28(a$Y.CREDENTIAL)&&(e$28(a$Y.CREDENTIAL._keymap[this._baseUrl])?n.url=a$Y.addTokenWithKey(this._baseUrl,n.url):n.url=a$Y.addToken(n.url)),r.quadKey=Y$a(e,t,i),!0===this._indexedDBSetting.isOpen&&!0===r.cacheEnable){if(e$28(this._indexedDBScheduler)){var o=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey);return e$28(o)?o$1q(o,(function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):e$k.loadImage(this,n)}return e$k.loadImage(this,n)}return e$k.loadImage(this,n)},b$n.prototype.pickFeatures=function(e,t,i,r,n){if(!this._ready)throw new t$Z("pickFeatures must not be called before the imagery provider is ready.");if(this.enablePickFeatures){var o,a,s,l=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(this._tilingScheme.projection instanceof n$1b)o=e$27.toDegrees(r),a=e$27.toDegrees(n),s="4326";else{var u=this._tilingScheme.projection.project(new t$W(r,n,0));o=u.x,a=u.y,s="3857"}var c="visible";e$28(this._layers)&&(c+=":"+this._layers);var h={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:o+","+a,mapExtent:l.west+","+l.south+","+l.east+","+l.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:s,layers:c};return this._resource.getDerivedResource({url:"identify",headers:this._customRequestHeaders,queryParameters:h}).fetchJson().then((function(e){var t=[],i=e.results;if(!e$28(i))return t;for(var r=0;r<i.length;++r){var n=i[r],o=new o$w;if(o.data=n,o.name=n.value,o.properties=n.attributes,o.configureDescriptionFromProperties(n.attributes),"esriGeometryPoint"===n.geometryType&&n.geometry){var a=n.geometry.spatialReference&&n.geometry.spatialReference.wkid?n.geometry.spatialReference.wkid:4326;if(4326===a||4283===a)o.position=t$W.fromDegrees(n.geometry.x,n.geometry.y,n.geometry.z);else if(102100===a||900913===a||3857===a){var s=new t$M;o.position=s.unproject(new t$X(n.geometry.x,n.geometry.y,n.geometry.z))}}t.push(o)}return t}))}},Object.defineProperties(a$m.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){var e=this._framebuffers;if(e$28(e))return e[e.length-1].getColorTexture(0)}}}),a$m.prototype.clear=function(e){var t=this._framebuffers;if(e$28(t)){var i=this._clearCommand;e$28(i)||(i=this._clearCommand=new r$11({color:new e$1S(0,0,0,0),framebuffer:void 0}));for(var r=t.length,n=0;n<r;++n)i.framebuffer=t[n],i.execute(e)}},a$m.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;(t!==this._width||i!==this._height)&&(this._width=t,this._height=i,D$m(this,e),A$p(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;var r=this._framebuffers,n=r[r.length-1];r[r.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance,this._previousLuminance=n},a$m.prototype.execute=function(e,t){this._colorTexture=t;var i=this._commands;if(e$28(i))for(var r=i.length,n=0;n<r;++n)i[n].execute(e)},a$m.prototype.isDestroyed=function(){return!1},a$m.prototype.destroy=function(){return v$l(this),x$m(this),i$Z(this)};var A$o={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},I$o=Object.freeze(A$o),e$j;function A$n(e){}function o$v(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");this._key=e$1O.getKey(e.key),this._resource=t$S.createIfNeeded(e.url),this._resource.appendForwardSlash(),this._tileProtocol=e.tileProtocol,this._mapStyle=u$Y(e.mapStyle,I$o.AERIAL),this._culture=u$Y(e.culture,""),this._tileDiscardPolicy=e.tileDiscardPolicy,e$28(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new A$n),this._proxy=e.proxy,this._credit=new r$1a('<a href="http://www.bing.com"><img src="'+o$v.logoUrl+'" title="Bing Imagery"/></a>'),this.defaultGamma=1,this._tilingScheme=new c$10({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=u$Y(e.maximumLevel,void 0),this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer();var t=this._tileProtocol;e$28(t)?t.length>0&&":"===t[t.length-1]&&(t=t.substr(0,t.length-1)):t="http:"===document.location.protocol?"http":"https";var i,r=this._resource.getDerivedResource({url:"REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:t}}),n=this;function o(e){if(1===e.resourceSets.length){var t=e.resourceSets[0].resources[0];n._tileWidth=t.imageWidth,n._tileHeight=t.imageHeight,n._maximumLevel=e$28(n._maximumLevel)?n._maximumLevel:t.zoomMax-1,n._imageUrlSubdomains=t.imageUrlSubdomains,n._imageUrlTemplate=t.imageUrl;var r=n._attributionList=t.imageryProviders;r||(r=n._attributionList=[]);for(var o=0,s=r.length;o<s;++o){var l=r[o];if(l.credit instanceof r$1a)break;l.credit=new r$1a(l.attribution);for(var u=l.coverageAreas,c=0,h=l.coverageAreas.length;c<h;++c){var d=u[c],f=d.bbox;d.bbox=new h$10(e$27.toRadians(f[1]),e$27.toRadians(f[0]),e$27.toRadians(f[3]),e$27.toRadians(f[2]))}}n._ready=!0,n._readyPromise.resolve(!0),l$13.handleSuccess(i)}else a()}function a(e){var t="An error occurred while accessing "+r.url+".";i=l$13.handleError(i,n,n._errorEvent,t,void 0,void 0,void 0,l),n._readyPromise.reject(new t$U(t))}var s=r.url;function l(){var e=r.fetchJsonp("jsonp");o$v._metadataCache[s]=e,e.then(o).otherwise(a)}var u=o$v._metadataCache[s];e$28(u)?u.then(o).otherwise(a):l()}A$n.prototype.isReady=function(){return!0},A$n.prototype.shouldDiscardImage=function(e){return A$n.EMPTY_IMAGE===e},Object.defineProperties(A$n,{EMPTY_IMAGE:{get:function(){return e$28(e$j)||((e$j=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e$j}}}),Object.defineProperties(o$v.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var z$h=new h$10;function B$9(e,t,i,r,n){var o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+i+r)%a.length;return e._resource.getDerivedResource({url:o,request:n,templateValues:{quadkey:o$v.tileXYToQuadKey(t,i,r),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}o$v.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new t$Z("getTileCredits must not be called before the imagery provider is ready.");var r=this._tilingScheme.tileXYToRectangle(e,t,i,z$h);return O$h(this._attributionList,i,r)},o$v.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=e$k.loadImage(this,B$9(this,e,t,i,r));if(e$28(n))return n.otherwise((function(e){return e$28(e.blob)&&0===e.blob.size?A$n.EMPTY_IMAGE:o$1q.reject(e)}))},o$v.prototype.pickFeatures=function(e,t,i,r,n){},o$v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;0!=(e&o)&&(a|=1),0!=(t&o)&&(a|=2),r+=a}return r},o$v.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];0!=(1&a)&&(t|=o),0!=(2&a)&&(i|=o)}return{x:t,y:i,level:r}},o$v._logoUrl=void 0,Object.defineProperties(o$v,{logoUrl:{get:function(){return e$28(o$v._logoUrl)||(o$v._logoUrl=n$17("Assets/Images/bing_maps_credit.png")),o$v._logoUrl},set:function(e){o$1u.defined("value",e),o$v._logoUrl=e}}});var K$d=new h$10;function O$h(e,t,i){++t;for(var r=[],n=0,o=e.length;n<o;++n){for(var a=e[n],s=a.coverageAreas,l=!1,u=0,c=a.coverageAreas.length;!l&&u<c;++u){var h=s[u];if(t>=h.zoomMin&&t<=h.zoomMax)e$28(h$10.intersection(i,h.bbox,K$d))&&(l=!0)}l&&r.push(a.credit)}return r}o$v._metadataCache={};var Z$e="uniform sampler2D u_MainTex;\nuniform vec2 u_MainTex_TexelSize;\nuniform float u_Threshold;\nuniform float u_Params;\nvarying vec2 v_textureCoordinates;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\nvec4 DownsampleBox13Tap(sampler2D samplerTex, vec2 uv, vec2 texelSize)\n{\nvec4 A = texture2D(samplerTex, uv + texelSize * vec2(-1.0, -1.0));\nvec4 B = texture2D(samplerTex, uv + texelSize * vec2( 0.0, -1.0));\nvec4 C = texture2D(samplerTex, uv + texelSize * vec2( 1.0, -1.0));\nvec4 D = texture2D(samplerTex, uv + texelSize * vec2(-0.5, -0.5));\nvec4 E = texture2D(samplerTex, uv + texelSize * vec2( 0.5, -0.5));\nvec4 F = texture2D(samplerTex, uv + texelSize * vec2(-1.0, 0.0));\nvec4 G = texture2D(samplerTex, uv );\nvec4 H = texture2D(samplerTex, uv + texelSize * vec2( 1.0, 0.0));\nvec4 I = texture2D(samplerTex, uv + texelSize * vec2(-0.5, 0.5));\nvec4 J = texture2D(samplerTex, uv + texelSize * vec2( 0.5, 0.5));\nvec4 K = texture2D(samplerTex, uv + texelSize * vec2(-1.0, 1.0));\nvec4 L = texture2D(samplerTex, uv + texelSize * vec2( 0.0, 1.0));\nvec4 M = texture2D(samplerTex, uv + texelSize * vec2( 1.0, 1.0));\nvec2 div = (1.0 / 4.0) * vec2(0.5, 0.125);\nvec4 o = (D + E + I + J) * div.x;\no += (A + B + G + F) * div.y;\no += (B + C + H + G) * div.y;\no += (F + G + L + K) * div.y;\no += (G + H + M + L) * div.y;\nreturn o;\n}\nvec4 QuadraticThreshold(vec4 color, float threshold, vec3 curve)\n{\nfloat br = max(max(color.r, color.g), color.b);\nfloat rq = clamp(br - curve.x, 0.0, curve.y);\nrq = curve.z * rq * rq;\ncolor *= max(rq, br - threshold) / max(br, 1.0e-4);\nreturn color;\n}\nvec4 Prefilter(vec4 color, vec2 uv)\n{\nfloat br = max(max(color.r, color.g), color.b);\nif(br < u_Threshold)\n{\ncolor = vec4(0.0);\n}\nreturn color;\n}\nvec4 SafeHDR(vec4 c)\n{\nreturn min(c, 65504.0);\n}\nvoid main()\n{\nvec4 color = DownsampleBox13Tap(u_MainTex, v_textureCoordinates, u_MainTex_TexelSize.xy);\ngl_FragColor = Prefilter(SafeHDR(color), v_textureCoordinates);\n}\n",$$c="uniform sampler2D u_MainTex;\nuniform vec2 u_MainTex_TexelSize;\nvarying vec2 v_textureCoordinates;\nvec4 DownsampleBox13Tap(sampler2D samplerTex, vec2 uv, vec2 texelSize)\n{\nvec4 A = texture2D(samplerTex, uv + texelSize * vec2(-1.0, -1.0));\nvec4 B = texture2D(samplerTex, uv + texelSize * vec2( 0.0, -1.0));\nvec4 C = texture2D(samplerTex, uv + texelSize * vec2( 1.0, -1.0));\nvec4 D = texture2D(samplerTex, uv + texelSize * vec2(-0.5, -0.5));\nvec4 E = texture2D(samplerTex, uv + texelSize * vec2( 0.5, -0.5));\nvec4 F = texture2D(samplerTex, uv + texelSize * vec2(-1.0, 0.0));\nvec4 G = texture2D(samplerTex, uv );\nvec4 H = texture2D(samplerTex, uv + texelSize * vec2( 1.0, 0.0));\nvec4 I = texture2D(samplerTex, uv + texelSize * vec2(-0.5, 0.5));\nvec4 J = texture2D(samplerTex, uv + texelSize * vec2( 0.5, 0.5));\nvec4 K = texture2D(samplerTex, uv + texelSize * vec2(-1.0, 1.0));\nvec4 L = texture2D(samplerTex, uv + texelSize * vec2( 0.0, 1.0));\nvec4 M = texture2D(samplerTex, uv + texelSize * vec2( 1.0, 1.0));\nvec2 div = (1.0 / 4.0) * vec2(0.5, 0.125);\nvec4 o = (D + E + I + J) * div.x;\no += (A + B + G + F) * div.y;\no += (B + C + H + G) * div.y;\no += (F + G + L + K) * div.y;\no += (G + H + M + L) * div.y;\nreturn o;\n}\nvec4 DownsampleBox4Tap(sampler2D samplerTex, vec2 uv, vec2 texelSize)\n{\nvec4 d = texelSize.xyxy * vec4(-1.0, -1.0, 1.0, 1.0);\nvec4 s;\ns = texture2D(samplerTex, uv + d.xy);\ns += texture2D(samplerTex, uv + d.zy);\ns += texture2D(samplerTex, uv + d.xw);\ns += texture2D(samplerTex, uv + d.zw);\nreturn s * (1.0 / 4.0);\n}\nvoid main()\n{\nvec4 color = DownsampleBox13Tap(u_MainTex, v_textureCoordinates, u_MainTex_TexelSize.xy);\ngl_FragColor = color;\n}\n",tt$5="uniform sampler2D u_MainTex;\nuniform sampler2D u_BloomTex;\nuniform vec2 u_MainTex_TexelSize;\nuniform float u_SampleScale;\nvarying vec2 v_textureCoordinates;\nvec4 Combine(vec4 bloom, vec2 uv)\n{\nvec4 color = texture2D(u_BloomTex, uv);\nreturn bloom + color;\n}\nvec4 UpsampleTent(sampler2D samplerTex, vec2 uv, vec2 texelSize, vec4 sampleScale)\n{\nvec4 d = texelSize.xyxy * vec4(1.0, 1.0, -1.0, 0.0) * sampleScale;\nvec4 s;\ns = texture2D(samplerTex, uv - d.xy);\ns += texture2D(samplerTex, uv - d.wy) * 2.0;\ns += texture2D(samplerTex, uv - d.zy);\ns += texture2D(samplerTex, uv + d.zw) * 2.0;\ns += texture2D(samplerTex, uv ) * 4.0;\ns += texture2D(samplerTex, uv + d.xw) * 2.0;\ns += texture2D(samplerTex, uv + d.zy);\ns += texture2D(samplerTex, uv + d.wy) * 2.0;\ns += texture2D(samplerTex, uv + d.xy);\nreturn s * (1.0 / 16.0);\n}\nvec4 UpsampleBox(sampler2D samplerTex, vec2 uv, vec2 texelSize, vec4 sampleScale)\n{\nvec4 d = texelSize.xyxy * vec4(-1.0, -1.0, 1.0, 1.0) * (sampleScale * 0.5);\nvec4 s;\ns = texture2D(samplerTex, uv + d.xy);\ns += texture2D(samplerTex, uv + d.zy);\ns += texture2D(samplerTex, uv + d.xw);\ns += texture2D(samplerTex, uv + d.zw);\nreturn s * (1.0 / 4.0);\n}\nvoid main()\n{\nvec4 bloom = UpsampleTent(u_MainTex, v_textureCoordinates, u_MainTex_TexelSize.xy, vec4(u_SampleScale));\ngl_FragColor = Combine(bloom, v_textureCoordinates);\n}\n",L$o=16;function e$i(){this._fbo=void 0,this._downSamplePassState=new n$p,this._upSamplePassState=new n$p,this._show=!1,this._context=void 0,this.anamorphicRatio=0,this.diffusion=7,this._iterations=0,this._sampleScale=1,this._dirtTileOffset=new e$25(1,1,0,0),this._shaderSettings=new t$X,this._bloomColor=new t$X(1,1,1),this._threshold=0,this._softKnee=.5,this._clamp=65472,this._params=1,this._intensity=1.34,this._dirtIntensity=0,this._dirtTexUrl=n$17("Assets/Textures/NoiseAndGrain.png"),this._dirtTexture=void 0,this._lastUpFBO=void 0,this._Pyramid=[];for(var e=0;e<L$o;e++){this._Pyramid.push({})}this._clearCommand=new r$11({color:new e$1S})}Object.defineProperties(e$i.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(e$28(this._owner)&&this._owner.bloomShowChange(e),this._show=e)}},bloomIntensity:{get:function(){return this._intensity},set:function(e){this._intensity=e}},bloomDirtTexIntensity:{get:function(){return this._dirtIntensity},set:function(e){this._dirtIntensity=e}},threshold:{get:function(){return this._threshold},set:function(e){this._threshold=e}}}),e$i.prototype.clear=function(e,t){for(var i=0;i<this._iterations;i++){var r=this._clearCommand;r.framebuffer=this._Pyramid[i].downSampleFBO,e$1S.clone(u$Y(t,e$1S.BLACK),r.color),r.execute(e),r.framebuffer=this._Pyramid[i].upSampleFBO,e$1S.clone(u$Y(t,e$1S.BLACK),r.color),r.execute(e)}};var h$j=new o$1k;e$i.prototype.execute=function(e,t){var i=this,r=this._fbo;e$28(this._context)&&this._context.numPostEffectFilterObject>0&&(r=this._scene._postEffectFilterFramebuffer.renderTexture._fb);for(var n=0;n<this._iterations;n++){var o=this._Pyramid[n].downCommand;h$j.x=1/r.getColorTexture(0).width,h$j.y=1/r.getColorTexture(0).height,o.uniformMap.u_MainTex=function(){return r.getColorTexture(0)},o.uniformMap.u_MainTex_TexelSize=function(){return h$j},o.uniformMap.u_Threshold=function(){return i._threshold},o.uniformMap.u_Params=function(){return i._params},o.execute(e,this._downSamplePassState),r=this._Pyramid[n].downSampleFBO}var a=this._Pyramid[this._iterations-1].downSampleFBO;for(n=this._iterations-2;n>=0;n--){var s=this._Pyramid[n].downSampleFBO,l=this._Pyramid[n].upSampleFBO,u=this._Pyramid[n].upCommand;h$j.x=1/a.getColorTexture(0).width,h$j.y=1/a.getColorTexture(0).height,u.uniformMap.u_BloomTex=function(){return s.getColorTexture(0)},u.uniformMap.u_MainTex=function(){return a.getColorTexture(0)},u.uniformMap.u_MainTex_TexelSize=function(){return h$j},u.uniformMap.u_SampleScale=function(){return i._sampleScale},u.execute(e,this._downSamplePassState),a=l}this._lastUpFBO=a};var et$5=new f$10;e$i.prototype.update=function(e,t,i){this._context=t.context,this._downSamplePassState.context=t.context,this._upSamplePassState.context=t.context,this._scene=i;var r=e.drawingBufferWidth,n=e.drawingBufferHeight,o=this;e$28(this._dirtTexture)||o$1q(t$D(o._dirtTexUrl),(function(t){o._dirtTexture=new L$17({context:e,source:t,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE})}));var a=e$27.clamp(this.anamorphicRatio,-1,1),s=a<0?-a:0,l=a>0?a:0,u=Math.floor(r/(2-s)),c=Math.floor(n/(2-l)),h=Math.max(u,c),d=Math.log(h)/Math.log(2)+Math.min(this.diffusion,10)-10,f=Math.floor(d),p=e$27.clamp(f,1,L$o),_=!1;p!=this._iterations&&(this._iterations=p,_=!0),this._sampleScale=.5+d-f;var m=1;e$28(this._dirtTexture)&&(m=this._dirtTexture.width/this._dirtTexture.height);var $=e.drawingBufferWidth/e.drawingBufferHeight;m>$?(this._dirtTileOffset.x=$/m,this._dirtTileOffset.z=.5*(1-this._dirtTileOffset.x)):$>m&&(this._dirtTileOffset.y=m/$,this._dirtTileOffset.w=.5*(1-this._dirtTileOffset.y));var g=Math.exp(this._intensity/10*.6931471805599453)-1;this._shaderSettings.x=this._sampleScale,this._shaderSettings.y=g,this._shaderSettings.z=this._dirtIntensity;var v=this._Pyramid[0].downSampleFBO,y=e$28(v)&&v.getColorTexture(0)||void 0;if(!e$28(y)||y.width!==u||y.height!==c||_){this.destroyFBO();for(var x=0;x<this._iterations;x++){var b,w={};b=0==x?e.createViewportQuadCommand(Z$e,{uniformMap:w,owner:this}):e.createViewportQuadCommand($$c,{uniformMap:w,owner:this});var C=e.createViewportQuadCommand(tt$5,{uniformMap:w,owner:this});this._Pyramid[x].downCommand=b,this._Pyramid[x].upCommand=C;var T=et$5;T.width=u,T.height=c;var S=u$R.fromCache({viewport:T});b.renderState=S,C.renderState=S;var E=new a$z({context:e,colorTextures:[new L$17({context:e,width:u,height:c,pixelDatatype:y$U.FLOAT})]}),A=new a$z({context:e,colorTextures:[new L$17({context:e,width:u,height:c,pixelDatatype:y$U.FLOAT})]});this._Pyramid[x].downSampleFBO=E,this._Pyramid[x].upSampleFBO=A,b.framebuffer=E,C.framebuffer=A,u/=2,u=Math.max(u,1),c=Math.max(c/2,1)}}},e$i.prototype.gammaToLinearSpace=function(e){return e*(e*(.305306011*e+.682171111)+.012522878)},e$i.prototype.setInputFBO=function(e){this._fbo=e},e$i.prototype.getBloomTexture=function(){return this._lastUpFBO.getColorTexture(0)},e$i.prototype.getBloomDirtTexture=function(){return e$28(this._dirtTexture)?this._dirtTexture:this._context.defaultTexture},e$i.prototype.getBloomTextureTexelSize=function(){return h$j.x=1/this._lastUpFBO.getColorTexture(0).width,h$j.y=1/this._lastUpFBO.getColorTexture(0).height,h$j},e$i.prototype.getDirtTileOffset=function(){return this._dirtTileOffset},e$i.prototype.getBloomSettings=function(){return this._shaderSettings},e$i.prototype.getBloomColor=function(){return this._bloomColor},e$i.prototype.isDestroyed=function(){return!1},e$i.prototype.destroyFBO=function(){for(var e=0;e<this._iterations;e++)if(e$28(this._Pyramid[e].downSampleFBO)){var t=this._Pyramid[e].downSampleFBO,i=this._Pyramid[e].upSampleFBO;t.destroy(),i.destroy()}},e$i.prototype.destroy=function(){this.destroyFBO();for(var e=0;e<this._iterations;e++){var t=this._Pyramid[e].downCommand,i=this._Pyramid[e].upCommand;t.shaderProgram.destroy(),i.shaderProgram.destroy()}return i$Z(this)};var y$m=new t$X(1,1,1);function a$l(e){e=u$Y(e,y$m),o$1u.defined("dimensions",e),o$1u.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),o$1u.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=t$X.clone(e)}Object.defineProperties(a$l.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){o$1u.defined("value",e),o$1u.typeOf.number.greaterThanOrEquals("value.x",e.x,0),o$1u.typeOf.number.greaterThanOrEquals("value.y",e.y,0),o$1u.typeOf.number.greaterThanOrEquals("value.z",e.z,0),t$X.clone(e,this._dimensions)}}});var l$k=new t$X;a$l.prototype.emit=function(e){var t=this._dimensions,i=t$X.multiplyByScalar(t,.5,l$k),r=e$27.randomBetween(-i.x,i.x),n=e$27.randomBetween(-i.y,i.y),o=e$27.randomBetween(-i.z,i.z);e.position=t$X.fromElements(r,n,o,e.position),e.velocity=t$X.normalize(e.position,e.velocity)};var h$i="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 t$9(){this._colorTexture=void 0,this._drawCommand=void 0}function x$l(e,t,i){const r=t.createViewportQuadCommand(h$i,{framebuffer:i,renderState:u$R.fromCache({viewport:new f$10(0,0,256,256)})});e._drawCommand=r}Object.defineProperties(t$9.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),t$9.prototype.update=function(e){if(!e$28(this._colorTexture)){const t=e.context,i=new L$17({context:t,width:256,height:256,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:n$Y.NEAREST});this._colorTexture=i;const r=new a$z({context:t,colorTextures:[i],destroyAttachments:!1});x$l(this,t,r),this._drawCommand.execute(t),r.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},t$9.prototype.isDestroyed=function(){return!1},t$9.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),i$Z(this)};var e$h={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},K$c=Object.freeze(e$h);function d$q(e,t){var i=e;return e$28(t)&&(i+="+"+t),i}function S$c(e,t){o$1k.clone(e.distance.startPosition,t.distance.startPosition),o$1k.clone(e.distance.endPosition,t.distance.endPosition),o$1k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),o$1k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function A$m(e,t,i){var r=d$q(K$c.PINCH,t),n=e._update,o=e._isDown,a=e._eventStartPosition,s=e._pressTime,l=e._releaseTime;n[r]=!0,o[r]=!1,a[r]=new o$1k;var u=e._movement[r];e$28(u)||(u=e._movement[r]={}),u.distance={startPosition:new o$1k,endPosition:new o$1k},u.angleAndHeight={startPosition:new o$1k,endPosition:new o$1k},u.prevAngle=0,e._eventHandler.setInputAction((function(t){e._buttonsDown++,o[r]=!0,s[r]=new Date,o$1k.lerp(t.position1,t.position2,.5,a[r])}),J$P.PINCH_START,t),e._eventHandler.setInputAction((function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[r]=!1,l[r]=new Date}),J$P.PINCH_END,t),e._eventHandler.setInputAction((function(e){if(o[r]){n[r]?(S$c(e,u),n[r]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(o$1k.clone(e.distance.endPosition,u.distance.endPosition),o$1k.clone(e.angleAndHeight.endPosition,u.angleAndHeight.endPosition));for(var t=u.angleAndHeight.endPosition.x,a=u.prevAngle,s=2*Math.PI;t>=a+Math.PI;)t-=s;for(;t<a-Math.PI;)t+=s;u.angleAndHeight.endPosition.x=-t*i.clientWidth/12,u.angleAndHeight.startPosition.x=-a*i.clientWidth/12}}),J$P.PINCH_MOVE,t)}function M$l(e,t){var i=d$q(K$c.WHEEL,t),r=e._update;r[i]=!0;var n=e._movement[i];e$28(n)||(n=e._movement[i]={}),n.startPosition=new o$1k,n.endPosition=new o$1k,e._eventHandler.setInputAction((function(e){var t=15*e$27.toRadians(e);r[i]?(o$1k.clone(o$1k.ZERO,n.startPosition),n.endPosition.x=0,n.endPosition.y=t,r[i]=!1):n.endPosition.y=n.endPosition.y+t}),J$P.WHEEL,t)}function H$l(e,t,i){var r=d$q(i,t),n=e._isDown,o=e._eventStartPosition,a=e._pressTime,s=e._releaseTime;n[r]=!1,o[r]=new o$1k;var l,u,c=e._lastMovement[r];e$28(c)||(c=e._lastMovement[r]={startPosition:new o$1k,endPosition:new o$1k,valid:!1}),i===K$c.LEFT_DRAG?(l=J$P.LEFT_DOWN,u=J$P.LEFT_UP):i===K$c.RIGHT_DRAG?(l=J$P.RIGHT_DOWN,u=J$P.RIGHT_UP):i===K$c.MIDDLE_DRAG&&(l=J$P.MIDDLE_DOWN,u=J$P.MIDDLE_UP),e._eventHandler.setInputAction((function(t){e._buttonsDown++,c.valid=!1,n[r]=!0,a[r]=new Date,o$1k.clone(t.position,o[r])}),l,t),e._eventHandler.setInputAction((function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),n[r]=!1,s[r]=new Date}),u,t)}function T$f(e,t){o$1k.clone(e.startPosition,t.startPosition),o$1k.clone(e.endPosition,t.endPosition)}function y$l(e,t){var i=e._update,r=e._movement,n=e._lastMovement,o=e._isDown;for(var a in K$c)if(K$c.hasOwnProperty(a)){var s=K$c[a];if(e$28(s)){var l=d$q(s,t);i[l]=!0,e$28(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new o$1k,endPosition:new o$1k,valid:!1}),e$28(e._movement[l])||(e._movement[l]={startPosition:new o$1k,endPosition:new o$1k})}}e._eventHandler.setInputAction((function(a){for(var s in K$c)if(K$c.hasOwnProperty(s)){var l=K$c[s];if(e$28(l)){var u=d$q(l,t);o[u]&&(i[u]?(T$f(r[u],n[u]),n[u].valid=!0,T$f(a,r[u]),i[u]=!1):o$1k.clone(a.endPosition,r[u].endPosition))}}o$1k.clone(a.endPosition,e._currentMousePosition)}),J$P.MOUSE_MOVE,t)}function L$n(e){switch(e){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}}function G$n(e){document.addEventListener("keydown",(function(t){var i=L$n(t.keyCode);typeof i<"u"&&(e._flags[i]=!0)}),!1)}function W$g(e){document.addEventListener("keyup",(function(t){var i=L$n(t.keyCode);typeof i<"u"&&(e._flags[i]=!1)}),!1)}function l$j(e){if(!e$28(e))throw new t$Z("canvas is required.");for(var t in this._eventHandler=new g$G(e,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new o$1k,M$l(this,void 0),A$m(this,void 0,e),H$l(this,void 0,K$c.LEFT_DRAG),H$l(this,void 0,K$c.RIGHT_DRAG),H$l(this,void 0,K$c.MIDDLE_DRAG),y$l(this,void 0),Na$2)if(Na$2.hasOwnProperty(t)){var i=Na$2[t];e$28(i)&&(M$l(this,i),A$m(this,i,e),H$l(this,i,K$c.LEFT_DRAG),H$l(this,i,K$c.RIGHT_DRAG),H$l(this,i,K$c.MIDDLE_DRAG),y$l(this,i))}this._flags={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1},G$n(this),W$g(this)}function r$m(e,t,i,r,n){this.featurePropertiesDirty=!1}function a$k(e){o$1u.typeOf.object("options",e),o$1u.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}function h$h(){}Object.defineProperties(l$j.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[d$q(K$c.WHEEL)]&&this._update[d$q(K$c.WHEEL,Na$2.SHIFT)]&&this._update[d$q(K$c.WHEEL,Na$2.CTRL)]&&this._update[d$q(K$c.WHEEL,Na$2.ALT)]);return this._buttonsDown>0||e}}}),l$j.prototype.isMoving=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t);return!this._update[i]},l$j.prototype.getMovement=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t);return this._movement[i]},l$j.prototype.getLastMovement=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t),r=this._lastMovement[i];if(r.valid)return r},l$j.prototype.isButtonDown=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t);return this._isDown[i]},l$j.prototype.getStartMousePosition=function(e,t){if(!e$28(e))throw new t$Z("type is required.");if(e===K$c.WHEEL)return this._currentMousePosition;var i=d$q(e,t);return this._eventStartPosition[i]},l$j.prototype.getButtonPressTime=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t);return this._pressTime[i]},l$j.prototype.getButtonReleaseTime=function(e,t){if(!e$28(e))throw new t$Z("type is required.");var i=d$q(e,t);return this._releaseTime[i]},l$j.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},l$j.prototype.isDestroyed=function(){return!1},l$j.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),i$Z(this)},Object.defineProperties(r$m.prototype,{featuresLength:{get:function(){t$Z.throwInstantiationError()}},pointsLength:{get:function(){t$Z.throwInstantiationError()}},trianglesLength:{get:function(){t$Z.throwInstantiationError()}},geometryByteLength:{get:function(){t$Z.throwInstantiationError()}},texturesByteLength:{get:function(){t$Z.throwInstantiationError()}},batchTableByteLength:{get:function(){t$Z.throwInstantiationError()}},innerContents:{get:function(){t$Z.throwInstantiationError()}},readyPromise:{get:function(){t$Z.throwInstantiationError()}},tileset:{get:function(){t$Z.throwInstantiationError()}},tile:{get:function(){t$Z.throwInstantiationError()}},url:{get:function(){t$Z.throwInstantiationError()}},batchTable:{get:function(){t$Z.throwInstantiationError()}}}),r$m.prototype.hasProperty=function(e,t){t$Z.throwInstantiationError()},r$m.prototype.getFeature=function(e){t$Z.throwInstantiationError()},r$m.prototype.applyDebugSettings=function(e,t){t$Z.throwInstantiationError()},r$m.prototype.applyStyle=function(e){t$Z.throwInstantiationError()},r$m.prototype.update=function(e,t){t$Z.throwInstantiationError()},r$m.prototype.isDestroyed=function(){t$Z.throwInstantiationError()},r$m.prototype.destroy=function(){t$Z.throwInstantiationError()};var o$u={stack:new r$U,stackMaximumLength:0};function d$p(e){return e._visible&&e._inRequestVolume}function m$n(e){return e.hasEmptyContent||e.hasTilesetContent}function v$k(e){return!m$n(e)&&e.contentUnloaded}function T$e(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:(t.hasEmptyContent,!0))}function g$k(e,t,i,r){for(var n=t.children,o=n.length,a=0;a<o;++a){var s=n[a];s.updateVisibility(r),d$p(s)&&i.push(s)}}function y$k(e,t){(v$k(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function C$g(e,t){e._cache.touch(t)}function x$k(e){++e.statistics.visited}function _$j(e,t,i){t.contentAvailable&&t.contentVisibility(i)!==pt$a.OUTSIDE&&e._selectedTiles.push(t)}function u$h(e,t){this._conditionsExpression=l$1e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,g$j(this,t)}function l$i(e,t){this.condition=e,this.expression=t}function g$j(e,t){var i=[],r=e._conditions;if(e$28(r)){for(var n=r.length,o=0;o<n;++o){var a=r[o],s=String(a[0]),l=String(a[1]);i.push(new l$i(new L$J(s,t),new L$J(l,t)))}e._runtimeConditions=i}}function d$o(e){var t;(this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._pbrMaterialIndex=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,"string"==typeof e||e instanceof t$S)?t=t$S.createIfNeeded(e).fetchJson(e):t=o$1q.resolve(e);var i=this;this._readyPromise=t.then((function(e){return m$m(i,e),i}))}function m$m(e,t){t=u$Y(l$1e(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.pbrMaterialIndex=t.pbrMaterialIndex;var i={};if(e$28(t.meta)){var r=t.defines,n=u$Y(t.meta,u$Y.EMPTY_OBJECT);for(var o in n)n.hasOwnProperty(o)&&(i[o]=new L$J(n[o],r))}e._meta=i,e._ready=!0}function n$m(e,t){var i=u$Y(e._style,u$Y.EMPTY_OBJECT).defines;if(e$28(t))return"boolean"==typeof t||"number"==typeof t?new L$J(String(t)):"string"==typeof t?new L$J(t,i):e$28(t.conditions)?new u$h(t,i):t}function r$l(e){if(e$28(e))return e$28(e.expression)?e.expression:e$28(e.conditionsExpression)?l$1e(e.conditionsExpression,!0):e}function I$n(e){if(!e$28((e=u$Y(e,{})).url))throw new t$Z("options.url is required.");this._baseUrl=e.url;var t=t$S.createIfNeeded(e.url);if(t.appendForwardSlash(),e$28(e.token))t.setQueryParameters({token:e.token});else if(e$28(a$Y.CREDENTIAL))if(e$28(a$Y.CREDENTIAL._keymap[this._baseUrl])){var i=a$Y.CREDENTIAL._keymap[this._baseUrl].type,r=a$Y.CREDENTIAL._keymap[this._baseUrl].value,n='{"tokenName": "value"}'.replace("tokenName",i).replace("value",r),o=JSON.parse(n);t.setQueryParameters(o)}else{(n={})[a$Y.CREDENTIAL.name]=a$Y.CREDENTIAL.value,t.setQueryParameters(n)}this._resource=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=u$Y(e.tilingScheme,new g$12({ellipsoid:e.ellipsoid})),this._tilingSchemeCustomized=e$28(e.tilingScheme),this._useTiles=u$Y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=u$Y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._zoomOffset=e.zoomOffset,this._coordUnit="DEGREE",this._customRequestHeaders=e.customRequestHeaders,this._beginLevel=u$Y(e.beginLevel,0);var a=e.credit;"string"==typeof a&&(a=new r$1a(a)),this._credit=a,this.enablePickFeatures=u$Y(e.enablePickFeatures,!0),this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer();var s,l=this,u=e.url;function c(t){l._tilingScheme instanceof g$12&&"esriMeters"===t.units&&(l._coordUnit="METER");var i=t.tileInfo;if(l.wkid=t.spatialReference.wkid,l._tilingSchemeCustomized&&l._tilingScheme instanceof g$12&&e$28(i)&&(l._tilingScheme=new g$12({tileInfo:{origin:{x:i.origin.x,y:i.origin.y},cols:i.cols,rows:i.rows},resolutions:i.lods.map((function(e){return e.resolution})),dataBounds:{west:t.fullExtent.xmin,south:t.fullExtent.ymin,east:t.fullExtent.xmax,north:t.fullExtent.ymax}})),"DEGREE"===l._coordUnit)if(e$28(i)){if(l._tileWidth=i.rows,l._tileHeight=i.cols,!l._tilingSchemeCustomized||!e$28(l.wkid))if(4326===t.tileInfo.spatialReference.wkid)l._tilingScheme=new g$12({ellipsoid:e.ellipsoid,tileInfo:t.tileInfo});else if(4490===t.tileInfo.spatialReference.wkid){if(e$28(e.suggest)&&e.suggest){var r=Math.ceil((t.fullExtent.xmax-t.fullExtent.xmin)/(t.tileInfo.lods[0].resolution*t.tileInfo.cols)),n=Math.ceil((t.fullExtent.ymax-t.fullExtent.ymin)/(t.tileInfo.lods[0].resolution*t.tileInfo.rows));l._tilingScheme=new g$12({ellipsoid:e.ellipsoid,tileInfo:t.tileInfo,rectangle:new h$10(e$27.toRadians(t.fullExtent.xmin),e$27.toRadians(t.fullExtent.ymin),e$27.toRadians(t.fullExtent.xmax),e$27.toRadians(t.fullExtent.ymax)),origin:new o$1k(e$27.toRadians(t.tileInfo.origin.x),e$27.toRadians(t.tileInfo.origin.y)),numberOfLevelZeroTilesX:r,numberOfLevelZeroTilesY:n}),l._tilingScheme._suggest=!0}else{if(t.tileInfo.lods.length>0&&0!==t.tileInfo.lods[0].level)for(;t.tileInfo.lods[0].level>0;){var o=t.tileInfo.lods[0];t.tileInfo.lods.unshift({level:o.level-1,resolution:2*o.resolution,scale:2*o.scale})}l._tilingScheme=new g$12({ellipsoid:e.ellipsoid,tileInfo:t.tileInfo})}l._tilingScheme._beginLevel=l._beginLevel}l._useTiles=!0,e$28(t.fullExtent)&&(l._rectangle=h$10.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax))}else l._useTiles=!1,e$28(t.fullExtent)?l._rectangle=h$10.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax):l._rectangle=l._tilingScheme._rectangle;else{var a=new t$X(t.fullExtent.xmin,t.fullExtent.ymin,0),u=new t$X(t.fullExtent.xmax,t.fullExtent.ymax,0);a.x>20037508.342789244&&(t$X.globalOffset.x=20037508.342789244*Math.floor(a.x/20037508.342789244),a.x=a.x-t$X.globalOffset.x,t.fullExtent.xmin=a.x,e$28(i)&&(t.tileInfo.origin.x=t.tileInfo.origin.x-t$X.globalOffset.x)),a.y>10018754.171394622&&(t$X.globalOffset.y=20037508.342789244*Math.floor((a.y+10018754.171394622)/20037508.342789244),a.y=a.y-t$X.globalOffset.y,t.fullExtent.ymin=a.y,e$28(i)&&(t.tileInfo.origin.y=t.tileInfo.origin.y-t$X.globalOffset.y)),t.fullExtent.xmax=Math.min(20037508.342789244,u.x-t$X.globalOffset.x),t.fullExtent.ymax=Math.min(20037508.342789244,u.y-t$X.globalOffset.y);var c=new t$X(t.fullExtent.xmin,t.fullExtent.ymin,0),h=new t$X(t.fullExtent.xmax,t.fullExtent.ymax,0);if(e$28(i)){if(!l._tilingSchemeCustomized||!e$28(l.wkid)){var d=102100===t.fullExtent.spatialReference.wkid||102113===t.fullExtent.spatialReference.wkid,f=[];if(e$28(i.lods))for(var p=0;p<i.lods.length;p++)f.push(i.lods[p].resolution);l._tilingScheme=new w$J({projection:d?new t$M:new n$1b,ellipsoid:e.ellipsoid,tileInfo:t.tileInfo,dataBounds:new h$10(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax),resolutions:f.length>0?f:void 0});a=new t$X(t.fullExtent.xmin,t.fullExtent.ymin,0),u=new t$X(t.fullExtent.xmax,t.fullExtent.ymax,0);var _=l._tilingScheme._projection.unproject(a),m=l._tilingScheme._projection.unproject(u);l._rectangle=new h$10(_.longitude,_.latitude,m.longitude,m.latitude),l._useTiles=!0}}else l._useTiles=!1,l._tilingScheme=new w$J({ellipsoid:e.ellipsoid,rectangleSouthwestInMeters:c,rectangleNortheastInMeters:h}),l._rectangle=l._tilingScheme._rectangle}e$28(i)&&(l._zoomOffset?l._maximumLevel=20:l._maximumLevel=t.tileInfo.lods.length-1,e$28(l._tilingScheme._resolutions)&&(l._minimumLevel=l._tilingScheme._beginLevel,l._maximumLevel=l._minimumLevel+l._tilingScheme._resolutions.length-1),e$28(l._tileDiscardPolicy)||(l._tileDiscardPolicy=new u$i({missingImageUrl:G$m(l,0,0,l._maximumLevel).url,pixelsToCheck:[new o$1k(0,0),new o$1k(200,20),new o$1k(20,200),new o$1k(80,110),new o$1k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))),e$28(t.copyrightText)&&t.copyrightText.length>0&&(l._credit=new r$1a(t.copyrightText)),l._ready=!0,l._readyPromise.resolve(!0),l$13.handleSuccess(s)}function h(e){var t="An error occurred while accessing "+l._resource.url+".";s=l$13.handleError(s,l,l._errorEvent,t,void 0,void 0,void 0,d),l._readyPromise.reject(new t$U(t))}function d(){o$1q(l._resource.getDerivedResource({queryParameters:{f:"json",headers:l._customRequestHeaders}}).fetchJson(),c,h)}l.tablename=e.url,new l$11({name:u}).then((function(e){e.checkObjectStoreExit(l.tablename)?l._indexedDBScheduler=e:e.createObjectStore(l.tablename).then((function(){l._indexedDBScheduler=e}))})),l._indexedDBSetting={isOpen:!1,clear:function(){l._indexedDBScheduler.clear(l.tablename)},cache:[]},this._useTiles?d():(this._ready=!0,this._readyPromise.resolve(!0))}function G$m(e,t,i,r,n){var o;if(e$28(e._tilingScheme._resolutions)&&(r-=e._tilingScheme._beginLevel),e._useTiles)e.zoomOffset&&(r-=parseInt(e.zoomOffset)),o=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,headers:e._customRequestHeaders,request:n});else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r);"METER"===e._coordUnit&&(t$X.globalOffset.x>0||t$X.globalOffset.y)&&(a.west+=t$X.globalOffset.x,a.east+=t$X.globalOffset.x,a.south+=t$X.globalOffset.y,a.north+=t$X.globalOffset.y);var s={bbox:a.west+","+a.south+","+a.east+","+a.north,size:e._tileWidth+","+e._tileHeight,format:"png",transparent:!0,f:"image"};e.wkid&&(s.imageSR=s.bboxSR=e.wkid),e.layers&&(s.layers="show:"+e.layers),e.layerDefs&&(s.layerDefs=e.layerDefs),e.time&&(s.time=e.time),o=e._resource.getDerivedResource({url:"export",headers:e._customRequestHeaders,request:n,queryParameters:s})}return o||null}function ee$9(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function u$g(e,t,i,r){e=u$Y(e,1),o$1u.typeOf.number.greaterThan("radius",e,0),this._radius=u$Y(e,1),this._innerRadius=u$Y(t,0),this._startAngle=u$Y(i,0),this._endAngle=u$Y(r,e$27.TWO_PI)}h$h.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e._hasMixedContent=!1;var i=!0,r=e.root;if(r.updateVisibility(t),!d$p(r))return i;var n=o$u.stack;for(n.push(e.root);n.length>0;){o$u.stackMaximumLength=Math.max(o$u.stackMaximumLength,n.length);var o=n.pop(),a=o.refine===f$H.ADD,s=o.refine===f$H.REPLACE,l=T$e(e,o);l&&g$k(e,o,n,t),(a||s&&!l)&&(y$k(e,o),_$j(e,o,t),!m$n(o)&&!o.contentAvailable&&(i=!1)),x$k(e),C$g(e,o)}return o$u.stack.trim(o$u.stackMaximumLength),i},Object.defineProperties(u$h.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),u$h.prototype.evaluate=function(e,t){var i=this._runtimeConditions;if(e$28(i))for(var r=i.length,n=0;n<r;++n){var o=i[n];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}},u$h.prototype.evaluateColor=function(e,t){var i=this._runtimeConditions;if(e$28(i))for(var r=i.length,n=0;n<r;++n){var o=i[n];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}},u$h.prototype.getShaderFunction=function(e,t,i,r){var n=this._runtimeConditions;if(e$28(n)&&0!==n.length){for(var o="",a=n.length,s=0;s<a;++s){var l=n[s];o+=" "+(0===s?"if":"else if")+" ("+l.condition.getShaderExpression(t,i)+") \n { \n return "+l.expression.getShaderExpression(t,i)+"; \n } \n"}return o=r+" "+e+"() \n{ \n"+o+" return "+r+"(1.0); \n} \n"}},Object.defineProperties(d$o.prototype,{style:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._show},set:function(e){this._show=n$m(this,e),this._style.show=r$l(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._color},set:function(e){this._color=n$m(this,e),this._style.color=r$l(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointSize},set:function(e){this._pointSize=n$m(this,e),this._style.pointSize=r$l(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointOutlineColor},set:function(e){this._pointOutlineColor=n$m(this,e),this._style.pointOutlineColor=r$l(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=n$m(this,e),this._style.pointOutlineWidth=r$l(this._pointOutlineWidth)}},labelColor:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelColor},set:function(e){this._labelColor=n$m(this,e),this._style.labelColor=r$l(this._labelColor)}},labelOutlineColor:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelOutlineColor},set:function(e){this._labelOutlineColor=n$m(this,e),this._style.labelOutlineColor=r$l(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=n$m(this,e),this._style.labelOutlineWidth=r$l(this._labelOutlineWidth)}},font:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._font},set:function(e){this._font=n$m(this,e),this._style.font=r$l(this._font)}},labelStyle:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelStyle},set:function(e){this._labelStyle=n$m(this,e),this._style.labelStyle=r$l(this._labelStyle)}},labelText:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelText},set:function(e){this._labelText=n$m(this,e),this._style.labelText=r$l(this._labelText)}},backgroundColor:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundColor},set:function(e){this._backgroundColor=n$m(this,e),this._style.backgroundColor=r$l(this._backgroundColor)}},backgroundPadding:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundPadding},set:function(e){this._backgroundPadding=n$m(this,e),this._style.backgroundPadding=r$l(this._backgroundPadding)}},backgroundEnabled:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._backgroundEnabled},set:function(e){this._backgroundEnabled=n$m(this,e),this._style.backgroundEnabled=r$l(this._backgroundEnabled)}},scaleByDistance:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._scaleByDistance},set:function(e){this._scaleByDistance=n$m(this,e),this._style.scaleByDistance=r$l(this._scaleByDistance)}},translucencyByDistance:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._translucencyByDistance},set:function(e){this._translucencyByDistance=n$m(this,e),this._style.translucencyByDistance=r$l(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=n$m(this,e),this._style.distanceDisplayCondition=r$l(this._distanceDisplayCondition)}},heightOffset:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._heightOffset},set:function(e){this._heightOffset=n$m(this,e),this._style.heightOffset=r$l(this._heightOffset)}},anchorLineEnabled:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=n$m(this,e),this._style.anchorLineEnabled=r$l(this._anchorLineEnabled)}},anchorLineColor:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._anchorLineColor},set:function(e){this._anchorLineColor=n$m(this,e),this._style.anchorLineColor=r$l(this._anchorLineColor)}},image:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._image},set:function(e){this._image=n$m(this,e),this._style.image=r$l(this._image)}},disableDepthTestDistance:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=n$m(this,e),this._style.disableDepthTestDistance=r$l(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._horizontalOrigin},set:function(e){this._horizontalOrigin=n$m(this,e),this._style.horizontalOrigin=r$l(this._horizontalOrigin)}},verticalOrigin:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._verticalOrigin},set:function(e){this._verticalOrigin=n$m(this,e),this._style.verticalOrigin=r$l(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=n$m(this,e),this._style.labelHorizontalOrigin=r$l(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=n$m(this,e),this._style.labelVerticalOrigin=r$l(this._labelVerticalOrigin)}},pbrMaterialIndex:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._pbrMaterialIndex},set:function(e){this._pbrMaterialIndex=n$m(this,e),this._style.pbrMaterialIndex=r$l(this._pbrMaterialIndex)}},meta:{get:function(){if(!this._ready)throw new t$Z("The style is not loaded. Use Cesium3DTileStyle.readyPromise or wait for Cesium3DTileStyle.ready to be true.");return this._meta},set:function(e){this._meta=e}}}),d$o.prototype.getColorShaderFunction=function(e,t,i){return this._colorShaderFunctionReady?(i.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,this._colorShaderFunction=e$28(this.color)?this.color.getShaderFunction(e,t,i,"vec4"):void 0,this._colorShaderTranslucent=i.translucent,this._colorShaderFunction)},d$o.prototype.getShowShaderFunction=function(e,t,i){return this._showShaderFunctionReady||(this._showShaderFunctionReady=!0,this._showShaderFunction=e$28(this.show)?this.show.getShaderFunction(e,t,i,"bool"):void 0),this._showShaderFunction},d$o.prototype.getPointSizeShaderFunction=function(e,t,i){return this._pointSizeShaderFunctionReady||(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=e$28(this.pointSize)?this.pointSize.getShaderFunction(e,t,i,"float"):void 0),this._pointSizeShaderFunction},Object.defineProperties(I$n.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return e$28(this._minimumLevel)?this._minimumLevel:0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},zoomOffset:{get:function(){return this._zoomOffset}}}),I$n.prototype.getTileCredits=function(e,t,i){},I$n.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=G$m(this,e,t,i,r);if(r.quadKey=ee$9(e,t,i),!0===this._indexedDBSetting.isOpen&&!0===r.cacheEnable){if(e$28(this._indexedDBScheduler)){var o=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey);return e$28(o)?o$1q(o,(function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):e$k.loadImage(this,n)}return e$k.loadImage(this,n)}return e$k.loadImage(this,n)},I$n.prototype.pickFeatures=function(e,t,i,r,n){if(!this._ready)throw new t$Z("pickFeatures must not be called before the imagery provider is ready.");if(this.enablePickFeatures){var o,a,s,l=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(this._tilingScheme.projection instanceof n$1b)o=e$27.toDegrees(r),a=e$27.toDegrees(n),s="4326";else{var u=this._tilingScheme.projection.project(new t$W(r,n,0));o=u.x,a=u.y,s="3857"}var c="visible";e$28(this._layers)&&(c+=":"+this._layers);var h={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:o+","+a,mapExtent:l.west+","+l.south+","+l.east+","+l.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:s,layers:c};return this._resource.getDerivedResource({url:"identify",queryParameters:h,headers:this._customRequestHeaders}).fetchJson().then((function(e){var t=[],i=e.results;if(!e$28(i))return t;for(var r=0;r<i.length;++r){var n=i[r],o=new o$w;if(o.data=n,o.name=n.value,o.properties=n.attributes,o.configureDescriptionFromProperties(n.attributes),"esriGeometryPoint"===n.geometryType&&n.geometry){var a=n.geometry.spatialReference&&n.geometry.spatialReference.wkid?n.geometry.spatialReference.wkid:4326;if(4326===a||4283===a)o.position=t$W.fromDegrees(n.geometry.x,n.geometry.y,n.geometry.z);else if(102100===a||900913===a||3857===a){var s=new t$M;o.position=s.unproject(new t$X(n.geometry.x,n.geometry.y,n.geometry.z))}}t.push(o)}return t}))}},Object.defineProperties(u$g.prototype,{radius:{get:function(){return this._radius},set:function(e){o$1u.typeOf.number.greaterThan("value",e,0),this._radius=e}},innerRadius:{get:function(){return this._innerRadius},set:function(e){o$1u.typeOf.number.greaterThan("value",e,0),this._innerRadius=e}},startAngle:{get:function(){return this._startAngle},set:function(e){this._startAngle=e}},endAngle:{get:function(){return this._endAngle},set:function(e){this._endAngle=e}},type:{get:function(){return"Circle"}}}),u$g.prototype.emit=function(e){var t=this._startAngle,i=this._endAngle;t>i&&(t=this._endAngle,i=this._startAngle);var r=e$27.randomBetween(t,i),n=e$27.randomBetween(this._innerRadius,this._radius),o=n*Math.cos(r),a=n*Math.sin(r);e.position=t$X.fromElements(o,a,0,e.position),e.velocity=t$X.clone(t$X.UNIT_Z,e.velocity)};var d$n="varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",i$f="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function t$8(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=u$Y(e.translucent,!0),i=u$Y(e.aboveGround,!1);this.material=e$28(e.material)?e.material:a$O.fromType(a$O.ColorType),this.translucent=u$Y(e.translucent,!0),this._vertexShaderSource=u$Y(e.vertexShaderSource,i$f),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,d$n),this._renderState=a$P.getDefaultRenderState(t,!i,e.renderState),this._closed=!1,this._flat=u$Y(e.flat,!1),this._faceForward=u$Y(e.faceForward,i),this._aboveGround=i}function e$g(e){LicenseChecker.LICENSECHECKER.verify("CloudBox"),this._angle=0,this._speed=1,this._url=e.url,this._scene=void 0,this._ellipsoidGeometry=new b$Y({radii:new t$X(6578137,6578137,6578137),vertexFormat:t$8.vertexFormat,maximumCone:175/180*e$27.PI,minimumCone:5/180*e$27.PI}),this._cloudBall=new v$C({geometryInstances:new d$15({geometry:this._ellipsoidGeometry,attributes:{distanceDisplayCondition:new t$H(2e6,Number.MAX_VALUE)}}),appearance:new t$8({material:new a$O({fabric:{type:"Image",uniforms:{image:this._url,color:new e$1S(1,1,1,.99)}}}),aboveGround:!0}),allowPicking:!1}),this._originalModelMatrix=y$15.clone(this._cloudBall.modelMatrix)}function o$t(e){this._show=!1,this._brightness=1,this._contrast=1,this._saturation=1,this._hue=0,this.context=e}Object.defineProperties(t$8.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return t$8.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),t$8.VERTEX_FORMAT=n$10.POSITION_AND_ST,t$8.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,t$8.prototype.isTranslucent=a$P.prototype.isTranslucent,t$8.prototype.getRenderState=a$P.prototype.getRenderState,Object.defineProperties(e$g.prototype,{url:{get:function(){return this._url},set:function(e){this._url!==e&&(this._cloudBall.appearance.material.uniforms.image=e,this._url=e)}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}}}),e$g.prototype.update=function(e){LicenseChecker.LICENSECHECKER.verify("CloudBox"),this._scene=e.camera._scene,e$28(this._cloudBall)&&!this._scene.primitives.contains(this._cloudBall)&&this._scene.primitives.add(this._cloudBall),e.mode===P$$.SCENE3D&&this.animation(),e.mode===P$$.COLUMBUS_VIEW&&(this._cloudBall.modelMatrix=y$15.clone(this._originalModelMatrix))},e$g.prototype.animation=function(){this._angle+=.05*this.speed,this._angle=this._angle%360;var e=e$27.toRadians(this._angle);e=-e;var t=p$1a.fromRotationZ(e);y$15.multiplyByMatrix3(this._originalModelMatrix,t,this._cloudBall.modelMatrix)},e$g.prototype.isDestroyed=function(){return!1},e$g.prototype.remove=function(){if(this._scene.primitives.contains(this._cloudBall)){var e=this._scene._primitives._primitives.indexOf(this._cloudBall);-1!==e&&(this._scene._primitives._primitives.splice(e,1),delete this._cloudBall._external._composites[this._scene._primitives._guid])}},e$g.prototype.destroy=function(){this.remove(),this._cloudBall=void 0},Object.defineProperties(o$t.prototype,{show:{get:function(){return this._show},set:function(e){this.context._colorBufferFloat||this.context._colorBufferHalfFloat?e!==this._show&&(e$28(this._owner)&&this._owner.colorCorrectionShowChange(e),this._show=e):console.warn("Color correction is not currently supported on the mobile.")}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness=e}},contrast:{get:function(){return this._contrast},set:function(e){this._contrast=e}},saturation:{get:function(){return this._saturation},set:function(e){this._saturation=e}},hue:{get:function(){return this._hue},set:function(e){this._hue=e}}}),o$t.prototype.isDestroyed=function(){return!1},o$t.prototype.destroy=function(){return i$Z(this)};var N$c="uniform sampler2D u_texture0;\n#ifdef BLOOM\nuniform vec2 u_BloomTex_TexelSize;\nuniform vec4 u_Bloom_DirtTileOffset;\nuniform vec3 u_Bloom_Settings;\nuniform vec3 u_Bloom_Color;\nuniform sampler2D u_BloomTexture;\nuniform sampler2D u_Bloom_DirtTex;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float u_brightness;\nuniform float u_contrast;\nuniform float u_saturation;\nuniform float u_hue;\n#endif\n#ifdef SSAO\nuniform sampler2D u_AmbientOcclusionTexture;\n#endif\n#ifdef TONEMAPPING\nuniform float u_exposure;\nuniform float u_toneMappingWhitePoint;\n#endif\nvarying vec2 v_textureCoordinates;\nvec4 UpsampleTent(sampler2D samplerTex, vec2 uv, vec2 texelSize, vec4 sampleScale)\n{\nvec4 d = texelSize.xyxy * vec4(1.0, 1.0, -1.0, 0.0) * sampleScale;\nvec4 s;\ns = texture2D(samplerTex, uv - d.xy);\ns += texture2D(samplerTex, uv - d.wy) * 2.0;\ns += texture2D(samplerTex, uv - d.zy);\ns += texture2D(samplerTex, uv + d.zw) * 2.0;\ns += texture2D(samplerTex, uv ) * 4.0;\ns += texture2D(samplerTex, uv + d.xw) * 2.0;\ns += texture2D(samplerTex, uv + d.zy);\ns += texture2D(samplerTex, uv + d.wy) * 2.0;\ns += texture2D(samplerTex, uv + d.xy);\nreturn s * (1.0 / 16.0);\n}\n#ifdef TONEMAPPING\nvec3 ACESTonemapping(vec3 inputColor)\n{\nreturn clamp((inputColor * (2.51 * inputColor + 0.03)) / (inputColor * (2.43 * inputColor + 0.59) + 0.14), 0.0, 1.0);\n}\nvec3 FilmicTonemappingFunction(vec3 x)\n{\nfloat A = 0.22;\nfloat B = 0.3;\nfloat C = 0.1;\nfloat D = 0.2;\nfloat E = 0.01;\nfloat F = 0.3;\nreturn ((x * (A * x + C * B) + D * E) / (x * (A * x + B) + D * F)) - E / F;\n}\nvec3 FilmicTonemapping(vec3 x)\n{\nvec3 WHITE = vec3(u_toneMappingWhitePoint);\nreturn FilmicTonemappingFunction(1.6 * x) / FilmicTonemappingFunction(WHITE);\n}\nvec3 inverseGamma(vec3 color)\n{\nreturn pow(color, vec3(1.0 / 2.2));\n}\nvec3 sRGBToLinear(vec3 value)\n{\nreturn vec3(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))));\n}\nvec3 linearTosRGB(vec3 value)\n{\nreturn vec3(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))));\n}\n#endif\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\ngl_FragColor = color0;\n#ifdef BLOOM\nvec4 bloom = UpsampleTent(u_BloomTexture, v_textureCoordinates, u_BloomTex_TexelSize.xy, vec4(u_Bloom_Settings.x));\nvec4 dirt = vec4(texture2D(u_Bloom_DirtTex, v_textureCoordinates * u_Bloom_DirtTileOffset.xy + u_Bloom_DirtTileOffset.zw).rgb, 0.0);\nbloom *= u_Bloom_Settings.y;\ndirt *= u_Bloom_Settings.z;\ngl_FragColor += bloom * vec4(u_Bloom_Color, 1.0);\ngl_FragColor += dirt * bloom;\n#endif\n#ifdef SSAO\nvec3 ao = texture2D(u_AmbientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb *= ao;\n#endif\n#ifdef TONEMAPPING\nvec3 linearColor = sRGBToLinear(gl_FragColor.rgb);\nvec3 toneMappingColor = ACESTonemapping(linearColor * u_exposure);\ngl_FragColor.rgb = linearTosRGB(toneMappingColor);\n#endif\n#ifdef COLOR_CORRECTION\ngl_FragColor.rgb = mix(vec3(0.0), gl_FragColor.rgb, u_brightness);\ngl_FragColor.rgb = mix(vec3(0.5), gl_FragColor.rgb, u_contrast);\ngl_FragColor.rgb = czm_hue(gl_FragColor.rgb, u_hue);\ngl_FragColor.rgb = czm_saturation(gl_FragColor.rgb, u_saturation);\n#endif\n}\n",v$j="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",b$m="uniform float focalDistance;\nuniform float focalRange;\nuniform float focalLength;\nuniform float fstop;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));\nvec4 viewPos = czm_windowToEyeCoordinates(v_textureCoordinates.xy * czm_viewport.zw, logDepthOrDepth);\nviewPos /= viewPos.w;\nfloat dist = abs(viewPos.z);\nfloat aperture = focalLength / fstop;\nfloat coc;\nfloat uppper = focalDistance + focalRange;\nfloat lower = focalDistance - focalRange;\nif (dist <= uppper && dist >= lower)\n{\ncoc = 0.5;\ncoc = coc * 0.5 + 0.5;\n}\nelse\n{\nfloat focalAdjusted = dist > uppper ? uppper : lower;\ncoc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\ncoc = clamp(coc, 0.0, 2.0) / 2.00001;\nif (dist < lower)\n{\ncoc = -coc;\n}\ncoc = coc * 0.5 + 0.5;\n}\ngl_FragColor = czm_packDepth(coc);\n}\n",x$j="uniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_textureCoordinates;\nuniform float blurRadius;\nuniform vec2 textureSize;\nuniform vec2 poissonKernel[16];\nconst float percent = 0.01;\nfloat nrand(in vec2 n)\n{\nreturn fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvoid main()\n{\nvec2 offset = blurRadius / textureSize;\nfloat rnd = 6.28318 * nrand(v_textureCoordinates + 0.07 * percent );\nfloat cosa = cos(rnd);\nfloat sina = sin(rnd);\nvec4 basis = vec4(cosa, -sina, sina, cosa);\noffset *= abs(czm_unpackDepth(texture2D(coc, v_textureCoordinates)) * 2.0 - 1.0);\nvec4 color = vec4(0.0);\nfloat weightSum = 0.0;\nfor (int i = 0; i < 16; i++)\n{\nvec2 ofs = poissonKernel[i];\nofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\nvec2 uv = v_textureCoordinates + ofs * offset;\nvec4 texel = texture2D(texture, uv);\nfloat w = 1.0;\nfloat fCoc = czm_unpackDepth(texture2D(coc, uv)) * 2.0 - 1.0;\nw *= abs(fCoc);\ntexel.rgb *= texel.a;\ncolor += texel * w;\nweightSum += w;\n}\ncolor /= weightSum;\ncolor.rgb /= (color.a + 0.0001);\ngl_FragColor = color;\n}\n",S$b="uniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D coc;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 blurredColor = texture2D(blurred, v_textureCoordinates);\nvec4 originalColor = texture2D(original, v_textureCoordinates);\nfloat fCoc = czm_unpackDepth(texture2D(coc, v_textureCoordinates));\nfCoc = abs(fCoc * 2.0 - 1.0);\nfloat weight = smoothstep(0.0, 1.0, fCoc);\ngl_FragColor = mix(originalColor, blurredColor, weight);\n}\n";function n$l(){this._cocFBO=void 0,this._blurFBO=void 0,this._compositeBlurFBO=void 0,this._cocCommand=void 0,this._blurCommand=void 0,this._compositeCommand=void 0,this._upSamplePassState=new n$p,this._scene=void 0,this._show=!1,this._useLogDepth=!0,this._focalDistance=50,this._focalRange=20,this._focalLength=30,this._fstop=2.8,this._blurRadius=10,this._textureSize=new o$1k(512,512),this._poissonKernel=P$h(),this._dofBlurKernel=[],this._dofBlurKernelSize=16;for(var e=0;e<this._dofBlurKernelSize;e++)this._dofBlurKernel.push(this._poissonKernel[e])}Object.defineProperties(n$l.prototype,{show:{get:function(){return this._show},set:function(e){this._show=e}},focalDistance:{get:function(){return this._focalDistance},set:function(e){this._focalDistance=e}},focalRange:{get:function(){return this._focalRange},set:function(e){this._focalRange=e}},fStop:{get:function(){return this._fstop},set:function(e){this._fstop=e}},blurRadius:{get:function(){return this._blurRadius},set:function(e){this._blurRadius=e}}}),n$l.prototype.execute=function(e){this._cocCommand.execute(e,this._upSamplePassState),this._blurCommand.execute(e,this._upSamplePassState),this._compositeCommand.execute(e,this._upSamplePassState)};var y$j=new f$10;function v$i(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function D$l(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function P$h(){var e=[];return e.push(new o$1k(0,0)),e.push(new o$1k(-.321585265978,-.154972575841)),e.push(new o$1k(.458126042375,.188473391593)),e.push(new o$1k(.842080129861,.527766490688)),e.push(new o$1k(.147304551086,-.659453822776)),e.push(new o$1k(-.331943915203,-.940619700594)),e.push(new o$1k(.0479226680259,.54812163202)),e.push(new o$1k(.701581552186,-.709825561388)),e.push(new o$1k(-.295436780218,.940589268233)),e.push(new o$1k(-.901489676764,.237713156085)),e.push(new o$1k(.973570876096,-.109899459384)),e.push(new o$1k(-.866792314779,-.451805525005)),e.push(new o$1k(.330975007087,.800048655954)),e.push(new o$1k(-.344275183665,.381779221166)),e.push(new o$1k(-.386139432542,-.437418421534)),e.push(new o$1k(-.576478634965,-.0148463392551)),e.push(new o$1k(.385798197415,-.262426961053)),e.push(new o$1k(-.666302061145,.682427250835)),e.push(new o$1k(-.628010632582,-.732836215494)),e.push(new o$1k(.10163141741,-.987658134403)),e.push(new o$1k(.711995289051,-.320024291314)),e.push(new o$1k(.0296005138058,.950296523438)),e.push(new o$1k(.0130612307608,-.351024443122)),e.push(new o$1k(-.879596633704,-.10478487883)),e.push(new o$1k(.435712737232,.504254490347)),e.push(new o$1k(.779203817497,.206477676721)),e.push(new o$1k(.388264289969,-.896736162545)),e.push(new o$1k(-.153106280781,-.629203242522)),e.push(new o$1k(-.245517550697,.657969239148)),e.push(new o$1k(.126830499058,.26862328493)),e.push(new o$1k(-.634888119007,-.302301223431)),e.push(new o$1k(.617074219636,.779817204925)),e}n$l.prototype.update=function(e,t,i,r){var n=(e=t.context).drawingBufferWidth,o=e.drawingBufferHeight;this._scene=i,e$28(this._cocCommand)&&r!==this._useLogDepth&&(this._useLogDepth=r,this.changeProgramDefine(r,"LOG_DEPTH")),e$28(this._cocCommand)||this.createCommand(e);var a=this._blurFBO,s=e$28(a)&&a.getColorTexture(0)||void 0;if(!e$28(s)||this._textureSize.x!==n||this._textureSize.y!==o){this._textureSize.x=n,this._textureSize.y=o,this.createFBO(n,o,e);var l=y$j;l.width=n,l.height=o;var u=u$R.fromCache({viewport:l});this._cocCommand.renderState=u,this._blurCommand.renderState=u,this._compositeCommand.renderState=u}this._upSamplePassState.context=e},n$l.prototype.createFBO=function(e,t,i){this._cocFBO=this._cocFBO&&this._cocFBO.destroy(),this._blurFBO=this._blurFBO&&this._blurFBO.destroy(),this._compositeBlurFBO=this._compositeBlurFBO&&this._compositeBlurFBO.destroy(),this._cocFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t})]}),this._blurFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT})]}),this._compositeBlurFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t})]}),e$28(this._cocCommand)&&e$28(this._blurCommand)&&e$28(this._compositeCommand)&&(this._cocCommand.framebuffer=this._cocFBO,this._blurCommand.framebuffer=this._blurFBO,this._compositeCommand.framebuffer=this._compositeBlurFBO)},n$l.prototype.createCommand=function(e){var t={},i=new a$$({name:"DOFCoc",sources:[b$m]});this._useLogDepth&&i.defines.push("LOG_DEPTH"),this._cocCommand=e.createViewportQuadCommand(i,{uniformMap:t,owner:this}),this._blurCommand=e.createViewportQuadCommand(x$j,{uniformMap:t,owner:this}),this._compositeCommand=e.createViewportQuadCommand(S$b,{uniformMap:t,owner:this}),this.createUniformMap()},n$l.prototype.createUniformMap=function(){if(e$28(this._cocCommand)&&e$28(this._blurCommand)&&e$28(this._compositeCommand)){var e=this;this._cocCommand.uniformMap.focalDistance=function(){return e._focalDistance},this._cocCommand.uniformMap.focalRange=function(){return e._focalRange},this._cocCommand.uniformMap.focalLength=function(){return e._focalLength},this._cocCommand.uniformMap.fstop=function(){return e._fstop},this._blurCommand.uniformMap.texture=function(){return e._fbo.getColorTexture(0)},this._blurCommand.uniformMap.coc=function(){return e._cocFBO.getColorTexture(0)},this._blurCommand.uniformMap.blurRadius=function(){return e._blurRadius},this._blurCommand.uniformMap.textureSize=function(){return e._textureSize},this._blurCommand.uniformMap.poissonKernel=function(){return e._dofBlurKernel},this._compositeCommand.uniformMap.original=function(){return e._fbo.getColorTexture(0)},this._compositeCommand.uniformMap.blurred=function(){return e._blurFBO.getColorTexture(0)},this._compositeCommand.uniformMap.coc=function(){return e._cocFBO.getColorTexture(0)}}},n$l.prototype.setInputFBO=function(e){this._fbo=e},n$l.prototype.getDOFTexture=function(){return this._compositeBlurFBO.getColorTexture(0)},n$l.prototype.isDestroyed=function(){return!1},n$l.prototype.destroy=function(){return this._cocFBO=this._cocFBO&&this._cocFBO.destroy(),this._blurFBO=this._blurFBO&&this._blurFBO.destroy(),this._compositeBlurFBO=this._compositeBlurFBO&&this._compositeBlurFBO.destroy(),this._cocCommand=this._cocCommand&&this._cocCommand.shaderProgram&&this._cocCommand.shaderProgram.destroy(),this._blurCommand=this._blurCommand&&this._blurCommand.shaderProgram&&this._blurCommand.shaderProgram.destroy(),this._compositeCommand=this._compositeCommand&&this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy(),i$Z(this)},n$l.prototype.changeProgramDefine=function(e,t){var i=this._scanCommand;if(e$28(i)){var r=i.shaderProgram.fragmentShaderSource,n=i.shaderProgram.vertexShaderSource;e?v$i(r,t):D$l(r,t),i.shaderProgram.destroy(),i.shaderProgram=ShaderProgram.fromCache({context:this._context,vertexShaderSource:n,fragmentShaderSource:r})}};var z$g="uniform sampler2D randomTexture;\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}\nfloat getDepth(in vec4 depth)\n{\nfloat z_window = czm_unpackDepth(depth);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nreturn (2.0 * z_window - n_range - f_range) / (f_range - n_range);\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 = getDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = 1.0 / czm_viewport.zw;\nfloat depthU = getDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates- vec2(0.0, pixelSize.y)));\nfloat depthD = getDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates+ vec2(0.0, pixelSize.y)));\nfloat depthL = getDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates- vec2(pixelSize.x, 0.0)));\nfloat depthR = getDepth(texture2D(czm_globeDepthTexture, 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 = getDepth(texture2D(randomTexture, v_textureCoordinates));\nfloat inverseViewportWidth = 1.0 / czm_viewport.z;\nfloat inverseViewportHeight = 1.0 / czm_viewport.w;\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 directionWithStep = vec2(rotatedSampleDirection.x * localStepSize * inverseViewportWidth, rotatedSampleDirection.y * localStepSize * inverseViewportHeight);\nvec2 newCoords = directionWithStep + v_textureCoordinates;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = getDepth(texture2D(czm_globeDepthTexture, 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",F$g="uniform float u_delta;\nuniform float u_sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec2 off = u_step * dir;\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * u_sigma);\ng.y = exp((-0.5 * u_delta * u_delta) / (u_sigma * u_sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < 8; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n";function a$j(){this._fbo=void 0,this._scene=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._ambientOcclusionGenerateCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._downSamplePassState=new n$p,this._upSamplePassState=new n$p,this._blurStep=new o$1k,this._intensity=3,this._bias=.1,this._lengthCap=.26,this._stepSize=1.95,this._frustumLength=1e3,this._randomTexture=void 0,this._show=!1,this._useLogDepth=!0,this._context=void 0}Object.defineProperties(a$j.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(e$28(this._owner)&&this._owner.ssaoShowChange(e),this._show=e)}},intensity:{get:function(){return this._intensity},set:function(e){this._intensity=e}},lengthCap:{get:function(){return this._lengthCap},set:function(e){this._lengthCap=e}},bias:{get:function(){return this._bias},set:function(e){this._bias=e}},stepSize:{get:function(){return this._stepSize},set:function(e){this._stepSize=e}},frustumLength:{get:function(){return this._frustumLength},set:function(e){this._frustumLength=e}}}),a$j.prototype.clear=function(e,t){var i=this._clearFBO1Command;e$1S.clone(u$Y(t,e$1S.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,e$1S.clone(u$Y(t,e$1S.BLACK),i.color),i.execute(e)},a$j.prototype.isPrepared=function(){return e$28(this._scene)&&this._scene._pickDepths.length>0},a$j.prototype.execute=function(e,t){this._ambientOcclusionGenerateCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState)},a$j.prototype.createRandomTexture=function(e){for(var t=196608,i=new Uint8Array(t),r=0;r<t;r+=3)i[r]=Math.floor(255*Math.random());this._randomTexture=new L$17({context:e,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:i,width:256,height:256},sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})},new f$10;var V$e=new f$10;function k$j(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function H$k(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}a$j.prototype.update=function(e,t,i,r){this._scene=i,this._context=t.context;var n=(e=t.context).drawingBufferWidth,o=e.drawingBufferHeight,a=this;if(e$28(this._randomTexture)||this.createRandomTexture(e),e$28(this._ambientOcclusionGenerateCommand)&&r!==this._useLogDepth&&(this._useLogDepth=r,this.changeProgramDefine(r,"LOG_DEPTH")),!e$28(this._ambientOcclusionGenerateCommand)){this._clearFBO1Command=new r$11({color:new e$1S}),this._clearFBO2Command=new r$11({color:new e$1S});var s={randomTexture:function(){return a._randomTexture},intensity:function(){return a._intensity},bias:function(){return a._bias},lengthCap:function(){return a._lengthCap},stepSize:function(){return a._stepSize},frustumLength:function(){return a._frustumLength}},l=new a$$({name:"ambientOcclusion",sources:[z$g]});this._useLogDepth&&l.defines.push("LOG_DEPTH"),this._ambientOcclusionGenerateCommand=e.createViewportQuadCommand(l,{uniformMap:s,owner:this}),s={direction:function(){return 0}},this._blurXCommand=e.createViewportQuadCommand(F$g,{uniformMap:s,owner:this}),s={direction:function(){return 1}},this._blurYCommand=e.createViewportQuadCommand(F$g,{uniformMap:s,owner:this})}var u=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2))-2),c=Math.pow(2,Math.ceil(Math.log(o)/Math.log(2))-2),h=Math.max(1,u,c),d=V$e;d.width=h,d.height=h;var f=this._downSampleFBO1,p=e$28(f)&&f.getColorTexture(0)||void 0;if(!e$28(p)||p.width!==h||p.height!==h){this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=2/h;this._downSampleFBO1=new a$z({context:e,colorTextures:[new L$17({context:e,width:h,height:h})]}),this._downSampleFBO2=new a$z({context:e,colorTextures:[new L$17({context:e,width:h,height:h})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._ambientOcclusionGenerateCommand.framebuffer=this._downSampleFBO1,this._blurXCommand.framebuffer=this._downSampleFBO2,this._blurYCommand.framebuffer=this._downSampleFBO1;var _=u$R.fromCache({viewport:d});this._ambientOcclusionGenerateCommand.uniformMap.depthTexture=function(){return a._scene._pickDepths.length>0&&e$28(a._scene._pickDepths[0]._depthTexture)?a._scene._pickDepths[0]._depthTexture:a._context.defaultTexture},this._ambientOcclusionGenerateCommand.renderState=_,this._blurXCommand.uniformMap.u_texture=function(){return a._downSampleFBO1.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return a._blurStep},this._blurXCommand.uniformMap.u_delta=function(){return 1},this._blurXCommand.uniformMap.u_sigma=function(){return 2},this._blurXCommand.renderState=_,this._blurYCommand.uniformMap.u_texture=function(){return a._downSampleFBO2.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return a._blurStep},this._blurYCommand.uniformMap.u_delta=function(){return 1},this._blurYCommand.uniformMap.u_sigma=function(){return 2},this._blurYCommand.renderState=_}this._downSamplePassState.context=e,this._upSamplePassState.context=e},a$j.prototype.setInputFBO=function(e){this._fbo=e},a$j.prototype.getAmbientOcclusionTexture=function(){return this._downSampleFBO1.getColorTexture(0)},a$j.prototype.changeProgramDefine=function(e,t){var i=this._scanCommand;if(e$28(i)){var r=i.shaderProgram.fragmentShaderSource,n=i.shaderProgram.vertexShaderSource;e?k$j(r,t):H$k(r,t),i.shaderProgram.destroy(),i.shaderProgram=ShaderProgram.fromCache({context:this._context,vertexShaderSource:n,fragmentShaderSource:r})}},a$j.prototype.isDestroyed=function(){return!1},a$j.prototype.destroy=function(){return this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._ambientOcclusionGenerateCommand=this._ambientOcclusionGenerateCommand&&this._ambientOcclusionGenerateCommand.shaderProgram&&this._ambientOcclusionGenerateCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),i$Z(this)};var I$m="uniform sampler2D u_colorTexture;\nuniform sampler2D u_appendTexture;\nuniform vec4 u_scanViewCenterArr[COUNT];\nuniform vec4 u_scanViewPlaneArr[COUNT];\nuniform float u_radiusArr[COUNT];\nuniform vec3 u_scanLineDirArr[COUNT];\nuniform vec3 u_scanLineMoveViewDirArr[COUNT];\nuniform vec3 u_scanLinePtArr[COUNT];\nuniform float u_lineWidth;\nuniform vec4 u_ScanColor;\nvarying vec2 v_textureCoordinates;\nvec3 pointProjectPlane(vec3 planeNormal, vec3 pointOnPlane, vec3 point1)\n{\nvec3 v01 = point1 - pointOnPlane;\nv01 = normalize(v01);\nvec3 normalizeVector = normalize(planeNormal);\nif (v01 == normalizeVector)\n{\nreturn pointOnPlane;\n}\nfloat d = (planeNormal.x * (point1.x - pointOnPlane.x) + planeNormal.y * (point1.y - pointOnPlane.y) + planeNormal.z * (point1.z - pointOnPlane.z)) / dot(planeNormal, planeNormal);\nvec3 res;\nres = point1 - planeNormal * d;\nreturn res;\n}\nfloat distancePointToLine(vec3 ptOnLine, vec3 vectorLine, vec3 testPt)\n{\nvec3 v = vectorLine;\nvec3 w = testPt - ptOnLine;\nfloat c1 = dot(w, v);\nfloat c2 = dot(v, v);\nfloat b = c1 / c2;\nvec3 Pb = ptOnLine + b * v;\nreturn length(testPt - Pb);\n}\nvoid main()\n{\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));\n#ifdef LOG_DEPTH\nfloat scale = logDepthOrDepth;\n#else\nfloat scale = pow(logDepthOrDepth * 0.5 + 0.5, 8.0);\n#endif\nif(scale > 0.999999)\n{\nreturn;\n}\nvec4 viewPos = czm_windowToEyeCoordinates(v_textureCoordinates.xy * czm_viewport.zw, logDepthOrDepth);\nviewPos /= viewPos.w;\nvec4 scanColor = vec4(1.0);\nfloat scanValue = 0.0;\nvec4 appendColor = vec4(0.0);\nfor(int i = 0;i < COUNT;i++)\n{\nvec3 scanViewPlane = u_scanViewPlaneArr[i].xyz;\nvec3 scanViewCenter = u_scanViewCenterArr[i].xyz;\nfloat radius = u_radiusArr[i];\nvec3 scanLinePt = u_scanLinePtArr[i];\nvec3 scanLineDir = u_scanLineDirArr[i];\nvec3 scanLineMoveViewDir = u_scanLineMoveViewDirArr[i];\nfloat lineWidth = u_lineWidth;\nvec3 prjOnPlane = pointProjectPlane(scanViewPlane, scanViewCenter, viewPos.xyz);\nvec2 appendTexCoord = vec2(0.0);\n#ifdef CIRCLE\nvec3 relativePos = prjOnPlane - scanViewCenter;\nfloat dis = length(relativePos);\n#ifdef APPEND_TEXTURE\nif(dis < radius)\n{\nvec3 zAxis = scanViewPlane;\nvec3 temp = vec3(1.0, 0.0, 0.0);\nvec3 xAxis = normalize(cross(temp, zAxis));\nvec3 yAxis = normalize(cross(zAxis, xAxis));\nfloat cosTheta = dot(normalize(relativePos), xAxis);\nfloat cosTheta2 = dot(normalize(relativePos), yAxis);\nappendTexCoord.x = (dis * cosTheta / radius + 1.0) * 0.5;\nappendTexCoord.y = (dis * cosTheta2 / radius + 1.0) * 0.5;\nappendColor += texture2D(u_appendTexture, appendTexCoord);\nappendColor.rgb = appendColor.rgb * u_ScanColor.rgb;\n}\n#else\nif(dis < radius)\n{\nfloat f = 1.0 - abs(radius - dis) / radius;\nf = pow(f, 8.0);\nscanValue = f;\nscanColor *= u_ScanColor;\n}\n#endif\n#else\n#ifdef APPEND_TEXTURE\nvec3 relativePos = prjOnPlane - scanLinePt;\nfloat cosTheta = dot(scanLineDir, normalize(relativePos));\nfloat cosTheta2 = dot(scanLineMoveViewDir, normalize(relativePos));\nfloat disToLineCenter = length(relativePos);\nappendTexCoord.x = (disToLineCenter * cosTheta / lineWidth + 1.0) * 0.5;\nappendTexCoord.y = (disToLineCenter * cosTheta2 / lineWidth + 1.0) * 0.5;\nappendColor += texture2D(u_appendTexture, appendTexCoord);\nappendColor.rgb = appendColor.rgb * u_ScanColor.rgb;\n#else\nfloat disToLine = distancePointToLine(scanLinePt, scanLineDir, prjOnPlane);\nif(disToLine < lineWidth)\n{\nfloat f = abs(lineWidth - disToLine) / lineWidth;\nf = pow(f, 8.0);\nscanValue += f;\nscanColor = u_ScanColor;\n}\n#endif\n#endif\n}\nvec4 color = texture2D(u_colorTexture, v_textureCoordinates);\n#ifdef APPEND_TEXTURE\ngl_FragColor.rgb = color.rgb + appendColor.rgb * scanColor.rgb;\n#else\ngl_FragColor = mix(color, scanColor, scanValue);\n#endif\n}\n",e$f={CIRCLE:{programDefines:"CIRCLE"},LINE:{programDefines:"LINE"}},A$l=Object.freeze(e$f);function c$e(){this._fbo=void 0,this._inputFbo=void 0,this._scanCommand=void 0,this._upSamplePassState=new n$p,this._scene=void 0,this._mode=A$l.LINE,this._scanViewCenterArr=[],this._scanPlaneArr=[],this._scanCenterArr=[],this._scanLineMoveDirArr=[],this._scanLineMoveViewDirArr=[],this._scanLineDirArr=[],this._scanLinePtArr=[],this._radiusArr=[],this._lineWidth=1e3,this._color=new e$1S(1,1,1,1),this._period=1e3,this._speed=1e3,this._show=!1,this._appendTexUrl=void 0,this._appendTexture=void 0,this._textureChanged=!1,this._useLogDepth=!0,this._flowTime=this._period}Object.defineProperties(c$e.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(e$28(this._owner)&&this._owner.scanShowChange(e),this._show=e)}},mode:{get:function(){return this._mode},set:function(e){this.changeProgramDefine(!1,this._mode.programDefines),this._mode=e,this.changeProgramDefine(!0,this._mode.programDefines)}},color:{get:function(){return this._color},set:function(e){this._color=e}},count:{get:function(){return this._scanCenterArr.length}},centerPostion:{get:function(){var e=this._scanCenterArr.length;return this._scanCenterArr[e-1]},set:function(e){this._scanCenterArr[0]=e,this._flowTime=this._period,0===this._scanLineMoveDirArr.length&&(this._scanViewCenterArr[0]=new t$X,this.computeDefaultMoveDir(0))}},period:{get:function(){return this._period/1e3},set:function(e){this._period=1e3*e}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}},lineMoveDirection:{get:function(){var e=this._scanLineMoveDirArr.length;return this._scanLineMoveDirArr[e-1]},set:function(e){var t=this._scanLineMoveDirArr.length,i=t$X.normalize(e,new t$X);this._scanLineMoveDirArr[t-1]=i}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=e}},textureUrl:{get:function(){return this._appendTexUrl},set:function(e){this._textureChanged=!0,this._appendTexUrl=e,(!e$28(e)||""===e)&&this.changeProgramDefine(!1,"APPEND_TEXTURE")}}}),c$e.prototype.isPrepared=function(){return e$28(this._scene)&&this._scene._pickDepths.length>0},c$e.prototype.execute=function(e){this._scanCommand.execute(e,this._upSamplePassState)};var k$i=new f$10,x$i=new e$25(0,0,0,1),v$h=new e$25(0,0,0,1),o$s=new e$25,d$m=new e$25,m$l=new t$X,G$l=new o$1i(new t$X(0,0,1),10);function H$j(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function j$h(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}c$e.prototype.computeDefaultMoveDir=function(e){var t=new t$X,i=this._scanCenterArr[e];t=t$X.cross(new t$X(0,0,1),i,t),t=t$X.normalize(t,t),this._scanLineMoveDirArr[e]=t},c$e.prototype.computeScanPlane=function(e,t){var i=this._scanCenterArr[t],r=this._scanViewCenterArr[t],n=this._scanPlaneArr[t];e$28(n)||(n=this._scanPlaneArr[t]=new e$25);var o=e._frameState.camera;e.mode===P$$.SCENE2D&&(v$h.x=i.x,v$h.y=i.y,v$h.z=i.z-1e3),x$i=y$15.multiplyByVector(o.viewMatrix,v$h,x$i),d$m=e$25.subtract(r,x$i,d$m),m$l.x=d$m.x,m$l.y=d$m.y,m$l.z=d$m.z,m$l=t$X.normalize(m$l,m$l);var a=o$1i.fromPointNormal(new t$X(r.x,r.y,r.z),m$l,G$l);n.x=a.normal.x,n.y=a.normal.y,n.z=a.normal.z,n.w=a.distance},c$e.prototype.updateScanParameters=function(e){for(var t=e._frameState.camera,i=0,r=this._scanCenterArr.length;i<r;i++){var n=this._scanCenterArr[i];o$s.x=n.x,o$s.y=n.y,o$s.z=n.z,o$s.w=1,y$15.multiplyByVector(t.viewMatrix,o$s,this._scanViewCenterArr[i]),this.computeScanPlane(e,i),this._flowTime=this._flowTime+30;var o=this._flowTime%this._period;0==o&&(o=this._period);var a=this._speed*o/1e3;this._mode===A$l.CIRCLE?this._radiusArr[i]=a:this._mode===A$l.LINE&&(this.computeScanLineDir(e,i),this.computeScanLinePt(e,a,i))}},c$e.prototype.computeScanLineDir=function(e,t){var i=e._frameState.camera,r=this._scanLineDirArr[t];e$28(r)||(r=this._scanLineDirArr[t]=new t$X);var n=this._scanLineMoveDirArr[t];e$28(n)||(n=this._scanLineMoveDirArr[t]=new t$X);var o=this._scanCenterArr[t],a=this._scanViewCenterArr[t];r=e.mode===P$$.SCENE2D?t$X.cross(n,new t$X(0,0,1),r):t$X.cross(n,o,r),t$X.normalize(r,r);var s=new t$X;s=t$X.multiplyByScalar(r,10,s),s=t$X.add(o,s,s),o$s.x=s.x,o$s.y=s.y,o$s.z=s.z,o$s.w=1,o$s=y$15.multiplyByVector(i.viewMatrix,o$s,o$s),r.x=o$s.x-a.x,r.y=o$s.y-a.y,r.z=o$s.z-a.z,t$X.normalize(r,r)},c$e.prototype.computeScanLinePt=function(e,t,i){var r=e._frameState.camera,n=this._scanLinePtArr[i];e$28(n)||(n=this._scanLinePtArr[i]=new t$X);var o=this._scanLineMoveDirArr[i],a=this._scanCenterArr[i],s=this._scanViewCenterArr[i],l=this._scanLineMoveViewDirArr[i];e$28(l)||(l=this._scanLineMoveViewDirArr[i]=new t$X),n=t$X.multiplyByScalar(o,t,n),n=t$X.add(a,n,n),o$s.x=n.x,o$s.y=n.y,o$s.z=n.z,o$s.w=1,o$s=y$15.multiplyByVector(r.viewMatrix,o$s,o$s),n.x=o$s.x,n.y=o$s.y,n.z=o$s.z,l.x=o$s.x-s.x,l.y=o$s.y-s.y,l.z=o$s.z-s.z,t$X.normalize(l,l)},c$e.prototype.update=function(e,t,i,r){this._context=t.context;var n=(e=t.context).drawingBufferWidth,o=e.drawingBufferHeight;this._scene=i,this.updateScanParameters(i);var a=this;if(this._textureChanged&&(e$28(this._appendTexUrl)&&""!==this._appendTexUrl&&o$1q(t$D(a._appendTexUrl),(function(t){e$28(a._appendTexture)&&a._appendTexture.destroy(),a._appendTexture=new L$17({context:e,source:t,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE}),a.changeProgramDefine(!0,"APPEND_TEXTURE")})),this._textureChanged=!1),e$28(this._scanCommand)&&r!==this._useLogDepth&&(this._useLogDepth=r,this.changeProgramDefine(r,"LOG_DEPTH")),!e$28(this._scanCommand)){var s=new a$$({name:"Scan",sources:[I$m]});s.defines.push(this._mode.programDefines),s.defines.push("COUNT "+this._scanCenterArr.length),r&&s.defines.push("LOG_DEPTH"),this._scanCommand=e.createViewportQuadCommand(s,{uniformMap:{},owner:this}),this._scanCommand.uniformMap.u_depthTex=function(){return a._scene._pickDepths[0]._depthTexture},this._scanCommand.uniformMap.u_colorTexture=function(){return a._inputFbo.getColorTexture(0)},this._scanCommand.uniformMap.u_appendTexture=function(){return e$28(a._appendTexture)?a._appendTexture:a._context.defaultTexture},this._scanCommand.uniformMap.u_scanViewCenterArr=function(){return a._scanViewCenterArr},this._scanCommand.uniformMap.u_radiusArr=function(){return a._radiusArr},this._scanCommand.uniformMap.u_scanViewPlaneArr=function(){return a._scanPlaneArr},this._scanCommand.uniformMap.u_scanLineDirArr=function(){return a._scanLineDirArr},this._scanCommand.uniformMap.u_scanLineMoveViewDirArr=function(){return a._scanLineMoveViewDirArr},this._scanCommand.uniformMap.u_scanLinePtArr=function(){return a._scanLinePtArr},this._scanCommand.uniformMap.u_lineWidth=function(){return a._lineWidth},this._scanCommand.uniformMap.u_ScanColor=function(){return a._color}}var l=this._fbo,u=e$28(l)&&l.getColorTexture(0)||void 0;if(!e$28(u)||u.width!==n||u.height!==o){this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new a$z({context:e,colorTextures:[new L$17({context:e,width:n,height:o})]}),this._scanCommand.framebuffer=this._fbo;var c=k$i;c.width=n,c.height=o;var h=u$R.fromCache({viewport:c});this._scanCommand.renderState=h}this._upSamplePassState.context=e},c$e.prototype.setInputFBO=function(e){this._inputFbo=e},c$e.prototype.getScanTexture=function(){return this._fbo.getColorTexture(0)},c$e.prototype.getScanFBO=function(){return this._fbo},c$e.prototype.changeProgramDefine=function(e,t){var i=this._scanCommand;if(e$28(i)){var r=i.shaderProgram.fragmentShaderSource,n=i.shaderProgram.vertexShaderSource;e?H$j(r,t):j$h(r,t),i.shaderProgram.destroy(),i.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:n,fragmentShaderSource:r})}},c$e.prototype.add=function(e){if(e$28(e))return 0===this._scanCenterArr.length?void(this.centerPosition=t$X.clone(e)):(this.changeProgramDefine(!1,"COUNT "+this._scanCenterArr.length),this._scanCenterArr.push(e),this._scanViewCenterArr.push(new t$X),this.changeProgramDefine(!0,"COUNT "+this._scanCenterArr.length),this.computeDefaultMoveDir(this._scanCenterArr.length-1),this._scanCenterArr.length-1)},c$e.prototype.remove=function(e){e>=this._scanCenterArr.length||1===this._scanCenterArr.length||(this.changeProgramDefine(!1,"COUNT "+this._scanCenterArr.length),this._scanCenterArr.splice(e,1),this._scanViewCenterArr.splice(e,1),this._scanLineMoveDirArr.splice(e,1),this.changeProgramDefine(!0,"COUNT "+this._scanCenterArr.length))},c$e.prototype.isDestroyed=function(){return!1},c$e.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._scanCommand=this._scanCommand&&this._scanCommand.shaderProgram&&this._scanCommand.shaderProgram.destroy(),e$28(this._appendTexture)&&(this._appendTexture.destroy(),this._appendTexture=null),i$Z(this)};var I$l="#define AA_SAMPLES 9\n#define AA_CLAMP 1\n#define AA_CLIP 0\n#define SHARPEN 1\nuniform sampler2D u_currentTexture;\nuniform sampler2D u_historyTexture;\nuniform mat4 u_transformMatrix;\nuniform vec2 u_jitter;\nuniform float u_sampleSpatialWeight[AA_SAMPLES];\nuniform vec2 u_offsets3x3[AA_SAMPLES];\nvarying vec2 v_textureCoordinates;\nvec3 RGB2YCoCgR(vec3 rgbColor){\nfloat Y = dot(rgbColor, vec3(1.0, 2.0, 1.0));\nfloat Co = dot(rgbColor, vec3(2.0, 0.0, -2.0));\nfloat Cg = dot(rgbColor, vec3(-1.0, 2.0, -1.0));\nvec3 YCoCgRColor = vec3(Y, Co, Cg);\nreturn YCoCgRColor;\n}\nvec3 YCoCgR2RGB(vec3 YCoCgRColor){\nfloat Y = YCoCgRColor.x * 0.25;\nfloat Co = YCoCgRColor.y * 0.25;\nfloat Cg = YCoCgRColor.z * 0.25;\nfloat R = Y + Co - Cg;\nfloat G = Y + Cg;\nfloat B = Y - Co - Cg;\nvec3 rgbColor = vec3(R, G, B);\nreturn rgbColor;\n}\nfloat Luminance(vec3 color){\nreturn color.r;\n}\nvec3 ToneMap(vec3 color){\nreturn color / (1.0 + Luminance(color));\n}\nvec3 UnToneMap(vec3 color){\nreturn color / (1.0 - Luminance(color));\n}\nvec3 GetNeighorhoodSamp(vec2 offset, vec2 uv){\nfloat fx = offset.x;\nfloat fy = offset.y;\nvec2 sampleOffset = vec2(fx / czm_viewport.z, fy / czm_viewport.w);\nvec2 sampleUV = uv + sampleOffset;\nsampleUV = clamp(sampleUV, 0.0, 1.0);\nvec3 neighorhoodSamp = texture2D(u_currentTexture, sampleUV).rgb;\nneighorhoodSamp = max(neighorhoodSamp, 0.0);\nneighorhoodSamp = ToneMap(neighorhoodSamp);\nneighorhoodSamp = RGB2YCoCgR(neighorhoodSamp);\nreturn neighorhoodSamp;\n}\nfloat HdrWeightY(float Color){\nfloat exposure = 1.0;\nreturn 1.0 / (Color * exposure + 4.0);\n}\nfloat GetSceneColorLuma4(vec3 SceneColor){\nreturn SceneColor.x;\n}\nfloat GetSceneColorHdrWeight(vec3 SceneColor)\n{\nreturn HdrWeightY(SceneColor.x);\n}\nvec2 WeightedLerpFactors(float WeightA, float WeightB, float Blend)\n{\nfloat BlendA = (1.0 - Blend) * WeightA;\nfloat BlendB = Blend * WeightB;\nfloat RcpBlend = 1.0 / (BlendA + BlendB);\nBlendA *= RcpBlend;\nBlendB *= RcpBlend;\nreturn vec2(BlendA, BlendB);\n}\nvoid ComputeNeighborhoodBoundingbox(in vec3 Neighbors[AA_SAMPLES], out vec3 OutNeighborMin, out vec3 OutNeighborMax)\n{\nvec3 NeighborMin;\nvec3 NeighborMax;\nNeighborMin = min( min(Neighbors[1], Neighbors[3]), Neighbors[4] );\nNeighborMin = min( min(NeighborMin, Neighbors[5]), Neighbors[7] );\nNeighborMax = max( max(Neighbors[1], Neighbors[3]), Neighbors[4] );\nNeighborMax = max( max(NeighborMax, Neighbors[5]), Neighbors[7] );\nvec3 NeighborMinPlus = NeighborMin;\nvec3 NeighborMaxPlus = NeighborMax;\nNeighborMin = min( min(NeighborMin, Neighbors[0]), Neighbors[2] );\nNeighborMin = min( min(NeighborMin, Neighbors[6]), Neighbors[8] );\nNeighborMax = max( max(NeighborMax, Neighbors[0]), Neighbors[2] );\nNeighborMax = max( max(NeighborMax, Neighbors[6]), Neighbors[8] );\nOutNeighborMin = NeighborMin;\nOutNeighborMax = NeighborMax;\n}\nfloat IntersectAABB(vec3 Dir, vec3 Org, vec3 Box){\nvec3 RcpDir = vec3(1.0 / Dir.x, 1.0 / Dir.y, 1.0 / Dir.z);\nvec3 TNeg = ( Box - Org) * RcpDir;\nvec3 TPos = ((-Box) - Org) * RcpDir;\nreturn max(max(min(TNeg.x, TPos.x), min(TNeg.y, TPos.y)), min(TNeg.z, TPos.z));\n}\nfloat HistoryClip(vec3 History, vec3 Filtered, vec3 NeighborMin, vec3 NeighborMax){\n#if 0\nvec3 Min = min(Filtered, min(NeighborMin, NeighborMax));\nvec3 Max = max(Filtered, max(NeighborMin, NeighborMax));\nvec3 Avg2 = Max + Min;\nvec3 Dir = Filtered - History;\nvec3 Org = History - Avg2 * 0.5;\nvec3 Scale = Max - Avg2 * 0.5;\nreturn clamp(IntersectAABB(Dir, Org, Scale), 0.0, 1.0);\n#else\nvec3 BoxMin = NeighborMin;\nvec3 BoxMax = NeighborMax;\nvec3 RayOrigin = History;\nvec3 RayDir = Filtered - History;\nRayDir = all(lessThanEqual(abs(RayDir), vec3(1.0/65536.0))) ? vec3(1.0/65536.0) : RayDir;\nvec3 InvRayDir = vec3( 1.0 / RayDir.x, 1.0 / RayDir.y, 1.0 / RayDir.z );\nvec3 MinIntersect = (BoxMin - RayOrigin) * InvRayDir;\nvec3 MaxIntersect = (BoxMax - RayOrigin) * InvRayDir;\nvec3 EnterIntersect = min( MinIntersect, MaxIntersect );\nreturn max( max(EnterIntersect.x, EnterIntersect.y), EnterIntersect.z );\n#endif\n}\nvec3 ClampHistory(vec3 Filtered, vec3 History, vec3 NeighborMin, vec3 NeighborMax)\n{\n#if !AA_CLAMP\nreturn History;\n#elif AA_CLIP\nvec3 TargetColor = Filtered;\nvec3 HistoryColor = History;\nfloat ClipBlend = HistoryClip( HistoryColor.rgb, TargetColor.rgb, NeighborMin.rgb, NeighborMax.rgb );\nClipBlend = clamp( ClipBlend, 0.0, 1.0 );\nHistoryColor = mix( HistoryColor, TargetColor, ClipBlend );\nreturn HistoryColor;\n#else //!AA_CLIP\nHistory = clamp(History, NeighborMin, NeighborMax);\nreturn History;\n#endif\n}\nvec3 FilterCurrentFrameInputSamples(in vec2 uv, inout vec3 neighborhood[AA_SAMPLES]){\nfor(int i = 0; i < AA_SAMPLES; i++){\nneighborhood[i] = GetNeighorhoodSamp(u_offsets3x3[i], uv);\n}\nfloat totalWeight = 0.0;\nvec3 sum = vec3(0.0);\nfor(int i = 0; i < AA_SAMPLES; i++){\nfloat neighborhoodHdrWeight = GetSceneColorHdrWeight(neighborhood[i]);\nfloat neighborhoodFinalWeight = neighborhoodHdrWeight * u_sampleSpatialWeight[i];\ntotalWeight += neighborhoodFinalWeight;\nsum += neighborhood[i] * neighborhoodFinalWeight;\n}\nvec3 filtered = sum / totalWeight;\nreturn filtered;\n}\nvoid main()\n{\nfloat HistoryBlur = 0.0;\nvec2 jitteredUV = v_textureCoordinates + u_jitter;\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));\nvec4 viewPos = czm_windowToEyeCoordinates(v_textureCoordinates.xy * czm_viewport.zw, logDepthOrDepth);\nviewPos /= viewPos.w;\nvec4 histroyUV = u_transformMatrix * viewPos;\nhistroyUV = histroyUV / histroyUV.w;\nhistroyUV.xy = histroyUV.xy * 0.5 + 0.5;\nhistroyUV.xy = histroyUV.xy + u_jitter;\nvec3 prevColor = texture2D(u_historyTexture, histroyUV.xy).rgb;\nprevColor = ToneMap(prevColor);\nprevColor = RGB2YCoCgR(prevColor);\nvec3 neighborhood[AA_SAMPLES];\nvec3 filtered = FilterCurrentFrameInputSamples(jitteredUV, neighborhood);\nvec3 NeighborMin;\nvec3 NeighborMax;\nComputeNeighborhoodBoundingbox(neighborhood, NeighborMin, NeighborMax);\nfloat LumaMin = GetSceneColorLuma4(NeighborMin);\nfloat LumaMax = GetSceneColorLuma4(NeighborMax);\nfloat LumaHistory = GetSceneColorLuma4(prevColor);\nprevColor = ClampHistory(filtered, prevColor, NeighborMin, NeighborMax);\nfloat BlendFinal = 0.04;\nfloat FilterWeight = GetSceneColorHdrWeight(filtered);\nfloat HistoryWeight = GetSceneColorHdrWeight(prevColor);\nvec2 Weights = WeightedLerpFactors(HistoryWeight, FilterWeight, BlendFinal);\nvec3 color = prevColor * Weights.x + filtered * Weights.y;\ncolor = YCoCgR2RGB(color);\ncolor = UnToneMap(color);\ngl_FragColor.rgb = color;\ngl_FragColor.a = 1.0;\n}\n",C$f=8,D$k=[0,-.5,.5,-3/4,1/4,-1/4,3/4,-7/8],W$f=[-1/3,1/3,-7/9,-1/9,5/9,-5/9,1/9,7/9],g$i=[new o$1k(-1,-1),new o$1k(0,-1),new o$1k(1,-1),new o$1k(-1,0),new o$1k(0,0),new o$1k(1,0),new o$1k(-1,1),new o$1k(0,1),new o$1k(1,1)];function a$i(){this._compositeCommand=void 0,this._histroyFBO=[],this._upSamplePassState=new n$p,this._show=!1,this._fbo=void 0,this._fboIndex=0,this._uniformState=void 0,this._prevViewProjectionMatrx=new y$15,this._transformMatrix=new y$15,this._frameIndex=0,this._jitterPixel=new o$1k,this._jitterUVOffset=new o$1k,this._sampleWeights=[],this._plusWeights=[]}Object.defineProperties(a$i.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e)}}}),a$i.prototype.execute=function(e,t){!e$28(e.uniformState)||!e$28(e.uniformState.globeDepthTexture)||(this._compositeCommand.framebuffer=this._histroyFBO[this._fboIndex],this._compositeCommand.execute(e,this._upSamplePassState),this._frameIndex++,this._frameIndex===C$f&&(this._frameIndex=0))};var L$m=new f$10;a$i.prototype.update=function(e,t,i,r){var n=r.useLogDepth,o=(e=t.context).uniformState;this._uniformState=o,o.viewProjection.clone(this._prevViewProjectionMatrx);var a=e.drawingBufferWidth,s=e.drawingBufferHeight;this._scene=i,e$28(this._compositeCommand)&&n!==this._useLogDepth&&(this._useLogDepth=n,this.changeProgramDefine(n,"LOG_DEPTH")),e$28(this._compositeCommand)||this.createCommand(e);var l=!1;if(0==this._histroyFBO.length)l=!0;else{var u=this._histroyFBO[0],c=e$28(u)&&u.getColorTexture(0)||void 0;(!e$28(c)||c.width!==a||c.height!==s)&&(l=!0)}if(l){this.createFBO(a,s,e);var h=L$m;h.width=a,h.height=s;var d=u$R.fromCache({viewport:h});this._compositeCommand.renderState=d}this._upSamplePassState.context=e,this._fboIndex=(this._fboIndex+1)%2,r.jitterIndex=this._frameIndex,V$d(this,r,a,s),U$f(this)};var l$h=new o$1k;function V$d(e,t,i,r){var n=e._frameIndex%C$f,o=D$k[n],a=W$f[n],s=.47,l=Math.exp(-.565866908103214),u=2*Math.PI*a,c=s*Math.sqrt(-2*Math.log((1-o)*l+o)),h=c*Math.cos(u),d=c*Math.sin(u);e._jitterPixel.x=h,e._jitterPixel.y=d;var f=e._jitterPixel.x/i,p=e._jitterPixel.y/r;l$h.x=f,l$h.y=p,t.jitter=l$h,e._jitterUVOffset.x=-f/2,e._jitterUVOffset.y=-p/2}function U$f(e){var t,i,r=[],n=[],o=0;for(i=0;i<9;i++){var a=g$i[i].x-e._jitterPixel.x,s=g$i[i].y-e._jitterPixel.y;r[i]=Math.exp(-2.29*(a*a+s*s)),o+=r[i]}for(n[0]=r[1],n[1]=r[3],n[2]=r[4],n[3]=r[5],n[4]=r[7],t=r[1]+r[3]+r[4]+r[5]+r[7],i=0;i<9;i++)r[i]=r[i]/o;for(i=0;i<5;i++)n[i]=n[i]/t;e._sampleWeights=r,e._plusWeights=n}function H$i(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function R$i(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}a$i.prototype.createFBO=function(e,t,i){var r,n=y$U.FLOAT;for(r=0;r<this._histroyFBO.length;r++)this._histroyFBO[r].destroy();for(this._histroyFBO=[],r=0;r<2;r++){var o=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t,pixelDatatype:n})]});this._histroyFBO.push(o)}},a$i.prototype.createCommand=function(e){var t=new a$$({name:"TAAComposite",sources:[I$l]});this._useLogDepth&&t.defines.push("LOG_DEPTH"),this._compositeCommand=e.createViewportQuadCommand(t,{uniformMap:{},owner:this}),this.createUniformMap()},a$i.prototype.createUniformMap=function(){if(e$28(this._compositeCommand)){var e=this;this._compositeCommand.uniformMap.u_currentTexture=function(){return e._fbo.getColorTexture(0)},this._compositeCommand.uniformMap.u_historyTexture=function(){var t=(e._fboIndex+1)%2;return e._histroyFBO[t].getColorTexture(0)},this._compositeCommand.uniformMap.u_transformMatrix=function(){var t=e._uniformState.inverseView3D;return y$15.multiply(e._prevViewProjectionMatrx,t,e._transformMatrix),e._transformMatrix},this._compositeCommand.uniformMap.u_jitter=function(){return e._jitterUVOffset},this._compositeCommand.uniformMap.u_sampleSpatialWeight=function(){return e._sampleWeights},this._compositeCommand.uniformMap.u_offsets3x3=function(){return g$i}}},a$i.prototype.setInputFBO=function(e){this._fbo=e},a$i.prototype.getTAATexture=function(){return this._histroyFBO[this._fboIndex].getColorTexture(0)},a$i.prototype.getOutputFBO=function(){return this._histroyFBO[this._fboIndex]},a$i.prototype.changeProgramDefine=function(e,t){var i=this._scanCommand;if(e$28(i)){var r=i.shaderProgram.fragmentShaderSource,n=i.shaderProgram.vertexShaderSource;e?H$i(r,t):R$i(r,t),i.shaderProgram.destroy(),i.shaderProgram=ShaderProgram.fromCache({context:this._context,vertexShaderSource:n,fragmentShaderSource:r})}},a$i.prototype.isDestroyed=function(){return!1},a$i.prototype.destroy=function(){for(var e=0;e<this._histroyFBO.length;e++)this._histroyFBO[e].destroy();return this._compositeCommand=this._compositeCommand&&this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy(),i$Z(this)};var h$g={BLOOM:"BLOOM",COLOR_CORRECTION:"COLOR_CORRECTION",SCAN:"SCAN",SSAO:"SSAO",TONEMAPPING:"TONEMAPPING",ACES_TONEMAPPING:"ACES_TONEMAPPING",FILMIC_TONEMAPPING:"FILMIC_TONEMAPPING"};function o$r(e){this._fbo=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._upSamplePassState=new n$p,this.bloomEffect=void 0,this.colorCorrection=void 0,this.context=e,this.show=!1,this.bloomEffect=new e$i,this.colorCorrection=new o$t(e),this.depthOfFieldEffect=new n$l,this.SSAOEffect=new a$j,this.scanEffect=new c$e,this.temporalAA=new a$i,this.bloomEffect._owner=this,this.colorCorrection._owner=this,this.scanEffect._owner=this,this.SSAOEffect._owner=this,this.exposure=1,this.toneMappingWhitePoint=11.2,this._toneMappingEnabled=!1,this.inputTexture=void 0,this._outputFbo=void 0}Object.defineProperties(o$r.prototype,{toneMappingEnabled:{get:function(){return this._toneMappingEnabled},set:function(e){e!==this._toneMappingEnabled&&(this.toneMappingEnabledChange(e),this._toneMappingEnabled=e)}},outputFbo:{get:function(){return this._outputFbo},set:function(e){this._outputFbo=e}}}),o$r.prototype.isEnable=function(){return this.isTAAEnable()||this.isBloomEnable()||this.isColorCorrectionEnable()||this.isDOFEnable()||this.isScanEnable()||this.isSSAOEnable()||this._toneMappingEnabled},o$r.prototype.isBloomEnable=function(){return e$28(this.bloomEffect)&&this.bloomEffect.show},o$r.prototype.isColorCorrectionEnable=function(){return e$28(this.colorCorrection)&&this.colorCorrection.show},o$r.prototype.isDOFEnable=function(){return e$28(this.depthOfFieldEffect)&&this.depthOfFieldEffect.show},o$r.prototype.isSSAOEnable=function(){return e$28(this.SSAOEffect)&&this.SSAOEffect.show},o$r.prototype.isScanEnable=function(){return e$28(this.scanEffect)&&this.scanEffect.show},o$r.prototype.isTAAEnable=function(){return e$28(this.temporalAA)&&this.temporalAA.show},o$r.prototype.clear=function(e,t){this.isBloomEnable()&&this.bloomEffect.clear(e,t)},o$r.prototype.copy=function(e,t){this.inputTexture=t,this._fullScreenCommand.framebuffer=this._fbo,this._fullScreenCommand.execute(e),this.inputTexture=void 0},o$r.prototype.execute=function(e,t){this.isTAAEnable()&&this.temporalAA.execute(e),this.isDOFEnable()&&this.depthOfFieldEffect.execute(e),this.isScanEnable()&&this.scanEffect.execute(e),this.isBloomEnable()&&this.bloomEffect.execute(e,t),this.isSSAOEnable()&&this.SSAOEffect.execute(e,t),this.isEnable()&&(this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState))};var j$g=new f$10;function k$h(e,t){var i=!1;for(var r in e.defines)if(e.defines[r]===t){i=!0;break}i||e.defines.push(t)}function z$f(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function a$h(e,t){var i,r=t.terrainProvider,n=t.mapProjection,o=n.ellipsoid,a=t.camera.getRectangleCameraCoordinates(e);return i=t.mode===P$$.SCENE3D?o.cartesianToCartographic(a):n.unproject(a),e$28(r)?r.readyPromise.then((function(){if(!e$28(r.availability)||t.mode===P$$.SCENE2D)return i;var n=[h$10.center(e),h$10.southeast(e),h$10.southwest(e),h$10.northeast(e),h$10.northwest(e)];return a$h._sampleTerrainMostDetailed(r,n).then((function(e){var t=e.reduce((function(e,t){return Math.max(t.height,e)}),-Number.MAX_VALUE),r=i;return r.height+=isNaN(t)?0:t,r}))})):o$1q.resolve(i)}o$r.prototype.update=function(e,t,i,r){var n=r.useLogDepth;this.isTAAEnable()&&this.temporalAA.update(e,t,i,r),this.isDOFEnable()&&this.depthOfFieldEffect.update(e,t,i,n),this.isScanEnable()&&this.scanEffect.update(e,t,i,n),this.isBloomEnable()&&this.bloomEffect.update(e,t,i),this.isSSAOEnable()&&this.SSAOEffect.update(e,t,i,n);var o=(e=t.context).drawingBufferWidth,a=e.drawingBufferHeight;if(!e$28(this._blendCommand)){var s=new a$$({name:"CompositorFP",sources:[N$c]});this.isScanEnable()&&s.defines.push(h$g.SCAN),this.isBloomEnable()&&s.defines.push(h$g.BLOOM),this.isColorCorrectionEnable()&&s.defines.push(h$g.COLOR_CORRECTION),this.isSSAOEnable()&&s.defines.push(h$g.SSAO),this._toneMappingEnabled&&s.defines.push(h$g.TONEMAPPING);var l={};this._blendCommand=e.createViewportQuadCommand(s,{uniformMap:l,owner:this}),l={},this._fullScreenCommand=e.createViewportQuadCommand(v$j,{uniformMap:l,owner:this})}var u=this._fbo,c=e$28(u)&&u.getColorTexture(0)||void 0;if(!e$28(c)||c.width!==o||c.height!==a){u=u&&u.destroy();var h=[new L$17({context:e,width:o,height:a,pixelDatatype:e.colorBufferHalfFloat?y$U.HALF_FLOAT:y$U.FLOAT})];u=e.depthTexture?this._fbo=new a$z({context:e,colorTextures:h,depthTexture:new L$17({context:e,width:o,height:a,pixelFormat:V$O.DEPTH_COMPONENT,pixelDatatype:y$U.UNSIGNED_SHORT})}):this._fbo=new a$z({context:e,colorTextures:h,depthRenderbuffer:new o$C({context:e,format:M$q.DEPTH_COMPONENT16})});var d=j$g;d.width=o,d.height=a;var f=u$R.fromCache({viewport:d}),p=this;this._blendCommand.uniformMap.u_texture0=function(){return p.isTAAEnable()?p.temporalAA.getTAATexture():p.isDOFEnable()?p.depthOfFieldEffect.getDOFTexture():p.isScanEnable()?p.scanEffect.getScanTexture():u.getColorTexture(0)},this._blendCommand.uniformMap.u_ScanColor=function(){return p.scanEffect.color},this._blendCommand.uniformMap.u_BloomTexture=function(){return p.bloomEffect.getBloomTexture()},this._blendCommand.uniformMap.u_Bloom_DirtTex=function(){return p.bloomEffect.getBloomDirtTexture()},this._blendCommand.uniformMap.u_BloomTex_TexelSize=function(){return p.bloomEffect.getBloomTextureTexelSize()},this._blendCommand.uniformMap.u_Bloom_DirtTileOffset=function(){return p.bloomEffect.getDirtTileOffset()},this._blendCommand.uniformMap.u_Bloom_Settings=function(){return p.bloomEffect.getBloomSettings()},this._blendCommand.uniformMap.u_Bloom_Color=function(){return p.bloomEffect.getBloomColor()},this._blendCommand.uniformMap.u_AmbientOcclusionTexture=function(){return p.SSAOEffect.getAmbientOcclusionTexture()},this._blendCommand.uniformMap.u_brightness=function(){return p.colorCorrection.brightness},this._blendCommand.uniformMap.u_contrast=function(){return p.colorCorrection.contrast},this._blendCommand.uniformMap.u_saturation=function(){return p.colorCorrection.saturation},this._blendCommand.uniformMap.u_hue=function(){return p.colorCorrection.hue},this._blendCommand.uniformMap.u_exposure=function(){return p.exposure},this._blendCommand.uniformMap.u_toneMappingWhitePoint=function(){return p.toneMappingWhitePoint},this._blendCommand.renderState=f,this._fullScreenCommand.uniformMap.u_texture=function(){return u$Y(p.inputTexture,u.getColorTexture(0))},this._fullScreenCommand.renderState=f}return this.temporalAA.setInputFBO(u),this.isTAAEnable()&&(u=this.temporalAA.getOutputFBO()),this.depthOfFieldEffect.setInputFBO(u),this.SSAOEffect.setInputFBO(u),this.bloomEffect.setInputFBO(u),this.scanEffect.setInputFBO(u),this._upSamplePassState.context=e,this._fbo},o$r.prototype.getColorFramebuffer=function(){return this._fbo},o$r.prototype.isDestroyed=function(){return!1},o$r.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),e$28(this.bloomEffect)&&(this.bloomEffect.destroy(),this.bloomEffect=null),e$28(this.colorCorrection)&&(this.colorCorrection.destroy(),this.colorCorrection=null),e$28(this.SSAOEffect)&&(this.SSAOEffect.destroy(),this.SSAOEffect=null),e$28(this.DepthOfFieldEffect)&&(this.DepthOfFieldEffect.destroy(),this.DepthOfFieldEffect=null),e$28(this.ScanEffect)&&(this.ScanEffect.destroy(),this.ScanEffect=null),e$28(this.temporalAA)&&(this.temporalAA.destroy(),this.temporalAA=null),i$Z(this)},o$r.prototype.scanShowChange=function(e){this.changeProgramDefine(e,h$g.SCAN)},o$r.prototype.bloomShowChange=function(e){this.changeProgramDefine(e,h$g.BLOOM)},o$r.prototype.colorCorrectionShowChange=function(e){this.changeProgramDefine(e,h$g.COLOR_CORRECTION)},o$r.prototype.ssaoShowChange=function(e){this.changeProgramDefine(e,h$g.SSAO)},o$r.prototype.toneMappingEnabledChange=function(e){this.changeProgramDefine(e,h$g.TONEMAPPING)},o$r.prototype.changeProgramDefine=function(e,t){var i=this._blendCommand;if(e$28(i)){var r=i.shaderProgram.fragmentShaderSource,n=i.shaderProgram.vertexShaderSource;e?k$h(r,t):z$f(r,t),i.shaderProgram.destroy(),i.shaderProgram=S$T.fromCache({context:this.context,vertexShaderSource:n,fragmentShaderSource:r})}},a$h._sampleTerrainMostDetailed=y$J;var v$g=e$27.toRadians(30);function n$k(e){this._angle=u$Y(e,v$g)}Object.defineProperties(n$k.prototype,{angle:{get:function(){return this._angle},set:function(e){o$1u.typeOf.number("value",e),this._angle=e}}}),n$k.prototype.emit=function(e){var t=Math.tan(this._angle),i=e$27.randomBetween(0,e$27.TWO_PI),r=e$27.randomBetween(0,t),n=r*Math.cos(i),o=r*Math.sin(i);e.velocity=t$X.fromElements(n,o,1,e.velocity),t$X.normalize(e.velocity,e.velocity),e.position=t$X.clone(t$X.ZERO,e.position)};var e$e={DESIGN:0,NORMAL:1},ni$1=Object.freeze(e$e),W$e=/{[^}]+}/g,X$8={x:Q$e,y:ee$8,z:ie$6,s:ne$9,reverseX:$$b,reverseY:te$a,reverseZ:re$5,westDegrees:ae$7,southDegrees:oe$6,eastDegrees:ue$4,northDegrees:se$3,westProjected:ce$8,southProjected:le$7,eastProjected:he$4,northProjected:de$7,width:fe$5,height:me$7},J$e=p$17(X$8,{i:ge$7,j:ve$3,reverseI:_e$6,reverseJ:ye$4,longitudeDegrees:we$4,latitudeDegrees:pe$8,longitudeProjected:Te$4,latitudeProjected:Se$4,format:De$7});function _$i(e){if(!e$28(e))throw new t$Z("options is required.");if(!o$1q.isPromise(e)&&!e$28(e.url))throw new t$Z("options is required.");this._errorEvent=new o$1o,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function K$b(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}Object.defineProperties(_$i.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(){if(!this.ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this.ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this.ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this.ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this.ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return e$28(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){if(!this.ready)throw new t$Z("credit must not be called before the imagery provider is ready.");return this._credit}},hasAlphaChannel:{get:function(){if(!this.ready)throw new t$Z("hasAlphaChannel must not be called before the imagery provider is ready.");return this._hasAlphaChannel}}}),_$i.prototype.reinitialize=function(e){var t=this;t._readyPromise=o$1q(e).then((function(i){if(!e$28(i))throw new t$Z("options is required.");if(!e$28(i.url))throw new t$Z("options.url is required.");t._baseUrl=e.baseUrl;var r=i.customTags,n=p$17(X$8,r),o=p$17(J$e,r),a=t$S.createIfNeeded(i.url),s=t$S.createIfNeeded(i.pickFeaturesUrl);t.enablePickFeatures=u$Y(i.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=u$Y(i.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=i.tileDiscardPolicy,t._getFeatureInfoFormats=i.getFeatureInfoFormats,t._subdomains=i.subdomains,Array.isArray(t._subdomains)?t._subdomains=t._subdomains.slice():e$28(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=u$Y(i.tileWidth,256),t._tileHeight=u$Y(i.tileHeight,256),t._minimumLevel=u$Y(i.minimumLevel,0),t._maximumLevel=i.maximumLevel,t._tilingScheme=u$Y(i.tilingScheme,new c$10({ellipsoid:i.ellipsoid})),t._rectangle=u$Y(i.rectangle,t._tilingScheme.rectangle),t._rectangle=h$10.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=u$Y(i.hasAlphaChannel,!0);var l=i.credit;"string"==typeof l&&(l=new r$1a(l)),t._credit=l,t._resource=a,t._tags=n,t._pickFeaturesResource=s,t._pickFeaturesTags=o;var u=i.url;return t.tablename=i.url,new l$11({name:u}).then((function(e){e.checkObjectStoreExit(t.tablename)?t._indexedDBScheduler=e:e.createObjectStore(t.tablename).then((function(){t._indexedDBScheduler=e}))})),t._indexedDBSetting={isOpen:!1,clear:function(){t._indexedDBScheduler.clear(t.tablename)},cache:[]},!0}))},_$i.prototype.getTileCredits=function(e,t,i){if(!this.ready)throw new t$Z("getTileCredits must not be called before the imagery provider is ready.")},_$i.prototype.requestImage=function(e,t,i,r){if(!this.ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=M$k(this,e,t,i,r);if(e$28(a$Y.CREDENTIAL)&&(e$28(a$Y.CREDENTIAL._keymap[this._baseUrl])?n.url=a$Y.addTokenWithKey(this._baseUrl,n.url):n.url=a$Y.addToken(n.url)),e$28(this._customRequestHeaders)&&(n.headers=p$17(n.headers,this._customRequestHeaders)),r.quadKey=K$b(e,t,i),!0===this._indexedDBSetting.isOpen&&!0===r.cacheEnable){if(e$28(this._indexedDBScheduler)){var o=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey);return e$28(o)?o$1q(o,(function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):e$k.loadImage(this,n)}return e$k.loadImage(this,n)}return e$k.loadImage(this,n)},_$i.prototype.pickFeatures=function(e,t,i,r,n){if(!this.ready)throw new t$Z("pickFeatures must not be called before the imagery provider is ready.");if(this.enablePickFeatures&&e$28(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var o=0,a=this;return function l(){if(o>=a._getFeatureInfoFormats.length)return o$1q([]);var u=a._getFeatureInfoFormats[o],c=G$k(a,e,t,i,r,n,u.format);return++o,"json"===u.type?c.fetchJson().then(u.callback).otherwise(l):"xml"===u.type?c.fetchXML().then(u.callback).otherwise(l):"text"===u.type||"html"===u.type?c.fetchText().then(u.callback).otherwise(l):c.fetch({responseType:u.format}).then(s.bind(void 0,u)).otherwise(l)}()}function s(e,t){return e.callback(t)}};var P$g=!1,f$l=new h$10,F$f=!1,p$g=new h$10;function M$k(e,t,i,r,n){P$g=!1,F$f=!1;var o=e._resource,a=o.getUrlComponent(!0),s=e._tags,l={},u=a.match(W$e);return e$28(u)&&u.forEach((function(n){var o=n.substring(1,n.length-1);e$28(s[o])&&(l[o]=s[o](e,t,i,r))})),o.getDerivedResource({request:n,templateValues:l})}var E$k=!1,y$i=new o$1k,Z$d=!1;function G$k(e,t,i,r,n,o,a){P$g=!1,F$f=!1,E$k=!1,Z$d=!1;var s=e._pickFeaturesResource,l=s.getUrlComponent(!0),u=e._pickFeaturesTags,c={},h=l.match(W$e);return e$28(h)&&h.forEach((function(s){var l=s.substring(1,s.length-1);e$28(u[l])&&(c[l]=u[l](e,t,i,r,n,o,a))})),s.getDerivedResource({templateValues:c})}function b$l(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var r=e.urlSchemeZeroPadding[t];if("string"==typeof r){var n=r.length;n>1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function Q$e(e,t,i,r){return b$l(e,"{x}",t)}function $$b(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return b$l(e,"{reverseX}",n)}function ee$8(e,t,i,r){return b$l(e,"{y}",i)}function te$a(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return b$l(e,"{reverseY}",n)}function re$5(e,t,i,r){var n=e.maximumLevel;return b$l(e,"{reverseZ}",e$28(n)&&r<n?n-r-1:r)}function ie$6(e,t,i,r){return b$l(e,"{z}",r)}function ne$9(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function j$f(e,t,i,r){P$g||(e.tilingScheme.tileXYToRectangle(t,i,r,f$l),f$l.west=e$27.toDegrees(f$l.west),f$l.south=e$27.toDegrees(f$l.south),f$l.east=e$27.toDegrees(f$l.east),f$l.north=e$27.toDegrees(f$l.north),P$g=!0)}function ae$7(e,t,i,r){return j$f(e,t,i,r),f$l.west}function oe$6(e,t,i,r){return j$f(e,t,i,r),f$l.south}function ue$4(e,t,i,r){return j$f(e,t,i,r),f$l.east}function se$3(e,t,i,r){return j$f(e,t,i,r),f$l.north}function k$g(e,t,i,r){F$f||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,p$g),F$f=!0)}function ce$8(e,t,i,r){return k$g(e,t,i,r),p$g.west}function le$7(e,t,i,r){return k$g(e,t,i,r),p$g.south}function he$4(e,t,i,r){return k$g(e,t,i,r),p$g.east}function de$7(e,t,i,r){return k$g(e,t,i,r),p$g.north}function fe$5(e,t,i,r){return e.tileWidth}function me$7(e,t,i,r){return e.tileHeight}function ge$7(e,t,i,r,n,o,a){return I$k(e,t,i,r,n,o),y$i.x}function ve$3(e,t,i,r,n,o,a){return I$k(e,t,i,r,n,o),y$i.y}function _e$6(e,t,i,r,n,o,a){return I$k(e,t,i,r,n,o),e.tileWidth-y$i.x-1}function ye$4(e,t,i,r,n,o,a){return I$k(e,t,i,r,n,o),e.tileHeight-y$i.y-1}var be$4=new h$10,w$f=new t$X;function I$k(e,t,i,r,n,o,a){if(!E$k){A$k(e,t,i,r,n,o);var s=w$f,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,be$4);y$i.x=e.tileWidth*(s.x-l.west)/l.width|0,y$i.y=e.tileHeight*(l.north-s.y)/l.height|0,E$k=!0}}function we$4(e,t,i,r,n,o,a){return e$27.toDegrees(n)}function pe$8(e,t,i,r,n,o,a){return e$27.toDegrees(o)}function Te$4(e,t,i,r,n,o,a){return A$k(e,t,i,r,n,o),w$f.x}function Se$4(e,t,i,r,n,o,a){return A$k(e,t,i,r,n,o),w$f.y}var xe$5=new t$W;function A$k(e,t,i,r,n,o,a){if(!Z$d){if(e.tilingScheme instanceof c$10){var s=xe$5;s.longitude=n,s.latitude=o,e.tilingScheme.projection.project(s,w$f)}else w$f.x=e$27.toDegrees(n),w$f.y=e$27.toDegrees(o);Z$d=!0}}function De$7(e,t,i,r,n,o,a){return a}var y$h=new r$1a("MapQuest, Open Street Map and contributors, CC-BY-SA");function L$l(e){e=u$Y(e,{});var t=u$Y(e.url,"https://a.tile.openstreetmap.org/");t=n$1c(t),t+="{z}/{x}/{y}."+u$Y(e.fileExtension,"png");var i=t$S.createIfNeeded(t),r=new c$10({ellipsoid:e.ellipsoid}),n=u$Y(e.minimumLevel,0),o=e.maximumLevel,a=u$Y(e.rectangle,r.rectangle),s=r.positionToTileXY(h$10.southwest(a),n),l=r.positionToTileXY(h$10.northeast(a),n),u=(Math.abs(l.x-s.x)+1)*(Math.abs(l.y-s.y)+1);if(u>4)throw new t$Z("The rectangle and minimumLevel indicate that there are "+u+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var c=u$Y(e.credit,y$h);return"string"==typeof c&&(c=new r$1a(c)),new _$i({url:i,credit:c,tilingScheme:r,tileWidth:256,tileHeight:256,minimumLevel:n,maximumLevel:o,rectangle:a})}function y$g(e){var t=[],i=(e=u$Y(e,u$Y.EMPTY_OBJECT)).geometry;if(!e$28(i))throw new t$Z("options.geometry is required.");(!e$28(i.attributes)||!e$28(i.primitiveType))&&(i=i.constructor.createGeometry(i));var r=i.attributes,n=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),o=u$Y(e.length,1e4);if(e$28(r.normal)&&t.push(new d$15({geometry:k$Z.createLineSegmentsForVectors(i,"normal",o),attributes:{color:new o$18(1,0,0,1)},modelMatrix:n})),e$28(r.tangent)&&t.push(new d$15({geometry:k$Z.createLineSegmentsForVectors(i,"tangent",o),attributes:{color:new o$18(0,1,0,1)},modelMatrix:n})),e$28(r.bitangent)&&t.push(new d$15({geometry:k$Z.createLineSegmentsForVectors(i,"bitangent",o),attributes:{color:new o$18(0,0,1,1)},modelMatrix:n})),t.length>0)return new v$C({asynchronous:!1,geometryInstances:t,appearance:new r$J({flat:!0,translucent:!1})})}function te$9(e){if(!e$28((e=u$Y(e,{})).url))throw new t$Z("options.url is required.");var t,i,r,n=o$1q.defer(),o=new _$i(n.promise);function a(a){for(var s,u,c,h=/tileformat/i,d=/tileset/i,f=/tilesets/i,p=/boundingbox/i,_=[],m=a.childNodes[0].childNodes,$=0;$<m.length;$++)if(h.test(m.item($).nodeName))s=m.item($);else if(f.test(m.item($).nodeName)){c=m.item($);for(var g=m.item($).childNodes,v=0;v<g.length;v++)d.test(g.item(v).nodeName)&&_.push(g.item(v))}else p.test(m.item($).nodeName)&&(u=m.item($));var y;if(!e$28(c)||!e$28(u))return y="Unable to find expected tilesets or bbox attributes in "+r.url+".",void((t=l$13.handleError(t,o,o.errorEvent,y,void 0,void 0,void 0,l)).retry||n.reject(new t$U(y)));var x=u$Y(e.fileExtension,s.getAttribute("extension")),b=u$Y(e.tileWidth,parseInt(s.getAttribute("width"),10)),w=u$Y(e.tileHeight,parseInt(s.getAttribute("height"),10)),C=u$Y(e.minimumLevel,parseInt(_[0].getAttribute("order"),10)),T=u$Y(e.maximumLevel,parseInt(_[_.length-1].getAttribute("order"),10)),S=c.getAttribute("profile"),E=e.tilingScheme;if(!e$28(E))if("geodetic"===S||"global-geodetic"===S)E=new g$14({ellipsoid:e.ellipsoid});else{if("mercator"!==S&&"global-mercator"!==S)return y=r.url+"specifies an unsupported profile attribute, "+S+".",void((t=l$13.handleError(t,o,o.errorEvent,y,void 0,void 0,void 0,l)).retry||n.reject(new t$U(y)));E=new c$10({ellipsoid:e.ellipsoid})}var A=h$10.clone(e.rectangle);if(!e$28(A)){var P,I,M,O;u$Y(e.flipXY,!1)?(M=new o$1k(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),O=new o$1k(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(M=new o$1k(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),O=new o$1k(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));var D="geodetic"===S||"mercator"===S;if(E.projection instanceof n$1b||D)P=t$W.fromDegrees(M.x,M.y),I=t$W.fromDegrees(O.x,O.y);else{var R=E.projection;P=R.unproject(M),I=R.unproject(O)}A=new h$10(P.longitude,P.latitude,I.longitude,I.latitude)}A.west<E.rectangle.west&&(A.west=E.rectangle.west),A.east>E.rectangle.east&&(A.east=E.rectangle.east),A.south<E.rectangle.south&&(A.south=E.rectangle.south),A.north>E.rectangle.north&&(A.north=E.rectangle.north);var L=E.positionToTileXY(h$10.southwest(A),C),B=E.positionToTileXY(h$10.northeast(A),C);(Math.abs(B.x-L.x)+1)*(Math.abs(B.y-L.y)+1)>4&&(C=0);var N=i.getDerivedResource({url:"{z}/{x}/{reverseY}."+x});n.resolve({url:N,tilingScheme:E,rectangle:A,tileWidth:b,tileHeight:w,minimumLevel:C,maximumLevel:T,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit})}function s(t){var r=u$Y(e.fileExtension,"png"),o=u$Y(e.tileWidth,256),a=u$Y(e.tileHeight,256),s=u$Y(e.minimumLevel,0),l=e.maximumLevel,u=e$28(e.tilingScheme)?e.tilingScheme:new c$10({ellipsoid:e.ellipsoid}),c=u$Y(e.rectangle,u.rectangle),h=i.getDerivedResource({url:"{z}/{x}/{reverseY}."+r});n.resolve({url:h,tilingScheme:u,rectangle:c,tileWidth:o,tileHeight:a,minimumLevel:s,maximumLevel:l,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit})}function l(){r.fetchXML().then(a).otherwise(s)}return o$1q(e.url).then((function(e){(i=t$S.createIfNeeded(e)).appendForwardSlash(),r=i.getDerivedResource({url:"tilemapresource.xml"}),l()})).otherwise((function(e){n.reject(e)})),o}function g$h(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");var t=o$1q.defer();_$i.call(this,t.promise),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._deferred=t,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);var i,r=this;o$1q(e.url).then((function(e){(i=t$S.createIfNeeded(e)).appendForwardSlash(),r._tmsResource=i,r._xmlResource=i.getDerivedResource({url:"tilemapresource.xml"}),r._requestMetadata()})).otherwise((function(e){t.reject(e)}))}function n$j(e){if(!e$28((e=u$Y(e,{})).url))throw new t$Z("options.url is required.");if(!e$28(e.channel))throw new t$Z("options.channel is required.");var t=e.url,i=u$Y(e.path,"/default_map"),r=t$S.createIfNeeded(t).getDerivedResource({url:"/"===i[0]?i.substring(1):i});r.appendForwardSlash(),this._resource=r,this._url=t,this._path=i,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new r$1a('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+n$j.logoUrl+'" title="Google Imagery"/></a>'),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer();var n,o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),a=this;function s(t){var i,r;try{i=JSON.parse(t)}catch{i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var o,s=0;s<i.layers.length;s++)if(i.layers[s].id===a._channel){o=i.layers[s];break}if(!e$28(o))throw r="Could not find layer with channel (id) of "+a._channel+".",n=l$13.handleError(n,a,a._errorEvent,r,void 0,void 0,void 0,u),new t$U(r);if(!e$28(o.version))throw r="Could not find a version in channel (id) "+a._channel+".",n=l$13.handleError(n,a,a._errorEvent,r,void 0,void 0,void 0,u),new t$U(r);if(a._version=o.version,e$28(i.projection)&&"flat"===i.projection)a._tilingScheme=new g$14({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h$10(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:e.ellipsoid});else{if(e$28(i.projection)&&"mercator"!==i.projection)throw r="Unsupported projection "+i.projection+".",n=l$13.handleError(n,a,a._errorEvent,r,void 0,void 0,void 0,u),new t$U(r);a._tilingScheme=new c$10({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid})}a._ready=!0,a._readyPromise.resolve(!0),l$13.handleSuccess(n)}function l(e){var t="An error occurred while accessing "+o.url+".";n=l$13.handleError(n,a,a._errorEvent,t,void 0,void 0,void 0,u),a._readyPromise.reject(new t$U(t))}function u(){o$1q(o.fetchText(),s,l)}u()}e$28(Object.create)&&(g$h.prototype=Object.create(_$i.prototype),g$h.prototype.constructor=g$h),g$h.prototype._requestMetadata=function(){this._xmlResource.fetchXML().then(this._metadataSuccess).otherwise(this._metadataFailure)},g$h.prototype._metadataSuccess=function(e){for(var t,i,r,n=/tileformat/i,o=/tileset/i,a=/tilesets/i,s=/boundingbox/i,l=[],u=this._xmlResource,c=this._metadataError,h=this._deferred,d=this._requestMetadata,f=e.childNodes[0].childNodes,p=0;p<f.length;p++)if(n.test(f.item(p).nodeName))t=f.item(p);else if(a.test(f.item(p).nodeName)){r=f.item(p);for(var _=f.item(p).childNodes,m=0;m<_.length;m++)o.test(_.item(m).nodeName)&&l.push(_.item(m))}else s.test(f.item(p).nodeName)&&(i=f.item(p));var $;if(!e$28(r)||!e$28(i))return $="Unable to find expected tilesets or bbox attributes in "+u.url+".",(c=l$13.handleError(c,this,this.errorEvent,$,void 0,void 0,void 0,d)).retry||h.reject(new t$U($)),void(this._metadataError=c);var g=this._options,v=u$Y(g.fileExtension,t.getAttribute("extension")),y=u$Y(g.tileWidth,parseInt(t.getAttribute("width"),10)),x=u$Y(g.tileHeight,parseInt(t.getAttribute("height"),10)),b=u$Y(g.minimumLevel,parseInt(l[0].getAttribute("order"),10)),w=u$Y(g.maximumLevel,parseInt(l[l.length-1].getAttribute("order"),10)),C=r.getAttribute("profile"),T=g.tilingScheme;if(!e$28(T))if("geodetic"===C||"global-geodetic"===C)T=new g$14({ellipsoid:g.ellipsoid});else{if("mercator"!==C&&"global-mercator"!==C)return $=u.url+"specifies an unsupported profile attribute, "+C+".",(c=l$13.handleError(c,this,this.errorEvent,$,void 0,void 0,void 0,d)).retry||h.reject(new t$U($)),void(this._metadataError=c);T=new c$10({ellipsoid:g.ellipsoid})}var S=h$10.clone(g.rectangle);if(!e$28(S)){var E,A,P,I;u$Y(g.flipXY,!1)?(P=new o$1k(parseFloat(i.getAttribute("miny")),parseFloat(i.getAttribute("minx"))),I=new o$1k(parseFloat(i.getAttribute("maxy")),parseFloat(i.getAttribute("maxx")))):(P=new o$1k(parseFloat(i.getAttribute("minx")),parseFloat(i.getAttribute("miny"))),I=new o$1k(parseFloat(i.getAttribute("maxx")),parseFloat(i.getAttribute("maxy"))));var M="geodetic"===C||"mercator"===C;if(T.projection instanceof n$1b||M)E=t$W.fromDegrees(P.x,P.y),A=t$W.fromDegrees(I.x,I.y);else{var O=T.projection;E=O.unproject(P),A=O.unproject(I)}S=new h$10(E.longitude,E.latitude,A.longitude,A.latitude)}S.west<T.rectangle.west&&(S.west=T.rectangle.west),S.east>T.rectangle.east&&(S.east=T.rectangle.east),S.south<T.rectangle.south&&(S.south=T.rectangle.south),S.north>T.rectangle.north&&(S.north=T.rectangle.north);var D=T.positionToTileXY(h$10.southwest(S),b),R=T.positionToTileXY(h$10.northeast(S),b);(Math.abs(R.x-D.x)+1)*(Math.abs(R.y-D.y)+1)>4&&(b=0);var L=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+v});h.resolve({url:L,tilingScheme:T,rectangle:S,tileWidth:y,tileHeight:x,minimumLevel:b,maximumLevel:w,tileDiscardPolicy:g.tileDiscardPolicy,credit:g.credit})},g$h.prototype._metadataFailure=function(e){var t=this._options,i=u$Y(t.fileExtension,"png"),r=u$Y(t.tileWidth,256),n=u$Y(t.tileHeight,256),o=u$Y(t.minimumLevel,0),a=t.maximumLevel,s=e$28(t.tilingScheme)?t.tilingScheme:new c$10({ellipsoid:t.ellipsoid}),l=u$Y(t.rectangle,s.rectangle),u=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+i});this._deferred.resolve({url:u,tilingScheme:s,rectangle:l,tileWidth:r,tileHeight:n,minimumLevel:o,maximumLevel:a,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit})},Object.defineProperties(n$j.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(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},version:{get:function(){if(!this._ready)throw new t$Z("version must not be called before the imagery provider is ready.");return this._version}},requestType:{get:function(){if(!this._ready)throw new t$Z("requestType must not be called before the imagery provider is ready.");return this._requestType}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");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}}}),n$j.prototype.getTileCredits=function(e,t,i){},n$j.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=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 e$k.loadImage(this,n)},n$j.prototype.pickFeatures=function(e,t,i,r,n){},n$j._logoUrl=void 0,Object.defineProperties(n$j,{logoUrl:{get:function(){return e$28(n$j._logoUrl)||(n$j._logoUrl=n$17("Assets/Images/google_earth_credit.png")),n$j._logoUrl},set:function(e){o$1u.defined("value",e),n$j._logoUrl=e}}});var p$f=/\/$/,g$g=new r$1a('© <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 m$k(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).mapId;if(!e$28(t))throw new t$Z("options.mapId is required.");var i=t$S.createIfNeeded(u$Y(e.url,"https://{s}.tiles.mapbox.com/v4/")),r=e$1q.getAccessToken(e.accessToken);this._mapId=t,this._accessToken=r,this._accessTokenErrorCredit=r$1a.clone(e$1q.getErrorCredit(e.accessToken));var n=u$Y(e.format,"png");/\./.test(n)||(n="."+n),this._format=n;var o,a=i.getUrlComponent();p$f.test(a)||(a+="/"),a+=t+"/{z}/{x}/{y}"+this._format,i.url=a,i.setQueryParameters({access_token:r}),e$28(e.credit)?"string"==typeof(o=e.credit)&&(o=new r$1a(o)):o=g$g,this._resource=i,this._imageryProvider=new _$i({url:i,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function u$f(e){if(!e$28((e=u$Y(e,{})).url))throw new t$Z("options.url is required.");var t=t$S.createIfNeeded(e.url),i=new g$14({rectangle:u$Y(e.rectangle,h$10.MAX_VALUE),numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=i,this._resource=t,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o$1o,this._ready=!1,this._readyPromise=o$1q.defer();var r=e.credit;"string"==typeof r&&(r=new r$1a(r)),this._credit=r;var n,o=this;function a(e){o._image=e,o._tileWidth=e.width,o._tileHeight=e.height,o._ready=!0,o._readyPromise.resolve(!0),l$13.handleSuccess(o._errorEvent)}function s(e){var i="Failed to load image "+t.url+".";n=l$13.handleError(n,o,o._errorEvent,i,0,0,0,l,e),o._readyPromise.reject(new t$U(i))}function l(){o$1q(t.fetchImage(),a,s)}l()}function R$h(e,t,i){if(!e$28(e))throw new t$Z("type is required.");if(this.type=e,!e$28(t))if("json"===e)t="application/json";else if("xml"===e)t="text/xml";else if("html"===e)t="text/html";else{if("text"!==e)throw new t$Z('format is required when type is not "json", "xml", "html", or "text".');t="text/plain"}if(this.format=t,!e$28(i))if("json"===e)i=L$k;else if("xml"===e)i=M$j;else if("html"===e)i=S$a;else{if("text"!==e)throw new t$Z('callback is required when type is not "json", "xml", "html", or "text".');i=S$a}this.callback=i}function L$k(e){for(var t=[],i=e.features,r=0;r<i.length;++r){var n=i[r],o=new o$w;if(o.data=n,o.properties=n.properties,o.configureNameFromProperties(n.properties),o.configureDescriptionFromProperties(n.properties),e$28(n.geometry)&&"Point"===n.geometry.type){var a=n.geometry.coordinates[0],s=n.geometry.coordinates[1];o.position=t$W.fromDegrees(a,s)}t.push(o)}return t}Object.defineProperties(m$k.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}}}),m$k.prototype.getTileCredits=function(e,t,i){if(e$28(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},m$k.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},m$k.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},m$k._defaultCredit=g$g,Object.defineProperties(u$f.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return 0}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.")}},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}}}),u$f.prototype.getTileCredits=function(e,t,i){},u$f.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");return this._image},u$f.prototype.pickFeatures=function(e,t,i,r,n){};var d$l="http://www.mapinfo.com/mxp",D$j="http://www.esri.com/wms",P$f="http://www.opengis.net/wfs",C$e="http://www.opengis.net/gml";function M$j(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===d$l)return B$8(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===D$j)return x$h(e);if("FeatureCollection"===t.localName&&t.namespaceURI===P$f)return j$e(e);if("ServiceExceptionReport"===t.localName)throw new t$U((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?O$g(e):X$7(e)}function B$8(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(d$l,"Feature"),r=0;r<i.length;++r){for(var n=i[r],o={},a=n.getElementsByTagNameNS(d$l,"Val"),s=0;s<a.length;++s){var l=a[s];if(l.hasAttribute("ref")){var u=l.getAttribute("ref"),c=l.textContent.trim();o[u]=c}}var h=new o$w;h.data=n,h.properties=o,h.configureNameFromProperties(o),h.configureDescriptionFromProperties(o),t.push(h)}return t}function x$h(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(p$e(a,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),h=0;h<c.length;++h){var d=c[h];t={};for(var f=d.childNodes,p=0;p<f.length;++p){var _=f[p];_.nodeType===Node.ELEMENT_NODE&&(t[_.localName]=_.textContent)}r.push(p$e(d,t))}return r}function j$e(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(C$e,"featureMember"),r=0;r<i.length;++r){var n=i[r],o={};E$j(n,o),t.push(p$e(n,o))}return t}function O$g(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}if(!e$28(t))throw new t$U("Unable to find first child of the feature info xml document");for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};E$j(s,l),i.push(p$e(s,l))}}return i}function E$j(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&E$j(n,t)&&(t[n.localName]=n.textContent)}return i}function p$e(e,t){var i=new o$w;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function X$7(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var n=new o$w;return n.data=e,n.description=i.innerHTML,[n]}var z$e=/<body>\s*<\/body>/im,G$j=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,U$e=/<title>([\s\S]*)<\/title>/im;function S$a(e){if(!z$e.test(e)&&!G$j.test(e)){var t,i=U$e.exec(e);i&&i.length>1&&(t=i[1]);var r=new o$w;return r.name=t,r.description=e,r.data=e,[r]}}const j$d=[3034,3035,3042,3043,3044],w$e=[4471,4559];function m$j(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url))throw new t$Z("options.url is required.");if(!e$28(e.layers))throw new t$Z("options.layers is required.");if(e$28(e.times)&&!e$28(e.clock))throw new t$Z("options.times was specified, so options.clock is required.");this._baseUrl=e.url;var t=t$S.createIfNeeded(e.url),i=t.clone();t.setQueryParameters(m$j.DefaultParameters,!0),i.setQueryParameters(m$j.GetFeatureInfoDefaultParameters,!0),e$28(e.parameters)&&t.setQueryParameters(v$f(e.parameters)),e$28(e.getFeatureInfoParameters)&&i.setQueryParameters(v$f(e.getFeatureInfoParameters));var r=this;r._indexedDBSetting={isOpen:!1,clear:function(){r._indexedDBScheduler.clear(r.tablename)},cache:[]},this._reload=void 0,e$28(e.times)&&(this._timeDynamicImagery=new f$p({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,n,o){return g$f(r,e,t,i,n,o)},reloadFunction:function(){e$28(r._reload)&&r._reload()}})),this._useSrs=!1;var n={};if(n.layers=e.layers,n.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",n.width="{width}",n.height="{height}",parseFloat(t.queryParameters.version)>=1.3){n.crs=u$Y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof t$M?"EPSG:3857":"CRS:84");const t=n.crs.split(":");if("EPSG"===t[0]&&2===t.length){const e=Number(t[1]);(e>=4e3&&e<5e3&&!w$e.includes(e)||j$d.includes(e))&&(n.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else n.srs=u$Y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof t$M?"EPSG:3857":"EPSG:4326"),this._useSrs=!0;e.tilingScheme instanceof c$10&&e.tilingScheme.projection instanceof n$1b&&(n.srs="EPSG:0",this._useSrs=!0),t.setQueryParameters(n,!0),i.setQueryParameters(n,!0);var o={query_layers:e.layers,x:"{i}",y:"{j}",info_format:"{format}"};i.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new _$i({url:t,pickFeaturesUrl:i,tilingScheme:u$Y(e.tilingScheme,new g$14({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:u$Y(e.getFeatureInfoFormats,m$j.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures,baseUrl:this._baseUrl}),this._tileProvider._indexedDBSetting=this._indexedDBSetting,this._customRequestHeaders=e.customRequestHeaders,this._tileProvider._customRequestHeaders=e.customRequestHeaders,this._tilingScheme=this._tileProvider._tilingScheme,this._readyPromise=this._tileProvider._readyPromise}function g$f(e,t,i,r,n,o){var a=e$28(o)?o.data:void 0,s=e._tileProvider;return e$28(a)&&s._resource.setQueryParameters(a),s.requestImage(t,i,r,n)}function x$g(e,t,i,r,n,o,a){var s=e$28(a)?a.data:void 0,l=e._tileProvider;return e$28(s)&&l._pickFeaturesResource.setQueryParameters(s),l.pickFeatures(t,i,r,n,o)}function v$f(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}function o$q(e){return function(t){return new e(t)}}Object.defineProperties(m$j.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}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}}}),m$j.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},m$j.prototype.requestImage=function(e,t,i,r){var n,o,a=this._timeDynamicImagery;return e$28(a)&&(o=a.currentInterval,n=a.getFromCache(e,t,i,r)),e$28(n)||(n=g$f(this,e,t,i,r,o)),e$28(n)&&e$28(a)&&a.checkApproachingInterval(e,t,i,r),n},m$j.prototype.pickFeatures=function(e,t,i,r,n){var o=this._timeDynamicImagery;return x$g(this,e,t,i,r,n,e$28(o)?o.currentInterval:void 0)},m$j.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),m$j.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),m$j.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new R$h("json","application/json")),Object.freeze(new R$h("xml","text/xml")),Object.freeze(new R$h("text","text/html"))]);var A$j={ARCGIS_MAPSERVER:o$q(b$n),BING:o$q(o$v),GOOGLE_EARTH:o$q(n$j),MAPBOX:o$q(m$k),SINGLE_TILE:o$q(u$f),TMS:o$q(g$h),URL_TEMPLATE:o$q(_$i),WMS:o$q(m$j),WMTS:o$q(y$r)};function a$g(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).assetId;o$1u.typeOf.number("options.assetId",t),this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new o$1o;var i=this,r=n$T._createEndpointResource(t,e),n=e.assetId.toString()+e.accessToken+e.server,o=a$g._endpointCache[n];e$28(o)||(o=r.fetchJson(),a$g._endpointCache[n]=o),this._readyPromise=o.then((function(e){if("IMAGERY"!==e.type)return o$1q.reject(new t$U("Cesium ion asset "+t+" is not an imagery asset."));var n,o=e.externalType;if(e$28(o)){var a=A$j[o];if(!e$28(a))return o$1q.reject(new t$U("Unrecognized Cesium ion imagery type: "+o));n=a(e.options)}else n=new g$h({url:new n$T(e,r)});return i._tileCredits=n$T.getCreditsFromEndpoint(e,r),n.errorEvent.addEventListener((function(e){e.provider=i,i._errorEvent.raiseEvent(e)})),i._imageryProvider=n,n.readyPromise.then((function(){return i._ready=!0,!0}))}))}Object.defineProperties(a$g.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._imageryProvider.rectangle}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._imageryProvider.tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){if(!this._ready)throw new t$Z("credit must not be called before the imagery provider is ready.");return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){if(!this._ready)throw new t$Z("hasAlphaChannel must not be called before the imagery provider is ready.");return this._imageryProvider.hasAlphaChannel}}}),a$g.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new t$Z("getTileCredits must not be called before the imagery provider is ready.");var r=this._imageryProvider.getTileCredits(e,t,i);return e$28(r)?this._tileCredits.concat(r):this._tileCredits},a$g.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");return this._imageryProvider.requestImage(e,t,i,r)},a$g.prototype.pickFeatures=function(e,t,i,r,n){if(!this._ready)throw new t$Z("pickFeatures must not be called before the imagery provider is ready.");return this._imageryProvider.pickFeatures(e,t,i,r,n)},a$g._endpointCache={};var e$d={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},n$i=Object.freeze(e$d);function o$p(e){return e=u$Y(e,u$Y.EMPTY_OBJECT),new a$g({assetId:u$Y(e.style,n$i.AERIAL)})}var L$j=576,A$i=100,g$e="#ffffff",_$h="#48b";function I$j(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];if(r$1a.equals(n,t))return!0}return!1}function O$f(e){var t=e._previousCesiumCredit,i=e._currentCesiumCredit;r$1a.equals(i,t)||(e$28(t)&&e._cesiumCreditContainer.removeChild(t.element),e$28(i)&&e._cesiumCreditContainer.appendChild(i.element),e._previousCesiumCredit=i)}var k$f="cesium-credit-delimiter",v$e;function E$i(e){var t=document.createElement("span");return t.textContent=e,t.className=k$f,t}function N$b(e,t){if(e$28(t)){var i=document.createElement(t);i._creditId=e._creditId,i.appendChild(e),e=i}return e}function F$e(e,t,i,r){for(var n=e.childNodes,o=-1,a=0;a<t.length;++a){var s=t[a];if(e$28(s)){if(o=a,e$28(i)&&(o*=2,a>0)){var l=o-1;if(n.length<=l)e.appendChild(E$i(i));else{var u=n[l];u.className!==k$f&&e.replaceChild(E$i(i),u)}}var c=s.element;if(n.length<=o)e.appendChild(N$b(c,r));else{var h=n[o];h._creditId!==s._id&&e.replaceChild(N$b(c,r),h)}}}for(++o;o<n.length;)e.removeChild(n[o])}function q$c(e){var t=e._lightboxCredits,i=e.viewport.clientWidth,r=e.viewport.clientHeight;i!==e._lastViewportWidth&&(i<L$j?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px"),e._lastViewportWidth=i),i>=L$j&&r!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px",e._lastViewportHeight=r)}function o$o(e,t){var i=e+" {";for(var r in t)t.hasOwnProperty(r)&&(i+=r+": "+t[r]+"; ");return i+=" }\n"}function S$9(){var e="";e+=o$o(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=o$o(".cesium-credit-lightbox",{"background-color":"#303336",color:g$e,position:"relative","min-height":A$i+"px",margin:"auto"}),e+=o$o(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:g$e}),e+=o$o(".cesium-credit-lightbox > ul > li a:hover",{color:_$h}),e+=o$o(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=o$o(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=o$o(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=o$o(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:g$e}),e+=o$o(".cesium-credit-lightbox-close:hover",{color:_$h}),e+=o$o(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=o$o(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=o$o(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=o$o(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:g$e}),e+=o$o(".cesium-credit-expand-link:hover",{color:_$h}),e+=o$o(".cesium-credit-text",{color:g$e}),e+=o$o(".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 r$k(e,t,i){o$1u.defined("container",e);var r=this;i=u$Y(i,document.body);var n=document.createElement("div");n.className="cesium-credit-lightbox-overlay",i.appendChild(n);var o=document.createElement("div");function a(e){o.contains(e.target)||r.hideLightbox()}o.className="cesium-credit-lightbox",n.appendChild(o),n.addEventListener("click",a,!1);var s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",o.appendChild(s);var l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",o.appendChild(l);var u=document.createElement("ul");o.appendChild(u);var c=document.createElement("div");c.className="cesium-credit-logoContainer",c.style.display="inline",e.appendChild(c);var h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);var d=document.createElement("a");d.className="cesium-credit-expand-link",d.onclick=this.showLightbox.bind(this),d.textContent="Data attribution",e.appendChild(d),S$9();var f=r$1a.clone(r$k.cesiumCredit);this._delimiter=u$Y(t," â€? "),this._screenContainer=h,this._cesiumCreditContainer=c,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=u,this._lightbox=n,this._hideLightbox=a,this._expandLink=d,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=f,this._previousCesiumCredit=void 0,this._currentCesiumCredit=f,this._currentFrameCredits={screenCredits:new e$1P,lightboxCredits:new e$1P},this._defaultCredit=void 0,this.viewport=i,this.container=e}function H$h(){if(!e$28(v$e)){var e=n$17("Assets/Images/logo.png");v$e=new r$1a('<a href="http://www.supermap.com" target="_blank"><img src="'+e+'" title="SuperMap"/></a>',!0)}return r$k._cesiumCreditInitialized||(r$k._cesiumCredit=v$e,r$k._cesiumCreditInitialized=!0),v$e}function r$j(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._sceneDepthBuffer=void 0,this._cameraDepthBuffer=void 0,this._boundingSphere=new i$19,this._qureyRegion=[],this._waterHeight=0,this._polygonTexture=null,this._damBreakPosition=[0,0,0],this._frameState=void 0,this._update=!0,this._name="",this._sceneName="",this._cameraName="",this._checking=!1}function h$f(e){e$28(e._polygonTexture)&&(e._polygonTexture=e._polygonTexture&&e._polygonTexture.destroy(),e._polygonTexture=null)}function i$e(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).attributeName,i=e.perInstanceAttribute;if(!e$28(t))throw new t$Z("options.attributeName is required.");e$28(i)||(i=!1);var r,n=u$Y(e.glslDatatype,"vec3"),o="v_"+t;if("normal"===t||"tangent"===t||"bitangent"===t)r="vec4 getColor() { return vec4(("+o+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===t&&(n="vec2"),n){case"float":r="vec4 getColor() { return vec4(vec3("+o+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+o+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+o+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+o+"; }\n";break;default:throw new t$Z("options.glslDatatype must be float, vec2, vec3, or vec4.")}var a="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(i?"":"attribute "+n+" "+t+";\n")+"varying "+n+" "+o+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(i?o+" = czm_batchTable_"+t+"(batchId);\n":o+" = "+t+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",s="varying "+n+" "+o+";\n"+r+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=u$Y(e.translucent,!1),this._vertexShaderSource=u$Y(e.vertexShaderSource,a),this._fragmentShaderSource=u$Y(e.fragmentShaderSource,s),this._renderState=a$P.getDefaultRenderState(!1,!1,e.renderState),this._closed=u$Y(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function s$f(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.length=u$Y(e.length,1e7),this._length=void 0,this.width=u$Y(e.width,2),this._width=void 0,this.show=u$Y(e.show,!0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=new y$15,this.id=e.id,this._id=void 0,this._primitive=void 0}r$k.prototype.addCredit=function(e){if(o$1u.defined("credit",e),e._isIon)return e$28(this._defaultCredit)||(this._defaultCredit=r$1a.clone(H$h())),void(this._currentCesiumCredit=this._defaultCredit);e.showOnScreen?this._currentFrameCredits.screenCredits.set(e.id,e):this._currentFrameCredits.lightboxCredits.set(e.id,e)},r$k.prototype.addDefaultCredit=function(e){o$1u.defined("credit",e);var t=this._defaultCredits;I$j(t,e)||t.push(e)},r$k.prototype.removeDefaultCredit=function(e){o$1u.defined("credit",e);var t=this._defaultCredits,i=t.indexOf(e);-1!==i&&t.splice(i,1)},r$k.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},r$k.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},r$k.prototype.update=function(){this._expanded&&q$c(this)},r$k.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,r=0;r<i.length;++r){var n=i[r];t.set(n.id,n)}e.lightboxCredits.removeAll(),r$1a.equals(r$k.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=r$1a.clone(r$k.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},r$k.prototype.endFrame=function(){var e=this._currentFrameCredits.screenCredits.values;F$e(this._screenContainer,e,this._delimiter,void 0);var t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",F$e(this._creditList,t,void 0,"li"),O$f(this)},r$k.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),i$Z(this)},r$k.prototype.isDestroyed=function(){return!1},r$k._cesiumCredit=void 0,r$k._cesiumCreditInitialized=!1,Object.defineProperties(r$k,{cesiumCredit:{get:function(){return H$h(),r$k._cesiumCredit},set:function(e){r$k._cesiumCredit=e,r$k._cesiumCreditInitialized=!0}}}),Object.defineProperties(r$j.prototype,{damBreakPosition:{get:function(){return this._damBreakPosition},set:function(e){this._damBreakPosition=e,this._update=!0}},waterHeight:{get:function(){return this._waterHeight},set:function(e){this._waterHeight=e,this._update=!0}}}),r$j.prototype.destroy=function(){return h$f(this),i$Z(this)},r$j.prototype.build=function(){""!==this._name||this._checking||(this._name="damBreakAnalysis"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_scene",this._cameraName=this._name+"_camera",this._scene._analyst3D.add(this))},r$j.prototype.qureyRegion=function(e){if(!e$28(e)||!e$28(e.position))throw new t$Z("the options is required");this._qureyRegion=e.position,this._update=!0},r$j.prototype.setTerrainBlock=function(e){},r$j.prototype.update=function(e,t,i){if("water"!==t._fboState.name&&!t.passes.pick){if(t._fboState.enabled&&(t._fboState.name===this._sceneName||t._fboState.name===this._cameraName))return void(t._fboState.name===this._sceneName&&e$28(this._stencilCommand)&&i.push(this._stencilCommand));var r=t.camera;r.bReflect||(y$15.multiply(this._viewProjMatrix,r.inverseViewMatrix,this._renderTextureMatrix),this._update&&(this._frameState=t,e$28(this._cameraDepthBuffer)||(this._cameraDepthBuffer=new s$h(e),this._cameraDepthBuffer.environmentVisible.isObjectVisible=!0,this._cameraDepthBuffer.environmentVisible.isGlobalVisible=!0,this._cameraDepthBuffer._visibleViewport=this._visibleViewport,t._framebufferList[this._cameraName]=this._cameraDepthBuffer),this._update=!1,h$f(this),updateCamera(this,e,t),updateViewShed(this,e,t)),e$28(this._cameraDepthBuffer.framebuffer)&&i.push(correct))}},Object.defineProperties(i$e.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),i$e.prototype.getFragmentShaderSource=a$P.prototype.getFragmentShaderSource,i$e.prototype.isTranslucent=a$P.prototype.isTranslucent,i$e.prototype.getRenderState=a$P.prototype.getRenderState,s$f.prototype.update=function(e){if(this.show){if(!e$28(this._primitive)||!y$15.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=y$15.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,e$28(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var t=new d$15({geometry:new R$J({positions:[t$X.ZERO,t$X.UNIT_X],width:this.width,vertexFormat:e$17.VERTEX_FORMAT,colors:[e$1S.RED,e$1S.RED],arcType:m$_.NONE}),modelMatrix:y$15.multiplyByUniformScale(this.modelMatrix,this.length,new y$15),id:this.id,pickPrimitive:this}),i=new d$15({geometry:new R$J({positions:[t$X.ZERO,t$X.UNIT_Y],width:this.width,vertexFormat:e$17.VERTEX_FORMAT,colors:[e$1S.GREEN,e$1S.GREEN],arcType:m$_.NONE}),modelMatrix:y$15.multiplyByUniformScale(this.modelMatrix,this.length,new y$15),id:this.id,pickPrimitive:this}),r=new d$15({geometry:new R$J({positions:[t$X.ZERO,t$X.UNIT_Z],width:this.width,vertexFormat:e$17.VERTEX_FORMAT,colors:[e$1S.BLUE,e$1S.BLUE],arcType:m$_.NONE}),modelMatrix:y$15.multiplyByUniformScale(this.modelMatrix,this.length,new y$15),id:this.id,pickPrimitive:this});this._primitive=new v$C({geometryInstances:[t,i,r],appearance:new e$17,asynchronous:!1})}this._primitive.update(e)}},s$f.prototype.isDestroyed=function(){return!1},s$f.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),i$Z(this)};var N$a="varying vec4 positionEC;\nvoid main()\n{\nvec3 direction = normalize(positionEC.xyz);\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);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\nczm_writeLogDepth();\n}\n",Q$d="attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n}\n";function c$d(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1}var f$k=s$V.supportsTypedArrays()?new Float32Array(12):[],L$i=new t$X,x$f=new t$X,C$d=new t$X,s$e=new t$X;function V$c(e,t){var i=e.radii,r=t.camera.positionWC,n=t$X.multiplyComponents(e.oneOverRadii,r,L$i),o=t$X.magnitude(n),a=t$X.normalize(n,x$f),s=t$X.normalize(t$X.cross(t$X.UNIT_Z,n,C$d),C$d),l=t$X.normalize(t$X.cross(a,s,s$e),s$e),u=Math.sqrt(t$X.magnitudeSquared(n)-1),c=t$X.multiplyByScalar(a,1/o,L$i),h=u/o,d=t$X.multiplyByScalar(s,h,x$f),f=t$X.multiplyByScalar(l,h,C$d),p=t$X.add(c,f,s$e);t$X.subtract(p,d,p),t$X.multiplyComponents(i,p,p),t$X.pack(p,f$k,0);var _=t$X.subtract(c,f,s$e);t$X.subtract(_,d,_),t$X.multiplyComponents(i,_,_),t$X.pack(_,f$k,3);var m=t$X.add(c,f,s$e);t$X.add(m,d,m),t$X.multiplyComponents(i,m,m),t$X.pack(m,f$k,6);var $=t$X.subtract(c,f,s$e);return t$X.add($,d,$),t$X.multiplyComponents(i,$,$),t$X.pack($,f$k,9),f$k}function _$g(){}c$d.prototype.update=function(e){if(this._mode=e.mode,e.mode===P$$.SCENE3D){var t=e.context,i=e.mapProjection.ellipsoid,r=e.useLogDepth;if(e$28(this._command)||(this._rs=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new r$15({renderState:this._rs,boundingVolume:new i$19(t$X.ZERO,i.maximumRadius),pass:Le$p.OPAQUE,owner:this})),!e$28(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;var n=new a$$({sources:[Q$d]}),o=new a$$({sources:[N$a]});if(r){o.sources.push("#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),o.defines.push("LOG_DEPTH"),n.defines.push("LOG_DEPTH")}this._sp=S$T.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}var a=V$c(i,e);if(e$28(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(a);else{var s=new I$1n({attributes:{position:new o$1g({componentDatatype:S$W.FLOAT,componentsPerAttribute:3,values:a})},indices:[0,1,2,2,1,3],primitiveType:W$_.TRIANGLES});this._va=m$19.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:A$1c.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},c$d.prototype.execute=function(e,t){this._mode===P$$.SCENE3D&&this._command.execute(e,t)},c$d.prototype.isDestroyed=function(){return!1},c$d.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var D$i=/\bgl_FragDepthEXT\b/,k$e=/\bdiscard\b/;function x$e(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!e$28(i)){var r=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length;for(h=0;h<s;++h)if(D$i.test(a[h])||k$e.test(a[h])){o=!0;break}var l=!1,u=n.defines;for(s=u.length,h=0;h<s;++h)if("LOG_DEPTH"===u[h]){l=!0;break}if(e.depthTexture)o||l?!o&&l&&(n=new a$$({defines:["LOG_DEPTH"],sources:["#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeLogDepth(); \n} \n"]})):n=new a$$({sources:["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"]});else if(o||l)if(!o&&l)n=new a$$({defines:["LOG_DEPTH"],sources:["#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n gl_FragColor = czm_packDepth(gl_FragCoord.z);\n czm_writeLogDepth(); \n} \n"]});else{s=a.length;for(var c=new Array(s+1),h=0;h<s;++h)c[h]=a$$.replaceMain(a[h],"pick_depth_old_main");var d="void main() \n{ \n pick_depth_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = "+(l?"czm_packDepth(gl_FragDepthEXT)":"czm_packDepth(gl_FragCoord.z)")+";\n} \n";c[s]=d;for(var f=[],p=0;p<u.length;p++){var _=n.defines[p];f.push(_)}n=new a$$({sources:c,defines:f})}else n=new a$$({sources:["void main() \n{ \n gl_FragColor = czm_packDepth(gl_FragCoord.z);\n} \n"]});i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function O$e(e,t,i){var r=e._depthOnlyRenderStateCache,n=r[t.id];if(!e$28(n)){var o=u$R.getState(t);o.depthMask=!0,e._context.depthTexture&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),e$28(i)&&(o.viewport=void 0),n=u$R.fromCache(o),r[t.id]=n}return n}_$g.createDepthOnlyDerivedCommand=function(e,t,i,r){var n,o;return e$28(r)||(r={}),e$28(r.depthOnlyCommand)&&(n=r.depthOnlyCommand.shaderProgram,o=r.depthOnlyCommand.renderState),r.depthOnlyCommand=r$15.shallowClone(t,r.depthOnlyCommand),e$28(n)&&r.shaderProgramId===t.shaderProgram.id?(r.depthOnlyCommand.shaderProgram=n,r.depthOnlyCommand.renderState=o):(r.depthOnlyCommand.shaderProgram=x$e(i,t.shaderProgram),r.depthOnlyCommand.renderState=O$e(e,t.renderState,r.depthOnlyCommand._pointCloudEyeDomeLighting),r.shaderProgramId=t.shaderProgram.id),r.depthOnlyCommand._pointCloudEyeDomeLighting&&(r.depthOnlyCommand.framebuffer=void 0),r};var E$h=/\s+czm_writeLogDepth\(/,F$d=/\s+czm_vertexLogDepth\(/,R$g=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;function G$i(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!e$28(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();n.defines=e$28(n.defines)?n.defines.slice(0):[],n.defines.push("LOG_DEPTH"),o.defines=e$28(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH");var a,s=!1,l=n.sources,u=l.length;for(a=0;a<u;++a)if(F$d.test(l[a])){s=!0;break}if(!s){for(a=0;a<u;++a)l[a]=a$$.replaceMain(l[a],"czm_log_depth_main");"\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n",l.push("\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n")}var c=!0;for(s=!1,u=(l=o.sources).length,a=0;a<u;++a)E$h.test(l[a])&&(s=!0),R$g.test(l[a])&&(c=!1);var h="";if(c&&(h+="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),!s){for(a=0;a<u;a++)l[a]=a$$.replaceMain(l[a],"czm_log_depth_main");h+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}l.push(h),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:r})}return i}function s$d(e,t,i){var r=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!e$28(r)){var n=t._attributeLocations,o=t.fragmentShaderSource,a=o.sources,s=a.length,l="";l="vSecondColor"===i?"uniform float uTransparentFilter;\nvoid main() \n{ \n czm_non_pick_main(); \n if (gl_FragColor.a < uTransparentFilter) { \n discard; \n } \n gl_FragColor = "+i+"; \n} \n":"void main() \n{ \n czm_non_pick_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = "+i+"; \n} \n";for(var u=new Array(s+1),c=0;c<s;++c)u[c]=a$$.replaceMain(a[c],"czm_non_pick_main");u[s]=l,o=new a$$({sources:u,defines:o.defines}),r=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:n})}return r}function w$d(e,t){var i=e._pickRenderStateCache,r=i[t.id];if(!e$28(r)){var n=u$R.getState(t);n.blending.enabled=!1,n.depthMask=!0,r=u$R.fromCache(n),i[t.id]=r}return r}function u$e(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!e$28(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();n.defines=e$28(n.defines)?n.defines.slice(0):[],n.defines.push("HDR"),o.defines=e$28(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),i=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:r})}return i}function H$g(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"NORMAL");if(!e$28(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();o.defines=e$28(o.defines)?o.defines.slice(0):[],o.defines.push("NORMAL"),i=e.shaderCache.createDerivedShaderProgram(t,"NORMAL",{vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:r})}return i}function I$i(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"mask");if(!e$28(i)){var r,n=t._attributeLocations,o=t.fragmentShaderSource,a=o.sources,s=a.length;for(r=0;r<s&&(!D$i.test(a[r])&&!k$e.test(a[r]));++r);var l=o.defines;for(s=l.length,r=0;r<s&&"LOG_DEPTH"!==l[r];++r);o=new a$$({defines:["LOG_DEPTH"],sources:[["#ifdef GL_EXT_frag_depth","#extension GL_EXT_frag_depth : enable","#endif","uniform sampler2D uNonSelDepthTexture;","varying vec4 vColor;","varying vec2 fSelected;","void main() {"," if(vColor.a < 0.1 || fSelected.x < 0.1){discard;}","\tfloat depth = czm_unpackDepth(texture2D(czm_nonSelDepthTexture, gl_FragCoord.xy / czm_viewport.zw));"," depth = czm_reverseLogDepth(depth);"," vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);"," if(-positionEC.z > 10000.0){discard;}"," float near = czm_currentFrustum.x;"," float far = czm_currentFrustum.y;"," float viewZ = -( near * far ) / ( ( far - near ) * depth - far );"," float depthTest = (-positionEC.z > viewZ) && (depth > 0.00001) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);"," czm_writeLogDepth();","}"].join("\n")]}),i=e.shaderCache.createDerivedShaderProgram(t,"mask",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:n})}return i}function h$e(e){if(!e$28(e))throw new t$Z("scene is required.");this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var t=this;function i(e){var i=e.alpha;if(!e$28(i))return t._alpha=void 0,t._beta=void 0,void(t._gamma=void 0);t._alpha=e$27.toRadians(i),t._beta=e$27.toRadians(e.beta),t._gamma=e$27.toRadians(e.gamma)}window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}_$g.createLogDepthCommand=function(e,t,i){var r;return e$28(i)||(i={}),e$28(i.command)&&(r=i.command.shaderProgram),i.command=r$15.shallowClone(e,i.command),e$28(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=G$i(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},_$g.createPickDerivedCommand=function(e,t,i,r){var n,o;return e$28(r)||(r={}),e$28(r.pickCommand)&&(n=r.pickCommand.shaderProgram,o=r.pickCommand.renderState),r.pickCommand=r$15.shallowClone(t,r.pickCommand),e$28(n)&&r.shaderProgramId===t.shaderProgram.id?(r.pickCommand.shaderProgram=n,r.pickCommand.renderState=o):(r.pickCommand.shaderProgram=s$d(i,t.shaderProgram,t.pickId),r.pickCommand.renderState=w$d(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),e.pickPointEnabled&&t.pass===Le$p.S3MTiles&&(r.pickCommand.primitiveType=W$_.POINTS),r},_$g.createHdrCommand=function(e,t,i){var r;return e$28(i)||(i={}),e$28(i.command)&&(r=i.command.shaderProgram),i.command=r$15.shallowClone(e,i.command),e$28(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=u$e(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},_$g.createNormalDerivedCommand=function(e,t,i){var r;return e$28(i)||(i={}),e$28(i.command)&&(r=i.command.shaderProgram),i.command=r$15.shallowClone(e,i.command),e$28(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=H$g(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},_$g.createMaskCommand=function(e,t,i){var r;return e$28(i)||(i={}),e$28(i.command)&&(r=i.command.shaderProgram),i.command=r$15.shallowClone(e,i.command),e$28(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=I$i(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i};var b$k=new n$14,f$j=new n$14,A$h=new p$1a;function w$c(e,t,i,r){var n=e.direction,o=e.right,a=e.up,s=n$14.fromAxisAngle(n,i,f$j),l=n$14.fromAxisAngle(o,r,b$k),u=n$14.multiply(l,s,l),c=n$14.fromAxisAngle(a,t,f$j);n$14.multiply(c,u,u);var h=p$1a.fromQuaternion(u,A$h);p$1a.multiplyByVector(h,o,o),p$1a.multiplyByVector(h,a,a),p$1a.multiplyByVector(h,n,n)}function r$i(e){this.blobSize=u$Y(e,0)}h$e.prototype.update=function(){if(e$28(this._alpha)){e$28(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;w$c(this._scene.camera,-e,t,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},h$e.prototype.isDestroyed=function(){return!1},h$e.prototype.destroy=function(){return this._removeListener(),i$Z(this)},r$i.prototype.isReady=function(){return!0},new e$25,r$i.prototype.shouldDiscardImage=function(e){return e.blob.size===this.blobSize};var I$h="#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ray ray = czm_ray(t * direction, direction);\nvec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + positionCC.w);\n#else\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n#endif\n}\n",O$d="attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\nczm_vertexLogDepth();\n}\n",S$8={position:0};function p$d(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.center=t$X.clone(u$Y(e.center,t$X.ZERO)),this._center=new t$X,this.radii=t$X.clone(e.radii),this._radii=new t$X,this._oneOverEllipsoidRadiiSquared=new t$X,this._boundingSphere=new i$19,this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=new y$15,this._computedModelMatrix=new y$15,this.show=u$Y(e.show,!0),this.material=u$Y(e.material,a$O.fromType(a$O.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.onlySunLighting=u$Y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=u$Y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new r$15({owner:u$Y(e._owner,this)}),this._pickCommand=new r$15({owner:u$Y(e._owner,this),pickOnly:!0});var t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function F$c(e){var t=e.cache.ellipsoidPrimitive_vertexArray;if(e$28(t))return t;var i=O$H.createGeometry(O$H.fromDimensions({dimensions:new t$X(2,2,2),vertexFormat:n$10.POSITION_ONLY}));return t=m$19.fromGeometry({context:e,geometry:i,attributeLocations:S$8,bufferUsage:A$1c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}var C$c="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";p$d.prototype.update=function(e){if(this.show&&e.mode===P$$.SCENE3D&&e$28(this.center)&&e$28(this.radii)){if(!e$28(this.material))throw new t$Z("this.material must be defined.");var t=e.context,i=this.material.isTranslucent(),r=this._translucent!==i;(!e$28(this._rs)||r)&&(this._translucent=i,this._rs=u$R.fromCache({cull:{enabled:!0,face:k$11.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!i&&t.fragmentDepth,blending:i?Ee$n.ALPHA_BLEND:void 0})),e$28(this._va)||(this._va=F$c(t));var n=!1,o=this.radii;if(!t$X.equals(this._radii,o)){t$X.clone(o,this._radii);var a=this._oneOverEllipsoidRadiiSquared;a.x=1/(o.x*o.x),a.y=1/(o.y*o.y),a.z=1/(o.z*o.z),n=!0}(!y$15.equals(this.modelMatrix,this._modelMatrix)||!t$X.equals(this.center,this._center))&&(y$15.clone(this.modelMatrix,this._modelMatrix),t$X.clone(this.center,this._center),y$15.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),n=!0),n&&(t$X.clone(t$X.ZERO,this._boundingSphere.center),this._boundingSphere.radius=t$X.maximumComponent(o),i$19.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var s=this._material!==this.material;this._material=this.material,this._material.update(t);var l=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var u=e.useLogDepth,c=this._useLogDepth!==u;this._useLogDepth=u;var h,d,f=this._colorCommand;(s||l||r||c)&&(h=new a$$({sources:[O$d]}),d=new a$$({sources:[this.material.shaderSource,I$h]}),this.onlySunLighting&&d.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&d.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),d.defines.push("LOG_DEPTH"),d.sources.push(C$c)),this._sp=S$T.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:S$8}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=p$17(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=i);var p=e.commandList,_=e.passes;if(_.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=i?Le$p.TRANSLUCENT:Le$p.OPAQUE,p.push(f)),_.pick){var m=this._pickCommand;(!e$28(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||l||!e$28(this._pickSP)||c)&&(h=new a$$({sources:[O$d]}),d=new a$$({sources:[this.material.shaderSource,I$h],pickColorQualifier:"uniform"}),this.onlySunLighting&&d.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&d.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),d.defines.push("LOG_DEPTH"),d.sources.push(C$c)),this._pickSP=S$T.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:S$8}),m.vertexArray=this._va,m.renderState=this._rs,m.shaderProgram=this._pickSP,m.uniformMap=p$17(p$17(this._uniforms,this._pickUniforms),this.material._uniforms),m.executeInClosestFrustum=i),m.boundingVolume=this._boundingSphere,m.modelMatrix=this._computedModelMatrix,m.pass=i?Le$p.TRANSLUCENT:Le$p.OPAQUE,p.push(m)}}},p$d.prototype.isDestroyed=function(){return!1},p$d.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),i$Z(this)};var te$8="layout(location=0) in vec4 pos;\nlayout(location=2) in vec2 lonLat;\nlayout(location=3) in vec2 life;\nlayout(location=4) in vec2 texCoord;\nuniform float pointSize;\nuniform float uFieldTextureSize;\nuniform float uMaxFilterValue;\nuniform float uMinFilterValue;\nuniform vec4 particleColor;\nuniform sampler2D velocityTexture;\nuniform sampler2D colorTable;\nuniform float uHasColorTable;\nuniform float uCeil;\nuniform float uFloor;\nuniform float velocityScale;\nuniform float deltaTime;\nuniform vec4 lonlatRange;\nout vec4 velocityColor;\nout vec2 outTexCoord;\nfloat computerOnePixelLength()\n{\nvec4 viewPos = czm_modelView * vec4(pos.xyz, 1.0);\nvec4 winPos = czm_projection * viewPos;\nfloat dwidth = czm_metersPerPixel(viewPos);\nwinPos.x = winPos.x - 2.0 * dwidth;\nvec4 newViewPos = czm_inverseProjection * winPos;\nreturn length(viewPos - newViewPos);\n}\nvec4 computePos(vec3 v3Normal)\n{\nvec4 viewPos = czm_modelView * vec4(pos.xyz, 1.0);\n#ifdef SIZEFIXED\nviewPos.xyz = viewPos.xyz + v3Normal * computerOnePixelLength() * uFieldTextureSize;\n#else\nviewPos.xyz = viewPos.xyz + v3Normal * uFieldTextureSize;\n#endif\nviewPos.xyz = viewPos.xyz * 0.9;\nreturn czm_projection * viewPos;\n}\nvoid main()\n{\nvec2 lonLatTexCoord;\n#ifdef TEXTUREEFFECT\nlonLatTexCoord.x = (lonLat.x + czm_pi) / czm_twoPi;\nlonLatTexCoord.y = (lonLat.y + czm_piOverTwo) / czm_pi;\n#else\nlonLatTexCoord.x = (lonLat.x - lonlatRange.x) / (lonlatRange.z - lonlatRange.x);\nlonLatTexCoord.y = (lonLat.y - lonlatRange.y) / (lonlatRange.w - lonlatRange.y);\n#endif\nvec2 velocity = texture(velocityTexture, lonLatTexCoord).xy;\nfloat velocitySize = length(velocity);\nfloat threshold = abs(uCeil - uFloor);\nfloat contourRate = (velocitySize - uFloor) / threshold;\nfloat finalCoord = clamp(contourRate, 0.0, 1.0);\nvelocityColor = mix(particleColor, texture(colorTable, vec2(0.0, finalCoord)).rgba, uHasColorTable);\noutTexCoord= texCoord;\nvec3 upAxis = normalize(pos.xyz);\nvec3 eastAxis = cross(vec3(0.0, 0.0, 1.0), upAxis);\neastAxis = normalize(eastAxis);\nvec3 northAxis = cross(upAxis, eastAxis);\nnorthAxis = normalize(northAxis);\n#ifdef FILTER\nif(velocitySize > uMaxFilterValue || velocitySize < uMinFilterValue){\nvelocityColor.a = 0.0;\n}\n#endif\nif(pos.w > 0.5){\nvelocityColor.a = 0.0;\n}\n#ifdef TEXTUREEFFECT\nvec3 nestPos = pos.xyz + northAxis * velocity.y * deltaTime * velocityScale + eastAxis * velocity.x * deltaTime * velocityScale;\nvec4 nextPrjPos = czm_modelViewProjection * vec4(nestPos, 1.0);\nvec4 curPrjPos = czm_modelViewProjection * vec4(pos.xyz, 1.0);\nvec2 direction = normalize(nextPrjPos.xy - curPrjPos.xy);\nfloat cosx = dot(direction, vec2(1.0, 0.0));\nfloat cosy = dot(direction, vec2(0.0, 1.0));\nfloat sinx = sqrt(1.0- cosx*cosx);\nfloat cosYBiggerThan0 = sign(cosy);\nmat2 mat = mat2(cosx, sinx * cosYBiggerThan0, -sinx * cosYBiggerThan0, cosx);\nvec2 realNormal = mat * texCoord.xy;\ngl_Position = computePos(vec3(realNormal.xy, 0.0));\n#else\ngl_PointSize = pointSize;\ngl_Position = czm_modelViewProjection * vec4(pos.xyz, 1);\n#endif\n}\n",re$4="layout(location=0) in vec3 pos;\nlayout(location=3) in vec2 texCoord;\nuniform float pointSize;\nuniform float uFieldTextureSize;\nuniform float uMaxFilterValue;\nuniform float uMinFilterValue;\nuniform vec4 particleColor;\nuniform sampler2D velocityTexture;\nuniform sampler2D colorTable;\nuniform float uHasColorTable;\nuniform float uCeil;\nuniform float uFloor;\nuniform float velocityScale;\nuniform float deltaTime;\nuniform vec4 uXYBounds;\nuniform vec2 uZBounds;\nuniform float uTextureDepth;\nout vec4 velocityColor;\nout vec2 outTexCoord;\nfloat computerOnePixelLength()\n{\nvec4 viewPos = czm_modelView * vec4(pos, 1.0);\nvec4 winPos = czm_projection * viewPos;\nfloat dwidth = czm_metersPerPixel(viewPos);\nwinPos.x = winPos.x - 2.0 * dwidth;\nvec4 newViewPos = czm_inverseProjection * winPos;\nreturn length(viewPos - newViewPos);\n}\nvec4 computePos(vec3 v3Normal)\n{\nvec4 viewPos = czm_modelView * vec4(pos, 1.0);\n#ifdef SIZEFIXED\nviewPos.xyz = viewPos.xyz + v3Normal * computerOnePixelLength() * uFieldTextureSize;\n#else\nviewPos.xyz = viewPos.xyz + v3Normal * uFieldTextureSize;\n#endif\nviewPos.xyz = viewPos.xyz * 0.9;\nreturn czm_projection * viewPos;\n}\nvoid main()\n{\nvec2 velocityTexCoord;\nvelocityTexCoord.x = (pos.x - uXYBounds.x) / (uXYBounds.z - uXYBounds.x);\nvelocityTexCoord.y = (pos.y - uXYBounds.y) / (uXYBounds.w - uXYBounds.y);\nfloat texCoordZ = pos.z / (uZBounds.y - uZBounds.x);\nfloat texCoordStep = 1.0 / uTextureDepth;\nfloat timesZ = floor(texCoordZ / texCoordStep);\nvelocityTexCoord.x /= uTextureDepth;\nvelocityTexCoord.x += texCoordStep * timesZ;\nvec3 velocity = texture(velocityTexture, velocityTexCoord).xyz;\nfloat velocitySize = length(velocity);\nfloat threshold = abs(uCeil - uFloor);\nfloat contourRate = (velocitySize - uFloor) / threshold;\nfloat finalCoord = clamp(contourRate, 0.0, 1.0);\nvelocityColor = mix(particleColor, texture(colorTable, vec2(0.0, finalCoord)).rgba, uHasColorTable);\noutTexCoord= texCoord;\n#ifdef FILTER\nif(velocitySize > uMaxFilterValue || velocitySize < uMinFilterValue)\n{\nvelocityColor.a = 0.0;\n}\n#endif\nif(pos.x > uXYBounds.z || pos.x < uXYBounds.x || pos.y > uXYBounds.w || pos.y < uXYBounds.y || pos.z < uZBounds.x || pos.z > uZBounds.y)\n{\nvelocityColor.a = 0.0;\n}\n#ifdef TEXTUREEFFECT\nvec3 nextPos = pos.xyz + velocity.xyz * deltaTime * velocityScale;\nvec4 nextPrjPos = czm_modelViewProjection * vec4(nextPos, 1.0);\nvec4 curPrjPos = czm_modelViewProjection * vec4(pos, 1.0);\nvec2 direction = normalize(nextPrjPos.xy - curPrjPos.xy);\nfloat cosx = dot(direction, vec2(1.0, 0.0));\nfloat cosy = dot(direction, vec2(0.0, 1.0));\nfloat sinx = sqrt(1.0- cosx*cosx);\nfloat cosYBiggerThan0 = sign(cosy);\nmat2 mat = mat2(cosx, sinx * cosYBiggerThan0, -sinx * cosYBiggerThan0, cosx);\nvec2 realNormal = mat * texCoord.xy;\ngl_Position = computePos(vec3(realNormal.xy, 0.0));\n#else\ngl_PointSize = pointSize;\ngl_Position = czm_modelViewProjection * vec4(pos, 1);\n#endif\n}\n",ie$5="precision mediump float;\nin vec4 velocityColor;\nin vec2 outTexCoord;\nout vec4 FragColor;\nuniform sampler2D uFieldTexture;\nvoid main()\n{\nFragColor = velocityColor;\n#ifdef TEXTUREEFFECT\nFragColor = texture(uFieldTexture, outTexCoord) * velocityColor;\n#endif\n}\n",ae$6="precision highp float;\nlayout(location=0) in vec4 pos;\nlayout(location=1) in vec3 oriPos;\nlayout(location=2) in vec2 lonLat;\nlayout(location=3) in vec2 life;\nout vec4 tf_pos;\nout vec3 tf_oriPos;\nout vec2 tf_lonLat;\nout vec2 tf_life;\nuniform sampler2D velocityTexture;\nuniform float velocityScale;\nuniform float deltaTime;\nuniform vec2 velocityTexRes;\nuniform vec4 lonlatRange;\nuniform float randomCoefficient;\nvec3 convertCoordinate(float longitude, float latitude) {\nfloat a = 6378137.0;\nfloat b = 6356752.3142;\nfloat e2 = 6.69437999014e-3;\nfloat cosLat = cos(latitude);\nfloat sinLat = sin(latitude);\nfloat cosLon = cos(longitude);\nfloat sinLon = sin(longitude);\nfloat N_Phi = a / sqrt(1.0 - e2 * sinLat * sinLat);\nfloat h = 5.0;\nvec3 cartesian = vec3(0.0);\ncartesian.x = (N_Phi + h) * cosLat * cosLon;\ncartesian.y = (N_Phi + h) * cosLat * sinLon;\ncartesian.z = ((b * b) / (a * a) * N_Phi + h) * sinLat;\nreturn cartesian;\n}\nvec2 lookup_wind(const vec2 uv)\n{\nvec2 px = 1.0 / velocityTexRes;\nvec2 vc = (floor(uv * velocityTexRes)) * px;\nvec2 f = fract(uv * velocityTexRes);\nvec2 tl = texture(velocityTexture, vc).rg;\nvec2 tr = texture(velocityTexture, vc + vec2(px.x, 0)).rg;\nvec2 bl = texture(velocityTexture, vc + vec2(0, px.y)).rg;\nvec2 br = texture(velocityTexture, vc + px).rg;\nreturn mix(mix(tl, tr, f.x), mix(bl, br, f.x), f.y);\n}\nconst vec3 randomConstants = vec3(12.9898, 78.233, 4375.85453);\nconst vec2 normalRange = vec2(0.0, 1.0);\nfloat rand(vec2 seed, vec2 range) {\nvec2 randomSeed = randomCoefficient * seed;\nfloat temp = dot(randomConstants.xy, randomSeed);\ntemp = fract(sin(temp) * (randomConstants.z + temp));\nreturn temp * (range.y - range.x) + range.x;\n}\nvec2 generateRandomParticle(vec2 seed) {\nvec2 lonRange = lonlatRange.xz;\nvec2 latRange = lonlatRange.yw;\nfloat randomLon = mod(rand(seed, lonRange), 360.0 * czm_pi / 180.0);\nrandomLon = randomLon > czm_pi ? randomLon - czm_pi * 2.0 : randomLon;\nfloat randomLat = rand(-seed, latRange);\nreturn vec2(randomLon, randomLat);\n}\nvec2 lengthOfLonLat(vec3 lonLatLev) {\nfloat latitude = lonLatLev.y;\nfloat term1 = 111132.92;\nfloat term2 = 559.82 * cos(2.0 * latitude);\nfloat term3 = 1.175 * cos(4.0 * latitude);\nfloat term4 = 0.0023 * cos(6.0 * latitude);\nfloat latLength = term1 - term2 + term3 - term4;\nfloat term5 = 111412.84 * cos(latitude);\nfloat term6 = 93.5 * cos(3.0 * latitude);\nfloat term7 = 0.118 * cos(5.0 * latitude);\nfloat longLength = term5 - term6 + term7;\nreturn vec2(longLength, latLength);\n}\nvec3 convertSpeedUnitToLonLat(vec3 lonLatLev, vec3 speed) {\nvec2 lonLatLength = lengthOfLonLat(lonLatLev);\nfloat u = speed.x / lonLatLength.x;\nfloat v = speed.y / lonLatLength.y;\nfloat w = 0.0;\nvec3 windVectorInLonLatLev = vec3(u, v, w);\nreturn windVectorInLonLatLev;\n}\nvec3 linearInterpolation(vec3 lonLatLev) {\nvec2 lonLatTexCoord;\nlonLatTexCoord.x = (lonLatLev.x - lonlatRange.x) / (lonlatRange.z - lonlatRange.x);\nlonLatTexCoord.y = (lonLatLev.y - lonlatRange.y) / (lonlatRange.w - lonlatRange.y);\nvec2 velocity = lookup_wind(lonLatTexCoord);\nreturn vec3(velocity, 0.0);\n}\nvec3 calculateSpeedByRungeKutta2(vec3 lonLatLev) {\nconst float h = 0.5;\nvec3 y_n = lonLatLev;\nvec3 f_n = linearInterpolation(lonLatLev);\nvec3 midpoint = y_n + 0.5 * h * convertSpeedUnitToLonLat(y_n, f_n) * velocityScale;\nvec3 speed = h * linearInterpolation(midpoint) * velocityScale;\nreturn speed;\n}\nbool outOfBounds(float lon, float lat) {\nreturn lon < lonlatRange.x || lon > lonlatRange.z || lat < lonlatRange.y || lat > lonlatRange.w;\n}\nvoid main()\n{\nvec3 lonLatLev = vec3(lonLat, 0.0);\nvec3 speed = calculateSpeedByRungeKutta2(lonLatLev);\nvec3 speedInLonLat = convertSpeedUnitToLonLat(lonLatLev, speed);\ntf_lonLat = lonLat + speedInLonLat.xy;\ntf_life.x += life.x + deltaTime;\ntf_life.y = life.y;\nif(speedInLonLat.xy == vec2(0.0) || tf_life.x > life.y || outOfBounds(tf_lonLat.x, tf_lonLat.y)){\ntf_lonLat = generateRandomParticle(lonLat);\ntf_pos.w = 1.0;\ntf_life.x = 0.0;\n}\nelse{\ntf_pos.w = 0.0;\n}\ntf_pos.xyz = convertCoordinate(tf_lonLat.x, tf_lonLat.y);\ntf_oriPos = oriPos;\n}\n",oe$5="precision highp float;\nlayout(location=0) in vec3 pos;\nlayout(location=1) in vec3 oriPos;\nlayout(location=2) in vec2 life;\nout vec3 tf_pos;\nout vec3 tf_oriPos;\nout vec2 tf_life;\nuniform sampler2D velocityTexture;\nuniform float velocityScale;\nuniform float deltaTime;\nuniform vec4 uXYBounds;\nuniform vec2 uZBounds;\nuniform float uTextureDepth;\nvoid main()\n{\nvec2 velocityTexCoord;\nvelocityTexCoord.x = (pos.x - uXYBounds.x) / (uXYBounds.z - uXYBounds.x);\nvelocityTexCoord.y = (pos.y - uXYBounds.y) / (uXYBounds.w - uXYBounds.y);\nfloat texCoordZ = pos.z / (uZBounds.y - uZBounds.x);\nfloat texCoordStep = 1.0 / uTextureDepth;\nfloat timesZ = floor(texCoordZ / texCoordStep);\nvelocityTexCoord.x /= uTextureDepth;\nvelocityTexCoord.x += texCoordStep * timesZ;\nvec3 velocity = texture(velocityTexture, velocityTexCoord).xyz;\nif(life.x > life.y)\n{\ntf_pos = oriPos;\ntf_life.x = 0.0;\ntf_life.y = life.y;\n}\nelse\n{\ntf_pos.xyz = pos.xyz + velocity.xyz * deltaTime * velocityScale;\ntf_life.x += life.x + deltaTime;\ntf_life.y = life.y;\n}\ntf_oriPos = oriPos;\n}\n",ne$8="precision highp float;\nout vec4 FragColor;\nvoid main() {}\n",V$b="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",le$6="uniform sampler2D u_lastColorTexture;\nuniform sampler2D u_colorTexture;\nuniform float u_opacity;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_colorTexture, v_textureCoordinates);\nvec4 lastColor = texture2D(u_lastColorTexture, v_textureCoordinates);\nvec4 outColor = color*color.a + lastColor * (1.0 - color.a);\nfloat alpha = outColor.a * u_opacity;\ngl_FragColor = vec4(outColor.rgb, alpha < 0.1 ? 0.0 : alpha);\n}\n";function P$e(e){if(!e._webgl2)throw new t$Z("webgl2 is not supported.");this._context=e,this._show=!0,this._filter=!1,this._MaxFilterValue=Number.MAX_VALUE,this._MinFilterValue=Number.MIN_VALUE,this._paricleCountPerDegree=1,this._lifeRange=[5e3,1e4],this._particleColor=new e$1S(1,1,0,1),this._particleSize=5,this._velocityScale=1,this._velocityTexRes=new o$1k(0,0),this._velocityField=void 0,this._dictColorTable=void 0,this._floor=0,this._ceil=10,this._hasColorTable=0,this._hypsometricTexture=void 0,this._dataBounds=h$10.MAX_VALUE,this.lonlatRange=new e$25(this._dataBounds.west,this._dataBounds.south,this._dataBounds.east,this._dataBounds.north),this._zBounds=new o$1k(0,1),this._transformFeedback=void 0,this._normalShaderProgram=void 0,this._feedbackShaderProgram=void 0,this._currentTime=0,this._deltaTime=0,this._transformFeedbackInitialized=!1,this._fieldInitialized=!1,this._fieldDataIndices=void 0,this._textureEffect=!1,this._textureEffectUrl=n$17("Assets/Textures/arrow.png"),this._fieldTexture=void 0,this._fieldTextureSize=30,this._sizeFixed=!0,this._sceneMode=P$$.SCENE3D,this._showParticleTrails=!0,this._fadeOpacity=.98,this._curParticleStateTexture=void 0,this._lastParticleStateTexture=void 0,this._tmpParticleStateTexture=void 0,this._curParticleTextureBuffer=void 0,this._lastParticleTextureBuffer=void 0,this._tmpParticleTextureBuffer=void 0,this._clearCommand=void 0,this._copyColorCommand=void 0,this._copyLastColorCommand=void 0,this._hdrEnable=!1}var de$6=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Object.defineProperties(P$e.prototype,{fieldTextureSize:{get:function(){return this._fieldTextureSize},set:function(e){this._fieldTextureSize=e}},sizeFixed:{get:function(){return this._sizeFixed},set:function(e){this._sizeFixed=e,this._transformFeedbackInitialized=!1}},textureEffect:{get:function(){return this._textureEffect},set:function(e){this._textureEffect=e,this._transformFeedbackInitialized=!1}},textureEffectUrl:{get:function(){return this._textureEffectUrl},set:function(e){this._textureEffectUrl=e,this._fieldTexture=void 0}},show:{get:function(){return this._show},set:function(e){this._show=e}},filter:{get:function(){return this._filter},set:function(e){this._filter=e,this._transformFeedbackInitialized=!1}},MaxFilterValue:{get:function(){return this._MaxFilterValue},set:function(e){this._MaxFilterValue=e}},MinFilterValue:{get:function(){return this._MinFilterValue},set:function(e){this._MinFilterValue=e}},paricleCountPerDegree:{get:function(){return this._paricleCountPerDegree},set:function(e){this._paricleCountPerDegree=e,this._transformFeedbackInitialized=!1}},particleLifeRange:{get:function(){return this._lifeRange},set:function(e){this._lifeRange=e,this._transformFeedbackInitialized=!1}},particleColor:{get:function(){return this._particleColor},set:function(e){this._particleColor=e}},particleSize:{get:function(){return this._particleSize},set:function(e){this._particleSize=e}},velocityScale:{get:function(){return this._velocityScale},set:function(e){this._velocityScale=e}},colorTable:{get:function(){return this._dictColorTable},set:function(e){if(!e$28(e))return e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null),void(this._hasColorTable=0);this._dictColorTable=i$O.clone(e,this._dictColorTable);var t=this._dictColorTable.count();if(t<1)this._hasColorTable=0;else{e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:this._context,width:1024,height:64,pixelFormat:V$O.RGBA})),e$28(this._dictColorTable)&&(this._dictColorTable.generateBuffer(),e$28(this._hypsometricTexture)&&this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._dictColorTable._imageBuffer}));var i=0,r=0,n=this._dictColorTable.getItem(0);e$28(n)&&e$28(n.altitude)&&(i=parseFloat(n.altitude)),e$28(n=this._dictColorTable.getItem(t-1))&&e$28(n.altitude)&&(r=parseFloat(n.altitude)),this._ceiling=Math.max(i,r),this._floor=Math.min(i,r),this._hasColorTable=1}}}}),P$e.prototype.update=function(e){if(this._show&&e$28(this._velocityField)){if(this._sceneMode!==e.camera._mode&&(this._sceneMode=e.camera._mode,this._transformFeedbackInitialized=!1),this._textureEffect&&e$28(this._textureEffectUrl)&&!e$28(this._fieldTexture)){var t=this;o$1q(t$D(this._textureEffectUrl),(function(e){t._fieldTexture=new L$17({context:t._context,source:e,sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT})}),t._transformFeedbackInitialized=!1}))}this._fieldInitialized||(this._createVectorFieldTexture(this._context,this._velocityField),this._fieldInitialized=!0),this._transformFeedbackInitialized||(this._createTransformFeedback(this._context,e),this._transformFeedbackInitialized=!0),e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:this._context,width:1,height:1024,pixelFormat:V$O.RGBA}));var i=(new Date).getTime(),r=i-this._currentTime;this._currentTime=i,this._deltaTime=r,e$28(this._transformFeedback)&&e.commandList.push(this._transformFeedback)}},P$e.prototype._setVelocityField=function(e){this._velocityField=e,this._fieldInitialized=!1},P$e.prototype._setDataBounds=function(e){this._dataBounds=e,this.lonlatRange.x=this._dataBounds.west,this.lonlatRange.y=this._dataBounds.south,this.lonlatRange.z=this._dataBounds.east,this.lonlatRange.w=this._dataBounds.north,this._transformFeedbackInitialized=!1},P$e.prototype._setZBounds=function(e){this._zBounds=e,this._transformFeedbackInitialized=!1};var ce$7=/\s+czm_writeLogDepth\(/,_e$5=/\s+czm_vertexLogDepth\(/,me$6=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;function pe$7(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!e$28(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();n.defines=e$28(n.defines)?n.defines.slice(0):[],n.defines.push("LOG_DEPTH"),o.defines=e$28(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH");var a,s=!1,l=n.sources,u=l.length;for(a=0;a<u;++a)if(_e$5.test(l[a])){s=!0;break}if(!s){for(a=0;a<u;++a)l[a]=a$$.replaceMain(l[a],"czm_log_depth_main");"\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n",l.push("\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n")}for(s=!1,u=(l=o.sources).length,a=0;a<u;++a)ce$7.test(l[a])&&(s=!0),me$6.test(l[a]);var c="";if(!s){for(a=0;a<u;a++)l[a]=a$$.replaceMain(l[a],"czm_log_depth_main");c+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}l.push(c),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:r})}return i}P$e.prototype._createTransformFeedback=function(e,t){e$28(this._transformFeedback)&&this._transformFeedback.destroy();var i,r,n=[];this._sceneMode!==P$$.SCENE3D?(i=new a$$({sources:[oe$5]}),r=new a$$({sources:[re$4]}),n=["tf_pos","tf_oriPos","tf_life"]):(i=new a$$({sources:[ae$6]}),r=new a$$({sources:[te$8]}),n=["tf_pos","tf_oriPos","tf_lonLat","tf_life"]);var o,a=new a$$({sources:[ie$5]});this._textureEffect&&(i.defines.push("TEXTUREEFFECT"),r.defines.push("TEXTUREEFFECT"),a.defines.push("TEXTUREEFFECT")),this._filter&&r.defines.push("FILTER"),this._sizeFixed&&r.defines.push("SIZEFIXED"),this._normalShaderProgram=S$T.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a}),t.useLogDepth&&(this._normalShaderProgram=pe$7(e,this._normalShaderProgram)),this._feedbackShaderProgram=S$T.fromCache({context:e,vertexShaderSource:i,fragmentShaderSource:ne$8,varyings:n,bufferMode:de$y.SEPARATE_ATTRIBS}),o=this._textureEffect?this._sceneMode!==P$$.SCENE3D?this._createLocalTextureVertexAttributes():this._createGlobalTextureVertexAttributes():this._sceneMode!==P$$.SCENE3D?this._createLocalVertexAttributes():this._createGlobalVertexAttributes();var s=this._createFeedbackShaderUniformMap(),l=this._createNormalShaderUniformMap(),u=u$R.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:Ee$n.ALPHA_BLEND}),c=this._computeTotalParticleCount();this._transformFeedback=new s$g({pointCount:c,indices:this._fieldDataIndices,textureEffect:this._textureEffect,attributes:o,primitiveMode:this._textureEffect?de$y.TRIANGLES:de$y.POINTS,renderState:u,feedbackShader:this._feedbackShaderProgram,normalShader:this._normalShaderProgram,normalShaderUniformMap:l,feedbackShaderUniformMap:s,modelMatrix:this._sceneMode===P$$.SCENE3D?y$15.IDENTITY:de$6,fadeOpacity:this._fadeOpacity}),this._transformFeedback._drawEvent.addEventListener(this.drawParticleTrails,this)},P$e.prototype._createGlobalVertexAttributes=function(){var e,t,i,r,n,o;e=e$27.toDegrees(this._dataBounds.width),t=e$27.toDegrees(this._dataBounds.height),this._zBounds.y,this._zBounds.x,i=e$27.toDegrees(this._dataBounds.west),r=e$27.toDegrees(this._dataBounds.south),this._zBounds.x;for(var a=(n=Math.ceil(this._paricleCountPerDegree*e))*(o=Math.ceil(this._paricleCountPerDegree*t)),s=new Float32Array(4*a),l=new Float32Array(3*a),u=new Float32Array(2*a),c=new Float32Array(2*a),h=0,d=0;d<o;d++)for(var f=0;f<n;f++){var p=i+f*(e/n),_=r+d*(t/o);p=e$27.toRadians(p),_=e$27.toRadians(_);var m=new t$X.fromRadians(p,_,5);s[4*h]=m.x,s[4*h+1]=m.y,s[4*h+2]=m.z,s[4*h+3]=1,l[3*h]=m.x,l[3*h+1]=m.y,l[3*h+2]=m.z,u[2*h]=p,u[2*h+1]=_;var $=(this._lifeRange[1]-this._lifeRange[0])*Math.random()+this._lifeRange[0];c[2*h]=0,c[2*h+1]=$,h++}var g=[];return g.push({index:0,componentsPerAttribute:4,data:s}),g.push({index:1,componentsPerAttribute:3,data:l}),g.push({index:2,componentsPerAttribute:2,data:u}),g.push({index:3,componentsPerAttribute:2,data:c}),g},P$e.prototype._createLocalVertexAttributes=function(){var e,t,i,r,n,o,a,s,l;e=this._dataBounds.width,t=this._dataBounds.height,i=this._zBounds.y-this._zBounds.x,r=this._dataBounds.west,n=this._dataBounds.south,o=this._zBounds.x;for(var u=(a=Math.ceil(this._paricleCountPerDegree*e))*(s=Math.ceil(this._paricleCountPerDegree*t))*(l=Math.ceil(this._paricleCountPerDegree*i)),c=new Float32Array(3*u),h=new Float32Array(3*u),d=new Float32Array(2*u),f=0,p=0;p<s;p++)for(var _=0;_<a;_++)for(var m=0;m<l;m++,f++){var $=r+_*(e/(a-1)),g=n+p*(t/(s-1)),v=o+m*(i/l);c[3*f]=$,c[3*f+1]=g,c[3*f+2]=v,h[3*f]=$,h[3*f+1]=g,h[3*f+2]=v;var y=(this._lifeRange[1]-this._lifeRange[0])*Math.random()+this._lifeRange[0];d[2*f]=0,d[2*f+1]=y}var x=[];return x.push({index:0,componentsPerAttribute:3,data:c}),x.push({index:1,componentsPerAttribute:3,data:h}),x.push({index:2,componentsPerAttribute:2,data:d}),x},P$e.prototype._createGlobalTextureVertexAttributes=function(){for(var e=e$27.toDegrees(this._dataBounds.width),t=e$27.toDegrees(this._dataBounds.height),i=this._zBounds.y-this._zBounds.x,r=e$27.toDegrees(this._dataBounds.west),n=e$27.toDegrees(this._dataBounds.south),o=this._zBounds.x,a=Math.ceil(this._paricleCountPerDegree*t),s=Math.ceil(this._paricleCountPerDegree*e),l=Math.ceil(this._paricleCountPerDegree*i),u=a*s*l*4,c=new Uint32Array(u/4*6),h=new Float32Array(2*u),d=new Float32Array(3*u),f=new Float32Array(3*u),p=new Float32Array(2*u),_=new Float32Array(2*u),m=0,$=0;$<a;$++)for(var g=0;g<s;g++)for(var v=0;v<l;v++,m++){for(var y=r+g*(e/(s-1)),x=n+$*(t/(a-1)),b=o+v*(i/l),w=new t$X.fromDegrees(y,x,b),C=0;C<12;C+=3)d[12*m+C]=w.x,d[12*m+C+1]=w.y,d[12*m+ +C+2]=w.z;for(C=0;C<12;C+=3)f[12*m+C]=w.x,f[12*m+C+1]=w.y,f[12*m+ +C+2]=w.z;for(C=0;C<8;C+=2)p[8*m+C]=e$27.toRadians(y),p[8*m+C+1]=e$27.toRadians(x);var T=(this._lifeRange[1]-this._lifeRange[0])*Math.random()+this._lifeRange[0];_[8*m]=0,_[8*m+1]=T,_[8*m+2]=0,_[8*m+3]=T,_[8*m+4]=0,_[8*m+5]=T,_[8*m+6]=0,_[8*m+7]=T}for(g=0;g<c.length;g++)c[6*g]=4*g,c[6*g+1]=4*g+1,c[6*g+2]=4*g+2,c[6*g+3]=4*g,c[6*g+4]=4*g+2,c[6*g+5]=4*g+3;this._fieldDataIndices=c;for(m=0,v=0;v<h.length;v+=8,m++)h[8*m]=0,h[8*m+1]=0,h[8*m+2]=0,h[8*m+3]=1,h[8*m+4]=1,h[8*m+5]=1,h[8*m+6]=1,h[8*m+7]=0;var S=[];return S.push({index:0,componentsPerAttribute:3,data:d}),S.push({index:1,componentsPerAttribute:3,data:f}),S.push({index:2,componentsPerAttribute:2,data:p}),S.push({index:3,componentsPerAttribute:2,data:_}),S.push({index:4,componentsPerAttribute:2,data:h}),S},P$e.prototype._createLocalTextureVertexAttributes=function(){for(var e=this._dataBounds.width,t=this._dataBounds.height,i=this._zBounds.y-this._zBounds.x,r=this._dataBounds.west,n=this._dataBounds.south,o=this._zBounds.x,a=Math.ceil(this._paricleCountPerDegree*e),s=Math.ceil(this._paricleCountPerDegree*t),l=Math.ceil(this._paricleCountPerDegree*i),u=s*a*l*4,c=new Uint32Array(u/4*6),h=new Float32Array(2*u),d=new Float32Array(3*u),f=new Float32Array(3*u),p=new Float32Array(2*u),_=0,m=0;m<s;m++)for(var $=0;$<a;$++)for(var g=0;g<l;g++,_++){for(var v=r+$*(e/(a-1)),y=n+m*(t/(s-1)),x=o+g*(i/l),b=0;b<12;b+=3)d[12*_+b]=v,d[12*_+b+1]=y,d[12*_+ +b+2]=x;for(b=0;b<12;b+=3)f[12*_+b]=v,f[12*_+b+1]=y,f[12*_+ +b+2]=x;var w=(this._lifeRange[1]-this._lifeRange[0])*Math.random()+this._lifeRange[0];p[8*_]=0,p[8*_+1]=w,p[8*_+2]=0,p[8*_+3]=w,p[8*_+4]=0,p[8*_+5]=w,p[8*_+6]=0,p[8*_+7]=w}for($=0;$<c.length;$++)c[6*$]=4*$,c[6*$+1]=4*$+1,c[6*$+2]=4*$+2,c[6*$+3]=4*$,c[6*$+4]=4*$+2,c[6*$+5]=4*$+3;this._fieldDataIndices=c;for(_=0,g=0;g<h.length;g+=8,_++)h[8*_]=0,h[8*_+1]=0,h[8*_+2]=0,h[8*_+3]=1,h[8*_+4]=1,h[8*_+5]=1,h[8*_+6]=1,h[8*_+7]=0;var C=[];return C.push({index:0,componentsPerAttribute:3,data:d}),C.push({index:1,componentsPerAttribute:3,data:f}),C.push({index:2,componentsPerAttribute:2,data:p}),C.push({index:3,componentsPerAttribute:2,data:h}),C},P$e.prototype._computeTotalParticleCount=function(){if(this._sceneMode!==P$$.SCENE3D){var e=this._dataBounds.width,t=this._dataBounds.height;return this._zBounds.y,this._zBounds.x,Math.ceil(this._paricleCountPerDegree*e)*Math.ceil(this._paricleCountPerDegree*t)}e=e$27.toDegrees(this._dataBounds.width),t=e$27.toDegrees(this._dataBounds.height);return this._zBounds.y,this._zBounds.x,Math.ceil(this._paricleCountPerDegree*e)*Math.ceil(this._paricleCountPerDegree*t)};var R$f=new e$25;function i$d(e){o$1u.defined("context",e),this._context=e,this._fieldData=void 0,this._NetCDFData=void 0,this._NetCDFInfo=void 0,this._NetCDFBuffer=void 0,this._layerBounds=h$10.MAX_VALUE,this._visible=!0,this._type="FieldLayer3D",this._particleVelocityFieldEffect=new P$e(e)}P$e.prototype._createFeedbackShaderUniformMap=function(){var e=this;return{velocityTexture:function(){return e._vectorFieldTexture},velocityScale:function(){return e._velocityScale},velocityTexRes:function(){return e._velocityTexRes},deltaTime:function(){return e._deltaTime},uZBounds:function(){return e._zBounds},uTextureDepth:function(){return e._texZDepth},lonlatRange:function(){return e.lonlatRange},randomCoefficient:function(){return Math.random()}}},P$e.prototype._createNormalShaderUniformMap=function(){var e=this;return{particleColor:function(){return e._particleColor},pointSize:function(){return e._particleSize},uMaxFilterValue:function(){return e._MaxFilterValue},uMinFilterValue:function(){return e._MinFilterValue},uFieldTexture:function(){return e$28(e._fieldTexture)?e._fieldTexture:new L$17({context:e._context,width:1,height:1})},uFieldTextureSize:function(){return e._fieldTextureSize},velocityTexture:function(){return e._vectorFieldTexture},colorTable:function(){return e._hypsometricTexture},lonlatRange:function(){return e.lonlatRange},uFloor:function(){return e._floor},uCeil:function(){return e._ceiling},uHasColorTable:function(){return e._hasColorTable},velocityScale:function(){return e._velocityScale},deltaTime:function(){return e._deltaTime},uXYBounds:function(){return R$f.x=e._dataBounds.west,R$f.y=e._dataBounds.south,R$f.z=e._dataBounds.east,R$f.w=e._dataBounds.north,R$f},uZBounds:function(){return e._zBounds},uTextureDepth:function(){return e._texZDepth},velocityTexRes:function(){return e._velocityTexRes}}},P$e.prototype._createVectorFieldTexture=function(e,t){e$28(this._vectorFieldTexture)&&this._vectorFieldTexture.destroy();var i,r=0,n=0;if(t instanceof Array&&(r=(i=this._createCanvasFromDataMatrix(t)).width,n=i.height,!i))return!1;this._velocityTexRes.x=r,this._velocityTexRes.y=n,this._vectorFieldTexture=new L$17({context:e,width:r,height:n,pixelFormat:V$O.RGB,pixelDatatype:y$U.FLOAT,flipY:!1}),this._vectorFieldTexture.copyFrom({width:r,height:n,arrayBufferView:i.imageData})},P$e.prototype._createCanvasFromDataMatrix=function(e){var t=e.length;if(!(e[0]instanceof Array))return null;var i,r,n,o,a,s,l,u=e[0].length;if(!(e[0][0]instanceof Array))return null;if(e[0][0][0]instanceof Array){var c=u,h=t,d=e[0][0].length;for(this._texZDepth=d,s=new Float32Array(h*c*d*3),o=0,i=0;i<c;i++)for(r=0;r<d;r++)for(n=0;n<h;n++){var f=null==(l=e[n][i][r]).x?l[0]:l.x,p=null==l.y?l[1]:l.y,_=null==l.z?l[2]:l.z;s[o++]=f,s[o++]=p,s[o++]=_}a={height:c,width:d*h,imageData:s}}else{for(s=new Float32Array(t*u*3),o=0,r=0;r<t;r++)for(i=0;i<u;i++){var m=null==(l=e[r][i]).x?l[0]:l.x,$=null==l.y?l[1]:l.y;s[o++]=m,s[o++]=$,s[o++]=0}a={height:t,width:u,imageData:s}}return a},P$e.prototype.createParticleTrailsResources=function(e,t){if(this._showParticleTrails&&(!e$28(this._lastParticleStateTexture)||this._lastParticleStateTexture.width!==e.drawingBufferWidth||this._lastParticleStateTexture.height!==e.drawingBufferHeight)){e$28(this._lastParticleStateTexture)&&(this._lastParticleStateTexture.width!==e.drawingBufferWidth||this._lastParticleStateTexture.height!==e.drawingBufferHeight)&&this.destroyParticleTrailsResources();var i=y$U.UNSIGNED_BYTE;this._hdrEnable&&(i=y$U.FLOAT),this._curParticleStateTexture=new L$17({context:e,width:e.drawingBufferWidth,height:e.drawingBufferHeight,pixelDatatype:i,pixelFormat:V$O.RGBA}),this._lastParticleStateTexture=new L$17({context:e,width:e.drawingBufferWidth,height:e.drawingBufferHeight,pixelDatatype:i,pixelFormat:V$O.RGBA}),this._tmpParticleStateTexture=new L$17({context:e,width:e.drawingBufferWidth,height:e.drawingBufferHeight,pixelDatatype:i,pixelFormat:V$O.RGBA});var r=u$Y(this._transformFeedback._framebuffer,t.framebuffer);this._curParticleTextureBuffer=new a$z({context:e,colorTextures:[this._curParticleStateTexture],depthStencilTexture:r._depthStencilTexture,destroyAttachments:!1}),this._lastParticleTextureBuffer=new a$z({context:e,colorTextures:[this._lastParticleStateTexture],destroyAttachments:!1}),this._tmpParticleTextureBuffer=new a$z({context:e,colorTextures:[this._tmpParticleStateTexture],destroyAttachments:!1}),this._clearCommand=new r$11({color:new e$1S(0,0,0,0),renderState:u$R.fromCache()});var n=this._lastParticleStateTexture,o=this._tmpParticleTextureBuffer;this._copyLastColorCommand=e.createViewportQuadCommand(V$b,{uniformMap:{colorTexture:function(){return n}},framebuffer:o});var a=this._tmpParticleStateTexture,s=this._curParticleStateTexture,l=this._lastParticleTextureBuffer,u=this._fadeOpacity;this._copyColorCommand=e.createViewportQuadCommand(le$6,{uniformMap:{u_lastColorTexture:function(){return a},u_colorTexture:function(){return s},u_opacity:function(){return u}},framebuffer:l})}},P$e.prototype.destroyParticleTrailsResources=function(){e$28(this._curParticleStateTexture)&&(this._curParticleStateTexture.destroy(),this._curParticleStateTexture=void 0),e$28(this._lastParticleStateTexture)&&(this._lastParticleStateTexture.destroy(),this._lastParticleStateTexture=void 0),e$28(this._tmpParticleStateTexture)&&(this._tmpParticleStateTexture.destroy(),this._tmpParticleStateTexture=void 0),e$28(this._curParticleTextureBuffer)&&(this._curParticleTextureBuffer.destroy(),this._curParticleTextureBuffer=void 0),e$28(this._lastParticleTextureBuffer)&&(this._lastParticleTextureBuffer.destroy(),this._lastParticleTextureBuffer=void 0),e$28(this._tmpParticleTextureBuffer)&&(this._tmpParticleTextureBuffer.destroy(),this._tmpParticleTextureBuffer=void 0),this._clearCommand=void 0,this._copyColorCommand=void 0,this._copyLastColorCommand=void 0},P$e.prototype.drawParticleTrails=function(e,t){!this._showParticleTrails||(this.createParticleTrailsResources(e,t),e$28(this._copyLastColorCommand)&&this._copyLastColorCommand.execute(e,t),e$28(this._copyColorCommand)&&this._copyColorCommand.execute(e,t),this._clearCommand.framebuffer=this._curParticleTextureBuffer,this._clearCommand.execute(e,t),this._transformFeedback.beginDraw(e,this._curParticleTextureBuffer,this._transformFeedback,t),this._transformFeedback._drawNormal(e,t))},P$e.prototype.clearLastParticleStateTexture=function(e,t,i,r){if(e$28(t)&&this._hdrEnable!==t)return this._hdrEnable=t,this.destroyParticleTrailsResources(),void this.createParticleTrailsResources(t,i,r);!e._stateChanged||this.clearLastParticleBuffer(i,r)},P$e.prototype.clearLastParticleBuffer=function(e,t){this._clearCommand.framebuffer=this._lastParticleTextureBuffer,this._clearCommand.execute(e,t),this._clearCommand.framebuffer=this._curParticleTextureBuffer,this._clearCommand.execute(e,t),this._clearCommand.framebuffer=this._tmpParticleTextureBuffer,this._clearCommand.execute(e,t)},P$e.prototype.isDestroyed=function(){return!1},P$e.prototype.destroy=function(){return e$28(this._vectorFieldTexture)&&(this._vectorFieldTexture.destroy(),this._vectorFieldTexture=void 0),e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null),e$28(this._hypsometricTexture)&&(this._hypsometricTexture.destroy(),this._hypsometricTexture=null),e$28(this._transformFeedback)&&(this._transformFeedback.destroy(),this._transformFeedback=void 0),e$28(this._fieldTexture)&&(this._fieldTexture.destroy(),this._fieldTexture=void 0),this.destroyParticleTrailsResources(),i$Z(this)},Object.defineProperties(i$d.prototype,{visible:{get:function(){return this._visible},set:function(e){this._visible=e}},type:{get:function(){return this._type}},fieldData:{get:function(){return this._fieldData},set:function(e){this._fieldData=e,e$28(this._particleVelocityFieldEffect)&&this._particleVelocityFieldEffect._setVelocityField(e)}},NetCDFData:{get:function(){return this._NetCDFData},set:function(e){if(!e$28(e.longitude)||!e$28(e.latitude))throw new t$Z("coordinates are required.");if(!e$28(e.uwnd)||!e$28(e.vwnd))throw new t$Z("uwnd or vwnd is required.");if(e.timeOrder=u$Y(e.timeOrder,0),e$28(this._NetCDFBuffer)){for(var t=this._NetCDFBuffer,i=t.getDataVariable(e.longitude),r=t.getDataVariable(e.latitude),n=t.getDataVariable(e.uwnd),o=t.getDataVariable(e.vwnd),a=0,s=[],l=0;l<r.length;l++){s[l]=[];for(var u=0;u<i.length;u++,a++){var c=r.length*i.length*e.timeOrder;s[l][u]=[n[a+c],o[a+c]]}}this._NetCDFData=s,e$28(this._particleVelocityFieldEffect)&&this._particleVelocityFieldEffect._setVelocityField(s)}}},NetCDFInfo:{get:function(){return this._NetCDFInfo},set:function(e){this._NetCDFInfo=e}},layerBounds:{get:function(){return this._layerBounds},set:function(e){this._layerBounds=e,e$28(this._particleVelocityFieldEffect)&&this._particleVelocityFieldEffect._setDataBounds(e)}},zBounds:{get:function(){return this._zBounds},set:function(e){this._zBounds=e,e$28(this._particleVelocityFieldEffect)&&this._particleVelocityFieldEffect._setZBounds(e)}},particleVelocityFieldEffect:{get:function(){return this._particleVelocityFieldEffect}}}),i$d.prototype.update=function(e){this._visible?e$28(this._particleVelocityFieldEffect)&&this._particleVelocityFieldEffect.update(e):e$28(this._particleVelocityFieldEffect)&&e$28(this._particleVelocityFieldEffect._transformFeedback)&&this._particleVelocityFieldEffect.clearLastParticleBuffer(this._context,e)},i$d.prototype.isDestroyed=function(){return!1},i$d.prototype.destroy=function(){return e$28(this._particleVelocityFieldEffect)&&(this._particleVelocityFieldEffect.destroy(),this._particleVelocityFieldEffect=void 0),i$Z(this)};var ge$6="attribute vec4 aPosition;\nattribute vec2 aTexCoord0;\nuniform float uWaterHeight;\nvarying vec2 vNoiseCoord;\nvarying vec3 vProjectionCoord;\nvarying vec3 vEyeDir;\nvarying vec3 vNormal;\nvarying vec4 clip_vertex;\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\nvec4 depthClampFarPlane(vec4 clipPos)\n{\nfWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\nclipPos.z = min(clipPos.z, clipPos.w);\nreturn clipPos;\n}\nvoid initialWaterParam(vec4 oPos)\n{\nfloat uTimeVal = 0.05;\nfloat uScale = 80.0;\nfloat uScroll = 1.0;\nfloat uNoise = 1.0;\nvec2 uBumpSpeed = vec2(3.0 -3.0);\nmat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0,\n0.0, 0.5, 0.0, 0.0,\n0.0, 0.0, 0.5, 0.0,\n0.5, 0.5, 0.5, 1.0);\nvec4 proj = scalemat * oPos;\nvProjectionCoord = proj.xyw;\nvNoiseCoord.xy = aTexCoord0.xy * uScale + uBumpSpeed * uTimeVal;\nvec4 cameraPos = czm_inverseModel * vec4(czm_cameraPositionWC, 1.0);\nvEyeDir = aPosition.xyz - cameraPos.xyz;\nvNormal = vec3(0.0,0.0,1.0);\n}\nvoid main()\n{\nvec4 newPos = vec4(aPosition.xyz, 1.0);\nnewPos.z = newPos.z + uWaterHeight;\nvec4 pos = czm_modelViewProjection * newPos;\ngl_Position = depthClampFarPlane(pos);\nvTexCoord = aTexCoord0.xy;\ninitialWaterParam(pos);\nclip_vertex = czm_modelView * newPos;\n}\n",ce$6="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D uPolygonTexture;\nuniform sampler2D uReflectMap;\nuniform sampler2D uNoiseMap;\nvarying vec2 vNoiseCoord;\nvarying vec3 vProjectionCoord;\nvarying vec3 vEyeDir;\nvarying vec3 vNormal;\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\nvec4 AdjSaturation(in vec4 inputColor, in float saturation)\n{\nvec3 lumCoeff = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(inputColor.rgb, lumCoeff));\nvec3 tempColor = mix(intensity, inputColor.rgb, saturation);\nreturn vec4(tempColor, 1.0);\n}\nvec4 GetWaterColor()\n{\nvec4 uTintColour = vec4(0,0.05,0.05,1);\nvec4 uWaterColour = vec4(0.1804,0.2706,0.3294,1);\nfloat uNoiseScale = 0.05;\nfloat uMinFresnel = 0.3;\nfloat uMaxFresnel = 0.7;\nfloat uFresnelPower = 1.8;\nfloat uWaterBrightness = 0.95;\nvec2 final = vProjectionCoord.xy / vProjectionCoord.z;\nvec3 noiseNormal = (texture2D(uNoiseMap, (vNoiseCoord.xy / 5.0)).rgb - 0.5).rbg * uNoiseScale;\nfinal += noiseNormal.xz;\nfloat realMinFresnel, realMaxFresnel;\nif(uMinFresnel < uMaxFresnel)\n{\nrealMinFresnel = uMinFresnel;\nrealMaxFresnel = uMaxFresnel;\n}\nelse\n{\nrealMinFresnel = uMaxFresnel;\nrealMaxFresnel = uMinFresnel;\n}\nfloat fresnelBias = realMinFresnel;\nfloat fresnelScale = (realMaxFresnel - realMinFresnel) / 1.0;\nfloat fresnel = fresnelBias + fresnelScale * pow(1.0 + dot(normalize(vEyeDir), vNormal), uFresnelPower);\nfresnel = clamp(fresnel, 0.05, 0.95);\nvec4 reflectionColour = texture2D(uReflectMap, final);\nvec4 refractionColour = reflectionColour + uTintColour;\nvec4 resultColour = mix(uWaterColour, reflectionColour, fresnel);\nresultColour = AdjSaturation(resultColour, 1.0);\nresultColour = resultColour * uWaterBrightness;\nresultColour.a = uWaterColour.a;\nreturn resultColour;\n}\nvoid main()\n{\n#if defined(GL_EXT_frag_depth) || defined(WEBGL2)\ngl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\nvec2 texCoord = vTexCoord.xy;\nvec4 waterColor = GetWaterColor();\nvec4 texHeight = texture2D(uPolygonTexture, texCoord.xy);\nif(texHeight.x < 0.5)\n{\ndiscard;\n}\nelse\n{\ngl_FragColor = waterColor;\n}\n}\n",fe$4="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D uHeightTexture;\nuniform sampler2D uAssisTexture;\nuniform float uWaterHeight;\nuniform float uTextureWidth;\nuniform float uTextureHeight;\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\nvoid main()\n{\nfloat dStepX = 1.0 / uTextureWidth;\nfloat dStepY = 1.0 / uTextureHeight;\nvec2 texCoord = vTexCoord;\nvec4 texHeight = texture2D(uHeightTexture, texCoord);\nif(texHeight.r > uWaterHeight || texHeight.r < -90000.0)\n{\ngl_FragColor = vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nvec4 texCenter = texture2D(uAssisTexture, texCoord);\nif(texCenter.x > 0.5)\n{\ngl_FragColor = vec4(1.0,0.0,0.0,1.0);\nreturn;\n}\nvec4 texRight = texture2D(uAssisTexture, vec2(dStepX + texCoord.x, texCoord.y));\nvec4 texTop = texture2D(uAssisTexture, vec2( texCoord.x, dStepY + texCoord.y));\nvec4 texLeft = texture2D(uAssisTexture, vec2(texCoord.x - dStepX, texCoord.y));\nvec4 texBottom = texture2D(uAssisTexture, vec2(texCoord.x, texCoord.y - dStepY));\nvec4 texLeftBottom = texture2D(uAssisTexture, vec2(texCoord.x - dStepX, texCoord.y - dStepY));\nvec4 texRightBottom = texture2D(uAssisTexture, vec2(texCoord.x + dStepX, texCoord.y - dStepY));\nvec4 texLeftTop = texture2D(uAssisTexture, vec2(texCoord.x - dStepX, texCoord.y + dStepY));\nvec4 texRightTop = texture2D(uAssisTexture, vec2(texCoord.x + dStepX, texCoord.y + dStepY));\nif(texCenter.x < 0.5 && texRight.x < 0.5 && texTop.x < 0.5 && texLeft.x < 0.5 && texBottom.x < 0.5 && texLeftBottom.x < 0.5 && texRightBottom.x < 0.5 && texLeftTop.x < 0.5 && texRightTop.x < 0.5)\n{\ndiscard;\n}\ngl_FragColor = vec4(1.0,0.0,0.0,1.0);\n}\n",e$c={Clamp:0,Absolute:1},K$a=Object.freeze(e$c);function I$g(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._floodCommand=void 0,this._boundingSphere=new i$19,this._qureyRegion=[],this._waterHeight=0,this._polygonTexture=null,this._floodPosition=[0,0,0],this._worldMatrix=y$15.IDENTITY.clone(),this._bound=[],this._terrainBlock=void 0,this._terrainBlockURL="",this._points=[],this._datasetInfo=void 0,this._frameState=void 0,this._updateFlagTexture=!1,this._updateHeightTexture=!1,this._name="",this._sceneName="",this._initialize=!1,this._waterMode=K$a.Clamp,this._assistTexture=null,this._heightTexture=null,this._flagCommand=void 0,this._regionGeometry=null,this._textureWidth=1024,this._textureHeight=1024,this._loaded=!1,this._layer=null}function Z$c(e){e$28(e._floodCommand)&&(e._floodCommand.vertexArray=e._floodCommand.vertexArray&&e._floodCommand.vertexArray.destroy(),e._floodCommand.shaderProgram=e._floodCommand.shaderProgram&&e._floodCommand.shaderProgram.destroy(),e._floodCommand=void 0),e$28(e._flagCommand)&&(e._flagCommand.vertexArray=e._flagCommand.vertexArray&&e._flagCommand.vertexArray.destroy(),e._flagCommand.shaderProgram=e._flagCommand.shaderProgram&&e._flagCommand.shaderProgram.destroy(),e._flagCommand=void 0)}function z$d(e){e$28(e._polygonTexture)&&(e._polygonTexture=e._polygonTexture&&e._polygonTexture.destroy(),e._polygonTexture=null),e$28(e._assistTexture)&&(e._assistTexture=e._assistTexture&&e._assistTexture.destroy(),e._assistTexture=null),e$28(e._heightTexture)&&(e._heightTexture=e._heightTexture&&e._heightTexture.destroy(),e._heightTexture=null)}function $$a(e){if(null!==e._polygonTexture&&null!==e._assistTexture){var t=e._textureWidth,i=e._textureHeight,r=0,n=0;if(e._layer==e._scene.globe){var o=(e._bound[2]-e._bound[0])/t,a=(e._bound[3]-e._bound[1])/i,s=e._floodPosition;r=Math.floor((s.x-e._bound[0])/o),n=Math.floor((s.y-e._bound[1])/a)}else{var l=e._regionGeometry.rect,u=(o=(l.z-l.x)/t,a=(l.w-l.y)/i,s=t$X.fromDegrees(e._floodPosition.x,e._floodPosition.y,0),new y$15);y$15.inverse(e._worldMatrix,u),y$15.multiplyByPoint(u,s,s),r=Math.floor((s.x-l.x)/o),n=Math.floor((s.y-l.y)/a)}var c=new Uint8Array(t*i*4);c[4*(n*t+r)]=255,e._polygonTexture.copyFrom({width:t,height:i,arrayBufferView:c});var h=new Uint8Array(t*i*4);h[4*(n*t+r)]=255,e._assistTexture.copyFrom({width:t,height:i,arrayBufferView:h})}}function we$3(e,t,i){e._initialize||(l$g(e),e._regionGeometry=ie$4(e),ae$5(e,t),Ee$4(e,t),ne$7(e,t,e._regionGeometry,e._polygonTexture),D$h(e,e._terrainBlockURL,e._bound),e._initialize=!0),e._updateHeightTexture&&e._loaded&&null!=e._terrainBlock&&null!=e._datasetInfo&&re$3(e),e._updateFlagTexture&&te$7(e,t),e$28(e._floodCommand)&&null!=e._terrainBlock&&null!=e._datasetInfo&&i.push(e._floodCommand)}function be$3(e,t){e._initialize||(e._initialize=!0,l$g(e),e._regionGeometry=ie$4(e),ae$5(e,t),Be$6(e),ne$7(e,t,e._regionGeometry,e._polygonTexture),D$h(e,e._terrainBlockURL,e._bound)),e._updateHeightTexture&&e._loaded&&null!=e._terrainBlock&&null!=e._datasetInfo&&re$3(e),e._updateFlagTexture&&te$7(e,t)}function l$g(e){Re$3(e);var t=e._bound[0],i=e._bound[1],r=e._bound[2],n=e._bound[3],o=t$X.fromDegrees(.5*(r+t),.5*(n+i),0),a=new i$10(0,0,0);m$1b.headingPitchRollToFixedFrame(o,a,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,e._worldMatrix)}function Re$3(e){if(0!==e._points.length){for(var t=Number.MAX_VALUE,i=Number.MAX_VALUE,r=-Number.MAX_VALUE,n=-Number.MAX_VALUE,o=0;o<e._points.length;o++)t=Math.min(e._points[o].x,t),i=Math.min(e._points[o].y,i),r=Math.max(e._points[o].x,r),n=Math.max(e._points[o].y,n);e._bound.length=0,e._bound.push(t),e._bound.push(i),e._bound.push(r),e._bound.push(n)}}function Ee$4(e,t){if(0!=e._points.length){var i=e._points.length,r=S$W.createTypedArray(S$W.FLOAT,3*i),n=S$W.createTypedArray(S$W.FLOAT,2*i),o=new y$15;y$15.inverse(e._worldMatrix,o);for(var a=[],s=0;s<e._qureyRegion.length/3;s++)a[3*s]=e._qureyRegion[3*s],a[3*s+1]=e._qureyRegion[3*s+1],a[3*s+2]=e._qureyRegion[3*s+2];var l=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(a)}}),u=U$Q.createGeometry(l);f$X.updateGeometry(u,a,o),e._boundingSphere=u.boundingSphere;for(s=0;s<u.attributes.position.values.length/3;s++)r[3*s]=u.attributes.position.values[3*s],r[3*s+1]=u.attributes.position.values[3*s+1],r[3*s+2]=u.attributes.position.values[3*s+2],n[2*s]=u.attributes.st.values[2*s],n[2*s+1]=u.attributes.st.values[2*s+1];var c=null,h=ce$v.UNSIGNED_SHORT;i<65535?c=S$W.createTypedArray(S$W.UNSIGNED_SHORT,u.indices.length):(c=S$W.createTypedArray(S$W.UNSIGNED_INT,u.indices.length),h=ce$v.UNSIGNED_INT);for(s=0;s<u.indices.length;s++)c[s]=u.indices[s];Se$3(e,t,r,n,c,h)}}function Se$3(e,t,i,r,n,o){Z$c(e);var a=h$W.createVertexBuffer({context:t,typedArray:i,usage:A$1c.STATIC_DRAW}),s=h$W.createVertexBuffer({context:t,typedArray:r,usage:A$1c.STATIC_DRAW}),l=[],u={aPosition:0,aTexCoord0:1};l.push({index:u.aPosition,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),l.push({index:u.aTexCoord0,vertexBuffer:s,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var c=h$W.createIndexBuffer({context:t,typedArray:n,usage:A$1c.STATIC_DRAW,indexDatatype:o});e._floodCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:e._worldMatrix,boundingVolume:e._boundingSphere,pass:Le$p.ANALYSIS,owner:e,cull:!0}),e._floodCommand.vertexArray=new m$19({context:t,attributes:l,indexBuffer:c});var h=new a$$({sources:[ge$6]});e._floodCommand.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:ce$6,attributeLocations:u}),e._floodCommand.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0}}),e._floodCommand.uniformMap={uWaterHeight:function(){return e._waterHeight},uPolygonTexture:function(){return e._polygonTexture},uReflectMap:function(){return e._frameState._framebufferList.water.renderTexture._fb.getColorTexture(0)},uNoiseMap:function(){return e._frameState._framebufferList.water._waterNormalMap}}}function D$h(e,t,i){""!=t&&4==i.length&&d$17(t+".xml").then((function(r){var n=r.getElementsByTagName("leftBottom"),o=n[0].children[0].textContent,a=n[0].children[1].textContent,s=r.getElementsByTagName("rightTop"),l=s[0].children[0].textContent,u=s[0].children[1].textContent,c=r.getElementsByTagName("height")[0].textContent,h=r.getElementsByTagName("width")[0].textContent;e._datasetInfo={width:h,height:c,left:o,right:l,top:u,bottom:a,xRatio:(l-o)/h,yRatio:(u-a)/c};for(var d=[],f=0;f<e._datasetInfo.width;f++){for(var p=[],_=0;_<e._datasetInfo.height;_++)p.push(-99999);d.push(p)}ee$7(e,t,i,d)}))}function ee$7(e,t,i,r){u$O(t+'/gridValues.json?bounds={"leftBottom":{"x":'+i[0]+',"y":'+i[1]+'},"rightTop":{"x":'+i[2]+',"y":'+i[3]+"}}").then((function(t){for(var i=t.values,n=0;n<i.length;n++)for(var o=i[n],a=0,s=o.length;a<s;a++){var l=o[a];r[l.column][l.row]=l.value}e._terrainBlock=r;var u=(e._floodPosition.x-e._datasetInfo.left)/e._datasetInfo.xRatio,c=(e._datasetInfo.top-e._floodPosition.y)/e._datasetInfo.yRatio;u=Math.ceil(u),c=Math.ceil(c),r[u][c]>-9e4&&(e._loaded=!0),e._updateHeightTexture=!0}),(function(n){if(400==n.statusCode)for(var o=0;o<2;o++)for(var a=(i[2]-i[0])/2,s=i[0]+a*o,l=s+a,u=0;u<2;u++){var c=(i[3]-i[1])/2,h=i[1]+c*u,d=h+c,f=[];f[0]=s,f[1]=h,f[2]=l,f[3]=d,ee$7(e,t,f,r)}}))}function te$7(e,t){if(null!=e._terrainBlock&&null!=e._datasetInfo){e._flagCommand.execute(t);var i=t.readPixels({x:0,y:0,width:e._textureWidth,height:e._textureHeight,framebuffer:e._flagCommand.framebuffer});e._assistTexture.copyFrom({width:e._textureWidth,height:e._textureHeight,arrayBufferView:i})}}function re$3(e,t){if(null!=e._terrainBlock&&null!=e._datasetInfo){var i=new Float32Array(e._textureWidth*e._textureHeight);if(e._layer==e._scene.globe)for(var r=(e._bound[2]-e._bound[0])/e._textureWidth,n=(e._bound[3]-e._bound[1])/e._textureHeight,o=0;o<e._textureWidth;o++)for(var a=e._bound[0]+r*o,s=0;s<e._textureHeight;s++){-99999!=(f=q$b(e,a,e._bound[1]+n*s))&&(i[s*e._textureWidth+o]=f,e._minHeight=Math.min(f,e._minHeight))}else{var l=e._regionGeometry.rect,u=(l.z-l.x)/e._textureWidth,c=(l.w-l.y)/e._textureHeight;for(o=0;o<e._textureWidth;o++){var h=l.x+u*o;for(s=0;s<e._textureHeight;s++){var d=new t$X(h,l.y+c*s,0);y$15.multiplyByPoint(e._worldMatrix,d,d);var f,p=Cesium.Cartographic.fromCartesian(d);-99999!=(f=q$b(e,Cesium.Math.toDegrees(p.longitude),Cesium.Math.toDegrees(p.latitude)))&&(i[s*e._textureWidth+o]=f,e._minHeight=Math.min(f,e._minHeight))}}}e._heightTexture.copyFrom({width:e._textureWidth,height:e._textureHeight,arrayBufferView:i}),e._updateFlagTexture=!0,e._updateHeightTexture=!1}}function q$b(e,t,i){if(t<e._datasetInfo.left||t>e._datasetInfo.right||i<e._datasetInfo.bottom||i>e._datasetInfo.top)return-99999;var r=(t-e._datasetInfo.left)/e._datasetInfo.xRatio,n=(e._datasetInfo.top-i)/e._datasetInfo.yRatio;return r=Math.ceil(r),n=Math.ceil(n),e._terrainBlock[r][n]}function ae$5(e,t){var i=e._textureWidth,r=e._textureHeight;z$d(e),null===e._polygonTexture&&(e._polygonTexture=new L$17({context:t,width:e._textureWidth,height:e._textureHeight,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),flipY:!1})),null===e._assistTexture&&(e._assistTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST}),flipY:!1})),$$a(e),null===e._heightTexture&&(e._heightTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.FLOAT,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR}),flipY:!1}))}function ie$4(e,t){for(var i=[],r=0;r<e._qureyRegion.length/3;r++)i[3*r]=e._qureyRegion[3*r],i[3*r+1]=e._qureyRegion[3*r+1],i[3*r+2]=e._qureyRegion[3*r+2];var n=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)}}),o=0,a=U$Q.createGeometry(n),s=a.attributes.position.values;S$W.createTypedArray(S$W.FLOAT,s.length);var l=S$W.createTypedArray(S$W.FLOAT,s.length/3*2),u=new e$25(e._bound[0]*e$27.RADIANS_PER_DEGREE,e._bound[1]*e$27.RADIANS_PER_DEGREE,e._bound[2]*e$27.RADIANS_PER_DEGREE,e._bound[3]*e$27.RADIANS_PER_DEGREE);if(e._layer==e._scene.globe){var c=e._bound[2]-e._bound[0],h=e._bound[3]-e._bound[1];for(r=0;r<s.length;r+=3){var d=new t$X(s[r],s[r+1],s[r+2]),f=Cesium.Cartographic.fromCartesian(d),p=Cesium.Math.toDegrees(f.longitude),_=Cesium.Math.toDegrees(f.latitude);l[o++]=(p-e._bound[0])/c,l[o++]=(_-e._bound[1])/h}var m=new y$15;y$15.inverse(e._worldMatrix,m),f$X.updateGeometry(a,i,m)}else{m=new y$15;y$15.inverse(e._worldMatrix,m),f$X.updateGeometry(a,i,m);for(c=(u=f$X.updateGeoBounds(a)).z-u.x,h=u.w-u.y,r=0;r<s.length;r+=3)l[o++]=(s[r]-u.x)/c,l[o++]=(s[r+1]-u.y)/h}return{vertices:a.attributes.position.values,texcoords:l,indices:a.indices,rect:u}}function ne$7(e,t,i,r){if(e$28(i)){var n=new r$15({primitiveType:W$_.TRIANGLES}),o=h$W.createVertexBuffer({context:t,typedArray:i.vertices,usage:A$1c.STATIC_DRAW}),a=h$W.createVertexBuffer({context:t,typedArray:i.texcoords,usage:A$1c.STATIC_DRAW}),s=[],l={aPosition:0,aTexCoord0:1};s.push({index:l.aPosition,vertexBuffer:o,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),s.push({index:l.aTexCoord0,vertexBuffer:a,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1});var u=h$W.createIndexBuffer({context:t,typedArray:i.indices,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});n.vertexArray=new m$19({context:t,attributes:s,indexBuffer:u});var c=new a$$({sources:["attribute vec4 position;\nattribute vec4 aTexCoord0;\nvarying vec2 vTexCoord;\nvoid main()\n{\n vTexCoord = vec2(aTexCoord0.xy);\n vec2 vPos = aTexCoord0.xy * 2.0 - 1.0;\n gl_Position = vec4(vPos, 0.1, 1.0);\n}\n"]}),h=new a$$({sources:[fe$4]});n.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:c,fragmentShaderSource:h,attributeLocations:l}),n.framebuffer=new a$z({context:t,colorTextures:[r],destroyAttachments:!1}),n.renderState=u$R.fromCache({cull:{enabled:!1}}),n.uniformMap={uTextureWidth:function(){return e._textureWidth},uTextureHeight:function(){return e._textureHeight},uWaterHeight:function(){return e._waterHeight},uHeightTexture:function(){return e._heightTexture},uAssisTexture:function(){return e._assistTexture}},e._flagCommand=n}}function _e$4(e){e._loaded=!1,e._initialize=!1,e._updateFlagTexture=!1,e._updateHeightTexture=!1}function Be$6(e){var t=new e$25(e._bound[0]*e$27.RADIANS_PER_DEGREE,e._bound[1]*e$27.RADIANS_PER_DEGREE,e._bound[2]*e$27.RADIANS_PER_DEGREE,e._bound[3]*e$27.RADIANS_PER_DEGREE);e._layer!==e._scene.globe&&(t=e._regionGeometry.rect),e._layer._setFloodTexture(e._polygonTexture,t,e._worldMatrix)}function Ie$5(e){e._layer._removeFloodTexture()}function h$d(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(I$g.prototype,{floodPosition:{get:function(){return this._floodPosition},set:function(e){this._floodPosition=e,this._updateFlagTexture=!0,$$a(this)}},waterHeight:{get:function(){return this._waterHeight},set:function(e){this._waterHeight=e,this._updateFlagTexture=!0,$$a(this)}},waterMode:{get:function(){return this._waterMode},set:function(e){this._waterMode=e,this._updateFlagTexture=!0}},layer:{get:function(){return this._layer},set:function(e){this._layer=e,Z$c(this),z$d(this),_e$4(this)}}}),I$g.prototype.destroy=function(){return this._scene._analyst3D.remove(this._name,!0),null!==this._scene&&this._waterMode===K$a.Clamp&&Ie$5(this),Z$c(this),z$d(this),i$Z(this)},I$g.prototype.build=function(){""===this._name&&(this._name="floodAnalysis3D"+this._scene._analyst3D._layerIndex,this._sceneName=this._name+"_scene",this._cameraName=this._name+"_camera",this._scene._analyst3D.add(this))},I$g.prototype.qureyRegion=function(e){if(!e$28(e)||!e$28(e.position))throw new t$Z("the options is required");this._qureyRegion=e.position,this._points.length=0;for(var t=this._qureyRegion.length/3,i=0;i<t;i++){var r=new t$X(this._qureyRegion[3*i],this._qureyRegion[3*i+1],this._qureyRegion[3*i+2]);this._points.push(r)}_e$4(this)},I$g.prototype.terrainURL=function(e){this._terrainBlockURL=e},I$g.prototype.update=function(e,t,i){this._frameState=t,this._textureWidth=e.drawingBufferWidth,this._textureHeight=e.drawingBufferHeight,this._waterMode===K$a.Absolute?we$3(this,e,i):be$3(this,e)};for(var l$f=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],n$h=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],f$i=0;f$i<n$h.length;++f$i)n$h[f$i]*=1e6;for(var g$d=n$h[1],m$i=n$h[n$h.length-1],d$k=0;d$k<n$h.length;++d$k)n$h[d$k]=(n$h[d$k]-m$i)/(g$d-m$i);var e$b=0;function F$b(e){var t,i=l$f,r=i.length;if(e<i[0])return e$b=0;if(e>i[r-1])return e$b=r-2;if(e>=i[e$b]){if(e$b+1<r&&e<i[e$b+1])return e$b;if(e$b+2<r&&e<i[e$b+2])return++e$b}else if(e$b-1>=0&&e>=i[e$b-1])return--e$b;for(t=0;t<r-2&&!(e>=i[t]&&e<i[t+1]);++t);return e$b=t}var M$i=new t$X;function i$c(e){if(!e$28(e)||!e$28(e.scene))throw new t$Z("options.scene is required.");this._scene=e.scene,this.samplingWindow=u$Y(e.samplingWindow,i$c.defaultSettings.samplingWindow),this.quietPeriod=u$Y(e.quietPeriod,i$c.defaultSettings.quietPeriod),this.warmupPeriod=u$Y(e.warmupPeriod,i$c.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=u$Y(e.minimumFrameRateDuringWarmup,i$c.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=u$Y(e.minimumFrameRateAfterWarmup,i$c.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o$1o,this._nominalFrameRate=new o$1o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener((function(e,i){l$e(t)})),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var i=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;function r(){o$n(t)}this._visibilityChangeRemoveListener=void 0,e$28(i)&&(document.addEventListener(i,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(i,r,!1)})}function l$e(e,t){if(!(e._pauseCount>0)){var i=kt$7();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/h$Z.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/h$Z.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/h$Z.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n,n>1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup)?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function o$n(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}function h$c(e,t,i){this.context=e,this.commandList=[],this.commandListRealtimeRaster=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=P$$.SCENE3D,this.morphTime=P$$.getMorphTime(P$$.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1,asynchronous:!1,fbo:!1,normal:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this._framebufferList=[],this.shadowState={shadowsEnabled:!0,lightShadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=new o$1k,this.globeSplitPosition=new o$1k,this.frustumSplits=[],this.backgroundColor=void 0,this.sunColor=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this._fboState={name:"normal",enabled:!1,frameBufferType:L$T.NORMAL},this.useType=0,this.frustumIndex=0,this.multiViewportIndex=-1,this.globeBottomLevel=0,this.minTerrainHeight=0,this.maxTerrainHeight=0,this.TAAEnable=!1,this.rasterLineWidth=1,this.pickIDColor=new e$1S,this.tilesetPassState=void 0,this.requests=[],this.updateRoArr=[],this.rasterPerFrame=!1,this.pbrMaterialsArr=[]}function i$b(e,t){this.near=u$Y(e,0),this.far=u$Y(t,0);for(var i=Le$p.NUMBER_OF_PASSES,r=new Array(i),n=new Array(i),o=0;o<i;++o)r[o]=[],n[o]=0;this.commands=r,this.indices=n}h$d.prototype.update=function(e){if(e.fog.enabled=this.enabled){var t=e.camera,i=t.positionCartographic;if(!e$28(i)||i.height>8e5||e.mode!==P$$.SCENE3D)return void(e.fog.enabled=!1);var r=i.height,n=F$b(r),o=e$27.clamp((r-l$f[n])/(l$f[n+1]-l$f[n]),0,1),a=e$27.lerp(n$h[n],n$h[n+1],o),s=1e6*this.density;a=a*(s-s/g$d*m$i)*1e-6;var l=t$X.normalize(t.positionWC,M$i);a*=1-Math.abs(t$X.dot(t.directionWC,l)),e.fog.density=a,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness}},i$c.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},i$c.fromScene=function(e){if(!e$28(e))throw new t$Z("scene is required.");return(!e$28(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new i$c({scene:e})),e._frameRateMonitor},Object.defineProperties(i$c.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),i$c.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},i$c.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},i$c.prototype.isDestroyed=function(){return!1},i$c.prototype.destroy=function(){return this._preUpdateRemoveListener(),e$28(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i$Z(this)};var De$6="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform vec4 u_initialColor;\nuniform float u_GlobeAlpha;\nuniform vec3 u_sunLightColor;\nuniform vec3 u_ambientLightColor;\nuniform vec4 uSlopeArrowsColor;\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#if GRIDTEXTURE_UNITS > 0\nuniform sampler2D u_gridTextures[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTranslationAndScale[GRIDTEXTURE_UNITS];\nuniform bool u_gridTextureUseWebMercatorT[GRIDTEXTURE_UNITS];\nuniform vec4 u_gridTextureTexCoordsRectangle[GRIDTEXTURE_UNITS];\n#endif\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\nuniform bool u_dayTextureFlipY[TEXTURE_UNITS];\nuniform vec4 u_transparentBackColor[TEXTURE_UNITS];\nuniform bool u_imageryClipEnable[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform vec2 u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SWIPE\nuniform vec4 u_dayTextureSwipeRegion[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GLOBESPLIT\nuniform vec2 u_GlobeSplitDirection;\n#endif\n#ifdef APPLY_GLOBESWIPE\nuniform vec4 u_GlobeSwipeRegion;\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef ALPHAFILTER\nuniform float u_dayMinAlphaFilters[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\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 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 SHOW_NORMAL_MAP\nuniform sampler2D u_normalTexture;\nuniform vec4 u_normalTextureTranslationAndScale;\nvarying vec3 vertNorm;\n#endif\n#ifdef SQRESULT\nuniform sampler2D uFrontColorTexture;\nuniform sampler2D uFrontDepthTexture;\nuniform sampler2D uBackDepthTexture;\n#endif\n#ifdef SLOPE_ANALYSIS\nuniform sampler2D uSlopeColorTexture;\nuniform sampler2D uSlopeArrowsTexture;\nuniform sampler2D uSlopePolygonTexture;\nuniform float uSlopeHasColorTable;\nuniform float uSlopeFillMode;\nuniform float uSlopeOpacity;\nuniform float uSlopeFloor;\nuniform float uSlopeCeil;\nuniform float uSlopeMinVisibleValue;\nuniform float uSlopeMaxVisibleValue;\nuniform float uHasSlopeRegion;\nconst float PI = 3.1415926535897932384626;\nvarying vec3 texCoordRotate;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvarying float v_height2;\n#ifdef HYPSOMETRIC_ANALYSIS\nuniform sampler2D uHypsometricTexture;\nuniform sampler2D uHypsometricRenderTexture;\nuniform float uHypHasColorTable;\nuniform float uHypContourFillMode;\nuniform float uHypContourInterval;\nuniform float uHypOpacity;\nuniform float uHypMaxVisibleValue;\nuniform float uHypMinVisibleValue;\nuniform float uHypFloor;\nuniform float uHypCeil;\nuniform vec4 uHypLineColor;\nuniform float uHypHasAnalysisRegion;\n#endif\nuniform vec4 uTileBounds;\n#if defined(Excavate_Region) || defined(Excavate_Outer) || defined(SLOPE_ANALYSIS) || defined(HYPSOMETRIC_REGION)\n#ifndef Apply_ImageryClip\nuniform sampler2D uModifyRasterTexture;\n#endif\n#endif\n#ifdef BRDF\nuniform vec4 uBaseColorFactor;\nuniform float uMetallicFactor;\nuniform float uRoughnessFactor;\n#endif\n#ifdef FLOOD_ANALYSIS\nuniform sampler2D uFloodTexture;\nuniform vec4 uFloodRect;\nvarying vec3 vProjectionCoord;\n#endif\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);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n#ifdef HYPSOMETRIC_ANALYSIS\nfloat computeMixCon()\n{\nfloat distanceToContour;\nif(abs(uHypMaxVisibleValue - uHypMinVisibleValue) > 0.1)\n{\nfloat t = floor(v_height2 / uHypContourInterval);\ndistanceToContour = abs(v_height2 - t * uHypContourInterval - 0.1) ;\n}\nelse\n{\ndistanceToContour = abs(v_height2 - uHypMaxVisibleValue);\n}\nfloat dxc = abs(dFdx(v_height2));\nfloat dyc = abs(dFdy(v_height2));\nfloat dF = max(dxc, dyc);\nreturn (distanceToContour < dF) ? 1.0 : 0.0;\n}\nvec4 computeContourMapColor()\n{\nfloat threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\nfloat contourRate = (v_height2 - uHypFloor) / threshold;\nfloat finalCoord = clamp(contourRate, 0.0, 1.0);\nvec2 contourCoord = vec2(0.0, finalCoord);\nreturn texture2D(uHypsometricTexture, contourCoord).rgba;\n}\n#endif\n#ifdef SLOPE_ANALYSIS\nvec4 ComputeSlopeArrowColor(in float slopeAngle,in vec3 realNormal)\n{\nif (slopeAngle <= PI/180.0)\n{\nreturn vec4(0.0);\n}\nvec2 limitTexCoord = fract(texCoordRotate.xy);\nfloat scale = texCoordRotate.z;\nvec2 uv = (floor(texCoordRotate.xy) + 0.9) / scale;\nvec2 normalTextureTranslation = u_normalTextureTranslationAndScale.xy;\nvec2 normalTextureScale = u_normalTextureTranslationAndScale.zw;\nvec2 normalTextureCoordinates = uv.xy * normalTextureScale + normalTextureTranslation;\nvec3 normalTC = texture2D(u_normalTexture, normalTextureCoordinates.xy).xyz;\nnormalTC = (normalTC - 0.5) * 2.0;\nvec2 slopeDirection = normalTC.xy;\nvec4 arrowsTexColor = vec4(0.0);\nfloat arrowAlpha = 0.0;\nfloat distance = length(slopeDirection);\nfloat acosSlopeDirection = acos(slopeDirection.x/distance);\nfloat slopeArrowsAngle = acosSlopeDirection;\nif(slopeDirection.y<0.0)\n{\nslopeArrowsAngle = 2.0 * PI - acosSlopeDirection;\n}\nvec2 n = vec2(cos(slopeArrowsAngle),-sin(slopeArrowsAngle));\nvec2 t = vec2(sin(slopeArrowsAngle),cos(slopeArrowsAngle));\nmat2 slopeRotateZMatrix = mat2(n,t);\nvec2 transCoord = limitTexCoord - vec2(0.5,0.5);\ntransCoord = slopeRotateZMatrix * transCoord ;\ntransCoord += vec2(0.5,0.5);\ntransCoord = smoothstep(0.0,1.0,transCoord);\narrowsTexColor = texture2D(uSlopeArrowsTexture, transCoord);\narrowAlpha = arrowsTexColor.a;\nfloat xNum = floor(transCoord.x * 64.0);\nfloat yNum = floor(transCoord.y * 64.0);\nif ((xNum<=2.0||xNum>=61.0||yNum<=2.0||yNum>=61.0)&&arrowAlpha<1.0)\n{\narrowAlpha = 0.0;\n}\narrowsTexColor = vec4(arrowsTexColor.rgb,arrowAlpha);\nreturn arrowsTexColor;\n}\n#endif\nvec4 sRGBToLinear( in vec4 value ) {\n#ifndef HDR\nreturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n#else\nreturn value;\n#endif\n}\nvec4 LinearTosRGB( in vec4 value ) {\n#ifndef HDR\nreturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n#else\nreturn value;\n#endif\n}\n#ifdef BRDF\nvec3 SRGBtoLINEAR3(vec3 srgbIn)\n{\nreturn pow(srgbIn, vec3(2.2));\n}\nvec4 SRGBtoLINEAR4(vec4 srgbIn)\n{\nsrgbIn = srgbIn * uBaseColorFactor;\nvec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\nreturn vec4(linearOut, srgbIn.a);\n}\nvec3 LINEARtoSRGB(vec3 linearIn)\n{\n#ifndef HDR\nreturn pow(linearIn, vec3(1.0/2.2));\n#else\nreturn linearIn;\n#endif\n}\nconst float M_PI = 3.141592653589793;\nvec3 lambertianDiffuse(vec3 diffuseColor)\n{\nreturn diffuseColor / M_PI;\n}\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n{\nreturn f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\nfloat smithVisibilityG1(float NdotV, float roughness)\n{\nfloat k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n{\nreturn smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\nfloat GGX(float roughness, float NdotH)\n{\nfloat roughnessSquared = roughness * roughness;\nfloat f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\nreturn roughnessSquared / (M_PI * f * f);\n}\nvec3 applyTonemapping(vec3 linearIn)\n{\n#ifndef HDR\nreturn czm_acesTonemapping(linearIn);\n#else\nreturn linearIn;\n#endif\n}\nvec3 brdf(in vec4 baseColorWithAlpha) {\nbaseColorWithAlpha = SRGBtoLINEAR4(baseColorWithAlpha);\nvec3 ng = normalize(v_normalEC);\nvec3 n = ng;\nvec3 baseColor = baseColorWithAlpha.rgb;\nfloat roughness = uRoughnessFactor;\nfloat metalness = uMetallicFactor;\nvec3 v = -normalize(v_positionEC);\nvec3 lightColorHdr = vec3(5.0);\nvec3 l = normalize(czm_lightDirectionEC);\nvec3 h = normalize(v + l);\nfloat NdotL = clamp(dot(n, l), 0.001, 1.0);\nfloat NdotV = abs(dot(n, v)) + 0.001;\nfloat NdotH = clamp(dot(n, h), 0.0, 1.0);\nfloat LdotH = clamp(dot(l, h), 0.0, 1.0);\nfloat VdotH = clamp(dot(v, h), 0.0, 1.0);\nvec3 f0 = vec3(0.04);\nvec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\nvec3 specularColor = mix(f0, baseColor, metalness);\nfloat alpha = roughness * roughness;\nfloat reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\nvec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\nvec3 r0 = specularColor.rgb;\nvec3 F = fresnelSchlick2(r0, r90, VdotH);\nfloat G = smithVisibilityGGX(alpha, NdotL, NdotV);\nfloat D = GGX(alpha, NdotH);\nvec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\nvec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\nvec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n#ifndef IBL\nvec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\nvec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\nfloat vertexRadius = length(positionWC);\nfloat horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\nfloat reflectionDotNadir = dot(r, normalize(positionWC));\nr.x = -r.x;\nr = -normalize(czm_temeToPseudoFixed * r);\nr.x = -r.x;\nfloat inverseRoughness = 1.04 - roughness;\ninverseRoughness *= inverseRoughness;\nvec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\nfloat atmosphereHeight = 0.05;\nfloat blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\nfloat blendRegionOffset = roughness * -1.0;\nfloat farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\nfloat aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\nfloat farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\nfloat smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\nvec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\nvec3 nadirColor = belowHorizonColor * 0.5;\nvec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\nvec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\nvec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\nvec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\nfloat diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\nfloat diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\nvec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\nfloat notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\nvec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\nspecularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\nspecularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\nfloat LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\nfloat S = acos(LdotZenith);\nfloat NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\nfloat gamma = acos(NdotL);\nfloat numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\nfloat denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\nfloat luminance = 0.2 * (numerator / denominator);\nvec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\nvec3 IBLColor = (diffuseIrradiance * diffuseColor * 1.0) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * 1.0);\nfloat maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\nvec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\nIBLColor *= lightColor;\ncolor += IBLColor * luminance;\n#else\nmat3 fixedToENU = mat3(czm_modelView[0][0], czm_modelView[1][0], czm_modelView[2][0], czm_modelView[0][1], czm_modelView[1][1], czm_modelView[2][1], czm_modelView[0][2], czm_modelView[1][2], czm_modelView[2][2]);\nconst mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0);\nvec3 cubeDir = normalize(yUpToZUp * fixedToENU * reflect(-v, n));\nvec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);\nvec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\nvec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\nspecularIBL *= F * brdfLut.x + brdfLut.y;\ncolor += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n#endif\ncolor = applyTonemapping(color);\ncolor = LINEARtoSRGB(color);\nreturn color;\n}\n#endif\n#ifdef SQRESULT\nfloat computeDepth()\n{\n#ifdef LOG_DEPTH\nreturn log2(v_depthFromNearPlusOne) * czm_oneOverLog2FarDepthFromNearPlusOne;\n#else\nreturn gl_FragCoord.z;\n#endif\n}\nbool isPointInObject(vec2 texCoord)\n{\nbool bIn = false;\nvec4 colorInClipTexture = texture2D(uFrontColorTexture,texCoord.xy);\nif(colorInClipTexture.r > 0.99 && colorInClipTexture.g < 0.01 && colorInClipTexture.b < 0.01)\n{\nfloat depthNear = czm_unpackDepth(texture2D(uFrontDepthTexture, texCoord.xy)) - 0.00001;\nfloat depthFar = czm_unpackDepth(texture2D(uBackDepthTexture, texCoord.xy)) + 0.00001;\nfloat currentDepth = computeDepth();\nif(currentDepth > depthNear && currentDepth < depthFar){\nbIn = true;\n}\n}\nreturn bIn;\n}\n#endif\nvoid main()\n{\n#ifdef APPLY_GLOBESPLIT\nvec2 splitPosition = czm_globeSplitPosition;\nif (u_GlobeSplitDirection.x < 0.0 && gl_FragCoord.x > splitPosition.x) {\ndiscard;\n}\nelse if (u_GlobeSplitDirection.x > 0.0 && gl_FragCoord.x < splitPosition.x) {\ndiscard;\n}\nif(u_GlobeSplitDirection.y < 0.0 && gl_FragCoord.y > splitPosition.y) {\ndiscard;\n}\nelse if(u_GlobeSplitDirection.y > 0.0 && gl_FragCoord.y < splitPosition.y) {\ndiscard;\n}\n#endif\n#ifdef APPLY_GLOBESWIPE\nif (gl_FragCoord.x < u_GlobeSwipeRegion.x || gl_FragCoord.y > u_GlobeSwipeRegion.y) {\ndiscard;\n}\nelse if (gl_FragCoord.x > u_GlobeSwipeRegion.z || gl_FragCoord.y < u_GlobeSwipeRegion.w) {\ndiscard;\n}\n#endif\n#ifdef Excavate_Region\nif(texture2D(uModifyRasterTexture, v_textureCoordinates.xy).w > 0.5)\n{\ndiscard;\n}\n#endif\n#ifdef Excavate_Outer\nif(texture2D(uModifyRasterTexture, v_textureCoordinates.xy).w < 0.1)\n{\ndiscard;\n}\n#endif\n#ifdef SQRESULT\nvec2 texCoord = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\nif(isPointInObject(texCoord))\n{\ndiscard;\n}\n#endif\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\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\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_getWgs84EllipsoidEC().radii;\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;\nczm_material material = czm_getMaterial(materialInput);\ncolor.xyz = mix(color.xyz, material.diffuse, material.alpha);\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * u_sunLightColor.rgb * diffuseIntensity + u_ambientLightColor.rgb * 0.25, color.a);\n#elif defined(SHOW_NORMAL_MAP)\nvec2 normalTextureTranslation = u_normalTextureTranslationAndScale.xy;\nvec2 normalTextureScale = u_normalTextureTranslationAndScale.zw;\nvec2 normalTextureCoordinates = v_textureCoordinates.xy * normalTextureScale + normalTextureTranslation;\nvec3 realNormal = texture2D(u_normalTexture, normalTextureCoordinates.xy).xyz;\nrealNormal = (realNormal - 0.5) * 2.0;\n#ifdef ENABLE_LIGHTING\nvec3 zAxis = normalize(vertNorm);\nvec3 xAxis = normalize(vec3(-vertNorm.y, vertNorm.x, 0));\nvec3 yAxis = normalize(cross(zAxis, xAxis));\nmat3 matrix = mat3(xAxis, yAxis, zAxis);\nvec3 vNormal = czm_normal3D * matrix * realNormal;\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(vNormal)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * u_sunLightColor.rgb * diffuseIntensity + u_ambientLightColor.rgb * 0.25, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * u_sunLightColor.rgb * diffuseIntensity + u_ambientLightColor.rgb * 0.25, 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#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nconst float fExposure = 2.0;\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 HYPSOMETRIC_ANALYSIS\nif(uHypHasColorTable > 0.1)\n{\nbool hasHyp = true;\n#ifdef HYPSOMETRIC_REGION\nif(uHypHasAnalysisRegion > 0.1){\nhasHyp = texture2D(uModifyRasterTexture, v_textureCoordinates.xy).w > 0.5;\n}\n#endif\nif(hasHyp)\n{\nvec4 contourMapColor = vec4(1.0);\nfloat finalOpacity = uHypOpacity;\nif(v_height2 > uHypMaxVisibleValue + 4.0 || v_height2 < uHypMinVisibleValue - 4.0)\n{\nfinalOpacity = 0.5;\n}\nelse\n{\n#if defined(GL_OES_standard_derivatives) || defined(WEBGL2)\nif(uHypContourFillMode > 2.9)\n{\nfloat mix_con = computeMixCon();\ncontourMapColor = mix(computeContourMapColor(), uHypLineColor, mix_con);\n}\nelse if(uHypContourFillMode > 1.9)\n{\nfinalOpacity = computeMixCon();\ncontourMapColor = uHypLineColor;\n}\nelse if(uHypContourFillMode > 0.9)\n#else\nif(uHypContourFillMode > 0.9)\n#endif\n{\ncontourMapColor = computeContourMapColor();\n}\nelse\n{\nfinalOpacity = 0.0;\n}\nfinalColor = mix(finalColor, contourMapColor, finalOpacity);\n}\n}\n}\n#endif\n#ifdef SLOPE_ANALYSIS\nbool hasSlopeRegion = true;\n#ifdef SlopeRegion\nif(uHasSlopeRegion > 0.1){\nhasSlopeRegion = texture2D(uModifyRasterTexture, v_textureCoordinates.xy).w > 0.5;\n}\n#endif\nif(hasSlopeRegion)\n{\nfloat finalOpacity = uSlopeOpacity;\nfloat slopeRate = abs(normalize(realNormal).z);\nfloat slopeAngle = acos(slopeRate);\nif (slopeAngle < uSlopeMinVisibleValue || slopeAngle > uSlopeMaxVisibleValue)\n{\nfinalOpacity = 0.0;\n}\nfloat threshold = clamp(abs(uSlopeCeil-uSlopeFloor),0.0000001,PI/2.0);\nfloat rate = (slopeAngle-uSlopeFloor)/threshold;\nfloat finalRate = clamp(rate,0.0,1.0);\nfloat count = floor(finalRate * 16.0);\nfloat y = (count*2.0 + 1.0)/32.0;\nfloat x = fract(finalRate*16.0);\nif(y > 1.0)\n{\nx = 1.0;\n}\nvec2 slopeCoord = vec2(x, y);\nvec4 slopeFillColor = texture2D(uSlopeColorTexture, slopeCoord);\nvec4 slopeMapColor = vec4(0.0);\nif(uSlopeFillMode > 2.9)\n{\nvec4 arrowsTexColor = ComputeSlopeArrowColor(slopeAngle, realNormal);\nslopeMapColor = mix(slopeFillColor, arrowsTexColor * uSlopeArrowsColor, arrowsTexColor.a);\n}\nelse if(uSlopeFillMode > 1.9)\n{\nvec4 arrowsTexColor = ComputeSlopeArrowColor(slopeAngle, realNormal);\nslopeMapColor = arrowsTexColor * uSlopeArrowsColor;\nfinalOpacity *= arrowsTexColor.a;\n}\nelse if(uSlopeFillMode > 0.9)\n{\nslopeMapColor = slopeFillColor;\n}\nelse\n{\nfinalOpacity = 0.0;\n}\nfinalColor = mix(finalColor, slopeMapColor, finalOpacity);\n}\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (czm_sceneMode != czm_sceneMode3D)\n{\nfinalColor.a *= u_GlobeAlpha;\ngl_FragColor = finalColor;\n#ifdef Height_Map\ngl_FragColor = czm_packValue(v_height2);\n#endif\nreturn;\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\nfadeInDist = u_nightFadeDistance.x;\nfadeOutDist = 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\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n#endif\nfinalColor.a *= u_GlobeAlpha;\nif (finalColor.a == 0.0) {\ndiscard;\n}\ngl_FragColor = finalColor;\n#ifdef BRDF\ngl_FragColor.rgb = brdf(gl_FragColor);\n#endif\n#ifdef Height_Map\ngl_FragColor = czm_packValue(v_height2);\n#endif\n#ifdef FLOOD_ANALYSIS\nfloat bIsFloodColor = 1.0;\nvec2 polyTexCoord = v_textureCoordinates.xy;\npolyTexCoord.x = polyTexCoord.x * (uTileBounds.z - uTileBounds.x) + uTileBounds.x;\npolyTexCoord.y = polyTexCoord.y * (uTileBounds.w - uTileBounds.y) + uTileBounds.y;\nif(polyTexCoord.x>uFloodRect.x && polyTexCoord.x<uFloodRect.z && polyTexCoord.y> uFloodRect.y&& polyTexCoord.y < uFloodRect.w)\n{\npolyTexCoord.xy = polyTexCoord.xy - vec2(uFloodRect.x, uFloodRect.w);\npolyTexCoord.x = polyTexCoord.x / (uFloodRect.z - uFloodRect.x);\npolyTexCoord.y = 1.0-polyTexCoord.y / (uFloodRect.y - uFloodRect.w);\nvec4 floodColor = texture2D(uFloodTexture, polyTexCoord);\nif(floodColor.r > 0.5)\n{\ngl_FragColor = vec4(40.0/255.0,150.0/255.0,200.0/255.0,u_GlobeAlpha);\n}\n}\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, 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_sunDirectionEC, 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_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\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",He$4="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#ifdef APPLY_MODIFY\nattribute vec3 positionModify;\n#endif\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 float v_height2;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\n#endif\n#ifdef SHOW_NORMAL_MAP\nvarying vec3 vertNorm;\n#endif\n#ifdef BRDF\nuniform sampler2D u_normalTexture;\nuniform vec4 u_normalTextureTranslationAndScale;\n#endif\n#ifdef SLOPE_ANALYSIS\nuniform float uTopLevel;\nuniform float uLevel;\nvarying vec3 texCoordRotate;\n#endif\n#ifdef APPLY_MODIFY\nuniform sampler2D uModifyRasterTexture;\n#endif\nvarying vec4 clip_vertex;\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;\nv_height2 = height;\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;\nv_height2 = height;\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;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nvec3 finalNormal = normalMC;\nvec3 ellipsoidNormal = normalize(position3DWC.xyz);\nv_slope = abs(dot(ellipsoidNormal, finalNormal));\nv_height = height;\n#endif\nclip_vertex = czm_inverseProjection * gl_Position;\n#ifdef SHOW_NORMAL_MAP\nv_positionEC = (u_modifiedModelView * vec4(position.xyz, 1.0)).xyz;\nvertNorm = normalize(position3DWC);\n#ifdef BRDF\nvec2 normalTextureTranslation = u_normalTextureTranslationAndScale.xy;\nvec2 normalTextureScale = u_normalTextureTranslationAndScale.zw;\nvec2 normalTextureCoordinates = v_textureCoordinates.xy * normalTextureScale + normalTextureTranslation;\nvec3 realNormal = texture2D(u_normalTexture, normalTextureCoordinates.xy).xyz;\nrealNormal = (realNormal - 0.5) * 2.0;\nvec3 zAxis = normalize(vertNorm);\nvec3 xAxis = normalize(vec3(-vertNorm.y, vertNorm.x, 0));\nvec3 yAxis = normalize(cross(zAxis, xAxis));\nmat3 matrix = mat3(xAxis, yAxis, zAxis);\nvec3 vNormal = czm_normal3D * matrix * realNormal;\nv_normalEC = normalize(vNormal);\n#endif\n#endif\n#ifdef SLOPE_ANALYSIS\nfloat levelSpan = uLevel < 12.0 ? 0.0 : min(uLevel - 12.0, 2.0);\nfloat arrowTextureScale = pow(2.0, levelSpan);\ntexCoordRotate.xy = v_textureCoordinates.xy * vec2(arrowTextureScale, arrowTextureScale);\ntexCoordRotate.z = arrowTextureScale;\n#endif\n}\n",le$5="const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos, bool dynamicLighting, vec3 lightDirectionWC)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 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 Ce$4(e,t,i,r,n,o,a,s){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n,this.mvtTextureObj=o,this.numberOfGridTextures=a,this.gridUpdate=s}function D$g(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function Oe$4(e){var t;switch(e){case P$$.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case P$$.SCENE2D:case P$$.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case P$$.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function Le$4(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}function ce$5(e,t){if(!e$28(e)||!e$28(t))return!1;if(e===t)return!0;if(e.length!=t.length)return!1;for(var i=e.length,r=0;r<i;r++)if(e[r].textureIndex!==t[r].textureIndex||e[r].selectColor!==t[r].selectColor)return!1;return!0}D$g.prototype.getShaderProgram=function(e){var t=e.frameState,i=e.surfaceTile,r=e.numberOfDayTextures,n=e.applyBrightness,o=e.applyContrast,a=e.applyHue,s=e.applySaturation,l=e.applyGamma,u=e.applyAlpha,c=e.applySplit,h=e.applySwipe,d=e.applyGlobeSwipe,f=e.showReflectiveOcean,p=e.showOceanWaves,_=e.enableLighting,m=e.dynamicAtmosphereLighting,$=e.dynamicAtmosphereLightingFromSun,g=e.showGroundAtmosphere,v=e.perFragmentGroundAtmosphere,y=e.hasVertexNormals,x=e.hasRoughness,b=e.useWebMercatorProjection,w=e.enableFog,C=e.enableClippingPlanes,T=e.clippingPlanes,S=e.clippedByBoundaries,E=e.hasImageryLayerCutout,A=e.colorCorrect,P=e.isHeight,I=e.isColor,M=e.hasNormalMap,O=e.hasHypsometricSetting,D=e.hasFlood,R=e.hasSlopeAnalysis,L=e.applyGlobeSplit;e.highlightFillTile,e.colorToAlpha;var B=e.mvtTextureObj,N=e.numberOfGridTextures,F=e.gridUpdate,z=e.applyPolygonOffset,k=e.applyModify,V=e.applyExtract,U=e.excavationRegion,X=e.excavationOuter,H=e.applyImageryClip,G=e.hasHypsometricRegion,W=e.applySlopeRegion,Y=e.excavationGeometry,q=e.applyMinAlphaFilter,j=0,Z="",K=i.renderedMesh.encoding;K.quantization===ye$s.BITS12&&(j=1,Z="QUANTIZATION_BITS12");var Q=0,J="";e$28(i.terrainData)&&i.terrainData._createdByUpsampling&&(Q=1,J="DISABLE_GL_POSITION_LOG_DEPTH");var ee=0,te="";S&&(ee=1,te="TILE_LIMIT_RECTANGLE");var ie=0,re="";E&&(ie=1,re="APPLY_IMAGERY_CUTOUT");var ne=t.mode,oe=ne|n<<2|o<<3|a<<4|s<<5|l<<6|u<<7|f<<8|p<<9|_<<10|g<<11|v<<12|y<<13|b<<14|w<<15|j<<16|c<<17|C<<18|Q<<19|ee<<20|ie<<21|A<<22|P<<23|I<<24|M<<25|R<<26|L<<27|k<<28|U<<29|X<<30|x<<31;oe=oe+"_"+(L|O<<1|h<<2|d<<3|z<<4|D<<5|H<<6|G<<7|W<<8|Y<<9|q<<10);var ae=0;e$28(T)&&T.length>0&&(ae=C?T.clippingPlanesState:0);var se=i.surfaceShader;if(e$28(se)&&se.numberOfDayTextures===r&&se.flags===oe&&se.material===this.material&&se.clippingShaderState===ae&&ce$5(se.mvtTextureObj,B)&&se.numberOfGridTextures===N&&se.gridUpdate===F)return se.shaderProgram;var le=this._shadersByTexturesFlags[r+N];if(e$28(le)||(le=this._shadersByTexturesFlags[r+N]={}),!e$28(se=le[oe])||se.material!==this.material||se.clippingShaderState!==ae||!ce$5(se.mvtTextureObj,B)||F||se.numberOfGridTextures!=N){var ue=this.baseVertexShaderSource.clone(),ce=this.baseFragmentShaderSource.clone();0!==ae&&ce.sources.unshift(f$K(T,t.context)),ue.defines.push(Z,J),ce.defines.push("TEXTURE_UNITS "+r,te,re),ce.defines.push("GRIDTEXTURE_UNITS "+N,te,re),n&&ce.defines.push("APPLY_BRIGHTNESS"),o&&ce.defines.push("APPLY_CONTRAST"),a&&ce.defines.push("APPLY_HUE"),s&&ce.defines.push("APPLY_SATURATION"),l&&ce.defines.push("APPLY_GAMMA"),u&&ce.defines.push("APPLY_ALPHA"),f&&(ce.defines.push("SHOW_REFLECTIVE_OCEAN"),ue.defines.push("SHOW_REFLECTIVE_OCEAN")),p&&ce.defines.push("SHOW_OCEAN_WAVES"),z&&ce.defines.push("POLYGON_OFFSET"),_&&(ue.defines.push("ENABLE_LIGHTING"),ce.defines.push("ENABLE_LIGHTING"),y?(ue.defines.push("ENABLE_VERTEX_LIGHTING"),ce.defines.push("ENABLE_VERTEX_LIGHTING")):(ue.defines.push("ENABLE_DAYNIGHT_SHADING"),ce.defines.push("ENABLE_DAYNIGHT_SHADING"))),(x&&M||_&&y)&&(ue.defines.push(H$r.BRDF),ce.defines.push(H$r.BRDF),e$28(t.specularEnvironmentMaps)&&ce.defines.push(H$r.IBL)),m&&(ce.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),$&&ce.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN")),M&&(ce.defines.push("SHOW_NORMAL_MAP"),ue.defines.push("SHOW_NORMAL_MAP")),g&&(ue.defines.push("GROUND_ATMOSPHERE"),ce.defines.push("GROUND_ATMOSPHERE"),v&&ce.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),ue.defines.push("INCLUDE_WEB_MERCATOR_Y"),ce.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(ue.defines.push("FOG"),ce.defines.push("FOG")),c&&ce.defines.push("APPLY_SPLIT"),h&&ce.defines.push("APPLY_SWIPE"),L&&ce.defines.push("APPLY_GLOBESPLIT"),d&&ce.defines.push("APPLY_GLOBESWIPE"),C&&ce.defines.push("ENABLE_CLIPPING_PLANES"),A&&ce.defines.push("COLOR_CORRECT"),P&&(ue.defines.push("Height_Map"),ce.defines.push("Height_Map")),I&&ue.defines.push("Color_Map"),k&&!V&&ue.defines.push("APPLY_MODIFY"),U&&ce.defines.push("Excavate_Region"),X&&ce.defines.push("Excavate_Outer"),H&&ce.defines.push("Apply_ImageryClip"),O&&ce.defines.push("HYPSOMETRIC_ANALYSIS"),G&&ce.defines.push("HYPSOMETRIC_REGION"),D&&(ce.defines.push("FLOOD_ANALYSIS"),ue.defines.push("FLOOD_ANALYSIS")),R&&M&&(ce.defines.push("SLOPE_ANALYSIS"),ue.defines.push("SLOPE_ANALYSIS")),R&&W&&M&&ce.defines.push("SlopeRegion"),Y&&ce.defines.push("SQRESULT"),q&&ce.defines.push("ALPHAFILTER");var he="vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n{\n vec4 color = initialColor;\n";E&&(he+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var de=0;de<r;++de)E?he+=" cutoutAndColorResult = u_dayTextureCutoutRectangles["+de+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = czm_sampleAndBlend(\n":de===e.mixIndex&&e.mixDirection>0?he+=" color = sampleAndBlendParent(\n":he+=" color = czm_sampleAndBlend(\n",he+=" color,\n u_dayTextures["+de+"],\n u_dayTextureUseWebMercatorT["+de+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+de+"],\n u_dayTextureTranslationAndScale["+de+"],\n u_transparentBackColor["+de+"],\n u_imageryClipEnable["+de+"],\n u_dayTextureFlipY["+de+"],\n "+(u?"u_dayTextureAlpha["+de+"]":"1.0")+",\n "+(n?"u_dayTextureBrightness["+de+"]":"0.0")+",\n "+(o?"u_dayTextureContrast["+de+"]":"0.0")+",\n "+(a?"u_dayTextureHue["+de+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+de+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+de+"]":"0.0")+",\n "+(c?"u_dayTextureSplit["+de+"]":"vec2(0.0,0.0)")+",\n "+(h?"u_dayTextureSwipeRegion["+de+"]":"vec4(0.0,0.0,0.0,0.0)")+",\n "+(q?"u_dayMinAlphaFilters["+de+"]":"0.0")+"\n );\n",E&&(he+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");for(de=0;de<N;++de)he+=" color = gridTextureSampleAndBlend(\n color,\n u_gridTextures["+de+"],\n u_gridTextureUseWebMercatorT["+de+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_gridTextureTexCoordsRectangle["+de+"],\n u_gridTextureTranslationAndScale["+de+"]);\n";he+=" return color;\n}",ce.sources.push(he),ue.sources.push(Oe$4(ne)),ue.sources.push(Le$4(b));var fe=S$T.fromCache({context:t.context,vertexShaderSource:ue,fragmentShaderSource:ce,attributeLocations:K.getAttributeLocations()});se=le[oe]=new Ce$4(r,oe,this.material,fe,ae,B,N,F)}return i.surfaceShader=se,se.shaderProgram},D$g.prototype.destroy=function(){var e,t,i=this._shadersByTexturesFlags;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];if(!e$28(n))continue;for(e in n)n.hasOwnProperty(e)&&(e$28(t=n[e])&&t.shaderProgram.destroy())}return i$Z(this)};var E$g={FAILED:0,UNLOADED:1,TRANSITIONING:2,RECEIVED:3,TEXTURE_LODED:4,READY:5,UPDATE:6},_$f=Object.freeze(E$g);function n$g(e,t,i,r,n){if(this.gridLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r){var o=t/2|0,a=i/2|0,s=r-1;this.parent=e._getGridFromCache(o,a,s)}(this.state=_$f.UNLOADED,this.gridBuffer=void 0,this.gridUrl=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e$28(n)&&e.gridProvider.ready)&&(n=e.gridProvider.tilingScheme.tileXYToRectangle(t,i,r));this.rectangle=n,this.needUpdate=!1}function d$j(e,t,i){this.readyGrid=void 0,this.loadingGrid=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function p$c(e,t){this._gridProvider=e,t=u$Y(t,{}),this._context=t.context,this._show=!0,this.show=!0,this._rectangle=u$Y(t.rectangle,h$10.MAX_VALUE),this._gridCache=[],e$28(t.maxCategory)?this._MaxCategory=t.maxCategory:e.ready?this._MaxCategory=e.maxCategory:this._isNeedUpdate=!0,this._isNeedUpdate=!1,this._isUpdate=!0,e$28(t.minCategory)?this._MinCategory=t.minCategory:e.ready?this._MinCategory=e.minCategory:this._isNeedUpdate=!0,this._hypsometricSetting=void 0,e$28(t.hypsometricSetting)&&D$f(this,t),this._filterMode=k$T.FilterMode.LINEAR}function b$j(e,t,i,r,n){var o=r+1,a=e._gridProvider;if(e$28(a)&&!(a.maxLevel<o))for(var s=Object.keys(e._gridCache),l=0;l<2;l++)for(var u=2*t+l,c=0;c<2;c++){var h=2*i+c,d=w$b(u,h,o);for(l=0;l<s.length;l++)if(d==s[l]){var f=e._gridCache[d];if(R$e(f,n)){var p=b$j(e,u,h,o);return e$28(p)&&p.state==_$f.READY?p:f.state==_$f.READY?f:void 0}}}}function R$e(e,t){return!!e$28(e)&&h$10.contains(e.rectangle,t)}n$g.prototype.addReference=function(){++this.referenceCount},n$g.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.gridLayer._removeGridFromCache(this),e$28(this.parent)&&this.parent.releaseReference(),e$28(this.girlBuffer)&&e$28(this.girlBuffer.destroy)&&this.girlBuffer.destroy(),e$28(this.texture)&&this.texture.destroy(),e$28(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),i$Z(this),0):this.referenceCount},n$g.prototype._processStateMachine=function(e,t,i){return this.state===_$f.UNLOADED&&!i&&(this.state=_$f.TRANSITIONING,this.gridLayer._requestGridTile(this)),(this.state===_$f.RECEIVED||this.state===_$f.UPDATE)&&(this.state=_$f.TRANSITIONING,this.gridLayer._createTexture(e.context,this)),!0},d$j.prototype.freeResources=function(){e$28(this.readyImagery)&&this.readyImagery.releaseReference(),e$28(this.loadingImagery)&&this.loadingImagery.releaseReference()},d$j.prototype._processStateMachine=function(e,t,i){var r=this.loadingGrid;if(null==r){if(!e$28(this.readyGrid)||this.readyGrid.state!=_$f.UPDATE)return!1;this.loadingGrid=this.readyGrid,this.readyGrid=void 0,r=this.loadingGrid}var n=r.gridLayer;return r._processStateMachine(t,!this.useWebMercatorT,i),r.state===_$f.READY&&(e$28(this.readyGrid)&&this.readyGrid.releaseReference(),this.readyGrid=this.loadingGrid,this.loadingGrid=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),!0)},Object.defineProperties(p$c.prototype,{gridProvider:{get:function(){return this._gridProvider}},rectangle:{get:function(){return this._rectangle}},dataMaxValue:{get:function(){if(!this._isNeedUpdate)return this._MaxCategory;if(!this._gridProvider.ready)throw new DeveloperError("dataMaxValue must not be called before the grid provider is ready");this._MaxCategory=this._gridProvider.maxCategory,this._isNeedUpdate=!1}},dataMinValue:{get:function(){if(!this._isNeedUpdate)return this._MinCategory;if(!this._gridProvider.ready)throw new DeveloperError("dataMinValue must not be called before the grid provider is ready");this._MinCategory=this._gridProvider.minCategory,this._isNeedUpdate=!1}},hypsometricSetting:{get:function(){return{hypsometricSetting:this._hypsometricSetting,analysisMode:this._hypAnalysisMode}},set:function(e){D$f(this,e),this._isUpdate=!0}}}),p$c.prototype.destroy=function(){return i$Z(this)},p$c.prototype.cancelReprojections=function(){},p$c.prototype.queueReprojectionCommands=function(e){},p$c.prototype.getViewableRectangle=function(){var e=this._gridProvider,t=this._rectangle;return e.readyPromise.then((function(){return h$10.intersection(e.rectangle,t)}))},p$c.prototype._getGridFromCache=function(e,t,i,r){var n=w$b(e,t,i),o=(this._gridCache.length,this._gridCache[n]);return e$28(o)||(o=new n$g(this,e,t,i,r),this._gridCache[n]=o),o.addReference(),o},p$c.prototype.getGridValue=function(e){for(var t=Object.values(this._gridCache),i=void 0,r=0;r<t.length;r++){var n=t[r];if(n.state==_$f.READY)if(R$e(n,e)){var o=b$j(this,n.x,n.y,n.level,e);i=e$28(o)?o:n;break}}if(!e$28(i))return-1;var a=(e.longitude-i.rectangle.west)/i.rectangle.width,s=(i.rectangle.north-e.latitude)/i.rectangle.height;a=Math.max(Math.floor(a*this._gridProvider.cellWidth),0),s=Math.max(Math.floor(s*this._gridProvider.cellHeight),0);var l=i.gridBuffer;return G$h(this._gridProvider,l,a,s,this._filterMode)},p$c.prototype._removeGridFromCache=function(e){var t=w$b(e.x,e.y,e.level);delete this._gridCache[t]},p$c.prototype._requestGridTile=function(e){var t=this._gridProvider;function i(t){if(!e$28(t))return r();e.gridBuffer=t,e.state=_$f.RECEIVED}function r(){if(e.request.state===W$14.CANCELLED)return e.gridBuffer=void 0,e.state=_$f.UNLOADED,void(e.request=void 0);e.state=_$f.FAILED,e.request=void 0}!function(){var n=new r$1c({throttle:!1,throttleByServer:!0,type:$$13.TERRAIN});e.request=n;var o=t._requestGridTile(e.x,e.y,e.level,n);e$28(o)?(e.state=_$f.RECEIVING,o$1q(o,i,r)):(e.state=_$f.UNLOADED,e.request=void 0)}()},p$c.prototype._createTexture=function(e,t){var i=this._gridProvider,r=t.gridBuffer;if(null==r||null==i||!i.ready)return!1;this._isNeedUpdate&&this._gridProvider.ready&&(this._MinCategory=this._gridProvider.minCategory,this._MaxCategory=this._gridProvider.maxCategory,this._isNeedUpdate=!1),this._context=e,null==this._hypsometricSetting&&Q$c(this),null==t.texture&&(t.texture=new L$17({context:this._context,width:i.cellWidth,height:i.cellHeight,pixelFormat:V$O.RGBA,flipY:!1}));for(var n=i.cellWidth*i.cellHeight,o=new Uint8Array(4*n),a=0;a<i.cellHeight;a++)for(var s=0;s<i.cellWidth;s++){var l=(i.cellHeight-1-a)*i.cellWidth+s,u=G$h(i,r,s,a,this._filterMode);if(u<this._hypsometricSetting.MinVisibleValue||u>this._hypsometricSetting.MaxVisibleValue||u<this._hypsometricSetting.ColorTableMinKey||u>this._hypsometricSetting.ColorTableMaxKey)o[4*l+0]=0,o[4*l+1]=0,o[4*l+2]=0,o[4*l+3]=0;else{var c=this._hypsometricSetting.ColorTable.getColor(u);if(!e$28(c)){o[4*l+0]=0,o[4*l+1]=0,o[4*l+2]=0,o[4*l+3]=0;continue}o[4*l+0]=255*c.red,o[4*l+1]=255*c.green,o[4*l+2]=255*c.blue,o[4*l+3]=255*c.alpha}}t.texture.copyFrom({width:i.cellWidth,height:i.cellHeight,arrayBufferView:o}),t.state=_$f.READY};var E$f=new h$10,J$d=new h$10,M$h=new h$10,A$g=new h$10;function Z$b(e,t,i,r,n,o){var a,s=t.rectangle.width/512,l=t.rectangle.height/512,u=e.tilingScheme,c=h$10.clone(t.rectangle,A$g),h=u.tileXYToRectangle(i.northwestTileCoordinates.x,i.northwestTileCoordinates.y,o),d=h$10.intersection(h,r,M$h);return n?(u.rectangleToNativeRectangle(c,c),u.rectangleToNativeRectangle(h,h),u.rectangleToNativeRectangle(d,d),u.rectangleToNativeRectangle(r,r),a=u.tileXYToNativeRectangle.bind(u),s=c.width/512,l=c.height/512):a=u.tileXYToRectangle.bind(u),{veryCloseX:s,veryCloseY:l,terrainRectangle:c,gridRectangle:h,clippedGridRectangle:d,gridTileXYToRectangle:a}}function z$c(e,t,i,r,n,o,a,s){var l,u,c=0,h=1;Math.abs(i.clippedGridRectangle.west-i.terrainRectangle.west)>=i.veryCloseX&&(c=Math.min(1,(i.clippedGridRectangle.west-i.terrainRectangle.west)/i.terrainRectangle.width)),Math.abs(i.clippedGridRectangle.north-i.terrainRectangle.north)>=i.veryCloseY&&(h=Math.max(0,(i.clippedGridRectangle.north-i.terrainRectangle.south)/i.terrainRectangle.height));for(var d=h,f=r.northwestTileCoordinates.x;f<=r.southeastTileCoordinates.x;f++)if(l=c,i.gridRectangle=i.gridTileXYToRectangle(f,r.northwestTileCoordinates.y,o),i.clippedGridRectangle=h$10.simpleIntersection(i.gridRectangle,n,M$h),e$28(i.clippedGridRectangle)){c=Math.min(1,(i.clippedGridRectangle.east-i.terrainRectangle.west)/i.terrainRectangle.width),f===r.southeastTileCoordinates.x&&Math.abs(i.clippedGridRectangle.east-i.terrainRectangle.east)<i.veryCloseX&&(c=1),h=d;for(var p=r.northwestTileCoordinates.y;p<=r.southeastTileCoordinates.y;p++)if(u=h,i.gridRectangle=i.gridTileXYToRectangle(f,p,o),i.clippedGridRectangle=h$10.simpleIntersection(i.gridRectangle,n,M$h),e$28(i.clippedGridRectangle)){h=Math.max(0,(i.clippedGridRectangle.south-i.terrainRectangle.south)/i.terrainRectangle.height),p===r.southeastTileCoordinates.y&&Math.abs(i.clippedGridRectangle.south-i.terrainRectangle.south)<i.veryCloseY&&(h=0);var _=new e$25(l,h,c,u),m=e._getGridFromCache(f,p,o);t.gridImagery.splice(s,0,new d$j(m,_,a)),++s}}}function D$f(e,t){if(e$28(t)&&e$28(t.hypsometricSetting))e$28(e._hypsometricSetting)&&e._hypsometricSetting.destroy(),e._hypsometricSetting=t.hypsometricSetting,e._hypsometricSetting._emissionTextureChanged=!0,e._filterMode=e._hypsometricSetting.filterMode,e$28(e._hypsometricSetting.ColorTable)&&e._hypsometricSetting.ColorTable.generateBuffer();else if(e$28(e._hypsometricSetting._hypsometricSetting))return e._hypsometricSetting.destroy(),void(e._hypsometricSetting=void 0);$$9(e)}function Q$c(e){if(e._isNeedUpdate&&e._gridProvider.ready&&(e._MinCategory=e._gridProvider.minCategory,e._MaxCategory=e._gridProvider.maxCategory,e._isNeedUpdate=!1),null==e._hypsometricSetting){var t=new i$O;e._hypsometricSetting=new u$K,e._hypsometricSetting.MaxVisibleValue=0;for(var i=[e$1S.fromCssColorString("#AAF0E9"),e$1S.fromCssColorString("#B0F2D3"),e$1S.fromCssColorString("#B0F4BC"),e$1S.fromCssColorString("#BFF8B2"),e$1S.fromCssColorString("#DAFBB2"),e$1S.fromCssColorString("#EDF9AD"),e$1S.fromCssColorString("#DCEC91"),e$1S.fromCssColorString("#A0D567"),e$1S.fromCssColorString("#60BD42"),e$1S.fromCssColorString("#2CA432"),e$1S.fromCssColorString("#148E35"),e$1S.fromCssColorString("#20853D"),e$1S.fromCssColorString("#559037"),e$1S.fromCssColorString("#819D2F"),e$1S.fromCssColorString("#ABA826"),e$1S.fromCssColorString("#D7B117"),e$1S.fromCssColorString("#EBA509"),e$1S.fromCssColorString("#E18302"),e$1S.fromCssColorString("#CB5902"),e$1S.fromCssColorString("#C53602"),e$1S.fromCssColorString("#9D1901"),e$1S.fromCssColorString("#820C01"),e$1S.fromCssColorString("#760F03"),e$1S.fromCssColorString("#721906"),e$1S.fromCssColorString("#702007"),e$1S.fromCssColorString("#6E280A"),e$1S.fromCssColorString("#6A2D0C"),e$1S.fromCssColorString("#733C1B"),e$1S.fromCssColorString("#815032"),e$1S.fromCssColorString("#8E664D"),e$1S.fromCssColorString("#997C6C"),e$1S.fromCssColorString("#A69992")],r=(e._MaxCategory-e._MinCategory)/31,n=0;n<32;n++)t.insert(e._MinCategory+r*n,i[n]);e._hypsometricSetting.ColorTable=t,e._hypsometricSetting.DisplayMode=k$T.DisplayMode.FACE_AND_LINE,e._hypsometricSetting.Opacity=.618,e._hypsometricSetting.ColorTableMaxKey=e._MaxCategory,e._hypsometricSetting.ColorTableMinKey=e._MinCategory,e._hypsometricSetting.MaxVisibleValue=e._MaxCategory,e._hypsometricSetting.MinVisibleValue=e._MinCategory,e._hypsometricSetting.ColorTable.generateBuffer()}}function w$b(e,t,i){return JSON.stringify([e,t,i])}function $$9(e){for(var t=Object.values(e._gridCache),i=0;i<t.length;i++){var r=t[i];r.state==_$f.READY&&(r.state=_$f.UPDATE,r.needUpdate=!0)}}function P$d(e,t,i,r){var n=0;i.south>0?n=i.south:i.north<0&&(n=i.north);var o=e._gridProvider,a=I$f(e,1*t.getLevelMaximumGeometricError(r),n,e$28(o.resolution)?o.resolution:1,t.tilingScheme._tileWidth);a=Math.max(0,a);var s=o.maxLevel;if(a>s&&(a=s),e$28(o.minLevel)){var l=o.minLevel;a<l&&(a=l)}return a}function I$f(e,t,i,r,n){var o=e._gridProvider,a=o.tilingScheme,s=a.ellipsoid,l=o.tilingScheme.projection instanceof n$1b?1:Math.cos(i),u=a.rectangle,c=s.maximumRadius*u.width*l/(o.cellWidth*a.getNumberOfXTilesAtLevel(0)/r)/t*(o.cellWidth/n),h=Math.log(c)/Math.log(2);return 0|Math.round(h)}function L$h(e,t,i,r){var n=e.tilingScheme,o=n.positionToTileXY(h$10.northwest(t),i),a=n.positionToTileXY(h$10.southeast(t),i),s=r.width/512,l=r.height/512,u=n.tileXYToRectangle(o.x,o.y,i);Math.abs(u.south-r.north)<l&&o.y<a.y&&++o.y,Math.abs(u.east-r.west)<s&&o.x<a.x&&++o.x;var c=n.tileXYToRectangle(a.x,a.y,i);return Math.abs(c.north-r.south)<l&&a.y>o.y&&--a.y,Math.abs(c.west-r.east)<s&&a.x>o.x&&--a.x,{northwestTileCoordinates:o,southeastTileCoordinates:a}}function G$h(e,t,i,r,n){if(!e$28(e))throw new DeveloperError("getValue must not be called before the grid provider is ready");if(n==k$T.FilterMode.NEAREST)return t[r*e.cellWidth+i];for(var o=0,a=0,s=0;s<2;s++)for(var l=0;l<2;l++){var u=i+s;u=Math.min(u,e.cellWidth-1);var c=r+l;o+=t[(c=Math.min(c,e.cellHeight-1))*e.cellWidth+u],a++}return a<=0?-99999:o/=a}function n$f(){this._layers=[],this.layerAdded=new o$1o,this.layerRemoved=new o$1o,this.layerMoved=new o$1o,this.layerShownOrHidden=new o$1o,this.layerUpdate=new o$1o}function _$e(e,t){if(!e$28(t))throw new t$Z("layer is required.");var i=e.indexOf(t);if(-1===i)throw new t$Z("layer is not in this collection.");return i}function M$g(e,t,i){var r=e._layers;if((t=e$27.clamp(t,0,r.length-1))!==(i=e$27.clamp(i,0,r.length-1))){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}p$c.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data,n=this._gridProvider;if(!this.show||!n.ready)return!1;e$28(i)||(i=r.gridImagery.length);var o=n.tilingScheme.projection instanceof t$M&&e.rectangle.north<t$M.MaximumLatitude&&e.rectangle.south>-t$M.MaximumLatitude,a=h$10.intersection(n.rectangle,this._rectangle,E$f),s=h$10.intersection(e.rectangle,a,J$d);if(null==s)return!1;var l=P$d(this,t,s,e.level),u=L$h(n,s,l,e.rectangle);return e.rectangle.width,e.rectangle.height,z$c(this,r,Z$b(n,e,u,a,o,l),u,a,l,o,i),!0},p$c.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyGrid.rectangle,r=e.rectangle;if(t.useWebMercatorT){var n=t.girdLayer.gridProvider.tilingScheme;i=n.rectangleToNativeRectangle(i,E$f),r=n.rectangleToNativeRectangle(r,A$g)}var o=r.width,a=r.height,s=o/i.width,l=a/i.height;return new e$25(s*(r.west-i.west)/o,l*(r.south-i.south)/a,s,l)},Object.defineProperties(n$f.prototype,{length:{get:function(){return this._layers.length}}}),n$f.prototype.add=function(e,t){var i=e$28(t);if(!e$28(e))throw new t$Z("layer is required.");if(i){if(t<0)throw new t$Z("index must be greater than or equal to zero.");if(t>this._layers.length)throw new t$Z("index must be less than or equal to the number of layers.")}i?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},n$f.prototype.addImageryProvider=function(e,t){if(!e$28(e))throw new t$Z("imageryProvider is required.");var i=new h$p(e);return i._imageryLayers=this,this.add(i,t),i},n$f.prototype.addVectorTileProvider=function(e,t){if(!e$28(e))throw new t$Z("imageryProvider is required.");var i=new h$p(e,{minimumTerrainLevel:e.minimumTerrainLevel,maximumTerrainLevel:e.maximumTerrainLevel,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter});return this.add(i,t),i},n$f.prototype.addGridProvider=function(e,t){if(!e$28(e))throw new t$Z("gridProvider is required.");var i=new p$c(e);return this.add(i,t),i},n$f.prototype.removeImageryLayerByName=function(e,t){var i=this.getImageryLayerByName(e);return this.remove(i,t)},n$f.prototype.removeImageryLayerById=function(e,t){var i=this.get(e);return this.remove(i,t)},n$f.prototype.remove=function(e,t,i){t=u$Y(t,!0);i=u$Y(i,!1);var r=this._layers.indexOf(e);return-1!==r&&(e._imageryProvider&&e._imageryProvider instanceof M$X&&!i?void 0:(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(e,r),t&&e.destroy(),!0))},n$f.prototype.removeAll=function(e){e=u$Y(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=[]},n$f.prototype.contains=function(e){return-1!==this.indexOf(e)},n$f.prototype.indexOf=function(e){return this._layers.indexOf(e)},n$f.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.","index");return this._layers[e]},n$f.prototype.getImageryLayerByName=function(e){if(!e$28(e))throw new t$Z("imageryLayer name is required.");for(var t=0;t<this._layers.length;t++)if(e$28(this._layers[t].name)&&this._layers[t].name===e)return this._layers[t]},n$f.prototype.raise=function(e){var t=_$e(this._layers,e);M$g(this,t,t+1)},n$f.prototype.lower=function(e){var t=_$e(this._layers,e);M$g(this,t,t-1)},n$f.prototype.raiseToTop=function(e){var t=_$e(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))},n$f.prototype.lowerToBottom=function(e){var t=_$e(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 G$g=new h$10;function r$h(e,t){this._terrainProvider=e}function o$m(){this._layers=[],this.layerAdded=new o$1o,this.layerRemoved=new o$1o,this.layerMoved=new o$1o,this.layerShownOrHidden=new o$1o,this._globe=void 0}function f$h(e,t){if(!e$28(t))throw new t$Z("layer is required.");var i=e.indexOf(t);if(-1===i)throw new t$Z("layer is not in this collection.");return i}function p$b(e,t,i){var r=e._layers;if((t=e$27.clamp(t,0,r.length-1))!==(i=e$27.clamp(i,0,r.length-1))){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}function e$a(e){this._ellipsoid=new s$W(e.ellipsoid,t$X.ZERO)}function h$b(e){if(!e$28(e))throw new t$Z("options is required.");if(!e$28(e.x))throw new t$Z("options.x is required.");if(!e$28(e.y))throw new t$Z("options.y is required.");if(e.x<0||e.y<0)throw new t$Z("options.x and options.y must be greater than or equal to zero.");if(!e$28(e.level))throw new t$Z("options.level is required and must be greater than or equal to zero.");if(!e$28(e.tilingScheme))throw new t$Z("options.tilingScheme is required.");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=D$t.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=re$B.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0,this._rasterTextureSize=void 0,this._rasterFBO=void 0,this._rasterTexture=void 0,this._rasterized=!1,this._clearCommand=new r$11({color:new e$1S(0,0,0,0),depth:1}),this._2DRasterized=!1,this._2DRasterTexture=void 0,this._mvtLoaded=!1,this._clipRasterTexture=void 0,this._clipRasterFbo=void 0,this._clipRegionsCount=0,this._clipRegionRasterized=!1,this.isModified=!1,0===this._level?this.showInvalid=!1:this.showInvalid=e.parent.showInvalid,this.zoomLevel=-1,this._renderThisFrame=!1,this._useParentImage=!1}function I$e(e){e$28(e)&&e.freeResources()}n$f.prototype.pickImageryLayerFeatures=function(e,t){var i=t.globe.pick(e,t);if(e$28(i)){for(var r,n=t.globe.ellipsoid.cartesianToCartographic(i),o=t.globe._surface._tilesToRender,a=0;!e$28(r)&&a<o.length;++a){var s=o[a];h$10.contains(s.rectangle,n)&&(r=s)}if(e$28(r)){for(var l=r.data.imagery,u=[],c=[],h=l.length-1;h>=0;--h){var d=l[h],f=d.readyImagery;if(e$28(f)){var p=f.imageryLayer.imageryProvider;if(e$28(p.pickFeatures)&&h$10.contains(f.rectangle,n)){var _=G$g,m=1/1024;if(_.west=e$27.lerp(r.rectangle.west,r.rectangle.east,d.textureCoordinateRectangle.x-m),_.east=e$27.lerp(r.rectangle.west,r.rectangle.east,d.textureCoordinateRectangle.z+m),_.south=e$27.lerp(r.rectangle.south,r.rectangle.north,d.textureCoordinateRectangle.y-m),_.north=e$27.lerp(r.rectangle.south,r.rectangle.north,d.textureCoordinateRectangle.w+m),h$10.contains(_,n)){var $=p.pickFeatures(f.x,f.y,f.level,n.longitude,n.latitude);!e$28($)||(u.push($),c.push(f.imageryLayer))}}}}if(0!==u.length)return o$1q.all(u,(function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],o=c[i];if(e$28(r)&&r.length>0)for(var a=0;a<r.length;++a){var s=r[a];s.imageryLayer=o,e$28(s.position)||(s.position=n),t.push(s)}}return t}))}}},n$f.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},n$f.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},n$f.prototype.isDestroyed=function(){return!1},n$f.prototype.destroy=function(){return this.removeAll(!0),i$Z(this)},n$f.prototype._update=function(){var e,t,i,r,n=!0,o=this._layers;for(i=0,r=o.length;i<r;++i)(t=o[i])._layerIndex=i,e$28(t._imageryProvider)&&(t._imageryProvider._id=t._layerIndex),t.show?(t._isBaseLayer=n,n=!1):t._isBaseLayer=!1,t.show!==t._show&&(e$28(t._show)&&(e$28(e)||(e=[]),e.push(t)),t._show=t.show),e$28(t.gridProvider)&&t._isUpdate&&this.layerUpdate.raiseEvent(t,t._layerIndex);if(e$28(e))for(i=0,r=e.length;i<r;++i)t=e[i],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},n$f.prototype._maxDetailLevelOffset=function(){for(var e=0,t=this._layers,i=0,r=t.length;i<r;++i){var n=t[i]._detailLevelOffset;t[i].featherEdgesEnabled&&n<1&&(n=1),e=Math.max(n,e)}return e},n$f.prototype.saveLocalCache=function(){for(var e=0,t=this._layers.length;e<t;e++)this._layers[e]instanceof h$p&&this._layers[e].saveLocalCache()},Object.defineProperties(r$h.prototype,{terrainProvider:{get:function(){return this._terrainProvider}}}),r$h.prototype.isDestroyed=function(){return!1},r$h.prototype.destroy=function(){return i$Z(this)},Object.defineProperties(o$m.prototype,{length:{get:function(){return this._layers.length}}}),o$m.prototype.add=function(e,t){var i=e$28(t);if(!e$28(e))throw new t$Z("layer is required.");if(i){if(t<0)throw new t$Z("index must be greater than or equal to zero.");if(t>this._layers.length)throw new t$Z("index must be less than or equal to the number of layers.")}i?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles(),this.layerAdded.raiseEvent(e,t)},o$m.prototype.addTerrainProvider=function(e,t){if(!e$28(e))throw new t$Z("terrainProvider is required.");var i=new r$h(e);return this.add(i,t),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles(),i},o$m.prototype.remove=function(e,t){t=u$Y(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(),e$28(this._globe)&&e$28(this._globe._surface)&&(0===this._layers.length&&(this._globe.terrainProvider=new t$G({ellipsoid:this._globe.ellipsoid})),this._globe._surface.invalidateAllTiles()),!0)},o$m.prototype.removeAll=function(e){e=u$Y(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()}e$28(this._globe)&&e$28(this._globe._surface)&&(this._globe.terrainProvider=new t$G({ellipsoid:this._globe.ellipsoid}),this._globe._surface.invalidateAllTiles()),this._layers=[]},o$m.prototype.contains=function(e){return-1!==this.indexOf(e)},o$m.prototype.indexOf=function(e){return this._layers.indexOf(e)},o$m.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.","index");return this._layers[e]},o$m.prototype.raise=function(e){var t=f$h(this._layers,e);p$b(this,t,t+1),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles()},o$m.prototype.lower=function(e){var t=f$h(this._layers,e);p$b(this,t,t-1),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles()},o$m.prototype.raiseToTop=function(e){var t=f$h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},o$m.prototype.lowerToBottom=function(e){var t=f$h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),e$28(this._globe)&&e$28(this._globe._surface)&&this._globe._surface.invalidateAllTiles(),this.layerMoved.raiseEvent(e,0,t))},o$m.prototype.isDestroyed=function(){return!1},o$m.prototype.destroy=function(){return this.removeAll(!0),i$Z(this)},o$m.prototype._update=function(){var e,t,i,r,n=!0,o=this._layers;for(i=0,r=o.length;i<r;++i)(t=o[i])._layerIndex=i,e$28(t._terrainProvider)&&(t._terrainProvider._id=t._layerIndex),t.show?(t._isBaseLayer=n,n=!1):t._isBaseLayer=!1,t.show!==t._show&&(e$28(t._show)&&(e$28(e)||(e=[]),e.push(t)),t._show=t.show);if(e$28(e))for(i=0,r=e.length;i<r;++i)t=e[i],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},Object.defineProperties(e$a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),h$b.createLevelZeroTiles=function(e){if(!e$28(e))throw new t$Z("tilingScheme is required.");for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,o=0;o<i;++o)for(var a=0;a<t;++a)r[n++]=new h$b({tilingScheme:e,x:a,y:o,level:0});return r},h$b.prototype._updateCustomData=function(e,t,i){var r,n,o,a=this.customData;if(e$28(t)&&e$28(i)){for(a=a.filter((function(e){return-1===i.indexOf(e)})),this._customData=a,o=this._rectangle,r=0;r<t.length;++r)n=t[r],h$10.contains(o,n.positionCartographic)&&a.push(n);this._frameUpdated=e}else{var s=this._parent;if(e$28(s)&&this._frameUpdated!==s._frameUpdated){a.length=0,o=this._rectangle;var l=s.customData;for(r=0;r<l.length;++r)n=l[r],h$10.contains(o,n.positionCartographic)&&a.push(n);this._frameUpdated=s._frameUpdated}}},Object.defineProperties(h$b.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e$28(this._southwestChild)||(this._southwestChild=new h$b({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e$28(this._southeastChild)||(this._southeastChild=new h$b({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e$28(this._northwestChild)||(this._northwestChild=new h$b({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e$28(this._northeastChild)||(this._northeastChild=new h$b({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<re$B.DONE}},eligibleForUnloading:{get:function(){var e=!0;return e$28(this.data)&&(e$28(e=this.data.eligibleForUnloading)||(e=!0)),e}}}),h$b.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:t>=r&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter((function(e){return e.x===t&&e.y===i}))[0]},h$b.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;var i=t.findTileToWest(e);return void 0!==i?t.southwestChild===this?i.southeastChild:i.northeastChild:void 0},h$b.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;var i=t.findTileToEast(e);return void 0!==i?t.southeastChild===this?i.southwestChild:i.northwestChild:void 0},h$b.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;var i=t.findTileToSouth(e);return void 0!==i?t.southwestChild===this?i.northwestChild:i.northeastChild:void 0},h$b.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;var i=t.findTileToNorth(e);return void 0!==i?t.northwestChild===this?i.southwestChild:i.southeastChild:void 0},h$b.prototype.freeResources=function(){this.state=re$B.START,this.renderable=!1,this.upsampledFromParent=!1,e$28(this.data)&&e$28(this.data.freeResources)&&this.data.freeResources(),I$e(this._southwestChild),this._southwestChild=void 0,I$e(this._southeastChild),this._southeastChild=void 0,I$e(this._northwestChild),this._northwestChild=void 0,I$e(this._northeastChild),this._northeastChild=void 0,this._rasterTexture=this._rasterTexture&&!this._rasterTexture.isDestroyed()&&this._rasterTexture.destroy(),this._rasterFBO=this._rasterFBO&&!this._rasterFBO.isDestroyed()&&this._rasterFBO.destroy(),this._rasterFBO=void 0,this._rasterized=!1,this._2DRasterTexture=this._2DRasterTexture&&!this._2DRasterTexture.isDestroyed()&&this._2DRasterTexture.destroy(),this._2DRasterized=!1,this._mvtLoaded=!1,this._clipRasterTexture=this._clipRasterTexture&&!this._clipRasterTexture.isDestroyed()&&this._clipRasterTexture.destroy(),this._clipRasterFbo=this._clipRasterFbo&&!this._clipRasterFbo.isDestroyed()&&this._clipRasterFbo.destroy(),this._clipRegionsCount=0,this._clipRegionRasterized=!1,this.modifyRegionsMap=void 0,this.isModified=!1};var q$a=new h$10,_$d=new f$10;h$b.prototype.createRealtimeRasterFBO=function(e){this._rasterTexture=new L$17({context:e.context,width:this._rasterTextureSize,height:this._rasterTextureSize,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}),this._rasterFBO=new a$z({context:e.context,colorTextures:[this._rasterTexture],destroyAttachments:!1})};var Y$9=new y$15;function H$f(e,t){var i=f$10.clone(t.context.uniformState._viewport),r=e$27.toDegrees(e._rectangle.west),n=e$27.toDegrees(e._rectangle.east),o=e$27.toDegrees(e._rectangle.north),a=e$27.toDegrees(e._rectangle.south),s=t.camera,l=s.frustum.clipPlane,u=s.heading,c=s.pitch,h=s.roll,d=new t$X;1===t._fboState.frameBufferType&&s.disableReflection(),t$X.clone(s._positionWC,d),y$15.clone(s.transform,Y$9),s._setTransform(y$15.IDENTITY);var f=new a$X({width:n-r,aspectRatio:1,near:1,far:100}),p=new t$X(.5*(r+n),.5*(o+a),50),_=new t$X(0,0,-1),m=new t$X(0,1,0);n=t$X.cross(_,m,new t$X);return y$15.computeView(p,_,m,n,t.context.uniformState.view),t.context.uniformState.updateFrustum(f),{position:d,viewport:i,waterPlane:l,heading:u,pitch:c,roll:h}}function L$g(e){if(!e$28(e)||!e$28(e.tileProvider))throw new t$Z("options.tileProvider is required.");if(e$28(e.tileProvider.quadtree))throw new t$Z("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,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 i$R,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=u$Y(e.maximumScreenSpaceError,2),this.tileCacheSize=u$Y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!0,this._occluders=new e$a({ellipsoid:t}),this._tileLoadProgressEvent=new o$1o,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0,this._tilesToRenderOld=[],this._levelZeroTilesOld=[],this._zeroTileReady=!1,this._freeAllBakTiles=!1,this._visible=!0,this._delicateImagerylength=16}function Le$3(e){if(e._zeroTileReady){e._tilesToRenderOld.length=0;for(var t=e._levelZeroTilesOld,i=0;i<t.length;++i){for(var r=t[i],n=r.customData,o=n.length,a=0;a<o;++a){var s=n[a];s.level=0,e._addHeightCallbacks.push(s)}r.freeResources()}e._levelZeroTilesOld.length=0}}function Ce$3(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,le$4(e);var i=e._levelZeroTiles;if(e$28(i))if(e._zeroTileReady){e._tilesToRenderOld.length=0;for(var r=0;r<i.length;++r){for(var n=i[r].customData,o=n.length,a=0;a<o;++a){var s=n[a];s.level=0,e._addHeightCallbacks.push(s)}i[r].freeResources()}}else e._tilesToRenderOld=e._tilesToRender.slice(0),e._levelZeroTilesOld=e._levelZeroTiles.slice(0);e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function le$4(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 me$5(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;(i!==e._lastTileLoadQueueLength||e._tilesInvalidated)&&(t.afterRender.push(o$1o.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);var r=e._debug;r.enableDebugOutput&&!r.suspendLodUpdate&&(r.maxDepth=e._tilesToRender.reduce((function(e,t){return Math.max(e,t.level)}),-1),r.tilesRendered=e._tilesToRender.length,(r.tilesVisited!==r.lastTilesVisited||r.tilesRendered!==r.lastTilesRendered||r.tilesCulled!==r.lastTilesCulled||r.maxDepth!==r.lastMaxDepth||r.tilesWaitingForChildren!==r.lastTilesWaitingForChildren||r.maxDepthVisited!==r.lastMaxDepthVisited)&&(console.log("Visited "+r.tilesVisited+", Rendered: "+r.tilesRendered+", Culled: "+r.tilesCulled+", Max Depth Rendered: "+r.maxDepth+", Max Depth Visited: "+r.maxDepthVisited+", Waiting for children: "+r.tilesWaitingForChildren),r.lastTilesVisited=r.tilesVisited,r.lastTilesRendered=r.tilesRendered,r.lastTilesCulled=r.tilesCulled,r.lastMaxDepth=r.maxDepth,r.lastTilesWaitingForChildren=r.tilesWaitingForChildren,r.lastMaxDepthVisited=r.maxDepthVisited))}h$b.prototype.resetCamera=function(e,t){var i=e.camera;1===e._fboState.frameBufferType&&t.waterPlane&&i.enableReflection(t.waterPlane),i._setTransform(Y$9),i.setView({destination:t.position,orientation:{heading:t.heading,pitch:t.pitch,roll:t.roll},convert:!1}),e.context.uniformState.update(e),e.context.uniformState.updateFrustum(i.frustum),e.context.uniformState.viewport=t.viewport},h$b.prototype.realtimeRasterVectors=function(e,t){if(!(this.level<2||(e.rasterPerFrame&&e.camera.zoomLevel!==this.zoomLevel&&(this._rasterized=!1),this._rasterized))){this.zoomLevel=e.camera.zoomLevel;var i=0;2===this._level&&(i=1),t._rasterCurrentFBOIdx=i,this._rasterTextureSize=t._rasterTextureSizes[i],this._rasterized=!0,_$d.width=this._rasterTextureSize,_$d.height=this._rasterTextureSize;for(var r=e.commandListRealtimeRaster,n=[],o=[],a=0;a<r.length;a++){var s=!1;if(e$28(r[a]._globeIndex))if(this._level>=r[a]._globeIndex.level){var l=Math.pow(2,this._level-r[a]._globeIndex.level),u=Math.floor(this.y/l),c=Math.floor(this.x/l);u===r[a]._globeIndex.row&&c===r[a]._globeIndex.col&&(s=!0)}else{l=Math.pow(2,r[a]._globeIndex.level-this._level),u=Math.floor(r[a]._globeIndex.row/l),c=Math.floor(r[a]._globeIndex.col/l);u===this.y&&c===this.x&&(s=!0)}else{var h=new h$10(r[a]._boundingVolume.center.x-r[a]._boundingVolume.radius,r[a]._boundingVolume.center.y-r[a]._boundingVolume.radius,r[a]._boundingVolume.center.x+r[a]._boundingVolume.radius,r[a]._boundingVolume.center.y+r[a]._boundingVolume.radius);h.west=e$27.toRadians(h.west),h.north=e$27.toRadians(h.north),h.east=e$27.toRadians(h.east),h.south=e$27.toRadians(h.south),e$28(h$10.intersection(h,this._rectangle,q$a))&&(s=!0)}s&&(r[a]._primitiveType===W$_.TRIANGLES?n.push(r[a]):o.push(r[a]))}if(0===n.length&&0===o.length)return void(e$28(this._rasterFBO)&&(this._clearCommand.framebuffer=this._rasterFBO,this._clearCommand.execute(e.context)));e$28(this._rasterTexture)||this.createRealtimeRasterFBO(e);var d=!1,f=t._rasterLineFBOs[i],p=t._rasterAAFBOs[i];e.rasterLineWidth>1&&o.length>0&&(d=!0,this._clearCommand.framebuffer=f,this._clearCommand.execute(e.context)),this._clearCommand.framebuffer=p,this._clearCommand.execute(e.context),this._clearCommand.framebuffer=this._rasterFBO,this._clearCommand.execute(e.context);var _=H$f(this,e),m={},$={};for(a=0;a<n.length;a++){e$28(m[g=n[a].layerId])?m[g].push(n[a]):m[g]=[n[a]]}for(a=0;a<o.length;a++){var g;e$28($[g=o[a].layerId])?$[g].push(o[a]):$[g]=[o[a]]}if(e$28(e.rasterLayerIds))for(var v=0;v<e.rasterLayerIds.length;v++){var y=e.rasterLayerIds[v],x=m[y],b=$[y];if(e$28(x))for(a=0;a<x.length;a++)x[a].renderState=u$R.fromCache({viewport:_$d,depthTest:{enabled:!1},blending:Ee$n.ALPHA_BLEND}),x[a].framebuffer=p,x[a].execute(e.context);if(e$28(b))for(a=0;a<b.length;a++)b[a].renderState=u$R.fromCache({viewport:_$d}),b[a].framebuffer=d?f:p,b[a].execute(e.context)}this.resetCamera(e,_),d&&(t._lineExpandCommand.framebuffer=p,t._lineExpandCommand.renderState=u$R.fromCache({viewport:_$d}),t._lineExpandCommand.execute(e.context)),t._lineFXAACommand.framebuffer=this._rasterFBO,t._lineFXAACommand.renderState=u$R.fromCache({viewport:_$d}),t._lineFXAACommand.execute(e.context)}},h$b.prototype.renderVectorBy2DCanvas=function(e,t){var i=e.rasterVectorCollection,r=i.bounds;if(e$28(r)){var n=!1;if(e$28(h$10.intersection(r,this._rectangle,q$a))&&(n=!0),n&&!this._2DRasterized){this._2DRasterized=!0,e$28(this._2DRasterTexture)||(this._2DRasterTexture=new L$17({context:e.context,width:i.canvasWidth,height:i.canvasHeight,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}));var o=i.draw(this._rectangle);this._2DRasterTexture.copyFrom(o),this._2DRasterTexture.textureAlpha=i.alpha}}},h$b.prototype.rasterClipRegion=function(e,t){if(!(e._fboState.name.indexOf("_excavationGlobeHeight")>-1||this._level<2)){var i=[].concat(t._excavateRegions.values).concat(t._modifyRegions.values).concat(t._imageryClipRegions.values).concat(t._extractRegions.values);e$28(t._slopeRegion)&&i.push(t._slopeRegion),e$28(t._hypsometricRegion)&&i.push(t._hypsometricRegion);var r=i.length;if(!(r<1||e.camera.frustum instanceof a$X||this._clipRegionsCount===r)){e$28(this._clipRasterFbo)||(this._clipRasterTexture=new L$17({context:e.context,width:256,height:256,pixelFormat:V$O.RGBA}),this._clipRasterFbo=new a$z({context:e.context,colorTextures:[this._clipRasterTexture],destroyAttachments:!1})),this._clearCommand.framebuffer=this._clipRasterFbo,this._clearCommand.execute(e.context),_$d.width=256,_$d.height=256,this.regions=[];for(var n=H$f(this,e),o=!1,a=0;a<r;a++){var s=i[a];if(e$28(h$10.intersection(s.rectangle,this._rectangle))){this.regions.push(s);var l=s.command;!e$28(s.command)||(o=!0,l.renderState=u$R.fromCache({viewport:_$d,cull:{enabled:!1}}),l.framebuffer=this._clipRasterFbo,l.execute(e.context))}}if(this.resetCamera(e,n),(o=o||t.clippingType===V$i.KeepInside)&&(this._clipRegionsCount=r),this._clipRegionRasterized=o,o){var u=this._level+" "+this._x+" "+this._y;t._clipRasterTilesMap[u]=this}}}},h$b.prototype.setRasterValidTerrainCamera=function(e,t){var i=f$10.clone(t.context.uniformState._viewport),r=t.camera;t$X.clone(r.position,oldPosition),t$X.clone(r.direction,oldDirection),t$X.clone(r.up,oldUp),r.setView({destination:new t$X(16383.5,16383.5,5e4),orientation:{direction:new t$X(0,0,-1),up:new t$X(0,1,0)},convert:!1});var n=new a$X({width:32767,aspectRatio:1,near:1,far:1e5});return t.context.uniformState.update(t),t.context.uniformState.updateFrustum(n),{position:oldPosition,direction:oldDirection,upDirection:oldUp,viewport:i}},h$b.prototype.setShowInvalid=function(e){this.showInvalid!==e&&(this.showInvalid=e,e$28(this.data)&&this.data.setShowInvalid(e))},Object.defineProperties(L$g.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),L$g.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0,this._zeroTileReady=!1},L$g.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;e$28(t);)t.state!==re$B.START&&e(t),t=t.replacementNext},L$g.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},L$g.prototype.updateHeight=function(e,t,i){var r=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,scene:i,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},L$g.prototype.update=function(e){e$28(this._tileProvider.update)&&this._tileProvider.update(e)},L$g.prototype.beginFrame=function(e){!e.passes.render||(this._tilesInvalidated&&(Ce$3(this),this._tilesInvalidated=!1),this._freeAllBakTiles&&(Le$3(this),this._freeAllBakTiles=!1),this._tileProvider.initialize(e),le$4(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())},L$g.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),ye$3(this,e),We$3(this,e),i.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&i.updateForPick(e)},L$g.prototype.showInvalid=function(e){var t,i,r,n=[];for(t=0,i=this._levelZeroTiles.length;t<i;++t)n.push(this._levelZeroTiles[t]);for(;r=n.pop();)r.setShowInvalid(e),this._tileToUpdateHeights.push(r),e$28(r._southeastChild)&&n.push(r._southeastChild),e$28(r._southwestChild)&&n.push(r._southwestChild),e$28(r._northeastChild)&&n.push(r._northeastChild),e$28(r._northwestChild)&&n.push(r._northwestChild)},L$g.prototype.endFrame=function(e){if(e.passes.render&&e.mode!==P$$.MORPHING){if(e.camera._scene._mvtVisibleControl)for(var t=e.camera._scene._mvtVisibleLevel,i=this._tileReplacementQueue.head;e$28(i);){if(!1===i._mvtLoaded&&i._level>e.camera._endLevel-t&&e$28(i.data)&&e$28(i.data.imagery))for(var r=i.data.imagery,n=0;n<r.length;n++)if(e$28(r[n].loadingImagery)){r[n].loadingImagery.imageryLayer._imageryProvider instanceof M$X&&(i._mvtLoaded=r[n].processStateMachine(i,e))}i=i.replacementNext}!0===this.tileProvider.terrainProvider._needRefresh&&(this.invalidateAllTiles(),this.tileProvider.terrainProvider._needRefresh=!1),we$2(this,e),ke$1(this,e),me$5(this,e)}},L$g.prototype.isDestroyed=function(){return!1},L$g.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._tileReplacementQueue.markStartOfRenderFrame(),this._tileReplacementQueue.trimTiles(0,0)};var O$c,ae$4=new t$W;function pe$6(e,t){var i=h$10.center(e.rectangle,ae$4),r=i.longitude-O$c.longitude,n=i.latitude-O$c.latitude,o=(i=h$10.center(t.rectangle,ae$4)).longitude-O$c.longitude,a=i.latitude-O$c.latitude;return r*r+n*n-(o*o+a*a)}var Pe$4=new t$X,H$e=[];function Ee$3(e,t,i){if(t>5){for(var r=[],n=0;n<e.length;++n)e[n].level===t&&r.push(e[n]);if(r.length<i)for(n=0;n<r.length;++n)r[n]._useParentImage=!0}}function ye$3(e,t){var i=e._debug;if(!i.suspendLodUpdate){var r=e._tilesToRender;r.length=0;for(var n=e._tileReplacementQueue.head;n!==e._tileReplacementQueue.tail;)n._renderThisFrame=!1,n._useParentImage=!1,n=n.replacementNext;var o,a=e._tileProvider;if(!e$28(e._levelZeroTiles)){if(!a.ready)return;var s=a.tilingScheme;e._levelZeroTiles=h$b.createLevelZeroTiles(s);var l=e._levelZeroTiles.length;if(H$e.length<l)for(H$e=new Array(l),o=0;o<l;++o)void 0===H$e[o]&&(H$e[o]=new A$f)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var u=e._levelZeroTiles,c=u.length>1?e._occluders:void 0;O$c=t.camera.positionCartographic,u.sort(pe$6);var h,d=e._addHeightCallbacks,f=e._removeHeightCallbacks,p=t.frameNumber;if(d.length>0||f.length>0){for(o=0,h=u.length;o<h;++o)(n=u[o])._updateCustomData(p,d,f);d.length=0,f.length=0}var _=t.camera;e._cameraPositionCartographic=_.positionCartographic;var m=y$15.getTranslation(_.transform,Pe$4);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,h=u.length;o<h;++o)n=u[o],e._tileReplacementQueue.markTileRendered(n),n.renderable?R$d(e,n,a,t,c,!1,H$e[o]):(m$h(e,e._tileLoadQueueHigh,n,t),++i.tilesWaitingForChildren);for(var $=0,g=22,v=0;v<r.length;++v)$=Math.max(r[v].level,$),g=Math.min(r[v].level,g);t.camera._endLevel=$,$-g>3&&Ee$3(r,$,e._delicateImagerylength),e._zeroTileReady||(e._tilesToRenderOld.length>0?r.length>2&&(e._zeroTileReady=!0,e._freeAllBakTiles=!0):e._zeroTileReady=!0),e._lastSelectionFrameNumber=p}}function m$h(e,t,i,r){!i.needsLoading||i.loadFrameNumber===r.frameNumber||(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),i.loadFrameNumber=r.frameNumber,t.push(i))}function A$f(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function ne$6(){this.southwest=new A$f,this.southeast=new A$f,this.northwest=new A$f,this.northeast=new A$f}ne$6.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 U$d=new Array(30),G$f=0;G$f<U$d.length;++G$f)U$d[G$f]=new ne$6;function Fe$4(e,t,i,r,n){var o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>o.maxDepthVisited&&(o.maxDepthVisited=i.level);var a=Ne$3(e,t,i)<e.maximumScreenSpaceError;if(e._tileProvider._terrainProvider._enablePrjArea&&a){var s=i._level+2,l=4*i._x,u=4*i._y;for(let t=0;t<e._tilesToRender.length;t++){const i=e._tilesToRender[t];if(i._level==s&&(i._x==l-1&&i._y==u||i._x==l&&i._y==u-1||i._x==l+3&&i._y==u-1||i._x==l+4&&i._y==u||i._x==l+4&&i._y==u+3||i._x==l+3&&i._y==u+4||i._x==l&&i._y==u+4||i._x==l-1&&i._y==u+3)){a=!1;break}}}var c=i.southwestChild,h=i.southeastChild,d=i.northwestChild,f=i.northeastChild,p=e._lastSelectionFrameNumber,_=i._lastSelectionResultFrame===p?i._lastSelectionResult:D$t.NONE,m=e.tileProvider;if(a||r){var $=D$t.originalResult(_)===D$t.RENDERED,g=D$t.originalResult(_)===D$t.CULLED||_===D$t.NONE,v=i.state===re$B.DONE,y=$||g||v;if(y||e$28(m.canRenderWithoutLosingDetail)&&(y=m.canRenderWithoutLosingDetail(i)),y)return a&&m$h(e,e._tileLoadQueueMedium,i,t),M$f(e,i),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=_===D$t.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=D$t.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));r=!0,a&&m$h(e,e._tileLoadQueueHigh,i,t)}if(m.canRefine(i)){if(c.upsampledFromParent&&h.upsampledFromParent&&d.upsampledFromParent&&f.upsampledFromParent)return M$f(e,i),m$h(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(h),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(f),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=_===D$t.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=D$t.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=D$t.REFINED;var x=e._tilesToRender.length,b=e._tileLoadQueueLow.length,w=e._tileLoadQueueMedium.length,C=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(De$5(e,c,h,d,f,t,r,n),x!==e._tilesToRender.length){var S=n.allAreRenderable,E=n.anyWereRenderedLastFrame,A=n.notYetRenderableCount,P=!1;if(!S&&!E){for(var I=e._tilesToRender,M=x;M<I.length;++M)for(var O=I[M];void 0!==O&&O._lastSelectionResult!==D$t.KICKED&&O!==i;)O._lastSelectionResult=D$t.kick(O._lastSelectionResult),O=O.parent;e._tilesToRender.length=x,e._tileToUpdateHeights.length=T,M$f(e,i),i._lastSelectionResult=D$t.RENDERED;var D=_===D$t.RENDERED;!D&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=w,e._tileLoadQueueHigh.length=C,m$h(e,e._tileLoadQueueMedium,i,t),n.notYetRenderableCount=i.renderable?0:1,P=!0),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=D,D||e._tileToUpdateHeights.push(i),++o.tilesWaitingForChildren}e.preloadAncestors&&!P&&m$h(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=D$t.RENDERED,M$f(e,i),m$h(e,e._tileLoadQueueHigh,i,t),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=_===D$t.RENDERED,n.notYetRenderableCount=i.renderable?0:1}function De$5(e,t,i,r,n,o,a,s){if(!(t.level>=U$d.length)){var l=o.camera.positionCartographic,u=e._tileProvider,c=e._occluders,h=U$d[t.level],d=h.southwest,f=h.southeast,p=h.northwest,_=h.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(R$d(e,t,u,o,c,a,d),R$d(e,i,u,o,c,a,f),R$d(e,r,u,o,c,a,p),R$d(e,n,u,o,c,a,_)):(R$d(e,r,u,o,c,a,p),R$d(e,t,u,o,c,a,d),R$d(e,n,u,o,c,a,_),R$d(e,i,u,o,c,a,f)):l.latitude<t.rectangle.north?(R$d(e,i,u,o,c,a,f),R$d(e,t,u,o,c,a,d),R$d(e,n,u,o,c,a,_),R$d(e,r,u,o,c,a,p)):(R$d(e,n,u,o,c,a,_),R$d(e,r,u,o,c,a,p),R$d(e,i,u,o,c,a,f),R$d(e,t,u,o,c,a,d)),h.combine(s)}}function Qe$3(e,t){var i=t.rectangle;return e$28(e._cameraPositionCartographic)&&h$10.contains(i,e._cameraPositionCartographic)||e$28(e._cameraReferenceFrameOriginCartographic)&&h$10.contains(i,e._cameraReferenceFrameOriginCartographic)}function R$d(e,t,i,r,n,o,a){if(i.computeTileVisibility(t,r,n)!==fe$s.NONE)return Fe$4(e,r,t,o,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,Qe$3(e,t)){(!e$28(t.data)||!e$28(t.data.vertexArray))&&m$h(e,e._tileLoadQueueMedium,t,r);var s=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===s?t._lastSelectionResult:D$t.NONE;l!==D$t.CULLED_BUT_NEEDED&&l!==D$t.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=D$t.CULLED_BUT_NEEDED}else e.preloadSiblings||0===t.level?(m$h(e,e._tileLoadQueueLow,t,r),t._lastSelectionResult=D$t.CULLED):t._lastSelectionResult=D$t.CULLED;t._lastSelectionResultFrame=r.frameNumber}function Ne$3(e,t,i){if(t.mode===P$$.SCENE2D||t.camera.frustum instanceof a$X||t.camera.frustum instanceof l$$)return xe$4(e,t,i);if(i.isModified&&i.level>18)return 0;var r,n=i._distance;if(e._tileProvider._terrainProvider._enablePrjArea){var o=i.data.tileBoundingRegion._orientedBoundingBox.calculateBoxArea(t.camera.positionWC,t.mode,n,t.camera.frustum.sseDenominator,t.context.drawingBufferHeight,-1,t.context.uniformState.mvpViewPort,t.mapProjection);r=Math.sqrt(o/e$27.PI_OVER_FOUR)/288}else{r=e._tileProvider.getLevelMaximumGeometricError(i.level)*t.context.drawingBufferHeight/(n*t.camera.frustum.sseDenominator)}return 0==e._tileProvider._terrainProvider._enablePrjArea&&t.fog.enabled&&(r-=e$27.fog(n,t.fog.density)*t.fog.sse),r}function xe$4(e,t,i){var r=t.camera.frustum;e$28(r._offCenterFrustum)&&(r=r._offCenterFrustum);var n=t.context,o=n.drawingBufferWidth,a=n.drawingBufferHeight,s=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(r.top-r.bottom,r.right-r.left)/Math.max(o,a));return t.fog.enabled&&t.mode!==P$$.SCENE2D&&(s-=e$27.fog(i._distance,t.fog.density)*t.fog.sse),s}function M$f(e,t){t._renderThisFrame=!0,e._tilesToRender.push(t)}function we$2(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize,e.tileCacheSizeForMVT);var o=kt$7()+e._loadQueueTimeSlice,a=e._tileProvider,s=q$9(e,t,a,o,i,!1);s=q$9(e,t,a,o,r,s),q$9(e,t,a,o,n,s)}}function Oe$3(e,t){return e._loadPriority-t._loadPriority}function q$9(e,t,i,r,n,o){void 0!==i.computeTileLoadPriority&&n.sort(Oe$3);for(var a=0,s=n.length;a<s&&(kt$7()<r||!o);++a){var l=n[a];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l),o=!0}return o}function He$3(e,t){for(var i,r=!1,n=0,o=e.length;n<o;n++){if(i=e[n],e$28(h$10.simpleIntersection(i.rectangle,t))){r=!0;break}}if(e$28(i)&&r)for(;e$28(i);){if(i.rectangle.contains(t))return i;i=i.parent}}function Ae$4(e,t,i){if(i.length<1)return;const r=[].concat(t._modifyRegions.values).concat(t._extractRegions.values);for(let n=0,o=r.length;n<o;n++){const o=r[n],a=He$3(i,o.rectangle);if(!e$28(a)||!e$28(a.data))continue;const s=a.data;s.createModifyVertexArray(e,t,a,o,!1),e$28(s.modifyTerrainVertexArray)&&t.upsampleParent(e,a,o)}}var Q$b=new f$18,K$9=new t$W,F$a=new t$X,Ve$5=[];function ke$1(e,t){if(!e.tileProvider.ready)return;const i=Ve$5;i.length=0;const r=e._tileToUpdateHeights;Ae$4(t.context,e.tileProvider,r);const n=kt$7()+e._updateHeightsTimeSlice,o=t.mode,a=t.mapProjection,s=e.tileProvider.tilingScheme.ellipsoid;let l;for(;r.length>0;){const t=r[0];if(!e$28(t.data)||!e$28(t.data.mesh)){const n=t._lastSelectionResultFrame===e._lastSelectionFrameNumber?t._lastSelectionResult:D$t.NONE;(n===D$t.RENDERED||n===D$t.CULLED_BUT_NEEDED)&&i.push(t),r.shift(),e._lastTileIndex=0;continue}const u=t.customData,c=u.length;let h=!1;for(l=e._lastTileIndex;l<c;++l){const e=u[l],i=t.data.terrainData;if(e$28(i)&&i.wasCreatedByUpsampling(),t.level>e.level){if(e$28(e.positionOnEllipsoidSurface)||(e.positionOnEllipsoidSurface=t$X.fromRadians(e.positionCartographic.longitude,e.positionCartographic.latitude,0,s)),o===P$$.SCENE3D){const i=s.geodeticSurfaceNormal(e.positionOnEllipsoidSurface,Q$b.direction);if(!e$28(s.getSurfaceNormalIntersectionWithZAxis(e.positionOnEllipsoidSurface,11500,Q$b.origin))){let r=0;e$28(t.data.tileBoundingRegion)&&(r=t.data.tileBoundingRegion.minimumHeight);const n=Math.min(r,-11500),o=t$X.multiplyByScalar(i,Math.abs(n)+1,F$a);t$X.subtract(e.positionOnEllipsoidSurface,o,Q$b.origin)}}else t$W.clone(e.positionCartographic,K$9),K$9.height=-11500,a.project(K$9,F$a),t$X.fromElements(F$a.z,F$a.x,F$a.y,F$a),t$X.clone(F$a,Q$b.origin),t$X.clone(t$X.UNIT_X,Q$b.direction);const i=t.data.pick(Q$b,o,a,!1,F$a);e$28(i)&&(e$28(e.callback)&&e.callback(i),e.level=t.level)}if(kt$7()>=n){h=!0;break}}if(h){e._lastTileIndex=l;break}e._lastTileIndex=0,r.shift()}for(l=0;l<i.length;l++)r.push(i[l])}function We$3(e,t){for(var i=e._tileProvider,r=e._zeroTileReady?e._tilesToRender:e._tilesToRenderOld,n=0,o=r.length;n<o;++n){var a=r[n];i.showTileThisFrame(a,t)}}function p$a(e){this._bounds=void 0;var t=512;this._canvas=document.createElement("canvas"),this._canvas.height=t,this._canvas.width=t,this._pickCanvas=document.createElement("canvas"),this._pickCanvas.height=t,this._pickCanvas.width=t,this._polygons=new e$1P,this._polygonHoles=new e$1P,this._polylines=new e$1P,this._quadtreePrimitive=e,this._alpha=1}Object.defineProperties(p$a.prototype,{bounds:{get:function(){return this._bounds}},canvasWidth:{get:function(){return this._canvas.width}},canvasHeight:{get:function(){return this._canvas.height}},alpha:{get:function(){return this._alpha},set:function(e){this._alpha=e}}});var T$d=new h$10;function f$g(e,t){if(e$28(t)){var i=e._rectangle;e$28(h$10.intersection(t,i,T$d))&&(e._2DRasterized=!1),e$28(e._southwestChild)&&f$g(e._southwestChild,t),e$28(e._southeastChild)&&f$g(e._southeastChild,t),e$28(e._northwestChild)&&f$g(e._northwestChild,t),e$28(e._northeastChild)&&f$g(e._northeastChild,t)}}function Z$a(e){var t,i,r=e._polygons,n=r.values.length;for(t=0;t<n;t++)i=r.values[t].bounds,e$28(e._bounds)?e._bounds=h$10.union(i,e._bounds):e._bounds=i;for(n=(r=e._polygonHoles).values.length,t=0;t<n;t++)i=r.values[t].bounds,e$28(e._bounds)?e._bounds=h$10.union(i,e._bounds):e._bounds=i;for(n=(r=e._polylines).values.length,t=0;t<n;t++)i=r.values[t].bounds,e$28(e._bounds)?e._bounds=h$10.union(i,e._bounds):e._bounds=i}function x$d(e,t,i,r){for(var n=e.length,o=[],a=i/t.width,s=r/t.height,l=0;l<n;l++){var u=e[l],c=new o$1k;c.x=(u.longitude-t.west)*a,c.y=(t.north-u.latitude)*s,c.x=Math.floor(c.x+.5),c.y=Math.floor(c.y+.5),o.push(c)}return o}function I$d(e,t,i,r,n,o){var a,s=t.values.length;for(a=0;a<s;a++){var l=t.values[a];if(e$28(h$10.intersection(l.bounds,i,T$d))){var u;u=e$28(l.selected)&&l.selected?e$1S.BLUE:o?new e$1S(0,0,0,1):l.fillColor;var c=x$d(l.positions,i,r,n);t$b.drawPolygon(e,{canvasPostions:c,fillColor:u,lineColor:l.lineColor,lineWidth:l.lineWidth})}}}function D$e(e,t,i,r,n){var o,a=t.values.length;for(o=0;o<a;o++){var s=t.values[o];if(e$28(h$10.intersection(s.bounds,i,T$d))){var l=x$d(s.positions,i,r,n);t$b.drawSimplePolyline(e,{canvasPostions:l,lineColor:s.lineColor,lineWidth:s.lineWidth})}}}function M$e(e,t){var i=Math.floor(e/65536),r=e-65536*i,n=Math.floor(r/256),o=r-256*n,a=1;return e$28(t)&&(a=t/256),new e$1S(o/256,n/256,i/256,a)}p$a.prototype.add=function(e){var t=e.name,i=e.positions,r=new h$10,n=u$Y(e.geometryType,C$l.POLYGON),o=u$Y(e.pickId,0);h$10.fromCartographicArray(i,r);var a={pickId:o,positions:i,bounds:r,fillColor:e.fillColor,lineColor:e.lineColor,lineWidth:e.lineWidth};n==C$l.POLYLINE?this._polylines.set(t,a):n==C$l.POLYGON?this._polygons.set(t,a):n==C$l.POLYGON_HOLE&&this._polygonHoles.set(t,a),Z$a(this),f$g(this._quadtreePrimitive._levelZeroTiles[0],r),f$g(this._quadtreePrimitive._levelZeroTiles[1],r)},p$a.prototype.remove=function(e){var t;if(this._polygons.contains(e)){var i=this._polygons.get(e);e$28(i)&&(t=i.bounds),this._polygons.remove(e)}if(this._polygonHoles.contains(e)){var r=this._polygonHoles.get(e);e$28(r)&&(t=r.bounds),this._polygonHoles.remove(e)}if(this._polylines.contains(e)){var n=this._polylines.get(e);e$28(n)&&(t=n.bounds),this._polylines.remove(e)}f$g(this._quadtreePrimitive._levelZeroTiles[0],t),f$g(this._quadtreePrimitive._levelZeroTiles[1],t)},p$a.prototype.removeAll=function(){this._polylines.removeAll(),this._polygons.removeAll(),this._polygonHoles.removeAll(),f$g(this._quadtreePrimitive._levelZeroTiles[0],this._bounds),f$g(this._quadtreePrimitive._levelZeroTiles[1],this._bounds)},p$a.prototype.draw=function(e){var t=this._canvas.getContext("2d");return t.clearRect(0,0,this._canvas.width,this._canvas.height),I$d(t,this._polygons,e,this._canvas.width,this._canvas.height,!1),I$d(t,this._polygonHoles,e,this._canvas.width,this._canvas.height,!0),D$e(t,this._polylines,e,this._canvas.width,this._canvas.height),t.getImageData(0,0,this._canvas.width,this._canvas.height)};var c$c=new h$10;function h$a(e){var t=new t$G({ellipsoid:e=u$Y(e,t$V.WGS84)}),i=new n$f,r=new o$m;this._ellipsoid=e,this._imageryLayerCollection=i,this._terrainLayerCollection=r,this._surfaceShaderSet=new D$g,this._material=void 0,this._surface=new L$g({tileProvider:new R$l({terrainProvider:t,imageryLayers:i,terrainLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainLayerCollection._globe=this,this._rasterVectorCollection=new p$a(this._surface),this._terrainProvider=t,this._defaultTerrainProvider=t,this._terrainProviderChanged=new o$1o,K$8(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new t$S({url:n$17("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.tileCacheSizeForMVT=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!0,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=!0,this.shadows=q$L.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,this._globeAlpha=1,this._splitDirection=new o$1k(0,0),this._sceneMode=P$$.SCENE3D,this.clippingType=V$i.KeepOutside,this.showExcavationSide=!0,this._scene=void 0,this._excavationNormalTextureUrl=n$17("Assets/Textures/excavationregion_top_Normal.jpg"),this._excavationSideNormalTextureUrl=n$17("Assets/Textures/excavationregion_side_Normal.jpg"),this._floodFlagTexture=void 0,this._floodRect=new e$25}function K$8(e){var t=[],i=e$28(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[le$5];!e$28(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.uniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.uniformMap=e._material._uniforms),r.push(De$6),e._surfaceShaderSet.baseVertexShaderSource=new a$$({sources:[le$5,He$4],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new a$$({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function Ye$2(e){return function(t,i){return i$19.distanceSquaredTo(t.pickBoundingSphere,e)-i$19.distanceSquaredTo(i.pickBoundingSphere,e)}}p$a.prototype.getPickID=function(e){var t,i=this._polygons,r=i.values.length,n=[],o=0;for(t=0;t<r;t++){var a=i.values[t].bounds;h$10.contains(a,e)&&(0==o?h$10.clone(a,c$c):c$c=h$10.union(a,c$c),o++,n.push(i.values[t]))}if(0==o)return-1;var s=this._pickCanvas.getContext("2d");for(r=n.length,t=0;t<r;t++){var l=n[t],u=x$d(l.positions,c$c,this._pickCanvas.width,this._pickCanvas.height),c=M$e(l.pickId);t$b.drawPolygon(s,{canvasPostions:u,fillColor:c,lineColor:c})}var h=(e.longitude-c$c.west)/c$c.width*this._pickCanvas.width,d=(c$c.north-e.latitude)/c$c.height*this._pickCanvas.height;h=Math.floor(h+.5);var f=4*((d=Math.floor(d+.5))*this._pickCanvas.width+h),p=s.getImageData(0,0,this._pickCanvas.width,this._pickCanvas.height),_=p.data[f],m=p.data[f+1],$=p.data[f+2];return p.data[f+3],_+256*m+256*$*256},p$a.prototype.setSelection=function(e){var t,i=this._polygons,r=i.values.length,n=0,o=!1;for(t=0;t<r;t++){var a=i.values[t],s=a.pickId,l=a.bounds;o=!1,s===e?(a.selected=!0,o=!0):(e$28(a.selected)&&a.selected&&(o=!0),a.selected=!1),o&&(0==n?h$10.clone(l,c$c):c$c=h$10.union(l,c$c),n++)}f$g(this._quadtreePrimitive._levelZeroTiles[0],c$c),f$g(this._quadtreePrimitive._levelZeroTiles[1],c$c)},p$a.prototype.isDestroyed=function(){return!1},p$a.prototype.destroy=function(){return i$Z(this)},new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Object.defineProperties(h$a.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},terrainLayers:{get:function(){return this._terrainLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tileLoadedEvent:{get:function(){return this._surface.tileProvider.tileLoadedEvent}},tilesLoaded:{get:function(){return!e$28(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){e$28(e)||(e=h$10.clone(h$10.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),e$28(this._material)&&K$8(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,K$8(this))}},globeAlpha:{get:function(){return this._globeAlpha},set:function(e){e$28(e)&&e>=0&&e<=1&&(this._globeAlpha=e,this._surface.tileProvider.globeAlpha=e)}},cullEnabled:{get:function(){return this._surface._tileProvider._cullEnabled},set:function(e){if(o$1u.typeOf.bool("cullEnabled",e),e$28(e)&&(this._surface._tileProvider._cullEnabled=e,e$28(this._surface._tileProvider._renderState))){var t=u$R.getState(this._surface._tileProvider._renderState);t.cull.enabled=e,this._surface._tileProvider._renderState=u$R.fromCache(t)}}},HypsometricSetting:{get:function(){return{hypsometricSetting:this._surface._tileProvider._hypsometricSetting,analysisMode:this._surface._tileProvider._hypAnalysisMode,altitudeMode:this._surface._tileProvider._style3D._altitudeMode}},set:function(e){if(this.removeRasterRegions(),this._surface._tileProvider._bUseHypColorTable=!1,this._surface._tileProvider._hypsometricRegionUpdate=!0,e$28(this._surface._tileProvider._hypsometricRegion)&&(e$28(this._surface._tileProvider._hypsometricRegion.command)&&(this._surface._tileProvider._hypsometricRegion.command.vertexArray.destroy(),this._surface._tileProvider._hypsometricRegion.command.shaderProgram.destroy()),this._surface._tileProvider._hypsometricRegion=null),e$28(e)&&e$28(e.hypsometricSetting)){if(this._surface._tileProvider._hypAnalysisMode=e.analysisMode||this._surface._tileProvider._hypAnalysisMode,this._surface._tileProvider._hypsometricSetting=u$K.clone(e.hypsometricSetting,this._surface._tileProvider._hypsometricSetting),this._surface._tileProvider._hypsometricSetting.ColorTable.generateBuffer(),e$28(this._surface._tileProvider._hypsometricTexture)&&this._surface._tileProvider._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._surface._tileProvider._hypsometricSetting.ColorTable._imageBuffer}),this._surface._tileProvider._hypAnalysisMode!=k$T.AnalysisRegionMode.ARM_NONE&&(this._surface._tileProvider._bUseHypColorTable=!0),this._surface._tileProvider._hypsometricSetting.UpdatePolygonRegion&&this._surface._tileProvider._hypAnalysisMode==k$T.AnalysisRegionMode.ARM_REGION&&this._surface._tileProvider._hypsometricSetting.CoverageArea.length>0){var t=this._surface._tileProvider._hypsometricSetting.CoverageArea,i=t$X.fromDegreesArrayHeights(t),r=h$10.fromCartesianArray(i),n=U$Q.createGeometry(new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(t)}}));this._surface._tileProvider._hypsometricRegion={rectangle:r,worldGeometry:n,modelMatrix:y$15.fromTranslation(new t$X(t[0],t[1],0),new y$15),command:void 0}}}else e$28(this._surface._tileProvider._hypsometricSetting)&&(this._surface._tileProvider._hypsometricSetting.destroy(),this._surface._tileProvider._hypsometricSetting=void 0)}},SlopeSetting:{get:function(){return LicenseChecker.LICENSECHECKER.verify("Globe_SlopeSetting"),{slopeSetting:this._surface._tileProvider._slopeSetting,analysisMode:this._surface._tileProvider._slopeAnalysisMode,altitudeMode:this._surface._tileProvider._style3D._altitudeMode}},set:function(e){if(LicenseChecker.LICENSECHECKER.verify("Globe_SlopeSetting"),this.removeRasterRegions(),this._surface._tileProvider._bUseSlopeColorTable=!1,this._surface._tileProvider._slopeRegionUpdate=!0,e$28(this._surface._tileProvider._slopeRegion)&&(e$28(this._surface._tileProvider._slopeRegion.command)&&(this._surface._tileProvider._slopeRegion.command.vertexArray.destroy(),this._surface._tileProvider._slopeRegion.command.shaderProgram.destroy()),this._surface._tileProvider._slopeRegion=null),e$28(e)&&e$28(e.slopeSetting)){if(this._surface._tileProvider._slopeAnalysisMode=e.analysisMode,this._surface._tileProvider._slopeSetting=l$R.clone(e.slopeSetting,this._surface._tileProvider._slopeSetting),this._surface._tileProvider._slopeSetting.ColorTable.generateBuffer(),e$28(this._surface._tileProvider._slopeColorTexture)&&this._surface._tileProvider._slopeColorTexture.copyFrom({width:1024,height:64,arrayBufferView:this._surface._tileProvider._slopeSetting.ColorTable._imageBuffer}),this._surface._tileProvider._slopeAnalysisMode!=k$T.AnalysisRegionMode.ARM_NONE&&(this._surface._tileProvider._bUseSlopeColorTable=!0),this._surface._tileProvider._slopeSetting.UpdatePolygonRegion&&this._surface._tileProvider._slopeAnalysisMode==k$T.AnalysisRegionMode.ARM_REGION&&this._surface._tileProvider._slopeSetting.CoverageArea.length>0){var t=this._surface._tileProvider._slopeSetting.CoverageArea,i=t$X.fromDegreesArrayHeights(t),r=h$10.fromCartesianArray(i),n=U$Q.createGeometry(new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(t)}}));this._surface._tileProvider._slopeRegion={rectangle:r,worldGeometry:n,modelMatrix:y$15.fromTranslation(new t$X(t[0],t[1],0),new y$15),command:void 0}}}else e$28(this._surface._tileProvider._slopeSetting)&&(this._surface._tileProvider._slopeSetting.destroy(),this._surface._tileProvider._slopeSetting=void 0)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){o$1k.clone(e,this._splitDirection),o$1k.clone(e,this._surface._tileProvider._splitDirection)}},swipeRegion:{get:function(){var e=this._surface._tileProvider._swipeRegion;return new f$10(e.x,e.y,e.z-e.x,e.w-e.y)},set:function(e){if(e$28(e)){if(!(e instanceof f$10))throw new t$Z("swipeRegion must be a instance of BoundingRectangle.");e$25.fromElements(e.x,e.y,e.x+e.width,e.y+e.height,this._surface._tileProvider._swipeRegion)}}},swipeEnabled:{get:function(){return this._surface._tileProvider._swipeEnabled},set:function(e){e!==this._swipeEnabled&&(e?this.splitDirection=new o$1k(0,0):e$25.fromElements(0,0,1,1,this._surface._tileProvider._swipeRegion),this._surface._tileProvider._swipeEnabled=e)}},imageryLodTolerance:{get:function(){return this._surface._delicateImagerylength},set:function(e){"number"==typeof e&&(this._surface._delicateImagerylength=e)}},excavationSideTextureUrl:{get:function(){return this._surface.tileProvider._excavationSideTextureUrl},set:function(e){this._surface.tileProvider._excavationSideTextureUrl=e}},excavationBottomTextureUrl:{get:function(){return this._surface.tileProvider._excavationBottomTextureUrl},set:function(e){this._surface.tileProvider._excavationBottomTextureUrl=e}}});var Ke$2=[],Je$1={start:0,stop:0};h$a.prototype.pickWorldCoordinates=function(e,t,i){if(!e$28(e))throw new t$Z("ray is required");if(!e$28(t))throw new t$Z("scene is required");var r=t.mode,n=t.mapProjection,o=Ke$2;o.length=0;var a,s,l,u=this._surface._tilesToRender,c=u.length;for(s=0;s<c;++s){var h=(a=u[s]).data;if(e$28(h)){var d=h.pickBoundingSphere;if(r!==P$$.SCENE3D)h.pickBoundingSphere=d=i$19.fromRectangleWithHeights2D(a.rectangle,n,h.tileBoundingRegion.minimumHeight,h.tileBoundingRegion.maximumHeight,d),t$X.fromElements(d.center.z,d.center.x,d.center.y,d.center);else{if(!e$28(h.renderedMesh))continue;i$19.clone(h.renderedMesh.boundingSphere3D,d)}e$28(g$10.raySphere(e,d,Je$1))&&o.push(h)}}for(o.sort(Ye$2(e.origin)),c=o.length,s=0;s<c&&!e$28(l=o[s].pick(e,t.mode,t.mapProjection,!0,i));++s);return l};var J$c=new t$X,$$8=new t$X,ee$6=new t$X;h$a.prototype.computeSurfaceArea=function(e,t,i){var r,n=e._polygonHierarchy.positions;if(!e$28(i)){for(var o=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0;u<n.length;u++){var c=t$W.fromCartesian(n[u]);o=Math.min(c.longitude,o),a=Math.max(c.longitude,a),s=Math.min(c.latitude,s),l=Math.max(c.latitude,l)}var h=t$W.toCartesian(new t$W(o,s,0)),d=t$W.toCartesian(new t$W(a,l,0));r=t$X.angleBetween(h,d)}for(var f=U$Q.fromPositions({positions:n,granularity:e$28(i)?i:r/32}),p=U$Q.createGeometry(f),_=0,m={},$=0;$<p.indices.length;$+=3){var g,v,y,x=p.indices[$];if(e$28(m[x]))g=m[x];else{g=new t$X(p.attributes.position.values[3*x],p.attributes.position.values[3*x+1],p.attributes.position.values[3*x+2]);var b=t$W.fromCartesian(g),w=this.getHeight(b);if(!e$28(w))continue;b=t$W.fromRadians(b.longitude,b.latitude,w),g=t$W.toCartesian(b,t),m[x]=t$X.clone(g)}var C=p.indices[$+1];if(e$28(m[C]))v=m[C];else{v=new t$X(p.attributes.position.values[3*C],p.attributes.position.values[3*C+1],p.attributes.position.values[3*C+2]);var T=t$W.fromCartesian(v),S=this.getHeight(T);if(!e$28(S))continue;T=t$W.fromRadians(T.longitude,T.latitude,S),v=t$W.toCartesian(T,t),m[C]=t$X.clone(v)}var E=p.indices[$+2];if(e$28(m[E]))y=m[E];else{y=new t$X(p.attributes.position.values[3*E],p.attributes.position.values[3*E+1],p.attributes.position.values[3*E+2]);var A=t$W.fromCartesian(y),P=this.getHeight(A);if(!e$28(P))continue;A=t$W.fromRadians(A.longitude,A.latitude,P),y=t$W.toCartesian(A,t),m[E]=t$X.clone(y)}J$c=t$X.subtract(v,g,J$c),$$8=t$X.subtract(y,g,$$8),ee$6=t$X.cross(J$c,$$8,ee$6),_+=.5*t$X.magnitude(ee$6)}return _},h$a.prototype.getVisibleTiles=function(){for(var e=[],t=this._surface._tilesToRender,i=0;i<t.length;i++)e.push({x:t[i].x,y:t[i].y,level:t[i].level});return e},h$a.prototype.computeSurfaceDistance=function(e,t){for(var i=e._positions,r=0,n=[],o=i.length-1,a=0;a<o;a++)for(var s=i[a],l=i[a+1],u=t$X.angleBetween(s,l)/64,c=e$27.chordLength(u,6378137),h=y$Q.subdivideLine(s,l,c,n),d=t$X.unpackArray(h),f=d.length-1,p=0;p<f;p++){var _=d[p],m=t$W.fromCartesian(_),$=this.getHeight(m);if(e$28($)){m=t$W.fromRadians(m.longitude,m.latitude,$);var g=t$W.toCartesian(m),v=d[p+1];if(m=t$W.fromCartesian(v),e$28($=this.getHeight(m))){m=t$W.fromRadians(m.longitude,m.latitude,$);var y=t$W.toCartesian(m);r+=t$X.distance(g,y)}}}return r};var $e$1=new t$W;h$a.prototype.pick=function(e,t,i){if(this.show){if(e$28(i=this.pickWorldCoordinates(e,t,i))&&t.mode!==P$$.SCENE3D){i=t$X.fromElements(i.y,i.z,i.x,i);var r=t.mapProjection.unproject(i,$e$1);i=t.globe.ellipsoid.cartographicToCartesian(r,i)}return i}};var er$1=new t$X,de$5=new t$X,rr=new t$W,tr=new f$18;function L$f(e,t){return h$10.contains(e.rectangle,t)?e:void 0}function ue$3(e){for(var t=Number.MAX_VALUE,i=-Number.MAX_VALUE,r=2,n=e.length;r<n;r+=3){var o=e[r];t=Math.min(t,o),i=Math.max(i,o)}return{min:t,max:i}}function ir(e,t,i){var r=h$10.center(t,new t$X);r.height=i,r=t$W.toCartesian(r);var n=t$X.distance(e[0],e[1])/90,o=[];for(let t=0;t<e.length;t++){var a=new t$X,s=t$X.subtract(e[t],r,new t$X);t$X.normalize(s,s),t$X.multiplyComponents(s,new t$X(n,n,n),a),t$X.subtract(e[t],a,a);var l=t$W.fromCartesian(a),u=e$27.toDegrees(l.longitude),c=e$27.toDegrees(l.latitude);o.push(u),o.push(c),o.push(l.height)}return o}function ar(e,t){var i=e.mapProjection,r=i.ellipsoid,n=new t$X,o=new t$W;return r.cartesianToCartographic(t,o),i.project(o,n),t$X.fromElements(n.z,n.x,n.y)}function he$3(e,t){if(!e$28(t._surface)||!e$28(t._surface._tileProvider))return!1;var i=t._surface._tileProvider;if(e$28(t._slopeSetting)&&i._modifyRegions.values.length>0)return!1;var r=t._surface._levelZeroTiles;if(!e$28(r))return!1;var n,o,a=r.length;for(o=0;o<a&&(n=r[o],!h$10.contains(n.rectangle,e));++o);if(o>=a)return!1;for(;n._lastSelectionResult===D$t.REFINED;)n=L$f(n.southwestChild,e)||L$f(n.southeastChild,e)||L$f(n.northwestChild,e)||n.northeastChild;for(var s=n.data,l=s.normalTexture,u=s.terrainData.normalTexture;!(u||(n=n.parent,u=n.data.terrainData.normalTexture,l=n.data.normalTexture,n.level<10)););if(!e$28(u)||!e$28(l))return!1;var c=parseInt((e.longitude-n.rectangle.west)/(n.rectangle.east-n.rectangle.west)*l.width)+parseInt((n.rectangle.north-e.latitude)/(n.rectangle.north-n.rectangle.south)*l.height)*l.width,h=new t$X;return h.x=2*(u[3*c]/255-.5),h.y=2*(u[3*c+1]/255-.5),h.z=2*(u[3*c+2]/255-.5),t$X.normalize(h,h),h}function o$l(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this._colorRenderBuffer=void 0,this._depthStencilRenderbuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._framebufferWithTexture=void 0,this._framebufferWithRenderbuffer=void 0,this._isMSAA=!1,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new f$10,this._rs=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._debugGlobeDepthViewportCommand=void 0}function B$7(e,t,i,r){if(!e$28(e._debugGlobeDepthViewportCommand)||r!==e._useLogDepth){var n=new a$$({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 G$e(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function O$b(e){e._colorRenderBuffer=e._colorRenderBuffer&&!e._colorRenderBuffer.isDestroyed()&&e._colorRenderBuffer.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&!e._depthStencilRenderbuffer.isDestroyed()&&e._depthStencilRenderbuffer.destroy()}function M$d(e){e._framebufferWithTexture=e._framebufferWithTexture&&!e._framebufferWithTexture.isDestroyed()&&e._framebufferWithTexture.destroy(),e._framebufferWithRenderbuffer=e._framebufferWithRenderbuffer&&!e._framebufferWithRenderbuffer.isDestroyed()&&e._framebufferWithRenderbuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function y$f(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 P$c(e,t,i,r,n){e._tempGlobeDepthTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),e._tempCopyDepthFramebuffer=new a$z({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1});var o=n.framebuffer.depthStencilTexture;e._isMSAA&&(o=e._depthStencilTexture),e._updateDepthFramebuffer=new a$z({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:o,destroyAttachments:!1})}function U$c(e,t,i,r,n){var o=n?t.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT:y$U.UNSIGNED_BYTE;e._colorTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:o,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),e._depthStencilTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8}),e._globeDepthTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})}function z$b(e,t,i,r,n){if(e._isMSAA){var o=n?t.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT:y$U.UNSIGNED_BYTE;e._colorRenderBuffer=new o$C({context:t,width:i,height:r,pixelDatatype:o,format:V$O.RGBA,samples:t.msaaLevel}),e._depthStencilRenderbuffer=new o$C({context:t,width:i,height:r,format:M$q.DEPTH_STENCIL,samples:t.msaaLevel})}}function I$c(e,t){e._isMSAA&&(e._framebufferWithRenderbuffer=new a$z({context:t,colorRenderbuffers:[e._colorRenderBuffer],depthStencilRenderbuffer:e._depthStencilRenderbuffer,destroyAttachments:!1})),e._framebufferWithTexture=new a$z({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a$z({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function b$i(e,t,i,r,n){t.msaaLevel>1&&(e._isMSAA=!0);var o=e._colorTexture,a=!e$28(o)||o.width!==i||o.height!==r||n!==e._useHdr;(!e$28(e._framebufferWithTexture)||a)&&(G$e(e),M$d(e),U$c(e,t,i,r,n),z$b(e,t,i,r,n),I$c(e,t))}function l$d(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;var o=!f$10.equals(e._viewport,n.viewport),a=o!==e._useScissorTest;e._useScissorTest=o,f$10.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=f$10.clone(n.viewport,e._scissorRectangle),a=!0),(!e$28(e._rs)||!f$10.equals(e._viewport,e._rs.viewport)||a)&&(e._rs=u$R.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsUpdate=u$R.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!1,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.KEEP},backFunction:m$12.NEVER,reference:Fa$6.CESIUM_3D_TILE_MASK,mask:Fa$6.CESIUM_3D_TILE_MASK}})),e$28(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(E$n,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer,e._copyDepthCommand.renderState=e._rs,e$28(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(V$b,{uniformMap:{colorTexture:function(){return e._colorTexture}},owner:e})),e$28(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(E$n,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer,e._tempCopyDepthCommand.renderState=e._rs,e$28(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(V$b,{uniformMap:{colorTexture:function(){return e._tempGlobeDepthTexture}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer,e._updateDepthCommand.renderState=e._rsUpdate,e$28(e._clearColorCommand)||(e._clearColorCommand=new r$11({color:new e$1S(0,0,0,0),stencil:0,owner:e})),e._isMSAA?e._clearColorCommand.framebuffer=e._framebufferWithRenderbuffer:e._clearColorCommand.framebuffer=e._framebufferWithTexture}function v$d(){this._image=new Image}function h$9(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).url)&&!e$28(e.metadata))throw new t$Z("options.url or options.metadata is required.");var t;if(e$28(e.metadata))t=e.metadata;else{var i=t$S.createIfNeeded(e.url);t=new c$T(i)}this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new g$14({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h$10(-e$27.PI,-e$27.PI,e$27.PI,e$27.PI),ellipsoid:e.ellipsoid});var r=e.credit;"string"==typeof r&&(r=new r$1a(r)),this._credit=r,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,e$28(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new v$d),this._errorEvent=new o$1o,this._ready=!1;var n,o=this;this._readyPromise=t.readyPromise.then((function(e){if(!t.imageryPresent){var i=new t$U("The server "+t.url+" doesn't have imagery");return n=l$13.handleError(n,o,o._errorEvent,i.message,void 0,void 0,void 0,i),o$1q.reject(i)}return l$13.handleSuccess(n),o._ready=e,e})).otherwise((function(e){return n=l$13.handleError(n,o,o._errorEvent,e.message,void 0,void 0,void 0,e),o$1q.reject(e)}))}function j$c(e,t,i,r,n,o){var a=c$T.tileXYToQuadKey(i,r,n),s=t.imageryVersion;return s=e$28(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+a+"-i."+s.toString(),request:o})}function x$c(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";var i="PNG";return e[1]===i.charCodeAt(0)&&e[2]===i.charCodeAt(1)&&e[3]===i.charCodeAt(2)?"image/png":void 0}function F$9(e){for(var t=R$K.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 o=r.copyrightIds;if(e$28(o)||(o=r.copyrightIds=[]),2==(7&n))for(var a=t.uint32()+t.pos;t.pos<a;)o.push(t.uint32());else o.push(t.uint32());break;default:t.skipType(7&n)}}var s=r.imageType;if(e$28(s))switch(s){case 0:r.imageType="image/jpeg";break;case 4:r.imageType="image/png";break;default:throw new t$U("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var l=r.alphaType;return e$28(l)&&0!==l&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete r.alphaType,delete r.imageAlpha),r}h$a.prototype.getHeight=function(e){if(!e$28(e))throw new t$Z("cartographic is required");var t=this._surface._levelZeroTiles;if(e$28(t)){var i,r,n=t.length;for(r=0;r<n&&(i=t[r],!h$10.contains(i.rectangle,e));++r);if(!(r>=n)){for(;i._lastSelectionResult===D$t.REFINED;)i=L$f(i.southwestChild,e)||L$f(i.southeastChild,e)||L$f(i.northwestChild,e)||i.northeastChild;if(e$28(i.data)&&e$28(i.data.renderedMesh)){var o=this._surface._tileProvider.tilingScheme.ellipsoid,a=t$X.fromRadians(e.longitude,e.latitude,0,o,er$1),s=tr,l=o.geodeticSurfaceNormal(a,s.direction);if(!e$28(o.getSurfaceNormalIntersectionWithZAxis(a,11500,s.origin))){var u=Math.min(u$Y(i.data.minimumHeight,0),-11500),c=t$X.multiplyByScalar(l,Math.abs(u)+1,de$5);t$X.subtract(a,c,s.origin)}if(e$28(i.data.terrainData)&&i.data.terrainData instanceof p$_)return i.data.terrainData.interpolateHeight(i.rectangle,e.longitude,e.latitude);var h=i.data.pick(s,void 0,void 0,!1,de$5);if(e$28(h))return o.cartesianToCartographic(h,rr).height}}}},h$a.prototype.update=function(e){!this.show||(e.passes.render&&this._surface.update(e),e.rasterVectorCollection=this._rasterVectorCollection,this.computeGlobeBottomLevel(e))},h$a.prototype.computeGlobeBottomLevel=function(e){for(var t=e.camera.frustum.fov,i=512/Math.tan(.5*t),r=e.camera.position,n=new t$W.fromCartesian(r),o=new t$X.fromRadians(n.longitude,n.latitude,0),a=i/t$X.distance(r,o),s=0,l=0;l<22;l++){var u=1<<l,c=Math.PI/u,h=t$X.fromRadians(n.longitude+.5*c,n.latitude+.5*c),d=t$X.fromRadians(n.longitude+.5*c,n.latitude-.5*c),f=t$X.fromRadians(n.longitude-.5*c,n.latitude-.5*c),p=t$X.fromRadians(n.longitude-.5*c,n.latitude+.5*c),_=t$X.distance(h,d),m=t$X.distance(d,f),$=t$X.distance(f,p),g=t$X.distance(p,h);if(Math.max(Math.max(Math.max(_,m),$),g)/8*a<32||21==l){s=l;break}}e.globeBottomLevel=s},h$a.prototype.beginFrame=function(e){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(this._sceneMode=e.mode,n&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;var o=this._oceanNormalMapResource,a=o.url;if(e$28(a)){var s=this;o$1q(o.fetchImage(),(function(t){a===s._oceanNormalMapResource.url&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new L$17({context:e.context,source:t}))}))}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.passes,u=e.mode;l.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.tileCacheSizeForMVT=this.tileCacheSizeForMVT,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.nightFadeOutDistance=this.nightFadeOutDistance,i.nightFadeInDistance=this.nightFadeInDistance,i.zoomedOutOceanSpecularIntensity=u===P$$.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,i.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,i.showGroundAtmosphere=this.showGroundAtmosphere,i.shadows=this.shadows,i.hueShift=this.atmosphereHueShift,i.saturationShift=this.atmosphereSaturationShift,i.brightnessShift=this.atmosphereBrightnessShift,i.fillHighlightColor=this.fillHighlightColor,i.showSkirts=this.showSkirts,i.backFaceCulling=this.backFaceCulling,i.clippingType=this.clippingType,i.showExcavationSide=this.showExcavationSide,i.excavationNormalTextureUrl=this._excavationNormalTextureUrl,i.excavationSideNormalTextureUrl=this._excavationSideNormalTextureUrl,t.beginFrame(e))},h$a.prototype.render=function(e){if(this.show){e$28(this._material)&&this._material.update(e.context);var t=this._surface,i=e.passes;i.render&&t.render(e),i.pick&&t.render(e)}},h$a.prototype.endFrame=function(e){!this.show||e.passes.render&&this._surface.endFrame(e)},h$a.prototype.isDestroyed=function(){return!1},h$a.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(),i$Z(this)},h$a.prototype.addModifyRegion=function(e){var t=e.name,i=e.position;if(!e$28(t)||!e$28(i))return!1;var r=this._surface._tileProvider;if(r._modifyRegions.contains(t))return!1;var n=ue$3(i),o=n.min,a=n.max,s=t$X.fromDegreesArrayHeights(i),l=U$Q.createGeometry(new U$Q({polygonHierarchy:{positions:s},extrudedHeight:Math.min(-1e3,o),perPositionHeight:!0}));if(!l)return!1;var u=U$Q.createGeometry(new U$Q({polygonHierarchy:{positions:s},perPositionHeight:!0})),c=h$10.fromCartesianArray(s),h=[];s.forEach((e=>{h.push(t$W.fromCartesian(e))}));var d={geometry:l,worldGeometry:u,modelMatrix:y$15.fromTranslation(new t$X(i[0],i[1],0),new y$15),rectangle:c,minimumHeight:Math.min(-1e3,o),maximumHeight:a,command:void 0,cartographics:h,name:t};return r._modifyRegions.set(t,d),r._modifyRegionUpdate=!0,!0},h$a.prototype.removeModifyRegion=function(e){var t=this._surface._tileProvider,i=t._modifyRegions;if(i.contains(e)){var r=i.get(e);e$28(r.command)&&(r.command.vertexArray=r.command.vertexArray&&!r.command.vertexArray.isDestroyed()&&r.command.vertexArray.destroy(),r.command.shaderProgram=r.command.shaderProgram&&!r.command.shaderProgram.isDestroyed()&&r.command.shaderProgram.destroy()),r.command=void 0,t._modifyRegions.remove(e),t._modifyRegionUpdate=!0}},h$a.prototype.removeAllModifyRegion=function(){for(var e=this._surface._tileProvider,t=Object.keys(e._modifyRegions._hash),i=0,r=t.length;i<r;i++){var n=t[i];this.removeModifyRegion(n)}e._modifyRegions.removeAll()},h$a.prototype.addExcavationRegion=function(e){var t=e.name,i=e.position,r=e.height;if(!e$28(t)||!e$28(i)||!e$28(r))return!1;var n=this._surface._tileProvider;if(n._excavateRegions.contains(t))return!1;var o=1,a=[],s=t$X.fromDegreesArrayHeights(i);let l=[...s,s[0]];for(let e=1;e<l.length;e++){o+=t$X.distance(l[e-1],l[e]),a.push(o)}var u=i.length;i.length/3%2!=0&&(i.push(i[u-1-2]),i.push(i[u-1-1]),i.push(i[u-1]),a.push(a[a.length-1]));for(var c=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)}}),h=Number.MAX_VALUE,d=0,f=i.length;d<f;d+=3)h=Math.min(h,i[d+2]);var p=U$Q.createGeometry(c);if(!p)return!1;var _=U$Q.createGeometry(c),m=U$Q.createGeometry(c),$=t$X.fromDegreesArrayHeights(i),g={rectangle:h$10.fromCartesianArray($),geometry:p,worldGeometry:_,colorGeometry:m,positions:i,modelMatrix:y$15.fromTranslation(new t$X(i[0],i[1],0),new y$15),command:void 0,name:t,height:h-r,sideLengths:a,round:o};return n._excavateRegions.set(t,g),n._excavateRegionUpdate=!0,n._excavateTransparent=u$Y(e.transparent,!0),n._excavateTextureWrap=u$Y(e.textureWrap,q$11.REPEAT),n._excavateExtendHeight=r,!0},h$a.prototype.removeExcavationRegion=function(e){var t=this._surface._tileProvider,i=t._excavateRegions;if(i.contains(e)){t._removeExcavationCommands(e);var r=i.get(e);e$28(r.command)&&(r.command.vertexArray=r.command.vertexArray&&!r.command.vertexArray.isDestroyed()&&r.command.vertexArray.destroy(),r.command.shaderProgram=r.command.shaderProgram&&!r.command.shaderProgram.isDestroyed()&&r.command.shaderProgram.destroy()),e$28(r.removeListenerFunc)&&r.removeListenerFunc(),r.command=void 0,i.remove(e),0===i.length&&(t._onceExcavateRegionsEmpty=!0),t._excavateRegionUpdate=!0}},h$a.prototype.removeAllExcavationRegion=function(){var e=this._surface._tileProvider;e._removeAllExcavationCommands();for(var t=Object.keys(e._excavateRegions._hash),i=0,r=t.length;i<r;i++){var n=t[i];this.removeExcavationRegion(n)}e._excavateRegions.removeAll()},h$a.prototype.addExtractRegion=function(e){var t=e.name,i=e.position,r=e.height,n=u$Y(e.extractHeight,100),o=u$Y(e.granularity,1);if(!e$28(t)||!e$28(i)||!e$28(r))return!1;var a=this._surface._tileProvider;if(a._extractRegions.contains(t))return!1;var s=1,l=[],u=t$X.fromDegreesArrayHeights(i);let c=[...u,u[0]];for(let e=1;e<c.length;e++){s+=t$X.distance(c[e-1],c[e]),l.push(s)}var h=i.length;i.length/3%2!=0&&(i.push(i[h-1-2]),i.push(i[h-1-1]),i.push(i[h-1]),l.push(l[l.length-1]));var d=ue$3(i),f=d.min,p=d.max;p+=n;var _=t$X.fromDegreesArrayHeights(i),m=h$10.fromCartesianArray(_),$=Math.PI/Math.pow(2,11);$=$/64*o;var g=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)},granularity:$});i=ir(_,m,p);var v=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)}}),y=U$Q.createGeometry(v);if(!y)return!1;var x=U$Q.createGeometry(g),b=U$Q.createGeometry(v),w=U$Q.createGeometry(v),C=[];_.forEach((e=>{C.push(t$W.fromCartesian(e))}));var T={rectangle:m,geometry:y,geometry_extract:x,colorGeometry:b,worldGeometry:w,positions:i,modelMatrix:y$15.fromTranslation(new t$X(i[0],i[1],0),new y$15),command:void 0,name:t,height:f-r,minimumHeight:Math.min(0,f),maximumHeight:p,sideLengths:l,round:s,cartographics:C};return a._extractRegions.set(t,T),a._extractRegionsUpdate=!0,a._extractTransparent=u$Y(e.transparent,!0),a._extractTextureWrap=u$Y(e.textureWrap,q$11.REPEAT),a._extractExtendHeight=n,a._excavateTransparent=u$Y(e.transparent,!0),a._excavateTextureWrap=u$Y(e.textureWrap,q$11.REPEAT),!0},h$a.prototype.removeExtractRegion=function(e){var t=this._surface._tileProvider,i=t._extractRegions;if(i.contains(e)){t._removeExtractCommands(e);var r=i.get(e);e$28(r.command)&&(r.command.vertexArray=r.command.vertexArray&&!r.command.vertexArray.isDestroyed()&&r.command.vertexArray.destroy(),r.command.shaderProgram=r.command.shaderProgram&&!r.command.shaderProgram.isDestroyed()&&r.command.shaderProgram.destroy()),r.command=void 0,i.remove(e),0===i.length&&(t._onceExcavateRegionsEmpty=!0),t._extractRegionsUpdate=!0,r.command=void 0,t._modifyRegions.remove(e),t._modifyRegionUpdate=!0,t._extractExtendHeight=void 0}},h$a.prototype.removeAllExtractRegion=function(){var e=this._surface._tileProvider;e._removeAllExtractCommands();for(var t=Object.keys(e._extractRegions._hash),i=0,r=t.length;i<r;i++){var n=t[i];this.removeExtractRegion(n)}e._extractRegions.removeAll(),e._extractExtendHeight=void 0,e.clearModifyTerrain()},h$a.prototype.setClipGeometry=function(e){var t="ExcavationGeometry",i=e.geometry,r=e.scene;if(!e$28(r)||!e$28(i))return!1;var n=this._surface._tileProvider,o=new p$i(r);o.geometry=i,o.positionMode=j$l.Intersects,o._profile=!0,o._beQueryCollection=new _0x36e54b(r._context);var a={geometry:i,command:void 0,name:t,spatialQuery:o};return n._excavationGeometrys.set(t,a),!0},h$a.prototype.clearClipGeometry=function(){var e=this._surface._tileProvider._excavationGeometrys,t="ExcavationGeometry";if(e.contains(t)){var i=e.get(t);e$28(i.command)&&(i.command.vertexArray=i.command.vertexArray&&!i.command.vertexArray.isDestroyed()&&i.command.vertexArray.destroy(),i.command.shaderProgram=i.command.shaderProgram&&!i.command.shaderProgram.isDestroyed()&&i.command.shaderProgram.destroy()),e$28(i.removeListenerFunc)&&i.removeListenerFunc(),i.command=void 0,e.remove(t)}},h$a.prototype.addImageryClipRegions=function(e){var t=e.name,i=e.position;if(e$28(t)&&e$28(i)&&e$28(e.layers)){var r=this._surface._tileProvider;if(r._imageryClipRegions.contains(t))return!1;var n=new U$Q({polygonHierarchy:{positions:t$X.fromDegreesArrayHeights(i)}}),o=U$Q.createGeometry(n);if(!o)return!1;for(var a=U$Q.createGeometry(n),s=t$X.fromDegreesArrayHeights(i),l={rectangle:h$10.fromCartesianArray(s),geometry:o,worldGeometry:a,positions:i,modelMatrix:y$15.fromTranslation(new t$X(i[0],i[1],0),new y$15),command:void 0,name:t},u=0,c=e.layers.length;u<c;u++)e.layers[u].enableImageryClip=!0;r._imageryClipRegions.set(t,l),r._imageryClipRegionUpate=!0}},h$a.prototype.removeImageryClipRegion=function(e,t){var i=this._surface._tileProvider,r=i._imageryClipRegions;if(r.contains(e)){var n=r.get(e);if(e$28(n.command)&&(n.command.vertexArray=n.command.vertexArray&&!n.command.vertexArray.isDestroyed()&&n.command.vertexArray.destroy(),n.command.shaderProgram=n.command.shaderProgram&&!n.command.shaderProgram.isDestroyed()&&n.command.shaderProgram.destroy()),n.command=void 0,r.remove(e),0===r.length){for(var o=0,a=t.length;o<a;o++)t[o].enableImageryClip=!1;i._onceImageryClipRegionsEmpty=!0}i._imageryClipRegionUpate=!0}},h$a.prototype.clearCustomClipBox=function(){this.clippingPlanes=void 0},h$a.prototype.setCustomClipBox=function(e){if(!(e.dimensions&&e.position||e.planePos&&e.planeNormal))throw new t$Z("globe box clip, position and dimensions is required!");if(e.dimensions){var t,i=e.position,r=new i$10(e$28(e.heading)?e.heading:0,e$28(e.pitch)?e.pitch:0,e$28(e.roll)?e.roll:0);if(this._sceneMode===P$$.SCENE3D)t=m$1b.headingPitchRollToFixedFrame(i,r,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,new y$15);else{var n=ar(this._scene,i);t=y$15.setTranslation(y$15.clone(y$15.IDENTITY),n,new y$15)}var o=-.5*e.dimensions.x,a=-.5*e.dimensions.y,s=-.5*e.dimensions.z;e$28(e.clipLineColor)?e.clipLineColor:e$1S.WHITE;var l=[new a$D(new t$X(1,0,0),o),new a$D(new t$X(-1,0,0),o),new a$D(new t$X(0,1,0),a),new a$D(new t$X(0,-1,0),a),new a$D(new t$X(0,0,1),s),new a$D(new t$X(0,0,-1),s)]}else{l=[];for(var u=0;u<e.planePos.length;u++){var c=e.planePos[u],h=e.planeNormal[u],d=-t$X.dot(h,c);l.push(new a$D(h,d))}}return this.clippingPlanes=new h$C({modelMatrix:t,planes:l,edgeWidth:1,edgeColor:e$1S.WHITE,unionClippingRegions:!e$28(e.dimensions),enabled:!0}),!0},h$a.prototype.setPolygonOffset=function(e,t){0!=e||0!=t?(this._surface._tileProvider._polygonOffset.enabled=!0,o$1k.fromElements(e,t,this._surface._tileProvider._polygonOffset.value)):(this._surface._tileProvider._polygonOffset.enabled=!1,o$1k.fromElements(0,0,this._surface._tileProvider._polygonOffset.value))},h$a.prototype.hasTerrainAnalysis=function(){if(!e$28(this._surface)||!e$28(this._surface._tileProvider))return!1;var e=this._surface._tileProvider;return!!(e$28(e._excavateRegions)&&e._excavateRegions.values.length>0||e$28(e._modifyRegions)&&e._modifyRegions.values.length>0||e$28(e._hypsometricSetting)&&e._hypsometricSetting.CoverageArea.length>0||e$28(e._slopeSetting)&&e._slopeSetting.CoverageArea.length>0)},h$a.prototype.getSlopeValue=function(e){var t=he$3(e,this);return t?Math.acos(Math.abs(t.z))*e$27.DEGREES_PER_RADIAN:0},h$a.prototype.getSlopeDirectionValue=function(e){var t=he$3(e,this);if(!t)return 0;t.z=0;var i=t$X.angleBetween(t,t$X.UNIT_Y);return i=i/e$27.PI*180,i=t$X.dot(t,t$X.UNIT_X)<0?360-i:i},h$a.prototype.setPBRMaterialFromJSON=function(e){if(LicenseChecker.LICENSECHECKER.verify("Globe_setPBRMaterial"),this._surface.tileProvider._pbrParameter===je$b.NONE){var t=this;u$O(e).then((function(e){var i=e.material,r=i.pbrMetallicRoughness;i.textureunitstates,t._surface.tileProvider._PBRMaterialParams.baseColorFactor=e$28(r.baseColor)?e$25.fromElements(r.baseColor.x,r.baseColor.y,r.baseColor.z,r.baseColor.w):t._surface.tileProvider._PBRMaterialParams.baseColorFactor,t._surface.tileProvider._PBRMaterialParams.baseColorTextureIndex=e$28(r.baseColorTextureIndex)?r.baseColorTextureIndex:t._surface.tileProvider._PBRMaterialParams.baseColorTextureIndex,t._surface.tileProvider._PBRMaterialParams.emissionFactor=e$28(r.emissiveFactor)?t$X.fromElements(r.emissiveFactor.x,r.emissiveFactor.y,r.emissiveFactor.z):t._surface.tileProvider._PBRMaterialParams.emissionFactor,t._surface.tileProvider._PBRMaterialParams.emissionTextureIndex=e$28(r.emissiveTextureIndex)?r.emissiveTextureIndex:-1,t._surface.tileProvider._PBRMaterialParams.metallic=e$28(r.metallicFactor)?r.metallicFactor:t._surface.tileProvider._PBRMaterialParams.metallic,t._surface.tileProvider._PBRMaterialParams.roughness=e$28(r.roughnessFactor)?r.roughnessFactor:t._surface.tileProvider._PBRMaterialParams.roughness,t._surface.tileProvider._PBRMaterialParams.occlusionTextureIndex=e$28(r.occlusionTextureIndex)?r.occlusionTextureIndex:-1,t._surface.tileProvider._PBRMaterialParams.normalTextureIndex=e$28(r.normalTextureIndex)?r.normalTextureIndex:-1}))}},h$a.prototype.removePBRMaterial=function(){this._surface.tileProvider._PBRMaterialParams={metallic:0,roughness:0,baseColorFactor:new e$25(1,1,1,1),baseColorTextureIndex:-1,emissionFactor:t$X.UNIT_XYZ,emissionTextureIndex:-1,occlusionTextureIndex:-1,normalTextureIndex:-1}},h$a.prototype._setFloodTexture=function(e,t){this._floodFlagTexture=e,this._floodRect=t},h$a.prototype._removeFloodTexture=function(){this._floodFlagTexture=void 0,this._floodRect=void 0},h$a.prototype.removeRasterRegions=function(){var e=this._surface._tileProvider,t=e._clipRasterTilesMap;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];r._clipRasterTexture=r._clipRasterTexture&&!r._clipRasterTexture.isDestroyed()&&r._clipRasterTexture.destroy(),r._clipRasterFbo=r._clipRasterFbo&&!r._clipRasterFbo.isDestroyed()&&r._clipRasterFbo.destroy(),r._clipRegionsCount=0,r._clipRegionRasterized=!1}e._clipRasterTilesMap={}},Object.defineProperties(o$l.prototype,{framebuffer:{get:function(){return this._isMSAA?this._framebufferWithRenderbuffer:this._framebufferWithTexture}},framebufferWithTexture:{get:function(){return this._framebufferWithTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}}),o$l.prototype.executeDebugGlobeDepth=function(e,t,i){B$7(this,e,t,i)},o$l.prototype.update=function(e,t,i,r){var n=i.width,o=i.height;b$i(this,e,n,o,r),l$d(this,e,n,o,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r},o$l.prototype.executeCopyDepth=function(e,t){e$28(this._copyDepthCommand)&&(this.copyFromRenderbufferToTexture(e,!1,!0,!1),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},o$l.prototype.executeUpdateDepth=function(e,t,i){var r=t.framebuffer.depthStencilTexture;if(!e$28(r)||!i&&r===this._depthStencilTexture)if(this._isMSAA&&i){if(e$28(this._updateDepthCommand)){if(!e$28(this._updateDepthFramebuffer)||this._updateDepthFramebuffer.getColorTexture(0)!==this._globeDepthTexture){n=this._globeDepthTexture.width,o=this._globeDepthTexture.height;y$f(this),P$c(this,e,n,o,t),l$d(this,e,n,o,t)}this.copyFromRenderbufferToTexture(e,!1,!0,!1),this._tempCopyDepthTexture=this._depthStencilTexture,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture}}else e$28(this._copyDepthCommand)&&(this.copyFromRenderbufferToTexture(e,!1,!0,!1),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture);else if(e$28(this._updateDepthCommand)){if(!e$28(this._updateDepthFramebuffer)||this._updateDepthFramebuffer.depthStencilTexture!==r||this._updateDepthFramebuffer.getColorTexture(0)!==this._globeDepthTexture){var n=this._globeDepthTexture.width,o=this._globeDepthTexture.height;y$f(this),P$c(this,e,n,o,t),l$d(this,e,n,o,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture}},o$l.prototype.executeCopyColor=function(e,t){e$28(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},o$l.prototype.copyFromRenderbufferToTexture=function(e,t,i,r){this._isMSAA&&a$z.copyFromFramebufferToFramebuffer(e,this._framebufferWithRenderbuffer,this._framebufferWithTexture,t,i,r)},o$l.prototype.clear=function(e,t,i){var r=this._clearColorCommand;e$28(r)&&(e$1S.clone(i,r.color),r.execute(e,t))},o$l.prototype.isDestroyed=function(){return!1},o$l.prototype.destroy=function(){G$e(this),O$b(this),M$d(this),y$f(this),e$28(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),e$28(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return e$28(e)&&(e.shaderProgram=e.shaderProgram.destroy()),i$Z(this)},v$d.prototype.isReady=function(){return!0},v$d.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(h$9.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return 0}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new t$Z("tileDiscardPolicy must not be called before the imagery provider is ready.");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}}}),h$9.prototype.getTileCredits=function(e,t,i){if(!this._ready)throw new t$Z("getTileCredits must not be called before the imagery provider is ready.");var r=this._metadata,n=r.getTileInformation(e,t,i);if(e$28(n)){var o=r.providers[n.imageryProvider];if(e$28(o))return[o]}},h$9.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=this._tileDiscardPolicy._image,o=this._metadata,a=c$T.tileXYToQuadKey(e,t,i),s=o.getTileInformation(e,t,i);if(!e$28(s)){if(o.isValid(a)){var l=new r$1c({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction});return void o.populateSubtree(e,t,i,l)}return n}if(!s.hasImagery())return n;var u=j$c(this,s,e,t,i,r).fetchArrayBuffer();return e$28(u)?u.then((function(e){f$Z(o.key,e);var t,i=new Uint8Array(e),r=o.protoImagery;if((!e$28(r)||!r)&&(t=x$c(i)),!e$28(t)&&(!e$28(r)||r)){var a=F$9(i);t=a.imageType,i=a.imageData}return e$28(t)&&e$28(i)?w$B({uint8Array:i,format:t,flipY:!0}):n})):void 0},h$9.prototype.pickFeatures=function(e,t,i,r,n){};var f$f=new e$1S(1,1,1,.4),m$g=new e$1S(0,1,0,.05),v$c=new e$1S(0,.5,0,.2);function o$k(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._tilingScheme=e$28(e.tilingScheme)?e.tilingScheme:new g$14({ellipsoid:e.ellipsoid}),this._cells=u$Y(e.cells,8),this._color=u$Y(e.color,f$f),this._glowColor=u$Y(e.glowColor,m$g),this._glowWidth=u$Y(e.glowWidth,6),this._backgroundColor=u$Y(e.backgroundColor,v$c),this._errorEvent=new o$1o,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._canvasSize=u$Y(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=o$1q.resolve(!0)}Object.defineProperties(o$k.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}}}),o$k.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()},o$k.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);var n=this._glowColor.toCssColorString();i.strokeStyle=n,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);var o=this._color.toCssColorString();return i.strokeStyle=o,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},o$k.prototype.getTileCredits=function(e,t,i){},o$k.prototype.requestImage=function(e,t,i,r){return this._canvas},o$k.prototype.pickFeatures=function(e,t,i,r,n){};var y$e={None:0,Attribute:1,Slope:2,Aspect:3};function w$a(e){e=u$Y(e,{}),this._url=e.url+"/",this._useConfigFile=u$Y(e.useConfigFile,!0),this._compressType="NONE",this._tilingScheme=void 0,this._rectangle=void 0,this._levels=[],this._maxCategory=90,this._minCategory=0,this._dataType=y$e.NONE;var t=e.credit;"string"==typeof t&&(t=new Credit(t)),this._credit=t,this._ready=!1,this._readyPromise=o$1q.defer();var i,r=u$Y(e.ellipsoid,t$V.WGS84),n=this;function o(e){n._compressType=e.getElementsByTagName("sml:CompressType")[0].textContent;var t=e.getElementsByTagName("sml:Type")[0].textContent;"Slope"==t?n._dataType=y$e.Slope:"Aspect"==t?n._dataType=y$e.Aspect:"Attribute"==t&&(n._dataType=y$e.Attribute),n._cellWidth=parseInt(e.getElementsByTagName("sml:CellWidth")[0].textContent),n._cellHeight=parseInt(e.getElementsByTagName("sml:CellHeight")[0].textContent),n._maxCategory=parseInt(e.getElementsByTagName("sml:MaxHeight")[0].textContent),n._minCategory=parseInt(e.getElementsByTagName("sml:MinHeight")[0].textContent),n._tilingScheme=new g$14({ellipsoid:r}),n._tilingScheme.isSct=!0;var i=e.getElementsByTagName("sml:Bounds")[0],o=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Left")[0].textContent)),a=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Bottom")[0].textContent)),s=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Right")[0].textContent)),l=e$27.toRadians(parseFloat(i.getElementsByTagName("sml:Top")[0].textContent));n._rectangle=new h$10(o,a,s,l);for(var u=e.getElementsByTagName("sml:Levels")[0].getElementsByTagName("sml:Level"),c=0;c<u.length;++c){var h=u[c];n._levels.push(parseInt(h.textContent))}n._ready=!0,n._readyPromise.resolve(!0)}function a(e){var t=u$Y(e,"An error occurred while accessing "+n._url+".");i=TileProviderError.handleError(i,n,n._errorEvent,t,void 0,void 0,void 0,s),n._readyPromise.reject(new RuntimeError(t))}function s(){if(!e$28(e.rectangle)||!e$28(e.levels))throw new t$Z("options.rectangles,options.levels is required.");n._compressType=u$Y(e.compressType,"ZIP"),n._attType=y$e.SLOPE,n._cellWidth=u$Y(e._cellWidth,32),n._cellHeight=u$Y(e._cellHeight,32),n._maxCategory=u$Y(e.maxCategory,90),n._minCategory=u$Y(e.minCategory,0),n._tilingScheme=new g$14({ellipsoid:r}),n._rectangle=e.rectangle,n._levels=e.levels}this._useConfigFile?o$1q(d$17(n._url+"config"),o,a):s(),this._styleEngine=new e$N}Object.defineProperties(w$a.prototype,{url:{get:function(){return this._url}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){if(!this.ready)throw new t$Z("requestTileGeometry must not be called before ready returns true.");return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},errorEvent:{get:function(){return this._errorEvent}},cellWidth:{get:function(){return this._cellWidth}},cellHeight:{get:function(){return this._cellHeight}},minLevel:{get:function(){return this._levels.length>0?Math.min(this._levels[0],this._levels[this._levels.length-1]):-1}},maxLevel:{get:function(){return this._levels.length>0?Math.max(this._levels[0],this._levels[this._levels.length-1]):-1}},minCategory:{get:function(){if(!this._ready)throw new t$Z("minCategory must not be called before the grid provider is ready");return this._minCategory}},maxCategory:{get:function(){if(!this._ready)throw new t$Z("maxCategory must not be called before the grid provider is ready");return this._maxCategory}}}),w$a.prototype.getTileCredits=function(e,t,i){};var W$d=new h$10;function R$c(e,t){var r,n;if(2===(r="ZIP"===e._compressType?nt$c.inflate(t).buffer:t[i]).byteLength/(e._cellWidth*e._cellHeight)){var o=new Int16Array(r,0,e._cellWidth*e._cellHeight);n=[];for(var a=0;a<o.length;a++)n.push(parseFloat(o[a]))}else n=new Float32Array(r,0,e._cellWidth*e._cellHeight);return n}function o$j(e){e=u$Y(e,{}),this._height=this._width=u$Y(e.quality,2048);var t=u$Y(e.intensityRange,new o$1k(0,1));this._minIntensity=t.x,this._maxIntensity=t.y,this._context=e.context,this._bounds=e.bounds,this._fbIntensity=void 0,this._intensityCommand=void 0,this._heatMapCommand=void 0,this._sp=void 0,this._va=void 0,this._vertexSize=8,this._maxPointCount=1e4,this._pointCount=0,this._bufferIndex=0,this._vertexBufferData=new Float32Array(this._maxPointCount*this._vertexSize*6),this._vertexBufferViews=[];for(var i=this._maxPointCount,r=0;r<i;r++)this._vertexBufferViews.push(new Float32Array(this._vertexBufferData.buffer,0,r*this._vertexSize*6));this._clearCommand=new r$11({color:new e$1S(0,0,0,0)}),this._data=void 0,this._dataIndex=0,this._fbHeatMap=x$b(this._context,this._width,this._height,y$U.UNSIGNED_BYTE),this._clearCommand.framebuffer=this._fbHeatMap,this._clearCommand.execute(this._context),this._maxPerFrameDrawCount=5e3}function x$b(e,t,i,r){return new a$z({context:e,colorTextures:[new L$17({context:e,width:t,height:i,pixelDatatype:r})]})}function R$b(e,t){if(!e$28(t._sp)){var i=new a$$({sources:[["attribute vec4 aPosition;","attribute vec4 aIntensity;","varying vec2 vOff;","varying vec2 vDim;","varying float vIntensity;","uniform vec4 uBounds;","void main()","{","vDim = abs(aPosition.zw);","vOff = aPosition.zw;","vec2 pos = aPosition.xy + aPosition.zw;","vIntensity = aIntensity.x;","gl_Position = vec4(((pos - uBounds.xy) / uBounds.zw) * 2.0 - 1.0, 0.0, 1.0);","}"].join("\n")]}),r=new a$$({sources:[["varying vec2 vOff;","varying vec2 vDim;","varying float vIntensity;","void main()","{","float falloff = (1.0 - smoothstep(0.0, 1.0, length(vOff/vDim)));","float intensity = falloff*vIntensity;","gl_FragColor = vec4(intensity);","}"].join("\n")]});t._sp=S$T.fromCache({context:e,vertexShaderSource:i,fragmentShaderSource:r,attributeLocations:{aPosition:0,aIntensity:1}})}}function T$c(e,t){if(!e$28(t._va)){var i=t._vertexBufferViews[t._pointCount],r=h$W.createVertexBuffer({context:e,typedArray:i,usage:A$1c.STREAM_DRAW}),n=[{index:0,vertexBuffer:r,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:32,normalize:!1},{index:1,vertexBuffer:r,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,offsetInBytes:16,strideInBytes:32,normalize:!1}];t._va=new m$19({context:e,attributes:n})}}function S$7(e,t){var i=new r$15({primitiveType:W$_.TRIANGLES,count:6*t._pointCount});T$c(e,t),R$b(e,t),i.vertexArray=t._va,i.shaderProgram=t._sp,i.renderState=u$R.fromCache({depthTest:{enabled:!1},viewport:new f$10(0,0,t._width,t._height),blending:{enabled:!0,functionDestinationRgb:de$y.ONE,functionDestinationAlpha:de$y.ONE}});var r=new e$25(t.bounds.x,t.bounds.y,t.bounds.width,t.bounds.height);return i.uniformMap={uBounds:function(){return r}},i.framebuffer=t._fbIntensity,i}function V$a(e,t){var i=["uniform sampler2D uIntensityTexture;","varying vec2 v_textureCoordinates;","float linstep(float low, float high, float value) {","return clamp((value-low)/(high-low), 0.0, 1.0);","}","float fade(float low, float high, float value){","float mid = (low+high)*0.5;","float range = (high-low)*0.5;","float x = 1.0 - clamp(abs(mid-value)/range, 0.0, 1.0);","return smoothstep(0.0, 1.0, x);","}","vec3 getColor(float intensity){","vec3 blue = vec3(0.0, 0.0, 1.0);","vec3 cyan = vec3(0.0, 1.0, 1.0);","vec3 green = vec3(0.0, 1.0, 0.0);","vec3 yellow = vec3(1.0, 1.0, 0.0);","vec3 red = vec3(1.0, 0.0, 0.0);","vec3 color = fade(-0.25, 0.25, intensity)*blue + fade(0.0, 0.5, intensity)*cyan + fade(0.25, 0.75, intensity)*green + fade(0.5, 1.0, intensity)*yellow + smoothstep(0.75, 1.0, intensity)*red;","return color;","}","vec4 alphaFun(vec3 color, float intensity){","float alpha = smoothstep(0.0, 1.0, intensity);","return vec4(color*alpha, alpha);","}","void main(){","float intensity = smoothstep(0.0, 1.0, texture2D(uIntensityTexture, v_textureCoordinates).r);","vec3 color = getColor(intensity);","gl_FragColor = alphaFun(color, intensity);","}"].join("\n"),r=e.createViewportQuadCommand(i,{uniformMap:{uIntensityTexture:function(){return t._fbIntensity.getColorTexture(0)}},renderState:u$R.fromCache({viewport:new f$10(0,0,t._width,t._height),blending:{enabled:!0,functionDestinationRgb:de$y.ONE,functionDestinationAlpha:de$y.ONE}}),owner:t});return r.framebuffer=t._fbHeatMap,r}function H$d(e){if(e$28(e._va)){var t=e._va.getAttribute(0).vertexBuffer,i=t._getBuffer(),r=t._gl;r.bindBuffer(de$y.ARRAY_BUFFER,i),r.bufferData(de$y.ARRAY_BUFFER,e._vertexBufferViews[e._pointCount],A$1c.STREAM_DRAW),r.bindBuffer(de$y.ARRAY_BUFFER,null)}}function t$7(){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 r$11({color:new e$1S(0,0,0,0),owner:this}),this._clearCommand=new r$11({color:new e$1S(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}}}w$a.prototype._requestGridTile=function(e,t,i,r){if(!this.ready)throw new t$Z("requestTileGrid must not be called before ready returns true.");var n=[],o=this._tilingScheme.tileXYToRectangle(e,t,i),a=this;if(this._levels[this._levels.length-1],e$28(h$10.intersection(this._rectangle,o,W$d))){var s=this._levels[0],l=i;if(l<=this._levels[this._levels.length-1]&&l>=s){var u=i+"_"+e+"_"+t,c=a._url+"data/index/"+t+"/"+e+".bil?level="+l,h=o$$(c);e$28(h)&&(h.id=u,h.url=c,n.push(h))}}return o$1q.all(n,(function(e){for(var t=0;t<e.length;t++){return R$c(a,e[t])}}),(function(e){return o$1q.reject(e)}))},Object.defineProperties(o$j.prototype,{texture:{get:function(){return this._fbHeatMap.getColorTexture(0)}},bounds:{set:function(e){this._bounds=e},get:function(){return this._bounds}},maxPerFrameDrawCount:{set:function(e){this._maxPerFrameDrawCount=e},get:function(){return this._maxPerFrameDrawCount}}}),o$j.prototype.addVertex=function(e,t,i,r,n){this._vertexBufferData[this._bufferIndex++]=e,this._vertexBufferData[this._bufferIndex++]=t,this._vertexBufferData[this._bufferIndex++]=i,this._vertexBufferData[this._bufferIndex++]=r,this._vertexBufferData[this._bufferIndex++]=n,this._vertexBufferData[this._bufferIndex++]=n,this._vertexBufferData[this._bufferIndex++]=n,this._vertexBufferData[this._bufferIndex++]=n},o$j.prototype.addPoint=function(e,t,i,r){this._pointCount>=this._maxPointCount-1&&this.draw(this._context),r=u$Y(r,50),i=u$Y(i,.2);var n=.5*r;this.addVertex(e,t,-n,-n,i),this.addVertex(e,t,+n,-n,i),this.addVertex(e,t,-n,+n,i),this.addVertex(e,t,-n,+n,i),this.addVertex(e,t,+n,-n,i),this.addVertex(e,t,+n,+n,i),this._pointCount++},o$j.prototype.setData=function(e){this._data=e},o$j.prototype.drawIntensity=function(e){e$28(this._fbIntensity)||(this._fbIntensity=x$b(e,this._width,this._height,y$U.HALF_FLOAT)),e$28(this._intensityCommand)||(this._intensityCommand=S$7(e,this)),this._intensityCommand.count=6*this._pointCount,H$d(this),this._intensityCommand.execute(e)},o$j.prototype.drawHeatMap=function(e){this._clearCommand.framebuffer=this._fbHeatMap,this._clearCommand.execute(e),e$28(this._heatMapCommand)||(this._heatMapCommand=V$a(e,this)),this._heatMapCommand.execute(e)},o$j.prototype.draw=function(e){this.drawIntensity(e),this.drawHeatMap(e),this._bufferIndex=0,this._pointCount=0},o$j.prototype.update=function(e){if(this._context=e.context,e$28(this._data)){for(var t=Math.min(this._data.length,this._dataIndex+this._maxPerFrameDrawCount),i=.002*this._bounds.width,r=this._dataIndex;r<t;r++){var n=this._data[r];n.x,n.y;var o=u$Y(n.intensity,.1);o=(o-this._minIntensity)/this._maxIntensity,this.addPoint(n.x,n.y,o,i)}this._dataIndex=t,this._dataIndex>=this._data.length&&(this._data=void 0,this._dataIndex=0)}this._pointCount<1||this.draw(e.context)},o$j.prototype.destroy=function(){return this._fbIntensity=this._fbIntensity&&this._fbIntensity.destroy(),this._fbHeatMap=this._fbHeatMap&&this._fbHeatMap.destroy(),this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy(),this._vertexBufferData=void 0,this._vertexBufferViews=void 0,this._data=void 0,i$Z(this)},Object.defineProperties(t$7.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),t$7.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var I$b={depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.KEEP},backFunction:m$12.NEVER,reference:0,mask:Fa$6.CLASSIFICATION_MASK},blending:Ee$n.ALPHA_BLEND},L$e={depthMask:!1,stencilTest:{enabled:!0,frontFunction:m$12.NOT_EQUAL,frontOperation:{fail:n$12.KEEP,zFail:n$12.KEEP,zPass:n$12.KEEP},backFunction:m$12.NEVER,reference:0,mask:Fa$6.CLASSIFICATION_MASK},blending:Ee$n.ALPHA_BLEND},N$9={depthMask:!0,depthTest:{enabled:!0},stencilTest:Fa$6.setCesium3DTileBit(),stencilMask:Fa$6.CESIUM_3D_TILE_MASK,blending:Ee$n.ALPHA_BLEND},M$c="#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",U$b="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";function n$e(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function o$i(e){if(e$28(e)&&e.length!==i$B.NUMBER_OF_JOB_TYPES)throw new t$Z("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");var t=new Array(i$B.NUMBER_OF_JOB_TYPES);t[i$B.TEXTURE]=new n$e(e$28(e)?e[i$B.TEXTURE]:10),t[i$B.PROGRAM]=new n$e(e$28(e)?e[i$B.PROGRAM]:10),t[i$B.BUFFER]=new n$e(e$28(e)?e[i$B.BUFFER]:30);var i,r=t.length,n=0;for(i=0;i<r;++i)n+=t[i].total;var o=new Array(r);for(i=0;i<r;++i)o[i]=!1;this._totalBudget=n,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}t$7.prototype.update=function(e){var t=this._texture,i=!e$28(t)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var r,n,o=e.drawingBufferWidth,a=e.drawingBufferHeight,s=!e$28(t)||t.width!==o||t.height!==a;((s||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 L$17({context:e,width:o,height:a,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}),e$28(this._previousFramebuffer)||(this._classifiedTexture=new L$17({context:e,width:o,height:a,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}),this._depthStencilTexture=new L$17({context:e,width:o,height:a,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8}))),!e$28(this._fbo)||s||i)&&(this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy(),e$28(this._previousFramebuffer)?(r=this._previousFramebuffer.depthStencilTexture,n=this._previousFramebuffer.depthStencilRenderbuffer):r=this._depthStencilTexture,this._fbo=new a$z({context:e,colorTextures:[this._texture],depthStencilTexture:r,depthStencilRenderbuffer:n,destroyAttachments:!1}),e$28(this._previousFramebuffer)||(this._fboClassified=new a$z({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:r,destroyAttachments:!1})));if(e$28(this._rsUnclassified)||(this._rsUnclassified=u$R.fromCache(I$b),this._rsClassified=u$R.fromCache(L$e),this._rsDefault=u$R.fromCache(N$9)),!e$28(this._unclassifiedCommand)||i){e$28(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());var l=e$28(this._previousFramebuffer)?U$b:M$c,u=new a$$({defines:["UNCLASSIFIED"],sources:[l]}),c=new a$$({sources:[l]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:e$28(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(c,{renderState:e$28(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),e$28(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),e$28(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(V$b,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},t$7.prototype.clear=function(e,t){var i=t.framebuffer;e$28(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},t$7.prototype.executeClassified=function(e,t){if(!e$28(this._previousFramebuffer)){var i=t.framebuffer;t.framebuffer=this._fboClassified,this._translucentCommand.execute(e,t),t.framebuffer=i}this._classifiedCommand.execute(e,t)},t$7.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},t$7.prototype.isDestroyed=function(){return!1},t$7.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(),e$28(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i$Z(this)},Object.defineProperties(n$e.prototype,{total:{get:function(){return this._total}}}),o$i.getTimestamp=kt$7,Object.defineProperties(o$i.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),o$i.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},o$i.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},o$i.prototype.execute=function(e,t){var i,r=this._budgets,n=r[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return n.starvedThisFrame=!0,!1;if(n.usedThisFrame+n.stolenFromMeThisFrame>=n.total){var a,s=r.length;for(a=0;a<s&&(!((i=r[a]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++a);if(a===s&&o)return!1;o&&(n.starvedThisFrame=!0)}var l=o$i.getTimestamp();e.execute();var u=o$i.getTimestamp()-l;return this._totalUsedThisFrame+=u,i?i.stolenFromMeThisFrame+=u:n.usedThisFrame+=u,this._executedThisFrame[t]=!0,!0};const T$b=1048576;var h$8=function(){this._layers=new e$1P,this._layerQueue=[],this._layerIndex=3,this._selectedLayer=void 0,this._clampLayerIndex=Number.MAX_VALUE,this._allTextOverlap=[],this._lastId2RectangleCount=0,this._s3mLayerAddedIndex=0,this._processingTiles=[],this._replacementList=new h$P,this._replacementSentinel=this._replacementList.add(),this._maxMemory=2048,this._maxMemoryInBytes=this._maxMemory*T$b,this._cacheBytes=this._maxMemory*T$b};Object.defineProperties(h$8.prototype,{layerQueue:{get:function(){return this._layerQueue}}}),h$8.prototype._setCacheMemory=function(e){this._cacheBytes=e*T$b},h$8.prototype._setMaxMemory=function(e){this._maxMemory=e,this._maxMemoryInBytes=this._maxMemory*T$b};var P$b=function(e,t){return e.priority-t.priority},F$8=function(e,t){return e._disFromCamera-t._disFromCamera};function O$a(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];i._adjustedLodRangeScale=Math.min(1.02*i._adjustedLodRangeScale,1e4)}}function z$a(e){for(let t=0,i=e.length;t<i;t++){const i=e[t];i._adjustedLodRangeScale=Math.max(i._adjustedLodRangeScale/1.02,i._lodRangeScale)}}h$8.prototype._processTiles=function(e){const t=e.context;e.processingTiles.sort(F$8);const i=this._maxMemoryInBytes,r=i+.5*i,n=e.processingTiles;let o=!1;for(let t=0,i=n.length;t<i;t++){const i=n[t];o=i.transformResource(e,i.layer,r)}const a=this._layerQueue;t.memorySize<i?z$a(a):o&&n.length>0&&O$a(a),this._processingTiles.length=0};var A$e=0;function D$d(e,t,i){if((t=e$27.clamp(t,0,e.length-1))===(i=e$27.clamp(i,0,e.length-1)))return!1;var r=e[t];return e[t]=e[i],e[i]=r,!0}function r$g(){}h$8.prototype.update=function(e,t,i,r){this._frameState=t,_0x2dd764.update(e);var n=this._layerQueue,o=this._layerQueue.length;this._replacementList.splice(this._replacementList.tail,this._replacementSentinel),t.replacementList=this._replacementList,t.processingTiles=this._processingTiles;var a=0,s=[];for(a=0;a<o;a++){var l=n[a];if(e$28(l)){if(l instanceof _0x2564e5)for(var u=n[a],c=0;c<u._s3mLayers._array.length;c++){if(l=u._s3mLayers._array[c],t.multiViewportIndex>-1)if(!l.getVisibleInViewport(t.multiViewportIndex))continue;if(e$28(r)&&!0===r){if(l._fileType===f$r.IconPoint||l._fileType===f$r.Text){l.update(e,t,i,r);continue}if(l._fileType!=f$r.ClampGroundRealtimeRasterCache){if(t.multiViewportIndex>-1&&!l.getVisibleInViewport(t.multiViewportIndex))continue;continue}s.push(l.id)}}if(l=n[a],t.multiViewportIndex>-1)if(!l.getVisibleInViewport(t.multiViewportIndex))continue;if(e$28(r)&&!0===r){if(l._fileType!=f$r.ClampGroundRealtimeRasterCache){if(t.multiViewportIndex>-1&&!l.getVisibleInViewport(t.multiViewportIndex))continue;continue}s.push(l.id)}else if(l._fileType===f$r.ClampGroundRealtimeRasterCache)continue;var h=t._fboState.frameBufferType;if(h==L$T.NORMAL_AND_DEPTH){if(!e$28(l._wireFrameType)||!l.isSilhouette())continue}else if(h==L$T.POSTEFFECT_FILTER){if(!e$28(l.bloomEnable)||!l.bloomEnable)continue}else if(!(h!=L$T.CLAMP||e$28(l._section)&&l._section))continue;l.update(e,t,i)}}f$q.update(e),to.update(e.memorySize),t.requests.sort(P$b);var d=performance.now();for(a=0,c=t.requests.length;a<c;a++){var f=t.requests[a];if(f.owner.loadEntity(f.entity),performance.now()-d>5)break;if(f.owner.LoadingPriority===U$p.UsePagedLodInfo&&0==a){var p=d-A$e;if(A$e=d,p>25)break;p>20&&(c=Math.min(3,t.requests.length))}}return t.requests.length=0,this._processTiles(t),s},h$8.prototype.postPassesUpdate=function(e){var t=this._layerQueue,i=t.length;for(let r=0;r<i;r++){const i=t[r];e$28(i.postPassesUpdate)&&i.postPassesUpdate(e)}},h$8.prototype.updateTextVisible=function(e,t){if(0!=this._allTextOverlap.length){for(var i=this._layerQueue,r=this._layerQueue.length,n=0;n<r;n++){var o=i[n];(o._fileType===f$r.Text||o._fileType===f$r.IconPoint)&&_0x1e730b.addPotentialVisibiltyChangedLayer(o.name)}var a=t.camera._scene.overlapDisplayOptions,s=a&&a.allowIconWithTextDisplay,l=t.camera._scene._overlapDisplayedThreshold;_0x1e730b.meetVisible(this._allTextOverlap,l,s),_0x1e730b.setVisibiltyChangedToLayer(this,s),_0x1e730b.resetVisibleChangedQueue(),this._allTextOverlap=[]}},h$8.prototype._freeResource=function(e){for(var t=e.context,i=this._replacementList.head,r=this._cacheBytes;i!==this._replacementSentinel&&t.memorySize>r&&e$28(i)&&e$28(i.item);){var n=i.item,o=n.layer;if(i=i.next,this._replacementList.remove(n._replacementNode),n._isRootTile&&o.residentRootTile)n._replacementNode=null;else{var a={geoSize:0,texSize:0};n.memoryUsageEx(a),to._memGeometryRemoved(a.geoSize),n.destroy(e,!1)}}},h$8.prototype.endFrame=function(e){if(Se$8.GetUnusedSize()>0&&Se$8.DeleteUnusedTextures(),e.lightSource.hasChange()){var t=e.lightSource._changedLightList._hash;this.lightSourceChanged(t),e.lightSource.resetChange()}for(var i=this._layerQueue,r=this._layerQueue.length,n=performance.now(),o=0;o<r;o++){var a=i[o];if(a instanceof _0x2564e5){var s=a._scene.context;for(let e=0;e<a._s3mLayers.length;e++){var l=a._s3mLayers.values[e];e$28(s._subTextureManager)&&s._subTextureManager.processRequests(l)}}else a._isS3MBlock&&a._context._subTextureManager&&a._context._subTextureManager.processRequests(a);if(performance.now()-n>5)break}_0x333f13.processTasks(),!e.passes.offscreen&&e.multiViewportIndex<1&&this._freeResource(e)},h$8.prototype.render=function(e,t){var i=this._layerQueue,r=this._layerQueue.length,n=0;for(n=0;n<r;n++){var o=i[n];if(e$28(o)){if(t.multiViewportIndex>-1)if(!o.getVisibleInViewport(t.multiViewportIndex))continue;o.render(e,t)}}},h$8.prototype._setSelection=function(e){var t=e.primitive.id,i=e.id,r=e.skeletonId,n=this._layerQueue,o=this._layerQueue.length,a=0,s=void 0;for(a=0;a<o;a++){var l=n[a];l instanceof _0x2564e5?l.setSelection(i,r,t,e.primitive.name)&&(s=l):l.id===t&&l.selectEnabled?(l.setSelection(i,r),s=l):l.releaseSelection()}s instanceof _0x2564e5||this.setSelectedLayer(s)},h$8.prototype.releaseSelection=function(){var e=this._layerQueue,t=this._layerQueue.length,i=0;for(i=0;i<t;i++){var r=e[i];!e$28(r)||r.releaseSelection()}this.setSelectedLayer(void 0)},h$8.prototype.find=function(e){if(!e$28(e))throw new t$Z("name is required.");var t=this._layers.get(e);if(!e$28(t))for(var i=this._layerQueue,r=this._layerQueue.length,n=0;n<r;n++){var o=i[n];if(o instanceof _0x2564e5)for(var a=i[n],s=0;s<a._s3mLayers._array.length;s++)if((o=a._s3mLayers._array[s]).name===e){t=o;break}}return t},h$8.prototype.findByIndex=function(e){if(!e$28(e))throw new t$Z("index is required.");if(e>this._layerQueue.length-1)throw new t$Z("index is out of bounds.");return this._layerQueue[e]},h$8.prototype.add=function(e,t){if(!e$28(e))throw new t$Z("layer is required.");var i=e._name;if(!e$28(i)||""==i)throw new t$Z("name is required.");var r=this._layers;if(r.contains(i))throw new RuntimeError("An layer with name "+i+" already exists in this Scene.");e._id=this._layerIndex++;var n=this._layerQueue.length;r.set(i,e),t=u$Y(t,n),e.index=t,this._layerQueue.push(e),this._layerQueue.sort((function(e,t){return e.index-t.index})),e._fileType===f$r.ClampObjectPolygon?this._clampLayerIndex=t:t>this._clampLayerIndex&&(e.receiveObjectClamp=!1)},h$8.prototype.remove=function(e,t){if(t=u$Y(t,!0),!e$28(e))return!1;var i=this.find(e);return!!i&&(!!this._layers.remove(e)&&(this._layerQueue.splice(this._layerQueue.indexOf(i),1),i._fileType===f$r.ClampGroundRealtimeRasterCache&&i.refreshRaster(),t&&i.destroy(),i._fileType===f$r.ClampObjectPolygon&&(this._clampLayerIndex=Number.MAX_VALUE),this._selectedLayer===i&&(this._selectedLayer=void 0),this._s3mLayerAddedIndex--,!0))},h$8.prototype.removeAll=function(e){if(e=u$Y(e,!0),this._replacementList.splice(this._replacementList.tail,this._replacementSentinel),e){var t=this._layerQueue,i=this._layerQueue.length,r=0;for(r=0;r<i;r++){var n=t[r];!e$28(n)||n.destroy()}}this._layers.removeAll(),this._layerQueue.length=0,this._clampLayerIndex=Number.MAX_VALUE,this._selectedLayer=void 0,this._s3mLayerAddedIndex=0,e$28(this._frameState)&&this._freeResource(this._frameState)},h$8.prototype.pickFeatures=function(e,t){var i,r=t._context,n=r.pixels,o=e$1S.byteToRgba(n[0],n[1],n[2],n[3]),a=r.getObjectByPickId(o);if(e$28(a)&&e$28(a.primitive)&&a.primitive instanceof _0x47d916){var s=a.id;if(!e$28((i=a.primitive).queryParameter)||!i.selectEnabled)return;var l=i.queryParameter,u=l.url+"/datasources/{datasourceName}/datasets/{datasetName}/features/{id}.jsonp?hasGeometry={hasGeometry}";if(e$28(l.dataSetName))return u=u.replace("{datasourceName}",l.dataSourceName).replace("{datasetName}",l.dataSetName).replace("{id}",s).replace("{hasGeometry}",l.hasGeometry),e$28(a$Y.CREDENTIAL)&&(u=a$Y.addToken(u)),d$Z(u);if(1==l.isMerge&&e$28(l.datasetList)){for(var c,h=0,d=l.datasetList.length;h<d;h++){var f=l.datasetList[h];if(s>=f.startID&&s<=f.endID){s=s-f.startID+1,c=f.datasetName;break}}if(e$28(c))return u=u.replace("{datasourceName}",l.dataSourceName).replace("{datasetName}",c).replace("{id}",s).replace("{hasGeometry}",l.hasGeometry),e$28(a$Y.CREDENTIAL)&&(u=a$Y.addToken(u)),d$Z(u)}}},h$8.prototype.raise=function(e){if(e$28(e)){var t=e.index;if(D$d(this._layerQueue,t,t+1)&&(e.index+=1),e._fileType===f$r.ClampGroundRealtimeRasterCache)for(var i=0;i<this._layerQueue.length;i++)this._layerQueue[i]._fileType===f$r.ClampGroundRealtimeRasterCache&&this._layerQueue[i]._layerScheduler.refreshRaster(this._layerQueue[i]._frameState)}},h$8.prototype.lower=function(e){if(e$28(e)){var t=e.index;if(D$d(this._layerQueue,t,t-1)&&(e.index-=1),e._fileType===f$r.ClampGroundRealtimeRasterCache)for(var i=0;i<this._layerQueue.length;i++)this._layerQueue[i]._fileType===f$r.ClampGroundRealtimeRasterCache&&this._layerQueue[i]._layerScheduler.refreshRaster(this._layerQueue[i]._frameState)}},h$8.prototype.lowerToBottom=function(e){if(e$28(e)){var t=e.index;this._layerQueue.splice(t,1),this._layerQueue.unshift(e),e.index=0;for(let i=1;i<=t;i++){(e=this._layers.get(this._layerQueue[i].name)).index+=1}}},h$8.prototype.raiseToTop=function(e){if(e$28(e)){var t=e.index;this._layerQueue.splice(t,1),this._layerQueue.push(e),e.index=this._layerQueue.length-1;for(let i=t;i<this._layerQueue.length-1;i++){(e=this._layers.get(this._layerQueue[i].name)).index-=1}}},h$8.prototype.setSelectedLayer=function(e){this._selectedLayer=e},h$8.prototype.getSelectedLayer=function(){if(!e$28(this._selectedLayer)||!this._selectedLayer.isDestroyed())return this._selectedLayer},h$8.prototype.lightSourceChanged=function(e){for(var t=0,i=this._layerQueue.length;t<i;t++)this._layerQueue[t]instanceof _0x47d916&&this._layerQueue[t].lightSourceChanged(e)},h$8.prototype.saveLocalCache=function(){for(var e=[],t=0,i=this._layerQueue.length;t<i;t++)this._layerQueue[t]instanceof _0x47d916&&this._layerQueue[t]._layerScheduler.saveLocalCache(e);if(e.length>0){var r={nameArray:e};_0x333f13.indexTaskProcessor.scheduleTask(r,[])}},Object.defineProperties(r$g.prototype,{color:{get:t$Z.throwInstantiationError},intensity:{get:t$Z.throwInstantiationError}});var e$9={SUN_LIGHT:0,LIGHT_GROUP1:1},Ct$2=Object.freeze(e$9),p$9=/\/$/,d$i=new r$1a('© <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 o$h(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).styleId;if(!e$28(t))throw new t$Z("options.styleId is required.");var i=t$S.createIfNeeded(u$Y(e.url,"https://api.mapbox.com/styles/v1/")),r=e$1q.getAccessToken(e.accessToken);this._styleId=t,this._accessToken=r,this._accessTokenErrorCredit=r$1a.clone(e$1q.getErrorCredit(e.accessToken));var n=u$Y(e.tilesize,512);this._tilesize=n;var o=u$Y(e.username,"mapbox");this._username=o;var a,s=e$28(e.scaleFactor)?"@2x":"",l=i.getUrlComponent();p$9.test(l)||(l+="/"),l+=this._username+"/"+t+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+s,i.url=l,i.setQueryParameters({access_token:r}),e$28(e.credit)?"string"==typeof(a=e.credit)&&(a=new r$1a(a)):a=d$i,this._resource=i,this._imageryProvider=new _$i({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function s$c(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).textureUrl;e$28(t)||(t=n$17("Assets/Textures/moonSmall.jpg")),this.show=u$Y(e.show,!0),this.textureUrl=t,this._ellipsoid=u$Y(e.ellipsoid,t$V.MOON),this.onlySunLighting=u$Y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new p$d({radii:this.ellipsoid.radii,material:a$O.fromType(a$O.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new h$N}Object.defineProperties(o$h.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}}}),o$h.prototype.getTileCredits=function(e,t,i){if(e$28(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},o$h.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},o$h.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},o$h._defaultCredit=d$i,Object.defineProperties(s$c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var n$d=new p$1a,_$c=new p$1a,M$b=new t$X,a$f=[];s$c.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;e$28(m$1b.computeIcrfToFixedMatrix(i,n$d))||m$1b.computeTemeToPseudoFixedMatrix(i,n$d);var r=this._axes.evaluate(i,_$c);p$1a.transpose(r,r),p$1a.multiply(n$d,r,r);var n=F$T.computeMoonPositionInEarthInertialFrame(i,M$b);p$1a.multiplyByVector(n$d,n,n),y$15.fromRotationTranslation(r,n,t.modelMatrix);var o=e.commandList;return e.commandList=a$f,a$f.length=0,t.update(e),e.commandList=o,1===a$f.length?a$f[0]:void 0}},s$c.prototype.isDestroyed=function(){return!1},s$c.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),i$Z(this)};var I$a={NONE:0,HORIZONTAL:1,VERTICAL:2,QUAD:3,TRIPLE:4,VerticalTrisection:5,FIVE_DIVISIONS:6,SIX_DIVISIONS:7,SEVEN_DIVISIONS:8,EIGHT_DIVISIONS:9,NINE_DIVISIONS:10},te$6=Object.freeze(I$a);function x$a(){}function y$d(e,t,i,r,n,o,a){var s=e.xDimName,l=e.yDimName,u=e.zDimName,c=e.timeDimName,h=e.dimensions,d=e.dimensionIndices,f=e.buffer,p=h[d[t]];if(0==p.size&&t<d.length-1)y$d(e,t+1,i,r,n,o,a);else for(var _=p.name===s,m=p.name===l,$=p.name===u,g=e$28(c)&&p.name===c,v=0;v<p.size;v++)if(_?i=v:m?r=v:$?n=v:g&&(o=v),t==d.length-1){var y=f.readFloat32();a.maxValue=Math.max(a.maxValue,y),a.minValue=Math.min(a.minValue,y);var x=n*e.xDimSize*e.yDimSize+r*e.xDimSize+i;a.array[o][x]=y}else y$d(e,t+1,i,r,n,o,a)}function E$e(e,t,i,r){var n=t.offset;t.size,t.type;var o=t.dimensions,a=e.recordDimension;r.seek(n),e.buffer=r,e.dimensions=i,e.dimensionIndices=o;var s=e.xDimName,l=e.yDimName,u=e.zDimName,c=e.timeDimName;e.xDimSize=0,e.yDimSize=0,e.zDimSize=0;for(var h=1,d=0;d<i.length;d++)i[d].name==s?e.xDimSize=i[d].size:i[d].name==l?e.yDimSize=i[d].size:i[d].name==u?e.zDimSize=i[d].size:e$28(c)&&i[d].name==c&&(h=i[d].size);a.length>0&&(h=a.length,e.timeDimName=null);var f={array:[]},p=0;for(p=0;p<h;p++)f.array[p]=[];if(f.maxValue=Number.MIN_VALUE,f.minValue=Number.MAX_VALUE,f.xDimSize=e.xDimSize,f.yDimSize=e.yDimSize,f.zDimSize=e.zDimSize,f.timeDimSize=h,a.length>0)for(p=0;p<h;p++)r.seek(n+a.recordStep*p),y$d(e,0,0,0,0,p,f);else y$d(e,0,0,0,0,0,f);return f}function e$8(e){}x$a.loadData=function(e,t){var i=e.header,r=e.buffer,n=i.dimensions;i.globalAttributes;var o=i.variables;t.recordDimension=i.recordDimension;for(var a=0,s=0;s<o.length;s++)if(o[s].name==t.variableName){a=s;break}return E$e(t,o[a],n,r)},e$8.prototype.isReady=function(){return!0},e$8.prototype.shouldDiscardImage=function(e){return!1};var y$c="#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",L$d="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 _$b(e){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;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 r$11({color:new e$1S(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new r$11({color:new e$1S(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new r$11({color:new e$1S(0,0,0,0),owner:this}),this._alphaClearCommand=new r$11({color:new e$1S(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 f$10,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function P$a(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function R$a(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 q$8(e){P$a(e),R$a(e)}function N$8(e,t,i,r){P$a(e),e._accumulationTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT});var n=new Float32Array(i*r*4);e._revealageTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT,source:{arrayBufferView:n,width:i,height:r},flipY:!1})}function I$9(e,t){R$a(e);var i=de$y.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new a$z({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a$z({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),(e._translucentFBO.status!==i||e._adjustTranslucentFBO.status!==i)&&(R$a(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new a$z({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new a$z({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new a$z({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new a$z({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,o=e._alphaFBO.status===i,a=e._adjustTranslucentFBO.status===i,s=e._adjustAlphaFBO.status===i;(!n||!o||!a||!s)&&(q$8(e),e._translucentMultipassSupport=!1,r=!1)}return r}_$b.prototype.update=function(e,t,i,r){if(this.isSupported()){this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!e$28(a)||a.width!==n||a.height!==o||r!==this._useHDR;if(s&&N$8(this,e,n,o),e$28(this._translucentFBO)&&!s||I$9(this,e)){this._useHDR=r;var l,u,c=this;e$28(this._compositeCommand)||(l=new a$$({sources:[L$d]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return c._opaqueTexture},u_accumulation:function(){return c._accumulationTexture},u_revealage:function(){return c._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this})),e$28(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new a$$({defines:["MRT"],sources:[y$c]}),u={u_bgColor:function(){return c._translucentMRTClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new a$$({sources:[y$c]}),u={u_bgColor:function(){return c._translucentMultipassClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return c._alphaClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o;var h=!f$10.equals(this._viewport,t.viewport),d=h!==this._useScissorTest;this._useScissorTest=h,f$10.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=f$10.clone(t.viewport,this._scissorRectangle),d=!0),(!e$28(this._rs)||!f$10.equals(this._viewport,this._rs.viewport)||d)&&(this._rs=u$R.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),e$28(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),e$28(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var H$c={enabled:!0,color:new e$1S(0,0,0,0),equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.ONE,functionDestinationRgb:l$15.ONE,functionSourceAlpha:l$15.ZERO,functionDestinationAlpha:l$15.ONE_MINUS_SOURCE_ALPHA},U$a={enabled:!0,color:new e$1S(0,0,0,0),equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.ONE,functionDestinationRgb:l$15.ONE,functionSourceAlpha:l$15.ONE,functionDestinationAlpha:l$15.ONE},V$9={enabled:!0,color:new e$1S(0,0,0,0),equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.ZERO,functionDestinationRgb:l$15.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:l$15.ZERO,functionDestinationAlpha:l$15.ONE_MINUS_SOURCE_ALPHA};function b$h(e,t,i,r){var n=i[r.id];if(!e$28(n)){var o=u$R.getState(r);o.depthMask=!1,o.blending=t,n=u$R.fromCache(o),i[r.id]=n}return n}function G$d(e,t,i){return b$h(t,H$c,e._translucentRenderStateCache,i)}function Q$a(e,t,i){return b$h(t,U$a,e._translucentRenderStateCache,i)}function W$c(e,t,i){return b$h(t,V$9,e._alphaRenderStateCache,i)}var Z$9=" 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",X$6=" 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",Y$8=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";function A$d(e,t,i,r){var n=e.shaderCache.getDerivedShaderProgram(t,i);if(!e$28(n)){var o=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map((function(e){return e=(e=(e=(e=a$$.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"),n=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:o})}return n}function k$d(e,t){return A$d(e,t,"translucentMRT",Z$9)}function J$b(e,t){return A$d(e,t,"translucentMultipass",X$6)}function K$7(e,t){return A$d(e,t,"alphaMultipass",Y$8)}function $$7(e,t,i,r,n,o){var a,s,l=t.context,u=t.frameState.useLogDepth,c=t._hdr,h=r.framebuffer,d=n.length,f=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var p=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<d;++s)a=n[s],a=u?a.derivedCommands.logDepth.command:a,a=c?a.derivedCommands.hdr.command:a,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,l,r,p);for(e$28(o)&&(a=o.unclassifiedCommand,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.translucentCommand:a.derivedCommands.oit.translucentCommand,t,l,r,p)),r.framebuffer=e._alphaFBO,s=0;s<d;++s)a=n[s],a=u?a.derivedCommands.logDepth.command:a,a=c?a.derivedCommands.hdr.command:a,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,t,l,r,p);e$28(o)&&(a=o.unclassifiedCommand,i(f&&a.receiveShadows?a.derivedCommands.oit.shadows.alphaCommand:a.derivedCommands.oit.alphaCommand,t,l,r,p)),r.framebuffer=h}function ee$5(e,t,i,r,n,o){var a=t.context,s=t.frameState.useLogDepth,l=t._hdr,u=r.framebuffer,c=n.length,h=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(a,r);var d=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var f,p=0;p<c;++p)f=n[p],f=s?f.derivedCommands.logDepth.command:f,f=l?f.derivedCommands.hdr.command:f,i(h&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,t,a,r,d);e$28(o)&&(f=o.unclassifiedCommand,i(h&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand,t,a,r,d)),r.framebuffer=u}_$b.prototype.createDerivedCommands=function(e,t,i){var r,n,o,a,s,l;(e$28(i)||(i={}),this._translucentMRTSupport)?(e$28(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,n=i.translucentCommand.renderState),i.translucentCommand=r$15.shallowClone(e,i.translucentCommand),e$28(r)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=n):(i.translucentCommand.shaderProgram=k$d(t,e.shaderProgram),i.translucentCommand.renderState=G$d(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)):(e$28(i.translucentCommand)&&(o=i.translucentCommand.shaderProgram,a=i.translucentCommand.renderState,s=i.alphaCommand.shaderProgram,l=i.alphaCommand.renderState),i.translucentCommand=r$15.shallowClone(e,i.translucentCommand),i.alphaCommand=r$15.shallowClone(e,i.alphaCommand),e$28(o)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=o,i.translucentCommand.renderState=a,i.alphaCommand.shaderProgram=s,i.alphaCommand.renderState=l):(i.translucentCommand.shaderProgram=J$b(t,e.shaderProgram),i.translucentCommand.renderState=Q$a(this,t,e.renderState),i.alphaCommand.shaderProgram=K$7(t,e.shaderProgram),i.alphaCommand.renderState=W$c(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id));return i},_$b.prototype.executeCommands=function(e,t,i,r,n){this._translucentMRTSupport?ee$5(this,e,t,i,r,n):$$7(this,e,t,i,r,n)},_$b.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},_$b.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._opaqueFBO,e$1S.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},_$b.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},_$b.prototype.setOpaqueTexture=function(e){this._opaqueTexture=e},_$b.prototype.isDestroyed=function(){return!1},_$b.prototype.destroy=function(){return q$8(this),e$28(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),e$28(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),e$28(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),i$Z(this)};var x$9=new r$1a("MapQuest, Open Street Map and contributors, CC-BY-SA");function a$e(e){e=u$Y(e,u$Y.EMPTY_OBJECT);var t=t$S.createIfNeeded(u$Y(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+u$Y(e.fileExtension,"png");var i=new c$10({ellipsoid:e.ellipsoid}),r=u$Y(e.minimumLevel,0),n=e.maximumLevel,o=u$Y(e.rectangle,i.rectangle),a=i.positionToTileXY(h$10.southwest(o),r),s=i.positionToTileXY(h$10.northeast(o),r),l=(Math.abs(s.x-a.x)+1)*(Math.abs(s.y-a.y)+1);if(l>4)throw new t$Z("The rectangle and minimumLevel indicate that there are "+l+" tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.");var u=u$Y(e.credit,x$9);"string"==typeof u&&(u=new r$1a(u)),_$i.call(this,{url:t,credit:u,tilingScheme:i,tileWidth:256,tileHeight:256,minimumLevel:r,maximumLevel:n,rectangle:o})}e$28(Object.create)&&(a$e.prototype=Object.create(_$i.prototype),a$e.prototype.constructor=a$e);var n$c=new o$1k(1,1);function a$d(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.mass=u$Y(e.mass,1),this.position=t$X.clone(u$Y(e.position,t$X.ZERO)),this.velocity=t$X.clone(u$Y(e.velocity,t$X.ZERO)),this.life=u$Y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=e$1S.clone(u$Y(e.startColor,e$1S.WHITE)),this.endColor=e$1S.clone(u$Y(e.endColor,e$1S.WHITE)),this.startScale=u$Y(e.startScale,1),this.endScale=u$Y(e.endScale,1),this.imageSize=o$1k.clone(u$Y(e.imageSize,n$c)),this.rotationSpeed=u$Y(e.rotationSpeed,0),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(a$d.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var o$g=new t$X;function m$f(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.time=u$Y(e.time,0),this.minimum=u$Y(e.minimum,0),this.maximum=u$Y(e.maximum,50),this._complete=!1}function e$7(e){throw new t$Z("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}a$d.prototype.update=function(e,t){return t$X.multiplyByScalar(this.velocity,e,o$g),t$X.add(this.position,o$g,this.position),e$28(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(m$f.prototype,{complete:{get:function(){return this._complete}}}),e$7.prototype.emit=function(e){t$Z.throwInstantiationError()};var N$7="uniform sampler2D u_colorTexture;\nuniform sampler2D u_transitionAndCountTexture;\nvarying vec2 v_textureCoordinates;\nfloat erf(float x){\nif (abs(x) > 2.629639){\nreturn sign(x);\n}\nelse {\nfloat z = 0.289226 * x * x - 1.0;\nreturn ((((((0.0145688 * z - 0.0348595) * z + 0.0503913) * z - 0.0897001) * z + 0.156097) * z - 0.249431) * z + 0.533201) * x;\n}\n}\nfloat VDMTransmission(vec2 transition, float depth){\nfloat variance = max(transition.y - transition.x * transition.x, 0.0);\nreturn clamp(0.5 * (1.0 + erf((depth - transition.x) / sqrt(variance * 2.0))), 0.0, 1.0);\n}\nvoid main()\n{\nvec4 color = texture2D(u_colorTexture, v_textureCoordinates);\nif(color.a < 0.01){\ndiscard;\n}\nfloat scene_depth = czm_unpackDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));\nif(scene_depth > 0.0){\nvec3 transitionAndCount = texture2D(u_transitionAndCountTexture, v_textureCoordinates).xyz;\nfloat count = transitionAndCount.z;\nvec2 transition = transitionAndCount.xy;\ntransition /= count;\nfloat vdmAlpha = VDMTransmission(transition, scene_depth);\ncolor.a = min(color.a, vdmAlpha);\n}\ngl_FragColor = color;\n}\n";function u$d(){this._colorFBO=void 0,this._transitionFBO=void 0,this._colorTexture=void 0,this._transitionTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._passType=Le$p.OPAQUE,this._screenWidth=0,this._screenHeight=0,this._renderStateCache={},this.quality=.25,this.enable=!1,this._useLogDepth=!1,this._particleSp=void 0,this._useHdr=!1,this.useHdr=this._useHdr}var G$c={enabled:!0,color:new e$1S(0,0,0,0),equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.SOURCE_ALPHA,functionDestinationRgb:l$15.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:l$15.ONE,functionDestinationAlpha:l$15.ONE},f$e=new f$10;function q$7(e,t){var i=e[t.id];if(!e$28(i)||i.viewport.width!=f$e.width||i.viewport.height!=f$e.height){var r=u$R.getState(t);r.viewport=f$e,i=u$R.fromCache(r),e[t.id]=i}return i}function S$6(){return new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}function y$b(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._transitionTexture=e._transitionTexture&&!e._transitionTexture.isDestroyed()&&e._transitionTexture.destroy(),e._colorFBO=e._colorFBO&&!e._colorFBO.isDestroyed()&&e._colorFBO.destroy(),e._transitionFBO=e._transitionFBO&&!e._transitionFBO.isDestroyed()&&e._transitionFBO.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}function U$9(e,t){var i=e._screenWidth,r=e._screenHeight;e._colorTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:S$6()}),e._transitionTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT,sampler:S$6()}),e._colorFBO=new a$z({context:t,colorTextures:[e._colorTexture],destroyAttachments:!1}),e._transitionFBO=new a$z({context:t,colorTextures:[e._transitionTexture],destroyAttachments:!1})}function I$8(e,t){var i=[];e._useLogDepth&&i.push("LOG_DEPTH");var r=new a$$({sources:[N$7],defines:i}),n={u_colorTexture:function(){return e._colorTexture},u_transitionAndCountTexture:function(){return e._transitionTexture}},o=u$R.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:G$c});e._drawCommand=t.createViewportQuadCommand(r,{uniformMap:n,renderState:o,pass:e._passType,owner:e}),e._clearCommand=new r$11({color:new e$1S(0,0,0,0),depth:1,renderState:u$R.fromCache(),pass:e._passType,owner:e})}function V$8(e,t){var i=e._screenWidth,r=e._screenHeight,n=e._colorTexture,o=!1,a=e$28(n)&&(n.width!==i||n.height!==r);return(!e$28(n)||a)&&(y$b(e),U$9(e,t),I$8(e,t),o=!0),o}function D$c(e){return e.drawBuffers&&e.fragmentDepth}u$d.isSupported=D$c,u$d.prototype.update=function(e,t){if(D$c(e.context)&&this.enable){var i=e.context;this._screenWidth=Math.floor(i.drawingBufferWidth*this.quality),this._screenHeight=Math.floor(i.drawingBufferHeight*this.quality),f$e.width=this._screenWidth,f$e.height=this._screenHeight,this._useLogDepth=e.useLogDepth,this._useHdr=t,V$8(this,i)}},u$d.prototype.execute=function(e,t){!e$28(this._drawCommand)||!this.enable||!e$28(e.uniformState)||!e$28(e.uniformState.globeDepthTexture)||this._drawCommand.execute(e,t)},u$d.prototype.executeCommand=function(e,t,i,r,n){if(0!=n){var o,a,s=e.context,l=e.frameState.useLogDepth,u=e._hdr,c=i.framebuffer;for(i.framebuffer=this._colorFBO,a=0;a<n;++a)o=r[a],o=l?o.derivedCommands.logDepth.command:o,t(o=u?o.derivedCommands.hdr.command:o,e,s,i);for(i.framebuffer=this._transitionFBO,a=0;a<n;++a){if(o=r[a],o=l?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,!e$28(this._particleSp)||this._useHdr!==this.useHdr){this.useHdr=this._useHdr;var h=o.shaderProgram.fragmentShaderSource.clone(),d=o.shaderProgram.vertexShaderSource.clone();h.defines.push("PARTICLESYSTEM"),this._particleSp=S$T.fromCache({context:s,vertexShaderSource:d,fragmentShaderSource:h})}var f=o.shaderProgram;o._shaderProgram=this._particleSp,t(o,e,s,i),o._shaderProgram=f}i.framebuffer=c}},u$d.prototype.clear=function(e,t){!e$28(this._clearCommand)||!this.enable||(this._clearCommand.framebuffer=this._colorFBO,this._clearCommand.execute(e,t),this._clearCommand.framebuffer=this._transitionFBO,this._clearCommand.execute(e,t))},u$d.prototype.createDerivedCommands=function(e){!e$28(e)||(this.enable=!0,e$28(this._colorFBO)&&(e.renderState=q$7(this._renderStateCache,e.renderState)))},u$d.prototype.isDestroyed=function(){return!1},u$d.prototype.destroy=function(){return y$b(this),i$Z(this)};var _0x524314=(_0x3c3c79=!0,function(e,t){var i=_0x3c3c79?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3c3c79=!1,i}),_0x580d57=_0x524314(void 0,(function(){return _0x580d57.toString().search("(((.+)+)+)+$").toString().constructor(_0x580d57).search("(((.+)+)+)+$")})),_0x3c3c79;_0x580d57();var _0x3094c8={FIRE:0,FOUNTAIN:1,RAIN:2},v$b=Object.freeze(_0x3094c8);function o$f(e){e=u$Y(e,1),o$1u.typeOf.number.greaterThan("radius",e,0),this._radius=u$Y(e,1),this.radius=this._radius}Object.defineProperties(o$f.prototype,{radius:{get:function(){return this._radius},set:function(e){o$1u.typeOf.number.greaterThan("value",e,0),this._radius=e}},type:{get:function(){return"Sphere"}}}),o$f.prototype.emit=function(e){var t=e$27.randomBetween(0,e$27.TWO_PI),i=e$27.randomBetween(0,e$27.PI),r=e$27.randomBetween(0,this._radius),n=r*Math.cos(t)*Math.sin(i),o=r*Math.sin(t)*Math.sin(i),a=r*Math.cos(i);e.position=t$X.fromElements(n,o,a,e.position),e.velocity=t$X.normalize(e.position,e.velocity)};var I$7=new o$1k(1,1);function g$c(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.show=u$Y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=u$Y(e.loop,!0),this.image=u$Y(e.image,void 0);var t=e.emitter;e$28(t)||(t=new u$g(.5)),this._emitter=t,t.owner=this,this._bursts=e.bursts,this._modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._emitterModelMatrix=y$15.clone(u$Y(e.emitterModelMatrix,y$15.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new y$15,this._startColor=e$1S.clone(u$Y(e.color,u$Y(e.startColor,e$1S.WHITE))),this._endColor=e$1S.clone(u$Y(e.color,u$Y(e.endColor,e$1S.WHITE))),this._startScale=u$Y(e.scale,u$Y(e.startScale,1)),this._endScale=u$Y(e.scale,u$Y(e.endScale,1)),this._minRotationSpeed=u$Y(e.minRotationSpeed,u$Y(e.minimumRotationSpeed,0)),this._maxRotationSpeed=u$Y(e.maxRotationSpeed,u$Y(e.maximumRotationSpeed,0)),this._emissionRate=u$Y(e.emissionRate,5),this._emissionRateByDistance=u$Y(e.emissionRate,5),this._minimumSpeed=u$Y(e.speed,u$Y(e.minimumSpeed,1)),this._maximumSpeed=u$Y(e.speed,u$Y(e.maximumSpeed,1)),this._minimumParticleLife=u$Y(e.particleLife,u$Y(e.minimumParticleLife,5)),this._maximumParticleLife=u$Y(e.particleLife,u$Y(e.maximumParticleLife,5)),this._minimumMass=u$Y(e.mass,u$Y(e.minimumMass,1)),this._maximumMass=u$Y(e.mass,u$Y(e.maximumMass,1)),this._minimumImageSize=o$1k.clone(u$Y(e.imageSize,u$Y(e.minimumImageSize,I$7))),this._maximumImageSize=o$1k.clone(u$Y(e.imageSize,u$Y(e.maximumImageSize,I$7))),this._lifetime=u$Y(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 o$1o,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0,this._sizeInMeters=u$Y(e.sizeInMeters,u$Y(e.sizeInMeters,!1)),this._boundingSphere=new i$19(t$X.ZERO,100),this.lodRangeScale=1,this._performance=u$Y(e.performance,!0),this._type=u$Y(e.type,v$b.FIRE)}function W$b(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(e$28(n))for(var o=n.length,a=0;a<o;++a)r+=n[a].maximum;var s=e._billboardCollection,l=e.image,u=Math.ceil(t*i+r),c=e._particles,h=e._particlePool,d=e._emitter;e$28(d.areaFactor)&&(u=Math.min(u,d.areaFactor));for(var f=Math.max(u-c.length-h.length,0),p=0;p<f;++p){var _=new a$d;_._billboard=s.add({image:l,sizeInMeters:e._sizeInMeters}),h.push(_)}e._particleEstimate=u}function j$b(e){var t=e._particlePool.pop();return e$28(t)||(t=new a$d),t}function H$b(e,t){e._particlePool.push(t)}function Y$7(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,n=(t.length,i.length),o=e._particleEstimate,a=o;a<n;++a){var s=i[a];!e$28(s)||r.remove(s._billboard)}i.length=o}function J$a(e){e$28(e._billboard)&&(e._billboard.show=!1)}function w$9(e,t){var i=t._billboard;e$28(i)||(i=t._billboard=e._billboardCollection.add({image:t.image,sizeInMeters:e._sizeInMeters})),i.width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.show=!0;var r=e$27.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),n=e$27.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=e$27.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=e$27.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new e$1S(r,n,o,a),i.scale=e$27.lerp(t.startScale,t.endScale,t.normalizedAge),i.rotation=t.age*t.rotationSpeed}function X$5(e,t){t.startColor=e$1S.clone(e._startColor,t.startColor),t.endColor=e$1S.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=e$27.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=e$27.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=e$27.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=e$27.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t.rotationSpeed=e$27.randomBetween(e._minRotationSpeed,e._maxRotationSpeed),t._normalizedAge=0,t._age=0;var i=e$27.randomBetween(e._minimumSpeed,e._maximumSpeed);t$X.multiplyByScalar(t.velocity,i,t.velocity),e._particles.push(t)}function K$6(e,t){if(e._isComplete)return 0;var i=(t=e$27.mod(t,e._lifetime))*e._emissionRateByDistance,r=Math.floor(i);if(e._carryOver+=i-r,e._carryOver>1&&(r++,e._carryOver-=1),e$28(e.bursts))for(var n=e.bursts.length,o=0;o<n;o++){var a=e.bursts[o],s=e._currentTime;e$28(a)&&!a._complete&&s>a.time&&(r+=e$27.randomBetween(a.minimum,a.maximum),a._complete=!0)}return r}Object.defineProperties(g$c.prototype,{emitter:{get:function(){return this._emitter},set:function(e){o$1u.defined("value",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){o$1u.defined("value",e),this._matrixDirty=this._matrixDirty||!y$15.equals(this._modelMatrix,e),y$15.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){o$1u.defined("value",e),this._matrixDirty=this._matrixDirty||!y$15.equals(this._emitterModelMatrix,e),y$15.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){o$1u.defined("value",e),e$1S.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){o$1u.defined("value",e),e$1S.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumRotationSpeed:{get:function(){return this._minRotationSpeed},set:function(e){this._minRotationSpeed=e}},maximumRotationSpeed:{get:function(){return this._maxRotationSpeed},set:function(e){this._maxRotationSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){o$1u.typeOf.object("value",e),o$1u.typeOf.number.greaterThanOrEquals("value.x",e.x,0),o$1u.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){o$1u.typeOf.object("value",e),o$1u.typeOf.number.greaterThanOrEquals("value.x",e.x,0),o$1u.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},lifetime:{get:function(){return this._lifetime},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},type:{get:function(){return this._ParticleSystemType},set:function(e){o$1u.typeOf.number.greaterThanOrEquals("value",e,0),this._ParticleSystemType=e,this.setParticleType(e)}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var Z$8=new i$19,P$9=new y$15;function G$b(e,t){if(e$28(e._emitter)&&"Polygon"==e._emitter.type)e._boundingSphere=e._emitter.boundingSphere;else{var i=e._maxVelocity*e._maximumParticleLife;P$9=y$15.multiply(e.modelMatrix,e.emitterModelMatrix,P$9),i$19.transform(Z$8,P$9,e._boundingSphere),e._boundingSphere.radius=i+10+e._emitter.radius}t.mode===P$$.COLUMBUS_VIEW&&m$W.computeActualWgs84Position(t,e._boundingSphere.center,e._boundingSphere.center)}function Q$9(e,t){var i=t.camera.positionWC,r=t$X.distance(i,e._boundingSphere.center)-e._boundingSphere.radius,n=0;r>1e3*e.lodRangeScale?n=0:r>200*e.lodRangeScale?(n=e._emissionRate/8,n=Math.max(2,n)):r>50*e.lodRangeScale?(n=e._emissionRate/2,n=Math.max(2,n)):n=e._emissionRate,e$28(e._emitter.areaFactor)&&(n=Math.min(e._emitter.areaFactor,n)),e._emissionRateByDistance=n}var C$b=new t$X;function r$f(){this._drawCommand=void 0,this.enable=!1,this._particleStateTexture=void 0,this._initialized=!1}function a$c(e){e._drawCommand=void 0,e._clearCommand=void 0}function h$7(e,t){var i=new a$$({sources:[V$b]}),r={colorTexture:function(){return e._particleStateTexture}},n=u$R.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:Ee$n.ALPHA_BLEND});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:r,renderState:n,pass:e._passType,owner:e})}function c$b(e,t){var i=!1;return e._initialized||(a$c(e),h$7(e,t),i=!0,e._initialized=!0),i}function d$h(e){return e.drawBuffers&&e.fragmentDepth}function i$a(e){if("string"==typeof e){var t=document.getElementById(e);if(null===t)throw new t$Z('Element with id "'+e+'" does not exist in the document.');e=t}return e}function o$e(e){var t=i$a((e=u$Y(e,u$Y.EMPTY_OBJECT)).container);if(!e$28(t))throw new t$Z("container is required");this._container=t;var i=document.createElement("div");i.className="cesium-performanceDisplay";var r=document.createElement("div");r.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),r.appendChild(this._fpsText);var n=document.createElement("div");n.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),n.appendChild(this._msText),i.appendChild(n),i.appendChild(r),this._container.appendChild(i),this._lastFpsSampleTime=kt$7(),this._lastMsSampleTime=kt$7(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;var o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),i.appendChild(o);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._trangleCountText=document.createTextNode(""),a.appendChild(this._trangleCountText),i.appendChild(a)}function f$d(){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 w$8(e,t,i,r){if(!e$28(e._debugPickDepthViewportCommand)||r!==e._useLogDepth){var n=new a$$({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 c$a(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function x$8(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function b$g(e,t,i,r){e._depthTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE})}function T$a(e,t,i,r){c$a(e),x$8(e),b$g(e,t,i,r),e._framebuffer=new a$z({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function P$8(e,t,i){var r=i.width,n=i.height,o=e._depthTexture,a=!e$28(o)||o.width!==r||o.height!==n;(!e$28(e._framebuffer)||a)&&T$a(e,t,r,n)}function D$b(e,t,i){if(t.depthTexture){if(!e$28(e._copyDepthCommand)){var r="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";e._copyDepthCommand=t.createViewportQuadCommand(r,{renderState:u$R.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}}else if(!e$28(e._copyDepthCommand)){r="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = texture2D(u_texture, v_textureCoordinates).rgba;\n}\n";e._copyDepthCommand=t.createViewportQuadCommand(r,{renderState:u$R.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._framebuffer}g$c.prototype.setParticleType=function(e){switch(e){case v$b.FIRE:this._emitter=new n$k(e$27.toRadians(45)),this._emissionRate=150,this._particleSize=2,this._minimumParticleLife=1.5,this._maximumParticleLife=1.8,this._minimumSpeed=7,this._maximumSpeed=9,this._startScale=3,this._endScale=1.5,this._startColor=new e$1S(1,1,1,1),this._endColor=new e$1S(1,0,0,0),this._lifeTime=6,this._sizeInMeters=!0,this._performance=!0;break;case v$b.FOUNTAIN:this._emitter=new o$1k(1,1),this._emissionRate=40,this._particleSize=1,this._minimumParticleLife=6,this._maximumParticleLife=7,this._minimumSpeed=10,this._maximumSpeed=10,this._startScale=1,this._endScale=30,this._startColor=new e$1S(1,1,1,.6),this._endColor=new e$1S(.8,.86,1,.4),this._lifeTime=16,this._sizeInMeters=!0,this._performance=!0;break;case v$b.RAIN:this._emitter=new o$f(5e3),this._emissionRate=8e3,this._particleSize=30,this._minimumParticleLife=6,this._maximumParticleLife=6,this._minimumSpeed=0,this._maximumSpeed=0,this._startScale=1,this._endScale=1,this._startColor=new e$1S(1,1,1,.8),this._endColor=new e$1S(1,1,1,.8),this._lifeTime=10,this._sizeInMeters=!0,this._performance=!1}},g$c.prototype.update=function(e){if(LicenseChecker.LICENSECHECKER.verify("ParticleSystem"),this.show){e$28(this._billboardCollection)||(this._billboardCollection=new B$q({particleSystem:this._performance,ignoreShow:!0})),this._updateParticlePool&&(W$b(this),this._updateParticlePool=!1);var t=e.cullingVolume;if(G$b(this,e),t.computeVisibility(this._boundingSphere)!=pt$a.OUTSIDE){Q$9(this,e);var i=0;this._previousTime&&(i=a$12.secondsDifference(e.time,this._previousTime)),i<0&&(i=0),this._maxVelocity=0;var r,n,o=this._particles,a=this._emitter,s=this.updateCallback,l=o.length;for(r=0;r<l;++r)(n=o[r]).update(i,s)?(w$9(this,n),this._maxVelocity=Math.max(this._maxVelocity,t$X.magnitude(n.velocity))):(J$a(n),H$b(this,n),o[r]=o[l-1],--r,--l);o.length=l;var u=K$6(this,i);if(u>0&&e$28(a)){this._matrixDirty&&(this._combinedMatrix=y$15.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);var c=this._combinedMatrix;for(r=0;r<u;r++)n=j$b(this),this._emitter.emit(n),"Polygon"!==this._emitter.type&&(t$X.add(n.position,n.velocity,C$b),y$15.multiplyByPoint(c,C$b,C$b),n.position=y$15.multiplyByPoint(c,n.position,n.position),t$X.subtract(C$b,n.position,n.velocity),t$X.normalize(n.velocity,n.velocity)),X$5(this,n),w$9(this,n)}if(this._billboardCollection.update(e),this._previousTime=a$12.clone(e.time,this._previousTime),this._currentTime+=i,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=e$27.mod(this._currentTime,this._lifetime),this.bursts){var h=this.bursts.length;for(r=0;r<h;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%60==0&&Y$7(this)}}},g$c.prototype.isDestroyed=function(){return!1},g$c.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),i$Z(this)},r$f.isSupported=d$h,r$f.prototype.update=function(e){if(this.enable=!0,d$h(e.context)&&this.enable)c$b(this,e.context)},r$f.prototype.execute=function(e,t){!e$28(this._drawCommand)||!this.enable||!e$28(e.uniformState)||!e$28(e.uniformState.globeDepthTexture)||this._drawCommand.execute(e,t)},r$f.prototype.isDestroyed=function(){return!1},r$f.prototype.destroy=function(){return a$c(this),i$Z(this)},Object.defineProperties(o$e.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}},trangleCount:{set:function(e){this._trangleCount!==e&&(this._trangleCount=e,this._trangleCountText.nodeValue=e)}}}),o$e.prototype.update=function(e){var t=kt$7(),i=u$Y(e,!0);this._fpsFrameCount++;var r=t-this._lastFpsSampleTime;if(r>1e3){var n="N/A";i&&(n=1e3*this._fpsFrameCount/r|0),this._fpsText.nodeValue=n+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;var o=t-this._lastMsSampleTime;if(o>200){var a="N/A";i&&(a=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=a+" MS",this._lastMsSampleTime=t,this._msFrameCount=0}},o$e.prototype.destroy=function(){return i$Z(this)},f$d.prototype.executeDebugPickDepth=function(e,t,i){w$8(this,e,t,i)},f$d.prototype.update=function(e,t){P$8(this,e,t),D$b(this,e,t)},new e$25;var z$9=new e$25(1,1/255,1/65025,1/16581375);function a$b(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function m$e(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function w$7(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight;t.depthTexture?(e._depthStencilTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8}),e._framebuffer=new a$z({context:t,depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1})):(e._depthStencilTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE}),e._framebuffer=new a$z({context:t,colorTextures:[e._depthStencilTexture],depthStencilRenderbuffer:new o$C({context:t,width:i,height:r,format:M$q.DEPTH_STENCIL}),destroyAttachments:!1}));var n=new n$p(t);n.blendingEnabled=!1,n.scissorTest={enabled:!0,rectangle:new f$10},n.viewport=new f$10,e._passState=n}function f$c(e){var t=new n$p(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new f$10},t.viewport=new f$10,this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}function n$b(){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 e$1S(0,0,0,0),this._useHdr=void 0,this._clearCommand=new r$11({color:new e$1S(0,0,0,0),depth:1,owner:this})}function S$5(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 a$a(e){var t=new n$p(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new f$10},t.viewport=new f$10,this._environmentVisible={isSunVisible:!1,isMoonVisible:!1,isSkyAtmosphereVisible:!1,isSkyBoxVisible:!1,isGlobalVisible:!1,isObjectVisible:!0,isOnlyS3MObjectVisible:!0,isUnderGlobeVisible:!1},this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}function L$c(e,t,i){var r,n,o=e.context,a=[],s=t.frustum.near,l=t.frustum.far,u=e.logarithmicDepthBuffer?e.logarithmicDepthFarToNearRatio:e.farToNearRatio;W$a(s,l,u,Math.ceil(Math.log(l/s)/Math.log(u)),e.logarithmicDepthBuffer,a,!1,void 0),o.depthTexture&&(r=new o$l),e._useOIT&&o.depthTexture&&(n=new _$b(o));var c=new n$p(o);c.viewport=f$10.clone(i),this.camera=t,this._cameraClone=v$n.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=c,this.pickFramebuffer=new f$c(o),this.pickPointFramebuffer=new a$a(o),this.pickDepthFramebuffer=new a$b,this.sceneFramebuffer=new n$b,this.normalFramebuffer=new r$n(o),this.globeDepth=r,this.oit=n,this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=a,this.debugFrustumStatistics=void 0,this.updateFrustums=!1}f$d.prototype.getDepth=function(e,t,i,r){var n=1;e$28(r)&&(n+=r),t-=Math.floor(.5*n),i-=Math.floor(.5*n);var o=e.readPixels({x:t,y:i,width:n,height:n,framebuffer:this._framebuffer}),a=[];e$25.unpackArray(o,a);for(var s=Number.POSITIVE_INFINITY,l=0;l<a.length;l++){var u=a[l];e$25.divideByScalar(u,255,u),s=Math.min(s,e$25.dot(u,z$9))}return s},f$d.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},f$d.prototype.isDestroyed=function(){return!1},f$d.prototype.destroy=function(){return c$a(this),x$8(this),this._copyDepthCommand.shaderProgram=e$28(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),i$Z(this)},a$b.prototype.update=function(e,t,i){var r=i.width,n=i.height;(!e$28(this._framebuffer)||r!==this._depthStencilTexture.width||n!==this._depthStencilTexture.height)&&(m$e(this),w$7(this,e));var o=this._framebuffer,a=this._passState;return a.framebuffer=o,a.viewport.width=r,a.viewport.height=n,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=n-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a},a$b.prototype.isDestroyed=function(){return!1},a$b.prototype.destroy=function(){return m$e(this),i$Z(this)},f$c.prototype.begin=function(e,t,i){var r=this._context,n=t.width,o=t.height;return f$10.clone(e,this._passState.scissorTest.rectangle),this._passState.scissorTest.enabled=!i,(!e$28(this._fb)||this._width!==n||this._height!==o)&&(this._width=n,this._height=o,this._fb=this._fb&&this._fb.destroy(),this._fb=new a$z({context:r,colorTextures:[new L$17({context:r,width:n,height:o})],depthStencilRenderbuffer:new o$C({context:r,width:n,height:o,format:M$q.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=o,this._passState},new e$1S,f$c.prototype.end=function(e){var t=u$Y(e.width,1),i=u$Y(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb});r.pixels=n;for(var o=Math.max(t,i),a=o*o,s=Math.floor(.5*t),l=Math.floor(.5*i),u=0,c=0,h=0,d=-1,f=0;f<a;++f){if(-s<=u&&u<=s&&-l<=c&&c<=l){var p=4*((l-c)*t+u+s),_=e$1S.byteToRgba(n[p],n[p+1],n[p+2],n[p+3]),m=r.getObjectByPickId(_);if(e$28(m))return m}if(u===c||u<0&&-u===c||u>0&&u===1-c){var $=h;h=-d,d=$}u+=h,c+=d}},f$c.prototype.isDestroyed=function(){return!1},f$c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),i$Z(this)},n$b.prototype.update=function(e,t,i){var r=t.width,n=t.height,o=this._colorTexture;if(!e$28(o)||o.width!==r||o.height!==n||i!==this._useHdr){S$5(this),this._useHdr=i;var a=i?e.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT:y$U.UNSIGNED_BYTE;this._colorTexture=new L$17({context:e,width:r,height:n,pixelFormat:V$O.RGBA,pixelDatatype:a,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),this._idTexture=new L$17({context:e,width:r,height:n,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),e.depthTexture?(this._depthStencilTexture=new L$17({context:e,width:r,height:n,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}),this._depthStencilIdTexture=new L$17({context:e,width:r,height:n,pixelFormat:V$O.DEPTH_STENCIL,pixelDatatype:y$U.UNSIGNED_INT_24_8,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})):(this._depthStencilRenderbuffer=new o$C({context:e,width:r,height:n,format:M$q.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new o$C({context:e,width:r,height:n,format:M$q.DEPTH_STENCIL})),this._framebuffer=new a$z({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new a$z({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1})}},n$b.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._framebuffer,e$1S.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=this._idFramebuffer,e$1S.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=r},n$b.prototype.getFramebuffer=function(){return this._framebuffer},n$b.prototype.getIdFramebuffer=function(){return this._idFramebuffer},n$b.prototype.isDestroyed=function(){return!1},n$b.prototype.destroy=function(){return S$5(this),i$Z(this)},a$a.prototype.begin=function(e,t){var i=this._context,r=t.width,n=t.height;return f$10.clone(e,this._passState.scissorTest.rectangle),(!e$28(this._fb)||this._width!==r||this._height!==n)&&(this._width=r,this._height=n,this._fb=this._fb&&this._fb.destroy(),this._fb=new a$z({context:i,colorTextures:[new L$17({context:i,width:r,height:n,pixelFormat:V$O.RGB,pixelDatatype:y$U.FLOAT})],depthStencilRenderbuffer:new o$C({context:i,width:r,height:n,format:M$q.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=r,this._passState.viewport.height=n,this._passState},a$a.prototype.end=function(e){var t=u$Y(e.width,1),i=u$Y(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb});r.pixels=n;for(var o=Math.max(t,i),a=o*o,s=Math.floor(.5*t),l=Math.floor(.5*i),u=0,c=0,h=0,d=-1,f=0;f<a;++f){if(-s<=u&&u<=s&&-l<=c&&c<=l){var p=4*((l-c)*t+u+s),_=new e$25(n[p],n[p+1],n[p+2],1);if(_.z<-e$27.EPSILON10)return _}if(u===c||u<0&&-u===c||u>0&&u===1-c){var m=h;h=-d,d=m}u+=h,c+=d}},a$a.prototype.isDestroyed=function(){return!1},a$a.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),i$Z(this)};var X$4=new t$X,z$8=new t$X;function pt$2(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function vt$1(e,t,i){var r=1/Math.max(1,pt$2(e.position,t.position));return t$X.multiplyByScalar(e.position,r,X$4),t$X.multiplyByScalar(t.position,r,z$8),t$X.equalsEpsilon(X$4,z$8,i)&&t$X.equalsEpsilon(e.direction,t.direction,i)&&t$X.equalsEpsilon(e.up,t.up,i)&&t$X.equalsEpsilon(e.right,t.right,i)&&y$15.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}function W$a(e,t,i,r,n,o,a,s){o.length=r;for(var l=0;l<r;++l){var u,c;a?(u=Math.min(t-s,e+l*s),c=Math.min(t,u+s)):(c=i*(u=Math.max(e,Math.pow(i,l)*e)),n||(c=Math.min(t,c)));var h=o[l];e$28(h)?(h.near=u,h.far=c):h=o[l]=new i$b(u,c)}}function dt$3(e,t,i,r){e.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var n=t.frustumCommandsList,o=n.length,a=0;a<o;++a){var s=n[a],l=s.near,u=s.far;if(!(r.start>u)){if(r.stop<l)break;var c=i.pass,h=s.indices[c]++;if(s.commands[c][h]=i,e.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=t.debugFrustumStatistics.commandsInFrustums;d[i.debugOverlappingFrustums]=e$28(d[i.debugOverlappingFrustums])?d[i.debugOverlappingFrustums]+1:1,++t.debugFrustumStatistics.totalCommands}e.updateDerivedCommands(i)}L$c.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return vt$1(t,i,e$27.EPSILON6)?(this._cameraStartFired&&kt$7()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=kt$7(),v$n.clone(t,i),!0)};var Y$6=new i$S,o$d=new o$1t;L$c.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=e._logDepthOverlayCommandList,l=e._overlayAgainstDepthCommandList,u=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var c=this.frustumCommandsList,h=c.length,d=Le$p.NUMBER_OF_PASSES,f=0;f<h;++f)for(var p=0;p<d;++p)c[f].indices[p]=0;o.length=0,a.length=0,s.length=0,l.length=0;for(var _=Number.MAX_VALUE,m=-Number.MAX_VALUE,$=!1,g=t.shadowState.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,x=Number.MAX_VALUE,b=t.mode===P$$.SCENE3D?t.occluder:void 0,w=t.cullingVolume,C=Y$6.planes,T=0;T<5;++T)C[T]=w.planes[T];w=Y$6;for(var S=u.length,E=0;E<S;++E){var A=u[E];if(!e$28(e.terrainProvider)||e.terrainProvider.isShowGlobe||!0!==A.invalid){var P=A.pass;if(P===Le$p.COMPUTE)o.push(A);else if(P===Le$p.LOG_DEPTH_OVERLAY)s.push(A),e.updateDerivedCommands(A);else if(P===Le$p.OVERLAY)a.push(A),e.updateDerivedCommands(A);else if(P===Le$p.OVERLAY_AGAINST_DEPTH)l.push(A),e.updateDerivedCommands(A);else{var I=A.boundingVolume;if(e$28(I)){if(!e.isVisible(A,w,b))continue;if(o$d=I.computePlaneDistances(n,r,o$d),_=Math.min(_,o$d.start),m=Math.max(m,o$d.stop),g&&A.receiveShadows&&o$d.start<F$j.MAXIMUM_DISTANCE&&!(P===Le$p.GLOBE&&o$d.start<-100&&o$d.stop>100)){var M=o$d.stop-o$d.start;P!==Le$p.GLOBE&&o$d.start<100&&(x=Math.min(x,M));var O=Math.max(o$d.start,5);v=Math.min(v,O),y=Math.max(y,o$d.stop)}}else o$d.start=i.frustum.near,o$d.stop=i.frustum.far,$=!(A instanceof r$11);dt$3(e,this,A,o$d)}}}$?(_=i.frustum.near,m=i.frustum.far):(_=Math.min(Math.max(_,i.frustum.near),i.frustum.far),_=t.useLogDepth?_:Math.max(_,1),m=Math.max(Math.min(m,i.frustum.far),_),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v+1))),g&&(t.shadowState.nearPlane=Math.max(v,1),t.shadowState.farPlane=y,t.shadowState.closestObjectSize=x);var D,R=e.mode===P$$.SCENE2D,L=t.useLogDepth,B=L?e.logarithmicDepthFarToNearRatio:e.farToNearRatio;!t.useLogDepth&&t.context.depthTexture&&(t.passes.fbo||t._isDepth||e.compositor.isScanEnable())&&(B=e.logarithmicDepthFarToNearRatio,_=Math.max(_,1)),R?(m=Math.min(m,i.position.z+e.nearToFarDistance2D),_=Math.min(_,m),D=Math.ceil(Math.max(1,m-_)/e.nearToFarDistance2D)):D=Math.ceil(Math.log(m/_)/Math.log(B)),(this.updateFrustums||_!==Number.MAX_VALUE&&(D!==h||0!==c.length&&(_<c[0].near||m>c[h-1].far&&(L||!e$27.equalsEpsilon(m,c[h-1].far,e$27.EPSILON8)))))&&(this.updateFrustums=!1,W$a(_,m,B,D,L,c,R,e.nearToFarDistance2D),this.createPotentiallyVisibleSet(e));var N=t.frustumSplits;N.length=D+1;for(var F=0;F<D;++F)N[F]=c[F].near,F===D-1&&(N[F+1]=c[F].far);"normal"===t._fboState.name&&(e._commandsNear=_,e._commandsFar=m)},L$c.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickPointFramebuffer=this.pickPointFramebuffer&&this.pickPointFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.normalFramebuffer=this.normalFramebuffer&&this.normalFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy();var e,t,i=this.pickDepths,r=this.debugGlobeDepths;for(t=i.length,e=0;e<t;++e)i[e].destroy();for(t=r.length,e=0;e<t;++e)r[e].destroy()};var J$9=.1,wt$1=new a$k({pass:gr$4.MOST_DETAILED_PRELOAD}),yt=new a$k({pass:gr$4.MOST_DETAILED_PICK}),b$f=new a$k({pass:gr$4.PICK});function d$g(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;var t=new f$10(0,0,1,1),i=new v$n(e);i.frustum=new a$X({width:J$9,aspectRatio:1,near:.1}),this._pickOffscreenView=new L$c(e,i,t)}d$g.prototype.update=function(){this._pickPositionCacheDirty=!0},d$g.prototype.getPickDepth=function(e,t){var i=e.view.pickDepths,r=i[t];return e$28(r)||(r=new f$d,i[t]=r),r};var kt$1=new l$$,Ct$1=new t$X,M$a=new t$X,Pt$2=new o$1k,Dt$2=new y$15;function St(e,t,i,r,n){var o=e.camera,a=o.frustum;e$28(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(a.right-a.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(a.top-a.bottom);var u=y$15.clone(o.transform,Dt$2);o._setTransform(y$15.IDENTITY);var c=t$X.clone(o.position,Ct$1);t$X.multiplyByScalar(o.right,s,M$a),t$X.add(M$a,c,c),t$X.multiplyByScalar(o.up,l,M$a),t$X.add(M$a,c,c),o._setTransform(u),e.mode===P$$.SCENE2D&&t$X.fromElements(c.z,c.x,c.y,c);var h=a.getPixelDimensions(n.width,n.height,1,1,Pt$2),d=kt$1;return d.right=.5*h.x,d.left=-d.right,d.top=.5*h.y,d.bottom=-d.top,d.near=a.near,d.far=a.far,d.computeCullingVolume(c,o.directionWC,o.upWC)}var Ft$1=new l$X,Rt$1=new o$1k;function Ot(e,t,i,r,n){var o=e.camera,a=o.frustum,s=a.near,l=Math.tan(.5*a.fovy),u=a.aspectRatio*l,c=(2*(t.x-n.x)/n.width-1)*s*u,h=(2*(n.height-t.y-n.y)/n.height-1)*s*l,d=a.getPixelDimensions(n.width,n.height,1,1,Rt$1),f=d.x*i*.5,p=d.y*r*.5,_=Ft$1;return _.top=h+p,_.bottom=h-p,_.right=c+f,_.left=c-f,_.near=s,_.far=a.far,_.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function Q$8(e,t,i,r,n){var o=e.camera.frustum;return o instanceof a$X||o instanceof l$$?St(e,t,i,r,n):Ot(e,t,i,r,n)}var R$9=3,V$7=3,P$7=new f$10(0,0,R$9,V$7),$$6=new o$1k,G$a=new e$1S(0,0,0,0);function Ht(e,t){var i=e.context,r=e.frameState,n=e.environmentState,o=e.defaultView;e.view=o;var a=o.viewport;a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;var s=o.passState;s.viewport=f$10.clone(a,s.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=Q$8(e,t,1,1,a),r.tilesetPassState=b$f,e.updateEnvironment(),n.renderTranslucentDepthForPick=!0,s=o.pickDepthFramebuffer.update(i,t,a),e.updateAndExecuteCommands(s,G$a),e.resolveFramebuffers(s),i.endFrame()}d$g.prototype.pick=function(e,t,i,r){if(!e$28(t))throw new t$Z("windowPosition is undefined.");R$9=u$Y(i,3),V$7=u$Y(r,R$9);var n=e.context,o=n.uniformState,a=e.frameState,s=e.defaultView;e.view=s;var l=s.viewport;l.x=0,l.y=0,l.width=n.drawingBufferWidth,l.height=n.drawingBufferHeight;var u=s.passState;u.viewport=f$10.clone(l,u.viewport);var c=m$W.transformWindowToDrawingBuffer(e,t,$$6);e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=Q$8(e,c,R$9,V$7,l),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=b$f,o.update(a),e.updateEnvironment(),P$7.x=c.x-.5*(R$9-1),P$7.y=e.drawingBufferHeight-c.y-.5*(V$7-1),P$7.width=R$9,P$7.height=V$7,u=s.pickFramebuffer.begin(P$7,s.viewport),e.updateAndExecuteCommands(u,G$a),e.resolveFramebuffers(u);var h=s.pickFramebuffer.end(P$7);return n.endFrame(),h};var xt$1=new o$15,_t$2=new l$X,Vt$2=new a$X,Mt$1=new l$$;d$g.prototype.pickPositionWorldCoordinates=function(e,t,i){if(e.useDepthPicking){if(!e$28(t))throw new t$Z("windowPosition is undefined.");if(!e.context.depthTexture)throw new t$Z("Picking from the depth buffer is not supported. Check pickPositionSupported.");var r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return t$X.clone(this._pickPositionCache[r],i);var n=e.frameState,o=e.context,a=o.uniformState,s=e.defaultView;e.view=s;var l=m$W.transformWindowToDrawingBuffer(e,t,$$6);e.pickTranslucentDepth?Ht(e,l):(e.updateFrameState(),a.update(n),e.updateEnvironment()),l.y=e.drawingBufferHeight-l.y;var u,c=e.camera;u=e$28(c.frustum.fov)?c.frustum.clone(xt$1):e$28(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(_t$2):e$28(c.frustum.width)?c.frustum.clone(Vt$2):c.frustum.clone(Mt$1);for(var h=s.frustumCommandsList,d=h.length,f=0;f<d;++f){var p=this.getPickDepth(e,f).getDepth(o,l.x,l.y);if(p>0&&p<1){var _,m=h[f];return e.mode===P$$.SCENE2D?(_=c.position.z,c.position.z=_-m.near+1,u.far=Math.max(1,m.far-m.near),u.near=1,a.update(n),a.updateFrustum(u)):(u.near=m.near*(0!==f?e.opaqueFrustumNearOffset:1),u.far=m.far,a.updateFrustum(u)),i=m$W.drawingBufferToWgs84Coordinates(e,l,p,i),e.mode===P$$.SCENE2D&&(c.position.z=_,a.update(n)),this._pickPositionCache[r]=t$X.clone(i),i}}this._pickPositionCache[r]=void 0}};var Nt$2=new t$W;function j$a(e,t){var i,r,n=[],o=[],a=[],s=[];e$28(e)||(e=Number.MAX_VALUE);for(var l=t();e$28(l);){var u=l.object,c=l.position,h=l.exclude;if(e$28(c)&&!e$28(u)){n.push(l);break}if(!e$28(u)||!e$28(u.primitive)||!h&&(n.push(l),0>=--e))break;var d=u.primitive,f=!1;"function"==typeof d.getGeometryInstanceAttributes&&e$28(u.id)&&(e$28(r=d.getGeometryInstanceAttributes(u.id))&&e$28(r.show)&&(f=!0,r.show=e$1h.toValue(!1,r.show),a.push(r))),u instanceof e$10&&(f=!0,u.show=!1,s.push(u)),f||(d.show=!1,o.push(d)),l=t()}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)(r=a[i]).show=e$1h.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}d$g.prototype.pickPosition=function(e,t,i){if(e$28(i=this.pickPositionWorldCoordinates(e,t,i))&&e.mode!==P$$.SCENE3D){t$X.fromElements(i.y,i.z,i.x,i);var r=e.mapProjection,n=r.ellipsoid,o=r.unproject(i,Nt$2);n.cartographicToCartesian(o,i)}return i},d$g.prototype.drillPick=function(e,t,i,r,n){var o=this,a=j$a(i,(function(){var i=o.pick(e,t,r,n);if(e$28(i))return{object:i,position:void 0,exclude:!1}}));return a.map((function(e){return e.object}))};var tt$4=new t$X,Wt=new t$X;function Et$1(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=o$1q.defer(),this.promise=this.deferred.promise}function rt$5(e,t,i,r){var n=t.direction,o=t$X.mostOrthogonalAxis(n,tt$4),a=t$X.cross(n,o,tt$4),s=t$X.cross(n,a,Wt);return r.position=t.origin,r.direction=n,r.up=s,r.right=a,r.frustum.width=u$Y(i,J$9),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Tt$1(e,t,i){var r=t.frameState,n=i.ray,o=i.width,a=i.tilesets,s=e._pickOffscreenView.camera,l=rt$5(e,n,o,s),u=wt$1;u.camera=s,u.cullingVolume=l;for(var c=!0,h=a.length,d=0;d<h;++d){var f=a[d];f.show&&t.primitives.contains(f)&&(f.updateForPass(r,u),c=c&&u.ready)}return c&&i.deferred.resolve(),c}function et$4(e,t,i){for(var r=e.length,n=0;n<r;++n){var o=e.get(n);o.show&&(e$28(o.isCesium3DTileset)?(!e$28(t)||-1===t.indexOf(o))&&i.push(o):o instanceof o$I&&et$4(o,t,i))}}function N$6(e,t,i,r,n,o){var a=[];if(et$4(t.primitives,r,a),0===a.length)return o$1q.resolve(o());var s=new Et$1(i,n,a);return e._mostDetailedRayPicks.push(s),s.promise.then((function(){return o()}))}function At(e,t){return!(!e$28(e)||!e$28(t)||0===t.length)&&(t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1)}function It$3(e,t,i,r,n,o,a){var s=t.context,l=s.uniformState,u=t.frameState,c=e._pickOffscreenView;t.view=c,rt$5(e,i,n,c.camera),P$7=f$10.clone(c.viewport,P$7);var h=c.pickFramebuffer.begin(P$7,c.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,c.updateFrustums=!0,u.tilesetPassState=a?yt:b$f,l.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(h,G$a),t.resolveFramebuffers(h);var d,f=c.pickFramebuffer.end(s);if(t.context.depthTexture)for(var p=c.frustumCommandsList.length,_=0;_<p;++_){var m=e.getPickDepth(t,_).getDepth(s,0,0);if(m>0&&m<1){var $=c.frustumCommandsList[_],g=$.near*(0!==_?t.opaqueFrustumNearOffset:1),v=g+m*($.far-g);d=f$18.getPoint(i,v);break}}if(t.view=t.defaultView,s.endFrame(),e$28(f)||e$28(d))return{object:f,position:d,exclude:!e$28(d)&&o||At(f,r)}}function it$2(e,t,i,r,n,o,a,s){return j$a(r,(function(){return It$3(e,t,i,n,o,a,s)}))}function O$9(e,t,i,r,n,o,a){var s=it$2(e,t,i,1,r,n,o,a);if(s.length>0)return s[0]}function at$5(e,t,i,r,n,o,a,s){return it$2(e,t,i,r,n,o,a,s)}function W$9(e,t){var i=o$1q.defer();return t.then((function(t){var r=e.postRender.addEventListener((function(){i.resolve(t),r()}));e.requestRender()})).otherwise((function(e){i.reject(e)})),i.promise}d$g.prototype.updateMostDetailedRayPicks=function(e){for(var t=this._mostDetailedRayPicks,i=0;i<t.length;++i)Tt$1(this,e,t[i])&&t.splice(i--,1)},d$g.prototype.pickFromRay=function(e,t,i,r){if(o$1u.defined("ray",t),e.mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");return O$9(this,e,t,i,r,!1,!1)},d$g.prototype.drillPickFromRay=function(e,t,i,r,n){if(o$1u.defined("ray",t),e.mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");return at$5(this,e,t,i,r,n,!1,!1)},d$g.prototype.pickFromRayMostDetailed=function(e,t,i,r){if(o$1u.defined("ray",t),e.mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");var n=this;return t=f$18.clone(t),i=e$28(i)?i.slice():i,W$9(e,N$6(n,e,t,i,r,(function(){return O$9(n,e,t,i,r,!1,!0)})))},d$g.prototype.drillPickFromRayMostDetailed=function(e,t,i,r,n){if(o$1u.defined("ray",t),e.mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");var o=this;return t=f$18.clone(t),r=e$28(r)?r.slice():r,W$9(e,N$6(o,e,t,r,n,(function(){return at$5(o,e,t,i,r,n,!1,!0)})))};var Bt$1=new t$X,Lt$1=new t$X,zt=new f$18,ot$4=new t$W;function K$5(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid,n=e$1_._defaultMaxTerrainHeight,o=r.geodeticSurfaceNormalCartographic(t,Lt$1),a=t$W.toCartesian(t,r,Bt$1),s=zt;s.origin=a,s.direction=o;var l=new f$18;return f$18.getPoint(s,n,l.origin),t$X.negate(o,l.direction),l}function nt$4(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid;return K$5(e,t$W.fromCartesian(t,r,ot$4))}function ft$2(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid;return t$W.fromCartesian(t,r,ot$4).height}function qt(e,t,i,r,n){var o=K$5(t,i);return N$6(e,t,o,r,n,(function(){var i=O$9(e,t,o,r,n,!0,!0);if(e$28(i))return ft$2(t,i.position)}))}function bt(e,t,i,r,n,o){var a=nt$4(t,i);return N$6(e,t,a,r,n,(function(){var i=O$9(e,t,a,r,n,!0,!0);if(e$28(i))return t$X.clone(i.position,o)}))}function M$9(e){if(this._positions=u$Y(e,[new t$X,new t$X,new t$X]),this.boundingSphere=i$19.fromPoints(e),e$28(e)){var t=U$Q.fromPositions({positions:e,perPositionHeight:!0});this._geometry=U$Q.createGeometry(t),this._triangleArrayByWeight=S$4(this)}this._density=1}d$g.prototype.sampleHeight=function(e,t,i,r){if(o$1u.defined("position",t),e.mode!==P$$.SCENE3D)throw new t$Z("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new t$Z("sampleHeight requires depth texture support. Check sampleHeightSupported.");var n=O$9(this,e,K$5(e,t),i,r,!0,!1);if(e$28(n))return ft$2(e,n.position)},d$g.prototype.clampToHeight=function(e,t,i,r,n){if(o$1u.defined("cartesian",t),e.mode!==P$$.SCENE3D)throw new t$Z("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new t$Z("clampToHeight requires depth texture support. Check clampToHeightSupported.");var o=O$9(this,e,nt$4(e,t),i,r,!0,!1);if(e$28(o))return t$X.clone(o.position,n)},d$g.prototype.sampleHeightMostDetailed=function(e,t,i,r){if(o$1u.defined("positions",t),e.mode!==P$$.SCENE3D)throw new t$Z("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new t$Z("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");i=e$28(i)?i.slice():i;for(var n=t.length,o=new Array(n),a=0;a<n;++a)o[a]=qt(this,e,t[a],i,r);return W$9(e,o$1q.all(o).then((function(e){for(var i=e.length,r=0;r<i;++r)t[r].height=e[r];return t})))},d$g.prototype.clampToHeightMostDetailed=function(e,t,i,r){if(o$1u.defined("cartesians",t),e.mode!==P$$.SCENE3D)throw new t$Z("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new t$Z("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");i=e$28(i)?i.slice():i;for(var n=t.length,o=new Array(n),a=0;a<n;++a)o[a]=bt(this,e,t[a],i,r,t[a]);return W$9(e,o$1q.all(o).then((function(e){for(var i=e.length,r=0;r<i;++r)t[r]=e[r];return t})))},d$g.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()},Object.defineProperties(M$9.prototype,{type:{get:function(){return"Polygon"}},positions:{get:function(){return this._positions},set:function(e){if(e$28(e)){this._positions=e;var t=U$Q.fromPositions({positions:this._positions,perPositionHeight:!0});this._geometry=U$Q.createGeometry(t),this._triangleArrayByWeight=S$4(this),this.boundingSphere=i$19.fromPoints(e),e$28(this.owner)&&(this.owner._updateParticlePool=!0)}}},density:{set:function(e){e!==this._density&&(this._density=e,e$28(this.owner)&&(this.owner._updateParticlePool=!0))},get:function(){return this._density}},areaFactor:{get:function(){return this._density*this._area/100|0}}});var l$c=new t$X,_$a=new t$X,x$7=new t$X;function S$4(e){var t,i,r=e._geometry,n=r.indices,o=n.length/3,a=r.attributes.position.values,s=[],l=0;for(t=0;t<o;t++){var u=n[3*t],c=n[3*t+1],h=n[3*t+2];l$c.x=a[3*u],l$c.y=a[3*u+1],l$c.z=a[3*u+2],_$a.x=a[3*c],_$a.y=a[3*c+1],_$a.z=a[3*c+2],x$7.x=a[3*h],x$7.y=a[3*h+1],x$7.z=a[3*h+2];var d=j$9(l$c,_$a,x$7);l+=d,s.push(d)}e._area=l;var f=Math.max(100,10*o),p=[];for(t=0;t<o;t++){var _=Math.floor(s[t]/l*f);for(_=Math.max(1,_),i=0;i<_;i++)p.push(t)}return p}var b$e=new t$X,W$8=new t$X,z$7=new t$X;function j$9(e,t,i){return b$e=t$X.subtract(t,e,b$e),W$8=t$X.subtract(i,e,W$8),z$7=t$X.cross(b$e,W$8,z$7),.5*t$X.magnitude(z$7)}function C$a(e,t,i,r,n){return(1-Math.sqrt(e))*i+Math.sqrt(e)*(1-t)*r+Math.sqrt(e)*t*n}M$9.prototype.emit=function(e){if(e$28(this._geometry)){var t=Math.floor(e$27.randomBetween(0,this._triangleArrayByWeight.length)),i=this._triangleArrayByWeight[t],r=this._geometry.indices[3*i],n=this._geometry.indices[3*i+1],o=this._geometry.indices[3*i+2],a=this._geometry.attributes.position.values,s=a[3*r],l=a[3*r+1],u=a[3*r+2],c=a[3*n],h=a[3*n+1],d=a[3*n+2],f=a[3*o],p=a[3*o+1],_=a[3*o+2],m=e$27.randomBetween(0,1),$=e$27.randomBetween(0,1),g=C$a(m,$,s,c,f),v=C$a(m,$,l,h,p),y=C$a(m,$,u,d,_);e.position=t$X.fromElements(g,v,y,e.position),e.velocity=t$X.normalize(e.position,e.velocity)}};var e$6={NEAREST:0,LINEAR:1};function p$8(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).fragmentShader,i=u$Y(e.textureScale,1),r=u$Y(e.pixelFormat,V$O.RGBA);if(o$1u.typeOf.string("options.fragmentShader",t),o$1u.typeOf.number.greaterThan("options.textureScale",i,0),o$1u.typeOf.number.lessThanOrEquals("options.textureScale",i,1),!V$O.isColorFormat(r))throw new t$Z("options.pixelFormat must be a color format.");this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=u$Y(e.forcePowerOfTwo,!1),this._sampleMode=u$Y(e.sampleMode,e$6.NEAREST),this._blendingState=e.blendingState,this._pixelFormat=r,this._pixelDatatype=u$Y(e.pixelDatatype,y$U.UNSIGNED_BYTE),this._clearColor=u$Y(e.clearColor,e$1S.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;var n=new n$p;n.scissorTest={enabled:!0,rectangle:e$28(e.scissorRectangle)?f$10.clone(e.scissorRectangle):new f$10},this._passState=n,this._ready=!1;var o=e.name;e$28(o)||(o=e$1K()),this._name=o,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(p$8.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(e$28(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(e$28(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 z$6=/uniform\s+sampler2D\s+depthTexture/g;function H$a(e,t,i){var r=t[i];return("string"==typeof r||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData)&&e._dirtyUniforms.push(i),{get:function(){return t[i]},set:function(r){var n=t[i];t[i]=r;var o=e._actualUniforms,a=o[i];e$28(a)&&a!==n&&a instanceof L$17&&!e$28(e._textureCache.getStageByName(i))&&(e._texturesToRelease.push(a),delete o[i],delete o[i+"Dimensions"]),n instanceof L$17&&e._texturesToRelease.push(n),"string"==typeof r||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(i):o[i]=r}}}function V$6(e,t){return function(){var i=e._actualUniforms[t];return"function"==typeof i?i():i}}function k$c(e,t){return function(){var i=e[t]();if(e$28(i))return i.dimensions}}function Y$5(e){if(!e$28(e._uniformMap)){var t={},i={},r=e._uniforms,n=e._actualUniforms;for(var o in r)if(r.hasOwnProperty(o)){"function"!=typeof r[o]?(t[o]=V$6(e,o),i[o]=H$a(e,r,o)):(t[o]=r[o],i[o]=r[o]),n[o]=r[o];var a=t[o]();("string"==typeof a||a instanceof L$17||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[o+"Dimensions"]=k$c(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,i),e._uniformMap=p$17(t,{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 q$6(e,t){if(!e$28(e._command)||e._logDepthChanged||e._selectedDirty){var i=e._fragmentShader;if(e$28(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) * 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,""));var r=new a$$({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]});e._command=t.createViewportQuadCommand(r,{uniformMap:e._uniformMap,owner:e})}}function W$7(e){var t,i;e._sampleMode===e$6.LINEAR?(t=tt$h.LINEAR,i=rt$g.LINEAR):(t=tt$h.NEAREST,i=rt$g.NEAREST);var r=e._sampler;(!e$28(r)||r.minificationFilter!==t||r.magnificationFilter!==i)&&(e._sampler=new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function j$8(e,t){return function(i){e._texturesToCreate.push({name:t,source:i})}}function J$8(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function K$4(e,t){var i,r,n,o=e._texturesToRelease,a=o.length;for(i=0;i<a;++i)r=(r=o[i])&&r.destroy();o.length=0;var s=e._texturesToCreate;for(a=s.length,i=0;i<a;++i){var l=s[i];n=l.name;var u=l.source;e._actualUniforms[n]=new L$17({context:t,source:u})}s.length=0;var c=e._dirtyUniforms;if(0!==c.length||e$28(e._texturePromise)){if(0!==c.length&&!e$28(e._texturePromise)){a=c.length;var h=e._uniforms,d=[];for(i=0;i<a;++i){var f=h[n=c[i]];if(e$28(e._textureCache.getStageByName(f)))e._actualUniforms[n]=J$8(e,f);else if("string"==typeof f){var p=new t$S({url:f});d.push(p.fetchImage().then(j$8(e,n)))}else e._texturesToCreate.push({name:n,source:f})}c.length=0,d.length>0?(e._ready=!1,e._texturePromise=o$1q.all(d).then((function(){e._ready=!0,e._texturePromise=void 0}))):e._ready=!0}}else e._ready=!0}function g$b(e){e$28(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(e$28(t)){var i=e._uniforms,r=e._actualUniforms;for(var n in r)r.hasOwnProperty(n)&&r[n]instanceof L$17&&(e$28(t.getStageByName(i[n]))||r[n].destroy(),e._dirtyUniforms.push(n))}}function Q$7(e){var t=e$28(e._selected)?e._selected.length:0,i=e$28(e._parentSelected)?e._parentSelected:0,r=e._selected!==e._selectedShadow||t!==e._selectedLength;if(r=r||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,e$28(e._selected)&&e$28(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):e$28(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&e$28(e._combinedSelected)){if(!e$28(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 Z$7(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var i=e._combinedSelected;if(e$28(i)){var r,n,o=0,a=i.length;for(r=0;r<a;++r)e$28((n=i[r]).pickIds)?o+=n.pickIds.length:e$28(n.pickId)&&++o;if(0===a||0===o){var s=new Uint8Array(4);return s[0]=255,s[1]=255,s[2]=255,s[3]=255,void(e._selectedIdTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}))}var l,u=0,c=new Uint8Array(4*o);for(r=0;r<a;++r)if(e$28((n=i[r]).pickIds))for(var h=n.pickIds,d=h.length,f=0;f<d;++f)l=h[f].color,c[u]=e$1S.floatToByte(l.red),c[u+1]=e$1S.floatToByte(l.green),c[u+2]=e$1S.floatToByte(l.blue),c[u+3]=e$1S.floatToByte(l.alpha),u+=4;else e$28(n.pickId)&&(l=n.pickId.color,c[u]=e$1S.floatToByte(l.red),c[u+1]=e$1S.floatToByte(l.green),c[u+2]=e$1S.floatToByte(l.blue),c[u+3]=e$1S.floatToByte(l.alpha),u+=4);e._selectedIdTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:c,width:o,height:1},sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})}}}p$8.prototype._isSupported=function(e){return!z$6.test(this._fragmentShader)||e.depthTexture},p$8.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&g$b(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Q$7(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=e$28(this._selected)?this._selected.length:0,this._parentSelectedLength=e$28(this._parentSelected)?this._parentSelected.length:0,Z$7(this,e),Y$5(this),K$4(this,e),q$6(this,e),W$7(this),this._selectedDirty=!1,this._ready)){var i=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=i,e$28(i)){var r,n=i.getColorTexture(0);(n.width!==e.drawingBufferWidth||n.height!==e.drawingBufferHeight||e$28(this._blendingState))&&((!e$28(r=this._renderState)||n.width!==r.viewport.width||n.height!==r.viewport.height)&&(this._renderState=u$R.fromCache({viewport:new f$10(0,0,n.width,n.height),blending:this._blendingState}))),this._command.renderState=r}}},p$8.prototype.execute=function(e,t,i,r){if(e$28(this._command)&&e$28(this._command.framebuffer)&&this._ready&&this._enabled){this._colorTexture=t,this._depthTexture=i,this._idTexture=r,n$Y.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.ignoreWEBGL2=!0,this._colorTexture.sampler=this._sampler);var n=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;e$28(n)&&(n.context=e),this._command.execute(e,n)}},p$8.prototype.isDestroyed=function(){return!1},p$8.prototype.destroy=function(){return g$b(this),i$Z(this)};var b$d="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\nfloat g = 0.985;\nfloat a = 0.065;\nfloat b = 0.0001;\nfloat c = 0.433;\nfloat d = 0.238;\ncolor = (color * (color + a) - b) / (color * (g * color + c) + d);\ncolor = clamp(color, 0.0, 1.0);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",w$6="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",T$9="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",z$5="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",E$d="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",C$9="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",O$8="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",D$a="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",A$c="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",R$8="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",y$a="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",P$6="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",L$b="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",k$b="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",M$8="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",U$8="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",I$6="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";function s$b(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.defined("options.stages",e.stages),o$1u.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=u$Y(e.inputPreviousStageTexture,!0);var t=e.name;e$28(t)||(t=e$1K()),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 u$c(e){var t=e$28(e._selected)?e._selected.length:0,i=e$28(e._parentSelected)?e._parentSelected:0,r=e._selected!==e._selectedShadow||t!==e._selectedLength;if(r=r||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,e$28(e._selected)&&e$28(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):e$28(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&e$28(e._combinedSelected)){if(!e$28(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(s$b.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}}}),s$b.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},s$b.prototype.get=function(e){return o$1u.typeOf.number.greaterThanOrEquals("index",e,0),o$1u.typeOf.number.lessThan("index",e,this.length),this._stages[e]},s$b.prototype.update=function(e,t){this._selectedDirty=u$c(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=e$28(this._selected)?this._selected.length:0,this._parentSelectedLength=e$28(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,r=i.length,n=0;n<r;++n){var o=i[n];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}},s$b.prototype.isDestroyed=function(){return!1},s$b.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return i$Z(this)};var V$5="uniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nuniform float scale;\nvoid main ()\n{\nvec4 oriColor = texture2D(colorTexture, v_textureCoordinates);\nvec4 fogColor = vec4(0.8, 0.8, 0.8, 0.5);\nfloat depth = texture2D(depthTexture, v_textureCoordinates).r;\nfloat f = (depth - 0.7) * min(1.0, max(scale, 0.0)) / 0.2;\ngl_FragColor = mix(oriColor, fogColor, clamp(f, 0.0, 1.0));\n}\n",Y$4="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nuniform float speed;\nuniform float angle;\nfloat hash(float x){\nreturn fract(sin(x * 133.3) * 13.13);\n}\nvoid main(void){\nfloat time = czm_frameNumber / 60.0;\nvec2 resolution = czm_viewport.zw;\nvec2 uv = (gl_FragCoord.xy * 2.0 - resolution.xy) / min(resolution.x, resolution.y);\nvec3 c = vec3(0.6, 0.7, 0.8);\nfloat a = angle;\nfloat si = sin(a);\nfloat co = cos(a);\nuv *= mat2(co, -si, si, co);\nuv *= length(uv + vec2(0.0, 4.9)) * 0.3 + 1.0;\nfloat v = 1.0 - sin(hash(floor(uv.x * 100.0)) * 2.0);\nfloat b = clamp(abs(sin(speed * time * v + uv.y * (5.0 / (2.0 + v)))) - 0.95, 0.0, 1.0) * 20.0;\nc *= v * b;\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c, 1.0), speed < 0.00001 ? 0.0 : 0.15);\n}\n",G$9="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nuniform int density;\nuniform float speed;\nuniform float angle;\nfloat snow(vec2 uv, float scale)\n{\nfloat time = czm_frameNumber / 60.0;\nfloat w = smoothstep(1.0 , 0.0, -uv.y * (scale / 10.0));\nif(w < 0.1) return 0.0;\nuv += time / scale;\nuv.y += time * cos(angle) * speed / scale;\nuv.x += sin(uv.y + time * sin(angle) * speed) / scale;\nuv *= scale;\nvec2 s = floor(uv);\nvec2 f = fract(uv);\nvec2 p;\nfloat k = 3.0;\nfloat d;\np = 0.5 + 0.35 * sin(11.0 * fract(sin((s + p + scale) * mat2(7, 3, 6, 5)) * 5.0)) - f;\nd = length(p);\nk = min(d, k);\nk = smoothstep(0.0, k, sin(f.x + f.y) * 0.01);\nreturn k * w * clamp(float(density) / 5.0, 1.0, 5.0);\n}\nvoid main(void){\nvec2 resolution = czm_viewport.zw;\nvec2 uv = (gl_FragCoord.xy * 2.0 - resolution.xy) / min(resolution.x, resolution.y);\nvec3 finalColor = vec3(0);\nfloat c = 0.0;\nfor (int i = 2; i < 5; i++) {\nif (density < i) {\nbreak;\n}\nc += snow(uv, float(i));\n}\nfor (int i = 6; i < 10; i+= 2) {\nif (density < i) {\nbreak;\n}\nc += snow(uv, float(i));\n}\nfor (int i = 15; i < 30; i+= 5) {\nif (density < i) {\nbreak;\n}\nc += snow(uv, float(i));\n}\nfinalColor = vec3(c);\nif(c > 0.8)\n{\nfinalColor = vec3(max(5.0, c));\n}\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor, 1.0), 0.15);\n}\n",o$c={};function v$a(e){var t="#define USE_STEP_SIZE\n"+W$l,i=new p$8({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:e$6.LINEAR}),r=new p$8({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:e$6.LINEAR}),n={};return Object.defineProperties(n,{delta:{get:function(){return i.uniforms.delta},set:function(e){var t=i.uniforms,n=r.uniforms;t.delta=n.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){var t=i.uniforms,n=r.uniforms;t.sigma=n.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){var t=i.uniforms,n=r.uniforms;t.stepSize=n.stepSize=e}}}),new s$b({name:e,stages:[i,r],uniforms:n})}function H$9(e){if(!e$28(e))return o$c.createEdgeDetectionStage();for(var t=new s$b({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},r="",n="",o=0;o<e.length;++o)r+="uniform sampler2D edgeTexture"+o+"; \n",n+=" vec4 edge"+o+" = texture2D(edgeTexture"+o+", v_textureCoordinates); \n if (edge"+o+".a > 0.0) \n { \n color = edge"+o+"; \n break; \n } \n",i["edgeTexture"+o]=e[o].name;return new s$b({name:"czm_edge_detection_composite",stages:[t,new p$8({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})]})}o$c.createBlurStage=function(){return v$a("czm_blur")},o$c.createDepthOfFieldStage=function(){var e=v$a("czm_depth_of_field_blur"),t=new p$8({name:"czm_depth_of_field_composite",fragmentShader:D$a,uniforms:{focalDistance:5,blurTexture:e.name}}),i={};return Object.defineProperties(i,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(e){t.uniforms.focalDistance=e}},delta:{get:function(){return e.uniforms.delta},set:function(t){e.uniforms.delta=t}},sigma:{get:function(){return e.uniforms.sigma},set:function(t){e.uniforms.sigma=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}}}),new s$b({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:i})},o$c.isDepthOfFieldSupported=function(e){return e.context.depthTexture},o$c.createEdgeDetectionStage=function(){return new p$8({name:"czm_edge_detection_"+e$1K(),fragmentShader:R$8,uniforms:{length:.25,color:e$1S.clone(e$1S.BLACK)}})},o$c.isEdgeDetectionSupported=function(e){return e.context.depthTexture},o$c.createSilhouetteStage=function(e){var t=H$9(e);return new s$b({name:"czm_silhouette",stages:[t,new p$8({name:"czm_silhouette_color_edges",fragmentShader:I$6,uniforms:{silhouetteTexture:t.name}})],inputPreviousStageTexture:!1,uniforms:t.uniforms})},o$c.isSilhouetteSupported=function(e){return e.context.depthTexture},o$c.createBloomStage=function(){var e=new p$8({name:"czm_bloom_contrast_bias",fragmentShader:O$8,uniforms:{contrast:128,brightness:-.3}}),t=v$a("czm_bloom_blur"),i=new s$b({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),r=new p$8({name:"czm_bloom_generate_composite",fragmentShader:E$d,uniforms:{glowOnly:!1,bloomTexture:i.name}}),n={};return Object.defineProperties(n,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return e.uniforms.contrast},set:function(t){e.uniforms.contrast=t}},brightness:{get:function(){return e.uniforms.brightness},set:function(t){e.uniforms.brightness=t}},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 s$b({name:"czm_bloom",stages:[i,r],inputPreviousStageTexture:!1,uniforms:n})},o$c.createAmbientOcclusionStage=function(){var e=new p$8({name:"czm_ambient_occlusion_generate",fragmentShader:w$6,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=v$a("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;var i=new s$b({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),r=new p$8({name:"czm_ambient_occlusion_composite",fragmentShader:T$9,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:i.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(t){e.uniforms.intensity=t}},bias:{get:function(){return e.uniforms.bias},set:function(t){e.uniforms.bias=t}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(t){e.uniforms.lengthCap=t}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(t){e.uniforms.stepSize=t}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(t){e.uniforms.frustumLength=t}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(t){e.uniforms.randomTexture=t}},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}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new s$b({name:"czm_ambient_occlusion",stages:[i,r],inputPreviousStageTexture:!1,uniforms:n})},o$c.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var Q$6="#define FXAA_QUALITY_PRESET 39 \n"+X$d+"\n"+P$6;function l$b(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function m$d(e){for(;e$28(e.length);)e=e.get(e.length-1);return e.name}function _$9(e,t,i,r,n){if(!r.enabled||!r._isSupported(t))return n;var o=i[r.name]={};e$28(n)&&(o[m$d(e.getStageByName(n))]=!0);var a=r.uniforms;if(e$28(a))for(var s=Object.getOwnPropertyNames(a),l=s.length,u=0;u<l;++u){var c=a[s[u]];if("string"==typeof c){var h=e.getStageByName(c);e$28(h)&&(o[m$d(h)]=!0)}}return r.name}function b$c(e,t,i,r,n){if(e$28(r.enabled)&&!r.enabled||e$28(r._isSupported)&&!r._isSupported(t))return n;for(var o=n,a=!e$28(r.inputPreviousStageTexture)||r.inputPreviousStageTexture,s=n,l=r.length,u=0;u<l;++u){var c=r.get(u);s=e$28(c.length)?b$c(e,t,i,c,n):_$9(e,t,i,c,n),a&&(n=s)}var h,d;if(a)for(h=1;h<l;++h)e$28(i[d=m$d(r.get(h))])||(i[d]={}),i[d][o]=!0;else for(h=1;h<l;++h)for(var f=i[d=m$d(r.get(h))],p=0;p<h;++p)f[m$d(r.get(p))]=!0;return s}function E$c(e,t){var i={};if(e$28(e.ambientOcclusion)){var r=e._outline,n=e.ambientOcclusion,o=e.bloom,a=e._tonemapping,s=e.fxaa,l=e.fog,u=e.rain,c=e.snow,h=b$c(e,t,i,r,void 0);h=_$9(e,t,i,l,h),h=_$9(e,t,i,c,h),h=b$c(e,t,i,n,h=_$9(e,t,i,u,h)),h=_$9(e,t,i,a,h=b$c(e,t,i,o,h)),_$9(e,t,i,s,h=b$c(e,t,i,e,h))}else b$c(e,t,i,e,void 0);return i}function M$7(e,t,i){var r,n,o=e._collection.getStageByName(t),a=o._textureScale,s=o._forcePowerOfTwo,l=o._pixelFormat,u=o._pixelDatatype,c=o._clearColor,h=e._framebuffers,d=h.length;for(r=0;r<d;++r)if(a===(n=h[r]).textureScale&&s===n.forcePowerOfTwo&&l===n.pixelFormat&&u===n.pixelDatatype&&e$1S.equals(c,n.clearColor)){for(var f=n.stages,p=f.length,_=!1,m=0;m<p;++m)if(i[f[m]]){_=!0;break}if(!_)break}return e$28(n)&&r<d?(n.stages.push(t),n):(n={textureScale:a,forcePowerOfTwo:s,pixelFormat:l,pixelDatatype:u,clearColor:c,stages:[t],buffer:void 0,clear:void 0},h.push(n),n)}function c$9(e,t){var i=E$c(e._collection,t);for(var r in i)i.hasOwnProperty(r)&&(e._stageNameToFramebuffer[r]=M$7(e,r,i[r]))}function S$3(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 j$7(e,t){for(var i=e._width,r=e._height,n=e._framebuffers,o=n.length,a=0;a<o;++a){var s=n[a],l=s.textureScale,u=Math.ceil(i*l),c=Math.ceil(r*l),h=Math.min(u,c);s.forcePowerOfTwo&&(e$27.isPowerOfTwo(h)||(h=e$27.nextPowerOfTwo(h)),u=h,c=h),s.buffer=new a$z({context:t,colorTextures:[new L$17({context:t,width:u,height:c,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype})]}),s.clear=new r$11({color:s.clearColor,framebuffer:s.buffer})}}o$c.createFXAAStage=function(){return new p$8({name:"czm_FXAA",fragmentShader:Q$6,sampleMode:e$6.LINEAR})},o$c.createSnowStage=function(){return new p$8({name:"czm_SnowEffect",fragmentShader:G$9,uniforms:{density:5,angle:.1,speed:2},sampleMode:e$6.LINEAR})},o$c.createRainStage=function(){return new p$8({name:"czm_RainEffect",fragmentShader:Y$4,uniforms:{speed:20,angle:-.4},sampleMode:e$6.LINEAR})},o$c.createFogStage=function(){return new p$8({name:"czm_FogEffect",fragmentShader:V$5,uniforms:{scale:1},sampleMode:e$6.LINEAR})},o$c.createAcesTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new p$8({name:"czm_aces",fragmentShader:t+=b$d,uniforms:{autoExposure:void 0}})},o$c.createFilmicTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new p$8({name:"czm_filmic",fragmentShader:t+=y$a,uniforms:{autoExposure:void 0}})},o$c.createReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new p$8({name:"czm_reinhard",fragmentShader:t+=U$8,uniforms:{autoExposure:void 0}})},o$c.createModifiedReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new p$8({name:"czm_modified_reinhard",fragmentShader:t+=k$b,uniforms:{white:e$1S.WHITE,autoExposure:void 0}})},o$c.createAutoExposureStage=function(){return new a$m},o$c.createBlackAndWhiteStage=function(){return new p$8({name:"czm_black_and_white",fragmentShader:z$5,uniforms:{gradations:5}})},o$c.createBrightnessStage=function(){return new p$8({name:"czm_brightness",fragmentShader:C$9,uniforms:{brightness:.5}})},o$c.createNightVisionStage=function(){return new p$8({name:"czm_night_vision",fragmentShader:M$8})},o$c.createDepthViewStage=function(){return new p$8({name:"czm_depth_view",fragmentShader:A$c})},o$c.createLensFlareStage=function(){return new p$8({name:"czm_lens_flare",fragmentShader:L$b,uniforms:{dirtTexture:n$17("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:n$17("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,earthRadius:t$V.WGS84.maximumRadius}})},o$c.createOutlineStage=function(){var e=new p$8({name:"outline_copy",fragmentShader:V$b}),t=new p$8({name:"outline_downSample",fragmentShader:["varying vec2 v_textureCoordinates;","void main()","{","gl_FragColor = texture2D(czm_maskTexture, v_textureCoordinates);","}"].join("\n"),textureScale:.5}),i=new p$8({name:"outline_edgeDetection",fragmentShader:["varying vec2 v_textureCoordinates;","uniform sampler2D colorTexture;","uniform vec2 colorTextureDimensions;","uniform vec3 visibleEdgeColor;","uniform vec3 hiddenEdgeColor;","void main() {","vec2 invSize = 1.0 / vec2(colorTextureDimensions.x, colorTextureDimensions.y);","vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);","vec4 c1 = texture2D( colorTexture, v_textureCoordinates + uvOffset.xy);","vec4 c2 = texture2D( colorTexture, v_textureCoordinates - uvOffset.xy);","vec4 c3 = texture2D( colorTexture, v_textureCoordinates + uvOffset.yw);","vec4 c4 = texture2D( colorTexture, v_textureCoordinates - uvOffset.yw);","float diff1 = (c1.r - c2.r)*0.5;","float diff2 = (c3.r - c4.r)*0.5;","float d = length( vec2(diff1, diff2) );","float a1 = min(c1.g, c2.g);","float a2 = min(c3.g, c4.g);","float visibilityFactor = min(a1, a2);","vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;","gl_FragColor = vec4(edgeColor,1.0) * vec4(d);","}"].join("\n"),textureScale:.5,uniforms:{visibleEdgeColor:new e$1S(1,1,1),hiddenEdgeColor:new e$1S(.1,.04,.02)},sampleMode:e$6.LINEAR});i.visibleEdgeColor=new e$1S,i.hiddenEdgeColor=new e$1S;var r=["varying vec2 v_textureCoordinates;","uniform sampler2D colorTexture;","uniform vec2 colorTextureDimensions;","uniform vec2 direction;","uniform float kernelRadius;","float gaussianPdf(in float x, in float sigma) {","return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;","}","void main() {","vec2 invSize = 1.0 / colorTextureDimensions;","float weightSum = gaussianPdf(0.0, kernelRadius);","vec3 diffuseSum = texture2D( colorTexture, v_textureCoordinates).rgb * weightSum;","vec2 delta = direction * invSize * kernelRadius/float(4);","vec2 uvOffset = delta;","for( int i = 1; i <= 4; i ++ ) {","float w = gaussianPdf(uvOffset.x, kernelRadius);","vec3 sample1 = texture2D( colorTexture, v_textureCoordinates + uvOffset).rgb;","vec3 sample2 = texture2D( colorTexture, v_textureCoordinates - uvOffset).rgb;","diffuseSum += ((sample1 + sample2) * w);","weightSum += (2.0 * w);","uvOffset += delta;","}","gl_FragColor = vec4(diffuseSum/weightSum, 1.0);","}"].join("\n"),n=new p$8({name:"outline_blurHalf_X",fragmentShader:r,textureScale:.5,uniforms:{direction:{x:1,y:0},kernelRadius:1},sampleMode:e$6.LINEAR}),o=new p$8({name:"outline_blurHalf_Y",fragmentShader:r,textureScale:.5,uniforms:{direction:{x:0,y:1},kernelRadius:1},sampleMode:e$6.LINEAR}),a=new p$8({name:"outline_blurQuarter_X",fragmentShader:r,textureScale:.25,uniforms:{direction:{x:1,y:0},kernelRadius:4},sampleMode:e$6.LINEAR}),s=new p$8({name:"outline_blurQuarter_Y",fragmentShader:r,textureScale:.25,uniforms:{direction:{x:0,y:1},kernelRadius:4},sampleMode:e$6.LINEAR}),l=new p$8({name:"outline_overlayStage",fragmentShader:["varying vec2 v_textureCoordinates;","uniform sampler2D edgeTexture1;","uniform sampler2D edgeTexture2;","uniform float edgeStrength;","uniform float edgeGlow;","void main() {","vec4 edgeValue1 = texture2D(edgeTexture1, v_textureCoordinates);","vec4 edgeValue2 = texture2D(edgeTexture2, v_textureCoordinates);","vec4 maskColor = texture2D(czm_maskTexture, v_textureCoordinates);","vec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;","vec4 finalColor = edgeStrength * maskColor.r * edgeValue;","gl_FragColor = finalColor;","}"].join("\n"),uniforms:{edgeStrength:3,edgeGlow:0,edgeTexture1:"outline_blurHalf_Y",edgeTexture2:"outline_blurQuarter_Y"},blendingState:Ee$n.ADDITIVE_BLEND,sampleMode:e$6.LINEAR}),u={};return Object.defineProperties(u,{visibleEdgeColor:{get:function(){return i.uniforms.visibleEdgeColor},set:function(e){i.uniforms.visibleEdgeColor=e$1S.clone(e)}},hiddenEdgeColor:{get:function(){return i.hiddenEdgeColor},set:function(e){i.uniforms.hiddenEdgeColor=e$1S.clone(e)}},edgeStrength:{get:function(){return l.uniforms.edgeStrength},set:function(e){l.uniforms.edgeStrength=e}},edgeGlow:{get:function(){return l.uniforms.edgeGlow},set:function(e){l.uniforms.edgeGlow=e}},edgeThickness:{get:function(){return n.uniforms.kernelRadius},set:function(e){n.uniforms.kernelRadius=e,o.uniforms.kernelRadius=e}}}),new s$b({name:"outline_overlay",stages:[e,t,i,n,o,a,s,l],inputPreviousStageTexture:!0,uniforms:u})},l$b.prototype.updateDependencies=function(){this._updateDependencies=!0},l$b.prototype.update=function(e){var t=this._collection,i=this._updateDependencies,r=e$28(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),n=e$28(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=e$28(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),a=e$28(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!e$28(t._activeStages)||t._activeStages.length>0||r||n||o||a;if((i||!s&&this._framebuffers.length>0)&&(S$3(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),i||s){0===this._framebuffers.length&&c$9(this,e);var l=e.drawingBufferWidth,u=e.drawingBufferHeight,c=this._width!==l||this._height!==u;!i&&!c||(this._width=l,this._height=u,this._updateDependencies=!1,S$3(this),j$7(this,e))}},l$b.prototype.clear=function(e){for(var t=this._framebuffers,i=t.length,r=0;r<i;++r)t[r].clear.execute(e)},l$b.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},l$b.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},l$b.prototype.getFramebuffer=function(e){var t=this._stageNameToFramebuffer[e];if(e$28(t))return t.buffer},l$b.prototype.isDestroyed=function(){return!1},l$b.prototype.destroy=function(){return S$3(this),i$Z(this)};var I$5={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===I$5.REINHARD||e===I$5.MODIFIED_REINHARD||e===I$5.FILMIC||e===I$5.ACES}},k$a=Object.freeze(I$5),N$5="precision highp float;\nprecision highp int;\nattribute vec4 position;\nattribute vec2 textureCoordinates;\nuniform vec2 u_resolution;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[3];\nvoid SMAAEdgeDetectionVS(vec2 texcoord) {\nfOffset[0] = texcoord.xyxy + u_resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );\nfOffset[1] = texcoord.xyxy + u_resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );\nfOffset[2] = texcoord.xyxy + u_resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );\n}\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\nSMAAEdgeDetectionVS(textureCoordinates);\n}\n",z$4="precision highp float;\nprecision highp int;\n#define SMAA_THRESHOLD 0.05\n#define SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR 2\n#define SMAA_USE_COLOR_EDGE_DETECTION 1\nuniform sampler2D inputColorTexture;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[3];\nvec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {\nvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );\nvec4 delta;\nvec3 C = texture2D( colorTex, texcoord ).rgb;\nvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;\nvec3 t = abs( C - Cleft );\ndelta.x = max( max( t.r, t.g ), t.b );\nvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;\nt = abs( C - Ctop );\ndelta.y = max( max( t.r, t.g ), t.b );\nvec2 edges = step( threshold, delta.xy );\nif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )\ndiscard;\nvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;\nt = abs( C - Cright );\ndelta.z = max( max( t.r, t.g ), t.b );\nvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;\nt = abs( C - Cbottom );\ndelta.w = max( max( t.r, t.g ), t.b );\nfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );\nvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;\nt = abs( C - Cleftleft );\ndelta.z = max( max( t.r, t.g ), t.b );\nvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;\nt = abs( C - Ctoptop );\ndelta.w = max( max( t.r, t.g ), t.b );\nmaxDelta = max( max( maxDelta, delta.z ), delta.w );\nedges.xy *= step( maxDelta, float(SMAA_LOCAL_CONTRAST_ADAPTATION_FACTOR) * delta.xy );\nreturn vec4( edges, 0.0, 0.0 );\n}\nvoid main()\n{\ngl_FragColor = SMAAColorEdgeDetectionPS( v_textureCoordinates, fOffset, inputColorTexture );\n}\n",F$7="precision highp float;\nprecision highp int;\n#define SMAA_MAX_SEARCH_STEPS 8\nattribute vec4 position;\nattribute vec2 textureCoordinates;\nuniform vec2 u_resolution;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[3];\nvarying vec2 fPixCoord;\nvoid SMAABlendingWeightCalculationVS( vec2 texcoord ) {\nfPixCoord = texcoord / u_resolution;\nfOffset[ 0 ] = texcoord.xyxy + u_resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );\nfOffset[ 1 ] = texcoord.xyxy + u_resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );\nfOffset[ 2 ] = vec4( fOffset[ 0 ].xz, fOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * u_resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );\n}\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\nSMAABlendingWeightCalculationVS( textureCoordinates );\n}\n",C$8="precision highp float;\nprecision highp int;\n#define SMAA_MAX_SEARCH_STEPS 8\n#define SMAA_AREATEX_MAX_DISTANCE 16\n#define SMAA_AREATEX_PIXEL_SIZE ( 1.0 / vec2( 160.0, 560.0 ) )\n#define SMAA_AREATEX_SUBTEX_SIZE ( 1.0 / 7.0 )\nuniform sampler2D tEdges;\nuniform sampler2D tArea;\nuniform sampler2D tSearch;\nuniform vec2 u_resolution;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[3];\nvarying vec2 fPixCoord;\nvec4 SMAASampleLevelZeroOffset(sampler2D tex, vec2 coord, ivec2 offset ){\nreturn texture2D( tex, coord + float( offset ) * u_resolution, 0.0 );\n}\n#ifndef WEBGL2\nvec2 round( vec2 x ) {\nreturn sign( x ) * floor( abs( x ) + 0.5 );\n}\n#endif\nfloat SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {\ne.r = bias + e.r * scale;\nreturn 255.0 * texture2D( searchTex, e, 0.0 ).r;\n}\nfloat SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\nvec2 e = vec2( 0.0, 1.0 );\nfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {\ne = texture2D( edgesTex, texcoord, 0.0 ).rg;\ntexcoord -= vec2( 2.0, 0.0 ) * u_resolution;\nif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;\n}\ntexcoord.x += 0.25 * u_resolution.x;\ntexcoord.x += u_resolution.x;\ntexcoord.x += 2.0 * u_resolution.x;\ntexcoord.x -= u_resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);\nreturn texcoord.x;\n}\nfloat SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\nvec2 e = vec2( 0.0, 1.0 );\nfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {\ne = texture2D( edgesTex, texcoord, 0.0 ).rg;\ntexcoord += vec2( 2.0, 0.0 ) * u_resolution;\nif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;\n}\ntexcoord.x -= 0.25 * u_resolution.x;\ntexcoord.x -= u_resolution.x;\ntexcoord.x -= 2.0 * u_resolution.x;\ntexcoord.x += u_resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );\nreturn texcoord.x;\n}\nfloat SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\nvec2 e = vec2( 1.0, 0.0 );\nfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {\ne = texture2D( edgesTex, texcoord, 0.0 ).rg;\ntexcoord += vec2( 0.0, 2.0 ) * u_resolution;\nif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;\n}\ntexcoord.y -= 0.25 * u_resolution.y;\ntexcoord.y -= u_resolution.y;\ntexcoord.y -= 2.0 * u_resolution.y;\ntexcoord.y += u_resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );\nreturn texcoord.y;\n}\nfloat SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {\nvec2 e = vec2( 1.0, 0.0 );\nfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {\ne = texture2D( edgesTex, texcoord, 0.0 ).rg;\ntexcoord -= vec2( 0.0, 2.0 ) * u_resolution;\nif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;\n}\ntexcoord.y += 0.25 * u_resolution.y;\ntexcoord.y += u_resolution.y;\ntexcoord.y += 2.0 * u_resolution.y;\ntexcoord.y -= u_resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );\nreturn texcoord.y;\n}\nvec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {\nvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;\ntexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );\ntexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;\nreturn texture2D( areaTex, texcoord, 0.0 ).rg;\n}\nvec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {\nvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );\nvec2 e = texture2D( edgesTex, texcoord ).rg;\nif ( e.g > 0.0 ) {\nvec2 d;\nvec2 coords;\ncoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );\ncoords.y = offset[ 1 ].y;\nd.x = coords.x;\nfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;\ncoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );\nd.y = coords.x;\nd = d / u_resolution.x - pixcoord.x;\nvec2 sqrt_d = sqrt( abs( d ) );\ncoords.y -= 1.0 * u_resolution.y;\nfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;\nweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );\n}\nif ( e.r > 0.0 ) {\nvec2 d;\nvec2 coords;\ncoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );\ncoords.x = offset[ 0 ].x;\nd.x = coords.y;\nfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;\ncoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );\nd.y = coords.y;\nd = d / u_resolution.y - pixcoord.y;\nvec2 sqrt_d = sqrt( abs( d ) );\ncoords.y -= 1.0 * u_resolution.y;\nfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;\nweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );\n}\nreturn weights;\n}\nvoid main()\n{\ngl_FragColor = SMAABlendingWeightCalculationPS(v_textureCoordinates, fPixCoord, fOffset, tEdges, tArea, tSearch, ivec4(0.0));\n}\n",W$6="precision highp float;\nprecision highp int;\nattribute vec4 position;\nattribute vec2 textureCoordinates;\nuniform vec2 u_resolution;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[2];\nvoid SMAANeighborhoodBlendingVS( vec2 texcoord ) {\nfOffset[ 0 ] = texcoord.xyxy + u_resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );\nfOffset[ 1 ] = texcoord.xyxy + u_resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );\n}\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\nSMAANeighborhoodBlendingVS(textureCoordinates);\n}\n",j$6="precision highp float;\nprecision highp int;\n#define SMAA_DEBUG_SPLIT_VIEW 0\nuniform vec2 u_resolution;\nuniform sampler2D tBlendWeights;\nuniform sampler2D tColor;\nvarying vec2 v_textureCoordinates;\nvarying vec4 fOffset[2];\nvec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {\nvec4 a;\na.xz = texture2D( blendTex, texcoord ).xz;\na.y = texture2D( blendTex, offset[ 1 ].zw ).g;\na.w = texture2D( blendTex, offset[ 1 ].xy ).a;\nif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {\nreturn texture2D( colorTex, texcoord, 0.0 );\n} else {\nvec2 offset;\noffset.x = a.a > a.b ? a.a : -a.b;\noffset.y = a.g > a.r ? -a.g : a.r;\nif ( abs( offset.x ) > abs( offset.y )) {\noffset.y = 0.0;\n} else {\noffset.x = 0.0;\n}\nvec4 C = texture2D( colorTex, texcoord, 0.0 );\ntexcoord += sign( offset ) * u_resolution;\nvec4 Cop = texture2D( colorTex, texcoord, 0.0 );\nfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );\nC.xyz = pow(C.xyz, vec3(2.2));\nCop.xyz = pow(Cop.xyz, vec3(2.2));\nvec4 mixed = mix(C, Cop, s);\nmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));\nreturn mixed;\n}\n}\nvoid main()\n{\ngl_FragColor = SMAANeighborhoodBlendingPS( v_textureCoordinates, fOffset, tColor, tBlendWeights );\n#if SMAA_DEBUG_SPLIT_VIEW // split the view in the middle and display the unprocessed image on the right\nif (v_textureCoordinates.x > 0.5)\n{\nif (v_textureCoordinates.x < 0.5 + (5.0 / czm_viewport.z))\n{\ngl_FragColor = vec4(0, 0, 1, 1);\n} else\n{\ngl_FragColor = texture2D(tColor, v_textureCoordinates);\n}\n}\n#endif // DEBUG\n}\n";function i$9(){this._edgeDetectionCommand=void 0,this._weightCalculationCommand=void 0,this._neighborhoodBlendingCommand=void 0,this._upSamplePassState=new n$p,this.enabled=!1,this._inputTexture=void 0,this._edgeDetectionFBO=void 0,this._weightFBO=void 0,this._blendingFBO=void 0,this._searchTexture=void 0,this._areaTexture=void 0,this._clearCommand=new r$11({color:new e$1S(0,0,0,0)}),this._resolution=new o$1k}function H$8(){return new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})}Object.defineProperties(i$9.prototype,{}),i$9.prototype.execute=function(e){var t=this._clearCommand;t.framebuffer=this._edgeDetectionFBO,t.execute(e),t.framebuffer=this._weightFBO,t.execute(e),t.framebuffer=this._blendingFBO,t.execute(e),this._edgeDetectionCommand.framebuffer=this._edgeDetectionFBO,this._edgeDetectionCommand.execute(e,this._upSamplePassState),this._weightCalculationCommand.framebuffer=this._weightFBO,this._weightCalculationCommand.execute(e,this._upSamplePassState),this._neighborhoodBlendingCommand.framebuffer=this._blendingFBO,this._neighborhoodBlendingCommand.execute(e,this._upSamplePassState)};var f$b=new f$10;i$9.prototype.update=function(e){if(this.enabled){this._context=e;var t=e.drawingBufferWidth,i=e.drawingBufferHeight;this._resolution.x=1/t,this._resolution.y=1/i;var r=this;if(!e$28(this._searchTexture)){var n=new Image;n.src=this.getSearchTexture(),n.onload=function(){r._searchTexture=new L$17({context:e,source:this,pixelFormat:V$O.RGBA,pixelDatatype:y$U.UNSIGNED_BYTE,flipY:!1,sampler:H$8()})}}if(!e$28(this._areaTexture)){var o=new Image;o.src=this.getAreaTexture(),o.onload=function(){r._areaTexture=new L$17({context:e,source:this,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,flipY:!1})}}e$28(this._edgeDetectionCommand)||this.createCommand(e);var a=this._edgeDetectionFBO,s=e$28(a)&&a.getColorTexture(0)||void 0;if(!e$28(s)||s.width!==t||s.height!==i){this.createFBO(t,i,e),f$b.width=t,f$b.height=i;var l=u$R.fromCache({viewport:f$b});this._edgeDetectionCommand.renderState=l,this._weightCalculationCommand.renderState=l,this._neighborhoodBlendingCommand.renderState=l}this._upSamplePassState.context=e}},i$9.prototype.createCommand=function(e){this._edgeDetectionCommand=e.createCustomViewportQuadCommand(N$5,z$4,{uniformMap:{},owner:this});var t=new a$$({name:"blendingWeightCalculationFS",sources:[C$8]});e.webgl2&&t.defines.push("WEBGL2"),this._weightCalculationCommand=e.createCustomViewportQuadCommand(F$7,t,{uniformMap:{},owner:this}),this._neighborhoodBlendingCommand=e.createCustomViewportQuadCommand(W$6,j$6,{uniformMap:{},owner:this}),this.createUniformMap()},i$9.prototype.createUniformMap=function(){if(e$28(this._edgeDetectionCommand)){var e=this;this._edgeDetectionCommand.uniformMap.inputColorTexture=function(){return e._inputTexture},this._edgeDetectionCommand.uniformMap.u_resolution=function(){return e._resolution},this._weightCalculationCommand.uniformMap.tEdges=function(){return e._edgeDetectionFBO.getColorTexture(0)},this._weightCalculationCommand.uniformMap.tArea=function(){return e$28(e._areaTexture)?e._areaTexture:e._context.defaultTexture},this._weightCalculationCommand.uniformMap.tSearch=function(){return e$28(e._searchTexture)?e._searchTexture:e._context.defaultTexture},this._weightCalculationCommand.uniformMap.u_resolution=function(){return e._resolution},this._neighborhoodBlendingCommand.uniformMap.tColor=function(){return e._inputTexture},this._neighborhoodBlendingCommand.uniformMap.tBlendWeights=function(){return e._weightFBO.getColorTexture(0)},this._neighborhoodBlendingCommand.uniformMap.u_resolution=function(){return e._resolution}}},i$9.prototype.createFBO=function(e,t,i){e$28(this._edgeDetectionFBO)||this.destroyFBO();var r=y$U.UNSIGNED_BYTE;this._edgeDetectionFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t,pixelDatatype:r,pixelFormat:V$O.RGB})]}),this._weightFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t,pixelDatatype:r,pixelFormat:V$O.RGBA})]}),this._blendingFBO=new a$z({context:i,colorTextures:[new L$17({context:i,width:e,height:t,pixelDatatype:r,pixelFormat:V$O.RGBA})]})},i$9.prototype.setInputTexture=function(e){this._inputTexture=e},i$9.prototype.getSMAATexture=function(){return this._blendingFBO.getColorTexture(0)},i$9.prototype.isDestroyed=function(){return!1},i$9.prototype.destroyFBO=function(){this._edgeDetectionFBO=this._edgeDetectionFBO&&!this._edgeDetectionFBO.isDestroyed()&&this._edgeDetectionFBO.destroy(),this._weightFBO=this._weightFBO&&!this._weightFBO.isDestroyed()&&this._weightFBO.destroy(),this._blendingFBO=this._blendingFBO&&!this._blendingFBO.isDestroyed()&&this._blendingFBO.destroy()},i$9.prototype.destroy=function(){return this.destroyFBO(),this._edgeDetectionCommand=this._edgeDetectionCommand&&this._edgeDetectionCommand.shaderProgram&&this._edgeDetectionCommand.shaderProgram.destroy(),this._weightCalculationCommand=this._weightCalculationCommand&&this._weightCalculationCommand.shaderProgram&&this._weightCalculationCommand.shaderProgram.destroy(),this._neighborhoodBlendingCommand=this._neighborhoodBlendingCommand&&this._neighborhoodBlendingCommand.shaderProgram&&this._neighborhoodBlendingCommand.shaderProgram.destroy(),i$Z(this)},i$9.prototype.getAreaTexture=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},i$9.prototype.getSearchTexture=function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="};var j$5=[];function f$a(){var e=o$c.createFXAAStage(),t=o$c.createAmbientOcclusionStage(),i=o$c.createBloomStage(),r=o$c.createOutlineStage(),n=o$c.createFogStage(),o=o$c.createRainStage(),a=o$c.createSnowStage();this._autoExposureEnabled=!1,this._autoExposure=o$c.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=k$a.ACES;var s=this._tonemapping;t.enabled=!1,i.enabled=!1,s.enabled=!1,n.enabled=!1,o.enabled=!1,a.enabled=!1;var l=new l$b(this),u={},c=j$5;for(c.push(e,t,i,s,r,n,a,o);c.length>0;){var h=c.pop();u[h.name]=h,h._textureCache=l;var d=h.length;if(e$28(d))for(var f=0;f<d;++f)c.push(h.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var p=this;t.uniforms.randomTexture=function(){return p._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._smaa=new i$9,this._outline=r,this._fog=n,this._rain=o,this._snow=a,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._smaaEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=u,this._textureCache=l}function W$5(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._stages=t}}function E$b(e){for(;e$28(e.length);)e=e.get(e.length-1);return e.outputTexture}function v$9(e,t,i,r,n){if(e$28(e.execute))e.execute(t,i,r,n);else{var o,a=e.length;if(e.inputPreviousStageTexture)for(v$9(e.get(0),t,i,r,n),o=1;o<a;++o)v$9(e.get(o),t,E$b(e.get(o-1)),r,n);else for(o=0;o<a;++o)v$9(e.get(o),t,i,r,n)}}Object.defineProperties(f$a.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length-1;i>=0;--i){var r=t[i];e=e||r.ready&&r.enabled}var n=this._fxaa,o=this._ao,a=this._bloom,s=this._tonemapping;return e=(e=(e=(e=e||n.ready&&n.enabled)||o.ready&&o.enabled)||a.ready&&a.enabled)||s.ready&&s.enabled}},fxaa:{get:function(){return this._fxaa}},smaa:{get:function(){return this._smaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},outline:{get:function(){return this._outline}},rain:{get:function(){return this._rain}},snow:{get:function(){return this._snow}},fog:{get:function(){return this._fog}},length:{get:function(){return W$5(this),this._stages.length}},outputTexture:{get:function(){var e=this._smaa;if(e.enabled)return e.getSMAATexture();var t=this._fxaa;if(t.enabled&&t.ready)return this.getOutputTexture(t.name);for(var i=this._stages,r=i.length-1;r>=0;--r){var n=i[r];if(e$28(n)&&n.ready&&n.enabled)return this.getOutputTexture(n.name)}var o=this._tonemapping;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);var a=this._bloom;if(a.enabled&&a.ready)return this.getOutputTexture(a.name);var s=this._ao;return s.enabled&&s.ready?this.getOutputTexture(s.name):void 0}},hasSelected:{get:function(){for(var e=l$12(this._stages);e.length>0;){var t=e.pop();if(e$28(t)){if(e$28(t.selected))return!0;var i=t.length;if(e$28(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){if(!k$a.validate(e))throw new t$Z("tonemapper was set to an invalid value.");e$28(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i=this._autoExposureEnabled;switch(e){case k$a.REINHARD:t=o$c.createReinhardTonemappingStage(i);break;case k$a.MODIFIED_REINHARD:t=o$c.createModifiedReinhardTonemappingStage(i);break;case k$a.FILMIC:t=o$c.createFilmicTonemappingStage(i);break;default:t=o$c.createAcesTonemappingStage(i)}if(i){var r=this._autoExposure;t.uniforms.autoExposure=function(){return r.outputTexture}}this._tonemapper=e,this._tonemapping=t,e$28(this._stageNames)&&(this._stageNames[t.name]=t,t._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),f$a.prototype.add=function(e){o$1u.typeOf.object("stage",e);var t=this._stageNames,i=j$5;for(i.push(e);i.length>0;){var r=i.pop();if(e$28(t[r.name]))throw new t$Z(r.name+" has already been added to the collection or does not have a unique name.");t[r.name]=r,r._textureCache=this._textureCache;var n=r.length;if(e$28(n))for(var o=0;o<n;++o)i.push(r.get(o))}var a=this._stages;return e._index=a.length,a.push(e),this._textureCacheDirty=!0,e},f$a.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=j$5;for(i.push(e);i.length>0;){var r=i.pop();delete t[r.name];var n=r.length;if(e$28(n))for(var o=0;o<n;++o)i.push(r.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},f$a.prototype.contains=function(e){return e$28(e)&&e$28(e._index)&&e._textureCache===this._textureCache},f$a.prototype.get=function(e){W$5(this);var t=this._stages,i=t.length;return o$1u.typeOf.number.greaterThanOrEquals("stages length",i,0),o$1u.typeOf.number.greaterThanOrEquals("index",e,0),o$1u.typeOf.number.lessThan("index",e,i),t[e]},f$a.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},f$a.prototype.getStageByName=function(e){return this._stageNames[e]},new e$1S,new e$1S,f$a.prototype.update=function(e,t,i,r){W$5(this);var n=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=n;var a,s,l=this._stages,u=o.length=l.length,c=0;for(a=0;a<u;++a)(s=l[a]).ready&&s.enabled&&s._isSupported(e)&&(o[c++]=s);o.length=c;var h=c!==n.length;if(!h)for(a=0;a<c;++a)if(o[a]!==n[a]){h=!0;break}var d=this._ao,f=this._bloom,p=this._autoExposure,_=this._tonemapping,m=this._fxaa,$=this._smaa,g=this._outline,v=this._fog,y=this._rain,x=this._snow;_.enabled=i;var b=d.enabled&&d._isSupported(e),w=f.enabled&&f._isSupported(e),C=_.enabled&&_._isSupported(e),T=m.enabled&&m._isSupported(e),S=$.enabled,E=v.enabled,A=y.enabled,P=x.enabled,I=g.enabled;if((h||this._textureCacheDirty||c!==this._lastLength||b!==this._aoEnabled||E!==this._fogEnabled||A!==this._rainEnabled||P!==this._snowEnabled||w!==this._bloomEnabled||C!==this._tonemappingEnabled||T!==this._fxaaEnabled||S!==this._smaaEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=c,this._aoEnabled=b,this._fogEnabled=E,this._rainEnabled=A,this._snowEnabled=P,this._bloomEnabled=w,this._tonemappingEnabled=C,this._fxaaEnabled=T,this._smaaEnabled=S,this._textureCacheDirty=!1),e$28(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),I){var M=r._layers.getSelectedLayer();e$28(M)&&(M._selectColorType===Ya$1.SILHOUETTE_EDGE?g.uniforms.visibleEdgeColor=e$1S.clone(M._selectedLineColor):g.uniforms.visibleEdgeColor=e$1S.WHITE)}if(!e$28(this._randomTexture)&&b){u=196608;var O=new Uint8Array(u);for(a=0;a<u;a+=3)O[a]=Math.floor(255*Math.random());this._randomTexture=new L$17({context:e,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,source:{arrayBufferView:O,width:256,height:256},sampler:new n$Y({wrapS:q$11.REPEAT,wrapT:q$11.REPEAT,minificationFilter:tt$h.NEAREST,magnificationFilter:rt$g.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),$.update(e,t),d.update(e,t),f.update(e,t),_.update(e,t),g.update(e,t),v.update(e,t),y.update(e,t),x.update(e,t),this._autoExposureEnabled&&p.update(e,t),u=l.length,a=0;a<u;++a)l[a].update(e,t)},f$a.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},f$a.prototype.getOutputTexture=function(e){var t=this.getStageByName(e);if(e$28(t))return E$b(t)},f$a.prototype.execute=function(e,t,i,r){var n=this._activeStages,o=n.length,a=this._fxaa,s=this._smaa,l=this._ao,u=this._bloom,c=this._autoExposure,h=this._tonemapping,d=this._outline,f=this.compositor,p=this._fog,_=this._rain,m=this._snow,$=l.enabled&&l._isSupported(e),g=u.enabled&&u._isSupported(e),v=this._autoExposureEnabled,y=h.enabled&&h._isSupported(e),x=a.enabled&&a._isSupported(e),b=s.enabled,w=d.enabled,C=p.enabled,T=_.enabled,S=m.enabled;if(C||T||S||w||b||x||$||g||y||0!==o){var E=t;w&&d.ready&&e$28(e.uniformState.maskTexture)&&(v$9(d,e,E,i,r),E=E$b(d)),e$28(f)&&f.isEnable()&&(f.copy(e,E),f.execute(e,f.outputFbo),E=f.outputFbo.getColorTexture(0)),$&&l.ready&&(v$9(l,e,E,i,r),E=E$b(l)),g&&u.ready&&(v$9(u,e,E,i,r),E=E$b(u)),v&&c.ready&&v$9(c,e,E,i,r),y&&h.ready&&(v$9(h,e,E,i,r),E=E$b(h));var A=E;if(o>0){v$9(n[0],e,E,i,r);for(var P=1;P<o;++P)v$9(n[P],e,E$b(n[P-1]),i,r);A=E$b(n[o-1])}C&&(v$9(p,e,A,i,r),A=E$b(p)),S&&(v$9(m,e,A,i,r),A=E$b(m)),T&&(v$9(_,e,A,i,r),A=E$b(_)),x&&a.ready&&v$9(a,e,A,i,r),b&&(s.setInputTexture(A),s.execute(e))}};var D$9=new f$10;function I$4(e){this._url=e,this._rgbeLoader=new U$g,this._sourceData=void 0,this._loading=!1,this._width=1,this._height=1,this._inputTexture=void 0,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._outputTexture=void 0,this._pingPongTexture=void 0,this._ready=!1}f$a.prototype.copy=function(e,t,i){if(D$9.width=e.realDrawingBufferWidth,D$9.height=e.realDrawingBufferHeight,D$9.x=0,D$9.y=0,D$9.x+=-e._curCol/e._cols*e.realDrawingBufferWidth,D$9.y+=-(e._rows-e._curRow-1)/e._rows*e.realDrawingBufferHeight,!e$28(this._copyColorCommand)){var r,n=this;i&&e.fragmentDepth&&e.depthTexture&&!e.webglOptions.preserveDrawingBuffer?r=new a$$({sources:[r=["#extension GL_EXT_frag_depth : enable","#extension GL_OES_standard_derivatives : enable","uniform sampler2D colorTexture;","varying vec2 v_textureCoordinates;","void main()","{","float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, v_textureCoordinates));","gl_FragDepthEXT = logDepthOrDepth;","gl_FragColor = texture2D(colorTexture, v_textureCoordinates);","}"].join("\n")],defines:i?["LOG_DEPTH"]:[]}):r=V$b,this._copyColorCommand=e.createViewportQuadCommand(r,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}var o=u$R.fromCache({viewport:D$9,depthTest:{enabled:!e.webglOptions.preserveDrawingBuffer}});this._copyColorCommand.renderState=o,this._copyColorCommand.framebuffer=t,(e.fragmentDepth&&e$28(e.uniformState.globeDepthTexture)||!e.fragmentDepth||!e.depthTexture)&&this._copyColorCommand.execute(e)},f$a.prototype.isDestroyed=function(){return!1},f$a.prototype.destroy=function(){return this._fxaa.destroy(),this._smaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),i$Z(this)},Object.defineProperties(I$4.prototype,{ready:{get:function(){return this._ready}},texture:{get:function(){return this._outputTexture}}});const j$4="\n precision mediump float;\n precision mediump int;\n\n attribute vec4 position;\n attribute vec2 uv;\n attribute float faceIndex;\n\n varying vec3 vOutputDirection;\n\n // RH coordinate system; PMREM face-indexing convention\n vec3 getDirection( vec2 uv, float face ) {\n\n uv = 2.0 * uv - 1.0;\n\n vec3 direction = vec3( uv, 1.0 );\n\n if ( face == 0.0 ) {\n\n direction = direction.zyx; // ( 1, v, u ) pos x\n\n } else if ( face == 1.0 ) {\n\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n } else if ( face == 2.0 ) {\n\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n\n } else if ( face == 3.0 ) {\n\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n\n } else if ( face == 4.0 ) {\n\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n\n } else if ( face == 5.0 ) {\n\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n\n }\n\n return direction;\n\n }\n\n void main() {\n\n vOutputDirection = getDirection( uv, faceIndex );\n gl_Position = vec4( position.xyz, 1.0 );\n\n }\n",te$5="\n precision mediump float;\n precision mediump int;\n\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n\n #define RECIPROCAL_PI 0.3183098861837907\n #define RECIPROCAL_PI2 0.15915494309189535\n\n vec2 equirectUv( in vec3 dir ) {\n\n // dir is assumed to be unit length\n \n float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n \n float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n \n return vec2( u, v );\n \n }\n\n void main() {\n\n vec3 outputDirection = normalize( vOutputDirection );\n vec2 uv = equirectUv( outputDirection );\n\n gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n }\n",ie$3="\n precision mediump float;\n precision mediump int;\n #extension GL_EXT_shader_texture_lod : enable\n #define ENVMAP_TYPE_CUBE_UV\n #define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\t#define n 20\n\t#define CUBEUV_TEXEL_WIDTH 0.0013020833333333333\n\t#define CUBEUV_TEXEL_HEIGHT 0.0009765625\n\t#define CUBEUV_MAX_MIP 8.0\n\t\n varying vec3 vOutputDirection;\n\n uniform sampler2D envMap;\n uniform int samples;\n uniform float weights[ n ];\n uniform bool latitudinal;\n uniform float dTheta;\n uniform float mipInt;\n uniform vec3 poleAxis;\n\n float getFace( vec3 direction ) {\n\n\t\tvec3 absDirection = abs( direction );\n\n\t\tfloat face = - 1.0;\n\n\t\tif ( absDirection.x > absDirection.z ) {\n\n\t\t\tif ( absDirection.x > absDirection.y )\n\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t} else {\n\n\t\t\tif ( absDirection.z > absDirection.y )\n\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\n\t\t\telse\n\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\n\t\t}\n\n\t\treturn face;\n\n\t}\n\t\n\tvec2 getUV( vec3 direction, float face ) {\n\n\t\tvec2 uv;\n\n\t\tif ( face == 0.0 ) {\n\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n\n\t\t} else if ( face == 1.0 ) {\n\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n\n\t\t} else if ( face == 2.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n\n\t\t} else if ( face == 3.0 ) {\n\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n\n\t\t} else if ( face == 4.0 ) {\n\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n\n\t\t} else {\n\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n\n\t\t}\n\n\t\treturn 0.5 * ( uv + 1.0 );\n\n\t}\n\t\n vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\n\t\tfloat face = getFace( direction );\n\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\n\t\tfloat faceSize = exp2( mipInt );\n\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\n\t\tif ( face > 2.0 ) {\n\n\t\t\tuv.y += faceSize;\n\n\t\t\tface -= 3.0;\n\n\t\t}\n\n\t\tuv.x += face * faceSize;\n\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\n\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; // disable anisotropic filtering\n\t}\n\n vec3 getSample( float theta, vec3 axis ) {\n\n float cosTheta = cos( theta );\n // Rodrigues' axis-angle rotation\n vec3 sampleDirection = vOutputDirection * cosTheta\n + cross( axis, vOutputDirection ) * sin( theta )\n + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n return bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n }\n\n void main() {\n\n vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n if ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n }\n\n axis = normalize( axis );\n\n gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n for ( int i = 1; i < n; i++ ) {\n\n if ( i >= samples ) {\n\n break;\n\n }\n\n float theta = dTheta * float( i );\n gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n }\n \n }\n",m$c=(1+Math.sqrt(5))/2,D$8=1/m$c,E$a=20,k$9=[new t$X(1,1,1),new t$X(-1,1,1),new t$X(1,1,-1),new t$X(-1,1,-1),new t$X(0,m$c,D$8),new t$X(0,m$c,-D$8),new t$X(D$8,0,m$c),new t$X(-D$8,0,m$c),new t$X(m$c,D$8,0),new t$X(-m$c,D$8,0)],A$b=4,J$7=[.125,.215,.35,.446,.526,.582];function oe$4(e,t){const i=[],r=[],n=[];let o=t;const a=t-A$b+1+J$7.length;for(let s=0;s<a;s++){const a=Math.pow(2,o);r.push(a);let l=1/a;s>t-A$b?l=J$7[s-t+A$b-1]:0===s&&(l=0),n.push(l);const u=1/(a-2),c=-u,h=1+u,d=[c,c,h,c,h,h,c,c,h,h,c,h],f=6,p=6,_=3,m=2,$=1,g=new Float32Array(_*p*f),v=new Float32Array(m*p*f),y=new Float32Array($*p*f);for(let e=0;e<f;e++){const t=e%3*2/3-1,i=e>2?0:-1,r=[t,i,0,t+2/3,i,0,t+2/3,i+1,0,t,i,0,t+2/3,i+1,0,t,i+1,0];g.set(r,_*p*e),v.set(d,m*p*e);const n=[e,e,e,e,e,e];y.set(n,$*p*e)}const x=h$W.createVertexBuffer({context:e,typedArray:g,usage:A$1c.STATIC_DRAW}),b=h$W.createVertexBuffer({context:e,typedArray:v,usage:A$1c.STATIC_DRAW}),w=h$W.createVertexBuffer({context:e,typedArray:y,usage:A$1c.STATIC_DRAW}),C=new m$19({context:e,attributes:[{index:0,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:S$W.FLOAT},{index:1,vertexBuffer:b,componentsPerAttribute:2,componentDatatype:S$W.FLOAT},{index:2,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:S$W.FLOAT}]});i.push(C),o>A$b&&o--}return{lodPlanes:i,sizeLods:r,sigmas:n}}function ne$5(e,t){const i=e.context,r=S$T.fromCache({context:i,vertexShaderSource:j$4,fragmentShaderSource:te$5,attributeLocations:{position:0,uv:1,faceIndex:2}}),n=t._lodPlanes[0],o={envMap:function(){return t._inputTexture}},a=new L$17({context:i,pixelFormat:V$O.RGBA,pixelDatatype:y$U.HALF_FLOAT,width:t._width,height:t._height}),s=new t$u({vertexArray:n,shaderProgram:r,uniformMap:o,outputTexture:a,persists:!0,renderState:u$R.fromCache({viewport:new f$10(0,0,3*t._cubeSize,2*t._cubeSize)}),owner:t});t._outputTexture=a,e.commandList.push(s)}I$4.prototype._halfBlur=function(e,t,i,r,n,o,a,s){const l=this._sizeLods[r]-1,u=isFinite(o)?Math.PI/(2*l):2*Math.PI/(2*E$a-1),c=o/u,h=isFinite(o)?1+Math.floor(3*c):E$a,d=[];let f=0;for(let e=0;e<E$a;++e){const t=e/c,i=Math.exp(-t*t/2);d.push(i),0===e?f+=i:e<h&&(f+=2*i)}for(let e=0;e<d.length;e++)d[e]=d[e]/f;const{_lodMax:p}=this,_=this._sizeLods[n],m=3*_*(n>p-A$b?n-p+A$b:0),$=4*(this._cubeSize-_),g=this._lodPlanes[n],v=this._blurSP,y={envMap:function(){return this.properties.envMap},samples:function(){return this.properties.samples},weights:function(){return this.properties.weights},latitudinal:function(){return this.properties.latitudinal},dTheta:function(){return this.properties.dTheta},mipInt:function(){return this.properties.mipInt},poleAxis:function(){return this.properties.poleAxis},properties:{envMap:null,samples:1,weights:new Float32Array(E$a),latitudinal:!1,dTheta:0,mipInt:0,poleAxis:new t$X(0,1,0)}};y.properties.envMap=t,y.properties.samples=h,y.properties.weights=d,y.properties.latitudinal="latitudinal"===a,s&&(y.properties.poleAxis=s),y.properties.dTheta=u,y.properties.mipInt=p-r;const x=new t$u({vertexArray:g,shaderProgram:v,uniformMap:y,outputTexture:i,persists:!0,renderState:u$R.fromCache({viewport:new f$10(m,$,3*_,2*_)}),clear:!1,owner:this});e.commandList.push(x)},I$4.prototype._blur=function(e,t,i,r,n,o){const a=this._pingPongTexture;this._halfBlur(e,t,a,i,r,n,"latitudinal",o),this._halfBlur(e,a,t,r,r,n,"longitudinal",o)},I$4.prototype.update=function(e){const t=e.context;e$28(this._sourceData)||this._loading||(t$S.createIfNeeded(this._url).fetchArrayBuffer().then((e=>{this._sourceData=this._rgbeLoader.parse(e),this._loading=!1})).otherwise((e=>{this._loading=!1})),this._loading=!0);if(e$28(this._sourceData)){if(!e$28(this._inputTexture)){this._inputTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.HALF_FLOAT,flipY:!0,source:{arrayBufferView:this._sourceData.data,width:this._sourceData.width,height:this._sourceData.height}}),this._lodMax=Math.floor(Math.log2(this._inputTexture.width/4)),this._cubeSize=Math.pow(2,this._lodMax),this._width=3*Math.max(this._cubeSize,112),this._height=4*this._cubeSize;const{_lodMax:e}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=oe$4(t,e)),this._blurSP=S$T.fromCache({context:t,vertexShaderSource:j$4,fragmentShaderSource:ie$3,attributeLocations:{position:0,uv:1,faceIndex:2}}),this._pingPongTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.HALF_FLOAT,width:this._width,height:this._height})}if(!this._ready){ne$5(e,this);for(let t=1;t<this._lodPlanes.length;t++){const i=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=k$9[(t-1)%k$9.length];this._blur(e,this._outputTexture,t-1,t,i,r)}this._ready=!0}}};var d$f=2e4;function h$6(e){this._positionArray=e,this.type="PLANE",this.planeWidth=1,this.planeHeight=1,this._center=new t$X,this.init(),this._volBounds=void 0}h$6.prototype.createVertices=function(e){var t=S$W.createTypedArray(S$W.FLOAT,12),i=0;return t[i++]=this._topPoint1.x-e.x,t[i++]=this._topPoint1.y-e.y,t[i++]=this._topPoint1.z-e.z,t[i++]=this._topPoint2.x-e.x,t[i++]=this._topPoint2.y-e.y,t[i++]=this._topPoint2.z-e.z,t[i++]=this._bottomPoint1.x-e.x,t[i++]=this._bottomPoint1.y-e.y,t[i++]=this._bottomPoint1.z-e.z,t[i++]=this._bottomPoint2.x-e.x,t[i++]=this._bottomPoint2.y-e.y,t[i++]=this._bottomPoint2.z-e.z,t},h$6.prototype.createTexCoords=function(){var e=S$W.createTypedArray(S$W.FLOAT,8);return e[0]=0,e[1]=0,e[2]=1,e[3]=0,e[4]=0,e[5]=1,e[6]=1,e[7]=1,e},h$6.prototype.createNormals=function(){return S$W.createTypedArray(S$W.FLOAT,12)},h$6.prototype.init=function(){this._topPoint1=this._positionArray[0],this._topPoint2=this._positionArray[1];var e=t$W.fromCartesian(this._positionArray[0]),t=t$W.fromCartesian(this._positionArray[1]),i=t$W.clone(e),r=t$W.clone(t);e.height+=.5*d$f,t.height+=.5*d$f,i.height-=d$f,r.height-=d$f,this._topPoint1=t$W.toCartesian(e),this._topPoint2=t$W.toCartesian(t),this._bottomPoint1=t$W.toCartesian(i),this._bottomPoint2=t$W.toCartesian(r),this.planeWidth=t$X.distance(this._topPoint1,this._topPoint2),this.planeHeight=d$f;var n=[];n.push(this._topPoint1),n.push(this._topPoint2),n.push(this._bottomPoint1),n.push(this._bottomPoint2),this.boundingSphere=i$19.fromPoints(n);var o=n.length,a=this;n.map((function(e){a._center.x+=e.x/o,a._center.y+=e.y/o,a._center.z+=e.z/o}));var s={};y$15.fromRotationTranslation(p$1a.IDENTITY,this._center,s),this.modelMatrix=s},h$6.prototype.getVertexArray=function(e){var t=this.createVertices(this._center),i=h$W.createVertexBuffer({context:e,typedArray:t,usage:A$1c.STATIC_DRAW}),r=this.createNormals(this._center),n=h$W.createVertexBuffer({context:e,typedArray:r,usage:A$1c.STATIC_DRAW}),o=this.createTexCoords(),a=h$W.createVertexBuffer({context:e,typedArray:o,usage:A$1c.STATIC_DRAW}),s=[];if(s.push({index:0,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),s.push({index:1,vertexBuffer:n,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1}),s.push({index:2,vertexBuffer:a,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:8,normalize:!1}),e$28(this._volBounds)){for(var l=S$W.createTypedArray(S$W.FLOAT,12),u=[this._topPoint1,this._topPoint2,this._bottomPoint1,this._bottomPoint2],c=0;c<4;c++){var h=t$W.fromCartesian(u[c]),d=e$27.toDegrees(h.longitude),f=e$27.toDegrees(h.latitude),p=h.height,_=(d-this._volBounds.left)/(this._volBounds.right-this._volBounds.left),m=(f-this._volBounds.bottom)/(this._volBounds.top-this._volBounds.bottom),$=(p-this._volBounds.minHeight)/(this._volBounds.maxHeight-this._volBounds.minHeight);l[3*c]=_,l[3*c+1]=m,l[3*c+2]=$}var g=h$W.createVertexBuffer({context:e,typedArray:l,usage:A$1c.STATIC_DRAW});s.push({index:3,vertexBuffer:g,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:12,normalize:!1})}var v=S$W.createTypedArray(S$W.UNSIGNED_SHORT,6);return v[0]=0,v[1]=1,v[2]=3,v[3]=0,v[4]=3,v[5]=2,new m$19({context:e,attributes:s,indexBuffer:h$W.createIndexBuffer({context:e,typedArray:v,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})})},h$6.prototype.destroy=function(){return i$Z(this)};var _0x287773=(_0x672b17=!0,function(e,t){var i=_0x672b17?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x672b17=!1,i}),_0x462680=_0x287773(void 0,(function(){return _0x462680.toString().search("(((.+)+)+)+$").toString().constructor(_0x462680).search("(((.+)+)+)+$")})),_0x672b17;_0x462680();var k$8="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D uClampIDTexture;\nuniform sampler2D uClampColorTexture;\nuniform sampler2D uModelTexture;\nuniform vec4 uModelTextureRect;\nuniform vec4 uModelColor;\nuniform vec3 uHasModelTextureAndPixelLength;\nuniform vec3 uModelTextureTiling;\nuniform vec4 uModelIDColor;\nuniform vec4 uProfilePickColor;\nuniform bool uPicking;\nuniform vec4 uHighLightColor;\nuniform float uUseOriModelTex;\nuniform float uClippingType;\nvarying vec2 v_texCoord;\nvarying float v_face;\n#ifdef Volume2\nvarying vec3 vecRotioCoord;\n#endif\nvoid main()\n{\nvec2 texCoord = vec2(gl_FragCoord.x / czm_viewport.z, gl_FragCoord.y / czm_viewport.w);\nvec4 idColor = texture2D(uClampIDTexture, texCoord) * 255.0;\nif((gl_FrontFacing && uClippingType < 1.5) || idColor.r != uModelIDColor.r || idColor.g != uModelIDColor.g || idColor.b != uModelIDColor.b)\n{\n discard;\n}\nif(uPicking){\n gl_FragColor = uProfilePickColor;\n return;\n}\nvec4 color = texture2D(uClampColorTexture, texCoord);\ntexCoord = mod(v_texCoord * uModelTextureTiling.xy, vec2(1.0));\nif(v_face > -0.1 && v_face < 0.1)\n{\n texCoord = mod(v_texCoord * uModelTextureTiling.xz, vec2(1.0));\n}\n#ifdef GEOBOX\n if(v_face > -0.1 && v_face < 0.1)\n {\n texCoord = mod(v_texCoord * uModelTextureTiling.xy, vec2(1.0));\n }\n else if(v_face > 0.5)\n {\n texCoord = mod(v_texCoord * vec2(uModelTextureTiling.zy), vec2(1.0));\n }\n else if(v_face < -0.5)\n {\n texCoord = mod(v_texCoord * vec2(uModelTextureTiling.zx), vec2(1.0));\n }\n#endif\nvec2 pixelSize = uHasModelTextureAndPixelLength.yz;\ntexCoord = clamp(texCoord, pixelSize, 1.0 - pixelSize);\nvec2 modelTexCoord = uUseOriModelTex > 0.5 ? texCoord : mix(uModelTextureRect.xy, uModelTextureRect.zw, texCoord);\nvec4 texColor = texture2D(uModelTexture, modelTexCoord);\ngl_FragColor = uUseOriModelTex > 0.5 ? texColor * color * uHighLightColor : mix(uModelColor, texColor, uHasModelTextureAndPixelLength.x) * uHighLightColor * color;\n#ifdef Volume\n#ifdef Volume2\n if((vecRotioCoord.x < 1.0 && vecRotioCoord.x >0.0) && (vecRotioCoord.y < 1.0 && vecRotioCoord.y >0.0) && (vecRotioCoord.z < 1.0 && vecRotioCoord.z >0.0))\n {\n gl_FragColor = czm_getVolumeValue(vecRotioCoord);\n }\n#else\n float wValue = 0.0;\n gl_FragColor = czm_getHypsometricColor(gl_FragColor, wValue);\n#endif\n gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(1.0/2.2));\n#endif\n}";function p$7(e,t,i,r){this._scene=e._scene,this._attributeLocations={aPosition:0,aNormal:1,aTexCoord:2},this._geometry=r,this._drawCommandInClampTexture=null,this._drawCommandInScene=null,this._drawCommandNormal=null,this._drawCommandInScenePreModel={},this._clampFramebuffer=null,this._name="solidModelsProfile_"+e._name+"_"+t.toString(),this._textureAtlas=e._textureAtlas,this._modelInfo=i,this._picking=!1,this._owner=e,this._clippingType=V$i.KeepInside,this._volume=void 0,this._width=1,this._height=1}p$7.prototype.createCommand=function(e){var t=y$15.clone(this._geometry.modelMatrix),i=this._geometry.boundingSphere,r=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:t,pass:Le$p.OPAQUE,cull:!1,boundingVolume:i});r.vertexArray=this._geometry.getVertexArray(e);var n=new a$$({name:"ClipPlaneVp",sources:[V$j]}),o=new a$$({name:"SolidProfileFp",sources:[k$8]});this._geometry.type==P$v.GEOCYLINDER?(n.defines.push("GEOCYLINDER"),o.defines.push("GEOCYLINDER")):this._geometry.type==P$v.GEOBOX&&(n.defines.push("GEOBOX"),o.defines.push("GEOBOX")),e$28(this._volume)&&(n.defines.push("Volume"),o.defines.push("Volume"),this._volume.hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(n.defines.push("Volume2"),o.defines.push("Volume2"))),r.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:this._attributeLocations}),r.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},depthMask:{enabled:!0},blending:Ee$n.ALPHA_BLEND});for(var a in this._drawCommandInScene=r,this._modelInfo)this.copyCommandForSingleModel(a,this._modelInfo[a],this._drawCommandInScene,e);this.createCommandInClampTexture(r,e),this.createNormalCommand(this._drawCommandInClampTexture,e)};var y$9=new t$X,c$8=new e$25,a$9=new t$X,C$7=new t$X,m$b=new e$1S;function L$a(e){e$28(e)&&(e.vertexArray=e.vertexArray&&!e.vertexArray.isDestroyed()&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),e.renderState=void 0,e.uniformMap=void 0)}function r$e(){t$Z.throwInstantiationError()}p$7.prototype.copyCommandForSingleModel=function(e,t,i,r){var n=r$15.shallowClone(i),o=this;n.uniformMap={uClampIDTexture:function(){var e=o._clampFramebuffer;return e$28(e)?e.renderTexture._fb.getColorTexture(0):r.defaultTexture},uClampColorTexture:function(){var e=o._clampFramebuffer;return e$28(e)&&2===e.renderTexture._fb._colorTextures.length?e.renderTexture._fb.getColorTexture(1):r.defaultTexture},uModelColor:function(){return t.color},uHasModelTextureAndPixelLength:function(){if(C$7.x=t.textureAtlasID>=0?1:0,e$28(o._textureAtlas)){var e=o._textureAtlas.texture.width,i=o._textureAtlas.texture.height,r=o._textureAtlas.textureCoordinates[t.textureAtlasID];if(e$28(r)){var n=r.width*e,a=r.height*i;C$7.y=1/n,C$7.z=1/a}}return C$7},uUseOriModelTex:function(){return!e$28(o._textureAtlas)&&e$28(t.texture)},uModelTexture:function(){return e$28(o._textureAtlas)?o._textureAtlas.texture:e$28(t.texture)?t.texture:r.defaultTexture},uModelTextureRect:function(){if(e$28(o._textureAtlas)){var e=o._textureAtlas.textureCoordinates[t.textureAtlasID];e$28(e)&&(c$8.x=e.x,c$8.y=e.y,c$8.z=e.x+e.width,c$8.w=e.y+e.height)}return c$8},uModelTextureTiling:function(){return"PLANE"==o._geometry.type?(a$9.x=o._geometry.planeWidth/t.textureTilingU,a$9.y=o._geometry.planeHeight/t.textureTilingV,a$9.z=2e4/t.textureTilingV):o._geometry.type==P$v.GEOCYLINDER?(a$9.x=2*Math.PI*o._geometry.geoTopRadius/t.textureTilingU,a$9.y=o._geometry.geoHeight/t.textureTilingV):o._geometry.type==P$v.GEOREGION3D?(a$9.x=o._geometry.width/t.textureTilingU,a$9.y=o._geometry.height/t.textureTilingV,a$9.z=Math.abs(o._geometry._extrudedHeight)/t.textureTilingV):o._geometry.type==P$v.GEOBOX&&(a$9.x=o._geometry.geoWidth/t.textureTilingU,a$9.y=o._geometry.geoHeight/t.textureTilingV,a$9.z=o._geometry.geoLength/t.textureTilingU),a$9},uClippingType:function(){return o._clippingType},uGeometryHeight:function(){return o._geometry.type==P$v.GEOCYLINDER?o._geometry.geoHeight:1},uModelIDColor:function(){return y$9.x=t.pickColor.x,y$9.y=t.pickColor.y,y$9.z=t.pickColor.z,y$9},uProfilePickColor:function(){return t.profilePickId.color},uPicking:function(){return o._picking},uHighLightColor:function(){var e=o._owner._selectedProfileIDs;if(0==e.length)m$b.red=1,m$b.green=1,m$b.blue=1;else{var i=!1;e.map((function(e){t.id==e&&(i=!0)})),i?(m$b.red=.7,m$b.green=.7,m$b.blue=1):(m$b.red=1,m$b.green=1,m$b.blue=1)}return m$b},uVolumeTexture:function(){return o._volume._volTexture},width:function(){return o._volume._volImageBuffer.nWidth},height:function(){return o._volume._volImageBuffer.nHeight},depth:function(){return o._volume._volImageBuffer.nDepth},sideBlockCount:function(){return o._volume._volImageBuffer.nSideBlockCount},blockLength:function(){return o._volume._volImageBuffer.nBlockLength},texLength:function(){return o._volume._volImageBuffer.nLength},uFilterMode:function(){var e=0;return e$28(o._volume.hypsometricSetting)&&o._volume.hypsometricSetting.filterMode===k$T.FilterMode.NEAREST&&(e=1),e},uMixColorType:function(){return 0},uDataFloor:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.ColorTableMinKey:0},uDataCeil:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.ColorTableMaxKey:0},uVolumeType:function(){return e$28(o._volume.hypsometricSetting)&&o._volume.hypsometricSetting.filterMode===k$T.FilterMode.LINEAR?0:1},uHypOpacity:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.Opacity:1},uHypContourInterval:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.LineInterval:100},uHypLineColor:function(){var e=new e$25(0,1,1,1);return e$28(o._volume.hypsometricSetting)&&(e.x=o._volume.hypsometricSetting.LineColor.red,e.y=o._volume.hypsometricSetting.LineColor.green,e.z=o._volume.hypsometricSetting.LineColor.blue,e.w=o._volume.hypsometricSetting.LineColor.alpha),e},uHypContourFillMode:function(){var e=1;if(e$28(o._volume.hypsometricSetting))switch(o._volume.hypsometricSetting.DisplayMode){case k$T.DisplayMode.NONE:e=0;break;case k$T.DisplayMode.FACE:e=1;break;case k$T.DisplayMode.LINE:e=2;break;case k$T.DisplayMode.FACE_AND_LINE:e=3}return e},uHypFloor:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.ColorTableMinKey:0},uHypCeil:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.ColorTableMaxKey:0},uHypMaxVisibleValue:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.MaxVisibleValue:0},uHypMinVisibleValue:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.MinVisibleValue:0},uNoValueColor:function(){return e$28(o._volume.hypsometricSetting)?o._volume.hypsometricSetting.noValueColor:e$1S.WHITE},uHypsometricVisible:function(){return 1},uHypHasAnalysisRegion:function(){return 0},uHypsometricRenderTexture:function(){return 0},uHypsometricTexture:function(){return o._volume._hypsometricTexture}},this._drawCommandInScenePreModel[e]=n},p$7.prototype.createCommandInClampTexture=function(e,t){var i=r$15.shallowClone(e);i.pass=Le$p.OPAQUE;var r={enabled:!1};this._geometry.type===P$v.GEOREGION3D&&this._clippingType===V$i.KeepOutside&&(r.enabled=!0,r.face=de$y.FRONT),i.renderState=u$R.fromCache({cull:r,depthTest:{enabled:!0},depthMask:!0,colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:_0x17966c.createReceiveClampObjectStencilTest(!0)}),i.uniformMap={uDiffuseColor:function(){return e$1S.WHITE}},i.shaderProgram=S$T.fromCache({context:t,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:this._attributeLocations}),this._drawCommandInClampTexture=i},p$7.prototype.createNormalCommand=function(e){this._drawCommandNormal=r$15.shallowClone(e),this._drawCommandNormal.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},depthMask:!1,colorMask:{red:!0,green:!0,blue:!0,alpha:!0},stencilTest:!1})},p$7.prototype.createClampFrameBuffer=function(e,t){e$28(this._clampFramebuffer)||(this._frameState=t,e$28(t._framebufferList[this._name])?this._clampFramebuffer=t._framebufferList[this._name]:(this._clampFramebuffer=e.createClampFramebuffer(),this._clampFramebuffer.renderTexture.mrt=!0,t._framebufferList[this._name]=this._clampFramebuffer))},p$7.prototype.update=function(e,t,i,r){this._picking=t.passes.pick,this._frameState=t;var n=e.drawingBufferWidth,o=e.drawingBufferHeight;if((this._width!==n||this._height!==o)&&(this._width=n,this._height=o,e$28(this._clampFramebuffer)&&(this._clampFramebuffer.renderTexture._mrt=!1)),(!e$28(this._drawCommandInScene)||this._geometry._isGeometryDirty)&&(this.createCommand(e,t),this.createClampFrameBuffer(e,t)),t._fboState.frameBufferType==L$T.CLAMP)t._fboState.name==this._name&&i.push(this._drawCommandInClampTexture);else for(var a in this._geometry.type==P$v.GEOCYLINDER&&i.push(this._drawCommandNormal),this._drawCommandInScenePreModel){var s=this._modelInfo[a];if(!t$X.equals(s.pickColor,t$X.ZERO)){var l=this._drawCommandInScenePreModel[a];i.push(l)}}},p$7.prototype.destroy=function(){return L$a(this._drawCommandInClampTexture),this._drawCommandInClampTexture=void 0,L$a(this._drawCommandInScene),this._drawCommandInScene=void 0,this._drawCommandNormal=void 0,this._drawCommandInScenePreModel={},e$28(this._clampFramebuffer)&&(this._clampFramebuffer.destroy(),this._frameState._framebufferList[this._name]=void 0),e$28(this._geometry)&&(this._geometry=null),i$Z(this)},r$e.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(r$e.prototype,{quadtree:{get:t$Z.throwInstantiationError,set:t$Z.throwInstantiationError},ready:{get:t$Z.throwInstantiationError},tilingScheme:{get:t$Z.throwInstantiationError},errorEvent:{get:t$Z.throwInstantiationError}}),r$e.prototype.update=t$Z.throwInstantiationError,r$e.prototype.beginUpdate=t$Z.throwInstantiationError,r$e.prototype.endUpdate=t$Z.throwInstantiationError,r$e.prototype.getLevelMaximumGeometricError=t$Z.throwInstantiationError,r$e.prototype.loadTile=t$Z.throwInstantiationError,r$e.prototype.computeTileVisibility=t$Z.throwInstantiationError,r$e.prototype.showTileThisFrame=t$Z.throwInstantiationError,r$e.prototype.computeDistanceToTile=t$Z.throwInstantiationError,r$e.prototype.isDestroyed=t$Z.throwInstantiationError,r$e.prototype.destroy=t$Z.throwInstantiationError;var e$5={LOW:1024,MEDIUM:2048,HIGH:4096},Quality=Object.freeze(e$5);function R$7(e){o$1u.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}R$7.prototype.completeMorph=function(){e$28(this._completeMorph)&&this._completeMorph()},R$7.prototype.morphTo2D=function(e,t){e$28(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof a$X,this._previousMode!==P$$.SCENE2D&&this._previousMode!==P$$.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,P$$.SCENE2D,!0),i._mode=P$$.MORPHING,i.camera._setTransform(y$15.IDENTITY),this._previousMode===P$$.COLUMBUS_VIEW?be$2(this,e):Ze$1(this,e,t),0===e&&e$28(this._completeMorph)&&this._completeMorph())};var ce$4=new t$X,ae$3=new t$X,se$2=new t$X,pe$5=new t$X,ue$2=new t$X,me$4=new t$X,he$2=new t$X,fe$3=new t$W,de$4=new y$15,ve$2=new o$15,le$3=new a$X,_e$3={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};R$7.prototype.morphToColumbusView=function(e,t){e$28(this._completeMorph)&&this._completeMorph();var i=this._scene;if(this._previousMode=i.mode,this._previousMode!==P$$.COLUMBUS_VIEW&&this._previousMode!==P$$.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,P$$.COLUMBUS_VIEW,!0),i.camera._setTransform(y$15.IDENTITY);var r,n=ce$4,o=ae$3,a=se$2;if(e>0)n.x=0,n.y=-1,n.z=1,n=t$X.multiplyByScalar(t$X.normalize(n,n),5*t.maximumRadius,n),t$X.negate(t$X.normalize(n,o),o),t$X.cross(t$X.UNIT_X,o,a);else{var s=i.camera;if(this._previousMode===P$$.SCENE2D)t$X.clone(s.position,n),n.z=s.frustum.right-s.frustum.left,t$X.negate(t$X.UNIT_Z,o),t$X.clone(t$X.UNIT_Y,a);else{t$X.clone(s.positionWC,n),t$X.clone(s.directionWC,o),t$X.clone(s.upWC,a);var l=t.scaleToGeodeticSurface(n,he$2),u=m$1b.eastNorthUpToFixedFrame(l,t,de$4);y$15.inverseTransformation(u,u),i.mapProjection.project(t.cartesianToCartographic(n,fe$3),n),y$15.multiplyByPointAsVector(u,o,o),y$15.multiplyByPointAsVector(u,a,a)}}this._morphToOrthographic?((r=le$3).width=i.camera.frustum.right-i.camera.frustum.left,r.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight):((r=ve$2).aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,r.fov=e$27.toRadians(60));var c=_e$3;c.position=n,c.direction=o,c.up=a,c.frustum=r;var h=Ye$1(c);V$4(this,h),this._previousMode===P$$.SCENE2D?Qe$2(this,e,c,h):(c.position2D=y$15.multiplyByPoint(v$n.TRANSFORM_2D,n,pe$5),c.direction2D=y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,o,ue$2),c.up2D=y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,a,me$4),i._mode=P$$.MORPHING,K$3(this,e,c,h)),0===e&&e$28(this._completeMorph)&&this._completeMorph()}};var A$a={position:new t$X,direction:new t$X,up:new t$X,frustum:void 0},G$8=new o$15;function V$4(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new g$G(e._scene.canvas);var i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,J$P.LEFT_DOWN),e._morphHandler.setInputAction(i,J$P.MIDDLE_DOWN),e._morphHandler.setInputAction(i,J$P.RIGHT_DOWN),e._morphHandler.setInputAction(i,J$P.WHEEL)}}function P$5(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()}R$7.prototype.morphTo3D=function(e,t){e$28(this._completeMorph)&&this._completeMorph();var i=this._scene;if(this._previousMode=i.mode,this._previousMode!==P$$.SCENE3D&&this._previousMode!==P$$.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,P$$.SCENE3D,!0),i._mode=P$$.MORPHING,i.camera._setTransform(y$15.IDENTITY),this._previousMode===P$$.SCENE2D)Se$2(this,e,t);else{var r;e>0?(r=A$a,t$X.fromDegrees(0,0,5*t.maximumRadius,t,r.position),t$X.negate(r.position,r.direction),t$X.normalize(r.direction,r.direction),t$X.clone(t$X.UNIT_Z,r.up)):r=x$6(this,t);var n,o=i.camera;o.frustum instanceof a$X?n=o.frustum.clone():((n=G$8).aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,n.fov=e$27.toRadians(60)),r.frustum=n;var a=ee$4(r);V$4(this,a),B$6(this,e,r,a)}0===e&&e$28(this._completeMorph)&&this._completeMorph()}},R$7.prototype.isDestroyed=function(){return!1},R$7.prototype.destroy=function(){return P$5(this),i$Z(this)};var Te$3=new t$W,De$4=new t$X,ge$5=new y$15;function x$6(e,t){var i=e._scene,r=i.camera,n=A$a,o=n.position,a=n.direction,s=n.up,l=i.mapProjection.unproject(r.position,Te$3);t.cartographicToCartesian(l,o);var u=t.scaleToGeodeticSurface(o,De$4),c=m$1b.eastNorthUpToFixedFrame(u,t,ge$5);return y$15.multiplyByPointAsVector(c,r.direction,a),y$15.multiplyByPointAsVector(c,r.up,s),n}var we$1=new t$X,Ce$2=new t$X,Me$6=new t$X,Ee$2=new t$X,Re$2=new t$X,Oe$2=new t$X;function B$6(e,t,i,r){t*=.5;var n=e._scene,o=n.camera,a=t$X.clone(o.position,we$1),s=t$X.clone(o.direction,Ce$2),l=t$X.clone(o.up,Me$6),u=y$15.multiplyByPoint(v$n.TRANSFORM_2D_INVERSE,i.position,Ee$2),c=y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D_INVERSE,i.direction,Re$2),h=y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D_INVERSE,i.up,Oe$2);var d=n.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){w$5(a,u,e.time,o.position),w$5(s,c,e.time,o.direction),w$5(l,h,e.time,o.up),t$X.cross(o.direction,o.up,o.right),t$X.normalize(o.right,o.right)},complete:function(){$$5(e,n,0,1,t,r)}});e._currentTweens.push(d)}var Ve$4=new a$X,L$9=new t$X,Z$6=new t$X,Q$5=new t$X,H$7=new t$X,Y$3=new t$X,k$7=new t$X;function Se$2(e,t,i){t/=3;var r,n,o=e._scene,a=o.camera;t>0?(r=A$a,t$X.fromDegrees(0,0,5*i.maximumRadius,i,r.position),t$X.negate(r.position,r.direction),t$X.normalize(r.direction,r.direction),t$X.clone(t$X.UNIT_Z,r.up)):(a.position.z=a.frustum.right-a.frustum.left,r=x$6(e,i)),e._morphToOrthographic?((n=Ve$4).aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,n.width=a.frustum.right-a.frustum.left):((n=G$8).aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,n.fov=e$27.toRadians(60)),r.frustum=n;var s,l=ee$4(r);V$4(e,l),s=e._morphToOrthographic?function(){B$6(e,t,r,l)}:function(){J$6(e,t,r,(function(){B$6(e,t,r,l)}))},t>0?(o._mode=P$$.SCENE2D,a.flyTo({duration:t,destination:t$X.fromDegrees(0,0,5*i.maximumRadius,i,H$7),complete:function(){o._mode=P$$.MORPHING,s()}})):s()}function w$5(e,t,i,r){return t$X.lerp(e,t,i,r)}function X$3(e,t,i,r,n){var o=e._scene,a=o.camera;if(!(a.frustum instanceof a$X)){var s=a.frustum.fov,l=.5*e$27.RADIANS_PER_DEGREE,u=i.position.z*Math.tan(.5*s);a.frustum.far=u/Math.tan(.5*l)+1e7;var c=o.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=e$27.lerp(s,l,e.time);var t=u/Math.tan(.5*a.frustum.fov);r(a,t)},complete:function(){a.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(c)}}var Ne$2=new t$X,Pe$3=new t$X,Ue$4=new t$X,b$b=new t$X,Ie$4=new t$X,ye$2=new t$X,Fe$3=new l$$,Ae$3=new f$18,Be$5=new t$X,He$2={position:void 0,direction:void 0,up:void 0,frustum:void 0};function be$2(e,t){t*=.5;var i=e._scene,r=i.camera,n=t$X.clone(r.position,Ne$2),o=t$X.clone(r.direction,Pe$3),a=t$X.clone(r.up,Ue$4),s=t$X.negate(t$X.UNIT_Z,Ie$4),l=t$X.clone(t$X.UNIT_Y,ye$2),u=b$b;if(t>0)t$X.clone(t$X.ZERO,b$b),u.z=5*i.mapProjection.ellipsoid.maximumRadius;else{t$X.clone(n,b$b);var c=Ae$3;y$15.multiplyByPoint(v$n.TRANSFORM_2D,n,c.origin),y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,o,c.direction);var h=i.globe;if(e$28(h)){var d=h.pickWorldCoordinates(c,i,Be$5);e$28(d)&&(y$15.multiplyByPoint(v$n.TRANSFORM_2D_INVERSE,d,u),u.z+=t$X.distance(n,u))}}var f=Fe$3;f.right=.5*u.z,f.left=-f.right,f.top=f.right*(i.drawingBufferHeight/i.drawingBufferWidth),f.bottom=-f.top;var p=He$2;p.position=u,p.direction=s,p.up=l,p.frustum=f;var _=te$4(p);function m(e,t){e.position.z=t}V$4(e,_);var $=i.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){w$5(n,u,e.time,r.position),w$5(o,s,e.time,r.direction),w$5(a,l,e.time,r.up),t$X.cross(r.direction,r.up,r.right),t$X.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)},complete:function(){X$3(e,t,p,m,_)}});e._currentTweens.push($)}var q$5=new t$W,je$2={position:new t$X,direction:new t$X,up:new t$X,position2D:new t$X,direction2D:new t$X,up2D:new t$X,frustum:new l$$},ze$2={position:new t$X,direction:new t$X,up:new t$X,frustum:void 0},We$2=new t$X,Ge$2=new f$18,xe$3=new y$15,Le$2=new t$X;function Ze$1(e,t,i){t*=.5;var r=e._scene,n=r.camera,o=je$2;if(t>0)t$X.clone(t$X.ZERO,o.position),o.position.z=5*i.maximumRadius,t$X.negate(t$X.UNIT_Z,o.direction),t$X.clone(t$X.UNIT_Y,o.up);else{i.cartesianToCartographic(n.positionWC,q$5),r.mapProjection.project(q$5,o.position),t$X.negate(t$X.UNIT_Z,o.direction),t$X.clone(t$X.UNIT_Y,o.up);var a=Ge$2;t$X.clone(o.position2D,a.origin);var s=t$X.clone(n.directionWC,a.direction),l=i.scaleToGeodeticSurface(n.positionWC,Le$2),u=m$1b.eastNorthUpToFixedFrame(l,i,xe$3);y$15.inverseTransformation(u,u),y$15.multiplyByPointAsVector(u,s,s),y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,s,s);var c=r.globe;if(e$28(c)){var h=c.pickWorldCoordinates(a,r,We$2);if(e$28(h)){var d=t$X.distance(o.position2D,h);h.x+=d,t$X.clone(h,o.position2D)}}}function f(e,t){e.position.x=t}y$15.multiplyByPoint(v$n.TRANSFORM_2D,o.position,o.position2D),y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,o.direction,o.direction2D),y$15.multiplyByPointAsVector(v$n.TRANSFORM_2D,o.up,o.up2D);var p=o.frustum;p.right=.5*o.position.z,p.left=-p.right,p.top=p.right*(r.drawingBufferHeight/r.drawingBufferWidth),p.bottom=-p.top;var _=ze$2;y$15.multiplyByPoint(v$n.TRANSFORM_2D_INVERSE,o.position2D,_.position),t$X.clone(o.direction,_.direction),t$X.clone(o.up,_.up),_.frustum=p;var m=te$4(_);V$4(e,m),K$3(e,t,o,(function(){X$3(e,t,o,f,m)}))}function J$6(e,t,i,r){var n=e._scene,o=n.camera,a=o.frustum.right-o.frustum.left;o.frustum=i.frustum.clone();var s=o.frustum.fov,l=.5*e$27.RADIANS_PER_DEGREE,u=a*Math.tan(.5*s);o.frustum.far=u/Math.tan(.5*l)+1e7,o.frustum.fov=l;var c=n.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){o.frustum.fov=e$27.lerp(l,s,e.time),o.position.z=u/Math.tan(.5*o.frustum.fov)},complete:function(){r(e)}});e._currentTweens.push(c)}function Qe$2(e,t,i,r){t*=.5;var n=e._scene,o=n.camera,a=t$X.clone(i.position,H$7),s=t$X.clone(i.direction,Y$3),l=t$X.clone(i.up,k$7);function u(){o.frustum=i.frustum.clone();var u=t$X.clone(o.position,L$9),c=t$X.clone(o.direction,Z$6),h=t$X.clone(o.up,Q$5);u.z=a.z;var d=n.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){w$5(u,a,e.time,o.position),w$5(c,s,e.time,o.direction),w$5(h,l,e.time,o.up),t$X.cross(o.direction,o.up,o.right),t$X.normalize(o.right,o.right)},complete:function(){r(e)}});e._currentTweens.push(d)}n._mode=P$$.MORPHING,e._morphToOrthographic?u():J$6(e,0,i,u)}function K$3(e,t,i,r){var n=e._scene,o=n.camera,a=t$X.clone(o.position,L$9),s=t$X.clone(o.direction,Z$6),l=t$X.clone(o.up,Q$5),u=t$X.clone(i.position2D,H$7),c=t$X.clone(i.direction2D,Y$3),h=t$X.clone(i.up2D,k$7);var d=n.tweens.add({duration:t,easingFunction:m$S.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){w$5(a,u,e.time,o.position),w$5(s,c,e.time,o.direction),w$5(l,h,e.time,o.up),t$X.cross(o.direction,o.up,o.right),t$X.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)},complete:function(){$$5(e,n,1,0,t,r)}});e._currentTweens.push(d)}function $$5(e,t,i,r,n,o){var a={object:t,property:"morphTime",startValue:i,stopValue:r,duration:n,easingFunction:m$S.QUARTIC_OUT};e$28(o)&&(a.complete=function(){o(e)});var s=t.tweens.addProperty(a);e._currentTweens.push(s)}function ee$4(e){return function(t){var i=t._scene;i._mode=P$$.SCENE3D,i.morphTime=P$$.getMorphTime(P$$.SCENE3D),P$5(t);var r=i.camera;(t._previousMode!==P$$.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,t$X.clone(e.position,r.position),t$X.clone(e.direction,r.direction),t$X.clone(e.up,r.up),t$X.cross(r.direction,r.up,r.right),t$X.normalize(r.right,r.right),r.frustum=e.frustum.clone());var n=r.frustum;i.frameState.useLogDepth&&(n.near=.1,n.far=1e10);var o=e$28(t._completeMorph);t._completeMorph=void 0,i.camera.update(i.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,P$$.SCENE3D,o)}}function te$4(e){return function(t){var i=t._scene;i._mode=P$$.SCENE2D,i.morphTime=P$$.getMorphTime(P$$.SCENE2D),P$5(t);var r=i.camera;t$X.clone(e.position,r.position),r.position.z=2*i.mapProjection.ellipsoid.maximumRadius,t$X.clone(e.direction,r.direction),t$X.clone(e.up,r.up),t$X.cross(r.direction,r.up,r.right),t$X.normalize(r.right,r.right),r.frustum=e.frustum.clone();var n=e$28(t._completeMorph);t._completeMorph=void 0,i.camera.update(i.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,P$$.SCENE2D,n)}}function Ye$1(e){return function(t){var i=t._scene;i._mode=P$$.COLUMBUS_VIEW,i.morphTime=P$$.getMorphTime(P$$.COLUMBUS_VIEW),P$5(t);var r=i.camera;(t._previousModeMode!==P$$.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,t$X.clone(e.position,r.position),t$X.clone(e.direction,r.direction),t$X.clone(e.up,r.up),t$X.cross(r.direction,r.up,r.right),t$X.normalize(r.right,r.right));var n=r.frustum;i.frameState.useLogDepth&&(n.near=.1,n.far=1e10);var o=e$28(t._completeMorph);t._completeMorph=void 0,i.camera.update(i.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,P$$.COLUMBUS_VIEW,o)}}function d$e(e,t,i,r,n,o,a,s,l,u){this._tweens=e,this._tweenjs=t,this._startObject=l$1e(i),this._stopObject=l$1e(r),this._duration=n,this._delay=o,this._easingFunction=a,this._update=s,this._complete=l,this.cancel=u,this.needsStart=!0}function s$a(){this._tweens=[]}function ua(e){if(!e$28(e))throw new t$Z("scene is required.");this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.enableWalk=!1,this.walkParameters={speed:1,height:2},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=K$c.LEFT_DRAG,this.zoomEventTypes=[K$c.RIGHT_DRAG,K$c.WHEEL,K$c.PINCH],this.rotateEventTypes=K$c.LEFT_DRAG,this.tiltEventTypes=[K$c.MIDDLE_DRAG,K$c.PINCH,{eventType:K$c.LEFT_DRAG,modifier:Na$2.CTRL},{eventType:K$c.RIGHT_DRAG,modifier:Na$2.CTRL}],this.lookEventTypes={eventType:K$c.LEFT_DRAG,modifier:Na$2.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e4,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._enableIndoorColliDetection=!1,this.minimumDetectDistance=.5,this.minimumWalkingDetectDistance=2,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new l$j(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 s$a,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new o$1k(-1,-1),this._tiltCenter=new t$X,this._rotateMousePosition=new o$1k(-1,-1),this._rotateStartPosition=new t$X,this._strafeStartPosition=new t$X,this._zoomMouseStart=new o$1k(-1,-1),this._zoomWorldPosition=new t$X,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var t=e.mapProjection;this._maxCoord=t.project(new t$W(Math.PI,e$27.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=.618,this._minimumRotateRate=.5,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._cloneCamera=void 0,this._isAroundScreenCenter=!1,this.autoTiltHeight=0,this._controlMode=ni$1.NORMAL,this._enableFusion=!1,this.panOffset={x:0,y:0},this.zoomDirty=!1,this.panDirty=!1,this.minFov=e$27.toRadians(20),this.maxFov=e$27.toRadians(70)}Object.defineProperties(d$e.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}}}),d$e.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(s$a.prototype,{length:{get:function(){return this._tweens.length}}}),s$a.prototype.add=function(e){if(!e$28((e=u$Y(e,u$Y.EMPTY_OBJECT)).startObject)||!e$28(e.stopObject))throw new t$Z("options.startObject and options.stopObject are required.");if(!e$28(e.duration)||e.duration<0)throw new t$Z("options.duration is required and must be positive.");if(0===e.duration)return e$28(e.complete)&&e.complete(),new d$e(this);var t=e.duration/h$Z.SECONDS_PER_MILLISECOND,i=u$Y(e.delay,0),r=i/h$Z.SECONDS_PER_MILLISECOND,n=u$Y(e.easingFunction,m$S.LINEAR_NONE),o=e.startObject,a=new f$Y.Tween(o);a.to(l$1e(e.stopObject),t),a.delay(r),a.easing(n),e$28(e.update)&&a.onUpdate((function(){e.update(o)})),a.onComplete(u$Y(e.complete,null)),a.repeat(u$Y(e._repeat,0));var s=new d$e(this,a,e.startObject,e.stopObject,e.duration,i,n,e.update,e.complete,e.cancel);return this._tweens.push(s),s},s$a.prototype.addProperty=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).object,i=e.property,r=e.startValue,n=e.stopValue;if(!e$28(t)||!e$28(e.property))throw new t$Z("options.object and options.property are required.");if(!e$28(t[i]))throw new t$Z("options.object must have the specified property.");if(!e$28(r)||!e$28(n))throw new t$Z("options.startValue and options.stopValue are required.");return this.add({startObject:{value:r},stopObject:{value:n},duration:u$Y(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})},s$a.prototype.addAlpha=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).material;if(!e$28(t))throw new t$Z("options.material is required.");var i=[];for(var r in t.uniforms)t.uniforms.hasOwnProperty(r)&&e$28(t.uniforms[r])&&e$28(t.uniforms[r].alpha)&&i.push(r);if(0===i.length)throw new t$Z("material has no properties with alpha components.");return this.add({startObject:{alpha:u$Y(e.startValue,0)},stopObject:{alpha:u$Y(e.stopValue,1)},duration:u$Y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){for(var r=i.length,n=0;n<r;++n)t.uniforms[i[n]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},s$a.prototype.addOffsetIncrement=function(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).material;if(!e$28(t))throw new t$Z("material is required.");if(!e$28(t.uniforms.offset))throw new t$Z("material.uniforms must have an offset property.");var i=t.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},s$a.prototype.remove=function(e){if(!e$28(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),e$28(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},s$a.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),e$28(i.cancel)&&i.cancel()}e.length=0},s$a.prototype.contains=function(e){return e$28(e)&&-1!==this._tweens.indexOf(e)},s$a.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return this._tweens[e]},s$a.prototype.update=function(e){var t=this._tweens,i=0;for(e=e$28(e)?e/h$Z.SECONDS_PER_MILLISECOND:kt$7();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 Wa=0;function Xi(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function Ki(e){return o$1k.equalsEpsilon(e.startPosition,e.endPosition,e$27.EPSILON14)}Object.defineProperties(ua.prototype,{enableIndoorColliDetection:{get:function(){return this._enableIndoorColliDetection},set:function(e){this._enableIndoorColliDetection=e,this._scene.camera._enableIndoorColliDetection=e}},zoomFactor:{get:function(){return this._zoomFactor},set:function(e){this._zoomFactor=e}},previousHeight:{set:function(e){Wa=e}},controlMode:{get:function(){return this._controlMode},set:function(e){o$1u.typeOf.number.lessThanOrEquals("controlMode",e,1),o$1u.typeOf.number.greaterThanOrEquals("controlMode",e,0),this._controlMode=e}},enableFusion:{get:function(){return this._enableFusion},set:function(e){e!==this._enableFusion&&(this._enableFusion=e,this.panOffset={x:0,y:0})}}});var Ji=.4;function $i(e,t,i,r,n,o,a){let s=o[a];e$28(s)||(s=o[a]={startPosition:new o$1k,endPosition:new o$1k,motion:new o$1k,inertiaEnabled:!0});const l=e.getButtonPressTime(t,i),u=e.getButtonReleaseTime(t,i),c=l&&u&&(u.getTime()-l.getTime())/1e3,h=new Date,d=u&&(h.getTime()-u.getTime())/1e3;if(l&&u&&c<Ji){const a=Xi(d,r),l=e.getLastMovement(t,i);if(!e$28(l)||Ki(l)||!s.inertiaEnabled||(s.motion.x=.5*(l.endPosition.x-l.startPosition.x),s.motion.y=.5*(l.endPosition.y-l.startPosition.y),s.startPosition=o$1k.clone(l.startPosition,s.startPosition),s.endPosition=o$1k.multiplyByScalar(s.motion,a,s.endPosition),s.endPosition=o$1k.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||o$1k.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,i)){n(o,e.getStartMousePosition(t,i),s)}}}function ji$1(e,t){if(e$28(t)){let i=e[t];e$28(i)&&(i.inertiaEnabled=!0);const r=e._inertiaDisablers[t];if(e$28(r)){const t=r.length;for(let n=0;n<t;++n)i=e[r[n]],e$28(i)&&(i.inertiaEnabled=!1)}}}var si=[];function N$4(e,t,i,r,n,o){if(e._scene.mode===P$$.COLUMBUS_VIEW&&e._controlMode===ni$1.DESIGN?e._isAroundScreenCenter=!0:e._isAroundScreenCenter=!1,e$28(i)){var a=e._aggregator;e$28(e.tiltEventTypes)&&!Array.isArray(e.tiltEventTypes)&&(e.tiltEventTypes=[e.tiltEventTypes]),Array.isArray(i)||(si[0]=i,i=si);for(var s=i.length,l=0;l<s;++l){var u=i[l],c=e$28(u.eventType)?u.eventType:u,h=u.modifier,d=a.isMoving(c,h)&&a.getMovement(c,h),f=a.getStartMousePosition(c,h);if(e._isAroundScreenCenter){var p=e._scene.getViewport({x:10,y:10});f={x:p.width/2,y:p.height/2}}e.enableInputs&&t&&(d?(r(e,f,d),ji$1(e,o)):n<1&&"_lastInertiaTiltMovement"!=o&&"_lastInertiaZoomMovement"!=o?$i(a,c,h,n,r,e,o):("_lastInertiaZoomMovement"===o||"_lastInertiaTiltMovement"===o)&&a._isDown[c]&&(e._isAroundScreenCenter||(f=a.getStartMousePosition(c,void 0)),e._scene.mode===P$$.SCENE3D&&"_lastInertiaTiltMovement"===o&&e.tiltEventTypes.indexOf(c)>-1?r(e,f,a._lastMovement[c],!0):"_lastInertiaZoomMovement"==o&&a._lastMovement[c].valid&&r(e,f,a._lastMovement[c])))}}}var la=new f$18,ae$2=new t$X,ie$2=new o$1k,ee$3=new t$X,te$3=new o$1k,ne$4=new t$X,re$2=new t$X,se$1=new t$X,oe$3=new t$X,me$3=new t$X,ve$1=new t$X,de$3=new t$X,fe$2=new t$X,ue$1=new t$X,_e$2=new t$X,he$1=new t$X,ge$4=new t$X,pe$4=new t$X,ce$3=new t$X,le$2=new t$X,Q$4=new t$X,oi=new t$X,mi$1=new t$X,Va={orientation:new i$10};function Aa(e,t,i,r,n,o){var a=1;e$28(o)&&(a=e$27.clamp(Math.abs(o),.25,1));var s=e._scene,l=s.camera,u=s.mode;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(s.camera)),v$n.clone(e._scene.camera,e._cloneCamera),l=e._cloneCamera);var c=e.minimumZoomDistance*a,h=e.maximumZoomDistance,d=r*(n-c);d=e$27.clamp(d,e._minimumZoomRate,e._maximumZoomRate);var f=(i.endPosition.y-i.startPosition.y)/e._scene.canvas.clientHeight,p=d*(f=Math.min(f,e.maximumMovementRatio));if(e$28(e.thetaWindowRatio)&&Math.abs(f)<Math.abs(e.thetaWindowRatio))e.thetaWindowRatio=0;else if(e$28(e.phiWindowRatio)&&Math.abs(f)<Math.abs(e.phiWindowRatio))e.phiWindowRatio=0;else if(!(e.enableIndoorColliDetection&&p>0&&Math.abs(n-c)<1||e.enableIndoorColliDetection&&p<0&&Math.abs(n-h)<1)){n-p<c?p=n-c-1:n-p>h&&(p=n-h);var _=Va.orientation;if(_.heading=l.heading,_.pitch=l.pitch,_.roll=l.roll,l.frustum instanceof a$X)return void(Math.abs(p)>0&&(l.zoomIn(p),e.enableIndoorColliDetection&&$$4(e),l._adjustOrthographicFrustum()));var m=o$1k.equals(t,e._zoomMouseStart);e._isAroundScreenCenter&&(m=!1,e._useZoomWorldPosition=!1);var $,g,v=e._zoomingOnVector,y=e._rotatingZoom;if(!m&&!e._isAroundScreenCenter&&(e._zoomMouseStart=o$1k.clone(t,e._zoomMouseStart),e$28(e._globe)&&u===P$$.SCENE2D?($=l.getPickRay(t,la).origin,$=t$X.fromElements($.y,$.z,$.x)):e._globe&&($=ea(e,t,ae$2)),e$28($)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=t$X.clone($,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,v=e._zoomingOnVector=!1,y=e._rotatingZoom=!1),!e._useZoomWorldPosition)return l.zoomIn(p),p<0&&(g=3),void(e.enableIndoorColliDetection&&$$4(e,g));var x=u===P$$.COLUMBUS_VIEW;if(l.positionCartographic.height<2e6&&(y=!0),!m||y){if(u===P$$.SCENE2D){var b=e._zoomWorldPosition,w=l.position;if(!t$X.equals(b,w)&&l.positionCartographic.height<2*e._maxCoord.x){var C=l.position.x,T=t$X.subtract(b,w,ee$3);t$X.normalize(T,T);var S=t$X.distance(b,w)*p/(.5*l.getMagnitude());l.move(T,.5*S),(l.position.x<0&&C>0||l.position.x>0&&C<0)&&($=l.getPickRay(t,la).origin,e._zoomWorldPosition=t$X.clone($,e._zoomWorldPosition))}}else if(u===P$$.SCENE3D){var E=t$X.normalize(l.position,me$3);if(l.positionCartographic.height<3e3&&Math.abs(t$X.dot(l.direction,E))<.6)x=!0;else{var A=s.canvas,P=te$3;P.x=A.clientWidth/2,P.y=A.clientHeight/2;var I=ea(e,P,ne$4);if(e$28(I)&&l.positionCartographic.height<1e6){var M=de$3;t$X.clone(l.position,M);var O=e._zoomWorldPosition,D=ve$1;if(D=t$X.normalize(O,D),t$X.dot(D,E)<0)return;var R=le$2,L=_e$2;t$X.clone(l.direction,L),t$X.add(M,t$X.multiplyByScalar(L,1e3,Q$4),R);var B=he$1,N=ge$4;t$X.subtract(O,M,B),t$X.normalize(B,N);var F=t$X.dot(E,N);if(F>=0)return void(e._zoomMouseStart.x=-1);var z=Math.acos(-F),k=t$X.magnitude(M),V=t$X.magnitude(O),U=k-p,X=t$X.magnitude(B),H=Math.asin(e$27.clamp(X/V*Math.sin(z),-1,1))-Math.asin(e$27.clamp(U/V*Math.sin(z),-1,1))+z,G=fe$2;t$X.normalize(M,G);var W=ue$1;W=t$X.cross(N,G,W),W=t$X.normalize(W,W),t$X.normalize(t$X.cross(G,W,Q$4),L),t$X.multiplyByScalar(t$X.normalize(R,Q$4),t$X.magnitude(R)-p,R),t$X.normalize(M,M),t$X.multiplyByScalar(M,U,M);var Y=pe$4;t$X.multiplyByScalar(t$X.add(t$X.multiplyByScalar(G,Math.cos(H)-1,oi),t$X.multiplyByScalar(L,Math.sin(H),mi$1),Q$4),U,Y),t$X.add(M,Y,M),t$X.normalize(R,G),t$X.normalize(t$X.cross(G,W,Q$4),L);var q=ce$3;return t$X.multiplyByScalar(t$X.add(t$X.multiplyByScalar(G,Math.cos(H)-1,oi),t$X.multiplyByScalar(L,Math.sin(H),mi$1),Q$4),t$X.magnitude(R),q),t$X.add(R,q,R),t$X.clone(M,l.position),t$X.normalize(t$X.subtract(R,M,Q$4),l.direction),t$X.clone(l.direction,l.direction),t$X.cross(l.direction,l.up,l.right),t$X.cross(l.right,l.direction,l.up),l.setView(Va),void(e.enableIndoorColliDetection&&$$4(e))}if(e$28(I)){var j=t$X.normalize(I,re$2),Z=t$X.normalize(e._zoomWorldPosition,se$1),K=t$X.dot(Z,j);if(K>0&&K<1){var Q=e$27.acosClamped(K),J=t$X.cross(Z,j,oe$3),ee=p/(Math.abs(Q)>e$27.toRadians(20)?.75*l.positionCartographic.height:l.positionCartographic.height-p);l.rotate(J,Q*ee)}}else x=!0}}e._rotatingZoom=!x}if(!m&&x||v){var te=m$W.wgs84ToWindowCoordinates(s,e._zoomWorldPosition,ie$2),ie=(u!==P$$.COLUMBUS_VIEW&&o$1k.equals(t,e._zoomMouseStart)&&e$28(te)?l.getPickRay(te,la):l.getPickRay(t,la)).direction;u===P$$.COLUMBUS_VIEW&&t$X.fromElements(ie.y,ie.z,ie.x,ie),l.move(ie,p),e._zoomingOnVector=!0}else l.zoomIn(p);l.setView(Va),e.enableIndoorColliDetection&&$$4(e)}}function we(e,t,i,r,n,o){e._ellipsoid;var a=e._scene,s=a.camera;if(a.canvas,e._globe,e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(a.camera)),v$n.clone(a.camera,e._cloneCamera),s=e._cloneCamera),!(Math.abs(i.endPosition.y-i.startPosition.y)<1)){var l=i.endPosition.y-i.startPosition.y>0?1:-1;e._aggregator._isDown[1]&&(l=i.endPosition.y-t.y>0?.2:-.2,e._isAroundScreenCenter&&(l=i.endPosition.y-i.startPosition.y>0?.2:-.2));var u=e.maximumZoomDistance,c=1*e.minimumZoomDistance,h=l*r*7e-4*48;if(e$28(o)){c=l>0?c:0;var d=t$X.distance(s.position,o),f=r*(d-c);f=e$27.clamp(f,e._minimumZoomRate,e._maximumZoomRate);var p=l/e._scene.canvas.clientHeight,_=f*(p=Math.min(p,e.maximumMovementRatio));if(e.enableIndoorColliDetection&&_>0&&Math.abs(d-c)<.1||_>0&&Math.abs(d-c)<1||_<0&&Math.abs(d-u)<1)return}if(!(n>u&&l<0)){o$1k.equals(t,e._zoomMouseStart)||(e._zoomMouseStart=o$1k.clone(t,e._zoomMouseStart)),e.zoomActive=!0,s.position;var m=n*h;if(!e$28(o))return void s.zoomIn(m);var $=new t$X;t$X.subtract(o,s.position,$);var g=new t$X;g=t$X.clone(s.right,g);var v=t$X.dot($,g),y=new t$X;y=t$X.multiplyByScalar(g,v,y);var x=new t$X;x=t$X.subtract($,y,x);var b=new t$X;b=t$X.normalize(x,b),new t$X,s.move(b,m);var w=new t$X;w=t$X.normalize(o,w);var C=t$X.magnitude(o),T=wi$1;T.x=T.y=T.z=C;var S=t$V.fromCartesian3(T,yi$1),E=s.pickEllipsoid(t,S,La);if(e$28(E)&&!isNaN(E.x)&&!isNaN(E.y)&&!isNaN(E.z)){E=t$X.normalize(E,E);var A=t$X.angleBetween(w,E);if(!(e$27.equalsEpsilon(A,0,e$27.EPSILON10)||A>e$27.PI_OVER_TWO)){var P=new t$X;P=t$X.cross(w,E,P),s.rotate(P,A),e.enableIndoorColliDetection&&$$4(e,1)}}}}}var ye$1=new f$18,Ce$1=new f$18,Te$2=new t$X;function Pe$2(e,t,i){var r=e._scene.camera,n=r.getPickRay(i.startPosition,ye$1).origin,o=r.getPickRay(i.endPosition,Ce$1).origin;n=t$X.fromElements(n.y,n.z,n.x,n),o=t$X.fromElements(o.y,o.z,o.x,o);var a=t$X.subtract(n,o,Te$2),s=t$X.magnitude(a);s>0&&(t$X.normalize(a,a),r.move(a,s))}function vi$1(e,t,i){e$28(i.distance)&&(i=i.distance);var r=e._scene.camera;Aa(e,t,i,e._zoomFactor,r.getMagnitude())}var Re$1=new o$1k,Ie$3=new o$1k;function di(e,t,i){if(e$28(i.angleAndHeight))Ee$1(e,t,i.angleAndHeight);else{var r=e._scene,n=r.camera,o=r.canvas,a=o.clientWidth,s=o.clientHeight,l=Re$1;l.x=2/a*i.startPosition.x-1,l.y=2/s*(s-i.startPosition.y)-1,l=o$1k.normalize(l,l);var u=Ie$3;u.x=2/a*i.endPosition.x-1,u.y=2/s*(s-i.endPosition.y)-1,u=o$1k.normalize(u,u);var c=e$27.acosClamped(l.x);l.y<0&&(c=e$27.TWO_PI-c);var h=e$27.acosClamped(u.x);u.y<0&&(h=e$27.TWO_PI-h);var d=h-c;n.twistRight(d)}}function Ee$1(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth,l=r*(s=Math.min(s,e.maximumMovementRatio))*Math.PI*4;o.twistRight(l)}function xe$2(e){var t=e._scene.mapMode2D===Jt$1.ROTATE;y$15.equals(y$15.IDENTITY,e._scene.camera.transform)?(N$4(e,e.enableTranslate,e.translateEventTypes,Pe$2,e.inertiaTranslate,"_lastInertiaTranslateMovement"),N$4(e,e.enableZoom,e.zoomEventTypes,vi$1,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&N$4(e,e.enableRotate,e.tiltEventTypes,di,e.inertiaSpin,"_lastInertiaTiltMovement")):(N$4(e,e.enableZoom,e.zoomEventTypes,vi$1,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&N$4(e,e.enableRotate,e.translateEventTypes,di,e.inertiaSpin,"_lastInertiaSpinMovement"))}var fi=new f$18,De$3=new t$X,wa=new t$X,_a=new o$1k;function ui(e,t){if(e._mode!==P$$.SCENE3D||e._multiViewportMode==te$6.NONE)return t;o$1k.clone(t,_a);for(var i=e._context,r=new f$10(t.x,i.drawingBufferHeight-t.y),n=new f$10,o=0;o<e._multiViewportInfo.length;o++){var a=e._multiViewportInfo[o];if(n.x=i.drawingBufferWidth*a.x,n.y=i.drawingBufferHeight*a.y,n.width=i.drawingBufferWidth*a.width,n.height=i.drawingBufferHeight*a.height,n.intersect(r)===pt$a.INTERSECTING){var s=(r.x-n.x)/n.width,l=(r.y-n.y)/n.height;return _a.x=s*i.drawingBufferWidth,_a.y=i.drawingBufferHeight-l*i.drawingBufferHeight,_a}}return _a}function ea(e,t,i){var r=e._scene,n=e._globe,o=r.camera;if(e$28(n)){var a;r.pickPositionSupported&&(a=r.pickPositionWorldCoordinates(t,De$3,!0));var s,l=o.getPickRay(ui(e._scene,t),fi),u=n.pick(l,r,wa);if((e$28(a)?t$X.distance(a,o.positionWC):Number.POSITIVE_INFINITY)<(e$28(u)?t$X.distance(u,o.positionWC):Number.POSITIVE_INFINITY))return t$X.clone(a,i);if(e$28(u))return t$X.clone(u,i);if(r._environmentState.isUnderGlobeVisible&&o._positionCartographic.height<1&&e$28(s=g$10.rayEllipsoid(l,r._underGlobe.ellipsoid))){var c=s.start>0?s.start:s.stop;return c=Math.min(c,100),f$18.getPoint(l,c,i)}}}var _i$1=new f$18,Me$5=new f$18,hi$1=new t$X,ke=new t$X,Se$1=new t$X,ze$1=new t$X,be$1=new o$1i(t$X.UNIT_X,0),Ne$1=new o$1k,Oe$1=new o$1k;function We$1(e,t,i){if(t$X.equals(t,e._translateMousePosition)||(e._looking=!1),t$X.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking||e.enableWalk)U$7(e,t,i);else if(!e._strafing||e._isAroundScreenCenter){var r=e._scene,n=r.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(r.camera)),v$n.clone(r.camera,e._cloneCamera),n=e._cloneCamera);var o,a=o$1k.clone(i.startPosition,Ne$1),s=o$1k.clone(i.endPosition,Oe$1),l=n.getPickRay(a,_i$1),u=t$X.clone(t$X.ZERO,ze$1),c=t$X.UNIT_X;if(n.position.z<e._minimumPickingTerrainHeight&&(e$28(o=ea(e,a,hi$1))?(u.x=o.x,(!e$28(r.pickPositionWorldCoordinates(t))||o.x<-1e4)&&(u.x=-20)):e$28(r.pickPositionWorldCoordinates(t))||(u.x=-20)),u.x>n.position.z&&e$28(o)&&!e._isAroundScreenCenter)return t$X.clone(o,e._strafeStartPosition),e._strafing=!0,Ca(e,t,i),void(e._strafeMousePosition=o$1k.clone(t,e._strafeMousePosition));var h=o$1i.fromPointNormal(u,c,be$1);l=n.getPickRay(a,_i$1);var d=g$10.rayPlane(l,h,hi$1),f=n.getPickRay(s,Me$5),p=g$10.rayPlane(f,h,ke);if(!e$28(d)||!e$28(p))return e._looking=!0,U$7(e,t,i),void o$1k.clone(t,e._translateMousePosition);var _=t$X.subtract(d,p,Se$1),m=_.x;_.x=_.y,_.y=_.z,_.z=m;var $=t$X.magnitude(_);$>e$27.EPSILON6&&(t$X.normalize(_,_),n.move(_,$),e.enableIndoorColliDetection&&$$4(e))}else Ca(e,t,i)}var gi$1=new o$1k,Ha=new f$18,ya=new t$X,Ve$3=new t$X,pi$1=new y$15,Ae$2=new y$15,He$1=new t$X,Ze=new o$1i(t$X.UNIT_X,0),Za=new t$X,Ba=new t$W,ci$1=new y$15,Be$4=new n$14,Fe$2=new p$1a,Ue$3=new t$X;function Le$1(e,t,i){if(e$28(i.angleAndHeight)&&(i=i.angleAndHeight),(!o$1k.equals(t,e._tiltCenterMousePosition)||e._isAroundScreenCenter)&&(e._tiltCVOffMap=!1,e._looking=!1),e._looking)U$7(e,t,i);else{var r=e._scene,n=r.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(r.camera)),v$n.clone(r.camera,e._cloneCamera),n=e._cloneCamera);var o=e._maxCoord,a=Math.abs(n.position.x)-o.x<0&&Math.abs(n.position.y)-o.y<0;e._tiltCVOffMap||!a||n.position.z>e._minimumPickingTerrainHeight||!e$28(r.pickPositionWorldCoordinates(t))?(e._tiltCVOffMap=!0,qe$2(e,t,i)):Ge$1(e,t,i),e.enableIndoorColliDetection&&$$4(e)}}function qe$2(e,t,i){var r=e._scene,n=r.camera,o=r.canvas,a=gi$1;a.x=o.clientWidth/2,a.y=o.clientHeight/2;var s,l=n.getPickRay(a,Ha),u=t$X.UNIT_X,c=l.origin,h=l.direction,d=t$X.dot(u,h);if(Math.abs(d)>e$27.EPSILON6&&(s=-t$X.dot(u,c)/d),!e$28(s)||s<=0)return e._looking=!0,U$7(e,t,i),void o$1k.clone(t,e._tiltCenterMousePosition);var f=t$X.multiplyByScalar(h,s,ya);t$X.add(c,f,f);var p=r.mapProjection,_=p.ellipsoid;t$X.fromElements(f.y,f.z,f.x,f);var m=p.unproject(f,Ba);_.cartographicToCartesian(m,f);var $=m$1b.eastNorthUpToFixedFrame(f,_,pi$1),g=e._globe,v=e._ellipsoid;e._globe=void 0,e._ellipsoid=t$V.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var y=y$15.clone(n.transform,ci$1);n._setTransform($),J$5(e,t,i,t$X.UNIT_Z),n._setTransform(y),e._globe=g,e._ellipsoid=v;var x=v.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Ge$1(e,t,i){var r=e._scene,n=r.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(r.camera)),n=e._cloneCamera);var o,a,s=t$X.UNIT_X;if(o$1k.equals(t,e._tiltCenterMousePosition)&&!e._isAroundScreenCenter)o=t$X.clone(e._tiltCenter,ya);else{if(n.position.z<e._minimumPickingTerrainHeight&&(o=ea(e,t,ya)),!e$28(o)){var l,u=(a=n.getPickRay(t,Ha)).origin,c=a.direction,h=t$X.dot(s,c);if(Math.abs(h)>e$27.EPSILON6&&(l=-t$X.dot(s,u)/h),!e$28(l)||l<=0)return e._looking=!0,U$7(e,t,i),void o$1k.clone(t,e._tiltCenterMousePosition);o=t$X.multiplyByScalar(c,l,ya),t$X.add(u,o,o)}if(o$1k.clone(t,e._tiltCenterMousePosition),e._isAroundScreenCenter){var d=new t$X;t$X.clone(o,d),e._tiltCenter=d}else t$X.clone(o,e._tiltCenter)}var f=r.canvas,p=gi$1;p.x=f.clientWidth/2,p.y=e._tiltCenterMousePosition.y,a=n.getPickRay(p,Ha);var _=t$X.clone(t$X.ZERO,He$1);_.x=o.x;var m=o$1i.fromPointNormal(_,s,Ze),$=g$10.rayPlane(a,m,Ve$3),g=n._projection,v=g.ellipsoid;t$X.fromElements(o.y,o.z,o.x,o);var y=g.unproject(o,Ba);v.cartographicToCartesian(y,o);var x,b=m$1b.eastNorthUpToFixedFrame(o,v,pi$1);e$28($)?(t$X.fromElements($.y,$.z,$.x,$),y=g.unproject($,Ba),v.cartographicToCartesian(y,$),x=m$1b.eastNorthUpToFixedFrame($,v,Ae$2)):x=b;var w=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=t$V.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var T=t$X.UNIT_Z,S=y$15.clone(n.transform,ci$1);n._setTransform(b);var E=t$X.cross(t$X.UNIT_Z,t$X.normalize(n.position,Za),Za),A=t$X.dot(n.right,E);if(J$5(e,t,i,T,!1,!0),n._setTransform(x),A<0){i.startPosition.y>i.endPosition.y&&(T=void 0);var P=n.constrainedAxis;n.constrainedAxis=void 0,J$5(e,t,i,T,!0,!1),n.constrainedAxis=P}else J$5(e,t,i,T,!0,!1);if(e$28(n.constrainedAxis)){var I=t$X.cross(n.direction,n.constrainedAxis,Ue$3);t$X.equalsEpsilon(I,t$X.ZERO,e$27.EPSILON6)||(t$X.dot(I,n.right)<0&&t$X.negate(I,I),t$X.cross(I,n.direction,n.up),t$X.cross(n.direction,n.up,n.right),t$X.normalize(n.up,n.up),t$X.normalize(n.right,n.right))}n._setTransform(S),e._globe=w,e._ellipsoid=C;var M=C.maximumRadius;e._rotateFactor=1/M,e._rotateRateRangeAdjustment=M;var O=t$X.clone(n.positionWC,Za);if(n._adjustHeightForTerrain(),!t$X.equals(n.positionWC,O)){n._setTransform(x),n.worldToCameraCoordinatesPoint(O,O);var D=t$X.magnitudeSquared(O);t$X.magnitudeSquared(n.position)>D&&(t$X.normalize(n.position,n.position),t$X.multiplyByScalar(n.position,Math.sqrt(D),n.position));var R=t$X.angleBetween(O,n.position),L=t$X.cross(O,n.position,O);t$X.normalize(L,L);var B=n$14.fromAxisAngle(L,R,Be$4),N=p$1a.fromQuaternion(B,Fe$2);p$1a.multiplyByVector(N,n.direction,n.direction),p$1a.multiplyByVector(N,n.up,n.up),t$X.cross(n.direction,n.up,n.right),t$X.cross(n.right,n.direction,n.up),n._setTransform(S)}}var Ye=new o$1k,Qe$1=new f$18,Fa=new t$X;function Xe$1(e,t,i){e$28(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera,o=r.canvas,a=Ye;a.x=o.clientWidth/2,a.y=o.clientHeight/2;var s,l,u=n.getPickRay(a,Qe$1);if(n.position.z<e._minimumPickingTerrainHeight&&(s=ea(e,t,Fa)),e$28(s))if(e$28(r.pickPositionWorldCoordinates(t,Fa,!0)))l=t$X.distance(u.origin,s);else{var c=n._projection.unproject(n.position),h=t$W.toCartesian(c);l=t$X.distance(h,s)}else{var d=t$X.UNIT_X,f=u.origin,p=u.direction;l=-t$X.dot(d,f)/t$X.dot(d,p)}Pi$1(e,i);var _=t$X.normalize(n.position,Ti$1);Aa(e,t,i,e._zoomFactor,l,t$X.dot(_,n.direction))}function Ke$1(e){var t=e._scene.camera;if(y$15.equals(y$15.IDENTITY,t.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),N$4(e,e.enableTilt,e.tiltEventTypes,Le$1,e.inertiaSpin,"_lastInertiaTiltMovement"),N$4(e,e.enableTranslate,e.translateEventTypes,We$1,e.inertiaTranslate,"_lastInertiaTranslateMovement"),N$4(e,e.enableZoom,e.zoomEventTypes,Xe$1,e.inertiaZoom,"_lastInertiaZoomMovement"),N$4(e,e.enableLook,e.lookEventTypes,U$7),!(e._aggregator.anyButtonDown||e$28(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||e$28(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var r=t.createCorrectPositionTween(e.bounceAnimationTime);e$28(r)&&(e._tween=i.add(r))}i.update()}else N$4(e,e.enableRotate,e.rotateEventTypes,J$5,e.inertiaSpin,"_lastInertiaSpinMovement"),N$4(e,e.enableZoom,e.zoomEventTypes,Ri$1,e.inertiaZoom,"_lastInertiaZoomMovement")}new f$18;var Je=new o$1i(t$X.UNIT_X,0);new t$X,new t$X;var Ua=new t$X;function Ca(e,t,i){var r=e._scene.camera,n=e._strafeStartPosition,o=e.operPlane;if(e$28(n)&&e$28(o)){t=i.startPosition;var a=o$1k.clone(i.endPosition,new o$1k);if(e.flipY){var s=a.y-t.y;a.y=t.y-s}var l=r.getPickRay(t,new f$18),u=r.getPickRay(a,new f$18),c=g$10.rayPlane(l,o,new t$X),h=g$10.rayPlane(u,o,new t$X);if(e$28(c)&&e$28(h)){var d=t$X.normalize(c,new t$X),f=t$X.normalize(h,new t$X),p=t$X.angleBetween(d,f);if(0!=p){var _=t$X.cross(d,f,new t$X);r.rotate(_,p),r._adjustHeightForTerrain()}}}}var li=new t$X,ma=new t$W,wi$1=new t$X,yi$1=new t$V,$e=new t$X;function je$1(e,t,i){var r=e._scene,n=r.camera;if(y$15.equals(n.transform,y$15.IDENTITY)){var o,a,s,l=e._ellipsoid.geodeticSurfaceNormal(n.position,$e),u=e._ellipsoid.cartesianToCartographic(n.positionWC,ma).height,c=e._globe;if(o$1k.equals(t,e._rotateMousePosition))e._looking?U$7(e,t,i,l):e._rotating?J$5(e,t,i):e._strafing?Ca(e,t,i,e.operPlane):qa(e,t,i,e.operEllipsoid);else{if(e._looking=!1,e._rotating=!1,e._strafing=!1,e.enableWalk)return e._limitObject=void 0,e._looking=!0,void U$7(e,t,i,l);var h;if(e$28(c)&&u<e._minimumPickingTerrainHeight){if(!e$28(h=ea(e,t,Ua))){var d=new f$18(n.position,n.direction),f=c.pick(d,r,wa);if(e$28(f)){var p=m$W.wgs84ToWindowCoordinates(r,f,new t$X);if(!e$28(h=ea(e,new o$1k(t.x,p.y+100),Ua)))return}else if(!e$28(h=n.pickEllipsoid(t,c.ellipsoid,Ua)))return}if(o=t$X.magnitude(h),t$X.magnitude(n.position)<o){t$X.clone(h,e._strafeStartPosition);var _=new t$X;e.flipY=!0,_=t$X.add(n.direction,n.up,_),t$X.normalize(_,_);var m=o$1i.fromPointNormal(h,_,Je);e.operPlane=m,e._strafing=!0,Ca(e,t,i)}else(a=wi$1).x=a.y=a.z=o,s=t$V.fromCartesian3(a,yi$1),e.operEllipsoid=s,!r.undergroundMode&&r.globe.show&&(e._limitObject=et$3(e,s)),qa(e,t,i,s),t$X.clone(h,e._rotateStartPosition)}else e$28(n.pickEllipsoid(i.startPosition,e._ellipsoid,li))?(e._limitObject=void 0,qa(e,t,i,e._ellipsoid),t$X.clone(li,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._limitObject=void 0,e._rotating=!0,J$5(e,t,i)):(e._limitObject=void 0,e._looking=!0,U$7(e,t,i,l));o$1k.clone(t,e._rotateMousePosition)}}else J$5(e,t,i)}function J$5(e,t,i,r,n,o){n=u$Y(n,!1),o=u$Y(o,!1);var a=e._scene,s=a.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(a.camera)),s=e._cloneCamera);var l=a.canvas,u=s.constrainedAxis;e$28(r)&&(s.constrainedAxis=r);var c=t$X.magnitude(s.position),h=e._rotateFactor*(c-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);var d=(i.startPosition.x-i.endPosition.x)/l.clientWidth,f=(i.startPosition.y-i.endPosition.y)/l.clientHeight;d=Math.min(d,e.maximumMovementRatio),f=Math.min(f,e.maximumMovementRatio);var p=Math.abs(d)<Math.abs(f),_=h*d*Math.PI*2,m=h*f*Math.PI;if("ontouchstart"in window&&(m*=2),e.deltaTheta=-m,e.thetaWindowRatio=f,e.phiWindowRatio=d,!n&&!p&&s.rotateRight(_),!o&&p){var $=Math.abs(s.pitch-m),g=s.positionCartographic.height,v=e.minimumZoomDistance+1;if(!($>-e$27.PI_OVER_TWO&&$<e$27.PI_OVER_TWO)||g<v&&m<0)return void(s.constrainedAxis=u);s.rotate(s.right,m)}s.constrainedAxis=u}var La=e$25.clone(e$25.UNIT_W),Ci$1=e$25.clone(e$25.UNIT_W);new t$X,new t$X,new t$X,new t$X;var at$4=new o$1k,it$1=new o$1k;function et$3(e,t){var i=e._scene,r=i.camera,n=i.globe,o=.5*Math.PI,a=new f$18(r.position,r.direction),s=n.pick(a,i,wa);if(e$28(s)){var l=t$X.subtract(r.position,s,new t$X);o=t$X.angleBetween(s,l)}var u=e$27.toDegrees(o);o=e$27.toRadians(82-u);var c=n$14.fromAxisAngle(r.right,o,Di$1),h=p$1a.fromQuaternion(c,Ta),d=new t$X;p$1a.multiplyByVector(h,r.direction,d),t$X.normalize(d,d);var f=new t$X;n$14.multiplyByVec(c,r.direction,f),t$X.normalize(f,f);var p=new f$18(r.position,d),_=g$10.rayEllipsoid(p,t);if(e$28(_)){var m=_.start>0?_.start:_.stop,$=f$18.getPoint(p,m,new t$X),g=new o$1k;if(e$28($)){m$W.wgs84ToWindowCoordinates(i,$,g);var v=new o$1k(g.x,g.y-2),y=r.getPickRay(v,fi),x=g$10.rayEllipsoid(y,t);if(e$28(x)){var b=x.start>0?x.start:x.stop,w=f$18.getPoint(y,b,new t$X);if(e$28(w))return{angle:.5*t$X.angleBetween(w,$),division:g.y}}}}}function tt$3(e,t,i,r,n,o,a){var s=e._scene,l=s.camera,u=e._limitObject.division,c=e._limitObject.angle;if(t.y<u){var h=c,d=(r.y-i.y)*h*.5,f=(r.x-i.x)*h*.2,p=n$14.fromAxisAngle(l.right,d,new n$14);n$14.normalize(p,p);var _=p$1a.fromQuaternion(p,Ta);p$1a.multiplyByVector(_,n,o);var m=n$14.fromAxisAngle(l.direction,f,new n$14);n$14.normalize(m,m);var $=p$1a.fromQuaternion(m,Ta);return p$1a.multiplyByVector($,o,o),!0}if(i.y>u&&r.y>u)return!1;if(i.y<u&&r.y>u)return!!e$28(e._lastPosition)&&(n=l.pickEllipsoid(e._lastPosition,a),!0);var g=new t$X,v=0;if(i.y<u&&r.y<u){v=(r.y-i.y)*c;var y=e$28(e._lastPosition)?e._lastPosition:i;l.pickEllipsoid(y,a,n),g=t$X.clone(n)}else if(i.y>u&&r.y<u){var x=new o$1k;x.y=u,x.x=(x.y-i.y)/(r.y-i.y)*(r.x-i.x)+i.x,g=l.pickEllipsoid(x,a),v=(r.y-x.y)*c}var b=new t$X,w=n$14.fromAxisAngle(l.right,v,Di$1),C=p$1a.fromQuaternion(w,Ta);p$1a.multiplyByVector(C,g,b);var T=new o$1k;m$W.wgs84ToWindowCoordinates(s,b,T);var S=new o$1k(r.x,T.y),E=l.pickEllipsoid(S,a);return t$X.clone(E,o),e._lastPosition=o$1k.clone(S),!0}function qa(e,t,i,r){var n=e._scene,o=n.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(n.camera)),v$n.clone(n.camera,e._cloneCamera),o=e._cloneCamera);var a=o$1k.clone(i.startPosition,at$4),s=o$1k.clone(i.endPosition,it$1),l=o.pickEllipsoid(a,r,La),u=o.pickEllipsoid(s,r,Ci$1);if(!e$28(l)||!e$28(u)||isNaN(l.x)||isNaN(u.x)){var c=new f$18(o.position,o.direction),h=n.globe.pick(c,n,wa);if(e$28(h)){var d=m$W.wgs84ToWindowCoordinates(n,h,new t$X);if(!e$28(d))return;var f=s.y-a.y,p=new o$1k(a.x,d.y),_=new o$1k(s.x,d.y+f);l=o.pickEllipsoid(p,r,La),u=o.pickEllipsoid(_,r,Ci$1)}}if(e$28(l)&&e$28(u)&&!isNaN(l.x)&&!isNaN(u.x)&&(e$28(e._limitObject)&&tt$3(e,t,a,s,l,u,r),e$28(l)&&e$28(u)&&!isNaN(l.x)&&!isNaN(u.x))){l=o.worldToCameraCoordinates(l,l),u=o.worldToCameraCoordinates(u,u);var m=t$X.angleBetween(l,u),$=new t$X;t$X.cross(l,u,$),t$X.magnitudeSquared($)<1e-20&&($=t$X.cross(l,t$X.UNIT_X,$),t$X.magnitudeSquared($)<1e-20&&($=t$X.cross(l,t$X.UNIT_Y,$))),t$X.normalize($,$),o.rotate($,m),e._enableFusion&&(e.panOffset.x+=i.endPosition.x-i.startPosition.x,e.panOffset.y+=i.endPosition.y-i.startPosition.y,e.panDirty=!0),e.enableIndoorColliDetection&&$$4(e,1),o._adjustHeightForTerrain()}}var Ti$1=new t$X,nt$3=new t$W;function Pi$1(e,t){var i=e._scene,r=i.globe;if(!(e.autoTiltHeight<1)&&e$28(r)){var n=i.camera,o=n.positionCartographic;if(o.height-r.getHeight(o)<e.autoTiltHeight){var a=t.endPosition.y-t.startPosition.y>0?1:-1,s=n.pitch+e$27.toRadians(3)*a;s=Math.min(s,-.01),s=Math.max(s,.5*-Math.PI),n.setView({orientation:{heading:n.heading,pitch:s}})}}}function Ri$1(e,t,i){var r=e._ellipsoid,n=e._scene,o=n.camera;if(e$28(i.distance)&&(i=i.distance),e._enableFusion){var a=i.endPosition.y-i.startPosition.y;e.zoomDirty=!0;var s=e$27.toRadians(1);a>=0?(o.frustum.fov-=s,o.frustum.fov<e.minFov&&(o.frustum.fov=e.minFov,e.zoomDirty=!1)):(o.frustum.fov+=s,o.frustum.fov>e.maxFov&&(o.frustum.fov=e.maxFov,e.zoomDirty=!1))}else{if(e.isAroundScreenCenter){var l=e._scene.getViewport({x:10,y:10});t={x:l.width/2,y:l.height/2}}var u,c=ea(e,t,Fa),h=r.cartesianToCartographic(o.position,nt$3).height;if(u=e$28(c)?t$X.distance(o.position,c):h,"ontouchstart"in window){var d=t$X.normalize(o.position,Ti$1);Aa(e,t,i,e._zoomFactor,u,t$X.dot(d,o.direction))}else we(e,ui(n,t),i,e._zoomFactor,u,c);Pi$1(e,i),o._adjustHeightForTerrain()}}var rt$4=new o$1k,Ii$1=new f$18,ha=new t$X;new t$X;var Ei$1=new y$15;new y$15;var xi$1=new y$15,Di$1=new n$14,Ta=new p$1a,Mi$1=new t$W,ki$1=new t$X;function st$1(e,t,i,r){var n=e._scene.camera;if(y$15.equals(n.transform,y$15.IDENTITY)){if(e$28(i.angleAndHeight)&&(i=i.angleAndHeight),o$1k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e.enableWalk||e._looking){var o=e._ellipsoid.geodeticSurfaceNormal(n.position,ki$1);return void U$7(e,t,i,o)}var a=e._ellipsoid.cartesianToCartographic(n.position,Mi$1);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,mt(e,t,i,r)):vt(e,t,i,r)}}var ot$3=new t$W;function mt(e,t,i,r){var n=e._ellipsoid,o=e._scene,a=o.camera;e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(o.camera)),v$n.clone(o.camera,e._cloneCamera),a=e._cloneCamera);var s=.25*e.minimumZoomDistance,l=n.cartesianToCartographic(a.positionWC,ot$3).height;if(!(l-s-1<e$27.EPSILON3&&i.endPosition.y-i.startPosition.y<0)){var u=o.canvas,c=rt$4;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,d=a.getPickRay(c,Ii$1),f=g$10.rayEllipsoid(d,n);if(e$28(f))h=f$18.getPoint(d,f.start,ha);else{if(!(l>e._minimumTrackBallHeight)){e._looking=!0;var p=e._ellipsoid.geodeticSurfaceNormal(a.position,ki$1);return U$7(e,t,i,p),void o$1k.clone(t,e._tiltCenterMousePosition)}var _=g$10.grazingAltitudeLocation(d,n);if(!e$28(_))return;var m=n.cartesianToCartographic(_,Mi$1);m.height=0,h=n.cartographicToCartesian(m,ha)}if(t$X.clone(h,e._tiltCenter),!r){var $=m$1b.eastNorthUpToFixedFrame(h,n,Ei$1),g=e._globe,v=e._ellipsoid;e._globe=void 0,e._ellipsoid=t$V.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var y=y$15.clone(a.transform,xi$1);a._setTransform($),J$5(e,t,i,t$X.UNIT_Z),a._setTransform(y),e._globe=g,e._ellipsoid=v,e.enableIndoorColliDetection&&$$4(e,1);var x=v.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}}}var Si$1=new t$X;function $$4(e,t,i){var r=e._scene,n=r.camera,o=e._cloneCamera,a=n.position,s=o.position;if(!t$X.equals(s,a)){var l=t$X.subtract(s,a,Si$1);t$X.normalize(l,l);var u=r.collideDetection(l);if(e$28(u)){r.mode===P$$.COLUMBUS_VIEW&&(u=t$X.fromElements(u.y,u.z,u.x));var c=t$X.distance(a,u);t=u$Y(t,e.minimumDetectDistance);var h=t$X.distance(a,s);if(c<t||c<=h)return}}v$n.clone(o,r.camera)}function vt(e,t,i,r){var n,o,a,s=e._ellipsoid,l=e._scene,u=l.camera;if(e.enableIndoorColliDetection&&(e$28(e._cloneCamera)||(e._cloneCamera=v$n.clone(l.camera)),v$n.clone(l.camera,e._cloneCamera),u=e._cloneCamera),o$1k.equals(t,e._tiltCenterMousePosition)&&!e._isAroundScreenCenter)n=t$X.clone(e._tiltCenter,ha);else{if(!e$28(n=ea(e,t,ha))){if(o=u.getPickRay(t,Ii$1),!e$28(a=g$10.rayEllipsoid(o,s)))return;n=f$18.getPoint(o,a.start,ha)}o$1k.clone(t,e._tiltCenterMousePosition),e._tiltCenter=t$X.clone(n,e._tiltCenter)}if(!r){var c=m$1b.eastNorthUpToFixedFrame(n,s,Ei$1),h=e._globe,d=e._ellipsoid;e._globe=void 0,e._ellipsoid=t$V.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var f=t$X.UNIT_Z,p=y$15.clone(u.transform,xi$1);u._setTransform(c),J$5(e,t,i,f),u._setTransform(p),e._globe=h,e._ellipsoid=d;var _=d.maximumRadius;e._rotateFactor=1/_,e._rotateRateRangeAdjustment=_,u._suspendTerrainAdjustment=!1,u._adjustHeightForTerrain(),e.enableIndoorColliDetection&&$$4(e,1)}}var dt$2=new o$1k,ft$1=new o$1k,Ga=new f$18,Ya=new f$18,ut$3=new t$X,_t$1=new t$X;function U$7(e,t,i,r){var n=e._scene.camera,o=dt$2;o.x=i.startPosition.x,o.y=0;var a=ft$1;a.x=i.endPosition.x,a.y=0;var s,l,u=n.getPickRay(o,Ga),c=n.getPickRay(a,Ya),h=0;n.frustum instanceof a$X?(s=u.origin,l=c.origin,t$X.add(n.direction,s,s),t$X.add(n.direction,l,l),t$X.subtract(s,n.position,s),t$X.subtract(l,n.position,l),t$X.normalize(s,s),t$X.normalize(l,l)):(s=u.direction,l=c.direction);var d=t$X.dot(s,l);d<1&&(h=Math.acos(d)),h=i.startPosition.x>i.endPosition.x?-h:h;var f=e._horizontalRotationAxis;if(e$28(r)?n.look(r,-h):e$28(f)?n.look(f,-h):n.lookLeft(h),o.x=0,o.y=i.startPosition.y,a.x=0,a.y=i.endPosition.y,s=n.getPickRay(o,Ga).direction,l=n.getPickRay(a,Ya).direction,u=n.getPickRay(o,Ga),c=n.getPickRay(a,Ya),h=0,n.frustum instanceof a$X?(s=u.origin,l=c.origin,t$X.add(n.direction,s,s),t$X.add(n.direction,l,l),t$X.subtract(s,n.position,s),t$X.subtract(l,n.position,l),t$X.normalize(s,s),t$X.normalize(l,l)):(s=u.direction,l=c.direction),(d=t$X.dot(s,l))<1&&(h=Math.acos(d)),h=i.startPosition.y>i.endPosition.y?-h:h,e$28(r=u$Y(r,f))){var p=n.direction,_=t$X.negate(r,ut$3),m=t$X.equalsEpsilon(p,r,e$27.EPSILON2),$=t$X.equalsEpsilon(p,_,e$27.EPSILON2);if(m||$)(m&&h<0||$&&h>0)&&n.look(n.right,-h);else{d=t$X.dot(p,r);var g=e$27.acosClamped(d);h>0&&h>g&&(h=g-e$27.EPSILON4),d=t$X.dot(p,_),g=e$27.acosClamped(d),h<0&&-h>g&&(h=-g+e$27.EPSILON4);var v=t$X.cross(r,p,_t$1);n.look(v,h)}}else n.lookUp(h)}var S$2=new t$X,zi=new t$X;function Pa(e,t){var i=new f$16(t);S$2=t$X.multiplyByScalar(e,.1,S$2),t$X.add(t,S$2,S$2);var r=i.projectPointOntoPlane(S$2),n=i.projectPointOntoEllipsoid(r),o=i.projectPointOntoPlane(t),a=i.projectPointOntoEllipsoid(o),s=t$X.subtract(n,a,zi);return t$X.normalize(s,s),s}function Ra(e,t){var i=o$1i.ORIGIN_XY_PLANE;S$2=t$X.multiplyByScalar(e,.1,S$2),t$X.add(t,S$2,S$2);var r=o$1i.projectPointOntoPlane(i,S$2),n=o$1i.projectPointOntoPlane(i,t),o=t$X.subtract(r,n,zi);return t$X.normalize(o,o),o}var Qa=new f$18,ma=new t$W,Q$4=new t$X;function ht$1(e,t){var i=t.positionCartographic;ma.longitude=i.longitude,ma.latitude=i.latitude,ma.height=i.height>0?0:i.height-10,t$W.toCartesian(ma,void 0,Q$4);var r=t$X.subtract(Q$4,t.position,Q$4);t$X.normalize(r,r),Qa.origin=t.position,Qa.direction=r;var n=e.pickFromRay(Qa);if(e$28(n)&&e$28(n.position)){var o=n.position;return t$W.fromCartesian(o,void 0,ma).height}}function gt$2(e,t,i){var r=t.positionCartographic,n=ht$1(e,t);if(!e$28(n)||Math.abs(r.height-n-i)<1)return t.position;r.height=n-Wa>2?i+1.8:n+i,Wa=r.height;var o=t$W.toCartesian(r);return e$28(o)?o:t.position}var Ia=new t$X,Ea=new t$X;function pt$1(e){var t=e._scene,i=t.camera,r=e._aggregator._flags,n=i.position,o=5*e.walkParameters.speed,a=e.walkParameters.height;r.moveForward&&xa(e,Pa(i.direction,n),o),r.moveBackward&&(Ia.x=-i.direction.x,Ia.y=-i.direction.y,Ia.z=-i.direction.z,xa(e,Pa(Ia,n),o)),r.moveLeft&&(Ea.x=-i.right.x,Ea.y=-i.right.y,Ea.z=-i.right.z,xa(e,Pa(Ea,n),.1*o)),r.moveRight&&xa(e,Pa(i.right,n),.1*o),i.position=gt$2(t,i,a)}function xa(e,t,i){var r=e._scene,n=r.camera.position;t$X.multiplyByScalar(t,i,S$2),t$X.add(n,S$2,S$2);var o=!0;if(!t$X.equals(S$2,n)){var a=t$X.subtract(S$2,n,Si$1);t$X.normalize(a,a);var s=r.collideDetection(a);if(e$28(s))t$X.distance(S$2,n)-t$X.distance(n,s)>-e.minimumDetectDistance*Math.abs(i)&&(o=!1)}(o||!e.enableIndoorColliDetection)&&t$X.clone(S$2,n)}function ct$2(e){var t,i=e._scene.camera,r=e._aggregator._flags,n=i.position,o=5*e.walkParameters.speed;r.moveForward&&(t=Ra(i.direction,n),i.move(t,o)),r.moveBackward&&(t=Ra(i.direction,n),i.move(t,-o)),r.moveLeft&&(t=Ra(i.right,n),i.move(t,-o)),r.moveRight&&(t=Ra(i.right,n),i.move(t,o))}function lt$2(e){N$4(e,e.enableRotate,e.rotateEventTypes,je$1,e.inertiaSpin,"_lastInertiaSpinMovement"),N$4(e,e.enableZoom,e.zoomEventTypes,Ri$1,e.inertiaZoom,"_lastInertiaZoomMovement"),N$4(e,e.enableTilt,e.tiltEventTypes,st$1,e.inertiaSpin,"_lastInertiaTiltMovement"),N$4(e,e.enableLook,e.lookEventTypes,U$7)}ua.prototype.update=function(){y$15.equals(this._scene.camera.transform,y$15.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=e$28(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=t$V.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var t=this._scene.mode;t===P$$.SCENE2D?xe$2(this):t===P$$.COLUMBUS_VIEW?(this._horizontalRotationAxis=t$X.UNIT_Z,Ke$1(this),this.enableWalk&&ct$2(this)):t===P$$.SCENE3D&&(this._horizontalRotationAxis=void 0,lt$2(this),this.enableWalk&&pt$1(this)),this._aggregator.reset()},ua.prototype.isDestroyed=function(){return!1},ua.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),i$Z(this)};var O$7="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",N$3="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 u$b(){this._sceneFramebuffer=new n$b,this._stMatrix3=p$1a.clone(p$1a.IDENTITY),this._isMultiViewport=!1;var e=.125,t=new Array(6);t[0]=new p$8({fragmentShader:V$b,textureScale:e,forcePowerOfTwo:!0,sampleMode:e$6.LINEAR});var i=t[1]=new p$8({fragmentShader:N$3,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),r=this;this._delta=1,this._sigma=2,this._blurStep=new o$1k,t[2]=new p$8({fragmentShader:W$l,uniforms:{step:function(){return r._blurStep.x=r._blurStep.y=1/i.outputTexture.width,r._blurStep},delta:function(){return r._delta},sigma:function(){return r._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new p$8({fragmentShader:W$l,uniforms:{step:function(){return r._blurStep.x=r._blurStep.y=1/i.outputTexture.width,r._blurStep},delta:function(){return r._delta},sigma:function(){return r._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new p$8({fragmentShader:V$b,sampleMode:e$6.LINEAR}),this._uCenter=new o$1k,this._uRadius=void 0,t[5]=new p$8({fragmentShader:O$7,uniforms:{center:function(){return r._uCenter},radius:function(){return r._uRadius},colorTexture2:function(){return r._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new s$b({stages:t});for(var n=new l$b(this),o=t.length,a=0;a<o;++a)t[a]._textureCache=n;this._textureCache=n,this.length=t.length}u$b.prototype.get=function(e){return this._stages.get(e)},u$b.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 Y$2=new e$25,D$7=new o$1k,Q$3=new o$1k,I$3=new y$15;function U$6(e,t,i){var r=t.uniformState,n=r.sunPositionWC,o=r.view,a=r.viewProjection,s=r.projection,l=y$15.computeViewportTransformation(i,0,1,I$3),u=y$15.multiplyByPoint(o,n,Y$2),c=m$1b.pointToGLWindowCoordinates(a,l,n,D$7);u.x+=e$27.SOLAR_RADIUS;var h=m$1b.pointToGLWindowCoordinates(s,l,u,u),d=30*o$1k.magnitude(o$1k.subtract(h,c,h))*2,f=Q$3;f.x=d,f.y=d,e._uCenter=o$1k.clone(c,e._uCenter),e._uRadius=.15*Math.max(f.x,f.y);var p=t.drawingBufferWidth,_=t.drawingBufferHeight,m=e._stages,$=m.get(0),g=$.outputTexture.width,v=$.outputTexture.height,y=new f$10;y.width=g,y.height=v,l=y$15.computeViewportTransformation(y,0,1,I$3),c=m$1b.pointToGLWindowCoordinates(a,l,n,D$7),f.x*=g/p,f.y*=v/_;var x=$.scissorRectangle;x.x=Math.max(c.x-.5*f.x,0),x.y=Math.max(c.y-.5*f.y,0),x.width=Math.min(f.x,p),x.height=Math.min(f.y,_);for(var b=1;b<4;++b)f$10.clone(x,m.get(b).scissorRectangle)}u$b.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},u$b.prototype.update=function(e){var t=e.context,i=e.viewport,r=this._sceneFramebuffer;r.update(t,i);var n=r.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),U$6(this,t,i),n},u$b.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)};const k$6=new p$1a(1,0,-.5,0,1,-.5,0,0,1);u$b.prototype.copy=function(e,t,i){if(e$28(i)&&e$28(i.viewport)){this._isMultiViewport=!0;var r=i.viewport,n=e.drawingBufferWidth,o=e.drawingBufferHeight,a=[r.width/n,0,(r.x+.5*r.width)/n,0,r.height/o,(r.y+.5*r.height)/o,0,0,1];p$1a.fromRowMajorArray(a,this._stMatrix3),p$1a.multiply(this._stMatrix3,k$6,this._stMatrix3)}if(!e$28(this._copyColorCommand)){var s=this;const t="\n uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform mat3 stMatrix3;\n void main(){\n vec3 st = stMatrix3 * vec3(v_textureCoordinates, 1.0);\n gl_FragColor = texture2D(colorTexture, st.xy);\n }\n ";this._copyColorCommand=e.createViewportQuadCommand(t,{uniformMap:{colorTexture:function(){return s._stages.get(s._stages.length-1).outputTexture},stMatrix3:function(){return s._isMultiViewport?s._stMatrix3:p$1a.IDENTITY}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e,i),this._isMultiViewport=!1},u$b.prototype.isDestroyed=function(){return!1},u$b.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),i$Z(this)};var Be$3=new r$1a("MapQuest, SuperMap iServer Imagery"),J$4=[1.690163571602655e-9,3.3803271432053056e-9,6.760654286410611e-9,1.3521308572821242e-8,2.7042617145642484e-8,5.408523429128511e-8,1.0817046858256998e-7,2.1634093716513974e-7,4.3268187433028044e-7,8.653637486605571e-7,17307274973211203e-22,34614549946422405e-22,69229099892844565e-22,13845819978568952e-21,27691639957137904e-21,553832799142758e-19,.0001107665598285516,.0002215331196571032,.0004430662393142064,.0008861324786284128,.001772264957256826,.003544529914513652,.007089059829027304,.014178119658054609,.028356239316109217,.056712478632218434,.11342495726443687,.2684991452887374],he=[1.690163571602655e-9,3.38026990562e-9,6.76053981124e-9,1.352107962249e-8,2.704215924497e-8,5.408431848995e-8,1.0816863697989e-7,2.1633727395979e-7,4.3267454791958e-7,8.6534909583916e-7,173069819167831e-20,346139638335662e-20,692279276671324e-20,1384558553342649e-20,2769117106685297e-20,5538234213370595e-20,.0001107646842674119,.0002215293685348238,.0004430587370696476,.0008861174741392952,.0017722349482785903,.0035444698965571807,.007088939793114361],H$6=function(e){if(!e$28((e=u$Y(e,{})).url))throw new t$Z("options.url is required.");this._baseUrl=e.url,this._prjCoordSys=e.prjCoordSys;var t=(r=e.url).substring(0,r.indexOf("/datas"));this.tablename=r.substring(r.indexOf("datas/")+6,r.length);var i=this;new l$11({name:t+this.tablename}).then((function(e){e.checkObjectStoreExit(i.tablename)?i._indexedDBScheduler=e:e.createObjectStore(i.tablename).then((function(){i._indexedDBScheduler=e}))})),this._indexedDBSetting={isOpen:!1,clear:function(){i._indexedDBScheduler.clear(i.tablename)},cache:[]},this.isSci3D=!1,this.isTileMap=!1;var r=n$1c(e.url);if(this._packingRequest=e.packingRequest,this._url=r,this._resource=t$S.createIfNeeded(r),this._resolution=e$28(e.highResolution)?2:1,this._transparent=u$Y(e.transparent,!0),this._name=e.name||"",this._urlTemplate=void 0,this._errorEvent=new o$1o,this._fileExtension="png",this._tileWidth=256,this._tileHeight=256,this._tileFormat=e.tileFormat||"png",this._scales=J$4,this._rasterfunction=u$Y(e.rasterfunction,void 0),this._regions=e.regions,this._cache=u$Y(e._cache,!0),this._rectangleExtentValue=u$Y(e.rectangleExtentValue,0),this._isBlock=!1,this._blockCache={},this._blockCacheQueue=new r$$,this._blockCacheSize=100,this._blockScale=0,this._tileversion=u$Y(e.tileversion,""),this._minimumLevel=u$Y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=void 0,this._tilingScheme=e.tilingScheme,this._subdomains=e.subdomains,this._origin=u$Y(e.origin,null),e$28(e.tilingScheme)&&e$28(e.tilingScheme._scaleDenominators)){this._scales=[];for(var n=0;n<e.tilingScheme._scaleDenominators.length;n++)this._scales[n]=1/e.tilingScheme._scaleDenominators[n]}this._flipY=!1,this._tileDiscardPolicy=e.tileDiscardPolicy,this._fRatio=u$Y(e.ratio,e$27.DEGREES_PER_RADIAN/t$V.WGS84.maximumRadius),this._coordUnit="DEGREE",this._customRequestHeaders=e.customRequestHeaders;var o=u$Y(e.credit,Be$3);this._cacheKey=u$Y(e.cacheKey,""),this._cacheEnabled=u$Y(e.cacheEnabled,!0),"string"==typeof o&&(o=new r$1a(o)),this._credit=o,this._ready=!1,this._readyPromise=o$1q.defer();i=this;e$28(this._subdomains)&&(r=r.replace(/({.*?})/g,(function(e,t){if(!e$28(i._subdomains.length))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");return"{s}"===t?i._subdomains[0]:e}))),this._layerStatusParameters=u$Y(e.layerStatusParameters,void 0),this._layerStatusParametersID=void 0;var a,s=!0;if(this._layerStatusParameters&&(s=me$2(this)),r.indexOf("rest/maps")>-1)this.isTileMap=!0,this.layersID=e.layersID;else{if(!(r.indexOf("rest/realspace")>-1)){var l=r+"config";return e$28(a$Y.CREDENTIAL)&&(l=e$28(a$Y.CREDENTIAL._keymap[i._baseUrl])?a$Y.addTokenWithKey(i._baseUrl,l):a$Y.addToken(l)),void o$1q.all([u$P(l,i._customRequestHeaders),s]).then(c).otherwise((function(){var e=r.slice(0,-1)+".json";e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._baseUrl])?a$Y.addTokenWithKey(i._baseUrl,e):a$Y.addToken(e));var t=u$O(e,i.customRequestHeaders);o$1q.all([t,s]).then(h,d)}))}this.isSci3D=!0}function u(){if(i.isTileMap){var e=r.slice(0,-1)+".json";e$28(a$Y.CREDENTIAL)&&(e=e$28(a$Y.CREDENTIAL._keymap[i._baseUrl])?a$Y.addTokenWithKey(i._baseUrl,e):a$Y.addToken(e)),e$28(i._prjCoordSys)&&(e=e.includes("?")?e+"&prjCoordSys="+JSON.stringify(i._prjCoordSys):e+"?prjCoordSys="+JSON.stringify(i._prjCoordSys)),LicenseChecker.LICENSECHECKER.getLicense(e).then((function(e){LicenseChecker.LICENSECHECKER.check(e)}));var t=u$O(e,i.customRequestHeaders);o$1q.all([t,s]).then(h,d)}else{var n=r+"config";e$28(a$Y.CREDENTIAL)&&(n=e$28(a$Y.CREDENTIAL._keymap[i._baseUrl])?a$Y.addTokenWithKey(i._baseUrl,n):a$Y.addToken(n)),LicenseChecker.LICENSECHECKER.getLicense(n).then((function(e){LicenseChecker.LICENSECHECKER.check(e)})),o$1q.all([u$P(n,i._customRequestHeaders),s]).then(c,d)}}function c(t){i.isSci3D=!0;var r=function(e){var t=(e=f.parseFromString(e,"application/xml")).childNodes[0],r="http://www.supermap.com/SuperMapCache/sci3d",n=u$Y(Pe$1(t,"xmlns:sml"),r);A$9(t,"Version",n);var o=qe$1(F$6(t,"StoreType",n),"BlockScale");"number"==typeof o&&(i._isBlock=!0,i._blockScale=o);for(var a=He(F$6(t,"Levels",n),"Level",n),s=[],l=0,u=a.length;l<u;l++)s.push(parseInt(a[l].textContent,10));var c=F$6(t,"Bounds",n),h=A$9(c,"Left",n),d=A$9(c,"Right",n),p=A$9(c,"Top",n),_=A$9(c,"Bottom",n),m=pe$3(t,"FileExtentName",n),$=A$9(t,"CellWidth",n),g=A$9(t,"CellHeight",n),v=pe$3(t,"CacheName",n);return i._name||(i._name=v||""),{left:h,right:d,top:p,bottom:_,fileExtentName:m,levels:s,imageSizeWidth:$,imageSizeHeight:g}}(t[0]);i._fileExtension=u$Y(r.fileExtentName,"png"),i._tileWidth=u$Y(r.imageSizeWidth,256),i._tileHeight=u$Y(r.imageSizeHeight,256);var n=r.levels,o=n.length;i._minimumLevel=u$Y(n[0],0),i._maximumLevel=u$Y(i._maximumLevel,n[o-1]),e$28(i._tilingScheme)||(i._tilingScheme=new g$14({ellipsoid:e.ellipsoid}));var a,s,l,u,c=i._tilingScheme;e$28(i._rectangle)||e$28(r.left)&&e$28(r.right)&&e$28(r.top)&&e$28(r.bottom)&&(a=e$27.toRadians(r.left),l=e$27.toRadians(r.right),s=e$27.toRadians(r.bottom),u=e$27.toRadians(r.top),a>Math.PI&&(t$X.globalOffset.x=Math.floor(a/Math.PI)*Math.PI,a-=t$X.globalOffset.x,l-=t$X.globalOffset.x,t$X.globalOffset.x*=6378137),u>.5*Math.PI&&(t$X.globalOffset.y=Math.floor((u+.5*Math.PI)/Math.PI)*Math.PI,u-=t$X.globalOffset.y,s-=t$X.globalOffset.y,t$X.globalOffset.y*=6378137),i._rectangle=new h$10(a,s,l,u));i._rectangle.west<c.rectangle.west&&(i._rectangle.west=c.rectangle.west),i._rectangle.east>c.rectangle.east&&(i._rectangle.east=c.rectangle.east),i._rectangle.south<c.rectangle.south&&(i._rectangle.south=c.rectangle.south),i._rectangle.north>c.rectangle.north&&(i._rectangle.north=c.rectangle.north);var h=c.positionToTileXY(h$10.southwest(i._rectangle),i._minimumLevel),d=c.positionToTileXY(h$10.northeast(i._rectangle),i._minimumLevel);(Math.abs(d.x-h.x)+1)*(Math.abs(d.y-h.y)+1)>4&&(i._minimumLevel=0),i._tilingScheme=c,i._urlTemplate=i._url+"data/index/{y}/{x}.{fileExtension}?level={level}",i._ready=!0,i._readyPromise.resolve(!0)}function h(t){i.isTileMap=!0,i.layersID=e.layersID;var r=t[0];i._name||(i._name=r.name||"");var n=r.prjCoordSys.coordUnit;i._coordUnit=n,r.prjCoordSys.projection;var o,a,s=r.bounds,l=r.visibleScales;if(i.customScales=l&&l.length>0,"DEGREE"==n){var u=i._resolution;i._tilingScheme=new g$14({numberOfLevelZeroTilesX:2*u,numberOfLevelZeroTilesY:u});var c=i._rectangleExtentValue;if(s.left=e$27.clamp(s.left-c,-180,180),s.bottom=e$27.clamp(s.bottom-c,-90,90),s.right=e$27.clamp(s.right+c,-180,180),s.top=e$27.clamp(s.top+c,-90,90),e$27.equalsEpsilon(s.left,s.right,e$27.EPSILON7)&&(s.right+=e$27.EPSILON5),e$27.equalsEpsilon(s.top,s.bottom,e$27.EPSILON7)&&(s.top+=e$27.EPSILON5),i._rectangle=h$10.fromDegrees(s.left,s.bottom,s.right,s.top),i._urlTemplate=i._url+"tileImage."+i._tileFormat+"?transparent={transparent}&cacheEnabled="+i._cacheEnabled+'&_cache={_cache}&width=256&height=256&x={x}&y={y}&scale={scale}&redirect=false&overlapDisplayed=false&origin={"x":-180,"y":90}{tileversion}',(l=u$Y(e.scales,l)).length>0){var h=[];for(var d=i.customScales?0:u;d<l.length;d++)h.push(1/l[d]);i._tilingScheme._scaleDenominators=h,r.dpi&&(i._tilingScheme._customDPI=new Cesium.Cartesian2(r.dpi,r.dpi)),i._tilingScheme._rectangle=i._rectangle,null!=i._origin?(o=i._origin[0],a=i._origin[1]):(o=s.left-c,a=s.top+c),i._urlTemplate=i._url+"tileImage."+i._tileFormat+"?transparent={transparent}&cacheEnabled="+i._cacheEnabled+'&_cache={_cache}&width=256&height=256&x={x}&y={y}&scale={scale}&redirect=false&overlapDisplayed=false&origin={"x":'+o+',"y":'+a+"}{tileversion}",i._maximumLevel=u$Y(i._maximumLevel,h.length)}}else{c=i._rectangleExtentValue;var f=new t$X(s.left-c,s.bottom-c,0);f.x>20037508.342789244&&(t$X.globalOffset.x=20037508.342789244*Math.floor(f.x/20037508.342789244),f.x=f.x-t$X.globalOffset.x),f.y>10018754.171394622&&(t$X.globalOffset.y=20037508.342789244*Math.floor((f.y+10018754.171394622)/20037508.342789244),f.y=f.y-t$X.globalOffset.y);var p=new t$X(s.right+c,s.top+c,0);if(p.x=Math.min(20037508.342789244,p.x-t$X.globalOffset.x),p.y=Math.min(20037508.342789244,p.y-t$X.globalOffset.y),e$28(i._tilingScheme)){h=[];if(i._tilingScheme._scaleDenominators){h=i._tilingScheme._scaleDenominators;for(var _=[],m=0;m<i._tilingScheme._scaleDenominators.length;m++)_.push(1/i._tilingScheme._scaleDenominators[m]);l=_}else for(d=0;d<l.length;d++)h.push(1/l[d]);if(i._tilingScheme._scaleDenominators=h,l.length>0){i._tilingScheme._rectangleNortheastInMeters=p,i._tilingScheme._rectangleSouthwestInMeters=f,!e$28(i._tilingScheme._customDPI)&&r.dpi&&(i._tilingScheme._customDPI=new Cartesian2(r.dpi,r.dpi));var $=l[0];u=.0254/(r.dpi*$);i._tilingScheme._numberOfLevelZeroTilesX=Math.ceil((p.x-f.x)/u/r.viewer.width),i._tilingScheme._numberOfLevelZeroTilesY=Math.ceil((p.y-f.y)/u/r.viewer.height)}var g=i._tilingScheme._projection.unproject(f),v=i._tilingScheme._projection.unproject(p);i._tilingScheme._rectangle=new h$10(g.longitude,g.latitude,v.longitude,v.latitude)}else{var y,x,b=e$28(r.prjCoordSys)&&3857==r.prjCoordSys.epsgCode,w=b?new t$M:new n$1b;h=[];if(!b){for(d=0;d<l.length;d++)h.push(1/l[d]);if(l.length>0){r.viewBounds.rightTop,r.viewBounds.leftBottom;$=l[0],u=.0254/(r.dpi*$);y=Math.ceil((p.x-f.x)/u/r.viewer.width),x=Math.ceil((p.y-f.y)/u/r.viewer.height)}}!b&&l.length>0?i._tilingScheme=new c$10({numberOfLevelZeroTilesX:y,numberOfLevelZeroTilesY:x,projection:w,rectangleSouthwestInMeters:f,rectangleNortheastInMeters:p,customDPI:new Cesium.Cartesian2(r.dpi,r.dpi),scaleDenominators:h}):i._tilingScheme=new c$10({projection:w})}g=i._tilingScheme._projection.unproject(f),v=i._tilingScheme._projection.unproject(p);i._rectangle=new h$10(g.longitude,g.latitude,v.longitude,v.latitude),!b&&(l.length>0||h.length>0)?(null!=i._origin?(o=i._origin[0],a=i._origin[1]):(o=s.left-c,a=s.top+c),i._urlTemplate=i._url+"tileImage."+i._tileFormat+"?transparent={transparent}&cacheEnabled="+i._cacheEnabled+'&_cache={_cache}&width=256&height=256&x={x}&y={y}&scale={scale}&redirect=false&overlapDisplayed=false&origin={"x":'+o+',"y":'+a+"}{tileversion}"):(null!=i._origin?(o=i._origin[0],a=i._origin[1]):(o=-20037508.342789248,a=20037508.342789095),i._urlTemplate=i._url+"tileImage."+i._tileFormat+"?transparent={transparent}&cacheEnabled="+i._cacheEnabled+'&_cache={_cache}&width=256&height=256&x={x}&y={y}&scale={scale}&redirect=false&overlapDisplayed=false&origin={"x":'+o+',"y":'+a+"}{tileversion}")}if(e$28(l)&&Array.isArray(l)&&l.length>1)if(i._tilingScheme.projection instanceof n$1b)i._scales=l,i._maximumLevel=u$Y(i._maximumLevel,l.length-1-i._resolution);else{var C=l[l.length-1];i._maximumLevel=u$Y(i._maximumLevel,Me$4(i,C)),r.prjCoordSys.name.indexOf("Beijing")>-1&&r.prjCoordSys.name.indexOf("1954")>-1&&(i._scales=he)}else e$28(i._maximumLevel)||(i._maximumLevel=i._scales.length-1);"GCS_Beijing_1954"===r.prjCoordSys.name&&(!e$28(l)||0==l.length)&&(i._scales=he),i._urlTemplate=i._urlTemplate.replace("{transparent}",i._transparent),i._urlTemplate=i._urlTemplate.replace("{_cache}",i._cache),e$28(i._rasterfunction)&&(i._urlTemplate=i._urlTemplate+"&rasterfunction={rasterfunction}"),i.layersID&&(i._urlTemplate=i._urlTemplate+"&layersID="+i.layersID),e$28(i._regions)&&(i._urlTemplate=i._urlTemplate+"®ions="+i._regions),e$28(i._prjCoordSys)&&(i._urlTemplate=i._urlTemplate+"&prjCoordSys="+JSON.stringify(i._prjCoordSys)),i._rectangle||(i._rectangle=u$Y(e.rectangle,i._tilingScheme.rectangle)),i._ready=!0,i._readyPromise.resolve(!0)}function d(e){var t="An error occurred while accessing "+i._url+".";a=l$13.handleError(a,i,i._errorEvent,t,void 0,void 0,void 0,u),i._readyPromise.reject(new t$U(t))}u();var f=new DOMParser};function fe$1(e){var t=[];if(e$28(e.subLayers)&&e.subLayers.length>0)for(var i=0;i<e.subLayers.length;i++){var r=fe$1(e.subLayers[i]);t.push(r)}return{type:"UGC",name:e.layerName,visible:e.isVisible,displayFilter:e.displayFilter||null,subLayers:{layers:t}}}function me$2(e){var t=o$1q.defer(),i=e._url+"tempLayersSet.rjson";return e$28(a$Y.CREDENTIAL)&&(i=a$Y.addToken(i)),t$S.createIfNeeded(i).post(JSON.stringify(null)).then((function(i){for(var r=JSON.parse(i),n=[],o=0;o<e._layerStatusParameters.length;o++){var a=e._layerStatusParameters[o];n.push(fe$1(a))}var s=e._url.slice(0,-1),l=s.lastIndexOf("/"),u=e._baseUrl+r.newResourceLocation.substring(r.newResourceLocation.indexOf("/tempLayersSet"));e$28(a$Y.CREDENTIAL)&&(u=a$Y.addToken(u));var c=t$S.createIfNeeded(u),h=[{type:"UGC",visible:!0,subLayers:{layers:n},name:s.slice(l+1)}];c.put(JSON.stringify(h)).then((function(){e._layerStatusParametersID=r.newResourceID,t.resolve(e._layerStatusParametersID)})).otherwise((function(){t.reject("修改图层失败")}))})),t.promise}function Me$4(e,t){for(var i=e._scales.length;i--;)if(e._scales[i]<=t)return i}function te$2(e,t,i,r,n){var o;if(e.isTileMap){var a,s=""===e._tileversion?"":"&tileversion="+e._tileversion;if("DEGREE"===e._coordUnit)if(1===e.packingRequest)o=e._urlTemplate.replace("&x={x}&y={y}&scale={scale}","").replace("{tileversion}",s).replace("tileImage","tileImages").replace("&_cache=true","");else{let n=e.customScales?0:e.resolution;var l=Math.min(r+n,e._scales.length-1);a=e._scales[l]||J$4[r],o=e._urlTemplate.replace("{x}",t).replace("{y}",i).replace("{scale}",a.toString()).replace("{tileversion}",s)}else"METER"===e._coordUnit&&(1===e.packingRequest?o=e._urlTemplate.replace("&x={x}&y={y}&scale={scale}","").replace("{tileversion}",s).replace("tileImage","tileImages").replace("&_cache=true",""):(a=e._scales[r],o=e._urlTemplate.replace("{x}",t).replace("{y}",i).replace("{scale}",a.toString()).replace("{tileversion}",s)))}else o=e._urlTemplate.replace("{x}",t).replace("{y}",i).replace("{level}",r).replace("{fileExtension}",e._fileExtension);if(e$28(e._subdomains)){var u=e._subdomains,c=u[(t+i+r)%u.length];o=o.replace(je,(function(e,t){return"{s}"===t?c:e}))}return e$28(a$Y.CREDENTIAL)&&(o=a$Y.addToken(o)),o}function U$5(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}function de$2(e,t,i,r){var n=e._blockScale,o=Math.pow(2,n),a=Math.floor(t/o),s=t%o,l=Math.floor(i/o),u=i%o;return{x:a,y:l,url:te$2(e,a,l,r),col:s,row:u,level:r,blockSize:o}}Object.defineProperties(H$6.prototype,{url:{get:function(){return this._url}},name:{get:function(){return this._name},set:function(e){this._name=e}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}},tileWidth:{get:function(){if(!this._ready)throw new t$Z("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new t$Z("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},tileFormat:{get:function(){return this._tileFormat}},tileversion:{get:function(){return this._tileversion}},maximumLevel:{get:function(){if(!this._ready)throw new t$Z("maximumLevel must not be called before the imagery provider is ready.");return 1===this.resolution?this._maximumLevel:this._maximumLevel-1}},minimumLevel:{get:function(){if(!this._ready)throw new t$Z("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this._ready)throw new t$Z("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new t$Z("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},ratio:{get:function(){return this._fRatio},set:function(e){this._fRatio=e}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},resolution:{get:function(){return this._resolution}},flipY:{get:function(){return this._flipY},set:function(e){this._flipY=e}},packingRequest:{get:function(){return this._packingRequest}},isBlock:{get:function(){return this._isBlock}},blockCache:{get:function(){return this._blockCache}},blockCacheQueue:{get:function(){return this._blockCacheQueue}},blockCacheSize:{get:function(){return this._blockCacheSize}},subdomains:{get:function(){return this._subdomains},set:function(e){if(e$28(e)&&!e$28(e.length))throw new t$Z("Excepted SuperMapImageryProvider.subdomains to be type of Array.");this._subdomains=e}},layerStatusParameters:{get:function(){return this._layerStatusParameters}}}),H$6.prototype.setLayerStatusParameters=function(e){if(!e$28(e))throw new t$Z("Parameter is required.");if(!e$28(e.length))throw new t$Z("Expected parameter to be type of Array.");return this._layerStatusParameters=e,me$2(this)},H$6.prototype.getTileCredits=function(e,t,i){};var je=/({.*?})/g;H$6.prototype.requestImage=function(e,t,i,r){if(!this._ready)throw new t$Z("requestImage must not be called before the imagery provider is ready.");var n=te$2(this,e,t,i),o=e,a=t;if(this.isSci3D){var s=1<<i;n=te$2(this,o=e+t$X.globalOffset.x/(6378137*Math.PI)*s,a=t+t$X.globalOffset.y/(6378137*Math.PI)*s,i)}e$28(this._layerStatusParametersID)&&(n+="&layersID="+this._layerStatusParametersID),e$28(a$Y.CREDENTIAL)&&e$28(a$Y.CREDENTIAL._keymap[this._baseUrl])&&(n=a$Y.addTokenWithKey(this._baseUrl,n));var l=this,u={};e$28(this._rasterfunction)&&(u.rasterfunction=JSON.stringify(this._rasterfunction));var c=this._resource.getDerivedResource({url:n,request:r,templateValues:u});if(r.quadKey=U$5(e,t,i),this._packingRequest===ee$B.QuadKey&&this._isBlock){r.type=$$13.BLOCKPACK,r.throttle=!0;var h=de$2(this,e,t,i);if(c.url=h.url,r.blockInfo=h,r.quadKey=U$5(h.x,h.y,h.level),r.providerName=this.url,e$28(f=this._blockCache[r.quadKey]))return this.blockCacheQueue.touch(f),f.data}else if(this._packingRequest===ee$B.QuadKey){var d;if(r.type=$$13.PACK,this.isTileMap)d="DEGREE"===this._coordUnit?this._scales[i+(this.customScales?0:this.resolution)]||J$4[i]:J$4[i]||this._scales[i+this.resolution],r.quadKey=d+":"+e+":"+t;else r.quadKey=U$5(e,t,i);r.providerName=this.url,r.throttle=!0}else if(this._isBlock){r.type=$$13.BLOCK;var f;h=de$2(this,o,a,i);if(c.url=h.url,r.blockInfo=h,r.quadKey=U$5(h.x,h.y,h.level),r.providerName=this.url,e$28(f=this._blockCache[r.quadKey])&&e$28(f.data))return this.blockCacheQueue.touch(f),f.data;if(!0===this._indexedDBSetting.isOpen&&!0===r.cacheEnable){var p,_=o$1q.defer();return e$28(this._indexedDBScheduler)&&e$28(p=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey))?(o$1q(p,(function(e){e$28(e)?_.resolve(e):_.resolve("cacheError")}),(function(e){_.resolve("cacheError")})),_):m(l,c)}}if(!0===this._indexedDBSetting.isOpen&&!0===r.cacheEnable)return e$28(this._indexedDBScheduler)&&e$28(p=this._indexedDBScheduler.getElementFromDB(this.tablename,r.quadKey))?o$1q(p,(function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):m(l,c);function m(e,t){if(e._isBlock){var i=e._blockCache[r.quadKey];if(e$28(i))return i.promise;var n=ge$3(e,t);return e$28(n)?(i=new e$1B(e,r.quadKey),e._blockCache[r.quadKey]=i,i.promise=n,i.promise):void 0}return ge$3(e,t)}return m(l,c)};var Ke=/\.ktx$/i,Ae$1=/\.crn$/i,_e$1=/\.dxtz/i;function ge$3(e,t){o$1u.defined("url",t);var i=t$S.createIfNeeded(t);return e.isBlock||e.packingRequest===ee$B.QuadKey?(_e$1.test(i.url)&&(e.flipY=!0),i.fetchArrayBuffer()):Ke.test(i.url)?k$R(i):Ae$1.test(i.url)?a$R(i):_e$1.test(i.url)?(e.flipY=!0,B$E(i)):e$28(e.tileDiscardPolicy)?i.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):(e$28(e._customRequestHeaders)&&(i.headers=p$17(i.headers,e._customRequestHeaders)),e._cacheKey.length>0?i.fetchArrayBuffer():i.fetchBlob())}function qe$1(e,t){if(e$28(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function Pe$1(e,t){if(e$28(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function F$6(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}}function He(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function A$9(e,t,i){var r=F$6(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function pe$3(e,t,i){var r=F$6(e,t,i);if(e$28(r))return r.textContent.trim()}H$6.prototype.pickFeatures=function(){};var k$5={},U$4=function(){function e(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)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}();function m$a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var E$9=8192,g$a=[],I$2=function(){function e(t,i){m$a(this,e),i=i||{},void 0===t&&(t=E$9),"number"==typeof t&&(t=new ArrayBuffer(t));var r=t.byteLength,n=i.offset?i.offset>>>0:0;t.buffer&&(r=t.byteLength-n,t=t.byteLength!==t.buffer.byteLength?t.buffer.slice(t.byteOffset+n,t.byteOffset+t.byteLength):n?t.buffer.slice(n):t.buffer),this.buffer=t,this.length=r,this.byteLength=r,this.byteOffset=0,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer),this._increment=r||E$9,this._mark=0}return U$4(e,[{key:"available",value:function(e){return void 0===e&&(e=1),this.offset+e<=this.length}},{key:"isLittleEndian",value:function(){return this.littleEndian}},{key:"setLittleEndian",value:function(){this.littleEndian=!0}},{key:"isBigEndian",value:function(){return!this.littleEndian}},{key:"setBigEndian",value:function(){this.littleEndian=!1}},{key:"skip",value:function(e){void 0===e&&(e=1),this.offset+=e}},{key:"seek",value:function(e){this.offset=e}},{key:"mark",value:function(){this._mark=this.offset}},{key:"reset",value:function(){this.offset=this._mark}},{key:"rewind",value:function(){this.offset=0}},{key:"ensureAvailable",value:function(e){if(void 0===e&&(e=1),!this.available(e)){var t=this._increment+this._increment;this._increment=t;var i=this.length+t,r=new Uint8Array(i);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=i,this._data=new DataView(this.buffer)}}},{key:"readBoolean",value:function(){return 0!==this.readUint8()}},{key:"readInt8",value:function(){return this._data.getInt8(this.offset++)}},{key:"readUint8",value:function(){return this._data.getUint8(this.offset++)}},{key:"readByte",value:function(){return this.readUint8()}},{key:"readBytes",value:function(e){void 0===e&&(e=1);for(var t=new Uint8Array(e),i=0;i<e;i++)t[i]=this.readByte();return t}},{key:"readInt16",value:function(){var e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}},{key:"readUint16",value:function(){var e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}},{key:"readInt32",value:function(){var e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readUint32",value:function(){var e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readFloat32",value:function(){var e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readFloat64",value:function(){var e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}},{key:"readChar",value:function(){return String.fromCharCode(this.readInt8())}},{key:"readChars",value:function(e){void 0===e&&(e=1),g$a.length=e;for(var t=0;t<e;t++)g$a[t]=this.readChar();return g$a.join("")}},{key:"writeBoolean",value:function(e){this.writeUint8(e?255:0)}},{key:"writeInt8",value:function(e){this.ensureAvailable(1),this._data.setInt8(this.offset++,e)}},{key:"writeUint8",value:function(e){this.ensureAvailable(1),this._data.setUint8(this.offset++,e)}},{key:"writeByte",value:function(e){this.writeUint8(e)}},{key:"writeBytes",value:function(e){this.ensureAvailable(e.length);for(var t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t])}},{key:"writeInt16",value:function(e){this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2}},{key:"writeUint16",value:function(e){this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2}},{key:"writeInt32",value:function(e){this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4}},{key:"writeUint32",value:function(e){this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4}},{key:"writeFloat32",value:function(e){this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4}},{key:"writeFloat64",value:function(e){this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8}},{key:"writeChar",value:function(e){this.writeUint8(e.charCodeAt(0))}},{key:"writeChars",value:function(e){for(var t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t))}},{key:"toArray",value:function(){return new Uint8Array(this.buffer,0,this.offset)}}]),e}(),s$9={};function A$8(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)}function b$a(e){e.offset%4!=0&&e.skip(4-e.offset%4)}function T$8(e){var t=e.readUint32(),i=e.readChars(t);return b$a(e),i}s$9.notNetcdf=A$8,s$9.padding=b$a,s$9.readName=T$8;var a$8={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function N$2(e){switch(Number(e)){case a$8.BYTE:return"byte";case a$8.CHAR:return"char";case a$8.SHORT:return"short";case a$8.INT:return"int";case a$8.FLOAT:return"float";case a$8.DOUBLE:return"double";default:return"undefined"}}function v$8(e,t){if(1!==e){for(var i=new Array(e),r=0;r<e;r++)i[r]=t();return i}return t()}function F$5(e,t,i){switch(t){case a$8.BYTE:return e.readBytes(i);case a$8.CHAR:return L$8(e.readChars(i));case a$8.SHORT:return v$8(i,e.readInt16.bind(e));case a$8.INT:return v$8(i,e.readInt32.bind(e));case a$8.FLOAT:return v$8(i,e.readFloat32.bind(e));case a$8.DOUBLE:return v$8(i,e.readFloat64.bind(e));default:return void A$8(!0,"non valid type "+t)}}function L$8(e){return 0===e.charCodeAt(e.length-1)?e.substring(0,e.length-1):e}var d$d=0,D$6=10,O$6=11,p$6=12;function R$6(e){var t={recordDimension:{length:e.readUint32()}},i=S$1(e);t.recordDimension.id=i.recordId,t.recordDimension.name=i.recordName,t.dimensions=i.dimensions,t.globalAttributes=B$5(e);var r=H$5(e,i.recordId);return t.variables=r.variables,t.recordDimension.recordStep=r.recordStep,t}function S$1(e){var t,i,r=e.readUint32();if(r===d$d)return s$9.notNetcdf(e.readUint32()!==d$d,"wrong empty tag for list of dimensions"),[];s$9.notNetcdf(r!==D$6,"wrong tag for list of dimensions");for(var n=e.readUint32(),o=new Array(n),a=0;a<n;a++){var s=s$9.readName(e),l=e.readUint32();0===l&&(t=a,i=s),o[a]={name:s,size:l}}return{dimensions:o,recordId:t,recordName:i}}function B$5(e){var t=e.readUint32();if(t===d$d)return s$9.notNetcdf(e.readUint32()!==d$d,"wrong empty tag for list of attributes"),[];s$9.notNetcdf(t!==p$6,"wrong tag for list of attributes");for(var i=e.readUint32(),r=new Array(i),n=0;n<i;n++){var o=s$9.readName(e),a=e.readUint32();s$9.notNetcdf(a<1||a>6,"non valid type "+a);var s=e.readUint32(),l=F$5(e,a,s);s$9.padding(e),r[n]={name:o,type:N$2(a),value:l}}return r}function H$5(e,t){var i=e.readUint32(),r=0;if(i===d$d)return s$9.notNetcdf(e.readUint32()!==d$d,"wrong empty tag for list of variables"),[];s$9.notNetcdf(i!==O$6,"wrong tag for list of variables");for(var n=e.readUint32(),o=new Array(n),a=0;a<n;a++){for(var s=s$9.readName(e),l=e.readUint32(),u=new Array(l),c=0;c<l;c++)u[c]=e.readUint32();var h=B$5(e),d=e.readUint32();s$9.notNetcdf(d<1&&d>6,"non valid type "+d);var f=e.readUint32(),p=e.readUint32();u[0]===t&&(r+=f),o[a]={name:s,dimensions:u,attributes:h,type:N$2(d),size:f,offset:p,record:u[0]===t}}return{variables:o,recordStep:r}}!function(){function e(t){m$a(this,e);var i=new I$2(t);i.setBigEndian(),s$9.notNetcdf("CDF"!==i.readChars(3),"should start with CDF");var r=i.readByte();s$9.notNetcdf(2===r,"64-bit offset format not supported yet"),s$9.notNetcdf(1!==r,"unknown version"),this.header=R$6(i),this.header.version=r,this.buffer=i}U$4(e,[{key:"getDataVariable",value:function(e){var t;return t="string"==typeof e?this.header.variables.find((function(t){return t.name===e})):e,s$9.notNetcdf(void 0===t,"variable not found"),this.buffer.seek(t.offset),t.record?data.record(this.buffer,t,this.header.recordDimension):data.nonRecord(this.buffer,t)}},{key:"version",get:function(){return 1===this.header.version?"classic format":"64-bit offset format"}},{key:"recordDimension",get:function(){return this.header.recordDimension}},{key:"dimensions",get:function(){return this.header.dimensions}},{key:"globalAttributes",get:function(){return this.header.globalAttributes}},{key:"variables",get:function(){return this.header.variables}}]),k$5.NetCDFReader=e}();var e$4={VolumeRendering:0,Slice:1,ContourValue:2},gt$1=Object.freeze(e$4),Fe$1="attribute vec4 aPosition;\nattribute vec3 aTexCoord0;\nvarying vec4 vTexCoord;\nvarying vec4 vNearTexCoord;\n#ifdef HAS_LIGHT\nvarying vec4 vPositionMC;\n#endif\nuniform vec3 u_volumeBoxSize;\nuniform vec3 scale;\nuniform vec3 uOffset;\nvoid main()\n{\nvTexCoord = vec4(aTexCoord0.xyz, 1.0);\ngl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}\n",Re="varying vec4 vTexCoord;\nvarying vec4 vNearTexCoord;\nuniform sampler2D u_colorTable;\nuniform vec4 u_minMaxValueAndFiltration;\nuniform vec3 u_maxVisibleTextureCoord;\nuniform vec3 u_minVisibleTextureCoord;\nuniform sampler2D u_opacityTexture;\nuniform sampler2D u_colorTexture;\nvec4 getColorForValue(float tValue)\n{\nfloat texCoord = tValue;\ntexCoord = clamp(texCoord, 0.0, 1.0);\nvec4 tColor = texture2D(u_colorTexture, vec2(texCoord, 0.5));\ntColor.a = texture2D(u_opacityTexture, vec2(texCoord, 0.5)).r;\nreturn tColor;\n}\nvec4 getSampleValue(vec3 pos)\n{\nif(vTexCoord.x > u_maxVisibleTextureCoord.x || vTexCoord.x < u_minVisibleTextureCoord.x\n|| vTexCoord.y > u_maxVisibleTextureCoord.y || vTexCoord.y < u_minVisibleTextureCoord.y\n|| vTexCoord.z > u_maxVisibleTextureCoord.z || vTexCoord.z < u_minVisibleTextureCoord.z)\n{\ndiscard;\n}\nfloat noValue;\nfloat value = czm_getVolumeValue(pos, noValue);\nvec4 color = getColorForValue(value);\nreturn color;\n}\nvoid main()\n{\nvec3 texcood = vTexCoord.xyz;\nif(uFilterMode > 0.5)\n{\ntexcood = vNearTexCoord.xyz;\n}\ngl_FragColor = getSampleValue(texcood);\ngl_FragColor = czm_gammaCorrect(gl_FragColor);\n}\n",_0x17ba64=(_0x3bd351=!0,function(e,t){var i=_0x3bd351?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x3bd351=!1,i}),_0x27895b=_0x17ba64(void 0,(function(){return _0x27895b.toString().search("(((.+)+)+)+$").toString().constructor(_0x27895b).search("(((.+)+)+)+$")})),_0x3bd351;_0x27895b();var Me$3="attribute vec4 aPosition;\nattribute vec4 aTexCoord0;\nvarying vec3 positionEC;\nvarying vec3 vTexCoord;\nvoid main()\n{\n positionEC = (czm_modelView * aPosition).xyz;\n vTexCoord = aTexCoord0.xyz;\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}",_0x3f8460=(_0x394732=!0,function(e,t){var i=_0x394732?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x394732=!1,i}),_0x970152=_0x3f8460(void 0,(function(){return _0x970152.toString().search("(((.+)+)+)+$").toString().constructor(_0x970152).search("(((.+)+)+)+$")})),_0x394732;_0x970152();var Ne="uniform vec3 u_camTexCoord;\nuniform vec4 u_minMaxValueAndFiltration;\n// opacity and color textures\nuniform sampler2D u_opacityTexture;\nuniform sampler2D u_colorTexture;\nuniform float u_sampleDistance;\nuniform vec4 u_gradientOpacityInfo;\n#ifdef CLIP_PLANE\nuniform vec4 u_clip_planes[6];\nuniform int u_clip_planes_count;\n#endif\n#ifdef APPLY_LIGHTING\n uniform vec3 uDiffuse;\n uniform vec3 uSpecular;\n uniform vec3 uAmbient;\n uniform float uShiness;\n#endif\n\nvarying vec3 positionEC;\nvarying vec3 vTexCoord;\n\nfloat realValueToScalarValue(float value){\n float minValue = u_minMaxValueAndFiltration.z;\n float maxValue = u_minMaxValueAndFiltration.w;\n return (value - minValue) / (maxValue - minValue);\n}\nfloat scalarValueToReaValue(float value){\n float minValue = u_minMaxValueAndFiltration.x;\n float maxValue = u_minMaxValueAndFiltration.y;\n return minValue + value * (maxValue - minValue);\n}\nfloat getTextureValue(vec3 pos)\n{\n float noValue;\n#ifdef MultiResolution\n\tfloat value = czm_getVolumeValueMultiResolution(pos, noValue);\n#else\n\tfloat value = czm_getVolumeValue(pos, noValue);\n#endif\n value = scalarValueToReaValue(value);\n return value;\n}\n\n// Given a normal compute the gradient opacity factors\nfloat computeGradientOpacityFactor(vec4 normal, float goscale, float goshift, float gomin, float gomax)\n{\n#ifdef GRADIENT_OPACITY\n return clamp(normal.a*goscale + goshift, gomin, gomax);\n#else\n return 1.0;\n#endif\n}\n\n// compute the normal and gradient magnitude for a position\nvec4 computeNormal(vec3 pos, float scalar, vec3 tstep)\n{\n vec4 result;\n result.x = getTextureValue(pos + vec3(tstep.x, 0.0, 0.0)) - scalar;\n result.y = getTextureValue(pos + vec3(0.0, tstep.y, 0.0)) - scalar;\n result.z = getTextureValue(pos + vec3(0.0, 0.0, tstep.z)) - scalar;\n // divide by spacing\n vec3 vSpacing = vec3(1.0);\n result.xyz /= vSpacing;\n result.w = length(result.xyz);\n // rotate to View Coords\n //result.xyz = result.x * vPlaneNormal0 + result.y * vPlaneNormal2 + result.z * vPlaneNormal4;\n if (result.w > 0.0)\n {\n result.xyz /= result.w;\n }\n return result;\n}\n\n#ifdef APPLY_LIGHTING\nvoid applyLighting(inout vec4 tColor, vec3 normal)\n{\n vec3 diffuse = uDiffuse;\n vec3 specular = uSpecular;\n vec3 ambient = uAmbient;\n float shiness = uShiness;\n vec3 normalEC = normalize(czm_normal * normal);\n float ndot = max( dot( normalEC, czm_sunDirectionEC ), 0.0 );\n ndot = ndot * 0.5 + 0.5;\n diffuse = diffuse * ndot;\n specular = specular * czm_getSpecular(czm_sunDirectionEC, normalize(-positionEC), normalEC, shiness);\n tColor.rgb = tColor.rgb*(diffuse + ambient) + specular;\n}\n#endif\n\nvec4 getColorForValue(vec3 posIS, vec3 stepIS, float tValue)\n{\n vec4 goFactor = vec4(1.0,1.0,1.0,1.0);\n#if defined(GRADIENT_OPACITY) || defined(APPLY_LIGHTING)\n vec4 normal0 = computeNormal(posIS, tValue, stepIS);\n#endif\n#ifdef GRADIENT_OPACITY\n float goscale = u_gradientOpacityInfo.z;\n float goshift = u_gradientOpacityInfo.w;\n float gomin = u_gradientOpacityInfo.x;\n float gomax = u_gradientOpacityInfo.y;\n goFactor.x = computeGradientOpacityFactor(normal0, goscale, goshift, gomin, gomax);\n#endif\n float texCoord = realValueToScalarValue(tValue);\n\ttexCoord = clamp(texCoord, 0.0, 1.0);\n vec4 tColor = texture2D(u_colorTexture, vec2(texCoord, 0.5));\n tColor.a = goFactor.x * texture2D(u_opacityTexture, vec2(texCoord, 0.5)).r;\n#ifdef APPLY_LIGHTING\n applyLighting(tColor, normal0.xyz);\n#endif\n return tColor;\n}\n\nvec4 applyBlend(vec3 posIS, vec3 endIS, vec3 stepIS, float texSampleDist)\n{\n float raySteps = 1.0 / texSampleDist;\n float jitter = 0.1;\n float stepsTraveled = jitter;\n // local vars for the loop\n vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n float tValue;\n vec4 tColor = vec4(0.0);\n // Perform initial step at the volume boundary\n // compute the scalar\n tValue = getTextureValue(posIS);\n // now map through opacity and color\n tColor = getColorForValue(posIS, stepIS, tValue);\n // handle very thin volumes\n if (raySteps <= 1.0)\n {\n tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps);\n return tColor;\n }\n\n tColor.a = 1.0 - pow(1.0 - tColor.a, jitter);\n color = vec4(tColor.rgb * tColor.a, tColor.a);\n posIS += (jitter * stepIS);\n\n for (int i = 0; i < 5000 ; ++i)\n {\n if (stepsTraveled + 1.0 >= raySteps) { break; }\n // compute the scalar\n tValue = getTextureValue(posIS);\n // now map through opacity and color\n tColor = getColorForValue(posIS, stepIS, tValue);\n float mix = (1.0 - color.a);\n color = color + vec4(tColor.rgb*tColor.a, tColor.a)*mix;\n stepsTraveled++;\n posIS += stepIS;\n if(posIS.x > 1.0 || posIS.x < 0.0 || posIS.y > 1.0 || posIS.y < 0.0 || posIS.z > 1.0 || posIS.z < 0.0){\n break; \n }\n if (color.a > 0.99) \n { \n color.a = 1.0; break; \n }\n }\n\n // if (color.a < 0.99 && (raySteps - stepsTraveled) > 0.0)\n // {\n // posIS = endIS;\n\n // // compute the scalar\n // tValue = getTextureValue(posIS);\n\n // // now map through opacity and color\n // tColor = getColorForValue(posIS, stepIS, tValue);\n // tColor.a = 1.0 - pow(1.0 - tColor.a, raySteps - stepsTraveled);\n\n // float mix = (1.0 - color.a);\n // color = color + vec4(tColor.rgb * tColor.a, tColor.a)*mix;\n // }\n return vec4(color.rgb/color.a, color.a);\n}\n\nvec2 intersectBox(vec3 texel_zero, vec3 texel_dir_norm)\n{\n vec3 minV = vec3(0.0);\n vec3 maxV = vec3(1.0);\n float t1,t2;\n t1=(minV.x-texel_zero.x)/texel_dir_norm.x;\n t2=(maxV.x-texel_zero.x)/texel_dir_norm.x;\n float tminX=min(t1,t2);\n float tmaxX=max(t1,t2);\n t1=(minV.y-texel_zero.y)/texel_dir_norm.y;\n t2=(maxV.y-texel_zero.y)/texel_dir_norm.y;\n float tminY=min(t1,t2);\n float tmaxY=max(t1,t2);\n t1=(minV.z-texel_zero.z)/texel_dir_norm.z;\n t2=(maxV.z-texel_zero.z)/texel_dir_norm.z;\n float tminZ=min(t1,t2);\n float tmaxZ=max(t1,t2);\n float largest_tmin = max(max(tminX, tminY), max(tminX, tminZ));\n float smallest_tmax = min(min(tmaxX, tmaxY), min(tmaxX, tmaxZ));\n vec2 dists = vec2(largest_tmin,smallest_tmax);\n \n#ifdef CLIP_PLANE\n for(int i = 0; i < 6; i++){\n if(i == u_clip_planes_count){\n break;\n }\n float rayDirRatio = dot(texel_dir_norm, u_clip_planes[i].xyz);\n float equationResult = dot(texel_zero.xyz, u_clip_planes[i].xyz) + u_clip_planes[i].w;\n if (rayDirRatio == 0.0){\n if (equationResult < 0.0){\n dists.x = dists.y;\n }\n continue;\n }\n float result = -1.0 * equationResult / rayDirRatio;\n if (rayDirRatio < 0.0){\n dists.y = min(dists.y, result);\n }\n else {\n dists.x = max(dists.x, result);\n }\n }\n#endif\n return dists;\n}\nvoid main()\n{\n vec3 cameraDir = normalize(positionEC.xyz);\n vec3 localZero = u_camTexCoord;\n vec3 localOne = vTexCoord.xyz;\n vec3 texel_dir_norm = normalize(localOne.xyz - localZero.xyz);\n\n vec3 texel_zero = localZero.xyz;\n vec2 nearFar = intersectBox(texel_zero, texel_dir_norm);\n // é‡‡æ ·é—´éš”å�—相机与物体之间的è·�离控制\n float texSampleDist = u_sampleDistance;\n vec3 texel_step = texSampleDist * texel_dir_norm;\n float tstep = length(texel_step);\n float tnear = max(nearFar.x, 0.0) + tstep;\n float tfar = nearFar.y - tstep;\n vec3 coord;\n if(tnear > tfar){\n discard;\n }\n else{\n coord = texel_zero + texel_dir_norm * tnear;\n }\n gl_FragColor = applyBlend(coord, texel_zero + texel_dir_norm * tfar, texel_step, texSampleDist);\n}",_0x6c679=(_0x49d928=!0,function(e,t){var i=_0x49d928?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x49d928=!1,i}),_0x9cf625=_0x6c679(void 0,(function(){return _0x9cf625.toString().search("(((.+)+)+)+$").toString().constructor(_0x9cf625).search("(((.+)+)+)+$")})),_0x49d928;_0x9cf625();var _0x351c13=[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,3,8,1,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,11,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,3,8,2,8,11,11,8,9,-1,-1,-1,-1,-1,-1,-1],[3,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,2,10,8,0,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,0,9,2,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,2,10,1,10,9,9,10,8,-1,-1,-1,-1,-1,-1,-1],[3,1,11,10,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,1,11,0,11,8,8,11,10,-1,-1,-1,-1,-1,-1,-1],[3,0,9,3,9,10,10,9,11,-1,-1,-1,-1,-1,-1,-1],[9,11,8,11,10,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,9,1,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1],[1,11,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,7,4,3,4,0,1,11,2,-1,-1,-1,-1,-1,-1,-1],[9,11,2,9,2,0,8,7,4,-1,-1,-1,-1,-1,-1,-1],[2,9,11,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1],[8,7,4,3,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[10,7,4,10,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1],[9,1,0,8,7,4,2,10,3,-1,-1,-1,-1,-1,-1,-1],[4,10,7,9,10,4,9,2,10,9,1,2,-1,-1,-1,-1],[3,1,11,3,11,10,7,4,8,-1,-1,-1,-1,-1,-1,-1],[1,11,10,1,10,4,1,4,0,7,4,10,-1,-1,-1,-1],[4,8,7,9,10,0,9,11,10,10,3,0,-1,-1,-1,-1],[4,10,7,4,9,10,9,11,10,-1,-1,-1,-1,-1,-1,-1],[9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,4,5,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1],[1,11,2,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,8,0,1,11,2,4,5,9,-1,-1,-1,-1,-1,-1,-1],[5,11,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1],[2,5,11,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1],[9,4,5,2,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,2,10,0,10,8,4,5,9,-1,-1,-1,-1,-1,-1,-1],[0,4,5,0,5,1,2,10,3,-1,-1,-1,-1,-1,-1,-1],[2,5,1,2,8,5,2,10,8,4,5,8,-1,-1,-1,-1],[11,10,3,11,3,1,9,4,5,-1,-1,-1,-1,-1,-1,-1],[4,5,9,0,1,8,8,1,11,8,11,10,-1,-1,-1,-1],[5,0,4,5,10,0,5,11,10,10,3,0,-1,-1,-1,-1],[5,8,4,5,11,8,11,10,8,-1,-1,-1,-1,-1,-1,-1],[9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1],[0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1],[1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,8,7,9,7,5,11,2,1,-1,-1,-1,-1,-1,-1,-1],[11,2,1,9,0,5,5,0,3,5,3,7,-1,-1,-1,-1],[8,2,0,8,5,2,8,7,5,11,2,5,-1,-1,-1,-1],[2,5,11,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1],[7,5,9,7,9,8,3,2,10,-1,-1,-1,-1,-1,-1,-1],[9,7,5,9,2,7,9,0,2,2,10,7,-1,-1,-1,-1],[2,10,3,0,8,1,1,8,7,1,7,5,-1,-1,-1,-1],[10,1,2,10,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1],[9,8,5,8,7,5,11,3,1,11,10,3,-1,-1,-1,-1],[5,0,7,5,9,0,7,0,10,1,11,0,10,0,11,-1],[10,0,11,10,3,0,11,0,5,8,7,0,5,0,7,-1],[10,5,11,7,5,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[11,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,3,8,5,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,1,0,5,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,3,8,1,8,9,5,6,11,-1,-1,-1,-1,-1,-1,-1],[1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,5,6,1,6,2,3,8,0,-1,-1,-1,-1,-1,-1,-1],[9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1],[5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1],[2,10,3,11,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[10,8,0,10,0,2,11,5,6,-1,-1,-1,-1,-1,-1,-1],[0,9,1,2,10,3,5,6,11,-1,-1,-1,-1,-1,-1,-1],[5,6,11,1,2,9,9,2,10,9,10,8,-1,-1,-1,-1],[6,10,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1],[0,10,8,0,5,10,0,1,5,5,6,10,-1,-1,-1,-1],[3,6,10,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1],[6,9,5,6,10,9,10,8,9,-1,-1,-1,-1,-1,-1,-1],[5,6,11,4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,0,3,4,3,7,6,11,5,-1,-1,-1,-1,-1,-1,-1],[1,0,9,5,6,11,8,7,4,-1,-1,-1,-1,-1,-1,-1],[11,5,6,1,7,9,1,3,7,7,4,9,-1,-1,-1,-1],[6,2,1,6,1,5,4,8,7,-1,-1,-1,-1,-1,-1,-1],[1,5,2,5,6,2,3,4,0,3,7,4,-1,-1,-1,-1],[8,7,4,9,5,0,0,5,6,0,6,2,-1,-1,-1,-1],[7,9,3,7,4,9,3,9,2,5,6,9,2,9,6,-1],[3,2,10,7,4,8,11,5,6,-1,-1,-1,-1,-1,-1,-1],[5,6,11,4,2,7,4,0,2,2,10,7,-1,-1,-1,-1],[0,9,1,4,8,7,2,10,3,5,6,11,-1,-1,-1,-1],[9,1,2,9,2,10,9,10,4,7,4,10,5,6,11,-1],[8,7,4,3,5,10,3,1,5,5,6,10,-1,-1,-1,-1],[5,10,1,5,6,10,1,10,0,7,4,10,0,10,4,-1],[0,9,5,0,5,6,0,6,3,10,3,6,8,7,4,-1],[6,9,5,6,10,9,4,9,7,7,9,10,-1,-1,-1,-1],[11,9,4,6,11,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,6,11,4,11,9,0,3,8,-1,-1,-1,-1,-1,-1,-1],[11,1,0,11,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1],[8,1,3,8,6,1,8,4,6,6,11,1,-1,-1,-1,-1],[1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1],[3,8,0,1,9,2,2,9,4,2,4,6,-1,-1,-1,-1],[0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1],[11,9,4,11,4,6,10,3,2,-1,-1,-1,-1,-1,-1,-1],[0,2,8,2,10,8,4,11,9,4,6,11,-1,-1,-1,-1],[3,2,10,0,6,1,0,4,6,6,11,1,-1,-1,-1,-1],[6,1,4,6,11,1,4,1,8,2,10,1,8,1,10,-1],[9,4,6,9,6,3,9,3,1,10,3,6,-1,-1,-1,-1],[8,1,10,8,0,1,10,1,6,9,4,1,6,1,4,-1],[3,6,10,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1],[6,8,4,10,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[7,6,11,7,11,8,8,11,9,-1,-1,-1,-1,-1,-1,-1],[0,3,7,0,7,11,0,11,9,6,11,7,-1,-1,-1,-1],[11,7,6,1,7,11,1,8,7,1,0,8,-1,-1,-1,-1],[11,7,6,11,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1],[1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1],[2,9,6,2,1,9,6,9,7,0,3,9,7,9,3,-1],[7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1],[7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,10,3,11,8,6,11,9,8,8,7,6,-1,-1,-1,-1],[2,7,0,2,10,7,0,7,9,6,11,7,9,7,11,-1],[1,0,8,1,8,7,1,7,11,6,11,7,2,10,3,-1],[10,1,2,10,7,1,11,1,6,6,1,7,-1,-1,-1,-1],[8,6,9,8,7,6,9,6,1,10,3,6,1,6,3,-1],[0,1,9,10,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[7,0,8,7,6,0,3,0,10,10,0,6,-1,-1,-1,-1],[7,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[7,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,8,0,10,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,9,1,10,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[8,9,1,8,1,3,10,6,7,-1,-1,-1,-1,-1,-1,-1],[11,2,1,6,7,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,11,2,3,8,0,6,7,10,-1,-1,-1,-1,-1,-1,-1],[2,0,9,2,9,11,6,7,10,-1,-1,-1,-1,-1,-1,-1],[6,7,10,2,3,11,11,3,8,11,8,9,-1,-1,-1,-1],[7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1],[2,6,7,2,7,3,0,9,1,-1,-1,-1,-1,-1,-1,-1],[1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1],[11,6,7,11,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1],[11,6,7,1,11,7,1,7,8,1,8,0,-1,-1,-1,-1],[0,7,3,0,11,7,0,9,11,6,7,11,-1,-1,-1,-1],[7,11,6,7,8,11,8,9,11,-1,-1,-1,-1,-1,-1,-1],[6,4,8,10,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,10,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1],[8,10,6,8,6,4,9,1,0,-1,-1,-1,-1,-1,-1,-1],[9,6,4,9,3,6,9,1,3,10,6,3,-1,-1,-1,-1],[6,4,8,6,8,10,2,1,11,-1,-1,-1,-1,-1,-1,-1],[1,11,2,3,10,0,0,10,6,0,6,4,-1,-1,-1,-1],[4,8,10,4,10,6,0,9,2,2,9,11,-1,-1,-1,-1],[11,3,9,11,2,3,9,3,4,10,6,3,4,3,6,-1],[8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1],[0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,0,9,2,4,3,2,6,4,4,8,3,-1,-1,-1,-1],[1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1],[8,3,1,8,1,6,8,6,4,6,1,11,-1,-1,-1,-1],[11,0,1,11,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1],[4,3,6,4,8,3,6,3,11,0,9,3,11,3,9,-1],[11,4,9,6,4,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,5,9,7,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,3,8,4,5,9,10,6,7,-1,-1,-1,-1,-1,-1,-1],[5,1,0,5,0,4,7,10,6,-1,-1,-1,-1,-1,-1,-1],[10,6,7,8,4,3,3,4,5,3,5,1,-1,-1,-1,-1],[9,4,5,11,2,1,7,10,6,-1,-1,-1,-1,-1,-1,-1],[6,7,10,1,11,2,0,3,8,4,5,9,-1,-1,-1,-1],[7,10,6,5,11,4,4,11,2,4,2,0,-1,-1,-1,-1],[3,8,4,3,4,5,3,5,2,11,2,5,10,6,7,-1],[7,3,2,7,2,6,5,9,4,-1,-1,-1,-1,-1,-1,-1],[9,4,5,0,6,8,0,2,6,6,7,8,-1,-1,-1,-1],[3,2,6,3,6,7,1,0,5,5,0,4,-1,-1,-1,-1],[6,8,2,6,7,8,2,8,1,4,5,8,1,8,5,-1],[9,4,5,11,6,1,1,6,7,1,7,3,-1,-1,-1,-1],[1,11,6,1,6,7,1,7,0,8,0,7,9,4,5,-1],[4,11,0,4,5,11,0,11,3,6,7,11,3,11,7,-1],[7,11,6,7,8,11,5,11,4,4,11,8,-1,-1,-1,-1],[6,5,9,6,9,10,10,9,8,-1,-1,-1,-1,-1,-1,-1],[3,10,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1],[0,8,10,0,10,5,0,5,1,5,10,6,-1,-1,-1,-1],[6,3,10,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1],[1,11,2,9,10,5,9,8,10,10,6,5,-1,-1,-1,-1],[0,3,10,0,10,6,0,6,9,5,9,6,1,11,2,-1],[10,5,8,10,6,5,8,5,0,11,2,5,0,5,2,-1],[6,3,10,6,5,3,2,3,11,11,3,5,-1,-1,-1,-1],[5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1],[9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1],[1,8,5,1,0,8,5,8,6,3,2,8,6,8,2,-1],[1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,6,3,1,11,6,3,6,8,5,9,6,8,6,9,-1],[11,0,1,11,6,0,9,0,5,5,0,6,-1,-1,-1,-1],[0,8,3,5,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[11,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[10,11,5,7,10,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[10,11,5,10,5,7,8,0,3,-1,-1,-1,-1,-1,-1,-1],[5,7,10,5,10,11,1,0,9,-1,-1,-1,-1,-1,-1,-1],[11,5,7,11,7,10,9,1,8,8,1,3,-1,-1,-1,-1],[10,2,1,10,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1],[0,3,8,1,7,2,1,5,7,7,10,2,-1,-1,-1,-1],[9,5,7,9,7,2,9,2,0,2,7,10,-1,-1,-1,-1],[7,2,5,7,10,2,5,2,9,3,8,2,9,2,8,-1],[2,11,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1],[8,0,2,8,2,5,8,5,7,11,5,2,-1,-1,-1,-1],[9,1,0,5,3,11,5,7,3,3,2,11,-1,-1,-1,-1],[9,2,8,9,1,2,8,2,7,11,5,2,7,2,5,-1],[1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1],[9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1],[9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[5,4,8,5,8,11,11,8,10,-1,-1,-1,-1,-1,-1,-1],[5,4,0,5,0,10,5,10,11,10,0,3,-1,-1,-1,-1],[0,9,1,8,11,4,8,10,11,11,5,4,-1,-1,-1,-1],[11,4,10,11,5,4,10,4,3,9,1,4,3,4,1,-1],[2,1,5,2,5,8,2,8,10,4,8,5,-1,-1,-1,-1],[0,10,4,0,3,10,4,10,5,2,1,10,5,10,1,-1],[0,5,2,0,9,5,2,5,10,4,8,5,10,5,8,-1],[9,5,4,2,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,11,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1],[5,2,11,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1],[3,2,11,3,11,5,3,5,8,4,8,5,0,9,1,-1],[5,2,11,5,4,2,1,2,9,9,2,4,-1,-1,-1,-1],[8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1],[0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[8,5,4,8,3,5,9,5,0,0,5,3,-1,-1,-1,-1],[9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,7,10,4,10,9,9,10,11,-1,-1,-1,-1,-1,-1,-1],[0,3,8,4,7,9,9,7,10,9,10,11,-1,-1,-1,-1],[1,10,11,1,4,10,1,0,4,7,10,4,-1,-1,-1,-1],[3,4,1,3,8,4,1,4,11,7,10,4,11,4,10,-1],[4,7,10,9,4,10,9,10,2,9,2,1,-1,-1,-1,-1],[9,4,7,9,7,10,9,10,1,2,1,10,0,3,8,-1],[10,4,7,10,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1],[10,4,7,10,2,4,8,4,3,3,4,2,-1,-1,-1,-1],[2,11,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1],[9,7,11,9,4,7,11,7,2,8,0,7,2,7,0,-1],[3,11,7,3,2,11,7,11,4,1,0,11,4,11,0,-1],[1,2,11,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1],[4,1,9,4,7,1,0,1,8,8,1,7,-1,-1,-1,-1],[4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[9,8,11,11,8,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,9,0,3,10,9,10,11,9,-1,-1,-1,-1,-1,-1,-1],[0,11,1,0,8,11,8,10,11,-1,-1,-1,-1,-1,-1,-1],[3,11,1,10,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,10,2,1,9,10,9,8,10,-1,-1,-1,-1,-1,-1,-1],[3,9,0,3,10,9,1,9,2,2,9,10,-1,-1,-1,-1],[0,10,2,8,10,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,8,3,2,11,8,11,9,8,-1,-1,-1,-1,-1,-1,-1],[9,2,11,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,8,3,2,11,8,0,8,1,1,8,11,-1,-1,-1,-1],[1,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]],_0x55f4c0=[[0,1],[1,3],[2,3],[0,2],[4,5],[5,7],[6,7],[4,6],[0,4],[1,5],[2,6],[3,7]];function _0x55b126(e){return _0x351c13[e]}function _0x3c171f(e){return _0x55f4c0[e]}var _0x4a23c9={getCase:_0x55b126,getEdge:_0x3c171f},_0x1287e0=(_0x1033c8=!0,function(e,t){var i=_0x1033c8?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x1033c8=!1,i}),_0x5c4725=_0x1287e0(void 0,(function(){return _0x5c4725.toString().search("(((.+)+)+)+$").toString().constructor(_0x5c4725).search("(((.+)+)+)+$")})),_0x1033c8;function _0x423d8d(){this._ids=[],this._voxelScalars=[],this._voxelGradients=[],this._voxelPts=[],this._edgeMap={},this.computeNormals=!0,this.mergePoints=!1,this.contourValue=0}_0x5c4725(),_0x423d8d.prototype.getVoxelScalars=function(e,t,i,r,n,o,a,s){var l=this._ids,u=this._voxelScalars;l[0]=i*r+t*n[0]+e,l[1]=l[0]+1,l[2]=l[0]+n[0],l[3]=l[2]+1,l[4]=l[0]+r,l[5]=l[4]+1,l[6]=l[4]+n[0],l[7]=l[6]+1;for(let e=0;e<8;++e)u[e]=s[l[e]]},_0x423d8d.prototype.getVoxelPoints=function(e,t,i,r,n,o){var a=this._voxelPts;a[0]=n[0]+e*o[0],a[1]=n[1]+t*o[1],a[2]=n[2]+i*o[2],a[3]=a[0]+o[0],a[4]=a[1],a[5]=a[2],a[6]=a[0],a[7]=a[1]+o[1],a[8]=a[2],a[9]=a[3],a[10]=a[7],a[11]=a[2],a[12]=a[0],a[13]=a[1],a[14]=a[2]+o[2],a[15]=a[3],a[16]=a[1],a[17]=a[14],a[18]=a[0],a[19]=a[7],a[20]=a[14],a[21]=a[3],a[22]=a[7],a[23]=a[14]},_0x423d8d.prototype.getPointGradient=function(e,t,i,r,n,o,a,s){let l,u;0===e?(l=a[e+1+t*r[0]+i*n],u=a[e+t*r[0]+i*n],s[0]=(u-l)/o[0]):e===r[0]-1?(l=a[e+t*r[0]+i*n],u=a[e-1+t*r[0]+i*n],s[0]=(u-l)/o[0]):(l=a[e+1+t*r[0]+i*n],u=a[e-1+t*r[0]+i*n],s[0]=.5*(u-l)/o[0]),0===t?(l=a[e+(t+1)*r[0]+i*n],u=a[e+t*r[0]+i*n],s[1]=(u-l)/o[1]):t===r[1]-1?(l=a[e+t*r[0]+i*n],u=a[e+(t-1)*r[0]+i*n],s[1]=(u-l)/o[1]):(l=a[e+(t+1)*r[0]+i*n],u=a[e+(t-1)*r[0]+i*n],s[1]=.5*(u-l)/o[1]),0===i?(l=a[e+t*r[0]+(i+1)*n],u=a[e+t*r[0]+i*n],s[2]=(u-l)/o[2]):i===r[2]-1?(l=a[e+t*r[0]+i*n],u=a[e+t*r[0]+(i-1)*n],s[2]=(u-l)/o[2]):(l=a[e+t*r[0]+(i+1)*n],u=a[e+t*r[0]+(i-1)*n],s[2]=.5*(u-l)/o[2])},_0x423d8d.prototype.getVoxelGradients=function(e,t,i,r,n,o,a){var s=this._voxelGradients,l=[];this.getPointGradient(e,t,i,r,n,o,a,l),s[0]=l[0],s[1]=l[1],s[2]=l[2],this.getPointGradient(e+1,t,i,r,n,o,a,l),s[3]=l[0],s[4]=l[1],s[5]=l[2],this.getPointGradient(e,t+1,i,r,n,o,a,l),s[6]=l[0],s[7]=l[1],s[8]=l[2],this.getPointGradient(e+1,t+1,i,r,n,o,a,l),s[9]=l[0],s[10]=l[1],s[11]=l[2],this.getPointGradient(e,t,i+1,r,n,o,a,l),s[12]=l[0],s[13]=l[1],s[14]=l[2],this.getPointGradient(e+1,t,i+1,r,n,o,a,l),s[15]=l[0],s[16]=l[1],s[17]=l[2],this.getPointGradient(e,t+1,i+1,r,n,o,a,l),s[18]=l[0],s[19]=l[1],s[20]=l[2],this.getPointGradient(e+1,t+1,i+1,r,n,o,a,l),s[21]=l[0],s[22]=l[1],s[23]=l[2]},_0x423d8d.prototype.produceTriangles=function(e,t,i,r,n,o,a,s,l,u,c,h){var d,f,p=[1,2,4,8,16,32,64,128],_=[0,1,3,2,4,5,7,6],m=[],$=[],g=[];this.getVoxelScalars(t,i,r,n,o,a,s,l);for(var v=0,y=0;y<8;y++)this._voxelScalars[_[y]]>=e&&(v|=p[y]);var x=_0x4a23c9.getCase(v);if(!(x[0]<0)){this.getVoxelPoints(t,i,r,o,a,s),this.computeNormals&&this.getVoxelGradients(t,i,r,o,n,s,l);var b=new t$X;for(y=0;x[y]>=0;y+=3){c.push(3);for(var w=0;w<3;w++){var C=_0x4a23c9.getEdge(x[y+w]);if(d=void 0,this.mergePoints&&(g[0]=this._ids[C[0]],g[1]=this._ids[C[1]],g[0]>g[1]&&(f=g[0],g[0]=g[1],g[1]=f),d=this._edgeMap[g]),void 0===d){var T=(e-this._voxelScalars[C[0]])/(this._voxelScalars[C[1]]-this._voxelScalars[C[0]]),S=this._voxelPts.slice(3*C[0],3*(C[0]+1)),E=this._voxelPts.slice(3*C[1],3*(C[1]+1));if(m[0]=S[0]+T*(E[0]-S[0]),m[1]=S[1]+T*(E[1]-S[1]),m[2]=S[2]+T*(E[2]-S[2]),d=u.length/3,u.push(m[0],m[1],m[2]),this.computeNormals){var A=this._voxelGradients.slice(3*C[0],3*(C[0]+1)),P=this._voxelGradients.slice(3*C[1],3*(C[1]+1));$[0]=A[0]+T*(P[0]-A[0]),$[1]=A[1]+T*(P[1]-A[1]),$[2]=A[2]+T*(P[2]-A[2]),t$X.unpack($,0,b),t$X.equals(t$X.ZERO,b)||t$X.normalize(b,b),h.push(b.x,b.y,b.z)}this.mergePoints&&(g[0]=this._ids[C[0]],g[1]=this._ids[C[1]],g[0]>g[1]&&(f=g[0],g[0]=g[1],g[1]=f),this._edgeMap[g]=d)}c.push(d)}}}},_0x423d8d.prototype.compute=function(e){for(var t=e.xDimSize,i=e.yDimSize,r=e.zDimSize,n=(e.timeDimSize,[0,0,0]),o=[1/t,1/i,1/r],a=[t,i,r],s=e.array[0],l=[],u=[],c=[],h=a[0]*a[1],d=0;d<a[2]-1;++d)for(var f=0;f<a[1]-1;++f)for(var p=0;p<a[0]-1;++p)this.produceTriangles(this.contourValue,p,f,d,h,a,n,o,s,l,u,c);return{pBuffer:l,tBuffer:u,nBuffer:c}};var We="attribute vec4 aPosition;\nattribute vec4 aNormal;\nvarying vec3 vNormal;\nvarying vec3 positionEC;\nvoid main()\n{\nvNormal = aNormal.xyz;\npositionEC = (czm_modelView * vec4(aPosition.xyz, 1.0)).xyz;\ngl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n}\n",Ue$2="varying vec3 vNormal;\nvarying vec3 positionEC;\nuniform float uContourValue;\nuniform sampler2D u_colorTexture;\n#ifdef APPLY_LIGHTING\nuniform vec3 uDiffuse;\nuniform vec3 uSpecular;\nuniform vec3 uAmbient;\nuniform float uShiness;\n#endif\nvec4 getColorForValue(float tValue)\n{\nfloat texCoord = tValue;\ntexCoord = clamp(texCoord, 0.0, 1.0);\nvec4 tColor = texture2D(u_colorTexture, vec2(texCoord, 0.5));\nreturn tColor;\n}\n#ifdef APPLY_LIGHTING\nvoid applyLighting(inout vec4 tColor, vec3 normal)\n{\nvec3 diffuse = uDiffuse;\nvec3 specular = uSpecular;\nvec3 ambient = uAmbient;\nfloat shiness = uShiness;\nvec3 normalEC = normalize(czm_normal * normal);\nfloat ndot = max( dot( normalEC, czm_sunDirectionEC ), 0.0 );\nndot = ndot * 0.5 + 0.5;\ndiffuse = diffuse * ndot;\nspecular = specular * czm_getSpecular(czm_sunDirectionEC, normalize(-positionEC), normalEC, shiness);\ntColor.rgb = tColor.rgb*(diffuse + ambient) + specular;\n}\n#endif\nvoid main()\n{\nvec4 color = getColorForValue(uContourValue);\n#ifdef APPLY_LIGHTING\napplyLighting(color, vNormal);\n#endif\ngl_FragColor = color;\n}\n";function Qe(e){for(var t=1;t<e;)t<<=1;return t}function qe(e){var t=new t$X(1,255,65025);(t=t$X.multiplyByScalar(t,e,t)).x=t.x-Math.floor(t.x),t.y=t.y-Math.floor(t.y),t.z=t.z-Math.floor(t.z);var i=new t$X,r=new t$X(1/255,1/255,0);return i.x=t.y*r.x,i.y=t.z*r.y,i.z=t.z*r.z,t=t$X.subtract(t,i,t)}function m$9(e,t){this._context=e,this._floor=0,this._ceil=1,this._dataBounds=h$10.MAX_VALUE,this._zBounds=new o$1k(0,1),this._nSideBlockCount=0,this._nBlockLength=0,this._nLength=0,this._nWidth=0,this._nHeight=0,this._nDepth=0,this._volTextures=[],this._dWidth=0,this._dHeight=0,this._dDepth=0,this._matLocalView=void 0,this._boundingSphere=void 0,this._timeDimension=1,this._timeIndex=0,this._xSliceCommand=void 0,this._ySliceCommand=void 0,this._zSliceCommand=void 0,this._initialized=!1,this._layer=t,this._attributeLocations={},this._visibleBoundingBox=new O$H({minimum:t$X.ZERO,maximum:new t$X(1,1,1)}),this.m_vScale=new t$X(1,1,1),this._volumeBoxCommand=void 0,this.marchingCubes=new _0x423d8d,this.outlineCommand=void 0,this._mode=P$$.SCENE3D}Object.defineProperties(m$9.prototype,{maxValue:{get:function(){return this._ceil}},minValue:{get:function(){return this._floor}},visibleBoundingBox:{get:function(){return this._visibleBoundingBox},set:function(e){this._visibleBoundingBox=e}}}),m$9.prototype._encodeImageData=function(e,t,i,r){for(var n=this._nLength*this._nLength*4,o=new Array(n),a=i-t,s=t,l=0;l<e.zDimSize;l++)for(var u=parseInt(l/this._nSideBlockCount)*this._nBlockLength,c=l%this._nSideBlockCount*this._nBlockLength,h=0;h<this._nBlockLength-2;h++)for(var d=0;d<this._nBlockLength-2;d++){var f=Math.min(d,e.xDimSize-1),p=Math.min(h,e.yDimSize-1),_=l*e.yDimSize*e.xDimSize+(e.yDimSize-1-p)*e.xDimSize+f,m=r[_],$=new e$25(0,0,0,0);if(-9999!=m){m<t||m>i?m=s:s=m;var g=qe(m=(m-t)/a);$.x=g.x,$.y=g.y,$.z=g.z,$.w=1}var v=255*$.x,y=255*$.y,x=255*$.z,b=255*$.w;o[4*(_=(u+h)*this._nLength+c+d)]=parseInt(v),o[4*_+1]=parseInt(y),o[4*_+2]=parseInt(x),o[4*_+3]=parseInt(b)}return new Uint8Array(o,0,n)},m$9.prototype._loadData=function(e,t){var i=x$a.loadData(e,t);this.output=i,this._timeDimension=i.timeDimSize,this._floor=i.minValue,this._ceil=i.maxValue,this._nWidth=i.xDimSize,this._nHeight=i.yDimSize,this._nDepth=i.zDimSize;var r=i.array;this._nSideBlockCount=Math.ceil(Math.sqrt(i.zDimSize)),this._nBlockLength=Math.max(i.xDimSize,i.yDimSize)+2,this._nLength=Qe(this._nBlockLength*this._nSideBlockCount-2);for(var n=[],o=0;o<this._timeDimension;o++)n.push(this._encodeImageData(i,i.minValue,i.maxValue,r[o]));return n},m$9.prototype._loadVolume=function(e,t){},m$9.prototype._loadTexture=function(e){var t=e.length,i=tt$h.LINEAR,r=rt$g.LINEAR;this._layer._filterMode===k$T.FilterMode.NEAREST&&(i=tt$h.NEAREST,r=rt$g.NEAREST);for(var n=0;n<t;n++){var o=new L$17({context:this._context,width:this._nLength,height:this._nLength,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:r})});o.copyFrom({width:this._nLength,height:this._nLength,arrayBufferView:e[n]}),this._volTextures.push(o)}},m$9.prototype._computePosition=function(){var e=this._mode,t=new t$X(.5*(this._dataBounds.west+this._dataBounds.east),.5*(this._dataBounds.north+this._dataBounds.south),this._zBounds.x);this._matLocalView=new y$15,this._matInverseLocalView=new y$15;var i=[];if(e===P$$.COLUMBUS_VIEW)this._vecCenter=new t$X(t.z,t.x,t.y),y$15.fromTranslation(this._vecCenter,this._matLocalView),y$15.inverse(this._matLocalView,this._matInverseLocalView),i[0]=new t$X(this._zBounds.x,this._dataBounds.west,this._dataBounds.south),i[1]=new t$X(this._zBounds.x,this._dataBounds.east,this._dataBounds.south),i[2]=new t$X(this._zBounds.x,this._dataBounds.east,this._dataBounds.north),i[3]=new t$X(this._zBounds.x,this._dataBounds.west,this._dataBounds.north),i[4]=new t$X(this._zBounds.y,this._dataBounds.west,this._dataBounds.south),i[5]=new t$X(this._zBounds.y,this._dataBounds.east,this._dataBounds.south),i[6]=new t$X(this._zBounds.y,this._dataBounds.east,this._dataBounds.north),i[7]=new t$X(this._zBounds.y,this._dataBounds.west,this._dataBounds.north);else{this._vecCenter=t$X.fromDegrees(t.x,t.y,t.z);var r=new i$10;m$1b.headingPitchRollToFixedFrame(this._vecCenter,r,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,this._matLocalView),y$15.inverse(this._matLocalView,this._matInverseLocalView),i[0]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.south,this._zBounds.x),i[1]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.south,this._zBounds.x),i[2]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.north,this._zBounds.x),i[3]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.north,this._zBounds.x),i[4]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.south,this._zBounds.y),i[5]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.south,this._zBounds.y),i[6]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.north,this._zBounds.y),i[7]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.north,this._zBounds.y)}this._dWidth=t$X.distance(i[1],i[0]),this._dHeight=t$X.distance(i[3],i[0]),this._dDepth=t$X.distance(i[4],i[0]),this._boundingSphere=new i$19,y$15.multiplyByPoint(this._matLocalView,t$X.ZERO,this._boundingSphere.center),this._boundingSphere.radius=.5*Math.sqrt(this._dWidth*this._dWidth+this._dHeight*this._dHeight+this._dDepth*this._dDepth)},m$9.prototype._createShaderPreDefines=function(e,t){var i=[];return i.push("Volume"),e._timeDimension>1&&i.push("TIME_ORDER"),e$28(t._hypsometricTexture)&&i.push("HAS_COLORTABLE"),t._useGradientOpacity&&i.push("GRADIENT_OPACITY"),t._clipPlanes.length>0&&i.push("CLIP_PLANE"),t.enableLighting&&i.push("APPLY_LIGHTING"),(0!=e._visibleBoundingBox._minimum.x||0!=e._visibleBoundingBox._minimum.y||0!=e._visibleBoundingBox._minimum.z||1!=e._visibleBoundingBox._maximum.x||1!=e._visibleBoundingBox._maximum.y||1!=e._visibleBoundingBox._maximum.z)&&i.push("TEXTURECOORD_CLIP"),i},m$9.prototype._createSliceCommand=function(){this._context;var e=this._mode===P$$.COLUMBUS_VIEW,t=this.GetRealBoundTop(),i=this.GetRealBoundBottom(),r=this.GetRealBoundRight(),n=this.GetRealBoundLeft();this._dWidth,this._dHeight;var o,a,s=this._layer._layerBounds.width,l=this._layer._layerBounds.height,u=this._layer._sliceCoordinate,c=Math.min(u.x,1),h=c*s,d=(c=Math.min(u.y,1))*l,f=r-n,p=t-i;e?o=a=5:(o=Math.ceil(this._dataBounds.north-this._dataBounds.south),a=Math.ceil(this._dataBounds.east-this._dataBounds.west));for(var _=a+1,m=o+1,$=(t-i)/o,g=(r-n)/a,v=_*m,y=2*_,x=2*m,b=new Float32Array(3*y),w=new Float32Array(3*y),C=new Float32Array(3*x),T=new Float32Array(3*x),S=new Float32Array(3*v),E=new Float32Array(3*v),A=this.GetRealTop(),P=this.GetRealBottom(),I=A-P,M=(c=Math.min(u.z,1))*I,O=0,D=new t$X,R=P+M,L=(R-P)/I,B=0;B<m;B++)for(var N=i+B*$,F=0;F<_;F++){var z=n+F*g,k=e?new t$X(R,z,N):t$X.fromDegrees(z,N,R);y$15.multiplyByPoint(this._matInverseLocalView,k,D),S[3*O]=D.x,S[3*O+1]=D.y,S[3*O+2]=D.z,E[3*O]=(z-n)/f,E[3*O+1]=(N-i)/p,E[3*O+2]=L,O++}O=0;var V=(t-d-i)/p;for(F=0;F<_;F++){z=n+F*g;var U=e?new t$X(A,z,t-d):t$X.fromDegrees(z,t-d,A);y$15.multiplyByPoint(this._matInverseLocalView,U,D),b[6*O]=D.x,b[6*O+1]=D.y,b[6*O+2]=D.z,w[6*O]=(z-n)/f,w[6*O+1]=V,w[6*O+2]=1;var X=e?new t$X(this._zBounds.x,z,t-d):t$X.fromDegrees(z,t-d,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,X,D),b[6*O+3]=D.x,b[6*O+4]=D.y,b[6*O+5]=D.z,w[6*O+3]=(z-n)/f,w[6*O+4]=V,w[6*O+5]=0,O++}O=0;var H=h/f;for(B=0;B<m;B++){N=i+B*$;var G=e?new t$X(A,n+h,N):t$X.fromDegrees(n+h,N,A);y$15.multiplyByPoint(this._matInverseLocalView,G,D),C[6*O]=D.x,C[6*O+1]=D.y,C[6*O+2]=D.z,T[6*O]=H,T[6*O+1]=(N-i)/p,T[6*O+2]=1;var W=e?new t$X(this._zBounds.x,n+h,N):t$X.fromDegrees(n+h,N,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,W,D),C[6*O+3]=D.x,C[6*O+4]=D.y,C[6*O+5]=D.z,T[6*O+3]=H,T[6*O+4]=(N-i)/p,T[6*O+5]=0,O++}for(var Y=new Uint16Array(a*o*2*3),q=0,j=0;j<o;j++)for(var Z=0;Z<a;Z++){var K=Z+_*j,Q=Z+_*(j+1),J=Z+1+_*(j+1),ee=Z+1+_*j;Y[q++]=K,Y[q++]=Q,Y[q++]=ee,Y[q++]=Q,Y[q++]=J,Y[q++]=ee}for(var te=2*o*3,ie=new Uint16Array(2*a*3),re=new Uint16Array(te),ne=0,oe=0;oe<o;oe++){K=j=2*oe,Q=j+1,J=j+2,ee=j+3;re[ne++]=K,re[ne++]=J,re[ne++]=Q,re[ne++]=Q,re[ne++]=J,re[ne++]=ee}var ae=0;for(oe=0;oe<a;oe++){K=Z=2*oe,Q=Z+1,J=Z+2,ee=Z+3;ie[ae++]=K,ie[ae++]=J,ie[ae++]=Q,ie[ae++]=Q,ie[ae++]=J,ie[ae++]=ee}var se=h$W.createVertexBuffer({context:this._context,typedArray:C,usage:A$1c.STATIC_DRAW}),le=h$W.createVertexBuffer({context:this._context,typedArray:T,usage:A$1c.STATIC_DRAW}),ue=h$W.createVertexBuffer({context:this._context,typedArray:b,usage:A$1c.STATIC_DRAW}),ce=h$W.createVertexBuffer({context:this._context,typedArray:w,usage:A$1c.STATIC_DRAW}),he=h$W.createVertexBuffer({context:this._context,typedArray:S,usage:A$1c.STATIC_DRAW}),de=h$W.createVertexBuffer({context:this._context,typedArray:E,usage:A$1c.STATIC_DRAW}),fe=[],pe=[],_e=[],me=this._attributeLocations;me.aPosition=0,fe.push({index:me.aPosition,vertexBuffer:se,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),pe.push({index:me.aPosition,vertexBuffer:ue,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),_e.push({index:me.aPosition,vertexBuffer:he,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),me.aTexCoord0=1,fe.push({index:me.aTexCoord0,vertexBuffer:le,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),pe.push({index:me.aTexCoord0,vertexBuffer:ce,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),_e.push({index:me.aTexCoord0,vertexBuffer:de,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1});var $e=h$W.createIndexBuffer({context:this._context,typedArray:re,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),ge=h$W.createIndexBuffer({context:this._context,typedArray:ie,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),ve=h$W.createIndexBuffer({context:this._context,typedArray:Y,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),ye=new a$$({sources:[Fe$1]}),xe=new a$$({sources:[Re]});ye.defines.push("Volume"),xe.defines.push("Volume"),this._timeDimension>1&&xe.defines.push("TIME_ORDER"),this._xSliceCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matLocalView,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,cull:!0}),this._ySliceCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matLocalView,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,cull:!0}),this._zSliceCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matLocalView,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,cull:!0}),this._xSliceCommand.vertexArray=new m$19({context:this._context,attributes:fe,indexBuffer:$e}),this._ySliceCommand.vertexArray=new m$19({context:this._context,attributes:pe,indexBuffer:ge}),this._zSliceCommand.vertexArray=new m$19({context:this._context,attributes:_e,indexBuffer:ve}),this._xSliceCommand.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:ye,fragmentShaderSource:xe,attributeLocations:me}),this._ySliceCommand.shaderProgram=this._xSliceCommand.shaderProgram,this._zSliceCommand.shaderProgram=this._xSliceCommand.shaderProgram,this._xSliceCommand.renderState=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!0},depthMask:{enabled:!0}}),this._ySliceCommand.renderState=this._xSliceCommand.renderState,this._zSliceCommand.renderState=this._xSliceCommand.renderState},m$9.prototype._createContourCommand=function(e,t,i){var r=this._context,n=this._layer,o=e.length;if(!(o<3)){for(var a=new Float32Array(o),s=new Float32Array(i),l=this._dataBounds.west,u=this._dataBounds.south,c=this._zBounds.x,h=this._dataBounds.width,d=this._dataBounds.height,f=this._zBounds.y-this._zBounds.x,p=new t$X,_=this._mode===P$$.COLUMBUS_VIEW,m=0;m<o;m+=3){var $=l+h*e[m],g=u+d*e[m+1],v=c+f*e[m+2],y=_?new t$X(v,$,g):t$X.fromDegrees($,g,v);y$15.multiplyByPoint(this._matInverseLocalView,y,p),a[m]=p.x,a[m+1]=p.y,a[m+2]=p.z}var x=h$W.createVertexBuffer({context:this._context,typedArray:a,usage:A$1c.STATIC_DRAW}),b=h$W.createVertexBuffer({context:this._context,typedArray:s,usage:A$1c.STATIC_DRAW}),w=[],C={aPosition:0};w.push({index:C.aPosition,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),C.aNormal=1,w.push({index:C.aNormal,vertexBuffer:b,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1});var T=new a$$({sources:[We]}),S=new a$$({sources:[Ue$2]});T.defines.push("Volume"),S.defines.push("Volume"),n.enableLighting&&S.defines.push("APPLY_LIGHTING"),this._contourCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matLocalView,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,count:o/3,cull:!0}),this._contourCommand.vertexArray=new m$19({context:this._context,attributes:w}),this._contourCommand.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:T,fragmentShaderSource:S,attributeLocations:C}),this._contourCommand.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},blending:Ee$n.ALPHA_BLEND});var E=this,A={u_colorTexture:function(){return e$28(n._colorTexture)?n._colorTexture:r.defaultTexture},uVolumeTexture:function(){return E._volTextures[0]},width:function(){return E._nWidth},height:function(){return E._nHeight},depth:function(){return E._nDepth},sideBlockCount:function(){return E._nSideBlockCount},blockLength:function(){return E._nBlockLength},texLength:function(){return E._nLength},uFilterMode:function(){return n._filterMode},uContourValue:function(){return(n.contourValue-n.minValue)/(n.maxValue-n.minValue)},uDiffuse:function(){return n.material.diffuse},uAmbient:function(){return n.material.ambient},uSpecular:function(){return n.material.specular},uShiness:function(){return n.material.shiness}};this._contourCommand.uniformMap=A}},m$9.prototype.GetRealTop=function(){return this._zBounds.x+(this._zBounds.y-this._zBounds.x)*this._layer.scale.z},m$9.prototype.GetRealBottom=function(){return this._zBounds.x},m$9.prototype.GetRealBoundLeft=function(){return.5*(this._dataBounds.east+this._dataBounds.west)-.5*(this._dataBounds.east-this._dataBounds.west)*this._layer.scale.x},m$9.prototype.GetRealBoundRight=function(){return.5*(this._dataBounds.east+this._dataBounds.west)+.5*(this._dataBounds.east-this._dataBounds.west)*this._layer.scale.x},m$9.prototype.GetRealBoundTop=function(){return.5*(this._dataBounds.north+this._dataBounds.south)+.5*(this._dataBounds.north-this._dataBounds.south)*this._layer.scale.y},m$9.prototype.GetRealBoundBottom=function(){return.5*(this._dataBounds.north+this._dataBounds.south)-.5*(this._dataBounds.north-this._dataBounds.south)*this._layer.scale.y};var Xt=new t$X;m$9.prototype._createVolumeBoxDrawCommand=function(e){this._context,new t$X(.5*(this._dataBounds.west+this._dataBounds.east),.5*(this._dataBounds.north+this._dataBounds.south),this._zBounds.x);var t,i,r=this._mode===P$$.COLUMBUS_VIEW,n=this.GetRealBoundTop(),o=this.GetRealBoundBottom(),a=this.GetRealBoundRight(),s=this.GetRealBoundLeft(),l=a-s,u=n-o;r?(t=5,i=5):(t=Math.ceil(this._dataBounds.north-this._dataBounds.south),i=Math.ceil(this._dataBounds.east-this._dataBounds.west));for(var c=i+1,h=t+1,d=(n-o)/t,f=(a-s)/i,p=c*h,_=2*c,m=2*h,$=new Float32Array(3*_),g=new Float32Array(3*_),v=new Float32Array(3*_),y=new Float32Array(3*_),x=new Float32Array(3*m),b=new Float32Array(3*m),w=new Float32Array(3*m),C=new Float32Array(3*m),T=new Float32Array(3*p),S=new Float32Array(3*p),E=new Float32Array(3*p),A=new Float32Array(3*p),P=this.GetRealTop(),I=0,M=new t$X,O=0;O<h;O++)for(var D=o+O*d,R=0;R<c;R++){var L=s+R*f,B=r?new t$X(P,L,D):t$X.fromDegrees(L,D,P);y$15.multiplyByPoint(this._matInverseLocalView,B,M),T[3*I]=M.x,T[3*I+1]=M.y,T[3*I+2]=M.z,S[3*I]=(L-s)/l,S[3*I+1]=(D-o)/u,S[3*I+2]=1;var N=r?new t$X(this._zBounds.x,L,D):t$X.fromDegrees(L,D,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,N,M),E[3*I]=M.x,E[3*I+1]=M.y,E[3*I+2]=M.z,A[3*I]=(L-s)/l,A[3*I+1]=(D-o)/u,A[3*I+2]=0,I++}I=0;for(R=0;R<c;R++){L=s+R*f;var F=r?new t$X(P,L,n):t$X.fromDegrees(L,n,P);y$15.multiplyByPoint(this._matInverseLocalView,F,M),$[6*I]=M.x,$[6*I+1]=M.y,$[6*I+2]=M.z,g[6*I]=(L-s)/l,g[6*I+1]=1,g[6*I+2]=1;var z=r?new t$X(this._zBounds.x,L,n):t$X.fromDegrees(L,n,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,z,M),$[6*I+3]=M.x,$[6*I+4]=M.y,$[6*I+5]=M.z,g[6*I+3]=(L-s)/l,g[6*I+4]=1,g[6*I+5]=0;var k=r?new t$X(P,L,o):t$X.fromDegrees(L,o,P);y$15.multiplyByPoint(this._matInverseLocalView,k,M),v[6*I]=M.x,v[6*I+1]=M.y,v[6*I+2]=M.z,y[6*I]=(L-s)/l,y[6*I+1]=0,y[6*I+2]=1;var V=r?new t$X(this._zBounds.x,L,o):t$X.fromDegrees(L,o,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,V,M),v[6*I+3]=M.x,v[6*I+4]=M.y,v[6*I+5]=M.z,y[6*I+3]=(L-s)/l,y[6*I+4]=0,y[6*I+5]=0,I++}I=0;for(O=0;O<h;O++){D=o+O*d;var U=r?new t$X(P,s,D):t$X.fromDegrees(s,D,P);y$15.multiplyByPoint(this._matInverseLocalView,U,M),x[6*I]=M.x,x[6*I+1]=M.y,x[6*I+2]=M.z,b[6*I]=0,b[6*I+1]=(D-o)/u,b[6*I+2]=1;var X=r?new t$X(this._zBounds.x,s,D):t$X.fromDegrees(s,D,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,X,M),x[6*I+3]=M.x,x[6*I+4]=M.y,x[6*I+5]=M.z,b[6*I+3]=0,b[6*I+4]=(D-o)/u,b[6*I+5]=0;var H=r?new t$X(P,a,D):t$X.fromDegrees(a,D,P);y$15.multiplyByPoint(this._matInverseLocalView,H,M),w[6*I]=M.x,w[6*I+1]=M.y,w[6*I+2]=M.z,C[6*I]=1,C[6*I+1]=(D-o)/u,C[6*I+2]=1;var G=r?new t$X(this._zBounds.x,a,D):t$X.fromDegrees(a,D,this._zBounds.x);y$15.multiplyByPoint(this._matInverseLocalView,G,M),w[6*I+3]=M.x,w[6*I+4]=M.y,w[6*I+5]=M.z,C[6*I+3]=1,C[6*I+4]=(D-o)/u,C[6*I+5]=0,I++}for(var W=i*t*2*3,Y=new Uint16Array(W),q=new Uint16Array(W),j=0,Z=0,K=0;K<t;K++)for(var Q=0;Q<i;Q++){var J=Q+c*K,ee=Q+c*(K+1),te=Q+1+c*(K+1),ie=Q+1+c*K;Y[j++]=ie,Y[j++]=ee,Y[j++]=J,Y[j++]=ie,Y[j++]=te,Y[j++]=ee,q[Z++]=J,q[Z++]=ee,q[Z++]=ie,q[Z++]=ee,q[Z++]=te,q[Z++]=ie}for(var re=2*i*3,ne=2*t*3,oe=new Uint16Array(re),ae=new Uint16Array(re),se=new Uint16Array(ne),le=new Uint16Array(ne),ue=0,ce=0,he=0;he<t;he++){J=K=2*he,ee=K+1,te=K+2,ie=K+3;se[ue++]=J,se[ue++]=te,se[ue++]=ee,se[ue++]=ee,se[ue++]=te,se[ue++]=ie,le[ce++]=ee,le[ce++]=te,le[ce++]=J,le[ce++]=ie,le[ce++]=te,le[ce++]=ee}var de=0,fe=0;for(he=0;he<i;he++){J=Q=2*he,ee=Q+1,te=Q+2,ie=Q+3;oe[de++]=J,oe[de++]=te,oe[de++]=ee,oe[de++]=ee,oe[de++]=te,oe[de++]=ie,ae[fe++]=ee,ae[fe++]=te,ae[fe++]=J,ae[fe++]=ie,ae[fe++]=te,ae[fe++]=ee}var pe=2*p+2*_+2*m,_e=new Float32Array(3*pe),me=new Float32Array(3*pe),$e=new Uint16Array(2*W+2*ne+2*re),ge=[],ve=[],ye=[];ge.push($),ge.push(v),ge.push(x),ge.push(w),ge.push(T),ge.push(E),ve.push(g),ve.push(y),ve.push(b),ve.push(C),ve.push(S),ve.push(A),ye.push(oe),ye.push(ae),ye.push(se),ye.push(le),ye.push(Y),ye.push(q);for(var xe=ge.length,be=0,we=0,Ce=0,Te=0,Se=0;Se<xe;Se++){for(var Ee=ge[Se],Ae=ve[Se],Pe=ye[Se],Ie=0;Ie<Ee.length;Ie++)_e[we++]=Ee[Ie],me[Ce++]=Ae[Ie];for(Ie=0;Ie<Pe.length;Ie++)$e[Te++]=Pe[Ie]+be;be+=Ee.length/3}var Me=h$W.createVertexBuffer({context:this._context,typedArray:_e,usage:A$1c.STATIC_DRAW}),Oe=h$W.createVertexBuffer({context:this._context,typedArray:me,usage:A$1c.STATIC_DRAW}),De=[],Re={aPosition:0};De.push({index:Re.aPosition,vertexBuffer:Me,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1}),Re.aTexCoord0=1,De.push({index:Re.aTexCoord0,vertexBuffer:Oe,componentsPerAttribute:3,componentDatatype:S$W.FLOAT,offsetInBytes:0,strideInBytes:3*Float32Array.BYTES_PER_ELEMENT,normalize:!1});var Le=h$W.createIndexBuffer({context:this._context,typedArray:$e,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT}),Be=new a$$({sources:[Me$3]}),Fe=new a$$({sources:[Ne]}),ze=this._createShaderPreDefines(this,e);Be.defines=ze,Fe.defines=ze,this._volumeBoxCommand=new r$15({primitiveType:W$_.TRIANGLES,modelMatrix:this._matLocalView,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,cull:!0}),this._volumeBoxCommand.vertexArray=new m$19({context:this._context,attributes:De,indexBuffer:Le}),this._volumeBoxCommand.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:Be,fragmentShaderSource:Fe,attributeLocations:Re}),this._volumeBoxCommand.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},depthMask:{enabled:!0},blending:Ee$n.ALPHA_BLEND})};for(var Zt=new t$X,Mt=new e$25,Nt$1=new e$25,It$2=[],pe$2=0;pe$2<6;pe$2++)It$2.push(new e$25);function xe$1(e,t){var i=!1,r=t.split(" ");if(r.length>1){var n=r[0],o=r[1];for(var a in e.defines)if(-1!==e.defines[a].indexOf(n))return void(e.defines[a]=n+" "+o)}else{for(var a in e.defines)if(e.defines[a]===t){i=!0;break}i||e.defines.push(t)}}function Be$2(e,t){for(var i=-1,r=0;r<e.defines.length;r++)if(e.defines[r]===t){i=r;break}i>=0&&e.defines.splice(i,1)}function $$3(e){e$28(e)&&(e.vertexArray=e.vertexArray&&!e.vertexArray.isDestroyed()&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&!e.shaderProgram.isDestroyed()&&e.shaderProgram.destroy(),e.renderState=void 0,e.uniformMap=void 0)}function o$b(e,t){m$9.call(this,e,t),this._orientedBoundingBox=void 0,this._level=0,this._x=0,this._y=0,this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._NetCDFInfo=void 0,this._NetCDFBuffer=void 0,this._isVisible=!1,this._disFromCamera=0,this._rangeList=256,this._isLessLodDis=!1,this._pix=0,this._s3mLoadState=I$F.UNLOAD,this._isRootTile=!1,this._rootTile=void 0,this._maxValue=void 0,this._minValue=void 0,this._multiTextures=[]}function G$7(e){for(var t=1;t<e;)t<<=1;return t}function H$4(e){var t=new t$X(1,255,65025);(t=t$X.multiplyByScalar(t,e,t)).x=t.x-Math.floor(t.x),t.y=t.y-Math.floor(t.y),t.z=t.z-Math.floor(t.z);var i=new t$X,r=new t$X(1/255,1/255,0);return i.x=t.y*r.x,i.y=t.z*r.y,i.z=t.z*r.z,t=t$X.subtract(t,i,t)}function q$4(e,t,i){var r=i.radius,n=i.center,o=t$X.distance(e.positionWC,n);e._mode===P$$.SCENE2D&&(o=e.positionCartographic.height);var a=t.drawingBufferHeight,s=.5*e$27.PI_OVER_FOUR,l=.5*a/Math.tan(s)*r/o;return Math.ceil(l)}m$9.prototype._createOutlineCommand=function(e){var t=new r$r(this._dWidth,this._dHeight,this._dDepth),i=(this._zBounds.y-this._zBounds.x)/2,r=t$X.fromArray([0,0,i]),n=y$15.fromTranslation(r),o=new y$15;y$15.multiply(this._matLocalView,n,o);var a=new r$15({primitiveType:W$_.LINES,modelMatrix:o,boundingVolume:this._boundingSphere,pass:Le$p.OPAQUE,cull:!0,owner:e});a.vertexArray=t.getOutlineVertexArray(this._context),a.shaderProgram=S$T.fromCache({context:this._context,vertexShaderSource:He$7,fragmentShaderSource:Ye$4,attributeLocations:{aPosition:0}}),a.renderState=u$R.fromCache({cull:{enabled:!0},depthTest:{enabled:!0}}),e._outlineCommand=a,this._outlineCommand=a},m$9.prototype._createUniformMap=function(e){var t=this,i={width:function(){return t._nWidth},height:function(){return t._nHeight},depth:function(){return t._nDepth},sideBlockCount:function(){return t._nSideBlockCount},blockLength:function(){return t._nBlockLength},texLength:function(){return t._nLength},u_maxVisibleTextureCoord:function(){return t._visibleBoundingBox._maximum},u_minVisibleTextureCoord:function(){return t._visibleBoundingBox._minimum},u_minMaxValueAndFiltration:function(){return Mt.x=t._floor,Mt.y=t._ceil,Mt.z=e._minFiltration,Mt.w=e._maxFiltration,Mt},uVolumeTexture:function(){var i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):t._timeIndex;return t._volTextures[i]},uNextVolumeTexture:function(){var i=t._timeIndex+1;return t._timeIndex+1==t._timeDimension&&(i=t._timeIndex),i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):i,t._volTextures[i]},uTimeRatio:function(){return e._timeRatio},u_colorTable:function(){return e$28(e._hypsometricTexture)?e._hypsometricTexture:t._context.defaultTexture},u_volumeBoxSize:function(){return Zt.x=t._dWidth,Zt.y=t._dHeight,Zt.z=t._dDepth,Zt},uFilterMode:function(){return e._filterMode},u_opacityTexture:function(){return e$28(e._opacityTexture)?e._opacityTexture:t._context.defaultTexture},u_colorTexture:function(){return e$28(e._colorTexture)?e._colorTexture:t._context.defaultTexture},u_jitterTexture:function(){return e$28(t._jitterTexture)?t._jitterTexture:t._context.defaultTexture},u_gradientOpacityInfo:function(){if(e._useGradientOpacity){var t=e._gradientOpacityMinOpacity,i=e._gradientOpacityMaxOpacity,r=[e._gradientOpacityMinValue,e._gradientOpacityMaxValue],n=(i-t)/(r[1]-r[0]),o=-r[0]*(i-t)/(r[1]-r[0])+t;Nt$1.x=t,Nt$1.y=i,Nt$1.z=n,Nt$1.w=o}return Nt$1},u_clip_planes:function(){for(var t=e._clipPlanes.length,i=0;i<t;i++)It$2[i].x=e._clipPlanes[i].normal.x,It$2[i].y=e._clipPlanes[i].normal.y,It$2[i].z=e._clipPlanes[i].normal.z,It$2[i].w=e._clipPlanes[i].distance;return It$2},u_clip_planes_count:function(){return e._clipPlanes.length},uDiffuse:function(){return e.material.diffuse},uAmbient:function(){return e.material.ambient},uSpecular:function(){return e.material.specular},uShiness:function(){return e.material.shiness}},r={uOffset:function(){return new t$X(e._sliceCoordinate.x,0,0)}},n={uOffset:function(){return new t$X(0,e._sliceCoordinate.y,0)}},o={uOffset:function(){return new t$X(0,0,e._sliceCoordinate.z)}};if(e$28(this._xSliceCommand)&&(this._xSliceCommand.uniformMap=p$17(i,r),this._ySliceCommand.uniformMap=p$17(i,n),this._zSliceCommand.uniformMap=p$17(i,o)),e$28(this._volumeBoxCommand)){var a={u_camTexCoord:function(){var e,i,r=t.frameState.camera.positionCartographic;if(t._mode===P$$.COLUMBUS_VIEW){var n=t$W.toCartesian(r),o=m$1b.convertToColumbusCartesian(n);e=o.y,i=o.z}else e=e$27.toDegrees(r.longitude),i=e$27.toDegrees(r.latitude);var a=r.height,s=t.GetRealTop()-t._zBounds.x,l=t.GetRealBoundLeft(),u=t.GetRealBoundRight(),c=t.GetRealBoundBottom(),h=t.GetRealBoundTop();return Xt.x=(e-l)/(u-l),Xt.y=(i-c)/(h-c),Xt.z=(a-t._zBounds.x)/s,Xt},u_sampleDistance:function(){return t._layer._sampleDistance||.005}};this._volumeBoxCommand.uniformMap=p$17(i,a)}if(e$28(this._outlineCommand)){var s={uDiffuseColor:function(){return e._outlineColor}};this._outlineCommand.uniformMap=p$17(i,s)}},m$9.prototype._initJitterTexture=function(){if(!e$28(this._jitterTexture)){for(var e=new Uint8Array(1024),t=0;t<1024;++t)e[t]=255*Math.random();this._jitterTexture=new L$17({context:this._context,width:32,height:32,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.UNSIGNED_BYTE,flipY:!1}),this._jitterTexture.copyFrom({width:32,height:32,arrayBufferView:e})}},m$9.prototype._initialize=function(e,t,i){if(this.frameState=t,this._mode=t.mode,this._initialized){for(var r=this._volTextures.length,n=0;n<r;n++)this._volTextures[n].destroy();this._volTextures=[],e$28(this._volumeBoxCommand)&&($$3(this._volumeBoxCommand),this._volumeBoxCommand=void 0),e$28(this._outlineCommand)&&($$3(this._outlineCommand),this._outlineCommand=void 0),this._initialized=!1}this._initJitterTexture(),this._loadTexture(i),this._computePosition(),this._createVolumeBoxDrawCommand(e),this._createOutlineCommand(e),this._createSliceCommand(),this._createUniformMap(e),this._initialized=!0},m$9.prototype.update=function(e,t){if(this._mode=t.mode,(e._scaleDirty||e._sliceCoordDirty)&&(e._scaleDirty&&($$3(this._volumeBoxCommand),this._volumeBoxCommand=void 0),$$3(this._xSliceCommand),this._xSliceCommand=void 0,$$3(this._ySliceCommand),this._ySliceCommand=void 0,$$3(this._zSliceCommand),this._zSliceCommand=void 0,$$3(this._outlineCommand),this._outlineCommand=void 0,this._createVolumeBoxDrawCommand(e),this._createOutlineCommand(e),this._createSliceCommand(),this._createUniformMap(e),e._scaleDirty=!1,e._sliceCoordDirty=!1),e._contourValueDirty){if($$3(this._contourCommand),this._contourCommand=void 0,this.marchingCubes.contourValue=e.contourValue,e$28(this.output)){var i=this.marchingCubes.compute(this.output);this._createContourCommand(i.pBuffer,i.tBuffer,i.nBuffer)}e._contourValueDirty=!1}e._volumeRenderMode===gt$1.Slice?(e$28(this._xSliceCommand)&&t.commandList.push(this._xSliceCommand),e$28(this._ySliceCommand)&&t.commandList.push(this._ySliceCommand),e$28(this._zSliceCommand)&&t.commandList.push(this._zSliceCommand)):e._volumeRenderMode===gt$1.VolumeRendering?(e$28(this._volumeBoxCommand)&&e._fillStyle!==yt$3.WireFrame&&t.commandList.push(this._volumeBoxCommand),e$28(this._outlineCommand)&&e._fillStyle!==yt$3.Fill&&t.commandList.push(this._outlineCommand)):e._volumeRenderMode===gt$1.ContourValue&&e$28(this._contourCommand)&&t.commandList.push(this._contourCommand),this.updateTimeDimension(e)},m$9.prototype.updateTimeDimension=function(e){this._timeDimension>1?(e._timeIndexChange&&this._timeIndex++,this._timeIndex==this._timeDimension&&(this._timeIndex=0)):this._timeIndex=0},m$9.prototype._setDataBounds=function(e){this._dataBounds=e},m$9.prototype._useGradientOpacityChanged=function(e){e?this._appendProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"GRADIENT_OPACITY"):this._removeProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"GRADIENT_OPACITY")},m$9.prototype._enableLightingChange=function(e){e?(this._appendProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"APPLY_LIGHTING"),this._appendProgramDefineForCommand(this._contourCommand,!1,!0,"APPLY_LIGHTING")):(this._removeProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"APPLY_LIGHTING"),this._removeProgramDefineForCommand(this._contourCommand,!1,!0,"APPLY_LIGHTING"))},m$9.prototype._clipPlaneChanged=function(e){e._clipPlanes.length>0?this._appendProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"CLIP_PLANE"):this._removeProgramDefineForCommand(this._volumeBoxCommand,!1,!0,"CLIP_PLANE")},m$9.prototype._setZBounds=function(e){this._zBounds=e},m$9.prototype._appendProgramDefineForCommand=function(e,t,i,r){if(e$28(e)){var n=this._context,o=e.shaderProgram.fragmentShaderSource,a=e.shaderProgram.vertexShaderSource;t&&xe$1(a,r),i&&xe$1(o,r),e.shaderProgram.destroy(),e.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:this._attributeLocations})}},m$9.prototype._removeProgramDefineForCommand=function(e,t,i,r){if(e$28(e)){var n=this._context,o=e.shaderProgram.fragmentShaderSource,a=e.shaderProgram.vertexShaderSource;t&&Be$2(a,r),i&&Be$2(o,r),e.shaderProgram.destroy(),e.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:this._attributeLocations})}},m$9.prototype.isDestroyed=function(){return!1},m$9.prototype.destroy=function(){for(var e=this._volTextures.length,t=0;t<e;t++)this._volTextures[t].destroy();return e$28(this._volumeBoxCommand)&&($$3(this._volumeBoxCommand),this._volumeBoxCommand=void 0),e$28(this._outlineCommand)&&($$3(this._outlineCommand),this._outlineCommand=void 0),e$28(this._xSliceCommand)&&($$3(this._xSliceCommand),this._xSliceCommand=void 0),e$28(this._ySliceCommand)&&($$3(this._ySliceCommand),this._ySliceCommand=void 0),e$28(this._zSliceCommand)&&($$3(this._zSliceCommand),this._zSliceCommand=void 0),e$28(this._contourCommand)&&($$3(this._contourCommand),this._contourCommand=void 0),e$28(this._jitterTexture)&&this._jitterTexture.destroy(),this.output=void 0,this.marchingCubes=void 0,i$Z(this)},o$b.prototype=new m$9,o$b.prototype.constructor=o$b,o$b.prototype.parent=m$9.prototype,Object.defineProperties(o$b.prototype,{}),o$b.prototype._encodeImageData=function(e,t,i,r){for(var n=this._nLength*this._nLength*4,o=new Array(n),a=i-t,s=t,l=0;l<e.zDimSize;l++)for(var u=parseInt(l/this._nSideBlockCount)*this._nBlockLength,c=l%this._nSideBlockCount*this._nBlockLength,h=-1;h<this._nBlockLength-1;h++)for(var d=-1;d<this._nBlockLength-1;d++){var f=Math.min(d,e.xValidSize-1),p=Math.min(h,e.yValidSize-1);f=Math.max(0,f),p=Math.max(0,p);var _=l*e.yDimSize*e.xDimSize+(e.yValidSize-1-p)*e.xDimSize+f;if(!(_<0)){var m=r[_],$=new e$25(0,0,0,0);if(-9999!=m){m<t||m>i?m=s:s=m;var g=H$4(m=(m-t)/a);$.x=g.x,$.y=g.y,$.z=g.z,$.w=1}var v=255*$.x,y=255*$.y,x=255*$.z,b=255*$.w;o[4*(_=(u+h)*this._nLength+c+d)]=parseInt(v),o[4*_+1]=parseInt(y),o[4*_+2]=parseInt(x),o[4*_+3]=parseInt(b)}}return new Uint8Array(o,0,n)},o$b.prototype._loadVolume=function(e,t){this._maxValue=t.maxValue,this._minValue=t.minValue,this._timeDimension=t.time,this._ceil=t.maxValue,this._floor=t.minValue,this._nWidth=t.xValidSize,this._nHeight=t.yValidSize,this._nDepth=t.zValidSize;var i=e.slice(36,e.byteLength),r=4*t.xDimSize*t.yDimSize*t.zDimSize;this._nSideBlockCount=Math.ceil(Math.sqrt(t.zDimSize)),this._nBlockLength=Math.max(t.xDimSize,t.yDimSize)+2,this._nLength=G$7(this._nBlockLength*this._nSideBlockCount-2);t.xValidSize,t.yValidSize,t.zValidSize;for(var n=[],o=0;o<this._timeDimension;o++){var a=new Float32Array(i.slice(o*r,(o+1)*r));n.push(this._encodeImageData(t,t.minValue,t.maxValue,a))}return n},o$b.prototype.updateTimeDimension=function(e){this._isRootTile?this._timeDimension>1?(e._timeIndexChange&&this._timeIndex++,this._timeIndex==this._timeDimension&&(this._timeIndex=0)):this._timeIndex=0:this._timeIndex=this._rootTile._timeIndex},o$b.prototype._computePosition=function(){var e=this._mode,t=new t$X(.5*(this._dataBounds.west+this._dataBounds.east),.5*(this._dataBounds.north+this._dataBounds.south),this._zBounds.x);this._matLocalView=new y$15,this._matInverseLocalView=new y$15;var i=[];if(e===P$$.COLUMBUS_VIEW)this._vecCenter=new t$X(t.z,t.x,t.y),y$15.fromTranslation(this._vecCenter,this._matLocalView),y$15.inverse(this._matLocalView,this._matInverseLocalView),i[0]=new t$X(this._zBounds.x,this._dataBounds.west,this._dataBounds.south),i[1]=new t$X(this._zBounds.x,this._dataBounds.east,this._dataBounds.south),i[2]=new t$X(this._zBounds.x,this._dataBounds.east,this._dataBounds.north),i[3]=new t$X(this._zBounds.x,this._dataBounds.west,this._dataBounds.north),i[4]=new t$X(this._zBounds.y,this._dataBounds.west,this._dataBounds.south),i[5]=new t$X(this._zBounds.y,this._dataBounds.east,this._dataBounds.south),i[6]=new t$X(this._zBounds.y,this._dataBounds.east,this._dataBounds.north),i[7]=new t$X(this._zBounds.y,this._dataBounds.west,this._dataBounds.north);else{this._vecCenter=t$X.fromDegrees(t.x,t.y,t.z);var r=new i$10;m$1b.headingPitchRollToFixedFrame(this._vecCenter,r,t$V.WGS84,m$1b.eastNorthUpToFixedFrame,this._matLocalView),y$15.inverse(this._matLocalView,this._matInverseLocalView),i[0]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.south,this._zBounds.x),i[1]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.south,this._zBounds.x),i[2]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.north,this._zBounds.x),i[3]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.north,this._zBounds.x),i[4]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.south,this._zBounds.y),i[5]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.south,this._zBounds.y),i[6]=t$X.fromDegrees(this._dataBounds.east,this._dataBounds.north,this._zBounds.y),i[7]=t$X.fromDegrees(this._dataBounds.west,this._dataBounds.north,this._zBounds.y)}this._dWidth=t$X.distance(i[1],i[0]),this._dHeight=t$X.distance(i[3],i[0]),this._dDepth=t$X.distance(i[4],i[0]),this._orientedBoundingBox=x$13.fromPoints(i,this._orientedBoundingBox),this._boundingSphere=new i$19,y$15.multiplyByPoint(this._matLocalView,t$X.ZERO,this._boundingSphere.center),this._boundingSphere.radius=.5*Math.sqrt(this._dWidth*this._dWidth+this._dHeight*this._dHeight+this._dDepth*this._dDepth)},o$b.prototype.calcPixFromCam=function(e,t,i){if(this._boundingSphere){var r=e.positionWC,n=t$X.clone(this._boundingSphere.center),o=t$X.distance(n,r);e._mode==P$$.SCENE2D&&(o=e.positionCartographic.height),this._disFromCamera=o-this._boundingSphere.radius;var a;a=2*q$4(e,t,this._boundingSphere),this._isLessLodDis=a<=this._rangeList*i,this._pix=a}},o$b.prototype.load=function(e){var t,i,r=this._s3mLoadState,n=this;I$F.UNLOAD===r&&(n._s3mLoadState=I$F.LOADING,t=n._x<10?"000"+n._x:n._x<100?"00"+n._x:n._x<1e3?"0"+n._x:n._x,i=n._y<10?"000"+n._y:n._y<100?"00"+n._y:n._y<1e3?"0"+n._y:n._y,o$1q(o$$(e._url+"/"+n._level+"/"+i+"/"+t+"/"+i+"_"+t+".vol"),(function(e){n._s3mLoadState=I$F.LOADED,n._arrayBuffer=e})).otherwise((function(e){throw new DeveloperError("Not a valid NetCDF file!")})))};var C$6=new y$15;o$b.prototype._createUniformMap=function(e){this.parent._createUniformMap.call(this,e);var t=this,i={uMultiResolutionPara1:function(){return e$28(t._multiTextures[0])?t._multiTextures[0].multiResolutionPara:C$6},uMultiResolutionPara2:function(){return e$28(t._multiTextures[1])?t._multiTextures[1].multiResolutionPara:C$6},uMultiResolutionPara3:function(){return e$28(t._multiTextures[2])?t._multiTextures[2].multiResolutionPara:C$6},uVolumeTexture1:function(){var i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):t._timeIndex;return e$28(t._multiTextures[0])?t._multiTextures[0]._volTextures[i]:t._volTextures[i]},uNextVolumeTexture1:function(){var i=t._timeIndex+1;return t._timeIndex+1==t._timeDimension&&(i=t._timeIndex),i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):i,e$28(t._multiTextures[0])?t._multiTextures[0]._volTextures[i]:t._volTextures[i]},uVolumeTexture2:function(){var i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):t._timeIndex;return e$28(t._multiTextures[1])?t._multiTextures[1]._volTextures[i]:t._volTextures[i]},uNextVolumeTexture2:function(){var i=t._timeIndex+1;return t._timeIndex+1==t._timeDimension&&(i=t._timeIndex),i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):i,e$28(t._multiTextures[1])?t._multiTextures[1]._volTextures[i]:t._volTextures[i]},uVolumeTexture3:function(){var i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):t._timeIndex;return e$28(t._multiTextures[2])?t._multiTextures[2]._volTextures[i]:t._volTextures[i]},uNextVolumeTexture3:function(){var i=t._timeIndex+1;return t._timeIndex+1==t._timeDimension&&(i=t._timeIndex),i=e.frameIndex>0?Math.min(e.frameIndex,t._timeDimension-1):i,e$28(t._multiTextures[2])?t._multiTextures[2]._volTextures[i]:t._volTextures[i]}};e$28(this._xSliceCommand)&&(this._xSliceCommand.uniformMap=p$17(i,this._xSliceCommand.uniformMap),this._ySliceCommand.uniformMap=p$17(i,this._ySliceCommand.uniformMap),this._zSliceCommand.uniformMap=p$17(i,this._zSliceCommand.uniformMap)),e$28(this._volumeBoxCommand)&&(this._volumeBoxCommand.uniformMap=p$17(i,this._volumeBoxCommand.uniformMap)),e$28(this._outlineCommand)&&(this._outlineCommand.uniformMap=p$17(i,this._outlineCommand.uniformMap))},o$b.prototype._createShaderPreDefines=function(e,t){var i=this.parent._createShaderPreDefines.call(this,e,t);return i.push("MultiResolution"),i};var _0x2a8a68=(_0x21d7a7=!0,function(e,t){var i=_0x21d7a7?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x21d7a7=!1,i}),_0x1205d0=_0x2a8a68(void 0,(function(){return _0x1205d0.toString().search("(((.+)+)+)+$").toString().constructor(_0x1205d0).search("(((.+)+)+)+$")})),_0x21d7a7;function _0x5a3e2e(){this.model={clamping:!0,allowDuplicateScalars:!1,range:[0,0]},this.model.nodes=[]}_0x1205d0(),_0x5a3e2e.prototype.getSize=function(){return this.model.nodes.length},_0x5a3e2e.prototype.getType=function(){var e,t=0,i=0;this.model.nodes.length>0&&(t=this.model.nodes[0].y);for(var r=1;r<this.model.nodes.length;r++){if((e=this.model.nodes[r].y)!==t)if(e>t)switch(i){case 0:case 1:i=1;break;default:i=3}else switch(i){case 0:case 2:i=2;break;default:i=3}if(t=e,3===i)break}switch(i){case 0:return"Constant";case 1:return"NonDecreasing";case 2:return"NonIncreasing";default:return"Varied"}},_0x5a3e2e.prototype.getDataPointer=function(){var e=this.model.nodes.length;if(this.model.function=null,e>0){this.model.function=[];for(var t=0;t<e;t++)this.model.function[2*t]=this.model.nodes[t].x,this.model.function[2*t+1]=this.model.nodes[t].y}return this.model.function},_0x5a3e2e.prototype.getFirstNonZeroValue=function(){if(0===this.model.nodes.length)return 0;for(var e=1,t=0;t<this.model.nodes.length;t++)if(0!==this.model.nodes[t].y){e=0;break}return e?Number.MAX_VALUE:t>0?this.model.nodes[t-1].x:this.model.clamping?-Number.MAX_VALUE:this.model.nodes[0].x},_0x5a3e2e.prototype.getNodeValue=function(e,t){var i=this.model.nodes.length;return e<0||e>=i?-1:(t[0]=this.model.nodes[e].x,t[1]=this.model.nodes[e].y,t[2]=this.model.nodes[e].midpoint,t[3]=this.model.nodes[e].sharpness,1)},_0x5a3e2e.prototype.setNodeValue=function(e,t){var i=this.model.nodes.length;if(e<0||e>=i)return-1;var r=this.model.nodes[e].x;return this.model.nodes[e].x=t[0],this.model.nodes[e].y=t[1],this.model.nodes[e].midpoint=t[2],this.model.nodes[e].sharpness=t[3],r!==t[0]?this.sortAndUpdateRange():this.modified(),1},_0x5a3e2e.prototype.addPoint=function(e,t){this.addPointLong(e,t,.5,0)},_0x5a3e2e.prototype.addPointLong=function(e,t,i,r){if(i<0||i>1||r<0||r>1)return-1;this.model.allowDuplicateScalars||this.removePoint(e);var n,o={x:e,y:t,midpoint:i,sharpness:r};for(this.model.nodes.push(o),this.sortAndUpdateRange(),n=0;n<this.model.nodes.length&&this.model.nodes[n].x!==e;n++);return n<this.model.nodes.length?n:-1},_0x5a3e2e.prototype.setNodes=function(e){this.model.nodes!==e&&(this.model.nodes=e,this.sortAndUpdateRange())},_0x5a3e2e.prototype.getRange=function(){return this.model.range},_0x5a3e2e.prototype.updateRange=function(){var e=this.model.range.slice(),t=this.model.nodes.length;return t?(this.model.range[0]=this.model.nodes[0].x,this.model.range[1]=this.model.nodes[t-1].x):(this.model.range[0]=0,this.model.range[1]=0),(e[0]!==this.model.range[0]||e[1]!==this.model.range[1])&&(this.modified(),!0)},_0x5a3e2e.prototype.sortAndUpdateRange=function(e){this.model.nodes.sort((function(e,t){return e.x-t.x})),this.updateRange()||this.modified()},_0x5a3e2e.prototype.removePoint=function(e){var t;for(t=0;t<this.model.nodes.length&&this.model.nodes[t].x!==e;t++);if(t>=this.model.nodes.length)return-1;var i=t,r=!1;return this.model.nodes.splice(t,1),(0===t||t===this.model.nodes.length)&&(r=this.updateRange()),r||this.modified(),i},_0x5a3e2e.prototype.removeAllPoints=function(){this.model.nodes=[],this.sortAndUpdateRange()},_0x5a3e2e.prototype.addSegment=function(e,t,i,r){this.sortAndUpdateRange();for(var n=0;n<this.model.nodes.length;)this.model.nodes[n].x>=e&&this.model.nodes[n].x<=i?this.model.nodes.splice(n,1):n++;this.addPoint(e,t,.5,0),this.addPoint(i,r,.5,0)},_0x5a3e2e.prototype.getValue=function(e){var t=[];return this.getTable(e,e,1,t),t[0]},_0x5a3e2e.prototype.adjustRange=function(e){if(e.length<2)return 0;var t=this.getRange();t[0]<e[0]?this.addPoint(e[0],this.getValue(e[0])):this.addPoint(e[0],this.getValue(t[0])),t[1]>e[1]?this.addPoint(e[1],this.getValue(e[1])):this.addPoint(e[1],this.getValue(t[1])),this.sortAndUpdateRange();for(var i=0;i<this.model.nodes.length;)this.model.nodes[i].x>=e[0]&&this.model.nodes[i].x<=e[1]?this.model.nodes.splice(i,1):++i;return this.sortAndUpdateRange(),1},_0x5a3e2e.prototype.estimateMinNumberOfSamples=function(e,t){var i=this.findMinimumXDistance();return Math.ceil((t-e)/i)},_0x5a3e2e.prototype.findMinimumXDistance=function(){var e=this.model.nodes.length;if(e<2)return-1;for(var t=this.model.nodes[1].x-this.model.nodes[0].x,i=0;i<e-1;i++){var r=this.model.nodes[i+1].x-this.model.nodes[i].x;r<t&&(t=r)}return t},_0x5a3e2e.prototype.getTable=function(e,t,i,r,n){e$28(n)||(n=1);var o,a=0,s=this.model.nodes.length,l=0;0!==s&&(l=this.model.nodes[s-1].y);var u=0,c=0,h=0,d=0,f=0,p=0,_=0;for(o=0;o<i;o++){var m=n*o;for(u=i>1?e+o/(i-1)*(t-e):.5*(e+t);a<s&&u>this.model.nodes[a].x;)++a<s&&(c=this.model.nodes[a-1].x,h=this.model.nodes[a].x,d=this.model.nodes[a-1].y,f=this.model.nodes[a].y,p=this.model.nodes[a-1].midpoint,_=this.model.nodes[a-1].sharpness,p<1e-5&&(p=1e-5),p>.99999&&(p=.99999));if(a>=s)r[m]=this.model.clamping?l:0;else if(0===a)r[m]=this.model.clamping?this.model.nodes[0].y:0;else{var $=(u-c)/(h-c);if($=$<p?.5*$/p:.5+.5*($-p)/(1-p),_>.99){if($<.5){r[m]=d;continue}r[m]=f;continue}if(_<.01){r[m]=(1-$)*d+$*f;continue}$<.5?$=.5*(2*$)**(1+10*_):$>.5&&($=1-.5*(2*(1-$))**(1+10*_));var g=$*$,v=g*$,y=2*v-3*g+1,x=-2*v+3*g,b=v-2*g+$,w=v-g,C=(1-_)*(f-d);r[m]=y*d+x*f+b*C+w*C;var T=d<f?d:f,S=d>f?d:f;r[m]=r[m]<T?T:r[m],r[m]=r[m]>S?S:r[m]}}},_0x5a3e2e.prototype.modified=function(){},_0x5a3e2e.clone=function(e,t){if(e$28(e)){var i;for(e$28(t)||(t=new _0x5a3e2e),i=0;i<e.model.nodes.length;i++){var r=e.model.nodes[i];t.model.nodes.push({x:r.x,y:r.y,midpoint:r.midpoint,sharpness:r.sharpness})}return t.sortAndUpdateRange(),t}};var _0x1ac147=(_0x23661d=!0,function(e,t){var i=_0x23661d?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x23661d=!1,i}),_0x1c1ad3=_0x1ac147(void 0,(function(){return _0x1c1ad3.toString().search("(((.+)+)+)+$").toString().constructor(_0x1c1ad3).search("(((.+)+)+)+$")})),_0x23661d;_0x1c1ad3();var _0xaf7c2a={RGB:0,HSV:1,LAB:2,DIVERGING:3},_0x480603={LINEAR:0,LOG10:1};function _0x39067d(e,t){var i=e[0],r=e[1],n=e[2],o=Math.sqrt(i*i+r*r+n*n),a=o>.001?Math.acos(i/o):0,s=a>.001?Math.atan2(n,r):0;t[0]=o,t[1]=a,t[2]=s}function _0x578cf7(e,t){var i=e[0],r=e[1],n=e[2];t[0]=i*Math.cos(r),t[1]=i*Math.sin(r)*Math.cos(n),t[2]=i*Math.sin(r)*Math.sin(n)}function _0xf69b40(e,t){if(e[0]>=t-.1)return e[2];var i=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+i:e[2]-i}function _0x447976(e,t){var i=e-t;for(i<0&&(i=-i);i>=2*Math.PI;)i-=2*Math.PI;return i>Math.PI&&(i=2*Math.PI-i),i}function _0x4e6ffa(e,t,i,r){var n=[],o=[];_0x59be53(t,n),_0x59be53(i,o);var a=[],s=[];_0x39067d(n,a),_0x39067d(o,s);var l=e;if(a[1]>.05&&s[1]>.05&&_0x447976(a[2],s[2])>.33*Math.PI){var u=Math.max(a[0],s[0]);u=Math.max(88,u),e<.5?(s[0]=u,s[1]=0,s[2]=0,l*=2):(a[0]=u,a[1]=0,a[2]=0,l=2*l-1)}a[1]<.05&&s[1]>.05?a[2]=_0xf69b40(s,a[0]):s[1]<.05&&a[1]>.05&&(s[2]=_0xf69b40(a,s[0]));var c=[];c[0]=(1-l)*a[0]+l*s[0],c[1]=(1-l)*a[1]+l*s[1],c[2]=(1-l)*a[2]+l*s[2];var h=[];_0x578cf7(c,h),_0x267392(h,r)}function _0xc6c4b6(){this.model={clamping:!0,colorSpace:_0xaf7c2a.RGB,hSVWrap:!0,scale:_0x480603.LINEAR,nanColor:null,belowRangeColor:null,aboveRangeColor:null,useAboveRangeColor:!1,useBelowRangeColor:!1,allowDuplicateScalars:!1,table:null,tableSize:0,buildTime:null,nodes:null,discretize:!1,numberOfValues:256,range:[0,1],mappingRange:[0,1]},this.model.table=[],this.model.nodes=[],this.model.nanColor=[.5,0,0,1],this.model.belowRangeColor=[0,0,0,1],this.model.aboveRangeColor=[1,1,1,1],this.model.buildTime={}}function _0x98cd1f(e,t){var i,r,n=e[0],o=e[1],a=e[2],s=1/6,l=n,u=n;o>l?l=o:o<u&&(u=o),a>l?l=a:a<u&&(u=a);const c=l;(r=c>0?(l-u)/l:0)>0?(i=n===l?s*(o-a)/(l-u):o===l?1/3+s*(a-n)/(l-u):2/3+s*(n-o)/(l-u))<0&&(i+=1):i=0,t[0]=i,t[1]=r,t[2]=c}function _0x424aac(e,t){var i,r,n,o=e[0],a=e[1],s=e[2],l=1/3,u=1/6,c=2/3,h=5/6;o>u&&o<=l?(r=1,i=(l-o)/u,n=0):o>l&&o<=.5?(r=1,n=(o-l)/u,i=0):o>.5&&o<=c?(n=1,r=(c-o)/u,i=0):o>c&&o<=h?(n=1,i=(o-c)/u,r=0):o>h&&o<=1?(i=1,n=(1-o)/u,r=0):(i=1,r=o/u,n=0),i=a*i+(1-a),r=a*r+(1-a),n=a*n+(1-a),i*=s,r*=s,n*=s,t[0]=i,t[1]=r,t[2]=n}function _0x1e8169(e,t){var i=(e[0]+16)/116,r=e[1]/500+i,n=i-e[2]/200;i**3>.008856?i**=3:i=(i-16/116)/7.787,r**3>.008856?r**=3:r=(r-16/116)/7.787,n**3>.008856?n**=3:n=(n-16/116)/7.787;t[0]=.9505*r,t[1]=1*i,t[2]=1.089*n}function _0x24aaf8(e,t){var i=e[0]/.9505,r=e[1]/1,n=e[2]/1.089;i>.008856?i**=1/3:i=7.787*i+16/116,r>.008856?r**=1/3:r=7.787*r+16/116,n>.008856?n**=1/3:n=7.787*n+16/116,t[0]=116*r-16,t[1]=500*(i-r),t[2]=200*(r-n)}function _0x7de595(e,t){var i=e[0],r=e[1],n=e[2],o=3.2406*i+-1.5372*r+-.4986*n,a=-.9689*i+1.8758*r+.0415*n,s=.0557*i+-.204*r+1.057*n;o>.0031308?o=1.055*o**(1/2.4)-.055:o*=12.92,a>.0031308?a=1.055*a**(1/2.4)-.055:a*=12.92,s>.0031308?s=1.055*s**(1/2.4)-.055:s*=12.92;var l=o;l<a&&(l=a),l<s&&(l=s),l>1&&(o/=l,a/=l,s/=l),o<0&&(o=0),a<0&&(a=0),s<0&&(s=0),t[0]=o,t[1]=a,t[2]=s}function _0x5832c9(e,t){var i=e[0],r=e[1],n=e[2];i>.04045?i=((i+.055)/1.055)**2.4:i/=12.92,r>.04045?r=((r+.055)/1.055)**2.4:r/=12.92,n>.04045?n=((n+.055)/1.055)**2.4:n/=12.92,t[0]=.4124*i+.3576*r+.1805*n,t[1]=.2126*i+.7152*r+.0722*n,t[2]=.0193*i+.1192*r+.9505*n}function _0x59be53(e,t){var i=[0,0,0];_0x5832c9(e,i),_0x24aaf8(i,t)}function _0x267392(e,t){var i=[0,0,0];_0x1e8169(e,i),_0x7de595(i,t)}function g$9(e){o$1u.defined("context",e),this._context=e,this._NetCDFData=void 0,this._NetCDFInfo=void 0,this._NetCDFBuffer=void 0,this._dictColorTable=void 0,this._hasColorTable=0,this._hypsometricTexture=void 0,this._filterMode=k$T.FilterMode.LINEAR,this._volumeRenderMode=gt$1.VolumeRendering,this._scale=new t$X(1,1,1),this._scaleDirty=!1,this._sliceCoordDirty=!1,this._transparency=0,this._sliceCoordinate=new t$X(.5,.5,.5),this._floor=Number.MAX_VALUE,this._ceil=Number.MIN_VALUE,this._maxFiltration=Number.MAX_VALUE,this._minFiltration=Number.MIN_VALUE,this._visible=!0,this._type="VoxelGridLayer3D",this._name=void 0,this._url=void 0,this._voxelGridTile=void 0,this._zBounds=void 0,this._layerBounds=void 0,this._version=1,this._width=0,this._height=0,this._depth=0,this._time=0,this._cellWidth=0,this._cellHeight=0,this._cellDepth=0,this._cellTime=0,this._levels=0,this._availableNode=void 0,this._volumeBuffer=void 0,this._multiTextures=[],this._textureLevelLoaded=!0,this._period=500,this._prevTime=0,this._timeRatio=0,this._timeIndexChange=!1,this._duration=1,this._startRender=!1,this._frameIndex=-1,this._useGradientOpacity=!1,this._gradientOpacityMinOpacity=0,this._gradientOpacityMaxOpacity=1,this._gradientOpacityMinValue=0,this._gradientOpacityMaxValue=1,this._clipPlanes=[],this._contourValue=0,this._contourValueDirty=!1,this._enableLighting=!1,this._material={diffuse:new e$1S(.9,.9,.9),specular:new e$1S(.2,.2,.2),ambient:new e$1S(.1,.1,.1),shiness:10},this._fillStyle=yt$3.Fill,this._outlineColor=new e$1S(1,1,1,1)}_0xc6c4b6.clone=function(e,t){if(e$28(e)){var i;for(e$28(t)||(t=new _0xc6c4b6),i=0;i<e.model.nodes.length;i++){var r=e.model.nodes[i];t.model.nodes.push({x:r.x,r:r.r,g:r.g,b:r.b,midpoint:r.midpoint,sharpness:r.sharpness})}return t.sortAndUpdateRange(),t.model.mappingRange[0]=e.model.mappingRange[0],t.model.mappingRange[1]=e.model.mappingRange[1],t}},_0xc6c4b6.prototype.getSize=function(){return this.model.nodes.length},_0xc6c4b6.prototype.addRGBPoint=function(e,t,i,r){this.addRGBPointLong(e,t,i,r,.5,0)},_0xc6c4b6.prototype.addRGBPointLong=function(e,t,i,r,n,o){var a=u$Y(n,.5),s=u$Y(o,0);if(a<0||a>1||s<0||s>1)return-1;this.model.allowDuplicateScalars||this.removePoint(e);var l={x:e,r:t,g:i,b:r,midpoint:a,sharpness:s};this.model.nodes.push(l),this.sortAndUpdateRange();for(var u=0;u<this.model.nodes.length&&this.model.nodes[u].x!==e;u++);return u<this.model.nodes.length?u:-1},_0xc6c4b6.prototype.addHSVPoint=function(e,t,i,r){this.addHSVPointLong(e,t,i,r,.5,0)},_0xc6c4b6.prototype.addHSVPointLong=function(e,t,i,r,n,o){var a=u$Y(n,.5),s=u$Y(o,0),l=[];return _0x424aac([t,i,r],l),this.addRGBPoint(e,l[0],l[1],l[2],a,s)},_0xc6c4b6.prototype.setNodes=function(e){this.model.nodes!==e&&(this.model.nodes=e,this.sortAndUpdateRange())},_0xc6c4b6.prototype.sortAndUpdateRange=function(){this.model.nodes.sort((function(e,t){return e.x-t.x})),this.updateRange()||this.modified()},_0xc6c4b6.prototype.getRange=function(){return this.model.mappingRange},_0xc6c4b6.prototype.updateRange=function(){var e=[2];e[0]=this.model.mappingRange[0],e[1]=this.model.mappingRange[1];var t=this.model.nodes.length;return t?(this.model.mappingRange[0]=this.model.nodes[0].x,this.model.mappingRange[1]=this.model.nodes[t-1].x):(this.model.mappingRange[0]=0,this.model.mappingRange[1]=0),(e[0]!==this.model.mappingRange[0]||e[1]!==this.model.mappingRange[1])&&(this.modified(),!0)},_0xc6c4b6.prototype.removePoint=function(e){for(var t=0;t<this.model.nodes.length&&this.model.nodes[t].x!==e;t++);var i=t;if(t>=this.model.nodes.length)return-1;var r=!1;return this.model.nodes.splice(t,1),(0===t||t===this.model.nodes.length)&&(r=this.updateRange()),r||this.modified(),i},_0xc6c4b6.prototype.movePoint=function(e,t){if(e!==t){this.removePoint(t);for(var i=0;i<this.model.nodes.length;i++)if(this.model.nodes[i].x===e){this.model.nodes[i].x=t,this.sortAndUpdateRange();break}}},_0xc6c4b6.prototype.removeAllPoints=function(){this.model.nodes=[],this.sortAndUpdateRange()},_0xc6c4b6.prototype.addRGBSegment=function(e,t,i,r,n,o,a,s){this.sortAndUpdateRange();for(var l=0;l<this.model.nodes.length;)this.model.nodes[l].x>=e&&this.model.nodes[l].x<=n?this.model.nodes.splice(l,1):l++;this.addRGBPointLong(e,t,i,r,.5,0),this.addRGBPointLong(n,o,a,s,.5,0),this.modified()},_0xc6c4b6.prototype.addHSVSegment=function(e,t,i,r,n,o,a,s){var l=[o,a,s],u=[],c=[];_0x424aac([t,i,r],u),_0x424aac(l,c),this.addRGBSegment(e,u[0],u[1],u[2],n,c[0],c[1],c[2])},_0xc6c4b6.prototype.mapValue=function(e){var t=[];return this.getColor(e,t),[Math.floor(255*t[0]+.5),Math.floor(255*t[1]+.5),Math.floor(255*t[2]+.5),255]},_0xc6c4b6.prototype.getColor=function(e,t){if(this.model.indexedLookup){var i=this.getSize(),r=this.getAnnotatedValueIndexInternal(e);if(r<0||0===i)this.getNanColor(t);else{var n=[];this.getNodeValue(r%i,n),t[0]=n.r,t[1]=n.g,t[2]=n.b}}else this.getTable(e,e,1,t)},_0xc6c4b6.prototype.getRedValue=function(e){var t=[];return this.getColor(e,t),t[0]},_0xc6c4b6.prototype.getGreenValue=function(e){var t=[];return this.getColor(e,t),t[1]},_0xc6c4b6.prototype.getBlueValue=function(e){var t=[];return this.getColor(e,t),t[2]},_0xc6c4b6.prototype.getTable=function(e,t,i,r){if(isNaN(e)||isNaN(t))for(var n=0;n<i;n++)r[3*n+0]=this.model.nanColor[0],r[3*n+1]=this.model.nanColor[1],r[3*n+2]=this.model.nanColor[2];else{var o=0,a=this.model.nodes.length,s=0,l=0,u=0;0!==a&&(s=this.model.nodes[a-1].r,l=this.model.nodes[a-1].g,u=this.model.nodes[a-1].b);var c=0,h=0,d=0,f=[0,0,0],p=[0,0,0],_=0,m=0,$=[],g=this.model.scale===_0x480603.LOG10;g&&(g=this.model.mappingRange[0]>0);var v=0,y=0,x=0;g&&(v=Math.log10(e),y=Math.log10(t));for(n=0;n<i;n++){var b=3*n;if(i>1?g?c=10**(x=v+n/(i-1)*(y-v)):c=e+n/(i-1)*(t-e):g?c=10**(x=.5*(v+y)):c=.5*(e+t),this.model.discretize){var w=this.model.mappingRange;if(c>=w[0]&&c<=w[1]){var C=this.model.numberOfValues,T=w[1]-w[0];if(C<=1)c=w[0]+T/2;else{var S=(c-w[0])/T,E=Math.floor(C*S);c=w[0]+E/(C-1)*T}}}for(;o<a&&c>this.model.nodes[o].x;)++o<a&&(h=this.model.nodes[o-1].x,d=this.model.nodes[o].x,g&&(h=Math.log10(h),d=Math.log10(d)),f[0]=this.model.nodes[o-1].r,p[0]=this.model.nodes[o].r,f[1]=this.model.nodes[o-1].g,p[1]=this.model.nodes[o].g,f[2]=this.model.nodes[o-1].b,p[2]=this.model.nodes[o].b,_=this.model.nodes[o-1].midpoint,m=this.model.nodes[o-1].sharpness,_<1e-5&&(_=1e-5),_>.99999&&(_=.99999));if(c>this.model.mappingRange[1])r[b]=0,r[b+1]=0,r[b+2]=0,this.model.clamping&&(this.getUseAboveRangeColor()?(r[b]=this.model.aboveRangeColor[0],r[b+1]=this.model.aboveRangeColor[1],r[b+2]=this.model.aboveRangeColor[2]):(r[b]=s,r[b+1]=l,r[b+2]=u));else if(c<this.model.mappingRange[0]||!Number.isFinite(c)&&c<0)r[b]=0,r[b+1]=0,r[b+2]=0,this.model.clamping&&(this.getUseBelowRangeColor()?(r[b]=this.model.belowRangeColor[0],r[b+1]=this.model.belowRangeColor[1],r[b+2]=this.model.belowRangeColor[2]):a>0&&(r[b]=this.model.nodes[0].r,r[b+1]=this.model.nodes[0].g,r[b+2]=this.model.nodes[0].b));else if(0===o&&(Math.abs(c-e)<1e-6||this.model.discretize))a>0?(r[b]=this.model.nodes[0].r,r[b+1]=this.model.nodes[0].g,r[b+2]=this.model.nodes[0].b):(r[b]=0,r[b+1]=0,r[b+2]=0);else{var A=0;if(A=(A=g?(x-h)/(d-h):(c-h)/(d-h))<_?.5*A/_:.5+.5*(A-_)/(1-_),m>.99){if(A<.5){r[b]=f[0],r[b+1]=f[1],r[b+2]=f[2];continue}r[b]=p[0],r[b+1]=p[1],r[b+2]=p[2];continue}if(m<.01){if(this.model.colorSpace===_0xaf7c2a.RGB)r[b]=(1-A)*f[0]+A*p[0],r[b+1]=(1-A)*f[1]+A*p[1],r[b+2]=(1-A)*f[2]+A*p[2];else if(this.model.colorSpace===_0xaf7c2a.HSV){var P=[];_0x98cd1f(f,z=[]),_0x98cd1f(p,P),this.model.hSVWrap&&(z[0]-P[0]>.5||P[0]-z[0]>.5)&&(z[0]>P[0]?z[0]-=1:P[0]-=1),(k=[])[0]=(1-A)*z[0]+A*P[0],k[0]<0&&(k[0]+=1),k[1]=(1-A)*z[1]+A*P[1],k[2]=(1-A)*z[2]+A*P[2],_0x424aac(k,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]}else if(this.model.colorSpace===_0xaf7c2a.LAB){var I=[];_0x59be53(f,V=[]),_0x59be53(p,I),(U=[])[0]=(1-A)*V[0]+A*I[0],U[1]=(1-A)*V[1]+A*I[1],U[2]=(1-A)*V[2]+A*I[2],_0x267392(U,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]}else this.model.colorSpace===_0xaf7c2a.DIVERGING&&(_0x4e6ffa(A,f,p,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]);continue}A<.5?A=.5*(2*A)**(1+10*m):A>.5&&(A=1-.5*(2*(1-A))**(1+10*m));var M,O=A*A,D=O*A,R=2*D-3*O+1,L=-2*D+3*O,B=D-2*O+A,N=D-O;if(this.model.colorSpace===_0xaf7c2a.RGB)for(var F=0;F<3;F++)M=(1-m)*(p[F]-f[F]),r[b+F]=R*f[F]+L*p[F]+B*M+N*M;else if(this.model.colorSpace===_0xaf7c2a.HSV){var z;P=[];_0x98cd1f(f,z=[]),_0x98cd1f(p,P),this.model.hSVWrap&&(z[0]-P[0]>.5||P[0]-z[0]>.5)&&(z[0]>P[0]?z[0]-=1:P[0]-=1);var k=[];for(F=0;F<3;F++)M=(1-m)*(P[F]-z[F]),k[F]=R*z[F]+L*P[F]+B*M+N*M,0===F&&k[F]<0&&(k[F]+=1);_0x424aac(k,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]}else if(this.model.colorSpace===_0xaf7c2a.LAB){var V;I=[];_0x59be53(f,V=[]),_0x59be53(p,I);var U=[];for(F=0;F<3;F++)M=(1-m)*(I[F]-V[F]),U[F]=R*V[F]+L*I[F]+B*M+N*M;_0x267392(U,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]}else this.model.colorSpace===_0xaf7c2a.DIVERGING&&(_0x4e6ffa(A,f,p,$),r[b]=$[0],r[b+1]=$[1],r[b+2]=$[2]);for(F=0;F<3;F++)r[b+F]=r[b+F]<0?0:r[b+F],r[b+F]=r[b+F]>1?1:r[b+F]}}}},_0xc6c4b6.prototype.getUint8Table=function(e,t,i,r){if(r=u$Y(r,!1),this.model.tableSize===i&&this.model.tableWithAlpha!==r)return this.model.table;if(0===this.model.nodes.length)return this.model.table;var n=r?4:3;(this.model.tableSize!==i||this.model.tableWithAlpha!==r)&&(this.model.table=new Uint8Array(i*n),this.model.tableSize=i,this.model.tableWithAlpha=r);var o=[];this.getTable(e,t,i,o);for(var a=0;a<i;a++)this.model.table[a*n+0]=Math.floor(255*o[3*a+0]+.5),this.model.table[a*n+1]=Math.floor(255*o[3*a+1]+.5),this.model.table[a*n+2]=Math.floor(255*o[3*a+2]+.5),r&&(this.model.table[a*n+3]=255);return this.model.buildTime.modified(),this.model.table},_0xc6c4b6.prototype.buildFunctionFromTable=function(e,t,i,r){var n=0;this.removeAllPoints(),i>1&&(n=(t-e)/(i-1));for(var o=0;o<i;o++){var a={x:e+n*o,r:r[3*o],g:r[3*o+1],b:r[3*o+2],sharpness:0,midpoint:.5};this.model.nodes.push(a)}this.sortAndUpdateRange()},_0xc6c4b6.prototype.getNodeValue=function(e,t){return e<0||e>=this.model.nodes.length?-1:(t[0]=this.model.nodes[e].x,t[1]=this.model.nodes[e].r,t[2]=this.model.nodes[e].g,t[3]=this.model.nodes[e].b,t[4]=this.model.nodes[e].midpoint,t[5]=this.model.nodes[e].sharpness,1)},_0xc6c4b6.prototype.setNodeValue=function(e,t){if(e<0||e>=this.model.nodes.length)return-1;var i=this.model.nodes[e].x;return this.model.nodes[e].x=t[0],this.model.nodes[e].r=t[1],this.model.nodes[e].g=t[2],this.model.nodes[e].b=t[3],this.model.nodes[e].midpoint=t[4],this.model.nodes[e].sharpness=t[5],i!==t[0]?this.sortAndUpdateRange():this.modified(),1},_0xc6c4b6.prototype.getNumberOfAvailableColors=function(){return this.model.indexedLookup&&this.getSize()?this.getSize():this.model.tableSize?this.model.tableSize:16777216},_0xc6c4b6.prototype.getIndexedColor=function(e,t){var i=this.getSize();if(i>0&&e>=0){var r=[];this.getNodeValue(e%i,r);for(var n=0;n<3;++n)t[n]=r[n+1];t[3]=1}else this.getNanColor(t),t[3]=1},_0xc6c4b6.prototype.fillFromDataPointer=function(e,t){if(!(e<=0)&&t){this.removeAllPoints();for(var i=0;i<e;i++)this.addRGBPoint(t[4*i],t[4*i+1],t[4*i+2],t[4*i+3])}},_0xc6c4b6.prototype.setMappingRange=function(e,t){var i=[e,t],r=this.getRange();if((r[1]!==i[1]||r[0]!==i[0])&&i[1]!==i[0]){for(var n=(i[1]-i[0])/(r[1]-r[0]),o=i[0]-r[0]*n,a=0;a<this.model.nodes.length;++a)this.model.nodes[a].x=this.model.nodes[a].x*n+o;this.model.mappingRange[0]=i[0],this.model.mappingRange[1]=i[1],this.modified()}},_0xc6c4b6.prototype.adjustRange=function(e){var t=this.getRange(),i=[];t[0]<e[0]?(this.getColor(e[0],i),this.addRGBPoint(e[0],i[0],i[1],i[2])):(this.getColor(t[0],i),this.addRGBPoint(e[0],i[0],i[1],i[2])),t[1]>e[1]?(this.getColor(e[1],i),this.addRGBPoint(e[1],i[0],i[1],i[2])):(this.getColor(t[1],i),this.addRGBPoint(e[1],i[0],i[1],i[2])),this.sortAndUpdateRange();for(var r=0;r<this.model.nodes.length;)this.model.nodes[r].x>=e[0]&&this.model.nodes[r].x<=e[1]?this.model.nodes.splice(r,1):++r;return 1},_0xc6c4b6.prototype.estimateMinNumberOfSamples=function(e,t){var i=this.findMinimumXDistance();return Math.ceil((t-e)/i)},_0xc6c4b6.prototype.findMinimumXDistance=function(){if(this.model.nodes.length<2)return-1;for(var e=Number.MAX_VALUE,t=0;t<this.model.nodes.length-1;t++){var i=this.model.nodes[t+1].x-this.model.nodes[t].x;i<e&&(e=i)}return e},_0xc6c4b6.prototype.mapScalarsThroughTable=function(e,t,i,r){0!==this.getSize()&&(this.model.indexedLookup?this.mapDataIndexed(e,t,i,r):this.mapData(e,t,i,r))},_0xc6c4b6.prototype.mapData=function(e,t,i,r){if(0!==this.getSize()){var n=Math.floor(255*this.getAlpha()+.5),o=e.getNumberOfTuples(),a=e.getNumberOfComponents(),s=t.getData(),l=e.getData(),u=[];if(i===ScalarMappingTarget.RGBA)for(var c=0;c<o;c++){var h=l[c*a+r];this.getColor(h,u),s[4*c]=Math.floor(255*u[0]+.5),s[4*c+1]=Math.floor(255*u[1]+.5),s[4*c+2]=Math.floor(255*u[2]+.5),s[4*c+3]=n}if(i===ScalarMappingTarget.RGB)for(c=0;c<o;c++){h=l[c*a+r];this.getColor(h,u),s[3*c]=Math.floor(255*u[0]+.5),s[3*c+1]=Math.floor(255*u[1]+.5),s[3*c+2]=Math.floor(255*u[2]+.5)}if(i===ScalarMappingTarget.LUMINANCE)for(c=0;c<o;c++){h=l[c*a+r];this.getColor(h,u),s[c]=Math.floor(76.5*u[0]+150.45*u[1]+28.05*u[2]+.5)}if(i===ScalarMappingTarget.LUMINANCE_ALPHA)for(c=0;c<o;c++){h=l[c*a+r];this.getColor(h,u),s[2*c]=Math.floor(76.5*u[0]+150.45*u[1]+28.05*u[2]+.5),s[2*c+1]=n}}},_0xc6c4b6.prototype.applyColorMap=function(e){if(e.ColorSpace&&(this.model.colorSpace=_0xaf7c2a[e.ColorSpace.toUpperCase()],void 0===this.model.colorSpace&&(this.model.colorSpace=_0xaf7c2a.RGB)),e.NanColor)for(this.model.nanColor=[].concat(e.NanColor);this.model.nanColor.length<4;)this.model.nanColor.push(1);if(e.RGBPoints){var t=e.RGBPoints.length;this.model.nodes=[];for(var i=0;i<t;i+=4)this.model.nodes.push({x:e.RGBPoints[i],r:e.RGBPoints[i+1],g:e.RGBPoints[i+2],b:e.RGBPoints[i+3],midpoint:.5,sharpness:0})}this.sortAndUpdateRange()},_0xc6c4b6.prototype.modified=function(){},Object.defineProperties(g$9.prototype,{visible:{get:function(){return this._visible},set:function(e){this._visible=e}},type:{get:function(){return this._type}},layerBounds:{get:function(){return this._layerBounds},set:function(e){this._layerBounds=e}},zBounds:{get:function(){return this._zBounds},set:function(e){this._zBounds=e}},name:{get:function(){return this._name}},NetCDFInfo:{get:function(){return this._NetCDFInfo}},maxFiltration:{get:function(){return this._maxFiltration},set:function(e){this._maxFiltration=e}},minFiltration:{get:function(){return this._minFiltration},set:function(e){this._minFiltration=e}},duration:{get:function(){return this._duration},set:function(e){o$1u.typeOf.number.greaterThan("duration",e,0),o$1u.typeOf.number.greaterThan("this._time",this._time,0),this._duration=e,this._period=1e3*this._duration/this._time}},opaqueRate:{get:function(){return this._transparency},set:function(e){this._transparency!==e&&(this._transparency=e)}},filterMode:{get:function(){return this._filterMode},set:function(e){this._filterMode!==e&&(this._filterMode=e)}},maxValue:{get:function(){return this._voxelGridTile.maxValue}},minValue:{get:function(){return this._voxelGridTile.minValue}},visibleBoundingBox:{get:function(){return this._voxelGridTile.visibleBoundingBox},set:function(e){this._voxelGridTile.visibleBoundingBox=e}},scale:{get:function(){return this._scale},set:function(e){t$X.equals(e,this._scale)||(this._scale=t$X.clone(e,this._scale),this._scaleDirty=!0)}},volumeRenderMode:{get:function(){return this._volumeRenderMode},set:function(e){this._volumeRenderMode=e}},sliceCoordinate:{get:function(){return this._sliceCoordinate},set:function(e){this._sliceCoordinate=e,this._sliceCoordDirty=!0}},frameIndex:{get:function(){return this._frameIndex},set:function(e){"number"!=typeof e||isNaN(e)||(this._frameIndex=e)}},colorTable:{get:function(){return this._dictColorTable},set:function(e){if(!e$28(e))return e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null),void(this._hasColorTable=0);this._dictColorTable=i$O.clone(e,this._dictColorTable),this._dictColorTable.count()<1?this._hasColorTable=0:(this._dictColorTable.generateBuffer(),e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:this._context,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1})),this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._dictColorTable._imageBuffer}),this._hasColorTable=1)}},colorTransferFunction:{get:function(){return this._colorTransferFunction},set:function(e){if(e$28(e)){this._colorTransferFunction=_0xc6c4b6.clone(e,this._colorTransferFunction);for(var t=1024,i=new Uint8Array(6144),r=new Float32Array(3*t),n=0;n<1;++n){var o=e.getRange();e.getTable(o[0],o[1],t,r,1);for(var a=0;a<3*t;++a)i[n*t*6+a]=255*r[a],i[n*t*6+a+3*t]=255*r[a]}e$28(this._colorTexture)||(this._colorTexture=new L$17({context:this._context,width:t,height:2,pixelFormat:V$O.RGB,pixelDatatype:y$U.UNSIGNED_BYTE,flipY:!1})),this._colorTexture.copyFrom({width:t,height:2,arrayBufferView:i})}else e$28(this._colorTransferFunction)&&(this._colorTransferFunction.destroy(),this._colorTransferFunction=null)}},opacityTransferFunction:{get:function(){return this._opacityTransferFunction},set:function(e){if(e$28(e)){this._opacityTransferFunction=_0x5a3e2e.clone(e,this._opacityTransferFunction);for(var t=1024,i=new Float32Array(2048),r=new Float32Array(t),n=0;n<1;++n){var o=e.getRange();e.getTable(o[0],o[1],t,r,1);for(var a=0;a<t;++a)i[n*t*2+a]=1-(1-r[a]),i[n*t*2+a+t]=i[n*t*2+a]}e$28(this._opacityTexture)||(this._opacityTexture=new L$17({context:this._context,width:t,height:2,pixelFormat:V$O.LUMINANCE,pixelDatatype:y$U.FLOAT,flipY:!1})),this._opacityTexture.copyFrom({width:t,height:2,arrayBufferView:i})}else e$28(this._opacityTransferFunction)&&(this._opacityTransferFunction.destroy(),this._opacityTransferFunction=null)}},useGradientOpacity:{get:function(){return this._useGradientOpacity},set:function(e){e$28(this._voxelGridTile)&&e!=this._useGradientOpacity&&this._voxelGridTile._useGradientOpacityChanged(e),this._useGradientOpacity=e}},gradientOpacityMinOpacity:{get:function(){return this._gradientOpacityMinOpacity},set:function(e){this._gradientOpacityMinOpacity=e}},gradientOpacityMaxOpacity:{get:function(){return this._gradientOpacityMaxOpacity},set:function(e){this._gradientOpacityMaxOpacity=e}},gradientOpacityMinValue:{get:function(){return this._gradientOpacityMinValue},set:function(e){this._gradientOpacityMinValue=e}},gradientOpacityMaxValue:{get:function(){return this._gradientOpacityMaxValue},set:function(e){this._gradientOpacityMaxValue=e}},contourValue:{get:function(){return this._contourValue},set:function(e){e!==this._contourValue&&(this._contourValue=Math.min(e,this.maxValue),this._contourValue=Math.max(e,this.minValue),this._contourValueDirty=!0)}},enableLighting:{get:function(){return this._enableLighting},set:function(e){e!==this._enableLighting&&(this._enableLighting=e,this._voxelGridTile._enableLightingChange(e))}},material:{get:function(){return this._material}},outlineColor:{get:function(){return this._outlineColor},set:function(e){this._outlineColor=e}},fillStyle:{get:function(){return this._fillStyle},set:function(e){this._fillStyle=e}},sampleDistance:{set:function(e){this._sampleDistance!==e&&(this._sampleDistance=e)}}}),g$9.prototype.update=function(e,t){if(this._frameState=t,this._visible&&this._startRender){this._timeIndexChange=!1;var i=performance.now(),r=i-this._prevTime;this._timeRatio=r/this._period,r>this._period&&(this._prevTime=i,this._timeRatio=0,this._timeIndexChange=!0),e$28(this._voxelGridTile)&&(this._voxelGridTile instanceof o$b&&this.updateMultiResolution(e,t),this._voxelGridTile.update(this,t))}},g$9.prototype.setIsMultiResolution=function(e){e$28(this._voxelGridTile)||(e?(this._voxelGridTile=new o$b(this._context,this),this._voxelGridTile._isRootTile=!0):this._voxelGridTile=new m$9(this._context,this))};var Vt$1=new i$W("loadVol");function t$6(e,t){this._show=u$Y(t,!0),this._command=new r$15({owner:this}),this._ellipsoid=t$V.fromCartesian3(new t$X(6378137-e,6378137-e,6356752.314245179-e)),this._baseColor=new e$1S(0,0,0,1),this._underDepth=1e3}g$9.prototype.updateMultiResolution=function(e,t){var i=t.camera,r=t.cullingVolume,n=e._gl,o=t.requests,a=this;if(this._voxelGridTile._isVisible=r.computeVisibility(this._voxelGridTile._orientedBoundingBox)!==pt$a.OUTSIDE,this._voxelGridTile._isVisible){if(!this._voxelGridTile._initialized)return void o.push({entity:this._voxelGridTile,priority:0,owner:this});this._voxelGridTile.calcPixFromCam(i,n,1),this._updateQueue=[[this._voxelGridTile]];for(var s,l,u,c,h,d,f=[this._voxelGridTile],p=1;p<this._levels;p++){for(var _={},m=0;m<f.length;m++){if(!(b=f[m])._isLessLodDis){if(u=this._availableNode[p].resolution.x,c=this._availableNode[p].resolution.y,e$28(b._southwestChild))_[JSON.stringify([b._southwestChild._x,b._southwestChild._y,b._southwestChild._level])]=b._southwestChild;else if(h=2*b._x,d=2*b._y+1,h<this._availableNode[p].EndCol&&d<this._availableNode[p].EndRow){b._southwestChild=new o$b(this._context,this),b._southwestChild._mode=t.mode,b._southwestChild._level=b._level+1,b._southwestChild._x=h,b._southwestChild._y=d,b._southwestChild._zBounds=b._zBounds,s=h==this._availableNode[p].EndCol-1?(this._availableNode[p].Width-h*this._cellWidth)*u:this._cellWidth*u,l=d==this._availableNode[p].EndRow-1?(this._availableNode[p].Height-d*this._cellHeight)*c:this._cellHeight*c;var $=this._layerBounds.north-d*c*this._cellHeight;b._southwestChild._dataBounds=new h$10(b._dataBounds.west,$-l,b._dataBounds.west+s,$),b._southwestChild._computePosition(),b._southwestChild._rootTile=this._voxelGridTile,_[JSON.stringify([b._southwestChild._x,b._southwestChild._y,b._southwestChild._level])]=b._southwestChild}if(e$28(b._southeastChild))_[JSON.stringify([b._southeastChild._x,b._southeastChild._y,b._southeastChild._level])]=b._southeastChild;else if(h=2*b._x+1,d=2*b._y+1,h<this._availableNode[p].EndCol&&d<this._availableNode[p].EndRow){b._southeastChild=new o$b(this._context,this),b._southeastChild._mode=t.mode,b._southeastChild._level=b._level+1,b._southeastChild._x=h,b._southeastChild._y=d,b._southeastChild._zBounds=b._zBounds,s=h==this._availableNode[p].EndCol-1?(this._availableNode[p].Width-h*this._cellWidth)*u:this._cellWidth*u,l=d==this._availableNode[p].EndRow-1?(this._availableNode[p].Height-d*this._cellHeight)*c:this._cellHeight*c;$=this._layerBounds.north-d*c*this._cellHeight;var g=this._layerBounds.west+h*u*this._cellWidth;b._southeastChild._dataBounds=new h$10(g,$-l,g+s,$),b._southeastChild._computePosition(),b._southeastChild._rootTile=this._voxelGridTile,_[JSON.stringify([b._southeastChild._x,b._southeastChild._y,b._southeastChild._level])]=b._southeastChild}if(e$28(b._northwestChild)?_[JSON.stringify([b._northwestChild._x,b._northwestChild._y,b._northwestChild._level])]=b._northwestChild:(h=2*b._x,d=2*b._y,h<this._availableNode[p].EndCol&&d<this._availableNode[p].EndRow&&(b._northwestChild=new o$b(this._context,this),b._northwestChild._mode=t.mode,b._northwestChild._level=b._level+1,b._northwestChild._x=h,b._northwestChild._y=d,b._northwestChild._zBounds=b._zBounds,s=h==this._availableNode[p].EndCol-1?(this._availableNode[p].Width-h*this._cellWidth)*u:this._cellWidth*u,l=d==this._availableNode[p].EndRow-1?(this._availableNode[p].Height-d*this._cellHeight)*c:this._cellHeight*c,b._northwestChild._dataBounds=new h$10(b._dataBounds.west,b._dataBounds.north-l,b._dataBounds.west+s,b._dataBounds.north),b._northwestChild._computePosition(),b._northwestChild._rootTile=this._voxelGridTile,_[JSON.stringify([b._northwestChild._x,b._northwestChild._y,b._northwestChild._level])]=b._northwestChild)),e$28(b._northeastChild))_[JSON.stringify([b._northeastChild._x,b._northeastChild._y,b._northeastChild._level])]=b._northeastChild;else if(h=2*b._x+1,d=2*b._y,h<this._availableNode[p].EndCol&&d<this._availableNode[p].EndRow){b._northeastChild=new o$b(this._context,this),b._northeastChild._mode=t.mode,b._northeastChild._level=b._level+1,b._northeastChild._x=h,b._northeastChild._y=d,b._northeastChild._zBounds=b._zBounds,s=h==this._availableNode[p].EndCol-1?(this._availableNode[p].Width-h*this._cellWidth)*u:this._cellWidth*u,l=d==this._availableNode[p].EndRow-1?(this._availableNode[p].Height-d*this._cellHeight)*c:this._cellHeight*c;g=this._layerBounds.west+h*u*this._cellWidth;b._northeastChild._dataBounds=new h$10(g,b._dataBounds.north-l,g+s,b._dataBounds.north),b._northeastChild._computePosition(),b._northeastChild._rootTile=this._voxelGridTile,_[JSON.stringify([b._northeastChild._x,b._northeastChild._y,b._northeastChild._level])]=b._northeastChild}}}f=[];var v=0,y=void 0;for(var x in _){var b;(b=_[x])._isVisible=r.computeVisibility(b._orientedBoundingBox)!==pt$a.OUTSIDE,b._isVisible&&(b.calcPixFromCam(i,n,1),b._pix>v&&(v=b._pix,y=b))}if(v=0,e$28(y)){var w=_[JSON.stringify([y._x-1,y._y,y._level])],C=_[JSON.stringify([y._x+1,y._y,y._level])],T=_[JSON.stringify([y._x,y._y-1,y._level])],S=_[JSON.stringify([y._x,y._y+1,y._level])],E=_[JSON.stringify([y._x+1,y._y-1,y._level])];e$28(E)&&E._isVisible&&e$28(C)&&e$28(T)&&C._isVisible&&T._isVisible&&(v=E._pix+C._pix+T._pix,f=[T,E,y,C]);var A=_[JSON.stringify([y._x+1,y._y+1,y._level])];if(e$28(A)&&A._isVisible&&e$28(C)&&e$28(S)&&C._isVisible&&S._isVisible)(I=A._pix+C._pix+S._pix)>v&&(v=I,f=[y,C,S,A]);var P=_[JSON.stringify([y._x-1,y._y+1,y._level])];if(e$28(P)&&P._isVisible&&e$28(w)&&e$28(S)&&w._isVisible&&S._isVisible)(I=P._pix+w._pix+S._pix)>v&&(v=I,f=[w,y,P,S]);var I,M=_[JSON.stringify([y._x-1,y._y-1,y._level])];if(e$28(M)&&M._isVisible&&e$28(w)&&e$28(T)&&w._isVisible&&T._isVisible)(I=M._pix+w._pix+T._pix)>v&&(v=I,f=[M,T,w,y]);0==f.length&&(e$28(w)&&w._isVisible&&(v=w._pix,f=[w,y]),e$28(C)&&C._isVisible&&C._pix>v&&(v=C._pix,f=[y,C]),e$28(T)&&T._isVisible&&T._pix>v&&(v=T._pix,f=[T,y]),e$28(S)&&S._isVisible&&S._pix>v&&(v=S._pix,f=[y,S]),0==f.length&&(f=[y]))}if(!(f.length>0))break;this._updateQueue.push(f);for(m=0;m<f.length;m++)f[m]._s3mLoadState===I$F.UNLOAD&&o.push({entity:f[m],priority:0,owner:this})}if(this._textureLevelLoaded){this._multiTextures.length>this._updateQueue.length-1&&(this._multiTextures.length=this._updateQueue.length-1);var O=void 0,D=void 0,R=void 0;for(p=1;p<this._updateQueue.length;p++){var L=this._updateQueue[p],B=L.length;if(0===B)break;var N=!0;for(m=0;m<L.length;m++)if(L[m]._s3mLoadState!=I$F.LOADED&&L[m]._s3mLoadState!=I$F.TRANSFORMED){N=!1;break}if(!N)break;if(this._multiTextures.length<p){var F;O={textureLevel:F={}},D=L,R=this._multiTextures.length;break}if(R=p-1,!e$28(F=this._multiTextures[R])||L[0]._x<F.startCol||L[0]._y<F.startRow||L[B-1]._x>F.endCol||L[B-1]._y>F.endRow){O={textureLevel:{}},D=L;break}}if(e$28(O)){O._cellWidth=this._cellWidth,O._cellHeight=this._cellHeight,O._cellDepth=this._cellDepth,O._availableNode=this._availableNode[D[0]._level],O._time=this._time,O._layerBounds=this._layerBounds,O._minFiltration=this._floor,O._maxFiltration=this._ceil;var z=[];for(p=0;p<D.length;p++){var k={_x:D[p]._x,_y:D[p]._y,_level:D[p]._level,_dataBounds:D[p]._dataBounds,_s3mLoadState:D[p]._s3mLoadState,_arrayBuffer:D[p]._arrayBuffer};z.push(k)}O.arrayWork=z;var V=Vt$1.scheduleTask(O);if(!e$28(V))return;this._textureLevelLoaded=!1;a=this;o$1q(V,(function(e){var t;if(R<a._multiTextures.length){if(e$28(!(t=a._multiTextures[R])._volTextures))t._volTextures=[];else{for(var i=t._volTextures.length,r=0;r<i;r++)t._volTextures[r].destroy();t._volTextures=[]}t.bounds=e.textureLevel.bounds,t.cellDepth=e.textureLevel.cellDepth,t.cellHeight=e.textureLevel.cellHeight,t.cellWidth=e.textureLevel.cellWidth,t.endCol=e.textureLevel.endCol,t.endRow=e.textureLevel.endRow,t.multiResolutionTranslation=e.textureLevel.multiResolutionTranslation,t.startCol=e.textureLevel.startCol,t.startRow=e.textureLevel.startRow,t.validHeight=e.textureLevel.validHeight,t.validWidth=e.textureLevel.validWidth,t.xSpan=e.textureLevel.xSpan,t._nBlockLength=e.textureLevel._nBlockLength,t._nLength=e.textureLevel._nLength,t._nSideBlockCount=e.textureLevel._nSideBlockCount}else e$28(!(t=e.textureLevel)._volTextures)&&(t._volTextures=[]),a._multiTextures.push(t);t.multiResolutionPara=new y$15(t.multiResolutionTranslation.x,0,t.validWidth,t._nLength,t.multiResolutionTranslation.y,0,t.validHeight,0,t.multiResolutionTranslation.z,0,t._nSideBlockCount,0,t.multiResolutionTranslation.w,0,t._nBlockLength,0);var n=tt$h.LINEAR,o=rt$g.LINEAR;a._filterMode===k$T.FilterMode.NEAREST&&(n=tt$h.NEAREST,o=rt$g.NEAREST);for(i=e.imageDatas.length,r=0;r<i;r++){var s=new L$17({context:a._context,width:t._nLength,height:t._nLength,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:o})});s.copyFrom({width:t._nLength,height:t._nLength,arrayBufferView:e.imageDatas[r]}),t._volTextures.push(s)}a._textureLevelLoaded=!0;for(r=0;r<e.unzipTile.length;r++){var l=e.unzipTile[r].index,u=e.unzipTile[r].buffer;D[l]._arrayBuffer=u,D[l]._s3mLoadState=I$F.TRANSFORMED}for(r=0;r<D.length;r++)D[r]._s3mLoadState=I$F.TRANSFORMED}))}}var U=[];for(p=0;p<this._multiTextures.length;p++)U.push(this._multiTextures[p]);p=0;for(U.length>3&&(p=U.length-3),this._voxelGridTile._multiTextures=[];p<U.length;p++)this._voxelGridTile._multiTextures.push(U[p])}},g$9.prototype.loadEntity=function(e){e.load(this)},g$9.prototype.addClipPlane=function(e){this._clipPlanes.length>=6?console.log("at most 6 clipping planes can be specified"):(this._clipPlanes.push(e),e$28(this._voxelGridTile)&&this._voxelGridTile._clipPlaneChanged(this))},g$9.prototype.removeAllClipPlanes=function(){var e=this._clipPlanes.length;this._clipPlanes.length=0,e$28(this._voxelGridTile)&&e>0&&this._voxelGridTile._clipPlaneChanged(this)},g$9.prototype.removeClipPlane=function(e){e<0||e>=6||(this._clipPlanes.splice(e,1),e$28(this._voxelGridTile)&&this._voxelGridTile._clipPlaneChanged(this))},g$9.prototype.getNumberOfClipPlanes=function(){return this._clipPlanes.length},g$9.prototype.startRender=function(e){if(this._startRender=!0,e$28(this._voxelGridTile)){var t;if(this._voxelGridTile._setDataBounds(this._layerBounds),this._voxelGridTile._setZBounds(this._zBounds),e$28(this._NetCDFBuffer))t=this._voxelGridTile._loadData(this._NetCDFBuffer,e),this._minFiltration==Number.MIN_VALUE&&(this._minFiltration=this._voxelGridTile._floor),this._maxFiltration==Number.MAX_VALUE&&(this._maxFiltration=this._voxelGridTile._ceil);else if(e$28(this._volumeBuffer)){var i=this._cellWidth,r=this._cellHeight,n=this._availableNode[this._voxelGridTile._level];n.EndCol-1==this._voxelGridTile._x&&(i=n.Width-this._voxelGridTile._x*i),n.EndRow-1==this._voxelGridTile._y&&(r=n.Height-this._voxelGridTile._y*r),t=this._voxelGridTile._loadVolume(this._volumeBuffer,{maxValue:this._ceil,minValue:this._floor,time:this._time,xDimSize:this._cellWidth,yDimSize:this._cellHeight,zDimSize:this._cellDepth,xValidSize:i,yValidSize:r,zValidSize:this._cellDepth})}this._voxelGridTile._initialize(this,this._frameState,t)}},g$9.prototype.render=function(e,t){},g$9.prototype.releaseSelection=function(e,t){},g$9.prototype.isDestroyed=function(){return!1},g$9.prototype.destroy=function(){return e$28(this._dictColorTable)&&(this._dictColorTable.destroy(),this._dictColorTable=null),e$28(this._hypsometricTexture)&&(this._hypsometricTexture.destroy(),this._hypsometricTexture=null),e$28(this._voxelGridTile)&&(this._voxelGridTile.destroy(),this._voxelGridTile=void 0),this._NetCDFInfo=void 0,this._NetCDFData=void 0,this._NetCDFBuffer=void 0,i$Z(this)},Object.defineProperties(t$6.prototype,{show:{get:function(){return this._show},set:function(e){o$1u.defined("UnderGlobe show",e),this._show=e}},underDepth:{get:function(){return this._underDepth},set:function(e){if(o$1u.defined("UnderGlobe underDepth",e),this._underDepth!==e){var t=this._command;e$28(t)&&(t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._ellipsoid=t$V.fromCartesian3(new t$X(6378137-e,6378137-e,6356752.314245179-e))}this._underDepth=e}},ellipsoid:{get:function(){return this._ellipsoid}},baseColor:{get:function(){return this._baseColor},set:function(e){o$1u.defined("UnderGlobe baseColor",e),this._baseColor=e}}});var D$5="attribute vec4 position;\nvoid main(void)\n{\ngl_Position = czm_modelViewProjection * position;\n}",G$6="uniform vec4 uBaseColor;\nvoid main (void)\n{\ngl_FragColor = uBaseColor;\n}";t$6.prototype.update=function(e){var t=e.camera.positionCartographic.height;if(this._show&&e.passes.render&&!(t>1e4)){var i=e.mode;if(i===P$$.SCENE3D||i===P$$.MORPHING){var r=this._command,n=this;if(!e$28(r.vertexArray)){var o=e.context,a=b$Y.createGeometry(new b$Y({radii:new t$X(6378137-this._underDepth,6378137-this._underDepth,6356752.314245179-this._underDepth),slicePartitions:256,stackPartitions:256,vertexFormat:n$10.POSITION_ONLY}));r.vertexArray=m$19.fromGeometry({context:o,geometry:a,attributeLocations:k$Z.createAttributeLocations(a),bufferUsage:A$1c.STATIC_DRAW}),r.renderState=u$R.fromCache({cull:{enabled:!0}}),r.uniformMap={uBaseColor:function(){return n._baseColor}};var s=new a$$({sources:[D$5]}),l=new a$$({sources:[G$6]});r.shaderProgram=S$T.fromCache({context:o,vertexShaderSource:s,fragmentShaderSource:l})}return r}}},t$6.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),i$Z(this)};var Ar=function(e){var t,i=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,n=Math.ceil,o=Math.floor,a="[BigNumber Error] ",s=a+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function _(e){for(var t,i,r=1,n=e.length,o=e[0]+"";r<n;){for(t=e[r++]+"",i=u-t.length;i--;t="0"+t);o+=t}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function m(e,t){var i,r,n=e.c,o=t.c,a=e.s,s=t.s,l=e.e,u=t.e;if(!a||!s)return null;if(i=n&&!n[0],r=o&&!o[0],i||r)return i?r?0:-s:a;if(a!=s)return a;if(i=a<0,r=l==u,!n||!o)return r?0:!n^i?1:-1;if(!r)return l>u^i?1:-1;for(s=(l=n.length)<(u=o.length)?l:u,a=0;a<s;a++)if(n[a]!=o[a])return n[a]>o[a]^i?1:-1;return l==u?0:l>u^i?1:-1}function $(e,t,i,r){if(e<t||e>i||e!==o(e))throw Error(a+(r||"Argument")+("number"==typeof e?e<t||e>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function g(e){var t=e.c.length-1;return p(e.e/u)==t&&e.c[t]%2!=0}function v(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function y(e,t,i){var r,n;if(t<0){for(n=i+".";++t;n+=i);e=n+e}else if(++t>(r=e.length)){for(n=i,t-=r;--t;n+=i);e+=n}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}return t=function e(t){var x,b,w,C=N.prototype={constructor:N,toString:null,valueOf:null},T=new N(1),S=20,E=4,A=-7,P=21,I=-1e7,M=1e7,O=!1,D=1,R=0,L={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz";function N(e,t){var r,n,a,l,h,d,f,p,_=this;if(!(_ instanceof N))return new N(e,t);if(null==t){if(e&&!0===e._isBigNumber)return _.s=e.s,void(!e.c||e.e>M?_.c=_.e=null:e.e<I?_.c=[_.e=0]:(_.e=e.e,_.c=e.c.slice()));if((d="number"==typeof e)&&0*e==0){if(_.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,h=e;h>=10;h/=10,l++);return void(l>M?_.c=_.e=null:(_.e=l,_.c=[e]))}p=String(e)}else{if(!i.test(p=String(e)))return w(_,p,d);_.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(l=p.indexOf("."))>-1&&(p=p.replace(".","")),(h=p.search(/e/i))>0?(l<0&&(l=h),l+=+p.slice(h+1),p=p.substring(0,h)):l<0&&(l=p.length)}else{if($(t,2,B.length,"Base"),10==t)return V(_=new N(e),S+_.e+1,E);if(p=String(e),d="number"==typeof e){if(0*e!=0)return w(_,p,d,t);if(_.s=1/e<0?(p=p.slice(1),-1):1,N.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(s+e)}else _.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(r=B.slice(0,t),l=h=0,f=p.length;h<f;h++)if(r.indexOf(n=p.charAt(h))<0){if("."==n){if(h>l){l=f;continue}}else if(!a&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){a=!0,h=-1,l=0;continue}return w(_,String(e),d,t)}d=!1,(l=(p=b(p,t,10,_.s)).indexOf("."))>-1?p=p.replace(".",""):l=p.length}for(h=0;48===p.charCodeAt(h);h++);for(f=p.length;48===p.charCodeAt(--f););if(p=p.slice(h,++f)){if(f-=h,d&&N.DEBUG&&f>15&&(e>c||e!==o(e)))throw Error(s+_.s*e);if((l=l-h-1)>M)_.c=_.e=null;else if(l<I)_.c=[_.e=0];else{if(_.e=l,_.c=[],h=(l+1)%u,l<0&&(h+=u),h<f){for(h&&_.c.push(+p.slice(0,h)),f-=u;h<f;)_.c.push(+p.slice(h,h+=u));h=u-(p=p.slice(h)).length}else h-=f;for(;h--;p+="0");_.c.push(+p)}}else _.c=[_.e=0]}function F(e,t,i,r){var n,o,a,s,l;if(null==i?i=E:$(i,0,8),!e.c)return e.toString();if(n=e.c[0],a=e.e,null==t)l=_(e.c),l=1==r||2==r&&(a<=A||a>=P)?v(l,a):y(l,a,"0");else if(o=(e=V(new N(e),t,i)).e,s=(l=_(e.c)).length,1==r||2==r&&(t<=o||o<=A)){for(;s<t;l+="0",s++);l=v(l,o)}else if(t-=a,l=y(l,o,"0"),o+1>s){if(--t>0)for(l+=".";t--;l+="0");}else if((t+=o-s)>0)for(o+1==s&&(l+=".");t--;l+="0");return e.s<0&&n?"-"+l:l}function z(e,t){for(var i,r=1,n=new N(e[0]);r<e.length;r++){if(!(i=new N(e[r])).s){n=i;break}t.call(n,i)&&(n=i)}return n}function k(e,t,i){for(var r=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,r++);return(i=r+i*u-1)>M?e.c=e.e=null:i<I?e.c=[e.e=0]:(e.e=i,e.c=t),e}function V(e,t,i,r){var a,s,c,d,f,p,_,m=e.c,$=h;if(m){e:{for(a=1,d=m[0];d>=10;d/=10,a++);if((s=t-a)<0)s+=u,c=t,_=(f=m[p=0])/$[a-c-1]%10|0;else if((p=n((s+1)/u))>=m.length){if(!r)break e;for(;m.length<=p;m.push(0));f=_=0,a=1,c=(s%=u)-u+1}else{for(f=d=m[p],a=1;d>=10;d/=10,a++);_=(c=(s%=u)-u+a)<0?0:f/$[a-c-1]%10|0}if(r=r||t<0||null!=m[p+1]||(c<0?f:f%$[a-c-1]),r=i<4?(_||r)&&(0==i||i==(e.s<0?3:2)):_>5||5==_&&(4==i||r||6==i&&(s>0?c>0?f/$[a-c]:0:m[p-1])%10&1||i==(e.s<0?8:7)),t<1||!m[0])return m.length=0,r?(t-=e.e+1,m[0]=$[(u-t%u)%u],e.e=-t||0):m[0]=e.e=0,e;if(0==s?(m.length=p,d=1,p--):(m.length=p+1,d=$[u-s],m[p]=c>0?o(f/$[a-c]%$[c])*d:0),r)for(;;){if(0==p){for(s=1,c=m[0];c>=10;c/=10,s++);for(c=m[0]+=d,d=1;c>=10;c/=10,d++);s!=d&&(e.e++,m[0]==l&&(m[0]=1));break}if(m[p]+=d,m[p]!=l)break;m[p--]=0,d=1}for(s=m.length;0===m[--s];m.pop());}e.e>M?e.c=e.e=null:e.e<I&&(e.c=[e.e=0])}return e}function U(e){var t,i=e.e;return null===i?e.toString():(t=_(e.c),t=i<=A||i>=P?v(t,i):y(t,i,"0"),e.s<0?"-"+t:t)}return N.clone=e,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(e){var t,i;if(null!=e){if("object"!=typeof e)throw Error(a+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&($(i=e[t],0,f,t),S=i),e.hasOwnProperty(t="ROUNDING_MODE")&&($(i=e[t],0,8,t),E=i),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((i=e[t])&&i.pop?($(i[0],-f,0,t),$(i[1],0,f,t),A=i[0],P=i[1]):($(i,-f,f,t),A=-(P=i<0?-i:i))),e.hasOwnProperty(t="RANGE"))if((i=e[t])&&i.pop)$(i[0],-f,-1,t),$(i[1],1,f,t),I=i[0],M=i[1];else{if($(i,-f,f,t),!i)throw Error(a+t+" cannot be zero: "+i);I=-(M=i<0?-i:i)}if(e.hasOwnProperty(t="CRYPTO")){if((i=e[t])!==!!i)throw Error(a+t+" not true or false: "+i);if(i){if(!(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes)))throw O=!i,Error(a+"crypto unavailable");O=i}else O=i}if(e.hasOwnProperty(t="MODULO_MODE")&&($(i=e[t],0,9,t),D=i),e.hasOwnProperty(t="POW_PRECISION")&&($(i=e[t],0,f,t),R=i),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(i=e[t]))throw Error(a+t+" not an object: "+i);L=i}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(i=e[t])||/^.$|[+-.\s]|(.).*\1/.test(i))throw Error(a+t+" invalid: "+i);B=i}}return{DECIMAL_PLACES:S,ROUNDING_MODE:E,EXPONENTIAL_AT:[A,P],RANGE:[I,M],CRYPTO:O,MODULO_MODE:D,POW_PRECISION:R,FORMAT:L,ALPHABET:B}},N.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!N.DEBUG)return!0;var t,i,r=e.c,n=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(r)){if((1===s||-1===s)&&n>=-f&&n<=f&&n===o(n)){if(0===r[0]){if(0===n&&1===r.length)return!0;break e}if((t=(n+1)%u)<1&&(t+=u),String(r[0]).length==t){for(t=0;t<r.length;t++)if((i=r[t])<0||i>=l||i!==o(i))break e;if(0!==i)return!0}}}else if(null===r&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(a+"Invalid BigNumber: "+e)},N.maximum=N.max=function(){return z(arguments,C.lt)},N.minimum=N.min=function(){return z(arguments,C.gt)},N.random=function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return o(Math.random()*e)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(e){var i,r,s,l,c,d=0,p=[],_=new N(T);if(null==e?e=S:$(e,0,f),l=n(e/u),O)if(crypto.getRandomValues){for(i=crypto.getRandomValues(new Uint32Array(l*=2));d<l;)(c=131072*i[d]+(i[d+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),i[d]=r[0],i[d+1]=r[1]):(p.push(c%1e14),d+=2);d=l/2}else{if(!crypto.randomBytes)throw O=!1,Error(a+"crypto unavailable");for(i=crypto.randomBytes(l*=7);d<l;)(c=281474976710656*(31&i[d])+1099511627776*i[d+1]+4294967296*i[d+2]+16777216*i[d+3]+(i[d+4]<<16)+(i[d+5]<<8)+i[d+6])>=9e15?crypto.randomBytes(7).copy(i,d):(p.push(c%1e14),d+=7);d=l/7}if(!O)for(;d<l;)(c=t())<9e15&&(p[d++]=c%1e14);for(l=p[--d],e%=u,l&&e&&(c=h[u-e],p[d]=o(l/c)*c);0===p[d];p.pop(),d--);if(d<0)p=[s=0];else{for(s=-1;0===p[0];p.splice(0,1),s-=u);for(d=1,c=p[0];c>=10;c/=10,d++);d<u&&(s-=u-d)}return _.e=s,_.c=p,_}}(),N.sum=function(){for(var e=1,t=arguments,i=new N(t[0]);e<t.length;)i=i.plus(t[e++]);return i},b=function(){var e="0123456789";function t(e,t,i,r){for(var n,o,a=[0],s=0,l=e.length;s<l;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),n=0;n<a.length;n++)a[n]>i-1&&(null==a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/i|0,a[n]%=i)}return a.reverse()}return function(i,r,n,o,a){var s,l,u,c,h,d,f,p,m=i.indexOf("."),$=S,g=E;for(m>=0&&(c=R,R=0,i=i.replace(".",""),d=(p=new N(r)).pow(i.length-m),R=c,p.c=t(y(_(d.c),d.e,"0"),10,n,e),p.e=p.c.length),u=c=(f=t(i,r,n,a?(s=B,e):(s=e,B))).length;0==f[--c];f.pop());if(!f[0])return s.charAt(0);if(m<0?--u:(d.c=f,d.e=u,d.s=o,f=(d=x(d,p,$,g,n)).c,h=d.r,u=d.e),m=f[l=u+$+1],c=n/2,h=h||l<0||null!=f[l+1],h=g<4?(null!=m||h)&&(0==g||g==(d.s<0?3:2)):m>c||m==c&&(4==g||h||6==g&&1&f[l-1]||g==(d.s<0?8:7)),l<1||!f[0])i=h?y(s.charAt(1),-$,s.charAt(0)):s.charAt(0);else{if(f.length=l,h)for(--n;++f[--l]>n;)f[l]=0,l||(++u,f=[1].concat(f));for(c=f.length;!f[--c];);for(m=0,i="";m<=c;i+=s.charAt(f[m++]));i=y(i,u,s.charAt(0))}return i}}(),x=function(){function e(e,t,i){var r,n,o,a,s=0,l=e.length,u=t%d,c=t/d|0;for(e=e.slice();l--;)s=((n=u*(o=e[l]%d)+(r=c*o+(a=e[l]/d|0)*u)%d*d+s)/i|0)+(r/d|0)+c*a,e[l]=n%i;return s&&(e=[s].concat(e)),e}function t(e,t,i,r){var n,o;if(i!=r)o=i>r?1:-1;else for(n=o=0;n<i;n++)if(e[n]!=t[n]){o=e[n]>t[n]?1:-1;break}return o}function i(e,t,i,r){for(var n=0;i--;)e[i]-=n,n=e[i]<t[i]?1:0,e[i]=n*r+e[i]-t[i];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,n,a,s,c){var h,d,f,_,m,$,g,v,y,x,b,w,C,T,S,E,A,P=r.s==n.s?1:-1,I=r.c,M=n.c;if(!(I&&I[0]&&M&&M[0]))return new N(r.s&&n.s&&(I?!M||I[0]!=M[0]:M)?I&&0==I[0]||!M?0*P:P/0:NaN);for(y=(v=new N(P)).c=[],P=a+(d=r.e-n.e)+1,c||(c=l,d=p(r.e/u)-p(n.e/u),P=P/u|0),f=0;M[f]==(I[f]||0);f++);if(M[f]>(I[f]||0)&&d--,P<0)y.push(1),_=!0;else{for(T=I.length,E=M.length,f=0,P+=2,(m=o(c/(M[0]+1)))>1&&(M=e(M,m,c),I=e(I,m,c),E=M.length,T=I.length),C=E,b=(x=I.slice(0,E)).length;b<E;x[b++]=0);A=M.slice(),A=[0].concat(A),S=M[0],M[1]>=c/2&&S++;do{if(m=0,(h=t(M,x,E,b))<0){if(w=x[0],E!=b&&(w=w*c+(x[1]||0)),(m=o(w/S))>1)for(m>=c&&(m=c-1),g=($=e(M,m,c)).length,b=x.length;1==t($,x,g,b);)m--,i($,E<g?A:M,g,c),g=$.length,h=1;else 0==m&&(h=m=1),g=($=M.slice()).length;if(g<b&&($=[0].concat($)),i(x,$,b,c),b=x.length,-1==h)for(;t(M,x,E,b)<1;)m++,i(x,E<b?A:M,b,c),b=x.length}else 0===h&&(m++,x=[0]);y[f++]=m,x[0]?x[b++]=I[C]||0:(x=[I[C]],b=1)}while((C++<T||null!=x[0])&&P--);_=null!=x[0],y[0]||y.splice(0,1)}if(c==l){for(f=1,P=y[0];P>=10;P/=10,f++);V(v,a+(v.e=f+d*u-1)+1,s,_)}else v.e=d,v.r=+_;return v}}(),w=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,i=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,n=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,l,u){var c,h=l?s:s.replace(n,"");if(r.test(h))o.s=isNaN(h)?null:h<0?-1:1;else{if(!l&&(h=h.replace(e,(function(e,t,i){return c="x"==(i=i.toLowerCase())?16:"b"==i?2:8,u&&u!=c?e:t})),u&&(c=u,h=h.replace(t,"$1").replace(i,"0.$1")),s!=h))return new N(h,c);if(N.DEBUG)throw Error(a+"Not a"+(u?" base "+u:"")+" number: "+s);o.s=null}o.c=o.e=null}}(),C.absoluteValue=C.abs=function(){var e=new N(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return m(this,new N(e,t))},C.decimalPlaces=C.dp=function(e,t){var i,r,n,o=this;if(null!=e)return $(e,0,f),null==t?t=E:$(t,0,8),V(new N(o),e+o.e+1,t);if(!(i=o.c))return null;if(r=((n=i.length-1)-p(this.e/u))*u,n=i[n])for(;n%10==0;n/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,t){return x(this,new N(e,t),S,E)},C.dividedToIntegerBy=C.idiv=function(e,t){return x(this,new N(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,t){var i,r,s,l,c,h,d,f,p=this;if((e=new N(e)).c&&!e.isInteger())throw Error(a+"Exponent not an integer: "+U(e));if(null!=t&&(t=new N(t)),c=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return f=new N(Math.pow(+U(p),c?2-g(e):+U(e))),t?f.mod(t):f;if(h=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new N(NaN);(r=!h&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||c&&p.c[1]>=24e7:p.c[0]<8e13||c&&p.c[0]<=9999975e7)))return l=p.s<0&&g(e)?-0:0,p.e>-1&&(l=1/l),new N(h?1/l:l);R&&(l=n(R/u+2))}for(c?(i=new N(.5),h&&(e.s=1),d=g(e)):d=(s=Math.abs(+U(e)))%2,f=new N(T);;){if(d){if(!(f=f.times(p)).c)break;l?f.c.length>l&&(f.c.length=l):r&&(f=f.mod(t))}if(s){if(0===(s=o(s/2)))break;d=s%2}else if(V(e=e.times(i),e.e+1,1),e.e>14)d=g(e);else{if(0===(s=+U(e)))break;d=s%2}p=p.times(p),l?p.c&&p.c.length>l&&(p.c.length=l):r&&(p=p.mod(t))}return r?f:(h&&(f=T.div(f)),t?f.mod(t):l?V(f,R,E,undefined):f)},C.integerValue=function(e){var t=new N(this);return null==e?e=E:$(e,0,8),V(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return 0===m(this,new N(e,t))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return m(this,new N(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return 1===(t=m(this,new N(e,t)))||0===t},C.isInteger=function(){return!!this.c&&p(this.e/u)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return m(this,new N(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return-1===(t=m(this,new N(e,t)))||0===t},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(e,t){var i,r,n,o,a=this,s=a.s;if(t=(e=new N(e,t)).s,!s||!t)return new N(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/u,h=e.e/u,d=a.c,f=e.c;if(!c||!h){if(!d||!f)return d?(e.s=-t,e):new N(f?a:NaN);if(!d[0]||!f[0])return f[0]?(e.s=-t,e):new N(d[0]?a:3==E?-0:0)}if(c=p(c),h=p(h),d=d.slice(),s=c-h){for((o=s<0)?(s=-s,n=d):(h=c,n=f),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(r=(o=(s=d.length)<(t=f.length))?s:t,s=t=0;t<r;t++)if(d[t]!=f[t]){o=d[t]<f[t];break}if(o&&(n=d,d=f,f=n,e.s=-e.s),(t=(r=f.length)-(i=d.length))>0)for(;t--;d[i++]=0);for(t=l-1;r>s;){if(d[--r]<f[r]){for(i=r;i&&!d[--i];d[i]=t);--d[i],d[r]+=l}d[r]-=f[r]}for(;0==d[0];d.splice(0,1),--h);return d[0]?k(e,d,h):(e.s=3==E?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var i,r,n=this;return e=new N(e,t),!n.c||!e.s||e.c&&!e.c[0]?new N(NaN):!e.c||n.c&&!n.c[0]?new N(n):(9==D?(r=e.s,e.s=1,i=x(n,e,0,3),e.s=r,i.s*=r):i=x(n,e,0,D),!(e=n.minus(i.times(e))).c[0]&&1==D&&(e.s=n.s),e)},C.multipliedBy=C.times=function(e,t){var i,r,n,o,a,s,c,h,f,_,m,$,g,v,y,x=this,b=x.c,w=(e=new N(e,t)).c;if(!(b&&w&&b[0]&&w[0]))return!x.s||!e.s||b&&!b[0]&&!w||w&&!w[0]&&!b?e.c=e.e=e.s=null:(e.s*=x.s,b&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=p(x.e/u)+p(e.e/u),e.s*=x.s,(c=b.length)<(_=w.length)&&(g=b,b=w,w=g,n=c,c=_,_=n),n=c+_,g=[];n--;g.push(0));for(v=l,y=d,n=_;--n>=0;){for(i=0,m=w[n]%y,$=w[n]/y|0,o=n+(a=c);o>n;)i=((h=m*(h=b[--a]%y)+(s=$*h+(f=b[a]/y|0)*m)%y*y+g[o]+i)/v|0)+(s/y|0)+$*f,g[o--]=h%v;g[o]=i}return i?++r:g.splice(0,1),k(e,g,r)},C.negated=function(){var e=new N(this);return e.s=-e.s||null,e},C.plus=function(e,t){var i,r=this,n=r.s;if(t=(e=new N(e,t)).s,!n||!t)return new N(NaN);if(n!=t)return e.s=-t,r.minus(e);var o=r.e/u,a=e.e/u,s=r.c,c=e.c;if(!o||!a){if(!s||!c)return new N(n/0);if(!s[0]||!c[0])return c[0]?e:new N(s[0]?r:0*n)}if(o=p(o),a=p(a),s=s.slice(),n=o-a){for(n>0?(a=o,i=c):(n=-n,i=s),i.reverse();n--;i.push(0));i.reverse()}for((n=s.length)-(t=c.length)<0&&(i=c,c=s,s=i,t=n),n=0;t;)n=(s[--t]=s[t]+c[t]+n)/l|0,s[t]=l===s[t]?0:s[t]%l;return n&&(s=[n].concat(s),++a),k(e,s,a)},C.precision=C.sd=function(e,t){var i,r,n,o=this;if(null!=e&&e!==!!e)return $(e,1,f),null==t?t=E:$(t,0,8),V(new N(o),e,t);if(!(i=o.c))return null;if(r=(n=i.length-1)*u+1,n=i[n]){for(;n%10==0;n/=10,r--);for(n=i[0];n>=10;n/=10,r++);}return e&&o.e+1>r&&(r=o.e+1),r},C.shiftedBy=function(e){return $(e,-c,c),this.times("1e"+e)},C.squareRoot=C.sqrt=function(){var e,t,i,r,n,o=this,a=o.c,s=o.s,l=o.e,u=S+4,c=new N("0.5");if(1!==s||!a||!a[0])return new N(!s||s<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(s=Math.sqrt(+U(o)))||s==1/0?(((t=_(a)).length+l)%2==0&&(t+="0"),s=Math.sqrt(+t),l=p((l+1)/2)-(l<0||l%2),s==1/0?t="1e"+l:t=(t=s.toExponential()).slice(0,t.indexOf("e")+1)+l,i=new N(t)):i=new N(s+""),i.c[0])for((s=(l=i.e)+u)<3&&(s=0);;)if(n=i,i=c.times(n.plus(x(o,n,u,1))),_(n.c).slice(0,s)===(t=_(i.c)).slice(0,s)){if(i.e<l&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(r||"4999"!=t)){(!+t||!+t.slice(1)&&"5"==t.charAt(0))&&(V(i,i.e+S+2,1),e=!i.times(i).eq(o));break}if(!r&&(V(n,n.e+S+2,0),n.times(n).eq(o))){i=n;break}u+=4,s+=4,r=1}return V(i,i.e+S+1,E,e)},C.toExponential=function(e,t){return null!=e&&($(e,0,f),e++),F(this,e,t,1)},C.toFixed=function(e,t){return null!=e&&($(e,0,f),e=e+this.e+1),F(this,e,t)},C.toFormat=function(e,t,i){var r,n=this;if(null==i)null!=e&&t&&"object"==typeof t?(i=t,t=null):e&&"object"==typeof e?(i=e,e=t=null):i=L;else if("object"!=typeof i)throw Error(a+"Argument not an object: "+i);if(r=n.toFixed(e,t),n.c){var o,s=r.split("."),l=+i.groupSize,u=+i.secondaryGroupSize,c=i.groupSeparator||"",h=s[0],d=s[1],f=n.s<0,p=f?h.slice(1):h,_=p.length;if(u&&(o=l,l=u,u=o,_-=o),l>0&&_>0){for(o=_%l||l,h=p.substr(0,o);o<_;o+=l)h+=c+p.substr(o,l);u>0&&(h+=c+p.slice(o)),f&&(h="-"+h)}r=d?h+(i.decimalSeparator||"")+((u=+i.fractionGroupSize)?d.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):d):h}return(i.prefix||"")+r+(i.suffix||"")},C.toFraction=function(e){var t,i,r,n,o,s,l,c,d,f,p,m,$=this,g=$.c;if(null!=e&&(!(l=new N(e)).isInteger()&&(l.c||1!==l.s)||l.lt(T)))throw Error(a+"Argument "+(l.isInteger()?"out of range: ":"not an integer: ")+U(l));if(!g)return new N($);for(t=new N(T),d=i=new N(T),r=c=new N(T),m=_(g),o=t.e=m.length-$.e-1,t.c[0]=h[(s=o%u)<0?u+s:s],e=!e||l.comparedTo(t)>0?o>0?t:d:l,s=M,M=1/0,l=new N(m),c.c[0]=0;f=x(l,t,0,1),1!=(n=i.plus(f.times(r))).comparedTo(e);)i=r,r=n,d=c.plus(f.times(n=d)),c=n,t=l.minus(f.times(n=t)),l=n;return n=x(e.minus(i),r,0,1),c=c.plus(n.times(d)),i=i.plus(n.times(r)),c.s=d.s=$.s,p=x(d,r,o*=2,E).minus($).abs().comparedTo(x(c,i,o,E).minus($).abs())<1?[d,r]:[c,i],M=s,p},C.toNumber=function(){return+U(this)},C.toPrecision=function(e,t){return null!=e&&$(e,1,f),F(this,e,t,2)},C.toString=function(e){var t,i=this,r=i.s,n=i.e;return null===n?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(null==e?t=n<=A||n>=P?v(_(i.c),n):y(_(i.c),n,"0"):10===e?t=y(_((i=V(new N(i),S+n+1,E)).c),i.e,"0"):($(e,2,B.length,"Base"),t=b(y(_(i.c),n,"0"),10,e,r,!0)),r<0&&i.c[0]&&(t="-"+t)),t},C.valueOf=C.toJSON=function(){return U(this)},C._isBigNumber=!0,r&&(C[Symbol.toStringTag]="BigNumber",C[Symbol.for("nodejs.util.inspect.custom")]=C.valueOf),null!=t&&N.set(t),N}(),t.default=t.BigNumber=t,"function"==typeof define&&define.amd?define((function(){return t})):typeof module<"u"&&module.exports?module.exports=t:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=t),t}(),R$5="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nuniform sampler2D u_opaque;\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;\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n";function a$7(e){this._framebuffer=void 0,this._outputFramebuffer=void 0,this._accumulationTexture=void 0,this._revealageTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._passType=Le$p.OPAQUE,this._screenWidth=0,this._screenHeight=0,this._renderStateCache={},this.billboardQuality=.5,this.enable=!1}Object.defineProperties(a$7.prototype,{});var B$4={enabled:!0,color:new e$1S(0,0,0,0),equationRgb:b$18.ADD,equationAlpha:b$18.ADD,functionSourceRgb:l$15.ONE,functionDestinationRgb:l$15.ONE,functionSourceAlpha:l$15.ZERO,functionDestinationAlpha:l$15.ONE_MINUS_SOURCE_ALPHA},o$a=new f$10;function E$8(e,t){var i=e[t.id];if(!e$28(i)||i.viewport.width!=o$a.width||i.viewport.height!=o$a.height){var r=u$R.getState(t);r.depthMask=!1,r.blending=B$4,r.viewport=o$a,i=u$R.fromCache(r),e[t.id]=i}return i}function T$7(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy(),e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy(),e._outputFramebuffer=e._outputFramebuffer&&!e._outputFramebuffer.isDestroyed()&&e._outputFramebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}function O$5(e,t){var i=e._screenWidth,r=e._screenHeight,n=e._hdr?t.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT:y$U.UNSIGNED_BYTE;e._outputFramebuffer=new a$z({context:t,colorTextures:[new L$17({context:t,width:t.drawingBufferWidth,height:t.drawingBufferHeight,pixelFormat:V$O.RGBA,pixelDatatype:n})],destroyAttachments:!0}),e._accumulationTexture=new L$17({context:t,width:i,height:r,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT});var o=new Float32Array(i*r*4);e._revealageTexture=new L$17({context:t,pixelFormat:V$O.RGBA,pixelDatatype:y$U.FLOAT,source:{arrayBufferView:o,width:i,height:r},flipY:!1}),e._framebuffer=new a$z({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1})}function H$3(e,t){var i=new a$$({sources:[R$5]}),r={u_accumulation:function(){return e._accumulationTexture},u_revealage:function(){return e._revealageTexture},u_opaque:function(){return e._opaqueTexture}},n=u$R.fromCache({});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:r,renderState:n,pass:e._passType,owner:e}),e._clearCommand=new r$11({framebuffer:e._framebuffer,color:new e$1S(0,0,0,1),depth:1,renderState:u$R.fromCache(),pass:e._passType,owner:e})}function M$6(e,t){var i=e._screenWidth,r=e._screenHeight,n=e._accumulationTexture,o=!1,a=e$28(n)&&(n.width!==i||n.height!==r);return(!e$28(n)||a)&&(T$7(e),O$5(e,t),H$3(e,t),o=!0),o}function w$4(e){return e.drawBuffers&&e.fragmentDepth}function _$8(e){if(!e$28(e.provider))throw new t$Z("options.provder and options.viewer is required.");this._provider=e.provider,this._inner=e.layer,this._imagelayerCollection=e.imagelayerCollection,this._name=e.name,this._billboardCollection=new B$q({ignoreShow:!0,scene:e.scene}),this._imageIconBillboard={},this._textBillboard={},this._imageCanvas={},this.kmlLayer=new U$m({camera:e.scene.camera,canvas:e.scene.canvas}),this.kmlLayer.clustering.enabled=!0,this.kmlLayer.clustering.pixelRange=10,e$28(e.viewer)&&e.viewer.dataSources.add(this.kmlLayer),this.kmlLayer.clustering.clusterEvent.addEventListener((function(e,t){if(e.length>0&&e[0].billboard){var i=e[0].billboard;t.billboard.position=e[0].position.getValue(0),t.billboard.image=i.image.getValue(),t.billboard.scale=i.scale.getValue(),t.billboard.heightReference=i.heightReference.getValue(),t.billboard.scaleByDistance=i.scaleByDistance.getValue(),t.billboard.pixelOffset=i.pixelOffset.getValue()}if(e.length>0&&e[0].label){var r=e[0].label;t.label.position=e[0].position.getValue(0),t.label.text=r.text.getValue(),t.label.font=r.font.getValue(),t.label.verticalOrigin=r.verticalOrigin.getValue(),t.label.horizontalOrigin=r.horizontalOrigin.getValue(),t.label.heightReference=r.heightReference.getValue(),t.label.pixelOffset=r.pixelOffset.getValue(),t.label.scaleByDistance=r.scaleByDistance.getValue(),e$28(r.style)&&(t.label.style=r.style.getValue()),t.label.fillColor=r.fillColor.getValue()}}))}function E$7(e,t){return t.level-e.level}a$7.isSupported=w$4,a$7.prototype.getOutputFramebuffer=function(){return this._outputFramebuffer},a$7.prototype.update=function(e,t,i){if(w$4(e.context)&&this.enable){var r=e.context;this._screenWidth=Math.floor(r.drawingBufferWidth*this.billboardQuality),this._screenHeight=Math.floor(r.drawingBufferHeight*this.billboardQuality),o$a.width=this._screenWidth,o$a.height=this._screenHeight,this._opaqueTexture=t.getColorTexture(0),this._hdr=i,M$6(this,r)}},a$7.prototype.execute=function(e,t){!e$28(this._drawCommand)||!this.enable||this._drawCommand.execute(e,t)},a$7.prototype.clear=function(e,t){!e$28(this._clearCommand)||!this.enable||this._clearCommand.execute(e,t)},a$7.prototype.createDerivedCommands=function(e){!e$28(e)||(this.enable=!0,e.framebuffer=this._framebuffer,e.renderState=E$8(this._renderStateCache,e.renderState))},a$7.prototype.isDestroyed=function(){return!1},a$7.prototype.destroy=function(){return T$7(this),i$Z(this)},Object.defineProperties(_$8.prototype,{tileWidth:{get:function(){return this._provider._tileWidth}},tileHeight:{get:function(){return this._provider._tileHeight}},maximumLevel:{get:function(){return this._provider._ready?this._provider._maximumLevel:-1}},minimumLevel:{get:function(){return this._provider._ready?this._provider._minimumLevel:-1}},tilingScheme:{get:function(){return this._provider._tilingScheme}},rectangle:{get:function(){return this._provider._ready?this._provider._rectangle:null}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._provider._errorEvent}},ready:{get:function(){return this._provider._ready}},readyPromise:{get:function(){return this._provider.readyPromise}},hasAlphaChannel:{get:function(){return!0}},show:{get:function(){return this._inner.show},set:function(e){this._inner.show=e}},mapboxStyle:{get:function(){return this._provider.mapboxStyle},set:function(e){this._provider.mapboxStyle=e}},alpha:{get:function(){return this._inner.alpha},set:function(e){this._inner.alpha=e}},selectColor:{get:function(){return this._inner._selectColor},set:function(e){this._inner._selectColor=e}},name:{get:function(){return this._name},set:function(e){this._name=e}},pausing:{get:function(){return this._inner._pausing},set:function(e){this._inner._pausing=e,this._provider._pausing=e}},indexedDBSetting:{get:function(){return this._provider._indexedDBSetting},set:function(e){e$28(e)&&"boolean"==typeof e.isOpen&&(this._provider._indexedDBSetting.isOpen=e.isOpen)}}});var b$9=new o$1k,T$6=new t$X,d$c=new o$1b;function D$4(e){return Array.isArray(e)?"rgb("+e[0]+","+e[1]+","+e[2]+")":""}function y$8(e,t,i,r){var n=t.getGeometry().getFlatCoordinates(),o=n[0],a=n[1],s=i[0]*o+i[2]*a+i[4],l=i[1]*o+i[3]*a+i[5],u=s/e._canvasWidth,c=l/e._canvasWidth,h=r.west+r.width*u,d=r.south+r.height*(1-c);return t$X.fromRadians(h,d,0,t$V.WGS84,T$6),T$6}function G$5(e){var t=e.getId();return t-=16777216*Math.floor(t/16777216)}_$8.prototype.createIconImageBillboard=function(e){if(e$28(e.iconImageObjects))for(var t=e.rectangle,i=e.transform,r=0,n=e.iconImageObjects.length;r<n;r++){var o=e.iconImageObjects[r],a=o.feature,s=a.index;if(e$28(this._imageIconBillboard[s])){var l=this._imageIconBillboard[s];e.level>l.level&&(l.position=y$8(this._provider,a,i,t),l.level=e.level)}else{var u,c=o.style.layout;if(e$28(c)&&e$28(c["icon-image"])){var h=c["icon-image"],d=u$Y(c["icon-size"],1);if(e$28(this._imageCanvas[h]))u=this._imageCanvas[h];else{var f=this._provider._subSpriteImage[h];if(!e$28(f))continue;(u=document.createElement("canvas")).width=f.width,u.height=f.height,u.getContext("2d").putImageData(f,0,0),this._imageCanvas[h]=u}}b$9.x=0,b$9.y=-u.height/2,d$c.near=1500,d$c.nearValue=1.5,d$c.far=8e6,d$c.farValue=0;var p=this._billboardCollection.add({image:u,scale:d,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:k$_.CLAMP_TO_GROUND,pixelOffset:b$9,scaleByDistance:d$c,id:G$5(a)});p.position=y$8(this._provider,a,i,t),p.level=e.level,this._imageIconBillboard[s]=p}}},_$8.prototype.createTextBillboard=function(e){if(e$28(e.textObjects))for(var t=e.rectangle,i=e.transform,r=0;r<e.textObjects.length;r++){var n=e.textObjects[r],o=n.feature,a=o.index;if(e$28(this._textBillboard[a])){var s=this._textBillboard[a];e.level>s.level&&(s.position=y$8(this._provider,o,i,t),s.level=e.level)}else{var l=n.style,u=l.getText(),c=l.textSize,h=u.getText(),d=u.getFont(d),f=u.getTextAlign(),p=document.createElement("canvas"),_=p.getContext("2d"),m=c+"px "+d;_.font=m,_.textBaseline="top",_.textAlign=f;var $=_.measureText(h).width+2;p.width=$,p.height=c+1,_.font=m;var g=u.getFill(),v=u.getStroke();e$28(v)&&(_.strokeStyle=D$4(v.getColor()),_.lineWidth=v.getWidth(),_.strokeText(h,0,c-3)),e$28(g)&&(_.fillStyle=D$4(g.getColor()),_.fillText(h,0,c-3)),b$9.x=0,b$9.y=-p.height/2,d$c.near=1500,d$c.nearValue=2,d$c.far=1e6,d$c.farValue=0;var y=this._billboardCollection.add({image:p,imageId:h,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:k$_.CLAMP_TO_GROUND,pixelOffset:b$9,scaleByDistance:d$c,verticalOrigin:S$L.TOP,horizontalOrigin:j$13.LEFT});y.position=y$8(this._provider,o,i,t),y.level=e.level,this._textBillboard[a]=y}}},_$8.prototype.update=function(e,t){if(e$28(this._billboardCollection)){var i=this._inner._imageryCache,r=[];for(var n in i)r.push(i[n]);r.sort(E$7);for(var o=0;o<r.length;o++){var a=r[o];!a.isMvtTexture||a.isRendered||(a.isRendered=!0)}this._billboardCollection.update(t)}},_$8.prototype.getProperty=function(e){return this._provider.getProperty(e)},_$8.prototype.refresh=function(){e$28(this._billboardCollection)&&this._billboardCollection.removeAll();var e=this._inner._imageryCache;for(var t in e)e[t].isRendered=!1;this._imageIconBillboard={},this._textBillboard={},this._imagelayerCollection.remove(this._inner),this._inner=this._imagelayerCollection.addImageryProvider(this._provider)},_$8.prototype.isDestroyed=function(){return!1},_$8.prototype.destroy=function(){return this._imagelayerCollection.remove(this._inner),e$28(this._billboardCollection)&&(this._billboardCollection.destroy(),this._billboardCollection=null),i$Z(this)};var e$3={NONE:0,ByKeyboard:1},ni=Object.freeze(e$3);function n$a(e){if(!e$28(e))throw new t$Z("scene are required.");this._scene=e,this._context=e._context,this._s3mInstanceCollection=new _0x36e54b(e._context),this._s3mInstanceCollection._profile=!0,this._s3mInstanceCollection.minVisibleAltitude=-9e3,e.primitives.add(this._s3mInstanceCollection),this._textureAtlas=null,this._profileRenders=[],this._spatialQueryList=[],this._section=!0,this._name="solidModelsProfile"+this._scene._analyst3D._layerIndex,this._scene._analyst3D.add(this),this._modelInfo={},this._dataIndex=0,this._selectedProfileIDs=[],this._clippingType=V$i.KeepInside,this._visibleViewport=4095;var t=this,i=0;this._modelCount=0,this._modelPosition=[],this._addedEvent=new o$1o,this._s3mInstanceCollection.addedEvent.addEventListener((function(){++i===t._modelCount&&t._addedEvent.raiseEvent({modelPosition:t._modelPosition})})),this._volume=void 0}function J$3(e,t){var i=t._group;for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=i[r];if(!e$28(o)||0===o.renderEntities.length)continue;var a=o.renderEntities[0];n.texture=a._texture}}function K$2(e){this.pickColor=new t$X,this.id=u$Y(e.id,0),e$28(e.color)?this.color=e$1S.clone(e.color):this.color=e$1S.fromRandom({alpha:1}),this.textureAtlasID=-1,e$28(e.textureMapParameter)?(this.textureTilingU=u$Y(e.textureMapParameter.UTiling,1),this.textureTilingV=u$Y(e.textureMapParameter.VTiling,1)):(this.textureTilingU=1,this.textureTilingV=1)}function L$7(e){return e===V$i.KeepOutside?j$l.Disjoint:j$l.Intersects}Object.defineProperties(n$a.prototype,{selectedModelIDs:{get:function(){return this._selectedProfileIDs}},clippingType:{get:function(){return this._clippingType},set:function(e){if(e!==this._clippingType){this._clippingType=e;for(var t=0;t<this._spatialQueryList.length;t++)this._spatialQueryList[t].positionMode=L$7(this._clippingType);for(t=0;t<this._profileRenders.length;t++)this._profileRenders[t]._clippingType=e}}},addedEvent:{get:function(){return this._addedEvent}},volume:{get:function(){return this._volume},set:function(e){this._volume=e,this._s3mInstanceCollection._volume=e}},mixColorType:{get:function(){return this._s3mInstanceCollection._mixColorType},set:function(e){this._s3mInstanceCollection._mixColorType!==e&&(this._s3mInstanceCollection._mixColorType=e)}}}),n$a.prototype.addProfileGeometry=function(e){if(e$28(e)){var t=e;Array.isArray(e)&&(t=new h$6(e),e$28(this._volume)&&(t._volBounds=this._volume._volBounds));var i=new p$7(this,this._profileRenders.length,this._modelInfo,t);i._clippingType=this._clippingType,e$28(this._volume)&&(i._attributeLocations.aRatio=3,i._volume=this._volume),this._profileRenders.push(i)}},n$a.prototype.clearProfile=function(){this._profileRenders.map((function(e){e.destroy()})),this._profileRenders=[],this._s3mInstanceCollection._profile=!1,this._s3mInstanceCollection._spatialQueryEnable=!1,this._s3mInstanceCollection.clampToObject=!1},n$a.prototype.addProfilePlane=function(e){},n$a.prototype.addProfileCylinder=function(e){},n$a.prototype.setClipGeometry=function(e){if(e.geoType!==P$v.GEOREGION3D&&e.geoType!==P$v.GEOCYLINDER&&e.geoType!==P$v.GEOBOX&&e.geoType!==P$v.GEOMODEL3D&&!(e instanceof N$G))return!1;var t=new p$i(this._scene);t.geometry=e,t.positionMode=L$7(this._clippingType),this._s3mInstanceCollection._profileMode=1,t._beQueryCollection=this._s3mInstanceCollection,this._s3mInstanceCollection._spatialQueryEnable=!0,t._profile=!0,this._spatialQueryList.push(t)},n$a.prototype.addModels=function(e){var t=this;e.map((function(e){var i=new K$2(e),r={id:i.id,primitive:t};i.profilePickId=t._context.createPickId(r),t._modelInfo[e.model]=i,t.requestImage(e.model,e.texture),t.requestModel(e.model,e.color,e.id),t._modelCount++}))},n$a.prototype.requestImage=function(e,t){if(e$28(t)){var i=this;e$28(this._textureAtlas)||(this._textureAtlas=new w$q({context:this._scene._context})),this._textureAtlas.addImage(t,t).then((function(t){i._modelInfo[e].textureAtlasID=t}))}},n$a.prototype.requestModel=function(e,t,i){var r=u$Y(i,(o=this)._dataIndex);if(e$28(e)){var n=e.replace(/\?returnContent=.*$/,"");if(".json"===(n=n.substring(n.length-5).toLowerCase()))if(e.indexOf("spatialAnalysis-")>-1){var o=this;p$Z({url:e,responseType:"arraybuffer",method:"POST",data:JSON.stringify({sourceDatasetFilter:{attributeFilter:""},isLonlat:!0,returnStream:!0}),headers:{"Content-type":"application/x-www-form-urlencoded; charset=UTF-8"}}).then((function(i){var n=new DataView(i),a=0,s=n.getInt32(a,!0);a+=4;var l=a$Z(new Uint8Array(i,a,s)),u=JSON.parse(l);a+=s;var c=n.getInt32(a,!0);a+=4;var h,d,f=[];for(h=0;h<c;h++)d=n.getInt32(a,!0),f.push(d),a+=4;var p=[];for(h=0;h<c;h++){if(0===(d=f[h]))p.push(null);else{var _=new Uint8Array(i,a,d);p.push(new Uint8Array(_).buffer)}a+=d}var m=u.geometries[0],$={};$.id=r,$.position=m.position,o._modelPosition.push($),o._s3mInstanceCollection.add(e,{position:t$X.fromDegrees(m.position.x,m.position.y,m.position.z),color:t,id:r,scale:new t$X(m.scaleX,m.scaleY,m.scaleZ)},p[0],!1);var g=o._s3mInstanceCollection.getInstance(e,r),v=o._modelInfo[e].pickColor;v.x=g._pickColor.x,v.y=g._pickColor.y,v.z=g._pickColor.z,o._dataIndex++}))}else u$O(e).then((function(i){if(null!=i.geometry){var n=new Uint8Array(i.geometry.model),a={};a.id=r,a.position=i.geometry.position,o._modelPosition.push(a),o._s3mInstanceCollection.add(e,{position:t$X.fromDegrees(i.geometry.position.x,i.geometry.position.y,i.geometry.position.z),color:t,id:r,scale:new t$X(i.geometry.scaleX,i.geometry.scaleY,i.geometry.scaleZ),hpr:i$10.fromDegrees(-i.geometry.rotationZ,i.geometry.rotationX,i.geometry.rotationY)},n.buffer);var s=o._s3mInstanceCollection.getInstance(e,r),l=o._modelInfo[e].pickColor;l.x=s._pickColor.x,l.y=s._pickColor.y,l.z=s._pickColor.z,o._dataIndex++}}));else o$$(e).then((function(i){var n=new DataView(i),a=0,s=n.getInt32(a,!0);a+=4;var l=a$Z(new Uint8Array(i,a,s)),u=JSON.parse(l).geometry;if(null!=u){var c={};c.id=r,c.position=u.position,o._modelPosition.push(c),a+=s;var h=n.getInt32(a,!0);a+=4;var d,f,p=[];for(d=0;d<h;d++)f=n.getInt32(a,!0),p.push(f),a+=4;var _=[];for(d=0;d<h;d++){if(0===(f=p[d]))_.push(null);else{var m=new Uint8Array(i,a,f);_.push(new Uint8Array(m).buffer)}a+=f}o._s3mInstanceCollection.add(e,{position:t$X.fromDegrees(u.position.x,u.position.y,u.position.z),color:t,id:r,scale:new t$X(u.scaleX,u.scaleY,u.scaleZ),hpr:i$10.fromDegrees(-u.rotationZ,u.rotationX,u.rotationY)},_[0],!1);var $=o._s3mInstanceCollection.getInstance(e,r);o._modelInfo[e].color=$._color;var g=o._modelInfo[e].pickColor;g.x=$._pickColor.x,g.y=$._pickColor.y,g.z=$._pickColor.z,o._dataIndex++}}))}},n$a.prototype.build=function(){this._s3mInstanceCollection._profile=!0,this._s3mInstanceCollection.clampToObject=!0},n$a.prototype.setSelected=function(e){this._selectedProfileIDs=[],this._selectedProfileIDs.push(e)},n$a.prototype.releaseSelection=function(){this._selectedProfileIDs=[]},n$a.prototype.setVisibleInViewport=function(e,t){if(e>8)throw new t$Z("the index is 0~8");this._visibleViewport=t?1<<e|this._visibleViewport:~(1<<e)&this._visibleViewport},n$a.prototype.getVisibleInViewport=function(e){if(e>8)throw new t$Z("the index is 0~8");return 1<<e&this._visibleViewport},n$a.prototype.clear=function(){for(var e in e$28(this._textureAtlas)&&(this._textureAtlas.destroy(),this._textureAtlas=null),this._profileRenders.map((function(e){e.destroy()})),this._profileRenders=[],this._s3mInstanceCollection._spatialQueryEnable=!1,this._spatialQueryList.map((function(e){e.destroy()})),this._spatialQueryList=[],this._modelInfo)this._s3mInstanceCollection.removeCollection(e);this._s3mInstanceCollection.clampToObject=!1,this._modelInfo={},this._dataIndex=0},n$a.prototype.destroy=function(){return this.clear(),this._scene._analyst3D.remove(this._name,!0),this._scene.primitives.remove(this._s3mInstanceCollection),this._s3mInstanceCollection.destroy(),i$Z(this)},n$a.prototype.update=function(e,t,i){this._spatialQueryList.map((function(r){r.update(e,t,i)}));var r=this._s3mInstanceCollection.clampToObject;J$3(this._modelInfo,this._s3mInstanceCollection),this._profileRenders.map((function(n){n.update(e,t,i,r)}))},n$a.prototype._updateTextures=function(e,t){this._spatialQueryList.map((function(i){i._updateTextures(e,t)}))};var h$5=81;function G$4(){this.powers=new Array(h$5)}var _$7=[[.0014,0,.0065],[.0022,1e-4,.0105],[.0042,1e-4,.0201],[.0076,2e-4,.0362],[.0143,4e-4,.0679],[.0232,6e-4,.1102],[.0435,.0012,.2074],[.0776,.0022,.3713],[.1344,.004,.6456],[.2148,.0073,1.0391],[.2839,.0116,1.3856],[.3285,.0168,1.623],[.3483,.023,1.7471],[.3481,.0298,1.7826],[.3362,.038,1.7721],[.3187,.048,1.7441],[.2908,.06,1.6692],[.2511,.0739,1.5281],[.1954,.091,1.2876],[.1421,.1126,1.0419],[.0956,.139,.813],[.058,.1693,.6162],[.032,.208,.4652],[.0147,.2586,.3533],[.0049,.323,.272],[.0024,.4073,.2123],[.0093,.503,.1582],[.0291,.6082,.1117],[.0633,.71,.0782],[.1096,.7932,.0573],[.1655,.862,.0422],[.2257,.9149,.0298],[.2904,.954,.0203],[.3597,.9803,.0134],[.4334,.995,.0087],[.5121,1,.0057],[.5945,.995,.0039],[.6784,.9786,.0027],[.7621,.952,.0021],[.8425,.9154,.0018],[.9163,.87,.0017],[.9786,.8163,.0014],[1.0263,.757,.0011],[1.0567,.6949,.001],[1.0622,.631,8e-4],[1.0456,.5668,6e-4],[1.0026,.503,3e-4],[.9384,.4412,2e-4],[.8544,.381,2e-4],[.7514,.321,1e-4],[.6424,.265,0],[.5419,.217,0],[.4479,.175,0],[.3608,.1382,0],[.2835,.107,0],[.2187,.0816,0],[.1649,.061,0],[.1212,.0446,0],[.0874,.032,0],[.0636,.0232,0],[.0468,.017,0],[.0329,.0119,0],[.0227,.0082,0],[.0158,.0057,0],[.0114,.0041,0],[.0081,.0029,0],[.0058,.0021,0],[.0041,.0015,0],[.0029,.001,0],[.002,7e-4,0],[.0014,5e-4,0],[.001,4e-4,0],[7e-4,2e-4,0],[5e-4,2e-4,0],[3e-4,1e-4,0],[2e-4,1e-4,0],[2e-4,1e-4,0],[1e-4,0,0],[1e-4,0,0],[1e-4,0,0],[0,0,0]];G$4.prototype.toXYZ=function(){for(var e=new t$X(0,0,0),t=1;t<h$5;t++){var i=t+0;i>h$5-1&&(i=h$5-1),i<1&&(i=1),e.x+=this.powers[i]*_$7[t][0],e.y+=this.powers[i]*_$7[t][1],e.z+=this.powers[i]*_$7[t][2]}return e};var t0=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,.003,.004,.006,.007,.009,.011,.014,.017,.021,.025,.03,.035,.04,.044,.048,.055,.063,.071,.075,.08,.085,.091,.12,.12,.12,.12,.12,.12,.12,.119,.12,.12,.12,.1,.09,.09,.085,.08,.075,.07,.07,.065,.06,.055,.05,.045,.04,.035,.028,.25,.023,.02,.018,.016,.012,.012,.012,.012,.01,.01,.01,.008,.007,.006,.005,.003,0],L$6=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.15,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0],n$9=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.016,.015,.014,.013,.0125,1.8,2.3,2.5,2.3,1.8,.061,.003,8e-4,1e-4,1e-5,1e-5,1e-4,3e-4,6e-4];G$4.prototype.applyAtmosphericTransmittance=function(e,t,i,r,n,o){var a=.04608*i-.04586,s=e$27.toDegrees(e);if(s<90){var l=1;l=1/(t+.50572*Math.pow(96.07995-s,-1.6364));l*=1;l*=Math.exp(-r/8435);for(var u=1.003454/Math.sqrt(t*t+.006908),c=Math.log(.35),h=c*(1.459+c*(.1595+.4129*c)),d=c*(.0783+c*(-.3824-.5874*c)),f=1-.5*Math.exp((h+d/1.8)/1.8),p=1-.5*Math.exp((h+d*t)*t),_=0;_<h$5;_++){var m,$=.38+.005*_,g=Math.exp(-l/(Math.pow($,4)*(115.6406-1.3366/($*$))));m=$<.5?1.0274:1.206;var v=a*Math.pow(2*$,-m),y=Math.exp(-v*l),x=2.5*n$9[_]*l,b=Math.exp(-.2385*x/Math.pow(1+20.07*x,.45)),w=Math.exp(.35*-t0[_]*u),C=Math.exp(-1.41*L$6[_]*l/Math.pow(1+118.3*L$6[_]*l,.45)),T=Math.log($/.4),S=.945*Math.exp(-.095*T*T),E=Math.exp(-S*v*l),A=Math.exp((S-1)*v*l),P=Math.exp(-1.8/($*$*$*$)*(115.6406-1.3366/($*$))),I=Math.exp(-.4293*n$9[_]*2.5/Math.pow(1+36.126*n$9[_]*2.5,.45)),M=Math.exp(-2.538*L$6[_]/Math.pow(1+212.94*L$6[_],.45)),O=Math.exp(-S*v*1.8),D=Math.exp((S-1)*v*1.8),R=g*y*b*w*C;n.powers[_]=this.powers[_]*R;var L=this.powers[_]*w*b*C*t*A,B=1;$<=.45&&(B=Math.pow($+.55,1.8));var N=I*M*D*(.5*(1-P)+(1-f)*P*(1-O)),F=L*(1-Math.pow(g,.95))/2,z=L*Math.pow(g,1.5)*(1-E)*p,k=.3*(n.powers[_]*t+F+z)*N/(1-.3*N);o.powers[_]=(F+z+k)*B,o.powers[_]<0&&(o.powers[_]=0)}}else for(_=0;_<h$5;_++)n.powers[_]=0,o.powers[_]=0};var a$6=[[.3,.305,.31,.315,.32,.325,.33,.335,.34,.345,.35,.36,.37,.38,.39,.4,.41,.42,.43,.44,.45,.46,.47,.48,.49,.5,.51,.52,.53,.54,.55,.57,.593,.61,.63,.656,.6676,.69,.71,.718,.7244,.74,.7525,.7575,.7625,.7675,.78,.8,.816,.8237,.8315,.84,.86,.88,.905,.915,.925,.93,.937,.948,.965,.98,.9935,1.04,1.07,1.1,1.12,1.13,1.145,1.161,1.17,1.2,1.24,1.27,1.29,1.32,1.35,1.395,1.4425,1.4625,1.477,1.497,1.52,1.539,1.558,1.578,1.592,1.61,1.63,1.646,1.678,1.74,1.8,1.86,1.92,1.96,1.985,2.005,2.035,2.065,2.1,2.148,2.198,2.27,2.36,2.45,2.5,2.6,2.7,2.8,2.9,3,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4],[535.9,558.3,622,692.7,715.1,832.9,961.9,931.9,900.6,911.3,975.5,975.9,1119.9,1103.8,1033.8,1479.1,1701.3,1740.4,1587.2,1837,2005,2043,1987,2027,1896,1909,1927,1831,1891,1898,1892,1840,1768,1728,1658,1524,1531,1420,1399,1374,1373,1298,1269,1245,1223,1205,1183,1148,1091,1062,1038,1022,998.7,947.2,893.2,868.2,829.7,830.3,814,786.9,768.3,767,757.6,688.1,640.7,606.2,585.9,570.2,564.1,544.2,533.4,501.6,477.5,442.7,440,416.8,391.4,358.9,327.5,317.5,307.3,300.4,292.8,275.5,272.1,259.3,246.9,244,243.5,234.8,220.5,190.8,171.1,144.5,135.7,123,123.8,113,108.5,97.5,92.4,82.4,74.6,68.3,63.8,49.5,48.5,38.6,36.6,32,28.1,24.8,22.1,19.6,17.5,15.7,14.1,12.7,11.5,10.4,9.5,8.6]],i$8=81,p$5=5;function o$9(){G$4.call(this);for(var e=a$6[1].length,t=1,i=.38,r=0;r<i$8;r++){for(var n=i+.001*p$5;t<e-1&&a$6[0][t]<=n;)t++;this.powers[r]=a$6[1][t],i+=.001*p$5}}function a$5(){}function u$a(e){var t,i=Math.log(e);return t=i<=-3.94?-2.86:i>=-1.44?i-.395:Math.pow(.405*i+1.6,2.18)-2.86,Math.exp(t)}function n$8(e){var t,i=Math.log(e);return t=i<=-2.6?-.72:i>=1.9?i-1.255:Math.pow(.249*i+.65,2.7)-.72,Math.exp(t)}o$9.prototype=Object.create(G$4.prototype),o$9.prototype.constructor=G$4,a$5.Ldmax=100,a$5.LsavgC=100,a$5.LsavgR=100,a$5.k=1,a$5.mR=1,a$5.mC=1,a$5.disableToneMapping=!1,a$5.setSceneLogAvg=function(e,t){e<0&&(e=0),t<0&&(t=0),a$5.LsavgR=e/.8,a$5.LsavgC=t/.8,a$5.computeScaleFactors()},a$5.durandMapperXYZ=function(e){var t=a$5.k,i=a$5.mR,r=a$5.Ldmax,n=a$5.mC,o=-.702*e.x+1.039*e.y+.433*e.z;o<0&&(o=0);var a=new t$X(.3*o,.3*o,.4*o),s=t$X.multiplyByScalar(e,(1-t)*n,new t$X),l=t$X.multiplyByScalar(a,t*i,new t$X),u=t$X.add(s,l,new t$X);e=t$X.multiplyByScalar(u,1/r,e)},a$5.computeScaleFactors=function(){var e,t,i;a$5.Ldmax=100,e=a$5.Ldmax,t=a$5.LsavgR,i=a$5.LsavgC;var r=n$8(e);a$5.mR=r/u$a(t),a$5.mC=r/n$8(i);a$5.k=(100-.25*t)/(100+t),a$5.k<0&&(a$5.k=0)};var P$4=new p$1a(2.37067,-.90004,-.470634,-.513885,1.4253,.0885814,.00529818,-.0146949,1.0094);function l$a(){this._oneOverGammaHosek=1/2.4,this._T=3,this._lastSunT=0,this._lastSunZenith=0,this._lastMoonT=0,this._lastMoonZenith=0,this._lastMoonPhase=0,this._ephemeris=void 0,this._perezBlend=0,this._isothermalEffect=0,this._sunAboveHorizon=!1,this._sunSpectrum=new o$9,this._sunTransmittedLuminance=void 0,this._sunScatteredLuminance=void 0,this._sunTransmittedLuminanceSeaLevel=void 0,this._sunScatteredLuminanceSeaLevel=void 0,this._lunarSpectrum=new o$9,this._moonTransmittedLuminance=void 0,this._moonScatteredLuminance=void 0,this._moonTransmittedLuminanceSeaLevel=void 0,this._moonScatteredLuminanceSeaLevel=void 0,this._maxSkylightLuminance=1,this._monochromeAmbient=!0,this._lightPollution=0,this._nightSkyScale=1,this._skyLight=new e$1S,this._twilightLuminance=[],k$4(this),this._lightingChanged=!1}function k$4(e){e._twilightLuminance={},e._twilightLuminance[5]=2200,e._twilightLuminance[4]=1800,e._twilightLuminance[3]=1400,e._twilightLuminance[2]=1200,e._twilightLuminance[1]=710,e._twilightLuminance[0]=400,e._twilightLuminance[-1]=190,e._twilightLuminance[-2]=77,e._twilightLuminance[-3]=28,e._twilightLuminance[-4]=9.4,e._twilightLuminance[-5]=2.9,e._twilightLuminance[-6]=.9,e._twilightLuminance[-7]=.3,e._twilightLuminance[-8]=.11,e._twilightLuminance[-9]=.047,e._twilightLuminance[-10]=.021,e._twilightLuminance[-11]=.0092,e._twilightLuminance[-12]=.0031,e._twilightLuminance[-13]=.0022,e._twilightLuminance[-14]=.0019,e._twilightLuminance[-15]=.0018,e._twilightLuminance[-16]=.0018;for(var t in e._twilightLuminance){var i=e._twilightLuminance[t];e._twilightLuminance[t]=i/Math.PI*.1}}var p$4=new t$X;l$a.prototype.getToneMappedSkyLight=function(){return this._skyLight};var O$4=new t$X;function e$2(){this.year=0,this.month=0,this.day=0,this.hours=0,this.minutes=0,this.seconds=0,this.observingDST=!0,this.zoneCorrection=8}function i$7(){this._latitude=0,this._longitude=0,this._altitude=0}function a$4(){this._time=void 0,this._lastTime=new e$2,this._lastLocation=new i$7,this._T=0,this._tuncorr=0,this._epochDays=0,this._sunEclipticLongitude=0,this._sunEcl=new t$X,this._moonEcl=new t$X,this._sunEq=new t$X,this._moonEq=new t$X,this._eclipticToEquatorial=new p$1a,this._equatorialToGeographic=new p$1a,this._sunGeo=new t$X,this._moonGeo=new t$X,this._sunHoriz=new t$X,this._moonHoriz=new t$X,this._eclipticToHorizon=new p$1a,this._equatorialToHorizon=new p$1a,this._geographicToEquatorial=new p$1a,this._horizonToEquatorial=new p$1a,this._horizonToGeographic=new p$1a,this._geographicToHorizon=new p$1a,this._horizonToEcliptic=new p$1a,this._moonPhase=void 0,this._moonPhaseAngle=void 0,this._moonDistance=void 0,this._precession=new p$1a,this._forceSunHoriz=!1,this._forceMoonHoriz=!1,this._geoZUp=!0,this._primeMeridianZ=!1}function m$8(e,t,i){var r=new t$X;return r.x=e*Math.cos(i)*Math.cos(t),r.y=e*Math.sin(i)*Math.cos(t),r.z=e*Math.sin(t),r}function T$5(e){for(;e>2*Math.PI;)e-=2*Math.PI;for(;e<0;)e+=2*Math.PI;return e}function E$6(e){var t=new t$X;return t.x=e.y,t.y=e.z,t.z=e.x,t}function z$3(e){var t=new t$X;return t.x=e.z,t.y=e.x,t.z=e.y,t}function q$3(e){var t,i;if(e>e$27.toRadians(85))t=0;else{if(i=Math.tan(e),e>=e$27.toRadians(5))t=58.1/i-.07/Math.pow(i,3)+86e-6/Math.pow(i,5);else if(e>=e$27.toRadians(-.575)){var r=e$27.toDegrees(e);t=1735+r*(r*(103.4+r*(.711*r-12.79))-518.2)}else t=-20.774/i;t/=3600}return e+e$27.toRadians(t)}l$a.prototype._computeSun=function(e){var t=this._ephemeris.getSunPositionHorizon(),i=(t=t$X.normalize(t,O$4)).y;if(this._lastSunT!==this._T||this._lastSunZenith!==i){this._lastSunT=this._T,this._lastSunZenith=i;var r=e$27.toDegrees(Math.asin(t.y));r+=0,this._perezBlend=r>1?0:r<0?1:1-r;var n=Math.acos(i)-e$27.toRadians(0),o=e$27.toRadians(1),a=new G$4,s=new G$4,l=new G$4,u=new G$4;if(.5*Math.PI-n>o){this._sunAboveHorizon=!0,this._sunSpectrum.applyAtmosphericTransmittance(n,i,this._T,e,a,s),this._sunTransmittedLuminance=a.toXYZ(),this._sunScatteredLuminance=s.toXYZ(),e<1e3?(this._sunTransmittedLuminanceSeaLevel=this._sunTransmittedLuminance,this._sunScatteredLuminanceSeaLevel=this._sunScatteredLuminance):(this._sunSpectrum.applyAtmosphericTransmittance(n,i,this._T,0,l,u),this._sunTransmittedLuminanceSeaLevel=l.toXYZ(),this._sunScatteredLuminanceSeaLevel=u.toXYZ());for(var c=n/(.5*Math.PI),h=0;h<6;h++)c*=c;this._sunScatteredLuminance.x*=1+0*c,this._sunScatteredLuminance.y*=1+0*c,this._sunScatteredLuminance.z*=1+0*c,this._sunScatteredLuminanceSeaLevel.x*=1+0*c,this._sunScatteredLuminanceSeaLevel.y*=1+0*c,this._sunScatteredLuminanceSeaLevel.z*=1+0*c}else{this._sunAboveHorizon=!1;var d=Math.floor(r),f=Math.ceil(r);c=r-d;e$28(this._twilightLuminance[d])||(this._twilightLuminance[d]=0),e$28(this._twilightLuminance[f])||(this._twilightLuminance[f]=0);var p=this._twilightLuminance[d],_=this._twilightLuminance[f];n=.5*Math.PI-o;this._sunSpectrum.applyAtmosphericTransmittance(n,Math.cos(n),this._T,e,a,s),this._sunTransmittedLuminance=a.toXYZ(),this._sunScatteredLuminance=s.toXYZ(),e<1e3?(this._sunTransmittedLuminanceSeaLevel=this._sunTransmittedLuminance,this._sunScatteredLuminanceSeaLevel=this._sunScatteredLuminance):(this._sunSpectrum.applyAtmosphericTransmittance(n,Math.cos(n),this._T,0,l,u),this._sunTransmittedLuminanceSeaLevel=l.toXYZ(),this._sunScatteredLuminanceSeaLevel=u.toXYZ());var m=(1-c)*p+c*_,$=.25,g=m/$*.25,v=m/$*.5;(c=-r/2)>1&&(c=1),c<0&&(c=0);var y=0*m*(c*=c)+(1-c);t$X.multiplyByScalar(this._sunTransmittedLuminance,y,this._sunTransmittedLuminance),this._sunScatteredLuminance.x=g*c+this._sunScatteredLuminance.x*(1-c),this._sunScatteredLuminance.y=m*c+this._sunScatteredLuminance.y*(1-c),this._sunScatteredLuminance.z=v*c+this._sunScatteredLuminance.z*(1-c),y=0*m*c+(1-c),t$X.multiplyByScalar(this._sunScatteredLuminanceSeaLevel,y,this._sunScatteredLuminanceSeaLevel),this._sunScatteredLuminanceSeaLevel.x=g*c+this._sunScatteredLuminanceSeaLevel.x*(1-c),this._sunScatteredLuminanceSeaLevel.y=m*c+this._sunScatteredLuminanceSeaLevel.y*(1-c),this._sunScatteredLuminanceSeaLevel.z=v*c+this._sunScatteredLuminanceSeaLevel.z*(1-c),this._sunScatteredLuminance.x*=1,this._sunScatteredLuminance.y*=1,this._sunScatteredLuminance.z*=1,this._sunScatteredLuminanceSeaLevel.x*=1,this._sunScatteredLuminanceSeaLevel.y*=1,this._sunScatteredLuminanceSeaLevel.z*=1}}},l$a.prototype._moonLuminance=function(){var e=this._ephemeris.getMoonPositionHorizon();t$X.clone(e,p$4),t$X.normalize(p$4,p$4);var t=e$27.toDegrees(Math.asin(p$4.z)),i=1738100,r=1e3*this._ephemeris.getMoonDistanceKM(),n=.001,o=this._ephemeris.getMoonPhaseAngle();o<n&&(o=n);for(var a=Math.PI-o;a<0;)a+=2*Math.PI;a<n&&(a=n);var s=683*(.144*i*i/(3*r*r)*(.095*(1-Math.sin(o/2)*Math.tan(o/2)*Math.log(1/Math.tan(o/4)))+1905*(1-Math.sin(a/2)*Math.tan(a/2)*Math.log(1/Math.tan(a/4)))))/3.14;return s*=.001,t<0&&(s*=Math.exp(1.1247*t)),s},l$a.prototype._computeMoon=function(e){var t=this._ephemeris.getMoonPositionHorizon();t$X.clone(t,p$4),t$X.normalize(p$4,p$4);var i=p$4.z,r=Math.acos(i),n=this._ephemeris.getMoonPhase();if(this._lastMoonT!==this._T||this._lastMoonZenith!==r||this._lastMoonPhase!==n){this._lastMoonT=this._T,this._lastMoonZenith=r,this._lastMoonPhase=n,this._lightingChanged=!0;var o=new G$4,a=new G$4;this._lunarSpectrum.applyAtmosphericTransmittance(r,i,this._T,e,o,a);var s=this._moonLuminance();this._moonTransmittedLuminance=t$X.multiplyByScalar(o.toXYZ(),s,new t$X),this._moonScatteredLuminance=t$X.multiplyByScalar(a.toXYZ(),s,new t$X);var l=new G$4,u=new G$4;this._lunarSpectrum.applyAtmosphericTransmittance(r,i,this._T,0,l,u),this._moonTransmittedLuminance=t$X.multiplyByScalar(o.toXYZ(),s,new t$X),this._moonScatteredLuminance=t$X.multiplyByScalar(a.toXYZ(),s,new t$X),this._moonTransmittedLuminanceSeaLevel=t$X.multiplyByScalar(l.toXYZ(),s,new t$X),this._moonScatteredLuminanceSeaLevel=t$X.multiplyByScalar(u.toXYZ(),s,new t$X)}},l$a.prototype.getSunColor=function(){var e=t$X.multiplyByScalar(this._sunTransmittedLuminance,1,new t$X);a$5.durandMapperXYZ(e);var t=p$1a.multiplyByVector(P$4,e,new t$X);return this._applyGamma(t),new e$1S(t.x,t.y,t.z)},l$a.prototype._updateZenith=function(e){var t=this._ephemeris.getSunPositionHorizon();t$X.normalize(t,t),new t$X(0,1,0);this._isothermalEffect=Math.exp(-e/8435),this._isothermalEffect<0&&(this._isothermalEffect=0),this._isothermalEffect>1&&(this._isothermalEffect=1)},l$a.prototype._nightSkyLuminance=function(){return 683*(this._lightPollution+2e-6+12e-8+3e-8+51e-9+9.1e-9+9.1e-10)/3.14*this._isothermalEffect*.001*this._nightSkyScale},l$a.prototype._applyGamma=function(e){var t=0;e.x<t&&(t=e.x),e.y<t&&(t=e.y),e.z<t&&(t=e.z),t=-t,e.x=e.x+t,e.y=e.y+t,e.z=e.z+t;var i=e.x;e.y>i&&(i=e.y),e.z>i&&(i=e.z),i>1&&(e.x/=i,e.y/=i,e.z/=i);var r=this._oneOverGammaHosek;e.x>0&&(e.x=Math.pow(e.x,r)),e.y>0&&(e.y=Math.pow(e.y,r)),e.z>0&&(e.z=Math.pow(e.z,r))},l$a.prototype._computeLogAvg=function(){var e,t,i=new t$X;t$X.add(this._sunScatteredLuminance,this._moonScatteredLuminance,i),t$X.add(i,this._moonTransmittedLuminance,i),i.y+=1e3*this._nightSkyLuminance(),e=i.y,t=-.702*i.x+1.039*i.y+.433*i.z,a$5.setSceneLogAvg(t,e)},l$a.prototype._computeToneMappedSkyLight=function(){var e=t$X.multiplyByScalar(this._sunScatteredLuminance,.5,new t$X);e.y+=1e3*this._nightSkyLuminance();var t=t$X.multiplyByScalar(this._moonScatteredLuminance,.5,new t$X),i=t$X.multiplyByScalar(this._sunScatteredLuminanceSeaLevel,.5,new t$X);i.y+=1e3*this._nightSkyLuminance();var r=t$X.multiplyByScalar(this._moonScatteredLuminanceSeaLevel,.5,new t$X);a$5.durandMapperXYZ(e),a$5.durandMapperXYZ(t),a$5.durandMapperXYZ(i),a$5.durandMapperXYZ(r);var n=t$X.add(e,t,new t$X);n.x>this._maxSkylightLuminance&&(n.x=this._maxSkylightLuminance),n.y>this._maxSkylightLuminance&&(n.y=this._maxSkylightLuminance),n.z>this._maxSkylightLuminance&&(n.z=this._maxSkylightLuminance);var o=p$1a.multiplyByVector(P$4,n,new t$X);this._monochromeAmbient&&(o.x=o.z=o.y),this._applyGamma(o),this._skyLight=new e$1S(o.x,o.y,o.z),(n=t$X.add(i,r,n)).x>this._maxSkylightLuminance&&(n.x=this._maxSkylightLuminance),n.y>this._maxSkylightLuminance&&(n.y=this._maxSkylightLuminance),n.z>this._maxSkylightLuminance&&(n.z=this._maxSkylightLuminance),o=p$1a.multiplyByVector(P$4,n,new t$X),this._monochromeAmbient&&(o.x=o.z=o.y),this._applyGamma(o),this._skyLightSeaLevel=new e$1S(o.x,o.y,o.z)},l$a.prototype.setEphemeris=function(e,t){this._ephemeris=e,this._lightingChanged=!1,this._computeSun(t),this._computeMoon(t),this._updateZenith(t),this._computeLogAvg(),this._computeToneMappedSkyLight()},e$2.prototype.setTimeZone=function(e){e>=-12&&e<=12&&(this.zoneCorrection=e)},e$2.prototype.getEpoch2000Centuries=function(e){var t,i,r,n,o=this.hours+(this.minutes+this.seconds/60)/60;this.observingDST&&(o-=1),o-=this.zoneCorrection,r=this.day+o/24,this.month<3?(t=this.year-1,i=this.month+12):(t=this.year,i=this.month),n=1720996.5-Math.floor(t/100)+Math.floor(t/400)+Math.floor(365.25*t)+Math.floor(30.6001*(i+1));var a=(n-=2451545)+r;return e&&(a+=65/60/60/24),a/=36525},e$2.prototype.getEpoch1990Days=function(e){var t,i,r,n,o=this.hours+(this.minutes+this.seconds/60)/60;this.observingDST&&(o-=1),o-=this.zoneCorrection,n=this.day+o/24,this.month<3?(t=this.year-1,i=this.month+12):(t=this.year,i=this.month),r=1720996.5-Math.floor(t/100)+Math.floor(t/400)+Math.floor(365.25*t)+Math.floor(30.6001*(i+1));var a=(r-=2447891.5)+n;return e&&(a+=65/60/60/24),a},e$2.prototype.clone=function(e){return e.year=this.year,e.month=this.month,e.day=this.day,e.hours=this.hours,e.minutes=this.minutes,e.seconds=this.seconds,e},Object.defineProperties(i$7.prototype,{longitude:{get:function(){return this._longitude},set:function(e){e>=-180&&e<=180&&(this._longitude=e)}},latitude:{get:function(){return this._latitude},set:function(e){e>=-90&&e<=90&&(this._latitude=e)}},altitude:{get:function(){return this._altitude},set:function(e){this._altitude=e}}}),i$7.prototype.clone=function(e){return e._latitude=this.latitude,e._longitude=this.longitude,e._altitude=this.altitude,e},a$4.prototype.getSunPositionGeographic=function(){return this._sunGeo},a$4.prototype.getSunPositionHorizon=function(){return this._sunHoriz},a$4.prototype.computeMoonPosition=function(){var e=this._T,t=6.23+628.3019*e,i=1.628+8433.4663*e,r=2.3554+8328.6911*e,n=5.1985+7771.3772*e,o=3.8104+8399.7091*e+.1098*Math.sin(r)+.0222*Math.sin(2*n-r)+.0115*Math.sin(2*n)+.0037*Math.sin(2*r)-.0032*Math.sin(t)-.002*Math.sin(2*i)+.001*Math.sin(2*n-2*r)+.001*Math.sin(2*n-t-r)+9e-4*Math.sin(2*n+r)+8e-4*Math.sin(2*n-t)+7e-4*Math.sin(r-t)-6e-4*Math.sin(n)-5e-4*Math.sin(t+r),a=.0895*Math.sin(i)+.0049*Math.sin(r+i)+.0048*Math.sin(r-i)+.003*Math.sin(2*n-i)+.001*Math.sin(2*n+i-r)+8e-4*Math.sin(2*n-i-r)+6e-4*Math.sin(2*n+i),s=1/(.016593+904e-6*Math.cos(r)+166e-6*Math.cos(2*n-r)+137e-6*Math.cos(2*n)+49e-6*Math.cos(2*r)+15e-6*Math.cos(2*n+r)+9e-6*Math.cos(2*n-t));this._moonEcl=m$8(s,a,o),this._moonEq=p$1a.multiplyByVector(this._eclipticToEquatorial,this._moonEcl,this._moonEq),this._moonGeo=p$1a.multiplyByVector(this._equatorialToGeographic,this._moonEq,this._moonGeo),this._moonHoriz=p$1a.multiplyByVector(this._eclipticToHorizon,this._moonEcl,new t$X),this._moonDistance=6378.137*t$X.distance(this._moonHoriz,new t$X(1,0,0)),o=T$5(o),this._sunEclipticLongitude=T$5(this._sunEclipticLongitude),this._moonPhaseAngle=o-this._sunEclipticLongitude,this._moonPhaseAngle=T$5(this._moonPhaseAngle),this._moonPhase=.5*(1-Math.cos(this._moonPhaseAngle))};var u$9=new t$X;function G$3(e,t){var i=Math.sin(-e),r=Math.cos(-e);t[0]=1,t[3]=0,t[6]=0,t[1]=0,t[4]=r,t[7]=i,t[2]=0,t[5]=-i,t[8]=r}function v$7(e,t){var i=Math.sin(-e),r=Math.cos(-e);t[0]=r,t[3]=0,t[6]=-i,t[1]=0,t[4]=1,t[7]=0,t[2]=i,t[5]=0,t[8]=r}function f$9(e,t){var i=Math.sin(-e),r=Math.cos(-e);t[0]=r,t[3]=i,t[6]=0,t[1]=-i,t[4]=r,t[7]=0,t[2]=0,t[5]=0,t[8]=1}a$4.prototype.computeSunPosition=function(){var e=this._T,t=6.24+628.302*e,i=4.895048+628.331951*e+(.033417-84e-6*e)*Math.sin(t)+351e-6*Math.sin(2*t),r=1.00014-(.016708-42e-6*e)*Math.cos(t)-141e-6*Math.cos(2*t);if(this._sunEclipticLongitude=i,this._sunEcl=m$8(r,0,i),this._sunEq=p$1a.multiplyByVector(this._eclipticToEquatorial,this._sunEcl,this._sunEq),u$9=p$1a.multiplyByVector(this._equatorialToGeographic,this._sunEq,u$9),this._geoZUp?(this._sunGeo.x=u$9.x,this._sunGeo.y=u$9.y,this._sunGeo.z=u$9.z):this._primeMeridianZ?(this._sunGeo.x=u$9.y,this._sunGeo.y=u$9.z,this._sunGeo.z=u$9.x):(this._sunGeo.x=u$9.x,this._sunGeo.y=u$9.z,this._sunGeo.z=-u$9.y),this._forceSunHoriz)this._sunHoriz.x=sin(forcedSunAzimuth)*cos(forcedSunAltitude),this._sunHoriz.z=-cos(forcedSunAzimuth)*cos(forcedSunAltitude),this._sunHoriz.y=sin(forcedSunAltitude),this._sunHoriz.Normalize(),this._geoZUp?this._sunGeo=horizonToGeographic*z$3(sunHoriz):this._sunGeo=E$6(horizonToGeographic*z$3(sunHoriz)),this._sunEcl=horizonToEcliptic*z$3(sunHoriz),this._sunEq=horizonToEquatorial*z$3(sunHoriz);else{var n=new t$X;n=p$1a.multiplyByVector(this._eclipticToHorizon,this._sunEcl,n),this._sunHoriz=E$6(n)}var o=t$X.normalize(this._sunHoriz,new t$X),a=t$X.distance(this._sunHoriz,t$X.ZERO),s=Math.asin(o.y);s=q$3(s),this._sunHoriz.y=a*Math.sin(s)},a$4.prototype.getSunPositionHorizon=function(){return this._sunHoriz},a$4.prototype.getMoonPositionHorizon=function(){return this._moonHoriz},a$4.prototype.getMoonPhase=function(){return this._moonPhase},a$4.prototype.getMoonDistanceKM=function(){return this._moonDistance},a$4.prototype.getMoonPhaseAngle=function(){return this._moonPhaseAngle};var M$5=new p$1a,g$8=new p$1a,y$7=new p$1a;function n$7(){this._ambientColor=new e$1S,this._sunColor=new e$1S,this._sky=new l$a,this._ephemeris=new a$4,this._localTime=new e$2,this._location=new i$7,this._atmosphereHeight=1e5,this._renderError=new o$1o,this._basis3=new p$1a,this._invBasis3=new p$1a,this._upVector=new t$X(0,0,1),this._rightVector=new t$X(-1,0,0),this._sceneMode=P$$.SCENE3D}a$4.prototype.update=function(e,t){var i=!1;if(e!==this._lastTime&&(i=!0,this._lastTime=e.clone(this._lastTime)),t!==this._lastLocation&&(i=!0,this._lastLocation=t.clone(this._lastLocation)),i){var r=this._T=e.getEpoch2000Centuries(!0);this._tuncorr=e.getEpoch2000Centuries(!1),this._epochDays=e.getEpoch1990Days(!1),f$9(.01118*r,M$5),v$7(-.00972*r,g$8),f$9(.01118*r,y$7);var n=p$1a.multiply(M$5,g$8,new p$1a);this._precession=p$1a.multiply(n,y$7,this._precession);var o=4.894961+230121.675315*this._tuncorr,a=o+e$27.toRadians(t.longitude),s=e$27.toRadians(t.latitude),l=.409093-227e-6*this._T;v$7(s-Math.PI/2,g$8),f$9(-a,y$7),G$3(l,M$5),n=p$1a.multiply(g$8,y$7,n),p$1a.multiply(n,this._precession,this._equatorialToHorizon),p$1a.multiply(n,M$5,this._eclipticToHorizon),p$1a.clone(M$5,this._eclipticToEquatorial),f$9(-o,this._equatorialToGeographic),p$1a.transpose(this._equatorialToGeographic,this._geographicToEquatorial),p$1a.transpose(this._equatorialToHorizon,this._horizonToEquatorial),p$1a.multiply(this._equatorialToGeographic,this._horizonToEquatorial,this._horizonToGeographic),p$1a.multiply(this._equatorialToHorizon,this._geographicToEquatorial,this._geographicToHorizon),p$1a.inverse(this._eclipticToHorizon,this._horizonToEcliptic),this.computeSunPosition(),this.computeMoonPosition()}};var T$4=new e$1S(1,.96,.94,1);function u$8(e){var t=0;e.red<t&&(t=e.red),e.green<t&&(t=e.green),e.blue<t&&(t=e.blue),t=-t,e.red+=t,e.green+=t,e.blue+=t;var i=e.red;e.green>i&&(i=e.green),e.blue>i&&(i=e.blue),i>1&&(e.red/=i,e.green/=i,e.blue/=i),e.red<0&&(e.red=0),e.green<0&&(e.green=0),e.blue<0&&(e.blue=0),e.a<0&&(e.a=0)}n$7.prototype._interpolate=function(e,t){var i=(this._atmosphereHeight+.5*this._atmosphereHeight-this._location.altitude)/(.5*this._atmosphereHeight);return i>1&&(i=1),i<0&&(i=0),e$1S.lerp(e,t,i,new e$1S)},n$7.prototype.getAmbientColor=function(){var e=this._sky.getToneMappedSkyLight();return u$8(e),this._location.altitude>this._atmosphereHeight&&(e=this._interpolate(new e$1S(0,0,0,1),e)),e},n$7.prototype.getSunColor=function(){var e=this._sky.getSunColor();return u$8(e),this._location.altitude>this._atmosphereHeight&&(e=this._interpolate(T$4,e)),e},n$7.prototype.getSunPosition=function(){if(this._sceneMode==P$$.SCENE3D)return this.getSunPositionGeographic();var e=new t$X;return e=t$X.clone(this._ephemeris.getSunPositionHorizon(),e),t$X.normalize(e,e),p$1a.multiplyByVector(this._basis3,e,e),e},n$7.prototype.getSunPositionGeographic=function(){return this._ephemeris.getSunPositionGeographic()},n$7.prototype._computeLocalTime=function(e){var t=a$12.toGregorianDate(e);this._localTime.year=t.year,this._localTime.month=t.month,this._localTime.day=t.day,this._localTime.hours=t.hour,this._localTime.minutes=t.minute,this._localTime.seconds=t.second,this._localTime.setTimeZone(0)},n$7.prototype.setLocation=function(e){this._location.longitude=e$27.toDegrees(e.longitude),this._location.latitude=e$27.toDegrees(e.latitude),this._location.altitude=e.height};var _$6=new t$X,g$7=new t$X,l$9=new t$X;n$7.prototype.updateBasis=function(){this.getXYZ(_$6,g$7,l$9,this._upVector,this._rightVector,!0),this.getBases(this._basis3,this._invBasis3,_$6,g$7,l$9)},n$7.prototype.getXYZ=function(e,t,i,r,n){i=t$X.cross(n,r,i),t$X.normalize(i,i),e=t$X.cross(r,i,e),t$X.normalize(e,e),t=t$X.cross(i,e,t),t$X.normalize(t,t)},n$7.prototype.getBases=function(e,t,i,r,n){e[0]=i.x,e[3]=i.y,e[6]=i.z,e[1]=r.x,e[4]=r.y,e[7]=r.z,e[2]=n.x,e[5]=n.y,e[8]=n.z,t[0]=i.x,t[3]=r.x,t[6]=n.x,t[1]=i.y,t[4]=r.y,t[7]=n.y,t[2]=i.z,t[5]=r.z,t[8]=n.z},n$7.prototype.update=function(e,t){try{this._sceneMode=t,this._sceneMode==P$$.SCENE3D||this.updateBasis(),this.setLocation(e.camera.positionCartographic),this._computeLocalTime(e.time),this._ephemeris.update(this._localTime,this._location),this._sky.setEphemeris(this._ephemeris,this._location.altitude)}catch(e){this._renderError.raiseEvent(this,e)}};var et$2=function(e){return function(){e.frameState.afterRender.push((function(){e.requestRender()}))}};function fo(e,t,i){this.ray=e,this.width=t,this.primitives=i,this.ready=!1,this.deferred=o$1q.defer(),this.promise=this.deferred.promise}function F$4(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).canvas,i=e.contextOptions,r=e.creditContainer,n=e.creditViewport;if(!e$28(t))throw new t$Z("options and options.canvas are required.");var o=e$28(r),a=new d$s(t,i);o||((r=document.createElement("div")).style.position="absolute",r.style.bottom="0",r.style["text-shadow"]="0 0 2px #000000",r.style.color="#ffffff",r.style["font-size"]="10px",r.style["padding-right"]="5px",t.parentNode.appendChild(r)),e$28(n)||(n=t.parentNode),this._id=e$1K(),this._jobScheduler=new o$i,this._frameState=new h$c(a,new r$k(r,"_",n),this._jobScheduler),this._frameState.scene3DOnly=u$Y(e.scene3DOnly,!1),this._removeCreditContainer=!o,this._creditContainer=r;var s=new n$p(a);s.viewport=new f$10,s.viewport.x=0,s.viewport.y=0,s.viewport.width=a.drawingBufferWidth,s.viewport.height=a.drawingBufferHeight,this._passState=s,this._canvas=t,this._context=a,this._computeEngine=new f$n(a),this._globe=void 0,this._primitives=new o$I,this._groundPrimitives=new o$I,this._asyncRayPicks=[],this._logDepthBuffer=a.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new s$a,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._overlayAgainstDepthCommandList=[],this._logDepthOverlayCommandList=[],this._useOIT=u$Y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new c$d,this._clearColorCommand=new r$11({color:new e$1S,stencil:0,owner:this}),this._depthClearCommand=new r$11({depth:1,owner:this}),this._stencilClearCommand=new r$11({stencil:0}),this._classificationStencilClearCommand=new r$11({stencil:0,renderState:u$R.fromCache({stencilMask:Fa$6.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._pickRenderStateCache={},this._transitioner=new R$7(this),this._preUpdate=new o$1o,this._postUpdate=new o$1o,this._renderError=new o$1o,this._preRender=new o$1o,this._postRender=new o$1o,this._pickPositionCache={},this._pickPositionCacheDirty=!1,this._minimumDisableDepthTestDistance=0,this._customRequestHeaders=e.customRequestHeaders,this.frustumTolerance=0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new o$1o,this.morphComplete=new o$1o,this.skyBox=void 0,this._cloudBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=e$1S.clone(e$1S.BLACK),this._mode=P$$.SCENE3D,this._mapProjection=e$28(e.mapProjection)?e.mapProjection:new n$1b,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e11,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=!0,this.cameraEventWaitTime=500,this.fog=new h$d,this._sunCamera=new v$n(this),this.shadowMap=new F$j({context:a,lightCamera:this._sunCamera,enabled:u$Y(e.shadows,!1)}),this._analysisShadowMap=void 0,this.invertClassification=!1,this.invertClassificationColor=e$1S.clone(e$1S.WHITE),this._actualInvertClassificationColor=e$1S.clone(this._invertClassificationColor),this._invertClassification=new t$7,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new f$a,this._brdfLutGenerator=new t$9,this._terrainExaggeration=u$Y(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ua(this),this._mapMode2D=u$Y(e.mapMode2D,Jt$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,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostEffect:!1,usePostProcessSelected:!1,useWebVR:!1},this._environmentVisible={isSunVisible:!0,isMoonVisible:!0,isSkyAtmosphereVisible:!0,isSkyBoxVisible:!0,isUnderGlobeVisible:!0,isGlobalVisible:!0,isObjectVisible:!0,isOnlyS3MObjectVisible:!1,isBillboardVisible:!0},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=u$Y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=u$Y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=r$1b.requestCompletedEvent.addEventListener(et$2(this)),this._removeTaskProcessorListenerCallback=i$W.taskCompletedEvent.addEventListener(et$2(this)),this._removeGlobeCallbacks=[];var l=new f$10(0,0,a.drawingBufferWidth,a.drawingBufferHeight),u=new v$n(this);this._logDepthBuffer&&(u.frustum.near=.1,u.frustum.far=1e10),this.preloadFlightCamera=new v$n(this),this.preloadFlightCullingVolume=void 0,this._picking=new d$g(this);var c=new f$10(0,0,1,1),h=new v$n(this);h.frustum=new a$X({width:.1,aspectRatio:1,near:.1}),this._view=new L$c(this,u,l),this._pickOffscreenView=new L$c(this,h,c),this.pickOffscreenDefaultWidth=.1,this._defaultView=new L$c(this,u,l),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this._sunColor=new t$X(1.8,1.85,2),this._lightGroup=Ct$2.SUN_LIGHT,this._presetLightSource=[],this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this._supportCompressType=0,a.s3tc?this._supportCompressType=1:a.pvrtc?this._supportCompressType=2:a.etc1&&(this._supportCompressType=3),this._layers=new h$8,to._attachLayers(this._layers),this._undergroundMode=!1,this._undergroundDepth=1e3,this._underGlobe=new t$6(this._undergroundDepth,!1),this._analyst3D=new h$8,this._vectorTileMaps=new h$8,this._vectorTileSource=new e$1P,this._multiViewportMode=te$6.NONE,this._multiViewportInfo=[],this._lightSource=new h$l(a),this.compositor=new o$r(a),pi(this,0,a$12.now()),Ie$2(this),this.initializeFrame(),this._pickPointEnabled=!1,this._pickPointInterval=200,this._pos=void 0,this._pickPointTolerance=3,this._pickTolerance=3,this._pickDepthTolerance=0,this._rasterPickTexture=void 0,this._rasterPickFBO=void 0,this.voxelGridPostRender=new a$7({}),this.particlePostRender=new u$d({}),this.particleTrailsPostRenderer=new r$f({}),this._pickResult={pickFrameNumber:-1,pickObject:void 0},this._walkingMode=ni.NONE,this._pickRect=void 0,this._isUpdatePickCommand=!1,this._pickRectFramebuffer=void 0,this._mvtVisibleControl=!1,this._mvtVisibleLevel=0,this._maskEnabled=!1,this._enableCompositor=!0,this._overlapDisplayedThreshold=0,this._overlapDisplayOptions={allowIconWithTextDisplay:!0},this._pbrMaterlParameters=[],this._saveLocalCachePerformance=!0,this._toneMappingExposure=1,this.RSAAuthenticationStatus={},this._silverLightingAtmosphere=new n$7,a.uniformState._silverLightingAtmosphere=this._silverLightingAtmosphere}function mo(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];e$28(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(et$2(e))),r.push(t.terrainProviderChanged.addEventListener(et$2(e)))),e._removeGlobeCallbacks=r}function ho(e,t){e.enableVertexCapture(t)}function po(e,t){e.disableVertexCapture(t)}function mi(e,t,i){var r=e._frameState,n=e._context,o=e._view.oit,a=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,l=t.derivedCommands;e$28(t.pickId)&&(l.picking=_$g.createPickDerivedCommand(e,t,n,l.picking)),!t.pickOnly&&t.pass!==Le$p.TERRAIN_CLASSIFICATION&&t.pass!==Le$p.ClampObject&&(l.depth=_$g.createDepthOnlyDerivedCommand(e,t,n,l.depth)),r.passes.normal&&(l.normal=_$g.createNormalDerivedCommand(t,n)),l.originalCommand=t,e._hdr&&(l.hdr=_$g.createHdrCommand(t,n,l.hdr),l=(t=l.hdr.command).derivedCommands),s&&t.receiveShadows&&(l.shadows=F$j.createReceiveDerivedCommand(a,t,i,n,l.shadows)),t.pass===Le$p.TRANSLUCENT&&e$28(o)&&o.isSupported()&&(s&&t.receiveShadows?(l.oit=e$28(l.oit)?l.oit:{},l.oit.shadows=o.createDerivedCommands(l.shadows.receiveCommand,n,l.oit.shadows)):l.oit=o.createDerivedCommands(t,n,l.oit)),t.pass===Le$p.Voxel_Billboard&&e$28(e.voxelGridPostRender)&&e.voxelGridPostRender.createDerivedCommands(t),t.pass===Le$p.Particle&&e$28(e.particlePostRender)&&e.particlePostRender.createDerivedCommands(t),e._maskEnabled&&(l.mask=_$g.createMaskCommand(t,n,l.mask))}Object.defineProperties(F$4.prototype,{toneMappingExposure:{get:function(){return this._toneMappingExposure},set:function(e){this._toneMappingExposure=e}},canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},maximumAliasedLineWidth:{get:function(){return e$1U.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return e$1U.maximumCubeMapSize}},pickPositionSupported:{get:function(){return!0}},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 u$z.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,mo(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}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(e$28(this.globe))return this.globe.imageryLayers}},terrainLayers:{get:function(){if(e$28(this.globe))return this.globe.terrainLayers}},terrainProvider:{get:function(){if(e$28(this.globe))return this.globe.terrainProvider},set:function(e){e$28(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(e$28(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}},customRequestHeaders:{get:function(){return this._customRequestHeaders},set:function(e){this._customRequestHeaders=e}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){if(this.scene3DOnly&&e!==P$$.SCENE3D)throw new t$Z("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===P$$.SCENE2D)this.morphTo2D(0);else if(e===P$$.SCENE3D)this.morphTo3D(0);else{if(e!==P$$.COLUMBUS_VIEW)throw new t$Z("value must be a valid SceneMode enumeration.");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},set:function(e){this._terrainExaggeration!==e&&e$28(this.globe)&&this.globe._surface.invalidateAllTiles(),this._terrainExaggeration=e}},useWebVR:{get:function(){return this._useWebVR},set:function(e){if(this.camera.frustum instanceof a$X)throw new t$Z("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new v$n(this),e$28(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new h$e(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}},globeSplitPosition:{get:function(){return this._frameState.globeSplitPosition},set:function(e){this._frameState.globeSplitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){if(!e$28(e)||e<0)throw new t$Z("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");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,this._defaultView.updateFrustums=!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,i=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=i!==this._hdr,this._hdr=i}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},sunColor:{get:function(){return this._sunColor},set:function(e){this._sunColor=e}},opaqueFrustumNearOffset:{get:function(){return this._frameState.useLogDepth?.9:.9999}},layers:{get:function(){return this._layers}},multiViewportMode:{get:function(){return this._multiViewportMode},set:function(e){switch(this._multiViewportInfo.length=0,e){case te$6.NONE:this._frameState.multiViewportIndex=-1;break;case te$6.HORIZONTAL:this._multiViewportInfo[0]=new f$10(0,0,.5,1),this._multiViewportInfo[1]=new f$10(.5,0,.5,1);break;case te$6.VERTICAL:this._multiViewportInfo[0]=new f$10(0,.5,1,.5),this._multiViewportInfo[1]=new f$10(0,0,1,.5);break;case te$6.QUAD:this._multiViewportInfo[0]=new f$10(0,.5,.5,.5),this._multiViewportInfo[1]=new f$10(.5,.5,.5,.5),this._multiViewportInfo[2]=new f$10(.5,0,.5,.5),this._multiViewportInfo[3]=new f$10(0,0,.5,.5);break;case te$6.TRIPLE:this._multiViewportInfo[2]=new f$10(0,.5,.5,.5),this._multiViewportInfo[1]=new f$10(.5,.5,.5,.5),this._multiViewportInfo[0]=new f$10(0,0,1,.5);break;case te$6.VerticalTrisection:this._multiViewportInfo[2]=new f$10(2/3,0,1/3,1),this._multiViewportInfo[1]=new f$10(1/3,0,1/3,1),this._multiViewportInfo[0]=new f$10(0,0,1/3,1);break;case te$6.FIVE_DIVISIONS:this._multiViewportInfo[4]=new f$10(0,0,.5,.5),this._multiViewportInfo[3]=new f$10(0,.5,.5,.5),this._multiViewportInfo[2]=new f$10(.5,0,.5,1/3),this._multiViewportInfo[1]=new f$10(.5,1/3,.5,1/3),this._multiViewportInfo[0]=new f$10(.5,2/3,.5,1/3);break;case te$6.SIX_DIVISIONS:this._multiViewportInfo[5]=new f$10(2/3,0,1/3,1/3),this._multiViewportInfo[4]=new f$10(2/3,1/3,1/3,1/3),this._multiViewportInfo[3]=new f$10(2/3,2/3,1/3,1/3),this._multiViewportInfo[2]=new f$10(1/3,0,1/3,1/3),this._multiViewportInfo[1]=new f$10(0,0,1/3,1/3),this._multiViewportInfo[0]=new f$10(0,1/3,2/3,2/3);break;case te$6.SEVEN_DIVISIONS:this._multiViewportInfo[6]=new f$10(0,0,.3,.5),this._multiViewportInfo[5]=new f$10(.3,0,.4,1/3),this._multiViewportInfo[4]=new f$10(.7,0,.3,.5),this._multiViewportInfo[3]=new f$10(.7,.5,.3,.5),this._multiViewportInfo[2]=new f$10(.3,2/3,.4,1/3),this._multiViewportInfo[1]=new f$10(0,.5,.3,.5),this._multiViewportInfo[0]=new f$10(.3,1/3,.4,1/3);break;case te$6.EIGHT_DIVISIONS:this._multiViewportInfo[0]=new f$10(.5,0,.5,1/3),this._multiViewportInfo[1]=new f$10(0,0,.5,1/3),this._multiViewportInfo[2]=new f$10(2/3,1/3,1/3,1/3),this._multiViewportInfo[3]=new f$10(1/3,1/3,1/3,1/3),this._multiViewportInfo[4]=new f$10(0,1/3,1/3,1/3),this._multiViewportInfo[5]=new f$10(2/3,2/3,1/3,1/3),this._multiViewportInfo[6]=new f$10(1/3,2/3,1/3,1/3),this._multiViewportInfo[7]=new f$10(0,2/3,1/3,1/3);break;case te$6.NINE_DIVISIONS:this._multiViewportInfo[8]=new f$10(2/3,0,1/3,1/3),this._multiViewportInfo[7]=new f$10(1/3,0,1/3,1/3),this._multiViewportInfo[6]=new f$10(0,0,1/3,1/3),this._multiViewportInfo[5]=new f$10(2/3,1/3,1/3,1/3),this._multiViewportInfo[4]=new f$10(1/3,1/3,1/3,1/3),this._multiViewportInfo[3]=new f$10(0,1/3,1/3,1/3),this._multiViewportInfo[2]=new f$10(2/3,2/3,1/3,1/3),this._multiViewportInfo[1]=new f$10(1/3,2/3,1/3,1/3),this._multiViewportInfo[0]=new f$10(0,2/3,1/3,1/3);break;default:throw new t$Z("the mode is error")}e!==te$6.NONE&&this._multiViewportMode===te$6.NONE?(this._frameState.creditDisplay.container.style.visibility="hidden",!e$28(this._deviceOrientationCameraController)&&this._useWebVR&&(this._deviceOrientationCameraController=new h$e(this),this._aspectRatioVR=this._camera.frustum.aspectRatio)):e===te$6.NONE&&this._multiViewportMode!==te$6.NONE&&(this._frameState.creditDisplay.container.style.visibility="visible",this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this.drawingBufferWidth/this.drawingBufferHeight),this._multiViewportMode=e}},undergroundMode:{get:function(){return this._undergroundMode},set:function(e){e$28(e)&&(this._undergroundMode=e,this._underGlobe.show=e)}},underGlobe:{get:function(){return this._underGlobe}},undergroundDepth:{get:function(){return this._undergroundDepth},set:function(e){e!==this._undergroundDepth&&e$28(this._underGlobe)&&(this._underGlobe.underDepth=e),this._undergroundDepth=e}},lightSource:{get:function(){return this._lightSource}},cloudBox:{get:function(){return this._cloudBox},set:function(e){e$28(e)||e$28(this._cloudBox)&&this.cloudBox.remove(),this._cloudBox=e}},enableOcclude:{get:function(){return this._enableOcclude},set:function(e){this._enableOcclude=e}},bloomEffect:{get:function(){return LicenseChecker.LICENSECHECKER.verify("Scene_bloomEffect"),this.compositor.bloomEffect}},scanEffect:{get:function(){return LicenseChecker.LICENSECHECKER.verify("Scene_scanEffect"),this.compositor.scanEffect}},depthOfFieldEffect:{get:function(){return this.compositor.depthOfFieldEffect}},ssaoEffect:{get:function(){return this.compositor.SSAOEffect}},colorCorrection:{get:function(){return this.compositor.colorCorrection}},hdrEnabled:{get:function(){return LicenseChecker.LICENSECHECKER.verify("Scene_hdrEnabled"),this._hdr},set:function(e){LicenseChecker.LICENSECHECKER.verify("Scene_hdrEnabled");var t=this._context,i=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=i!==this._hdr,this._hdr=i}},toneMappingEnabled:{get:function(){return this.compositor.toneMappingEnabled},set:function(e){return this.compositor.toneMappingEnabled=e}},pickPoint:{get:function(){return this._pos}},pickPointEnabled:{get:function(){return this._pickPointEnabled},set:function(e){this._pickPointEnabled=e;for(var t=0;t<this._layers._layerQueue.length;t++){var i={};i.layer=this._layers._layerQueue[t],i.layer instanceof _0x47d916&&(e?i.layer.traverseRenderEntity(i,ho):i.layer.traverseRenderEntity(i,po))}}},pickPointInterval:{get:function(){return this._pickPointInterval},set:function(e){this._pickPointInterval=e}},pickPointTolerance:{get:function(){return this._pickPointTolerance},set:function(e){this._pickPointTolerance=e}},pickDepthTolerance:{get:function(){return this._pickDepthTolerance},set:function(e){this._pickDepthTolerance=e}},rasterVectorCollection:{get:function(){return this.globe._rasterVectorCollection}},walkingMode:{get:function(){return this._walkingMode},set:function(e){if(e!==this._walkingMode){this._walkingMode=e;var t=this._screenSpaceCameraController;t.previousHeight=void 0,e===ni.ByKeyboard?(t.enableWalk=!0,t.enableLook=!1,this.mode===P$$.SCENE3D?t.enableTranslate=!1:this.mode===P$$.COLUMBUS_VIEW&&(t.enableTranslate=!0)):(t.enableWalk=!1,t.enableTranslate=!0,t.enableZoom=!0,t.enableTilt=!0,t.enableLook=!0)}}},enableOutline:{get:function(){var e=this.layers.getSelectedLayer();return!(!e$28(e)||e.getSelection().length<1)&&e.selectColorType===Ya$1.SILHOUETTE_EDGE}},maskEnabled:{get:function(){return this._maskEnabled}},lightGroup:{get:function(){return this._lightGroup},set:function(e){e!==this._lightGroup&&(this._lightGroup=e,yo(this,e))}},enableCompositor:{get:function(){return this._enableCompositor},set:function(e){o$1u.typeOf.bool("Scene.enableCompositor",e),this._enableCompositor=e}},overlapDisplayedThreshold:{get:function(){return this._overlapDisplayedThreshold},set:function(e){o$1u.typeOf.number("Scene.clusterRange",e),this._overlapDisplayedThreshold=e}},overlapDisplayOptions:{get:function(){return this._overlapDisplayOptions},set:function(e){o$1u.typeOf.object("Scene.overlapDisplayOptions",e),this._overlapDisplayOptions=e}}}),F$4.prototype.setVectorTilesLayersControl=function(e,t){this._mvtVisibleControl=e,this._mvtVisibleLevel=t},F$4.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},F$4.prototype.updateDerivedCommands=function(e){if(e$28(e.derivedCommands)){var t=this._frameState,i=this._context,r=!1,n=t.shadowState.lastDirtyTime;e.lastDirtyTime!==n&&(e.lastDirtyTime=n,e.dirty=!0,r=!0);var o=t.useLogDepth,a=this._hdr,s=t.passes.normal,l=this._maskEnabled,u=e.derivedCommands,c=e$28(u.logDepth),h=e$28(u.hdr),d=e$28(u.normal),f=e$28(u.mask),p=e$28(u.originalCommand),_=o&&!c,m=a&&!h,$=s&&!d,g=l&&!f,v=!(o&&a||p);if(e.dirty=e.dirty||this._logDepthBufferDirty||this._hdrDirty||this._maskEnabled||_||m||v||g||$,e.dirty){e.dirty=!1;var y=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(u.shadows=F$j.createCastDerivedCommand(y,e,r,i,u.shadows)),(c||_)&&(u.logDepth=_$g.createLogDepthCommand(e,i,u.logDepth),mi(this,u.logDepth.command,r)),(p||v)&&mi(this,e,r)}}};var vo=new a$k({pass:gr$4.RENDER}),xt=new a$k({pass:gr$4.PRELOAD}),Vt=new a$k({pass:gr$4.PRELOAD_FLIGHT}),co=new a$k({pass:gr$4.REQUEST_RENDER_MODE_DEFER_CHECK});new a$k({pass:gr$4.MOST_DETAILED_PRELOAD});var go=new a$k({pass:gr$4.MOST_DETAILED_PICK}),Tt=new a$k({pass:gr$4.PICK}),hi=new i$19,Dt$1;function _o(e){var t=e.globe;if(e._mode===P$$.SCENE3D&&e$28(t)&&t.show){var i=t.ellipsoid;return hi.radius=i.minimumRadius,Dt$1=d$Y.fromBoundingSphere(hi,e.camera.positionWC,Dt$1)}}function Pt$1(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1,e.asynchronous=!1,e.fbo=!1,e.normal=!1}function pi(e,t,i){var r=e._frameState;r.frameNumber=t,r.time=a$12.clone(i,r.time)}function yo(e,t){for(var i=0;i<e._presetLightSource.length;i++)e.removeLightSource(e._presetLightSource[i]);if(e._presetLightSource.length=0,t===Ct$2.SUN_LIGHT)e.hdrEnabled=!1,e.sun.show=!0,e._lightSource.ambientLightColor=new e$1S(.76,.76,.76,1);else if(t===Ct$2.LIGHT_GROUP1){e.hdrEnabled=!1,e.sun.show=!1,e._lightSource.ambientLightColor=new e$1S(.5,.5,.5,1);var r=new c$j(new t$X.fromDegrees(116.191153,40.147532,450),{targetPosition:new t$X.fromDegrees(116.19106,40.147858,430),color:new e$1S(.9,.9,.9,1),intensity:.78});e.addLightSource(r),e._presetLightSource.push(r);var n=new c$j(new t$X.fromDegrees(116.192153,40.147432,490),{targetPosition:new t$X.fromDegrees(116.19106,40.147858,430),color:new e$1S(.9,.9,.9,1),intensity:.25});e.addLightSource(n),e._presetLightSource.push(n)}}function Ie$2(e){var t=e.camera,i=e._frameState;i.commandList.length=0,i.shadowMaps.length=0,i.brdfLutGenerator=e._brdfLutGenerator,i.environmentMap=e.skyBox&&e.skyBox._cubeMap,i.mode=e._mode,i.morphTime=e.morphTime,i.mapProjection=e.mapProjection,i.camera=t,i.cullingVolume=t.frustum.computeCullingVolume(t.positionWC,t.directionWC,t.upWC,e.frustumTolerance),i.cullingVolume.enableFusion=e$28(e.context.curFusionViewMatrix),i.occluder=_o(e),i.terrainExaggeration=e._terrainExaggeration,i.minimumDisableDepthTestDistance=e._minimumDisableDepthTestDistance,i.invertClassification=e.invertClassification,i.useLogDepth=e._logDepthBuffer&&!(e.camera.frustum instanceof a$X||e.camera.frustum instanceof l$$),i.sunColor=e._sunColor,e._lightSource.sunLightON=e$28(e.sun)&&e.sun.show,i.lightSource=e._lightSource,i.useBloom=e._environmentState.usePostProcess&&(e.postProcessStages.bloom.enabled||e.compositor.isBloomEnable()),i.shadowDarkness=e.shadowMap.darkness,i.toneMappingExposure=e.toneMappingExposure,e$28(e._specularEnvironmentMapAtlas)&&e._specularEnvironmentMapAtlas.ready?(i.specularEnvironmentMaps=e._specularEnvironmentMapAtlas.texture,i.specularEnvironmentMapsMaximumLOD=e._specularEnvironmentMapAtlas.maximumMipmapLevel):(i.specularEnvironmentMaps=void 0,i.specularEnvironmentMapsMaximumLOD=void 0),e$28(e._pmremGenerator)&&e._pmremGenerator.ready&&(i.hdrEnvMap=e._pmremGenerator.texture),i.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,e._actualInvertClassificationColor=e$1S.clone(e.invertClassificationColor,e._actualInvertClassificationColor),t$7.isTranslucencySupported(e._context)||(e._actualInvertClassificationColor.alpha=1),i.invertClassificationColor=e._actualInvertClassificationColor,e$28(e.globe)?i.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:i.maximumScreenSpaceError=2,Pt$1(i.passes),i.tilesetPassState=void 0,i.pbrMaterialsArr=e._pbrMaterlParameters,e.context._trangleCount=0}F$4.prototype.updateFrameState=function(){return Ie$2(this)};var vi=new i$S;function wo(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function bo(e,t,i){var r=t.context,n=u$Y(i,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map((function(e){e=a$$.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)-1===a.indexOf(t[1])&&a.push(t[1]);return e}));var s,l=a.length,u="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){e$28(e._debugColor)||(e._debugColor=e$1S.fromRandom());var c=e._debugColor;if(l>0)for(s=0;s<l;++s)u+=" gl_FragData["+a[s]+"].rgb *= vec3("+c.red+", "+c.green+", "+c.blue+"); \n";else u+=" gl_FragColor.rgb *= vec3("+c.red+", "+c.green+", "+c.blue+"); \n"}if(t.debugShowFrustums){var h=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",f=4&e.debugOverlappingFrustums?"1.0":"0.0";if(l>0)for(s=0;s<l;++s)u+=" gl_FragData["+a[s]+"].rgb *= vec3("+h+", "+d+", "+f+"); \n";else u+=" gl_FragColor.rgb *= vec3("+h+", "+d+", "+f+"); \n"}u+="}",o.sources.push(u);var p=wo(n);return S$T.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:p})}function Co(e,t,i){var r=r$15.shallowClone(e);r.shaderProgram=bo(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}F$4.prototype.isVisible=function(e,t,i){return e$28(e)&&(!e$28(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==pt$a.OUTSIDE&&(!e$28(i)||!(e.occlude&&!this._undergroundMode)||!e.boundingVolume.isOccluded(i)))};var rt$3=new y$15(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function So(e,t,i,r){var n=t._frameState,o=n.context,a=e.boundingVolume;e$28(t._debugVolume)&&t._debugVolume.destroy();var s,l=t$X.clone(a.center);if(n.mode!==P$$.SCENE3D){l=y$15.multiplyByPoint(rt$3,l,l);var u=n.mapProjection,c=u.unproject(l);l=u.ellipsoid.cartographicToCartesian(c)}if(e$28(a.radius)){var h=a.radius;s=k$Z.toWireframe(b$Y.createGeometry(new b$Y({radii:new t$X(h,h,h),vertexFormat:r$J.FLAT_VERTEX_FORMAT}))),t._debugVolume=new v$C({geometryInstances:new d$15({geometry:s,modelMatrix:y$15.fromTranslation(l),attributes:{color:new o$18(1,0,0,1)}}),appearance:new r$J({flat:!0,translucent:!1}),asynchronous:!1})}else{var d=a.halfAxes;s=k$Z.toWireframe(O$H.createGeometry(O$H.fromDimensions({dimensions:new t$X(2,2,2),vertexFormat:r$J.FLAT_VERTEX_FORMAT}))),t._debugVolume=new v$C({geometryInstances:new d$15({geometry:s,modelMatrix:y$15.fromRotationTranslation(d,l,new y$15),attributes:{color:new o$18(1,0,0,1)}}),appearance:new r$J({flat:!0,translucent:!1}),asynchronous:!1})}var f,p=n.commandList,_=n.commandList=[];(t._debugVolume.update(n),e=_[0],n.useLogDepth)&&(e=_$g.createLogDepthCommand(e,o).command);e$28(r)&&(f=i.framebuffer,i.framebuffer=r),e.execute(o,i),e$28(f)&&(i.framebuffer=f),n.commandList=p}function ne$3(e,t,i,r,n){var o=t._frameState,a=o.passes;if(!e$28(t.debugCommandFilter)||t.debugCommandFilter(e)){if(e instanceof r$11)return void e.execute(i,r);if(!e$28(e.owner)||"function"!=typeof e.owner.isDestroyed||!e.owner.isDestroyed()){if(e.debugShowBoundingVolume&&e$28(e.boundingVolume)&&So(e,t,r,n),o.useLogDepth&&e$28(e.derivedCommands)&&e$28(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command),!a.pick&&t._hdr&&e$28(e.derivedCommands)&&e$28(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),!a.pick&&t.maskEnabled&&e$28(e.derivedCommands)&&e$28(e.derivedCommands.mask)&&(e=e.derivedCommands.mask.command),a.pick&&a.normal){if(!e$28(e.derivedCommands))return;return void(e=e.derivedCommands.normal.command).execute(i,r)}if(a.pick||a.depth){if(!e$28(e.derivedCommands))return;if(a.pick&&!a.depth&&e$28(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(i,r);if(a.depth&&e$28(e.derivedCommands.depth)){if(e.pass===Le$p.ANALYSIS||!e.renderState.depthTest.enabled)return;return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,r)}}if(t.debugShowCommands||t.debugShowFrustums)return void Co(e,t,r);o.shadowState.lightShadowsEnabled&&e.receiveShadows&&e$28(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,r):e.execute(i,r)}}}function tt$2(e,t,i,r){var n=t._frameState,o=e.derivedCommands;!e$28(o)||(n.useLogDepth&&e$28(o.logDepth)&&(e=o.logDepth.command),e$28((o=e.derivedCommands).picking)?(e=o.picking.pickCommand).execute(i,r):e$28(o.depth)&&(e=o.depth.depthOnlyCommand).execute(i,r))}function xo(e,t,i){return e.boundingVolume&&t.boundingVolume?t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i):1}function Vo(e,t,i){return e.boundingVolume&&t.boundingVolume?e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+e$27.EPSILON12:1}function To(e,t,i,r,n){var o=e.context;m$Q(r,xo,e.camera.positionWC),e$28(n)&&t(n.unclassifiedCommand,e,o,i);for(var a=r.length,s=0;s<a;++s)t(r[s],e,o,i)}function Do(e,t,i,r,n){var o=e.context;m$Q(r,Vo,e.camera.positionWC),e$28(n)&&t(n.unclassifiedCommand,e,o,i);for(var a=r.length,s=e.frameState.passes,l=0;l<a;++l)s.pick&&s.depth&&r[l].owner instanceof B$q||s.pick&&!e$28(r[l].pickId)&&!s.depth||t(r[l],e,o,i)}function ci(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!e$28(r)&&e.context.depthTexture&&(r=new o$l,i[t]=r),r}function Po(e,t,i,r,n){var o=e.context,a=e._frameState.passes,s=e._environmentState,l=n.length,u=a.pick,c=a.depth;a.pick=!0,a.depth=!0;var h,d=0;for(h=0;h<l;++h){(_=n[h]).opaquePass===Le$p.GLOBE&&(ne$3(_,e,o,t),d++)}if(d>0){e$28(i)&&s.useGlobeDepthFramebuffer&&i.executeUpdateDepth(o,t,!0);var f=r.commands[Le$p.TERRAIN_CLASSIFICATION],p=r.indices[Le$p.TERRAIN_CLASSIFICATION];for(h=0;h<p;++h)ne$3(f[h],e,o,t)}for(d=0,h=0;h<l;++h){var _;(_=n[h]).opaquePass===Le$p.S3MTiles&&(ne$3(_,e,o,t),d++)}if(d>0){e$28(i)&&s.useGlobeDepthFramebuffer&&i.executeUpdateDepth(o,t,!0);f=r.commands[Le$p.ClampObject],p=r.indices[Le$p.ClampObject];for(h=0;h<p;++h)ne$3(f[h],e,o,t)}a.pick=u,a.depth=c}rt$3=y$15.inverseTransformation(rt$3,rt$3);var it=new o$15,at$3=new l$X,ot$2=new a$X,nt$2=new l$$;function Et(e,t){var i,r=e.camera,n=e.context,o=n.uniformState;o.updateCamera(r),i=e$28(r.frustum.fov)?r.frustum.clone(it):e$28(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(at$3):e$28(r.frustum.width)?r.frustum.clone(ot$2):r.frustum.clone(nt$2);var a=e._layers,s=e._frameState;a.render(n,s),i.near=r.frustum.near,i.far=r.frustum.far;var l=i.reflect;i.reflect=!1,o.updateFrustum(i),o.updatePass(Le$p.ENVIRONMENT);var u,c=e._frameState.passes,h=c.pick,d=e._environmentState,f=e._view,p=d.renderTranslucentDepthForPick,_=d.useWebVR,m=e._environmentVisible;if(!h){var $=d.skyBoxCommand;if(e$28($)&&m.isSkyBoxVisible&&ne$3($,e,n,t),d.isSkyAtmosphereVisible&&m.isSkyAtmosphereVisible&&ne$3(d.skyAtmosphereCommand,e,n,t),d.isUnderGlobeVisible&&m.isUnderGlobeVisible&&d.underGlobeCommand.execute(n,t),d.isSunVisible&&m.isSunVisible&&!c.fbo&&(d.sunDrawCommand.execute(n,t),e.sunBloom&&!_)){var g;g=d.useGlobeDepthFramebuffer?f.globeDepth.framebuffer:d.usePostProcess?f.sceneFramebuffer.getFramebuffer():d.originalFramebuffer;var v=e._multiViewportMode!==te$6.NONE;e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,g,v?t:void 0),t.framebuffer=g}d.isMoonVisible&&m.isMoonVisible&&d.moonCommand.execute(n,t),s.cullingVolume}i.reflect=l,d.useOIT?(e$28(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){f.oit.executeCommands(e,t,i,r,n)}),u=e._executeOITFunction):u=c.render?To:Do;var y,x=d.clearGlobeDepth,b=d.useDepthPlane,w=e._depthClearCommand,C=e._clearColorCommand,T=e._stencilClearCommand,S=e._classificationStencilClearCommand,E=e._depthPlane,A=d.usePostProcessSelected,P=r.position.z,I=f.frustumCommandsList,M=I.length;0===M&&e$28(f.globeDepth)&&d.useGlobeDepthFramebuffer&&f.globeDepth.executeCopyDepth(n,t);for(var O=0;O<M;++O){var D=M-O-1,R=I[D];e.mode===P$$.SCENE2D?(r.position.z=P-R.near+1,i.far=Math.max(1,R.far-R.near),i.near=1,o.update(e.frameState),o.updateFrustum(i)):((!c.fbo||!n.depthTexture)&&(i.near=0!==D?R.near*e.opaqueFrustumNearOffset:R.near,i.far=R.far),e.logarithmicDepthBuffer&&r._positionCartographic.height>1e5&&i.near<10&&(i.near*=1e4),o.updateFrustum(i)),zn(e,n,s);var L,B,N=e.debugShowGlobeDepth?ci(e,D):f.globeDepth;if(e.debugShowGlobeDepth&&e$28(N)&&d.useGlobeDepthFramebuffer&&(N.update(n,t,f.viewport),N.clear(n,t,e._clearColorCommand.color),L=t.framebuffer,t.framebuffer=N.framebuffer),w.execute(n,t),c.depth&&!n.depthTexture&&C.execute(n,t),n.stencilBuffer&&T.execute(n,t),m.isGlobalVisible){o.updatePass(Le$p.GLOBE),B=R.commands[Le$p.GLOBE];var F=R.indices[Le$p.GLOBE];for(y=0;y<F;++y)ne$3(B[y],e,n,t);for(e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeCopyDepth(n,t),e.debugShowGlobeDepth&&e$28(N)&&d.useGlobeDepthFramebuffer&&(t.framebuffer=L),o.updatePass(Le$p.TERRAIN_CLASSIFICATION),B=R.commands[Le$p.TERRAIN_CLASSIFICATION],F=R.indices[Le$p.TERRAIN_CLASSIFICATION],y=0;y<F;++y)ne$3(B[y],e,n,t);x&&(w.execute(n,t),b&&E.execute(n,t)),m.isObjectVisible||N.copyFromRenderbufferToTexture(n,!0,!1,!1)}if(!d.useInvertClassification||h){for(o.updatePass(Le$p.CESIUM_3D_TILE),B=R.commands[Le$p.CESIUM_3D_TILE],F=R.indices[Le$p.CESIUM_3D_TILE],y=0;y<F;++y)ne$3(B[y],e,n,t);if(F>0)for(e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),o.updatePass(Le$p.CESIUM_3D_TILE_CLASSIFICATION),B=R.commands[Le$p.CESIUM_3D_TILE_CLASSIFICATION],F=R.indices[Le$p.CESIUM_3D_TILE_CLASSIFICATION],y=0;y<F;++y)ne$3(B[y],e,n,t)}else{e._invertClassification.clear(n,t);var z=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,o.updatePass(Le$p.CESIUM_3D_TILE),B=R.commands[Le$p.CESIUM_3D_TILE],F=R.indices[Le$p.CESIUM_3D_TILE],y=0;y<F;++y)ne$3(B[y],e,n,t);for(e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),o.updatePass(Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),B=R.commands[Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],F=R.indices[Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],y=0;y<F;++y)ne$3(B[y],e,n,t);for(t.framebuffer=z,e._invertClassification.executeClassified(n,t),1===e.frameState.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(n,t),F>0&&n.stencilBuffer&&S.execute(n,t),o.updatePass(Le$p.CESIUM_3D_TILE_CLASSIFICATION),B=R.commands[Le$p.CESIUM_3D_TILE_CLASSIFICATION],F=R.indices[Le$p.CESIUM_3D_TILE_CLASSIFICATION],y=0;y<F;++y)ne$3(B[y],e,n,t)}if(F>0&&n.stencilBuffer&&T.execute(n,t),m.isObjectVisible){var k,V=Le$p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW+1,U=Le$p.OPAQUE;m.isOnlyS3MObjectVisible&&(V=Le$p.S3MTiles,U=Le$p.S3MTilesClampObjectColor);for(var X=V;X<=U;++X)if(o.updatePass(X),B=R.commands[X],F=R.indices[X],!s.passes.pick&&!s.passes.depth||X!==Le$p.ProjectionImage)for(X===Le$p.ProjectionImage&&F>0&&e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),X===Le$p.S3MTilesClampObjectColor&&F>0&&e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),y=0;y<F;++y)ne$3(B[y],e,n,t);if(e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),!i.reflect)for(o.updatePass(Le$p.ClampObject),B=R.commands[Le$p.ClampObject],F=R.indices[Le$p.ClampObject],y=0;y<F;++y)ne$3(B[y],e,n,t);for(o.updatePass(Le$p.NonClampObject),B=R.commands[Le$p.NonClampObject],F=R.indices[Le$p.NonClampObject],y=0;y<F;++y)ne$3(B[y],e,n,t);if(F>0&&e$28(N)&&d.useGlobeDepthFramebuffer&&N.executeUpdateDepth(n,t,x),m.isBillboardVisible&&(!h||!c.depth))for(o.updatePass(Le$p.Label_Billboard),B=R.commands[Le$p.Label_Billboard],F=R.indices[Le$p.Label_Billboard],y=0;y<F;++y)ne$3(B[y],e,n,t);for(o.updatePass(Le$p.Voxel_Billboard),B=R.commands[Le$p.Voxel_Billboard],F=R.indices[Le$p.Voxel_Billboard],y=0;y<F;++y)ne$3(B[y],e,n,t);if(o.updatePass(Le$p.Particle),B=R.commands[Le$p.Particle],(F=R.indices[Le$p.Particle])>0&&!c.fbo)if(h){if(!c.depth)for(y=0;y<F;++y)ne$3(B[y],e,n,t)}else e.particlePostRender.executeCommand(e,ne$3,t,B,F);for(0!==D&&e.mode!==P$$.SCENE2D&&(i.near=R.near,o.updateFrustum(i)),!h&&d.useInvertClassification&&e.frameState.invertClassificationColor.alpha<1&&(k=e._invertClassification),d.useOIT&&N.copyFromRenderbufferToTexture(n,!0,!0,!1),(c.pick&&c.normal||!m.isOnlyS3MObjectVisible||"sqResultTexture"===s._fboState.name)&&(o.updatePass(Le$p.TRANSLUCENT),(B=R.commands[Le$p.TRANSLUCENT]).length=R.indices[Le$p.TRANSLUCENT],"sqResultTexture"===s._fboState.name&&(B=B.filter((function(e){return"sqResultTexture"===e.owner}))),u(e,ne$3,t,B,k),B.length>0&&Po(e,t,N,R,B)),o.updatePass(Le$p.ANALYSIS),B=R.commands[Le$p.ANALYSIS],F=R.indices[Le$p.ANALYSIS],y=0;y<F;++y)ne$3(B[y],e,n,t);(F>0||!d.useOIT)&&e$28(N)&&N.copyFromRenderbufferToTexture(n,!0,!1,!1)}if(!c.fbo)if(n.depthTexture&&e.useDepthPicking&&(d.useGlobeDepthFramebuffer||p))e$28(G=p?t.framebuffer.depthStencilTexture:N.depthStencilTexture)||(G=N.depthStencilTexture),(H=e._picking.getPickDepth(e,D)).update(n,G),H.executeCopyDepth(n,t);else if(e$28(t.framebuffer)&&e$28(t.framebuffer._colorTextures[0])){var H,G=t.framebuffer._colorTextures[0];(H=e._picking.getPickDepth(e,D)).update(n,G),H.executeCopyDepth(n,t)}if(!h&&A){var W=t.framebuffer;for(t.framebuffer=f.sceneFramebuffer.getIdFramebuffer(),i.near=0!==D?R.near*e.opaqueFrustumNearOffset:R.near,i.far=R.far,o.updateFrustum(i),o.updatePass(Le$p.GLOBE),B=R.commands[Le$p.GLOBE],F=R.indices[Le$p.GLOBE],y=0;y<F;++y)tt$2(B[y],e,n,t);for(x&&(w.framebuffer=t.framebuffer,w.execute(n,t),w.framebuffer=void 0),x&&b&&E.execute(n,t),o.updatePass(Le$p.CESIUM_3D_TILE),B=R.commands[Le$p.CESIUM_3D_TILE],F=R.indices[Le$p.CESIUM_3D_TILE],y=0;y<F;++y)tt$2(B[y],e,n,t);for(o.updatePass(Le$p.OPAQUE),B=R.commands[Le$p.OPAQUE],F=R.indices[Le$p.OPAQUE],y=0;y<F;++y)tt$2(B[y],e,n,t);for(o.updatePass(Le$p.TRANSLUCENT),B=R.commands[Le$p.TRANSLUCENT],F=R.indices[Le$p.TRANSLUCENT],y=0;y<F;++y)tt$2(B[y],e,n,t);t.framebuffer=W}}}function gi(e){e.context.uniformState.updatePass(Le$p.COMPUTE);var t=e._environmentState.sunComputeCommand;e$28(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function _i(e,t){var i=e.context,r=e._frameState.passes,n=e._view.globeDepth,o=e._environmentState,a=o.renderTranslucentDepthForPick,s=e._logDepthOverlayCommandList,l=s.length;if(l>0)for(var u=0;u<l;++u){var c=s[u];(r=e._frameState.passes).pick||r.depth?ne$3(s[u],e,i,t):(c=c.derivedCommands.logDepth.command).execute(i,t)}l=(s=e._overlayCommandList).length;for(u=0;u<l;++u){c=s[u];(r=e._frameState.passes).pick||r.depth?ne$3(s[u],e,i,t):c.execute(i,t)}if(!r.fbo&&i.depthTexture&&e.useDepthPicking&&(o.useGlobeDepthFramebuffer||a)){var h=a?t.framebuffer.depthStencilTexture:n.depthStencilTexture;e$28(h)||(h=n.depthStencilTexture);var d=e._picking.getPickDepth(e,0);d.update(i,h),d.executeCopyDepth(i,t)}if((l=(s=e._overlayAgainstDepthCommandList).length)>0){e._depthClearCommand.execute(e._context,t);for(u=0;u<l;++u)if(e.frameState.passes.pick){(c=e._hdr&&e.logarithmicDepthBuffer?s[u].derivedCommands.logDepth.command.derivedCommands.picking.pickCommand:s[u].derivedCommands.picking.pickCommand).execute(e._context,t)}else s[u].execute(i,t)}}function Rt(e,t){var i=e.context.uniformState;i.updatePass(Le$p.OVERLAY);var r=e.context,n=e._frameState,o=e._view,a=o.viewport;if(a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight,t.viewport=f$10.clone(a,t.viewport),e._multiViewportMode===te$6.NONE)_i(e,t);else{for(var s=0;s<e._multiViewportInfo.length;s++)if(!n.passes.pick||e._frameState.multiViewportIndex===s){n.multiViewportIndex=s;var l=e._multiViewportInfo[s];a.x=r.drawingBufferWidth*l.x,a.y=r.drawingBufferHeight*l.y,a.width=r.drawingBufferWidth*l.width,a.height=r.drawingBufferHeight*l.height,n.camera.frustum.aspectRatio=a.width/a.height,n.passes.pick&&(a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight),t.viewport=f$10.clone(a),i.update(n),n.commandList.length=0,e._logDepthOverlayCommandList.length=0,e._overlayCommandList.length=0,e._overlayAgainstDepthCommandList.length=0,Ft(e,!1),o.createPotentiallyVisibleSet(e),_i(e,t)}a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight,t.viewport=f$10.clone(a)}}function Eo(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Le$p.GLOBE||u.pass===Le$p.CESIUM_3D_TILE||u.pass>=Le$p.S3MTiles&&u.pass<=Le$p.TRANSLUCENT)&&e.isVisible(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var h=!1,d=a-1;d>=0;--d){var f=o[d].cullingVolume;if(e.isVisible(u,f))o[d].commandList.push(u),h=!0;else if(h)break}}}function yi(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;for(Eo(e,e.frameState.commandList,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var d=h.commandList.length,f=0;f<d;++f){var p=h.commandList[f];o.updatePass(p.pass),ne$3(p.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}var Ro=new t$X;function Ue$1(e,t,i,r){var n=e._context,o=n.uniformState,a=t.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;var s=e._frameState,l=s.camera,u=s.mode,c=(d=s.passes).pick;if(e._useWebVR&&u!==P$$.SCENE2D)Fo(e,t,i);else if(s._fboState.enabled||e._multiViewportMode===te$6.NONE)st(e,t,i),u!==P$$.SCENE2D||e._mapMode2D===Jt$1.ROTATE?Xe(!0,e,t):Ao(e,t);else{st(e,t,i);for(var h=0;h<e._multiViewportInfo.length;h++)if(!c||e._frameState.multiViewportIndex===h){c=(d=e._frameState.passes).pick,r=d.fbo;var d,f=e._environmentState.useWebVR;e._environmentState.isSunVisible&&e.sunBloom&&!f&&!r&&(t.framebuffer=e._sunPostProcess._sceneFramebuffer.getFramebuffer());var p=e._multiViewportInfo[h];a.x=n.drawingBufferWidth*p.x,a.y=n.drawingBufferHeight*p.y,a.width=n.drawingBufferWidth*p.width,a.height=n.drawingBufferHeight*p.height,l.frustum.aspectRatio=a.width/a.height,c&&(a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight),o.update(s),e._frameState.multiViewportIndex=h,s.cullingVolume=s.camera.frustum.computeCullingVolume(s.camera.positionWC,s.camera.directionWC,s.camera.upWC),s.commandListRealtimeRaster.length=0,Xe(0==h||c,e,t)}}}function Fo(e,t,i){var r=e._view,n=r.camera,o=e._environmentState.renderTranslucentDepthForPick;st(e,t,i),o||Ft(e),r.createPotentiallyVisibleSet(e),o||(gi(e),yi(e));var a=t.viewport;a.x=0,a.y=0,a.width=.5*a.width;var s=v$n.clone(n,e._cameraVR);s.frustum=n.frustum;var l=n.frustum.near,u=l*u$Y(e.focalLength,5),c=u$Y(e.eyeSeparation,u/30),h=t$X.multiplyByScalar(s.right,.5*c,Ro);n.frustum.aspectRatio=a.width/a.height;var d=.5*c*l/u;t$X.add(s.position,h,n.position),n.frustum.xOffset=d,Et(e,t),a.x=a.width,t$X.subtract(s.position,h,n.position),n.frustum.xOffset=-d,Et(e,t),v$n.clone(s,n)}F$4.prototype.updateAndExecuteCommands=function(e,t,i){return Ue$1(this,e,t,i)};var No=new t$W(Math.PI,e$27.PI_OVER_TWO),ko$1=new t$X,Lo=new t$X,Io=new y$15,Mo=new y$15,Oo=new t$X,Bo=new t$X,qo=new f$10;function Ao(e,t){var i=e.context,r=e.frameState,n=e.camera,o=t.viewport,a=f$10.clone(o,qo);t.viewport=a;var s=No,l=ko$1;e.mapProjection.project(s,l);var u=t$X.clone(n.position,Lo),c=y$15.clone(n.transform,Mo),h=n.frustum.clone();n._setTransform(y$15.IDENTITY);var d=y$15.computeViewportTransformation(a,0,1,Io),f=n.frustum.projectionMatrix,p=n.positionWC.y,_=t$X.fromElements(e$27.sign(p)*l.x-p,0,-n.positionWC.x,Oo),m=m$1b.pointToGLWindowCoordinates(f,d,_,Bo);m.x=Math.floor(m.x);var $=a.x,g=a.width;if(0===p||m.x<=$||m.x>=$+g)Xe(!0,e,t);else if(Math.abs($+.5*g-m.x)<1)a.width=m.x-a.x,n.position.x*=e$27.sign(n.position.x),n.frustum.right=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!0,e,t),a.x=m.x,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!1,e,t);else if(m.x>$+.5*g){a.width=m.x-$;var v=n.frustum.right;n.frustum.right=l.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!0,e,t),a.x=m.x,a.width=$+g-m.x,n.position.x=-n.position.x,n.frustum.left=-n.frustum.right,n.frustum.right=v-2*n.frustum.right,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!1,e,t)}else{a.x=m.x,a.width=$+g-m.x;var y=n.frustum.left;n.frustum.left=-l.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!0,e,t),a.x=$,a.width=m.x-$,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=y-2*n.frustum.left,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),Xe(!1,e,t)}n._setTransform(c),t$X.clone(u,n.position),n.frustum=h.clone(),t.viewport=o}function Xe(e,t,i,r){var n=t._environmentState,o=t._view,a=n.renderTranslucentDepthForPick;!e&&!a&&(t.frameState.commandList.length=0),(!a||t._frameState.multiViewportIndex>-1)&&Ft(t,e),o.createPotentiallyVisibleSet(t),e&&(e$28(r)&&st(t,i,r),a||(gi(t),yi(t))),Et(t,i)}var Wo=/(\.hdr$)/i;function De$2(e){var t=e._frameState,i=e._view,r=e._environmentState,n=t.passes.render,o=t.passes.offscreen,a=e.skyAtmosphere,s=e.globe;if(!n||e._mode!==P$$.SCENE2D&&i.camera.frustum instanceof a$X)r.skyAtmosphereCommand=void 0,r.skyBoxCommand=void 0,r.sunDrawCommand=void 0,r.sunComputeCommand=void 0,r.moonCommand=void 0;else{e$28(a)&&e$28(s)&&(a.setDynamicAtmosphereColor(s.enableLighting),r.isReadyForAtmosphere=r.isReadyForAtmosphere||s._surface._tilesToRender.length>0),r.skyAtmosphereCommand=e$28(a)?a.update(t):void 0,r.skyBoxCommand=e$28(e.skyBox)?e.skyBox.update(t,e._hdr):void 0;var l=e$28(e.sun)?e.sun.update(t,i.passState,e._hdr):void 0;r.sunDrawCommand=e$28(l)?l.drawCommand:void 0,r.sunComputeCommand=e$28(l)?l.computeCommand:void 0,r.moonCommand=e$28(e.moon)?e.moon.update(t):void 0,r.underGlobeCommand=void 0,e$28(e._underGlobe)&&(e.globe&&e.globe.globeAlpha<1&&(e._underGlobe.show=!0),r.underGlobeCommand=e._underGlobe.update(t)),e$28(e.cloudBox)&&e.cloudBox.update(t)}var u=r.clearGlobeDepth=e$28(s)&&(!s.depthTestAgainstTerrain||e.mode===P$$.SCENE2D);(r.useDepthPlane=u&&e.mode===P$$.SCENE3D)&&e._depthPlane.update(t),r.renderTranslucentDepthForPick=!1,r.useWebVR=e._useWebVR&&e.mode!==P$$.SCENE2D&&!o;for(var c=t.mode===P$$.SCENE3D?t.occluder:void 0,h=t.cullingVolume,d=vi.planes,f=0;f<5;++f)d[f]=h.planes[f];h=vi,r.isSkyAtmosphereVisible=e$28(r.skyAtmosphereCommand)&&r.isReadyForAtmosphere,r.isSunVisible=e.isVisible(r.sunDrawCommand,h,c),r.isMoonVisible=e.isVisible(r.moonCommand,h,c),r.isUnderGlobeVisible=(e.undergroundMode||e._underGlobe.show)&&e$28(r.underGlobeCommand);var p=e.specularEnvironmentMaps,_=e._specularEnvironmentMapAtlas;e$28(p)?Wo.test(p)?e$28(e._pmremGenerator)||(e._pmremGenerator=new I$4(p)):(!e$28(_)||_.url!==p)&&(_=_&&_.destroy(),e._specularEnvironmentMapAtlas=new u$z(p)):e$28(_)?(_.destroy(),e._specularEnvironmentMapAtlas=void 0):e$28(e._pmremGenerator)&&(e._pmremGenerator=e._pmremGenerator.destroy()),e$28(e._specularEnvironmentMapAtlas)&&e._specularEnvironmentMapAtlas.update(t),e$28(e._pmremGenerator)&&e._pmremGenerator.update(t)}function Ho(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new p$k({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),e$28(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Go(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===P$$.SCENE3D;if(n!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=n),t.shadowState.lightShadowsEnabled=!1,n){for(var o=0;o<r;++o)if(i[o]!==t.shadowState.shadowMaps[o]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0,t.shadowState.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function Ft(e,t){var i=e._frameState,r=e._context,n=i.commandList;e._groundPrimitives.update(i),e._primitives.update(i),Ho(e),t&&Go(e);var o=e.layers.update(r,i,n,!0);if(i.rasterLayerIds=o,e.layers.update(r,i,n),e.layers.updateTextVisible(r,i),e._globe){for(var a in e._vectorTileSource._hash){(s=e._vectorTileSource.get(a))instanceof M$X&&s.resetVisible()}e._globe.render(i)}for(var a in i.rasterLayerIds=void 0,e._analyst3D.update(r,i,n),e._vectorTileMaps.update(r,i,n),e._vectorTileSource._hash){var s;(s=e._vectorTileSource.get(a)).update(r,i,n)}}function Uo(e,t){for(var i=e._context,r=e._frameState,n=e._view.camera,o=0,a=e._layers.layerQueue.length;o<a;o++){var s=e._layers.layerQueue[o];if("FieldLayer3D"===s._type)(c=s._particleVelocityFieldEffect)._showParticleTrails&&e$28(c._lastParticleStateTexture)&&(c.clearLastParticleStateTexture(n,e._hdr,i,t),e.particleTrailsPostRenderer._particleStateTexture=c._lastParticleStateTexture,e.particleTrailsPostRenderer.update(r))}for(var l=0,u=e._primitives.length;l<u;l++){var c,h=e._primitives._primitives[l];if("FieldLayer3D"==h.type)(c=h._particleVelocityFieldEffect)._showParticleTrails&&e$28(c._lastParticleStateTexture)&&(c.clearLastParticleStateTexture(n,e._hdr,i,t),e.particleTrailsPostRenderer._particleStateTexture=c._lastParticleStateTexture,e.particleTrailsPostRenderer.update(r))}}function st(e,t,i){var r=e._context,n=e._frameState,o=e._environmentState,a=e._view,s=e._frameState.passes,l=s.pick,u=s.fbo,c=o.useWebVR;o.originalFramebuffer=t.framebuffer,e$28(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!c?e._sunPostProcess=new u$b:e$28(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!e$28(e.sun)&&e$28(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var h=e._clearColorCommand;e$1S.clone(i,h.color),h.execute(r,t);var d=o.useGlobeDepthFramebuffer=e._enableCompositor&&e$28(a.globeDepth);d&&(a.globeDepth.update(r,t,a.viewport,e._hdr||e._pickPointEnabled),a.globeDepth.clear(r,t,i));var f=a.oit,p=o.useOIT=e._enableCompositor&&!u&&!l&&e$28(f)&&f.isSupported();p&&(f.update(r,t,a.globeDepth.framebufferWithTexture,e._hdr||e._pickPointEnabled),f.clear(r,t,i),o.useOIT=f.isSupported()),e$28(e.voxelGridPostRender)&&r.depthTexture&&(e.voxelGridPostRender.update(n,a.globeDepth.framebufferWithTexture,e._hdr),e.voxelGridPostRender.clear(r,t)),e$28(e.particlePostRender)&&(e.particlePostRender.update(n,e._hdr),e.particlePostRender.clear(r,t)),e$28(e.particleTrailsPostRenderer)&&!l&&Uo(e,t);var _,m=e.postProcessStages,$=o.usePostProcess=e._enableCompositor&&!u&&!l&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled||m.smaa.enabled);(o.usePostProcessSelected=!1,$)&&(a.sceneFramebuffer.update(r,a.viewport,e._hdr),a.sceneFramebuffer.clear(r,t,i),m.update(r,n.useLogDepth,e._hdr,e),m.clear(r),$=o.usePostProcess=m.ready,o.usePostProcessSelected=$&&m.hasSelected,(o.usePostEffect=e$28(e.compositor)&&e.compositor.isEnable())&&(e.compositor.update(r,t,e,n),e.compositor.clear(r,i),m.compositor=e.compositor));if(o.isSunVisible&&e.sunBloom&&!c&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):d?n._fboState.frameBufferType!==L$T.CLAMP&&(t.framebuffer=a.globeDepth.framebuffer):$&&(t.framebuffer=a.sceneFramebuffer.getFramebuffer()),e$28(t.framebuffer)&&h.execute(r,t),o.useInvertClassification=!l&&e$28(t.framebuffer)&&e.invertClassification)if(1===e.frameState.invertClassificationColor.alpha&&o.useGlobeDepthFramebuffer&&(_=a.globeDepth.framebuffer),e$28(_)||r.depthTexture){if(e._invertClassification.previousFramebuffer=_,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&p){var g=e._invertClassification.unclassifiedCommand,v=g.derivedCommands;v.oit=f.createDerivedCommands(g,r,v.oit)}}else o.useInvertClassification=!1}F$4.prototype.updateEnvironment=function(){return De$2(this)};var wi=new f$10;function Me$2(e,t){var i=e._context,r=e._frameState,n=e._environmentState,o=e._view,a=e.voxelGridPostRender,s=e.particlePostRender,l=e.particleTrailsPostRenderer,u=r.passes.pick,c=n.useOIT,h=e$28(a)&&a.enable,d=n.useGlobeDepthFramebuffer,f=n.usePostProcess;n.usePostEffect,r._fboState.frameBufferType,L$T.NORMAL_AND_DEPTH;var p=n.originalFramebuffer,_=d?o.globeDepth.framebufferWithTexture:void 0,m=o.sceneFramebuffer.getFramebuffer(),$=o.sceneFramebuffer.getIdFramebuffer();if(e$28(l)&&!u&&l.execute(i,t),e$28(a)){if(t.framebuffer=f?m:p,c){var g=a.getOutputFramebuffer();e$28(g)&&(t.framebuffer=g,o.oit.setOpaqueTexture(g.getColorTexture(0)))}a.execute(i,t)}if(c&&(t.framebuffer=f?m:p,o.oit.execute(i,t)),e$28(s)&&s.execute(i,t),f){var v=m;d&&!c&&!h&&(v=_),e.compositor.outputFbo=v;var y=e.postProcessStages,x=v.getColorTexture(0),b=$.getColorTexture(0),w=u$Y(_,m).depthStencilTexture;y.execute(i,x,w,b),y.copy(i,p,r.useLogDepth),e.compositor.outputFbo=void 0}!c&&!f&&d&&(t.framebuffer=p,f$10.clone(t.viewport,wi),t.viewport.x=0,t.viewport.y=0,t.viewport.width=i.drawingBufferWidth,t.viewport.height=i.drawingBufferHeight,o.globeDepth.executeCopyColor(i,t),f$10.clone(wi,t.viewport));var C=r.useLogDepth;e.debugShowGlobeDepth&&d&&ci(e,e.debugShowDepthFrustum-1).executeDebugGlobeDepth(i,t,C);e.debugShowPickDepth&&d&&e._picking.getPickDepth(e,e.debugShowDepthFrustum-1).executeDebugPickDepth(i,t,C)}function bi(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function jo(e,t){if(e.debugShowFramesPerSecond){if(!e$28(e._performanceDisplay)){var i=document.createElement("div");i.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(i);var r=new o$e({container:i});e._performanceDisplay=r,e._performanceContainer=i}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.trangleCount=e.context._trangleCount,e._performanceDisplay.update(t)}else e$28(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function zo(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),e$28(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Ko(e){var t=e._frameState;e.primitives.postPassesUpdate(t),e.layers.postPassesUpdate(t),r$1b.update()}function Xo(e){var t=e._frameState;e$28(e.globe)&&e.globe.update(t),t.creditDisplay.update()}F$4.prototype.resolveFramebuffers=function(e){return Me$2(this,e)},F$4.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._screenSpaceCameraController.update(),e$28(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};var Qo=new e$1S,Ci=0,Nt=0;const Yo=50,Si=100;function Zo(){var e=performance.now(),t=!1;return e-Ci<Yo?++Nt>Si&&(t=!0):Nt=0,Ci=e,t}var xi=!1,kt=0;function Jo(){return xi?kt++:kt=0,kt>Si}function $o(e){e._pickPositionCacheDirty=!0;var t=e.context,i=t.uniformState,r=e._frameState,n=e._defaultView;e._view=n,Ie$2(e),r.passes.render=!0,r.passes.postProcess=e.postProcessStages.hasSelected,r.tilesetPassState=vo;var o=u$Y(e.backgroundColor,e$1S.BLACK);e._hdr&&((o=e$1S.clone(o,Qo)).red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),r.backgroundColor=o,r.creditDisplay.beginFrame(),e.fog.update(r),i.update(r);var a=e.shadowMap;e$28(a)&&a.enabled&&(t$X.negate(i.sunDirectionWC,e._sunCamera.direction),r.shadowMaps.push(a),e$28(e._analysisShadowMap)&&r.shadowMaps.push(e._analysisShadowMap)),e._computeCommandList.length=0,e._logDepthOverlayCommandList.length=0,e._overlayCommandList.length=0,e._overlayAgainstDepthCommandList.length=0;var s=n.viewport;s.x=0,s.y=0,s.width=t.drawingBufferWidth,s.height=t.drawingBufferHeight;var l=n.passState;if(l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=f$10.clone(s,l.viewport),e$28(e.globe)&&e.globe.beginFrame(r),e$28(e.terrainProvider)){var u=e.terrainProvider;e$28(u._minHeight)&&e$28(u._maxHeight)&&(r.minTerrainHeight=u._minHeight,r.maxTerrainHeight=u._maxHeight)}On(e),Bn(e),qn(e),An(e),Wi(e),Gn(e),Ui(e),De$2(e),Ue$1(e,l,o),Me$2(e,l),l.framebuffer=void 0,Rt(e,l),Hi(e),e.layers.endFrame(r),e$28(e.globe)&&(e.globe.endFrame(r),e.globe.tilesLoaded||(e._renderRequested=!0),e.camera._computeSensitivePosition()),en(e,r),e._lightSource.resetChange(),r.creditDisplay.endFrame(),t.endFrame(),(!e._saveLocalCachePerformance||Zo()&&Jo())&&(e.layers.saveLocalCache(),e.imageryLayers.saveLocalCache(),e.terrainProvider instanceof se$x&&e.terrainProvider.saveLocalCache())}function en(e,t){for(var i=e.layers._layerQueue.length,r=0;r<i;r++){var n=e.layers._layerQueue[r];e$28(n._imageryLayer)&&e$28(n._layerScheduler)&&n._layerScheduler.loadImagery(n,t)}}function or(e,t){try{t(e)}catch(t){if(e._renderError.raiseEvent(e,t),e.rethrowRenderErrors)throw t}}function rn(e){return e._picking.updateMostDetailedRayPicks(e)}function tn(e){var t=e._frameState;xt.camera=t.camera,xt.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,xt)}function an(e){e.primitives.updateForPass(e._frameState,co)}F$4.prototype.render=function(e){if(e$28(this.terrainLayers)&&this.terrainLayers._layers.length>0&&e$28(this._globe)){var t=this.terrainLayers._layers.length-1;this._globe._terrainProvider=this._globe._terrainLayerCollection._layers[t]._terrainProvider}if(e$28(this._globe)&&e$28(this._globe._terrainProvider._visible)&&this._globe._surface._visible!==this._globe._terrainProvider._visible){var i=this._globe._terrainProvider._visible;this._globe._surface.showInvalid(!i),this._globe._surface._visible=i}e$28(e)||(e=a$12.now());var r=this._frameState;r.newFrame=!1,this._jobScheduler.resetBudgets();var n=this._view.checkForCameraUpdates(this),o=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===P$$.MORPHING;if(!o&&e$28(this.maximumRenderTimeChange)&&e$28(this._lastRenderTime)){var a=Math.abs(a$12.secondsDifference(this._lastRenderTime,e));o=o||a>this.maximumRenderTimeChange}o&&(this._lastRenderTime=a$12.clone(e,this._lastRenderTime),this._renderRequested=!1,pi(this,e$27.incrementWrap(r.frameNumber,15e6,1),e),r.newFrame=!0,this.mode===P$$.SCENE3D&&(this._silverLightingAtmosphere.update(r,this.mode),this._lightSource._enableAmbientLightColor||e$1S.clone(this._silverLightingAtmosphere.getAmbientColor(),this._lightSource._ambientLightColor),this._lightSource._enableSunLightColor||e$1S.clone(this._silverLightingAtmosphere.getSunColor(),this._lightSource._sunLightColor)));this._preUpdate.raiseEvent(this,e),or(this,Xo),or(this,zo),this.primitives.show&&(or(this,rn),or(this,tn),or(this,gn),o||or(this,an)),this._postUpdate.raiseEvent(this,e),o&&(this._preRender.raiseEvent(this,e),or(this,$o)),jo(this,o),or(this,Ko),xi=0==r$1b.activeRequestLength,bi(this),o&&this._postRender.raiseEvent(this,e),this._logDepthBufferDirty=!1,this._hdrDirty=!1},F$4.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},F$4.prototype.requestRender=function(){this._renderRequested=!0},F$4.prototype.clampLineWidth=function(e){return Math.max(e$1U.minimumAliasedLineWidth,Math.min(e,e$1U.maximumAliasedLineWidth))};var on=new l$$,nn=new t$X,ut$2=new t$X,sn=new o$1k,un=new y$15;function ln(e,t,i,r,n){var o=e.camera,a=o.frustum;e$28(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(a.right-a.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(a.top-a.bottom);var u=y$15.clone(o.transform,un);o._setTransform(y$15.IDENTITY);var c=t$X.clone(o.position,nn);t$X.multiplyByScalar(o.right,s,ut$2),t$X.add(ut$2,c,c),t$X.multiplyByScalar(o.up,l,ut$2),t$X.add(ut$2,c,c),o._setTransform(u),e.mode===P$$.SCENE2D&&t$X.fromElements(c.z,c.x,c.y,c);var h=a.getPixelDimensions(n.width,n.height,1,1,sn),d=on;return d.right=.5*h.x,d.left=-d.right,d.top=.5*h.y,d.bottom=-d.top,d.near=a.near,d.far=a.far,d.computeCullingVolume(c,o.directionWC,o.upWC)}var fn=new l$X,dn=new o$1k;function mn(e,t,i,r,n){var o=e.camera,a=o.frustum,s=a.near,l=Math.tan(.5*a.fovy),u=a.aspectRatio*l,c=(2*(t.x-n.x)/n.width-1)*s*u,h=(2*(n.height-t.y-n.y)/n.height-1)*s*l,d=a.getPixelDimensions(n.width,n.height,1,1,dn),f=d.x*i*.5,p=d.y*r*.5,_=fn;return _.top=h+p,_.bottom=h-p,_.right=c+f,_.left=c-f,_.near=s,_.far=a.far,_.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function Hr(e,t,i,r,n){var o=e.camera.frustum;return o instanceof a$X||o instanceof l$$?ln(e,t,i,r,n):mn(e,t,i,r,n)}var ge$2=3,Pe=3,ie$1=new f$10(0,0,ge$2,Pe),wr=new e$1S(0,0,0,0),lt$1=new o$1k,Nr=new t$X;F$4.prototype.pick=function(e,t,i,r){if(!e$28(e))throw new t$Z("windowPosition is undefined.");if(!this.requestRenderMode&&Math.abs(this._frameState.frameNumber-this._pickResult.pickFrameNumber)<5&&!e$28(r))return this._pickResult.pickObject;ge$2=u$Y(t,this._pickTolerance),Pe=u$Y(i,ge$2);var n=this._context,o=n.uniformState,a=this._frameState,s=this._defaultView;this._view=s;var l=s.viewport;l.x=0,l.y=0,l.width=n.drawingBufferWidth,l.height=n.drawingBufferHeight;var u=s.passState;u.viewport=f$10.clone(l,u.viewport);var c=m$W.transformWindowToDrawingBuffer(this,e,lt$1);if(this._multiViewportMode!==te$6.NONE){var h=Gr(this,c);if(c.y=n.drawingBufferHeight-c.y,h>-1){a.multiViewportIndex=h;var d=this._multiViewportInfo[h];Z$5.x=n.drawingBufferWidth*d.x,Z$5.y=n.drawingBufferHeight*d.y,Z$5.width=n.drawingBufferWidth*d.width,Z$5.height=n.drawingBufferHeight*d.height;var f=(c.x-Z$5.x)/Z$5.width,p=(c.y-Z$5.y)/Z$5.height;c.x=f*n.drawingBufferWidth,c.y=(1-p)*n.drawingBufferHeight}}for(var _=s.frustumCommandsList.length,m=0;m<_;++m){var $=this._picking.getPickDepth(this,m).getDepth(n,c.x,c.y);$>0&&$<1&&(Nr=m$W.drawingBufferToWgs84Coordinates(this,c,$,Nr))}n._pickPosition[0]=Nr.x,n._pickPosition[1]=Nr.y,n._pickPosition[2]=Nr.z;var g=t$W.fromCartesian(Nr);e$28(g)&&(n._pickPositionHeight=g.height),this._jobScheduler.disableThisFrame(),Ie$2(this),a.cullingVolume=Hr(this,c,ge$2,Pe,l),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=Tt,o.update(a),De$2(this);var v=!1,y=this.particlePostRender,x=this.particleTrailsPostRenderer;(y.enable||x.enable)&&(v=!0),ie$1.x=c.x-.5*(ge$2-1),ie$1.y=this.drawingBufferHeight-c.y-.5*(Pe-1),ie$1.width=ge$2,ie$1.height=Pe,Ue$1(this,u=s.pickFramebuffer.begin(ie$1,s.viewport,v),wr),Rt(this,u),Me$2(this,u);var b=s.pickFramebuffer.end(ie$1);n.endFrame();m=0;for(var w=this._primitives.length;m<w;m++){var C=this._primitives._primitives[m];C.type==oi$2.INSTANCED_LAYER&&C.setUnSelected()}var T=this._analyst3D.layerQueue;for(m=0,w=T.length;m<w;m++){var S=T[m];S instanceof n$a&&S.releaseSelection()}if(e$28(b)&&e$28(b.primitive)&&(b.primitive.type===oi$2.INSTANCED_OBJECT||b.primitive instanceof n$a)&&b.primitive.setSelected(b.id),e$28(b)&&e$28(b.primitive)&&b.primitive instanceof _0x1f65d5){var E=b.id.split("_");2==E.length&&b.primitive.setPolygonOffset(E[1])}else{var A=e$28(b)&&e$28(b.primitive)&&b.primitive instanceof _0x47d916;A?(this._layers._setSelection(b),e$28(b.primitive)&&!1===b.primitive.selectEnabled&&(b=void 0)):this._layers.releaseSelection()}var P={isS3MTilesLayerSel:!1,pickedObject:void 0};if(e$28(b)||(P=this.pickRasterData(e)),!A&&P.isS3MTilesLayerSel)return a.commandListRealtimeRaster.length=0,P.pickedObject;for(var I in this._vectorTileSource._hash){var M=this._vectorTileSource.get(I);e$28(M._labelCollection)&&M._labelCollection.releaseSelection()}return e$28(b)&&e$28(b.collection)&&(e$28(b.collection._isS3MTileLabels)&&b.collection._isS3MTileLabels||b.collection._isMVT)&&e$28(b.collection.setSelection)&&b.collection.setSelection(b.id),this._pickResult.pickFrameNumber=this._frameState.frameNumber,this._pickResult.pickObject=b,e$28(g)&&e$28(b)&&(b.height=g.height),b};var nr=new h$10,Vi=new t$X,Ti=new t$X,Di=new t$X,ft=new t$X,hn=new t$X(0,0,-1),pn=new t$X(0,1,0),vn=new f$10(0,0,1,1),Oe=new o$1k;function Pi(e,t){var i=e._context,r=e._frameState,n=e._environmentState,o=e.globe.depthTestAgainstTerrain;e.globe.depthTestAgainstTerrain=!0;var a=e._defaultView;e._view=a;var s=a.viewport;s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;var l=a.passState;l.viewport=f$10.clone(s,l.viewport),Pt$1(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=Hr(e,t,1,1,s),De$2(e),n.renderTranslucentDepthForPick=!0,Ue$1(e,l=a.pickDepthFramebuffer.update(i,t,s),wr,!0),Rt(e,l),Me$2(e,l),e.globe.depthTestAgainstTerrain=o,i.endFrame()}function Gr(e,t){if(e._mode===P$$.SCENE2D||e._multiViewportMode==te$6.NONE)return-1;for(var i=e._context,r=new f$10(t.x,i.drawingBufferHeight-t.y),n=new f$10,o=-1,a=0;a<e._multiViewportInfo.length;a++){var s=e._multiViewportInfo[a];if(n.x=i.drawingBufferWidth*s.x,n.y=i.drawingBufferHeight*s.y,n.width=i.drawingBufferWidth*s.width,n.height=i.drawingBufferHeight*s.height,n.intersect(r)===pt$a.INTERSECTING){o=a;break}}return o}F$4.prototype.pickRasterData=function(e,t,i){if(!e$28(e))throw new t$Z("windowPosition is undefined.");var r=this._frameState,n=r.commandListRealtimeRaster;if(0===n.length)return{isS3MTilesLayerSel:!1,pickedObject:void 0};var o=this.pickPosition(e),a=t$W.fromCartesian(o),s=e$27.toDegrees(a.longitude),l=e$27.toDegrees(a.latitude);Oe.x=e.x,Oe.y=e.y+1;var u=this.pickPosition(Oe),c=t$W.fromCartesian(u),h=e$27.toDegrees(c.latitude);Oe.x=e.x,Oe.y=e.y-1,u=this.pickPosition(Oe),c=t$W.fromCartesian(u);var d=e$27.toDegrees(c.latitude);Oe.x=e.x-1,Oe.y=e.y,u=this.pickPosition(Oe),c=t$W.fromCartesian(u);var f=e$27.toDegrees(c.longitude);Oe.x=e.x+1,Oe.y=e.y,u=this.pickPosition(Oe),c=t$W.fromCartesian(u);for(var p=e$27.toDegrees(c.longitude),_=Math.abs(p-f),m=Math.abs(d-h),$=[],g=0;g<n.length;g++){let e=n[g]._boundingVolume.radius;e||(n[g]._boundingVolume._updateBBox(),e=t$X.distance(n[g]._boundingVolume.center,n[g]._boundingVolume.bbox[0])),nr.west=n[g]._boundingVolume.center.x-e,nr.south=n[g]._boundingVolume.center.y-e,nr.east=n[g]._boundingVolume.center.x+e,nr.north=n[g]._boundingVolume.center.y+e,s<nr.east&&s>nr.west&&l<nr.north&&l>nr.south&&$.push(n[g])}if(0===$.length)return{isS3MTilesLayerSel:!1,pickedObject:void 0};e$28(this._rasterPickTexture)||(this._rasterPickTexture=new L$17({context:r.context,width:1,height:1,pixelFormat:V$O.RGBA,sampler:new n$Y({wrapS:q$11.CLAMP_TO_EDGE,wrapT:q$11.CLAMP_TO_EDGE,minificationFilter:tt$h.LINEAR,magnificationFilter:rt$g.LINEAR})}),this._rasterPickFBO=new a$z({context:r.context,colorTextures:[this._rasterPickTexture],destroyAttachments:!1}));var v=this._clearColorCommand.framebuffer;this._clearColorCommand.framebuffer=this._rasterPickFBO,this._clearColorCommand.execute(r.context);var y=r.camera;t$X.clone(y.position,Vi),t$X.clone(y.direction,Ti),t$X.clone(y.up,Di);var x=s-_,b=s+_,w=l+m,C=l-m;ft.x=.5*(x+b),ft.y=.5*(w+C),ft.z=5,y.setView({destination:ft,orientation:{direction:hn,up:pn},convert:!1});var T=new a$X({width:b-x,aspectRatio:1,near:1,far:10});r.context.uniformState.update(r),r.context.uniformState.updateFrustum(T);for(g=0;g<$.length;g++){$[g].renderState=u$R.fromCache({viewport:vn}),$[g].framebuffer=this._rasterPickFBO;var S=$[g].derivedCommands;S.picking=_$g.createPickDerivedCommand(this,$[g],r.context,S.picking),$[g].derivedCommands.picking.pickCommand.execute(r.context)}y.setView({destination:Vi,orientation:{direction:Ti,up:Di},convert:!1}),r.context.uniformState.update(r),r.context.uniformState.updateFrustum(y.frustum);var E=r.context.readPixels({x:0,y:0,width:1,height:1,framebuffer:this._rasterPickFBO});r.context.pixels=E;var A=e$1S.byteToRgba(E[0],E[1],E[2],E[3]),P=r.context.getObjectByPickId(A),I=e$28(P)&&e$28(P.primitive)&&P.primitive instanceof _0x47d916;return I?this._layers._setSelection(P):this._layers.releaseSelection(),this._clearColorCommand.execute(r.context),this._clearColorCommand.framebuffer=v,{isS3MTilesLayerSel:I,pickedObject:P}},F$4.prototype.pickRasterData2D=function(e,t,i){var r=this.pickPosition(e),n=t$W.fromCartesian(r),o=this._frameState.rasterVectorCollection,a=o.getPickID(n);o.setSelection(a)},F$4.prototype.pointPick=function(e){if(!e$28(e))throw new t$Z("windowPosition is undefined.");var t=this._pickPointTolerance,i=t;ge$2=u$Y(t,3),Pe=u$Y(i,ge$2);var r=this._context,n=r.uniformState,o=this._frameState,a=this._defaultView;this._view=a;var s=a.viewport;s.x=0,s.y=0,s.width=r.drawingBufferWidth,s.height=r.drawingBufferHeight;var l=a.passState;l.viewport=f$10.clone(s,l.viewport);var u=m$W.transformWindowToDrawingBuffer(this,e,m);if(this._multiViewportMode!==te$6.NONE){var c=Gr(this,u);if(u.y=r.drawingBufferHeight-u.y,c>-1){o.multiViewportIndex=c;var h=this._multiViewportInfo[c];Z$5.x=r.drawingBufferWidth*h.x,Z$5.y=r.drawingBufferHeight*h.y,Z$5.width=r.drawingBufferWidth*h.width,Z$5.height=r.drawingBufferHeight*h.height;var d=(u.x-Z$5.x)/Z$5.width,f=(u.y-Z$5.y)/Z$5.height;u.x=d*r.drawingBufferWidth,u.y=f*r.drawingBufferHeight,u.y=r.drawingBufferHeight-Be$1.y}}this._jobScheduler.disableThisFrame(),Ie$2(this),o.cullingVolume=Hr(this,u,ge$2,Pe,s),o.invertClassification=!1,o.passes.pick=!0;var p=this._environmentVisible;this._environmentVisible=a.pickPointFramebuffer._environmentVisible,n.update(o),De$2(this),ie$1.x=u.x-.5*(ge$2-1),ie$1.y=this.drawingBufferHeight-u.y-.5*(Pe-1),ie$1.width=ge$2,ie$1.height=Pe,Ue$1(this,l=a.pickPointFramebuffer.begin(ie$1,a.viewport),wr),Me$2(this,l);var _=a.pickPointFramebuffer.end(ie$1);if(r.endFrame(),this._environmentVisible=p,e$28(_))if(_.z>-e$27.EPSILON10)this._pos=void 0;else{var m=new e$25,$=t$X.magnitude(_);y$15.multiplyByVector(o.camera.inverseViewMatrix,_,m);var g=m$W.wgs84ToWindowCoordinates(this,m,new o$1k),v=this.pickPosition(g,new t$X);if(e$28(v)&&!($>t$X.distance(v,o.camera.position)+5))return this._pos=new e$25,e$25.clone(m,this._pos),this._pos;this._pos=void 0}else this._pos=void 0},F$4.prototype.pickNormal=function(e){if(!e$28(e))throw new t$Z("windowPosition is undefined.");ge$2=1,Pe=1;var t=this._context,i=t.uniformState,r=this._frameState,n=this._defaultView;this._view=n;var o=n.viewport;o.x=0,o.y=0,o.width=t.drawingBufferWidth,o.height=t.drawingBufferHeight;var a=n.passState;a.viewport=f$10.clone(o,a.viewport);var s=m$W.transformWindowToDrawingBuffer(this,e,lt$1);if(this._multiViewportMode!==te$6.NONE){var l=Gr(this,s);if(s.y=t.drawingBufferHeight-s.y,l>-1){r.multiViewportIndex=l;var u=this._multiViewportInfo[l];Z$5.x=t.drawingBufferWidth*u.x,Z$5.y=t.drawingBufferHeight*u.y,Z$5.width=t.drawingBufferWidth*u.width,Z$5.height=t.drawingBufferHeight*u.height;var c=(s.x-Z$5.x)/Z$5.width,h=(s.y-Z$5.y)/Z$5.height;s.x=c*t.drawingBufferWidth,s.y=h*t.drawingBufferHeight,s.y=t.drawingBufferHeight-Be$1.y}}this._jobScheduler.disableThisFrame(),Ie$2(this),r.cullingVolume=Hr(this,s,ge$2,Pe,o),r.invertClassification=!1,r.passes.pick=!0,r.passes.normal=!0;var d=this._environmentVisible;this._environmentVisible=n.normalFramebuffer._environmentVisible,i.update(r),De$2(this),ie$1.x=s.x-.5*(ge$2-1),ie$1.y=this.drawingBufferHeight-s.y-.5*(Pe-1),ie$1.width=ge$2,ie$1.height=Pe,Ue$1(this,a=n.normalFramebuffer.begin(ie$1,n.viewport),wr),Me$2(this,a);var f=n.normalFramebuffer.end(ie$1);if(t.endFrame(),r.passes.pick=!1,r.passes.normal=!1,this._environmentVisible=d,e$28(f))return f};var Z$5=new f$10,Be$1=new o$1k,dt$1=new o$1k;F$4.prototype.pickPositionWorldCoordinates=function(e,t,i){if(this.useDepthPicking){if(!e$28(e))throw new t$Z("windowPosition is undefined.");var r=e.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return t$X.clone(this._pickPositionCache[r],t);var n=this._frameState,o=this._context,a=o.uniformState,s=this._defaultView;this._view=s;var l=m$W.transformWindowToDrawingBuffer(this,e,lt$1);if(o$1k.clone(l,dt$1),this.pickTranslucentDepth){if(this._multiViewportMode!==te$6.NONE){var u=Gr(this,l);if(o$1k.clone(l,Be$1),Be$1.y=o.drawingBufferHeight-Be$1.y,u>-1){n.multiViewportIndex=u;var c=this._multiViewportInfo[u];Z$5.x=o.drawingBufferWidth*c.x,Z$5.y=o.drawingBufferHeight*c.y,Z$5.width=o.drawingBufferWidth*c.width,Z$5.height=o.drawingBufferHeight*c.height;var h=(Be$1.x-Z$5.x)/Z$5.width,d=(Be$1.y-Z$5.y)/Z$5.height;Be$1.x=h*o.drawingBufferWidth,Be$1.y=d*o.drawingBufferHeight,dt$1.x=Be$1.x,dt$1.y=o.drawingBufferHeight-Be$1.y,Ie$2(this,n.frameNumber,n.time),n.tilesetPassState=Tt}}Pi(this,dt$1)}else Ie$2(this,n.frameNumber,n.time),a.update(n),De$2(this);this._multiViewportMode!==te$6.NONE?l=Be$1:l.y=this.drawingBufferHeight-l.y;var f,p=this.camera;f=e$28(p.frustum.fov)?p.frustum.clone(it):e$28(p.frustum.infiniteProjectionMatrix)?p.frustum.clone(at$3):e$28(p.frustum.width)?p.frustum.clone(ot$2):p.frustum.clone(nt$2);for(var _=s.frustumCommandsList,m=_.length,$=0;$<m;++$){var g=this._picking.getPickDepth(this,$).getDepth(o,l.x,l.y,e$28(i)&&i?this._pickDepthTolerance:0);if(g>0&&g<1){var v,y=_[$];return this.mode===P$$.SCENE2D?(v=p.position.z,p.position.z=v-y.near+1,f.far=Math.max(1,y.far-y.near),f.near=1,a.update(n),a.updateFrustum(f)):(f.near=y.near*(0!==$?this.opaqueFrustumNearOffset:1),f.far=y.far,a.updateFrustum(f)),t=m$W.drawingBufferToWgs84Coordinates(this,l,g,t),this.mode===P$$.SCENE2D&&(p.position.z=v,a.update(n)),this._pickPositionCache[r]=t$X.clone(t),t}}this._pickPositionCache[r]=void 0}};var cn=new t$W;function Ei(e,t){var i,r,n=[],o=[],a=[],s=[],l=Object.create(null);e$28(e)||(e=Number.MAX_VALUE);for(var u=t();e$28(u);){var c=u.object,h=u.position,d=u.exclude;if(e$28(h)&&!e$28(c)){n.push(u);break}if(!e$28(c)||!e$28(c.primitive)||!d&&(n.push(u),0>=--e))break;var f=c.primitive,p=!1;if("function"==typeof f.getGeometryInstanceAttributes&&e$28(c.id)&&(e$28(r=f.getGeometryInstanceAttributes(c.id))&&e$28(r.show)&&(p=!0,r.show=e$1h.toValue(!1,r.show),a.push(r))),c instanceof e$10&&(p=!0,c.show=!1,s.push(c)),f instanceof _0x47d916){p=!0,f.setOnlyObjsVisible([c.id],!1);var _=f.id;(l[_]=l[_]||{}).layer=f,(l[_].ids=l[_].ids||[]).push(c.id)}p||(f.show=!1,o.push(f)),u=t()}for(i=0;i<o.length;++i)o[i].show=!0,o[i]instanceof _0x375cb8&&o[i].setSelected();for(var m in l){var $=l[m];$.layer.setOnlyObjsVisible($.ids,!0)}for(i=0;i<a.length;++i)(r=a[i]).show=e$1h.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}function gn(e){var t=e._frameState;t.camera.canPreloadFlight()&&(Vt.camera=e.preloadFlightCamera,Vt.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Vt))}F$4.prototype.pickPosition=function(e,t){if(e$28(t=this.pickPositionWorldCoordinates(e,t))&&this.mode!==P$$.SCENE3D){t$X.fromElements(t.y,t.z,t.x,t);var i=this.mapProjection,r=i.ellipsoid,n=i.unproject(t,cn);r.cartographicToCartesian(n,t)}return t},F$4.prototype.pickPosition2D=function(e,t){if(e$28(t=this.pickPositionWorldCoordinates(e,t)))return e$28(t)&&this.mode!==P$$.SCENE3D&&t$X.fromElements(t.y,t.z,t.x,t),t.x+=t$X.globalOffset.x,t.y+=t$X.globalOffset.y,t.z+=t$X.globalOffset.z,t},F$4.prototype.pickTileCoordinate=function(e){function t(e,t){return h$10.contains(e.rectangle,t)?e:void 0}if(!e$28(e))throw new t$Z("windowPosition is required");var i=this.globe._surface._levelZeroTiles;if(e$28(i)){var r,n;try{r=this.pickPosition(e,new t$X),n=t$W.fromCartesian(r)}catch{return}for(var o=n.longitude,a=n.latitude,s=t(i[0],n)||t(i[1],n);s._lastSelectionResult===D$t.REFINED;)s=t(s.southwestChild,n)||t(s.southeastChild,n)||t(s.northwestChild,n)||s.northeastChild;var l=s.rectangle,u=(o-l.west)/l.width,c=(l.north-a)/l.height;return{x:s.x,y:s.y,level:s.level,xRatio:u,yRatio:c}}},F$4.prototype.drillPick=function(e,t,i,r){var n=this,o=Ei(t,(function(){var t=n.pick(e,i,r,!0);if(e$28(t))return{object:t,position:void 0,exclude:!1}}));return o.map((function(e){return e.object}))};var Ri=new t$X,_n=new t$X;function Fi(e,t,i,r){var n=t.direction,o=t$X.mostOrthogonalAxis(n,Ri),a=t$X.cross(n,o,Ri),s=t$X.cross(n,a,_n);r.position=t.origin,r.direction=n,r.up=s,r.right=a,r.frustum.width=u$Y(i,e.pickOffscreenDefaultWidth)}function Lt(e,t,i,r,n){for(var o=[],a=e.primitives,s=a.length,l=0;l<s;++l){var u=a.get(l);u instanceof p$A&&u.show&&(!e$28(i)||-1===i.indexOf(u))&&o.push(u)}if(0===o.length)return o$1q.resolve(n());var c=new fo(t,r,o);return e._asyncRayPicks.push(c),c.promise.then((function(){return n()}))}function wn(e,t){return!(!e$28(e)||!e$28(t)||0===t.length)&&(t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1)}function bn(e,t,i,r,n,o,a){var s=e._context,l=s.uniformState,u=e._frameState,c=e._pickOffscreenView;e._view=c,Fi(e,t,r,c.camera),ie$1=f$10.clone(c.viewport,ie$1);var h=c.pickFramebuffer.begin(ie$1,c.viewport);e._jobScheduler.disableThisFrame(),e$28(e.camera.frustum.left)&&(u.cullingVolume=Hr(e,{x:0,y:0},1,1,c.viewport)),Ie$2(e),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,u.passes.asynchronous=o,c.updateFrustums=!0,u.tilesetPassState=a?go:Tt,l.update(u),De$2(e),Ue$1(e,h,wr),Me$2(e,h);var d,f=c.pickFramebuffer.end(s);if(e._context.depthTexture)for(var p=c.frustumCommandsList.length,_=0;_<p;++_){var m=e._picking.getPickDepth(e,_).getDepth(s,0,0);if(m>0&&m<1){var $=c.frustumCommandsList[_],g=$.near*(0!==_?e.opaqueFrustumNearOffset:1),v=g+m*($.far-g);d=f$18.getPoint(t,v);break}}if(e._view=e._defaultView,s.endFrame(),u.passes.pick=!1,u.passes.offscreen=!1,e$28(f)||e$28(d))return{object:f,position:d,exclude:!e$28(d)&&n||wn(f,i)}}function Ni(e,t,i,r,n,o,a,s){return Ei(i,(function(){return bn(e,t,r,n,o,a,s)}))}function kr(e,t,i,r,n,o){var a=Ni(e,t,1,i,r,n,o,!1);if(a.length>0)return a[0]}function ki(e,t,i,r,n,o,a){return Ni(e,t,i,r,n,o,a,!0)}F$4.prototype.pickFromRay=function(e,t,i){if(o$1u.defined("ray",e),this._mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");return kr(this,e,t,i,!1,!1)},F$4.prototype.drillPickFromRay=function(e,t,i,r){if(o$1u.defined("ray",e),this._mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");return ki(this,e,t,i,r,!1,!1)},F$4.prototype.pickFromRayMostDetailed=function(e,t,i){if(o$1u.defined("ray",e),this._mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");var r=this;return e=f$18.clone(e),t=e$28(t)?t.slice():t,Lt(this,e,t,i,(function(){return kr(r,e,t,i,!1,!0)}))},F$4.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){if(o$1u.defined("ray",e),this._mode!==P$$.SCENE3D)throw new t$Z("Ray intersections are only supported in 3D mode.");var n=this;return e=f$18.clone(e),i=e$28(i)?i.slice():i,Lt(this,e,i,r,(function(){return ki(n,e,t,i,r,!1,!0)}))};var Cn=new t$X,Sn=new t$X,xn=new f$18,Li=new t$W;function It$1(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid,n=e$1_._defaultMaxTerrainHeight,o=r.geodeticSurfaceNormalCartographic(t,Sn),a=t$W.toCartesian(t,r,Cn),s=xn;s.origin=a,s.direction=o;var l=new f$18;return f$18.getPoint(s,n,l.origin),t$X.negate(o,l.direction),l}function Ii(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid;return It$1(e,t$W.fromCartesian(t,r,Li))}function Mi(e,t){var i=e.globe,r=e$28(i)?i.ellipsoid:e.mapProjection.ellipsoid;return t$W.fromCartesian(t,r,Li).height}function Vn(e,t,i,r){var n=It$1(e,t);return Lt(e,n,i,r,(function(){var t=kr(e,n,i,r,!0,!0);if(e$28(t))return Mi(e,t.position)}))}function Oi(e){var t={},i=e.firstChild,r=s$P.queryStringValue(i,"Version");t.version=r;var n=s$P.queryStringValue(i,"FileType");t.fileType=n;var o=s$P.queryFirstNode(i,"WaterEffect"),a=s$P.queryNumericValue(o,"AverageHeight");t.averageHeight=a;var s=s$P.queryNodes(o,"GpuProgramParameters");t.gpuProgramParameters=[];for(var l=0,u=s.length;l<u;l++){var c={gpuConstants:[],atuoConstants:[]},h=s[l],d=s$P.queryFirstNode(h,"GpuConstants");if(d)for(var f=s$P.queryNodes(d,"GpuConstantDefinition"),p=0,_=f.length;p<_;p++){var m={},$=f[p],g=s$P.queryNumericValue($,"ConstType");m.constType=g;var v=s$P.queryNumericValue($,"Index");m.index=v;var y=s$P.queryStringValue($,"Name");m.name=y;var x=s$P.queryNumericValue($,"ArraySize");m.arraySize=x;var b=s$P.queryNumericValue($,"Multiple");m.multiple=b;var w=s$P.queryFirstNode($,"ArrayFloat");if(m.arrayFloat=[],w)for(var C=s$P.queryNodes(w,"Float"),T=0;T<x;){var S=parseFloat(C[T].textContent);m.arrayFloat.push(S),T++}c.gpuConstants.push(m)}var E=s$P.queryFirstNode(h,"AutoConstants");if(E){var A=s$P.queryNodes(E,"AutoConstantEntry");for(p=0,_=A.length;p<_;p++){m={};var P=A[p],I=s$P.queryNumericValue(P,"ParamType");m.paramType=I;y=s$P.queryStringValue(P,"Name");m.name=y;var M=s$P.queryNumericValue(P,"PhysicalIndex");m.physicalIndex=M;var O=s$P.queryNumericValue(P,"ElementCount");m.elementCount=O;var D=s$P.queryNumericValue(P,"Data");m.data=D;var R=s$P.queryNumericValue(P,"FData");m.fData=R;var L=s$P.queryBooleanValue(P,"IsReal");m.isReal=L,c.atuoConstants.push(m)}}t.gpuProgramParameters.push(c)}return t}function Tn(e,t,i,r){var n=o$1q.defer(),o=e.toString()+"indexData.dat";if(e$28(a$Y.CREDENTIAL)&&(o=a$Y.addToken(o)),i===fi$5.KEY_VALUE){var a=m$1j(r.split("?")[1]),s={suffix:"dat"},l=m$1k(s=Object.assign(s,a),!0),u=r.match(/(\S*)\/config/);u.length>0&&(o=u[0]+"?"+l)}return o$1q(d$17(o,t),(function(e){for(var t=new e$1P,i=e.firstChild,r=i.namespace,o=s$P.queryFirstNode(i,"FieldDefines",r),a=s$P.queryChildNodes(o,"FieldDefine",r),s=0;s<a.length;s++){var l=s$P.queryStringAttribute(a[s],"Name"),u=s$P.queryStringAttribute(a[s],"Type"),c=s$P.queryStringAttribute(a[s],"Size");t.set(l,{type:u,size:c})}n.resolve(t)}),(function(){n.reject()})),n.promise}function Dn(e,t,i,r){var n=o$1q.defer();if(e$28(i)){var o,a=e.toString();if(r===fi$5.KEY_VALUE){var s=m$1j(a.split("?")[1]),l={suffix:"attribute.json"},u=m$1k(l=Object.assign(l,s),!0),c=a.match(/(\S*)\/config/);c.length>0&&(o=c[0]+"?"+u)}else{var h=a.substring(0,a.indexOf("/realspace")+10);o=a+"attribute.json",e$28(a$Y.CREDENTIAL)&&(o=e$28(a$Y.CREDENTIAL._keymap[h])?a$Y.addTokenWithKey(h,o):a$Y.addToken(o))}o$1q(u$O(o,t),(function(e){if(e.layerInfos){for(var t=e.layerInfos[0].fieldInfos,i=new e$1P,r=0;r<t.length;r++)i.set(t[r].name,{type:t[r].type,size:t[r].size});var o,a=void 0;if(e$28(e.indexInfos)){o={},a={};r=0;for(var s=e.indexInfos.length;r<s;r++){var l=e.indexInfos[r],u=f$V(l.rootNodePath);o[u=u.replace(".s3mb","")]=l.indexInfo,a[l.rootNodePath.replace(".s3mb","")]=l.indexInfo}}n.resolve({fieldsInfo:i,indexInfoMap:o,indexInfoAttributeMap:a})}else n.reject()}),(function(){n.reject()}))}else n.reject();return n.promise}function Pn(e,t,i){if(e&&t){var r=e.firstChild;if(r){var n=r.namespaceURI,o=s$P.queryFirstNode(r,"AttachFiles",n);if(o){for(var a=s$P.queryNodes(o,"AttachFile",n),s=[],l=0,u=a.length;l<u;l++){var c=a[l].textContent;if(c.indexOf("water")>0){var h=t+c;s.push(d$17(h,i))}}if(!s.length)return;var d=o$1q.defer();return o$1q.all(s,(function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];if(!n)break;var o=Oi(n);t.push(o)}d.resolve(t)}),(function(){})),d.promise}}}}function En(e,t,i){if(e&&t){var r=e.extensions;if(e$28(r)&&e$28(r.attachFiles)){for(var n=r.attachFiles,o=[],a=0,s=n.length;a<s;a++){var l=n[a].attachFile;if(l.indexOf(".water")>0){var u=t+l;e$28(a$Y.CREDENTIAL)&&(u=a$Y.addToken(u)),o.push(d$17(u,i))}}if(o.length){var c=o$1q.defer();return o$1q.all(o,(function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];if(!n)break;var o=Oi(n);t.push(o)}c.resolve(t)}),(function(){})),c.promise}}}}function Rn(e,t,i){var r=e.firstChild,n=r.namespace;if("Spatial3DModel"===r.localName){s$P.queryStringValue(r,"Asset",n),s$P.queryStringValue(r,"Version",n);var o=s$P.queryStringValue(r,"DataType",n);s$P.queryStringValue(r,"PyramidSplitType",n),s$P.queryStringValue(r,"LodType",n);var a=s$P.queryFirstNode(r,"Position",n),s=s$P.queryNumericValue(a,"X",n),l=s$P.queryNumericValue(a,"Y",n),u=s$P.queryNumericValue(a,"Z",n);if(e$28(ie=s$P.queryFirstNode(r,"GeoBounds",n))){var c=s$P.queryNumericValue(ie,"Left",n),h=s$P.queryNumericValue(ie,"Top",n),d=s$P.queryNumericValue(ie,"Right",n),f=s$P.queryNumericValue(ie,"Bottom",n);Q=h$10.fromDegrees(c,f,d,h)}var p=s$P.queryFirstNode(r,"HeightRange",n),_=s$P.queryNumericValue(p,"Min",n),m=s$P.queryNumericValue(p,"Max",n),$=s$P.queryFirstNode(r,"CategoryRange",n),g=s$P.queryNumericValue($,"MaxCategory",n),v=s$P.queryNumericValue($,"MinCategory",n),y=s$P.queryFirstNode(r,"WDescript",n),x=s$P.queryFirstNode(y,"Range",n),b=s$P.queryNumericValue(x,"Min",n),w=s$P.queryNumericValue(x,"Max",n);g=g||w,v=v||b;var C=s$P.queryFirstNode(r,"Extensions",n),T=s$P.queryStringValue(C,"FileType",n);s$P.queryStringValue(C,"TileSplitType",n);var S=s$P.queryBooleanValue(C,"TextureSharing",n),E=s$P.queryBooleanValue(C,"TransparencyOptimization",n),A=s$P.queryStringValue(C,"VertexWeightMode",n),P=s$P.queryStringValue(C,"ProcessType",n),I={};(Ce=t.split("?")).length>1&&(I=m$1j(Ce[1]),t=Ce[0]);for(var M=new h$$(i===er.oss?t.substring(0,t.lastIndexOf("/")+1):t.replace(/config$/g,"data/path/")),O=[],D=/\\+/g,R=s$P.queryFirstNode(r,"Tiles",n),L=!1,B=0,N=(Te=s$P.queryNodes(R,"Tile",n)).length;B<N;B++){var F=Te[B],z=(Re=s$P.queryStringValue(F,"Url",n)).lastIndexOf(".");".s3mbz"===Re.substring(z,Re.length)&&(L=!0);var k=i$18(Re=(Re=Re.replace(D,"/")).replace(/(\.s3mbz)|(\.s3mb)|(\.osgb)/gi,"")),V=f$V(Re);(Le={}).relativePath=new h$$(k),Le.name=V;var U=s$P.queryFirstNode(F,"Boundingbox",n);if(e$28(U)){var X=s$P.queryFirstNode(U,"Min",n),H=s$P.queryFirstNode(U,"Max",n),G=s$P.queryNumericValue(X,"X",n),W=s$P.queryNumericValue(X,"Y",n),Y=s$P.queryNumericValue(X,"Z",n),q=s$P.queryNumericValue(H,"X",n),j=s$P.queryNumericValue(H,"Y",n),Z=s$P.queryNumericValue(H,"Z",n),K=new i$19;i$19.fromCornerPoints(new t$X(G,W,Y),new t$X(q,j,Z),K),Le.bSphere=K}O.push(Le)}return{position:{lon:s,lat:l,height:u},fileType:T,maxInstensity:0,minInstensity:0,maxHeight:m,minHeight:_,maxCategory:g,minCategory:v,layerBounds:Q,baseUri:M,rootEntities:O,isTextureShare:S,urlArguments:I,isS3MB:!0,isS3MZ:L,processType:P,dataType:o,isTransparencyOptimization:E,vertexWeightMode:A}}T=s$P.queryStringValue(r,"FileType",n),S=s$P.queryBooleanValue(r,"TextureSharing",n),E=s$P.queryBooleanValue(r,"TransparencyOptimization",n),A=s$P.queryStringValue(r,"VertexWeightMode",n);var Q,J=s$P.queryFirstNode(r,"InstensityRange",n),ee=s$P.queryNumericValue(J,"MinInstensity",n),te=s$P.queryNumericValue(J,"MaxInstensity",n),ie=(p=s$P.queryFirstNode(r,"HeightRange",n),_=s$P.queryNumericValue(p,"MinHeight",n),m=s$P.queryNumericValue(p,"MaxHeight",n),$=s$P.queryFirstNode(r,"CategoryRange",n),g=s$P.queryNumericValue($,"MaxCategory",n),v=s$P.queryNumericValue($,"MinCategory",n),P=s$P.queryStringValue(r,"ProcessType",n),a=s$P.queryFirstNode(r,"Position",n),s=s$P.queryNumericValue(a,"X",n),l=s$P.queryNumericValue(a,"Y",n),u=s$P.queryNumericValue(a,"Z",n),s$P.queryFirstNode(r,"Bounds",n)),re=s$P.queryFirstNode(r,"BoundingBox",n),ne=s$P.queryStringValue(r,"IDFieldName",n),oe=s$P.queryStringValue(r,"AttributeExtentName",n);if(e$28(ie)){c=s$P.queryNumericValue(ie,"Left",n),h=s$P.queryNumericValue(ie,"Top",n),d=s$P.queryNumericValue(ie,"Right",n),f=s$P.queryNumericValue(ie,"Bottom",n);Q=h$10.fromDegrees(c,f,d,h)}else if(e$28(re)){var ae=s$P.queryNumericValue(re,"MinX",n),se=s$P.queryNumericValue(re,"MinY",n);s$P.queryNumericValue(re,"MinZ",n);var le=s$P.queryNumericValue(re,"MaxX",n),ue=s$P.queryNumericValue(re,"MaxY",n);s$P.queryNumericValue(re,"MaxZ",n),ae=180*Math.abs(ae)/(6378137*Math.PI),se=180*Math.abs(se)/(6378137*Math.PI),le=180*Math.abs(le)/(6378137*Math.PI),ue=180*Math.abs(ue)/(6378137*Math.PI),Q=h$10.fromDegrees(s-ae,l-se,s+le,l+ue)}else Q=h$10.fromDegrees(s-1e-5,l-1e-5,s+1e-5,l+1e-5);var ce=void 0,he=s$P.queryNodes(r,"Vol",n);if(e$28(he)&&he.length>0){var de=[],fe=[],pe=[],_e=[];for(B=0,N=he.length;B<N;B++){var me=he[B],$e=s$P.queryStringValue(me,"Name",n);de.push($e);var ge=s$P.queryStringValue(me,"AttachFileExt",n);_e.push(ge);var ve=s$P.queryFirstNode(me,"VolumeValueRange",n);if(e$28(ve)){var ye=s$P.queryNumericValue(ve,"MinValue",n),xe=s$P.queryNumericValue(ve,"MaxValue",n);fe.push(xe),pe.push(ye)}}ce={bVolume:!0,strVolumeExts:_e,volNames:de,maxValues:fe,minValues:pe}}var be=s$P.queryFirstNode(r,"VolumeValueRange",n);if(e$28(be)){ye=s$P.queryNumericValue(be,"MinValue",n),xe=s$P.queryNumericValue(be,"MaxValue",n);var we=s$P.queryStringValue(r,"AttachFileExt",n);e$28(ce)?(ce.volNames.push(""),ce.maxValues.push(xe),ce.minValues.push(ye)):ce={bVolume:!0,strVolumeExts:[we],volNames:[""],maxValues:[xe],minValues:[ye]}}var Ce;I={};(Ce=t.split("?")).length>1&&(I=m$1j(Ce[1]),t=Ce[0]);M=new h$$(i===er.oss?t.substring(0,t.lastIndexOf("/")+1):t.replace(/config$/g,"data/path/")),O=[],D=/\\+/g,R=s$P.queryFirstNode(r,"OSGFiles",n);var Te,Se=!1;if((Te=s$P.queryNodes(R,"Files",n)).length>0)for(B=0,N=Te.length;B<N;B++){F=Te[B];(Re=s$P.queryStringValue(F,"FileName",n)).endsWith(".osgb")&&(Se=!0);k=i$18(Re=(Re=Re.replace(D,"/")).replace(/(\.s3m)|(\.osgb)/gi,"")),V=f$V(Re);(Le={}).relativePath=new h$$(k),Le.name=V;var Ee=s$P.queryFirstNode(F,"BoundingSphere",n);if(e$28(Ee)&&Ee.childNodes.length){var Ae=s$P.queryNumericValue(Ee,"CenterX",n),Pe=s$P.queryNumericValue(Ee,"CenterY",n),Ie=s$P.queryNumericValue(Ee,"CenterZ",n),Me=s$P.queryNumericValue(Ee,"Radius",n),Oe=new t$X(Ae,Pe,Ie);Le.bSphere=new i$19(Oe,Me)}O.push(Le)}else{var De=s$P.queryNodes(R,"FileName",n);for(B=0,N=De.length;B<N;B++){var Re;(Re=De[B].textContent).endsWith(".osgb")&&(Se=!0);var Le;k=i$18(Re=(Re=Re.replace(D,"/")).replace(/(\.s3m)|(\.osgb)/gi,"")),V=f$V(Re);(Le={}).relativePath=new h$$(k),Le.name=V,O.push(Le)}}var Be=void 0,Ne=s$P.queryFirstNode(r,"Levels",n);if(e$28(Ne)){var Fe=s$P.queryNodes(Ne,"Level",n);e$28(Fe)&&Fe.length>0&&(Be=parseInt(Fe[0].textContent))}return{position:{lon:s,lat:l,height:u},fileType:T,maxInstensity:te,minInstensity:ee,maxHeight:m,minHeight:_,maxCategory:g,minCategory:v,processType:P,layerBounds:Q,volumeObj:ce,baseUri:M,rootEntities:O,urlArguments:I,isTextureShare:S,isS3MB:!1,isOSGB:Se,isTransparencyOptimization:E,vertexWeightMode:A,level:Be,idFieldName:ne,attributeExtentName:oe}}function Bi(e,t,i){e.asset,e.version;var r=e.dataType;e.pyramidSplitType,e.lodType;var n,o,a,s,l=e.position.x,u=e.position.y,c=e.position.z,h=e.position.units;if(e$28(e.geoBounds)){var d=e.geoBounds.left,f=e.geoBounds.top,p=e.geoBounds.right,_=e.geoBounds.bottom;d>180||_>180||p>180||f>180?(d>20037508.342789244&&(d-=20037508.342789244*Math.floor(d/20037508.342789244)),p>20037508.342789244&&(p-=20037508.342789244*Math.floor(p/20037508.342789244)),f>10018754.171394622&&(f-=20037508.342789244*Math.floor((f+10018754.171394622)/20037508.342789244)),_>10018754.171394622&&(_-=20037508.342789244*Math.floor((_+10018754.171394622)/20037508.342789244)),V=new h$10(d/=6378137,_/=6378137,p/=6378137,f/=6378137)):V=h$10.fromDegrees(d,_,p,f)}if(e$28(e.heightRange)&&(n=e.heightRange.min,o=e.heightRange.max),e$28(e.wDescript)){var m=e.wDescript.range;a=m.min,s=m.max}else if(e$28(e.vertexAttributeDescript))for(let t=0;t<e.vertexAttributeDescript.length;t++){var $=e.vertexAttributeDescript[t];if("VertexWeight"==$.category){a=$.range.min[0],s=$.range.max[0];break}}var g,v,y,x,b,w,C,T,S,E,A,P,I,M=e.extensions,O=!0,D=-1;if(M.hasOwnProperty("s3m:FileType")&&(g=M["s3m:FileType"]),M.hasOwnProperty("s3m:TileSplitType")&&M["s3m:TileSplitType"],M.hasOwnProperty("s3m:ProcessType")&&(w=M["s3m:ProcessType"]),M.hasOwnProperty("IDFieldName")&&(C=M.IDFieldName),M.hasOwnProperty("textureLOD")&&(O="TRUE"===M.textureLOD),M.hasOwnProperty("s3m:MaterialType")&&(S=M["s3m:MaterialType"]),M.hasOwnProperty("globeType")&&(P=M.globeType),M.hasOwnProperty("temporalCount")&&(D=parseInt(M.temporalCount)),M.hasOwnProperty("levels"))for(var R=0,L=M.levels.length;R<L;R++){I=M.levels[R].level;break}M.hasOwnProperty("sml:Level")&&(I=parseInt(M["sml:Level"])),M.hasOwnProperty("s3m:TextureSharing")&&(v="TRUE"===M["s3m:TextureSharing"]),M.hasOwnProperty("s3m:TransparencyOptimization")&&(y="TRUE"===M["s3m:TransparencyOptimization"]),M.hasOwnProperty("s3m:VertexCompressionType")&&(x=M["s3m:VertexCompressionType"]),M.hasOwnProperty("s3m:VertexWeightMode")&&(b=M["s3m:VertexWeightMode"]),M.hasOwnProperty("s3m:AttributeExtentName")&&(T=M["s3m:AttributeExtentName"]),M.hasOwnProperty("associateMaterialUrl")&&(E=M.associateMaterialUrl),M.hasOwnProperty("hasAttributeIndex")&&(A="TRUE"==M.hasAttributeIndex);var B=[],N=new e$1P;if(M.hasOwnProperty("pointCloudLayers"))for(R=0,L=M.pointCloudLayers.length;R<L;R++){var F=M.pointCloudLayers[R].layerName;if(e$28(F)){var z=M.pointCloudLayers[R].layerBounds;B.push(F),N.set(F,z)}else{var k=M.pointCloudLayers[R].layer,V=new h$10;N.set(k,V),B.push(k)}}var U=void 0,X=e.extensions.vol;if(e$28(X)&&X.length>0)for(var H=[],G=[],W=[],Y=[],q=(R=0,X.length);R<q;R++){var j=X[R],Z=j.volName;H.push(Z);var K=j.volType;Y.push(K);var Q=j.volRangeMin,J=j.volRangeMax;G.push(J),W.push(Q),U={bVolume:!0,strVolumeExts:Y,volNames:H,maxValues:G,minValues:W}}var ee=void 0,te=e.extensions.map;if(e$28(te)&&te.length>0){var ie=[],re=[];for(R=0,q=te.length;R<q;R++){var ne=te[R];Z=ne.mapName;ie.push(Z);K=ne.dataType;re.push(K),ee={mapExts:re,mapNames:ie}}}var oe={},ae=t.split("?");ae.length>1&&(oe=m$1j(ae[1]),t=ae[0]);var se=new h$$(i===er.oss?t.substring(0,t.lastIndexOf("/")+1):t.replace(/config$/g,"data/path/")),le=[],ue=/\\+/g,ce=!1,he=!1,de=!1,fe=e.tiles||e.rootTiles;for(R=0,L=fe.length;R<L;R++)if(e$28(fe[R])){var pe=fe[R].url,_e=pe.lastIndexOf("."),me=pe.substring(_e,pe.length);".s3mbz"===me?ce=!0:".s3mblock"===me?he=!0:".osgb"===me&&(de=!0);var $e=i$18(pe=(pe=pe.replace(ue,"/")).replace(/(\.s3mblock)|(\.s3mbz)|(\.s3mb)|(\.osgb)/gi,"")),ge=f$V(pe),ve={};if(ve.relativePath=new h$$($e),ve.name=ge,e$28(fe[R].boundingbox))if(e$28(fe[R].boundingbox.center))ve.obb=fe[R].boundingbox;else{var ye=fe[R].boundingbox.min.x,xe=fe[R].boundingbox.min.y,be=fe[R].boundingbox.min.z,we=fe[R].boundingbox.max.x,Ce=fe[R].boundingbox.max.y,Te=fe[R].boundingbox.max.z;ve.min=new t$X(ye,xe,be),ve.max=new t$X(we,Ce,Te);var Se=new i$19;i$19.fromCornerPoints(ve.min,ve.max,Se),ve.bSphere=Se}le.push(ve)}return{position:{lon:l,lat:u,height:c,units:h},fileType:g,maxInstensity:0,minInstensity:0,maxHeight:o,minHeight:n,maxCategory:s,minCategory:a,layerBounds:V,volumeObj:U,maps:ee,baseUri:se,rootEntities:le,isTextureShare:v,urlArguments:oe,isS3MB:!0,isS3MZ:ce,isS3MBlock:he,isOSGB:de,dataType:r,isTransparencyOptimization:y,vertexCompressionType:x,vertexWeightMode:b,level:I,pointCloudLayerNames:B,processType:w,groupNameBounds:N,idFieldName:C,attributeExtentName:T,materialType:S,textureLod:O,associateMaterialUrl:E,globeType:P,temporalCount:D,hasAttributeIndex:A}}F$4.prototype.sampleHeight=function(e,t,i){if(o$1u.defined("position",e),this._mode!==P$$.SCENE3D)throw new t$Z("sampleHeight is only supported in 3D mode.");if(!this.sampleHeightSupported)throw new t$Z("sampleHeight requires depth texture support. Check sampleHeightSupported.");var r=kr(this,It$1(this,e),t,i,!0,!1);if(e$28(r))return Mi(this,r.position)},F$4.prototype.clampToHeight=function(e,t,i,r){if(o$1u.defined("cartesian",e),this._mode!==P$$.SCENE3D)throw new t$Z("sampleHeight is only supported in 3D mode.");if(!this.clampToHeightSupported)throw new t$Z("clampToHeight requires depth texture support. Check clampToHeightSupported.");i instanceof t$X&&(r=i,i=void 0,t$T("clampToHeight-parameter-change","clampToHeight now takes an optional width argument before the result argument in Cesium 1.54. The previous function definition will no longer work in 1.56."));var n=kr(this,Ii(this,e),t,i,!0,!1);if(e$28(n))return t$X.clone(n.position,r)},F$4.prototype.sampleHeightMostDetailed=function(e,t,i){if(o$1u.defined("positions",e),this._mode!==P$$.SCENE3D)throw new t$Z("sampleHeightMostDetailed is only supported in 3D mode.");if(!this.sampleHeightSupported)throw new t$Z("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");t=e$28(t)?t.slice():t;for(var r=e.length,n=new Array(r),o=0;o<r;++o)n[o]=Vn(this,e[o],t,i);return o$1q.all(n).then((function(t){for(var i=t.length,r=0;r<i;++r)e[r].height=t[r];return e}))},F$4.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},F$4.prototype.cartesianToCanvasCoordinates=function(e,t){return m$W.wgs84ToWindowCoordinates(this,e,t)},F$4.prototype.completeMorph=function(){this._transitioner.completeMorph()},F$4.prototype.morphTo2D=function(e){var t,i=this.globe;t=e$28(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u$Y(e,2),this._transitioner.morphTo2D(e,t)},F$4.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=e$28(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u$Y(e,2),this._transitioner.morphToColumbusView(e,t)},F$4.prototype.morphTo3D=function(e){var t,i=this.globe;t=e$28(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=u$Y(e,2),this._transitioner.morphTo3D(e,t)},F$4.prototype.getViewport=function(e){if(this._multiViewportMode!==te$6.NONE){var t=Gr(this,m$W.transformWindowToDrawingBuffer(this,e,lt$1));if(t>-1){var i=this._context,r=new f$10,n=this._multiViewportInfo[t];return r.x=i.drawingBufferWidth*n.x,r.y=i.drawingBufferHeight*n.y,r.width=i.drawingBufferWidth*n.width,r.height=i.drawingBufferHeight*n.height,r}}return(r=new f$10).x=0,r.y=0,r.width=this._canvas.clientWidth,r.height=this._canvas.clientHeight,r};var _e={},er={iServer:0,oss:1};function qi(e,t,i,r,n,o,a){a=u$Y(a,!1),o$1q(e,(function(e){if(r.fieldsInfo=e.fieldsInfo,r.indexInfoMap=e.indexInfoMap,r.indexInfoAttributeMap=e.indexInfoAttributeMap,e$28(o.isFlyMode)&&!0===o.isFlyMode&&e$28(bounds))t.camera.flyTo({destination:bounds,complete:function(){setTimeout((function(){var e=new _0x47d916(r);a||t._layers.add(e,n),e$28(t._clipRegions)&&e._setServerClipRegions(t._clipRegions,1),i.resolve(e)}),1e3)}});else{var s=new _0x47d916(r);a||t._layers.add(s,n),e$28(t._clipRegions)&&s._setServerClipRegions(t._clipRegions,1),i.resolve(s)}}),(function(){if(!0===o.isFlyMode)t.camera.flyTo({destination:bounds,complete:function(){var e=new _0x47d916(r);a||t._layers.add(e,n),e$28(t._clipRegions)&&e._setServerClipRegions(t._clipRegions,1),i.resolve(e)}});else{var e=new _0x47d916(r);a||t._layers.add(e,n),e$28(t._clipRegions)&&e._setServerClipRegions(t._clipRegions,1),i.resolve(e)}}))}function Ur(e,t,i,r,n,o,a,s){if(r.useWebsocket){var l=new i$W("websocketTaskProcessor");l.scheduleTask({data:"init",scpUrl:e});var u=e.substring(e.indexOf("datas")+6,e.indexOf("/data/path"))+".scp";l.scheduleTask({dataType:"json",data:"/"+u}).then((function(u){var c=Bi(u,e,r.serverType);c.context=t.context,c.gl=t.context._gl,c.name=n,c.cullMode=r.cullMode,c.supportCompressType=t._supportCompressType,c.urlType=r.urlType,c.cullEnabled=r.cullEnabled,c.horizontalLine=r.horizontalLine,c.style3D=r.style3D,c.selectEnable=r.selectable,c.isVisible=r.isVisible,c.minVisibleAltitude=r.minVisibleAltitude,c.maxVisibleAltitude=r.maxVisibleAltitude,c.minVisibleDistance=r.minVisibleDistance,c.maxVisibleDistance=r.maxVisibleDistance,c.shadowType=r.shadowType,c.heading=r.heading,c.lodRangeScale=r.lodRangeScale,c.polygonOffset=r.polygonOffset,c.brightness=r.brightness,c.constrast=r.constrast,c.hue=r.hue,c.saturation=r.saturation,c.gamma=r.gamma,c.effect=r.effect,c.ignoreNormal=u$Y(r.ignoreNormal,!1),c.groupName=u$Y(r.groupName,""),c.cacheKey=u$Y(r.cacheKey,""),c._isJson=!0,c.sceneMode=t.mode,c.scene=t,c.useMercatorProject=r.useMercatorProject,c.scpUrl=a,c.queryFieldNames=r.queryFieldNames,c.subdomainConfig=r.subdomainConfig,c.customRequestHeaders=r.customRequestHeaders,c.LoadingPriority=r.LoadingPriority;var h=new _0x47d916(c);h._wstTaskProcessor=l,s||t._layers.add(h,o),e$28(t._clipRegions)&&h._setServerClipRegions(t._clipRegions,1),i.resolve(h)}))}else d$17(e,r.customRequestHeaders).then((function(l){var u=Rn(l,e,r.serverType);u.context=t.context,u.gl=t.context._gl,u.name=n,u.supportCompressType=t._supportCompressType,u.urlType=r.urlType,u.cullEnabled=r.cullEnabled,u.cullMode=r.cullMode,u.horizontalLine=r.horizontalLine,u.style3D=r.style3D,u.selectEnable=r.selectable,u.isVisible=r.isVisible,u.minVisibleAltitude=r.minVisibleAltitude,u.maxVisibleAltitude=r.maxVisibleAltitude,u.minVisibleDistance=r.minVisibleDistance,u.maxVisibleDistance=r.maxVisibleDistance,u.shadowType=r.shadowType,u.heading=r.heading,u.lodRangeScale=r.lodRangeScale,u.polygonOffset=r.polygonOffset,u.brightness=r.brightness,u.constrast=r.constrast,u.hue=r.hue,u.saturation=r.saturation,u.gamma=r.gamma,u.effect=r.effect,u.ignoreNormal=u$Y(r.ignoreNormal,!1),u.groupName=u$Y(r.groupName,""),u.cacheKey=u$Y(r.cacheKey,""),u.customRequestHeaders=r.customRequestHeaders,u.sceneMode=t.mode,u.loadVolumeData=u$Y(r.loadVolumeData,!0),u.scene=t,u.useMercatorProject=r.useMercatorProject,u.scpUrl=a,u.queryFieldNames=r.queryFieldNames,u.subdomainConfig=r.subdomainConfig,u.useMercatorProject=r.useMercatorProject;var c=Tn(u.baseUri,r.customRequestHeaders,r.urlType,u.scpUrl);o$1q(Pn(l,u.baseUri,r.customRequestHeaders),(function(e){u.waterEffectSet=e,o$1q(c,(function(e){if(u.fieldsInfo=e,e$28(r.isFlyMode)&&!0===r.isFlyMode&&e$28(bounds))t.camera.flyTo({destination:bounds,complete:function(){setTimeout((function(){var e=new _0x47d916(u);t._layers.add(e,o),i.resolve(e)}),1e3)}});else{var n=new _0x47d916(u);s||t._layers.add(n,o),e$28(t._clipRegions)&&n._setServerClipRegions(t._clipRegions,1),i.resolve(n)}}),(function(){if(!0===r.isFlyMode)t.camera.flyTo({destination:bounds,complete:function(){var e=new _0x47d916(u);t._layers.add(e,o),i.resolve(e)}});else{var e=new _0x47d916(u);s||t._layers.add(e,o),e$28(t._clipRegions)&&e._setServerClipRegions(t._clipRegions,1),i.resolve(e)}}))}),(function(){o$1q(c,(function(e){if(u.fieldsInfo=e,e$28(r.isFlyMode)&&!0===r.isFlyMode&&e$28(bounds))t.camera.flyTo({destination:bounds,complete:function(){setTimeout((function(){var e=new _0x47d916(u);s||t._layers.add(e,o),i.resolve(e)}),1e3)}});else{var n=new _0x47d916(u);s||t._layers.add(n,o),e$28(t._clipRegions)&&n._setServerClipRegions(t._clipRegions,1),i.resolve(n)}}),(function(){if(!0===r.isFlyMode)t.camera.flyTo({destination:bounds,complete:function(){var e=new _0x47d916(u);t._layers.add(e,o),i.resolve(e)}});else{var e=new _0x47d916(u);s||t._layers.add(e,o),e$28(t._clipRegions)&&e._setServerClipRegions(t._clipRegions,1),i.resolve(e)}}))}))}),(function(l){u$O(e,r.customRequestHeaders).then((function(l){var u=Bi(l,e,r.serverType);u.context=t.context,u.gl=t.context._gl,u.name=n,u.cullMode=r.cullMode,u.supportCompressType=t._supportCompressType,u.urlType=r.urlType,u.cullEnabled=r.cullEnabled,u.horizontalLine=r.horizontalLine,u.style3D=r.style3D,u.selectEnable=r.selectable,u.isVisible=r.isVisible,u.minVisibleAltitude=r.minVisibleAltitude,u.maxVisibleAltitude=r.maxVisibleAltitude,u.minVisibleDistance=r.minVisibleDistance,u.maxVisibleDistance=r.maxVisibleDistance,u.shadowType=r.shadowType,u.heading=r.heading,u.lodRangeScale=r.lodRangeScale,u.polygonOffset=r.polygonOffset,u.brightness=r.brightness,u.constrast=r.constrast,u.hue=r.hue,u.saturation=r.saturation,u.gamma=r.gamma,u.effect=r.effect,u.ignoreNormal=u$Y(r.ignoreNormal,!1),u.groupName=u$Y(r.groupName,""),u.cacheKey=u$Y(r.cacheKey,""),u._isJson=!0,u.sceneMode=t.mode,u.scene=t,u.useMercatorProject=r.useMercatorProject,u.scpUrl=a,u.queryFieldNames=r.queryFieldNames,u.subdomainConfig=r.subdomainConfig,u.customRequestHeaders=r.customRequestHeaders,u.useMercatorProject=r.useMercatorProject;var c=Dn(u.baseUri,r.customRequestHeaders,u.attributeExtentName,u.urlType);o$1q(En(l,u.baseUri,r.customRequestHeaders),(function(e){u.waterEffectSet=e,qi(c,t,i,u,o,r,s)}),(function(){qi(c,t,i,u,o,r,s)}))}),(function(e){i.reject("add s3m layer failed,"+e)}))})).otherwise((function(e){i.reject("add s3m layer failed,"+e)}))}function Fn(e,t,i){return u$O(e,i).then((function(i){if(!(i.length<1)){var r=void 0;if(e$28(t)){for(var n=0;n<i.length;n++){var o=i[n];if(o.name===t){r=o;break}}if(!e$28(r))return void console.error("no named scene was found!")}else r=i[0];var a=new h$$(e);return a.path=new h$$(r.path).path,{name:r.name,path:a.toString()}}}))}function Nn(e,t,i){var r=e+"/layers.json";return e$28(a$Y.CREDENTIAL)&&(r=e$28(a$Y.CREDENTIAL._keymap[i])?a$Y.addTokenWithKey(i,r):a$Y.addToken(r)),u$O(r,t).then((function(e){for(var t={s3m:[],imagery:[],s3mGroup:[],terrain:void 0},i=0,r=e.length;i<r;i++){var n=e[i],o=n.layer3DType;"OSGBLayer"==o?t.s3m.push(n):"ImageFileLayer"==o?t.imagery.push(n):"TerrainFileLayer"==o?t.terrain=n:"OSGBGroup"==o&&t.s3mGroup.push(n)}return t}))}F$4.prototype.addS3MTilesLayerByScp=function(e,t,i,r){t=u$Y(t,{});var n=/({.*?})/g;if(e.indexOf("?token")>-1){var o=new h$$(e),a=m$1j(o.query);o.query=void 0,e=o.toString();var s={};if(e$28(t.subdomains))for(let i=0;i<t.subdomains.length;i++){var l=e.replace(/({.*?})/g,t.subdomains[i]);s={rooturl:l,type:"token",value:a.token},e$28(a$Y.CREDENTIAL)?l in a$Y.CREDENTIAL._keymap||a$Y.CREDENTIAL.addCredential([s]):a$Y.CREDENTIAL=new a$Y([s])}else{if(n.test(e))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");s={rooturl:e,type:"token",value:a.token},e$28(a$Y.CREDENTIAL)?e in a$Y.CREDENTIAL._keymap||a$Y.CREDENTIAL.addCredential([s]):a$Y.CREDENTIAL=new a$Y([s])}}if(!e$28(e))throw new t$Z("add s3m tiles layer,url is required.");if(e$28(t.subdomains))e=e.replace(n,(function(e,i){if(!e$28(t.subdomains.length))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");if("{s}"===i)return t.subdomains[0]}));else if(n.test(e))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");t=t||{};var u=o$1q.defer();r=u$Y(r,!1);var c,h,d=e,f=u$Y(t.name,f$V(d)),p=this;if((-1!==e.indexOf("ws://")||-1!==e.indexOf("wss://"))&&(t.useWebsocket=!0),t.useWebsocket)return Ur(d,p,u,t,f,i,_,r),u.promise;(c=-1!==e.indexOf("aliyuncs")||-1!==e.indexOf("oss-cn")?er.oss:er.iServer)===er.iServer&&(h=1===t.urlType?e+"&authentication=login":e.substring(0,e.indexOf("rest/realspace")+14));var _=e;return e$28(a$Y.CREDENTIAL)&&(d=e$28(a$Y.CREDENTIAL._keymap[d])?a$Y.addTokenWithKey(d,d):a$Y.addToken(d)),LicenseChecker.LICENSECHECKER.getLicense(d).then((function(e){LicenseChecker.LICENSECHECKER.check(e)})),c===er.iServer?(t.serverType=er.iServer,e$28(this.RSAAuthenticationStatus[h])?(0===this.RSAAuthenticationStatus[h]&&(e$28(_e[h])||(_e[h]={}),e$28(_e[h][d])||(_e[h][d]={_this:p,deferred:u,options:t,layerName:f,index:i})),1===this.RSAAuthenticationStatus[h]&&Ur(d,p,u,t,f,i,_,r),2===this.RSAAuthenticationStatus[h]&&u.reject("add s3m layer failed,"+d)):(this.RSAAuthenticationStatus[h]=0,Un(h,t.urlType,t.customRequestHeaders,d).then((function(){if(p.RSAAuthenticationStatus[h]=1,Ur(d,p,u,t,f,i,_,r),e$28(_e[h]))for(var e in _e[h]){var n=u$Y(_e[h][e].options.groupName,r);Ur(e,_e[h][e]._this,_e[h][e].deferred,_e[h][e].options,_e[h][e].layerName,_e[h][e].index,void 0,n),delete _e[h][e]}}),(function(e){p.RSAAuthenticationStatus[h]=2,delete _e[h],u.reject("add s3m layer failed,"+e.url)})).otherwise((function(e){p.RSAAuthenticationStatus[h]=2,delete _e[h],u.reject("add s3m layer failed,"&e.url)})))):(t.serverType=er.oss,Ur(d,p,u,t,f,i,_,r)),u.promise},F$4.prototype.addS3MGroupLayer=function(e,t,i){if(!e$28(e))throw new t$Z("add S3MGroup layer,url is required.");t=t||{};var r=e;e$28(a$Y.CREDENTIAL)&&(r=a$Y.addToken(r));var n=u$Y(t.name,f$V(r)),o=this,a=o$1q.defer();return u$O(r).then((function(e){var t={name:n,url:r,layerBounds:e.geobounds,layers:e.layers,scene:o},a=new _0x2564e5(t);o._layers.add(a,i)})).otherwise((function(e){a.reject("add S3MGroup layer failed,"+e)})),a.promise};var kn=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,Ai=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i;function jr(e,t,i){return e$28(i)||(i=o$1q.defer()),d$17(e,t).then((function(r){try{var n=Ln(r);i.resolve(n)}catch{jr(e,t,i)}})).otherwise((function(){jr(e,t,i)})),i.promise}function Ln(e){if(!e$28(e))throw new t$Z("get s3m layer config failed,xml document undefined.");var t,i=e.firstChild,r=i.namespaceURI,n=s$P.queryStringValue(i,"LayerName",r),o=s$P.queryFirstNode(i,"GeoBounds",r);if(e$28(o)){var a=s$P.queryNumericValue(o,"bottom",r),s=s$P.queryNumericValue(o,"left",r),l=s$P.queryNumericValue(o,"top",r),u=s$P.queryNumericValue(o,"right",r);s>180||a>180||u>180||l>180?(s>20037508.342789244&&(s-=20037508.342789244*Math.floor(s/20037508.342789244)),u>20037508.342789244&&(u-=20037508.342789244*Math.floor(u/20037508.342789244)),l>10018754.171394622&&(l-=20037508.342789244*Math.floor((l+10018754.171394622)/20037508.342789244)),a>10018754.171394622&&(a-=20037508.342789244*Math.floor((a+10018754.171394622)/20037508.342789244)),t=new h$10(s/=6378137,a/=6378137,u/=6378137,l/=6378137)):t=h$10.fromDegrees(s,a,u,l)}var c=s$P.queryFirstNode(i,"Options",r),h=s$P.queryStringValue(i,"WithinLayer3DGroup",r),d=s$P.queryBooleanValue(c,"Selectable",r),f=s$P.queryBooleanValue(c,"Visible",r),p=s$P.queryNumericValue(c,"VisibleAltitudeMin",r),_=s$P.queryNumericValue(c,"VisibleAltitudeMax",r);_=0==_?Number.MAX_VALUE:_;var m=s$P.queryNumericValue(c,"VisibleDistanceMin",r),$=s$P.queryNumericValue(c,"VisibleDistanceMax",r),g=s$P.queryStringValue(c,"ShadowType",r),v=0;"SELECTION"==g?v=1:"ALL"==g&&(v=2);var y=!1;"S3MB"==s$P.queryStringValue(i,"CacheFileType",r)&&(y=!0);var x=s$P.queryFirstNode(i,"Style",r);if(!e$28(x)){var b=s$P.queryFirstNode(i,"LayerStyle",r);if(e$28(b)&&!e$28(x=s$P.queryFirstNode(b,"Style",r)))throw new t$Z("get s3m layer config failed,extendxml.xml foamat error,layer name is "+n)}var w=s$P.queryNumericValue(x,"LineWidth",r),C=s$P.queryStringValue(x,"FillForeColor",r),T=kn.exec(C),S=new e$1S;if(null!==T){var E=parseFloat(T[1]);E=189==E?255:E;var A=parseFloat(T[2]);A=235==A?255:A,S.red=e$27.clamp(E/255,0,1),S.green=e$27.clamp(A/255,0,1),S.blue=e$27.clamp(parseFloat(T[3])%256/255,0,1),S.alpha=e$27.clamp(parseFloat(T[3])%65536/256/255,0,1)}var P=s$P.queryFirstNode(x,"Style3D",r),I=new e$E;if(e$28(P)){var M=s$P.queryStringValue(P,"Fill3DMode",r),O=yt$3.Fill;"FILL_LINE"==M?O=yt$3.WireFrame:"FILL_FACEANDLINE"==M&&(O=yt$3.Fill_And_WireFrame);var D=s$P.queryNumericValue(P,"PointSize",r),R=s$P.queryStringValue(P,"LineColor",r),L=(T=Ai.exec(R),new e$1S);null!==T&&(L.red=e$27.clamp(parseFloat(T[1]),0,1),L.green=e$27.clamp(parseFloat(T[2]),0,1),L.blue=e$27.clamp(parseFloat(T[3]),0,1),L.alpha=e$27.clamp(parseFloat(T[4]),0,1));var B=s$P.queryNumericValue(x,"MarkerSize",r)||0;B*=2,D=Math.max(D,B);var N=s$P.queryStringValue(P,"ColorPoint",r);T=Ai.exec(N);var F=new e$1S;null!==T&&(F.red=e$27.clamp(parseFloat(T[1]),0,1),F.green=e$27.clamp(parseFloat(T[2]),0,1),F.blue=e$27.clamp(parseFloat(T[3]),0,1),F.alpha=e$27.clamp(parseFloat(T[4]),0,1));var z=s$P.queryNumericValue(P,"BottomAltitude",r);s$P.queryStringValue(P,"AltitudeMode",r);var k=s$P.queryStringValue(P,"BillboardMode",r),V=s$P.queryBooleanValue(P,"FixedPixelSize",r);k="AUTO_Z_AXIAL"==k?$r$4.FixedZ:"FIXED_ANGLE"==k?$r$4.FixedXYZ:"FIXED_ROTATE_ANGLE"==k?$r$4.FIXED_ROTATE_ANGLE:$r$4.None;var U=e$27.toRadians(s$P.queryNumericValue(P,"RotateX",r)),X=e$27.toRadians(s$P.queryNumericValue(P,"RotateY",r)),H=e$27.toRadians(s$P.queryNumericValue(P,"RotateZ",r));new i$10(U,X,H),I.fillForeColor=S,I.bottomAltitude=z,I.lineWidth=w,I.lineColor=L,I.pointSize=D,I.pointColor=F,I.fillStyle=O,I.billboardMode=k,I.fixedPixelSize=V}var G=void 0,W=s$P.queryFirstNode(i,"Effect",r);if(e$28(W)){var Y=s$P.queryStringValue(W,"EffectType",r);if("Region"===Y){G=new _0x31641;var q=s$P.queryNumericValue(W,"Type",r);G.setValue("RegionType",q);var j=s$P.queryNumericValue(W,"ForeColor",r),Z=e$1S.fromRgba(j);G.setValue("ForeColor",Z);var K=s$P.queryNumericValue(W,"BackColor",r),Q=e$1S.fromRgba(K);G.setValue("BackColor",Q);var J=s$P.queryNumericValue(W,"WidthX",r);G.setValue("WidthX",J);var ee=s$P.queryNumericValue(W,"WidthY",r);G.setValue("WidthY",ee);var te=s$P.queryNumericValue(W,"OffsetX",r);G.setValue("OffsetX",te);var ie=s$P.queryNumericValue(W,"OffsetY",r);G.setValue("OffsetY",ie);var re=s$P.queryNumericValue(W,"RepeatX",r);G.setValue("RepeatX",re);var ne=s$P.queryNumericValue(W,"RepeatY",r);G.setValue("RepeatY",ne);var oe=s$P.queryNumericValue(W,"RotationAngle",r);G.setValue("RotationAngle",oe)}else if("Polyline"===Y){G=new _0x300acb;q=s$P.queryNumericValue(W,"Type",r);G.setValue("PolylineType",q);var ae=s$P.queryNumericValue(W,"Color",r),se=e$1S.fromRgba(ae);G.setValue("Color",se);var le=s$P.queryNumericValue(W,"Width",r);G.setValue("Width",le);var ue=s$P.queryBooleanValue(W,"IsArrow",r);G.setValue("IsArrow",ue);var ce=s$P.queryNumericValue(W,"GapColor",r),he=e$1S.fromRgba(ce);G.setValue("GapColor",he);var de=s$P.queryNumericValue(W,"DashLength",r);G.setValue("DashLength",de);var fe=s$P.queryNumericValue(W,"DashPattern",r);G.setValue("DashPattern",fe);var pe=s$P.queryBooleanValue(W,"IsMove",r);G.setValue("IsMove",pe);var _e=s$P.queryNumericValue(W,"GlowPower",r);G.setValue("GlowPower",_e);var me=s$P.queryNumericValue(W,"OutlineColor",r),$e=e$1S.fromRgba(me);G.setValue("OutlineColor",$e);var ge=s$P.queryNumericValue(W,"OutlineWidth",r);G.setValue("OutlineWidth",ge)}}var ve=s$P.queryNumericValue(i,"LODRangeScale",r),ye=s$P.queryFirstNode(i,"PolygonOffset",r),xe=s$P.queryNumericValue(ye,"Constant",r),be=s$P.queryNumericValue(ye,"SlopeScale",r),we=0!==xe&&0!==be,Ce=s$P.queryFirstNode(i,"ColorParams",r);return{name:n,groupName:h,layerBounds:t,isS3MB:y,style3D:I,selectEnable:d,isVisible:f,minVisibleAltitude:p,maxVisibleAltitude:_,minVisibleDistance:m,maxVisibleDistance:$,shadowType:v,heading:H,lodRangeScale:ve,polygonOffset:{enabled:we,units:xe,factor:be},brightness:s$P.queryNumericValue(Ce,"Brightness",r),constrast:s$P.queryNumericValue(Ce,"Constrast",r),hue:s$P.queryNumericValue(Ce,"Hue",r),saturation:s$P.queryNumericValue(Ce,"Saturation",r),gamma:s$P.queryNumericValue(Ce,"Gamma",r),effect:G,cullMode:s$P.queryStringValue(i,"RenderCullMode",r)}}function In(e,t){return u$O(e,t).then((function(e){return e}))}F$4.prototype.open=function(e,t,i){i=u$Y(i,{});var r=/({.*?})/g;if(e.indexOf("?token")>-1&&e.indexOf("realspace")>-1){var n=new h$$(e),o=m$1j(n.query);n.query=void 0,e=n.toString();var a={};if(e$28(i.subdomains))for(let t=0;t<i.subdomains.length;t++){var s=e.replace(/({.*?})/g,i.subdomains[t]);a={rooturl:s,type:"token",value:o.token},e$28(a$Y.CREDENTIAL)?s in a$Y.CREDENTIAL._keymap||a$Y.CREDENTIAL.addCredential([a]):a$Y.CREDENTIAL=new a$Y([a])}else{if(r.test(e))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");a={rooturl:e,type:"token",value:o.token},e$28(a$Y.CREDENTIAL)?e in a$Y.CREDENTIAL._keymap||a$Y.CREDENTIAL.addCredential([a]):a$Y.CREDENTIAL=new a$Y([a])}}if("realspace"!=e.slice(-9))throw new t$Z("open scene url error!");i=u$Y(i,{}),this.customRequestHeaders=u$Y(this.customRequestHeaders,i.customRequestHeaders);var l=u$Y(i.useMercatorProject,!1),u=u$Y(i.autoSetView,!0),c=e,h=i.subdomains;if(e$28(h))e=e.replace(r,(function(e,t){if(!e$28(h.length))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");if("{s}"===t)return h[0]}));else if(r.test(e))throw new t$Z("detected subdomain url scheme, but no subdomain provided.");var d=e+"/scenes.json";e$28(a$Y.CREDENTIAL)&&(d=e$28(a$Y.CREDENTIAL._keymap[e])?a$Y.addTokenWithKey(e,d):a$Y.addToken(d));var f=this,p=this.camera,_=o$1q.defer();return Fn(d,t,f._customRequestHeaders).then((function(t){if(e$28(t)){var r=t.path.indexOf("?");-1!==r&&(t.path=t.path.substring(0,r));var n=t.path+".json";e$28(a$Y.CREDENTIAL)&&(n=e$28(a$Y.CREDENTIAL._keymap[e])?a$Y.addTokenWithKey(e,n):a$Y.addToken(n)),In(n,f._customRequestHeaders).then((function(e){try{var t;if(e$28(e.clipRegions)){for(var i=[],r=0;r<e.clipRegions.length;r++){for(var n=[],o=0;o<e.clipRegions[r].points.length;o++)n.push(e.clipRegions[r].points[o].x),n.push(e.clipRegions[r].points[o].y),n.push(e.clipRegions[r].points[o].z||0);i.push(n)}f._clipRegions=i}if("NONEARTHFLAT"===e.sceneType){if(f.mode=P$$.COLUMBUS_VIEW,e.camera.tilt-=Math.PI/2,t=new t$X(e.camera.longitude,e.camera.latitude,e.camera.altitude),l){var a=(new t$M).unproject(t);t=f.camera._projection.project(a)}var s=t.x,c=t.y;s>20037508.342789244&&(s-=20037508.342789244*Math.floor(s/20037508.342789244)),c>10018754.171394622&&(c-=20037508.342789244*Math.floor((c+10018754.171394622)/20037508.342789244)),t.x=s,t.y=c,u&&p.setView({destination:t,orientation:{heading:e.camera.heading,pitch:e.camera.tilt,roll:0},convert:!1})}else e.camera.tilt-=90,t=t$X.fromDegrees(e.camera.longitude,e.camera.latitude,e.camera.altitude),u&&p.setView({destination:t,orientation:{heading:e$27.toRadians(e.camera.heading),pitch:e$27.toRadians(e.camera.tilt),roll:0},convert:!1})}catch(e){_.reject("camera set view failed,"+e)}})).otherwise((function(e){_.reject("get scene config failed,"+e)})),Nn(t.path,f._customRequestHeaders,e).then((function(r){for(var n=r.s3m,o=r.imagery,a=r.terrain,s=r.s3mGroup,u=t.path+"/layers/",d=[],p=n.length-1,m=p;m>=0;m--){var $=n[m],g=u+encodeURIComponent($.name)+"/extendxml.xml";e$28(a$Y.CREDENTIAL)&&(g=e$28(a$Y.CREDENTIAL._keymap[e])?a$Y.addTokenWithKey(e,g):a$Y.addToken(g)),function(t){t=f.layers._s3mLayerAddedIndex;var i=jr(g,f._customRequestHeaders).then((function(i){try{var r=e+"/datas/"+encodeURIComponent(i.name)+"/config";if(i.customRequestHeaders=f._customRequestHeaders,i.useMercatorProject=l,i.subdomainConfig={subdomains:h,urlScheme:c},!e$28(i.groupName)||""===i.groupName)return f.addS3MTilesLayerByScp(r,i,t);var n=f.layers.find(i.groupName),o=!n;if(!n){var a={scene:f,name:i.groupName};n=new _0x2564e5(a),f.layers.add(n)}if(i.index=t,i.ready=!1,n._layerConfigs.set(r,i),n._s3mURLs[t]=r,o)return n}catch(e){_.reject("add S3M layer"+i.name+" failed,"+e)}})).otherwise((function(e){_.reject("get S3M layer config failed,"+e+",layer name is "+$.name)}));f.layers._s3mLayerAddedIndex++,e$28(i)&&d.push(i)}(p-m)}for(m=s.length-1;m>=0;m--){$=s[m],g=u+encodeURIComponent($.name)+"/extendxml.xml";e$28(a$Y.CREDENTIAL)&&(g=e$28(a$Y.CREDENTIAL._keymap[e])?a$Y.addTokenWithKey(e,g):a$Y.addToken(g)),function(t){var i=jr(g,f._customRequestHeaders).then((function(i){try{var r=e+"/datas/"+encodeURIComponent(i.name)+"/config";return f.addS3MGroupLayer(r,i,t)}catch(e){_.reject("add S3MGroup layer"+i.name+" failed,"+e)}})).otherwise((function(e){_.reject("get S3MGroup layer config failed,"+e+",layer name is "+$.name)}));d.push(i)}(s.length-1-m)}for(m=o.length-1;m>=0;m--){var v=c+"/datas/"+encodeURIComponent(o[m].name),y=new H$6({url:v,subdomains:h,customRequestHeaders:f._customRequestHeaders});try{var x=f.imageryLayers.addImageryProvider(y);o[m].maxVisibleAltitude>0&&(x.maxHeight=o[m].maxVisibleAltitude,x.minHeight=o[m].minVisibleAltitude),d.push(x)}catch(e){_.reject("add imagery layer "+o[m].name+" failed,"+e)}}if(e$28(a)){var b=c+"/datas/"+encodeURIComponent(a.name);try{f.terrainProvider=new se$x({url:b,isSct:!0,subdomains:h,customRequestHeaders:f._customRequestHeaders,invisibility:u$Y(i.invisibility,!1)}),d.push(f.terrainProvider)}catch(e){_.reject("add terrain layer "+a.name+" failed,"+e)}}o$1q.all(d,(function(e){for(var t=[],i=0;i<e.length;i++)e$28(e[i])&&t.push(e[i]);_.resolve(t)}),(function(e){_.reject("add all layers failed,"+e)}))})).otherwise((function(e){_.reject("get layer list failed,"+e)}))}else _.reject("scene list response null!")})).otherwise((function(e){_.reject("get scene list failed,"+e)})),_.promise},F$4.prototype.addVectorTilesLayer=function(e){return e.renderer="canvas",this.addVectorTilesMap(e)},F$4.prototype.getVectorTilesLayer=function(e){return this.getVectorTilesMap(e)},F$4.prototype.removeVectorTilesLayer=function(e){return this.removeVectorTilesMap(e)},F$4.prototype.addVectorTilesMap=function(e){if(!e$28(e.url))throw new t$Z("url is required!");var t=e.name||e$1K(),i=this._vectorTileSource.get(t);if(e$28(i))return this._vectorTileMaps.find(e.name);i=new M$X(this._context,e),this._vectorTileSource.set(t,i);var r=this.imageryLayers.addVectorTileProvider(i);i.innerLayer=r,e$28(this._frameState.mvtLayerCount)?this._frameState.mvtLayerCount++:this._frameState.mvtLayerCount=1;var n=new i$o({provider:i,layer:i.innerLayer,imagelayerCollection:this.imageryLayers,scene:this,viewer:e.viewer,name:e.name||e$1K(),layerConfig:e.layerConfig,swipeEnabled:u$Y(e.swipeEnabled,!1),swipeRegion:u$Y(e.swipeRegion,new f$10(0,0,1,1)),enableMorphing:e.enableMorphing,realtime:e.realtime,billboardMode:e.billboardMode,customRequestHeaders:e.customRequestHeaders,labelDepthTestEnabled:e.labelDepthTestEnabled,lineAntialiasing:e.lineAntialiasing});return e.isTdt&&(i._ready=!0,n._isTdt=!0),i.innerLayer.kmlLayer=n.kmlLayer,i._owner=n,this._vectorTileMaps.add(n),n},F$4.prototype.getVectorTilesMap=function(e){if(!e$28(e))throw new t$Z("name is required!");return this._vectorTileMaps.find(e)},F$4.prototype.removeVectorTilesMap=function(e){var t=this._vectorTileMaps.find(e);return!!e$28(t)&&(this._removeCoverImageryLayer(t),this._vectorTileMaps.remove(e),this._vectorTileSource.remove(e),!0)},F$4.prototype._removeCoverImageryLayer=function(e){for(var t=0;t<this._layers.layerQueue.length;t++){var i=this._layers.layerQueue[t];i._imageryLayer===e&&i._removeCoverImageryLayer()}},F$4.prototype.addLayerService=function(e,t,i){if(!e$28(e)||!e$28(t)||!e$28(i))throw new t$Z("url and sceneName and layerName is required!");if("realspace"!=e.slice(-9))throw new t$Z("open scene url error!");var r=this,n=e+"/scenes/"+encodeURIComponent(t)+"/layers/"+encodeURIComponent(i)+"/extendxml.xml";e$28(a$Y.CREDENTIAL)&&(n=a$Y.addToken(n));var o=o$1q.defer();return jr(n,r._customRequestHeaders).then((function(t){try{var i=e+"/datas/"+encodeURIComponent(t.name)+"/config";t.customRequestHeaders=r._customRequestHeaders;var n=r.addS3MTilesLayerByScp(i,t);o.resolve(n)}catch(e){o.reject("add S3M layer"+t.name+" failed,"+e)}})).otherwise((function(e){o.reject("get S3M layer config failed,"+e+",layer name is "+i)})),o.promise},F$4.prototype.addS3MInstanceCollection=function(e,t){var i=new S3MInstanceCollection({url:e,instanceAttrs:t,gl:this._context._gl,context:this._context});return this.primitives.add(i),i};var Mn=new t$X;function On(e){var t=e._context;t.uniformState;var i=e._frameState,r=i.camera,n=r.positionWC,o=i.cullingVolume,a=i.mode===P$$.SCENE3D?i.occluder:void 0;e$28(e._reflectFramebuffer)||(e._reflectFramebuffer=t.createReflectFramebuffer(),i._framebufferList.water=e._reflectFramebuffer);var s=6378137,l=0;e._reflectFramebuffer.isUpdate=!1;for(var u=0;u<e.layers._layerQueue.length;u++){var c=e.layers._layerQueue[u];if(e$28(c._waterPlanes)){var h=c._waterPlanes;for(var d in h._hash){var f=h.get(d);if(!(o.computeVisibility(f.boundingVolume)==pt$a.OUTSIDE||e$28(a)&&f.boundingVolume.isOccluded(a)))(_=(_=e$28(f.boundingVolume.radius)?t$X.distance(f.boundingVolume.center,n)-f.boundingVolume.radius:Math.sqrt(x$13.distanceSquaredTo(f.boundingVolume,n)))<.01?.01:_)<s&&(s=_,l=f.distance),e._reflectFramebuffer.isUpdate=!0}}}var p=e._analyst3D.layerQueue.length;for(u=0;u<p;u++){if(-1!=e._analyst3D.layerQueue[u]._name.search("floodAnalysis3D")){var _,m=e._analyst3D.layerQueue[u];(_=(_=t$X.distance(m._boundingSphere.center,n)-m._boundingSphere.radius)<.01?.01:_)<s&&(s=_,l=m._waterHeight),e._reflectFramebuffer.isUpdate=!0}}if(!e._reflectFramebuffer.isUpdate||s>5e4)e._reflectFramebuffer.isUpdate=!1;else{if(e.mode==P$$.SCENE3D){l+=t$X.magnitude(r.positionWC)-r.positionCartographic.height,e._reflectFramebuffer._reflectPlane.normal=t$X.normalize(n,Mn);var $=new t$X;e._reflectFramebuffer._reflectPlane.normal.clone($),t$X.multiplyByScalar($,l,$),e._reflectFramebuffer._reflectPlane.distance=-t$X.dot($,e._reflectFramebuffer._reflectPlane.normal)}else e._reflectFramebuffer._reflectPlane.normal=t$X.UNIT_X,e._reflectFramebuffer._reflectPlane.distance=-l;e._reflectFramebuffer.isUpdate=!0}}function Bn(e){var t=e._context;t.uniformState;var i=e._frameState;t.numNormalAndDepthObject>0?(e$28(e._normalFramebuffer)||(e._normalFramebuffer=t.createNormalFramebuffer(),i._framebufferList.normalAndDepth=e._normalFramebuffer),e._normalFramebuffer.isUpdate=!0):e$28(e._normalFramebuffer)&&(e._normalFramebuffer.isUpdate=!1)}function qn(e){var t=e._context;t.uniformState;var i=e._frameState;t.numPostEffectFilterObject>0?(e$28(e._postEffectFilterFramebuffer)||(e._postEffectFilterFramebuffer=t.createPostEffectFilterlFramebuffer(),i._framebufferList.postEffectFilter=e._postEffectFilterFramebuffer),e._postEffectFilterFramebuffer.isUpdate=!0):e$28(e._postEffectFilterFramebuffer)&&(e._postEffectFilterFramebuffer.isUpdate=!1)}function An(e){var t=e._context;t.uniformState;var i=e._frameState;t.numClampClipPlaneLayer>0?(e$28(e._clampFramebuffer)||(e._clampFramebuffer=t.createClampFramebuffer(),i._framebufferList.clampTexture=e._clampFramebuffer),e._clampFramebuffer.isUpdate=!0):e$28(e._clampFramebuffer)&&(e._clampFramebuffer.isUpdate=!1)}function Wi(e){var t=e._context;t.uniformState;var i=e._frameState;e._isUpdatePickCommand?(e$28(e._pickRectFramebuffer)||(e._pickRectFramebuffer=t.createPickRectFramebuffer(),i._framebufferList.pickRectTexture=e._pickRectFramebuffer,e._pickRectFramebuffer.beginFunc=function(){this._renderTexture._passState.scissorTest={enabled:!0,rectangle:{x:e._pickRect.x,y:e._pickRect.y,width:e._pickRect.z-e._pickRect.x||1,height:e._pickRect.w-e._pickRect.y||1}}}),e._pickRectFramebuffer.isUpdate=!0,e._isUpdatePickCommand=!1):e$28(e._pickRectFramebuffer)&&(e._pickRectFramebuffer.isUpdate=!1)}function Hi(e){if(e$28(e._pickRectFramebuffer)&&e._pickRectFramebuffer.isUpdate){for(var t=e._context,i=e._pickRectFramebuffer.renderTexture._width,r=e._pickRectFramebuffer.renderTexture._height,n=t.readPixels({framebuffer:e._pickRectFramebuffer.renderTexture._fb,x:e._pickRect.x,y:e._pickRect.y,width:e._pickRect.z-e._pickRect.x||1,height:e._pickRect.w-e._pickRect.y||1}),o=[],a=[],s=[],l=e._layers.layerQueue,u=0;u<l.length;u++){s[$=Gi(_=l[u].id)]=u,o.push($),a[$]=[]}n.length;for(var c=0;c<i;c++)for(var h=0;h<r;h++){var d=4*(h*i+c);if(0!==n[d]||0!==n[d+1]||0!==n[d+2]){var f=e$1S.byteToRgba(n[d],n[d+1],n[d+2],n[d+3]),p=t.getObjectByPickId(f);if(e$28(p)){var _=p.primitive.id,m=p.id,$=Gi(_),g=o.indexOf($);if(g>=0){var v=l[s[$]];if(0==a[$].length)(b=[]).push(m),a[$]=b;else(g=a[$].indexOf(m))<0&&a[$].push(m)}}}}for(var y=Object.keys(a),x=0;x<y.length;x++){var b;v=l[u=s[y[x]]];(b=a[y[x]]).length>0&&v.setSelection(b)}}}function Gi(e){return"id_"+e}function Wn(e,t,i){var r=e._context,n=t.viewport;n.x=0,n.y=0,n.width=r.drawingBufferWidth,n.height=r.drawingBufferHeight,e._frameState;var o=i,a=e._clearColorCommand;e$1S.clone(o,a.color),a.execute(r,t),Xe(!0,e,t)}function Hn(e,t,i){var r=e._context,n=e._frameState,o=t.begin(n),a=e._environmentVisible;e._environmentVisible=t.environmentVisible;var s=n.useType,l=n._isDepth;if(n.useType=t.useType,n._isDepth=!1,e._multiViewportMode!==te$6.NONE)for(var u=0;u<4;u++)if(1<<u&t._visibleViewport){n.multiViewportIndex=u;break}Wn(e,o,u$Y(e.backgroundColor,e$1S.BLACK)),n.multiViewportIndex=-1,t.update(o,e._pickDepths),e._environmentState,n.commandList.length=0,r.endFrame(),t.end(n),n._isDepth=l,n.useType=s,e._environmentVisible=a}function Ui(e){var t=e._context,i=t.uniformState,r=e._frameState,n=r.camera,o=r._framebufferList;r.passes.fbo=!0;var a=e.enableCompositor;for(var s in e.enableCompositor=!0,o){var l=o[s];if(e$28(l)&&l.isUpdate&&(!l.isDestroyed||!l.isDestroyed())){var u=r.useType,c=r._isDepth,h=r._fboState.name,d=r._fboState.enabled,f=r._fboState.frameBufferType,p=e._sunCamera.direction;if(r._fboState.name=s,r._fboState.enabled=!0,r._fboState.frameBufferType=l.frameBufferType,l.frameBufferType===L$T.POSTEFFECT_FILTER)Hn(e,l);else{var _=n.frustum.near;l.frameBufferType===L$T.REFLECT&&(n.frustum.near=1);var m=l.begin(r),$=e._environmentVisible;e._environmentVisible=l.environmentVisible,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.update(r);var g=e.shadowMap;e$28(g)&&g.enabled&&t$X.negate(i.sunDirectionWC,e._sunCamera.direction);var v=r.shadowState.nearPlane,y=r.shadowState.farPlane,x=r.shadowState.closestObjectSize;if(r.useType=l.useType,r._isDepth=(6&l.useType)>0||1&l.useType&&l.isManualDepth,e._multiViewportMode!==te$6.NONE)for(var b=0;b<4;b++)if(1<<b&l._visibleViewport){r.multiViewportIndex=b;break}De$2(e),Ue$1(e,m,u$Y(e.backgroundColor,e$1S.BLACK),!0),r.multiViewportIndex=-1;var w=e._environmentState;if(t.msaaLevel>1&&w.useGlobeDepthFramebuffer){var C=e._view.globeDepth;C.copyFromRenderbufferToTexture(t,!1,!0,!1),l.update(t,m,C.framebufferWithTexture)}else l.update(t,m,m.framebuffer);r._fboState.frameBufferType!==L$T.CLAMP&&Me$2(e,m),r.commandList.length=0,t.endFrame(),bi(e),l.end(r),e$28(g)&&g.enabled&&-1!==r._fboState.name.indexOf("ShadowQueryPoints")&&(e._sunCamera.direction=p),"water"==r._fboState.name&&(n.frustum.near=_),e._environmentVisible=$,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.update(r),e$28(g)&&g.enabled&&t$X.negate(i.sunDirectionWC,e._sunCamera.direction),r.shadowState.nearPlane=v,r.shadowState.farPlane=y,r.shadowState.closestObjectSize=x}r._fboState.name=h,r._fboState.enabled=d,r._fboState.frameBufferType=f,r._isDepth=c,r.useType=u}}r.passes.fbo=!1,e.enableCompositor=a}function ji(e,t){var i=e._context,r=i.uniformState,n=e._frameState,o=n.camera,a=e.shadowMap.enabled,s=n.shadowState.shadowsEnabled;n.passes.fbo=!0,e.shadowMap.enabled=!1,n.shadowState.shadowsEnabled=!1;var l=n.useType,u=n._isDepth,c=n._fboState.name,h=n._fboState.enabled,d=n._fboState.frameBufferType;n._fboState.enabled=!0,n._fboState.frameBufferType=t.frameBufferType;var f=t.begin(n),p=e._environmentVisible;e._environmentVisible=t.environmentVisible,n.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),r.update(n),n.useType=t.useType,n._isDepth=(6&t.useType)>0||1&t.useType&&t.isManualDepth,De$2(e),Ue$1(e,f,u$Y(e.backgroundColor,e$1S.BLACK),!0);var _=e._environmentState;if(i.msaaLevel>1&&_.useGlobeDepthFramebuffer){var m=e._view.globeDepth;m.copyFromRenderbufferToTexture(i,!1,!0,!1),t.update(i,f,m.framebufferWithTexture)}else t.update(i,f,f.framebuffer);Me$2(e,f),n.commandList.length=0,i.endFrame(),t.end(n),e._environmentVisible=p,n.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),r.update(n),n._fboState.name=c,n._fboState.enabled=h,n._fboState.frameBufferType=d,n._isDepth=u,n.useType=l,n.passes.fbo=!1,e.shadowMap.enabled=a,n.shadowState.shadowsEnabled=s}function Gn(e){var t=e._context.uniformState;if(!e.enableOutline||e.camera._positionCartographic.height>2e3)return t.nonSelDepthTexture=void 0,void(t.maskTexture=void 0);var i=e.nonSelDepthbuffer;e$28(i)||((i=e.nonSelDepthbuffer=new s$h(e.context)).environmentVisible.isObjectVisible=!0,i.environmentVisible.isGlobalVisible=!0,i.isUpdate=!0,i._beginFunc=function(t){t.passes.pick=!0,t.passes.depth=!0,e.layers.getSelectedLayer().selectedColor.alpha=0},i._endFunc=function(t){t.passes.pick=!1,t.passes.depth=!1,e.layers.getSelectedLayer().selectedColor.alpha=1}),ji(e,i),t.nonSelDepthTexture=i.depthTexture;var r=e.selMaskBuffer;e$28(r)||((r=e.selMaskBuffer=new t$g(e.context))._useHeight=!1,r.environmentVisible.isObjectVisible=!0,r.environmentVisible.isOnlyS3MObjectVisible=!0,r.environmentVisible.isGlobalVisible=!1,r.isUpdate=!0),e._maskEnabled=!0;var n=e.backgroundColor;e.backgroundColor=e$1S.clone(e$1S.WHITE),ji(e,r),e.backgroundColor=n,e._maskEnabled=!1,t.maskTexture=r.renderTexture._fb.getColorTexture(0)}function Un(e,t,i,r){var n,o,a=o$1q.defer();return 1===t?(n=e,o=e):(n=e+"/login.json",o=e+"/login.json"),e$28(a$Y.CREDENTIAL)&&(r=r.substring(0,r.indexOf("?")),e$28(a$Y.CREDENTIAL._keymap[r])?(n=a$Y.addTokenWithKey(r,n),o=a$Y.addTokenWithKey(r,o)):(n=a$Y.addToken(n),o=a$Y.addToken(o))),u$O(n,i).then((function(t){var r=Number(t.jsessionID),n=jn(Number(t.random),397245148883021,0x8f461e7bf61d5),s={jsessionID:r.toString(),random:n.toString()},l=new XMLHttpRequest;if(u$V.contains(e)&&(l.withCredentials=!0),l.open("POST",o,!0),l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status||201===l.status){var e={};try{e=JSON.parse(l.response)}catch{-1!==(l.response||l.responseText).toString().indexOf("isSucceed : true")&&(e.succeed=!0)}!0===e.succeed?a.resolve(!0):a.reject(!1)}else a.reject(!1)},e$28(i))for(var u in i)i.hasOwnProperty(u)&&l.setRequestHeader(u,i[u]);l.send(JSON.stringify(s))}),(function(e){a.reject({status:!1,url:r})})).otherwise((function(){a.reject({status:!1,url:r})})),a.promise}function jn(e,t,i){for(var r=new Ar(e),n=new Ar(t),o=new Ar(1),a=new Ar(2),s=new Ar(1);n.toNumber()>0;)0===n.mod(a).toNumber()?(n=n.dividedBy(a),r=r.multipliedBy(r).mod(i)):(n=n.minus(s),o=o.multipliedBy(r).mod(i));return o.toNumber()}function zn(e,t,i){if(!(i.passes.fbo||i.passes.depth||i.passes.fbo.pick))for(var r=e._analyst3D.layerQueue,n=0,o=r.length;n<o;n++){var a=r[n];a instanceof n$a&&a._updateTextures(t,i)}}
- /**
- * @license
- * Copyright (c) 2000-2005, Sean O'Neil
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the project nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Modifications made by Analytical Graphics, Inc.
- */F$4.prototype.addFieldLayer=function(e){if(!e$28(e))throw new t$Z("url is required!");var t=this;if(e.indexOf(".nc")>-1){var i=o$1q.defer();return o$1q(o$$(e),(function(e){var r=new k$5(e),n=new i$d(t._context);n._NetCDFBuffer=r,n.NetCDFInfo=r.header,t._layers.add(n),i.resolve(n)})).otherwise((function(e){throw i.reject(e.message),new t$Z("Not a valid NetCDF file!")})),i.promise}},F$4.prototype.addVoxelGridLayer=function(e,t){if(!e$28(e))throw new t$Z("url is required!");var i=this,r=o$1q.defer();return e.indexOf(".nc")>-1?(o$1q(o$$(e),(function(e){var n=new k$5.NetCDFReader(e),o=new g$9(i._context);o.setIsMultiResolution(!1),o._NetCDFBuffer=n,o._NetCDFInfo=n.header,o._name=t,i._layers.add(o),r.resolve(o)})).otherwise((function(e){throw new t$Z("Not a valid NetCDF file!")})),r.promise):(o$1q(u$P(e),(function(t){for(var n=(t=(new DOMParser).parseFromString(t,"application/xml")).childNodes[0],o=u$Y(s$P.queryStringAttribute(n,"xmlns:sml"),"http://www.supermap.com/SuperMapCache/scvo"),a=s$P.queryNumericValue(n,"Version",o),s=s$P.queryStringValue(n,"CacheName",o),l=(s$P.queryStringValue(n,"StoreType",o),s$P.queryStringValue(n,"FileExtentName",o),s$P.queryStringValue(n,"Type",o),s$P.queryStringValue(n,"VolumeType",o),s$P.queryNumericValue(n,"Width",o)),u=s$P.queryNumericValue(n,"Height",o),c=s$P.queryNumericValue(n,"Depth",o),h=s$P.queryNumericValue(n,"Time",o),d=s$P.queryNumericValue(n,"CellWidth",o),f=s$P.queryNumericValue(n,"CellHeight",o),p=s$P.queryNumericValue(n,"CellDepth",o),_=s$P.queryNumericValue(n,"CellTime",o),m=s$P.queryFirstNode(n,"Bounds",o),$=s$P.queryNumericValue(m,"Left",o),g=s$P.queryNumericValue(m,"Right",o),v=s$P.queryNumericValue(m,"Top",o),y=s$P.queryNumericValue(m,"Bottom",o),x=s$P.queryNumericValue(n,"MaxAltitude",o),b=s$P.queryNumericValue(n,"MinAltitude",o),w=s$P.queryNumericValue(n,"MaxValue",o),C=s$P.queryNumericValue(n,"MinValue",o),T=s$P.queryNumericValue(n,"Levels",o),S=s$P.queryFirstNode(n,"Available",o),E=s$P.queryNodes(S,"TilesBounds",o),A=[],P=0,I=E.length;P<I;P++){var M=s$P.queryNumericAttribute(E[P],"level",o),O=s$P.queryNodes(E[P],"TileBounds",o),D=s$P.queryNumericValue(O[0],"StartCol",o),R=s$P.queryNumericValue(O[0],"StartRow",o),L=s$P.queryNumericValue(O[0],"EndCol",o),B=s$P.queryNumericValue(O[0],"EndRow",o);A[M]={StartCol:D,StartRow:R,EndCol:L,EndRow:B}}var N=new g$9(i._context);N.setIsMultiResolution(!0);var F=e.lastIndexOf("/");N._url=e.slice(0,F),N._name=s,N._version=a,N._width=l,N._height=u,N._zBounds=new o$1k(b,x),N._layerBounds=new h$10($,y,g,v);var z=N._layerBounds.width/l,k=N._layerBounds.height/u;for(P=A.length-1;P>=0;P--)A[P].Width=l,A[P].Height=u,l=Math.floor(.5*l),u=Math.floor(.5*u),A[P].resolution=new o$1k(z,k),z*=2,k*=2;N._depth=c,N._time=h,N._levels=T,N._cellWidth=d,N._cellHeight=f,N._cellDepth=p,N._cellTime=_,N._maxFiltration=w,N._minFiltration=C,N._floor=C,N._ceil=w,N._availableNode=A,o$1q(o$$(N._url+"/0/0000/0000/0000_0000.vol"),(function(e){var t=e.slice(16,e.byteLength);N._volumeBuffer=nt$c.inflate(t).buffer,i._layers.add(N),r.resolve(N)})).otherwise((function(e){throw new t$Z("Not load root file!")}))})).otherwise((function(e){throw new t$Z("Not a valid SCVO file!")})),r.promise)},F$4.prototype.renderIds=function(e){var t=this._context,i=this._defaultView;this._view=i;var r=i.viewport;r.x=0,r.y=0,r.width=t.drawingBufferWidth,r.height=t.drawingBufferHeight,ie$1.x=0,ie$1.y=0,ie$1.width=t.drawingBufferWidth,ie$1.height=t.drawingBufferHeight;var n=t.uniformState,o=this._frameState;Ie$2(this),o.invertClassification=!1,o.passes.pick=!0,n.update(o);var a=i.pickFramebuffer.begin(ie$1,r),s=this._environmentVisible.isGlobalVisible;this._environmentVisible.isGlobalVisible=!1,this._environmentVisible.isOnlyS3MObjectVisible=!0;var l=this.camera,u=t$X.clone(l.position),c=l.heading,h=l.pitch,d=l.roll;this.camera.setView(e),De$2(this),Ue$1(this,a,wr),Me$2(this,a),t.endFrame(),this._environmentVisible.isGlobalVisible=s,this._environmentVisible.isOnlyS3MObjectVisible=!1,l.setView({destination:u,orientation:{heading:c,pitch:h,roll:d}})},F$4.prototype.pickRect=function(e,t){var i=this._context.drawingBufferHeight-e.y,r=this._context.drawingBufferHeight-t.y,n=Math.min(e.x,t.x),o=Math.min(i,r),a=Math.max(e.x,t.x),s=Math.max(i,r),l=new e$25;l.x=n/this._context.drawingBufferWidth,l.y=o/this._context.drawingBufferHeight,l.z=a/this._context.drawingBufferWidth,l.w=s/this._context.drawingBufferHeight,this._isUpdatePickCommand=!0,this._pickRect=new e$25(n,o,a,s);for(var u=0,c=this._layers.layerQueue.length;u<c;u++){this._layers.layerQueue[u].selectBound=l}},F$4.prototype.getPickRectIDs=function(){for(var e=new e$1P,t=this._layers.layerQueue,i={},r=!1,n=0;n<t.length;n++){i[(_=t[n]).id]=Object.keys(_._objsVisibleMap),r=!!_._objsVisibleMap[i[_.id][0]]}for(var o=0;o<10;o++){this._isUpdatePickCommand=!0,this.initializeFrame(),this._renderForQuery();var a=!1;for(n=0;n<t.length;n++){var s=(_=t[n]).getSelection();if(!(s.length<=0)){if(e.contains(_.id)){var l;l=s.concat(e.get(_.id).ids),s=l}for(var u=[],c=(o=0,s.length);o<c;o++){var h=s[o],d=i[_.id].indexOf(h);(r&&d>-1||!r&&-1===d)&&u.push(h)}var f={layerName:_.name,layerIndex:n,ids:u};e.set(_.id,f),a=!0,_.releaseSelection(),_.setObjsVisible(s,!1)}}if(!a)break}var p=[];this._isUpdatePickCommand=!1;for(o=0;o<e.values.length;o++){var _;(_=t[e.values[o].layerIndex]).setObjsVisible([],!1),r||_.setOnlyObjsVisible(i[_.id],r);var m={layerName:e.values[o].layerName,ids:e.values[o].ids};p.push(m)}return p},F$4.prototype._renderForQuery=function(){var e=this.context,t=e.uniformState,i=this._frameState,r=this._defaultView;this._view=r,Ie$2(this),i.passes.render=!0,i.passes.postProcess=this.postProcessStages.hasSelected,i.backgroundColor=u$Y(this.backgroundColor,e$1S.BLACK),t.update(i);var n=r.viewport;n.x=0,n.y=0,n.width=e.drawingBufferWidth,n.height=e.drawingBufferHeight;var o=r.passState;o.framebuffer=void 0,o.blendingEnabled=void 0,o.scissorTest=void 0,o.viewport=f$10.clone(n,o.viewport),Wi(this),Ui(this),De$2(this),Me$2(this,o),o.framebuffer=void 0,Hi(this),e.endFrame()},F$4.prototype.getHeight=function(e,t){var i=this._context,r=i.uniformState,n=this._frameState;this._environmentState;var o=this._defaultView;this._view=o;var a=o.viewport;a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;var s=new o$1k(.5*i.drawingBufferWidth,.5*i.drawingBufferHeight),l=o.passState;l.viewport=f$10.clone(a,l.viewport),Pt$1(n.passes),n.passes.pick=!0,n.passes.depth=!0,De$2(this),l=o.pickDepthFramebuffer.update(i,s,a);var u,c=this.camera,h=t$X.clone(c.positionWC),d=t$X.clone(c.direction),f=t$X.clone(c.up);c.setView({destination:t$X.fromDegrees(e,t,9e3)}),Ue$1(this,l,wr),Me$2(this,l),i.endFrame(),u=e$28(c.frustum.fov)?c.frustum.clone(it):e$28(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(at$3):e$28(c.frustum.width)?c.frustum.clone(ot$2):c.frustum.clone(nt$2);for(var p,_=o.frustumCommandsList,m=_.length,$=new t$X,g=0;g<m;++g){var v=this._picking.getPickDepth(this,g).getDepth(i,s.x,s.y);if(v>0&&v<1){var y=_[g];u.near=y.near*(0!==g?this.opaqueFrustumNearOffset:1),u.far=y.far,r.updateFrustum(u),$=m$W.drawingBufferToWgs84Coordinates(this,s,v,$),p=t$W.fromCartesian($).height;break}}return c.setView({destination:h,orientation:{direction:d,up:f}}),p},F$4.prototype.addLightSource=function(e){LicenseChecker.LICENSECHECKER.verify("Scene_addLightSource"),e$28(e)&&this._lightSource.addLightSource(e)},F$4.prototype.removeLightSource=function(e){!e$28(e)||this._lightSource.removeLightSource(e)},F$4.prototype.outputSceneToFile=function(){var e=this,t=o$1q.defer(),i=!1;return this.postRender.addEventListener((function(){if(!i){i=!0;var r=e.context.readPixels({}),n=document.createElement("canvas");n.height=e.context.drawingBufferHeight,n.width=e.context.drawingBufferWidth;var o=n.getContext("2d"),a=o.createImageData(n.width,n.height);a.data.set(r),o.putImageData(a,0,0);for(var s=o.getImageData(0,0,n.width,n.height),l=0;l<s.height/2;++l)for(var u=0;u<s.width;++u){var c=4*l*s.width+4*u,h=4*(s.height-l)*s.width+4*u,d=s.data[c],f=s.data[c+1],p=s.data[c+2],_=s.data[c+3];s.data[c]=s.data[h],s.data[c+1]=s.data[h+1],s.data[c+2]=s.data[h+2],s.data[c+3]=s.data[h+3],s.data[h]=d,s.data[h+1]=f,s.data[h+2]=p,s.data[h+3]=_}o.clearRect(0,0,s.width,s.height),o.putImageData(s,0,0);var m=n.toDataURL();t.resolve(m)}})),t.promise},F$4.prototype.collideDetection=function(e){if(this.mode===P$$.SCENE3D||this.mode===P$$.COLUMBUS_VIEW){var t=this._context,i=this._defaultView;this._view=i;var r=this.camera,n=t.uniformState,o=t$X.clone(r.direction),a=t$X.clone(r.up),s=t$X.cross(e,r.right,new t$X);r.setView({destination:r.position,orientation:{direction:e,up:s},convert:r._mode!==P$$.COLUMBUS_VIEW});var l,u=new o$1k(.5*t.drawingBufferWidth,.5*t.drawingBufferHeight);Pi(this,u),this.camera.setView({destination:this.camera.position,orientation:{direction:o,up:a},convert:r._mode!==P$$.COLUMBUS_VIEW}),l=e$28(r.frustum.fov)?r.frustum.clone(it):e$28(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(at$3):e$28(r.frustum.width)?r.frustum.clone(ot$2):r.frustum.clone(nt$2);for(var c=i.frustumCommandsList,h=c.length,d=new t$X,f=0;f<h;++f){var p=this._picking.getPickDepth(this,f).getDepth(t,u.x,u.y);if(p>0&&p<1){var _=c[f];return l.near=_.near*(0!==f?this.opaqueFrustumNearOffset:1),l.far=_.far,n.updateFrustum(l),m$W.drawingBufferToWgs84Coordinates(this,u,p,d)}}}},F$4.prototype.parsePBRFromJson=function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(t$S.createIfNeeded(e[i]).fetchJson());var n=this;o$1q.all(t,(function(e){for(var t=0,i=e.length;t<i;t++){var r=e[t].material,o=new y$15,a=r.pbrMetallicRoughness;r.textureunitstates,o[0]=a.roughnessFactor,o[1]=a.metallicFactor,o[2]=a.baseColor.x,o[3]=a.baseColor.y,o[4]=a.baseColor.z,o[5]=a.baseColor.w,n._pbrMaterlParameters.push(o)}}))},F$4.prototype.isDestroyed=function(){return!1},F$4.prototype.destroy=function(){this.layers.removeAll(),this.layers.endFrame(this._frameState),this._analyst3D.removeAll(),this._vectorTileMaps.removeAll(),this.compositor.destroy(),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.cloudBox=this.cloudBox&&this.cloudBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this.moon=this.moon&&this.moon.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._defaultView=this._defaultView&&this._defaultView.destroy(),this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy(),this._view=void 0,this.shadowMap=this.shadowMap&&this.shadowMap.destroy(),this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),e$28(this._reflectFramebuffer)&&(this._reflectFramebuffer.destroy(),this._frameState._framebufferList.water=void 0),e$28(this._normalFramebuffer)&&(this._normalFramebuffer.destroy(),this._frameState._framebufferList.normalAndDepth=void 0),e$28(this._postEffectFilterFramebuffer)&&(this._postEffectFilterFramebuffer.destroy(),this._frameState._framebufferList.postEffectFilter=void 0),e$28(this._clampFramebuffer)&&(this._clampFramebuffer.destroy(),this._frameState._framebufferList.clampTexture=void 0),e$28(this._pickRectFramebuffer)&&(this._pickRectFramebuffer.destroy(),this._frameState._framebufferList.pickRectTexture=void 0),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),e$28(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,this._rasterPickTexture=this._rasterPickTexture&&!this._rasterPickTexture.isDestroyed()&&this._rasterPickTexture.destroy(),this._rasterPickFBO=this._rasterPickFBO&&!this._rasterPickFBO.isDestroyed()&&this._rasterPickFBO.destroy(),e$28(this.voxelGridPostRender)&&this.voxelGridPostRender.destroy(),this.voxelGridPostRender=void 0,e$28(this.particlePostRender)&&this.particlePostRender.destroy(),this.particlePostRender=void 0,e$28(this.particleTrailsPostRenderer)&&this.particleTrailsPostRenderer.destroy(),this.particleTrailsPostRenderer=void 0,e$28(this.nonSelDepthbuffer)&&this.nonSelDepthbuffer.destroy(),e$28(this.selMaskBuffer)&&this.selMaskBuffer.destroy(),i$Z(this)};var u$7="#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat lightEnum = u_cameraAndRadiiAndDynamicAtmosphereColor.w;\nvec3 lightDirection =\nczm_viewerPositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nlightDirection = normalize(lightDirection);\nfloat cosAngle = dot(lightDirection, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\n#ifndef HDR\nconst float exposure = 2.0;\nrgb = vec3(1.0) - exp(-exposure * rgb);\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 atmosphereAlpha = clamp((u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.x) / (u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.z), 0.0, 1.0);\nfloat nightAlpha = (lightEnum != 0.0) ? clamp(dot(normalize(czm_viewerPositionWC), lightDirection), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\ngl_FragColor = vec4(rgb, mix(rgb.b, 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n",n$6="attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat lightEnum = u_cameraAndRadiiAndDynamicAtmosphereColor.w;\nvec3 lightDirection =\nczm_viewerPositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nlightDirection = normalize(lightDirection);\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}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n";
- /**
- * @license
- * Copyright (c) 2000-2005, Sean O'Neil
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the project nor the names of its contributors may be
- * used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Modifications made by Analytical Graphics, Inc.
- */function s$8(e){e=u$Y(e,t$V.WGS84),this.show=!0,this._ellipsoid=e,this._command=new r$15({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=.4,this.alpha=1,this._hueSaturationBrightness=new t$X;var t=new e$25;t.w=0,t.y=t$X.maximumComponent(t$X.multiplyByScalar(e.radii,1.025,new t$X)),t.z=e.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=t;var i=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return i._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness},u_alpha:function(){return i.alpha}}}function M$4(e){return!(e$27.equalsEpsilon(e.hueShift,0,e$27.EPSILON7)&&e$27.equalsEpsilon(e.saturationShift,0,e$27.EPSILON7)&&e$27.equalsEpsilon(e.brightnessShift,0,e$27.EPSILON7))}Object.defineProperties(s$8.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s$8.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},s$8.prototype.update=function(e){if(this.show){var t=e.mode;if((t===P$$.SCENE3D||t===P$$.MORPHING)&&e.passes.render){var i=this._command;if(!e$28(i.vertexArray)){var r=e.context,n=b$Y.createGeometry(new b$Y({radii:t$X.multiplyByScalar(this._ellipsoid.radii,1.025,new t$X),slicePartitions:256,stackPartitions:256,vertexFormat:n$10.POSITION_ONLY}));i.vertexArray=m$19.fromGeometry({context:r,geometry:n,attributeLocations:k$Z.createAttributeLocations(n),bufferUsage:A$1c.STATIC_DRAW}),this._rs=u$R.fromCache({cull:{enabled:!0,face:k$11.FRONT},blending:Ee$n.ALPHA_BLEND,depthMask:!1}),this._rsReflect=u$R.fromCache({cull:{enabled:!0,face:k$11.BACK},blending:Ee$n.ALPHA_BLEND,depthMask:!1}),i.renderState=this._rs;var o=new a$$({defines:["SKY_FROM_SPACE"],sources:[n$6]});this._spSkyFromSpace=S$T.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:u$7}),o=new a$$({defines:["SKY_FROM_ATMOSPHERE"],sources:[n$6]}),this._spSkyFromAtmosphere=S$T.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:u$7})}var a=M$4(this);if(a&&(!e$28(this._spSkyFromSpaceColorCorrect)||!e$28(this._spSkyFromAtmosphereColorCorrect))){var s=e.context,l=new a$$({defines:["SKY_FROM_SPACE"],sources:[n$6]}),u=new a$$({defines:["COLOR_CORRECT"],sources:[u$7]});this._spSkyFromSpaceColorCorrect=S$T.fromCache({context:s,vertexShaderSource:l,fragmentShaderSource:u}),l=new a$$({defines:["SKY_FROM_ATMOSPHERE"],sources:[n$6]}),this._spSkyFromAtmosphereColorCorrect=S$T.fromCache({context:s,vertexShaderSource:l,fragmentShaderSource:u})}var c=e.camera.positionWC,h=t$X.magnitude(c);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=h,h>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=a?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=a?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,e._fboState.frameBufferType===L$T.REFLECT?i.renderState=this._rsReflect:i.renderState=this._rs,i}}},s$8.prototype.isDestroyed=function(){return!1},s$8.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),i$Z(this)};var J$2="uniform samplerCube u_cubeMap;\nuniform float u_alpha;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\nfloat alpha = czm_sceneMode == czm_sceneModeColumbusView ? u_alpha : u_alpha * czm_morphTime;\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, alpha);\n}\n",$$2="attribute vec3 position;\nuniform mat3 u_rotateMatrix;\nvarying vec3 v_texCoord;\nvoid main()\n{\nif (czm_sceneMode == czm_sceneModeColumbusView) {\nvec3 worldPosition = czm_entireFrustum.y * position;\ngl_Position = czm_modelViewProjection * vec4(worldPosition, 1.0);\nvec3 texCoord = normalize(worldPosition);\nv_texCoord = texCoord.zxy;\n}\nelse{\nvec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n}\n";function m$7(e){LicenseChecker.LICENSECHECKER.verify("SkyBox"),this.sources=e.sources,this._sources=void 0,this.show=u$Y(e.show,!0),this._command=new r$15({modelMatrix:y$15.clone(y$15.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this.alpha=1,this._uSpeed=0,this._vSpeed=0,this._wSpeed=0,this._horizontalRotationAngle=0,this._axisChanged=!0,this.imageUrl=e.imageUrl,this._imageUrl=void 0,this._PreprocessCubeMap=void 0}function oe$2(e){return!(0!==e._horizontalRotationAngle||0!==e._wSpeed||0!==e._uSpeed||0!==e._vSpeed)}Object.defineProperties(m$7.prototype,{USpeed:{get:function(){return this._uSpeed},set:function(e){o$1u.typeOf.number("SkyBox.uSpeed",e),this._uSpeed=e,this._axisChanged=!0}},VSpeed:{get:function(){return this._vSpeed},set:function(e){o$1u.typeOf.number("SkyBox.vSpeed",e),this._vSpeed=e,this._axisChanged=!0}},WSpeed:{get:function(){return this._wSpeed},set:function(e){o$1u.typeOf.number("SkyBox.wSpeed",e),this._wSpeed=e,this._axisChanged=!0}},horizontalRotationAngle:{get:function(){return this._horizontalRotationAngle},set:function(e){o$1u.typeOf.number("SkyBox.horizontalRotationAngle",e),this._horizontalRotationAngle=e,this._axisChanged=!0}}});var ae$1=new t$X,w$3=new t$X,A$7=new t$X,P$3=new t$X,ne$2=new t$X(1,1,1),R$4=new n$14,d$b=new t$X,E$5=0,U$3=y$15.IDENTITY.clone(new y$15);function t$5(){}m$7.prototype.update=function(e,t){oe$2(this)||LicenseChecker.LICENSECHECKER.verify("SkyBox");var i=this;if(this.show&&(e.mode===P$$.SCENE3D||e.mode===P$$.COLUMBUS_VIEW||e.mode===P$$.MORPHING)&&e.passes.render){var r=e.context;if(this._sources!==this.sources){this._sources=this.sources;var n=this.sources;if(!(e$28(n.positiveX)&&e$28(n.negativeX)&&e$28(n.positiveY)&&e$28(n.negativeY)&&e$28(n.positiveZ)&&e$28(n.negativeZ)))throw new t$Z("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof n.positiveX!=typeof n.negativeX||typeof n.positiveX!=typeof n.positiveY||typeof n.positiveX!=typeof n.negativeY||typeof n.positiveX!=typeof n.positiveZ||typeof n.positiveX!=typeof n.negativeZ)throw new t$Z("this.sources properties must all be the same type.");"string"==typeof n.positiveX?d$r(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 X$z({context:r,source:n}))}this._imageUrl!==this.imageUrl&&!this._sources&&(this._imageUrl=this.imageUrl,this._PreprocessCubeMap=new b$r(r,this._imageUrl)),e$28(this._PreprocessCubeMap)&&(this._PreprocessCubeMap.update(e),this._PreprocessCubeMap.ready&&(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=this._PreprocessCubeMap.cubeMap,this._PreprocessCubeMap=void 0));var o=this._command;if(e.mode===P$$.COLUMBUS_VIEW?o.modelMatrix=e.camera._actualInvTransform:o.modelMatrix=m$1b.eastNorthUpToFixedFrame(e.camera._positionWC),this._axisChanged){var a=y$15.multiplyByPoint(o.modelMatrix,t$X.ZERO,ae$1),s=y$15.multiplyByPoint(o.modelMatrix,t$X.UNIT_X,w$3),l=y$15.multiplyByPoint(o.modelMatrix,t$X.UNIT_Y,A$7),u=y$15.multiplyByPoint(o.modelMatrix,t$X.UNIT_Z,P$3),c=t$X.subtract(s,a,w$3),h=t$X.subtract(l,a,A$7),d=t$X.subtract(u,a,P$3),f=n$14.fromAxisAngle(c,this._uSpeed*performance.now()/1e5),p=n$14.fromAxisAngle(h,this._vSpeed*performance.now()/1e5),_=n$14.fromAxisAngle(d,this._wSpeed*performance.now()/1e5);if(this._horizontalRotationAngle){let t=e.mode===P$$.COLUMBUS_VIEW?h:d;_=n$14.fromAxisAngle(t,this._horizontalRotationAngle)}var m=n$14.multiply(f,n$14.multiply(p,_,R$4),R$4);d$b=n$14.computeAxis(m,d$b),E$5=Math.max(Math.max(Math.abs(this._uSpeed),Math.abs(this._vSpeed)),Math.abs(this._wSpeed)),this._axisChanged=!1}var $=y$15.IDENTITY.clone(U$3);if(!t$X.equals(d$b,t$X.ZERO)&&!e.camera.bReflect){var g=E$5*performance.now()/1e5;this._horizontalRotationAngle&&(g=this._horizontalRotationAngle),$=y$15.fromTranslationQuaternionRotationScale(t$X.ZERO,n$14.fromAxisAngle(d$b,g),ne$2,U$3),y$15.multiply($,o.modelMatrix,o.modelMatrix)}if(!e$28(o.vertexArray)){o.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return y$15.getRotation(o.modelMatrix,new p$1a)},u_alpha:function(){return i.alpha}};var v=O$H.createGeometry(O$H.fromDimensions({dimensions:new t$X(2,2,2),vertexFormat:n$10.POSITION_ONLY})),y=this._attributeLocations=k$Z.createAttributeLocations(v);o.vertexArray=m$19.fromGeometry({context:r,geometry:v,attributeLocations:y,bufferUsage:A$1c.STATIC_DRAW}),o.renderState=u$R.fromCache({blending:Ee$n.ALPHA_BLEND})}if(!e$28(o.shaderProgram)||this._useHdr!==t){var x=new a$$({defines:[t?"HDR":""],sources:[J$2]});o.shaderProgram=S$T.fromCache({context:r,vertexShaderSource:$$2,fragmentShaderSource:x,attributeLocations:this._attributeLocations}),this._useHdr=t}if(e$28(this._cubeMap))return o}},m$7.prototype.isDestroyed=function(){return!1},m$7.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(),i$Z(this)},t$5.prototype.evaluate=function(e,t){t$Z.throwInstantiationError()},t$5.prototype.evaluateColor=function(e,t){t$Z.throwInstantiationError()},t$5.prototype.getShaderFunction=function(e,t,i,r){t$Z.throwInstantiationError()};var tt$1="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",rt$2="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",et$1="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 u$6(){this.show=!0,this._drawCommand=new r$15({primitiveType:W$_.TRIANGLES,boundingVolume:new i$19,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new i$19,this._boundingVolume2D=new i$19,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(u$6.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var ot$1=new o$1k,nt$1=new o$1k,at$2=new e$25,s$7=new e$25;u$6.prototype.update=function(e,t,i){if(this.show){var r=e.mode;if(r!==P$$.SCENE2D&&r!==P$$.MORPHING&&e.passes.render){var n=e.context,o=t.viewport.width,a=t.viewport.height;if(!e$28(this._texture)||o!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||i!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=i;var s=Math.max(o,a);s=Math.pow(2,Math.ceil(Math.log(s)/Math.log(2))-2),s=Math.max(1,s);var l=i?n.halfFloatingPointTexture?y$U.HALF_FLOAT:y$U.FLOAT:y$U.UNSIGNED_BYTE;this._texture=new L$17({context:n,width:s,height:s,pixelFormat:V$O.RGBA,pixelDatatype:l}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var u=this,c={u_radiusTS:function(){return u._radiusTS}};this._commands.computeCommand=new t$u({fragmentShaderSource:rt$2,outputTexture:this._texture,uniformMap:c,persists:!1,owner:this,postExecute:function(){u._commands.computeCommand=void 0}})}var h=this._drawCommand;if(!e$28(h.vertexArray)){var d={direction:0},f=new Uint8Array(8);f[0]=0,f[1]=0,f[2]=255,f[3]=0,f[4]=255,f[5]=255,f[6]=0,f[7]=255;var p=h$W.createVertexBuffer({context:n,typedArray:f,usage:A$1c.STATIC_DRAW}),_=[{index:d.direction,vertexBuffer:p,componentsPerAttribute:2,normalize:!0,componentDatatype:S$W.UNSIGNED_BYTE}],m=h$W.createIndexBuffer({context:n,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT});h.vertexArray=new m$19({context:n,attributes:_,indexBuffer:m}),h.shaderProgram=S$T.fromCache({context:n,vertexShaderSource:et$1,fragmentShaderSource:tt$1,attributeLocations:d}),h.renderState=u$R.fromCache({blending:Ee$n.ALPHA_BLEND}),h.uniformMap=this._uniformMap}var $=n.uniformState.sunPositionWC,g=n.uniformState.sunPositionColumbusView,v=this._boundingVolume,y=this._boundingVolume2D;t$X.clone($,v.center),y.center.x=g.z,y.center.y=g.x,y.center.z=g.y,v.radius=e$27.SOLAR_RADIUS+e$27.SOLAR_RADIUS*this._glowLengthTS,y.radius=v.radius,r===P$$.SCENE3D?i$19.clone(v,h.boundingVolume):r===P$$.COLUMBUS_VIEW&&i$19.clone(y,h.boundingVolume);var x=m$W.computeActualWgs84Position(e,$,s$7),b=t$X.magnitude(t$X.subtract(x,e.camera.position,s$7)),w=n.uniformState.projection,C=at$2;C.x=0,C.y=0,C.z=-b,C.w=1;var T=y$15.multiplyByVector(w,C,s$7),S=m$W.clipToGLWindowCoordinates(t.viewport,T,ot$1);C.x=e$27.SOLAR_RADIUS;var E=y$15.multiplyByVector(w,C,s$7),A=m$W.clipToGLWindowCoordinates(t.viewport,E,nt$1);return this._size=o$1k.magnitude(o$1k.subtract(A,S,s$7)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands}}},u$6.prototype.isDestroyed=function(){return!1},u$6.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(),i$Z(this)};var L$5=null;try{L$5=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function s$6(e,t,i){this.low=0|e,this.high=0|t,this.unsigned=!!i}function l$8(e){return!0===(e&&e.__isLong__)}s$6.prototype.__isLong__,Object.defineProperty(s$6.prototype,"__isLong__",{value:!0}),s$6.isLong=l$8;var M$3={},R$3={};function d$a(e,t){var i,r,n;return t?(n=0<=(e>>>=0)&&e<256)&&(r=R$3[e])?r:(i=e$1(e,(0|e)<0?-1:0,!0),n&&(R$3[e]=i),i):(n=-128<=(e|=0)&&e<128)&&(r=M$3[e])?r:(i=e$1(e,e<0?-1:0,!1),n&&(M$3[e]=i),i)}function v$6(e,t){if(isNaN(e))return t?U$2:q$2;if(t){if(e<0)return U$2;if(e>=Z$4)return H$2}else{if(e<=-P$2)return c$7;if(e+1>=P$2)return D$3}return e<0?v$6(-e,t).neg():e$1(e%T$3|0,e/T$3|0,t)}function e$1(e,t,i){return new s$6(e,t,i)}s$6.fromInt=d$a,s$6.fromNumber=v$6,s$6.fromBits=e$1;var x$5=Math.pow;function I$1(e,t,i){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return q$2;if("number"==typeof t?(i=t,t=!1):t=!!t,(i=i||10)<2||36<i)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return I$1(e.substring(1),t,i).neg();for(var n=v$6(x$5(i,8)),o=q$2,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),l=parseInt(e.substring(a,a+s),i);if(s<8){var u=v$6(x$5(i,s));o=o.mul(u).add(v$6(l))}else o=(o=o.mul(n)).add(v$6(l))}return o.unsigned=t,o}function O$3(e,t){return"number"==typeof e?v$6(e,t):"string"==typeof e?I$1(e,t):e$1(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}s$6.fromString=I$1,s$6.fromValue=O$3;var W$4=65536,C$5=1<<24,T$3=W$4*W$4,Z$4=T$3*T$3,P$2=Z$4/2,S=d$a(C$5),q$2=d$a(0);s$6.ZERO=q$2;var U$2=d$a(0,!0);s$6.UZERO=U$2;var b$8=d$a(1);s$6.ONE=b$8;var V$3=d$a(1,!0);s$6.UONE=V$3;var A$6=d$a(-1);s$6.NEG_ONE=A$6;var D$3=e$1(-1,2147483647,!1);s$6.MAX_VALUE=D$3;var H$2=e$1(-1,-1,!0);s$6.MAX_UNSIGNED_VALUE=H$2;var c$7=e$1(0,-2147483648,!1);s$6.MIN_VALUE=c$7;var h$4=s$6.prototype;h$4.toInt=function(){return this.unsigned?this.low>>>0:this.low},h$4.toNumber=function(){return this.unsigned?(this.high>>>0)*T$3+(this.low>>>0):this.high*T$3+(this.low>>>0)},h$4.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(c$7)){var t=v$6(e),i=this.div(t),r=i.mul(t).sub(this);return i.toString(e)+r.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=v$6(x$5(e,6),this.unsigned),o=this,a="";;){var s=o.div(n),l=(o.sub(s.mul(n)).toInt()>>>0).toString(e);if((o=s).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},h$4.getHighBits=function(){return this.high},h$4.getHighBitsUnsigned=function(){return this.high>>>0},h$4.getLowBits=function(){return this.low},h$4.getLowBitsUnsigned=function(){return this.low>>>0},h$4.getNumBitsAbs=function(){if(this.isNegative())return this.eq(c$7)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},h$4.isZero=function(){return 0===this.high&&0===this.low},h$4.eqz=h$4.isZero,h$4.isNegative=function(){return!this.unsigned&&this.high<0},h$4.isPositive=function(){return this.unsigned||this.high>=0},h$4.isOdd=function(){return 1==(1&this.low)},h$4.isEven=function(){return 0==(1&this.low)},h$4.equals=function(e){return l$8(e)||(e=O$3(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},h$4.eq=h$4.equals,h$4.notEquals=function(e){return!this.eq(e)},h$4.neq=h$4.notEquals,h$4.ne=h$4.notEquals,h$4.lessThan=function(e){return this.comp(e)<0},h$4.lt=h$4.lessThan,h$4.lessThanOrEqual=function(e){return this.comp(e)<=0},h$4.lte=h$4.lessThanOrEqual,h$4.le=h$4.lessThanOrEqual,h$4.greaterThan=function(e){return this.comp(e)>0},h$4.gt=h$4.greaterThan,h$4.greaterThanOrEqual=function(e){return this.comp(e)>=0},h$4.gte=h$4.greaterThanOrEqual,h$4.ge=h$4.greaterThanOrEqual,h$4.compare=function(e){if(l$8(e)||(e=O$3(e)),this.eq(e))return 0;var t=this.isNegative(),i=e.isNegative();return t&&!i?-1:!t&&i?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},h$4.comp=h$4.compare,h$4.negate=function(){return!this.unsigned&&this.eq(c$7)?c$7:this.not().add(b$8)},h$4.neg=h$4.negate,h$4.add=function(e){l$8(e)||(e=O$3(e));var t=this.high>>>16,i=65535&this.high,r=this.low>>>16,n=65535&this.low,o=e.high>>>16,a=65535&e.high,s=e.low>>>16,l=0,u=0,c=0,h=0;return c+=(h+=n+(65535&e.low))>>>16,u+=(c+=r+s)>>>16,l+=(u+=i+a)>>>16,l+=t+o,e$1((c&=65535)<<16|(h&=65535),(l&=65535)<<16|(u&=65535),this.unsigned)},h$4.subtract=function(e){return l$8(e)||(e=O$3(e)),this.add(e.neg())},h$4.sub=h$4.subtract,h$4.multiply=function(e){if(this.isZero())return q$2;if(l$8(e)||(e=O$3(e)),L$5)return e$1(L$5.mul(this.low,this.high,e.low,e.high),L$5.get_high(),this.unsigned);if(e.isZero())return q$2;if(this.eq(c$7))return e.isOdd()?c$7:q$2;if(e.eq(c$7))return this.isOdd()?c$7:q$2;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(S)&&e.lt(S))return v$6(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,i=65535&this.high,r=this.low>>>16,n=65535&this.low,o=e.high>>>16,a=65535&e.high,s=e.low>>>16,l=65535&e.low,u=0,c=0,h=0,d=0;return h+=(d+=n*l)>>>16,c+=(h+=r*l)>>>16,h&=65535,c+=(h+=n*s)>>>16,u+=(c+=i*l)>>>16,c&=65535,u+=(c+=r*s)>>>16,c&=65535,u+=(c+=n*a)>>>16,u+=t*l+i*s+r*a+n*o,e$1((h&=65535)<<16|(d&=65535),(u&=65535)<<16|(c&=65535),this.unsigned)},h$4.mul=h$4.multiply,h$4.divide=function(e){if(l$8(e)||(e=O$3(e)),e.isZero())throw Error("division by zero");var t,i,r;if(L$5)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?e$1((this.unsigned?L$5.div_u:L$5.div_s)(this.low,this.high,e.low,e.high),L$5.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?U$2:q$2;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return U$2;if(e.gt(this.shru(1)))return V$3;r=U$2}else{if(this.eq(c$7))return e.eq(b$8)||e.eq(A$6)?c$7:e.eq(c$7)?b$8:(t=this.shr(1).div(e).shl(1)).eq(q$2)?e.isNegative()?b$8:A$6:(i=this.sub(e.mul(t)),r=t.add(i.div(e)));if(e.eq(c$7))return this.unsigned?U$2:q$2;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=q$2}for(i=this;i.gte(e);){t=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var n=Math.ceil(Math.log(t)/Math.LN2),o=n<=48?1:x$5(2,n-48),a=v$6(t),s=a.mul(e);s.isNegative()||s.gt(i);)s=(a=v$6(t-=o,this.unsigned)).mul(e);a.isZero()&&(a=b$8),r=r.add(a),i=i.sub(s)}return r},h$4.div=h$4.divide,h$4.modulo=function(e){return l$8(e)||(e=O$3(e)),L$5?e$1((this.unsigned?L$5.rem_u:L$5.rem_s)(this.low,this.high,e.low,e.high),L$5.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},h$4.mod=h$4.modulo,h$4.rem=h$4.modulo,h$4.not=function(){return e$1(~this.low,~this.high,this.unsigned)},h$4.and=function(e){return l$8(e)||(e=O$3(e)),e$1(this.low&e.low,this.high&e.high,this.unsigned)},h$4.or=function(e){return l$8(e)||(e=O$3(e)),e$1(this.low|e.low,this.high|e.high,this.unsigned)},h$4.xor=function(e){return l$8(e)||(e=O$3(e)),e$1(this.low^e.low,this.high^e.high,this.unsigned)},h$4.shiftLeft=function(e){return l$8(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?e$1(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):e$1(0,this.low<<e-32,this.unsigned)},h$4.shl=h$4.shiftLeft,h$4.shiftRight=function(e){return l$8(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?e$1(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):e$1(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},h$4.shr=h$4.shiftRight,h$4.shiftRightUnsigned=function(e){return l$8(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?e$1(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e$1(32===e?this.high:this.high>>>e-32,0,this.unsigned)},h$4.shru=h$4.shiftRightUnsigned,h$4.shr_u=h$4.shiftRightUnsigned,h$4.rotateLeft=function(e){var t;return l$8(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?e$1(this.high,this.low,this.unsigned):e<32?(t=32-e,e$1(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),e$1(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},h$4.rotl=h$4.rotateLeft,h$4.rotateRight=function(e){var t;return l$8(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?e$1(this.high,this.low,this.unsigned):e<32?(t=32-e,e$1(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),e$1(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},h$4.rotr=h$4.rotateRight,h$4.toSigned=function(){return this.unsigned?e$1(this.low,this.high,!1):this},h$4.toUnsigned=function(){return this.unsigned?this:e$1(this.low,this.high,!0)},h$4.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},h$4.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},h$4.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},s$6.fromBytes=function(e,t,i){return i?s$6.fromBytesLE(e,t):s$6.fromBytesBE(e,t)},s$6.fromBytesLE=function(e,t){return new s$6(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},s$6.fromBytesBE=function(e,t){return new s$6(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var u$5=function(e,t,i){if(typeof e>"u"&&(e=u$5.DEFAULT_CAPACITY),typeof t>"u"&&(t=u$5.DEFAULT_ENDIAN),typeof i>"u"&&(i=u$5.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");t=!!t,i=!!i}this.buffer=0===e?x$4:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=t,this.noAssert=i};u$5.VERSION="5.0.1",u$5.LITTLE_ENDIAN=!0,u$5.BIG_ENDIAN=!1,u$5.DEFAULT_CAPACITY=16,u$5.DEFAULT_ENDIAN=u$5.BIG_ENDIAN,u$5.DEFAULT_NOASSERT=!1,u$5.Long=s$6||null;var l$7=u$5.prototype;l$7.__isByteBuffer__,Object.defineProperty(l$7,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var x$4=new ArrayBuffer(0),I=String.fromCharCode;function c$6(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function d$9(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+I.apply(String,e);e.length+arguments.length>1024&&(t.push(I.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function E$4(e,t,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=i?n-1:0,d=i?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+h],h+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=u}return(f?-1:1)*a*Math.pow(2,o-r)}function m$6(e,t,i,r,n,o){var a,s,l,u=8*o-n-1,c=(1<<u)-1,h=c>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(t*l-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+f]=255&s,f+=p,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;e[i+f]=255&a,f+=p,a/=256,u-=8);e[i+f-p]|=128*_}u$5.accessor=function(){return Uint8Array},u$5.allocate=function(e,t,i){return new u$5(e,t,i)},u$5.concat=function(e,t,i,r){("boolean"==typeof t||"string"!=typeof t)&&(r=i,i=t,t=void 0);for(var n,o=0,a=0,s=e.length;a<s;++a)u$5.isByteBuffer(e[a])||(e[a]=u$5.wrap(e[a],t)),(n=e[a].limit-e[a].offset)>0&&(o+=n);if(0===o)return new u$5(0,i,r);var l,u=new u$5(o,i,r);for(a=0;a<s;)!((n=(l=e[a++]).limit-l.offset)<=0)&&(u.view.set(l.view.subarray(l.offset,l.limit),u.offset),u.offset+=n);return u.limit=u.offset,u.offset=0,u},u$5.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},u$5.type=function(){return ArrayBuffer},u$5.wrap=function(e,t,i,r){if("string"!=typeof t&&(r=i,i=t,t=void 0),"string"==typeof e)switch(typeof t>"u"&&(t="utf8"),t){case"base64":return u$5.fromBase64(e,i);case"hex":return u$5.fromHex(e,i);case"binary":return u$5.fromBinary(e,i);case"utf8":return u$5.fromUTF8(e,i);case"debug":return u$5.fromDebug(e,i);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var n;if(u$5.isByteBuffer(e))return(n=l$7.clone.call(e)).markedOffset=-1,n;if(e instanceof Uint8Array)n=new u$5(0,i,r),e.length>0&&(n.buffer=e.buffer,n.offset=e.byteOffset,n.limit=e.byteOffset+e.byteLength,n.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)n=new u$5(0,i,r),e.byteLength>0&&(n.buffer=e,n.offset=0,n.limit=e.byteLength,n.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(n=new u$5(e.length,i,r)).limit=e.length;for(var o=0;o<e.length;++o)n.view[o]=e[o]}return n},l$7.writeBitSet=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,n=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)r=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(r,t++);if(s<o){var l=0;for(r=0;s<o;)r|=(1&!!e[s++])<<l++;this.writeByte(r,t++)}return i?(this.offset=t,this):t-n},l$7.readBitSet=function(e){var t=typeof e>"u";t&&(e=this.offset);var i,r=this.readVarint32(e),n=r.value,o=n>>3,a=0,s=[];for(e+=r.length;o--;)i=this.readByte(e++),s[a++]=!!(1&i),s[a++]=!!(2&i),s[a++]=!!(4&i),s[a++]=!!(8&i),s[a++]=!!(16&i),s[a++]=!!(32&i),s[a++]=!!(64&i),s[a++]=!!(128&i);if(a<n){var l=0;for(i=this.readByte(e++);a<n;)s[a++]=!!(i>>l++&1)}return t&&(this.offset=e),s},l$7.readBytes=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var r=this.slice(t,t+e);return i&&(this.offset+=e),r},l$7.writeBytes=l$7.append,l$7.writeInt8=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,i&&(this.offset+=1),this},l$7.writeByte=l$7.writeInt8,l$7.readInt8=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=this.view[e];return 128==(128&i)&&(i=-(255-i+1)),t&&(this.offset+=1),i},l$7.readByte=l$7.readInt8,l$7.writeUint8=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=1,this.view[t]=e,i&&(this.offset+=1),this},l$7.writeUInt8=l$7.writeUint8,l$7.readUint8=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=this.view[e];return t&&(this.offset+=1),i},l$7.readUInt8=l$7.readUint8,l$7.writeInt16=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),i&&(this.offset+=2),this},l$7.writeShort=l$7.writeInt16,l$7.readInt16=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[e],i|=this.view[e+1]<<8):(i=this.view[e]<<8,i|=this.view[e+1]),32768==(32768&i)&&(i=-(65535-i+1)),t&&(this.offset+=2),i},l$7.readShort=l$7.readInt16,l$7.writeUint16=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),i&&(this.offset+=2),this},l$7.writeUInt16=l$7.writeUint16,l$7.readUint16=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[e],i|=this.view[e+1]<<8):(i=this.view[e]<<8,i|=this.view[e+1]),t&&(this.offset+=2),i},l$7.readUInt16=l$7.readUint16,l$7.writeInt32=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),i&&(this.offset+=4),this},l$7.writeInt=l$7.writeInt32,l$7.readInt32=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0),i|=0,t&&(this.offset+=4),i},l$7.readInt=l$7.readInt32,l$7.writeUint32=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),i&&(this.offset+=4),this},l$7.writeUInt32=l$7.writeUint32,l$7.readUint32=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0),t&&(this.offset+=4),i},l$7.readUInt32=l$7.readUint32,s$6&&(l$7.writeInt64=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=s$6.fromNumber(e);else if("string"==typeof e)e=s$6.fromString(e);else if(!(e&&e instanceof s$6))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=s$6.fromNumber(e):"string"==typeof e&&(e=s$6.fromString(e)),t+=8;var r=this.buffer.byteLength;t>r&&this.resize((r*=2)>t?r:t),t-=8;var n=e.low,o=e.high;return this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n,t+=4,this.view[t+3]=o>>>24&255,this.view[t+2]=o>>>16&255,this.view[t+1]=o>>>8&255,this.view[t]=255&o):(this.view[t]=o>>>24&255,this.view[t+1]=o>>>16&255,this.view[t+2]=o>>>8&255,this.view[t+3]=255&o,t+=4,this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),i&&(this.offset+=8),this},l$7.writeLong=l$7.writeInt64,l$7.readInt64=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,r=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var n=new s$6(i,r,!1);return t&&(this.offset+=8),n},l$7.readLong=l$7.readInt64,l$7.writeUint64=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=s$6.fromNumber(e);else if("string"==typeof e)e=s$6.fromString(e);else if(!(e&&e instanceof s$6))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=s$6.fromNumber(e):"string"==typeof e&&(e=s$6.fromString(e)),t+=8;var r=this.buffer.byteLength;t>r&&this.resize((r*=2)>t?r:t),t-=8;var n=e.low,o=e.high;return this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n,t+=4,this.view[t+3]=o>>>24&255,this.view[t+2]=o>>>16&255,this.view[t+1]=o>>>8&255,this.view[t]=255&o):(this.view[t]=o>>>24&255,this.view[t+1]=o>>>16&255,this.view[t+2]=o>>>8&255,this.view[t+3]=255&o,t+=4,this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),i&&(this.offset+=8),this},l$7.writeUInt64=l$7.writeUint64,l$7.readUint64=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=0,r=0;this.littleEndian?(i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0);var n=new s$6(i,r,!0);return t&&(this.offset+=8),n},l$7.readUInt64=l$7.readUint64),l$7.writeFloat32=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=4,m$6(this.view,e,t,this.littleEndian,23,4),i&&(this.offset+=4),this},l$7.writeFloat=l$7.writeFloat32,l$7.readFloat32=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=E$4(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),i},l$7.readFloat=l$7.readFloat32,l$7.writeFloat64=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var r=this.buffer.byteLength;return t>r&&this.resize((r*=2)>t?r:t),t-=8,m$6(this.view,e,t,this.littleEndian,52,8),i&&(this.offset+=8),this},l$7.writeDouble=l$7.writeFloat64,l$7.readFloat64=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var i=E$4(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),i},l$7.readDouble=l$7.readFloat64,u$5.MAX_VARINT32_BYTES=5,u$5.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},u$5.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},u$5.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},l$7.writeVarint32=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,n=u$5.calculateVarint32(e);t+=n;var o=this.buffer.byteLength;for(t>o&&this.resize((o*=2)>t?o:t),t-=n,e>>>=0;e>=128;)r=127&e|128,this.view[t++]=r,e>>>=7;return this.view[t++]=e,i?(this.offset=t,this):n},l$7.writeVarint32ZigZag=function(e,t){return this.writeVarint32(u$5.zigZagEncode32(e),t)},l$7.readVarint32=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i,r=0,n=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}i=this.view[e++],r<5&&(n|=(127&i)<<7*r),++r}while(0!=(128&i));return n|=0,t?(this.offset=e,n):{value:n,length:r}},l$7.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"==typeof t?t.value=u$5.zigZagDecode32(t.value):t=u$5.zigZagDecode32(t),t},s$6&&(u$5.MAX_VARINT64_BYTES=10,u$5.calculateVarint64=function(e){"number"==typeof e?e=s$6.fromNumber(e):"string"==typeof e&&(e=s$6.fromString(e));var t=e.toInt()>>>0,i=e.shiftRightUnsigned(28).toInt()>>>0,r=e.shiftRightUnsigned(56).toInt()>>>0;return 0==r?0==i?t<16384?t<128?1:2:t<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:r<128?9:10},u$5.zigZagEncode64=function(e){return"number"==typeof e?e=s$6.fromNumber(e,!1):"string"==typeof e?e=s$6.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},u$5.zigZagDecode64=function(e){return"number"==typeof e?e=s$6.fromNumber(e,!1):"string"==typeof e?e=s$6.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(s$6.ONE).toSigned().negate()).toSigned()},l$7.writeVarint64=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"==typeof e)e=s$6.fromNumber(e);else if("string"==typeof e)e=s$6.fromString(e);else if(!(e&&e instanceof s$6))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=s$6.fromNumber(e,!1):"string"==typeof e?e=s$6.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned());var r=u$5.calculateVarint64(e),n=e.toInt()>>>0,o=e.shiftRightUnsigned(28).toInt()>>>0,a=e.shiftRightUnsigned(56).toInt()>>>0;t+=r;var s=this.buffer.byteLength;switch(t>s&&this.resize((s*=2)>t?s:t),t-=r,r){case 10:this.view[t+9]=a>>>7&1;case 9:this.view[t+8]=9!==r?128|a:127&a;case 8:this.view[t+7]=8!==r?o>>>21|128:o>>>21&127;case 7:this.view[t+6]=7!==r?o>>>14|128:o>>>14&127;case 6:this.view[t+5]=6!==r?o>>>7|128:o>>>7&127;case 5:this.view[t+4]=5!==r?128|o:127&o;case 4:this.view[t+3]=4!==r?n>>>21|128:n>>>21&127;case 3:this.view[t+2]=3!==r?n>>>14|128:n>>>14&127;case 2:this.view[t+1]=2!==r?n>>>7|128:n>>>7&127;case 1:this.view[t]=1!==r?128|n:127&n}return i?(this.offset+=r,this):r},l$7.writeVarint64ZigZag=function(e,t){return this.writeVarint64(u$5.zigZagEncode64(e),t)},l$7.readVarint64=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,r=0,n=0,o=0,a=0;if(r=127&(a=this.view[e++]),128&a&&(r|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&typeof a>"u")&&(r|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&typeof a>"u")&&(r|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&typeof a>"u")&&(n=127&(a=this.view[e++]),(128&a||this.noAssert&&typeof a>"u")&&(n|=(127&(a=this.view[e++]))<<7,(128&a||this.noAssert&&typeof a>"u")&&(n|=(127&(a=this.view[e++]))<<14,(128&a||this.noAssert&&typeof a>"u")&&(n|=(127&(a=this.view[e++]))<<21,(128&a||this.noAssert&&typeof a>"u")&&(o=127&(a=this.view[e++]),(128&a||this.noAssert&&typeof a>"u")&&(o|=(127&(a=this.view[e++]))<<7,128&a||this.noAssert&&typeof a>"u"))))))))))throw Error("Buffer overrun");var s=s$6.fromBits(r|n<<28,n>>>4|o<<24,!1);return t?(this.offset=e,s):{value:s,length:e-i}},l$7.readVarint64ZigZag=function(e){var t=this.readVarint64(e);return t&&t.value instanceof s$6?t.value=u$5.zigZagDecode64(t.value):t=u$5.zigZagDecode64(t),t}),l$7.writeCString=function(e,t){var i=typeof t>"u";i&&(t=this.offset);var r,n=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;r<n;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}n=b$7.calculateUTF16asUTF8(c$6(e))[1],t+=n+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=n+1,b$7.encodeUTF16toUTF8(c$6(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,i?(this.offset=t,this):n},l$7.readCString=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i,r=e,n=-1;return b$7.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(n=this.view[e++])?null:n}.bind(this),i=d$9(),!0),t?(this.offset=e,i()):{string:i(),length:e-r}},l$7.writeIString=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,n=t;r=b$7.calculateUTF16asUTF8(c$6(e),this.noAssert)[1],t+=4+r;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+r,this.littleEndian?(this.view[t+3]=r>>>24&255,this.view[t+2]=r>>>16&255,this.view[t+1]=r>>>8&255,this.view[t]=255&r):(this.view[t]=r>>>24&255,this.view[t+1]=r>>>16&255,this.view[t+2]=r>>>8&255,this.view[t+3]=255&r),t+=4,b$7.encodeUTF16toUTF8(c$6(e),function(e){this.view[t++]=e}.bind(this)),t!==n+4+r)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+r));return i?(this.offset=t,this):t-n},l$7.readIString=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=e,r=this.readUint32(e),n=this.readUTF8String(r,u$5.METRICS_BYTES,e+=4);return e+=n.length,t?(this.offset=e,n.string):{string:n.string,length:e-i}},u$5.METRICS_CHARS="c",u$5.METRICS_BYTES="b",l$7.writeUTF8String=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,n=t;r=b$7.calculateUTF16asUTF8(c$6(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,b$7.encodeUTF16toUTF8(c$6(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-n},l$7.writeString=l$7.writeUTF8String,u$5.calculateUTF8Chars=function(e){return b$7.calculateUTF16asUTF8(c$6(e))[0]},u$5.calculateUTF8Bytes=function(e){return b$7.calculateUTF16asUTF8(c$6(e))[1]},u$5.calculateString=u$5.calculateUTF8Bytes,l$7.readUTF8String=function(e,t,i){"number"==typeof t&&(i=t,t=void 0);var r=typeof i>"u";if(r&&(i=this.offset),typeof t>"u"&&(t=u$5.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var n,o=0,a=i;if(t===u$5.METRICS_CHARS){if(n=d$9(),b$7.decodeUTF8(function(){return o<e&&i<this.limit?this.view[i++]:null}.bind(this),(function(e){++o,b$7.UTF8toUTF16(e,n)})),o!==e)throw RangeError("Illegal range: Truncated data, "+o+" == "+e);return r?(this.offset=i,n()):{string:n(),length:i-a}}if(t===u$5.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+e+") <= "+this.buffer.byteLength)}var s=i+e;if(b$7.decodeUTF8toUTF16(function(){return i<s?this.view[i++]:null}.bind(this),n=d$9(),this.noAssert),i!==s)throw RangeError("Illegal range: Truncated data, "+i+" == "+s);return r?(this.offset=i,n()):{string:n(),length:i-a}}throw TypeError("Unsupported metrics: "+t)},l$7.readString=l$7.readUTF8String,l$7.writeVString=function(e,t){var i=typeof t>"u";if(i&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var r,n,o=t;r=b$7.calculateUTF16asUTF8(c$6(e),this.noAssert)[1],n=u$5.calculateVarint32(r),t+=n+r;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=n+r,t+=this.writeVarint32(r,t),b$7.encodeUTF16toUTF8(c$6(e),function(e){this.view[t++]=e}.bind(this)),t!==o+r+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+r+n));return i?(this.offset=t,this):t-o},l$7.readVString=function(e){var t=typeof e>"u";if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,r=this.readVarint32(e),n=this.readUTF8String(r.value,u$5.METRICS_BYTES,e+=r.length);return e+=n.length,t?(this.offset=e,n.string):{string:n.string,length:e-i}},l$7.append=function(e,t,i){("number"==typeof t||"string"!=typeof t)&&(i=t,t=void 0);var r=typeof i>"u";if(r&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof u$5||(e=u$5.wrap(e,t));var n=e.limit-e.offset;if(n<=0)return this;i+=n;var o=this.buffer.byteLength;return i>o&&this.resize((o*=2)>i?o:i),i-=n,this.view.set(e.view.subarray(e.offset,e.limit),i),e.offset+=n,r&&(this.offset+=n),this},l$7.appendTo=function(e,t){return e.append(this,t),this},l$7.assert=function(e){return this.noAssert=!e,this},l$7.capacity=function(){return this.buffer.byteLength},l$7.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},l$7.clone=function(e){var t=new u$5(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},l$7.compact=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var i=t-e;if(0===i)return this.buffer=x$4,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(i),n=new Uint8Array(r);return n.set(this.view.subarray(e,t)),this.buffer=r,this.view=n,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=i,this},l$7.copy=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new u$5(0,this.littleEndian,this.noAssert);var i=t-e,r=new u$5(i,this.littleEndian,this.noAssert);return r.offset=0,r.limit=i,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},l$7.copyTo=function(e,t,i,r){var n,o;if(!this.noAssert&&!u$5.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(o=typeof t>"u")?e.offset:0|t,i=(n=typeof i>"u")?this.offset:0|i,r=typeof r>"u"?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(i<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=r-i;return 0===a?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(i,r),t),n&&(this.offset+=a),o&&(e.offset+=a),this)},l$7.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},l$7.fill=function(e,t,i){var r=typeof t>"u";if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),typeof t>"u"&&(t=this.offset),typeof i>"u"&&(i=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal end: Not an integer");if(i>>>=0,t<0||t>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+i+" <= "+this.buffer.byteLength)}if(t>=i)return this;for(;t<i;)this.view[t++]=e;return r&&(this.offset=t),this},l$7.flip=function(){return this.limit=this.offset,this.offset=0,this},l$7.mark=function(e){if(e=typeof e>"u"?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},l$7.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},l$7.LE=function(e){return this.littleEndian=!(typeof e<"u")||!!e,this},l$7.BE=function(e){return this.littleEndian=typeof e<"u"&&!e,this},l$7.prepend=function(e,t,i){("number"==typeof t||"string"!=typeof t)&&(i=t,t=void 0);var r=typeof i>"u";if(r&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof u$5||(e=u$5.wrap(e,t));var n=e.limit-e.offset;if(n<=0)return this;var o=n-i;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),s=new Uint8Array(a);s.set(this.view.subarray(i,this.buffer.byteLength),n),this.buffer=a,this.view=s,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,i+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),i-n),e.offset=e.limit,r&&(this.offset-=n),this},l$7.prependTo=function(e,t){return e.prepend(this,t),this},l$7.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},l$7.remaining=function(){return this.limit-this.offset},l$7.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},l$7.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),i=new Uint8Array(t);i.set(this.view),this.buffer=t,this.view=i}return this},l$7.reverse=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},l$7.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},l$7.slice=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var i=this.clone();return i.offset=e,i.limit=t,i},l$7.toBuffer=function(e){var t=this.offset,i=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal limit: Not an integer");if(i>>>=0,t<0||t>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+i+" <= "+this.buffer.byteLength)}if(!e&&0===t&&i===this.buffer.byteLength)return this.buffer;if(t===i)return x$4;var r=new ArrayBuffer(i-t);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(t,i),0),r},l$7.toArrayBuffer=l$7.toBuffer,l$7.toString=function(e,t,i){if(typeof e>"u")return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(i=t=e="utf8"),e){case"utf8":return this.toUTF8(t,i);case"base64":return this.toBase64(t,i);case"hex":return this.toHex(t,i);case"binary":return this.toBinary(t,i);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var T$2=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[],r=0,n=t.length;r<n;++r)i[t[r]]=r;return e.encode=function(e,i){for(var r,n;null!==(r=e());)i(t[r>>2&63]),n=(3&r)<<4,null!==(r=e())?(i(t[63&((n|=r>>4&15)|r>>4&15)]),n=(15&r)<<2,null!==(r=e())?(i(t[63&(n|r>>6&3)]),i(t[63&r])):(i(t[63&n]),i(61))):(i(t[63&n]),i(61),i(61))},e.decode=function(e,t){var r,n,o;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(r=e());)if(typeof(n=i[r])>"u"&&a(r),null!==(r=e())&&(typeof(o=i[r])>"u"&&a(r),t(n<<2>>>0|(48&o)>>4),null!==(r=e()))){if(typeof(n=i[r])>"u"){if(61===r)break;a(r)}if(t((15&o)<<4>>>0|(60&n)>>2),null!==(r=e())){if(typeof(o=i[r])>"u"){if(61===r)break;a(r)}t((3&n)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();l$7.toBase64=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var i;return T$2.encode(function(){return e<t?this.view[e++]:null}.bind(this),i=d$9()),i()},u$5.fromBase64=function(e,t){if("string"!=typeof e)throw TypeError("str");var i=new u$5(e.length/4*3,t),r=0;return T$2.decode(c$6(e),(function(e){i.view[r++]=e})),i.limit=r,i},u$5.btoa=function(e){return u$5.fromBinary(e).toBase64()},u$5.atob=function(e){return u$5.fromBase64(e).toBinary()},l$7.toBinary=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var i=[],r=[];e<t;)i.push(this.view[e++]),i.length>=1024&&(r.push(String.fromCharCode.apply(String,i)),i=[]);return r.join("")+String.fromCharCode.apply(String,i)},u$5.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var i,r=0,n=e.length,o=new u$5(n,t);r<n;){if((i=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+i);o.view[r++]=i}return o.limit=n,o},l$7.toDebug=function(e){for(var t,i=-1,r=this.buffer.byteLength,n="",o="",a="";i<r;){if(-1!==i&&(n+=(t=this.view[i])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++i,e&&i>0&&i%16==0&&i!==r){for(;n.length<51;)n+=" ";a+=n+o+"\n",n=o=""}i===this.offset&&i===this.limit?n+=i===this.markedOffset?"!":"|":i===this.offset?n+=i===this.markedOffset?"[":"<":i===this.limit?n+=i===this.markedOffset?"]":">":n+=i===this.markedOffset?"'":e||0!==i&&i!==r?" ":""}if(e&&" "!==n){for(;n.length<51;)n+=" ";a+=n+o+"\n"}return e?a:n},u$5.fromDebug=function(e,t,i){for(var r,n,o=e.length,a=new u$5((o+1)/3|0,t,i),s=0,l=0,u=!1,c=!1,h=!1,d=!1,f=!1;s<o;){switch(r=e.charAt(s++)){case"!":if(!i){if(c||h||d){f=!0;break}c=h=d=!0}a.offset=a.markedOffset=a.limit=l,u=!1;break;case"|":if(!i){if(c||d){f=!0;break}c=d=!0}a.offset=a.limit=l,u=!1;break;case"[":if(!i){if(c||h){f=!0;break}c=h=!0}a.offset=a.markedOffset=l,u=!1;break;case"<":if(!i){if(c){f=!0;break}c=!0}a.offset=l,u=!1;break;case"]":if(!i){if(d||h){f=!0;break}d=h=!0}a.limit=a.markedOffset=l,u=!1;break;case">":if(!i){if(d){f=!0;break}d=!0}a.limit=l,u=!1;break;case"'":if(!i){if(h){f=!0;break}h=!0}a.markedOffset=l,u=!1;break;case" ":u=!1;break;default:if(!i&&u){f=!0;break}if(n=parseInt(r+e.charAt(s++),16),!i&&(isNaN(n)||n<0||n>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[l++]=n,u=!0}if(f)throw TypeError("Illegal str: Invalid symbol at "+s)}if(!i){if(!c||!d)throw TypeError("Illegal str: Missing offset or limit");if(l<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+o)}return a},l$7.toHex=function(e,t){if(e=typeof e>"u"?this.offset:e,t=typeof t>"u"?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var i,r=new Array(t-e);e<t;)(i=this.view[e++])<16?r.push("0",i.toString(16)):r.push(i.toString(16));return r.join("")},u$5.fromHex=function(e,t,i){if(!i){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,n=e.length,o=new u$5(n/2|0,t),a=0,s=0;a<n;a+=2){if(r=parseInt(e.substring(a,a+2),16),!i&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[s++]=r}return o.limit=s,o};var b$7=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var i=null;for("number"==typeof e&&(i=e,e=function(){return null});null!==i||null!==(i=e());)i<128?t(127&i):i<2048?(t(i>>6&31|192),t(63&i|128)):i<65536?(t(i>>12&15|224),t(i>>6&63|128),t(63&i|128)):(t(i>>18&7|240),t(i>>12&63|128),t(i>>6&63|128),t(63&i|128)),i=null},decodeUTF8:function(e,t){for(var i,r,n,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(i=e());)if(0==(128&i))t(i);else if(192==(224&i))null===(r=e())&&a([i,r]),t((31&i)<<6|63&r);else if(224==(240&i))(null===(r=e())||null===(n=e()))&&a([i,r,n]),t((15&i)<<12|(63&r)<<6|63&n);else{if(240!=(248&i))throw RangeError("Illegal starting byte: "+i);(null===(r=e())||null===(n=e())||null===(o=e()))&&a([i,r,n,o]),t((7&i)<<18|(63&r)<<12|(63&n)<<6|63&o)}},UTF16toUTF8:function(e,t){for(var i,r=null;null!==(i=null!==r?r:e());)i>=55296&&i<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(i-55296)+r-56320+65536),r=null):t(i);null!==r&&t(r)},UTF8toUTF16:function(e,t){var i=null;for("number"==typeof e&&(i=e,e=function(){return null});null!==i||null!==(i=e());)i<=65535?t(i):(t(55296+((i-=65536)>>10)),t(i%1024+56320)),i=null},encodeUTF16toUTF8:function(t,i){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,i)}))},decodeUTF8toUTF16:function(t,i){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,i)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,i=0;null!==(t=e());)i+=t<128?1:t<2048?2:t<65536?3:4;return i},calculateUTF16asUTF8:function(t){var i=0,r=0;return e.UTF16toUTF8(t,(function(e){++i,r+=e<128?1:e<2048?2:e<65536?3:4})),[i,r]}};return e}();l$7.toUTF8=function(e,t){if(typeof e>"u"&&(e=this.offset),typeof t>"u"&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var i;try{b$7.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),i=d$9())}catch{if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return i()},u$5.fromUTF8=function(e,t,i){if(!i&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var r=new u$5(b$7.calculateUTF16asUTF8(c$6(e),!0)[1],t,i),n=0;return b$7.encodeUTF16toUTF8(c$6(e),(function(e){r.view[n++]=e})),r.limit=n,r};var f$8={};function h$3(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this.proxy=e.proxy,this.viewer=e.viewer,this.url=e.url,this.metadata=u$Y(e.metadata,{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20}),this.roadMetadata=e.roadMetadata,this.roadUrl=e.roadUrl,this.labelGraphics=e.labelGraphics?e.labelGraphics:{},this.billboardGraphics=e.billboardGraphics?e.billboardGraphics:{},this.aotuCollide=u$Y(e.aotuCollide,!0),this.collisionPadding=e.collisionPadding?e.collisionPadding:[3,5,3,5],this.subdomains=e.subdomains,Array.isArray(this.subdomains)?this.subdomains=this.subdomains.slice():e$28(this.subdomains)&&0<this.subdomains.length?this.subdomains=this.subdomains.split(""):this.subdomains=["t0","t1","t2","t3","t4","t5","t6","t7"],this.token=e.token,this.depthTestOptimization=u$Y(e.depthTestOptimization,!1),this.dTOElevation=u$Y(e.dTOElevation,2e4),this.dTOPitch=u$Y(e.dTOPitch,-1.22),this.tileCache=[],this.labelCache=[],this._isInitial=!1,this._latelyGrid=[],this._latelyRefreshStamp=0,this._latelyCollisionStamp=0;var t=e$1K();this._UUID="TDT_WTFS_LABEL_"+t,this._UUIDRoad="TDT_WTFS_LABEL_ROAD_"+t,this._isDTP=!1,this.viewer.camera.percentageChanged=.18,this.bindEvent()}function G$2(e,t){return t.minX>=e.minX&&t.minX<=e.maxX&&t.minY>=e.minY&&t.minY<=e.maxY||t.maxX>=e.minX&&t.maxX<=e.maxX&&t.maxY>=e.minY&&t.maxY<=e.maxY||t.minX>=e.minX&&t.minX<=e.maxX&&t.maxY>=e.minY&&t.maxY<=e.maxY||t.maxX>=e.minX&&t.maxX<=e.maxX&&t.minY>=e.minY&&t.minY<=e.maxY}function A$5(e){return e.coord.x}function N$1(e){return e.coord.y}function F$3(e){return{x:e.anno.collisionBox.x,y:e.anno.collisionBox.y,width:e.anno.collisionBox.width,height:e.anno.collisionBox.height}}function M$2(e,t,i,r,n,o,a,s){a.anno;var l=s,u={x:i,y:r,width:n-i,height:o-r},c=l.x,h=l.y,d=u.x,f=u.y;return!(c>d+u.width||c+l.width<d||h+l.height<f||h>f+u.height)}f$8.ByteBuffer=u$5,f$8.Long=u$5.Long||null,f$8.VERSION="5.0.3",f$8.WIRE_TYPES={},f$8.WIRE_TYPES.VARINT=0,f$8.WIRE_TYPES.BITS64=1,f$8.WIRE_TYPES.LDELIM=2,f$8.WIRE_TYPES.STARTGROUP=3,f$8.WIRE_TYPES.ENDGROUP=4,f$8.WIRE_TYPES.BITS32=5,f$8.PACKABLE_WIRE_TYPES=[f$8.WIRE_TYPES.VARINT,f$8.WIRE_TYPES.BITS64,f$8.WIRE_TYPES.BITS32],f$8.TYPES={int32:{name:"int32",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:f$8.Long?f$8.Long.ZERO:void 0},uint64:{name:"uint64",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:f$8.Long?f$8.Long.UZERO:void 0},sint64:{name:"sint64",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:f$8.Long?f$8.Long.ZERO:void 0},bool:{name:"bool",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:f$8.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:f$8.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:f$8.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:f$8.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:f$8.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:f$8.WIRE_TYPES.BITS64,defaultValue:f$8.Long?f$8.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:f$8.WIRE_TYPES.BITS64,defaultValue:f$8.Long?f$8.Long.ZERO:void 0},float:{name:"float",wireType:f$8.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:f$8.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:f$8.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:f$8.WIRE_TYPES.STARTGROUP,defaultValue:null}},f$8.MAP_KEY_TYPES=[f$8.TYPES.int32,f$8.TYPES.sint32,f$8.TYPES.sfixed32,f$8.TYPES.uint32,f$8.TYPES.fixed32,f$8.TYPES.int64,f$8.TYPES.sint64,f$8.TYPES.sfixed64,f$8.TYPES.uint64,f$8.TYPES.fixed64,f$8.TYPES.bool,f$8.TYPES.string,f$8.TYPES.bytes],f$8.ID_MIN=1,f$8.ID_MAX=536870911,f$8.convertFieldsToCamelCase=!1,f$8.populateAccessors=!0,f$8.populateDefaults=!0,f$8.Util=function(){var e={};return e.IS_NODE="object"==typeof process&&process+""=="[object process]"&&!process.browser,e.XHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=null,i=0;i<e.length;i++){try{t=e[i]()}catch{continue}break}if(!t)throw Error("XMLHttpRequest is not supported");return t},e.fetch=function(t,i){if(i&&"function"!=typeof i&&(i=null),e.IS_NODE){var r=require("fs");if(i)r.readFile(t,(function(e,t){i(e?null:""+t)}));else try{return r.readFileSync(t)}catch{return null}}else{var n=e.XHR();if(n.open("GET",t,!!i),n.setRequestHeader("Accept","text/plain"),"function"==typeof n.overrideMimeType&&n.overrideMimeType("text/plain"),!i)return n.send(null),200==n.status||0==n.status&&"string"==typeof n.responseText?n.responseText:null;if(n.onreadystatechange=function(){4==n.readyState&&(200==n.status||0==n.status&&"string"==typeof n.responseText?i(n.responseText):i(null))},4==n.readyState)return;n.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),f$8.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},f$8.DotProto=function(e,t){var i={},r=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},n=r.prototype;n._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var i=e.exec(this.source);if(!i)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,i[1]},n.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,i,r;do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;i=r,r=this.source.charAt(this.index)}while("*"!==i||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var n=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(n++)))for(;n<this.source.length&&!t.DELIM.test(this.source.charAt(n));)++n;var o=this.source.substring(this.index,this.index=n);return('"'===o||"'"===o)&&(this._stringOpen=o),o},n.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},n.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},n.omit=function(e){return this.peek()===e&&(this.next(),!0)},n.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},i.Tokenizer=r;var o=function(e){this.tn=new r(e),this.proto3=!1},a=o.prototype;function s(e,i){var r=-1,n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(n<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=n*r|0,!i&&r<0)throw Error("illegal id value: "+(n<0?"-":"")+e);return r}function l(e){var i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return i*parseInt(e,10);if(t.NUMBER_HEX.test(e))return i*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return i*parseInt(e.substring(1),8);if("inf"===e)return i*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return i*parseFloat(e);throw Error("illegal number value: "+(i<0?"-":"")+e)}function u(e,t,i){typeof e[t]>"u"?e[t]=i:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(i))}return a.parse=function(){var e,i,r={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},n=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!n||null!==r.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),r.package=e;break;case"import":if(!n)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(i="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),i||r.imports.push(e);break;case"syntax":if(!n)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(r.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(r,null),n=!1;break;case"enum":this._parseEnum(r),n=!1;break;case"option":this._parseOption(r);break;case"service":this._parseService(r);break;case"extend":this._parseExtend(r);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete r.name,r},o.parse=function(e){return new o(e).parse()},a._readString=function(){var e,t,i="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);i+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return i},a._readValue=function(e){var i=this.tn.peek();if('"'===i||"'"===i)return this._readString();if(this.tn.next(),t.NUMBER.test(i))return l(i);if(t.BOOL.test(i))return"true"===i.toLowerCase();if(e&&t.TYPEREF.test(i))return i;throw Error("illegal value: "+i)},a._parseOption=function(e,i){var r=this.tn.next(),n=!1;if("("===r&&(n=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal option name: "+r);var o=r;n&&(this.tn.skip(")"),o="("+o+")",r=this.tn.peek(),t.FQTYPEREF.test(r)&&(o+=r,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),i||this.tn.skip(";")},a._parseOptionValue=function(e,i){var r=this.tn.peek();if("{"!==r)u(e.options,i,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+i+"."+r);this.tn.omit(":")?u(e.options,i+"."+r,this._readValue(!0)):this._parseOptionValue(e,i+"."+r)}},a._parseService=function(e){var i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal service name at line "+this.tn.line+": "+i);var r={name:i,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(r);else{if("rpc"!==i)throw Error("illegal service token: "+i);this._parseServiceRPC(r)}this.tn.omit(";"),e.services.push(r)},a._parseServiceRPC=function(e){var i="rpc",r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal rpc service method name: "+r);var n=r,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.request_stream=!0,r=this.tn.next()),!t.TYPEREF.test(r))throw Error("illegal rpc service request type: "+r);if(o.request=r,this.tn.skip(")"),"returns"!==(r=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+r);if(this.tn.skip("("),"stream"===(r=this.tn.next()).toLowerCase()&&(o.response_stream=!0,r=this.tn.next()),o.response=r,this.tn.skip(")"),"{"===(r=this.tn.peek())){for(this.tn.next();"}"!==(r=this.tn.next());){if("option"!==r)throw Error("illegal rpc service token: "+r);this._parseOption(o)}this.tn.omit(";")}else this.tn.skip(";");typeof e[i]>"u"&&(e[i]={}),e[i][n]=o},a._parseMessage=function(e,i){var r=!!i,n=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(n))throw Error("illegal "+(r?"group":"message")+" name: "+n);for(o.name=n,r&&(this.tn.skip("="),i.id=s(this.tn.next()),o.isGroup=!0),"["===(n=this.tn.peek())&&i&&this._parseFieldOptions(i),this.tn.skip("{");"}"!==(n=this.tn.next());)if(t.RULE.test(n))this._parseMessageField(o,n);else if("oneof"===n)this._parseMessageOneOf(o);else if("enum"===n)this._parseEnum(o);else if("message"===n)this._parseMessage(o);else if("option"===n)this._parseOption(o);else if("service"===n)this._parseService(o);else if("extensions"===n)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===n)this._parseIgnored();else if("extend"===n)this._parseExtend(o);else{if(!t.TYPEREF.test(n))throw Error("illegal message token: "+n);if(!this.proto3)throw Error("illegal field rule: "+n);this._parseMessageField(o,"optional",n)}return this.tn.omit(";"),e.messages.push(o),o},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,i,r){if(!t.RULE.test(i))throw Error("illegal message field rule: "+i);var n,o={rule:i,type:"",name:"",options:{},id:0};if("map"===i){if(r)throw Error("illegal type: "+r);if(this.tn.skip("<"),n=this.tn.next(),!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(o.keytype=n,this.tn.skip(","),n=this.tn.next(),!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field: "+n);if(o.type=n,this.tn.skip(">"),n=this.tn.next(),!t.NAME.test(n))throw Error("illegal message field name: "+n);o.name=n,this.tn.skip("="),o.id=s(this.tn.next()),"["===(n=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(r=typeof r<"u"?r:this.tn.next())){var a=this._parseMessage(e,o);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(r)&&!t.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(o.type=r,n=this.tn.next(),!t.NAME.test(n))throw Error("illegal message field name: "+n);o.name=n,this.tn.skip("="),o.id=s(this.tn.next()),"["===(n=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},a._parseMessageOneOf=function(e){var i=this.tn.next();if(!t.NAME.test(i))throw Error("illegal oneof name: "+i);var r,n=i,o=[];for(this.tn.skip("{");"}"!==(i=this.tn.next());)(r=this._parseMessageField(e,"optional",i)).oneof=n,o.push(r.id);this.tn.omit(";"),e.oneofs[n]=o},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var i={name:"",values:[],options:{}},r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal name: "+r);for(i.name=r,this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(i);else{if(!t.NAME.test(r))throw Error("illegal name: "+r);this.tn.skip("=");var n={name:r,id:s(this.tn.next(),!0)};"["===(r=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(n)}this.tn.omit(";"),e.enums.push(i)},a._parseExtensionRanges=function(){var t,i,r,n=[];do{for(i=[];;){switch(t=this.tn.next()){case"min":r=e.ID_MIN;break;case"max":r=e.ID_MAX;break;default:r=l(t)}if(i.push(r),2===i.length)break;if("to"!==this.tn.peek()){i.push(r);break}this.tn.next()}n.push(i)}while(this.tn.omit(","));return this.tn.skip(";"),n},a._parseExtend=function(e){var i=this.tn.next();if(!t.TYPEREF.test(i))throw Error("illegal extend reference: "+i);var r={ref:i,fields:[]};for(this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(r,i);else{if(!t.TYPEREF.test(i))throw Error("illegal extend token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(r,"optional",i)}return this.tn.omit(";"),e.messages.push(r),r},a.toString=function(){return"Parser at line "+this.tn.line},i.Parser=o,i}(f$8,f$8.Lang),f$8.Reflect=function(e){var t={},i=function(e,t,i){this.builder=e,this.parent=t,this.name=i,this.className},r=i.prototype;r.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},r.toString=function(e){return(e?this.className+" ":"")+this.fqn()},r.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=i;var n=function(e,t,r,n,o){i.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=n||{},this.syntax=o||"proto2"},o=n.prototype=Object.create(i.prototype);o.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],i=0,r=this.children.length;i<r;++i)this.children[i]instanceof e&&t.push(this.children[i]);return t},o.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof u.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof u.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},o.getChild=function(e){for(var t="number"==typeof e?"id":"name",i=0,r=this.children.length;i<r;++i)if(this.children[i][t]===e)return this.children[i];return null},o.resolve=function(e,i){var r,n="string"==typeof e?e.split("."):e,o=this,a=0;if(""===n[a]){for(;null!==o.parent;)o=o.parent;a++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(r=o.getChild(n[a]))||!(r instanceof t.T)||i&&!(r instanceof t.Namespace)){o=null;break}o=r,a++}while(a<n.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,i)}while(null!=o);return o},o.qn=function(e){var i=[],r=e;do{i.unshift(r.name),r=r.parent}while(null!==r);for(var n=1;n<=i.length;n++){var o=i.slice(i.length-n);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},o.build=function(){for(var e,t={},i=this.children,r=0,o=i.length;r<o;++r)(e=i[r])instanceof n&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},o.buildOpt=function(){for(var e={},t=Object.keys(this.options),i=0,r=t.length;i<r;++i){var n=t[i],o=this.options[t[i]];e[n]=o}return e},o.getOption=function(e){return typeof e>"u"?this.options:typeof this.options[e]<"u"?this.options[e]:null},t.Namespace=n;var a=function(t,i,r,n,o){if(this.type=t,this.resolvedType=i,this.isMapKey=r,this.syntax=n,this.name=o,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},s=a.prototype;function l(t,i){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,typeof i>"u"?t.unsigned:i);if("string"==typeof t)return e.Long.fromString(t,i||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,i||!1);throw Error("not convertible to Long")}a.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),typeof t.defaultValue>"u")throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new u$5(0):t.defaultValue},s.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},s.verifyValue=function(t){var i=this;function r(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&r(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){r(typeof t,e.message)}else r(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){r(typeof t,e.message)}else r(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&r(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&r(typeof t,"not a number"),t;case e.TYPES.string:return"string"!=typeof t&&!(t&&t instanceof String)&&r(typeof t,"not a string"),""+t;case e.TYPES.bytes:return u$5.isByteBuffer(t)?t:u$5.wrap(t,"base64");case e.TYPES.enum:var n=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(a=0;a<n.length;a++){if(n[a].name==t)return n[a].id;if(n[a].id==t)return n[a].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&r(typeof t,"not an integer"),(t>4294967295||t<0)&&r(typeof t,"not in range for uint32"),t;r(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if((!t||"object"!=typeof t)&&r(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var o={};for(var a in t)t.hasOwnProperty(a)&&(o[a]=t[a]);t=o}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},s.calculateLength=function(t,i){if(null===i)return 0;var r;switch(this.type){case e.TYPES.int32:return i<0?u$5.calculateVarint64(i):u$5.calculateVarint32(i);case e.TYPES.uint32:return u$5.calculateVarint32(i);case e.TYPES.sint32:return u$5.calculateVarint32(u$5.zigZagEncode32(i));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return u$5.calculateVarint64(i);case e.TYPES.sint64:return u$5.calculateVarint64(u$5.zigZagEncode64(i));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return u$5.calculateVarint32(i);case e.TYPES.double:return 8;case e.TYPES.string:return r=u$5.calculateUTF8Bytes(i),u$5.calculateVarint32(r)+r;case e.TYPES.bytes:if(i.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+i.remaining()+" bytes remaining");return u$5.calculateVarint32(i.remaining())+i.remaining();case e.TYPES.message:return r=this.resolvedType.calculate(i),u$5.calculateVarint32(r)+r;case e.TYPES.group:return(r=this.resolvedType.calculate(i))+u$5.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+i+" (unknown type)")},s.encodeValue=function(t,i,r){if(null===i)return r;switch(this.type){case e.TYPES.int32:i<0?r.writeVarint64(i):r.writeVarint32(i);break;case e.TYPES.uint32:r.writeVarint32(i);break;case e.TYPES.sint32:r.writeVarint32ZigZag(i);break;case e.TYPES.fixed32:r.writeUint32(i);break;case e.TYPES.sfixed32:r.writeInt32(i);break;case e.TYPES.int64:case e.TYPES.uint64:r.writeVarint64(i);break;case e.TYPES.sint64:r.writeVarint64ZigZag(i);break;case e.TYPES.fixed64:r.writeUint64(i);break;case e.TYPES.sfixed64:r.writeInt64(i);break;case e.TYPES.bool:"string"==typeof i?r.writeVarint32("false"===i.toLowerCase()?0:!!i):r.writeVarint32(i?1:0);break;case e.TYPES.enum:r.writeVarint32(i);break;case e.TYPES.float:r.writeFloat32(i);break;case e.TYPES.double:r.writeFloat64(i);break;case e.TYPES.string:r.writeVString(i);break;case e.TYPES.bytes:if(i.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+i.remaining()+" bytes remaining");var n=i.offset;r.writeVarint32(i.remaining()),r.append(i),i.offset=n;break;case e.TYPES.message:var o=(new u$5).LE();this.resolvedType.encode(i,o),r.writeVarint32(o.offset),r.append(o.flip());break;case e.TYPES.group:this.resolvedType.encode(i,r),r.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+i+" (unknown type)")}return r},s.decode=function(t,i,r){if(i!=this.type.wireType)throw Error("Unexpected wire type for element");var n,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(n=t.clone()).limit=n.offset+o,t.offset+=o,n;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},s.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return u$5.fromBinary(t)}},s.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},t.Element=a;var u=function(e,t,i,r,o,a){n.call(this,e,t,i,r,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!o,this._fields=null,this._fieldsById=null,this._fieldsByName=null},c=u.prototype=Object.create(n.prototype);function h(t,i){var r=i.readVarint32(),n=7&r,o=r>>>3;switch(n){case e.WIRE_TYPES.VARINT:do{r=i.readUint8()}while(128==(128&r));break;case e.WIRE_TYPES.BITS64:i.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=i.readVarint32(),i.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:h(o,i);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:i.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+n)}return!0}c.build=function(t){if(this.clazz&&!t)return this.clazz;var i=function(e,t){var i=t.getChildren(e.Reflect.Message.Field),r=t.getChildren(e.Reflect.Message.OneOf),n=function(o,a){e.Builder.Message.call(this);for(var s=0,l=r.length;s<l;++s)this[r[s].name]=null;for(s=0,l=i.length;s<l;++s){var u=i[s];this[u.name]=u.repeated?[]:u.map?new e.Map(u):null,(u.required||"proto3"===t.syntax)&&null!==u.defaultValue&&(this[u.name]=u.defaultValue)}var c;if(arguments.length>0)if(1!==arguments.length||null===o||"object"!=typeof o||!("function"!=typeof o.encode||o instanceof n)||Array.isArray(o)||o instanceof e.Map||u$5.isByteBuffer(o)||o instanceof ArrayBuffer||e.Long&&o instanceof e.Long)for(s=0,l=arguments.length;s<l;++s)typeof(c=arguments[s])<"u"&&this.$set(i[s].name,c);else this.$set(o)},o=n.prototype=Object.create(e.Builder.Message.prototype);o.add=function(i,r,n){var o=t._fieldsByName[i];if(!n){if(!o)throw Error(this+"#"+i+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+i+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+i+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[i]&&(this[i]=[]),this[i].push(r),this},o.$add=o.add,o.set=function(i,r,n){if(i&&"object"==typeof i){for(var o in n=r,i)i.hasOwnProperty(o)&&typeof(r=i[o])<"u"&&void 0===t._oneofsByName[o]&&this.$set(o,r,n);return this}var a=t._fieldsByName[i];if(n)this[i]=r;else{if(!a)throw Error(this+"#"+i+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+i+" is not a field: "+a.toString(!0));this[a.name]=r=a.verifyValue(r)}if(a&&a.oneof){var s=this[a.oneof.name];null!==r?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===i&&(this[a.oneof.name]=null)}return this},o.$set=o.set,o.get=function(i,r){if(r)return this[i];var n=t._fieldsByName[i];if(!(n&&n instanceof e.Reflect.Message.Field))throw Error(this+"#"+i+" is not a field: undefined");if(!(n instanceof e.Reflect.Message.Field))throw Error(this+"#"+i+" is not a field: "+n.toString(!0));return this[n.name]},o.$get=o.get;for(var a=0;a<i.length;a++){var s=i[a];s instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var i=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));i=i.substring(0,1).toUpperCase()+i.substring(1);var r=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),n=function(t,i){return this[e.name]=i?t:e.verifyValue(t),this},a=function(){return this[e.name]};null===t.getChild("set"+i)&&(o["set"+i]=n),null===t.getChild("set_"+r)&&(o["set_"+r]=n),null===t.getChild("get"+i)&&(o["get"+i]=a),null===t.getChild("get_"+r)&&(o["get_"+r]=a)}(s)}function l(t,i,r,n){if(null===t||"object"!=typeof t){if(n&&n instanceof e.Reflect.Enum){var o=e.Reflect.Enum.getName(n.object,t);if(null!==o)return o}return t}if(u$5.isByteBuffer(t))return i?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return r?t.toString():e.Long.fromValue(t);var a;if(Array.isArray(t))return a=[],t.forEach((function(e,t){a[t]=l(e,i,r,n)})),a;if(a={},t instanceof e.Map){for(var s=t.entries(),u=s.next();!u.done;u=s.next())a[t.keyElem.valueToString(u.value[0])]=l(u.value[1],i,r,t.valueElem.resolvedType);return a}var c=t.$type,h=void 0;for(var d in t)t.hasOwnProperty(d)&&(c&&(h=c.getChild(d))?a[d]=l(t[d],i,r,h.resolvedType):a[d]=l(t[d],i,r));return a}return o.encode=function(e,i){"boolean"==typeof e&&(i=e,e=void 0);var r=!1;e||(e=new u$5,r=!0);var n=e.littleEndian;try{return t.encode(this,e.LE(),i),(r?e.flip():e).LE(n)}catch(t){throw e.LE(n),t}},n.encode=function(e,t,i){return new n(e).encode(t,i)},o.calculate=function(){return t.calculate(this)},o.encodeDelimited=function(e,i){var r=!1;e||(e=new u$5,r=!0);var n=(new u$5).LE();return t.encode(this,n,i).flip(),e.writeVarint32(n.remaining()),e.append(n),r?e.flip():e},o.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},o.toArrayBuffer=o.encodeAB,o.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},o.toBuffer=o.encodeNB,o.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},o.toBase64=o.encode64,o.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},o.toHex=o.encodeHex,o.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},o.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},n.decode=function(e,i,r){"string"==typeof i&&(r=i,i=-1),"string"==typeof e?e=u$5.wrap(e,r||"base64"):u$5.isByteBuffer(e)||(e=u$5.wrap(e));var n=e.littleEndian;try{var o=t.decode(e.LE(),i);return e.LE(n),o}catch(t){throw e.LE(n),t}},n.decodeDelimited=function(e,i){if("string"==typeof e?e=u$5.wrap(e,i||"base64"):u$5.isByteBuffer(e)||(e=u$5.wrap(e)),e.remaining()<1)return null;var r=e.offset,n=e.readVarint32();if(e.remaining()<n)return e.offset=r,null;try{var o=t.decode(e.slice(e.offset,e.offset+n).LE());return e.offset+=n,o}catch(t){throw e.offset+=n,t}},n.decode64=function(e){return n.decode(e,"base64")},n.decodeHex=function(e){return n.decode(e,"hex")},n.decodeJSON=function(e){return new n(JSON.parse(e))},o.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(n,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),n}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var r,n=0,o=this.children.length;n<o;n++)if((r=this.children[n])instanceof _||r instanceof u||r instanceof g){if(i.hasOwnProperty(r.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+r.toString(!0)+" cannot override static property '"+r.name+"'");i[r.name]=r.build()}else if(r instanceof u.Field)r.build(),this._fields.push(r),this._fieldsById[r.id]=r,this._fieldsByName[r.name]=r;else if(r instanceof u.OneOf)this._oneofsByName[r.name]=r;else if(!(r instanceof u.OneOf||r instanceof $))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[n].toString(!0));return this.clazz=i},c.encode=function(e,t,i){for(var r,n,o=null,a=0,s=this._fields.length;a<s;++a)n=e[(r=this._fields[a]).name],r.required&&null===n?null===o&&(o=r):r.encode(i?n:r.verifyValue(n),t,e);if(null!==o){var l=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw l.encoded=t,l}return t},c.calculate=function(e){for(var t,i,r=0,n=0,o=this._fields.length;n<o;++n){if(i=e[(t=this._fields[n]).name],t.required&&null===i)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(i,e)}return r},c.decode=function(t,i,r){"number"!=typeof i&&(i=-1);for(var n,o,a,s,l=t.offset,u=new this.clazz;t.offset<l+i||-1===i&&t.remaining()>0;){if(a=(n=t.readVarint32())>>>3,(o=7&n)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(s=this._fieldsById[a]){if(s.repeated&&!s.options.packed)u[s.name].push(s.decode(o,t));else if(s.map){var c=s.decode(o,t);u[s.name].set(c[0],c[1])}else if(u[s.name]=s.decode(o,t),s.oneof){var d=u[s.oneof.name];null!==d&&d!==s.name&&(u[d]=null),u[s.oneof.name]=s.name}}else switch(o){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var f=t.readVarint32();t.offset+=f;break;case e.WIRE_TYPES.STARTGROUP:for(;h(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var p=0,_=this._fields.length;p<_;++p)if(null===u[(s=this._fields[p]).name])if("proto3"===this.syntax)u[s.name]=s.defaultValue;else{if(s.required){var m=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw m.decoded=u,m}e.populateDefaults&&null!==s.defaultValue&&(u[s.name]=s.defaultValue)}return u},t.Message=u;var d=function(t,r,n,o,a,s,l,c,h,d){i.call(this,t,r,s),this.className="Message.Field",this.required="required"===n,this.repeated="repeated"===n,this.map="map"===n,this.keyType=o||null,this.type=a,this.resolvedType=null,this.id=l,this.options=c||{},this.defaultValue=null,this.oneof=h||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,this.builder.options.convertFieldsToCamelCase&&!(this instanceof u.ExtensionField)&&(this.name=e.Util.toCamelCase(this.name))},f=d.prototype=Object.create(i.prototype);f.build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?typeof this.options.default<"u"&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.type)},f.verifyValue=function(t,i){i=i||!1;var r,n=this;function o(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!i){Array.isArray(t)||(t=[t]);var a=[];for(r=0;r<t.length;r++)a.push(this.element.verifyValue(t[r]));return a}return this.map&&!i?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},f.hasWirePresence=function(t,i){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&i[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},f.encode=function(t,i,r){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return i;try{var n;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){i.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i.ensureCapacity(i.offset+=1);var o=i.offset;for(n=0;n<t.length;n++)this.element.encodeValue(this.id,t[n],i);var a=i.offset-o,s=u$5.calculateVarint32(a);if(s>1){var l=i.slice(o,i.offset);o+=s-1,i.offset=o,i.append(l)}i.writeVarint32(a,o-s)}else for(n=0;n<t.length;n++)i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[n],i);else this.map?t.forEach((function(t,r,n){var o=u$5.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+u$5.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i.writeVarint32(o),i.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,r,i),i.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,i)}),this):this.hasWirePresence(t,r)&&(i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,i))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},f.calculate=function(t,i){if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;var r=0;try{var n,o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(r+=u$5.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,n=0;n<t.length;n++)o+=this.element.calculateLength(this.id,t[n]);r+=u$5.calculateVarint32(o),r+=o}else for(n=0;n<t.length;n++)r+=u$5.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,t[n]);else this.map?t.forEach((function(t,i,n){var o=u$5.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+u$5.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);r+=u$5.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r+=u$5.calculateVarint32(o),r+=o}),this):this.hasWirePresence(t,i)&&(r+=u$5.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return r},f.decode=function(t,i,r){var n,o;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){o=i.readVarint32(),o=i.offset+o;for(var s=[];i.offset<o;)s.push(this.decode(this.type.wireType,i,!0));return s}if(this.map){var l=a.defaultFieldValue(this.keyType);if(n=a.defaultFieldValue(this.type),o=i.readVarint32(),i.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+i.remaining());var u=i.clone();for(u.limit=u.offset+o,i.offset+=o;u.remaining()>0;){var c=u.readVarint32();t=7&c;var h=c>>>3;if(1===h)l=this.keyElement.decode(u,t,h);else{if(2!==h)throw Error("Unexpected tag in map field key/value submessage");n=this.element.decode(u,t,h)}}return[l,n]}return this.element.decode(i,t,this.id)},t.Message.Field=d;var p=function(e,t,i,r,n,o,a){d.call(this,e,t,i,null,r,n,o,a),this.extension};p.prototype=Object.create(d.prototype),t.Message.ExtensionField=p;t.Message.OneOf=function(e,t,r){i.call(this,e,t,r),this.fields=[]};var _=function(e,t,i,r,o){n.call(this,e,t,i,r,o),this.className="Enum",this.object=null};_.getName=function(e,t){for(var i,r=Object.keys(e),n=0;n<r.length;++n)if(e[i=r[n]]===t)return i;return null},(_.prototype=Object.create(n.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var i=new e.Builder.Enum,r=this.getChildren(_.Value),n=0,o=r.length;n<o;++n)i[r[n].name]=r[n].id;return Object.defineProperty&&Object.defineProperty(i,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=i},t.Enum=_;var m=function(e,t,r,n){i.call(this,e,t,r),this.className="Enum.Value",this.id=n};m.prototype=Object.create(i.prototype),t.Enum.Value=m;var $=function(e,t,r,n){i.call(this,e,t,r),this.field=n};$.prototype=Object.create(i.prototype),t.Extension=$;var g=function(e,t,i,r){n.call(this,e,t,i,r),this.className="Service",this.clazz=null};(g.prototype=Object.create(n.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,i){setTimeout(i.bind(this,Error("Not implemented")),0)}},r=i.prototype=Object.create(e.Builder.Service.prototype),n=t.getChildren(e.Reflect.Service.RPCMethod),o=0;o<n.length;o++)!function(e){r[e.name]=function(i,r){try{try{i=e.resolvedRequestType.clazz.decode(u$5.wrap(i))}catch(e){if(!(e instanceof TypeError))throw e}if(null===i||"object"!=typeof i)throw Error("Illegal arguments");i instanceof e.resolvedRequestType.clazz||(i=new e.resolvedRequestType.clazz(i)),this.rpcImpl(e.fqn(),i,(function(i,n){if(i)r(i);else{null===n&&(n="");try{n=e.resolvedResponseType.clazz.decode(n)}catch{}n&&n instanceof e.resolvedResponseType.clazz?r(null,n):r(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(r.bind(this,e),0)}},i[e.name]=function(t,r,n){new i(t)[e.name](r,n)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(r[e.name],"$options",{value:i[e.name].$options}))}(n[o]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(r,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(r,"$type",{value:t})),i}(e,this)},t.Service=g;var v=function(e,t,r,n){i.call(this,e,t,r),this.className="Service.Method",this.options=n||{}};(v.prototype=Object.create(i.prototype)).buildOpt=o.buildOpt,t.Service.Method=v;var y=function(e,t,i,r,n,o,a,s){v.call(this,e,t,i,s),this.className="Service.RPCMethod",this.requestName=r,this.responseName=n,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return y.prototype=Object.create(v.prototype),t.Service.RPCMethod=y,t}(f$8),f$8.Builder=function(e,t,i){var r=function(e){this.ns=new i.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},n=r.prototype;function o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return r.isMessage=function(e){return!("string"!=typeof e.name||typeof e.values<"u"||typeof e.rpc<"u")},r.isMessageField=function(e){return!("string"!=typeof e.rule||"string"!=typeof e.name||"string"!=typeof e.type||typeof e.id>"u")},r.isEnum=function(e){return!("string"!=typeof e.name||typeof e.values>"u"||!Array.isArray(e.values)||0===e.values.length)},r.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},r.isExtend=function(e){return"string"==typeof e.ref},n.reset=function(){return this.ptr=this.ns,this},n.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new i.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},n.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var n=[t];n.length>0;){if(t=n.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var o=t.shift();if(r.isMessage(o)){var a=new i.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={};o.oneofs&&Object.keys(o.oneofs).forEach((function(e){a.addChild(s[e]=new i.Message.OneOf(this,a,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate or invalid field id in "+a.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+a.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+a.name+"#"+e.name+": "+e.oneof);e=new i.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),a.addChild(e)}),this);var l=[];if(o.enums&&o.enums.forEach((function(e){l.push(e)})),o.messages&&o.messages.forEach((function(e){l.push(e)})),o.services&&o.services.forEach((function(e){l.push(e)})),o.extensions&&("number"==typeof o.extensions[0]?a.extensions=[o.extensions]:a.extensions=o.extensions),this.ptr.addChild(a),l.length>0){n.push(t),t=l,l=null,this.ptr=a,a=null;continue}l=null}else if(r.isEnum(o))a=new i.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){a.addChild(new i.Enum.Value(this,a,e.name,e.id))}),this),this.ptr.addChild(a);else if(r.isService(o))a=new i.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];a.addChild(new i.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(a);else{if(!r.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate extended field id in "+a.name+": "+t.id);if(a.extensions){var r=!1;if(a.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r)throw Error("illegal extended field id in "+a.name+": "+t.id+" (not within valid ranges)")}var n=t.name;this.options.convertFieldsToCamelCase&&(n=e.Util.toCamelCase(n));var o=new i.Message.ExtensionField(this,a,t.rule,t.type,this.ptr.fqn()+"."+n,t.id,t.options),s=new i.Extension(this,this.ptr,t.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},n.import=function(t,i){var r="/";if("string"==typeof i){if(e.Util.IS_NODE&&(i=require("path").resolve(i)),!0===this.files[i])return this.reset();this.files[i]=!0}else if("object"==typeof i){var n,a=i.root;if(e.Util.IS_NODE&&(a=require("path").resolve(a)),(a.indexOf("\\")>=0||i.file.indexOf("\\")>=0)&&(r="\\"),n=e.Util.IS_NODE?require("path").join(a,i.file):a+r+i.file,!0===this.files[n])return this.reset();this.files[n]=!0}if(t.imports&&t.imports.length>0){var s,l=!1;"object"==typeof i?(this.importRoot=i.root,l=!0,s=this.importRoot,i=i.file,(s.indexOf("\\")>=0||i.indexOf("\\")>=0)&&(r="\\")):"string"==typeof i?this.importRoot?s=this.importRoot:i.indexOf("/")>=0?""===(s=i.replace(/\/[^\/]*$/,""))&&(s="/"):i.indexOf("\\")>=0?(s=i.replace(/\\[^\\]*$/,""),r="\\"):s=".":s=null;for(var u=0;u<t.imports.length;u++)if("string"==typeof t.imports[u]){if(!s)throw Error("cannot determine import root");var c=t.imports[u];if("google/protobuf/descriptor.proto"===c||(c=e.Util.IS_NODE?require("path").join(s,c):s+r+c,!0===this.files[c]))continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var h=e.Util.fetch(c);if(null===h)throw Error("failed to import '"+c+"' in '"+i+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(h+""),c):this.import(e.DotProto.Parser.parse(h),c)}else i?/\.(\w+)$/.test(i)?this.import(t.imports[u],i.replace(/^(.+)\.(\w+)$/,(function(e,t,i){return t+"_import"+u+"."+i}))):this.import(t.imports[u],i+"_import"+u):this.import(t.imports[u]);l&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&o(t);var d=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},n.resolveAll=function(){var r;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof i.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof i.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof i.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof i.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof i.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},n.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,i=this.result,r=0;r<t.length;r++){if(!i[t[r]]){i=null;break}i=i[t[r]]}return i},n.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},n.toString=function(){return"Builder"},r.Message=function(){},r.Enum=function(){},r.Service=function(){},r}(f$8,f$8.Lang,f$8.Reflect),f$8.Map=function(e,t){var i=function(e,i){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),i)for(var r=Object.keys(i),n=0;n<r.length;n++){var o=this.keyElem.valueFromString(r[n]),a=this.valueElem.verifyValue(i[r[n]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},r=i.prototype;function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return r.clear=function(){this.map={}},r.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),i=t in this.map;return delete this.map[t],i},r.entries=function(){for(var e,t=[],i=Object.keys(this.map),r=0;r<i.length;r++)t.push([(e=this.map[i[r]]).key,e.value]);return n(t)},r.keys=function(){for(var e=[],t=Object.keys(this.map),i=0;i<t.length;i++)e.push(this.map[t[i]].key);return n(e)},r.values=function(){for(var e=[],t=Object.keys(this.map),i=0;i<t.length;i++)e.push(this.map[t[i]].value);return n(e)},r.forEach=function(e,t){for(var i,r=Object.keys(this.map),n=0;n<r.length;n++)e.call(t,(i=this.map[r[n]]).value,i.key,this)},r.set=function(e,t){var i=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(i)]={key:i,value:r},this},r.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},r.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},i}(0,f$8.Reflect),f$8.loadProto=function(e,t,i){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(i=t,t=void 0),f$8.loadJson(f$8.DotProto.Parser.parse(e),t,i)},f$8.protoFromString=f$8.loadProto,f$8.loadProtoFile=function(e,t,i){if(t&&"object"==typeof t?(i=t,t=null):(!t||"function"!=typeof t)&&(t=null),t)return f$8.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,f$8.loadProto(r,i,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=f$8.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:f$8.loadProto(r,i,e)},f$8.protoFromFile=f$8.loadProtoFile,f$8.newBuilder=function(e){return typeof(e=e||{}).convertFieldsToCamelCase>"u"&&(e.convertFieldsToCamelCase=f$8.convertFieldsToCamelCase),typeof e.populateAccessors>"u"&&(e.populateAccessors=f$8.populateAccessors),new f$8.Builder(e)},f$8.loadJson=function(e,t,i){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(i=t,t=null),(!t||"object"!=typeof t)&&(t=f$8.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,i),t.resolveAll(),t},f$8.loadJsonFile=function(e,t,i){if(t&&"object"==typeof t?(i=t,t=null):(!t||"function"!=typeof t)&&(t=null),t)return f$8.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,f$8.loadJson(JSON.parse(r),i,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=f$8.Util.fetch("object"==typeof e?e.root+"/"+e.file:e);return null===r?null:f$8.loadJson(JSON.parse(r),i,e)},h$3.prototype.getCacheTile=function(e,t,i,r){for(var n=0;n<this.tileCache.length;n++)if(this.tileCache[n].x===e&&this.tileCache[n].y===t&&this.tileCache[n].z===i&&this.tileCache[n].t===r)return this.tileCache[n];return null},h$3.prototype.addCacheTile=function(e){this.tileCache.length>999&&this.tileCache.splice(0,500),this.removeCacheTile(e.x,e.y,e.z,e.t),this.tileCache.push(e)},h$3.prototype.removeCacheTile=function(e,t,i,r){for(var n=0;n<this.tileCache.length;n++)if(this.tileCache[n].x===e&&this.tileCache[n].y===t&&this.tileCache[n].z===i&&this.tileCache[n].t===r){this.tileCache.splice(n,1);break}},h$3.prototype.getCacheLabel=function(e){for(var t=0;t<this.labelCache.length;t++)if(this.labelCache[t].name===this._UUID&&this.labelCache[t].oid===e)return this.labelCache[t];return null},h$3.prototype.addCacheLabel=function(e){this.labelCache.length>999&&this.labelCache.splice(0,250),this.removeCacheLabel(e.oid),e.timestamp=(new Date).getTime(),this.labelCache.push(e)},h$3.prototype.removeCacheLabel=function(e){for(var t=0;t<this.labelCache.length;t++)if(this.labelCache[t].name===this._UUID&&this.labelCache[t].oid===e){this.labelCache.splice(t,1);break}},h$3.prototype.getTileUrl=function(){return(this.proxy?this.proxy.proxy:"")+this.url+"/GetTiles?lxys={z},{x},{y}"+(this.token?"&tk="+this.token:"")},h$3.prototype.getIcoUrl=function(){return(this.proxy?this.proxy.proxy:"")+this.url+"/GetIcon?id={id}"+(this.token?"&tk="+this.token:"")},h$3.prototype.getRoadTileUrl=function(){return(this.proxy?this.proxy.proxy:"")+this.roadUrl},h$3.prototype._cluster=function(e){if(!(e$28(e)&&e<.05)){var t=this;clearTimeout(this._timer);var i=this.viewer.scene.globe._surface;if(i._tilesToRender.length<8||0<i._tileLoadQueueHigh.length)this._timer=setTimeout((function(){t._cluster()}),100);else{var r=this.getTilesToRender();if(this.compareArray(r,this._latelyGrid))return;this._queueCall(r),t.delaySynchronous()}}},h$3.prototype._changed=function(e){if(!(e$28(e)&&e<.05)){var t=(new Date).getTime(),i=t-this._latelyRefreshStamp,r=t-this._latelyCollisionStamp;if(i>300&&this._cluster(),r>150&&this.aotuCollide&&this.collisionDetection(),this.depthTestOptimization){var n=this.viewer.scene,o=n.globe,a=n.camera,s=a.positionCartographic.height,l=a.pitch,u=this.dTOElevation,c=this.dTOPitch;this._isDTP=o.depthTestAgainstTerrain=s<u&&c<l}}},h$3.prototype._queueCall=function(e){var t=this;t._latelyGrid=e,t._latelyRefreshStamp=(new Date).getTime(),e.forEach((function(e,i,r){if(t.metadata&&G$2(t.metadata.boundBox,e.boundBox)){if(t.metadata.minLevel>e.level+1||t.metadata.maxLevel<e.level+1)return;var n=t.getCacheTile(e.x,e.y,e.level+1,0);if(n)t.addLabelAndIco(n);else{var o=t.getTileUrl().replace("{z}",e.level+1).replace("{y}",e.y).replace("{x}",e.x).replace("{s}",t.subdomains[(e.x+e.y+e.level)%t.subdomains.length]);(a=new XMLHttpRequest).open("GET",o,!0),a.responseType="arraybuffer",a.onload=function(){if(!(a.status<200||300<=a.status)){var e=t.CutString(a.response);if(e)(i=H$1(e)).x=this.tile.x,i.y=this.tile.y,i.z=this.tile.z,i.t=0,t.addCacheTile(i),t.addLabelAndIco(i);else{var i={x:this.tile.x,y:this.tile.y,z:this.tile.z,t:0};t.addCacheTile(i),t.delaySynchronous()}}},a.onerror=function(e){console.error(e)},a.send(),a.tile={x:e.x,y:e.y,z:e.level+1}}}if(t.roadMetadata&&G$2(t.roadMetadata.boundBox,e.boundBox)){if(t.roadMetadata.minLevel>e.level+1||t.roadMetadata.maxLevel<e.level+1)return;if(b=t.getCacheTile(e.x,e.y,e.level+1,1))t.addLabelAndIco(b);else{var a,s=t.getRoadTileUrl().replace("{z}",e.level+1).replace("{y}",e.y).replace("{x}",e.x);(a=new XMLHttpRequest).open("GET",s,!0),a.responseType="json",a.onload=function(){if(!(a.status<200||300<=a.status)){var e=a.response;if(e){var i={pois:e.map((function(e,t,i){return{oid:e.LabelPoint.X+"_"+e.LabelPoint.Y,name:e.Feature.properties.Name,coordinate:[e.LabelPoint.X,e.LabelPoint.Y,e.LabelPoint.Z?e.LabelPoint.Z:0]}})),x:this.tile.x,y:this.tile.y,z:this.tile.z,t:1};t.addCacheTile(i),t.addLabelAndIco(i)}else i={x:this.tile.x,y:this.tile.y,z:this.tile.z,t:1};t.addCacheTile(i),t.delaySynchronous()}},a.onerror=function(e){console.error(e)},a.send(),a.tile={x:e.x,y:e.y,z:e.level+1}}}}))},h$3.prototype.getTilesToRender=function(){var e=this.viewer.scene.globe._surface._tilesToRender.map((function(e){return{x:e.x,y:e.y,level:e.level,boundBox:{minX:e$27.toDegrees(e.rectangle.west),minY:e$27.toDegrees(e.rectangle.south),maxX:e$27.toDegrees(e.rectangle.east),maxY:e$27.toDegrees(e.rectangle.north)}}})).sort((function(e,t){return t.level-e.level}));return e},h$3.prototype.addLabelAndIco=function(e){if(e.pois)for(var t=0;t<e.pois.length;t++){var i=this.getCacheLabel(e.pois[t].oid);i=i||this.createLabel(e.pois[t],e),this.addCacheLabel(i)}this.delaySynchronous()},h$3.prototype.delaySynchronous=function(){var e=this;clearTimeout(this._timer2),e._timer2=setTimeout((function(){e.synchronousLabel()}),100)},h$3.prototype.synchronousLabel=function(){for(var e=0;e<this.labelCache.length;e++)this.labelCache[e].timestamp>=this._latelyRefreshStamp&&!this.viewer.entities.contains(this.labelCache[e])&&(this._isInitial&&this.aotuCollide&&(this.labelCache[e].show=!1),this.viewer.entities.add(this.labelCache[e]));if(!this._isInitial){for(e=0;e<this.viewer.entities.values.length;e++)!this.viewer.entities.values[e].name||this.viewer.entities.values[e].name!==this._UUID&&this.viewer.entities.values[e].name!==this._UUIDRoad||this.viewer.entities.values[e].timestamp<this._latelyRefreshStamp&&(this.viewer.entities.remove(this.viewer.entities.values[e]),e--);this.aotuCollide&&this.collisionDetection()}},h$3.prototype.createLabel=function(e,t){if(e$28(e)){var i={show:!0,position:t$X.fromDegrees(e.coordinate[0],e.coordinate[1],e.coordinate[2]),label:{text:e.name}};i.label.font=this.labelGraphics.font||e.fontSize+"px "+t.stringTable[e.fontNameIndex]||"30px 微软雅黑",i.label.style=this.labelGraphics.style||R$t.FILL_AND_OUTLINE,i.label.scale=this.labelGraphics.scale||e.scale||1,i.label.showBackground=this.labelGraphics.showBackground||e.showBackground||!1,i.label.backgroundColor=this.labelGraphics.backgroundColor||e.backgroundColor,i.label.backgroundPadding=this.labelGraphics.backgroundPadding||e.backgroundPadding,i.label.pixelOffset=this.labelGraphics.pixelOffset||e.pixelOffset||new o$1k(0,0),i.label.eyeOffset=this.labelGraphics.eyeOffset||e.eyeOffset,i.label.horizontalOrigin=this.labelGraphics.horizontalOrigin||e.horizontalOrigin,i.label.verticalOrigin=this.labelGraphics.verticalOrigin||e.verticalOrigin,i.label.heightReference=this.labelGraphics.heightReference||k$_.NONE,i.label.fillColor=this.labelGraphics.fillColor||e$1S.fromCssColorString(this.HexadecimalConversion(e.fontColor)),i.label.outlineColor=this.labelGraphics.outlineWidth||e$1S.fromCssColorString(this.HexadecimalConversion(e.shiningColor)),i.label.outlineWidth=this.labelGraphics.outlineWidth||e.shiningSize,i.label.translucencyByDistance=void 0,i.label.pixelOffsetScaleByDistance=void 0,i.label.scaleByDistance=this.labelGraphics.scaleByDistance||void 0,i.label.distanceDisplayCondition=void 0,i.label.disableDepthTestDistance=Number.POSITIVE_INFINITY;var r=new h$F(i);return r.name=t.t?this._UUIDRoad:this._UUID,r.oid=e.oid,r.priority=e.priority?e.priority:0,r.xyz=t.x+"_"+t.y+"_"+(t.z-1),r}},h$3.prototype.collisionDetection=function(){var e=this.viewer.scene._view.viewport,t=e.x,i=e.x+e.width,r=e.y,n=e.y+e.height,o=[],a=this,s=this.viewer.entities.values;s.sort((function(e,t){return e.priority-t.priority})),s.map((function(e){if(e.name&&(e.name===a._UUID||e.name===a._UUIDRoad)){var s=m$W.wgs84ToDrawingBufferCoordinates(a.viewer.scene,e.position.getValue(0));if(e$28(s)){e._screenSpacePosition=s;var l=a.getLabelReact({point:s,entity:e});e.collisionBox=l,s.x>=t&&s.x<=i&&s.y>=r&&s.y<=n?(e.show=!0,o.push({anno:e,clustered:!0,coord:s})):e.show=!1}else e.show=!1}}));for(var l=O$u(o,A$5,N$1,64,Int32Array),u=o.length,c=0;c<u;c++){for(var h=o[c],d=h.anno.collisionBox,f=l.intersect(d.x,d.y,d.x+d.width,d.y+d.height,o,F$3,M$2),p=f.length,_=0,m=0;m<p;m++){var $=f[m],g=o[$];c!==$&&!g.clustered&&++_}_<1?h.clustered=!1:h.anno.show=!1}},h$3.prototype.bindEvent=function(){this.viewer.scene.camera.moveEnd.addEventListener(this._cluster,this),this.viewer.scene.camera.changed.addEventListener(this._changed,this);this.viewer.scene.terrainProvider.readyPromise.then(this._cluster.bind(this))},h$3.prototype.unbindEvent=function(){this.viewer.scene.camera.moveEnd.removeEventListener(this._cluster,this),this.viewer.scene.camera.changed.removeEventListener(this._changed,this)},h$3.prototype.activate=function(){this._latelyGrid=[],this._cluster()},h$3.prototype.destroy=function(){for(var e=0;e<this.viewer.entities.values.length;e++)!this.viewer.entities.values[e].name||this.viewer.entities.values[e].name!==this._UUID&&this.viewer.entities.values[e].name!==this._UUIDRoad||(this.viewer.entities.remove(this.viewer.entities.values[e]),e--);this.viewer.camera.percentageChanged=.5,this.unbindEvent(),this.handler=this.handler&&this.handler.destroy(),this.proxy=void 0,this.viewer=void 0,this.url=void 0,this.labelGraphics=void 0,this.billboardGraphics=void 0,this.aotuCollide=void 0,this.collisionPadding=void 0,this.tileCache=void 0,this.labelCache=void 0,this._latelyGrid=void 0,this._latelyRefreshStamp=void 0,this._roadTileset=void 0},h$3.prototype.compareArray=function(e,t){for(var i=!1,r=0;r<e.length;r++){for(var n=!1,o=0;o<t.length;o++)if(e[r].x===t[o].x&&e[r].y===t[o].y&&e[r].level===t[o].level){n=!0;break}if(!n){i=!0;break}}return!i},h$3.prototype.getLabelReact=function(e){var t=parseInt(e.entity.label.font);t=t>0?t:15;for(var i=e.entity.label.text.getValue(0).split("\n"),r=0,n=i.length,o=0;o<i.length;o++){var a=V$2(i[o])/2;r<a&&(r=a)}var s=e.entity.billboard?e.entity.billboard.width.getValue(0)*e.entity.billboard.scale.getValue(0):1,l=e.entity.billboard?e.entity.billboard.height.getValue(0)*e.entity.billboard.scale.getValue(0):1,u=e.entity.label.pixelOffset,c=u.getValue(0).x;c<0&&(c=0);var h=u.getValue(0).y;return h<0&&(h=0),{x:(e.point?e.point.x:-999)-s/2-this.collisionPadding[3],y:(e.point?e.point.y:-999)-l/2-this.collisionPadding[0],width:t*e.entity.label.scale.getValue(0)*r+c+s+this.collisionPadding[1],height:t*e.entity.label.scale.getValue(0)*(n+.5*(n-1))+h+l/2+this.collisionPadding[2]}},h$3.prototype.CutString=function(e){if(!e)return"";var t=e.byteLength;return t<=28?"":e.slice(19,t-9)},h$3.prototype.HexadecimalConversion=function(e){if(4278190080===e)return"#000000";var t=4278190080|parseInt(-Number(e));if(e="",(t=t.toString(16).substring(1)).length<6)for(var i=6-t.length,r=0;r<i;r++)e+="0";return"#"+e+t},h$3.prototype.getLabelVisibility=function(e){if(!e)return!1;var t=this.viewer.canvas.getBoundingClientRect();return!(e.x<-10||e.x>t.right+10||e.y<-10||e.y>t.bottom+10)};var V$2=function(e){for(var t=0,i=0;i<e.length;i++)null!=e.charAt(i).match(/[^\x00-\xff]/gi)?t+=2:t+=1;return t},H$1=function(e){var t={stringTable:[],pois:[],enumGeometryType:[{ePoint:0},{eMultiLineString:1},{ePolygon:2}],enumZCoordType:[{eCloseGround:0},{eCloseSeaSurface:1},{eRelativelyGround:2},{eAbsolute:3}]},i=function(){if(!f$8)throw new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions.");return f$8.loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;} ;message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32\tFontNameIndex=13 [default =0];optional int32\tFontSize=14 [default =18];optional uint32\tFontColor=15 [default =0];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};","GEOPOI","GeoPOI.proto").build("GEOPOI").PBPOITile}(),r=function(){if(!f$8)throw new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions.");return f$8.loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Interate = 5;optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32\tFontNameIndex=13 [default =0];optional int32\tFontSize=14 [default =18];optional uint32\tFontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};","GEOPOI","GeoPOI2.proto").build("GEOPOI").PBPOITile}(),n=function(){if(!f$8)throw new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions.");return f$8.loadProto("option optimize_for = LITE_RUNTIME;package GEOPOI;enum enumGeometryType {ePoint = 0;eMultiLineString = 1;ePolygon = 2;};enum enumZCoordType {eCloseGround = 0;eCloseSeaSurface = 1;eRelativelyGround = 2;eAbsolute = 3;};message PBPOI{required uint64 OID = 1;required string Name =2;repeated double Coordinates =3 [packed=true];required enumGeometryType GeometryType = 4;optional int32 Priority = 5;repeated int32 Interates =6 [packed=true];optional int32 SymbolID = 10 [default = 0];optional double DisplayHeight = 11 [default = 32];optional uint32 ShiningColor=12 [default =0];optional uint32\tFontNameIndex=13 [default =0];optional int32\tFontSize=14 [default =18];optional uint32\tFontColor=15 [default =0];optional enumZCoordType ZCoordType = 16 [default = eAbsolute];optional int32 FontStyle=17;optional int32 ShiningSize=18;};message StringTable {repeated string s = 1;}message PBPOITile{required int64 Version = 1;required int64 TileKey = 2;required StringTable StringTable = 3;repeated PBPOI POIS = 4;};","GEOPOI","GeoPOI3.proto").build("GEOPOI").PBPOITile}();t.pois.length=0;var o,a=e;try{o=n.decode(a)}catch{console.log("message")}if(!o)try{results=r.decode(a)}catch{console.log("message"),results=i.decode(a)}t.version=parseInt(o.Version.toString()),t.titleKey=parseInt(o.TileKey.toString()),t.stringTable=[];for(var s=o.StringTable.s.length,l=0;l<s;l++)t.stringTable.push(o.StringTable.s[l].toString());return o.POIS.forEach((function(e){var i={};i.oid=parseInt(e.OID.toString())+"_"+t.titleKey,i.name=e.Name.toString(),i.symbolID=parseInt(e.SymbolID.toString()),i.displayHeight=e.DisplayHeight,i.shiningColor=e.ShiningColor,i.fontNameIndex=e.FontNameIndex,i.fontSize=e.FontSize,i.fontColor=e.FontColor,e.ZCoordType&&(i.zCoordType=e.ZCoordType),i.geometryType=e.GeometryType,i.coordinate=e.Coordinates,i.priority=void 0===e.Priority?null:e.Priority,i.interates=void 0===e.Interates?null:e.Interates,i.fontStyle=void 0===e.FontStyle?null:e.FontStyle,i.shiningSize=void 0===e.ShiningSize?null:e.ShiningSize,t.pois.push(i)})),t},_$5={IMG_W:"img_w",IMG_C:"img_c",CIA_W:"cia_w",CIA_C:"cia_c",VEC_W:"vec_w",VEC_C:"vec_c",TER_W:"ter_w",TER_C:"ter_c",CVA_W:"cva_w",CVA_C:"cva_c",CTA_W:"cta_w",CTA_C:"cta_c",IBO_W:"ibo_w",IBO_C:"ibo_c",EIA_W:"eia_w",EIA_C:"eia_c",EVA_W:"eva_w",EVA_C:"eva_c"},t$4=Object.freeze(_$5);function f$7(e){e=u$Y(e,{}),this._mapStyle=u$Y(e.mapStyle,t$4.IMG_W),this._url=u$Y(e.url,_$4[this._mapStyle]),this._token=e.token,this._layer=u$Y(e.layer,r$d[this._mapStyle]),this._style=u$Y(e.style,"default"),this._tileMatrixSetID=u$Y(e.tileMatrixSetID,a$3[this._mapStyle]),this._tileMatrixLabels=u$Y(e.tileMatrixLabels,i$6[this._mapStyle]),this._format=u$Y(e.format,n$5[this._mapStyle]),this._epsgCode=s$5[this._mapStyle],this._tilingScheme=u$Y(e.tilingScheme,new c$10({})),"4490"==this._epsgCode&&(this._tilingScheme=new g$14),this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._minimumLevel=u$Y(e.minimumLevel,0),this._maximumLevel=u$Y(e.maximumLevel,i$6[this._mapStyle].length),this._rectangle=u$Y(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=o$1q.resolve(!0),this._errorEvent=new o$1o;var t=e.credit;this._credit="string"==typeof t?new r$1a(t):t,this._subdomains=u$Y(e.subdomains,["t0","t1","t2","t3","t4","t5","t6","t7"]),this._tileDiscardPolicy=e.tileDiscardPolicy;var i=this,r=this._url;i.tablename=this._url,new l$11({name:r}).then((function(e){e.checkObjectStoreExit(i.tablename)?i._indexedDBScheduler=e:e.createObjectStore(i.tablename).then((function(){i._indexedDBScheduler=e}))})),i._indexedDBSetting={isOpen:!1,clear:function(){i._indexedDBScheduler.clear(i.tablename)},cache:[]}}function B$3(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;i$U(t,o)?i$U(e,o)&&(a|=1):(a|=2,i$U(e,o)||(a|=1)),r+=a}return r}Object.defineProperties(f$7.prototype,{url:{get:function(){return this._url}},mapStyle:{get:function(){return this._mapStyle}},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}},errorEvent:{get:function(){return this._errorEvent}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}}}),f$7.prototype.requestImage=function(e,t,i,r){var n=D$2(this,e,t,i),o=B$3(e,t,i);if(r.quadKey=o,!0===this._indexedDBSetting.isOpen&&r.cacheEnable){if(e$28(this._indexedDBScheduler)){var a=this._indexedDBScheduler.getElementFromDB(this.tablename,o);return e$28(a)?o$1q(a,(function(e){return e$28(e)?e:"cacheError"}),(function(e){return"cacheError"})):e$k.loadImage(this,n)}return e$k.loadImage(this,n)}return e$k.loadImage(this,n)};var L$4=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function D$2(e,t,i,r){"900913"==e._epsgCode&&(r-=1);var n=e._tileMatrixLabels,o=e$28(n)?n[r]:r.toString(),a=e._subdomains,s=e._url.replace("[subdomain]",a[(t+i+r)%a.length]),l=new h$$(s),u=m$1j(u$Y(l.query,""));(u=p$17(L$4,u)).tilematrix=o,u.layer=e._layer,u.style=e._style,u.tilerow=i,u.tilecol=t,u.tilematrixset=e._tileMatrixSetID,u.format=e._format,l.query=m$1k(u),s=l.toString();var c=e._proxy;return e$28(c)&&(s=c.getURL(s)),e$28(e._token)&&(s+="&tk="+e._token),s}f$7.prototype.pickFeatures=function(){};var _$4={};_$4[t$4.IMG_W]="https://[subdomain].tianditu.gov.cn/img_w/wmts",_$4[t$4.IMG_C]="https://[subdomain].tianditu.gov.cn/img_c/wmts",_$4[t$4.CIA_W]="https://[subdomain].tianditu.gov.cn/cia_w/wmts",_$4[t$4.CIA_C]="https://[subdomain].tianditu.gov.cn/cia_c/wmts",_$4[t$4.VEC_W]="https://[subdomain].tianditu.gov.cn/vec_w/wmts",_$4[t$4.VEC_C]="https://[subdomain].tianditu.gov.cn/vec_c/wmts",_$4[t$4.TER_W]="https://[subdomain].tianditu.gov.cn/ter_w/wmts",_$4[t$4.TER_C]="https://[subdomain].tianditu.gov.cn/ter_c/wmts",_$4[t$4.CVA_W]="https://[subdomain].tianditu.gov.cn/cva_w/wmts",_$4[t$4.CVA_C]="https://[subdomain].tianditu.gov.cn/cva_c/wmts",_$4[t$4.CTA_W]="https://[subdomain].tianditu.gov.cn/cta_w/wmts",_$4[t$4.CTA_C]="https://[subdomain].tianditu.gov.cn/cta_c/wmts",_$4[t$4.EIA_W]="https://[subdomain].tianditu.gov.cn/eia_w/wmts",_$4[t$4.EIA_C]="https://[subdomain].tianditu.gov.cn/eia_c/wmts",_$4[t$4.EVA_W]="https://[subdomain].tianditu.gov.cn/eva_w/wmts",_$4[t$4.EVA_C]="https://[subdomain].tianditu.gov.cn/eva_c/wmts",_$4[t$4.IBO_W]="https://[subdomain].tianditu.gov.cn/ibo_w/wmts",_$4[t$4.IBO_C]="https://[subdomain].tianditu.gov.cn/ibo_c/wmts";var r$d={};r$d[t$4.IMG_W]="img",r$d[t$4.IMG_C]="img",r$d[t$4.IBO_W]="ibo",r$d[t$4.IBO_C]="ibo",r$d[t$4.CIA_W]="cia",r$d[t$4.CIA_C]="cia",r$d[t$4.VEC_W]="vec",r$d[t$4.VEC_C]="vec",r$d[t$4.TER_W]="ter",r$d[t$4.TER_C]="ter",r$d[t$4.CVA_W]="cva",r$d[t$4.CVA_C]="cva",r$d[t$4.CTA_W]="cta",r$d[t$4.CTA_C]="cta",r$d[t$4.EIA_W]="eia",r$d[t$4.EIA_C]="eia",r$d[t$4.EVA_W]="eva",r$d[t$4.EVA_C]="eva";var a$3={};a$3[t$4.IMG_W]="w",a$3[t$4.IMG_C]="c",a$3[t$4.IBO_W]="w",a$3[t$4.IBO_C]="c",a$3[t$4.CIA_W]="w",a$3[t$4.CIA_C]="c",a$3[t$4.VEC_W]="w",a$3[t$4.VEC_C]="c",a$3[t$4.TER_W]="w",a$3[t$4.TER_C]="c",a$3[t$4.CVA_W]="w",a$3[t$4.CVA_C]="c",a$3[t$4.CTA_W]="w",a$3[t$4.CTA_C]="c",a$3[t$4.EIA_W]="w",a$3[t$4.EIA_C]="c",a$3[t$4.EVA_W]="w",a$3[t$4.EVA_C]="c";var n$5={};n$5[t$4.IMG_W]="tiles",n$5[t$4.IMG_C]="tiles",n$5[t$4.IBO_W]="tiles",n$5[t$4.IBO_C]="tiles",n$5[t$4.CIA_W]="tiles",n$5[t$4.CIA_C]="tiles",n$5[t$4.VEC_W]="tiles",n$5[t$4.VEC_C]="tiles",n$5[t$4.TER_W]="tiles",n$5[t$4.TER_C]="tiles",n$5[t$4.CVA_W]="tiles",n$5[t$4.CVA_C]="tiles",n$5[t$4.CTA_W]="tiles",n$5[t$4.CTA_C]="tiles",n$5[t$4.EIA_W]="tiles",n$5[t$4.EIA_C]="tiles",n$5[t$4.EVA_W]="tiles",n$5[t$4.EVA_C]="tiles";var s$5={};s$5[t$4.IMG_W]="900913",s$5[t$4.IMG_C]="4490",s$5[t$4.IBO_W]="900913",s$5[t$4.IBO_C]="4490",s$5[t$4.CIA_W]="900913",s$5[t$4.CIA_C]="4490",s$5[t$4.VEC_W]="900913",s$5[t$4.VEC_C]="4490",s$5[t$4.TER_W]="900913",s$5[t$4.TER_C]="4490",s$5[t$4.CVA_W]="900913",s$5[t$4.CVA_C]="4490",s$5[t$4.CTA_W]="900913",s$5[t$4.CTA_C]="4490",s$5[t$4.EIA_W]="900913",s$5[t$4.EIA_C]="4490",s$5[t$4.EVA_W]="900913",s$5[t$4.EVA_C]="4490";var i$6={};function d$8(e){if(!e$28(e)||!e$28(e.token))throw new t$Z("options.token is required.");if(!e$28(e)||!e$28(e.url))throw new t$Z("options.url is required.");this._url=e.url+"&tk="+e.token,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():e$28(this._subdomains)&&this._subdomains.length>0?this._subdomains=[this._subdomains]:this._subdomains=["t0","t1","t2","t3","t4","t5","t6","t7"],this._dataType=u$Y(e.dataType,"int"),this._errorEvent=new o$1o,this._ready=!0,this._readyPromise=o$1q.resolve(!0),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0};var t=e.credit;"string"==typeof t&&(t=new r$1a(t)),this._credit=t;var i=u$Y(e.ellipsoid,t$V.WGS84);this._tilingScheme=new g$14({ellipsoid:i}),this._heightmapWidth=64,this._heightmapHeight=64,this._levelZeroMaximumGeometricError=I$1i.getEstimatedLevelZeroGeometricErrorForAHeightmap(i,Math.min(this._heightmapWidth,this._heightmapHeight),this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._minimumLevel=u$Y(e.minimumLevel,5),this._maximumLevel=u$Y(e.maximumLevel,25),this._hasWaterMask=!1,this._hasVertexNormals=!1}function A$4(e,t){return(t=e$28(t)?t:new r$1c({url:e})).requestFunction=function(){var t=new XMLHttpRequest;t.open("get",e,!0),t.responseType="arraybuffer",t.async=!1,t.send(null);var i=o$1q.defer();return t.onreadystatechange=function(){if(4===t.readyState)if(200===t.status&&e$28(t.response)){for(var e=new DataView(t.response),r=e.byteLength,n=new Uint8Array(r),o=0;o<r;o++)n[o]=e.getUint8(o,!0);if(r>1e3){var a=nt$c.inflate(n).buffer;e$28(a)?i.resolve(new Uint8Array(a)):i.reject(!1)}else i.reject(!1)}else(t.status>=400||0===t.status)&&i.reject(!1)},i.promise},r$1b.request(t)}function o$8(){}function n$4(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._tilingScheme=e$28(e.tilingScheme)?e.tilingScheme:new g$14({ellipsoid:e.ellipsoid}),this._color=u$Y(e.color,e$1S.YELLOW),this._errorEvent=new o$1o,this._tileWidth=u$Y(e.tileWidth,256),this._tileHeight=u$Y(e.tileHeight,256),this._readyPromise=o$1q.resolve(!0)}function r$c(e){t$Z.throwInstantiationError()}i$6[t$4.IMG_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.IMG_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.IBO_W]=["1","2","3","4","5","6","7","8","9","10"],i$6[t$4.IBO_C]=["1","2","3","4","5","6","7","8","9","10"],i$6[t$4.CIA_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.CIA_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.VEC_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],i$6[t$4.VEC_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],i$6[t$4.TER_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14"],i$6[t$4.TER_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14"],i$6[t$4.CVA_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],i$6[t$4.CVA_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],i$6[t$4.CTA_W]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.CTA_C]=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],i$6[t$4.EIA_W]=["1","2","3","4","5","6","7","8","9","10"],i$6[t$4.EIA_C]=["1","2","3","4","5","6","7","8","9","10"],i$6[t$4.EVA_W]=["1","2","3","4","5","6","7","8","9","10"],i$6[t$4.EVA_C]=["1","2","3","4","5","6","7","8","9","10"],Object.defineProperties(d$8.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),d$8.prototype.requestTileGeometry=function(e,t,i,r){if(i<this._maximumLevel&&i>=this._minimumLevel){var n=this._url.replace("{s}",this._subdomains[(e+t+i)%this._subdomains.length]),o=-1===n.indexOf("?")?"?":"&",a=A$4(n+o+"x="+e+"&y="+t+"&l="+(i+1));if(!e$28(a))return;var s=this;return o$1q(a,(function(e){var t=s.transformBuffer(e);return e$28(t)?new T$S({buffer:t,width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:void 0,structure:s._terrainDataStructure}):new T$S({buffer:s.getvHeightBuffer(),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:void 0,structure:s._terrainDataStructure})}))}if(i<this._minimumLevel)return new T$S({buffer:this.getvHeightBuffer(),width:this._heightmapWidth,height:this._heightmapHeight,childTileMask:void 0,structure:this._terrainDataStructure})},d$8.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},d$8.prototype.getTileDataAvailable=function(e,t,i){return i<25},d$8.prototype.getvHeightBuffer=function(){var e=this._vHeightBuffer;if(!e$28(e)){e=this._vHeightBuffer=new Uint8ClampedArray(this._heightmapWidth*this._heightmapHeight*4);for(var t=this._heightmapWidth*this._heightmapHeight*4,i=0;i<t;)e[i++]=15,e[i++]=66,e[i++]=64,e[i++]=255}return e},d$8.prototype.transformBuffer=function(e){var t=2;"int"===this._dataType?t=2:"float"===this._dataType&&(t=4);var i,r,n,o,a,s,l,u=new ArrayBuffer(t),c=new DataView(u),h=this._heightmapWidth,d=this._heightmapHeight,f=new Uint8Array(h*d*4);for(i=0;i<d;i++)for(r=0;r<h;r++){n=parseInt(149*i/(d-1)),o=parseInt(149*r/(h-1)),4===t?(a=t*(150*n+o),c.setInt8(0,e[a]),c.setInt8(0,e[a+1]),c.setInt8(0,e[a+2]),c.setInt8(0,e[a+3]),l=c.getFloat32(0,!0)):l=e[a=t*(150*n+o)]+256*e[a+1],(l>1e4||l<-2e3)&&(l=0);var p=(l+1e3)/.001;f[s=4*(i*h+r)]=p/65536,f[s+1]=(p-256*f[s]*256)/256,f[s+2]=p-256*f[s]*256-256*f[s+1],f[s+3]=256}return f},o$8.prototype.boundingVolume=void 0,o$8.prototype.boundingSphere=void 0,o$8.prototype.distanceToCamera=function(e){t$Z.throwInstantiationError()},o$8.prototype.intersectPlane=function(e){t$Z.throwInstantiationError()},o$8.prototype.createDebugVolume=function(e){t$Z.throwInstantiationError()},Object.defineProperties(n$4.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}}}),n$4.prototype.getTileCredits=function(e,t,i){},n$4.prototype.requestImage=function(e,t,i,r){var n=document.createElement("canvas");n.width=256,n.height=256;var o=n.getContext("2d"),a=this._color.toCssColorString();return o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=a,o.fillText("L: "+i,124,86),o.fillText("X: "+e,124,136),o.fillText("Y: "+t,124,186),n},n$4.prototype.pickFeatures=function(e,t,i,r,n){},r$c.prototype.isReady=t$Z.throwInstantiationError,r$c.prototype.shouldDiscardImage=t$Z.throwInstantiationError;var e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},TileState=Object.freeze(e);function g$6(e){e=u$Y(e,u$Y.EMPTY_OBJECT),o$1u.typeOf.object("options.clock",e.clock),o$1u.typeOf.object("options.intervals",e.intervals),this.show=u$Y(e.show,!0),this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this.shadows=u$Y(e.shadows,q$L.ENABLED),this.maximumMemoryUsage=u$Y(e.maximumMemoryUsage,256),this.shading=new o$O(e.shading),this.style=e.style,this.frameFailed=new o$1o,this.frameChanged=new o$1o,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new m$C,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=o$1q.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=d$1a(new Array(5),0),this._runningAverage=0}function W$3(e){return"uniform vec4 czm_pickColor;\n"+e}function X$2(e){return function(t){return p$17(t,{czm_pickColor:function(){return e._pickId.color}})}}function Z$3(){return"czm_pickColor"}Object.defineProperties(g$6.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){h$C.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(e$28(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),g$6.prototype.makeStyleDirty=function(){this._styleDirty=!0},g$6.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var $$1=new a$12;function k$3(e){var t=e._clock,i=t.canAnimate&&t.shouldAnimate,r=t.multiplier;return i?r:0}function p$3(e,t){return e._intervals.indexOf(t.start)}function ee$2(e,t){var i=e._intervals,r=e._clock,n=k$3(e);if(0!==n){var o=e._getAverageLoadTime(),a=a$12.addSeconds(r.currentTime,o*n,$$1),s=i.indexOf(a);return s===p$3(e,t)&&(n>=0?++s:--s),i.get(s)}}function ie(e){var t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function ne$1(e,t,i){var r=k$3(e),n=p$3(e,t),o=p$3(e,i);return r>=0?n>=o:n<=o}function re$1(e,t){return function(i){var r=e$28(i.message)?i.message:i.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:r}):(console.log("A frame failed to load: "+t),console.log("Error: "+r))}}function te$1(e,t,i){var r=p$3(e,t),n=e._frames,o=n[r];if(!e$28(o)){var a=t.data.transform,s=e$28(a)?y$15.fromArray(a):void 0,l=t.data.uri;o={pointCloud:void 0,transform:s,timestamp:kt$7(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},n[r]=o,t$S.fetchArrayBuffer({url:l}).then((function(t){return o.pointCloud=new ie$l({arrayBuffer:t,cull:!0,fragmentShaderLoaded:W$3,uniformMapLoaded:X$2(e),pickIdLoaded:Z$3}),o.pointCloud.readyPromise})).otherwise(re$1(e,l))}return o}function ae(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 se(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var n=t.pointCloud;if(e$28(n)&&!t.ready){var o=r.commandList,a=o.length;if(A$3(e,t,i,r),n.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=n.geometryByteLength,o.length=a,t.sequential))ae(e,(kt$7()-t.timestamp)/1e3)}t.touchedFrameNumber=r.frameNumber}var oe$1=new y$15;function le$1(e,t){var i=e.shading;return e$28(i)&&e$28(i.baseResolution)?i.baseResolution:e$28(t.boundingSphere)?e$27.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function ue(e){var t=e.shading;return e$28(t)&&e$28(t.maximumAttenuation)?t.maximumAttenuation:10}var de$1=new o$O;function A$3(e,t,i,r){var n=u$Y(e.shading,de$1),o=t.pointCloud,a=u$Y(t.transform,y$15.IDENTITY);o.modelMatrix=y$15.multiplyTransformation(e.modelMatrix,a,oe$1),o.style=e.style,o.time=i.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=i.isClipped,o.attenuation=n.attenuation,o.backFaceCulling=n.backFaceCulling,o.normalShading=n.normalShading,o.geometricError=le$1(e,o),o.geometricErrorScale=n.geometricErrorScale,o.maximumAttenuation=ue(e),o.update(r),t.touchedFrameNumber=r.frameNumber}function L$3(e,t,i,r){se(e,te$1(e,t,r),i,r)}function me$1(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function T$1(e,t){for(var i=e._frames,r=i.length,n=0;n<r;++n){var o=i[n];if(e$28(o)&&(!e$28(t)||t(o))){var a=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),e$28(a)&&a.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[n]=void 0}}}function ce$2(e,t){var i=p$3(e,t),r=e._frames[i];if(e$28(r)&&r.ready)return r}function E$3(e,t,i,r,n){return!!e$28(i)&&(!!i.ready||(L$3(e,t,r,n),i.ready))}function fe(e,t,i,r,n){var o,a,s=e._intervals,l=e._frames,u=p$3(e,i),c=p$3(e,t);if(u>=c){for(o=u;o>=c;--o)if(E$3(e,a=s.get(o),l[o],r,n))return a}else for(o=u;o<=c;++o)if(E$3(e,a=s.get(o),l[o],r,n))return a;return t}function ge$1(e,t,i){for(var r=e._frames,n=r.length,o=0;o<n;++o){var a=r[o];e$28(a)&&e$28(a.pointCloud)&&(a.pointCloud.clippingPlanesDirty=t,a.pointCloud.styleDirty=i)}}var y$6={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};g$6.prototype.update=function(e){if(e.mode!==P$$.MORPHING&&this.show){e$28(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),e$28(this._loadTimestamp)||(this._loadTimestamp=a$12.clone(e.time));var t=Math.max(1e3*a$12.secondsDifference(e.time,this._loadTimestamp),0),i=this._clippingPlanes,r=0,n=!1,o=e$28(i)&&i.enabled;o&&(i.update(e),r=i.clippingPlanesState),this._clippingPlanesState!==r&&(this._clippingPlanesState=r,n=!0);var a=this._styleDirty;this._styleDirty=!1,(n||a)&&ge$1(this,n,a),y$6.timeSinceLoad=t,y$6.isClipped=o;var s=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,c=u.length,h=this._previousInterval,d=this._nextInterval,f=ie(this);if(e$28(f)){var p=!1,_=k$3(this),m=0===_;_!==this._clockMultiplier&&(p=!0,this._clockMultiplier=_),(!e$28(h)||m)&&(h=f),(!e$28(d)||p||ne$1(this,f,d))&&(d=ee$2(this,f));var $=ce$2(this,h=fe(this,h,f,y$6,e));e$28($)||(L$3(this,h,y$6,e),$=this._lastRenderedFrame),e$28($)&&A$3(this,$,y$6,e),e$28(d)&&L$3(this,d,y$6,e);var g=this;e$28($)&&!e$28(this._lastRenderedFrame)&&e.afterRender.push((function(){g._readyPromise.resolve(g)})),e$28($)&&$!==this._lastRenderedFrame&&g.frameChanged.numberOfListeners>0&&e.afterRender.push((function(){g.frameChanged.raiseEvent(g)})),this._previousInterval=h,this._nextInterval=d,this._lastRenderedFrame=$,this._totalMemoryUsageInBytes>1024*this.maximumMemoryUsage*1024&&T$1(this,me$1(e));var v=u.length-c;e$28(s)&&s.attenuation&&s.eyeDomeLighting&&v>0&&l.update(e,c,s)}}},g$6.prototype.isDestroyed=function(){return!1},g$6.prototype.destroy=function(){return T$1(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),i$Z(this)};var _$3="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 o$7(e,t){this.show=!0,e$28(e)||(e=new f$10),this.rectangle=f$10.clone(e),e$28(t)||(t=a$O.fromType(a$O.ColorType,{color:new e$1S(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}function A$2(e){this._url=e.url,this._hypsometricTexture=void 0,this.hypsometricSetting=e.hypsometricSetting,this._ready=!1,this._volBounds=void 0,this._volImageBuffer=void 0,this._volTexture=void 0,this._dataBuffer=void 0,this.loadData(this._url)}function pt(e,t,i){for(var r=e.length/4,n=new Float32Array(e.buffer,e.byteOffset,r),o=0;o<n.length;o++){var a=n[o],s=4*o;if(a<0||a>1)e[s+0]=255,e[s+1]=255,e[s+2]=255,e[s+3]=255;else{a=a*(t._ceiling-t._floor)+t._floor,i&&(a=Math.round(a));var l=t._dictColorTable.getColor(a);e[s+0]=255*l.red,e[s+1]=255*l.green,e[s+2]=255*l.blue,e[s+3]=255*l.alpha}}return new Uint8Array(e.buffer,0,e.length)}function gt(e){var t=new t$X(1,255,65025);(t=t$X.multiplyByScalar(t,e,t)).x=t.x-Math.floor(t.x),t.y=t.y-Math.floor(t.y),t.z=t.z-Math.floor(t.z);var i=new t$X,r=new t$X(1/255,1/255,0);return i.x=t.y*r.x,i.y=t.z*r.y,i.z=t.z*r.z,t=t$X.subtract(t,i,t)}function ut$1(e){for(var t=e.length/4,i=new Float32Array(e.buffer,e.byteOffset,t),r=0;r<i.length;r++){var n,o,a,s,l=i[r],u=4*r,c=new e$25(0,0,0,0);if(l>=0&&l<=1){l<e$27.EPSILON9?l=e$27.EPSILON9:1-l<e$27.EPSILON9&&(l=1-e$27.EPSILON9);var h=gt(l);c.x=h.x,c.y=h.y,c.z=h.z,c.w=1}n=255*c.x,o=255*c.y,a=255*c.z,s=255*c.w,e[u+0]=parseInt(n),e[u+1]=parseInt(o),e[u+2]=parseInt(a),e[u+3]=parseInt(s)}return new Uint8Array(e.buffer,0,e.length)}o$7.prototype.update=function(e){if(this.show){if(!e$28(this.material))throw new t$Z("this.material must be defined.");if(!e$28(this.rectangle))throw new t$Z("this.rectangle must be defined.");var t=this._rs;if((!e$28(t)||!f$10.equals(t.viewport,this.rectangle))&&(this._rs=u$R.fromCache({blending:Ee$n.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){var i=e.context;if(this._material!==this.material||!e$28(this._overlayCommand)){this._material=this.material,e$28(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var r=new a$$({sources:[this._material.shaderSource,_$3]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Le$p.OVERLAY}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}}},o$7.prototype.isDestroyed=function(){return!1},o$7.prototype.destroy=function(){return e$28(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i$Z(this)},Object.defineProperties(A$2.prototype,{hypsometricSetting:{get:function(){return this._hypsometricSetting},set:function(e){this._hypsometricSetting=e}}});var d$7=-9999,ct$1=new DOMParser;function _t(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t)return a}}A$2.prototype.loadData=function(e){var t=this;t._ready=!1;var i=u$P(e+"/config");!e$28(i)||i.then((function(i){var r=_t((i=ct$1.parseFromString(i,"application/xml")).childNodes[0],"sml:Bounds").textContent.split("\n"),n=Number(r[1]),o=Number(r[2]),a=Number(r[3]),s=Number(r[4]),l='/data/index/1/1.stream?bounds={"leftBottom":{"x":xLeft,"y":yBottom},"rightTop":{"x":xRight,"y":yTop}}';l=l.replace("xLeft",n).replace("yBottom",s).replace("xRight",a).replace("yTop",o);var u=o$$(e+l);!e$28(u)||u.then((function(e){var i=new Uint8Array(e,8),r=nt$c.inflate(i).buffer,n=new Float64Array(r,0,1),o=new Uint32Array(r,48,1);if(0===n[0]||3200===o[0]||3201===o[0]){var a=0;0===n[0]&&(a=8);var s=new Float64Array(r,a,6),l={left:s[0],top:s[1],right:s[2],bottom:s[3],minHeight:s[4]<s[5]?s[4]:s[5],maxHeight:s[4]>s[5]?s[4]:s[5]},u=new Uint32Array(r,48+a,7),c=u[0],h=u[1],d=u[2],f=u[3],p=u[4],_=u[5],m=u[6],$=new Uint8Array(r,76+a,f*f*4),g=new Float32Array(r,76+a,f*f),v=!1;Math.abs(t._hypsometricSetting._ceiling-Math.round(t._hypsometricSetting._ceiling))<e$27.EPSILON6&&Math.abs(t._hypsometricSetting._floor-Math.round(t._hypsometricSetting._floor))<e$27.EPSILON6&&(v=!0),t._dataBuffer=new Float32Array(p*_*m);for(var y=0;y<m;y++)for(var x=Math.floor(y/h),b=y%h,w=0;w<_;w++)for(var C=d*x+w,T=0;T<p;T++){var S=C*f+(d*b+T);if(g[S]<0||g[S]>1)t._dataBuffer[y*_*p+w*p+T]=d$7;else{var E=g[S]*(t._hypsometricSetting._ceiling-t._hypsometricSetting._floor)+t._hypsometricSetting._floor;v&&(E=Math.round(E)),t._dataBuffer[y*_*p+w*p+T]=E}}t._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST?pt($,t.hypsometricSetting,v):ut$1($);var A={nFormat:c,nSideBlockCount:h,nBlockLength:d,nLength:f,nWidth:p,nHeight:_,nDepth:m,imageArray:$};t._volBounds=l,t._volImageBuffer=A,t._ready=!0}e=null})).otherwise((function(e){}))})).otherwise((function(e){}))},A$2.prototype.loadTexture=function(e){if(!e$28(this._volTexture)){var t=tt$h.NEAREST,i=rt$g.NEAREST;if(this._hypsometricSetting.filterMode!==k$T.FilterMode.NEAREST)t=tt$h.LINEAR,i=rt$g.LINEAR;this._volTexture=new L$17({context:e,width:this._volImageBuffer.nLength,height:this._volImageBuffer.nLength,pixelFormat:V$O.RGBA,flipY:!1,sampler:new n$Y({minificationFilter:t,magnificationFilter:i})}),this._volTexture.copyFrom({width:this._volImageBuffer.nLength,height:this._volImageBuffer.nLength,arrayBufferView:this._volImageBuffer.imageArray}),this._volImageBuffer.imageArray=null}e$28(this._hypsometricTexture)||(this._hypsometricTexture=new L$17({context:e,width:1024,height:64,pixelFormat:V$O.RGBA,flipY:!1}),this._hypsometricTexture.copyFrom({width:1024,height:64,arrayBufferView:this._hypsometricSetting.ColorTable._imageBuffer}))},A$2.prototype.getPixel=function(e,t,i){var r=i*this._volImageBuffer.nWidth*this._volImageBuffer.nHeight+t*this._volImageBuffer.nWidth+e;return this._dataBuffer[r]},A$2.prototype.getValue=function(e){var t=Cesium.Cartographic.fromCartesian(e),i=Cesium.Math.toDegrees(t.longitude),r=Cesium.Math.toDegrees(t.latitude),n=t.height,o=(i-this._volBounds.left)/(this._volBounds.right-this._volBounds.left);if(!(o>1||o<0)){var a=(r-this._volBounds.bottom)/(this._volBounds.top-this._volBounds.bottom);if(!(a>1||a<0)){var s=(n-this._volBounds.minHeight)/(this._volBounds.maxHeight-this._volBounds.minHeight);if(!(s>1||s<0)){var l=o*this._volImageBuffer.nWidth-.5,u=a*this._volImageBuffer.nHeight-.5,c=s*(this._volImageBuffer.nDepth-1),h=Math.floor(l),d=Math.ceil(l),f=Math.floor(u),p=Math.ceil(u),_=Math.floor(c),m=Math.ceil(c);if(h=e$27.clamp(h,0,this._volImageBuffer.nWidth-1),d=e$27.clamp(d,0,this._volImageBuffer.nWidth-1),f=e$27.clamp(f,0,this._volImageBuffer.nHeight-1),p=e$27.clamp(p,0,this._volImageBuffer.nHeight-1),_=e$27.clamp(_,0,this._volImageBuffer.nDepth-1),m=e$27.clamp(m,0,this._volImageBuffer.nDepth-1),this._hypsometricSetting.filterMode===k$T.FilterMode.NEAREST)return l=l-h>.5?d:h,u=u-f>.5?p:f,c=c-_>.5?m:_,M=this.getPixel(l,u,c);var $=this.getPixel(h,f,_),g=this.getPixel(d,f,_);$==d$7&&($=0),g==d$7&&(g=0);var v=$;h!=d&&(v=g*(l-h)+$*(d-l));var y=this.getPixel(h,p,_),x=this.getPixel(d,p,_);y==d$7&&(y=0),x==d$7&&(x=0);var b=y;h!=d&&(b=x*(l-h)+y*(d-l));var w=b;if(f!=p)w=b*(u-f)+v*(p-u);var C=this.getPixel(h,f,m),T=this.getPixel(d,f,m);C==d$7&&(C=0),T==d$7&&(T=0);var S=C;h!=d&&(S=T*(l-h)+C*(d-l));var E=this.getPixel(h,p,m),A=this.getPixel(d,p,m);E==d$7&&(E=0),A==d$7&&(A=0);var P=E;h!=d&&(P=A*(l-h)+E*(d-l));var I=P;if(f!=p)I=P*(u-f)+S*(p-u);var M=I;if(_!=m)M=I*(c-_)+w*(m-c);return M}}}};var ve="#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nuniform vec4 u_tileRangeAndImageSize;\nattribute vec4 volTexCoord;\nvarying vec4 v_volTexCoord;\nvarying vec2 v_textureCoordinates;\nfloat getGlobeDepth(vec4 positionEC){\nvec4 posWC = czm_eyeToWindowCoordinates(positionEC);\nfloat globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));\nif (globeDepth == 0.0){\nreturn 0.0;\n}\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);\nreturn eyeCoordinate.z / eyeCoordinate.w;\n}\nvec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionEC.xy += halfSize;\nreturn positionEC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\nvec2 textureCoordinates = direction;\nvec2 imageSize = u_tileRangeAndImageSize.zw;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\nfloat depthsilon = 10.0;\nfloat globeDepth = getGlobeDepth(positionEC);\nif (globeDepth != 0.0 && positionEC.z + depthsilon < globeDepth)\n{\npositionEC.xyz = vec3(0.0);\n}\nelse{\npositionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction);\n}\ngl_Position = czm_projection * positionEC;\nv_textureCoordinates = textureCoordinates;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth();\n#endif\nv_volTexCoord = volTexCoord;\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5 / u_tileRangeAndImageSize.xy;\nhalfSize *= ((direction * 2.0) - 1.0);\nv_volTexCoord.xy += halfSize;\n}\n",pe$1="#extension GL_EXT_draw_buffers : enable\nuniform sampler2D u_atlas;\nuniform vec4 u_voxelGridLayerColor;\nuniform sampler2D u_colorTable;\nuniform vec4 u_minMaxValueAndFiltration;\nuniform vec3 u_maxVisibleTextureCoord;\nuniform vec3 u_minVisibleTextureCoord;\nvarying vec4 v_volTexCoord;\nvarying vec2 v_textureCoordinates;\nbool getSampleValueForVolume(float volumeValue, out vec4 colorFromColorTable)\n{\nfloat minValue = u_minMaxValueAndFiltration.x;\nfloat maxValue = u_minMaxValueAndFiltration.y;\nfloat minFiltration = u_minMaxValueAndFiltration.z;\nfloat maxFiltration = u_minMaxValueAndFiltration.w;\ncolorFromColorTable = vec4(1.0);\nfloat realValue = minValue + volumeValue * (maxValue - minValue);\nif(realValue > maxFiltration || realValue < minFiltration)\n{\nreturn false;\n}\n#ifdef HAS_COLORTABLE\ncolorFromColorTable = texture2D(u_colorTable, vec2(0.0, 1.0 - realValue)).rgba;\n#endif\nreturn true;\n}\nvoid main()\n{\nvec4 color = texture2D(u_atlas, v_textureCoordinates);\ncolor = czm_gammaCorrect(color);\nif (color.a < 0.005)\n{\ndiscard;\n}\n#ifdef TEXTURECOORD_CLIP\nif(v_volTexCoord.x > u_maxVisibleTextureCoord.x || v_volTexCoord.x < u_minVisibleTextureCoord.x\n|| v_volTexCoord.y > u_maxVisibleTextureCoord.y || v_volTexCoord.y < u_minVisibleTextureCoord.y\n|| v_volTexCoord.z > u_maxVisibleTextureCoord.z || v_volTexCoord.z < u_minVisibleTextureCoord.z)\n{\ndiscard;\n}\n#endif\nvec4 volumeColor = vec4(1.0);\nfloat noValue;\nfloat volumeValue = czm_getVolumeValue(v_volTexCoord.xyz, noValue);\nvec4 colorFromColorTable = vec4(1.0);\nif(!getSampleValueForVolume(volumeValue, colorFromColorTable))\n{\ndiscard;\n}\n#ifdef HAS_COLORTABLE\nvolumeColor = colorFromColorTable;\n#else\nfloat power = volumeValue * 40.0 - 30.0;\nvec3 hdrColor = u_voxelGridLayerColor.rgb * pow(2.0, power);\nvolumeColor.rgb = hdrColor;\n#endif\ncolor.rgb *= volumeColor.rgb;\nczm_writeLogDepth();\n#ifdef OIT\nvec3 Ci = color.rgb * color.a;\nfloat ai = color.a;\nfloat wzi = czm_alphaWeight(ai);\ngl_FragData[0] = vec4(Ci * wzi, ai);\ngl_FragData[1] = vec4(ai * wzi);\n#else\ngl_FragColor = color;\n#endif\n}\n",me=n$X.POSITION_INDEX,ee$1=n$X.NUMBER_OF_PROPERTIES,m$5,Ae={positionHighAndScale:0,positionLowAndRotation:1,volTexCoord:3},ge={direction:0,positionHighAndScale:1,positionLowAndRotation:2,volTexCoord:3},z$2;function c$5(e){e=u$Y(e,u$Y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ee$1),this._maxScale=1,this._allSizedInMeters=!0,this._baseVolume=new i$19,this._baseVolumeWC=new i$19,this._baseVolume2D=new i$19,this._boundingVolume=new i$19,this._boundingVolumeDirty=!1,this._colorCommands=[],this.modelMatrix=y$15.clone(u$Y(e.modelMatrix,y$15.IDENTITY)),this._modelMatrix=y$15.clone(y$15.IDENTITY),this.debugShowBoundingVolume=u$Y(e.debugShowBoundingVolume,!1),this.volumeShaderPredefine=u$Y(e.volumeShaderPredefine,[]),this._volumeShaderPredefine=void 0,this._mode=P$$.SCENE3D,this._highlightColor=e$1S.clone(e$1S.WHITE);var t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture}};var i=this._scene;e$28(i)&&e$28(i.terrainProviderChanged)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener((function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()}),this)),this.transparent=u$Y(e.OIT,!0),this._transparent=void 0,this._postRender=e.postRender}function te(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function W$2(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function ye(e){var t=e.cache.billboardCollection_indexBufferBatched;if(e$28(t))return t;for(var i=new Uint16Array(98298),r=0,n=0;r<98298;r+=6,n+=4)i[r]=n,i[r+1]=n+1,i[r+2]=n+2,i[r+3]=n+0,i[r+4]=n+2,i[r+5]=n+3;return(t=h$W.createIndexBuffer({context:e,typedArray:i,usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function Te$1(e){var t=e.cache.billboardCollection_indexBufferInstanced;return e$28(t)||((t=h$W.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:A$1c.STATIC_DRAW,indexDatatype:ce$v.UNSIGNED_SHORT})).vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Ie$1(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return e$28(t)||((t=h$W.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:A$1c.STATIC_DRAW})).vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}function Se(e,t,i,r){var n=[{index:m$5.positionHighAndScale,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:A$1c.STATIC_DRAW},{index:m$5.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:A$1c.STATIC_DRAW},{index:m$5.volTexCoord,componentsPerAttribute:4,componentDatatype:S$W.FLOAT,usage:A$1c.STATIC_DRAW}];return i&&n.push({index:m$5.direction,componentsPerAttribute:2,componentDatatype:S$W.FLOAT,vertexBuffer:Ie$1(e)}),e$28(r)&&n.push({index:m$5.a_batchId,componentsPerAttribute:1,componentDatatyps:S$W.FLOAT,bufferUsage:A$1c.STATIC_DRAW}),new f$G(e,n,i?t:4*t,i)}Object.defineProperties(c$5.prototype,{length:{get:function(){return W$2(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),c$5.prototype.add=function(e){var t=new n$X(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},c$5.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},c$5.prototype.removeAll=function(){te(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},c$5.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},c$5.prototype.contains=function(e){return e$28(e)&&e._billboardCollection===this},c$5.prototype.get=function(e){if(!e$28(e))throw new t$Z("index is required.");return W$2(this),this._billboards[e]};var H=new i$Q;function re(e,t,i,r,n){var o,a=r[m$5.positionHighAndScale],s=r[m$5.positionLowAndRotation],l=n._getActualPosition();e._mode===P$$.SCENE3D&&(i$19.expand(e._baseVolume,l,e._baseVolume),e._boundingVolumeDirty=!0),i$Q.fromCartesian(l,H);var u=n.scale,c=n.rotation;0!==c&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,u);var h=H.high,d=H.low;e._instanced?(a(o=n._index,h.x,h.y,h.z,u),s(o,d.x,d.y,d.z,c)):(a((o=4*n._index)+0,h.x,h.y,h.z,u),a(o+1,h.x,h.y,h.z,u),a(o+2,h.x,h.y,h.z,u),a(o+3,h.x,h.y,h.z,u),s(o+0,d.x,d.y,d.z,c),s(o+1,d.x,d.y,d.z,c),s(o+2,d.x,d.y,d.z,c),s(o+3,d.x,d.y,d.z,c))}function De$1(e,t,i,r,n){var o,a=r[m$5.volTexCoord],s=0,l=0,u=0;e$28(n._volTexCoord)&&(s=n._volTexCoord.x,l=n._volTexCoord.y,u=n._volTexCoord.z),e._instanced?a(o=n._index,s,l,u,0):(a((o=4*n._index)+0,s,l,u,0),a(o+1,s,l,u,0),a(o+2,s,l,u,0),a(o+3,s,l,u,0))}function be(e,t,i,r,n){re(e,t,i,r,n),De$1(e,t,i,r,n)}function G$1(e,t,i,r,n,o){var a;r.mode===P$$.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;for(var s=[],l=0;l<i;++l){var u=t[l],c=u.position,h=n$X._computeActualPosition(u,c,r,n);e$28(h)&&(u._setActualPosition(h),o?s.push(h):i$19.expand(a,h,a))}o&&i$19.fromPoints(s,a)}function Ce(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==P$$.SCENE3D&&!y$15.equals(o,e.modelMatrix)?(e._mode=i,y$15.clone(e.modelMatrix,o),e._createVertexArray=!0,(i===P$$.SCENE3D||i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&G$1(e,r,r.length,t,o,!0)):i===P$$.MORPHING?G$1(e,r,r.length,t,o,!0):(i===P$$.SCENE2D||i===P$$.COLUMBUS_VIEW)&&G$1(e,n,e._billboardsToUpdateIndex,t,o,!1)}function Ve$2(e){var t=e._volumeShaderPredefine,i=e.volumeShaderPredefine;if(!e$28(t)||t.length!==i.length)return!0;for(var r=0;r<i.length;r++)if(t[r]!=i[r])return!0;return!1}var Ee=[],Module$1;c$5.prototype.update=function(e){W$2(this);var t=this._billboards,i=t.length,r=e.context;this._instanced=r.instancedArrays,m$5=this._instanced?ge:Ae,z$2=this._instanced?Te$1:ye;var n=this._textureAtlas;if(!e$28(n)){n=this._textureAtlas=new w$q({context:r});for(var o=0;o<i;++o)t[o]._loadImage()}var a=n.textureCoordinates;if(0!==a.length){Ce(this,e),i=(t=this._billboards).length;var s=this._billboardsToUpdate,l=this._billboardsToUpdateIndex,u=this._propertiesChanged,c=n.guid,h=this._createVertexArray||this._textureAtlasGUID!==c;this._textureAtlasGUID=c;var d,f=e.passes;if(f.pick,h){this._createVertexArray=!1;for(var p=0;p<ee$1;++p)u[p]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Se(r,i,this._instanced,this._batchTable),d=this._vaf.writers;for(var _=0;_<i;++_){var m=this._billboards[_];m._dirty=!1,be(this,r,a,d,m)}this._vaf.commit(z$2(r))}this._billboardsToUpdateIndex=0}else if(l>0){var $=Ee;$.length=0,u[me]&&$.push(re);var g=$.length;if(d=this._vaf.writers,l/i>.1){for(var v=0;v<l;++v){var y=s[v];y._dirty=!1;for(var x=0;x<g;++x)$[x](this,r,a,d,y)}this._vaf.commit(z$2(r))}else{for(var b=0;b<l;++b){var w=s[b];w._dirty=!1;for(var C=0;C<g;++C)$[C](this,r,a,d,w);this._instanced?this._vaf.subCommit(w._index,1):this._vaf.subCommit(4*w._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(l>1.5*i&&(s.length=i),e$28(this._vaf)&&e$28(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,i$19.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var T,S=y$15.IDENTITY;e.mode===P$$.SCENE3D?(S=this.modelMatrix,T=i$19.clone(this._baseVolumeWC,this._boundingVolume)):T=i$19.clone(this._baseVolume2D,this._boundingVolume);var E=this._transparent!==this.transparent;this._transparent=this.transparent;var A,P,I=Ve$2(this);if(this._volumeShaderPredefine=this.volumeShaderPredefine,E&&(this._rsTranslucent=u$R.fromCache({depthTest:{enabled:!1,func:de$y.LESS},depthMask:!this._transparent,blending:Ee$n.ALPHA_BLEND})),E||I)A=new a$$({defines:this._volumeShaderPredefine,sources:[ve]}),this._instanced&&A.defines.push("INSTANCED"),P=new a$$({defines:this._volumeShaderPredefine,sources:[pe$1]}),this._transparent&&P.defines.push("OIT"),this._sp=S$T.replaceCache({context:r,shaderProgram:this._sp,vertexShaderSource:A,fragmentShaderSource:P,attributeLocations:m$5});var M=e.commandList;if(f.render||f.pick){var O=this._colorCommands,D=this._vaf.va,R=D.length,L=this._uniforms;O.length=R;for(var B=0;B<R;++B){var N=O[B];e$28(N)||(N=O[B]=new r$15),N.pass=Le$p.Voxel_Billboard,N.boundingVolume=T,N.modelMatrix=S,N.count=D[B].indicesCount,N.shaderProgram=this._sp,N.uniformMap=L,N.vertexArray=D[B].va,N.renderState=this._rsTranslucent,N.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(N.count=6,N.instanceCount=i),M.push(N)}}}}},c$5.prototype.isDestroyed=function(){return!1},c$5.prototype.destroy=function(){return e$28(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),te(this._billboards),i$Z(this)},Module$1||(Module$1=(typeof Module$1<"u"?Module$1:null)||{});var moduleOverrides$1={};for(var key in Module$1)Module$1.hasOwnProperty(key)&&(moduleOverrides$1[key]=Module$1[key]);var ENVIRONMENT_IS_WEB$1=!1,ENVIRONMENT_IS_WORKER$1=!1,ENVIRONMENT_IS_NODE$1=!1,ENVIRONMENT_IS_SHELL$1=!1,nodeFS,nodePath$1;if(Module$1.ENVIRONMENT)if("WEB"===Module$1.ENVIRONMENT)ENVIRONMENT_IS_WEB$1=!0;else if("WORKER"===Module$1.ENVIRONMENT)ENVIRONMENT_IS_WORKER$1=!0;else if("NODE"===Module$1.ENVIRONMENT)ENVIRONMENT_IS_NODE$1=!0;else{if("SHELL"!==Module$1.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL$1=!0}else ENVIRONMENT_IS_WEB$1="object"==typeof window,ENVIRONMENT_IS_WORKER$1="function"==typeof importScripts,ENVIRONMENT_IS_NODE$1="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB$1&&!ENVIRONMENT_IS_WORKER$1,ENVIRONMENT_IS_SHELL$1=!ENVIRONMENT_IS_WEB$1&&!ENVIRONMENT_IS_NODE$1&&!ENVIRONMENT_IS_WORKER$1;if(ENVIRONMENT_IS_NODE$1)Module$1.print||(Module$1.print=console.log),Module$1.printErr||(Module$1.printErr=console.warn),Module$1.read=function(e,t){nodeFS||(nodeFS=require("fs")),nodePath$1||(nodePath$1=require("path")),e=nodePath$1.normalize(e);var i=nodeFS.readFileSync(e);return t?i:i.toString()},Module$1.readBinary=function(e){var t=Module$1.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert$1(t.buffer),t},Module$1.load=function(e){globalEval(read(e))},Module$1.thisProgram||(process.argv.length>1?Module$1.thisProgram=process.argv[1].replace(/\\/g,"/"):Module$1.thisProgram="unknown-program"),Module$1.arguments=process.argv.slice(2),typeof module<"u"&&(module.exports=Module$1),process.on("uncaughtException",(function(e){if(!(e instanceof ExitStatus$1))throw e})),Module$1.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL$1)Module$1.print||(Module$1.print=print),typeof printErr<"u"&&(Module$1.printErr=printErr),typeof read<"u"?Module$1.read=read:Module$1.read=function(){throw"no read() available"},Module$1.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert$1("object"==typeof t),t},typeof scriptArgs<"u"?Module$1.arguments=scriptArgs:typeof arguments<"u"&&(Module$1.arguments=arguments),"function"==typeof quit&&(Module$1.quit=function(e,t){quit(e)});else{if(!ENVIRONMENT_IS_WEB$1&&!ENVIRONMENT_IS_WORKER$1)throw"Unknown runtime environment. Where are we?";if(Module$1.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER$1&&(Module$1.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module$1.readAsync=function(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)},typeof arguments<"u"&&(Module$1.arguments=arguments),typeof console<"u")Module$1.print||(Module$1.print=function(e){console.log(e)}),Module$1.printErr||(Module$1.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module$1.print||(Module$1.print=TRY_USE_DUMP&&typeof dump<"u"?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER$1&&(Module$1.load=importScripts),typeof Module$1.setWindowTitle>"u"&&(Module$1.setWindowTitle=function(e){document.title=e})}function globalEval(e){eval.call(null,e)}for(var key in!Module$1.load&&Module$1.read&&(Module$1.load=function(e){globalEval(Module$1.read(e))}),Module$1.print||(Module$1.print=function(){}),Module$1.printErr||(Module$1.printErr=Module$1.print),Module$1.arguments||(Module$1.arguments=[]),Module$1.thisProgram||(Module$1.thisProgram="./this.program"),Module$1.quit||(Module$1.quit=function(e,t){throw t}),Module$1.print=Module$1.print,Module$1.printErr=Module$1.printErr,Module$1.preRun=[],Module$1.postRun=[],moduleOverrides$1)moduleOverrides$1.hasOwnProperty(key)&&(Module$1[key]=moduleOverrides$1[key]);moduleOverrides$1=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":case"float":return 4;case"i64":case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert$1(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert$1(4==(7&e)),e+=4):assert$1(0==(3&e)),e},getAlignSize:function(e,t,i){return i||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,i){return i&&i.length?Module$1["dynCall_"+e].apply(null,[t].concat(i)):Module$1["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module$1.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert$1(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var i=Runtime.funcWrappers[t];return i[e]||(1===t.length?i[e]=function(){return Runtime.dynCall(t,e)}:2===t.length?i[e]=function(i){return Runtime.dynCall(t,e,[i])}:i[e]=function(){return Runtime.dynCall(t,e,Array.prototype.slice.call(arguments))}),i[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+e|0)+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+e|0)+15&-16,t},dynamicAlloc:function(e){var t=HEAP32$1[DYNAMICTOP_PTR>>2],i=-16&(t+e+15|0);if((HEAP32$1[DYNAMICTOP_PTR>>2]=i,i>=TOTAL_MEMORY)&&!enlargeMemory())return HEAP32$1[DYNAMICTOP_PTR>>2]=t,0;return t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,i){return i?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module$1.Runtime=Runtime;var ABORT$1=0,cwrap$1,ccall$1;function assert$1(e,t){e||abort$1("Assertion failed: "+t)}function getCFunc$1(ident){var func=Module$1["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert$1(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue$1(e,t,i,r){switch("*"===(i=i||"i8").charAt(i.length-1)&&(i="i32"),i){case"i1":case"i8":HEAP8$1[e>>0]=t;break;case"i16":HEAP16$1[e>>1]=t;break;case"i32":HEAP32$1[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32$1[e>>2]=tempI64[0],HEAP32$1[e+4>>2]=tempI64[1];break;case"float":HEAPF32$1[e>>2]=t;break;case"double":HEAPF64$1[e>>3]=t;break;default:abort$1("invalid type for setValue: "+i)}}function getValue$1(e,t,i){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8$1[e>>0];case"i16":return HEAP16$1[e>>1];case"i32":case"i64":return HEAP32$1[e>>2];case"float":return HEAPF32$1[e>>2];case"double":return HEAPF64$1[e>>3];default:abort$1("invalid type for setValue: "+t)}return null}(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory$1(e,t),t},stringToC:function(e){var t=0;if(null!=e&&0!==e){var i=1+(e.length<<2);stringToUTF8$1(e,t=Runtime.stackAlloc(i),i)}return t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall$1=function(e,t,i,r,n){var o=getCFunc$1(e),a=[],s=0;if(r)for(var l=0;l<r.length;l++){var u=toC[i[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(r[l])):a[l]=r[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(s)}));Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var e in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}cwrap$1=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc$1(ident),numericArgs=argTypes.every((function(e){return"number"===e})),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map((function(e,t){return"$"+t})),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");"}}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}})(),Module$1.ccall=ccall$1,Module$1.cwrap=cwrap$1,Module$1.setValue=setValue$1,Module$1.getValue=getValue$1;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,t,i,r){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=i==ALLOC_NONE?r:["function"==typeof _malloc$1?_malloc$1:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,s?1:t.length)),n){var l;r=a;for(assert$1(0==(3&a)),l=a+(-4&o);r<l;r+=4)HEAP32$1[r>>2]=0;for(l=a+o;r<l;)HEAP8$1[r++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8$1.set(e,a):HEAPU8$1.set(new Uint8Array(e),a),a;for(var u,c,h,d=0;d<o;){var f=e[d];("function"==typeof f&&(f=Runtime.getFunctionIndex(f)),0!==(u=s||t[d]))?("i64"==u&&(u="i32"),setValue$1(a+d,f,u),h!==u&&(c=Runtime.getNativeTypeSize(u),h=u),d+=c):d++}return a}function getMemory(e){return staticSealed?runtimeInitialized$1?_malloc$1(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var i,r=0,n=0;r|=i=HEAPU8$1[e+n>>0],(0!=i||t)&&(n++,!t||n!=t););t||(t=n);var o="";if(r<128){for(var a,s=1024;t>0;)a=String.fromCharCode.apply(String,HEAPU8$1.subarray(e,e+Math.min(t,s))),o=o?o+a:a,e+=s,t-=s;return o}return Module$1.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var i=HEAP8$1[e++>>0];if(!i)return t;t+=String.fromCharCode(i)}}function stringToAscii(e,t){return writeAsciiToMemory$1(e,t,!1)}Module$1.ALLOC_NORMAL=ALLOC_NORMAL,Module$1.ALLOC_STACK=ALLOC_STACK,Module$1.ALLOC_STATIC=ALLOC_STATIC,Module$1.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module$1.ALLOC_NONE=ALLOC_NONE,Module$1.allocate=allocate,Module$1.getMemory=getMemory,Module$1.Pointer_stringify=Pointer_stringify,Module$1.AsciiToString=AsciiToString,Module$1.stringToAscii=stringToAscii;var UTF8Decoder$1=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function UTF8ArrayToString$1(e,t){for(var i=t;e[i];)++i;if(i-t>16&&e.subarray&&UTF8Decoder$1)return UTF8Decoder$1.decode(e.subarray(t,i));for(var r,n,o,a,s,l="";;){if(!(r=e[t++]))return l;if(128&r)if(n=63&e[t++],192!=(224&r))if(o=63&e[t++],224==(240&r)?r=(15&r)<<12|n<<6|o:(a=63&e[t++],240==(248&r)?r=(7&r)<<18|n<<12|o<<6|a:(s=63&e[t++],248==(252&r)?r=(3&r)<<24|n<<18|o<<12|a<<6|s:r=(1&r)<<30|n<<24|o<<18|a<<12|s<<6|63&e[t++])),r<65536)l+=String.fromCharCode(r);else{var u=r-65536;l+=String.fromCharCode(55296|u>>10,56320|1023&u)}else l+=String.fromCharCode((31&r)<<6|n);else l+=String.fromCharCode(r)}}function UTF8ToString$1(e){return UTF8ArrayToString$1(HEAPU8$1,e)}function stringToUTF8Array$1(e,t,i,r){if(!(r>0))return 0;for(var n=i,o=i+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(i>=o)break;t[i++]=s}else if(s<=2047){if(i+1>=o)break;t[i++]=192|s>>6,t[i++]=128|63&s}else if(s<=65535){if(i+2>=o)break;t[i++]=224|s>>12,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=2097151){if(i+3>=o)break;t[i++]=240|s>>18,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=67108863){if(i+4>=o)break;t[i++]=248|s>>24,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else{if(i+5>=o)break;t[i++]=252|s>>30,t[i++]=128|s>>24&63,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}}return t[i]=0,i-n}function stringToUTF8$1(e,t,i){return stringToUTF8Array$1(e,HEAPU8$1,t,i)}function lengthBytesUTF8$1(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++i)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}function demangle$1(e){var t=Module$1.___cxa_demangle||Module$1.__cxa_demangle;if(t){try{var i=e.substr(1),r=lengthBytesUTF8$1(i)+1,n=_malloc$1(r);stringToUTF8$1(i,n,r);var o=_malloc$1(4),a=t(n,0,0,o);if(0===getValue$1(o,"i32")&&a)return Pointer_stringify(a)}catch{}finally{n&&_free(n),o&&_free(o),a&&_free(a)}return e}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll$1(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle$1(e);return e===t?e:e+" ["+t+"]"}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module$1.extraStackTrace&&(e+="\n"+Module$1.extraStackTrace()),demangleAll$1(e)}Module$1.UTF8ArrayToString=UTF8ArrayToString$1,Module$1.UTF8ToString=UTF8ToString$1,Module$1.stringToUTF8Array=stringToUTF8Array$1,Module$1.stringToUTF8=stringToUTF8$1,Module$1.lengthBytesUTF8=lengthBytesUTF8$1,typeof TextDecoder<"u"&&new TextDecoder("utf-16le"),Module$1.stackTrace=stackTrace;var WASM_PAGE_SIZE=65536,ASMJS_PAGE_SIZE=16777216,MIN_TOTAL_MEMORY=16777216,HEAP,buffer$1,HEAP8$1,HEAPU8$1,HEAP16$1,HEAPU16,HEAP32$1,HEAPU32$1,HEAPF32$1,HEAPF64$1,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR,byteLength;function alignUp(e,t){return e%t>0&&(e+=t-e%t),e}function updateGlobalBuffer(e){Module$1.buffer=buffer$1=e}function updateGlobalBufferViews(){Module$1.HEAP8=HEAP8$1=new Int8Array(buffer$1),Module$1.HEAP16=HEAP16$1=new Int16Array(buffer$1),Module$1.HEAP32=HEAP32$1=new Int32Array(buffer$1),Module$1.HEAPU8=HEAPU8$1=new Uint8Array(buffer$1),Module$1.HEAPU16=HEAPU16=new Uint16Array(buffer$1),Module$1.HEAPU32=HEAPU32$1=new Uint32Array(buffer$1),Module$1.HEAPF32=HEAPF32$1=new Float32Array(buffer$1),Module$1.HEAPF64=HEAPF64$1=new Float64Array(buffer$1)}function abortOnCannotGrowMemory(){abort$1("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){var e=Module$1.usingWasm?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE,t=2147483648-e;if(HEAP32$1[DYNAMICTOP_PTR>>2]>t)return!1;var i=TOTAL_MEMORY;for(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);TOTAL_MEMORY<HEAP32$1[DYNAMICTOP_PTR>>2];)TOTAL_MEMORY=TOTAL_MEMORY<=536870912?alignUp(2*TOTAL_MEMORY,e):Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,e),t);var r=Module$1.reallocBuffer(TOTAL_MEMORY);return r&&r.byteLength==TOTAL_MEMORY?(updateGlobalBuffer(r),updateGlobalBufferViews(),!0):(TOTAL_MEMORY=i,!1)}STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1,Module$1.reallocBuffer||(Module$1.reallocBuffer=function(e){var t;try{if(ArrayBuffer.transfer)t=ArrayBuffer.transfer(buffer$1,e);else{var i=HEAP8$1;t=new ArrayBuffer(e),new Int8Array(t).set(i)}}catch{return!1}return!!_emscripten_replace_memory(t)&&t});try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(d){byteLength=function(e){return e.byteLength}}var TOTAL_STACK=Module$1.TOTAL_STACK||5242880,TOTAL_MEMORY=Module$1.TOTAL_MEMORY||16777216;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module$1.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer$1=Module$1.buffer?Module$1.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32$1[0]=1668509029,HEAP16$1[1]=25459,115!==HEAPU8$1[2]||99!==HEAPU8$1[3])throw"Runtime error: expected the system to be little-endian!";function callRuntimeCallbacks$1(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?Module$1.dynCall_v(i):Module$1.dynCall_vi(i,t.arg):i(void 0===t.arg?null:t.arg)}else t()}}Module$1.HEAP=HEAP,Module$1.buffer=buffer$1,Module$1.HEAP8=HEAP8$1,Module$1.HEAP16=HEAP16$1,Module$1.HEAP32=HEAP32$1,Module$1.HEAPU8=HEAPU8$1,Module$1.HEAPU16=HEAPU16,Module$1.HEAPU32=HEAPU32$1,Module$1.HEAPF32=HEAPF32$1,Module$1.HEAPF64=HEAPF64$1;var __ATPRERUN__$1=[],__ATINIT__$1=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__$1=[],runtimeInitialized$1=!1;function preRun$1(){if(Module$1.preRun)for("function"==typeof Module$1.preRun&&(Module$1.preRun=[Module$1.preRun]);Module$1.preRun.length;)addOnPreRun$1(Module$1.preRun.shift());callRuntimeCallbacks$1(__ATPRERUN__$1)}function ensureInitRuntime(){runtimeInitialized$1||(runtimeInitialized$1=!0,callRuntimeCallbacks$1(__ATINIT__$1))}function preMain(){callRuntimeCallbacks$1(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks$1(__ATEXIT__)}function postRun$1(){if(Module$1.postRun)for("function"==typeof Module$1.postRun&&(Module$1.postRun=[Module$1.postRun]);Module$1.postRun.length;)addOnPostRun$1(Module$1.postRun.shift());callRuntimeCallbacks$1(__ATPOSTRUN__$1)}function addOnPreRun$1(e){__ATPRERUN__$1.unshift(e)}function addOnInit$1(e){__ATINIT__$1.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun$1(e){__ATPOSTRUN__$1.unshift(e)}function intArrayFromString$1(e,t,i){var r=i>0?i:lengthBytesUTF8$1(e)+1,n=new Array(r),o=stringToUTF8Array$1(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,i){var r,n;Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!"),i&&(n=t+lengthBytesUTF8$1(e),r=HEAP8$1[n]),stringToUTF8$1(e,t,1/0),i&&(HEAP8$1[n]=r)}function writeArrayToMemory$1(e,t){HEAP8$1.set(e,t)}function writeAsciiToMemory$1(e,t,i){for(var r=0;r<e.length;++r)HEAP8$1[t++>>0]=e.charCodeAt(r);i||(HEAP8$1[t>>0]=0)}Module$1.addOnPreRun=addOnPreRun$1,Module$1.addOnInit=addOnInit$1,Module$1.addOnPreMain=addOnPreMain,Module$1.addOnExit=addOnExit,Module$1.addOnPostRun=addOnPostRun$1,Module$1.intArrayFromString=intArrayFromString$1,Module$1.intArrayToString=intArrayToString,Module$1.writeStringToMemory=writeStringToMemory,Module$1.writeArrayToMemory=writeArrayToMemory$1,Module$1.writeAsciiToMemory=writeAsciiToMemory$1,(!Math.imul||-5!==Math.imul(4294967295,5))&&(Math.imul=function(e,t){var i=65535&e,r=65535&t;return i*r+((e>>>16)*r+i*(t>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_min=Math.min,runDependencies$1=0,dependenciesFulfilled$1=null;function addRunDependency$1(e){runDependencies$1++,Module$1.monitorRunDependencies&&Module$1.monitorRunDependencies(runDependencies$1)}function removeRunDependency$1(e){if(runDependencies$1--,Module$1.monitorRunDependencies&&Module$1.monitorRunDependencies(runDependencies$1),0==runDependencies$1&&dependenciesFulfilled$1){var t=dependenciesFulfilled$1;dependenciesFulfilled$1=null,t()}}Module$1.addRunDependency=addRunDependency$1,Module$1.removeRunDependency=removeRunDependency$1,Module$1.preloadedImages={},Module$1.preloadedAudios={},STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+6192,__ATINIT__$1.push(),allocate([228,2,0,0,81,16,0,0,12,3,0,0,177,16,0,0,32,0,0,0,0,0,0,0,12,3,0,0,94,16,0,0,48,0,0,0,0,0,0,0,228,2,0,0,127,16,0,0,12,3,0,0,140,16,0,0,16,0,0,0,0,0,0,0,12,3,0,0,183,17,0,0,32,0,0,0,0,0,0,0,12,3,0,0,147,17,0,0,72,0,0,0,0,0,0,0,108,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,32,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,40,20,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,56,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,83,116,57,101,120,99,101,112,116,105,111,110,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _abort$1(){Module$1.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}STATICTOP+=16;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){if(EXCEPTIONS.infos[t].adjusted===e)return t}return e},addRef:function(e){e&&EXCEPTIONS.infos[e].refcount++},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert$1(t.refcount>0),t.refcount--,0===t.refcount&&!t.rethrown&&(t.destructor&&Module$1.dynCall_vi(t.destructor,e),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){e&&(EXCEPTIONS.infos[e].refcount=0)}};function ___cxa_begin_catch(e){var t=EXCEPTIONS.infos[e];return t&&!t.caught&&(t.caught=!0,__ZSt18uncaught_exceptionv.uncaught_exception--),t&&(t.rethrown=!1),EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),!(e in _pthread_once.seen)&&(Module$1.dynCall_v(t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big$1(e,t,i){return HEAPU8$1.set(HEAPU8$1.subarray(t,t+i),e),e}var SYSCALLS$1={varargs:0,get:function(e){return SYSCALLS$1.varargs+=4,HEAP32$1[SYSCALLS$1.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS$1.get())},get64:function(){var e=SYSCALLS$1.get(),t=SYSCALLS$1.get();return assert$1(e>=0?0===t:-1===t),e},getZero:function(){assert$1(0===SYSCALLS$1.get())}};function ___syscall6(e,t){SYSCALLS$1.varargs=t;try{var i=SYSCALLS$1.getStreamFromFD();return FS.close(i),0}catch(e){return(typeof FS>"u"||!(e instanceof FS.ErrnoError))&&abort$1(e),-e.errno}}var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),PTHREAD_SPECIFIC={};function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module$1.___errno_location&&(HEAP32$1[Module$1.___errno_location()>>2]=e),e}var PTHREAD_SPECIFIC_NEXT_KEY=1,ERRNO_CODES$1={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _pthread_key_create(e,t){return 0==e?ERRNO_CODES$1.EINVAL:(HEAP32$1[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function ___resumeException(e){throw EXCEPTIONS.last||(EXCEPTIONS.last=e),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var e=EXCEPTIONS.last;if(!e)return Runtime.setTempRet0(0),0;var t=EXCEPTIONS.infos[e],i=t.type;if(!i)return Runtime.setTempRet0(0),0|e;var r=Array.prototype.slice.call(arguments);Module$1.___cxa_is_pointer_type(i),___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc$1(4)),HEAP32$1[___cxa_find_matching_catch.buffer>>2]=e,e=___cxa_find_matching_catch.buffer;for(var n=0;n<r.length;n++)if(r[n]&&Module$1.___cxa_can_catch(r[n],i,e))return e=HEAP32$1[e>>2],t.adjusted=e,Runtime.setTempRet0(r[n]),0|e;return e=HEAP32$1[e>>2],Runtime.setTempRet0(i),0|e}function ___gxx_personality_v0(){}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES$1.EINVAL}function ___syscall140(e,t){SYSCALLS$1.varargs=t;try{var i=SYSCALLS$1.getStreamFromFD(),r=(SYSCALLS$1.get(),SYSCALLS$1.get()),n=SYSCALLS$1.get(),o=SYSCALLS$1.get(),a=r;return FS.llseek(i,a,o),HEAP32$1[n>>2]=i.position,i.getdents&&0===a&&0===o&&(i.getdents=null),0}catch(e){return(typeof FS>"u"||!(e instanceof FS.ErrnoError))&&abort$1(e),-e.errno}}function ___syscall146(e,t){SYSCALLS$1.varargs=t;try{var i=SYSCALLS$1.get(),r=SYSCALLS$1.get(),n=SYSCALLS$1.get(),o=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,t){var i=___syscall146.buffers[e];assert$1(i),0===t||10===t?((1===e?Module$1.print:Module$1.printErr)(UTF8ArrayToString$1(i,0)),i.length=0):i.push(t)});for(var a=0;a<n;a++){for(var s=HEAP32$1[r+8*a>>2],l=HEAP32$1[r+(8*a+4)>>2],u=0;u<l;u++)___syscall146.printChar(i,HEAPU8$1[s+u]);o+=l}return o}catch(e){return(typeof FS>"u"||!(e instanceof FS.ErrnoError))&&abort$1(e),-e.errno}}function ___syscall54(e,t){SYSCALLS$1.varargs=t;try{return 0}catch(e){return(typeof FS>"u"||!(e instanceof FS.ErrnoError))&&abort$1(e),-e.errno}}function invoke_iiii(e,t,i,r){try{return Module$1.dynCall_iiii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_viiiii$1(e,t,i,r,n,o){try{Module$1.dynCall_viiiii(e,t,i,r,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_vi$1(e,t){try{Module$1.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_ii$1(e,t){try{return Module$1.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_viii$1(e,t,i,r){try{Module$1.dynCall_viii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_v(e){try{Module$1.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_viiiiii(e,t,i,r,n,o,a){try{Module$1.dynCall_viiiiii(e,t,i,r,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}function invoke_viiii(e,t,i,r,n){try{Module$1.dynCall_viiii(e,t,i,r,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module$1.setThrew(1,0)}}__ATEXIT__.push((function(){var e=Module$1._fflush;e&&e(0);var t=___syscall146.printChar;if(t){var i=___syscall146.buffers;i[1].length&&t(1,10),i[2].length&&t(2,10)}})),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32$1[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module$1.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module$1.asmLibraryArg={abort:abort$1,assert:assert$1,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii$1,invoke_vi:invoke_vi$1,invoke_ii:invoke_ii$1,invoke_viii:invoke_viii$1,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_getspecific:_pthread_getspecific,___syscall54:___syscall54,_pthread_setspecific:_pthread_setspecific,___gxx_personality_v0:___gxx_personality_v0,___syscall6:___syscall6,___setErrNo:___setErrNo,_abort:_abort$1,___cxa_begin_catch:___cxa_begin_catch,_pthread_once:_pthread_once,_emscripten_memcpy_big:_emscripten_memcpy_big$1,_pthread_key_create:_pthread_key_create,___syscall140:___syscall140,___resumeException:___resumeException,___cxa_find_matching_catch:___cxa_find_matching_catch,___syscall146:___syscall146,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT$1,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8};var asm=function(e,t,i){var r=e.Int8Array,n=new r(i),o=e.Int16Array,a=new o(i),s=e.Int32Array,l=new s(i),u=e.Uint8Array,c=new u(i),h=e.Uint16Array,d=new h(i),f=e.Uint32Array;new f(i);var p=e.Float32Array;new p(i);var _=e.Float64Array,m=new _(i),$=e.byteLength,g=0|t.DYNAMICTOP_PTR,v=0|t.tempDoublePtr;t.ABORT;var y=0|t.STACKTOP;t.STACK_MAX;var x=0|t.cttz_i8;e.NaN,e.Infinity;var b=0;e.Math.floor,e.Math.abs,e.Math.sqrt,e.Math.pow,e.Math.cos,e.Math.sin,e.Math.tan,e.Math.acos,e.Math.asin,e.Math.atan,e.Math.atan2,e.Math.exp,e.Math.log,e.Math.ceil;var w=e.Math.imul;e.Math.min,e.Math.max;var C=e.Math.clz32,T=t.abort;t.assert;var S=t.enlargeMemory,E=t.getTotalMemory,A=t.abortOnCannotGrowMemory;t.invoke_iiii,t.invoke_viiiii,t.invoke_vi,t.invoke_ii,t.invoke_viii,t.invoke_v,t.invoke_viiiiii,t.invoke_viiii;var P=t._pthread_getspecific,I=t.___syscall54,M=t._pthread_setspecific;t.___gxx_personality_v0;var O=t.___syscall6,D=t.___setErrNo,R=t._abort;t.___cxa_begin_catch;var L=t._pthread_once,B=t._emscripten_memcpy_big,N=t._pthread_key_create,F=t.___syscall140;t.___resumeException,t.___cxa_find_matching_catch;var z=t.___syscall146;function k(e){e|=0;var t,i=0,r=0,n=0,o=0,a=0,s=0,u=0,c=0,h=0,d=0,f=0,p=0,_=0,m=0,$=0,g=0,v=0,x=0,b=0,w=0;t=y,y=y+16|0,p=t;do{if(e>>>0<245){if(e=(h=e>>>0<11?16:e+11&-8)>>>3,3&(r=(f=0|l[1144])>>>e)|0)return n=0|l[(r=(e=4616+((i=(1&r^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|e)==(0|(a=0|l[(o=n+8|0)>>2]))?l[1144]=f&~(1<<i):(l[a+12>>2]=e,l[r>>2]=a),w=i<<3,l[n+4>>2]=3|w,l[(w=n+w+4|0)>>2]=1|l[w>>2],y=t,0|(w=o);if(h>>>0>(d=0|l[1146])>>>0){if(0|r)return i=((i=r<<e&((i=2<<e)|0-i))&0-i)-1|0,o=0|l[(e=(i=4616+((n=((r=(i>>>=s=i>>>12&16)>>>5&8)|s|(o=(i>>>=r)>>>2&4)|(e=(i>>>=o)>>>1&2)|(n=(i>>>=e)>>>1&1))+(i>>>n)|0)<<1<<2)|0)+8|0)>>2],(0|i)==(0|(r=0|l[(s=o+8|0)>>2]))?(e=f&~(1<<n),l[1144]=e):(l[r+12>>2]=i,l[e>>2]=r,e=f),a=(n<<3)-h|0,l[o+4>>2]=3|h,l[(n=o+h|0)+4>>2]=1|a,l[n+a>>2]=a,0|d&&(o=0|l[1149],r=4616+((i=d>>>3)<<1<<2)|0,e&(i=1<<i)?i=0|l[(e=r+8|0)>>2]:(l[1144]=e|i,i=r,e=r+8|0),l[e>>2]=o,l[i+12>>2]=o,l[o+8>>2]=i,l[o+12>>2]=r),l[1146]=a,l[1149]=n,y=t,0|(w=s);if(u=0|l[1145]){if(r=(u&0-u)-1|0,e=0|l[4880+(((a=(r>>>=s=r>>>12&16)>>>5&8)|s|(c=(r>>>=a)>>>2&4)|(n=(r>>>=c)>>>1&2)|(e=(r>>>=n)>>>1&1))+(r>>>e)<<2)>>2],r=(-8&l[e+4>>2])-h|0,n=0|l[e+16+((0==(0|l[e+16>>2])&1)<<2)>>2]){do{r=(c=(s=(-8&l[n+4>>2])-h|0)>>>0<r>>>0)?s:r,e=c?n:e,n=0|l[n+16+((0==(0|l[n+16>>2])&1)<<2)>>2]}while(0!=(0|n));c=e,a=r}else c=e,a=r;if(c>>>0<(s=c+h|0)>>>0){o=0|l[c+24>>2],i=0|l[c+12>>2];do{if((0|i)==(0|c)){if(!(i=0|l[(e=c+20|0)>>2])&&!(i=0|l[(e=c+16|0)>>2])){r=0;break}for(;;)if(0|(n=0|l[(r=i+20|0)>>2]))i=n,e=r;else{if(!(n=0|l[(r=i+16|0)>>2]))break;i=n,e=r}l[e>>2]=0,r=i}else r=0|l[c+8>>2],l[r+12>>2]=i,l[i+8>>2]=r,r=i}while(0);do{if(0|o){if(i=0|l[c+28>>2],(0|c)==(0|l[(e=4880+(i<<2)|0)>>2])){if(l[e>>2]=r,!r){l[1145]=u&~(1<<i);break}}else if(l[o+16+(((0|l[o+16>>2])!=(0|c)&1)<<2)>>2]=r,!r)break;l[r+24>>2]=o,0|(i=0|l[c+16>>2])&&(l[r+16>>2]=i,l[i+24>>2]=r),0|(i=0|l[c+20>>2])&&(l[r+20>>2]=i,l[i+24>>2]=r)}}while(0);return a>>>0<16?(w=a+h|0,l[c+4>>2]=3|w,l[(w=c+w+4|0)>>2]=1|l[w>>2]):(l[c+4>>2]=3|h,l[s+4>>2]=1|a,l[s+a>>2]=a,0|d&&(n=0|l[1149],r=4616+((i=d>>>3)<<1<<2)|0,f&(i=1<<i)?i=0|l[(e=r+8|0)>>2]:(l[1144]=f|i,i=r,e=r+8|0),l[e>>2]=n,l[i+12>>2]=n,l[n+8>>2]=i,l[n+12>>2]=r),l[1146]=a,l[1149]=s),y=t,0|(w=c+8|0)}f=h}else f=h}else f=h}else if(e>>>0<=4294967231)if(h=-8&(e=e+11|0),c=0|l[1145]){n=0-h|0,(e>>>=8)?h>>>0>16777215?u=31:u=h>>>((u=14-((d=((b=e<<(f=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|f|(u=((b<<=d)+245760|0)>>>16&2))+(b<<u>>>15)|0)+7|0)&1|u<<1:u=0,r=0|l[4880+(u<<2)>>2];e:do{if(r)for(e=0,s=h<<(31==(0|u)?0:25-(u>>>1)|0),a=0;;){if((o=(-8&l[r+4>>2])-h|0)>>>0<n>>>0){if(!o){e=r,n=0,o=r,b=61;break e}e=r,n=o}if(a=0==(0|(o=0|l[r+20>>2]))|(0|o)==(0|(r=0|l[r+16+(s>>>31<<2)>>2]))?a:o,o=0==(0|r)){r=a,b=57;break}s<<=1&(1^o)}else r=0,e=0,b=57}while(0);if(57==(0|b)){if(0==(0|r)&0==(0|e)){if(!(e=c&((e=2<<u)|0-e))){f=h;break}f=(e&0-e)-1|0,e=0,r=0|l[4880+(((a=(f>>>=s=f>>>12&16)>>>5&8)|s|(u=(f>>>=a)>>>2&4)|(d=(f>>>=u)>>>1&2)|(r=(f>>>=d)>>>1&1))+(f>>>r)<<2)>>2]}r?(o=r,b=61):(u=e,s=n)}if(61==(0|b))for(;;){if(b=0,r=(f=(r=(-8&l[o+4>>2])-h|0)>>>0<n>>>0)?r:n,e=f?o:e,!(o=0|l[o+16+((0==(0|l[o+16>>2])&1)<<2)>>2])){u=e,s=r;break}n=r,b=61}if(0!=(0|u)&&s>>>0<((0|l[1146])-h|0)>>>0){if(u>>>0>=(a=u+h|0)>>>0)return y=t,0|(w=0);o=0|l[u+24>>2],i=0|l[u+12>>2];do{if((0|i)==(0|u)){if(!(i=0|l[(e=u+20|0)>>2])&&!(i=0|l[(e=u+16|0)>>2])){i=0;break}for(;;)if(0|(n=0|l[(r=i+20|0)>>2]))i=n,e=r;else{if(!(n=0|l[(r=i+16|0)>>2]))break;i=n,e=r}l[e>>2]=0}else w=0|l[u+8>>2],l[w+12>>2]=i,l[i+8>>2]=w}while(0);do{if(o){if(e=0|l[u+28>>2],(0|u)==(0|l[(r=4880+(e<<2)|0)>>2])){if(l[r>>2]=i,!i){n=c&~(1<<e),l[1145]=n;break}}else if(l[o+16+(((0|l[o+16>>2])!=(0|u)&1)<<2)>>2]=i,!i){n=c;break}l[i+24>>2]=o,0|(e=0|l[u+16>>2])&&(l[i+16>>2]=e,l[e+24>>2]=i),(e=0|l[u+20>>2])&&(l[i+20>>2]=e,l[e+24>>2]=i),n=c}else n=c}while(0);do{if(s>>>0>=16){if(l[u+4>>2]=3|h,l[a+4>>2]=1|s,l[a+s>>2]=s,i=s>>>3,s>>>0<256){r=4616+(i<<1<<2)|0,(e=0|l[1144])&(i=1<<i)?i=0|l[(e=r+8|0)>>2]:(l[1144]=e|i,i=r,e=r+8|0),l[e>>2]=a,l[i+12>>2]=a,l[a+8>>2]=i,l[a+12>>2]=r;break}if((i=s>>>8)?s>>>0>16777215?i=31:i=s>>>((i=14-((x=((w=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(i=((w<<=x)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1:i=0,r=4880+(i<<2)|0,l[a+28>>2]=i,l[(e=a+16|0)+4>>2]=0,l[e>>2]=0,!(n&(e=1<<i))){l[1145]=n|e,l[r>>2]=a,l[a+24>>2]=r,l[a+12>>2]=a,l[a+8>>2]=a;break}for(e=s<<(31==(0|i)?0:25-(i>>>1)|0),r=0|l[r>>2];;){if((-8&l[r+4>>2]|0)==(0|s)){b=97;break}if(!(i=0|l[(n=r+16+(e>>>31<<2)|0)>>2])){b=96;break}e<<=1,r=i}if(96==(0|b)){l[n>>2]=a,l[a+24>>2]=r,l[a+12>>2]=a,l[a+8>>2]=a;break}if(97==(0|b)){w=0|l[(b=r+8|0)>>2],l[w+12>>2]=a,l[b>>2]=a,l[a+8>>2]=w,l[a+12>>2]=r,l[a+24>>2]=0;break}}else w=s+h|0,l[u+4>>2]=3|w,l[(w=u+w+4|0)>>2]=1|l[w>>2]}while(0);return y=t,0|(w=u+8|0)}f=h}else f=h;else f=-1}while(0);if((r=0|l[1146])>>>0>=f>>>0)return i=r-f|0,e=0|l[1149],i>>>0>15?(w=e+f|0,l[1149]=w,l[1146]=i,l[w+4>>2]=1|i,l[w+i>>2]=i,l[e+4>>2]=3|f):(l[1146]=0,l[1149]=0,l[e+4>>2]=3|r,l[(w=e+r+4|0)>>2]=1|l[w>>2]),y=t,0|(w=e+8|0);if((s=0|l[1147])>>>0>f>>>0)return x=s-f|0,l[1147]=x,b=(w=0|l[1150])+f|0,l[1150]=b,l[b+4>>2]=1|x,l[w+4>>2]=3|f,y=t,0|(w=w+8|0);if(0|l[1262]?e=0|l[1264]:(l[1264]=4096,l[1263]=4096,l[1265]=-1,l[1266]=-1,l[1267]=0,l[1255]=0,e=-16&p^1431655768,l[p>>2]=e,l[1262]=e,e=4096),u=f+48|0,(h=(a=e+(c=f+47|0)|0)&(o=0-e|0))>>>0<=f>>>0||0|(e=0|l[1254])&&(p=(d=0|l[1252])+h|0)>>>0<=d>>>0|p>>>0>e>>>0)return y=t,0|(w=0);e:do{if(4&l[1255])i=0,b=133;else{r=0|l[1150];t:do{if(r){for(n=5024;!((e=0|l[n>>2])>>>0<=r>>>0&&($=n+4|0,(e+(0|l[$>>2])|0)>>>0>r>>>0));){if(!(e=0|l[n+8>>2])){b=118;break t}n=e}if((i=a-s&o)>>>0<2147483647)if((0|(e=0|Te(0|i)))==((0|l[n>>2])+(0|l[$>>2])|0)){if(-1!=(0|e)){s=i,a=e,b=135;break e}}else n=e,b=126;else i=0}else b=118}while(0);do{if(118==(0|b))if(-1!=(0|(r=0|Te(0)))&&(i=r,m=(i=(0==((m=(_=0|l[1263])+-1|0)&i|0)?0:(m+i&0-_)-i|0)+h|0)+(_=0|l[1252])|0,i>>>0>f>>>0&i>>>0<2147483647)){if(0|($=0|l[1254])&&m>>>0<=_>>>0|m>>>0>$>>>0){i=0;break}if((0|(e=0|Te(0|i)))==(0|r)){s=i,a=r,b=135;break e}n=e,b=126}else i=0}while(0);do{if(126==(0|b)){if(r=0-i|0,!(u>>>0>i>>>0&i>>>0<2147483647&-1!=(0|n))){if(-1==(0|n)){i=0;break}s=i,a=n,b=135;break e}if((e=c-i+(e=0|l[1264])&0-e)>>>0>=2147483647){s=i,a=n,b=135;break e}if(-1==(0|Te(0|e))){Te(0|r),i=0;break}s=e+i|0,a=n,b=135;break e}}while(0);l[1255]=4|l[1255],b=133}}while(0);if(133==(0|b)&&h>>>0<2147483647&&!(-1==(0|(x=0|Te(0|h)))|1^(v=(g=($=0|Te(0))-x|0)>>>0>(f+40|0)>>>0)|x>>>0<$>>>0&-1!=(0|x)&-1!=(0|$)^1)&&(s=v?g:i,a=x,b=135),135==(0|b)){i=(0|l[1252])+s|0,l[1252]=i,i>>>0>(0|l[1253])>>>0&&(l[1253]=i),c=0|l[1150];do{if(c){for(i=5024;;){if((0|a)==((e=0|l[i>>2])+(n=0|l[(r=i+4|0)>>2])|0)){b=145;break}if(!(o=0|l[i+8>>2]))break;i=o}if(145==(0|b)&&0==(8&l[i+12>>2]|0)&&c>>>0<a>>>0&c>>>0>=e>>>0){l[r>>2]=n+s,b=c+(w=0==(7&(w=c+8|0)|0)?0:0-w&7)|0,w=(0|l[1147])+(s-w)|0,l[1150]=b,l[1147]=w,l[b+4>>2]=1|w,l[b+w+4>>2]=40,l[1151]=l[1266];break}for(a>>>0<(0|l[1148])>>>0&&(l[1148]=a),r=a+s|0,i=5024;;){if((0|l[i>>2])==(0|r)){b=153;break}if(!(e=0|l[i+8>>2]))break;i=e}if(153==(0|b)&&0==(8&l[i+12>>2]|0)){l[i>>2]=a,l[(d=i+4|0)>>2]=(0|l[d>>2])+s,h=(d=a+(0==(7&(d=a+8|0)|0)?0:0-d&7)|0)+f|0,u=(i=r+(0==(7&(i=r+8|0)|0)?0:0-i&7)|0)-d-f|0,l[d+4>>2]=3|f;do{if((0|i)!=(0|c)){if((0|i)==(0|l[1149])){w=(0|l[1146])+u|0,l[1146]=w,l[1149]=h,l[h+4>>2]=1|w,l[h+w>>2]=w;break}if(1==(3&(e=0|l[i+4>>2])|0)){s=-8&e,n=e>>>3;e:do{if(e>>>0<256){if(e=0|l[i+8>>2],(0|(r=0|l[i+12>>2]))==(0|e)){l[1144]=l[1144]&~(1<<n);break}l[e+12>>2]=r,l[r+8>>2]=e;break}a=0|l[i+24>>2],e=0|l[i+12>>2];do{if((0|e)==(0|i)){if(!(e=0|l[(r=(n=i+16|0)+4|0)>>2])){if(!(e=0|l[n>>2])){e=0;break}r=n}for(;;)if(0|(o=0|l[(n=e+20|0)>>2]))e=o,r=n;else{if(!(o=0|l[(n=e+16|0)>>2]))break;e=o,r=n}l[r>>2]=0}else w=0|l[i+8>>2],l[w+12>>2]=e,l[e+8>>2]=w}while(0);if(!a)break;n=4880+((r=0|l[i+28>>2])<<2)|0;do{if((0|i)==(0|l[n>>2])){if(l[n>>2]=e,0|e)break;l[1145]=l[1145]&~(1<<r);break e}if(l[a+16+(((0|l[a+16>>2])!=(0|i)&1)<<2)>>2]=e,!e)break e}while(0);if(l[e+24>>2]=a,0|(n=0|l[(r=i+16|0)>>2])&&(l[e+16>>2]=n,l[n+24>>2]=e),!(r=0|l[r+4>>2]))break;l[e+20>>2]=r,l[r+24>>2]=e}while(0);i=i+s|0,o=s+u|0}else o=u;if(l[(i=i+4|0)>>2]=-2&l[i>>2],l[h+4>>2]=1|o,l[h+o>>2]=o,i=o>>>3,o>>>0<256){r=4616+(i<<1<<2)|0,(e=0|l[1144])&(i=1<<i)?i=0|l[(e=r+8|0)>>2]:(l[1144]=e|i,i=r,e=r+8|0),l[e>>2]=h,l[i+12>>2]=h,l[h+8>>2]=i,l[h+12>>2]=r;break}i=o>>>8;do{if(i){if(o>>>0>16777215){i=31;break}i=o>>>((i=14-((x=((w=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(i=((w<<=x)+245760|0)>>>16&2))+(w<<i>>>15)|0)+7|0)&1|i<<1}else i=0}while(0);if(n=4880+(i<<2)|0,l[h+28>>2]=i,l[(e=h+16|0)+4>>2]=0,l[e>>2]=0,!((e=0|l[1145])&(r=1<<i))){l[1145]=e|r,l[n>>2]=h,l[h+24>>2]=n,l[h+12>>2]=h,l[h+8>>2]=h;break}for(e=o<<(31==(0|i)?0:25-(i>>>1)|0),r=0|l[n>>2];;){if((-8&l[r+4>>2]|0)==(0|o)){b=194;break}if(!(i=0|l[(n=r+16+(e>>>31<<2)|0)>>2])){b=193;break}e<<=1,r=i}if(193==(0|b)){l[n>>2]=h,l[h+24>>2]=r,l[h+12>>2]=h,l[h+8>>2]=h;break}if(194==(0|b)){w=0|l[(b=r+8|0)>>2],l[w+12>>2]=h,l[b>>2]=h,l[h+8>>2]=w,l[h+12>>2]=r,l[h+24>>2]=0;break}}else w=(0|l[1147])+u|0,l[1147]=w,l[1150]=h,l[h+4>>2]=1|w}while(0);return y=t,0|(w=d+8|0)}for(i=5024;!((e=0|l[i>>2])>>>0<=c>>>0&&(w=e+(0|l[i+4>>2])|0,w>>>0>c>>>0));)i=0|l[i+8>>2];i=(e=(e=(o=w+-47|0)+(0==(7&(e=o+8|0)|0)?0:0-e&7)|0)>>>0<(o=c+16|0)>>>0?c:e)+8|0,b=a+(r=0==(7&(r=a+8|0)|0)?0:0-r&7)|0,r=s+-40-r|0,l[1150]=b,l[1147]=r,l[b+4>>2]=1|r,l[b+r+4>>2]=40,l[1151]=l[1266],l[(r=e+4|0)>>2]=27,l[i>>2]=l[1256],l[i+4>>2]=l[1257],l[i+8>>2]=l[1258],l[i+12>>2]=l[1259],l[1256]=a,l[1257]=s,l[1259]=0,l[1258]=i,i=e+24|0;do{b=i,l[(i=i+4|0)>>2]=7}while((b+8|0)>>>0<w>>>0);if((0|e)!=(0|c)){if(a=e-c|0,l[r>>2]=-2&l[r>>2],l[c+4>>2]=1|a,l[e>>2]=a,i=a>>>3,a>>>0<256){r=4616+(i<<1<<2)|0,(e=0|l[1144])&(i=1<<i)?i=0|l[(e=r+8|0)>>2]:(l[1144]=e|i,i=r,e=r+8|0),l[e>>2]=c,l[i+12>>2]=c,l[c+8>>2]=i,l[c+12>>2]=r;break}if((i=a>>>8)?a>>>0>16777215?r=31:r=a>>>((r=14-((x=((w=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(r=((w<<=x)+245760|0)>>>16&2))+(w<<r>>>15)|0)+7|0)&1|r<<1:r=0,n=4880+(r<<2)|0,l[c+28>>2]=r,l[c+20>>2]=0,l[o>>2]=0,!((i=0|l[1145])&(e=1<<r))){l[1145]=i|e,l[n>>2]=c,l[c+24>>2]=n,l[c+12>>2]=c,l[c+8>>2]=c;break}for(e=a<<(31==(0|r)?0:25-(r>>>1)|0),r=0|l[n>>2];;){if((-8&l[r+4>>2]|0)==(0|a)){b=216;break}if(!(i=0|l[(n=r+16+(e>>>31<<2)|0)>>2])){b=215;break}e<<=1,r=i}if(215==(0|b)){l[n>>2]=c,l[c+24>>2]=r,l[c+12>>2]=c,l[c+8>>2]=c;break}if(216==(0|b)){w=0|l[(b=r+8|0)>>2],l[w+12>>2]=c,l[b>>2]=c,l[c+8>>2]=w,l[c+12>>2]=r,l[c+24>>2]=0;break}}}else{0==(0|(w=0|l[1148]))|a>>>0<w>>>0&&(l[1148]=a),l[1256]=a,l[1257]=s,l[1259]=0,l[1153]=l[1262],l[1152]=-1,i=0;do{l[(w=4616+(i<<1<<2)|0)+12>>2]=w,l[w+8>>2]=w,i=i+1|0}while(32!=(0|i));b=a+(w=0==(7&(w=a+8|0)|0)?0:0-w&7)|0,w=s+-40-w|0,l[1150]=b,l[1147]=w,l[b+4>>2]=1|w,l[b+w+4>>2]=40,l[1151]=l[1266]}}while(0);if((i=0|l[1147])>>>0>f>>>0)return x=i-f|0,l[1147]=x,b=(w=0|l[1150])+f|0,l[1150]=b,l[b+4>>2]=1|x,l[w+4>>2]=3|f,y=t,0|(w=w+8|0)}return w=0|tt(),l[w>>2]=12,y=t,0|(w=0)}function V(e,t,i,r,o,a){e|=0,t=+t,i|=0,r|=0,o|=0,a|=0;var s,u=0,h=0,d=0,f=0,p=0,_=0,m=0,$=0,g=0,v=0,x=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0,R=0;s=y,y=y+560|0,d=s+8|0,D=R=s+524|0,f=s+512|0,l[(x=s)>>2]=0,O=f+12|0,Fe(t),(0|b)<0?(t=-t,I=1,P=2087):(I=0!=(2049&o|0)&1,P=0==(2048&o|0)?0==(1&o|0)?2088:2093:2090),Fe(t),M=2146435072&b;do{if(M>>>0<2146435072|2146435072==(0|M)&!1){if((u=0!=($=2*+et(t,x)))&&(l[x>>2]=(0|l[x>>2])-1),97==(0|(T=32|a))){m=0==(0|(g=32&a))?P:P+9|0,_=2|I,u=12-r|0;do{if(!(r>>>0>11|0==(0|u))){t=8;do{u=u+-1|0,t*=16}while(0!=(0|u));if(45==(0|n[m>>0])){t=-(t+(-$-t));break}t=$+t-t;break}t=$}while(0);(0|(u=0|ge(u=(0|(h=0|l[x>>2]))<0?0-h|0:h,((0|u)<0)<<31>>31,O)))==(0|O)&&(n[(u=f+11|0)>>0]=48),n[u+-1>>0]=43+(h>>31&2),n[(p=u+-2|0)>>0]=a+15,f=(0|r)<1,d=0==(8&o|0),u=R;do{M=~~t,h=u+1|0,n[u>>0]=c[2122+M>>0]|g,t=16*(t-+(0|M)),1!=(h-D|0)||d&f&0==t?u=h:(n[h>>0]=46,u=u+2|0)}while(0!=t);M=u-D|0,be(e,32,i,u=(D=O-p|0)+_+(O=0!=(0|r)&(M+-2|0)<(0|r)?r+2|0:M)|0,o),Ue(e,m,_),be(e,48,i,u,65536^o),Ue(e,R,M),be(e,48,O-M|0,0,0),Ue(e,p,D),be(e,32,i,u,8192^o);break}h=(0|r)<0?6:r,u?(u=(0|l[x>>2])-28|0,l[x>>2]=u,t=268435456*$):(t=$,u=0|l[x>>2]),d=M=(0|u)<0?d:d+288|0;do{E=~~t>>>0,l[d>>2]=E,d=d+4|0,t=1e9*(t-+(E>>>0))}while(0!=t);if((0|u)>0)for(f=M,_=d;;){if(p=(0|u)<29?u:29,(u=_+-4|0)>>>0>=f>>>0){d=0;do{C=0|Me(0|(S=0|ze(0|(S=0|Re(0|l[u>>2],0,0|p)),0|b,0|d,0)),0|(E=b),1e9,0),l[u>>2]=C,d=0|Ye(0|S,0|E,1e9,0),u=u+-4|0}while(u>>>0>=f>>>0);d&&(l[(f=f+-4|0)>>2]=d)}for(d=_;!(d>>>0<=f>>>0)&&!(0|l[(u=d+-4|0)>>2]);)d=u;if(u=(0|l[x>>2])-p|0,l[x>>2]=u,!((0|u)>0))break;_=d}else f=M;if((0|u)<0){r=1+((h+25|0)/9|0)|0,v=102==(0|T);do{if(g=(0|(g=0-u|0))<9?g:9,f>>>0<d>>>0){p=(1<<g)-1|0,_=1e9>>>g,m=0,u=f;do{E=0|l[u>>2],l[u>>2]=(E>>>g)+m,m=0|w(E&p,_),u=u+4|0}while(u>>>0<d>>>0);u=0==(0|l[f>>2])?f+4|0:f,m?(l[d>>2]=m,f=u,u=d+4|0):(f=u,u=d)}else f=0==(0|l[f>>2])?f+4|0:f,u=d;d=(u-(d=v?M:f)>>2|0)>(0|r)?d+(r<<2)|0:u,u=(0|l[x>>2])+g|0,l[x>>2]=u}while((0|u)<0);u=f,r=d}else u=f,r=d;if(E=M,u>>>0<r>>>0){if(d=9*(E-u>>2)|0,(p=0|l[u>>2])>>>0>=10){f=10;do{f=10*f|0,d=d+1|0}while(p>>>0>=f>>>0)}}else d=0;if((0|(f=h-(102!=(0|T)?d:0)+(((C=0!=(0|h))&(v=103==(0|T)))<<31>>31)|0))<((9*(r-E>>2)|0)-9|0)){if(g=M+4+(((0|(f=f+9216|0))/9|0)-1024<<2)|0,(0|(f=1+((0|f)%9|0)|0))<9){p=10;do{p=10*p|0,f=f+1|0}while(9!=(0|f))}else p=10;if((f=(g+4|0)==(0|r))&0==(0|(m=((_=0|l[g>>2])>>>0)%(p>>>0)|0)))f=g;else if($=0==(1&((_>>>0)/(p>>>0)|0)|0)?9007199254740992:9007199254740994,t=m>>>0<(S=(0|p)/2|0)>>>0?.5:f&(0|m)==(0|S)?1:1.5,I&&(t=(S=45==(0|n[P>>0]))?-t:t,$=S?-$:$),f=_-m|0,l[g>>2]=f,$+t!=$){if(S=f+p|0,l[g>>2]=S,S>>>0>999999999)for(d=g;f=d+-4|0,l[d>>2]=0,f>>>0<u>>>0&&(l[(u=u+-4|0)>>2]=0),S=1+(0|l[f>>2])|0,l[f>>2]=S,S>>>0>999999999;)d=f;else f=g;if(d=9*(E-u>>2)|0,(_=0|l[u>>2])>>>0>=10){p=10;do{p=10*p|0,d=d+1|0}while(_>>>0>=p>>>0)}}else f=g;f=r>>>0>(f=f+4|0)>>>0?f:r,S=u}else f=r,S=u;for(T=f;;){if(T>>>0<=S>>>0){x=0;break}if(0|l[(u=T+-4|0)>>2]){x=1;break}T=u}r=0-d|0;do{if(v){if((0|(u=(1&(1^C))+h|0))>(0|d)&(0|d)>-5?(p=a+-1|0,h=u+-1-d|0):(p=a+-2|0,h=u+-1|0),!(u=8&o)){if(x&&0!=(0|(A=0|l[T+-4>>2])))if((A>>>0)%10|0)f=0;else{f=0,u=10;do{u=10*u|0,f=f+1|0}while(!(0|(A>>>0)%(u>>>0)))}else f=9;if(u=(9*(T-E>>2)|0)-9|0,102==(32|p)){h=(0|h)<(0|(g=(0|(g=u-f|0))>0?g:0))?h:g,g=0;break}h=(0|h)<(0|(g=(0|(g=u+d-f|0))>0?g:0))?h:g,g=0;break}g=u}else p=a,g=8&o}while(0);if(_=0!=(0|(v=h|g))&1,m=102==(32|p))C=0,u=(0|d)>0?d:0;else{if(((f=O)-(u=0|ge(u=(0|d)<0?r:d,((0|u)<0)<<31>>31,O))|0)<2)do{n[(u=u+-1|0)>>0]=48}while((f-u|0)<2);n[u+-1>>0]=43+(d>>31&2),n[(u=u+-2|0)>>0]=p,C=u,u=f-u|0}if(be(e,32,i,u=I+1+h+_+u|0,o),Ue(e,P,I),be(e,48,i,u,65536^o),m){_=g=R+9|0,m=R+8|0,f=p=S>>>0>M>>>0?M:S;do{if(d=0|ge(0|l[f>>2],0,g),(0|f)==(0|p))(0|d)==(0|g)&&(n[m>>0]=48,d=m);else if(d>>>0>R>>>0){de(0|R,48,d-D|0);do{d=d+-1|0}while(d>>>0>R>>>0)}Ue(e,d,_-d|0),f=f+4|0}while(f>>>0<=M>>>0);if(0|v&&Ue(e,2138,1),f>>>0<T>>>0&(0|h)>0)for(;;){if((d=0|ge(0|l[f>>2],0,g))>>>0>R>>>0){de(0|R,48,d-D|0);do{d=d+-1|0}while(d>>>0>R>>>0)}if(Ue(e,d,(0|h)<9?h:9),d=h+-9|0,!((f=f+4|0)>>>0<T>>>0&(0|h)>9)){h=d;break}h=d}be(e,48,h+9|0,9,0)}else{if(v=x?T:S+4|0,(0|h)>-1){g=0==(0|g),r=x=R+9|0,_=0-D|0,m=R+8|0,p=S;do{(0|(d=0|ge(0|l[p>>2],0,x)))==(0|x)&&(n[m>>0]=48,d=m);do{if((0|p)==(0|S)){if(f=d+1|0,Ue(e,d,1),g&(0|h)<1){d=f;break}Ue(e,2138,1),d=f}else{if(d>>>0<=R>>>0)break;de(0|R,48,d+_|0);do{d=d+-1|0}while(d>>>0>R>>>0)}}while(0);Ue(e,d,(0|h)>(0|(D=r-d|0))?D:h),h=h-D|0,p=p+4|0}while(p>>>0<v>>>0&(0|h)>-1)}be(e,48,h+18|0,18,0),Ue(e,C,O-C|0)}be(e,32,i,u,8192^o)}else R=0!=(32&a|0),be(e,32,i,u=I+3|0,-65537&o),Ue(e,P,I),Ue(e,t!=t|!1?R?2114:2118:R?2106:2110,3),be(e,32,i,u,8192^o)}while(0);return y=s,0|((0|u)<(0|i)?i:u)}function U(e,t,i,r,o){e|=0,t|=0,i|=0,r|=0,o|=0;var s,u,c,h,d,f,p,_,$,g=0,v=0,x=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0;$=y,y=y+64|0,f=$,D=$+24|0,p=$+8|0,_=$+20|0,l[(d=$+16|0)>>2]=t,s=0!=(0|e),c=u=D+40|0,D=D+39|0,h=p+4|0,v=0,g=0,T=0;e:for(;;){do{if((0|g)>-1){if((0|v)>(2147483647-g|0)){g=0|tt(),l[g>>2]=75,g=-1;break}g=v+g|0;break}}while(0);if(!((v=0|n[t>>0])<<24>>24)){O=87;break}x=t;t:for(;;){switch(v<<24>>24){case 37:v=x,O=9;break t;case 0:v=x;break t}M=x+1|0,l[d>>2]=M,v=0|n[M>>0],x=M}t:do{if(9==(0|O))for(;;){if(O=0,37!=(0|n[x+1>>0]))break t;if(v=v+1|0,x=x+2|0,l[d>>2]=x,37!=(0|n[x>>0]))break;O=9}}while(0);if(v=v-t|0,s&&Ue(e,t,v),0|v)t=x;else{(v=(0|n[(w=x+1|0)>>0])-48|0)>>>0<10?(I=(M=36==(0|n[x+2>>0]))?v:-1,T=M?1:T,w=M?x+3|0:w):I=-1,l[d>>2]=w,x=((v=0|n[w>>0])<<24>>24)-32|0;t:do{if(x>>>0<32)for(C=0,S=v;;){if(!(75913&(v=1<<x))){v=S;break t}if(C|=v,w=w+1|0,l[d>>2]=w,(x=((v=0|n[w>>0])<<24>>24)-32|0)>>>0>=32)break;S=v}else C=0}while(0);if(v<<24>>24==42){if((v=(0|n[(x=w+1|0)>>0])-48|0)>>>0<10&&36==(0|n[w+2>>0]))l[o+(v<<2)>>2]=10,v=0|l[r+((0|n[x>>0])-48<<3)>>2],T=1,w=w+3|0;else{if(0|T){g=-1;break}s?(T=3+(0|l[i>>2])&-4,v=0|l[T>>2],l[i>>2]=T+4,T=0,w=x):(v=0,T=0,w=x)}l[d>>2]=w,v=(M=(0|v)<0)?0-v|0:v,C=M?8192|C:C}else{if((0|(v=0|Se(d)))<0){g=-1;break}w=0|l[d>>2]}do{if(46==(0|n[w>>0])){if(42!=(0|n[w+1>>0])){l[d>>2]=w+1,x=0|Se(d),w=0|l[d>>2];break}if((x=(0|n[(S=w+2|0)>>0])-48|0)>>>0<10&&36==(0|n[w+3>>0])){l[o+(x<<2)>>2]=10,x=0|l[r+((0|n[S>>0])-48<<3)>>2],w=w+4|0,l[d>>2]=w;break}if(0|T){g=-1;break e}s?(M=3+(0|l[i>>2])&-4,x=0|l[M>>2],l[i>>2]=M+4):x=0,l[d>>2]=S,w=S}else x=-1}while(0);for(P=0;;){if(((0|n[w>>0])-65|0)>>>0>57){g=-1;break e}if(M=w+1|0,l[d>>2]=M,!(((E=255&(S=0|n[(0|n[w>>0])-65+(1606+(58*P|0))>>0]))+-1|0)>>>0<8))break;P=E,w=M}if(!(S<<24>>24)){g=-1;break}A=(0|I)>-1;do{if(S<<24>>24==19){if(A){g=-1;break e}O=49}else{if(A){l[o+(I<<2)>>2]=E,I=0|l[(A=r+(I<<3)|0)+4>>2],l[(O=f)>>2]=l[A>>2],l[O+4>>2]=I,O=49;break}if(!s){g=0;break e}Z(f,E,i)}}while(0);if(49!=(0|O)||(O=0,s)){w=0!=(0|P)&3==(15&(w=0|n[w>>0])|0)?-33&w:w,A=-65537&C,I=0==(8192&C|0)?C:A;t:do{switch(0|w){case 110:switch((255&P)<<24>>24){case 0:case 1:case 6:l[l[f>>2]>>2]=g,v=0,t=M;continue e;case 2:case 7:v=0|l[f>>2],l[v>>2]=g,l[v+4>>2]=((0|g)<0)<<31>>31,v=0,t=M;continue e;case 3:a[l[f>>2]>>1]=g,v=0,t=M;continue e;case 4:n[l[f>>2]>>0]=g,v=0,t=M;continue e;default:v=0,t=M;continue e}case 112:w=120,x=x>>>0>8?x:8,t=8|I,O=61;break;case 88:case 120:t=I,O=61;break;case 111:C=0,S=2070,x=0==(8&I|0)|(0|x)>(0|(A=c-(E=0|Ie(t=0|l[(w=f)>>2],w=0|l[w+4>>2],u))|0))?x:A+1|0,A=I,O=67;break;case 105:case 100:if(t=0|l[(w=f)>>2],(0|(w=0|l[w+4>>2]))<0){t=0|Ne(0,0,0|t,0|w),w=b,l[(C=f)>>2]=t,l[C+4>>2]=w,C=1,S=2070,O=66;break t}C=0!=(2049&I|0)&1,S=0==(2048&I|0)?0==(1&I|0)?2070:2072:2071,O=66;break t;case 117:C=0,S=2070,t=0|l[(w=f)>>2],w=0|l[w+4>>2],O=66;break;case 99:n[D>>0]=l[f>>2],t=D,C=0,S=2070,E=u,w=1,x=A;break;case 109:w=0|tt(),w=0|Xe(0|l[w>>2]),O=71;break;case 115:w=0|(w=0|l[f>>2])?w:2080,O=71;break;case 67:l[p>>2]=l[f>>2],l[h>>2]=0,l[f>>2]=p,E=-1,w=p,O=75;break;case 83:t=0|l[f>>2],x?(E=x,w=t,O=75):(be(e,32,v,0,I),t=0,O=84);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:v=0|V(e,+m[f>>3],v,x,I,w),t=M;continue e;default:C=0,S=2070,E=u,w=x,x=I}}while(0);t:do{if(61==(0|O))I=f,P=0|l[I>>2],I=0|l[I+4>>2],E=0|Ee(P,I,u,32&w),S=0==(8&t|0)|0==(0|P)&0==(0|I),C=S?0:2,S=S?2070:2070+(w>>4)|0,A=t,t=P,w=I,O=67;else if(66==(0|O))E=0|ge(t,w,u),A=I,O=67;else if(71==(0|O))O=0,I=0|se(w,0,x),P=0==(0|I),t=w,C=0,S=2070,E=P?w+x|0:I,w=P?x:I-w|0,x=A;else if(75==(0|O)){for(O=0,S=w,t=0,x=0;(C=0|l[S>>2])&&!((0|(x=0|He(_,C)))<0|x>>>0>(E-t|0)>>>0)&&E>>>0>(t=x+t|0)>>>0;)S=S+4|0;if((0|x)<0){g=-1;break e}if(be(e,32,v,t,I),t)for(C=0;;){if(!(x=0|l[w>>2])){O=84;break t}if((0|(C=(x=0|He(_,x))+C|0))>(0|t)){O=84;break t}if(Ue(e,_,x),C>>>0>=t>>>0){O=84;break}w=w+4|0}else t=0,O=84}}while(0);if(67==(0|O))O=0,I=0!=(0|x)|(w=0!=(0|t)|0!=(0|w)),w=c-E+(1&(1^w))|0,t=I?E:u,E=u,w=I?(0|x)>(0|w)?x:w:x,x=(0|x)>-1?-65537&A:A;else if(84==(0|O)){O=0,be(e,32,v,t,8192^I),v=(0|v)>(0|t)?v:t,t=M;continue}be(e,32,v=(0|v)<(0|(I=(A=(0|w)<(0|(P=E-t|0))?P:w)+C|0))?I:v,I,x),Ue(e,S,C),be(e,48,v,I,65536^x),be(e,48,A,P,0),Ue(e,t,P),be(e,32,v,I,8192^x),t=M}else v=0,t=M}}e:do{if(87==(0|O)&&!e)if(T){for(g=1;t=0|l[o+(g<<2)>>2];)if(Z(r+(g<<3)|0,t,i),(0|(g=g+1|0))>=10){g=1;break e}for(;;){if(0|l[o+(g<<2)>>2]){g=-1;break e}if((0|(g=g+1|0))>=10){g=1;break}}}else g=0}while(0);return y=$,0|g}function X(e,t){t|=0;var i,r,o,a,s,u,h,d,f,p,_,m,$,g,v,x=0,b=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0;if(v=y,y=y+704|0,$=v+144|0,m=v+128|0,_=v+112|0,p=v+96|0,f=v+80|0,d=v+64|0,h=v+48|0,g=v+32|0,i=v+16|0,S=v,o=v+184|0,I=v+160|0,a=0|function(e,t){e|=0;var i=0,r=0,n=0,o=0,a=0,s=0,u=0,h=0;if(h=y,y=y+528|0,a=h,o=h+16|0,!(t|=0))return y=h,0|(u=0);if(t>>>0<=16)return u=0|ae(e,t),y=h,0|u;if(s=0|ae(e,t+-16|0),(0|(t=0|l[(u=e+20|0)>>2]))<16){r=e+4|0,n=e+8|0,i=e+16|0;do{(0|(e=0|l[r>>2]))==(0|l[n>>2])?e=0:(l[r>>2]=e+1,e=0|c[e>>0]),t=t+8|0,l[u>>2]=t,(0|t)>=33&&(l[a>>2]=866,l[a+4>>2]=3208,l[a+8>>2]=1366,De(o,812,a),xe(o),t=0|l[u>>2]),e=e<<32-t|l[i>>2],l[i>>2]=e}while((0|t)<16)}else i=e=e+16|0,e=0|l[e>>2];return l[i>>2]=e<<16,l[u>>2]=t+-16,y=h,0|(u=e>>>16|s<<16)}(e|=0,14),!a)return function(e){var t=0,i=0,r=0,o=0,a=0,s=0;if(s=y,y=y+544|0,a=s+16|0,r=s,o=s+32|0,l[(e|=0)>>2]=0,0|(i=0|l[(t=e+4|0)>>2])&&(7&i?(l[r>>2]=866,l[r+4>>2]=2506,l[r+8>>2]=1232,De(o,812,r),xe(o)):_e(i,0,0,1,0),l[t>>2]=0,l[e+8>>2]=0,l[e+12>>2]=0),n[e+16>>0]=0,!(t=0|l[(e=e+20|0)>>2]))return void(y=s);ne(t),7&t?(l[a>>2]=866,l[a+4>>2]=2506,l[a+8>>2]=1232,De(o,812,a),xe(o)):_e(t,0,0,1,0),l[e>>2]=0,y=s}(t),y=v,0|(I=1);if(s=t+4|0,(0|(x=0|l[(u=t+8|0)>>2]))!=(0|a)){if(x>>>0<=a>>>0){do{if((0|l[t+12>>2])>>>0<a>>>0){if(0|K(s,a,(x+1|0)==(0|a),1,0)){x=0|l[u>>2];break}return n[t+16>>0]=1,y=v,0|(I=0)}}while(0);de((0|l[s>>2])+x|0,0,a-x|0)}l[u>>2]=a}if(de(0|l[s>>2],0,0|a),(0|(x=0|l[(r=e+20|0)>>2]))<5){C=e+4|0,T=e+8|0,w=e+16|0;do{(0|(b=0|l[C>>2]))==(0|l[T>>2])?b=0:(l[C>>2]=b+1,b=0|c[b>>0]),x=x+8|0,l[r>>2]=x,(0|x)>=33&&(l[S>>2]=866,l[S+4>>2]=3208,l[S+8>>2]=1366,De(o,812,S),xe(o),x=0|l[r>>2]),b=b<<32-x|l[w>>2],l[w>>2]=b}while((0|x)<5)}else w=b=e+16|0,b=0|l[b>>2];if(A=b>>>27,l[w>>2]=b<<5,l[r>>2]=x+-5,(A+-1|0)>>>0>20)return y=v,0|(I=0);l[I+20>>2]=0,l[I>>2]=0,l[I+4>>2]=0,l[I+8>>2]=0,l[I+12>>2]=0,n[I+16>>0]=0,x=I+4|0,b=I+8|0;e:do{if(0|K(x,21,0,1,0)){C=0|l[b>>2],de((E=0|l[x>>2])+C|0,0,21-C|0),l[b>>2]=21,C=e+4|0,T=e+8|0,S=e+16|0,w=0;do{if((0|(x=0|l[r>>2]))<3)do{(0|(b=0|l[C>>2]))==(0|l[T>>2])?b=0:(l[C>>2]=b+1,b=0|c[b>>0]),x=x+8|0,l[r>>2]=x,(0|x)>=33&&(l[i>>2]=866,l[i+4>>2]=3208,l[i+8>>2]=1366,De(o,812,i),xe(o),x=0|l[r>>2]),b=b<<32-x|l[S>>2],l[S>>2]=b}while((0|x)<3);else b=0|l[S>>2];l[S>>2]=b<<3,l[r>>2]=x+-3,n[E+(0|c[1327+w>>0])>>0]=b>>>29,w=w+1|0}while((0|w)!=(0|A));if(0|re(I)){S=e+4|0,E=e+8|0,A=e+16|0,x=0;t:do{T=a-x|0,w=0|q(e,I);i:do{if(w>>>0<17)(0|l[u>>2])>>>0<=x>>>0&&(l[g>>2]=866,l[g+4>>2]=910,l[g+8>>2]=1497,De(o,812,g),xe(o)),n[(0|l[s>>2])+x>>0]=w,x=x+1|0;else switch(0|w){case 17:if((0|(b=0|l[r>>2]))<3)do{(0|(w=0|l[S>>2]))==(0|l[E>>2])?w=0:(l[S>>2]=w+1,w=0|c[w>>0]),b=b+8|0,l[r>>2]=b,(0|b)>=33&&(l[h>>2]=866,l[h+4>>2]=3208,l[h+8>>2]=1366,De(o,812,h),xe(o),b=0|l[r>>2]),w=w<<32-b|l[A>>2],l[A>>2]=w}while((0|b)<3);else w=0|l[A>>2];if(l[A>>2]=w<<3,l[r>>2]=b+-3,b=(w=3+(w>>>29)|0)>>>0>T>>>0){x=0;break e}x=(b?0:w)+x|0;break i;case 18:if((0|(b=0|l[r>>2]))<7)do{(0|(w=0|l[S>>2]))==(0|l[E>>2])?w=0:(l[S>>2]=w+1,w=0|c[w>>0]),b=b+8|0,l[r>>2]=b,(0|b)>=33&&(l[d>>2]=866,l[d+4>>2]=3208,l[d+8>>2]=1366,De(o,812,d),xe(o),b=0|l[r>>2]),w=w<<32-b|l[A>>2],l[A>>2]=w}while((0|b)<7);else w=0|l[A>>2];if(l[A>>2]=w<<7,l[r>>2]=b+-7,b=(w=11+(w>>>25)|0)>>>0>T>>>0){x=0;break e}x=(b?0:w)+x|0;break i;default:if((w+-19|0)>>>0>=2){P=81;break t}if(b=0|l[r>>2],19==(0|w)){if((0|b)<2)for(w=b;(0|(b=0|l[S>>2]))==(0|l[E>>2])?C=0:(l[S>>2]=b+1,C=0|c[b>>0]),b=w+8|0,l[r>>2]=b,(0|b)>=33&&(l[f>>2]=866,l[f+4>>2]=3208,l[f+8>>2]=1366,De(o,812,f),xe(o),b=0|l[r>>2]),w=C<<32-b|l[A>>2],l[A>>2]=w,(0|b)<2;)w=b;else w=0|l[A>>2];l[A>>2]=w<<2,w>>>=30,C=3,b=b+-2|0}else{if((0|b)<6)do{(0|(w=0|l[S>>2]))==(0|l[E>>2])?w=0:(l[S>>2]=w+1,w=0|c[w>>0]),b=b+8|0,l[r>>2]=b,(0|b)>=33&&(l[p>>2]=866,l[p+4>>2]=3208,l[p+8>>2]=1366,De(o,812,p),xe(o),b=0|l[r>>2]),w=w<<32-b|l[A>>2],l[A>>2]=w}while((0|b)<6);else w=0|l[A>>2];l[A>>2]=w<<6,w>>>=26,C=7,b=b+-6|0}if(l[r>>2]=b,0==(0|x)|(w=w+C|0)>>>0>T>>>0){x=0;break e}if(b=x+-1|0,(0|l[u>>2])>>>0<=b>>>0&&(l[_>>2]=866,l[_+4>>2]=910,l[_+8>>2]=1497,De(o,812,_),xe(o)),!((C=0|n[(0|l[s>>2])+b>>0])<<24>>24)){x=0;break e}if(x>>>0>=(b=w+x|0)>>>0)break i;do{(0|l[u>>2])>>>0<=x>>>0&&(l[m>>2]=866,l[m+4>>2]=910,l[m+8>>2]=1497,De(o,812,m),xe(o)),n[(0|l[s>>2])+x>>0]=C,x=x+1|0}while((0|x)!=(0|b));x=b}}while(0)}while(a>>>0>x>>>0);if(81==(0|P)){l[$>>2]=866,l[$+4>>2]=3149,l[$+8>>2]=1348,De(o,812,$),xe(o),x=0;break}x=(0|a)==(0|x)?0|re(t):0}else x=0}else n[I+16>>0]=1,x=0}while(0);return ce(I),y=v,0|(I=x)}function H(e,t,i,r){i|=0;var o,s,u,h,f,p,_=0,m=0,$=0,g=0,v=0,x=0,b=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0,R=0,L=0,B=0,N=0;if(p=y,y=y+880|0,B=p+144|0,f=p+128|0,h=p+112|0,u=p+96|0,R=p+80|0,P=p+64|0,E=p+48|0,A=p+32|0,w=p+16|0,b=p,o=p+360|0,s=p+296|0,N=p+224|0,S=p+156|0,0==(0|(t|=0))|(r|=0)>>>0>11)return y=p,0|(N=0);l[(e|=0)>>2]=t,m=(_=N)+68|0;do{l[_>>2]=0,_=_+4|0}while((0|_)<(0|m));_=0;do{m=N+((255&(L=0|n[i+_>>0]))<<2)|0,L<<24>>24&&(l[m>>2]=1+(0|l[m>>2])),_=_+1|0}while((0|_)!=(0|t));for(m=0,$=0,g=0,v=-1,x=1;(_=0|l[N+(x<<2)>>2])?(l[s+((C=x+-1|0)<<2)>>2]=m,m=_+m|0,L=16-x|0,l[e+28+(C<<2)>>2]=1+(m+-1<<L|(1<<L)-1),l[e+96+(C<<2)>>2]=$,l[S+(x<<2)>>2]=$,C=_+$|0,g=g>>>0>x>>>0?g:x,v=v>>>0<x>>>0?v:x):(l[e+28+(x+-1<<2)>>2]=0,C=$),17!=(0|(x=x+1|0));)m<<=1,$=C;l[e+4>>2]=C,m=e+172|0;do{if(C>>>0>(0|l[m>>2])>>>0){(_=C+-1|0)&C?(_|=_>>>16,_|=_>>>8,_|=_>>>4,_=(_=1+((_|=_>>>2)>>>1|_)|0)>>>0>t>>>0?t:_):_=C,l[m>>2]=_,_=0|l[($=e+176|0)>>2];do{if(0|_){if(L=0|l[_+-4>>2],_=_+-8|0,0!=(0|L)&&(0|L)==(0|~l[_>>2])||(l[b>>2]=866,l[b+4>>2]=651,l[b+8>>2]=1579,De(o,812,b),xe(o)),7&_){l[w>>2]=866,l[w+4>>2]=2506,l[w+8>>2]=1232,De(o,812,w),xe(o);break}_e(_,0,0,1,0);break}}while(0);if(m=0|he(8+((_=0|(_=0|l[m>>2])?_:1)<<1)|0,0)){l[m+4>>2]=_,l[m>>2]=~_,l[$>>2]=m+8,T=24;break}l[$>>2]=0,r=0;break}T=24}while(0);e:do{if(24==(0|T)){n[(L=e+24|0)>>0]=v,n[e+25>>0]=g,$=e+176|0,m=0;do{_=255&(D=0|n[i+m>>0]),D<<24>>24&&(0|l[N+(_<<2)>>2]||(l[A>>2]=866,l[A+4>>2]=2276,l[A+8>>2]=977,De(o,812,A),xe(o)),_=0|l[(D=S+(_<<2)|0)>>2],l[D>>2]=_+1,_>>>0>=C>>>0&&(l[E>>2]=866,l[E+4>>2]=2280,l[E+8>>2]=990,De(o,812,E),xe(o)),a[(0|l[$>>2])+(_<<1)>>1]=m),m=m+1|0}while((0|m)!=(0|t));if(O=(0|c[L>>0])>>>0<r>>>0?r:0,l[(D=e+8|0)>>2]=O,M=0!=(0|O)){I=1<<O,_=e+164|0;do{if(I>>>0>(0|l[_>>2])>>>0){l[_>>2]=I,_=0|l[($=e+168|0)>>2];do{if(0|_){if(A=0|l[_+-4>>2],_=_+-8|0,0!=(0|A)&&(0|A)==(0|~l[_>>2])||(l[P>>2]=866,l[P+4>>2]=651,l[P+8>>2]=1579,De(o,812,P),xe(o)),7&_){l[R>>2]=866,l[R+4>>2]=2506,l[R+8>>2]=1232,De(o,812,R),xe(o);break}_e(_,0,0,1,0);break}}while(0);if(m=0|he((_=I<<2)+8|0,0)){R=m+8|0,l[m+4>>2]=I,l[m>>2]=~I,l[$>>2]=R,m=R;break}l[$>>2]=0,r=0;break e}_=I<<2,$=m=e+168|0,m=0|l[m>>2]}while(0);de(0|m,-1,0|_),E=e+176|0,S=1;do{if(0|l[N+(S<<2)>>2]&&(P=1<<(A=O-S|0),m=0|l[s+((_=S+-1|0)<<2)>>2],_>>>0>=16&&(l[u>>2]=866,l[u+4>>2]=1960,l[u+8>>2]=1453,De(o,812,u),xe(o)),m>>>0<=(t=0==(0|(t=0|l[e+28+(_<<2)>>2]))?-1:(t+-1|0)>>>(16-S|0))>>>0)){C=(0|l[e+96+(_<<2)>>2])-m|0,T=S<<16;do{_=0|d[(0|l[E>>2])+(C+m<<1)>>1],(0|c[i+_>>0])!=(0|S)&&(l[h>>2]=866,l[h+4>>2]=2322,l[h+8>>2]=1019,De(o,812,h),xe(o)),w=m<<A,x=_|T,v=0;do{(b=v+w|0)>>>0>=I>>>0&&(l[f>>2]=866,l[f+4>>2]=2328,l[f+8>>2]=1053,De(o,812,f),xe(o)),_=0|l[$>>2],-1!=(0|l[_+(b<<2)>>2])&&(l[B>>2]=866,l[B+4>>2]=2330,l[B+8>>2]=1076,De(o,812,B),xe(o),_=0|l[$>>2]),l[_+(b<<2)>>2]=x,v=v+1|0}while(v>>>0<P>>>0);m=m+1|0}while(m>>>0<=t>>>0)}S=S+1|0}while(O>>>0>=S>>>0)}l[(_=e+96|0)>>2]=(0|l[_>>2])-(0|l[s>>2]),l[(_=e+100|0)>>2]=(0|l[_>>2])-(0|l[s+4>>2]),l[(_=e+104|0)>>2]=(0|l[_>>2])-(0|l[s+8>>2]),l[(_=e+108|0)>>2]=(0|l[_>>2])-(0|l[s+12>>2]),l[(_=e+112|0)>>2]=(0|l[_>>2])-(0|l[s+16>>2]),l[(_=e+116|0)>>2]=(0|l[_>>2])-(0|l[s+20>>2]),l[(_=e+120|0)>>2]=(0|l[_>>2])-(0|l[s+24>>2]),l[(_=e+124|0)>>2]=(0|l[_>>2])-(0|l[s+28>>2]),l[(_=e+128|0)>>2]=(0|l[_>>2])-(0|l[s+32>>2]),l[(_=e+132|0)>>2]=(0|l[_>>2])-(0|l[s+36>>2]),l[(_=e+136|0)>>2]=(0|l[_>>2])-(0|l[s+40>>2]),l[(_=e+140|0)>>2]=(0|l[_>>2])-(0|l[s+44>>2]),l[(_=e+144|0)>>2]=(0|l[_>>2])-(0|l[s+48>>2]),l[(_=e+148|0)>>2]=(0|l[_>>2])-(0|l[s+52>>2]),l[(_=e+152|0)>>2]=(0|l[_>>2])-(0|l[s+56>>2]),l[(_=e+156|0)>>2]=(0|l[_>>2])-(0|l[s+60>>2]),l[(_=e+16|0)>>2]=0,l[(m=e+20|0)>>2]=c[L>>0];t:do{if(M){do{if(!r)break t;B=r,r=r+-1|0}while(!(0|l[N+(B<<2)>>2]));if(l[_>>2]=l[e+28+(r<<2)>>2],r=O+1|0,l[m>>2]=r,r>>>0<=g>>>0){for(;!(0|l[N+(r<<2)>>2]);)if((r=r+1|0)>>>0>g>>>0)break t;l[m>>2]=r}}}while(0);l[e+92>>2]=-1,l[e+160>>2]=1048575,l[e+12>>2]=32-(0|l[D>>2]),r=1}}while(0);return y=p,0|(N=r)}function G(e){var t=0,i=0,r=0,n=0,o=0,a=0,s=0,u=0;if(e|=0){i=e+-8|0,n=0|l[1148],u=i+(t=-8&(e=0|l[e+-4>>2]))|0;do{if(1&e)s=i,a=i;else{if(r=0|l[i>>2],!(3&e)||(o=r+t|0,(a=i+(0-r)|0)>>>0<n>>>0))return;if((0|a)==(0|l[1149])){if(3!=(3&(t=0|l[(e=u+4|0)>>2])|0)){s=a,t=o;break}return l[1146]=o,l[e>>2]=-2&t,l[a+4>>2]=1|o,void(l[a+o>>2]=o)}if(i=r>>>3,r>>>0<256){if(e=0|l[a+8>>2],(0|(t=0|l[a+12>>2]))==(0|e)){l[1144]=l[1144]&~(1<<i),s=a,t=o;break}l[e+12>>2]=t,l[t+8>>2]=e,s=a,t=o;break}n=0|l[a+24>>2],e=0|l[a+12>>2];do{if((0|e)==(0|a)){if(!(e=0|l[(t=(i=a+16|0)+4|0)>>2])){if(!(e=0|l[i>>2])){e=0;break}t=i}for(;;)if(0|(r=0|l[(i=e+20|0)>>2]))e=r,t=i;else{if(!(r=0|l[(i=e+16|0)>>2]))break;e=r,t=i}l[t>>2]=0}else s=0|l[a+8>>2],l[s+12>>2]=e,l[e+8>>2]=s}while(0);if(n){if(t=0|l[a+28>>2],(0|a)==(0|l[(i=4880+(t<<2)|0)>>2])){if(l[i>>2]=e,!e){l[1145]=l[1145]&~(1<<t),s=a,t=o;break}}else if(l[n+16+(((0|l[n+16>>2])!=(0|a)&1)<<2)>>2]=e,!e){s=a,t=o;break}l[e+24>>2]=n,0|(i=0|l[(t=a+16|0)>>2])&&(l[e+16>>2]=i,l[i+24>>2]=e),(t=0|l[t+4>>2])?(l[e+20>>2]=t,l[t+24>>2]=e,s=a,t=o):(s=a,t=o)}else s=a,t=o}}while(0);if(!(a>>>0>=u>>>0)&&1&(r=0|l[(e=u+4|0)>>2])){if(2&r)l[e>>2]=-2&r,l[s+4>>2]=1|t,l[a+t>>2]=t,n=t;else{if(e=0|l[1149],(0|u)==(0|l[1150])){if(u=(0|l[1147])+t|0,l[1147]=u,l[1150]=s,l[s+4>>2]=1|u,(0|s)!=(0|e))return;return l[1149]=0,void(l[1146]=0)}if((0|u)==(0|e))return u=(0|l[1146])+t|0,l[1146]=u,l[1149]=a,l[s+4>>2]=1|u,void(l[a+u>>2]=u);n=(-8&r)+t|0,i=r>>>3;do{if(r>>>0<256){if(t=0|l[u+8>>2],(0|(e=0|l[u+12>>2]))==(0|t)){l[1144]=l[1144]&~(1<<i);break}l[t+12>>2]=e,l[e+8>>2]=t;break}o=0|l[u+24>>2],e=0|l[u+12>>2];do{if((0|e)==(0|u)){if(!(e=0|l[(t=(i=u+16|0)+4|0)>>2])){if(!(e=0|l[i>>2])){i=0;break}t=i}for(;;)if(0|(r=0|l[(i=e+20|0)>>2]))e=r,t=i;else{if(!(r=0|l[(i=e+16|0)>>2]))break;e=r,t=i}l[t>>2]=0,i=e}else i=0|l[u+8>>2],l[i+12>>2]=e,l[e+8>>2]=i,i=e}while(0);if(0|o){if(e=0|l[u+28>>2],(0|u)==(0|l[(t=4880+(e<<2)|0)>>2])){if(l[t>>2]=i,!i){l[1145]=l[1145]&~(1<<e);break}}else if(l[o+16+(((0|l[o+16>>2])!=(0|u)&1)<<2)>>2]=i,!i)break;l[i+24>>2]=o,0|(t=0|l[(e=u+16|0)>>2])&&(l[i+16>>2]=t,l[t+24>>2]=i),0|(e=0|l[e+4>>2])&&(l[i+20>>2]=e,l[e+24>>2]=i)}}while(0);if(l[s+4>>2]=1|n,l[a+n>>2]=n,(0|s)==(0|l[1149]))return void(l[1146]=n)}if(e=n>>>3,n>>>0<256)return i=4616+(e<<1<<2)|0,(t=0|l[1144])&(e=1<<e)?e=0|l[(t=i+8|0)>>2]:(l[1144]=t|e,e=i,t=i+8|0),l[t>>2]=s,l[e+12>>2]=s,l[s+8>>2]=e,void(l[s+12>>2]=i);(e=n>>>8)?n>>>0>16777215?e=31:e=n>>>((e=14-((o=((u=e<<(a=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(e=((u<<=o)+245760|0)>>>16&2))+(u<<e>>>15)|0)+7|0)&1|e<<1:e=0,r=4880+(e<<2)|0,l[s+28>>2]=e,l[s+20>>2]=0,l[s+16>>2]=0,t=0|l[1145],i=1<<e;do{if(t&i){for(t=n<<(31==(0|e)?0:25-(e>>>1)|0),i=0|l[r>>2];;){if((-8&l[i+4>>2]|0)==(0|n)){e=73;break}if(!(e=0|l[(r=i+16+(t>>>31<<2)|0)>>2])){e=72;break}t<<=1,i=e}if(72==(0|e)){l[r>>2]=s,l[s+24>>2]=i,l[s+12>>2]=s,l[s+8>>2]=s;break}if(73==(0|e)){u=0|l[(a=i+8|0)>>2],l[u+12>>2]=s,l[a>>2]=s,l[s+8>>2]=u,l[s+12>>2]=i,l[s+24>>2]=0;break}}else l[1145]=t|i,l[r>>2]=s,l[s+24>>2]=r,l[s+12>>2]=s,l[s+8>>2]=s}while(0);if(u=(0|l[1152])-1|0,l[1152]=u,u)return;for(e=5032;e=0|l[e>>2];)e=e+8|0;l[1152]=-1}}}function W(e,t){var i=0,r=0,n=0,o=0,a=0,s=0,u=0;u=(e|=0)+(t|=0)|0,i=0|l[e+4>>2];do{if(1&i)s=e,i=t;else{if(r=0|l[e>>2],!(3&i))return;if(a=r+t|0,(0|(o=e+(0-r)|0))==(0|l[1149])){if(3!=(3&(i=0|l[(e=u+4|0)>>2])|0)){s=o,i=a;break}return l[1146]=a,l[e>>2]=-2&i,l[o+4>>2]=1|a,void(l[o+a>>2]=a)}if(t=r>>>3,r>>>0<256){if(e=0|l[o+8>>2],(0|(i=0|l[o+12>>2]))==(0|e)){l[1144]=l[1144]&~(1<<t),s=o,i=a;break}l[e+12>>2]=i,l[i+8>>2]=e,s=o,i=a;break}n=0|l[o+24>>2],e=0|l[o+12>>2];do{if((0|e)==(0|o)){if(!(e=0|l[(i=(t=o+16|0)+4|0)>>2])){if(!(e=0|l[t>>2])){e=0;break}i=t}for(;;)if(0|(r=0|l[(t=e+20|0)>>2]))e=r,i=t;else{if(!(r=0|l[(t=e+16|0)>>2]))break;e=r,i=t}l[i>>2]=0}else s=0|l[o+8>>2],l[s+12>>2]=e,l[e+8>>2]=s}while(0);if(n){if(i=0|l[o+28>>2],(0|o)==(0|l[(t=4880+(i<<2)|0)>>2])){if(l[t>>2]=e,!e){l[1145]=l[1145]&~(1<<i),s=o,i=a;break}}else if(l[n+16+(((0|l[n+16>>2])!=(0|o)&1)<<2)>>2]=e,!e){s=o,i=a;break}l[e+24>>2]=n,0|(t=0|l[(i=o+16|0)>>2])&&(l[e+16>>2]=t,l[t+24>>2]=e),(i=0|l[i+4>>2])?(l[e+20>>2]=i,l[i+24>>2]=e,s=o,i=a):(s=o,i=a)}else s=o,i=a}}while(0);if(2&(r=0|l[(e=u+4|0)>>2]))l[e>>2]=-2&r,l[s+4>>2]=1|i,l[s+i>>2]=i;else{if(e=0|l[1149],(0|u)==(0|l[1150])){if(u=(0|l[1147])+i|0,l[1147]=u,l[1150]=s,l[s+4>>2]=1|u,(0|s)!=(0|e))return;return l[1149]=0,void(l[1146]=0)}if((0|u)==(0|e))return u=(0|l[1146])+i|0,l[1146]=u,l[1149]=s,l[s+4>>2]=1|u,void(l[s+u>>2]=u);o=(-8&r)+i|0,t=r>>>3;do{if(r>>>0<256){if(i=0|l[u+8>>2],(0|(e=0|l[u+12>>2]))==(0|i)){l[1144]=l[1144]&~(1<<t);break}l[i+12>>2]=e,l[e+8>>2]=i;break}n=0|l[u+24>>2],e=0|l[u+12>>2];do{if((0|e)==(0|u)){if(!(e=0|l[(i=(t=u+16|0)+4|0)>>2])){if(!(e=0|l[t>>2])){t=0;break}i=t}for(;;)if(0|(r=0|l[(t=e+20|0)>>2]))e=r,i=t;else{if(!(r=0|l[(t=e+16|0)>>2]))break;e=r,i=t}l[i>>2]=0,t=e}else t=0|l[u+8>>2],l[t+12>>2]=e,l[e+8>>2]=t,t=e}while(0);if(0|n){if(e=0|l[u+28>>2],(0|u)==(0|l[(i=4880+(e<<2)|0)>>2])){if(l[i>>2]=t,!t){l[1145]=l[1145]&~(1<<e);break}}else if(l[n+16+(((0|l[n+16>>2])!=(0|u)&1)<<2)>>2]=t,!t)break;l[t+24>>2]=n,0|(i=0|l[(e=u+16|0)>>2])&&(l[t+16>>2]=i,l[i+24>>2]=t),0|(e=0|l[e+4>>2])&&(l[t+20>>2]=e,l[e+24>>2]=t)}}while(0);if(l[s+4>>2]=1|o,l[s+o>>2]=o,(0|s)==(0|l[1149]))return void(l[1146]=o);i=o}if(e=i>>>3,i>>>0<256)return t=4616+(e<<1<<2)|0,(i=0|l[1144])&(e=1<<e)?e=0|l[(i=t+8|0)>>2]:(l[1144]=i|e,e=t,i=t+8|0),l[i>>2]=s,l[e+12>>2]=s,l[s+8>>2]=e,void(l[s+12>>2]=t);if((e=i>>>8)?i>>>0>16777215?e=31:e=i>>>((e=14-((o=((u=e<<(a=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(e=((u<<=o)+245760|0)>>>16&2))+(u<<e>>>15)|0)+7|0)&1|e<<1:e=0,n=4880+(e<<2)|0,l[s+28>>2]=e,l[s+20>>2]=0,l[s+16>>2]=0,!((t=0|l[1145])&(r=1<<e)))return l[1145]=t|r,l[n>>2]=s,l[s+24>>2]=n,l[s+12>>2]=s,void(l[s+8>>2]=s);for(t=i<<(31==(0|e)?0:25-(e>>>1)|0),r=0|l[n>>2];;){if((-8&l[r+4>>2]|0)==(0|i)){e=69;break}if(!(e=0|l[(n=r+16+(t>>>31<<2)|0)>>2])){e=68;break}t<<=1,r=e}return 68==(0|e)?(l[n>>2]=s,l[s+24>>2]=r,l[s+12>>2]=s,void(l[s+8>>2]=s)):69==(0|e)?(u=0|l[(a=r+8|0)>>2],l[u+12>>2]=s,l[a>>2]=s,l[s+8>>2]=u,l[s+12>>2]=r,void(l[s+24>>2]=0)):void 0}function Y(e,t,i,r,n){n|=0;var o=0,a=0,s=0,u=0,c=0,h=0,d=0,f=0,p=0,_=0;if(h=e|=0,a=i|=0,s=f=r|=0,!(c=u=t|=0))return o=0!=(0|n),s?o?(l[n>>2]=0|e,l[n+4>>2]=0&t,b=f=0,0|(n=0)):(b=f=0,0|(n=0)):(o&&(l[n>>2]=(h>>>0)%(a>>>0),l[n+4>>2]=0),b=f=0,0|(n=(h>>>0)/(a>>>0)>>>0));o=0==(0|s);do{if(a){if(!o){if((o=(0|C(0|s))-(0|C(0|c))|0)>>>0<=31){a=d=o+1|0,e=h>>>(d>>>0)&(t=o-31>>31)|c<<(s=31-o|0),t&=c>>>(d>>>0),o=0,s=h<<s;break}return n?(l[n>>2]=0|e,l[n+4>>2]=u|0&t,b=f=0,0|(n=0)):(b=f=0,0|(n=0))}if((o=a-1|0)&a|0){a=s=33+(0|C(0|a))-(0|C(0|c))|0,e=(d=32-s|0)-1>>31&c>>>((p=s-32|0)>>>0)|(c<<d|h>>>(s>>>0))&(t=p>>31),t&=c>>>(s>>>0),o=h<<(_=64-s|0)&(u=d>>31),s=(c<<_|h>>>(p>>>0))&u|h<<d&s-33>>31;break}return 0|n&&(l[n>>2]=o&h,l[n+4>>2]=0),1==(0|a)?(b=p=u|0&t,0|(_=0|e)):(_=0|Ae(0|a),b=p=c>>>(_>>>0)|0,0|(_=c<<32-_|h>>>(_>>>0)|0))}if(o)return 0|n&&(l[n>>2]=(c>>>0)%(a>>>0),l[n+4>>2]=0),b=p=0,0|(_=(c>>>0)/(a>>>0)>>>0);if(!h)return 0|n&&(l[n>>2]=0,l[n+4>>2]=(c>>>0)%(s>>>0)),b=p=0,0|(_=(c>>>0)/(s>>>0)>>>0);if(!((o=s-1|0)&s))return 0|n&&(l[n>>2]=0|e,l[n+4>>2]=o&c|0&t),p=0,_=c>>>((0|Ae(0|s))>>>0),b=p,0|_;if((o=(0|C(0|s))-(0|C(0|c))|0)>>>0<=30){a=t=o+1|0,e=c<<(s=31-o|0)|h>>>(t>>>0),t=c>>>(t>>>0),o=0,s=h<<s;break}return n?(l[n>>2]=0|e,l[n+4>>2]=u|0&t,b=p=0,0|(_=0)):(b=p=0,0|(_=0))}while(0);if(a){c=0|ze(0|(d=0|i),0|(h=f|0&r),-1,-1),i=b,u=s,s=0;do{r=u,u=o>>>31|u<<1,o=s|o<<1,Ne(0|c,0|i,0|(r=e<<1|r>>>31|0),0|(f=e>>>31|t<<1|0)),s=1&(p=(_=b)>>31|((0|_)<0?-1:0)<<1),e=0|Ne(0|r,0|f,p&d|0,(((0|_)<0?-1:0)>>31|((0|_)<0?-1:0)<<1)&h|0),t=b,a=a-1|0}while(0!=(0|a));c=u,u=0}else c=s,u=0,s=0;return a=0,0|n&&(l[n>>2]=e,l[n+4>>2]=t),b=p=(0|o)>>>31|(c|a)<<1|0&(a<<1|o>>>31)|u,0|(_=-2&(o<<1|0)|s)}function q(e,t){e|=0;var i,r,n,o,a,s,u,h,f=0,p=0,_=0,m=0,$=0,g=0;h=y,y=y+576|0,n=h+48|0,a=h+32|0,o=h+16|0,r=h,u=h+64|0,s=0|l[(t|=0)+20>>2],(0|(i=0|l[(g=e+20|0)>>2]))<24?(p=(f=0|l[($=e+4|0)>>2])>>>0<(_=0|l[e+8>>2])>>>0,(0|i)<16?(p?(m=(0|c[f>>0])<<8,f=f+1|0):m=0,f>>>0<_>>>0?(_=0|c[f>>0],f=f+1|0):_=0,l[$>>2]=f,l[g>>2]=i+16,p=16,f=_|m):(p?(l[$>>2]=f+1,f=0|c[f>>0]):f=0,l[g>>2]=i+8,p=24),_=l[($=e+16|0)>>2]|f<<p-i,l[$>>2]=_):($=_=e+16|0,_=0|l[_>>2]),m=1+(_>>>16)|0;do{if(!(m>>>0<=(0|l[s+16>>2])>>>0)){for(p=0|l[s+20>>2];m>>>0>(0|l[s+28+((f=p+-1|0)<<2)>>2])>>>0;)p=p+1|0;if((f=(_>>>(32-p|0))+(0|l[s+96+(f<<2)>>2])|0)>>>0<(0|l[t>>2])>>>0){f=0|d[(0|l[s+176>>2])+(f<<1)>>1];break}return l[n>>2]=866,l[n+4>>2]=3275,l[n+8>>2]=1348,De(u,812,n),xe(u),y=h,0|(g=0)}-1==(0|(p=0|l[(0|l[s+168>>2])+(_>>>(32-(0|l[s+8>>2])|0)<<2)>>2]))&&(l[r>>2]=866,l[r+4>>2]=3253,l[r+8>>2]=1393,De(u,812,r),xe(u)),f=65535&p,p>>>=16,(0|l[t+8>>2])>>>0<=f>>>0&&(l[o>>2]=866,l[o+4>>2]=909,l[o+8>>2]=1497,De(u,812,o),xe(u)),(0|c[(0|l[t+4>>2])+f>>0])!=(0|p)&&(l[a>>2]=866,l[a+4>>2]=3257,l[a+8>>2]=1410,De(u,812,a),xe(u))}while(0);return l[$>>2]=l[$>>2]<<p,l[g>>2]=(0|l[g>>2])-p,y=h,0|(g=f)}function j(e){var t,i,r,o,a,s=0,u=0,c=0;if(a=y,y=y+576|0,c=a+48|0,r=a+32|0,i=a+16|0,t=a,o=a+64|0,l[(e|=0)>>2]=0,0|(u=0|l[(s=e+284|0)>>2])&&(7&u?(l[t>>2]=866,l[t+4>>2]=2506,l[t+8>>2]=1232,De(o,812,t),xe(o)):_e(u,0,0,1,0),l[s>>2]=0,l[e+288>>2]=0,l[e+292>>2]=0),n[e+296>>0]=0,0|(u=0|l[(s=e+268|0)>>2])&&(7&u?(l[i>>2]=866,l[i+4>>2]=2506,l[i+8>>2]=1232,De(o,812,i),xe(o)):_e(u,0,0,1,0),l[s>>2]=0,l[e+272>>2]=0,l[e+276>>2]=0),n[e+280>>0]=0,0|(u=0|l[(s=e+252|0)>>2])&&(7&u?(l[r>>2]=866,l[r+4>>2]=2506,l[r+8>>2]=1232,De(o,812,r),xe(o)):_e(u,0,0,1,0),l[s>>2]=0,l[e+256>>2]=0,l[e+260>>2]=0),n[e+264>>0]=0,!(u=0|l[(s=e+236|0)>>2]))return n[(c=e+248|0)>>0]=0,ce(c=e+212|0),ce(c=e+188|0),ce(c=e+164|0),ce(c=e+140|0),ce(c=e+116|0),void(y=a);7&u?(l[c>>2]=866,l[c+4>>2]=2506,l[c+8>>2]=1232,De(o,812,c),xe(o)):_e(u,0,0,1,0),l[s>>2]=0,l[e+240>>2]=0,l[e+244>>2]=0,n[(c=e+248|0)>>0]=0,ce(c=e+212|0),ce(c=e+188|0),ce(c=e+164|0),ce(c=e+140|0),ce(c=e+116|0),y=a}function Z(e,t,i){e|=0,t|=0,i|=0;var r=0,n=0,o=0;e:do{if(t>>>0<=20){switch(0|t){case 9:r=3+(0|l[i>>2])&-4,t=0|l[r>>2],l[i>>2]=r+4,l[e>>2]=t;break e;case 10:r=3+(0|l[i>>2])&-4,t=0|l[r>>2],l[i>>2]=r+4,l[(r=e)>>2]=t,l[r+4>>2]=((0|t)<0)<<31>>31;break e;case 11:r=3+(0|l[i>>2])&-4,t=0|l[r>>2],l[i>>2]=r+4,l[(r=e)>>2]=t,l[r+4>>2]=0;break e;case 12:r=7+(0|l[i>>2])&-8,n=0|l[(t=r)>>2],t=0|l[t+4>>2],l[i>>2]=r+8,l[(r=e)>>2]=n,l[r+4>>2]=t;break e;case 13:n=3+(0|l[i>>2])&-4,r=0|l[n>>2],l[i>>2]=n+4,r=(65535&r)<<16>>16,l[(n=e)>>2]=r,l[n+4>>2]=((0|r)<0)<<31>>31;break e;case 14:n=3+(0|l[i>>2])&-4,r=0|l[n>>2],l[i>>2]=n+4,l[(n=e)>>2]=65535&r,l[n+4>>2]=0;break e;case 15:n=3+(0|l[i>>2])&-4,r=0|l[n>>2],l[i>>2]=n+4,r=(255&r)<<24>>24,l[(n=e)>>2]=r,l[n+4>>2]=((0|r)<0)<<31>>31;break e;case 16:n=3+(0|l[i>>2])&-4,r=0|l[n>>2],l[i>>2]=n+4,l[(n=e)>>2]=255&r,l[n+4>>2]=0;break e;case 17:case 18:n=7+(0|l[i>>2])&-8,o=+m[n>>3],l[i>>2]=n+8,m[e>>3]=o;break e;default:break e}}}while(0)}function K(e,t,i,r,n){t|=0,i|=0,r|=0,n|=0;var o,a,s,u,c,h,d=0,f=0,p=0,_=0;if(h=y,y=y+576|0,u=h+48|0,o=h+32|0,f=h+16|0,d=h,s=h+64|0,c=h+60|0,_=(e|=0)+8|0,(0|l[(a=e+4|0)>>2])>>>0>(0|l[_>>2])>>>0&&(l[d>>2]=866,l[d+4>>2]=2123,l[d+8>>2]=845,De(s,812,d),xe(s)),(2147418112/(r>>>0)|0)>>>0<=t>>>0&&(l[f>>2]=866,l[f+4>>2]=2124,l[f+8>>2]=885,De(s,812,f),xe(s)),(d=0|l[_>>2])>>>0>=t>>>0)return y=h,0|(_=1);if(i&&0!=((p=t+-1|0)&t|0)?(t=p>>>16|p,t|=t>>>8,t|=t>>>4,(t=1+((t|=t>>>2)>>>1|t)|0)?i=9:(t=0,i=10)):i=9,9==(0|i)&&t>>>0<=d>>>0&&(i=10),10==(0|i)&&(l[o>>2]=866,l[o+4>>2]=2133,l[o+8>>2]=933,De(s,812,o),xe(s)),p=0|w(t,r),n)if(f=0|he(p,c)){ct[0&n](f,0|l[e>>2],0|l[a>>2]),d=0|l[e>>2];do{if(0|d){if(7&d){l[u>>2]=866,l[u+4>>2]=2506,l[u+8>>2]=1232,De(s,812,u),xe(s);break}_e(d,0,0,1,0);break}}while(0);l[e>>2]=f,i=20}else t=0;else d=0|function(e,t,i,r){t|=0,i|=0,r|=0;var n=0,o=0,a=0,s=0,u=0,c=0;return c=y,y=y+560|0,u=c+32|0,o=c+16|0,n=c,a=c+48|0,s=c+44|0,7&(e|=0)|0?(l[n>>2]=866,l[n+4>>2]=2506,l[n+8>>2]=1210,De(a,812,n),xe(a),y=c,0|(u=0)):t>>>0>2147418112?(l[o>>2]=866,l[o+4>>2]=2506,l[o+8>>2]=1103,De(a,812,o),xe(a),y=c,0|(u=0)):(l[s>>2]=t,e=0|_e(e,t,s,r,0),0|i&&(l[i>>2]=l[s>>2]),7&e|0&&(l[u>>2]=866,l[u+4>>2]=2558,l[u+8>>2]=1156,De(a,812,u),xe(a)),y=c,0|(u=e))}(0|l[e>>2],p,c,1),d?(l[e>>2]=d,i=20):t=0;return 20==(0|i)&&((d=0|l[c>>2])>>>0>p>>>0&&(t=(d>>>0)/(r>>>0)|0),l[_>>2]=t,t=1),y=h,0|(_=t)}function Q(e,t,i,r,o,a,s){t|=0,i|=0,r|=0,o|=0,a|=0,s|=0;var u=0,h=0,f=0,p=0;if(p=0|l[(e|=0)+88>>2],h=(((h=(c[p+12>>0]<<8|c[p+13>>0])>>>s)>>>0>1?h:1)+3|0)>>>2,f=(((f=(c[p+14>>0]<<8|c[p+15>>0])>>>s)>>>0>1?f:1)+3|0)>>>2,s=0|n[(p=p+18|0)>>0],s=0|w(h,s<<24>>24==0|s<<24>>24==9?8:16),a){if(!(0==(3&a|0)&s>>>0<=a>>>0))return 0|(o=0);s=a}if((0|w(s,f))>>>0>o>>>0||(a=(h+1|0)>>>1,u=(f+1|0)>>>1,!i))return 0|(o=0);switch(l[e+92>>2]=t,l[e+96>>2]=t,l[e+104>>2]=i,l[e+100>>2]=t+i,l[e+108>>2]=0,l[e+112>>2]=0,0|n[p>>0]){case 0:if(!(0|function(e,t,i,r,o,a,s,u){t|=0,i|=0,r|=0,o|=0,a|=0,s|=0,u|=0;var h,d,f,p,_,m,$,g,v,x,b,C,T,S,E,A,P,I,M,O,D,R,L,B,N,F,z,k,V,U,X,H,G=0,W=0,Y=0,j=0,Z=0,K=0,Q=0,J=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0;if(H=y,y=y+656|0,U=H+112|0,k=H+96|0,z=H+80|0,F=H+64|0,N=H+48|0,X=H+32|0,V=H+16|0,B=H,R=H+144|0,L=H+128|0,S=0|l[(T=240+(e|=0)|0)>>2],A=0|l[(E=e+256|0)>>2],P=255&(se=0|n[17+(0|l[e+88>>2])>>0]),!(se<<24>>24))return y=H,1;M=0==(0|u),D=(O=s+-1|0)<<4,se=u+-1|0,$=0!=(1&a|0),g=r<<1,v=e+92|0,x=e+116|0,b=e+140|0,C=e+236|0,m=0!=(1&o|0),_=e+188|0,h=e+252|0,d=1+(I=r>>>2)|0,f=I+2|0,p=I+3|0,ae=0,a=0,i=0,o=1;do{if(!M)for(ne=0|l[t+(ae<<2)>>2],oe=0;;){if(W=0==(0|(ie=1&oe)),te=(ie<<5^32)-16|0,ie=(ie<<1^2)-1|0,re=$&(e=(0|oe)==(0|se)),(0|(G=W?0:O))!=(0|(ee=W?s:-1)))for(J=$&e^1,Q=W?ne:ne+D|0;;){1==(0|o)&&(o=512|q(v,x)),K=7&o,o>>>=3,W=0|c[1539+K>>0],e=0;do{i=(Z=(j=(Y=(0|q(v,b))+i|0)-S|0)>>31)&Y|j&~Z,(0|l[T>>2])>>>0<=i>>>0&&(l[B>>2]=866,l[B+4>>2]=910,l[B+8>>2]=1497,De(R,812,B),xe(R)),l[L+(e<<2)>>2]=l[(0|l[C>>2])+(i<<2)>>2],e=e+1|0}while(e>>>0<W>>>0);if(re|(Z=m&(0|G)==(0|O))){j=0;do{e=Q+(0|w(j,r))|0,Y=0==(0|j)|J,W=j<<1,a=(a=(le=(ue=(0|q(v,_))+a|0)-A|0)>>31)&ue|le&~a;do{if(Z){if(!Y){a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a;break}l[e>>2]=l[L+((0|c[1547+(K<<2)+W>>0])<<2)>>2],(0|l[E>>2])>>>0<=a>>>0&&(l[k>>2]=866,l[k+4>>2]=910,l[k+8>>2]=1497,De(R,812,k),xe(R)),l[e+4>>2]=l[(0|l[h>>2])+(a<<2)>>2],a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a}else Y&&(l[e>>2]=l[L+((0|c[1547+(K<<2)+W>>0])<<2)>>2],(0|l[E>>2])>>>0<=a>>>0&&(l[z>>2]=866,l[z+4>>2]=910,l[z+8>>2]=1497,De(R,812,z),xe(R)),l[e+4>>2]=l[(0|l[h>>2])+(a<<2)>>2]),e=e+8|0,a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a,Y&&(l[e>>2]=l[L+((0|c[1547+(K<<2)+(1|W)>>0])<<2)>>2],(0|l[E>>2])>>>0<=a>>>0&&(l[U>>2]=866,l[U+4>>2]=910,l[U+8>>2]=1497,De(R,812,U),xe(R)),l[e+4>>2]=l[(0|l[h>>2])+(a<<2)>>2])}while(0);j=j+1|0}while(2!=(0|j))}else l[Q>>2]=l[L+((0|c[1547+(K<<2)>>0])<<2)>>2],a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a,(0|l[E>>2])>>>0<=a>>>0&&(l[V>>2]=866,l[V+4>>2]=910,l[V+8>>2]=1497,De(R,812,V),xe(R)),l[Q+4>>2]=l[(0|l[h>>2])+(a<<2)>>2],l[Q+8>>2]=l[L+((0|c[1547+(K<<2)+1>>0])<<2)>>2],a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a,(0|l[E>>2])>>>0<=a>>>0&&(l[X>>2]=866,l[X+4>>2]=910,l[X+8>>2]=1497,De(R,812,X),xe(R)),l[Q+12>>2]=l[(0|l[h>>2])+(a<<2)>>2],l[Q+(I<<2)>>2]=l[L+((0|c[1547+(K<<2)+2>>0])<<2)>>2],a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a,(0|l[E>>2])>>>0<=a>>>0&&(l[N>>2]=866,l[N+4>>2]=910,l[N+8>>2]=1497,De(R,812,N),xe(R)),l[Q+(d<<2)>>2]=l[(0|l[h>>2])+(a<<2)>>2],l[Q+(f<<2)>>2]=l[L+((0|c[1547+(K<<2)+3>>0])<<2)>>2],a=(a=(ue=(le=(0|q(v,_))+a|0)-A|0)>>31)&le|ue&~a,(0|l[E>>2])>>>0<=a>>>0&&(l[F>>2]=866,l[F+4>>2]=910,l[F+8>>2]=1497,De(R,812,F),xe(R)),l[Q+(p<<2)>>2]=l[(0|l[h>>2])+(a<<2)>>2];if((0|(G=ie+G|0))==(0|ee))break;Q=Q+te|0}if((0|(oe=oe+1|0))==(0|u))break;ne=ne+g|0}ae=ae+1|0}while((0|ae)!=(0|P));return y=H,1}(e,r,o,s,h,f,a,u)))return 0|(o=0);break;case 4:case 6:case 5:case 3:case 2:if(!(0|function(e,t,i,r,o,a,s,u){t|=0,i|=0,r|=0,o|=0,a|=0,s|=0,u|=0;var h,f,p,_,m,$,g,v,x,b,w,C,T,S,E,A,P,I,M,O,D,R,L,B,N,F,z,k,V,U,X,H,G,W,Y,j=0,Z=0,K=0,Q=0,J=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,he=0,de=0,fe=0,pe=0,_e=0,me=0;if(Y=y,y=y+640|0,H=Y+80|0,X=Y+64|0,U=Y+48|0,W=Y+32|0,G=Y+16|0,V=Y,z=Y+128|0,k=Y+112|0,$=Y+96|0,v=0|l[(g=240+(e|=0)|0)>>2],b=0|l[(x=e+256|0)>>2],C=0|l[(w=e+272|0)>>2],me=0|l[e+88>>2],T=(0|c[me+63>>0])<<8|0|c[me+64>>0],S=255&(me=0|n[me+17>>0]),!(me<<24>>24))return y=Y,1;E=0==(0|u),P=(A=s+-1|0)<<5,I=u+-1|0,M=r<<1,O=e+92|0,D=e+116|0,R=e+164|0,L=e+268|0,B=e+140|0,N=e+236|0,F=e+212|0,me=e+188|0,m=0==(1&o|0),_=0==(1&a|0),f=e+288|0,p=e+284|0,h=e+252|0,_e=0,e=0,a=0,o=0,i=0,j=1;do{if(!E)for(fe=0|l[t+(_e<<2)>>2],pe=0;;){if(K=0==(0|(de=1&pe)),he=(de<<6^64)-32|0,de=(de<<1^2)-1|0,(0|(Z=K?0:A))!=(0|(ue=K?s:-1)))for(ce=_|(0|pe)!=(0|I),le=K?fe:fe+P|0;;){1==(0|j)&&(j=512|q(O,D)),se=7&j,j>>>=3,Q=0|c[1539+se>>0],K=0;do{a=(ae=(oe=(ne=(0|q(O,R))+a|0)-C|0)>>31)&ne|oe&~ae,(0|l[w>>2])>>>0<=a>>>0&&(l[V>>2]=866,l[V+4>>2]=910,l[V+8>>2]=1497,De(z,812,V),xe(z)),l[$+(K<<2)>>2]=d[(0|l[L>>2])+(a<<1)>>1],K=K+1|0}while(K>>>0<Q>>>0);K=0;do{i=(ae=(oe=(ne=(0|q(O,B))+i|0)-v|0)>>31)&ne|oe&~ae,(0|l[g>>2])>>>0<=i>>>0&&(l[G>>2]=866,l[G+4>>2]=910,l[G+8>>2]=1497,De(z,812,G),xe(z)),l[k+(K<<2)>>2]=l[(0|l[N>>2])+(i<<2)>>2],K=K+1|0}while(K>>>0<Q>>>0);for(ae=m|(0|Z)!=(0|A),ne=0,oe=le;;){if(te=ce|0==(0|ne),ie=ne<<1,ae)for(J=0,ee=oe;e=(e=(Q=(re=(0|q(O,F))+e|0)-T|0)>>31)&re|Q&~e,o=(o=(re=(Q=(0|q(O,me))+o|0)-b|0)>>31)&Q|re&~o,te&&(K=0|c[J+ie+(1547+(se<<2))>>0],Q=3*e|0,(0|l[f>>2])>>>0<=Q>>>0&&(l[W>>2]=866,l[W+4>>2]=910,l[W+8>>2]=1497,De(z,812,W),xe(z)),re=(0|l[p>>2])+(Q<<1)|0,l[ee>>2]=(0|d[re>>1])<<16|l[$+(K<<2)>>2],l[ee+4>>2]=(0|d[re+4>>1])<<16|0|d[re+2>>1],l[ee+8>>2]=l[k+(K<<2)>>2],(0|l[x>>2])>>>0<=o>>>0&&(l[U>>2]=866,l[U+4>>2]=910,l[U+8>>2]=1497,De(z,812,U),xe(z)),l[ee+12>>2]=l[(0|l[h>>2])+(o<<2)>>2]),2!=(0|(J=J+1|0));)ee=ee+16|0;else for(re=1^te,te=1547+(se<<2)+ie|0,J=0,ee=oe;e=(e=(Q=(ie=(0|q(O,F))+e|0)-T|0)>>31)&ie|Q&~e,o=(o=(ie=(Q=(0|q(O,me))+o|0)-b|0)>>31)&Q|ie&~o,0!=(0|J)|re||(K=0|c[te>>0],Q=3*e|0,(0|l[f>>2])>>>0<=Q>>>0&&(l[X>>2]=866,l[X+4>>2]=910,l[X+8>>2]=1497,De(z,812,X),xe(z)),ie=(0|l[p>>2])+(Q<<1)|0,l[ee>>2]=(0|d[ie>>1])<<16|l[$+(K<<2)>>2],l[ee+4>>2]=(0|d[ie+4>>1])<<16|0|d[ie+2>>1],l[ee+8>>2]=l[k+(K<<2)>>2],(0|l[x>>2])>>>0<=o>>>0&&(l[H>>2]=866,l[H+4>>2]=910,l[H+8>>2]=1497,De(z,812,H),xe(z)),l[ee+12>>2]=l[(0|l[h>>2])+(o<<2)>>2]),2!=(0|(J=J+1|0));)ee=ee+16|0;if(2==(0|(ne=ne+1|0)))break;oe=oe+r|0}if((0|(Z=de+Z|0))==(0|ue))break;le=le+he|0}if((0|(pe=pe+1|0))==(0|u))break;fe=fe+M|0}_e=_e+1|0}while((0|_e)!=(0|S));return y=Y,1}(e,r,o,s,h,f,a,u)))return 0|(o=0);break;case 9:if(!(0|function(e,t,i,r,o,a,s,u){t|=0,i|=0,r|=0,o|=0,a|=0,s|=0,u|=0;var h,f,p,_,m,$,g,v,x,b,w,C,T,S,E,A,P,I,M,O,D,R,L,B,N=0,F=0,z=0,k=0,V=0,U=0,X=0,H=0,G=0,W=0,Y=0,j=0,Z=0,K=0,Q=0,J=0,ee=0,te=0;if(B=y,y=y+592|0,D=B+48|0,L=B+32|0,R=B+16|0,O=B,I=B+80|0,M=B+64|0,$=0|l[(m=272+(e|=0)|0)>>2],te=0|l[e+88>>2],g=(0|c[te+63>>0])<<8|0|c[te+64>>0],v=255&(te=0|n[te+17>>0]),!(te<<24>>24))return y=B,1;x=0==(0|u),w=(b=s+-1|0)<<4,C=u+-1|0,T=r<<1,S=e+92|0,E=e+116|0,A=e+164|0,P=e+268|0,te=e+212|0,_=0==(1&o|0),p=0==(1&a|0),f=e+288|0,h=e+284|0,ee=0,o=0,i=0,a=1;do{if(!x)for(Q=0|l[t+(ee<<2)>>2],J=0;;){if(N=0==(0|(K=1&J)),Z=(K<<5^32)-16|0,K=(K<<1^2)-1|0,(0|(e=N?0:b))!=(0|(Y=N?s:-1)))for(j=p|(0|J)!=(0|C),W=N?Q:Q+w|0;;){1==(0|a)&&(a=512|q(S,E)),G=7&a,a>>>=3,F=0|c[1539+G>>0],N=0;do{i=(H=(X=(U=(0|q(S,A))+i|0)-$|0)>>31)&U|X&~H,(0|l[m>>2])>>>0<=i>>>0&&(l[O>>2]=866,l[O+4>>2]=910,l[O+8>>2]=1497,De(I,812,O),xe(I)),l[M+(N<<2)>>2]=d[(0|l[P>>2])+(i<<1)>>1],N=N+1|0}while(N>>>0<F>>>0);for(H=_|(0|e)!=(0|b),U=0,X=W;V=j|0==(0|U),F=U<<1,k=(k=(z=(N=(0|q(S,te))+o|0)-g|0)>>31)&N|z&~k,H?(V&&(o=0|c[1547+(G<<2)+F>>0],N=3*k|0,(0|l[f>>2])>>>0<=N>>>0&&(l[R>>2]=866,l[R+4>>2]=910,l[R+8>>2]=1497,De(I,812,R),xe(I)),z=(0|l[h>>2])+(N<<1)|0,l[X>>2]=(0|d[z>>1])<<16|l[M+(o<<2)>>2],l[X+4>>2]=(0|d[z+4>>1])<<16|0|d[z+2>>1]),z=X+8|0,o=(o=(k=(N=(0|q(S,te))+k|0)-g|0)>>31)&N|k&~o,V&&(N=0|c[1547+(G<<2)+(1|F)>>0],F=3*o|0,(0|l[f>>2])>>>0<=F>>>0&&(l[D>>2]=866,l[D+4>>2]=910,l[D+8>>2]=1497,De(I,812,D),xe(I)),V=(0|l[h>>2])+(F<<1)|0,l[z>>2]=(0|d[V>>1])<<16|l[M+(N<<2)>>2],l[X+12>>2]=(0|d[V+4>>1])<<16|0|d[V+2>>1])):(V&&(o=0|c[1547+(G<<2)+F>>0],N=3*k|0,(0|l[f>>2])>>>0<=N>>>0&&(l[L>>2]=866,l[L+4>>2]=910,l[L+8>>2]=1497,De(I,812,L),xe(I)),V=(0|l[h>>2])+(N<<1)|0,l[X>>2]=(0|d[V>>1])<<16|l[M+(o<<2)>>2],l[X+4>>2]=(0|d[V+4>>1])<<16|0|d[V+2>>1]),o=(o=(V=(k=(0|q(S,te))+k|0)-g|0)>>31)&k|V&~o),2!=(0|(U=U+1|0));)X=X+r|0;if((0|(e=K+e|0))==(0|Y))break;W=W+Z|0}if((0|(J=J+1|0))==(0|u))break;Q=Q+T|0}ee=ee+1|0}while((0|ee)!=(0|v));return y=B,1}(e,r,o,s,h,f,a,u)))return 0|(o=0);break;case 8:case 7:if(!(0|function(e,t,i,r,o,a,s,u){t|=0,i|=0,r|=0,o|=0,a|=0,s|=0,u|=0;var h,f,p,_,m,$,g,v,x,b,w,C,T,S,E,A,P,I,M,O,D,R,L,B,N,F,z,k=0,V=0,U=0,X=0,H=0,G=0,W=0,Y=0,j=0,Z=0,K=0,Q=0,J=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,he=0;if(z=y,y=y+640|0,B=z+80|0,L=z+64|0,R=z+48|0,F=z+32|0,N=z+16|0,D=z,M=z+128|0,O=z+112|0,m=z+96|0,g=0|l[($=272+(e|=0)|0)>>2],he=0|l[e+88>>2],v=(0|c[he+63>>0])<<8|0|c[he+64>>0],x=255&(he=0|n[he+17>>0]),!(he<<24>>24))return y=z,1;b=0==(0|u),C=(w=s+-1|0)<<5,T=u+-1|0,S=r<<1,E=e+92|0,A=e+116|0,P=e+164|0,I=e+268|0,he=e+212|0,_=0==(1&o|0),p=0==(1&a|0),f=e+288|0,h=e+284|0,ce=0,e=0,a=0,o=0,i=0,k=1;do{if(!b)for(le=0|l[t+(ce<<2)>>2],ue=0;;){if(U=0==(0|(se=1&ue)),ae=(se<<6^64)-32|0,se=(se<<1^2)-1|0,(0|(V=U?0:w))!=(0|(ne=U?s:-1)))for(oe=p|(0|ue)!=(0|T),re=U?le:le+C|0;;){1==(0|k)&&(k=512|q(E,A)),ie=7&k,k>>>=3,X=0|c[1539+ie>>0],U=0;do{i=(te=(ee=(J=(0|q(E,P))+i|0)-g|0)>>31)&J|ee&~te,(0|l[$>>2])>>>0<=i>>>0&&(l[D>>2]=866,l[D+4>>2]=910,l[D+8>>2]=1497,De(M,812,D),xe(M)),l[O+(U<<2)>>2]=d[(0|l[I>>2])+(i<<1)>>1],U=U+1|0}while(U>>>0<X>>>0);U=0;do{a=(te=(ee=(J=(0|q(E,P))+a|0)-g|0)>>31)&J|ee&~te,(0|l[$>>2])>>>0<=a>>>0&&(l[N>>2]=866,l[N+4>>2]=910,l[N+8>>2]=1497,De(M,812,N),xe(M)),l[m+(U<<2)>>2]=d[(0|l[I>>2])+(a<<1)>>1],U=U+1|0}while(U>>>0<X>>>0);for(te=_|(0|V)!=(0|w),J=0,ee=re;;){if(Z=oe|0==(0|J),K=J<<1,te)for(Y=0,j=ee;o=(o=(W=(Q=(0|q(E,he))+o|0)-v|0)>>31)&Q|W&~o,e=(e=(Q=(W=(0|q(E,he))+e|0)-v|0)>>31)&W|Q&~e,Z&&(W=0|c[Y+K+(1547+(ie<<2))>>0],X=3*o|0,(U=0|l[f>>2])>>>0<=X>>>0&&(l[F>>2]=866,l[F+4>>2]=910,l[F+8>>2]=1497,De(M,812,F),xe(M),U=0|l[f>>2]),X=(H=0|l[h>>2])+(X<<1)|0,U>>>0>(G=3*e|0)>>>0?U=H:(l[R>>2]=866,l[R+4>>2]=910,l[R+8>>2]=1497,De(M,812,R),xe(M),U=0|l[h>>2]),Q=U+(G<<1)|0,l[j>>2]=(0|d[X>>1])<<16|l[O+(W<<2)>>2],l[j+4>>2]=(0|d[X+4>>1])<<16|0|d[X+2>>1],l[j+8>>2]=(0|d[Q>>1])<<16|l[m+(W<<2)>>2],l[j+12>>2]=(0|d[Q+4>>1])<<16|0|d[Q+2>>1]),2!=(0|(Y=Y+1|0));)j=j+16|0;else for(Q=1^Z,Z=1547+(ie<<2)+K|0,Y=0,j=ee;o=(o=(W=(K=(0|q(E,he))+o|0)-v|0)>>31)&K|W&~o,e=(e=(K=(W=(0|q(E,he))+e|0)-v|0)>>31)&W|K&~e,0!=(0|Y)|Q||(W=0|c[Z>>0],X=3*o|0,(U=0|l[f>>2])>>>0<=X>>>0&&(l[L>>2]=866,l[L+4>>2]=910,l[L+8>>2]=1497,De(M,812,L),xe(M),U=0|l[f>>2]),X=(H=0|l[h>>2])+(X<<1)|0,U>>>0>(G=3*e|0)>>>0?U=H:(l[B>>2]=866,l[B+4>>2]=910,l[B+8>>2]=1497,De(M,812,B),xe(M),U=0|l[h>>2]),K=U+(G<<1)|0,l[j>>2]=(0|d[X>>1])<<16|l[O+(W<<2)>>2],l[j+4>>2]=(0|d[X+4>>1])<<16|0|d[X+2>>1],l[j+8>>2]=(0|d[K>>1])<<16|l[m+(W<<2)>>2],l[j+12>>2]=(0|d[K+4>>1])<<16|0|d[K+2>>1]),2!=(0|(Y=Y+1|0));)j=j+16|0;if(2==(0|(J=J+1|0)))break;ee=ee+r|0}if((0|(V=se+V|0))==(0|ne))break;re=re+ae|0}if((0|(ue=ue+1|0))==(0|u))break;le=le+S|0}ce=ce+1|0}while((0|ce)!=(0|x));return y=z,1}(e,r,o,s,h,f,a,u)))return 0|(o=0);break;default:return 0|(o=0)}return 0|(o=1)}function J(e,t,i){e|=0,t|=0;var r,o,a=0;if((0|(i|=0))>=8192)return 0|B(0|e,0|t,0|i);if(o=0|e,r=e+i|0,(3&e)==(3&t)){for(;3&e;){if(!i)return 0|o;n[e>>0]=0|n[t>>0],e=e+1|0,t=t+1|0,i=i-1|0}for(a=(i=-4&r|0)-64|0;(0|e)<=(0|a);)l[e>>2]=l[t>>2],l[e+4>>2]=l[t+4>>2],l[e+8>>2]=l[t+8>>2],l[e+12>>2]=l[t+12>>2],l[e+16>>2]=l[t+16>>2],l[e+20>>2]=l[t+20>>2],l[e+24>>2]=l[t+24>>2],l[e+28>>2]=l[t+28>>2],l[e+32>>2]=l[t+32>>2],l[e+36>>2]=l[t+36>>2],l[e+40>>2]=l[t+40>>2],l[e+44>>2]=l[t+44>>2],l[e+48>>2]=l[t+48>>2],l[e+52>>2]=l[t+52>>2],l[e+56>>2]=l[t+56>>2],l[e+60>>2]=l[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|i);)l[e>>2]=l[t>>2],e=e+4|0,t=t+4|0}else for(i=r-4|0;(0|e)<(0|i);)n[e>>0]=0|n[t>>0],n[e+1>>0]=0|n[t+1>>0],n[e+2>>0]=0|n[t+2>>0],n[e+3>>0]=0|n[t+3>>0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|r);)n[e>>0]=0|n[t>>0],e=e+1|0,t=t+1|0;return 0|o}function ee(e,t,i){t|=0,i|=0;var r,n,o,a,s,u=0,c=0,h=0,d=0,f=0,p=0;s=y,y=y+48|0,a=s+16|0,h=s,c=s+32|0,u=0|l[(n=(e|=0)+28|0)>>2],l[c>>2]=u,u=(0|l[(o=e+20|0)>>2])-u|0,l[c+4>>2]=u,l[c+8>>2]=t,l[c+12>>2]=i,u=u+i|0,r=e+60|0,l[h>>2]=l[r>>2],l[h+4>>2]=c,l[h+8>>2]=2,h=0|ke(0|z(146,0|h));e:do{if((0|u)!=(0|h)){for(t=2;!((0|h)<0);)if(u=u-h|0,t=((f=h>>>0>(p=0|l[c+4>>2])>>>0)<<31>>31)+t|0,p=h-(f?p:0)|0,l[(c=f?c+8|0:c)>>2]=(0|l[c>>2])+p,l[(f=c+4|0)>>2]=(0|l[f>>2])-p,l[a>>2]=l[r>>2],l[a+4>>2]=c,l[a+8>>2]=t,(0|u)==(0|(h=0|ke(0|z(146,0|a))))){d=3;break e}l[e+16>>2]=0,l[n>>2]=0,l[o>>2]=0,l[e>>2]=32|l[e>>2],i=2==(0|t)?0:i-(0|l[c+4>>2])|0}else d=3}while(0);return 3==(0|d)&&(p=0|l[e+44>>2],l[e+16>>2]=p+(0|l[e+48>>2]),l[n>>2]=p,l[o>>2]=p),y=s,0|i}function te(e,t,i){e|=0,t|=0,i|=0;var r,o,a,s,u,c=0,h=0,d=0,f=0,p=0,_=0,m=0;u=y,y=y+224|0,r=u+120|0,a=u,s=u+136|0,h=(c=o=u+80|0)+40|0;do{l[c>>2]=0,c=c+4|0}while((0|c)<(0|h));return l[r>>2]=l[i>>2],(0|U(0,t,r,a,o))<0?i=-1:(l[e+76>>2],m=32&(i=0|l[e>>2]),(0|n[e+74>>0])<1&&(l[e>>2]=-33&i),0|l[(c=e+48|0)>>2]?i=0|U(e,t,r,a,o):(d=0|l[(h=e+44|0)>>2],l[h>>2]=s,l[(f=e+28|0)>>2]=s,l[(p=e+20|0)>>2]=s,l[c>>2]=80,l[(_=e+16|0)>>2]=s+80,i=0|U(e,t,r,a,o),d&&(at[7&l[e+36>>2]](e,0,0),i=0==(0|l[p>>2])?-1:i,l[h>>2]=d,l[c>>2]=0,l[_>>2]=0,l[f>>2]=0,l[p>>2]=0)),c=0|l[e>>2],l[e>>2]=c|m,i=0==(32&c|0)?i:-1),y=u,0|i}function ie(e,t,i,r){t|=0,i|=0,r|=0;var o,s,u,c,h,d,f,p=0,_=0;f=y,y=y+64|0,h=f,_=0|l[(e|=0)>>2],d=e+(0|l[_+-8>>2])|0,_=0|l[_+-4>>2],l[h>>2]=i,l[h+4>>2]=e,l[h+8>>2]=t,l[h+12>>2]=r,t=h+20|0,r=h+24|0,o=h+28|0,s=h+32|0,u=h+40|0,c=(p=e=h+16|0)+36|0;do{l[p>>2]=0,p=p+4|0}while((0|p)<(0|c));a[e+36>>1]=0,n[e+38>>0]=0;e:do{if(0|Ge(_,i))l[h+48>>2]=1,dt[3&l[20+(0|l[_>>2])>>2]](_,h,d,d,1,0),e=1==(0|l[r>>2])?d:0;else{switch(st[3&l[24+(0|l[_>>2])>>2]](_,h,d,1,0),0|l[h+36>>2]){case 0:e=1==(0|l[u>>2])&1==(0|l[o>>2])&1==(0|l[s>>2])?0|l[t>>2]:0;break e;case 1:break;default:e=0;break e}if(1!=(0|l[r>>2])&&!(0==(0|l[u>>2])&1==(0|l[o>>2])&1==(0|l[s>>2]))){e=0;break}e=0|l[e>>2]}}while(0);return y=f,0|e}function re(e){var t,i=0,r=0,n=0,o=0,a=0,s=0,u=0;if(t=y,y=y+544|0,s=t+16|0,i=t,o=t+32|0,((r=0|l[(a=(e|=0)+8|0)>>2])+-1|0)>>>0>=8192&&(l[i>>2]=866,l[i+4>>2]=3006,l[i+8>>2]=1257,De(o,812,i),xe(o)),l[e>>2]=r,(i=0|l[(n=e+20|0)>>2])?u=r:((i=0|he(180,0))?(l[(u=i+164|0)>>2]=0,l[u+4>>2]=0,l[u+8>>2]=0,l[u+12>>2]=0):i=0,l[n>>2]=i,u=0|l[e>>2]),0|l[a>>2]?s=u:(l[s>>2]=866,l[s+4>>2]=910,l[s+8>>2]=1497,De(o,812,s),xe(o),s=0|l[e>>2]),o=0|l[e+4>>2],!(s>>>0>16))return e=0|H(i,u,o,e=0),y=t,0|e;for(r=s,n=0;a=n+1|0,r>>>0>3;)r>>>=1,n=a;return e=0|H(i,u,o,e=255&((e=n+2+(32!=(0|a)&1<<a>>>0<s>>>0&1)|0)>>>0<11?e:11)),y=t,0|e}function ne(e){var t,i,r,n,o,a,s=0,u=0;a=y,y=y+576|0,n=a+48|0,o=a+32|0,i=a+16|0,t=a,r=a+64|0,s=0|l[(e|=0)+168>>2];do{if(0|s){if(u=0|l[s+-4>>2],s=s+-8|0,0!=(0|u)&&(0|u)==(0|~l[s>>2])||(l[t>>2]=866,l[t+4>>2]=651,l[t+8>>2]=1579,De(r,812,t),xe(r)),7&s){l[i>>2]=866,l[i+4>>2]=2506,l[i+8>>2]=1232,De(r,812,i),xe(r);break}_e(s,0,0,1,0);break}}while(0);if(s=0|l[e+176>>2])return u=0|l[s+-4>>2],s=s+-8|0,0!=(0|u)&&(0|u)==(0|~l[s>>2])||(l[o>>2]=866,l[o+4>>2]=651,l[o+8>>2]=1579,De(r,812,o),xe(r)),7&s?(l[n>>2]=866,l[n+4>>2]=2506,l[n+8>>2]=1232,De(r,812,n),xe(r),void(y=a)):(_e(s,0,0,1,0),void(y=a));y=a}function oe(e,t,i){var r=0;return!(0!=(0|(e|=0))&(t|=0)>>>0>73&0!=(0|(i|=0)))||40!=(0|l[i>>2])||18552!=((0|c[e>>0])<<8|0|c[e+1>>0]|0)||((0|c[e+2>>0])<<8|0|c[e+3>>0])>>>0<74||((0|c[e+7>>0])<<16|(0|c[e+6>>0])<<24|(0|c[e+8>>0])<<8|0|c[e+9>>0])>>>0>t>>>0?0|(i=0):(l[i+4>>2]=(0|c[e+12>>0])<<8|0|c[e+13>>0],l[i+8>>2]=(0|c[e+14>>0])<<8|0|c[e+15>>0],l[i+12>>2]=c[e+16>>0],l[i+16>>2]=c[e+17>>0],t=e+18|0,l[(r=i+32|0)>>2]=c[t>>0],l[r+4>>2]=0,t=0|n[t>>0],l[i+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16,l[i+24>>2]=(0|c[e+26>>0])<<16|(0|c[e+25>>0])<<24|(0|c[e+27>>0])<<8|0|c[e+28>>0],l[i+28>>2]=(0|c[e+30>>0])<<16|(0|c[e+29>>0])<<24|(0|c[e+31>>0])<<8|0|c[e+32>>0],0|(i=1))}function ae(e,t){e|=0;var i,r,n,o=0,a=0,s=0,u=0,h=0;if(n=y,y=y+544|0,h=n+16|0,o=n,u=n+32|0,(t|=0)>>>0>=33&&(l[o>>2]=866,l[o+4>>2]=3199,l[o+8>>2]=1350,De(u,812,o),xe(u)),(0|(o=0|l[(r=e+20|0)>>2]))>=(0|t))return s=a=e+16|0,u=o,h=(a=0|l[a>>2])>>>(h=32-t|0),a<<=t,l[s>>2]=a,t=u-t|0,l[r>>2]=t,y=n,0|h;a=e+4|0,s=e+8|0,i=e+16|0;do{(0|(e=0|l[a>>2]))==(0|l[s>>2])?e=0:(l[a>>2]=e+1,e=0|c[e>>0]),o=o+8|0,l[r>>2]=o,(0|o)>=33&&(l[h>>2]=866,l[h+4>>2]=3208,l[h+8>>2]=1366,De(u,812,h),xe(u),o=0|l[r>>2]),e=e<<32-o|l[i>>2],l[i>>2]=e}while((0|o)<(0|t));return h=e>>>(h=32-t|0),u=e<<t,l[i>>2]=u,t=o-t|0,l[r>>2]=t,y=n,0|h}function se(e,t,i){e|=0;var r=0,o=0,a=0,s=0;a=255&(t|=0),r=0!=(0|(i|=0));e:do{if(r&0!=(3&e|0))for(o=255&t;;){if((0|n[e>>0])==o<<24>>24){s=6;break e}if(!((r=0!=(0|(i=i+-1|0)))&0!=(3&(e=e+1|0)|0))){s=5;break}}else s=5}while(0);5==(0|s)&&(r?s=6:i=0);e:do{if(6==(0|s)&&(o=255&t,(0|n[e>>0])!=o<<24>>24)){r=0|w(a,16843009);t:do{if(i>>>0>3){for(;!((-2139062144&(a=l[e>>2]^r)^-2139062144)&a+-16843009|0);)if(e=e+4|0,(i=i+-4|0)>>>0<=3){s=11;break t}}else s=11}while(0);if(11==(0|s)&&!i){i=0;break}for(;;){if((0|n[e>>0])==o<<24>>24)break e;if(e=e+1|0,!(i=i+-1|0)){i=0;break}}}}while(0);return 0|(0|i?e:0)}function le(e,t,i,r,n){t|=0,i|=0,r|=0,n|=0;var o,a,s,u=0,h=0,d=0;return s=y,y=y+528|0,d=s,h=s+16|0,o=0|l[(e|=0)+88>>2],a=(0|c[o+70+(n<<2)+1>>0])<<16|(0|c[o+70+(n<<2)>>0])<<24|(0|c[o+70+(n<<2)+2>>0])<<8|0|c[o+70+(n<<2)+3>>0],(u=(u=n+1|0)>>>0<(0|c[o+16>>0])>>>0?(0|c[o+70+(u<<2)+1>>0])<<16|(0|c[o+70+(u<<2)>>0])<<24|(0|c[o+70+(u<<2)+2>>0])<<8|0|c[o+70+(u<<2)+3>>0]:0|l[e+8>>2])>>>0>a>>>0?(d=0|Q(e,h=(h=0|l[(h=e+4|0)>>2])+a|0,d=u-a|0,t,i,r,n),y=s,0|d):(l[d>>2]=866,l[d+4>>2]=3694,l[d+8>>2]=1508,De(h,812,d),xe(h),d=0|Q(e,h=(h=0|l[(h=e+4|0)>>2])+a|0,d=u-a|0,t,i,r,n),y=s,0|d)}function ue(e,t,i){e|=0,t|=0;var r=0,o=0,a=0,s=0,u=0;(o=0|l[(r=(i|=0)+16|0)>>2])?a=5:0|we(i)?r=0:(o=0|l[r>>2],a=5);e:do{if(5==(0|a)){if(r=s=0|l[(u=i+20|0)>>2],(o-s|0)>>>0<t>>>0){r=0|at[7&l[i+36>>2]](i,e,t);break}t:do{if((0|n[i+75>>0])>-1){for(s=t;;){if(!s){a=0,o=e;break t}if(10==(0|n[e+(o=s+-1|0)>>0]))break;s=o}if((r=0|at[7&l[i+36>>2]](i,e,s))>>>0<s>>>0)break e;a=s,o=e+s|0,t=t-s|0,r=0|l[u>>2]}else a=0,o=e}while(0);J(0|r,0|o,0|t),l[u>>2]=(0|l[u>>2])+t,r=a+t|0}}while(0);return 0|r}function ce(e){var t,i,r=0,o=0,a=0;i=y,y=y+544|0,a=i+16|0,o=i,t=i+32|0,r=0|l[(e|=0)+20>>2];do{if(0|r){if(ne(r),7&r){l[o>>2]=866,l[o+4>>2]=2506,l[o+8>>2]=1232,De(t,812,o),xe(t);break}_e(r,0,0,1,0);break}}while(0);if(!(o=0|l[(r=e+4|0)>>2]))return n[(a=e+16|0)>>0]=0,void(y=i);7&o?(l[a>>2]=866,l[a+4>>2]=2506,l[a+8>>2]=1232,De(t,812,a),xe(t)):_e(o,0,0,1,0),l[r>>2]=0,l[e+8>>2]=0,l[e+12>>2]=0,n[(a=e+16|0)>>0]=0,y=i}function he(e,t){t|=0;var i,r,n,o,a=0,s=0,u=0;return o=y,y=y+560|0,u=o+32|0,n=o+16|0,a=o,r=o+48|0,i=o+44|0,(s=0|(s=(e|=0)+3&-4)?s:4)>>>0>2147418112?(l[a>>2]=866,l[a+4>>2]=2506,l[a+8>>2]=1103,De(r,812,a),xe(r),y=o,0|(u=0)):(l[i>>2]=s,e=0|_e(0,s,i,1,0),a=0|l[i>>2],0|t&&(l[t>>2]=a),0==(0|e)|a>>>0<s>>>0?(l[n>>2]=866,l[n+4>>2]=2506,l[n+8>>2]=1129,De(r,812,n),xe(r),e=0):7&e&&(l[u>>2]=866,l[u+4>>2]=2533,l[u+8>>2]=1156,De(r,812,u),xe(r)),y=o,0|(u=e))}function de(e,t,i){t|=0;var r,o=0,a=0,s=0;if(r=(e|=0)+(i|=0)|0,t&=255,(0|i)>=67){for(;3&e;)n[e>>0]=t,e=e+1|0;for(a=(o=-4&r|0)-64|0,s=t|t<<8|t<<16|t<<24;(0|e)<=(0|a);)l[e>>2]=s,l[e+4>>2]=s,l[e+8>>2]=s,l[e+12>>2]=s,l[e+16>>2]=s,l[e+20>>2]=s,l[e+24>>2]=s,l[e+28>>2]=s,l[e+32>>2]=s,l[e+36>>2]=s,l[e+40>>2]=s,l[e+44>>2]=s,l[e+48>>2]=s,l[e+52>>2]=s,l[e+56>>2]=s,l[e+60>>2]=s,e=e+64|0;for(;(0|e)<(0|o);)l[e>>2]=s,e=e+4|0}for(;(0|e)<(0|r);)n[e>>0]=t,e=e+1|0;return r-i|0}function fe(e,t,i,r,o){e|=0,i|=0,r|=0,o|=0;var a=0,s=0,u=0,c=0;n[(t|=0)+53>>0]=1;do{if((0|l[t+4>>2])==(0|r)){if(n[t+52>>0]=1,u=t+54|0,c=t+48|0,s=t+24|0,e=t+36|0,!(a=0|l[(r=t+16|0)>>2])){if(l[r>>2]=i,l[s>>2]=o,l[e>>2]=1,!(1==(0|l[c>>2])&1==(0|o)))break;n[u>>0]=1;break}if((0|a)!=(0|i)){l[e>>2]=1+(0|l[e>>2]),n[u>>0]=1;break}2==(0|(e=0|l[s>>2]))&&(l[s>>2]=o,e=o),1==(0|l[c>>2])&1==(0|e)&&(n[u>>0]=1)}}while(0)}function pe(e,t){e|=0;var i,r,o,a=0,s=0,u=0,h=0;o=y,y=y+16|0,r=255&(t|=0),n[(i=o)>>0]=r,(u=0|l[(s=e+16|0)>>2])?h=4:0|we(e)?a=-1:(u=0|l[s>>2],h=4);do{if(4==(0|h)){if((s=0|l[(h=e+20|0)>>2])>>>0<u>>>0&&(0|(a=255&t))!=(0|n[e+75>>0])){l[h>>2]=s+1,n[s>>0]=r;break}a=1==(0|at[7&l[e+36>>2]](e,i,1))?0|c[i>>0]:-1}}while(0);return y=o,0|a}function _e(e,t,i,r,n){e|=0,t|=0,i|=0,r|=0,n|=0;do{if(e){if(!t){if(G(e),!i){t=0;break}l[i>>2]=0,t=0;break}r?e=0==(0|(t=0|ve(e,t)))?e:t:t=0,i&&(n=0|Oe(e),l[i>>2]=n)}else t=0|k(t),i&&(e=t?0|Oe(t):0,l[i>>2]=e)}while(0);return 0|t}function me(e,t){e=+e,t|=0;var i,r,n=0;switch(m[v>>3]=e,2047&(r=0|Le(0|(n=0|l[v>>2]),0|(i=0|l[v+4>>2]),52))){case 0:0!=e?(e=+me(0x10000000000000000*e,t),n=(0|l[t>>2])-64|0):n=0,l[t>>2]=n;break;case 2047:break;default:l[t>>2]=(2047&r)-1022,l[v>>2]=n,l[v+4>>2]=-2146435073&i|1071644672,e=+m[v>>3]}return+e}function $e(e,t){e|=0,t|=0;var i=0,r=0;for(r=0;;){if((0|c[2140+r>>0])==(0|e)){e=2;break}if(87==(0|(i=r+1|0))){i=2228,r=87,e=5;break}r=i}if(2==(0|e)&&(r?(i=2228,e=5):i=2228),5==(0|e))for(;;){do{e=i,i=i+1|0}while(0!=(0|n[e>>0]));if(!(r=r+-1|0))break;e=5}return 0|function(e,t){return 0|function(e,t){return e|=0,t=(t|=0)?0|function(e,t,i){t|=0,i|=0;var r,o=0,a=0,s=0,u=0,c=0,h=0,d=0,f=0,p=0;r=1794895138+(0|l[(e|=0)>>2])|0,s=0|We(0|l[e+8>>2],r),o=0|We(0|l[e+12>>2],r),a=0|We(0|l[e+16>>2],r);e:do{if(s>>>0<t>>>2>>>0&&(p=t-(s<<2)|0,o>>>0<p>>>0&a>>>0<p>>>0)&&0==(3&(a|o)|0)){for(p=o>>>2,f=a>>>2,d=0;;){if(o=0|We(0|l[e+((a=(u=(h=d+(c=s>>>1)|0)<<1)+p|0)<<2)>>2],r),!((a=0|We(0|l[e+(a+1<<2)>>2],r))>>>0<t>>>0&o>>>0<(t-a|0)>>>0)){o=0;break e}if(0|n[e+(a+o)>>0]){o=0;break e}if(!(o=0|Ce(i,e+a|0)))break;if(o=(0|o)<0,1==(0|s)){o=0;break e}d=o?d:h,s=o?c:s-c|0}a=0|We(0|l[e+((o=u+f|0)<<2)>>2],r),o=(o=0|We(0|l[e+(o+1<<2)>>2],r))>>>0<t>>>0&a>>>0<(t-o|0)>>>0&&0==(0|n[e+(o+a)>>0])?e+o|0:0}else o=0}while(0);return 0|o}(0|l[t>>2],0|l[t+4>>2],e):0,0|(0|t?t:e)}(e|=0,t|=0)}(i,0|l[t+20>>2])}function ge(e,t,i){i|=0;var r=0;if((t|=0)>>>0>0|0==(0|t)&(e|=0)>>>0>4294967295){for(;r=0|Me(0|e,0|t,10,0),n[(i=i+-1|0)>>0]=255&r|48,r=e,e=0|Ye(0|e,0|t,10,0),t>>>0>9|9==(0|t)&r>>>0>4294967295;)t=b;t=e}else t=e;if(t)for(;n[(i=i+-1|0)>>0]=48|(t>>>0)%10,!(t>>>0<10);)t=(t>>>0)/10|0;return 0|i}function ve(e,t){t|=0;var i=0,r=0;return(e|=0)?t>>>0>4294967231?(t=0|tt(),l[t>>2]=12,0|(t=0)):(i=0|function(e,t){t|=0;var i,r=0,n=0,o=0,a=0,s=0,u=0,c=0,h=0,d=0;if(i=(e|=0)+(r=-8&(h=0|l[(d=e+4|0)>>2]))|0,!(3&h))return t>>>0<256?0|(e=0):(r>>>0>=(t+4|0)>>>0&&(r-t|0)>>>0<=l[1264]<<1>>>0||(e=0),0|e);if(r>>>0>=t>>>0)return(r=r-t|0)>>>0<=15||(c=e+t|0,l[d>>2]=1&h|t|2,l[c+4>>2]=3|r,l[(d=c+r+4|0)>>2]=1|l[d>>2],W(c,r)),0|e;if((0|i)==(0|l[1150]))return r=(c=(0|l[1147])+r|0)-t|0,n=e+t|0,c>>>0<=t>>>0?0|(e=0):(l[d>>2]=1&h|t|2,l[n+4>>2]=1|r,l[1150]=n,l[1147]=r,0|e);if((0|i)==(0|l[1149]))return(o=(0|l[1146])+r|0)>>>0<t>>>0?0|(e=0):(n=1&h,(r=o-t|0)>>>0>15?(c=(h=e+t|0)+r|0,l[d>>2]=n|t|2,l[h+4>>2]=1|r,l[c>>2]=r,l[(n=c+4|0)>>2]=-2&l[n>>2],n=h):(l[d>>2]=n|o|2,l[(n=e+o+4|0)>>2]=1|l[n>>2],n=0,r=0),l[1146]=r,l[1149]=n,0|e);if(2&(n=0|l[i+4>>2])|0||(u=(-8&n)+r|0)>>>0<t>>>0)return 0;c=u-t|0,o=n>>>3;do{if(n>>>0<256){if(n=0|l[i+8>>2],(0|(r=0|l[i+12>>2]))==(0|n)){l[1144]=l[1144]&~(1<<o);break}l[n+12>>2]=r,l[r+8>>2]=n;break}s=0|l[i+24>>2],r=0|l[i+12>>2];do{if((0|r)==(0|i)){if(r=0|l[(n=4+(o=i+16|0)|0)>>2])a=n;else{if(!(r=0|l[o>>2])){o=0;break}a=o}for(;;)if(0|(n=0|l[(o=r+20|0)>>2]))r=n,a=o;else{if(!(o=0|l[(n=r+16|0)>>2]))break;r=o,a=n}l[a>>2]=0,o=r}else o=0|l[i+8>>2],l[o+12>>2]=r,l[r+8>>2]=o,o=r}while(0);if(0|s){if(r=0|l[i+28>>2],(0|i)==(0|l[(n=4880+(r<<2)|0)>>2])){if(l[n>>2]=o,!o){l[1145]=l[1145]&~(1<<r);break}}else if(l[s+16+(((0|l[s+16>>2])!=(0|i)&1)<<2)>>2]=o,!o)break;l[o+24>>2]=s,0|(n=0|l[(r=i+16|0)>>2])&&(l[o+16>>2]=n,l[n+24>>2]=o),0|(r=0|l[r+4>>2])&&(l[o+20>>2]=r,l[r+24>>2]=o)}}while(0);return r=1&h,c>>>0<16?(l[d>>2]=u|r|2,l[(d=e+u+4|0)>>2]=1|l[d>>2],0|e):(h=e+t|0,l[d>>2]=r|t|2,l[h+4>>2]=3|c,l[(d=h+c+4|0)>>2]=1|l[d>>2],W(h,c),0|e)}(e+-8|0,t>>>0<11?16:t+11&-8),0|i?0|(t=i+8|0):(i=0|k(t))?(J(0|i,0|e,0|((r=(-8&(r=0|l[e+-4>>2]))-(0==(3&r|0)?8:4)|0)>>>0<t>>>0?r:t)),G(e),0|(t=i)):0|(t=0)):0|(t=0|k(t))}function ye(e,t,i,r){e|=0,i|=0,r|=0;var o,a,s;o=0|l[(e=(t|=0)+16|0)>>2],a=t+36|0,s=t+24|0;do{if(o){if((0|o)!=(0|i)){l[a>>2]=1+(0|l[a>>2]),l[s>>2]=2,n[t+54>>0]=1;break}2==(0|l[s>>2])&&(l[s>>2]=r)}else l[e>>2]=i,l[s>>2]=r,l[a>>2]=1}while(0)}function xe(e){e|=0;var t,i=0,r=0;t=0|l[119],l[t+76>>2];do{if((0|Ve(e,t))<0)e=1;else{if(10!=(0|n[t+75>>0])&&(r=0|l[(i=t+20|0)>>2])>>>0<(0|l[t+16>>2])>>>0){l[i>>2]=r+1,n[r>>0]=10,e=0;break}e=(0|pe(t,10))<0}}while(0);return e<<31>>31|0}function be(e,t,i,r,n){e|=0,t|=0;var o,a;if(a=y,y=y+256|0,o=a,(0|(i|=0))>(0|(r|=0))&0==(73728&(n|=0)|0)){if(de(0|o,0|t,0|((n=i-r|0)>>>0<256?n:256)),n>>>0>255){t=i-r|0;do{Ue(e,o,256),n=n+-256|0}while(n>>>0>255);n=255&t}Ue(e,o,n)}y=a}function we(e){var t=0,i=0;return i=0|n[(t=(e|=0)+74|0)>>0],n[t>>0]=i+255|i,8&(t=0|l[e>>2])?(l[e>>2]=32|t,e=-1):(l[e+8>>2]=0,l[e+4>>2]=0,i=0|l[e+44>>2],l[e+28>>2]=i,l[e+20>>2]=i,l[e+16>>2]=i+(0|l[e+48>>2]),e=0),0|e}function Ce(e,t){t|=0;var i=0,r=0;if(i=0|n[(e|=0)>>0],r=0|n[t>>0],i<<24>>24==0||i<<24>>24!=r<<24>>24)e=r;else{do{t=t+1|0,i=0|n[(e=e+1|0)>>0],r=0|n[t>>0]}while(i<<24>>24!=0&&i<<24>>24==r<<24>>24);e=r}return(255&i)-(255&e)|0}function Te(e){var t,i;return(0|(i=(e|=0)+15&-16|0))>0&(0|(e=(t=0|l[g>>2])+i|0))<(0|t)|(0|e)<0?(A(),D(12),-1):(l[g>>2]=e,(0|e)>(0|E())&&0==(0|S())?(l[g>>2]=t,D(12),-1):0|t)}function Se(e){var t=0,i=0,r=0;if(i=0|l[(e|=0)>>2],(r=(0|n[i>>0])-48|0)>>>0<10){t=0;do{t=r+(10*t|0)|0,i=i+1|0,l[e>>2]=i,r=(0|n[i>>0])-48|0}while(r>>>0<10)}else t=0;return 0|t}function Ee(e,t,i,r){if(i|=0,r|=0,!(0==(0|(e|=0))&0==(0|(t|=0))))do{n[(i=i+-1|0)>>0]=0|c[2122+(15&e)>>0]|r,e=0|Le(0|e,0|t,4),t=b}while(!(0==(0|e)&0==(0|t)));return 0|i}function Ae(e){var t=0;return(0|(t=0|n[x+(255&(e|=0))>>0]))<8?0|t:(0|(t=0|n[x+(e>>8&255)>>0]))<8?t+8|0:(0|(t=0|n[x+(e>>16&255)>>0]))<8?t+16|0:24+(0|n[x+(e>>>24)>>0])|0}function Pe(e,t,i,r){i|=0,r|=0;var n=0;(0|l[(t|=0)+4>>2])==(0|i)&&1!=(0|l[(n=t+28|0)>>2])&&(l[n>>2]=r)}function Ie(e,t,i){if(i|=0,!(0==(0|(e|=0))&0==(0|(t|=0))))do{n[(i=i+-1|0)>>0]=7&e|48,e=0|Le(0|e,0|t,3),t=b}while(!(0==(0|e)&0==(0|t)));return 0|i}function Me(e,t,i,r){var n,o;return o=y,y=y+16|0,Y(e|=0,t|=0,i|=0,r|=0,n=0|o),y=o,b=0|l[n+4>>2],0|l[n>>2]}function Oe(e){var t=0;return(e|=0)?0|(1==(0|(e=3&(t=0|l[e+-4>>2])))?0:(-8&t)-(0==(0|e)?8:4)|0):0}function De(e,t,i){e|=0,t|=0,i|=0;var r,o;return r=y,y=y+16|0,l[(o=r)>>2]=i,i=0|function(e,t,i){return 0|function(e,t,i,r){e|=0,t|=0,i|=0,r|=0;var o,a,s=0,u=0,c=0,h=0,d=0;a=y,y=y+128|0,s=a+124|0,c=604,o=(u=d=a)+124|0;do{l[u>>2]=l[c>>2],u=u+4|0,c=c+4|0}while((0|u)<(0|o));return(t+-1|0)>>>0>2147483646?t?(t=0|tt(),l[t>>2]=75,t=-1):(e=s,t=1,h=4):h=4,4==(0|h)&&(h=t>>>0>(h=-2-e|0)>>>0?h:t,l[d+48>>2]=h,l[(s=d+20|0)>>2]=e,l[d+44>>2]=e,t=e+h|0,l[(e=d+16|0)>>2]=t,l[d+28>>2]=t,t=0|te(d,i,r),h&&(d=0|l[s>>2],n[d+(((0|d)==(0|l[e>>2]))<<31>>31)>>0]=0)),y=a,0|t}(e|=0,2147483647,t|=0,i|=0)}(e,t,o),y=r,0|i}function Re(e,t,i){return e|=0,t|=0,(0|(i|=0))<32?(b=t<<i|(e&(1<<i)-1<<32-i)>>>32-i,e<<i):(b=e<<i-32,0)}function Le(e,t,i){return e|=0,t|=0,(0|(i|=0))<32?(b=t>>>i,e>>>i|(t&(1<<i)-1)<<32-i):(b=0,t>>>i-32|0)}function Be(e,t){e|=0,t|=0;var i;i=y,y=y+16|0,l[i>>2]=t,te(t=0|l[26],e,i),function(e,t){var i,r=0,o=0,a=0,s=0;i=255&(e|=0),r=255&e,l[76+(t|=0)>>2],s=3;do{if(3==(0|s)){if((0|r)!=(0|n[t+75>>0])&&(a=0|l[(o=t+20|0)>>2])>>>0<(0|l[t+16>>2])>>>0){l[o>>2]=a+1,n[a>>0]=i;break}r=0|pe(t,e)}}while(0)}(10,t),R()}function Ne(e,t,i,r){return b=r=(t|=0)-(r|=0)-((i|=0)>>>0>(e|=0)>>>0|0)>>>0,0|e-i>>>0}function Fe(e){e=+e;var t;return m[v>>3]=e,t=0|l[v>>2],b=0|l[v+4>>2],0|t}function ze(e,t,i,r){return b=(t|=0)+(r|=0)+((i=(e|=0)+(i|=0)>>>0)>>>0<e>>>0|0)>>>0,0|i}function ke(e){var t=0;return(e|=0)>>>0>4294963200&&(t=0|tt(),l[t>>2]=0-e,e=-1),0|e}function Ve(e,t){t|=0;var i;return i=0|function(e){var t,i=0,r=0;t=e|=0;e:do{if(3&t)for(i=t;;){if(!(0|n[e>>0])){e=i;break e}if(!(3&(i=e=e+1|0))){r=4;break}}else r=4}while(0);if(4==(0|r)){for(;!((-2139062144&(i=0|l[e>>2])^-2139062144)&i+-16843009);)e=e+4|0;if((255&i)<<24>>24)do{e=e+1|0}while(0!=(0|n[e>>0]))}return e-t|0}(e|=0),((0|function(e,t,i,r){var n;return e|=0,r|=0,n=0|w(i|=0,t|=0),i=0==(0|t)?0:i,(0|(e=(l[r+76>>2],0|ue(e,n,r))))!=(0|n)&&(i=(e>>>0)/(t>>>0)|0),0|i}(e,1,i,t))!=(0|i))<<31>>31|0}function Ue(e,t,i){t|=0,i|=0,32&l[(e|=0)>>2]||ue(t,i,e)}function Xe(e){e|=0;var t;return t=188+(0|it())|0,0|$e(e,0|l[t>>2])}function He(e,t){return t|=0,e=(e|=0)?0|function(e,t,i){e|=0,t|=0,i|=0;do{if(e){if(t>>>0<128){n[e>>0]=t,e=1;break}if(i=188+(0|it())|0,!(0|l[l[i>>2]>>2])){if(57216==(-128&t|0)){n[e>>0]=t,e=1;break}e=0|tt(),l[e>>2]=84,e=-1;break}if(t>>>0<2048){n[e>>0]=t>>>6|192,n[e+1>>0]=63&t|128,e=2;break}if(t>>>0<55296|57344==(-8192&t|0)){n[e>>0]=t>>>12|224,n[e+1>>0]=t>>>6&63|128,n[e+2>>0]=63&t|128,e=3;break}if((t+-65536|0)>>>0<1048576){n[e>>0]=t>>>18|240,n[e+1>>0]=t>>>12&63|128,n[e+2>>0]=t>>>6&63|128,n[e+3>>0]=63&t|128,e=4;break}e=0|tt(),l[e>>2]=84,e=-1;break}e=1}while(0);return 0|e}(e,t,0):0,0|e}function Ge(e,t,i){return(0|(e|=0))==(0|(t|=0))|0}function We(e,t){t|=0;var i;return i=0|qe(0|(e|=0)),0|(0==(0|t)?e:i)}function Ye(e,t,i,r){return 0|Y(e|=0,t|=0,i|=0,r|=0,0)}function qe(e){return(255&(e|=0))<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function je(e,t,i,r,n,o){T(6)}function Ze(e,t,i,r,n){T(1)}function Ke(e){(function(e){G(e|=0)})(e|=0)}function Qe(e,t,i,r){T(7)}function Je(e,t,i){return T(0),0}function et(e,t){return+ +me(e=+e,t|=0)}function tt(){return 64+(0|it())|0}function it(){return 232}function rt(e){}function nt(e){T(2)}function ot(){T(5)}t.__ZSt18uncaught_exceptionv;var at=[Je,ee,function(e,t,i){var r,n,o;return e|=0,t|=0,i|=0,n=y,y=y+32|0,r=n+20|0,l[(o=n)>>2]=l[e+60>>2],l[o+4>>2]=0,l[o+8>>2]=t,l[o+12>>2]=r,l[o+16>>2]=i,(0|ke(0|F(140,0|o)))<0?(l[r>>2]=-1,e=-1):e=0|l[r>>2],y=n,0|e},function(e,t,i){t|=0,i|=0;var r,o=0;return r=y,y=y+32|0,o=r,l[(e|=0)+36>>2]=1,0==(64&l[e>>2]|0)&&(l[o>>2]=l[e+60>>2],l[o+4>>2]=21523,l[o+8>>2]=r+16,0|I(54,0|o))&&(n[e+75>>0]=-1),o=0|ee(e,t,i),y=r,0|o},function(e,t,i){var r,n;return t|=0,i|=0,J(0|(n=0|l[(r=(e|=0)+20|0)>>2]),0|t,0|(e=(e=(0|l[e+16>>2])-n|0)>>>0>i>>>0?i:e)),l[r>>2]=(0|l[r>>2])+e,0|i},function(e,t,i){i|=0;var r,n,o=0,a=0;if(n=y,y=y+64|0,r=n,0|Ge(e|=0,t|=0))t=1;else if(0!=(0|t)&&0!=(0|(a=0|ie(t,32,16,0)))){o=(t=r+4|0)+52|0;do{l[t>>2]=0,t=t+4|0}while((0|t)<(0|o));l[r>>2]=a,l[r+8>>2]=e,l[r+12>>2]=-1,l[r+48>>2]=1,ft[3&l[28+(0|l[a>>2])>>2]](a,r,0|l[i>>2],1),1==(0|l[r+24>>2])?(l[i>>2]=l[r+16>>2],t=1):t=0}else t=0;return y=n,0|t},Je,Je],st=[Ze,function(e,t,i,r,o){e|=0,t|=0,i|=0,r|=0;var a=0;do{if(0|Ge(e,0|l[t+8>>2]))Pe(0,t,i,r);else if(0|Ge(e,0|l[t>>2])){if(e=t+32|0,(0|l[t+16>>2])!=(0|i)&&(0|l[(a=t+20|0)>>2])!=(0|i)){l[e>>2]=r,l[a>>2]=i,l[(r=t+40|0)>>2]=1+(0|l[r>>2]),1==(0|l[t+36>>2])&&2==(0|l[t+24>>2])&&(n[t+54>>0]=1),l[t+44>>2]=4;break}1==(0|r)&&(l[e>>2]=1)}}while(0)},function(e,t,i,r,o){e|=0,t|=0,i|=0,r|=0,o|=0;var a=0,s=0,u=0,c=0;do{if(0|Ge(e,0|l[t+8>>2]))Pe(0,t,i,r);else{if(a=e+8|0,!(0|Ge(e,0|l[t>>2]))){u=0|l[a>>2],st[3&l[24+(0|l[u>>2])>>2]](u,t,i,r,o);break}if(e=t+32|0,(0|l[t+16>>2])!=(0|i)&&(0|l[(s=t+20|0)>>2])!=(0|i)){if(l[e>>2]=r,4==(0|l[(r=t+44|0)>>2]))break;n[(e=t+52|0)>>0]=0,n[(c=t+53|0)>>0]=0,a=0|l[a>>2],dt[3&l[20+(0|l[a>>2])>>2]](a,t,i,i,1,o),0|n[c>>0]?0|n[e>>0]?e=3:(e=3,u=11):(e=4,u=11),11==(0|u)&&(l[s>>2]=i,l[(c=t+40|0)>>2]=1+(0|l[c>>2]),1==(0|l[t+36>>2])&&2==(0|l[t+24>>2])&&(n[t+54>>0]=1)),l[r>>2]=e;break}1==(0|r)&&(l[e>>2]=1)}}while(0)},Ze],lt=[nt,rt,Ke,rt,rt,Ke,function(e){var t;t=y,y=y+16|0,G(e|=0),0|M(0|l[1285],0)?Be(4406,t):y=t},nt],ut=[function(e){return T(3),0},function(e){var t,i;return t=y,y=y+16|0,i=t,e=0|function(e){return 0|(e|=0)}(0|l[(e|=0)+60>>2]),l[i>>2]=e,e=0|ke(0|O(6,0|i)),y=t,0|e}],ct=[function(e,t,i){T(4)}],ht=[ot,function(){var e,t,i,r=0,n=0,o=0,a=0,s=0;a=y,y=y+48|0,i=a+32|0,e=a+24|0,s=a+16|0,t=a,a=a+36|0,r=0|function(){var e=0,t=0;if(e=y,y=y+16|0,!(0|L(5136,2)))return t=0|P(0|l[1285]),y=e,0|t;Be(4307,e);return 0}(),0|r&&0|(o=0|l[r>>2])&&(1126902528==(-256&(n=0|l[(r=o+48|0)>>2])|0)&1129074247==(0|(r=0|l[r+4>>2]))||(l[e>>2]=4168,Be(4118,e)),r=1126902529==(0|n)&1129074247==(0|r)?0|l[o+44>>2]:o+80|0,l[a>>2]=r,o=0|l[o>>2],r=0|l[o+4>>2],0|at[7&l[16+(0|l[2])>>2]](8,o,a)?(s=0|l[a>>2],s=0|ut[1&l[8+(0|l[s>>2])>>2]](s),l[t>>2]=4168,l[t+4>>2]=r,l[t+8>>2]=s,Be(4032,t)):(l[s>>2]=4168,l[s+4>>2]=r,Be(4077,s))),Be(4156,i)},function(){var e;e=y,y=y+16|0,0|N(5140,6)?Be(4356,e):y=e},ot],dt=[je,function(e,t,i,r,n,o){i|=0,r|=0,n|=0,0|Ge(e|=0,0|l[(t|=0)+8>>2])&&fe(0,t,i,r,n)},function(e,t,i,r,n,o){i|=0,r|=0,n|=0,o|=0,0|Ge(e|=0,0|l[(t|=0)+8>>2])?fe(0,t,i,r,n):(e=0|l[e+8>>2],dt[3&l[20+(0|l[e>>2])>>2]](e,t,i,r,n,o))},je],ft=[Qe,function(e,t,i,r){i|=0,r|=0,0|Ge(e|=0,0|l[(t|=0)+8>>2])&&ye(0,t,i,r)},function(e,t,i,r){i|=0,r|=0,0|Ge(e|=0,0|l[(t|=0)+8>>2])?ye(0,t,i,r):(e=0|l[e+8>>2],ft[3&l[28+(0|l[e>>2])>>2]](e,t,i,r))},Qe];return{stackSave:function(){return 0|y},_i64Subtract:Ne,_crn_get_bytes_per_block:function(e,t){e|=0,t|=0;var i,r,n,o=0;switch(n=y,y=y+576|0,r=n+40|0,i=n+56|0,l[(o=n)>>2]=40,oe(e,t,o),e=0|l[(t=o+32|0)+4>>2],0|l[t>>2]){case 0:case 9:case 10:if(!e)return y=n,0|(o=8);e=14;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:e=e?14:13;break;default:e=14}return 13==(0|e)?(y=n,0|(o=16)):14==(0|e)?(l[r>>2]=866,l[r+4>>2]=2672,l[r+8>>2]=1251,De(i,812,r),xe(i),y=n,0|(o=0)):0},setThrew:function(e,t){},dynCall_viii:function(e,t,i,r){t|=0,i|=0,r|=0,ct[0&(e|=0)](0|t,0|i,0|r)},_bitshift64Lshr:Le,_bitshift64Shl:Re,dynCall_viiii:function(e,t,i,r,n){t|=0,i|=0,r|=0,n|=0,ft[3&(e|=0)](0|t,0|i,0|r,0|n)},setTempRet0:function(e){b=e|=0},_crn_decompress:function(e,t,i,r,o,s){e|=0,t|=0,i|=0,r|=0,o|=0,s|=0;var u,h,d,f,p=0,_=0,m=0,$=0,g=0;switch(f=y,y=y+592|0,d=f+56|0,m=f+40|0,u=f+72|0,h=f+68|0,l[(g=f)>>2]=40,oe(e,t,g),p=(0|l[g+4>>2])>>>o,_=(0|l[g+8>>2])>>>o,r=0|l[(g=g+32|0)+4>>2],0|l[g>>2]){case 0:case 9:case 10:r?$=14:g=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:$=r?14:13;break;default:$=14}13==(0|$)?g=16:14==(0|$)&&(l[m>>2]=866,l[m+4>>2]=2672,l[m+8>>2]=1251,De(u,812,m),xe(u),g=0),l[h>>2]=i,$=0|function(e,t){var i=0,r=0,o=0,s=0,u=0,h=0,d=0,f=0,p=0,_=0,m=0,$=0;if(m=y,y=y+528|0,p=m,h=m+16|0,0==(0|(e|=0))|(t|=0)>>>0<62||!(d=0|he(300,0)))return y=m,0|($=0);l[d>>2]=519686845,l[d+4>>2]=0,l[d+8>>2]=0,f=d+88|0,i=d+136|0,r=d+160|0,o=d+184|0,s=d+208|0,u=d+232|0,l[(_=d+252|0)>>2]=0,l[_+4>>2]=0,l[_+8>>2]=0,n[_+12>>0]=0,l[(_=d+268|0)>>2]=0,l[_+4>>2]=0,l[_+8>>2]=0,n[_+12>>0]=0,l[(_=d+284|0)>>2]=0,l[_+4>>2]=0,l[_+8>>2]=0,n[_+12>>0]=0,$=(_=f)+44|0;do{l[_>>2]=0,_=_+4|0}while((0|_)<(0|$));return n[f+44>>0]=0,l[i>>2]=0,l[i+4>>2]=0,l[i+8>>2]=0,l[i+12>>2]=0,l[i+16>>2]=0,n[i+20>>0]=0,l[r>>2]=0,l[r+4>>2]=0,l[r+8>>2]=0,l[r+12>>2]=0,l[r+16>>2]=0,n[r+20>>0]=0,l[o>>2]=0,l[o+4>>2]=0,l[o+8>>2]=0,l[o+12>>2]=0,l[o+16>>2]=0,n[o+20>>0]=0,l[s>>2]=0,l[s+4>>2]=0,l[s+8>>2]=0,l[s+12>>2]=0,l[s+16>>2]=0,n[s+20>>0]=0,l[u>>2]=0,l[u+4>>2]=0,l[u+8>>2]=0,l[u+12>>2]=0,n[u+16>>0]=0,0|function(e,t,i){e|=0;var r=0,o=0;return!(0==(0|(t|=0))|(i|=0)>>>0<74)&&18552==((0|c[t>>0])<<8|0|c[t+1>>0]|0)&&((0|c[t+2>>0])<<8|0|c[t+3>>0])>>>0>=74&&((0|c[t+7>>0])<<16|(0|c[t+6>>0])<<24|(0|c[t+8>>0])<<8|0|c[t+9>>0])>>>0<=i>>>0?(l[(r=e+88|0)>>2]=t,l[e+4>>2]=t,l[e+8>>2]=i,0|function(e){var t=0,i=0,r=0,n=0;if(n=92+(e|=0)|0,i=0|l[(r=e+88|0)>>2],t=(0|l[e+4>>2])+((0|c[i+68>>0])<<8|(0|c[i+67>>0])<<16|0|c[i+69>>0])|0,!((i=(0|c[i+65>>0])<<8|0|c[i+66>>0])&&(l[n>>2]=t,l[e+96>>2]=t,l[e+104>>2]=i,l[e+100>>2]=t+i,l[e+108>>2]=0,l[e+112>>2]=0,0|X(n,e+116|0))))return 0|(n=0);t=0|l[r>>2];do{if((0|c[t+39>>0])<<8|0|c[t+40>>0]){if(!(0|X(n,e+140|0)))return 0|(n=0);if(0|X(n,e+188|0)){t=0|l[r>>2];break}return 0|(n=0)}if(!((0|c[t+55>>0])<<8|0|c[t+56>>0]))return 0|(n=0)}while(0);return!((0|c[t+55>>0])<<8|0|c[t+56>>0]|0)||0|X(n,e+164|0)&&0|X(n,e+212|0)?0|(n=1):0|(n=0)}(e)?(t=0|l[r>>2],(0|c[t+39>>0])<<8|0|c[t+40>>0]?0|function(e){var t=0,i=0,r=0,o=0,a=0,s=0,u=0,h=0,d=0,f=0,p=0,_=0,m=0;if(m=y,y=y+576|0,s=m,o=m+64|0,_=m+16|0,t=0|l[(r=88+(e|=0)|0)>>2],p=(0|c[t+39>>0])<<8|0|c[t+40>>0],d=e+236|0,(0|(i=0|l[(a=e+240|0)>>2]))!=(0|p)){if(i>>>0<=p>>>0){do{if((0|l[e+244>>2])>>>0<p>>>0){if(0|K(d,p,(i+1|0)==(0|p),4,0)){t=0|l[a>>2];break}return n[e+248>>0]=1,y=m,0|(_=0)}t=i}while(0);de((0|l[d>>2])+(t<<2)|0,0,p-t<<2|0),t=0|l[r>>2]}l[a>>2]=p}if(f=e+92|0,i=(0|l[e+4>>2])+((0|c[t+34>>0])<<8|(0|c[t+33>>0])<<16|0|c[t+35>>0])|0,!(t=(0|c[t+37>>0])<<8|(0|c[t+36>>0])<<16|0|c[t+38>>0]))return y=m,0|(_=0);if(l[f>>2]=i,l[e+96>>2]=i,l[e+104>>2]=t,l[e+100>>2]=i+t,l[e+108>>2]=0,l[e+112>>2]=0,u=_+20|0,l[_>>2]=0,l[_+4>>2]=0,l[_+8>>2]=0,l[_+12>>2]=0,n[_+16>>0]=0,h=_+24|0,l[_+44>>2]=0,l[u>>2]=0,l[u+4>>2]=0,l[u+8>>2]=0,l[u+12>>2]=0,l[u+16>>2]=0,n[u+20>>0]=0,0|X(f,_)&&0|X(f,h))if(0|l[a>>2]||(l[s>>2]=866,l[s+4>>2]=910,l[s+8>>2]=1497,De(o,812,s),xe(o)),p)for(s=0,u=0,i=0|l[d>>2],r=0,e=0,t=0,o=0,a=0;;){if(s=(0|q(f,_))+s&31,a=(0|q(f,h))+a&63,o=(0|q(f,_))+o&31,t=(0|q(f,_))+t|0,e=(0|q(f,h))+e&63,r=(0|q(f,_))+r&31,l[i>>2]=a<<5|s<<11|o|t<<27|e<<21|r<<16,(u=u+1|0)>>>0>=p>>>0){t=1;break}i=i+4|0,t&=31}else t=1;else t=0;return ce(_+24|0),ce(_),y=m,0|(_=t)}(e)&&0|function(e){var t,i,r,o,a,s,u=0,h=0,d=0,f=0,p=0,_=0,m=0,$=0,g=0,v=0,x=0,b=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0,R=0,L=0,B=0,N=0,F=0,z=0,k=0,V=0,U=0,H=0;if(s=y,y=y+1008|0,_=s,p=s+496|0,P=s+472|0,r=s+276|0,o=s+80|0,a=s+16|0,h=0|l[88+(e|=0)>>2],t=(0|c[h+47>>0])<<8|0|c[h+48>>0],i=e+92|0,u=(0|l[e+4>>2])+((0|c[h+42>>0])<<8|(0|c[h+41>>0])<<16|0|c[h+43>>0])|0,!(h=(0|c[h+45>>0])<<8|(0|c[h+44>>0])<<16|0|c[h+46>>0]))return y=s,0;if(l[i>>2]=u,l[e+96>>2]=u,l[e+104>>2]=h,l[e+100>>2]=u+h,l[e+108>>2]=0,l[e+112>>2]=0,l[P+20>>2]=0,l[P>>2]=0,l[P+4>>2]=0,l[P+8>>2]=0,l[P+12>>2]=0,n[P+16>>0]=0,0|X(i,P)){for(u=0,h=-3,d=-3;l[r+(u<<2)>>2]=d,l[o+(u<<2)>>2]=h,f=(0|d)>2,49!=(0|(u=u+1|0));)h=(1&f)+h|0,d=f?-3:d+1|0;h=(u=a)+64|0;do{l[u>>2]=0,u=u+4|0}while((0|u)<(0|h));d=e+252|0,u=0|l[(h=e+256|0)>>2];e:do{if((0|u)==(0|t))m=13;else{if(u>>>0<=t>>>0){do{if((0|l[e+260>>2])>>>0<t>>>0){if(0|K(d,t,(u+1|0)==(0|t),4,0)){u=0|l[h>>2];break}n[e+264>>0]=1,u=0;break e}}while(0);de((0|l[d>>2])+(u<<2)|0,0,t-u<<2|0)}l[h>>2]=t,m=13}}while(0);do{if(13==(0|m)){if(!t){l[_>>2]=866,l[_+4>>2]=910,l[_+8>>2]=1497,De(p,812,_),xe(p),u=1;break}for(e=a+4|0,p=a+8|0,_=a+12|0,m=a+16|0,$=a+20|0,g=a+24|0,v=a+28|0,x=a+32|0,b=a+36|0,w=a+40|0,C=a+44|0,T=a+48|0,S=a+52|0,E=a+56|0,A=a+60|0,f=0,u=0|l[d>>2],h=0|l[e>>2],d=0|l[a>>2];U=0|q(i,P),d=d+(0|l[r+(U<<2)>>2])&3,h=h+(0|l[o+(U<<2)>>2])&3,U=0|q(i,P),H=(0|l[p>>2])+(0|l[r+(U<<2)>>2])&3,l[p>>2]=H,U=(0|l[_>>2])+(0|l[o+(U<<2)>>2])&3,l[_>>2]=U,k=0|q(i,P),V=(0|l[m>>2])+(0|l[r+(k<<2)>>2])&3,l[m>>2]=V,k=(0|l[$>>2])+(0|l[o+(k<<2)>>2])&3,l[$>>2]=k,F=0|q(i,P),z=(0|l[g>>2])+(0|l[r+(F<<2)>>2])&3,l[g>>2]=z,F=(0|l[v>>2])+(0|l[o+(F<<2)>>2])&3,l[v>>2]=F,B=0|q(i,P),N=(0|l[x>>2])+(0|l[r+(B<<2)>>2])&3,l[x>>2]=N,B=(0|l[b>>2])+(0|l[o+(B<<2)>>2])&3,l[b>>2]=B,R=0|q(i,P),L=(0|l[w>>2])+(0|l[r+(R<<2)>>2])&3,l[w>>2]=L,R=(0|l[C>>2])+(0|l[o+(R<<2)>>2])&3,l[C>>2]=R,O=0|q(i,P),D=(0|l[T>>2])+(0|l[r+(O<<2)>>2])&3,l[T>>2]=D,O=(0|l[S>>2])+(0|l[o+(O<<2)>>2])&3,l[S>>2]=O,I=0|q(i,P),M=(0|l[E>>2])+(0|l[r+(I<<2)>>2])&3,l[E>>2]=M,I=(0|l[A>>2])+(0|l[o+(I<<2)>>2])&3,l[A>>2]=I,l[u>>2]=(0|c[1441+h>>0])<<2|0|c[1441+d>>0]|(0|c[1441+H>>0])<<4|(0|c[1441+U>>0])<<6|(0|c[1441+V>>0])<<8|(0|c[1441+k>>0])<<10|(0|c[1441+z>>0])<<12|(0|c[1441+F>>0])<<14|(0|c[1441+N>>0])<<16|(0|c[1441+B>>0])<<18|(0|c[1441+L>>0])<<20|(0|c[1441+R>>0])<<22|(0|c[1441+D>>0])<<24|(0|c[1441+O>>0])<<26|(0|c[1441+M>>0])<<28|(0|c[1441+I>>0])<<30,!((f=f+1|0)>>>0>=t>>>0);)u=u+4|0;l[a>>2]=d,l[e>>2]=h,u=1}}while(0)}else u=0;return ce(P),y=s,0|u}(e)&&(t=0|l[r>>2],o=11):o=11,11!=(0|o)||(0|c[t+55>>0])<<8|0|c[t+56>>0]&&!(0|function(e){var t=0,i=0,r=0,o=0,s=0,u=0,h=0,d=0,f=0;if(f=y,y=y+560|0,o=f,r=f+40|0,d=f+16|0,i=0|l[88+(e|=0)>>2],u=(0|c[i+55>>0])<<8|0|c[i+56>>0],h=e+92|0,t=(0|l[e+4>>2])+((0|c[i+50>>0])<<8|(0|c[i+49>>0])<<16|0|c[i+51>>0])|0,!(i=(0|c[i+53>>0])<<8|(0|c[i+52>>0])<<16|0|c[i+54>>0]))return y=f,0|(d=0);l[h>>2]=t,l[e+96>>2]=t,l[e+104>>2]=i,l[e+100>>2]=t+i,l[e+108>>2]=0,l[e+112>>2]=0,l[d+20>>2]=0,l[d>>2]=0,l[d+4>>2]=0,l[d+8>>2]=0,l[d+12>>2]=0,n[d+16>>0]=0;e:do{if(0|X(h,d)){if(s=e+268|0,(0|(t=0|l[(i=e+272|0)>>2]))!=(0|u)){if(t>>>0<=u>>>0){do{if((0|l[e+276>>2])>>>0<u>>>0){if(0|K(s,u,(t+1|0)==(0|u),2,0)){t=0|l[i>>2];break}n[e+280>>0]=1,t=0;break e}}while(0);de((0|l[s>>2])+(t<<1)|0,0,u-t<<1|0)}l[i>>2]=u}if(!u){l[o>>2]=866,l[o+4>>2]=910,l[o+8>>2]=1497,De(r,812,o),xe(r),t=1;break}for(i=0,e=0,r=0,t=0|l[s>>2];;){if(r=(s=0|q(h,d))+r&255,e=(0|q(h,d))+e&255,a[t>>1]=e<<8|r,(i=i+1|0)>>>0>=u>>>0){t=1;break}t=t+2|0}}else t=0}while(0);return ce(d),y=f,0|(d=t)}(e)&&0|function(e){var t,i,r,o,s,u,h=0,d=0,f=0,p=0,_=0,m=0,$=0,g=0,v=0,x=0,b=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0,R=0,L=0,B=0,N=0,F=0,z=0,k=0,V=0,U=0,H=0,G=0,W=0,Y=0;if(u=y,y=y+2416|0,m=u,_=u+1904|0,G=u+1880|0,r=u+980|0,o=u+80|0,s=u+16|0,d=0|l[88+(e|=0)>>2],t=(0|c[d+63>>0])<<8|0|c[d+64>>0],i=e+92|0,h=(0|l[e+4>>2])+((0|c[d+58>>0])<<8|(0|c[d+57>>0])<<16|0|c[d+59>>0])|0,!(d=(0|c[d+61>>0])<<8|(0|c[d+60>>0])<<16|0|c[d+62>>0]))return y=u,0;if(l[i>>2]=h,l[e+96>>2]=h,l[e+104>>2]=d,l[e+100>>2]=h+d,l[e+108>>2]=0,l[e+112>>2]=0,l[G+20>>2]=0,l[G>>2]=0,l[G+4>>2]=0,l[G+8>>2]=0,l[G+12>>2]=0,n[G+16>>0]=0,0|X(i,G)){for(h=0,d=-7,f=-7;l[r+(h<<2)>>2]=f,l[o+(h<<2)>>2]=d,p=(0|f)>6,225!=(0|(h=h+1|0));)d=(1&p)+d|0,f=p?-7:f+1|0;d=(h=s)+64|0;do{l[h>>2]=0,h=h+4|0}while((0|h)<(0|d));p=e+284|0,d=3*t|0,h=0|l[(f=e+288|0)>>2];e:do{if((0|h)==(0|d))$=13;else{if(h>>>0<=d>>>0){do{if((0|l[e+292>>2])>>>0<d>>>0){if(0|K(p,d,(h+1|0)==(0|d),2,0)){h=0|l[f>>2];break}n[e+296>>0]=1,h=0;break e}}while(0);de((0|l[p>>2])+(h<<1)|0,0,d-h<<1|0)}l[f>>2]=d,$=13}}while(0);do{if(13==(0|$)){if(!t){l[m>>2]=866,l[m+4>>2]=910,l[m+8>>2]=1497,De(_,812,m),xe(_),h=1;break}for(P=s+4|0,I=s+8|0,M=s+12|0,O=s+16|0,D=s+20|0,R=s+24|0,L=s+28|0,B=s+32|0,N=s+36|0,F=s+40|0,z=s+44|0,k=s+48|0,V=s+52|0,U=s+56|0,H=s+60|0,A=0,h=0|l[p>>2],d=0|l[s>>2],f=0|l[P>>2],p=0|l[I>>2],e=0|l[M>>2],_=0|l[O>>2],m=0|l[D>>2],$=0|l[R>>2],g=0|l[L>>2],v=0|l[B>>2],x=0|l[N>>2],b=0|l[F>>2],w=0|l[z>>2],C=0,T=0,S=0,E=0;Y=0|q(i,G),d=d+(0|l[r+(Y<<2)>>2])&7,f=f+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),p=p+(0|l[r+(Y<<2)>>2])&7,e=e+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),_=_+(0|l[r+(Y<<2)>>2])&7,m=m+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),$=$+(0|l[r+(Y<<2)>>2])&7,g=g+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),v=v+(0|l[r+(Y<<2)>>2])&7,x=x+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),b=b+(0|l[r+(Y<<2)>>2])&7,w=w+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),C=C+(0|l[r+(Y<<2)>>2])&7,T=T+(0|l[o+(Y<<2)>>2])&7,Y=0|q(i,G),S=S+(0|l[r+(Y<<2)>>2])&7,E=E+(0|l[o+(Y<<2)>>2])&7,Y=0|c[1445+m>>0],a[h>>1]=(0|c[1445+f>>0])<<3|0|c[1445+d>>0]|(0|c[1445+p>>0])<<6|(0|c[1445+e>>0])<<9|(0|c[1445+_>>0])<<12|Y<<15,W=0|c[1445+b>>0],a[h+2>>1]=(0|c[1445+$>>0])<<2|Y>>>1|(0|c[1445+g>>0])<<5|(0|c[1445+v>>0])<<8|(0|c[1445+x>>0])<<11|W<<14,a[h+4>>1]=(0|c[1445+w>>0])<<1|W>>>2|(0|c[1445+C>>0])<<4|(0|c[1445+T>>0])<<7|(0|c[1445+S>>0])<<10|(0|c[1445+E>>0])<<13,!((A=A+1|0)>>>0>=t>>>0);)h=h+6|0;l[s>>2]=d,l[P>>2]=f,l[I>>2]=p,l[M>>2]=e,l[O>>2]=_,l[D>>2]=m,l[R>>2]=$,l[L>>2]=g,l[B>>2]=v,l[N>>2]=x,l[F>>2]=b,l[z>>2]=w,l[k>>2]=C,l[V>>2]=T,l[U>>2]=S,l[H>>2]=E,h=1}}while(0)}else h=0;return ce(G),y=u,0|h}(e))?0|(o=0):0|(o=1)):0|(o=0)):(l[e+88>>2]=0,0|(o=0))}(d,e,t)?(y=m,0|($=d)):(j(d),7&d?(l[p>>2]=866,l[p+4>>2]=2506,l[p+8>>2]=1232,De(h,812,p),xe(h),y=m,0|($=0)):(_e(d,0,0,1,0),y=m,0|($=0)))}(e,t),t=s+o|0;do{if(t>>>0>o>>>0){if(!$){for(r=i;r=r+(0|w(0|w((p+3|0)>>>2,g),(_+3|0)>>>2))|0,(0|(o=o+1|0))!=(0|t);)_>>>=1,p>>>=1;l[h>>2]=r;break}for(e=_,r=i;_=0|w((p+3|0)>>>2,g),!(o>>>0>15|(m=0|w(_,(e+3|0)>>>2))>>>0<8)&&519686845==(0|l[$>>2])&&(le($,h,m,_,o),r=0|l[h>>2]),r=r+m|0,l[h>>2]=r,(0|(o=o+1|0))!=(0|t);)e>>>=1,p>>>=1}}while(0);if($){if(519686845==(0|l[$>>2]))return j($),7&$?(l[d>>2]=866,l[d+4>>2]=2506,l[d+8>>2]=1232,De(u,812,d),xe(u),void(y=f)):(_e($,0,0,1,0),void(y=f));y=f}else y=f},_memset:de,_sbrk:Te,_memcpy:J,stackAlloc:function(e){var t;return t=y,y=(y=y+(e|=0)|0)+15&-16,0|t},_crn_get_height:function(e,t){var i,r;return e|=0,t|=0,r=y,y=y+48|0,l[(i=r)>>2]=40,oe(e,t,i),y=r,0|l[i+8>>2]},dynCall_vi:function(e,t){t|=0,lt[7&(e|=0)](0|t)},getTempRet0:function(){return 0|b},_crn_get_levels:function(e,t){var i,r;return e|=0,t|=0,r=y,y=y+48|0,l[(i=r)>>2]=40,oe(e,t,i),y=r,0|l[i+12>>2]},_crn_get_uncompressed_size:function(e,t,i){e|=0,t|=0,i|=0;var r,n,o,a,s=0,u=0;switch(a=y,y=y+576|0,o=a+40|0,n=a+56|0,l[(u=a)>>2]=40,oe(e,t,u),r=(3+((0|l[u+4>>2])>>>i)|0)>>>2,t=(3+((0|l[u+8>>2])>>>i)|0)>>>2,e=0|l[(i=u+32|0)+4>>2],0|l[i>>2]){case 0:case 9:case 10:e?s=14:e=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:s=e?14:13;break;default:s=14}return 13==(0|s)?e=16:14==(0|s)&&(l[o>>2]=866,l[o+4>>2]=2672,l[o+8>>2]=1251,De(n,812,o),xe(n),e=0),u=0|w(0|w(t,r),e),y=a,0|u},_i64Add:ze,dynCall_iiii:function(e,t,i,r){return t|=0,i|=0,r|=0,0|at[7&(e|=0)](0|t,0|i,0|r)},_emscripten_get_global_libc:function(){return 5072},dynCall_ii:function(e,t){return t|=0,0|ut[1&(e|=0)](0|t)},___udivdi3:Ye,_llvm_bswap_i32:qe,dynCall_viiiii:function(e,t,i,r,n,o){t|=0,i|=0,r|=0,n|=0,o|=0,st[3&(e|=0)](0|t,0|i,0|r,0|n,0|o)},___cxa_can_catch:function(e,t,i){var r,n;return e|=0,t|=0,i|=0,n=y,y=y+16|0,l[(r=n)>>2]=l[i>>2],(e=0|at[7&l[16+(0|l[e>>2])>>2]](e,t,r))&&(l[i>>2]=l[r>>2]),y=n,1&e|0},_free:G,runPostSets:function(){},dynCall_viiiiii:function(e,t,i,r,n,o,a){t|=0,i|=0,r|=0,n|=0,o|=0,a|=0,dt[3&(e|=0)](0|t,0|i,0|r,0|n,0|o,0|a)},establishStackSpace:function(e,t){y=e|=0},___uremdi3:Me,___cxa_is_pointer_type:function(e){return 1&(e=(e|=0)?0!=(0|ie(e,32,88,0)):0)|0},stackRestore:function(e){y=e|=0},_malloc:k,_emscripten_replace_memory:function(e){return!(16777215&$(e)||$(e)<=16777215||$(e)>2147483648)&&(n=new r(e),a=new o(e),l=new s(e),c=new u(e),d=new h(e),new f(e),new p(e),m=new _(e),i=e,!0)},dynCall_v:function(e){ht[3&(e|=0)]()},_crn_get_width:function(e,t){var i,r;return e|=0,t|=0,r=y,y=y+48|0,l[(i=r)>>2]=40,oe(e,t,i),y=r,0|l[i+4>>2]},_crn_get_dxt_format:function(e,t){var i,r;return e|=0,t|=0,r=y,y=y+48|0,l[(i=r)>>2]=40,oe(e,t,i),y=r,0|l[i+32>>2]}}}(Module$1.asmGlobalArg,Module$1.asmLibraryArg,buffer$1);Module$1.stackSave=asm.stackSave,Module$1.getTempRet0=asm.getTempRet0,Module$1._memset=asm._memset,Module$1.setThrew=asm.setThrew,Module$1._bitshift64Lshr=asm._bitshift64Lshr,Module$1._bitshift64Shl=asm._bitshift64Shl,Module$1.setTempRet0=asm.setTempRet0,Module$1._crn_decompress=asm._crn_decompress,Module$1._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,Module$1._sbrk=asm._sbrk,Module$1._memcpy=asm._memcpy,Module$1.stackAlloc=asm.stackAlloc,Module$1._crn_get_height=asm._crn_get_height,Module$1._i64Subtract=asm._i64Subtract,Module$1._crn_get_levels=asm._crn_get_levels,Module$1._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,Module$1._i64Add=asm._i64Add,Module$1._emscripten_get_global_libc=asm._emscripten_get_global_libc,Module$1.___udivdi3=asm.___udivdi3,Module$1._llvm_bswap_i32=asm._llvm_bswap_i32,Module$1.___cxa_can_catch=asm.___cxa_can_catch;var _free=Module$1._free=asm._free;Module$1.runPostSets=asm.runPostSets,Module$1.establishStackSpace=asm.establishStackSpace,Module$1.___uremdi3=asm.___uremdi3,Module$1.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,Module$1.stackRestore=asm.stackRestore;var _malloc$1=Module$1._malloc=asm._malloc,_emscripten_replace_memory=Module$1._emscripten_replace_memory=asm._emscripten_replace_memory,initialStackTop;function ExitStatus$1(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run$1(e){function t(){Module$1.calledRun||(Module$1.calledRun=!0,!ABORT$1&&(ensureInitRuntime(),preMain(),Module$1.onRuntimeInitialized&&Module$1.onRuntimeInitialized(),Module$1._main&&shouldRunNow&&Module$1.callMain(e),postRun$1()))}e=e||Module$1.arguments,runDependencies$1>0||(preRun$1(),runDependencies$1>0)||Module$1.calledRun||(Module$1.setStatus?(Module$1.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module$1.setStatus("")}),1),t()}),1)):t())}function exit(e,t){t&&Module$1.noExitRuntime||(Module$1.noExitRuntime||(ABORT$1=!0,STACKTOP=initialStackTop,exitRuntime(),Module$1.onExit&&Module$1.onExit(e)),ENVIRONMENT_IS_NODE$1&&process.exit(e),Module$1.quit(e,new ExitStatus$1(e)))}Module$1._crn_get_width=asm._crn_get_width,Module$1._crn_get_dxt_format=asm._crn_get_dxt_format,Module$1.dynCall_iiii=asm.dynCall_iiii,Module$1.dynCall_viiiii=asm.dynCall_viiiii,Module$1.dynCall_vi=asm.dynCall_vi,Module$1.dynCall_ii=asm.dynCall_ii,Module$1.dynCall_viii=asm.dynCall_viii,Module$1.dynCall_v=asm.dynCall_v,Module$1.dynCall_viiiiii=asm.dynCall_viiiiii,Module$1.dynCall_viiii=asm.dynCall_viiii,Runtime.stackAlloc=Module$1.stackAlloc,Runtime.stackSave=Module$1.stackSave,Runtime.stackRestore=Module$1.stackRestore,Runtime.establishStackSpace=Module$1.establishStackSpace,Runtime.setTempRet0=Module$1.setTempRet0,Runtime.getTempRet0=Module$1.getTempRet0,Module$1.asm=asm,ExitStatus$1.prototype=new Error,ExitStatus$1.prototype.constructor=ExitStatus$1,dependenciesFulfilled$1=function e(){Module$1.calledRun||run$1(),Module$1.calledRun||(dependenciesFulfilled$1=e)},Module$1.callMain=Module$1.callMain=function(e){e=e||[],ensureInitRuntime();var t=e.length+1;function i(){for(var e=0;e<3;e++)r.push(0)}var r=[allocate(intArrayFromString$1(Module$1.thisProgram),"i8",ALLOC_NORMAL)];i();for(var n=0;n<t-1;n+=1)r.push(allocate(intArrayFromString$1(e[n]),"i8",ALLOC_NORMAL)),i();r.push(0),r=allocate(r,"i32",ALLOC_NORMAL);try{exit(Module$1._main(t,r,0),!0)}catch(e){if(e instanceof ExitStatus$1)return;if("SimulateInfiniteLoop"==e)return void(Module$1.noExitRuntime=!0);var o=e;e&&"object"==typeof e&&e.stack&&(o=[e,e.stack]),Module$1.printErr("exception thrown: "+o),Module$1.quit(1,e)}},Module$1.run=Module$1.run=run$1,Module$1.exit=Module$1.exit=exit;var abortDecorators=[];function abort$1(e){Module$1.onAbort&&Module$1.onAbort(e),void 0!==e?(Module$1.print(e),Module$1.printErr(e),e=JSON.stringify(e)):e="",ABORT$1=!0;var t="abort("+e+") at "+stackTrace()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw abortDecorators&&abortDecorators.forEach((function(i){t=i(t,e)})),t}if(Module$1.abort=Module$1.abort=abort$1,Module$1.preInit)for("function"==typeof Module$1.preInit&&(Module$1.preInit=[Module$1.preInit]);Module$1.preInit.length>0;)Module$1.preInit.pop()();var shouldRunNow=!0;Module$1.noInitialRun&&(shouldRunNow=!1),Module$1.noExitRuntime=!0,run$1();var Module$2=Module$1,G;typeof ko<"u"&&(G=ko),function(e){var t=this||(0,eval)("this"),i=t.document,r=t.navigator,n=t.jQuery,o=t.JSON;n||typeof jQuery>"u"||(n=jQuery),function(a,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=p.a.setTimeout((function(){r=e,t()}),i))}}function c(e,t){var i;return function(){clearTimeout(i),i=p.a.setTimeout(e,t)}}function h(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function d(e,t){null!==t&&t.s&&t.s()}function f(e,t){var i=this.qd,r=i[y];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 p=typeof a<"u"?a:{};p.b=function(e,t){for(var i=e.split("."),r=p,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},p.L=function(e,t,i){e[t]=i},p.version="3.5.1",p.b("version",p.version),p.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},p.a=function(){function a(e,t){for(var i in e)c.call(e,i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)c.call(t,i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(v)||[];p.a.D(i.match(v),(function(e){p.a.Na(n,e,r)})),e[t]=n.join(" ")}var c=Object.prototype.hasOwnProperty,h={__proto__:[]}instanceof Array,d="function"==typeof Symbol,f={},_={};f[r&&/Firefox\/2/i.test(r.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],f.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(f,(function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)_[t[i]]=e}));var m,$={propertychange:!0},g=i&&function(){for(var t=3,r=i.createElement("div"),n=r.getElementsByTagName("i");r.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:e}(),v=/\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(t,i,r){for(var n=0,o=t.length;n<o;n++)if(i.call(r,t[n],n,t))return t[n];return e},Pa:function(e,t){var i=p.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];return e&&p.a.D(e,(function(e){0>p.a.A(t,e)&&t.push(e)})),t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,o=e.length;n<o;n++)r.push(t.call(i,e[n],n));return r},jb:function(e,t,i){var r=[];if(e)for(var n=0,o=e.length;n<o;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=p.a.A(p.a.bc(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},Ba:h,extend:s,setPrototypeOf:l,Ab:h?l:s,P:a,Ga:function(e,t,i){if(!e)return e;var r,n={};for(r in e)c.call(e,r)&&(n[r]=t.call(i,e[r],r,e));return n},Tb:function(e){for(;e.firstChild;)p.removeNode(e.firstChild)},Yb:function(e){for(var t=((e=p.a.la(e))[0]&&e[0].ownerDocument||i).createElement("div"),r=0,n=e.length;r<n;r++)t.appendChild(p.oa(e[r]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?p.oa(o):o)}return n},va:function(e,t){if(p.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,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)p.removeNode(i[o])}},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){7>g?e.setAttribute("selected",t):e.selected=t},Db:function(t){return null===t||t===e?"":t.trim?t.trim():t.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 p.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!p.a.Lb(e,p.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return p.onError?function(){try{return e.apply(this,arguments)}catch(e){throw p.onError&&p.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(p.a.Ac(e),t)},Gc:function(e){setTimeout((function(){throw p.onError&&p.onError(e),e}),0)},B:function(e,t,i){var r=p.a.Ac(i);if(i=$[t],p.options.useOnlyNativeEvents||i||!n)if(i||"function"!=typeof e.addEventListener){if(!(typeof e.attachEvent<"u"))throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,o),p.a.K.za(e,(function(){e.detachEvent(a,o)}))}else e.addEventListener(t,r,!1);else m||(m="function"==typeof n(e).on?"on":"bind"),n(e)[m](t,r)},Fb:function(e,r){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if(o=!("input"!==p.a.R(e)||!e.type||"click"!=r.toLowerCase()||"checkbox"!=(o=e.type)&&"radio"!=o),p.options.useOnlyNativeEvents||!n||o)if("function"==typeof i.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");(o=i.createEvent(_[r]||"HTMLEvents")).initEvent(r,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if(!(typeof e.fireEvent<"u"))throw Error("Browser doesn't support triggering events");e.fireEvent("on"+r)}else n(e).trigger(r)},f:function(e){return p.O(e)?e():e},bc:function(e){return p.O(e)?e.v():e},Eb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],p.a.D(t.match(v),(function(t){r.call(e.classList,t)}))):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Bb:function(t,i){var r=p.a.f(i);(null===r||r===e)&&(r="");var n=p.h.firstChild(t);!n||3!=n.nodeType||p.h.nextSibling(n)?p.h.va(t,[t.ownerDocument.createTextNode(r)]):n.data=r,p.a.Ad(t)},Yc:function(e,t){if(e.name=t,7>=g)try{var r=e.name.replace(/[&<>'"]/g,(function(e){return"&#"+e.charCodeAt(0)+";"}));e.mergeAttributes(i.createElement("<input name='"+r+"'/>"),!1)}catch{}},Ad:function(e){9<=g&&(e=1==e.nodeType?e:e.parentNode).style&&(e.style.zoom=e.style.zoom)},wd:function(e){if(g){var t=e.style.width;e.style.width=0,e.style.width=t}},Pd:function(e,t){e=p.a.f(e),t=p.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 d?Symbol(e):e},Zd:6===g,$d:7===g,W:g,Lc:function(e,t){for(var i=p.a.la(e.getElementsByTagName("input")).concat(p.a.la(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},Nd:function(e){return"string"==typeof e&&(e=p.a.Db(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js.");return o.stringify(p.a.f(e),t,i)},Od:function(e,t,r){var n=(r=r||{}).params||{},o=r.includeFields||this.Jc,s=e;if("object"==typeof e&&"form"===p.a.R(e)){s=e.action;for(var l=o.length-1;0<=l;l--)for(var u=p.a.Lc(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value}t=p.a.f(t);var h=i.createElement("form");for(var d in h.style.display="none",h.action=s,h.method="post",t)(e=i.createElement("input")).type="hidden",e.name=d,e.value=p.a.hc(p.a.f(t[d])),h.appendChild(e);a(n,(function(e,t){var r=i.createElement("input");r.type="hidden",r.name=e,r.value=t,h.appendChild(r)})),i.body.appendChild(h),r.submitter?r.submitter(h):h.submit(),setTimeout((function(){h.parentNode.removeChild(h)}),0)}}}(),p.b("utils",p.a),p.b("utils.arrayForEach",p.a.D),p.b("utils.arrayFirst",p.a.Lb),p.b("utils.arrayFilter",p.a.jb),p.b("utils.arrayGetDistinctValues",p.a.wc),p.b("utils.arrayIndexOf",p.a.A),p.b("utils.arrayMap",p.a.Mb),p.b("utils.arrayPushAll",p.a.Nb),p.b("utils.arrayRemoveItem",p.a.Pa),p.b("utils.cloneNodes",p.a.Ca),p.b("utils.createSymbolOrString",p.a.Da),p.b("utils.extend",p.a.extend),p.b("utils.fieldsIncludedWithJsonPost",p.a.Jc),p.b("utils.getFormFields",p.a.Lc),p.b("utils.objectMap",p.a.Ga),p.b("utils.peekObservable",p.a.bc),p.b("utils.postJson",p.a.Od),p.b("utils.parseJson",p.a.Nd),p.b("utils.registerEventHandler",p.a.B),p.b("utils.stringifyJson",p.a.hc),p.b("utils.range",p.a.Pd),p.b("utils.toggleDomNodeCssClass",p.a.Eb),p.b("utils.triggerEvent",p.a.Fb),p.b("utils.unwrapObservable",p.a.f),p.b("utils.objectForEach",p.a.P),p.b("utils.addOrRemoveItem",p.a.Na),p.b("utils.setTextContent",p.a.Bb),p.b("unwrap",p.a.f),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),p.a.g=new function(){var t,i,r=0,n="__ko__"+(new Date).getTime(),o={};return p.a.W?(t=function(t,i){var a=t[n];if(!a||"null"===a||!o[a]){if(!i)return e;a=t[n]="ko"+r++,o[a]={}}return o[a]},i=function(e){var t=e[n];return!!t&&(delete o[t],e[n]=null,!0)}):(t=function(e,t){var i=e[n];return!i&&t&&(i=e[n]={}),i},i=function(e){return!!e[n]&&(delete e[n],!0)}),{get:function(e,i){var r=t(e,!1);return r&&r[i]},set:function(i,r,n){(i=t(i,n!==e))&&(i[r]=n)},Ub:function(e,i,r){return(e=t(e,!0))[i]||(e[i]=r)},clear:i,Z:function(){return r+++n}}},p.b("utils.domData",p.a.g),p.b("utils.domData.clear",p.a.g.clear),p.a.K=new function(){function t(t,i){var r=p.a.g.get(t,o);return r===e&&i&&(r=[],p.a.g.set(t,o,r)),r}function i(e){if(i=t(e,!1))for(var i=i.slice(0),n=0;n<i.length;n++)i[n](e);p.a.g.clear(e),p.a.K.cleanExternalData(e),s[e.nodeType]&&r(e.childNodes,!0)}function r(e,t){for(var r,n=[],o=0;o<e.length;o++)if((!t||8===e[o].nodeType)&&(i(n[n.length]=r=e[o]),e[o]!==r))for(;o--&&-1==p.a.A(n,e[o]););}var o=p.a.g.Z(),a={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},yb:function(i,r){var n=t(i,!1);n&&(p.a.Pa(n,r),0==n.length&&p.a.g.set(i,o,e))},oa:function(e){return p.u.G((function(){a[e.nodeType]&&(i(e),s[e.nodeType]&&r(e.getElementsByTagName("*")))})),e},removeNode:function(e){p.oa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},p.oa=p.a.K.oa,p.removeNode=p.a.K.removeNode,p.b("cleanNode",p.oa),p.b("removeNode",p.removeNode),p.b("utils.domNodeDisposal",p.a.K),p.b("utils.domNodeDisposal.addDisposeCallback",p.a.K.za),p.b("utils.domNodeDisposal.removeDisposeCallback",p.a.K.yb),function(){var r=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=p.a.W;p.a.ua=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=i),s=a.parentWindow||a.defaultView||t;var c,h=p.a.Db(e).toLowerCase(),d=a.createElement("div");for(c=(h=h.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&l[h[1]]||r,h=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?d.appendChild(s.innerShiv(c)):(u&&a.body.appendChild(d),d.innerHTML=c,u&&d.parentNode.removeChild(d));h--;)d=d.lastChild;a=p.a.la(d.lastChild.childNodes)}return a},p.a.Md=function(e,t){var i=p.a.ua(e,t);return i.length&&i[0].parentElement||p.a.Yb(i)},p.a.fc=function(t,i){if(p.a.Tb(t),null!==(i=p.a.f(i))&&i!==e)if("string"!=typeof i&&(i=i.toString()),n)n(t).html(i);else for(var r=p.a.ua(i,t.ownerDocument),o=0;o<r.length;o++)t.appendChild(r[o])}}(),p.b("utils.parseHtmlFragment",p.a.ua),p.b("utils.setHtml",p.a.fc),p.aa=function(){function t(e,i){if(e)if(8==e.nodeType)null!=(r=p.aa.Uc(e.nodeValue))&&i.push({ud:e,Kd:r});else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{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 i[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},cd:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].ud,s=[a];i&&p.a.Nb(s,i),p.aa.bd(r[n].Kd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),p.b("memoization",p.aa),p.b("memoization.memoize",p.aa.Xb),p.b("memoization.unmemoize",p.aa.bd),p.b("memoization.parseMemoText",p.aa.Uc),p.b("memoization.unmemoizeDomNodeAndDescendants",p.aa.cd),p.na=function(){function e(){if(a)for(var e,t=a,i=0;l<a;)if(e=o[l++]){if(l>t){if(5e3<=++i){l=a,p.a.Gc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=a}try{e()}catch(e){p.a.Gc(e)}}}function r(){e(),l=a=o.length=0}var n,o=[],a=0,s=1,l=0;return n=t.MutationObserver?function(e){var t=i.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(r):i&&"onreadystatechange"in i.createElement("script")?function(e){var t=i.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,i.documentElement.removeChild(t),t=null,e()},i.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},{scheduler:n,zb:function(e){return a||p.na.scheduler(r),o[a++]=e,s++},cancel:function(e){(e-=s-a)>=l&&e<a&&(o[e]=null)},resetForTesting:function(){var e=a-l;return l=a=o.length=0,e},Sd:e}}(),p.b("tasks",p.na),p.b("tasks.schedule",p.na.zb),p.b("tasks.runEarly",p.na.Sd),p.Ta={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return p.$({read:e,write:function(r){clearTimeout(i),i=p.a.setTimeout((function(){e(r)}),t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.Hb=!1,n="function"==typeof r?r:"notifyWhenChangesStop"==r?c:u,e.ub((function(e){return n(e,i,t)}))},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.Hb||(t.Hb=!0,t.ub((function(i){var r,n=!1;return function(){if(!n){p.na.cancel(r),r=p.na.zb(i);try{n=!0,t.notifySubscribers(e,"dirty")}finally{n=!1}}}})))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};p.b("extenders",p.Ta),p.ic=function(e,t,i){this.da=e,this.lc=t,this.mc=i,this.Ib=!1,this.fb=this.Jb=null,p.L(this,"dispose",this.s),p.L(this,"disposeWhenNodeIsRemoved",this.l)},p.ic.prototype.s=function(){this.Ib||(this.fb&&p.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},p.ic.prototype.l=function(e){this.Jb=e,p.a.K.za(e,this.fb=this.s.bind(this))},p.T=function(){p.a.Ab(this,m),m.qb(this)};var m={qb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new p.ic(r,t?e.bind(t):e,(function(){p.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{p.u.xc();for(var r,n=0;r=i[n];++n)r.Ib||r.lc(e)}finally{p.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var t,i,r,n,o,a=this,s=p.O(a);a.gb||(a.gb=a.notifySubscribers,a.notifySubscribers=h);var l=e((function(){a.Ja=!1,s&&n===a&&(n=a.nc?a.nc():a());var e=i||o&&a.sb(r,n);o=i=t=!1,e&&a.gb(r=n)}));a.qc=function(e,i){i&&a.Ja||(o=!i),a.ed=a.U.change.slice(0),a.Ja=t=!0,n=e,l()},a.pc=function(e){t||(r=e,a.gb(e,"beforeChange"))},a.rc=function(){o=!0},a.gd=function(){a.sb(r,a.v(!0))&&(i=!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 t=0;return p.a.P(this.U,(function(e,i){"dirty"!==e&&(t+=i.length)})),t},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var t=this;return e&&p.a.P(e,(function(e,i){var r=p.Ta[e];"function"==typeof r&&(t=r(t,i)||t)})),t}};p.L(m,"init",m.qb),p.L(m,"subscribe",m.subscribe),p.L(m,"extend",m.extend),p.L(m,"getSubscriptionsCount",m.Bd),p.a.Ba&&p.a.setPrototypeOf(m,Function.prototype),p.T.fn=m,p.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},p.b("subscribable",p.T),p.b("isSubscribable",p.Qc),p.S=p.u=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{xc:e,end:t,cc:function(e){if(i){if(!p.Qc(e))throw Error("Only subscribable things can act as dependencies");i.od.call(i.pd,e,e.fd||(e.fd=++n))}},G:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},qa:function(){if(i)return i.o.qa()},Va:function(){if(i)return i.o.Va()},Ya:function(){if(i)return i.Ya},o:function(){if(i)return i.o}}}(),p.b("computedContext",p.S),p.b("computedContext.getDependenciesCount",p.S.qa),p.b("computedContext.getDependencies",p.S.Va),p.b("computedContext.isInitial",p.S.Ya),p.b("computedContext.registerDependency",p.S.cc),p.b("ignoreDependencies",p.Yd=p.u.G);var $=p.a.Da("_latestValue");p.ta=function(e){function t(){return 0<arguments.length?(t.sb(t[$],arguments[0])&&(t.ya(),t[$]=arguments[0],t.xa()),this):(p.u.cc(t),t[$])}return t[$]=e,p.a.Ba||p.a.extend(t,p.T.fn),p.T.fn.qb(t),p.a.Ab(t,g),p.options.deferUpdates&&p.Ta.deferred(t,!0),t};var g={equalityComparer:l,v:function(){return this[$]},xa:function(){this.notifySubscribers(this[$],"spectate"),this.notifySubscribers(this[$])},ya:function(){this.notifySubscribers(this[$],"beforeChange")}};p.a.Ba&&p.a.setPrototypeOf(g,p.T.fn);var v=p.ta.Ma="__ko_proto__";g[v]=p.ta,p.O=function(e){if((e="function"==typeof e&&e[v])&&e!==g[v]&&e!==p.o.fn[v])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},p.Za=function(e){return"function"==typeof e&&(e[v]===g[v]||e[v]===p.o.fn[v]&&e.Nc)},p.b("observable",p.ta),p.b("isObservable",p.O),p.b("isWriteableObservable",p.Za),p.b("isWritableObservable",p.Za),p.b("observable.fn",g),p.L(g,"peek",g.v),p.L(g,"valueHasMutated",g.xa),p.L(g,"valueWillMutate",g.ya),p.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=p.ta(e),p.a.Ab(e,p.Ha.fn),e.extend({trackArrayChanges:!0})},p.Ha.fn={remove:function(e){for(var t=this.v(),i=[],r="function"!=typeof e||p.O(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];if(r(o)){if(0===i.length&&this.ya(),t[n]!==o)throw Error("Array modified during remove; cannot remove item");i.push(o),t.splice(n,1),n--}}return i.length&&this.xa(),i},removeAll:function(t){if(t===e){var i=this.v(),r=i.slice(0);return this.ya(),i.splice(0,i.length),this.xa(),r}return t?this.remove((function(e){return 0<=p.a.A(t,e)})):[]},destroy:function(e){var t=this.v(),i="function"!=typeof e||p.O(e)?function(t){return t===e}:e;this.ya();for(var r=t.length-1;0<=r;r--){var n=t[r];i(n)&&(n._destroy=!0)}this.xa()},destroyAll:function(t){return t===e?this.destroy((function(){return!0})):t?this.destroy((function(e){return 0<=p.a.A(t,e)})):[]},indexOf:function(e){var t=this();return p.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ya(),this.v()[i]=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()}},p.a.Ba&&p.a.setPrototypeOf(p.Ha.fn,p.ta.fn),p.a.D("pop push reverse shift sort splice unshift".split(" "),(function(e){p.Ha.fn[e]=function(){var t=this.v();this.ya(),this.zc(t,e,arguments);var i=t[e].apply(t,arguments);return this.xa(),i===t?this:i}})),p.a.D(["slice"],(function(e){p.Ha.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}})),p.Pc=function(e){return p.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},p.b("observableArray",p.Ha),p.b("isObservableArray",p.Pc),p.Ta.trackArrayChanges=function(t,i){function r(){function e(){if(u){var e,i=[].concat(t.v()||[]);t.Wa("arrayChange")&&((!l||1<u)&&(l=p.a.Pb(a,i,t.Ob)),e=l),a=i,l=null,u=0,e&&e.length&&t.notifySubscribers(e,"arrayChange")}}s?e():(s=!0,o=t.subscribe((function(){++u}),null,"spectate"),a=[].concat(t.v()||[]),l=null,n=t.subscribe(e))}if(t.Ob={},i&&"object"==typeof i&&p.a.extend(t.Ob,i),t.Ob.sparse=!0,!t.zc){var n,o,a,s=!1,l=null,u=0,c=t.Qa,h=t.hb;t.Qa=function(e){c&&c.call(t,e),"arrayChange"===e&&r()},t.hb=function(i){h&&h.call(t,i),"arrayChange"!==i||t.Wa("arrayChange")||(n&&n.s(),o&&o.s(),o=n=null,s=!1,a=e)},t.zc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(s&&!u){var n=[],o=e.length,a=i.length,c=0;switch(t){case"push":c=o;case"unshift":for(t=0;t<a;t++)r("added",i[t],c+t);break;case"pop":c=o-1;case"shift":o&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?o+i[0]:i[0]),o),o=1===a?o:Math.min(t+(i[1]||0),o),a=t+a-2,c=Math.max(o,a);for(var h=[],d=[],f=2;t<c;++t,++f)t<o&&d.push(r("deleted",e[t],t)),t<a&&h.push(r("added",i[f],t));p.a.Kc(d,h);break;default:return}l=n}}}};var y=p.a.Da("_state");p.o=p.$=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.nb,arguments),this}return a.ra||p.u.cc(n),(a.ka||a.J&&n.Xa())&&n.ha(),a.X}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:r.read,nb:i||r.owner,l:r.disposeWhenNodeIsRemoved||r.l||null,Sa:r.disposeWhen||r.Sa,Rb:null,I:{},V:0,Ic:null};return n[y]=a,n.Nc="function"==typeof o,p.a.Ba||p.a.extend(n,p.T.fn),p.T.fn.qb(n),p.a.Ab(n,x),r.pure?(a.wb=!0,a.J=!0,p.a.extend(n,b)):r.deferEvaluation&&p.a.extend(n,w),p.options.deferUpdates&&p.Ta.deferred(n,!0),a.l&&(a.jc=!0,a.l.nodeType||(a.l=null)),a.J||r.deferEvaluation||n.ha(),a.l&&n.ja()&&p.a.K.za(a.l,a.Rb=function(){n.s()}),n};var x={equalityComparer:l,qa:function(){return this[y].V},Va:function(){var e=[];return p.a.P(this[y].I,(function(t,i){e[i.Ka]=i.da})),e},Vb:function(e){if(!this[y].V)return!1;var t=this.Va();return-1!==p.a.A(t,e)||!!p.a.Lb(t,(function(t){return t.Vb&&t.Vb(e)}))},uc:function(e,t,i){if(this[y].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[y].I[e]=i,i.Ka=this[y].V++,i.La=t.ob()},Xa:function(){var e,t,i=this[y].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[y].rb&&this.Ia(!1)},ja:function(){var e=this[y];return e.ka||0<e.V},Rd:function(){this.Ja?this[y].ka&&(this[y].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[y].Ic),this[y].Ic=p.a.setTimeout((function(){e.ha(!0)}),t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[y],i=t.Sa,r=!1;if(!t.rb&&!t.ra){if(t.l&&!p.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(t){var i=this[y],r=!1,n=i.wb?e:!i.V;r={qd:this,mb:i.I,Qb:i.V},p.u.xc({pd:r,od:f,o:this,Ya:n}),i.I={},i.V=0;var o=this.yd(i,r);return i.V?r=this.sb(i.X,o):(this.s(),r=!0),r&&(i.J?this.Gb():this.notifySubscribers(i.X,"beforeChange"),i.X=o,this.notifySubscribers(i.X,"spectate"),!i.J&&t&&this.notifySubscribers(i.X),this.rc&&this.rc()),n&&this.notifySubscribers(i.X,"awake"),r},yd:function(e,t){try{var i=e.Wc;return e.nb?i.call(e.nb):i()}finally{p.u.end(),t.Qb&&!e.J&&p.a.P(t.mb,d),e.sa=e.ka=!1}},v:function(e){var t=this[y];return(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha(),t.X},ub:function(e){p.T.fn.ub.call(this,e),this.nc=function(){return this[y].J||(this[y].sa?this.ha():this[y].ka=!1),this[y].X},this.Ia=function(e){this.pc(this[y].X),this[y].ka=!0,e&&(this[y].sa=!0),this.qc(this,!e)}},s:function(){var t=this[y];!t.J&&t.I&&p.a.P(t.I,(function(e,t){t.s&&t.s()})),t.l&&t.Rb&&p.a.K.yb(t.l,t.Rb),t.I=e,t.V=0,t.ra=!0,t.sa=!1,t.ka=!1,t.J=!1,t.l=e,t.Sa=e,t.Wc=e,this.Nc||(t.nb=e)}},b={Qa:function(e){var t=this,i=t[y];if(!i.ra&&i.J&&"change"==e){if(i.J=!1,i.sa||t.Xa())i.I=null,i.V=0,t.ha()&&t.Gb();else{var r=[];p.a.P(i.I,(function(e,t){r[t.Ka]=e})),p.a.D(r,(function(e,r){var n=i.I[e],o=t.$c(n.da);o.Ka=r,o.La=n.La,i.I[e]=o})),t.Xa()&&t.ha()&&t.Gb()}i.ra||t.notifySubscribers(i.X,"awake")}},hb:function(t){var i=this[y];i.ra||"change"!=t||this.Wa("change")||(p.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(e,"asleep"))},ob:function(){var e=this[y];return e.J&&(e.sa||this.Xa())&&this.ha(),p.T.fn.ob.call(this)}},w={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};p.a.Ba&&p.a.setPrototypeOf(x,p.T.fn);var C=p.ta.Ma;x[C]=p.o,p.Oc=function(e){return"function"==typeof e&&e[C]===x[C]},p.Fd=function(e){return p.Oc(e)&&e[y]&&e[y].wb},p.b("computed",p.o),p.b("dependentObservable",p.o),p.b("isComputed",p.Oc),p.b("isPureComputed",p.Fd),p.b("computed.fn",x),p.L(x,"peek",x.v),p.L(x,"dispose",x.s),p.L(x,"isActive",x.ja),p.L(x,"getDependenciesCount",x.qa),p.L(x,"getDependencies",x.Va),p.xb=function(e,t){return"function"==typeof e?p.o(e,t,{pure:!0}):((e=p.a.extend({},e)).pure=!0,p.o(e,t))},p.b("pureComputed",p.xb),function(){function t(n,o,a){if(a=a||new r,"object"!=typeof(n=o(n))||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,(function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}})),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.values=[]}p.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,(function(e){for(var t=0;p.O(e)&&10>t;t++)e=e();return e}))},p.toJSON=function(e,t,i){return e=p.ad(e),p.a.hc(e,t,i)},r.prototype={constructor:r,save:function(e,t){var i=p.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(t){return 0<=(t=p.a.A(this.keys,t))?this.values[t]:e}}}(),p.b("toJS",p.ad),p.b("toJSON",p.toJSON),p.Wd=function(e,t,i){function r(t){var r=p.xb(e,i).extend({ma:"always"}),n=r.subscribe((function(e){e&&(n.s(),t(e))}));return r.notifySubscribers(r.v()),n}return"function"!=typeof Promise||t?r(t.bind(i)):new Promise(r)},p.b("when",p.Wd),p.w={M:function(t){switch(p.a.R(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?p.a.g.get(t,p.c.options.$b):7>=p.a.W?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?p.w.M(t.options[t.selectedIndex]):e;default:return t.value}},cb:function(t,i,r){switch(p.a.R(t)){case"option":"string"==typeof i?(p.a.g.set(t,p.c.options.$b,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i):(p.a.g.set(t,p.c.options.$b,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:"");break;case"select":(""===i||null===i)&&(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if((n=p.w.M(t.options[a]))==i||""===n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o,6===p.a.W&&p.a.setTimeout((function(){t.selectedIndex=o}),0));break;default:(null===i||i===e)&&(i=""),t.value=i}}},p.b("selectExtensions",p.w),p.b("selectExtensions.readValue",p.w.M),p.b("selectExtensions.writeValue",p.w.cb),p.m=function(){function e(e){123===(e=p.a.Db(e)).charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=(e+="\n,").match(r),s=[],l=0;if(1<a.length){for(var u,c=0;u=a[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===h){if(!l&&!t&&1===s.length){t=s.pop();continue}}else{if(47===h&&1<u.length&&(47===u.charCodeAt(1)||42===u.charCodeAt(1)))continue;47===h&&c&&1<u.length?(h=a[c-1].match(n))&&!o[h[0]]&&(a=(e=e.substr(e.indexOf(u)+1)).match(r),c=-1,u="/"):40===h||123===h||91===h?++l:41===h||125===h||93===h?--l:t||s.length||34!==h&&39!==h||(u=u.slice(1,-1))}s.push(u)}if(0<l)throw Error("Unbalanced parentheses, braces, or brackets")}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{Ra:[],wa:a,ac:e,vb:function(r,n){function o(e,r){var n;if(!c){var h=p.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=p.a.A(t,n)?n=!1:(h=n.match(i),n=null!==h&&(h[1]?"Object("+h[1]+")"+h[2]:n)),h=n),h&&l.push("'"+("string"==typeof a[e]?a[e]:e)+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}var s=[],l=[],u=(n=n||{}).valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return p.a.D(h,(function(e){o(e.key||e.unknown,e.value)})),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.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&&p.O(e)?!p.Za(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),p.b("expressionRewriting",p.m),p.b("expressionRewriting.bindingRewriteValidators",p.m.Ra),p.b("expressionRewriting.parseObjectLiteral",p.m.ac),p.b("expressionRewriting.preProcessBindings",p.m.vb),p.b("expressionRewriting._twoWayBindings",p.m.wa),p.b("jsonExpressionRewriting",p.m),p.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",p.m.vb),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function r(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(p.a.g.set(n,u,!0),0==--o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var o=i&&"\x3c!--test--\x3e"===i.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},u="__ko_matchedEndComment__";p.h={ea:{},childNodes:function(t){return e(t)?r(t):t.childNodes},Ea:function(t){if(e(t))for(var i=0,r=(t=p.h.childNodes(t)).length;i<r;i++)p.removeNode(t[i]);else p.a.Tb(t)},va:function(t,i){if(e(t)){p.h.Ea(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else p.a.va(t,i)},Vc:function(t,i){var r;e(t)?(r=t.nextSibling,t=t.parentNode):r=t.firstChild,r?i!==r&&t.insertBefore(i,r):t.appendChild(i)},Wb:function(t,i,r){r?(r=r.nextSibling,e(t)&&(t=t.parentNode),r?i!==r&&t.insertBefore(i,r):t.appendChild(i)):p.h.Vc(t,i)},firstChild:function(i){if(e(i))return!i.nextSibling||t(i.nextSibling)?null:i.nextSibling;if(i.firstChild&&t(i.firstChild))throw Error("Found invalid end comment, as the first child of "+i);return i.firstChild},nextSibling:function(i){if(e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)){var r=i.nextSibling;if(t(r)&&!p.a.g.get(r,u))throw Error("Found end comment without a matching opening comment, as child of "+i);return null}return i.nextSibling},Cd:e,Vd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Sc:function(i){if(l[p.a.R(i)]){var r=i.firstChild;if(r)do{if(1===r.nodeType){var o,a=null;if(o=r.firstChild)do{if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o])}while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}}while(r=r.nextSibling)}}}}(),p.b("virtualElements",p.h),p.b("virtualElements.allowedBindings",p.h.ea),p.b("virtualElements.emptyNode",p.h.Ea),p.b("virtualElements.insertAfter",p.h.Wb),p.b("virtualElements.prepend",p.h.Vc),p.b("virtualElements.setDomNodeChildren",p.h.va),p.ga=function(){this.nd={}},p.a.extend(p.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||p.j.getComponentNameForNode(e);case 8:return p.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e):null;return p.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 p.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return p.h.Vd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.nd,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+p.m.vb(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),p.ga.instance=new p.ga,p.b("bindingProvider",p.ga),function(){function r(e){var t=(e=p.a.g.get(e,b))&&e.N;t&&(e.N=null,t.Tc())}function o(e,t,i){this.node=e,this.yc=t,this.kb=[],this.H=!1,t.N||p.a.K.za(e,r),i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function a(e){return function(){return e}}function s(e){return e()}function l(e){return p.a.Ga(p.u.G(e),(function(t,i){return function(){return e()[i]}}))}function u(e,t,i){return"function"==typeof e?l(e.bind(null,t,i)):p.a.Ga(e,a)}function c(e,t){return l(this.getBindings.bind(this,e,t))}function h(e,t){var i=p.h.firstChild(t);if(i){var r,n=p.ga.instance,o=n.preprocessNode;if(o){for(;r=i;)i=p.h.nextSibling(r),o.call(n,r);i=p.h.firstChild(t)}for(;r=i;)i=p.h.nextSibling(r),d(e,r)}p.i.ma(t,p.i.H)}function d(e,t){var i=e,r=1===t.nodeType;r&&p.h.Sc(t),(r||p.ga.instance.nodeHasBindings(t))&&(i=_(t,null,e).bindingContextForDescendants),i&&!y[p.a.R(t)]&&h(i,t)}function f(e){var t=[],i={},r=[];return p.a.P(e,(function n(o){if(!i[o]){var a=p.getBindingHandler(o);a&&(a.after&&(r.push(o),p.a.D(a.after,(function(t){if(e[t]){if(-1!==p.a.A(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}})),r.length--),t.push({key:o,Mc:a})),i[o]=!0}})),t}function _(t,i,r){var n,o=p.a.g.Ub(t,b,{}),a=o.hd;if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");o.hd=!0}if(a||(o.context=r),o.Zb||(o.Zb={}),i&&"function"!=typeof i)n=i;else{var l=p.ga.instance,u=l.getBindingAccessors||c,h=p.$((function(){return(n=i?i(r,t):u.call(l,t,r))&&(r[$]&&r[$](),r[v]&&r[v]()),n}),null,{l:t});n&&h.ja()||(h=null)}var d,_=r;if(n){var m=function(){return p.a.Ga(h?h():n,s)},g=h?function(e){return function(){return s(h()[e])}}:function(e){return n[e]};m.get=function(e){return n[e]&&s(g(e))},m.has=function(e){return e in n},p.i.H in n&&p.i.subscribe(t,p.i.H,(function(){var e=(0,n[p.i.H])();if(e){var i=p.h.childNodes(t);i.length&&e(i,p.Ec(i[0]))}})),p.i.pa in n&&(_=p.i.Cb(t,r),p.i.subscribe(t,p.i.pa,(function(){var e=(0,n[p.i.pa])();e&&p.h.firstChild(t)&&e(t)}))),o=f(n),p.a.D(o,(function(i){var r=i.Mc.init,o=i.Mc.update,a=i.key;if(8===t.nodeType&&!p.h.ea[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&p.u.G((function(){var i=r(t,g(a),m,_.$data,_);if(i&&i.controlsDescendantBindings){if(d!==e)throw Error("Multiple bindings ("+d+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");d=a}})),"function"==typeof o&&p.$((function(){o(t,g(a),m,_.$data,_)}),null,{l:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+n[a]+'"\nMessage: '+e.message,e}}))}return{shouldBindDescendants:o=d===e,bindingContextForDescendants:o&&_}}function m(t,i){return t&&t instanceof p.fa?t:new p.fa(t,e,e,i)}var $=p.a.Da("_subscribable"),g=p.a.Da("_ancestorBindingInfo"),v=p.a.Da("_dataDependency");p.c={};var y={script:!0,textarea:!0,template:!0};p.getBindingHandler=function(e){return p.c[e]};var x={};p.fa=function(t,i,r,n,o){function a(){var e=h?c():c,t=p.a.f(e);return i?(p.a.extend(l,i),g in i&&(l[g]=i[g])):(l.$parents=[],l.$root=t,l.ko=p),l[$]=s,u?t=l.$data:(l.$rawData=e,l.$data=t),r&&(l[r]=t),n&&n(l,i,t),i&&i[$]&&!p.S.o().Vb(i[$])&&i[$](),d&&(l[v]=d),l.$data}var s,l=this,u=t===x,c=u?e:t,h="function"==typeof c&&!p.O(c),d=o&&o.dataDependency;o&&o.exportDependencies?a():((s=p.xb(a)).v(),s.ja()?s.equalityComparer=null:l[$]=e)},p.fa.prototype.createChildContext=function(e,t,i,r){if(!r&&t&&"object"==typeof t&&(t=(r=t).as,i=r.extend),t&&r&&r.noChildContext){var n="function"==typeof e&&!p.O(e);return new p.fa(x,this,null,(function(r){i&&i(r),r[t]=n?e():e}),r)}return new p.fa(e,this,t,(function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)}),r)},p.fa.prototype.extend=function(e,t){return new p.fa(x,this,null,(function(t){p.a.extend(t,"function"==typeof e?e(t):e)}),t)};var b=p.a.g.Z();o.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},o.prototype.sd=function(e){p.a.Pa(this.kb,e),!this.kb.length&&this.H&&this.Cc()},o.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,p.a.K.yb(this.node,r),p.i.ma(this.node,p.i.pa),this.Tc())},p.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,r,n){var o=p.a.g.Ub(e,b,{});return o.Fa||(o.Fa=new p.T),n&&n.notifyImmediately&&o.Zb[t]&&p.u.G(i,r,[e]),o.Fa.subscribe(i,r,t)},ma:function(t,i){var r=p.a.g.get(t,b);if(r&&(r.Zb[i]=!0,r.Fa&&r.Fa.notifySubscribers(t,i),i==p.i.H))if(r.N)r.N.Cc();else if(r.N===e&&r.Fa&&r.Fa.Wa(p.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=p.a.g.Ub(e,b,{});return i.N||(i.N=new o(e,i,t[g])),t[g]==i?t:t.extend((function(e){e[g]=i}))}},p.Td=function(e){return(e=p.a.g.get(e,b))&&e.context},p.ib=function(e,t,i){return 1===e.nodeType&&p.h.Sc(e),_(e,t,m(i))},p.ld=function(e,t,i){return i=m(i),p.ib(e,u(t,i,e),i)},p.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||h(m(e),t)},p.vc=function(e,r,o){if(!n&&t.jQuery&&(n=t.jQuery),2>arguments.length){if(!(r=i.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!r||1!==r.nodeType&&8!==r.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");d(m(e,o),r)},p.Dc=function(t){return!t||1!==t.nodeType&&8!==t.nodeType?e:p.Td(t)},p.Ec=function(t){return(t=p.Dc(t))?t.$data:e},p.b("bindingHandlers",p.c),p.b("bindingEvent",p.i),p.b("bindingEvent.subscribe",p.i.subscribe),p.b("bindingEvent.startPossiblyAsyncContentBinding",p.i.Cb),p.b("applyBindings",p.vc),p.b("applyBindingsToDescendants",p.Oa),p.b("applyBindingAccessorsToNode",p.ib),p.b("applyBindingsToNode",p.ld),p.b("contextFor",p.Dc),p.b("dataFor",p.Ec)}(),function(e){function t(t,r){var a,s=Object.prototype.hasOwnProperty.call(n,t)?n[t]:e;s?s.subscribe(r):((s=n[t]=new p.T).subscribe(r),i(t,(function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Gd:r},delete n[t],a||r?s.notifySubscribers(e):p.na.zb((function(){s.notifySubscribers(e)}))})),a=!0)}function i(e,t){r("getConfig",[e],(function(i){i?r("loadComponent",[e,i],(function(e){t(e,i)})):t(null,null)}))}function r(t,i,n,o){o||(o=p.j.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat((function(e){l?n(null):null!==e?n(e):r(t,i,n,o)})))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};p.j={get:function(i,r){var n=Object.prototype.hasOwnProperty.call(o,i)?o[i]:e;n?n.Gd?p.u.G((function(){r(n.definition)})):p.na.zb((function(){r(n.definition)})):t(i,r)},Bc:function(e){delete o[e]},oc:r},p.j.loaders=[],p.b("components",p.j),p.b("components.get",p.j.get),p.b("components.clearCachedDefinition",p.j.Bc)}(),function(){function e(e,t,i,r){function n(){0==--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,(function(t){p.j.oc("loadTemplate",[e,t],(function(e){o.template=e,n()}))})):n(),i?a(t,i,(function(t){p.j.oc("loadViewModel",[e,t],(function(e){o[c]=e,n()}))})):n()}function r(e,t,i){if("function"==typeof t)i((function(e){return new t(e)}));else if("function"==typeof t[c])i(t[c]);else if("instance"in t){var n=t.instance;i((function(){return n}))}else"viewModel"in t?r(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function n(e){switch(p.a.R(e)){case"script":return p.a.ua(e.text);case"textarea":return p.a.ua(e.value);case"template":if(o(e.content))return p.a.Ca(e.content.childNodes)}return p.a.Ca(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],(function(e){e&&"object"==typeof e&&e.Xd&&e.default&&(e=e.default),r(e)})):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};p.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(p.j.tb(e))throw Error("Component "+e+" is already registered");u[e]=t},p.j.tb=function(e){return Object.prototype.hasOwnProperty.call(u,e)},p.j.unregister=function(e){delete u[e],p.j.Bc(e)},p.j.Fc={getConfig:function(e,t){t(p.j.tb(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,(function(i){e(t,n,i,r)}))},loadTemplate:function(e,r,a){if(e=l(e),"string"==typeof r)a(p.a.ua(r));else if(r instanceof Array)a(r);else if(o(r))a(p.a.la(r.childNodes));else if(r.element)if(r=r.element,t.HTMLElement?r instanceof HTMLElement:r&&r.tagName&&1===r.nodeType)a(n(r));else if("string"==typeof r){var s=i.getElementById(r);s?a(n(s)):e("Cannot find element with ID "+r)}else e("Unknown element type: "+r);else e("Unknown template value: "+r)},loadViewModel:function(e,t,i){r(l(e),t,i)}};var c="createViewModel";p.b("components.register",p.j.register),p.b("components.isRegistered",p.j.tb),p.b("components.unregister",p.j.unregister),p.b("components.defaultLoader",p.j.Fc),p.j.loaders.push(p.j.Fc),p.j.dd=u}(),function(){function e(e,i){if(r=e.getAttribute("params")){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),n=(r=p.a.Ga(r,(function(t){return p.o(t,null,{l:e})})),p.a.Ga(r,(function(t){var i=t.v();return t.ja()?p.o({read:function(){return p.a.f(t())},write:p.Za(i)&&function(e){t()(e)},l:e}):i})));return Object.prototype.hasOwnProperty.call(n,"$raw")||(n.$raw=r),n}return{$raw:{}}}p.j.getComponentNameForNode=function(e){var t=p.a.R(e);if(p.j.tb(t)&&(-1!=t.indexOf("-")||""+e=="[object HTMLUnknownElement]"||8>=p.a.W&&e.tagName===t))return t},p.j.tc=function(t,i,r,n){if(1===i.nodeType){var o=p.j.getComponentNameForNode(i);if(o){if((t=t||{}).component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new p.ga;9>p.a.W&&(p.j.register=function(e){return function(t){return e.apply(this,arguments)}}(p.j.register),i.createDocumentFragment=function(e){return function(){var t=e();return p.j.dd,t}}(i.createDocumentFragment))}(),function(){function e(e,t,i){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=p.a.Ca(t),p.h.va(i,e)}function t(e,t,i){var r=e.createViewModel;return r?r.call(e,t,i):t}var i=0;p.c.component={init:function(r,n,o,a,s){function l(){var e=u&&u.dispose;"function"==typeof e&&e.call(u),h&&h.s(),c=u=h=null}var u,c,h,d=p.a.la(p.h.childNodes(r));return p.h.Ea(r),p.a.K.za(r,l),p.o((function(){var o,a,f=p.a.f(n());if("string"==typeof f?o=f:(o=p.a.f(f.name),a=p.a.f(f.params)),!o)throw Error("No component name specified");var _=p.i.Cb(r,s),m=c=++i;p.j.get(o,(function(i){if(c===m){if(l(),!i)throw Error("Unknown component '"+o+"'");e(o,i,r);var n=t(i,a,{element:r,templateNodes:d});i=_.createChildContext(n,{extend:function(e){e.$component=n,e.$componentTemplateNodes=d}}),n&&n.koDescendantsComplete&&(h=p.i.subscribe(r,p.i.pa,n.koDescendantsComplete,n)),u=n,p.Oa(i,r)}}))}),null,{l:r}),{controlsDescendantBindings:!0}}},p.h.ea.component=!0}();var T={class:"className",for:"htmlFor"};p.c.attr={update:function(t,i){var r=p.a.f(i())||{};p.a.P(r,(function(i,r){r=p.a.f(r);var n=i.indexOf(":"),o=(n="lookupNamespaceURI"in t&&0<n&&t.lookupNamespaceURI(i.substr(0,n)),!1===r||null===r||r===e);o?n?t.removeAttributeNS(n,i):t.removeAttribute(i):r=r.toString(),8>=p.a.W&&i in T?(i=T[i],o?t.removeAttribute(i):t[i]=r):o||(n?t.setAttributeNS(n,i,r):t.setAttribute(i,r)),"name"===i&&p.a.Yc(t,o?"":r)}))}},p.c.checked={after:["value","attr"],init:function(t,i,r){function n(){var n=t.checked,o=a();if(!p.S.Ya()&&(n||!l&&!p.S.qa())){var u=p.u.G(i);if(c){var d=h?u.v():u,_=f;f=o,_!==o?n&&(p.a.Na(d,o,!0),p.a.Na(d,_,!1)):p.a.Na(d,o,n),h&&p.Za(u)&&u(d)}else s&&(o===e?o=n:n||(o=e)),p.m.eb(u,r,"checked",o,!0)}}function o(){var r=p.a.f(i()),n=a();c?(t.checked=0<=p.a.A(r,n),f=n):t.checked=s&&n===e?!!r:a()===r}var a=p.xb((function(){return r.has("checkedValue")?p.a.f(r.get("checkedValue")):d?r.has("value")?p.a.f(r.get("value")):t.value:void 0})),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&p.a.f(u)instanceof Array,h=!(c&&u.push&&u.splice),d=l||c,f=c?a():e;l&&!t.name&&p.c.uniqueName.init(t,(function(){return!0})),p.o(n,null,{l:t}),p.a.B(t,"click",n),p.o(o,null,{l:t}),u=e}}},p.m.wa.checked=!0,p.c.checkedValue={update:function(e,t){e.value=p.a.f(t())}},p.c.class={update:function(e,t){var i=p.a.Db(p.a.f(t()));p.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,p.a.Eb(e,i,!0)}},p.c.css={update:function(e,t){var i=p.a.f(t());null!==i&&"object"==typeof i?p.a.P(i,(function(t,i){i=p.a.f(i),p.a.Eb(e,t,i)})):p.c.class.update(e,t)}},p.c.enable={update:function(e,t){var i=p.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},p.c.disable={update:function(e,t){p.c.enable.update(e,(function(){return!p.a.f(t())}))}},p.c.event={init:function(e,t,i,r,n){var o=t()||{};p.a.P(o,(function(o){"string"==typeof o&&p.a.B(e,o,(function(e){var a,s=t()[o];if(s){try{var l=p.a.la(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}}))}))}},p.c.foreach={Rc:function(e){return function(){var t=e(),i=p.a.bc(t);return i&&"number"!=typeof i.length?(p.a.f(t),{foreach:i.data,as:i.as,noChildContext:i.noChildContext,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:p.ba.Ma}):{foreach:t,templateEngine:p.ba.Ma}}},init:function(e,t){return p.c.template.init(e,p.c.foreach.Rc(t))},update:function(e,t,i,r,n){return p.c.template.update(e,p.c.foreach.Rc(t),i,r,n)}},p.m.Ra.foreach=!1,p.h.ea.foreach=!0,p.c.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch{o=n.body}r=o===e}n=t(),p.m.eb(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);p.a.B(e,"focus",n),p.a.B(e,"focusin",n),p.a.B(e,"blur",o),p.a.B(e,"focusout",o),e.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!p.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),p.u.G(p.a.Fb,null,[e,i?"focusin":"focusout"]))}},p.m.wa.hasfocus=!0,p.c.hasFocus=p.c.hasfocus,p.m.wa.hasFocus="hasfocus",p.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){p.a.fc(e,t())}},function(){function e(e,t,i){p.c[e]={init:function(e,r,n,o,a){var s,l,u,c,h,d={};if(t){o=n.get("as");var f=n.get("noChildContext");d={as:o,noChildContext:f,exportDependencies:h=!(o&&f)}}return c=(u="render"==n.get("completeOn"))||n.has(p.i.pa),p.o((function(){var n,o=p.a.f(r()),f=!i!=!o,_=!l;(h||f!==s)&&(c&&(a=p.i.Cb(e,a)),f&&((!t||h)&&(d.dataDependency=p.S.o()),n=t?a.createChildContext("function"==typeof o?o:r,d):p.S.qa()?a.extend(null,d):a),_&&p.S.qa()&&(l=p.a.Ca(p.h.childNodes(e),!0)),f?(_||p.h.va(e,p.a.Ca(l)),p.Oa(n,e)):(p.h.Ea(e),u||p.i.ma(e,p.i.H)),s=f)}),null,{l:e}),{controlsDescendantBindings:!0}}},p.m.Ra[e]=!1,p.h.ea[e]=!0}e("if"),e("ifnot",!1,!0),e("with",!0)}(),p.c.let={init:function(e,t,i,r,n){return t=n.extend(t),p.Oa(t,e),{controlsDescendantBindings:!0}}},p.h.ea.let=!0;var S={};p.c.options={init:function(e){if("select"!==p.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return p.a.jb(t.options,(function(e){return e.selected}))}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(_&&c)p.i.ma(t,p.i.H);else if(f.length){var r=0<=p.a.A(f,p.w.M(i[0]));p.a.Zc(i[0],r),_&&!r&&p.u.G(p.a.Fb,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=p.a.f(i()),c=r.get("valueAllowUnset")&&r.has("value"),h=r.get("optionsIncludeDestroyed");i={};var d,f=[];c||(s?f=p.a.Mb(n(),p.w.M):0<=t.selectedIndex&&f.push(p.w.M(t.options[t.selectedIndex]))),u&&(typeof u.length>"u"&&(u=[u]),d=p.a.jb(u,(function(t){return h||t===e||null===t||!p.a.f(t._destroy)})),r.has("optionsCaption")&&null!==(u=p.a.f(r.get("optionsCaption")))&&u!==e&&d.unshift(S));var _=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),p.u.G(r.get("optionsAfterRender"),null,[i[0],t!==S?t:e])}),p.a.ec(t,d,(function(i,n,a){return a.length&&(f=!c&&a[0].selected?[p.w.M(a[0])]:[],_=!0),n=t.ownerDocument.createElement("option"),i===S?(p.a.Bb(n,r.get("optionsCaption")),p.w.cb(n,e)):(a=o(i,r.get("optionsValue"),i),p.w.cb(n,p.a.f(a)),i=o(i,r.get("optionsText"),a),p.a.Bb(n,i)),[n]}),i,u),c||(s?f.length&&n().length<f.length:f.length&&0<=t.selectedIndex?p.w.M(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex)&&p.u.G(p.a.Fb,null,[t,"change"]),(c||p.S.Ya())&&p.i.ma(t,p.i.H),p.a.wd(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},p.c.options.$b=p.a.g.Z(),p.c.selectedOptions={init:function(e,t,i){function r(){var r=t(),n=[];p.a.D(e.getElementsByTagName("option"),(function(e){e.selected&&n.push(p.w.M(e))})),p.m.eb(r,i,"selectedOptions",n)}function n(){var i=p.a.f(t()),r=e.scrollTop;i&&"number"==typeof i.length&&p.a.D(e.getElementsByTagName("option"),(function(e){var t=0<=p.a.A(i,p.w.M(e));e.selected!=t&&p.a.Zc(e,t)})),e.scrollTop=r}if("select"!=p.a.R(e))throw Error("selectedOptions binding applies only to SELECT elements");var o;p.i.subscribe(e,p.i.H,(function(){o?r():(p.a.B(e,"change",r),o=p.o(n,null,{l:e}))}),null,{notifyImmediately:!0})},update:function(){}},p.m.wa.selectedOptions=!0,p.c.style={update:function(t,i){var r=p.a.f(i()||{});p.a.P(r,(function(i,r){if((null===(r=p.a.f(r))||r===e||!1===r)&&(r=""),n)n(t).css(i,r);else if(/^--/.test(i))t.style.setProperty(i,r);else{i=i.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}));var o=t.style[i];t.style[i]=r,r===o||t.style[i]!=o||isNaN(r)||(t.style[i]=r+"px")}}))}},p.c.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");p.a.B(e,"submit",(function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}}))}},p.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){p.a.Bb(e,t())}},p.h.ea.text=!0,function(){if(t&&t.navigator){var i,r,n,o,a,s=function(e){if(e)return parseFloat(e[1])},l=t.navigator.userAgent;(i=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(a=s(l.match(/Edge\/([^ ]+)$/)))||s(l.match(/Chrome\/([^ ]+)/))||(r=s(l.match(/Version\/([^ ]+) Safari/)))||(n=s(l.match(/Firefox\/([^ ]+)/)))||(o=p.a.W||s(l.match(/MSIE ([^ ]+)/)))||(o=s(l.match(/rv:([^ )]+)/)))}if(8<=o&&10>o)var u=p.a.g.Z(),c=p.a.g.Z(),h=function(e){var t=this.activeElement;(t=t&&p.a.g.get(t,c))&&t(e)},d=function(e,t){var i=e.ownerDocument;p.a.g.get(i,u)||(p.a.g.set(i,u,!0),p.a.B(i,"selectionchange",h)),p.a.g.set(e,c,t)};p.c.textInput={init:function(t,s,l){function u(e,i){p.a.B(t,e,i)}function c(){var i=p.a.f(s());(null===i||i===e)&&(i=""),m!==e&&i===m?p.a.setTimeout(c,4):t.value!==i&&(v=!0,t.value=i,v=!1,$=t.value)}function h(){_||(m=t.value,_=p.a.setTimeout(f,4))}function f(){clearTimeout(_),m=_=e;var i=t.value;$!==i&&($=i,p.m.eb(s(),l,"textInput",i))}var _,m,$=t.value,g=9==p.a.W?h:f,v=!1;o&&u("keypress",f),11>o&&u("propertychange",(function(e){v||"value"!==e.propertyName||g()})),8==o&&(u("keyup",f),u("keydown",f)),d&&(d(t,g),u("dragend",h)),(!o||9<=o)&&u("input",g),5>r&&"textarea"===p.a.R(t)?(u("keydown",h),u("paste",h),u("cut",h)):11>i?u("keydown",h):4>n?(u("DOMAutoComplete",f),u("dragdrop",f),u("drop",f)):a&&"number"===t.type&&u("keydown",h),u("change",f),u("blur",f),p.o(c,null,{l:t})}},p.m.wa.textInput=!0,p.c.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),p.c.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++p.c.uniqueName.rd;p.a.Yc(e,i)}}},p.c.uniqueName.rd=0,p.c.using={init:function(e,t,i,r,n){var o;return i.has("as")&&(o={as:i.get("as"),noChildContext:i.get("noChildContext")}),t=n.createChildContext(t,o),p.Oa(t,e),{controlsDescendantBindings:!0}}},p.h.ea.using=!0,p.c.value={init:function(t,i,r){var n=p.a.R(t),o="input"==n;if(!o||"checkbox"!=t.type&&"radio"!=t.type){var a=[],s=r.get("valueUpdate"),l=!1,u=null;s&&(a="string"==typeof s?[s]:p.a.wc(s),p.a.Pa(a,"change"));var c,h,d=function(){u=null,l=!1;var e=i(),n=p.w.M(t);p.m.eb(e,r,"value",n)};!p.a.W||!o||"text"!=t.type||"off"==t.autocomplete||t.form&&"off"==t.form.autocomplete||-1!=p.a.A(a,"propertychange")||(p.a.B(t,"propertychange",(function(){l=!0})),p.a.B(t,"focus",(function(){l=!1})),p.a.B(t,"blur",(function(){l&&d()}))),p.a.D(a,(function(e){var i=d;p.a.Ud(e,"after")&&(i=function(){u=p.w.M(t),p.a.setTimeout(d,0)},e=e.substring(5)),p.a.B(t,e,i)})),c=o&&"file"==t.type?function(){var r=p.a.f(i());null===r||r===e||""===r?t.value="":p.u.G(d)}:function(){var o=p.a.f(i()),a=p.w.M(t);null!==u&&o===u?p.a.setTimeout(c,0):(o!==a||a===e)&&("select"===n?(a=r.get("valueAllowUnset"),p.w.cb(t,o,a),a||o===p.w.M(t)||p.u.G(d)):p.w.cb(t,o))},"select"===n?p.i.subscribe(t,p.i.H,(function(){h?r.get("valueAllowUnset")?c():d():(p.a.B(t,"change",d),h=p.o(c,null,{l:t}))}),null,{notifyImmediately:!0}):(p.a.B(t,"change",d),p.o(c,null,{l:t}))}else p.ib(t,{checkedValue:i})},update:function(){}},p.m.wa.value=!0,p.c.visible={update:function(e,t){var i=p.a.f(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},p.c.hidden={update:function(e,t){p.c.visible.update(e,(function(){return!p.a.f(t())}))}},function(e){p.c[e]={init:function(t,i,r,n,o){return p.c.event.init.call(this,t,(function(){var t={};return t[e]=i(),t}),r,n,o)}}}("click"),p.ca=function(){},p.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},p.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},p.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){var r=(t=t||i).getElementById(e);if(!r)throw Error("Cannot find template with ID "+e);return new p.C.F(r)}if(1==e.nodeType||8==e.nodeType)return new p.C.ia(e);throw Error("Unknown template type: "+e)},p.ca.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},p.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},p.ca.prototype.rewriteTemplate=function(e,t,i){t=t((e=this.makeTemplateSource(e,i)).text()),e.text(t),e.data("isRewritten",!0)},p.b("templateEngine",p.ca),p.kc=function(){function e(e,t,i,r){e=p.m.ac(e);for(var n=p.m.Ra,o=0;o<e.length;o++){var a=e[o].key;if(Object.prototype.hasOwnProperty.call(n,a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+p.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 p.kc.Ld(e,t)}),i)},Ld:function(r,n){return r.replace(t,(function(t,i,r,o,a){return e(a,i,r,n)})).replace(i,(function(t,i){return e(i,"\x3c!-- ko --\x3e","#comment",n)}))},md:function(e,t){return p.aa.Xb((function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&p.ib(n,e,r)}))}}}(),p.b("__tr_ambtns",p.kc.md),function(){p.C={},p.C.F=function(e){if(this.F=e){var t=p.a.R(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},p.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?p.a.fc(this.F,t):this.F[e]=t};var t=p.a.g.Z()+"_";p.C.F.prototype.data=function(e){if(1===arguments.length)return p.a.g.get(this.F,t+e);p.a.g.set(this.F,t+e,arguments[1])};var i=p.a.g.Z();p.C.F.prototype.nodes=function(){var t=this.F;if(0==arguments.length){var r=p.a.g.get(t,i)||{},n=r.lb||(3===this.ab?t.content:4===this.ab?t:e);if(!n||r.jd){var o=this.text();o&&o!==r.bb&&(n=p.a.Md(o,t.ownerDocument),p.a.g.set(t,i,{lb:n,bb:o,jd:!0}))}return n}r=arguments[0],this.ab!==e&&this.text(""),p.a.g.set(t,i,{lb:r})},p.C.ia=function(e){this.F=e},p.C.ia.prototype=new p.C.F,p.C.ia.prototype.constructor=p.C.ia,p.C.ia.prototype.text=function(){if(0==arguments.length){var t=p.a.g.get(this.F,i)||{};return t.bb===e&&t.lb&&(t.bb=t.lb.innerHTML),t.bb}p.a.g.set(this.F,i,{bb:arguments[0]})},p.b("templateSources",p.C),p.b("templateSources.domElement",p.C.F),p.b("templateSources.anonymousTemplate",p.C.ia)}(),function(){function t(e,t,i){var r;for(t=p.h.nextSibling(t);e&&(r=e)!==t;)i(r,e=p.h.nextSibling(r))}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=p.ga.instance,s=a.preprocessNode;if(s){if(t(r,n,(function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))})),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),p.a.Ua(e,o))}t(r,n,(function(e){1!==e.nodeType&&8!==e.nodeType||p.vc(i,e)})),t(r,n,(function(e){1!==e.nodeType&&8!==e.nodeType||p.aa.cd(e,[i])})),p.a.Ua(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(p.kc.xd(n,u,l),"number"!=typeof(n=u.renderTemplate(n,o,s,l)).length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":p.h.va(e,n),l=!0;break;case"replaceNode":p.a.Xc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&p.u.G(s.afterRender,null,[n,o[s.as||"$data"]]),"replaceChildren"==t&&p.i.ma(e,p.i.H)),n}function o(e,t,i){return p.O(e)?e():"function"==typeof e?e(t,i):e}var a;p.gc=function(t){if(t!=e&&!(t instanceof p.ca))throw Error("templateEngine must inherit from ko.templateEngine");a=t},p.dc=function(t,i,s,l,u){if(((s=s||{}).templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return p.$((function(){var e=i&&i instanceof p.fa?i:new p.fa(i,null,null,null,{exportDependencies:!0}),a=o(t,e.$data,e);e=n(l,u,a,e,s),"replaceNode"==u&&(c=r(l=e))}),null,{Sa:function(){return!c||!p.a.Sb(c)},l:c&&"replaceNode"==u?c.parentNode:c})}return p.aa.Xb((function(e){p.dc(t,i,s,e,"replaceNode")}))},p.Qd=function(t,r,a,s,l){function u(e,t){p.u.G(p.a.ec,null,[s,e,h,a,c,t]),p.i.ma(s,p.i.H)}function c(e,t){i(t,d),a.afterRender&&a.afterRender(t,e),d=null}function h(e,i){d=l.createChildContext(e,{as:f,noChildContext:a.noChildContext,extend:function(e){e.$index=i,f&&(e[f+"Index"]=i)}});var r=o(t,e,d);return n(s,"ignoreTargetNode",r,d,a)}var d,f=a.as,_=!1===a.includeDestroyed||p.options.foreachHidesDestroyed&&!a.includeDestroyed;if(_||a.beforeRemove||!p.Pc(r))return p.$((function(){var t=p.a.f(r)||[];typeof t.length>"u"&&(t=[t]),_&&(t=p.a.jb(t,(function(t){return t===e||null===t||!p.a.f(t._destroy)}))),u(t)}),null,{l:s});u(r.v());var m=r.subscribe((function(e){u(r(),e)}),null,"arrayChange");return m.l(s),m};var s=p.a.g.Z(),l=p.a.g.Z();p.c.template={init:function(e,t){var i=p.a.f(t());if("string"==typeof i||"name"in i)p.h.Ea(e);else if("nodes"in i){if(i=i.nodes||[],p.O(i))throw Error('The "nodes" option must be a plain, non-observable array.');var r=i[0]&&i[0].parentNode;r&&p.a.g.get(r,l)||(r=p.a.Yb(i),p.a.g.set(r,l,!0)),new p.C.ia(e).nodes(r)}else{if(!(0<(i=p.h.childNodes(e)).length))throw Error("Anonymous template defined, but no template content was provided");r=p.a.Yb(i),new p.C.ia(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a=i();r=!0,n=null,"string"==typeof(i=p.a.f(a))?i={}:(a="name"in i?i.name:t,"if"in i&&(r=p.a.f(i.if)),r&&"ifnot"in i&&(r=!p.a.f(i.ifnot)),r&&!a&&(r=!1)),"foreach"in i?n=p.Qd(a,r&&i.foreach||[],i,t,o):r?(r=o,"data"in i&&(r=o.createChildContext(i.data,{as:i.as,noChildContext:i.noChildContext,exportDependencies:!0})),n=p.dc(a,r,i,t)):p.h.Ea(t),o=n,(i=p.a.g.get(t,s))&&"function"==typeof i.s&&i.s(),p.a.g.set(t,s,!o||o.ja&&!o.ja()?e:o)}},p.m.Ra.template=function(e){return 1==(e=p.m.ac(e)).length&&e[0].unknown||p.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},p.h.ea.template=!0}(),p.b("setTemplateEngine",p.gc),p.b("renderTemplate",p.dc),p.a.Kc=function(e,t,i){var r,n,o,a,s;if(e.length&&t.length)for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}},p.a.Pb=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,d=[],f=e.length,_=t.length,m=_-f||1,$=f+_+1;for(o=0;o<=f;o++)for(l=s,d.push(s=[]),u=c(_,o+m),a=h(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||$,s[a-1]||$)+1:a+1:o+1;for(c=[],h=[],m=[],o=f,a=_;o||a;)_=d[o][a]-1,a&&_===d[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&_===d[o-1][a]?m.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return p.a.Kc(m,h,!n.dontLimitMoves&&10*f),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},i=i||[],(t=t||[]).length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),p.b("utils.compareArrays",p.a.Pb),function(){function t(t,i,r,n,o){var a=[],s=p.$((function(){var e=i(r,o,p.a.Ua(a,t))||[];0<a.length&&(p.a.Xc(a,e),n&&p.u.G(n,null,[r,e,o])),a.length=0,p.a.Nb(a,e)}),null,{l:t,Sa:function(){return!p.a.kd(a)}});return{Y:a,$:s.ja()?s:e}}var i=p.a.g.Z(),r=p.a.g.Z();p.a.ec=function(n,o,a,s,l,u){function c(e){f={Aa:e,pb:p.ta(b++)},y.push(f),v||E.push(f)}function h(e){f=g[e],b!==f.pb.v()&&S.push(f),f.pb(b++),p.a.Ua(f.Y,n),y.push(f)}function d(e,t){if(e)for(var i=0,r=t.length;i<r;i++)p.a.D(t[i].Y,(function(r){e(r,i,t[i].Aa)}))}typeof(o=o||[]).length>"u"&&(o=[o]),s=s||{};var f,_,m,$,g=p.a.g.get(n,i),v=!g,y=[],x=0,b=0,w=[],C=[],T=[],S=[],E=[],A=0;if(v)p.a.D(o,c);else{if(!u||g&&g._countWaitingForRemove){var P=p.a.Mb(g,(function(e){return e.Aa}));u=p.a.Pb(P,o,{dontLimitMoves:s.dontLimitMoves,sparse:!0})}var I,M,O;for(P=0;I=u[P];P++)switch(M=I.moved,O=I.index,I.status){case"deleted":for(;x<O;)h(x++);M===e&&((f=g[x]).$&&(f.$.s(),f.$=e),p.a.Ua(f.Y,n).length&&(s.beforeRemove&&(y.push(f),A++,f.Aa===r?f=null:T.push(f)),f&&w.push.apply(w,f.Y))),x++;break;case"added":for(;b<O;)h(x++);M!==e?(C.push(y.length),h(M)):c(I.value)}for(;b<o.length;)h(x++);y._countWaitingForRemove=A}p.a.g.set(n,i,y),d(s.beforeMove,S),p.a.D(w,s.beforeRemove?p.oa:p.removeNode);try{$=n.ownerDocument.activeElement}catch{}if(C.length)for(;(P=C.shift())!=e;){for(f=y[P],_=e;P;)if((m=y[--P].Y)&&m.length){_=m[m.length-1];break}for(o=0;x=f.Y[o];_=x,o++)p.h.Wb(n,x,_)}for(P=0;f=y[P];P++){for(f.Y||p.a.extend(f,t(n,a,f.Aa,l,f.pb)),o=0;x=f.Y[o];_=x,o++)p.h.Wb(n,x,_);!f.Ed&&l&&(l(f.Aa,f.Y,f.pb),f.Ed=!0,_=f.Y[f.Y.length-1])}for($&&n.ownerDocument.activeElement!=$&&$.focus(),d(s.beforeRemove,T),P=0;P<T.length;++P)T[P].Aa=r;d(s.afterMove,S),d(s.afterAdd,E)}}(),p.b("utils.setDomNodeChildrenFromArrayMapping",p.a.ec),p.ba=function(){this.allowTemplateRewriting=!1},p.ba.prototype=new p.ca,p.ba.prototype.constructor=p.ba,p.ba.prototype.renderTemplateSource=function(e,t,i,r){return(t=9>p.a.W||!e.nodes?null:e.nodes())?p.a.la(t.cloneNode(!0).childNodes):(e=e.text(),p.a.ua(e,r))},p.ba.Ma=new p.ba,p.gc(p.ba.Ma),p.b("nativeTemplateEngine",p.ba),function(){p.$a=function(){var e=this.Hd=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(t,r,o,a){if(a=a||i,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[r.$data],r=n.extend({koBindingContext:r},o.templateOptions),(r=n.tmpl(s,t,r)).appendTo(a.createElement("div")),n.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){i.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")},0<e&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},p.$a.prototype=new p.ca,p.$a.prototype.constructor=p.$a;var e=new p.$a;0<e.Hd&&p.gc(e),p.b("jqueryTmplTemplateEngine",p.$a)}()}(t.ko={})}();var ce$1=ko;typeof window<"u"?(ko=window.ko,typeof G<"u"?window.ko=G:delete window.ko):(ko=global.ko,typeof G<"u"?global.ko=G:delete global.ko);var s$4="__knockoutObservables",o$6="__knockoutSubscribable";function f$6(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var i=this,r=c$4(e,!0);return(t=t||Object.getOwnPropertyNames(e)).forEach((function(t){if(t!==s$4&&t!==o$6&&!(t in r)){var n=e[t],o=n instanceof Array,a=i.isObservable(n)?n:o?i.observableArray(n):i.observable(n);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:a,set:i.isWriteableObservable(a)?a:void 0}),r[t]=a,o&&d$6(i,a)}})),e}function c$4(e,t){var i=e[s$4];return!i&&t&&(i={},Object.defineProperty(e,s$4,{value:i})),i}function v$5(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),f$6.call(this,e,[t]),e}function d$6(e,t){var i=null;e.computed((function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=h$2(e,t,r))}))}function h$2(e,t,i){return y$5(e,i).subscribe(t)}function y$5(e,t){var i=t[o$6];if(!i){i=new e.subscribable,Object.defineProperty(t,o$6,{value:i});var r={};p$2(t,i,r),A$1(e,t,i,r)}return i}function p$2(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach((function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return!0!==i.pause&&t.notifySubscribers(this),e}}))}function A$1(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach((function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})}))}function b$6(e,t){if(!e)return null;var i=c$4(e,!1);return i&&i[t]||null}function g$5(e,t){var i=b$6(e,t);i&&i.valueHasMutated()}function w$2(e){e.track=f$6,e.getObservable=b$6,e.valueHasMutated=g$5,e.defineProperty=v$5}var t$3={attachToKo:w$2},d$5="http://www.w3.org/2000/svg",v$4="cesium-svgPath-svg",g$4={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,i){var r=document.createElementNS(d$5,"svg:svg");r.setAttribute("class",v$4);var n=document.createElementNS(d$5,"path");return r.appendChild(n),e.virtualElements.setDomNodeChildren(t,[r]),e.computed({read:function(){var t=e.unwrap(i());n.setAttribute("d",e.unwrap(t.path));var o=e.unwrap(t.width),a=e.unwrap(t.height);r.setAttribute("width",o),r.setAttribute("height",a),r.setAttribute("viewBox","0 0 "+o+" "+a),t.css&&r.setAttribute("class",v$4+" "+e.unwrap(t.css))},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}};t$3.attachToKo(ce$1),g$4.register(ce$1);var j$3={};!function(){var e=function(){var e={defaultNoDataValue:-34027999387901484e22,decode:function(o,a){var s=(a=a||{}).encodedMaskData||null===a.encodedMaskData,l=n(o,a.inputOffset||0,s),u=null!==a.noDataValue?a.noDataValue:e.defaultNoDataValue,c=t(l,a.pixelType||Float32Array,a.encodedMaskData,u,a.returnMask),h={width:l.width,height:l.height,pixelData:c.resultPixels,minValue:c.minValue,maxValue:l.pixels.maxValue,noDataValue:u};return c.resultMask&&(h.maskData=c.resultMask),a.returnEncodedMask&&l.mask&&(h.encodedMaskData=l.mask.bitset?l.mask.bitset:null),a.returnFileInfo&&(h.fileInfo=i(l),a.computeUsedBitDepths&&(h.fileInfo.bitDepths=r(l))),h}},t=function(e,t,i,r,n){var a,s,l,u=0,c=e.pixels.numBlocksX,h=e.pixels.numBlocksY,d=Math.floor(e.width/c),f=Math.floor(e.height/h),p=2*e.maxZError,_=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),n&&i&&(l=new Uint8Array(e.width*e.height));for(var m,$,g=new Float32Array(d*f),v=0;v<=h;v++){var y=v!==h?f:e.height%h;if(0!==y)for(var x=0;x<=c;x++){var b=x!==c?d:e.width%c;if(0!==b){var w,C,T,S,E=v*e.width*f+x*d,A=e.width-b,P=e.pixels.blocks[u];if(P.encoding<2?(0===P.encoding?w=P.rawData:(o(P.stuffedData,P.bitsPerPixel,P.numValidPixels,P.offset,p,g,e.pixels.maxValue),w=g),C=0):T=2===P.encoding?0:P.offset,i)for($=0;$<y;$++){for(7&E&&(S=i[E>>3],S<<=7&E),m=0;m<b;m++)7&E||(S=i[E>>3]),128&S?(l&&(l[E]=1),_=_>(a=P.encoding<2?w[C++]:T)?a:_,s[E++]=a):(l&&(l[E]=0),s[E++]=r),S<<=1;E+=A}else if(P.encoding<2)for($=0;$<y;$++){for(m=0;m<b;m++)_=_>(a=w[C++])?a:_,s[E++]=a;E+=A}else for(_=_>T?T:_,$=0;$<y;$++){for(m=0;m<b;m++)s[E++]=T;E+=A}if(1===P.encoding&&C!==P.numValidPixels)throw"Block and Mask do not match";u++}}}return{resultPixels:s,resultMask:l,minValue:_}},i=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}}},r=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)},n=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 o=new DataView(e,t,24);if(r.fileVersion=o.getInt32(0,!0),r.imageType=o.getInt32(4,!0),r.height=o.getUint32(8,!0),r.width=o.getUint32(12,!0),r.maxZError=o.getFloat64(16,!0),t+=24,!i)if(o=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=o.getUint32(0,!0),r.mask.numBlocksX=o.getUint32(4,!0),r.mask.numBytes=o.getUint32(8,!0),r.mask.maxValue=o.getFloat32(12,!0),t+=16,r.mask.numBytes>0){var a=new Uint8Array(Math.ceil(r.width*r.height/8)),s=(o=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(s>0)for(;s--;)a[u++]=o.getUint8(l++);else{var c=o.getUint8(l++);for(s=-s;s--;)a[u++]=c}s=o.getInt16(l,!0),l+=2}while(l<r.mask.numBytes);if(-32768!==s||u<a.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=a,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)));o=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=o.getUint32(0,!0),r.pixels.numBlocksX=o.getUint32(4,!0),r.pixels.numBytes=o.getUint32(8,!0),r.pixels.maxValue=o.getFloat32(12,!0),t+=16;var h=r.pixels.numBlocksX,d=r.pixels.numBlocksY,f=h+(r.width%h>0?1:0),p=d+(r.height%d>0?1:0);r.pixels.blocks=new Array(f*p);for(var _=0,m=0;m<p;m++)for(var $=0;$<f;$++){var g=0,v=e.byteLength-t;o=new DataView(e,t,Math.min(10,v));var y={};r.pixels.blocks[_++]=y;var x=o.getUint8(0);if(g++,y.encoding=63&x,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==x&&2!==x){if(x>>=6,y.offsetType=x,2===x)y.offset=o.getInt8(1),g++;else if(1===x)y.offset=o.getInt16(1,!0),g+=2;else{if(0!==x)throw"Invalid block offset type";y.offset=o.getFloat32(1,!0),g+=4}if(1===y.encoding)if(x=o.getUint8(g),g++,y.bitsPerPixel=63&x,x>>=6,y.numValidPixelsType=x,2===x)y.numValidPixels=o.getUint8(g),g++;else if(1===x)y.numValidPixels=o.getUint16(g,!0),g+=2;else{if(0!==x)throw"Invalid valid pixel count type";y.numValidPixels=o.getUint32(g,!0),g+=4}}var b;if(t+=g,3!==y.encoding)if(0===y.encoding){var w=(r.pixels.numBytes-1)/4;if(w!==Math.floor(w))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*w),new Uint8Array(b).set(new Uint8Array(e,t,4*w));var C=new Float32Array(b);y.rawData=C,t+=4*w}else if(1===y.encoding){var T=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),S=Math.ceil(T/4);b=new ArrayBuffer(4*S),new Uint8Array(b).set(new Uint8Array(e,t,T)),y.stuffedData=new Uint32Array(b),t+=T}}else t++}return r.eofOffset=t,r},o=function(e,t,i,r,n,o,a){var s,l,u,c=(1<<t)-1,h=0,d=0,f=Math.ceil((a-r)/n),p=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*p,s=0;s<i;s++){if(0===d&&(u=e[h++],d=32),d>=t)l=u>>>d-t&c,d-=t;else{var _=t-d;l=(u&c)<<_&c,l+=(u=e[h++])>>>(d=32-_)}o[s]=l<f?r+l*n:a}return o};return e}(),t=function(){var e=function(e,t,i,r,n,o,a,s){var l,u,c,h,d,f=(1<<i)-1,p=0,_=0,m=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*m,n)for(l=0;l<r;l++)0===_&&(c=e[p++],_=32),_>=i?(u=c>>>_-i&f,_-=i):(u=(c&f)<<(h=i-_)&f,u+=(c=e[p++])>>>(_=32-h)),t[l]=n[u];else for(d=Math.ceil((s-o)/a),l=0;l<r;l++)0===_&&(c=e[p++],_=32),_>=i?(u=c>>>_-i&f,_-=i):(u=(c&f)<<(h=i-_)&f,u+=(c=e[p++])>>>(_=32-h)),t[l]=u<d?o+u*a:s},t=function(e,t,i,r,n,o){var a,s=(1<<t)-1,l=0,u=0,c=0,h=0,d=0,f=[],p=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*p;var _=Math.ceil((o-r)/n);for(u=0;u<i;u++)0===h&&(a=e[l++],h=32),h>=t?(d=a>>>h-t&s,h-=t):(d=(a&s)<<(c=t-h)&s,d+=(a=e[l++])>>>(h=32-c)),f[u]=d<_?r+d*n:o;return f.unshift(r),f},i=function(e,t,i,r,n,o,a,s){var l,u,c,h,d=(1<<i)-1,f=0,p=0,_=0;if(n)for(l=0;l<r;l++)0===p&&(c=e[f++],p=32,_=0),p>=i?(u=c>>>_&d,p-=i,_+=i):(u=c>>>_&d,p=32-(h=i-p),u|=((c=e[f++])&(1<<h)-1)<<i-h,_=h),t[l]=n[u];else{var m=Math.ceil((s-o)/a);for(l=0;l<r;l++)0===p&&(c=e[f++],p=32,_=0),p>=i?(u=c>>>_&d,p-=i,_+=i):(u=c>>>_&d,p=32-(h=i-p),u|=((c=e[f++])&(1<<h)-1)<<i-h,_=h),t[l]=u<m?o+u*a:s}return t},r=function(e,t,i,r,n,o){var a,s=(1<<t)-1,l=0,u=0,c=0,h=0,d=0,f=0,p=[],_=Math.ceil((o-r)/n);for(u=0;u<i;u++)0===h&&(a=e[l++],h=32,f=0),h>=t?(d=a>>>f&s,h-=t,f+=t):(d=a>>>f&s,h=32-(c=t-h),d|=((a=e[l++])&(1<<c)-1)<<t-c,f=c),p[u]=d<_?r+d*n:o;return p.unshift(r),p},n=function(e,t,i,r){var n,o,a,s,l=(1<<i)-1,u=0,c=0,h=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*h,n=0;n<r;n++)0===c&&(a=e[u++],c=32),c>=i?(o=a>>>c-i&l,c-=i):(o=(a&l)<<(s=i-c)&l,o+=(a=e[u++])>>>(c=32-s)),t[n]=o;return t},o=function(e,t,i,r){var n,o,a,s,l=(1<<i)-1,u=0,c=0,h=0;for(n=0;n<r;n++)0===c&&(a=e[u++],c=32,h=0),c>=i?(o=a>>>h&l,c-=i,h+=i):(o=a>>>h&l,c=32-(s=i-c),o|=((a=e[u++])&(1<<s)-1)<<i-s,h=s),t[n]=o;return t},a={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),o=0;n;){var a=n>=359?359:n;n-=a;do{t+=e[o++]<<8,i+=t+=e[o++]}while(--a);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[o]<<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 o,a=new DataView(e,i,8),s=a.getInt32(0,!0);if(n.fileVersion=s,i+=4,s>=3&&(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,s>=4?(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,s>=3&&(o=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-o,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),o=this.readSubArray(e,t.ptr,r,n),a=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;var s,l=!0;for(s=0;s<i.numDims;s++)if(o[s]!==a[s]){l=!1;break}return i.minValues=o,i.maxValues=a,l},readSubArray:function(e,t,i,r){var n;if(i===Uint8Array)n=new Uint8Array(e,t,r);else{var o=new ArrayBuffer(r);new Uint8Array(o).set(new Uint8Array(e,t,r)),n=new i(o)}return n},readMask:function(e,t){var i,r,n=t.ptr,o=t.headerInfo,a=o.width*o.height,s=o.numValidPixel,l=new DataView(e,n,4),u={};if(u.numBytes=l.getUint32(0,!0),n+=4,(0===s||a===s)&&0!==u.numBytes)throw"invalid mask";if(0===s)i=new Uint8Array(Math.ceil(a/8)),u.bitset=i,r=new Uint8Array(a),t.pixels.resultMask=r,n+=u.numBytes;else if(u.numBytes>0){i=new Uint8Array(Math.ceil(a/8));var c=(l=new DataView(e,n,u.numBytes)).getInt16(0,!0),h=2,d=0,f=0;do{if(c>0)for(;c--;)i[d++]=l.getUint8(h++);else for(f=l.getUint8(h++),c=-c;c--;)i[d++]=f;c=l.getInt16(h,!0),h+=2}while(h<u.numBytes);if(-32768!==c||d<i.length)throw"Unexpected end of mask RLE encoding";r=new Uint8Array(a);var p=0,_=0;for(_=0;_<a;_++)7&_?(p=i[_>>3],p<<=7&_):p=i[_>>3],128&p&&(r[_]=1);t.pixels.resultMask=r,u.bitset=i,n+=u.numBytes}return t.ptr=n,t.mask=u,!0},readDataOneSweep:function(e,t,i){var r,n=t.ptr,o=t.headerInfo,s=o.numDims,l=o.width*o.height,u=o.imageType,c=o.numValidPixel*a.getDataTypeSize(u)*s,h=t.pixels.resultMask;if(i===Uint8Array)r=new Uint8Array(e,n,c);else{var d=new ArrayBuffer(c);new Uint8Array(d).set(new Uint8Array(e,n,c)),r=new i(d)}if(r.length===l*s)t.pixels.resultPixels=r;else{t.pixels.resultPixels=new i(l*s);var f=0,p=0,_=0,m=0;if(s>1)for(_=0;_<s;_++)for(m=_*l,p=0;p<l;p++)h[p]&&(t.pixels.resultPixels[m+p]=r[f++]);else for(p=0;p<l;p++)h[p]&&(t.pixels.resultPixels[p]=r[f++])}return n+=c,t.ptr=n,!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),o=r.getInt32(8,!0),l=r.getInt32(12,!0);if(o>=l)return!1;var u=new Uint32Array(l-o);a.decodeBits(e,t,u);var c,h,d,f,p=[];for(c=o;c<l;c++)p[h=c-(c<n?0:n)]={first:u[c-o],second:null};var _=e.byteLength-t.ptr,m=Math.ceil(_/4),$=new ArrayBuffer(4*m);new Uint8Array($).set(new Uint8Array(e,t.ptr,_));var g,v=new Uint32Array($),y=0,x=0;for(g=v[0],c=o;c<l;c++)(f=p[h=c-(c<n?0:n)].first)>0&&(p[h].second=g<<y>>>32-f,32-y>=f?32===(y+=f)&&(y=0,g=v[++x]):(y+=f-32,g=v[++x],p[h].second|=g>>>32-y));var b=0,w=0,C=new s;for(c=0;c<p.length;c++)void 0!==p[c]&&(b=Math.max(b,p[c].first));w=b>=i?i:b,b>=30&&console.log("WARning, large NUM LUT BITS IS "+b);var T,S,E,A,P,I=[];for(c=o;c<l;c++)if((f=p[h=c-(c<n?0:n)].first)>0)if(T=[f,h],f<=w)for(S=p[h].second<<w-f,E=1<<w-f,d=0;d<E;d++)I[S|d]=T;else for(S=p[h].second,P=C,A=f-1;A>=0;A--)S>>>A&1?(P.right||(P.right=new s),P=P.right):(P.left||(P.left=new s),P=P.left),0===A&&!P.val&&(P.val=T[1]);return{decodeLut:I,numBitsLUTQick:w,numBitsLUT:b,tree:C,stuffedData:v,srcPtr:x,bitPos:y}},readHuffman:function(e,t,i){var r,n,o,a,s,l,u,c,h,d=t.headerInfo,f=d.numDims,p=t.headerInfo.height,_=t.headerInfo.width,m=_*p,$=this.readHuffmanTree(e,t),g=$.decodeLut,v=$.tree,y=$.stuffedData,x=$.srcPtr,b=$.bitPos,w=$.numBitsLUTQick,C=$.numBitsLUT,T=0===t.headerInfo.imageType?128:0,S=t.pixels.resultMask,E=0;b>0&&(x++,b=0);var A,P=y[x],I=1===t.encodeMode,M=new i(m*f),O=M;for(A=0;A<d.numDims;A++){if(f>1&&(O=new i(M.buffer,m*A,m),E=0),t.headerInfo.numValidPixel===_*p)for(c=0,l=0;l<p;l++)for(u=0;u<_;u++,c++){if(n=0,s=a=P<<b>>>32-w,32-b<w&&(s=a|=y[x+1]>>>64-b-w),g[s])n=g[s][1],b+=g[s][0];else for(s=a=P<<b>>>32-C,32-b<C&&(s=a|=y[x+1]>>>64-b-C),r=v,h=0;h<C;h++)if(!(r=a>>>C-h-1&1?r.right:r.left).left&&!r.right){n=r.val,b=b+h+1;break}b>=32&&(b-=32,P=y[++x]),o=n-T,I?(o+=u>0?E:l>0?O[c-_]:E,o&=255,O[c]=o,E=o):O[c]=o}else for(c=0,l=0;l<p;l++)for(u=0;u<_;u++,c++)if(S[c]){if(n=0,s=a=P<<b>>>32-w,32-b<w&&(s=a|=y[x+1]>>>64-b-w),g[s])n=g[s][1],b+=g[s][0];else for(s=a=P<<b>>>32-C,32-b<C&&(s=a|=y[x+1]>>>64-b-C),r=v,h=0;h<C;h++)if(!(r=a>>>C-h-1&1?r.right:r.left).left&&!r.right){n=r.val,b=b+h+1;break}b>=32&&(b-=32,P=y[++x]),o=n-T,I?(u>0&&S[c-1]?o+=E:l>0&&S[c-_]?o+=O[c-_]:o+=E,o&=255,O[c]=o,E=o):O[c]=o}t.ptr=t.ptr+4*(x+1)+(b>0?4:0)}t.pixels.resultPixels=M},decodeBits:function(a,s,l,u,c){var h=s.headerInfo,d=h.fileVersion,f=0,p=a.byteLength-s.ptr>=5?5:a.byteLength-s.ptr,_=new DataView(a,s.ptr,p),m=_.getUint8(0);f++;var $=m>>6,g=0===$?4:3-$,v=(32&m)>0,y=31&m,x=0;if(1===g)x=_.getUint8(f),f++;else if(2===g)x=_.getUint16(f,!0),f+=2;else{if(4!==g)throw"Invalid valid pixel count type";x=_.getUint32(f,!0),f+=4}var b,w,C,T,S,E,A,P,I,M=2*h.maxZError,O=h.numDims>1?h.maxValues[c]:h.zMax;if(v){for(s.counter.lut++,P=_.getUint8(f),f++,T=Math.ceil((P-1)*y/8),S=Math.ceil(T/4),w=new ArrayBuffer(4*S),C=new Uint8Array(w),s.ptr+=f,C.set(new Uint8Array(a,s.ptr,T)),A=new Uint32Array(w),s.ptr+=T,I=0;P-1>>>I;)I++;T=Math.ceil(x*I/8),S=Math.ceil(T/4),w=new ArrayBuffer(4*S),(C=new Uint8Array(w)).set(new Uint8Array(a,s.ptr,T)),b=new Uint32Array(w),s.ptr+=T,E=d>=3?r(A,y,P-1,u,M,O):t(A,y,P-1,u,M,O),d>=3?i(b,l,I,x,E):e(b,l,I,x,E)}else s.counter.bitstuffer++,I=y,s.ptr+=f,I>0&&(T=Math.ceil(x*I/8),S=Math.ceil(T/4),w=new ArrayBuffer(4*S),(C=new Uint8Array(w)).set(new Uint8Array(a,s.ptr,T)),b=new Uint32Array(w),s.ptr+=T,d>=3?null===u?o(b,l,I,x):i(b,l,I,x,!1,u,M,O):null===u?n(b,l,I,x):e(b,l,I,x,!1,u,M,O))},readTiles:function(e,t,i){var r=t.headerInfo,n=r.width,o=r.height,s=r.microBlockSize,l=r.imageType,u=a.getDataTypeSize(l),c=Math.ceil(n/s),h=Math.ceil(o/s);t.pixels.numBlocksY=h,t.pixels.numBlocksX=c,t.pixels.ptr=0;var d,f,p,_,m,$,g,v,y=0,x=0,b=0,w=0,C=0,T=0,S=0,E=0,A=0,P=0,I=0,M=0,O=0,D=0,R=0,L=new i(s*s),B=o%s||s,N=n%s||s,F=r.numDims,z=t.pixels.resultMask,k=t.pixels.resultPixels;for(b=0;b<h;b++)for(C=b!==h-1?s:B,w=0;w<c;w++)for(P=b*n*s+w*s,I=n-(T=w!==c-1?s:N),v=0;v<F;v++){if(F>1&&(k=new i(t.pixels.resultPixels.buffer,n*o*v*u,n*o)),S=e.byteLength-t.ptr,f={},R=0,R++,A=(E=(d=new DataView(e,t.ptr,Math.min(10,S))).getUint8(0))>>6&255,(E>>2&15)!==(w*s>>3&15))throw"integrity issue";if((m=3&E)>3)throw t.ptr+=R,"Invalid block encoding ("+m+")";if(2!==m)if(0===m){if(t.counter.uncompressed++,t.ptr+=R,M=(M=C*T*u)<(O=e.byteLength-t.ptr)?M:O,p=new ArrayBuffer(M%u==0?M:M+u-M%u),new Uint8Array(p).set(new Uint8Array(e,t.ptr,M)),_=new i(p),D=0,z)for(y=0;y<C;y++){for(x=0;x<T;x++)z[P]&&(k[P]=_[D++]),P++;P+=I}else for(y=0;y<C;y++){for(x=0;x<T;x++)k[P++]=_[D++];P+=I}t.ptr+=D*u}else if($=a.getDataTypeUsed(l,A),g=a.getOnePixel(f,R,$,d),R+=a.getDataTypeSize($),3===m)if(t.ptr+=R,t.counter.constantoffset++,z)for(y=0;y<C;y++){for(x=0;x<T;x++)z[P]&&(k[P]=g),P++;P+=I}else for(y=0;y<C;y++){for(x=0;x<T;x++)k[P++]=g;P+=I}else if(t.ptr+=R,a.decodeBits(e,t,L,g,v),R=0,z)for(y=0;y<C;y++){for(x=0;x<T;x++)z[P]&&(k[P]=L[R++]),P++;P+=I}else for(y=0;y<C;y++){for(x=0;x<T;x++)k[P++]=L[R++];P+=I}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:a.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=e.headerInfo.zMax,i=e.headerInfo.numDims,r=e.headerInfo.height*e.headerInfo.width,n=r*i,o=0,a=0,s=0,l=e.pixels.resultMask;if(l)if(i>1)for(o=0;o<i;o++)for(s=o*r,a=0;a<r;a++)l[a]&&(e.pixels.resultPixels[s+a]=t);else for(a=0;a<r;a++)l[a]&&(e.pixels.resultPixels[a]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(a=0;a<n;a++)e.pixels.resultPixels[a]=t},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:default:t=Float32Array;break;case 7:t=Float64Array}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:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&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}},s=function(e,t,i){this.val=e,this.left=t,this.right=i},l={decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},a.readHeaderInfo(e,n)){var o=n.headerInfo,s=o.fileVersion,l=a.getDataTypeArray(o.imageType);a.readMask(e,n),o.numValidPixel!==o.width*o.height&&!n.pixels.resultMask&&(n.pixels.resultMask=t.maskData);var u,c=o.width*o.height;if(n.pixels.resultPixels=new l(c*o.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==o.numValidPixel)if(o.zMax===o.zMin)a.constructConstantSurface(n);else if(s>=4&&a.checkMinMaxRanges(e,n))a.constructConstantSurface(n);else{var h=new DataView(e,n.ptr,2),d=h.getUint8(0);if(n.ptr++,d)a.readDataOneSweep(e,n,l);else if(s>1&&o.imageType<=1&&Math.abs(o.maxZError-.5)<1e-5){var f=h.getUint8(1);if(n.ptr++,n.encodeMode=f,f>2||s<4&&f>1)throw"Invalid Huffman flag "+f;f?a.readHuffman(e,n,l):a.readTiles(e,n,l)}else a.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(u=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(u)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(u=n.headerInfo.blobSize-n.ptr,Math.abs(u)>=1&&(n.eofOffset=n.headerInfo.blobSize));var p={width:o.width,height:o.height,pixelData:n.pixels.resultPixels,minValue:o.zMin,maxValue:o.zMax,validPixelCount:o.numValidPixel,dimCount:o.numDims,dimStats:{minValues:o.minValues,maxValues:o.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&a.isValidPixelValue(o.imageType,i)){var _=n.pixels.resultMask;for(r=0;r<c;r++)_[r]||(p.pixelData[r]=i);p.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(p.fileInfo=a.formatFileInfo(n)),p}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)a.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}};return l}(),i=function(){var e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,1===t[0]}(),r={decode:function(r,n){if(!i)throw"Big endian system is not supported.";var o,a,s,l,u,c=(n=n||{}).inputOffset||0,h=new Uint8Array(r,c,10),d=String.fromCharCode.apply(null,h);if("CntZImage"===d.trim())o=e,a=1;else{if("Lerc2"!==d.substring(0,5))throw"Unexpected file identifier string: "+d;o=t,a=2}for(var f,p,_,m=0,$=r.byteLength-10,g=[],v={width:0,height:0,pixels:[],pixelType:n.pixelType,mask:null,statistics:[]};c<$;){var y=o.decode(r,{inputOffset:c,encodedMaskData:f,maskData:_,returnMask:0===m,returnEncodedMask:0===m,returnFileInfo:!0,pixelType:n.pixelType||null,noDataValue:n.noDataValue||null});c=y.fileInfo.eofOffset,0===m&&(f=y.encodedMaskData,_=y.maskData,v.width=y.width,v.height=y.height,v.dimCount=y.dimCount||1,v.pixelType=y.pixelType||y.fileInfo.pixelType,v.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),m++,v.pixels.push(y.pixelData),v.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(u=v.width*v.height,v.bandMasks=g,(_=new Uint8Array(u)).set(g[0]),s=1;s<g.length;s++)for(p=g[s],l=0;l<u;l++)_[l]=_[l]&p[l];v.maskData=_}return v}};j$3.Lerc=r}();var LercDecode=j$3.Lerc,V$1=function(){var e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if("object"!=typeof WebAssembly)return{supported:!1};var i="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB";WebAssembly.validate(e)&&(i="B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB");var r,n=WebAssembly.instantiate(function(e){for(var i=new Uint8Array(e.length),r=0;r<e.length;++r){var n=e.charCodeAt(r);i[r]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}var o=0;for(r=0;r<e.length;++r)i[o++]=i[r]<60?t[i[r]]:64*(i[r]-60)+i[++r];return i.buffer.slice(0,o)}(i),{}).then((function(e){(r=e.instance).exports.__wasm_call_ctors()}));function o(e,t,i,n,o,a){var s=r.exports.sbrk,l=i+3&-4,u=s(l*n),c=s(o.length),h=new Uint8Array(r.exports.memory.buffer);h.set(o,c);var d=e(u,i,n,c,o.length);if(0==d&&a&&a(u,l,n),t.set(h.subarray(u,u+i*n)),s(u-s(0)),0!=d)throw new Error("Malformed buffer data: "+d)}var a={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},s={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:n,supported:!0,decodeVertexBuffer:function(e,t,i,n,s){o(r.exports.meshopt_decodeVertexBuffer,e,t,i,n,r.exports[a[s]])},decodeIndexBuffer:function(e,t,i,n){o(r.exports.meshopt_decodeIndexBuffer,e,t,i,n)},decodeIndexSequence:function(e,t,i,n){o(r.exports.meshopt_decodeIndexSequence,e,t,i,n)},decodeGltfBuffer:function(e,t,i,n,l,u){o(r.exports[s[l]],e,t,i,n,r.exports[a[u]])}}}(),C$4={};!function(e,t){e.NoSleep=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){var r=function(){function e(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)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}();function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=i(1),a=o.webm,s=o.mp4,l=typeof navigator<"u"&&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,u=function(){function e(){var t=this;n(this,e),l?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",s),this.noSleepVideo.addEventListener("loadedmetadata",(function(){t.noSleepVideo.duration<=1?t.noSleepVideo.setAttribute("loop",""):t.noSleepVideo.addEventListener("timeupdate",(function(){t.noSleepVideo.currentTime>.5&&(t.noSleepVideo.currentTime=Math.random())}))})))}return r(e,[{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(){l?(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 .\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(){l?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=u},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="}}])}(C$4);var b$5=C$4.NoSleep;function t$2(){}t$2.array={},t$2.array.binarySearch=function(e,t,i){for(var r,n,o=i||t$2.array.numberSafeCompareFunction,a=0,s=e.length,l=!1;a<s;)(n=+o(e[r=a+(s-a>>1)],t))<0?a=r+1:(s=r,l=!n);return l?a:~a},t$2.array.numberSafeCompareFunction=function(e,t){return e>t?1:e<t?-1:0},t$2.array.includes=function(e,t){return e.indexOf(t)>=0},t$2.array.linearFindNearest=function(e,t,i){var r,n=e.length;if(e[0]<=t)return 0;if(t<=e[n-1])return n-1;if(i>0){for(r=1;r<n;++r)if(e[r]<t)return r-1}else if(i<0){for(r=1;r<n;++r)if(e[r]<=t)return r}else for(r=1;r<n;++r){if(e[r]==t)return r;if(e[r]<t)return e[r-1]-t<t-e[r]?r-1:r}return n-1},t$2.array.reverseSubArray=function(e,t,i){for(;t<i;){var r=e[t];e[t]=e[i],e[i]=r,++t,--i}},t$2.array.extend=function(e,t){var i,r=Array.isArray(t)?t:[t],n=r.length;for(i=0;i<n;i++)e[e.length]=r[i]},t$2.array.remove=function(e,t){var i=e.indexOf(t),r=i>-1;return r&&e.splice(i,1),r},t$2.array.find=function(e,t){for(var i,r=e.length>>>0,n=0;n<r;n++)if(t(i=e[n],n,e))return i;return null},t$2.array.equals=function(e,t){var i=e.length;if(i!==t.length)return!1;for(var r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0},t$2.array.stableSort=function(e,t){var i,r=e.length,n=Array(e.length);for(i=0;i<r;i++)n[i]={index:i,value:e[i]};for(n.sort((function(e,i){return t(e.value,i.value)||e.index-i.index})),i=0;i<e.length;i++)e[i]=n[i].value},t$2.array.findIndex=function(e,t){var i,r=!e.every((function(r,n){return i=n,!t(r,n,e)}));return r?i:-1},t$2.array.isSorted=function(e,t,i){var r=t||t$2.array.numberSafeCompareFunction;return e.every((function(t,n){if(0===n)return!0;var o=r(e[n-1],t);return!(o>0||i&&0===o)}))},t$2.ASSUME_TOUCH=!1,t$2.DEFAULT_MAX_ZOOM=42,t$2.DEFAULT_MIN_ZOOM=0,t$2.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5,t$2.DEFAULT_TILE_SIZE=256,t$2.DEFAULT_WMS_VERSION="1.3.0",t$2.ENABLE_CANVAS=!0,t$2.ENABLE_PROJ4JS=!0,t$2.ENABLE_RASTER_REPROJECTION=!0,t$2.ENABLE_WEBGL=!0,t$2.DEBUG_WEBGL=!0,t$2.INITIAL_ATLAS_SIZE=256,t$2.MAX_ATLAS_SIZE=-1,t$2.MOUSEWHEELZOOM_MAXDELTA=1,t$2.OVERVIEWMAP_MAX_RATIO=.75,t$2.OVERVIEWMAP_MIN_RATIO=.1,t$2.RASTER_REPROJECTION_MAX_SOURCE_TILES=100,t$2.RASTER_REPROJECTION_MAX_SUBDIVISION=10,t$2.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25,t$2.SIMPLIFY_TOLERANCE=.5,t$2.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024,t$2.VERSION="",t$2.inherits=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},t$2.nullFunction=function(){},t$2.getUid=function(e){return e.ol_uid||(e.ol_uid=++t$2.uidCounter_)},t$2.asserts={},t$2.asserts.assert=function(e,t){},t$2.has={};var U$1=typeof navigator<"u"?navigator.userAgent.toLowerCase():"";t$2.has.FIREFOX=-1!==U$1.indexOf("firefox"),t$2.has.SAFARI=-1!==U$1.indexOf("safari")&&-1==U$1.indexOf("chrom"),t$2.has.WEBKIT=-1!==U$1.indexOf("webkit")&&-1==U$1.indexOf("edge"),t$2.has.MAC=-1!==U$1.indexOf("macintosh"),t$2.has.DEVICE_PIXEL_RATIO=1,t$2.has.CANVAS_LINE_DASH=!0,t$2.structs={},t$2.CollectionEventType={ADD:"add",REMOVE:"remove"},t$2.ObjectEventType={PROPERTYCHANGE:"propertychange"},t$2.events={},t$2.events.bindListener_=function(e){var t=function(t){var i=e.listener,r=e.bindTo||e.target;return e.callOnce&&t$2.events.unlistenByKey(e),i.call(r,t)};return e.boundListener=t,t},t$2.events.findListener_=function(e,t,i,r){for(var n,o=0,a=e.length;o<a;++o)if((n=e[o]).listener===t&&n.bindTo===i)return r&&(n.deleteIndex=o),n},t$2.events.getListeners=function(e,t){var i=e.ol_lm;return i?i[t]:void 0},t$2.events.getListenerMap_=function(e){var t=e.ol_lm;return t||(t=e.ol_lm={}),t},t$2.events.removeListeners_=function(e,t){var i=t$2.events.getListeners(e,t);if(i){for(var r=0,n=i.length;r<n;++r)e.removeEventListener(t,i[r].boundListener),t$2.obj.clear(i[r]);i.length=0;var o=e.ol_lm;o&&(delete o[t],0===Object.keys(o).length&&delete e.ol_lm)}},t$2.events.listen=function(e,t,i,r,n){var o=t$2.events.getListenerMap_(e),a=o[t];a||(a=o[t]=[]);var s=t$2.events.findListener_(a,i,r,!1);return s?n||(s.callOnce=!1):(s={bindTo:r,callOnce:!!n,listener:i,target:e,type:t},e.addEventListener(t,t$2.events.bindListener_(s)),a.push(s)),s},t$2.events.listenOnce=function(e,t,i,r){return t$2.events.listen(e,t,i,r,!0)},t$2.events.unlisten=function(e,t,i,r){var n=t$2.events.getListeners(e,t);if(n){var o=t$2.events.findListener_(n,i,r,!0);o&&t$2.events.unlistenByKey(o)}},t$2.events.unlistenByKey=function(e){if(e&&e.target){e.target.removeEventListener(e.type,e.boundListener);var t=t$2.events.getListeners(e.target,e.type);if(t){var i="deleteIndex"in e?e.deleteIndex:t.indexOf(e);-1!==i&&t.splice(i,1),0===t.length&&t$2.events.removeListeners_(e.target,e.type)}t$2.obj.clear(e)}},t$2.events.unlistenAll=function(e){var t=t$2.events.getListenerMap_(e);for(var i in t)t$2.events.removeListeners_(e,i)},t$2.Disposable=function(){},t$2.Disposable.prototype.disposed_=!1,t$2.Disposable.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},t$2.Disposable.prototype.disposeInternal=t$2.nullFunction,t$2.events.Event={},t$2.events.Event=function(e){this.propagationStopped,this.type=e,this.target=null},t$2.events.Event.prototype.preventDefault=t$2.events.Event.prototype.stopPropagation=function(){this.propagationStopped=!0},t$2.events.Event.stopPropagation=function(e){e.stopPropagation()},t$2.events.Event.preventDefault=function(e){e.preventDefault()},t$2.events.EventTarget={},t$2.events.EventTarget=function(){t$2.Disposable.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}},t$2.inherits(t$2.events.EventTarget,t$2.Disposable),t$2.events.EventTarget.prototype.addEventListener=function(e,t){var i=this.listeners_[e];i||(i=this.listeners_[e]=[]),-1===i.indexOf(t)&&i.push(t)},t$2.events.EventTarget.prototype.dispatchEvent=function(e){var t="string"==typeof e?new t$2.events.Event(e):e,i=t.type;t.target=this;var r,n=this.listeners_[i];if(n){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var o=0,a=n.length;o<a;++o)if(!1===n[o].call(this,t)||t.propagationStopped){r=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var s=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];s--;)this.removeEventListener(i,t$2.nullFunction);delete this.dispatching_[i]}return r}},t$2.events.EventTarget.prototype.disposeInternal=function(){t$2.events.unlistenAll(this)},t$2.events.EventTarget.prototype.getListeners=function(e){return this.listeners_[e]},t$2.events.EventTarget.prototype.hasListener=function(e){return e?e in this.listeners_:Object.keys(this.listeners_).length>0},t$2.events.EventTarget.prototype.removeEventListener=function(e,t){var i=this.listeners_[e];if(i){var r=i.indexOf(t);e in this.pendingRemovals_?(i[r]=t$2.nullFunction,++this.pendingRemovals_[e]):(i.splice(r,1),0===i.length&&delete this.listeners_[e])}},t$2.events.EventType={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"},t$2.Observable=function(){this.revision_=0},t$2.inherits(t$2.Observable,t$2.events.EventTarget),t$2.Observable.unByKey=function(e){if(Array.isArray(e))for(var t=0,i=e.length;t<i;++t)t$2.events.unlistenByKey(e[t]);else t$2.events.unlistenByKey(e)},t$2.Observable.prototype.changed=function(){++this.revision_},t$2.Observable.prototype.dispatchEvent,t$2.Observable.prototype.getRevision=function(){return this.revision_},t$2.Observable.prototype.on=function(e,t,i){if(Array.isArray(e)){for(var r=e.length,n=new Array(r),o=0;o<r;++o)n[o]=t$2.events.listen(this,e[o],t,i);return n}return t$2.events.listen(this,e,t,i)},t$2.Observable.prototype.once=function(e,t,i){if(Array.isArray(e)){for(var r=e.length,n=new Array(r),o=0;o<r;++o)n[o]=t$2.events.listenOnce(this,e[o],t,i);return n}return t$2.events.listenOnce(this,e,t,i)},t$2.Observable.prototype.un=function(e,t,i){if(Array.isArray(e))for(var r=0,n=e.length;r<n;++r)t$2.events.unlisten(this,e[r],t,i);else t$2.events.unlisten(this,e,t,i)},t$2.uidCounter_=0,t$2.Object=function(e){t$2.Observable.call(this),t$2.getUid(this),this.values_={},void 0!==e&&this.setProperties(e)},t$2.inherits(t$2.Object,t$2.Observable),t$2.Object.changeEventTypeCache_={},t$2.Object.getChangeEventType=function(e){return t$2.Object.changeEventTypeCache_.hasOwnProperty(e)?t$2.Object.changeEventTypeCache_[e]:t$2.Object.changeEventTypeCache_[e]="change:"+e},t$2.Object.prototype.get=function(e){var t;return this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t},t$2.Object.prototype.getKeys=function(){return Object.keys(this.values_)},t$2.Object.prototype.getProperties=function(){return t$2.obj.assign({},this.values_)},t$2.Object.prototype.notify=function(e,t){},t$2.Object.prototype.set=function(e,t,i){if(i)this.values_[e]=t;else{var r=this.values_[e];this.values_[e]=t,r!==t&&this.notify(e,r)}},t$2.Object.prototype.setProperties=function(e,t){var i;for(i in e)this.set(i,e[i],t)},t$2.Object.prototype.unset=function(e,t){if(e in this.values_){var i=this.values_[e];delete this.values_[e],t||this.notify(e,i)}},t$2.Object.Event=function(e,t,i){t$2.events.Event.call(this,e),this.key=t,this.oldValue=i},t$2.inherits(t$2.Object.Event,t$2.events.Event),t$2.functions={},t$2.functions.TRUE=function(){return!0},t$2.functions.FALSE=function(){return!1},t$2.math={},t$2.math.clamp=function(e,t,i){return Math.min(Math.max(e,t),i)},t$2.math.cosh=function(){var e;return e="cosh"in Math?Math.cosh:function(e){var t=Math.exp(e);return(t+1/t)/2},e}(),t$2.math.roundUpToPowerOfTwo=function(e){return t$2.asserts.assert(0<e,29),Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},t$2.math.squaredSegmentDistance=function(e,t,i,r,n,o){var a=n-i,s=o-r;if(0!==a||0!==s){var l=((e-i)*a+(t-r)*s)/(a*a+s*s);l>1?(i=n,r=o):l>0&&(i+=a*l,r+=s*l)}return t$2.math.squaredDistance(e,t,i,r)},t$2.math.squaredDistance=function(e,t,i,r){var n=i-e,o=r-t;return n*n+o*o},t$2.math.solveLinearSystem=function(e){for(var t=e.length,i=0;i<t;i++){for(var r=i,n=Math.abs(e[i][i]),o=i+1;o<t;o++){var a=Math.abs(e[o][i]);a>n&&(n=a,r=o)}if(0===n)return null;var s=e[r];e[r]=e[i],e[i]=s;for(var l=i+1;l<t;l++)for(var u=-e[l][i]/e[i][i],c=i;c<t+1;c++)i==c?e[l][c]=0:e[l][c]+=u*e[i][c]}for(var h=new Array(t),d=t-1;d>=0;d--){h[d]=e[d][t]/e[d][d];for(var f=d-1;f>=0;f--)e[f][t]-=e[f][d]*h[d]}return h},t$2.math.toDegrees=function(e){return 180*e/Math.PI},t$2.math.toRadians=function(e){return e*Math.PI/180},t$2.math.modulo=function(e,t){var i=e%t;return i*t<0?i+t:i},t$2.math.lerp=function(e,t,i){return e+i*(t-e)},t$2.ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3},t$2.color={},t$2.color.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i,t$2.color.NAMED_COLOR_RE_=/^([a-z]*)$/i,t$2.color.asArray=function(e){return Array.isArray(e)?e:t$2.color.fromString(e)},t$2.color.asString=function(e){return"string"==typeof e?e:t$2.color.toString(e)},t$2.color.fromNamed=function(e){var t=document.createElement("div");t.style.color=e,document.body.appendChild(t);var i=getComputedStyle(t).color;return document.body.removeChild(t),i},t$2.color.fromString=function(){var e={},t=0;return function(i){var r;if(e.hasOwnProperty(i))r=e[i];else{if(t>=1024){var n,o=0;for(n in e)0==(3&o++)&&(delete e[n],--t)}r=t$2.color.fromStringInternal_(i),e[i]=r,++t}return r}}(),t$2.color.fromStringInternal_=function(e){var t,i,r,n,o,a;if(t$2.color.NAMED_COLOR_RE_.exec(e)&&(e=t$2.color.fromNamed(e)),t$2.color.HEX_COLOR_RE_.exec(e)){var s,l=e.length-1;s=l<=4?1:2;var u=4===l||8===l;t=parseInt(e.substr(1+0*s,s),16),i=parseInt(e.substr(1+1*s,s),16),r=parseInt(e.substr(1+2*s,s),16),n=u?parseInt(e.substr(1+3*s,s),16):255,1==s&&(t=(t<<4)+t,i=(i<<4)+i,r=(r<<4)+r,u&&(n=(n<<4)+n)),o=[t,i,r,n/255]}else 0==e.indexOf("rgba(")?(a=e.slice(5,-1).split(",").map(Number),o=t$2.color.normalize(a)):0==e.indexOf("rgb(")?((a=e.slice(4,-1).split(",").map(Number)).push(1),o=t$2.color.normalize(a)):t$2.asserts.assert(!1,14);return o},t$2.color.normalize=function(e,t){var i=t||[];return i[0]=t$2.math.clamp(e[0]+.5|0,0,255),i[1]=t$2.math.clamp(e[1]+.5|0,0,255),i[2]=t$2.math.clamp(e[2]+.5|0,0,255),i[3]=t$2.math.clamp(e[3],0,1),i},t$2.color.toString=function(e){var t=e[0];t!=(0|t)&&(t=t+.5|0);var i=e[1];i!=(0|i)&&(i=i+.5|0);var r=e[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+t+","+i+","+r+","+(void 0===e[3]?1:e[3])+")"},t$2.colorlike={},t$2.colorlike.asColorLike=function(e){return t$2.colorlike.isColorLike(e)?e:t$2.color.asString(e)},t$2.colorlike.isColorLike=function(e){return"string"==typeof e||e instanceof CanvasPattern||e instanceof CanvasGradient},t$2.css={},t$2.css.CLASS_HIDDEN="ol-hidden",t$2.css.CLASS_SELECTABLE="ol-selectable",t$2.css.CLASS_UNSELECTABLE="ol-unselectable",t$2.css.CLASS_UNSUPPORTED="ol-unsupported",t$2.css.CLASS_CONTROL="ol-control",t$2.css.getFontFamilies=function(){var e,t={};return function(i){if(e||(e=document.createElement("div").style),!(i in t)){e.font=i;var r=e.fontFamily;if(e.font="",!r)return null;t[i]=r.split(/,\s?/)}return t[i]}}(),t$2.dom={},t$2.dom.createCanvasContext2D=function(e,t){return(e&&t?new OffscreenCanvas(e,t):new OffscreenCanvas(1,1)).getContext("2d")},t$2.dom.outerWidth=function(e){var t=e.offsetWidth,i=getComputedStyle(e);return t+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)},t$2.dom.outerHeight=function(e){var t=e.offsetHeight,i=getComputedStyle(e);return t+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)},t$2.dom.replaceNode=function(e,t){var i=t.parentNode;i&&i.replaceChild(e,t)},t$2.dom.removeNode=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},t$2.dom.removeChildren=function(e){for(;e.lastChild;)e.removeChild(e.lastChild)},t$2.extent={},t$2.extent.Corner={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},t$2.extent.Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16},t$2.extent.boundingExtent=function(e){for(var t=t$2.extent.createEmpty(),i=0,r=e.length;i<r;++i)t$2.extent.extendCoordinate(t,e[i]);return t},t$2.extent.boundingExtentXYs_=function(e,t,i){var r=Math.min.apply(null,e),n=Math.min.apply(null,t),o=Math.max.apply(null,e),a=Math.max.apply(null,t);return t$2.extent.createOrUpdate(r,n,o,a,i)},t$2.extent.buffer=function(e,t,i){return i?(i[0]=e[0]-t,i[1]=e[1]-t,i[2]=e[2]+t,i[3]=e[3]+t,i):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]},t$2.extent.clone=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()},t$2.extent.closestSquaredDistanceXY=function(e,t,i){var r,n;return(r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0)*r+(n=i<e[1]?e[1]-i:e[3]<i?i-e[3]:0)*n},t$2.extent.containsCoordinate=function(e,t){return t$2.extent.containsXY(e,t[0],t[1])},t$2.extent.containsExtent=function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]},t$2.extent.containsXY=function(e,t,i){return e[0]<=t&&t<=e[2]&&e[1]<=i&&i<=e[3]},t$2.extent.coordinateRelationship=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=t[0],s=t[1],l=t$2.extent.Relationship.UNKNOWN;return a<i?l|=t$2.extent.Relationship.LEFT:a>n&&(l|=t$2.extent.Relationship.RIGHT),s<r?l|=t$2.extent.Relationship.BELOW:s>o&&(l|=t$2.extent.Relationship.ABOVE),l===t$2.extent.Relationship.UNKNOWN&&(l=t$2.extent.Relationship.INTERSECTING),l},t$2.extent.createEmpty=function(){return[1/0,1/0,-1/0,-1/0]},t$2.extent.createOrUpdate=function(e,t,i,r,n){return n?(n[0]=e,n[1]=t,n[2]=i,n[3]=r,n):[e,t,i,r]},t$2.extent.createOrUpdateEmpty=function(e){return t$2.extent.createOrUpdate(1/0,1/0,-1/0,-1/0,e)},t$2.extent.createOrUpdateFromCoordinate=function(e,t){var i=e[0],r=e[1];return t$2.extent.createOrUpdate(i,r,i,r,t)},t$2.extent.createOrUpdateFromCoordinates=function(e,t){var i=t$2.extent.createOrUpdateEmpty(t);return t$2.extent.extendCoordinates(i,e)},t$2.extent.createOrUpdateFromFlatCoordinates=function(e,t,i,r,n){var o=t$2.extent.createOrUpdateEmpty(n);return t$2.extent.extendFlatCoordinates(o,e,t,i,r)},t$2.extent.createOrUpdateFromRings=function(e,t){var i=t$2.extent.createOrUpdateEmpty(t);return t$2.extent.extendRings(i,e)},t$2.extent.equals=function(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]},t$2.extent.extend=function(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e},t$2.extent.extendCoordinate=function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])},t$2.extent.extendCoordinates=function(e,t){var i,r;for(i=0,r=t.length;i<r;++i)t$2.extent.extendCoordinate(e,t[i]);return e},t$2.extent.extendFlatCoordinates=function(e,t,i,r,n){for(;i<r;i+=n)t$2.extent.extendXY(e,t[i],t[i+1]);return e},t$2.extent.extendRings=function(e,t){var i,r;for(i=0,r=t.length;i<r;++i)t$2.extent.extendCoordinates(e,t[i]);return e},t$2.extent.extendXY=function(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)},t$2.extent.forEachCorner=function(e,t,i){var r;return!!((r=t.call(i,t$2.extent.getBottomLeft(e)))||(r=t.call(i,t$2.extent.getBottomRight(e)),r)||(r=t.call(i,t$2.extent.getTopRight(e)),r)||(r=t.call(i,t$2.extent.getTopLeft(e)),r))&&r},t$2.extent.getArea=function(e){var t=0;return t$2.extent.isEmpty(e)||(t=t$2.extent.getWidth(e)*t$2.extent.getHeight(e)),t},t$2.extent.getBottomLeft=function(e){return[e[0],e[1]]},t$2.extent.getBottomRight=function(e){return[e[2],e[1]]},t$2.extent.getCenter=function(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]},t$2.extent.getCorner=function(e,t){var i;return t===t$2.extent.Corner.BOTTOM_LEFT?i=t$2.extent.getBottomLeft(e):t===t$2.extent.Corner.BOTTOM_RIGHT?i=t$2.extent.getBottomRight(e):t===t$2.extent.Corner.TOP_LEFT?i=t$2.extent.getTopLeft(e):t===t$2.extent.Corner.TOP_RIGHT?i=t$2.extent.getTopRight(e):t$2.asserts.assert(!1,13),i},t$2.extent.getEnlargedArea=function(e,t){var i=Math.min(e[0],t[0]),r=Math.min(e[1],t[1]);return(Math.max(e[2],t[2])-i)*(Math.max(e[3],t[3])-r)},t$2.extent.getForViewAndSize=function(e,t,i,r,n){var o=t*r[0]/2,a=t*r[1]/2,s=Math.cos(i),l=Math.sin(i),u=o*s,c=o*l,h=a*s,d=a*l,f=e[0],p=e[1],_=f-u+d,m=f-u-d,$=f+u-d,g=f+u+d,v=p-c-h,y=p-c+h,x=p+c+h,b=p+c-h;return t$2.extent.createOrUpdate(Math.min(_,m,$,g),Math.min(v,y,x,b),Math.max(_,m,$,g),Math.max(v,y,x,b),n)},t$2.extent.getHeight=function(e){return e[3]-e[1]},t$2.extent.getIntersectionArea=function(e,t){var i=t$2.extent.getIntersection(e,t);return t$2.extent.getArea(i)},t$2.extent.getIntersection=function(e,t,i){var r=i||t$2.extent.createEmpty();return t$2.extent.intersects(e,t)&&(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]),r},t$2.extent.getMargin=function(e){return t$2.extent.getWidth(e)+t$2.extent.getHeight(e)},t$2.extent.getSize=function(e){return[e[2]-e[0],e[3]-e[1]]},t$2.extent.getTopLeft=function(e){return[e[0],e[3]]},t$2.extent.getTopRight=function(e){return[e[2],e[3]]},t$2.extent.getWidth=function(e){return e[2]-e[0]},t$2.extent.intersects=function(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]},t$2.extent.isEmpty=function(e){return e[2]<e[0]||e[3]<e[1]},t$2.extent.returnOrUpdate=function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e},t$2.extent.scaleFromCenter=function(e,t){var i=(e[2]-e[0])/2*(t-1),r=(e[3]-e[1])/2*(t-1);e[0]-=i,e[2]+=i,e[1]-=r,e[3]+=r},t$2.extent.intersectsSegment=function(e,t,i){var r=!1,n=t$2.extent.coordinateRelationship(e,t),o=t$2.extent.coordinateRelationship(e,i);if(n===t$2.extent.Relationship.INTERSECTING||o===t$2.extent.Relationship.INTERSECTING)r=!0;else{var a,s,l=e[0],u=e[1],c=e[2],h=e[3],d=t[0],f=t[1],p=i[0],_=i[1],m=(_-f)/(p-d);!!(o&t$2.extent.Relationship.ABOVE)&&!(n&t$2.extent.Relationship.ABOVE)&&(r=(a=p-(_-h)/m)>=l&&a<=c),!r&&!!(o&t$2.extent.Relationship.RIGHT)&&!(n&t$2.extent.Relationship.RIGHT)&&(r=(s=_-(p-c)*m)>=u&&s<=h),!r&&!!(o&t$2.extent.Relationship.BELOW)&&!(n&t$2.extent.Relationship.BELOW)&&(r=(a=p-(_-u)/m)>=l&&a<=c),!r&&o&t$2.extent.Relationship.LEFT&&!(n&t$2.extent.Relationship.LEFT)&&(r=(s=_-(p-l)*m)>=u&&s<=h)}return r},t$2.extent.applyTransform=function(e,t,i){var r=[e[0],e[1],e[0],e[3],e[2],e[1],e[2],e[3]];t(r,r,2);var n=[r[0],r[2],r[4],r[6]],o=[r[1],r[3],r[5],r[7]];return t$2.extent.boundingExtentXYs_(n,o,i)},t$2.obj={},t$2.obj.assign="function"==typeof Object.assign?Object.assign:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),r=1,n=arguments.length;r<n;++r){var o=arguments[r];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(i[a]=o[a])}return i},t$2.obj.clear=function(e){for(var t in e)delete e[t]},t$2.obj.getValues=function(e){var t=[];for(var i in e)t.push(e[i]);return t},t$2.obj.isEmpty=function(e){var t;for(t in e)return!1;return!t},t$2.transform={},t$2.transform.tmp_=new Array(6),t$2.transform.create=function(){return[1,0,0,1,0,0]},t$2.transform.reset=function(e){return t$2.transform.set(e,1,0,0,1,0,0)},t$2.transform.multiply=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=t[0],u=t[1],c=t[2],h=t[3],d=t[4],f=t[5];return e[0]=i*l+n*u,e[1]=r*l+o*u,e[2]=i*c+n*h,e[3]=r*c+o*h,e[4]=i*d+n*f+a,e[5]=r*d+o*f+s,e},t$2.transform.set=function(e,t,i,r,n,o,a){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e},t$2.transform.setFromArray=function(e,t){return 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},t$2.transform.apply=function(e,t){var i=t[0],r=t[1];return t[0]=e[0]*i+e[2]*r+e[4],t[1]=e[1]*i+e[3]*r+e[5],t},t$2.transform.rotate=function(e,t){var i=Math.cos(t),r=Math.sin(t);return t$2.transform.multiply(e,t$2.transform.set(t$2.transform.tmp_,i,r,-r,i,0,0))},t$2.transform.scale=function(e,t,i){return t$2.transform.multiply(e,t$2.transform.set(t$2.transform.tmp_,t,0,0,i,0,0))},t$2.transform.translate=function(e,t,i){return t$2.transform.multiply(e,t$2.transform.set(t$2.transform.tmp_,1,0,0,1,t,i))},t$2.transform.compose=function(e,t,i,r,n,o,a,s){var l=Math.sin(o),u=Math.cos(o);return e[0]=r*u,e[1]=n*l,e[2]=-r*l,e[3]=n*u,e[4]=a*r*u-s*r*l+t,e[5]=a*n*l+s*n*u+i,e},t$2.transform.invert=function(e){var t=t$2.transform.determinant(e),i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5];return e[0]=o/t,e[1]=-r/t,e[2]=-n/t,e[3]=i/t,e[4]=(n*s-o*a)/t,e[5]=-(i*s-r*a)/t,e},t$2.transform.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},t$2.geom={},t$2.geom.flat={},t$2.geom.flat.center={},t$2.geom.flat.reverse={},t$2.geom.flat.orient={},t$2.geom.flat.transform={},t$2.geom.flat.transform.transform2D=function(e,t,i,r,n,o){var a,s=o||[],l=0;for(a=t;a<i;a+=r){var u=e[a],c=e[a+1];s[l++]=n[0]*u+n[2]*c+n[4],s[l++]=n[1]*u+n[3]*c+n[5]}return o&&s.length!=l&&(s.length=l),s},t$2.geom.flat.transform.rotate=function(e,t,i,r,n,o,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),c=o[0],h=o[1],d=0,f=t;f<i;f+=r){var p=e[f]-c,_=e[f+1]-h;s[d++]=c+p*l-_*u,s[d++]=h+p*u+_*l;for(var m=f+2;m<f+r;++m)s[d++]=e[m]}return a&&s.length!=d&&(s.length=d),s},t$2.geom.flat.transform.scale=function(e,t,i,r,n,o,a,s){for(var l=s||[],u=a[0],c=a[1],h=0,d=t;d<i;d+=r){var f=e[d]-u,p=e[d+1]-c;l[h++]=u+n*f,l[h++]=c+o*p;for(var _=d+2;_<d+r;++_)l[h++]=e[_]}return s&&l.length!=h&&(l.length=h),l},t$2.geom.GeometryLayout={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},t$2.geom.flat.reverse.coordinates=function(e,t,i,r){for(;t<i-r;){var n;for(n=0;n<r;++n){var o=e[t+n];e[t+n]=e[i-r+n],e[i-r+n]=o}t+=r,i-=r}},t$2.geom.flat.orient.linearRingIsClockwise=function(e,t,i,r){for(var n=0,o=e[i-r],a=e[i-r+1];t<i;t+=r){var s=e[t],l=e[t+1];n+=(s-o)*(l+a),o=s,a=l}return n>0},t$2.geom.flat.orient.linearRingsAreOriented=function(e,t,i,r,n){var o,a,s=void 0!==n&&n;for(o=0,a=i.length;o<a;++o){var l=i[o],u=t$2.geom.flat.orient.linearRingIsClockwise(e,t,l,r);if(0===o){if(s&&u||!s&&!u)return!1}else if(s&&!u||!s&&u)return!1;t=l}return!0},t$2.geom.flat.orient.linearRingssAreOriented=function(e,t,i,r,n){var o,a;for(o=0,a=i.length;o<a;++o)if(!t$2.geom.flat.orient.linearRingsAreOriented(e,t,i[o],r,n))return!1;return!0},t$2.geom.flat.orient.orientLinearRings=function(e,t,i,r,n){var o,a,s=void 0!==n&&n;for(o=0,a=i.length;o<a;++o){var l=i[o],u=t$2.geom.flat.orient.linearRingIsClockwise(e,t,l,r);(0===o?s&&u||!s&&!u:s&&!u||!s&&u)&&t$2.geom.flat.reverse.coordinates(e,t,l,r),t=l}return t},t$2.geom.flat.orient.orientLinearRingss=function(e,t,i,r,n){var o,a;for(o=0,a=i.length;o<a;++o)t=t$2.geom.flat.orient.orientLinearRings(e,t,i[o],r,n);return t},t$2.geom.flat.simplify={},t$2.geom.flat.simplify.lineString=function(e,t,i,r,n,o,a){var s=void 0!==a?a:[];return o||(i=t$2.geom.flat.simplify.radialDistance(e,t,i,r,n,s,0),e=s,t=0,r=2),s.length=t$2.geom.flat.simplify.douglasPeucker(e,t,i,r,n,s,0),s},t$2.geom.flat.simplify.douglasPeucker=function(e,t,i,r,n,o,a){var s=(i-t)/r;if(s<3){for(;t<i;t+=r)o[a++]=e[t],o[a++]=e[t+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u,c=[t,i-r],h=0;c.length>0;){var d=c.pop(),f=c.pop(),p=0,_=e[f],m=e[f+1],$=e[d],g=e[d+1];for(u=f+r;u<d;u+=r){var v=e[u],y=e[u+1],x=t$2.math.squaredSegmentDistance(v,y,_,m,$,g);x>p&&(h=u,p=x)}p>n&&(l[(h-t)/r]=1,f+r<h&&c.push(f,h),h+r<d&&c.push(h,d))}for(u=0;u<s;++u)l[u]&&(o[a++]=e[t+u*r],o[a++]=e[t+u*r+1]);return a},t$2.geom.flat.simplify.douglasPeuckers=function(e,t,i,r,n,o,a,s){var l,u;for(l=0,u=i.length;l<u;++l){var c=i[l];a=t$2.geom.flat.simplify.douglasPeucker(e,t,c,r,n,o,a),s.push(a),t=c}return a},t$2.geom.flat.simplify.douglasPeuckerss=function(e,t,i,r,n,o,a,s){var l,u;for(l=0,u=i.length;l<u;++l){var c=i[l],h=[];a=t$2.geom.flat.simplify.douglasPeuckers(e,t,c,r,n,o,a,h),s.push(h),t=c[c.length-1]}return a},t$2.geom.flat.simplify.radialDistance=function(e,t,i,r,n,o,a){if(i<=t+r){for(;t<i;t+=r)o[a++]=e[t],o[a++]=e[t+1];return a}var s=e[t],l=e[t+1];o[a++]=s,o[a++]=l;var u=s,c=l;for(t+=r;t<i;t+=r)u=e[t],c=e[t+1],t$2.math.squaredDistance(s,l,u,c)>n&&(o[a++]=u,o[a++]=c,s=u,l=c);return(u!=s||c!=l)&&(o[a++]=u,o[a++]=c),a},t$2.geom.flat.simplify.snap=function(e,t){return t*Math.round(e/t)},t$2.geom.flat.simplify.quantize=function(e,t,i,r,n,o,a){if(t==i)return a;var s,l,u=t$2.geom.flat.simplify.snap(e[t],n),c=t$2.geom.flat.simplify.snap(e[t+1],n);t+=r,o[a++]=u,o[a++]=c;do{if(s=t$2.geom.flat.simplify.snap(e[t],n),l=t$2.geom.flat.simplify.snap(e[t+1],n),(t+=r)==i)return o[a++]=s,o[a++]=l,a}while(s==u&&l==c);for(;t<i;){var h,d;if(h=t$2.geom.flat.simplify.snap(e[t],n),d=t$2.geom.flat.simplify.snap(e[t+1],n),t+=r,h!=s||d!=l){var f=s-u,p=l-c,_=h-u,m=d-c;if(f*m==p*_&&(f<0&&_<f||f==_||f>0&&_>f)&&(p<0&&m<p||p==m||p>0&&m>p)){s=h,l=d;continue}o[a++]=s,o[a++]=l,u=s,c=l,s=h,l=d}}return o[a++]=s,o[a++]=l,a},t$2.geom.flat.simplify.quantizes=function(e,t,i,r,n,o,a,s){var l,u;for(l=0,u=i.length;l<u;++l){var c=i[l];a=t$2.geom.flat.simplify.quantize(e,t,c,r,n,o,a),s.push(a),t=c}return a},t$2.geom.flat.simplify.quantizess=function(e,t,i,r,n,o,a,s){var l,u;for(l=0,u=i.length;l<u;++l){var c=i[l],h=[];a=t$2.geom.flat.simplify.quantizes(e,t,c,r,n,o,a,h),s.push(h),t=c[c.length-1]}return a},t$2.geom.GeometryType={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"},t$2.geom.Geometry=function(){t$2.Object.call(this),this.extent_=t$2.extent.createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.tmpTransform_=t$2.transform.create()},t$2.inherits(t$2.geom.Geometry,t$2.Object),t$2.geom.Geometry.prototype.clone=function(){},t$2.geom.Geometry.prototype.closestPointXY=function(e,t,i,r){},t$2.geom.Geometry.prototype.getClosestPoint=function(e,t){var i=t||[NaN,NaN];return this.closestPointXY(e[0],e[1],i,1/0),i},t$2.geom.Geometry.prototype.intersectsCoordinate=function(e){return this.containsXY(e[0],e[1])},t$2.geom.Geometry.prototype.computeExtent=function(e){},t$2.geom.Geometry.prototype.containsXY=t$2.functions.FALSE,t$2.geom.Geometry.prototype.getExtent=function(e){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),t$2.extent.returnOrUpdate(this.extent_,e)},t$2.geom.Geometry.prototype.rotate=function(e,t){},t$2.geom.Geometry.prototype.scale=function(e,t,i){},t$2.geom.Geometry.prototype.simplify=function(e){return this.getSimplifiedGeometry(e*e)},t$2.geom.Geometry.prototype.getSimplifiedGeometry=function(e){},t$2.geom.Geometry.prototype.getType=function(){},t$2.geom.Geometry.prototype.applyTransform=function(e){},t$2.geom.Geometry.prototype.intersectsExtent=function(e){},t$2.geom.Geometry.prototype.translate=function(e,t){},t$2.geom.Geometry.prototype.transform=function(e,t){var i=this.tmpTransform_,r=(e=t$2.proj.get(e)).getUnits()==t$2.proj.Units.TILE_PIXELS?function(r,n,o){var a=e.getExtent(),s=e.getWorldExtent(),l=t$2.extent.getHeight(s)/t$2.extent.getHeight(a);return t$2.transform.compose(i,s[0],s[3],l,-l,0,0,0),t$2.geom.flat.transform.transform2D(r,0,r.length,o,i,n),t$2.proj.getTransform(e,t)(r,n,o)}:t$2.proj.getTransform(e,t);return this.applyTransform(r),this},t$2.geom.SimpleGeometry=function(){t$2.geom.Geometry.call(this),this.layout=t$2.geom.GeometryLayout.XY,this.stride=2,this.flatCoordinates=null},t$2.inherits(t$2.geom.SimpleGeometry,t$2.geom.Geometry),t$2.geom.SimpleGeometry.getLayoutForStride_=function(e){var t;return 2==e?t=t$2.geom.GeometryLayout.XY:3==e?t=t$2.geom.GeometryLayout.XYZ:4==e&&(t=t$2.geom.GeometryLayout.XYZM),t},t$2.geom.SimpleGeometry.getStrideForLayout=function(e){var t;return e==t$2.geom.GeometryLayout.XY?t=2:e==t$2.geom.GeometryLayout.XYZ||e==t$2.geom.GeometryLayout.XYM?t=3:e==t$2.geom.GeometryLayout.XYZM&&(t=4),t},t$2.geom.SimpleGeometry.prototype.containsXY=t$2.functions.FALSE,t$2.geom.SimpleGeometry.prototype.computeExtent=function(e){return t$2.extent.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t$2.geom.SimpleGeometry.prototype.getCoordinates=function(){},t$2.geom.SimpleGeometry.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},t$2.geom.SimpleGeometry.prototype.getFlatCoordinates=function(){return this.flatCoordinates},t$2.geom.SimpleGeometry.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},t$2.geom.SimpleGeometry.prototype.getLayout=function(){return this.layout},t$2.geom.SimpleGeometry.prototype.getSimplifiedGeometry=function(e){if(this.simplifiedGeometryRevision!=this.getRevision()&&(t$2.obj.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var t=e.toString();if(this.simplifiedGeometryCache.hasOwnProperty(t))return this.simplifiedGeometryCache[t];var i=this.getSimplifiedGeometryInternal(e);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[t]=i,i):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)},t$2.geom.SimpleGeometry.prototype.getSimplifiedGeometryInternal=function(e){return this},t$2.geom.SimpleGeometry.prototype.getStride=function(){return this.stride},t$2.geom.SimpleGeometry.prototype.setFlatCoordinatesInternal=function(e,t){this.stride=t$2.geom.SimpleGeometry.getStrideForLayout(e),this.layout=e,this.flatCoordinates=t},t$2.geom.SimpleGeometry.prototype.setCoordinates=function(e,t){},t$2.geom.SimpleGeometry.prototype.setLayout=function(e,t,i){var r;if(e)r=t$2.geom.SimpleGeometry.getStrideForLayout(e);else{var n;for(n=0;n<i;++n){if(0===t.length)return this.layout=t$2.geom.GeometryLayout.XY,void(this.stride=2);t=t[0]}r=t.length,e=t$2.geom.SimpleGeometry.getLayoutForStride_(r)}this.layout=e,this.stride=r},t$2.geom.SimpleGeometry.prototype.applyTransform=function(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},t$2.geom.SimpleGeometry.prototype.rotate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();t$2.geom.flat.transform.rotate(i,0,i.length,r,e,t,i),this.changed()}},t$2.geom.SimpleGeometry.prototype.scale=function(e,t,i){var r=t;void 0===r&&(r=e);var n=i;n||(n=t$2.extent.getCenter(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();t$2.geom.flat.transform.scale(o,0,o.length,a,e,r,n,o),this.changed()}},t$2.geom.SimpleGeometry.prototype.translate=function(e,t){var i=this.getFlatCoordinates();if(i){var r=this.getStride();t$2.geom.flat.transform.translate(i,0,i.length,r,e,t,i),this.changed()}},t$2.geom.SimpleGeometry.transform2D=function(e,t,i){var r=e.getFlatCoordinates();if(r){var n=e.getStride();return t$2.geom.flat.transform.transform2D(r,0,r.length,n,t,i)}return null},t$2.geom.Polygon=function(e,t){t$2.geom.SimpleGeometry.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(e,t)},t$2.inherits(t$2.geom.Polygon,t$2.geom.SimpleGeometry),t$2.geom.Polygon.prototype.appendLinearRing=function(e){this.flatCoordinates?t$2.array.extend(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t$2.geom.Polygon.prototype.clone=function(){var e=new t$2.geom.Polygon(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),e},t$2.geom.Polygon.prototype.closestPointXY=function(e,t,i,r){return r<t$2.extent.closestSquaredDistanceXY(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(t$2.geom.flat.closest.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),t$2.geom.flat.closest.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,i,r))},t$2.geom.Polygon.prototype.containsXY=function(e,t){return t$2.geom.flat.contains.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)},t$2.geom.Polygon.prototype.getArea=function(){return t$2.geom.flat.area.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},t$2.geom.Polygon.prototype.getCoordinates=function(e){var t;return void 0!==e?(t=this.getOrientedFlatCoordinates().slice(),t$2.geom.flat.orient.orientLinearRings(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,t$2.geom.flat.inflate.coordinatess(t,0,this.ends_,this.stride)},t$2.geom.Polygon.prototype.getEnds=function(){return this.ends_},t$2.geom.Polygon.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var e=t$2.extent.getCenter(this.getExtent());this.flatInteriorPoint_=t$2.geom.flat.interiorpoint.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},t$2.geom.Polygon.prototype.getInteriorPoint=function(){return new t$2.geom.Point(this.getFlatInteriorPoint(),t$2.geom.GeometryLayout.XYM)},t$2.geom.Polygon.prototype.getLinearRingCount=function(){return this.ends_.length},t$2.geom.Polygon.prototype.getLinearRing=function(e){if(e<0||this.ends_.length<=e)return null;var t=new t$2.geom.LinearRing(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e])),t},t$2.geom.Polygon.prototype.getLinearRings=function(){var e,t,i=this.layout,r=this.flatCoordinates,n=this.ends_,o=[],a=0;for(e=0,t=n.length;e<t;++e){var s=n[e],l=new t$2.geom.LinearRing(null);l.setFlatCoordinates(i,r.slice(a,s)),o.push(l),a=s}return o},t$2.geom.Polygon.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;t$2.geom.flat.orient.linearRingsAreOriented(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=t$2.geom.flat.orient.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t$2.geom.Polygon.prototype.getSimplifiedGeometryInternal=function(e){var t=[],i=[];t.length=t$2.geom.flat.simplify.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),t,0,i);var r=new t$2.geom.Polygon(null);return r.setFlatCoordinates(t$2.geom.GeometryLayout.XY,t,i),r},t$2.geom.Polygon.prototype.getType=function(){return t$2.geom.GeometryType.POLYGON},t$2.geom.Polygon.prototype.intersectsExtent=function(e){return t$2.geom.flat.intersectsextent.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)},t$2.geom.Polygon.prototype.setCoordinates=function(e,t){if(e){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=t$2.geom.flat.deflate.coordinatess(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1]}else this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null,this.ends_)},t$2.geom.Polygon.prototype.setFlatCoordinates=function(e,t,i){this.setFlatCoordinatesInternal(e,t),this.ends_=i},t$2.geom.Polygon.circular=function(e,t,i,r){var n,o=r||32,a=[];for(n=0;n<o;++n)t$2.array.extend(a,e.offset(t,i,2*Math.PI*n/o));a.push(a[0],a[1]);var s=new t$2.geom.Polygon(null);return s.setFlatCoordinates(t$2.geom.GeometryLayout.XY,a,[a.length]),s},t$2.geom.Polygon.fromExtent=function(e){var t=e[0],i=e[1],r=e[2],n=e[3],o=[t,i,t,n,r,n,r,i,t,i],a=new t$2.geom.Polygon(null);return a.setFlatCoordinates(t$2.geom.GeometryLayout.XY,o,[o.length]),a},t$2.geom.Polygon.fromCircle=function(e,t,i){for(var r=t||32,n=e.getStride(),o=e.getLayout(),a=new t$2.geom.Polygon(null,o),s=n*(r+1),l=new Array(s),u=0;u<s;u++)l[u]=0;var c=[l.length];return a.setFlatCoordinates(o,l,c),t$2.geom.Polygon.makeRegular(a,e.getCenter(),e.getRadius(),i),a},t$2.geom.Polygon.makeRegular=function(e,t,i,r){for(var n,o,a=e.getFlatCoordinates(),s=e.getLayout(),l=e.getStride(),u=e.getEnds(),c=a.length/l-1,h=r||0,d=0;d<=c;++d)o=d*l,n=h+2*t$2.math.modulo(d,c)*Math.PI/c,a[o]=t[0]+i*Math.cos(n),a[o+1]=t[1]+i*Math.sin(n);e.setFlatCoordinates(s,a,u)},t$2.geom.LineString=function(e,t){t$2.geom.SimpleGeometry.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(e,t)},t$2.inherits(t$2.geom.LineString,t$2.geom.SimpleGeometry),t$2.geom.LineString.prototype.appendCoordinate=function(e){this.flatCoordinates?t$2.array.extend(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()},t$2.geom.LineString.prototype.clone=function(){var e=new t$2.geom.LineString(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),e},t$2.geom.LineString.prototype.closestPointXY=function(e,t,i,r){return r<t$2.extent.closestSquaredDistanceXY(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(t$2.geom.flat.closest.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),t$2.geom.flat.closest.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,i,r))},t$2.geom.LineString.prototype.forEachSegment=function(e,t){return t$2.geom.flat.segments.forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t$2.geom.LineString.prototype.getCoordinateAtM=function(e,t){if(this.layout!=t$2.geom.GeometryLayout.XYM&&this.layout!=t$2.geom.GeometryLayout.XYZM)return null;var i=void 0!==t&&t;return t$2.geom.flat.interpolate.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,i)},t$2.geom.LineString.prototype.getCoordinates=function(){return t$2.geom.flat.inflate.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t$2.geom.LineString.prototype.getCoordinateAt=function(e,t){return t$2.geom.flat.interpolate.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t)},t$2.geom.LineString.prototype.getLength=function(){return t$2.geom.flat.length.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t$2.geom.LineString.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},t$2.geom.LineString.prototype.getSimplifiedGeometryInternal=function(e){var t=[];t.length=t$2.geom.flat.simplify.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,0);var i=new t$2.geom.LineString(null);return i.setFlatCoordinates(t$2.geom.GeometryLayout.XY,t),i},t$2.geom.LineString.prototype.getType=function(){return t$2.geom.GeometryType.LINE_STRING},t$2.geom.LineString.prototype.intersectsExtent=function(e){return t$2.geom.flat.intersectsextent.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)},t$2.geom.LineString.prototype.setCoordinates=function(e,t){e?(this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=t$2.geom.flat.deflate.coordinates(this.flatCoordinates,0,e,this.stride),this.changed()):this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null)},t$2.geom.LineString.prototype.setFlatCoordinates=function(e,t){this.setFlatCoordinatesInternal(e,t),this.changed()},t$2.geom.Point=function(e,t){t$2.geom.SimpleGeometry.call(this),this.setCoordinates(e,t)},t$2.inherits(t$2.geom.Point,t$2.geom.SimpleGeometry),t$2.geom.Point.prototype.clone=function(){var e=new t$2.geom.Point(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),e},t$2.geom.Point.prototype.closestPointXY=function(e,t,i,r){var n=this.flatCoordinates,o=t$2.math.squaredDistance(e,t,n[0],n[1]);if(o<r){var a,s=this.stride;for(a=0;a<s;++a)i[a]=n[a];return i.length=s,o}return r},t$2.geom.Point.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},t$2.geom.Point.prototype.computeExtent=function(e){return t$2.extent.createOrUpdateFromCoordinate(this.flatCoordinates,e)},t$2.geom.Point.prototype.getType=function(){return t$2.geom.GeometryType.POINT},t$2.geom.Point.prototype.intersectsExtent=function(e){return t$2.extent.containsXY(e,this.flatCoordinates[0],this.flatCoordinates[1])},t$2.geom.Point.prototype.setCoordinates=function(e,t){e?(this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=t$2.geom.flat.deflate.coordinate(this.flatCoordinates,0,e,this.stride),this.changed()):this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null)},t$2.geom.Point.prototype.setFlatCoordinates=function(e,t){this.setFlatCoordinatesInternal(e,t),this.changed()},t$2.geom.MultiLineString=function(e,t){t$2.geom.SimpleGeometry.call(this),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(e,t)},t$2.inherits(t$2.geom.MultiLineString,t$2.geom.SimpleGeometry),t$2.geom.MultiLineString.prototype.appendLineString=function(e){this.flatCoordinates?t$2.array.extend(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},t$2.geom.MultiLineString.prototype.clone=function(){var e=new t$2.geom.MultiLineString(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),e},t$2.geom.MultiLineString.prototype.closestPointXY=function(e,t,i,r){return r<t$2.extent.closestSquaredDistanceXY(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(t$2.geom.flat.closest.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),t$2.geom.flat.closest.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,i,r))},t$2.geom.MultiLineString.prototype.getCoordinateAtM=function(e,t,i){if(this.layout!=t$2.geom.GeometryLayout.XYM&&this.layout!=t$2.geom.GeometryLayout.XYZM||0===this.flatCoordinates.length)return null;var r=void 0!==t&&t,n=void 0!==i&&i;return t$2.geom.flat.interpolate.lineStringsCoordinateAtM(this.flatCoordinates,0,this.ends_,this.stride,e,r,n)},t$2.geom.MultiLineString.prototype.getCoordinates=function(){return t$2.geom.flat.inflate.coordinatess(this.flatCoordinates,0,this.ends_,this.stride)},t$2.geom.MultiLineString.prototype.getEnds=function(){return this.ends_},t$2.geom.MultiLineString.prototype.getLineString=function(e){if(e<0||this.ends_.length<=e)return null;var t=new t$2.geom.LineString(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e])),t},t$2.geom.MultiLineString.prototype.getLineStrings=function(){var e,t,i=this.flatCoordinates,r=this.ends_,n=this.layout,o=[],a=0;for(e=0,t=r.length;e<t;++e){var s=r[e],l=new t$2.geom.LineString(null);l.setFlatCoordinates(n,i.slice(a,s)),o.push(l),a=s}return o},t$2.geom.MultiLineString.prototype.getFlatMidpoints=function(){var e,t,i=[],r=this.flatCoordinates,n=0,o=this.ends_,a=this.stride;for(e=0,t=o.length;e<t;++e){var s=o[e],l=t$2.geom.flat.interpolate.lineString(r,n,s,a,.5);t$2.array.extend(i,l),n=s}return i},t$2.geom.MultiLineString.prototype.getSimplifiedGeometryInternal=function(e){var t=[],i=[];t.length=t$2.geom.flat.simplify.douglasPeuckers(this.flatCoordinates,0,this.ends_,this.stride,e,t,0,i);var r=new t$2.geom.MultiLineString(null);return r.setFlatCoordinates(t$2.geom.GeometryLayout.XY,t,i),r},t$2.geom.MultiLineString.prototype.getType=function(){return t$2.geom.GeometryType.MULTI_LINE_STRING},t$2.geom.MultiLineString.prototype.intersectsExtent=function(e){return t$2.geom.flat.intersectsextent.lineStrings(this.flatCoordinates,0,this.ends_,this.stride,e)},t$2.geom.MultiLineString.prototype.setCoordinates=function(e,t){if(e){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=t$2.geom.flat.deflate.coordinatess(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}else this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null,this.ends_)},t$2.geom.MultiLineString.prototype.setFlatCoordinates=function(e,t,i){this.setFlatCoordinatesInternal(e,t),this.ends_=i,this.changed()},t$2.geom.MultiLineString.prototype.setLineStrings=function(e){var t,i,r=this.getLayout(),n=[],o=[];for(t=0,i=e.length;t<i;++t){var a=e[t];0===t&&(r=a.getLayout()),t$2.array.extend(n,a.getFlatCoordinates()),o.push(n.length)}this.setFlatCoordinates(r,n,o)},t$2.geom.MultiPoint=function(e,t){t$2.geom.SimpleGeometry.call(this),this.setCoordinates(e,t)},t$2.inherits(t$2.geom.MultiPoint,t$2.geom.SimpleGeometry),t$2.geom.MultiPoint.prototype.appendPoint=function(e){this.flatCoordinates?t$2.array.extend(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()},t$2.geom.MultiPoint.prototype.clone=function(){var e=new t$2.geom.MultiPoint(null);return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),e},t$2.geom.MultiPoint.prototype.closestPointXY=function(e,t,i,r){if(r<t$2.extent.closestSquaredDistanceXY(this.getExtent(),e,t))return r;var n,o,a,s=this.flatCoordinates,l=this.stride;for(n=0,o=s.length;n<o;n+=l){var u=t$2.math.squaredDistance(e,t,s[n],s[n+1]);if(u<r){for(r=u,a=0;a<l;++a)i[a]=s[n+a];i.length=l}}return r},t$2.geom.MultiPoint.prototype.getCoordinates=function(){return t$2.geom.flat.inflate.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},t$2.geom.MultiPoint.prototype.getPoint=function(e){var t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;if(e<0||t<=e)return null;var i=new t$2.geom.Point(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride)),i},t$2.geom.MultiPoint.prototype.getPoints=function(){var e,t,i=this.flatCoordinates,r=this.layout,n=this.stride,o=[];for(e=0,t=i.length;e<t;e+=n){var a=new t$2.geom.Point(null);a.setFlatCoordinates(r,i.slice(e,e+n)),o.push(a)}return o},t$2.geom.MultiPoint.prototype.getType=function(){return t$2.geom.GeometryType.MULTI_POINT},t$2.geom.MultiPoint.prototype.intersectsExtent=function(e){var t,i,r,n,o=this.flatCoordinates,a=this.stride;for(t=0,i=o.length;t<i;t+=a)if(r=o[t],n=o[t+1],t$2.extent.containsXY(e,r,n))return!0;return!1},t$2.geom.MultiPoint.prototype.setCoordinates=function(e,t){e?(this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=t$2.geom.flat.deflate.coordinates(this.flatCoordinates,0,e,this.stride),this.changed()):this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null)},t$2.geom.MultiPoint.prototype.setFlatCoordinates=function(e,t){this.setFlatCoordinatesInternal(e,t),this.changed()},t$2.geom.flat.center.linearRingss={},t$2.geom.flat.center.linearRingss=function(e,t,i,r){var n,o,a=[],s=t$2.extent.createEmpty();for(n=0,o=i.length;n<o;++n){var l=i[n];s=t$2.extent.createOrUpdateFromFlatCoordinates(e,t,l[0],r),a.push((s[0]+s[2])/2,(s[1]+s[3])/2),t=l[l.length-1]}return a},t$2.geom.MultiPolygon=function(e,t){t$2.geom.SimpleGeometry.call(this),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(e,t)},t$2.inherits(t$2.geom.MultiPolygon,t$2.geom.SimpleGeometry),t$2.geom.MultiPolygon.prototype.appendPolygon=function(e){var t;if(this.flatCoordinates){var i,r,n=this.flatCoordinates.length;for(t$2.array.extend(this.flatCoordinates,e.getFlatCoordinates()),i=0,r=(t=e.getEnds().slice()).length;i<r;++i)t[i]+=n}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()},t$2.geom.MultiPolygon.prototype.clone=function(){for(var e=new t$2.geom.MultiPolygon(null),t=this.endss_.length,i=new Array(t),r=0;r<t;++r)i[r]=this.endss_[r].slice();return e.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),i),e},t$2.geom.MultiPolygon.prototype.closestPointXY=function(e,t,i,r){return r<t$2.extent.closestSquaredDistanceXY(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(t$2.geom.flat.closest.getssMaxSquaredDelta(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),t$2.geom.flat.closest.getssClosestPoint(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,i,r))},t$2.geom.MultiPolygon.prototype.containsXY=function(e,t){return t$2.geom.flat.contains.linearRingssContainsXY(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)},t$2.geom.MultiPolygon.prototype.getArea=function(){return t$2.geom.flat.area.linearRingss(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},t$2.geom.MultiPolygon.prototype.getCoordinates=function(e){var t;return void 0!==e?(t=this.getOrientedFlatCoordinates().slice(),t$2.geom.flat.orient.orientLinearRingss(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,t$2.geom.flat.inflate.coordinatesss(t,0,this.endss_,this.stride)},t$2.geom.MultiPolygon.prototype.getEndss=function(){return this.endss_},t$2.geom.MultiPolygon.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var e=t$2.geom.flat.center.linearRingss(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=t$2.geom.flat.interiorpoint.linearRingss(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},t$2.geom.MultiPolygon.prototype.getInteriorPoints=function(){var e=new t$2.geom.MultiPoint(null);return e.setFlatCoordinates(t$2.geom.GeometryLayout.XYM,this.getFlatInteriorPoints().slice()),e},t$2.geom.MultiPolygon.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var e=this.flatCoordinates;t$2.geom.flat.orient.linearRingssAreOriented(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=t$2.geom.flat.orient.orientLinearRingss(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},t$2.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal=function(e){var t=[],i=[];t.length=t$2.geom.flat.simplify.quantizess(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),t,0,i);var r=new t$2.geom.MultiPolygon(null);return r.setFlatCoordinates(t$2.geom.GeometryLayout.XY,t,i),r},t$2.geom.MultiPolygon.prototype.getPolygon=function(e){if(e<0||this.endss_.length<=e)return null;var t;if(0===e)t=0;else{var i=this.endss_[e-1];t=i[i.length-1]}var r,n,o=this.endss_[e].slice(),a=o[o.length-1];if(0!==t)for(r=0,n=o.length;r<n;++r)o[r]-=t;var s=new t$2.geom.Polygon(null);return s.setFlatCoordinates(this.layout,this.flatCoordinates.slice(t,a),o),s},t$2.geom.MultiPolygon.prototype.getPolygons=function(){var e,t,i,r,n=this.layout,o=this.flatCoordinates,a=this.endss_,s=[],l=0;for(e=0,t=a.length;e<t;++e){var u=a[e].slice(),c=u[u.length-1];if(0!==l)for(i=0,r=u.length;i<r;++i)u[i]-=l;var h=new t$2.geom.Polygon(null);h.setFlatCoordinates(n,o.slice(l,c),u),s.push(h),l=c}return s},t$2.geom.MultiPolygon.prototype.getType=function(){return t$2.geom.GeometryType.MULTI_POLYGON},t$2.geom.MultiPolygon.prototype.intersectsExtent=function(e){return t$2.geom.flat.intersectsextent.linearRingss(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)},t$2.geom.MultiPolygon.prototype.setCoordinates=function(e,t){if(e){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=t$2.geom.flat.deflate.coordinatesss(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var r=i[i.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()}else this.setFlatCoordinates(t$2.geom.GeometryLayout.XY,null,this.endss_)},t$2.geom.MultiPolygon.prototype.setFlatCoordinates=function(e,t,i){this.setFlatCoordinatesInternal(e,t),this.endss_=i,this.changed()},t$2.geom.MultiPolygon.prototype.setPolygons=function(e){var t,i,r,n=this.getLayout(),o=[],a=[];for(t=0,i=e.length;t<i;++t){var s=e[t];0===t&&(n=s.getLayout());var l,u,c=o.length;for(l=0,u=(r=s.getEnds()).length;l<u;++l)r[l]+=c;t$2.array.extend(o,s.getFlatCoordinates()),a.push(r)}this.setFlatCoordinates(n,o,a)},t$2.Feature=function(e){if(t$2.Object.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,void 0!==e)if(e instanceof t$2.geom.Geometry||!e){var t=e;this.setGeometry(t)}else{var i=e;this.setProperties(i)}},t$2.inherits(t$2.Feature,t$2.Object),t$2.Feature.prototype.clone=function(){var e=new t$2.Feature(this.getProperties());e.setGeometryName(this.getGeometryName());var t=this.getGeometry();t&&e.setGeometry(t.clone());var i=this.getStyle();return i&&e.setStyle(i),e},t$2.Feature.prototype.getGeometry=function(){return this.get(this.geometryName_)},t$2.Feature.prototype.getId=function(){return this.id_},t$2.Feature.prototype.getGeometryName=function(){return this.geometryName_},t$2.Feature.prototype.getStyle=function(){return this.style_},t$2.Feature.prototype.getStyleFunction=function(){return this.styleFunction_},t$2.Feature.prototype.handleGeometryChange_=function(){this.changed()},t$2.Feature.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(t$2.events.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var e=this.getGeometry();e&&(this.geometryChangeKey_=t$2.events.listen(e,t$2.events.EventType.CHANGE,this.handleGeometryChange_,this)),this.changed()},t$2.Feature.prototype.setGeometry=function(e){this.set(this.geometryName_,e)},t$2.Feature.prototype.setStyle=function(e){this.style_=e,this.styleFunction_=e?t$2.Feature.createStyleFunction(e):void 0,this.changed()},t$2.Feature.prototype.setId=function(e){this.id_=e,this.changed()},t$2.Feature.prototype.setGeometryName=function(e){t$2.events.unlisten(this,t$2.Object.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=e,t$2.events.listen(this,t$2.Object.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},t$2.Feature.createStyleFunction=function(e){var t,i;"function"==typeof e?t=2==e.length?function(t){return e(this,t)}:e:(Array.isArray(e)?i=e:(t$2.asserts.assert(e instanceof t$2.style.Style,41),i=[e]),t=function(){return i});return t},t$2.format={},t$2.format.Feature=function(){this.defaultDataProjection=null,this.defaultFeatureProjection=null},t$2.format.Feature.prototype.getReadOptions=function(e,t){var i;return t&&(i={dataProjection:t.dataProjection?t.dataProjection:this.readProjection(e),featureProjection:t.featureProjection}),this.adaptOptions(i)},t$2.format.Feature.prototype.adaptOptions=function(e){return t$2.obj.assign({dataProjection:this.defaultDataProjection,featureProjection:this.defaultFeatureProjection},e)},t$2.format.Feature.prototype.getLastExtent=function(){return null},t$2.format.Feature.prototype.getType=function(){},t$2.format.Feature.prototype.readFeature=function(e,t){},t$2.format.Feature.prototype.readFeatures=function(e,t){},t$2.format.Feature.prototype.readGeometry=function(e,t){},t$2.format.Feature.prototype.readProjection=function(e){},t$2.format.Feature.prototype.writeFeature=function(e,t){},t$2.format.Feature.prototype.writeFeatures=function(e,t){},t$2.format.Feature.prototype.writeGeometry=function(e,t){},t$2.format.Feature.transformWithOptions=function(e,t,i){var r;if(r=e,t&&i&&void 0!==i.decimals){var n=Math.pow(10,i.decimals);r===e&&(r=r.clone()),r.applyTransform((function(e){for(var t=0,i=e.length;t<i;++t)e[t]=Math.round(e[t]*n)/n;return e}))}return r},t$2.format.MVT=function(e){t$2.format.Feature.call(this);var t=e||{};this.featureClass_=t.featureClass?t.featureClass:t$2.render.Feature,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.extent_=null},t$2.inherits(t$2.format.MVT,t$2.format.Feature),t$2.format.MVT.pbfReaders_={layers:function(e,t,i){if(3===e){var r={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(t$2.format.MVT.pbfReaders_.layer,r,n),r.length=r.features.length,r.length&&(t[r.name]=r)}},layer:function(e,t,i){if(15===e)t.version=i.readVarint();else if(1===e)t.name=i.readString();else if(5===e)t.extent=i.readVarint();else if(2===e)t.features.push(i.pos);else if(3===e)t.keys.push(i.readString());else if(4===e){for(var r=null,n=i.readVarint()+i.pos;i.pos<n;)r=1===(e=i.readVarint()>>3)?i.readString():2===e?i.readFloat():3===e?i.readDouble():4===e?i.readVarint64():5===e?i.readVarint():6===e?i.readSVarint():7===e?i.readBoolean():null;t.values.push(r)}},feature:function(e,t,i){if(1==e)t.id=i.readVarint();else if(2==e)for(var r=i.readVarint()+i.pos;i.pos<r;){var n=t.layer.keys[i.readVarint()],o=t.layer.values[i.readVarint()];t.properties[n]=o}else 3==e?t.type=i.readVarint():4==e&&(t.geometry=i.pos)}},t$2.format.MVT.readRawFeature_=function(e,t,i){e.pos=t.features[i];var r=e.readVarint()+e.pos,n={layer:t,type:0,properties:{}};return e.readFields(t$2.format.MVT.pbfReaders_.feature,n,r),n},t$2.format.MVT.readRawGeometry_=function(e,t,i,r){e.pos=t.geometry;for(var n=e.readVarint()+e.pos,o=1,a=0,s=0,l=0,u=0,c=0;e.pos<n;){if(!a){var h=e.readVarint();o=7&h,a=h>>3}a--,1===o||2===o?(s+=e.readSVarint(),l+=e.readSVarint(),1===o&&u>c&&(r.push(u),c=u),i.push(s,l),u+=2):7===o?u>c&&(i.push(i[c],i[c+1]),u+=2):t$2.asserts.assert(!1,59)}u>c&&(r.push(u),c=u)},t$2.format.MVT.getGeometryType_=function(e,t){var i;return 1===e?i=1===t?t$2.geom.GeometryType.POINT:t$2.geom.GeometryType.MULTI_POINT:2===e?i=1===t?t$2.geom.GeometryType.LINE_STRING:t$2.geom.GeometryType.MULTI_LINE_STRING:3===e&&(i=t$2.geom.GeometryType.POLYGON),i},t$2.format.MVT.prototype.createFeature_=function(e,t,i){var r=t.type;if(0===r)return null;var n,o=t.id,a=t.properties;a[this.layerName_]=t.layer.name;var s=[],l=[];t$2.format.MVT.readRawGeometry_(e,t,s,l);var u,c=t$2.format.MVT.getGeometryType_(r,l.length);if(c==t$2.geom.GeometryType.POLYGON){for(var h=[],d=0,f=0,p=0,_=l.length;p<_;++p){var m=l[p];t$2.geom.flat.orient.linearRingIsClockwise(s,d,m,2)||(h.push(l.slice(f,p+1)),f=p+1),d=m}h.length>1?(l=h,u=new t$2.geom.MultiPolygon(null)):u=new t$2.geom.Polygon(null)}else u=c===t$2.geom.GeometryType.POINT?new t$2.geom.Point(null):c===t$2.geom.GeometryType.LINE_STRING?new t$2.geom.LineString(null):c===t$2.geom.GeometryType.POLYGON?new t$2.geom.Polygon(null):c===t$2.geom.GeometryType.MULTI_POINT?new t$2.geom.MultiPoint(null):c===t$2.geom.GeometryType.MULTI_LINE_STRING?new t$2.geom.MultiLineString(null):null;u.setFlatCoordinates(t$2.geom.GeometryLayout.XY,s,l),n=new this.featureClass_,this.geometryName_&&n.setGeometryName(this.geometryName_);var $=t$2.format.Feature.transformWithOptions(u,!1,this.adaptOptions(i));return n.setGeometry($),n.setId(o),n.setProperties(a),n},t$2.format.MVT.prototype.readFeatures=function(e,t){var i,r=this.layers_,n=new h$Q(e),o=n.readFields(t$2.format.MVT.pbfReaders_.layers,{}),a=[];for(var s in o)if(!r||-1!=r.indexOf(s)){if(void 0!==t){var l=t.needSourceLayerNames;if(void 0!==l&&void 0===l[s])continue}for(var u,c=0,h=(i=o[s]).length;c<h;++c)u=t$2.format.MVT.readRawFeature_(n,i,c),a.push(this.createFeature_(n,u));this.extent_=i?[0,0,i.extent,i.extent]:null}return a},t$2.style={},t$2.style.IconImageCache=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32},t$2.style.IconImageCache.getKey=function(e,t,i){return t+":"+e+":"+(i?t$2.color.asString(i):"null")},t$2.style.IconImageCache.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t$2.style.IconImageCache.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var e,t,i=0;for(e in this.cache_)t=this.cache_[e],0==(3&i++)&&!t.hasListener()&&(delete this.cache_[e],--this.cacheSize_)}},t$2.style.IconImageCache.prototype.get=function(e,t,i){var r=t$2.style.IconImageCache.getKey(e,t,i);return r in this.cache_?this.cache_[r]:null},t$2.style.IconImageCache.prototype.set=function(e,t,i,r){var n=t$2.style.IconImageCache.getKey(e,t,i);this.cache_[n]=r,++this.cacheSize_},t$2.style.IconImageCache.prototype.setSize=function(e){this.maxCacheSize_=e,this.expire()},t$2.style.iconImageCache=new t$2.style.IconImageCache,t$2.style.Image=function(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.snapToPixel_=e.snapToPixel},t$2.style.Image.prototype.getOpacity=function(){return this.opacity_},t$2.style.Image.prototype.getRotateWithView=function(){return this.rotateWithView_},t$2.style.Image.prototype.getRotation=function(){return this.rotation_},t$2.style.Image.prototype.getScale=function(){return this.scale_},t$2.style.Image.prototype.getSnapToPixel=function(){return this.snapToPixel_},t$2.style.Image.prototype.getAnchor=function(){},t$2.style.Image.prototype.getImage=function(e){},t$2.style.Image.prototype.getHitDetectionImage=function(e){},t$2.style.Image.prototype.getImageState=function(){},t$2.style.Image.prototype.getImageSize=function(){},t$2.style.Image.prototype.getHitDetectionImageSize=function(){},t$2.style.Image.prototype.getOrigin=function(){},t$2.style.Image.prototype.getSize=function(){},t$2.style.Image.prototype.setOpacity=function(e){this.opacity_=e},t$2.style.Image.prototype.setRotateWithView=function(e){this.rotateWithView_=e},t$2.style.Image.prototype.setRotation=function(e){this.rotation_=e},t$2.style.Image.prototype.setScale=function(e){this.scale_=e},t$2.style.Image.prototype.setSnapToPixel=function(e){this.snapToPixel_=e},t$2.style.Image.prototype.listenImageChange=function(e,t){},t$2.style.Image.prototype.load=function(){},t$2.style.Image.prototype.unlistenImageChange=function(e,t){},t$2.style.RegularShape=function(e){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==e.fill?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=void 0!==e.radius?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=void 0!==e.angle?e.angle:0,this.stroke_=void 0!==e.stroke?e.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=e.atlasManager,this.render_(this.atlasManager_);var t=void 0===e.snapToPixel||e.snapToPixel,i=void 0!==e.rotateWithView&&e.rotateWithView;t$2.style.Image.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1,snapToPixel:t})},t$2.inherits(t$2.style.RegularShape,t$2.style.Image),t$2.style.RegularShape.prototype.clone=function(){var e=new t$2.style.RegularShape({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t$2.style.RegularShape.prototype.getAnchor=function(){return this.anchor_},t$2.style.RegularShape.prototype.getAngle=function(){return this.angle_},t$2.style.RegularShape.prototype.getFill=function(){return this.fill_},t$2.style.RegularShape.prototype.getHitDetectionImage=function(e){return this.hitDetectionCanvas_},t$2.style.RegularShape.prototype.getImage=function(e){return this.canvas_},t$2.style.RegularShape.prototype.getImageSize=function(){return this.imageSize_},t$2.style.RegularShape.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},t$2.style.RegularShape.prototype.getImageState=function(){return t$2.ImageState.LOADED},t$2.style.RegularShape.prototype.getOrigin=function(){return this.origin_},t$2.style.RegularShape.prototype.getPoints=function(){return this.points_},t$2.style.RegularShape.prototype.getRadius=function(){return this.radius_},t$2.style.RegularShape.prototype.getRadius2=function(){return this.radius2_},t$2.style.RegularShape.prototype.getSize=function(){return this.size_},t$2.style.RegularShape.prototype.getStroke=function(){return this.stroke_},t$2.style.RegularShape.prototype.listenImageChange=function(e,t){},t$2.style.RegularShape.prototype.load=function(){},t$2.style.RegularShape.prototype.unlistenImageChange=function(e,t){},t$2.style.RegularShape.prototype.render_=function(e){var t,i,r="",n="",o=0,a=null,s=0,l=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=t$2.render.canvas.defaultStrokeStyle),i=t$2.colorlike.asColorLike(i),void 0===(l=this.stroke_.getWidth())&&(l=t$2.render.canvas.defaultLineWidth),a=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset(),t$2.has.CANVAS_LINE_DASH||(a=null,s=0),void 0===(n=this.stroke_.getLineJoin())&&(n=t$2.render.canvas.defaultLineJoin),void 0===(r=this.stroke_.getLineCap())&&(r=t$2.render.canvas.defaultLineCap),void 0===(o=this.stroke_.getMiterLimit())&&(o=t$2.render.canvas.defaultMiterLimit));var u=2*(this.radius_+l)+1,c={strokeStyle:i,strokeWidth:l,size:u,lineCap:r,lineDash:a,lineDashOffset:s,lineJoin:n,miterLimit:o};if(void 0===e){var h=t$2.dom.createCanvasContext2D(u,u);this.canvas_=h.canvas,t=u=this.canvas_.width,this.draw_(c,h,0,0),this.createHitDetectionCanvas_(c)}else{u=Math.round(u);var d,f=!this.fill_;f&&(d=this.drawHitDetectionCanvas_.bind(this,c));var p=this.getChecksum(),_=e.add(p,u,u,this.draw_.bind(this,c),d);this.canvas_=_.image,this.origin_=[_.offsetX,_.offsetY],t=_.image.width,f?(this.hitDetectionCanvas_=_.hitImage,this.hitDetectionImageSize_=[_.hitImage.width,_.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[t,t])}this.anchor_=[u/2,u/2],this.size_=[u,u],this.imageSize_=[t,t]},t$2.style.RegularShape.prototype.draw_=function(e,t,i,r){var n,o,a;t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var s=this.points_;if(s===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(s*=2),n=0;n<=s;n++)o=2*n*Math.PI/s-Math.PI/2+this.angle_,a=n%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(o),e.size/2+a*Math.sin(o))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=t$2.render.canvas.defaultFillStyle),t.fillStyle=t$2.colorlike.asColorLike(u),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke()),t.closePath()},t$2.style.RegularShape.prototype.createHitDetectionCanvas_=function(e){if(this.hitDetectionImageSize_=[e.size,e.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var t=t$2.dom.createCanvasContext2D(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t,0,0)}},t$2.style.RegularShape.prototype.drawHitDetectionCanvas_=function(e,t,i,r){t.setTransform(1,0,0,1,0,0),t.translate(i,r),t.beginPath();var n=this.points_;if(n===1/0)t.arc(e.size/2,e.size/2,this.radius_,0,2*Math.PI,!0);else{var o,a,s,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(n*=2),o=0;o<=n;o++)s=2*o*Math.PI/n-Math.PI/2+this.angle_,a=o%2==0?this.radius_:l,t.lineTo(e.size/2+a*Math.cos(s),e.size/2+a*Math.sin(s))}t.fillStyle=t$2.render.canvas.defaultFillStyle,t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.stroke()),t.closePath()},t$2.style.RegularShape.prototype.getChecksum=function(){var e=this.stroke_?this.stroke_.getChecksum():"-",t=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||e!=this.checksums_[1]||t!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+e+t+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,e,t,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},t$2.style.Circle=function(e){var t=e||{};t$2.style.RegularShape.call(this,{points:1/0,fill:t.fill,radius:t.radius,snapToPixel:t.snapToPixel,stroke:t.stroke,atlasManager:t.atlasManager})},t$2.inherits(t$2.style.Circle,t$2.style.RegularShape),t$2.style.Circle.prototype.clone=function(){var e=new t$2.style.Circle({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return e.setOpacity(this.getOpacity()),e.setScale(this.getScale()),e},t$2.style.Circle.prototype.setRadius=function(e){this.radius_=e,this.render_(this.atlasManager_)},t$2.style.Fill=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.checksum_=void 0},t$2.style.Fill.prototype.clone=function(){var e=this.getColor();return new t$2.style.Fill({color:e&&e.slice?e.slice():e||void 0})},t$2.style.Fill.prototype.getColor=function(){return this.color_},t$2.style.Fill.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},t$2.style.Fill.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?this.checksum_=t$2.getUid(this.color_).toString():this.checksum_="f"+(this.color_?t$2.color.asString(this.color_):"-")),this.checksum_},t$2.style.Stroke=function(e){var t=e||{};this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width,this.checksum_=void 0},t$2.style.Stroke.prototype.clone=function(){var e=this.getColor();return new t$2.style.Stroke({color:e&&e.slice?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t$2.style.Stroke.prototype.getColor=function(){return this.color_},t$2.style.Stroke.prototype.getLineCap=function(){return this.lineCap_},t$2.style.Stroke.prototype.getLineDash=function(){return this.lineDash_},t$2.style.Stroke.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t$2.style.Stroke.prototype.getLineJoin=function(){return this.lineJoin_},t$2.style.Stroke.prototype.getMiterLimit=function(){return this.miterLimit_},t$2.style.Stroke.prototype.getWidth=function(){return this.width_},t$2.style.Stroke.prototype.setColor=function(e){this.color_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setLineCap=function(e){this.lineCap_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setLineDash=function(e){this.lineDash_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setLineDashOffset=function(e){this.lineDashOffset_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setLineJoin=function(e){this.lineJoin_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setMiterLimit=function(e){this.miterLimit_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.setWidth=function(e){this.width_=e,this.checksum_=void 0},t$2.style.Stroke.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=t$2.getUid(this.color_).toString():this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_},t$2.style.IconAnchorUnits={FRACTION:"fraction",PIXELS:"pixels"},t$2.style.IconImage=function(e,t,i,r,n,o){t$2.events.EventTarget.call(this),this.hitDetectionImage_=null,this.image_=e||new Image,null!==r&&(this.image_.crossOrigin=r),this.canvas_=o?document.createElement("CANVAS"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=n,this.size_=i,this.src_=t,this.tainting_=!1,this.imageState_==t$2.ImageState.LOADED&&this.determineTainting_()},t$2.inherits(t$2.style.IconImage,t$2.events.EventTarget),t$2.style.IconImage.get=function(e,t,i,r,n,o){var a=t$2.style.iconImageCache,s=a.get(t,r,o);return s||(s=new t$2.style.IconImage(e,t,i,r,n,o),a.set(t,r,o,s)),s},t$2.style.IconImage.prototype.determineTainting_=function(){var e=t$2.dom.createCanvasContext2D(1,1);try{e.drawImage(this.image_,0,0),e.getImageData(0,0,1,1)}catch{this.tainting_=!0}},t$2.style.IconImage.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(t$2.events.EventType.CHANGE)},t$2.style.IconImage.prototype.handleImageError_=function(){this.imageState_=t$2.ImageState.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t$2.style.IconImage.prototype.handleImageLoad_=function(){this.imageState_=t$2.ImageState.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},t$2.style.IconImage.prototype.getImage=function(e){return this.canvas_?this.canvas_:this.image_},t$2.style.IconImage.prototype.getImageState=function(){return this.imageState_},t$2.style.IconImage.prototype.getHitDetectionImage=function(e){if(!this.hitDetectionImage_)if(this.tainting_){var t=this.size_[0],i=this.size_[1],r=t$2.dom.createCanvasContext2D(t,i);r.fillRect(0,0,t,i),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t$2.style.IconImage.prototype.getSize=function(){return this.size_},t$2.style.IconImage.prototype.getSrc=function(){return this.src_},t$2.style.IconImage.prototype.load=function(){if(this.imageState_==t$2.ImageState.IDLE){this.imageState_=t$2.ImageState.LOADING,this.imageListenerKeys_=[t$2.events.listenOnce(this.image_,t$2.events.EventType.ERROR,this.handleImageError_,this),t$2.events.listenOnce(this.image_,t$2.events.EventType.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch{this.handleImageError_()}}},t$2.style.IconImage.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var e=this.canvas_.getContext("2d");e.drawImage(this.image_,0,0);for(var t=e.getImageData(0,0,this.image_.width,this.image_.height),i=t.data,r=this.color_[0]/255,n=this.color_[1]/255,o=this.color_[2]/255,a=0,s=i.length;a<s;a+=4)i[a]*=r,i[a+1]*=n,i[a+2]*=o;e.putImageData(t,0,0)}},t$2.style.IconImage.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(t$2.events.unlistenByKey),this.imageListenerKeys_=null},t$2.style.IconOrigin={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},t$2.style.Icon=function(e){var t=e||{};this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:t$2.style.IconOrigin.TOP_LEFT,this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:t$2.style.IconAnchorUnits.FRACTION,this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:t$2.style.IconAnchorUnits.FRACTION,this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;var i=void 0!==t.img?t.img:null,r=void 0!==t.imgSize?t.imgSize:null,n=t.src;(void 0===n||0===n.length)&&i&&(n=i.src||t$2.getUid(i).toString());var o=void 0!==t.src?t$2.ImageState.IDLE:t$2.ImageState.LOADED;this.color_=void 0!==t.color?t$2.color.asArray(t.color):null,this.iconImage_=t$2.style.IconImage.get(i,n,r,this.crossOrigin_,o,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:t$2.style.IconOrigin.TOP_LEFT,this.origin_=null,this.size_=void 0!==t.size?t.size:null;var a=void 0!==t.opacity?t.opacity:1,s=void 0!==t.rotateWithView&&t.rotateWithView,l=void 0!==t.rotation?t.rotation:0,u=void 0!==t.scale?t.scale:1,c=void 0===t.snapToPixel||t.snapToPixel;t$2.style.Image.call(this,{opacity:a,rotation:l,scale:u,snapToPixel:c,rotateWithView:s})},t$2.inherits(t$2.style.Icon,t$2.style.Image),t$2.style.Icon.prototype.clone=function(){return new t$2.style.Icon({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},t$2.style.Icon.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var e=this.anchor_,t=this.getSize();if(this.anchorXUnits_==t$2.style.IconAnchorUnits.FRACTION||this.anchorYUnits_==t$2.style.IconAnchorUnits.FRACTION){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==t$2.style.IconAnchorUnits.FRACTION&&(e[0]*=t[0]),this.anchorYUnits_==t$2.style.IconAnchorUnits.FRACTION&&(e[1]*=t[1])}if(this.anchorOrigin_!=t$2.style.IconOrigin.TOP_LEFT){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==t$2.style.IconOrigin.TOP_RIGHT||this.anchorOrigin_==t$2.style.IconOrigin.BOTTOM_RIGHT)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==t$2.style.IconOrigin.BOTTOM_LEFT||this.anchorOrigin_==t$2.style.IconOrigin.BOTTOM_RIGHT)&&(e[1]=-e[1]+t[1])}return this.normalizedAnchor_=e,this.normalizedAnchor_},t$2.style.Icon.prototype.getColor=function(){return this.color_},t$2.style.Icon.prototype.getImage=function(e){return this.iconImage_.getImage(e)},t$2.style.Icon.prototype.getImageSize=function(){return this.iconImage_.getSize()},t$2.style.Icon.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},t$2.style.Icon.prototype.getImageState=function(){return this.iconImage_.getImageState()},t$2.style.Icon.prototype.getHitDetectionImage=function(e){return this.iconImage_.getHitDetectionImage(e)},t$2.style.Icon.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var e=this.offset_;if(this.offsetOrigin_!=t$2.style.IconOrigin.TOP_LEFT){var t=this.getSize(),i=this.iconImage_.getSize();if(!t||!i)return null;e=e.slice(),(this.offsetOrigin_==t$2.style.IconOrigin.TOP_RIGHT||this.offsetOrigin_==t$2.style.IconOrigin.BOTTOM_RIGHT)&&(e[0]=i[0]-t[0]-e[0]),(this.offsetOrigin_==t$2.style.IconOrigin.BOTTOM_LEFT||this.offsetOrigin_==t$2.style.IconOrigin.BOTTOM_RIGHT)&&(e[1]=i[1]-t[1]-e[1])}return this.origin_=e,this.origin_},t$2.style.Icon.prototype.getSrc=function(){return this.iconImage_.getSrc()},t$2.style.Icon.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t$2.style.Icon.prototype.listenImageChange=function(e,t){return t$2.events.listen(this.iconImage_,t$2.events.EventType.CHANGE,e,t)},t$2.style.Icon.prototype.load=function(){this.iconImage_.load()},t$2.style.Icon.prototype.unlistenImageChange=function(e,t){t$2.events.unlisten(this.iconImage_,t$2.events.EventType.CHANGE,e,t)},t$2.style.Text=function(e){var t=e||{};this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.text_=t.text,this.textAlign_=t.textAlign,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new t$2.style.Fill({color:t$2.style.Text.DEFAULT_FILL_COLOR_}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:t$2.style.TextPlacement.POINT;var i=void 0===t.overflow?t.exceedLength:t.overflow;this.overflow_=void 0!==i&&i,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding},t$2.style.Text.DEFAULT_FILL_COLOR_="#333",t$2.style.Text.prototype.clone=function(){return new t$2.style.Text({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:this.getScale(),text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY()})},t$2.style.Text.prototype.getOverflow=function(){return this.overflow_},t$2.style.Text.prototype.getFont=function(){return this.font_},t$2.style.Text.prototype.getMaxAngle=function(){return this.maxAngle_},t$2.style.Text.prototype.getPlacement=function(){return this.placement_},t$2.style.Text.prototype.getOffsetX=function(){return this.offsetX_},t$2.style.Text.prototype.getOffsetY=function(){return this.offsetY_},t$2.style.Text.prototype.getFill=function(){return this.fill_},t$2.style.Text.prototype.getRotateWithView=function(){return this.rotateWithView_},t$2.style.Text.prototype.getRotation=function(){return this.rotation_},t$2.style.Text.prototype.getScale=function(){return this.scale_},t$2.style.Text.prototype.getStroke=function(){return this.stroke_},t$2.style.Text.prototype.getText=function(){return this.text_},t$2.style.Text.prototype.getTextAlign=function(){return this.textAlign_},t$2.style.Text.prototype.getTextBaseline=function(){return this.textBaseline_},t$2.style.Text.prototype.getBackgroundFill=function(){return this.backgroundFill_},t$2.style.Text.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t$2.style.Text.prototype.getPadding=function(){return this.padding_},t$2.style.Text.prototype.setOverflow=function(e){this.overflow_=e},t$2.style.Text.prototype.setFont=function(e){this.font_=e},t$2.style.Text.prototype.setMaxAngle=function(e){this.maxAngle_=e},t$2.style.Text.prototype.setOffsetX=function(e){this.offsetX_=e},t$2.style.Text.prototype.setOffsetY=function(e){this.offsetY_=e},t$2.style.Text.prototype.setPlacement=function(e){this.placement_=e},t$2.style.Text.prototype.setFill=function(e){this.fill_=e},t$2.style.Text.prototype.setRotation=function(e){this.rotation_=e},t$2.style.Text.prototype.setScale=function(e){this.scale_=e},t$2.style.Text.prototype.setStroke=function(e){this.stroke_=e},t$2.style.Text.prototype.setText=function(e){this.text_=e},t$2.style.Text.prototype.setTextAlign=function(e){this.textAlign_=e},t$2.style.Text.prototype.setTextBaseline=function(e){this.textBaseline_=e},t$2.style.Text.prototype.setBackgroundFill=function(e){this.backgroundFill_=e},t$2.style.Text.prototype.setBackgroundStroke=function(e){this.backgroundStroke_=e},t$2.style.Text.prototype.setPadding=function(e){this.padding_=e},t$2.style.Style=function(e){var t=e||{};this.geometry_=null,this.geometryFunction_=t$2.style.Style.defaultGeometryFunction,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex},t$2.style.Style.prototype.clone=function(){var e=this.getGeometry();return e&&e.clone&&(e=e.clone()),new t$2.style.Style({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t$2.style.Style.prototype.getRenderer=function(){return this.renderer_},t$2.style.Style.prototype.setRenderer=function(e){this.renderer_=e},t$2.style.Style.prototype.getGeometry=function(){return this.geometry_},t$2.style.Style.prototype.getGeometryFunction=function(){return this.geometryFunction_},t$2.style.Style.prototype.getFill=function(){return this.fill_},t$2.style.Style.prototype.setFill=function(e){this.fill_=e},t$2.style.Style.prototype.getImage=function(){return this.image_},t$2.style.Style.prototype.setImage=function(e){this.image_=e},t$2.style.Style.prototype.getStroke=function(){return this.stroke_},t$2.style.Style.prototype.setStroke=function(e){this.stroke_=e},t$2.style.Style.prototype.getText=function(){return this.text_},t$2.style.Style.prototype.setText=function(e){this.text_=e},t$2.style.Style.prototype.getZIndex=function(){return this.zIndex_},t$2.style.Style.prototype.setGeometry=function(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=t$2.style.Style.defaultGeometryFunction,this.geometry_=e},t$2.style.Style.prototype.setZIndex=function(e){this.zIndex_=e},t$2.style.Style.createFunction=function(e){var t,i;"function"==typeof e?t=e:(Array.isArray(e)?i=e:(t$2.asserts.assert(e instanceof t$2.style.Style,41),i=[e]),t=function(){return i});return t},t$2.style.Style.default_=null,t$2.style.Style.defaultFunction=function(e,t){if(!t$2.style.Style.default_){var i=new t$2.style.Fill({color:"rgba(255,255,255,0.4)"}),r=new t$2.style.Stroke({color:"#3399CC",width:1.25});t$2.style.Style.default_=[new t$2.style.Style({image:new t$2.style.Circle({fill:i,stroke:r,radius:5}),fill:i,stroke:r})]}return t$2.style.Style.default_},t$2.style.Style.createDefaultEditing=function(){var e={},t=[255,255,255,1],i=[0,153,255,1];return e[t$2.geom.GeometryType.POLYGON]=[new t$2.style.Style({fill:new t$2.style.Fill({color:[255,255,255,.5]})})],e[t$2.geom.GeometryType.MULTI_POLYGON]=e[t$2.geom.GeometryType.POLYGON],e[t$2.geom.GeometryType.LINE_STRING]=[new t$2.style.Style({stroke:new t$2.style.Stroke({color:t,width:5})}),new t$2.style.Style({stroke:new t$2.style.Stroke({color:i,width:3})})],e[t$2.geom.GeometryType.MULTI_LINE_STRING]=e[t$2.geom.GeometryType.LINE_STRING],e[t$2.geom.GeometryType.CIRCLE]=e[t$2.geom.GeometryType.POLYGON].concat(e[t$2.geom.GeometryType.LINE_STRING]),e[t$2.geom.GeometryType.POINT]=[new t$2.style.Style({image:new t$2.style.Circle({radius:6,fill:new t$2.style.Fill({color:i}),stroke:new t$2.style.Stroke({color:t,width:1.5})}),zIndex:1/0})],e[t$2.geom.GeometryType.MULTI_POINT]=e[t$2.geom.GeometryType.POINT],e[t$2.geom.GeometryType.GEOMETRY_COLLECTION]=e[t$2.geom.GeometryType.POLYGON].concat(e[t$2.geom.GeometryType.LINE_STRING],e[t$2.geom.GeometryType.POINT]),e},t$2.style.Style.defaultGeometryFunction=function(e){return e.getGeometry()},t$2.ext={},t$2.ext.rbush=function(){},function(){!function(e){var t=r,i=r;function r(e,t,i,r,o){n(e,t,i||0,r||e.length-1,o||a)}function n(e,t,i,r,a){for(;r>i;){if(r-i>600){var s=r-i+1,l=t-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);n(e,t,Math.max(i,Math.floor(t-l*c/s+h)),Math.min(r,Math.floor(t+(s-l)*c/s+h)),a)}var d=e[t],f=i,p=r;for(o(e,i,t),a(e[r],d)>0&&o(e,i,r);f<p;){for(o(e,f,p),f++,p--;a(e[f],d)<0;)f++;for(;a(e[p],d)>0;)p--}0===a(e[i],d)?o(e,i,p):o(e,++p,r),p<=t&&(i=p+1),t<=p&&(r=p-1)}}function o(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function a(e,t){return e<t?-1:e>t?1:0}t.default=i;var s=l;function l(e,t){if(!(this instanceof l))return new l(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function u(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function c(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,r,n){n||(n=x(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var o,a=t;a<i;a++)o=e.children[a],d(n,e.leaf?r(o):o);return n}function d(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function f(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function _(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function $(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,o-r)}function v(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function y(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function b(e,i,r,n,o){for(var a,s=[i,r];s.length;)!((r=s.pop())-(i=s.pop())<=n)&&(a=i+Math.ceil((r-i)/n/2)*n,t(e,a,i,r,o),s.push(i,a,a,r))}l.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!y(e,t))return i;for(var n,o,a,s,l=[];t;){for(n=0,o=t.children.length;n<o;n++)a=t.children[n],y(e,s=t.leaf?r(a):a)&&(t.leaf?i.push(a):v(e,s)?this._all(a,i):l.push(a));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!y(e,t))return!1;for(var r,n,o,a,s=[];t;){for(r=0,n=t.children.length;r<n;r++)if(o=t.children[r],y(e,a=t.leaf?i(o):o)){if(t.leaf||v(e,a))return!0;s.push(o)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=x([]),this},remove:function(e,t){if(!e)return this;for(var i,r,n,o,a=this.data,s=this.toBBox(e),l=[],c=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],i=c.pop(),o=!0),a.leaf&&-1!==(n=u(e,a.children,t)))return a.children.splice(n,1),l.push(a),this._condense(l),this;o||a.leaf||!v(a,s)?r?(i++,a=r.children[i],o=!1):a=null:(l.push(a),c.push(i),i=0,r=a,a=a.children[0])}return this},toBBox:function(e){return e},compareMinX:f,compareMinY:p,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var n,o=i-t+1,a=this._maxEntries;if(o<=a)return c(n=x(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(n=x([])).leaf=!1,n.height=r;var s,l,u,h,d=Math.ceil(o/a),f=d*Math.ceil(Math.sqrt(a));for(b(e,t,i,f,this.compareMinX),s=t;s<=i;s+=f)for(b(e,s,u=Math.min(s+f-1,i),d,this.compareMinY),l=s;l<=u;l+=d)h=Math.min(l+d-1,u),n.children.push(this._build(e,l,h,r-1));return c(n,this.toBBox),n},_chooseSubtree:function(e,t,i,r){for(var n,o,a,s,l,u,c,h;r.push(t),!t.leaf&&r.length-1!==i;){for(c=h=1/0,n=0,o=t.children.length;n<o;n++)l=_(a=t.children[n]),(u=$(e,a)-l)<h?(h=u,c=l<c?l:c,s=a):u===h&&l<c&&(c=l,s=a);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,n=i?e:r(e),o=[],a=this._chooseSubtree(n,this.data,t,o);for(a.children.push(e),d(a,n);t>=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)},_split:function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var o=this._chooseSplitIndex(i,n,r),a=x(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,c(i,this.toBBox),c(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(e,t){this.data=x([e,t]),this.data.height=e.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,n,o,a,s,l,u,c;for(l=u=1/0,r=t;r<=i-t;r++)a=g(n=h(e,0,r,this.toBBox),o=h(e,r,i,this.toBBox)),s=_(n)+_(o),a<l?(l=a,c=r,u=s<u?s:u):a===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:f,n=e.leaf?this.compareMinY:p;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var n,o,a=this.toBBox,s=h(e,0,t,a),l=h(e,i-t,i,a),u=m(s)+m(l);for(n=t;n<i-t;n++)o=e.children[n],d(s,e.leaf?a(o):o),u+=m(s);for(n=i-t-1;n>=t;n--)o=e.children[n],d(l,e.leaf?a(o):o),u+=m(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)d(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():c(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}},e.default=s}(this.rbush=this.rbush||{})}.call(t$2.ext),t$2.ext.rbush=t$2.ext.rbush.default,t$2.render={},t$2.render.VectorContext=function(){},t$2.render.VectorContext.prototype.drawCustom=function(e,t,i){},t$2.render.VectorContext.prototype.drawGeometry=function(e){},t$2.render.VectorContext.prototype.setStyle=function(e){},t$2.render.VectorContext.prototype.drawCircle=function(e,t){},t$2.render.VectorContext.prototype.drawFeature=function(e,t){},t$2.render.VectorContext.prototype.drawGeometryCollection=function(e,t){},t$2.render.VectorContext.prototype.drawLineString=function(e,t){},t$2.render.VectorContext.prototype.drawMultiLineString=function(e,t){},t$2.render.VectorContext.prototype.drawMultiPoint=function(e,t){},t$2.render.VectorContext.prototype.drawMultiPolygon=function(e,t){},t$2.render.VectorContext.prototype.drawPoint=function(e,t){},t$2.render.VectorContext.prototype.drawPolygon=function(e,t){},t$2.render.VectorContext.prototype.drawText=function(e,t){},t$2.render.VectorContext.prototype.setFillStrokeStyle=function(e,t){},t$2.render.VectorContext.prototype.setImageStyle=function(e,t){},t$2.render.VectorContext.prototype.setTextStyle=function(e,t){},t$2.render.ReplayGroup={},t$2.render.ReplayGroup=function(){},t$2.render.ReplayGroup.prototype.getReplay=function(e,t){},t$2.render.ReplayGroup.prototype.isEmpty=function(){},t$2.render.ReplayType={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},t$2.geom.flat.length={},t$2.geom.flat.length.lineString=function(e,t,i,r){var n,o=e[t],a=e[t+1],s=0;for(n=t+r;n<i;n+=r){var l=e[n],u=e[n+1];s+=Math.sqrt((l-o)*(l-o)+(u-a)*(u-a)),o=l,a=u}return s},t$2.geom.flat.length.linearRing=function(e,t,i,r){var n=t$2.geom.flat.length.lineString(e,t,i,r),o=e[i-r]-e[t],a=e[i-r+1]-e[t+1];return n+=Math.sqrt(o*o+a*a)},t$2.geom.flat.textpath={},t$2.geom.flat.textpath.lineString=function(e,t,i,r,n,o,a,s){for(var l,u,c,h=[],d=e[t]>e[i-r],f=n.length,p=e[t],_=e[t+1],m=e[t+=r],$=e[t+1],g=0,v=Math.sqrt(Math.pow(m-p,2)+Math.pow($-_,2)),y="",x=0,b=0;b<f;++b){u=d?f-b-1:b;var w=n.charAt(u),C=o(y=d?w+y:y+w)-x;x+=C;for(var T=a+C/2;t<i-r&&g+v<T;)p=m,_=$,m=e[t+=r],$=e[t+1],g+=v,v=Math.sqrt(Math.pow(m-p,2)+Math.pow($-_,2));var S=T-g,E=Math.atan2($-_,m-p);if(d&&(E+=E>0?-Math.PI:Math.PI),void 0!==c){var A=E-c;if(A+=A>Math.PI?-2*Math.PI:A<-Math.PI?2*Math.PI:0,Math.abs(A)>s)return null}var P=S/v,I=t$2.math.lerp(p,m,P),M=t$2.math.lerp(_,$,P);c==E?(d&&(l[0]=I,l[1]=M,l[2]=C/2),l[4]=y):(x=C,l=[I,M,C/2,E,y=w],d?h.unshift(l):h.push(l),c=E),a+=C}return h},t$2.structs.LRUCache=function(e){t$2.events.EventTarget.call(this),this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t$2.inherits(t$2.structs.LRUCache,t$2.events.EventTarget),t$2.structs.LRUCache.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},t$2.structs.LRUCache.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(t$2.events.EventType.CLEAR)},t$2.structs.LRUCache.prototype.containsKey=function(e){return this.entries_.hasOwnProperty(e)},t$2.structs.LRUCache.prototype.forEach=function(e,t){for(var i=this.oldest_;i;)e.call(t,i.value_,i.key_,this),i=i.newer},t$2.structs.LRUCache.prototype.get=function(e){var t=this.entries_[e];return t$2.asserts.assert(void 0!==t,15),t===this.newest_||(t===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(t.newer.older=t.older,t.older.newer=t.newer),t.newer=null,t.older=this.newest_,this.newest_.newer=t,this.newest_=t),t.value_},t$2.structs.LRUCache.prototype.remove=function(e){var t=this.entries_[e];return t$2.asserts.assert(void 0!==t,15),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_},t$2.structs.LRUCache.prototype.getCount=function(){return this.count_},t$2.structs.LRUCache.prototype.getKeys=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t},t$2.structs.LRUCache.prototype.getValues=function(){var e,t=new Array(this.count_),i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t},t$2.structs.LRUCache.prototype.peekLast=function(){return this.oldest_.value_},t$2.structs.LRUCache.prototype.peekLastKey=function(){return this.oldest_.key_},t$2.structs.LRUCache.prototype.peekFirstKey=function(){return this.newest_.key_},t$2.structs.LRUCache.prototype.pop=function(){var e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_},t$2.structs.LRUCache.prototype.replace=function(e,t){this.get(e),this.entries_[e].value_=t},t$2.structs.LRUCache.prototype.set=function(e,t){t$2.asserts.assert(!(e in this.entries_),16);var i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_},t$2.structs.LRUCache.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},t$2.render.canvas={},t$2.render.canvas.defaultFont="10px sans-serif",t$2.render.canvas.defaultFillStyle=[0,0,0,1],t$2.render.canvas.defaultLineCap="round",t$2.render.canvas.defaultLineDash=[],t$2.render.canvas.defaultLineDashOffset=0,t$2.render.canvas.defaultLineJoin="round",t$2.render.canvas.defaultMiterLimit=10,t$2.render.canvas.defaultStrokeStyle=[0,0,0,1],t$2.render.canvas.defaultTextAlign="center",t$2.render.canvas.defaultTextBaseline="middle",t$2.render.canvas.defaultPadding=[0,0,0,0],t$2.render.canvas.defaultLineWidth=1,t$2.render.canvas.labelCache=new t$2.structs.LRUCache,t$2.render.canvas.checkedFonts_={},t$2.render.canvas.measureContext_=null,t$2.render.canvas.textHeights_={},t$2.render.canvas.checkFont=function(){var e,t,i=t$2.render.canvas.checkedFonts_,r=t$2.render.canvas.labelCache,n="wmytzilWMYTZIL@#/&?$%10";function o(e){var i=t$2.render.canvas.getMeasureContext();i.font="32px monospace",t=i.measureText(n).width;var r=!0;"monospace"!=e&&(i.font="32px "+e+",monospace",r=i.measureText(n).width!=t);return r}function a(){var t=!0;for(var n in i)i[n]<60&&(o(n)?(i[n]=60,t$2.obj.clear(t$2.render.canvas.textHeights_),t$2.render.canvas.measureContext_=null,r.clear()):(++i[n],t=!1));t&&(window.clearInterval(e),e=void 0)}return function(t){var r=t$2.css.getFontFamilies(t);if(r)for(var n=0,s=r.length;n<s;++n){var l=r[n];l in i||(i[l]=60,o(l)||(i[l]=0,void 0===e&&(e=window.setInterval(a,32))))}}}(),t$2.render.canvas.getMeasureContext=function(){var e=t$2.render.canvas.measureContext_;return e||(e=t$2.render.canvas.measureContext_=t$2.dom.createCanvasContext2D(1,1)),e},t$2.render.canvas.measureTextHeight=function(){var e=t$2.render.canvas.textHeights_;return function(t){var i=e[t];return null==i&&(i=e[t]=19),i}}(),t$2.render.canvas.measureTextWidth=function(e,t){var i=t$2.render.canvas.getMeasureContext();return e!=i.font&&(i.font=e),i.measureText(t).width},t$2.render.canvas.rotateAtOffset=function(e,t,i,r){0!==t&&(e.translate(i,r),e.rotate(t),e.translate(-i,-r))},t$2.render.canvas.resetTransform_=t$2.transform.create(),t$2.render.canvas.drawImage=function(e,t,i,r,n,o,a,s,l,u,c){var h;1!=i&&(h=e.globalAlpha,e.globalAlpha=h*i),t&&e.setTransform.apply(e,t),e.drawImage(r,n,o,a,s,l,u,a*c,s*c),h&&(e.globalAlpha=h),t&&e.setTransform.apply(e,t$2.render.canvas.resetTransform_)},t$2.render.canvas.Instruction={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},t$2.render.replay={},t$2.render.replay.ORDER=[t$2.render.ReplayType.POLYGON,t$2.render.ReplayType.CIRCLE,t$2.render.ReplayType.LINE_STRING,t$2.render.ReplayType.IMAGE,t$2.render.ReplayType.TEXT,t$2.render.ReplayType.DEFAULT],t$2.render.replay.TEXT_ALIGN={},t$2.render.replay.TEXT_ALIGN.left=0,t$2.render.replay.TEXT_ALIGN.end=0,t$2.render.replay.TEXT_ALIGN.center=.5,t$2.render.replay.TEXT_ALIGN.right=1,t$2.render.replay.TEXT_ALIGN.start=1,t$2.render.replay.TEXT_ALIGN.top=0,t$2.render.replay.TEXT_ALIGN.middle=.5,t$2.render.replay.TEXT_ALIGN.hanging=.2,t$2.render.replay.TEXT_ALIGN.alphabetic=.8,t$2.render.replay.TEXT_ALIGN.ideographic=.8,t$2.render.replay.TEXT_ALIGN.bottom=1,t$2.render.canvas.Replay=function(e,t,i,r,n,o){t$2.render.VectorContext.call(this),this.declutterTree=o,this.tmpExtent_=t$2.extent.createEmpty(),this.tolerance=e,this.maxExtent=t,this.overlaps=n,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=i,this.fillOrigin_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=t$2.transform.create(),this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0,this.tmpLocalTransform_=t$2.transform.create(),this.resetTransform_=t$2.transform.create()},t$2.inherits(t$2.render.canvas.Replay,t$2.render.VectorContext),t$2.render.canvas.Replay.prototype.replayTextBackground_=function(e,t,i,r,n,o,a){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,i),e.lineTo.apply(e,r),e.lineTo.apply(e,n),e.lineTo.apply(e,t),o&&(this.fillOrigin_=o[2],this.fill_(e)),a&&(this.setStrokeStyle_(e,a),e.stroke())},t$2.render.canvas.Replay.prototype.replayImage_=function(e,t,i,r,n,o,a,s,l,u,c,h,d,f,p,_,m,$){var g=m||$,v=this.tmpLocalTransform_;t-=n*=d,i-=o*=d,f&&(t=Math.round(t),i=Math.round(i));var y,x,b,w,C=p+u>r.width?r.width-u:p,T=s+c>r.height?r.height-c:s,S=this.tmpExtent_,E=_[3]+C*d+_[1],A=_[0]+T*d+_[2],P=t-_[3],I=i-_[0];(g||0!==h)&&(y=[P,I],x=[P+E,I],b=[P+E,I+A],w=[P,I+A]);var M=null;if(0!==h){var O=t+n,D=i+o;M=t$2.transform.compose(v,O,D,1,1,h,-O,-D),t$2.extent.createOrUpdateEmpty(S),t$2.extent.extendCoordinate(S,t$2.transform.apply(v,y)),t$2.extent.extendCoordinate(S,t$2.transform.apply(v,x)),t$2.extent.extendCoordinate(S,t$2.transform.apply(v,b)),t$2.extent.extendCoordinate(S,t$2.transform.apply(v,w))}else t$2.extent.createOrUpdate(P,I,P+E,I+A,S);var R=e.canvas,L=S[0]<=R.width&&S[2]>=0&&S[1]<=R.height&&S[3]>=0;if(a){if(!L&&1==a[4])return;t$2.extent.extend(a,S);var B=L?[e,M?M.slice(0):null,l,r,u,c,C,T,t,i,d]:null;B&&g&&B.push(m,$,y,x,b,w),a.push(B)}else L&&(g&&this.replayTextBackground_(e,y,x,b,w,m,$),t$2.render.canvas.drawImage(e,M,l,r,u,c,C,T,t,i,d))},t$2.render.canvas.Replay.prototype.applyPixelRatio=function(e){var t=this.pixelRatio;return 1==t?e:e.map((function(e){return e*t}))},t$2.render.canvas.Replay.prototype.appendFlatCoordinates=function(e,t,i,r,n,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(t+=r);var l,u,c,h=[e[t],e[t+1]],d=[NaN,NaN],f=!0;for(l=t+r;l<i;l+=r)d[0]=e[l],d[1]=e[l+1],(c=t$2.extent.coordinateRelationship(s,d))!==u?(f&&(this.coordinates[a++]=h[0],this.coordinates[a++]=h[1]),this.coordinates[a++]=d[0],this.coordinates[a++]=d[1],f=!1):c===t$2.extent.Relationship.INTERSECTING?(this.coordinates[a++]=d[0],this.coordinates[a++]=d[1],f=!1):f=!0,h[0]=d[0],h[1]=d[1],u=c;return(n&&f||l===t+r)&&(this.coordinates[a++]=h[0],this.coordinates[a++]=h[1]),a},t$2.render.canvas.Replay.prototype.drawCustomCoordinates_=function(e,t,i,r,n){for(var o=0,a=i.length;o<a;++o){var s=i[o],l=this.appendFlatCoordinates(e,t,s,r,!1,!1);n.push(l),t=s}return t},t$2.render.canvas.Replay.prototype.drawCustom=function(e,t,i){this.beginGeometry(e,t);var r,n,o,a,s,l=e.getType(),u=e.getStride(),c=this.coordinates.length;if(l==t$2.geom.GeometryType.MULTI_POLYGON){r=(e=e).getOrientedFlatCoordinates(),a=[];var h=e.getEndss();s=0;for(var d=0,f=h.length;d<f;++d){var p=[];s=this.drawCustomCoordinates_(r,s,h[d],u,p),a.push(p)}this.instructions.push([t$2.render.canvas.Instruction.CUSTOM,c,a,e,i,t$2.geom.flat.inflate.coordinatesss])}else l==t$2.geom.GeometryType.POLYGON||l==t$2.geom.GeometryType.MULTI_LINE_STRING?(o=[],r=l==t$2.geom.GeometryType.POLYGON?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),s=this.drawCustomCoordinates_(r,0,e.getEnds(),u,o),this.instructions.push([t$2.render.canvas.Instruction.CUSTOM,c,o,e,i,t$2.geom.flat.inflate.coordinatess])):l==t$2.geom.GeometryType.LINE_STRING||l==t$2.geom.GeometryType.MULTI_POINT?(r=e.getFlatCoordinates(),n=this.appendFlatCoordinates(r,0,r.length,u,!1,!1),this.instructions.push([t$2.render.canvas.Instruction.CUSTOM,c,n,e,i,t$2.geom.flat.inflate.coordinates])):l==t$2.geom.GeometryType.POINT&&(r=e.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),n=this.coordinates.length,this.instructions.push([t$2.render.canvas.Instruction.CUSTOM,c,n,e,i]));this.endGeometry(e,t)},t$2.render.canvas.Replay.prototype.beginGeometry=function(e,t){this.beginGeometryInstruction1_=[t$2.render.canvas.Instruction.BEGIN_GEOMETRY,t,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[t$2.render.canvas.Instruction.BEGIN_GEOMETRY,t,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t$2.render.canvas.Replay.prototype.fill_=function(e){if(this.fillOrigin_){var t=t$2.transform.apply(this.renderedTransform_,this.fillOrigin_.slice());e.translate(t[0],t[1]),e.rotate(this.viewRotation_)}e.fill(),this.fillOrigin_&&e.setTransform.apply(e,t$2.render.canvas.resetTransform_)},t$2.render.canvas.Replay.prototype.setStrokeStyle_=function(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],t$2.has.CANVAS_LINE_DASH&&(e.lineDashOffset=t[7],e.setLineDash(t[6]))},t$2.render.canvas.Replay.prototype.renderDeclutter_=function(e,t){if(e&&e.length>5){var i=e[4];if(1==i||i==e.length-5){var r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};if(!this.declutterTree.collides(r)){this.declutterTree.insert(r);for(var n=t$2.render.canvas.drawImage,o=5,a=e.length;o<a;++o){var s=e[o];s&&(s.length>11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),n.apply(void 0,s))}}e.length=5,t$2.extent.createOrUpdateEmpty(e)}}},t$2.render.canvas.Replay.prototype.replay_=function(e,t,i,r,n,o){var a;this.pixelCoordinates_&&t$2.array.equals(t,this.renderedTransform_)?a=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),a=t$2.geom.flat.transform.transform2D(this.coordinates,0,this.coordinates.length,2,t,this.pixelCoordinates_),t$2.transform.setFromArray(this.renderedTransform_,t));for(var s,l,u,c,h,d,f,p,_,m=!t$2.obj.isEmpty(i),$=0,g=r.length,v=0,y=0,x=0,b=null,w=null,C=this.coordinateCache_,T=this.viewRotation_,S={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},E=this.instructions!=r||this.overlaps?0:200;$<g;){var A,P,I,M=r[$];switch(M[0]){case t$2.render.canvas.Instruction.BEGIN_GEOMETRY:A=M[1],m&&i[t$2.getUid(A).toString()]||!A.getGeometry()?$=M[2]:void 0===o||t$2.extent.intersects(o,A.getGeometry().getExtent())?++$:$=M[2]+1;break;case t$2.render.canvas.Instruction.BEGIN_PATH:y>E&&(this.fill_(e),y=0),x>E&&(e.stroke(),x=0),!y&&!x&&(e.beginPath(),c=h=NaN),++$;break;case t$2.render.canvas.Instruction.CIRCLE:var O=a[v=M[1]],D=a[v+1],R=a[v+2]-O,L=a[v+3]-D,B=Math.sqrt(R*R+L*L);e.moveTo(O+B,D),e.arc(O,D,B,0,2*Math.PI,!0),++$;break;case t$2.render.canvas.Instruction.CLOSE_PATH:e.closePath(),++$;break;case t$2.render.canvas.Instruction.CUSTOM:v=M[1],s=M[2];var N=M[3],F=M[4],z=6==M.length?M[5]:void 0;S.geometry=N,S.feature=A,$ in C||(C[$]=[]);var k=C[$];z?z(a,v,s,2,k):(k[0]=a[v],k[1]=a[v+1],k.length=2),F(k,S),++$;break;case t$2.render.canvas.Instruction.DRAW_IMAGE:v=M[1],s=M[2],_=M[3],l=M[4],u=M[5],p=n?null:M[6];var V,U,X,H=M[7],G=M[8],W=M[9],Y=M[10],q=M[11],j=M[12],Z=M[13],K=M[14],Q=M[15];for(M.length>16?(V=M[16],U=M[17],X=M[18]):(V=t$2.render.canvas.defaultPadding,U=X=!1),q&&(j+=T);v<s;v+=2)this.replayImage_(e,a[v],a[v+1],_,l,u,p,H,G,W,Y,j,Z,K,Q,V,U?b:null,X?w:null);this.renderDeclutter_(p,A),++$;break;case t$2.render.canvas.Instruction.DRAW_CHARS:var J=M[1],ee=M[2],te=M[3];p=n?null:M[4];var ie=M[5],re=M[6],ne=M[7],oe=M[8],ae=M[9],se=M[10],le=M[11],ue=M[12],ce=M[13],he=M[14],de=t$2.geom.flat.length.lineString(a,J,ee,2),fe=oe(ue);if(ie||fe<=de){var pe=this.textStates[ce].textAlign,_e=(de-fe)*t$2.render.replay.TEXT_ALIGN[pe],me=t$2.geom.flat.textpath.lineString(a,J,ee,2,ue,oe,_e,ne);if(me){var $e,ge,ve,ye,xe;if(se)for($e=0,ge=me.length;$e<ge;++$e)ve=(xe=me[$e])[4],ye=this.getImage(ve,ce,"",se),l=xe[2]+le,u=te*ye.height+2*(.5-te)*le-ae,this.replayImage_(e,xe[0],xe[1],ye,l,u,p,ye.height,1,0,0,xe[3],he,!1,ye.width,t$2.render.canvas.defaultPadding,null,null);if(re)for($e=0,ge=me.length;$e<ge;++$e)ve=(xe=me[$e])[4],ye=this.getImage(ve,ce,re,""),l=xe[2],u=te*ye.height-ae,this.replayImage_(e,xe[0],xe[1],ye,l,u,p,ye.height,1,0,0,xe[3],he,!1,ye.width,t$2.render.canvas.defaultPadding,null,null)}}this.renderDeclutter_(p,A),++$;break;case t$2.render.canvas.Instruction.END_GEOMETRY:if(void 0!==n){var be=n(A=M[1]);if(be)return be}++$;break;case t$2.render.canvas.Instruction.FILL:E?y++:this.fill_(e),++$;break;case t$2.render.canvas.Instruction.MOVE_TO_LINE_TO:for(v=M[1],s=M[2],P=a[v],f=(I=a[v+1])+.5|0,((d=P+.5|0)!==c||f!==h)&&(e.moveTo(P,I),c=d,h=f),v+=2;v<s;v+=2)d=(P=a[v])+.5|0,f=(I=a[v+1])+.5|0,(v==s-2||d!==c||f!==h)&&(e.lineTo(P,I),c=d,h=f);++$;break;case t$2.render.canvas.Instruction.SET_FILL_STYLE:b=M,this.fillOrigin_=M[2],y&&(this.fill_(e),y=0,x&&(e.stroke(),x=0)),e.fillStyle=M[1],++$;break;case t$2.render.canvas.Instruction.SET_STROKE_STYLE:w=M,x&&(e.stroke(),x=0),this.setStrokeStyle_(e,M),++$;break;case t$2.render.canvas.Instruction.STROKE:E?x++:e.stroke(),++$;break;default:++$}}y&&this.fill_(e),x&&e.stroke()},t$2.render.canvas.Replay.prototype.replay=function(e,t,i,r){this.viewRotation_=i,this.replay_(e,t,r,this.instructions,void 0,void 0)},t$2.render.canvas.Replay.prototype.replayHitDetection=function(e,t,i,r,n,o){return this.viewRotation_=i,this.replay_(e,t,r,this.hitDetectionInstructions,n,o)},t$2.render.canvas.Replay.prototype.reverseHitDetectionInstructions=function(){var e=this.hitDetectionInstructions;e.reverse();var t,i,r,n=e.length,o=-1;for(t=0;t<n;++t)(r=(i=e[t])[0])==t$2.render.canvas.Instruction.END_GEOMETRY?o=t:r==t$2.render.canvas.Instruction.BEGIN_GEOMETRY&&(i[2]=t,t$2.array.reverseSubArray(this.hitDetectionInstructions,o,t),o=-1)},t$2.render.canvas.Replay.prototype.setFillStrokeStyle=function(e,t){var i=this.state;if(e){var r=e.getColor();i.fillStyle=t$2.colorlike.asColorLike(r||t$2.render.canvas.defaultFillStyle)}else i.fillStyle=void 0;if(t){var n=t.getColor();i.strokeStyle=t$2.colorlike.asColorLike(n||t$2.render.canvas.defaultStrokeStyle);var o=t.getLineCap();i.lineCap=void 0!==o?o:t$2.render.canvas.defaultLineCap;var a=t.getLineDash();i.lineDash=a?a.slice():t$2.render.canvas.defaultLineDash;var s=t.getLineDashOffset();i.lineDashOffset=s||t$2.render.canvas.defaultLineDashOffset;var l=t.getLineJoin();i.lineJoin=void 0!==l?l:t$2.render.canvas.defaultLineJoin;var u=t.getWidth();i.lineWidth=void 0!==u?u:t$2.render.canvas.defaultLineWidth;var c=t.getMiterLimit();i.miterLimit=void 0!==c?c:t$2.render.canvas.defaultMiterLimit,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},t$2.render.canvas.Replay.prototype.applyFill=function(e,t){var i=e.fillStyle,r=[t$2.render.canvas.Instruction.SET_FILL_STYLE,i];if("string"!=typeof i){var n=t.getExtent();r.push([n[0],n[3]])}this.instructions.push(r)},t$2.render.canvas.Replay.prototype.applyStroke=function(e){this.instructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio])},t$2.render.canvas.Replay.prototype.updateFillStyle=function(e,t,i){var r=e.fillStyle;("string"!=typeof r||e.currentFillStyle!=r)&&(t.call(this,e,i),e.currentFillStyle=r)},t$2.render.canvas.Replay.prototype.updateStrokeStyle=function(e,t){var i=e.strokeStyle,r=e.lineCap,n=e.lineDash,o=e.lineDashOffset,a=e.lineJoin,s=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=i||e.currentLineCap!=r||n!=e.currentLineDash&&!t$2.array.equals(e.currentLineDash,n)||e.currentLineDashOffset!=o||e.currentLineJoin!=a||e.currentLineWidth!=s||e.currentMiterLimit!=l)&&(t.call(this,e),e.currentStrokeStyle=i,e.currentLineCap=r,e.currentLineDash=n,e.currentLineDashOffset=o,e.currentLineJoin=a,e.currentLineWidth=s,e.currentMiterLimit=l)},t$2.render.canvas.Replay.prototype.endGeometry=function(e,t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[t$2.render.canvas.Instruction.END_GEOMETRY,t];this.instructions.push(i),this.hitDetectionInstructions.push(i)},t$2.render.canvas.Replay.prototype.finish=t$2.nullFunction,t$2.render.canvas.Replay.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=t$2.extent.clone(this.maxExtent),this.maxLineWidth>0)){var e=this.resolution*(this.maxLineWidth+1)/2;t$2.extent.buffer(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t$2.render.canvas.ImageReplay=function(e,t,i,r,n,o){t$2.render.canvas.Replay.call(this,e,t,i,r,n,o),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0},t$2.inherits(t$2.render.canvas.ImageReplay,t$2.render.canvas.Replay),t$2.render.canvas.ImageReplay.prototype.drawCoordinates_=function(e,t,i,r){return this.appendFlatCoordinates(e,t,i,r,!1,!1)},t$2.render.canvas.ImageReplay.prototype.drawPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(e,t)}},t$2.render.canvas.ImageReplay.prototype.drawMultiPoint=function(e,t){if(this.image_){this.beginGeometry(e,t);var i=e.getFlatCoordinates(),r=e.getStride(),n=this.coordinates.length,o=this.drawCoordinates_(i,0,i.length,r);this.instructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,n,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(e,t)}},t$2.render.canvas.ImageReplay.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.snapToPixel_=void 0,this.width_=void 0},t$2.render.canvas.ImageReplay.prototype.setImageStyle=function(e,t){var i=e.getAnchor(),r=e.getSize(),n=e.getHitDetectionImage(1),o=e.getImage(1),a=e.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=t,this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScale(),this.snapToPixel_=e.getSnapToPixel(),this.width_=r[0]},t$2.render.canvas.LineStringReplay=function(e,t,i,r,n,o){t$2.render.canvas.Replay.call(this,e,t,i,r,n,o)},t$2.inherits(t$2.render.canvas.LineStringReplay,t$2.render.canvas.Replay),t$2.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_=function(e,t,i,r){var n=this.coordinates.length,o=this.appendFlatCoordinates(e,t,i,r,!1,!1),a=[t$2.render.canvas.Instruction.MOVE_TO_LINE_TO,n,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},t$2.render.canvas.LineStringReplay.prototype.drawLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],[t$2.render.canvas.Instruction.BEGIN_PATH]);var o=e.getFlatCoordinates(),a=e.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.STROKE]),this.endGeometry(e,t)}},t$2.render.canvas.LineStringReplay.prototype.drawMultiLineString=function(e,t){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],[t$2.render.canvas.Instruction.BEGIN_PATH]);var o,a,s=e.getEnds(),l=e.getFlatCoordinates(),u=e.getStride(),c=0;for(o=0,a=s.length;o<a;++o)c=this.drawFlatCoordinates_(l,c,s[o],u);this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.STROKE]),this.endGeometry(e,t)}},t$2.render.canvas.LineStringReplay.prototype.finish=function(){var e=this.state;null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push([t$2.render.canvas.Instruction.STROKE]),this.reverseHitDetectionInstructions(),this.state=null},t$2.render.canvas.LineStringReplay.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push([t$2.render.canvas.Instruction.STROKE]),e.lastStroke=this.coordinates.length),e.lastStroke=0,t$2.render.canvas.Replay.prototype.applyStroke.call(this,e),this.instructions.push([t$2.render.canvas.Instruction.BEGIN_PATH])},t$2.render.canvas.PolygonReplay=function(e,t,i,r,n,o){t$2.render.canvas.Replay.call(this,e,t,i,r,n,o)},t$2.inherits(t$2.render.canvas.PolygonReplay,t$2.render.canvas.Replay),t$2.render.canvas.PolygonReplay.prototype.drawFlatCoordinatess_=function(e,t,i,r){var n=this.state,o=void 0!==n.fillStyle,a=null!=n.strokeStyle,s=i.length,l=[t$2.render.canvas.Instruction.BEGIN_PATH];this.instructions.push(l),this.hitDetectionInstructions.push(l);for(var u=0;u<s;++u){var c=i[u],h=this.coordinates.length,d=this.appendFlatCoordinates(e,t,c,r,!0,!a),f=[t$2.render.canvas.Instruction.MOVE_TO_LINE_TO,h,d];if(this.instructions.push(f),this.hitDetectionInstructions.push(f),a){var p=[t$2.render.canvas.Instruction.CLOSE_PATH];this.instructions.push(p),this.hitDetectionInstructions.push(p)}t=c}var _=[t$2.render.canvas.Instruction.FILL];if(this.hitDetectionInstructions.push(_),o&&this.instructions.push(_),a){var m=[t$2.render.canvas.Instruction.STROKE];this.instructions.push(m),this.hitDetectionInstructions.push(m)}return t},t$2.render.canvas.PolygonReplay.prototype.drawCircle=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_FILL_STYLE,t$2.color.asString(t$2.render.canvas.defaultFillStyle)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=e.getFlatCoordinates(),a=e.getStride(),s=this.coordinates.length;this.appendFlatCoordinates(o,0,o.length,a,!1,!1);var l=[t$2.render.canvas.Instruction.BEGIN_PATH],u=[t$2.render.canvas.Instruction.CIRCLE,s];this.instructions.push(l,u),this.hitDetectionInstructions.push(l,u);var c=[t$2.render.canvas.Instruction.FILL];if(this.hitDetectionInstructions.push(c),void 0!==i.fillStyle&&this.instructions.push(c),void 0!==i.strokeStyle){var h=[t$2.render.canvas.Instruction.STROKE];this.instructions.push(h),this.hitDetectionInstructions.push(h)}this.endGeometry(e,t)}},t$2.render.canvas.PolygonReplay.prototype.drawPolygon=function(e,t){var i=this.state;this.setFillStrokeStyles_(e),this.beginGeometry(e,t),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_FILL_STYLE,t$2.color.asString(t$2.render.canvas.defaultFillStyle)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=e.getEnds(),n=e.getOrientedFlatCoordinates(),o=e.getStride();this.drawFlatCoordinatess_(n,0,r,o),this.endGeometry(e,t)},t$2.render.canvas.PolygonReplay.prototype.drawMultiPolygon=function(e,t){var i=this.state,r=i.fillStyle,n=i.strokeStyle;if(void 0!==r||void 0!==n){this.setFillStrokeStyles_(e),this.beginGeometry(e,t),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_FILL_STYLE,t$2.color.asString(t$2.render.canvas.defaultFillStyle)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o,a,s=e.getEndss(),l=e.getOrientedFlatCoordinates(),u=e.getStride(),c=0;for(o=0,a=s.length;o<a;++o)c=this.drawFlatCoordinatess_(l,c,s[o],u);this.endGeometry(e,t)}},t$2.render.canvas.PolygonReplay.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e){var t,i,r=this.coordinates;for(t=0,i=r.length;t<i;++t)r[t]=t$2.geom.flat.simplify.snap(r[t],e)}},t$2.render.canvas.PolygonReplay.prototype.setFillStrokeStyles_=function(e){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.applyFill,e),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},t$2.geom.flat.straightchunk={},t$2.geom.flat.straightchunk.lineString=function(e,t,i,r,n){var o,a,s,l,u,c,h,d,f,p=i,_=i,m=0,$=0,g=i;for(o=i;o<r;o+=n){var v=t[o],y=t[o+1];void 0!==l&&(d=v-l,f=y-u,s=Math.sqrt(d*d+f*f),void 0!==c&&($+=a,Math.acos((c*d+h*f)/(a*s))>e&&($>m&&(m=$,p=g,_=o),$=0,g=o-n)),a=s,c=d,h=f),l=v,u=y}return($+=s)>m?[g,o]:[p,_]},t$2.style.TextPlacement={POINT:"point",LINE:"line"},t$2.render.canvas.TextReplay=function(e,t,i,r,n,o){t$2.render.canvas.Replay.call(this,e,t,i,r,n,o),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},t$2.render.canvas.labelCache.prune()},t$2.inherits(t$2.render.canvas.TextReplay,t$2.render.canvas.Replay),t$2.render.canvas.TextReplay.measureTextWidths=function(e,t,i){var r,n,o=t.length,a=0;for(n=0;n<o;++n)r=t$2.render.canvas.measureTextWidth(e,t[n]),a=Math.max(a,r),i.push(r);return a},t$2.render.canvas.TextReplay.prototype.drawText=function(e,t){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o,a,s=this.coordinates.length,l=e.getType(),u=null,c=2,h=2;if(n.placement===t$2.style.TextPlacement.LINE){if(!t$2.extent.intersects(this.getBufferedMaxExtent(),e.getExtent()))return;var d;if(u=e.getFlatCoordinates(),h=e.getStride(),l==t$2.geom.GeometryType.LINE_STRING)d=[u.length];else if(l==t$2.geom.GeometryType.MULTI_LINE_STRING)d=e.getEnds();else if(l==t$2.geom.GeometryType.POLYGON)d=e.getEnds().slice(0,1);else if(l==t$2.geom.GeometryType.MULTI_POLYGON){var f=e.getEndss();for(d=[],o=0,a=f.length;o<a;++o)d.push(f[o][0])}this.beginGeometry(e,t);for(var p,_=n.textAlign,m=0,$=0,g=d.length;$<g;++$){if(null==_){var v=t$2.geom.flat.straightchunk.lineString(n.maxAngle,u,m,d[$],h);m=v[0],p=v[1]}else p=d[$];for(o=m;o<p;o+=h)this.coordinates.push(u[o],u[o+1]);c=this.coordinates.length,m=d[$],this.drawChars_(s,c,this.declutterGroup_),s=c}this.endGeometry(e,t)}else{var y=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),x=y.width/this.pixelRatio;switch(l){case t$2.geom.GeometryType.POINT:case t$2.geom.GeometryType.MULTI_POINT:c=(u=e.getFlatCoordinates()).length;break;case t$2.geom.GeometryType.LINE_STRING:u=e.getFlatMidpoint();break;case t$2.geom.GeometryType.CIRCLE:u=e.getCenter();break;case t$2.geom.GeometryType.MULTI_LINE_STRING:c=(u=e.getFlatMidpoints()).length;break;case t$2.geom.GeometryType.POLYGON:if(u=e.getFlatInteriorPoint(),!n.overflow&&u[2]/this.resolution<x)return;h=3;break;case t$2.geom.GeometryType.MULTI_POLYGON:var b=e.getFlatInteriorPoints();for(u=[],o=0,a=b.length;o<a;o+=3)(n.overflow||b[o+2]/this.resolution>=x)&&u.push(b[o],b[o+1]);if(0==(c=u.length))return}c=this.appendFlatCoordinates(u,0,c,h,!1,!1),this.beginGeometry(e,t),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,e),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(y,s,c),this.endGeometry(e,t)}}},t$2.render.canvas.TextReplay.prototype.getImage=function(e,t,i,r){var n,o=r+t+e+i+this.pixelRatio,a=t$2.render.canvas.labelCache;if(!a.containsKey(o)){var s=r?this.strokeStates[r]||this.textStrokeState_:null,l=i?this.fillStates[i]||this.textFillState_:null,u=this.textStates[t]||this.textState_,c=this.pixelRatio,h=u.scale*c,d=t$2.render.replay.TEXT_ALIGN[u.textAlign||t$2.render.canvas.defaultTextAlign],f=r&&s.lineWidth?s.lineWidth:0,p=e.split("\n"),_=p.length,m=[],$=t$2.render.canvas.TextReplay.measureTextWidths(u.font,p,m),g=t$2.render.canvas.measureTextHeight(u.font),v=g*_,y=$+f,x=t$2.dom.createCanvasContext2D(Math.ceil(y*h),Math.ceil((v+f)*h));n=x.canvas,a.set(o,n),1!=h&&x.scale(h,h),x.font=u.font,r&&(x.strokeStyle=s.strokeStyle,x.lineWidth=f*(t$2.has.SAFARI?h:1),x.lineCap=s.lineCap,x.lineJoin=s.lineJoin,x.miterLimit=s.miterLimit,t$2.has.CANVAS_LINE_DASH&&s.lineDash.length&&(x.setLineDash(s.lineDash),x.lineDashOffset=s.lineDashOffset)),i&&(x.fillStyle=l.fillStyle),x.textBaseline="middle",x.textAlign="center";var b,w=.5-d,C=d*n.width/h+w*f;if(r)for(b=0;b<_;++b)x.strokeText(p[b],C+w*m[b],.5*(f+g)+b*g);if(i)for(b=0;b<_;++b)x.fillText(p[b],C+w*m[b],.5*(f+g)+b*g)}return a.get(o)},t$2.render.canvas.TextReplay.prototype.drawTextImage_=function(e,t,i){var r=this.textState_,n=this.textStrokeState_,o=this.pixelRatio,a=t$2.render.replay.TEXT_ALIGN[r.textAlign||t$2.render.canvas.defaultTextAlign],s=t$2.render.replay.TEXT_ALIGN[r.textBaseline],l=n&&n.lineWidth?n.lineWidth:0,u=a*e.width/o+2*(.5-a)*l,c=s*e.height/o+2*(.5-s)*l;this.instructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,t,i,e,(u-this.textOffsetX_)*o,(c-this.textOffsetY_)*o,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,e.width,r.padding==t$2.render.canvas.defaultPadding?t$2.render.canvas.defaultPadding:r.padding.map((function(e){return e*o})),!!r.backgroundFill,!!r.backgroundStroke]),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.DRAW_IMAGE,t,i,e,(u-this.textOffsetX_)*o,(c-this.textOffsetY_)*o,this.declutterGroup_,e.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/o,!0,e.width,r.padding,!!r.backgroundFill,!!r.backgroundStroke])},t$2.render.canvas.TextReplay.prototype.drawChars_=function(e,t,i){var r=this.textStrokeState_,n=this.textState_,o=this.textFillState_,a=this.strokeKey_;r&&(a in this.strokeStates||(this.strokeStates[a]={strokeStyle:r.strokeStyle,lineCap:r.lineCap,lineDashOffset:r.lineDashOffset,lineWidth:r.lineWidth,lineJoin:r.lineJoin,miterLimit:r.miterLimit,lineDash:r.lineDash}));var s=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||t$2.render.canvas.defaultTextAlign,scale:n.scale});var l=this.fillKey_;o&&(l in this.fillStates||(this.fillStates[l]={fillStyle:o.fillStyle}));var u=this.pixelRatio,c=t$2.render.replay.TEXT_ALIGN[n.textBaseline],h=this.textOffsetY_*u,d=this.text_,f=n.font,p=n.scale,_=r?r.lineWidth*p/2:0,m=this.widths_[f];m||(this.widths_[f]=m={}),this.instructions.push([t$2.render.canvas.Instruction.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=m[e];return t||(t=m[e]=t$2.render.canvas.measureTextWidth(f,e)),t*p*u},h,a,_*u,d,s,1]),this.hitDetectionInstructions.push([t$2.render.canvas.Instruction.DRAW_CHARS,e,t,c,i,n.overflow,l,n.maxAngle,function(e){var t=m[e];return t||(t=m[e]=t$2.render.canvas.measureTextWidth(f,e)),t*p},h,a,_,d,s,1/u])},t$2.render.canvas.TextReplay.prototype.setTextStyle=function(e,t){var i,r,n;if(e){this.declutterGroup_=t;var o=e.getFill();o?((r=this.textFillState_)||(r=this.textFillState_={}),r.fillStyle=t$2.colorlike.asColorLike(o.getColor()||t$2.render.canvas.defaultFillStyle)):r=this.textFillState_=null;var a=e.getStroke();if(a){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),c=a.getMiterLimit();n.lineCap=a.getLineCap()||t$2.render.canvas.defaultLineCap,n.lineDash=s?s.slice():t$2.render.canvas.defaultLineDash,n.lineDashOffset=void 0===l?t$2.render.canvas.defaultLineDashOffset:l,n.lineJoin=a.getLineJoin()||t$2.render.canvas.defaultLineJoin,n.lineWidth=void 0===u?t$2.render.canvas.defaultLineWidth:u,n.miterLimit=void 0===c?t$2.render.canvas.defaultMiterLimit:c,n.strokeStyle=t$2.colorlike.asColorLike(a.getColor()||t$2.render.canvas.defaultStrokeStyle)}else n=this.textStrokeState_=null;i=this.textState_;var h=e.getFont()||t$2.render.canvas.defaultFont,d=e.getScale();i.overflow=e.getOverflow(),i.font=h,i.maxAngle=e.getMaxAngle(),i.placement=e.getPlacement(),i.textAlign=e.getTextAlign(),i.textBaseline=e.getTextBaseline()||t$2.render.canvas.defaultTextBaseline,i.backgroundFill=e.getBackgroundFill(),i.backgroundStroke=e.getBackgroundStroke(),i.padding=e.getPadding()||t$2.render.canvas.defaultPadding,i.scale=void 0===d?1:d;var f=e.getOffsetX(),p=e.getOffsetY(),_=e.getRotateWithView(),m=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===p?0:p,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:t$2.getUid(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=r?"string"==typeof r.fillStyle?r.fillStyle:"|"+t$2.getUid(r.fillStyle):""}else this.text_=""},t$2.render.canvas.ReplayGroup=function(e,t,i,r,n,o,a){t$2.render.ReplayGroup.call(this),this.declutterTree_=o,this.declutterGroup_=null,this.tolerance_=e,this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=i,this.renderBuffer_=a,this.replaysByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=t$2.transform.create()},t$2.inherits(t$2.render.canvas.ReplayGroup,t$2.render.ReplayGroup),t$2.render.canvas.ReplayGroup.circleArrayCache_={0:[[!0]]},t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_=function(e,t,i){var r,n=Math.floor(e.length/2);if(t>=n)for(r=n;r<t;r++)e[r][i]=!0;else if(t<n)for(r=t+1;r<n;r++)e[r][i]=!0},t$2.render.canvas.ReplayGroup.getCircleArray_=function(e){if(void 0!==t$2.render.canvas.ReplayGroup.circleArrayCache_[e])return t$2.render.canvas.ReplayGroup.circleArrayCache_[e];for(var t=2*e+1,i=new Array(t),r=0;r<t;r++)i[r]=new Array(t);for(var n=e,o=0,a=0;n>=o;)t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e+n,e+o),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e+o,e+n),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e-o,e+n),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e-n,e+o),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e-n,e-o),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e-o,e-n),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e+o,e-n),t$2.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(i,e+n,e-o),2*((a+=1+2*++o)-n)+1>0&&(a+=1-2*(n-=1));return t$2.render.canvas.ReplayGroup.circleArrayCache_[e]=i,i},t$2.render.canvas.ReplayGroup.replayDeclutter=function(e,t,i){for(var r=Object.keys(e).map(Number).sort(t$2.array.numberSafeCompareFunction),n={},o=0,a=r.length;o<a;++o)for(var s=e[r[o].toString()],l=0,u=s.length;l<u;){var c=s[l++],h=s[l++];c.replay(t,h,i,n)}},t$2.render.canvas.ReplayGroup.prototype.addDeclutter=function(e){var t=null;return this.declutterTree_&&(e?(t=this.declutterGroup_)[4]++:(t=this.declutterGroup_=t$2.extent.createEmpty()).push(1)),t},t$2.render.canvas.ReplayGroup.prototype.clip=function(e,t){var i=this.getClipCoords(t);e.beginPath(),e.moveTo(i[0],i[1]),e.lineTo(i[2],i[3]),e.lineTo(i[4],i[5]),e.lineTo(i[6],i[7]),e.clip()},t$2.render.canvas.ReplayGroup.prototype.hasReplays=function(e){for(var t in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[t],r=0,n=e.length;r<n;++r)if(e[r]in i)return!0;return!1},t$2.render.canvas.ReplayGroup.prototype.finish=function(){var e;for(e in this.replaysByZIndex_){var t,i=this.replaysByZIndex_[e];for(t in i)i[t].finish()}},t$2.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate=function(e,t,i,r,n,o,a){var s,l=2*(r=Math.round(r))+1,u=t$2.transform.compose(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-i,-e[0],-e[1]),c=this.hitDetectionContext_;c.canvas.width!==l||c.canvas.height!==l?(c.canvas.width=l,c.canvas.height=l):c.clearRect(0,0,l,l),void 0!==this.renderBuffer_&&(s=t$2.extent.createEmpty(),t$2.extent.extendCoordinate(s,e),t$2.extent.buffer(s,t*(this.renderBuffer_+r),s));var h,d,f=t$2.render.canvas.ReplayGroup.getCircleArray_(r);function p(e){for(var t=c.getImageData(0,0,l,l).data,i=0;i<l;i++)for(var r=0;r<l;r++)if(f[i][r]&&t[4*(r*l+i)+3]>0){var n;return(!(h&&(d==t$2.render.ReplayType.IMAGE||d==t$2.render.ReplayType.TEXT))||-1!==h.indexOf(e))&&(n=o(e)),n?n:void c.clearRect(0,0,l,l)}}this.declutterTree_&&(h=this.declutterTree_.all().map((function(e){return e.value})));var _,m,$,g,v,y=Object.keys(this.replaysByZIndex_).map(Number);for(y.sort(t$2.array.numberSafeCompareFunction),_=y.length-1;_>=0;--_){var x=y[_].toString();for($=this.replaysByZIndex_[x],m=t$2.render.replay.ORDER.length-1;m>=0;--m)if(void 0!==(g=$[d=t$2.render.replay.ORDER[m]]))if(!a||d!=t$2.render.ReplayType.IMAGE&&d!=t$2.render.ReplayType.TEXT){if(v=g.replayHitDetection(c,u,i,n,p,s))return v}else{var b=a[x];b?b.push(g,u.slice(0)):a[x]=[g,u.slice(0)]}}},t$2.render.canvas.ReplayGroup.prototype.getClipCoords=function(e){var t=this.maxExtent_,i=t[0],r=t[1],n=t[2],o=t[3],a=[i,r,i,o,n,o,n,r];return t$2.geom.flat.transform.transform2D(a,0,8,2,e,a),a},t$2.render.canvas.ReplayGroup.prototype.getReplay=function(e,t){var i=void 0!==e?e.toString():"0",r=this.replaysByZIndex_[i];void 0===r&&(r={},this.replaysByZIndex_[i]=r);var n=r[t];void 0===n&&(n=new(0,t$2.render.canvas.ReplayGroup.BATCH_CONSTRUCTORS_[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),r[t]=n);return n},t$2.render.canvas.ReplayGroup.prototype.getReplays=function(){return this.replaysByZIndex_},t$2.render.canvas.ReplayGroup.prototype.isEmpty=function(){return t$2.obj.isEmpty(this.replaysByZIndex_)},t$2.render.canvas.ReplayGroup.prototype.replay=function(e,t,i,r,n,o){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(t$2.array.numberSafeCompareFunction),e.save(),this.clip(e,t);var s,l,u,c,h,d,f=n||t$2.render.replay.ORDER;for(s=0,l=a.length;s<l;++s){var p=a[s].toString();for(h=this.replaysByZIndex_[p],u=0,c=f.length;u<c;++u){var _=f[u];if(void 0!==(d=h[_]))if(!o||_!=t$2.render.ReplayType.IMAGE&&_!=t$2.render.ReplayType.TEXT)d.replay(e,t,i,r);else{var m=o[p];m?m.push(d,t.slice(0)):o[p]=[d,t.slice(0)]}}}e.restore()},t$2.render.canvas.ReplayGroup.BATCH_CONSTRUCTORS_={Circle:t$2.render.canvas.PolygonReplay,Default:t$2.render.canvas.Replay,Image:t$2.render.canvas.ImageReplay,LineString:t$2.render.canvas.LineStringReplay,Polygon:t$2.render.canvas.PolygonReplay,Text:t$2.render.canvas.TextReplay},t$2.renderer={},t$2.renderer.vector={},t$2.renderer.vector.defaultOrder=function(e,t){return t$2.getUid(e)-t$2.getUid(t)},t$2.renderer.vector.getSquaredTolerance=function(e,t){var i=t$2.renderer.vector.getTolerance(e,t);return i*i},t$2.renderer.vector.getTolerance=function(e,t){return t$2.SIMPLIFY_TOLERANCE*e/t},t$2.renderer.vector.renderCircleGeometry_=function(e,t,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var a=e.getReplay(i.getZIndex(),t$2.render.ReplayType.CIRCLE);a.setFillStrokeStyle(n,o),a.drawCircle(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},t$2.renderer.vector.renderFeature=function(e,t,i,r,n,o){var a,s,l=!1;return(a=i.getImage())&&((s=a.getImageState())==t$2.ImageState.LOADED||s==t$2.ImageState.ERROR?a.unlistenImageChange(n,o):(s==t$2.ImageState.IDLE&&a.load(),s=a.getImageState(),a.listenImageChange(n,o),l=!0)),t$2.renderer.vector.renderFeature_(e,t,i,r),l},t$2.renderer.vector.renderFeature_=function(e,t,i,r){var n=i.getGeometryFunction()(t);if(n){var o=n.getSimplifiedGeometry(r);if(i.getRenderer())t$2.renderer.vector.renderGeometry_(e,o,i,t);else(0,t$2.renderer.vector.GEOMETRY_RENDERERS_[o.getType()])(e,o,i,t)}},t$2.renderer.vector.renderGeometry_=function(e,t,i,r){if(t.getType()!=t$2.geom.GeometryType.GEOMETRY_COLLECTION)e.getReplay(i.getZIndex(),t$2.render.ReplayType.DEFAULT).drawCustom(t,r,i.getRenderer());else for(var n=t.getGeometries(),o=0,a=n.length;o<a;++o)t$2.renderer.vector.renderGeometry_(e,n[o],i,r)},t$2.renderer.vector.renderGeometryCollectionGeometry_=function(e,t,i,r){var n,o,a=t.getGeometriesArray();for(n=0,o=a.length;n<o;++n){(0,t$2.renderer.vector.GEOMETRY_RENDERERS_[a[n].getType()])(e,a[n],i,r)}},t$2.renderer.vector.renderLineStringGeometry_=function(e,t,i,r){var n=i.getStroke();if(n){var o=e.getReplay(i.getZIndex(),t$2.render.ReplayType.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},t$2.renderer.vector.renderMultiLineStringGeometry_=function(e,t,i,r){var n=i.getStroke();if(n){var o=e.getReplay(i.getZIndex(),t$2.render.ReplayType.LINE_STRING);o.setFillStrokeStyle(null,n),o.drawMultiLineString(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);s.setTextStyle(a,e.addDeclutter(!1)),s.drawText(t,r)}},t$2.renderer.vector.renderMultiPolygonGeometry_=function(e,t,i,r){var n=i.getFill(),o=i.getStroke();if(o||n){var a=e.getReplay(i.getZIndex(),t$2.render.ReplayType.POLYGON);a.setFillStrokeStyle(n,o),a.drawMultiPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},t$2.renderer.vector.renderPointGeometry_=function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=t$2.ImageState.LOADED)return;var o=e.getReplay(i.getZIndex(),t$2.render.ReplayType.IMAGE);o.setImageStyle(n,e.addDeclutter(!1)),o.drawPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);s.setTextStyle(a,e.addDeclutter(!!n)),s.drawText(t,r)}},t$2.renderer.vector.renderMultiPointGeometry_=function(e,t,i,r){var n=i.getImage();if(n){if(n.getImageState()!=t$2.ImageState.LOADED)return;var o=e.getReplay(i.getZIndex(),t$2.render.ReplayType.IMAGE);o.setImageStyle(n,e.addDeclutter(!1)),o.drawMultiPoint(t,r)}var a=i.getText();if(a){var s=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);s.setTextStyle(a,e.addDeclutter(!!n)),s.drawText(t,r)}},t$2.renderer.vector.renderPolygonGeometry_=function(e,t,i,r){var n=i.getFill(),o=i.getStroke();if(n||o){var a=e.getReplay(i.getZIndex(),t$2.render.ReplayType.POLYGON);a.setFillStrokeStyle(n,o),a.drawPolygon(t,r)}var s=i.getText();if(s){var l=e.getReplay(i.getZIndex(),t$2.render.ReplayType.TEXT);l.setTextStyle(s,e.addDeclutter(!1)),l.drawText(t,r)}},t$2.renderer.vector.GEOMETRY_RENDERERS_={Point:t$2.renderer.vector.renderPointGeometry_,LineString:t$2.renderer.vector.renderLineStringGeometry_,Polygon:t$2.renderer.vector.renderPolygonGeometry_,MultiPoint:t$2.renderer.vector.renderMultiPointGeometry_,MultiLineString:t$2.renderer.vector.renderMultiLineStringGeometry_,MultiPolygon:t$2.renderer.vector.renderMultiPolygonGeometry_,GeometryCollection:t$2.renderer.vector.renderGeometryCollectionGeometry_,Circle:t$2.renderer.vector.renderCircleGeometry_};var f$5=1e20;function l$6(e,t,i,r,n,o){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function c$3(e,t,i,r,n,o,a){for(var s=0;s<t;s++){for(var l=0;l<i;l++)r[l]=e[l*t+s];for(u$4(r,n,o,a,i),l=0;l<i;l++)e[l*t+s]=n[l]}for(l=0;l<i;l++){for(s=0;s<t;s++)r[s]=e[l*t+s];for(u$4(r,n,o,a,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(n[s])}}function u$4(e,t,i,r,n){i[0]=0,r[0]=-f$5,r[1]=+f$5;for(var o=1,a=0;o<n;o++){for(var s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);s<=r[a];)a--,s=(e[o]+o*o-(e[i[a]]+i[a]*i[a]))/(2*o-2*i[a]);i[++a]=o,r[a]=s,r[a+1]=+f$5}for(o=0,a=0;o<n;o++){for(;r[a+1]<o;)a++;t[o]=(o-i[a])*(o-i[a])+e[i[a]]}}function r$b(e){e$28(e)||(e=new u$M),this._clock=e,this._eventHelper=new n$R,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=ce$1.observable(a$12.now()),this.systemTime.equalityComparer=a$12.equals,this.startTime=ce$1.observable(e.startTime),this.startTime.equalityComparer=a$12.equals,this.startTime.subscribe((function(t){e.startTime=t,this.synchronize()}),this),this.stopTime=ce$1.observable(e.stopTime),this.stopTime.equalityComparer=a$12.equals,this.stopTime.subscribe((function(t){e.stopTime=t,this.synchronize()}),this),this.currentTime=ce$1.observable(e.currentTime),this.currentTime.equalityComparer=a$12.equals,this.currentTime.subscribe((function(t){e.currentTime=t,this.synchronize()}),this),this.multiplier=ce$1.observable(e.multiplier),this.multiplier.subscribe((function(t){e.multiplier=t,this.synchronize()}),this),this.clockStep=ce$1.observable(e.clockStep),this.clockStep.subscribe((function(t){e.clockStep=t,this.synchronize()}),this),this.clockRange=ce$1.observable(e.clockRange),this.clockRange.subscribe((function(t){e.clockRange=t,this.synchronize()}),this),this.canAnimate=ce$1.observable(e.canAnimate),this.canAnimate.subscribe((function(t){e.canAnimate=t,this.synchronize()}),this),this.shouldAnimate=ce$1.observable(e.shouldAnimate),this.shouldAnimate.subscribe((function(t){e.shouldAnimate=t,this.synchronize()}),this),ce$1.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}function t$1(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,t$Z.throwInstantiationError()}function s$3(e,t){if(!e$28(e))throw new t$Z("func is required.");t=u$Y(t,!0);var i=new o$1o,r=new o$1o;function n(){if(!n.canExecute)throw new t$Z("Cannot execute command, canExecute is false.");var t,o={args:arguments,cancel:!1};return i.raiseEvent(o),o.cancel||(t=e.apply(null,arguments),r.raiseEvent(t)),t}return n.canExecute=t,ce$1.track(n,["canExecute"]),Object.defineProperties(n,{beforeExecute:{value:i},afterExecute:{value:r}}),n}l$6.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var n=t.data[4*r+3]/255;this.gridOuter[r]=1===n?0:0===n?f$5:Math.pow(Math.max(0,.5-n),2),this.gridInner[r]=1===n?f$5:0===n?0:Math.pow(Math.max(0,n-.5),2)}for(c$3(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),c$3(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var o=this.gridOuter[r]-this.gridInner[r];i[r]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return i},Object.defineProperties(r$b.prototype,{clock:{get:function(){return this._clock}}}),r$b.prototype.synchronize=function(){var e=this._clock;this.systemTime=a$12.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},r$b.prototype.isDestroyed=function(){return!1},r$b.prototype.destroy=function(){this._eventHelper.removeAll(),i$Z(this)};var o$5={};function c$2(e,t,i,r,n){return i.call(r,e[t]),ce$1.getObservable(e,t).subscribe(i,r,n)}function r$a(e,t){if(!e$28(e))throw new t$Z("command is required.");this._command=e,t=u$Y(t,u$Y.EMPTY_OBJECT),this.toggled=u$Y(t.toggled,!1),this.tooltip=u$Y(t.tooltip,""),ce$1.track(this,["toggled","tooltip"])}o$5.createCheckbox=function(e,t,i){o$1u.typeOf.string("labelText",e),o$1u.typeOf.string("checkedBinding",t);var r=document.createElement("div"),n=document.createElement("label"),o=document.createElement("input");o.type="checkbox";var a="checked: "+t;return e$28(i)&&(a+=", enable: "+i),o.setAttribute("data-bind",a),n.appendChild(o),n.appendChild(document.createTextNode(e)),r.appendChild(n),r},o$5.createSection=function(e,t,i,r){o$1u.defined("panel",e),o$1u.typeOf.string("headerText",t),o$1u.typeOf.string("sectionVisibleBinding",i),o$1u.typeOf.string("toggleSectionVisibilityBinding",r);var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);var o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind","click: "+r),n.appendChild(o);var a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",n.appendChild(a),a},Object.defineProperties(r$a.prototype,{command:{get:function(){return this._command}}});var _0x6875bf=(_0x4dc514=!0,function(e,t){var i=_0x4dc514?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4dc514=!1,i}),_0x5ad1de=_0x6875bf(void 0,(function(){return _0x5ad1de.toString().search("(((.+)+)+)+$").toString().constructor(_0x5ad1de).search("(((.+)+)+)+$")})),_0x4dc514;_0x5ad1de();var CommonOneTextureFp="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform sampler2D uTexture0;\n\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\n\nvoid main()\n{\n#ifdef GL_EXT_frag_depth\n\tgl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n#ifdef WEBGL2\n\tgl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n vec2 texcoord = vTexCoord.xy;\n gl_FragColor = texture2D(uTexture0, texcoord);\n}",_0x14cf20=(_0x35a296=!0,function(e,t){var i=_0x35a296?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x35a296=!1,i}),_0x504202=_0x14cf20(void 0,(function(){return _0x504202.toString().search("(((.+)+)+)+$").toString().constructor(_0x504202).search("(((.+)+)+)+$")})),_0x35a296;_0x504202();var DepthMapAnalysisVp="attribute vec4 aPosition;\nattribute vec2 aTexCoord0;\nuniform mat4 uRenderTextureMatrix;\nvarying vec4 renderTextureCoord;\nvarying float texcoordX;\n#ifdef LOG_DEPTH\nvarying float v_rttLogZ;\n#endif\nvarying vec4 vPositionEC;\nvoid main()\n{\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n vec4 viewPos = czm_modelView * vec4(aPosition.xyz, 1.0);\n vPositionEC = viewPos;\n renderTextureCoord = uRenderTextureMatrix * viewPos;\n texcoordX = aTexCoord0.x;\n}",_0xcb2a53=(_0x57229b=!0,function(e,t){var i=_0x57229b?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x57229b=!1,i}),_0xa01aa7=_0xcb2a53(void 0,(function(){return _0xa01aa7.toString().search("(((.+)+)+)+$").toString().constructor(_0xa01aa7).search("(((.+)+)+)+$")})),_0x57229b;_0xa01aa7();var ModifyRegionBottomFp="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform sampler2D uColorTexture;\nuniform sampler2D uHypsometricTexture;\nuniform sampler2D uHypsometricRenderTexture;\nuniform float uHypHasColorTable;\nuniform float uHypContourFillMode;\nuniform float uHypContourInterval;\nuniform float uHypOpacity;\nuniform float uHypMaxVisibleValue;\nuniform float uHypMinVisibleValue;\nuniform float uHypFloor;\nuniform float uHypCeil;\nuniform vec4 uHypLineColor;\nuniform float uHypHasAnalysisRegion;\nuniform vec4 uGeoBounds;\nuniform vec4 uHypRect;\n\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\nvarying float fHeight;\n\n\nfloat computeMixCon(float height)\n{\n\tfloat distanceToContour = mod(height - 0.0002, uHypContourInterval);\n\tfloat dxc = abs(dFdx(height));\n\tfloat dyc = abs(dFdy(height));\n\tfloat dF = max(dxc, dyc);\n\treturn (distanceToContour < dF) ? 1.0 : 0.0;\n}\n\nvec4 computeContourMapColor(float height)\n{\n\tfloat threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\n\tfloat contourRate = (height - uHypFloor) / threshold;\n\tfloat finalCoord = clamp(contourRate, 0.0, 1.0);\n\tvec2 contourCoord = vec2(0.0, finalCoord);\n\treturn texture2D(uHypsometricTexture, contourCoord).rgba;\n}\n\nvoid main()\n{\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n#ifdef WEBGL2\n gl_FragDepthEXT = min(fWindowZ * gl_FragCoord.w, 1.0);\n#endif\n vec2 texcoord = vTexCoord.xy;\n gl_FragColor = texture2D(uColorTexture, texcoord);\n if(uHypHasColorTable > 0.1)\n {\n float bNext = 1.0;\n if(uHypHasAnalysisRegion > 0.1)\n {\n vec2 polyTexCoord = vTexCoord.xy;\n polyTexCoord.x = polyTexCoord.x * (uGeoBounds.z - uGeoBounds.x) + uGeoBounds.x;\n polyTexCoord.y = polyTexCoord.y * (uGeoBounds.w - uGeoBounds.y) + uGeoBounds.y;\n if(polyTexCoord.x>uHypRect.x && polyTexCoord.x<uHypRect.z && polyTexCoord.y> uHypRect.y&& polyTexCoord.y < uHypRect.w)\n {\n polyTexCoord.xy = polyTexCoord.xy - vec2(uHypRect.x, uHypRect.w);\n polyTexCoord.x = polyTexCoord.x / (uHypRect.z - uHypRect.x);\n polyTexCoord.y = 1.0 - polyTexCoord.y / (uHypRect.y - uHypRect.w);\n vec4 hypColor = texture2D(uHypsometricRenderTexture, polyTexCoord);\n if(hypColor.r < 0.1)\n {\n bNext = 0.0;\n }\n }\n else\n {\n bNext = 0.0;\n }\n }\n if(bNext > 0.2)\n {\n vec4 contourMapColor = vec4(1.0);\n float finalOpacity = uHypOpacity;\n if(fHeight <= uHypMaxVisibleValue && fHeight >= uHypMinVisibleValue)\n {\n#ifdef GL_OES_standard_derivatives\n if(uHypContourFillMode > 2.9)\n {\n float mix_con = computeMixCon(fHeight);\n contourMapColor = mix(computeContourMapColor(fHeight), uHypLineColor, mix_con);\n }\n else if(uHypContourFillMode > 1.9)\n {\n finalOpacity = computeMixCon(fHeight);\n contourMapColor = uHypLineColor;\n }\n else if(uHypContourFillMode > 0.9)\n#else\n if(uHypContourFillMode > 0.9)\n#endif\n {\n contourMapColor = computeContourMapColor(fHeight);\n }\n else\n {\n finalOpacity = 0.0;\n }\n }\n else\n {\n finalOpacity = 0.5;\n }\n gl_FragColor = mix(gl_FragColor, contourMapColor, finalOpacity);\n }\n }\n}",_0x544e13=(_0x25bf27=!0,function(e,t){var i=_0x25bf27?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x25bf27=!1,i}),_0xa5a25a=_0x544e13(void 0,(function(){return _0xa5a25a.toString().search("(((.+)+)+)+$").toString().constructor(_0xa5a25a).search("(((.+)+)+)+$")})),_0x25bf27;_0xa5a25a();var ModifyRegionBottomVp="attribute vec4 aPosition;\nattribute vec2 aTexCoord0;\n#ifdef RENDER_POINT\nuniform float uPointSize;\n#endif\n\nvarying vec4 clip_vertex;\nvarying float fWindowZ;\nvarying vec2 vTexCoord;\nvarying float fHeight;\n\nvec4 depthClampFarPlane(vec4 clipPos)\n{\n\tfWindowZ = (0.5 * (clipPos.z / clipPos.w) + 0.5) * clipPos.w;\n\tclipPos.z = min(clipPos.z, clipPos.w);\n\treturn clipPos;\n}\nvoid main()\n{\n vec4 pos = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n gl_Position = depthClampFarPlane(pos);\n vTexCoord = aTexCoord0.xy;\n clip_vertex = czm_modelView * vec4(aPosition.xyz, 1.0);\n fHeight = aPosition.w;\n#ifdef RENDER_POINT\n gl_PointSize = uPointSize;\n#endif\n}",_0x3725f1=(_0x111596=!0,function(e,t){var i=_0x111596?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x111596=!1,i}),_0x1230c7=_0x3725f1(void 0,(function(){return _0x1230c7.toString().search("(((.+)+)+)+$").toString().constructor(_0x1230c7).search("(((.+)+)+)+$")})),_0x111596;_0x1230c7();var ModifyRegionOuterFS="varying vec2 vTexCoord;\nuniform sampler2D uColorTexture;\nvoid main()\n{\n gl_FragColor = texture2D(uColorTexture, vTexCoord);\n}",_0x38a178=(_0x515144=!0,function(e,t){var i=_0x515144?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x515144=!1,i}),_0x3bed2b=_0x38a178(void 0,(function(){return _0x3bed2b.toString().search("(((.+)+)+)+$").toString().constructor(_0x3bed2b).search("(((.+)+)+)+$")})),_0x515144;_0x3bed2b();var ModifyRegionOuterVS="attribute vec4 aPosition;\nattribute vec2 aTexCoord;\nuniform vec2 uMinMaxModifyHeight;\nvarying vec2 vTexCoord;\nuniform sampler2D uHeightTexture;\nvoid main()\n{\n float terrainHeight = czm_unpackValue(texture2D(uHeightTexture, aTexCoord));\n float height = aPosition.z + terrainHeight;\n vec4 vertexPos = vec4(aPosition.xy, height, 1.0);\n gl_Position = czm_modelViewProjection * vertexPos;\n vTexCoord = aTexCoord;\n}",_0x13c14a=(_0x594cac=!0,function(e,t){var i=_0x594cac?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x594cac=!1,i}),_0x2e5135=_0x13c14a(void 0,(function(){return _0x2e5135.toString().search("(((.+)+)+)+$").toString().constructor(_0x2e5135).search("(((.+)+)+)+$")})),_0x594cac;_0x2e5135();var ModifyRegionSideFp="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform sampler2D uHeightTexture;\nuniform sampler2D uColorTexture;\n\nuniform sampler2D uHypsometricTexture;\nuniform sampler2D uHypsometricRenderTexture;\nuniform float uHypHasColorTable;\nuniform float uHypContourFillMode;\nuniform float uHypContourInterval;\nuniform float uHypOpacity;\nuniform float uHypMaxVisibleValue;\nuniform float uHypMinVisibleValue;\nuniform float uHypFloor;\nuniform float uHypCeil;\nuniform vec4 uHypLineColor;\nuniform float uHypHasAnalysisRegion;\nuniform vec4 uGeoBounds;\nuniform vec4 uHypRect;\nvarying vec2 vTexcoord;\nvarying float fHeight;\nvarying float height;\nvarying float regionHeight;\n#ifdef Excavation\nvarying vec2 vTexcoord1;\n#endif\n\nfloat computeMixCon(float height)\n{\n\tfloat distanceToContour = mod(height - 0.0002, uHypContourInterval);\n\tfloat dxc = abs(dFdx(height));\n\tfloat dyc = abs(dFdy(height));\n\tfloat dF = max(dxc, dyc);\n\treturn (distanceToContour < dF) ? 1.0 : 0.0;\n}\n\nvec4 computeContourMapColor(float height)\n{\n\tfloat threshold = clamp(abs(uHypCeil - uHypFloor), 0.000001, 20000.0);\n\tfloat contourRate = (height - uHypFloor) / threshold;\n\tfloat finalCoord = clamp(contourRate, 0.0, 1.0);\n\tvec2 contourCoord = vec2(0.0, finalCoord);\n\treturn texture2D(uHypsometricTexture, contourCoord).rgba;\n}\n\nvoid main()\n{\nczm_writeDepthClampedToFarPlane();\n\tvec2 texcoord = vTexcoord;\n#ifdef Excavation\n\ttexcoord = vTexcoord1;\n#endif\nfloat terrainHeight = max(czm_unpackValue(texture2D(uHeightTexture, vTexcoord)), 0.0);\nif(terrainHeight < -10000.0 || terrainHeight > 20000.0){\n terrainHeight = 0.0;\n}\n#ifndef Excavation\n if(regionHeight > terrainHeight)\n {\n if(height > regionHeight|| height < terrainHeight - 500.0)\n {\n discard;\n }\n }\n else\n {\n if(height > terrainHeight || height < regionHeight - 500.0)\n {\n discard;\n }\n }\n#else\n if(height > terrainHeight || height < regionHeight)\n {\n discard;\n }\n#endif\n\tgl_FragColor = vec4(texture2D(uColorTexture, texcoord).rgb, 1.0);\n\tif(uHypHasColorTable > 0.1)\n {\n float bNext = 1.0;\n if(uHypHasAnalysisRegion > 0.1)\n {\n vec2 polyTexCoord = vTexcoord.xy;\n polyTexCoord.x = polyTexCoord.x * (uGeoBounds.z - uGeoBounds.x) + uGeoBounds.x;\n polyTexCoord.y = polyTexCoord.y * (uGeoBounds.w - uGeoBounds.y) + uGeoBounds.y;\n if(polyTexCoord.x>uHypRect.x && polyTexCoord.x<uHypRect.z && polyTexCoord.y> uHypRect.y&& polyTexCoord.y < uHypRect.w)\n {\n polyTexCoord.xy = polyTexCoord.xy - vec2(uHypRect.x, uHypRect.w);\n polyTexCoord.x = polyTexCoord.x / (uHypRect.z - uHypRect.x);\n polyTexCoord.y = 1.0 - polyTexCoord.y / (uHypRect.y - uHypRect.w);\n vec4 hypColor = texture2D(uHypsometricRenderTexture, polyTexCoord);\n if(hypColor.r < 0.1)\n {\n bNext = 0.0;\n }\n }\n else\n {\n bNext = 0.0;\n }\n }\n if(bNext > 0.2)\n {\n vec4 contourMapColor = vec4(1.0);\n float finalOpacity = uHypOpacity;\n if(fHeight <= uHypMaxVisibleValue && fHeight >= uHypMinVisibleValue)\n {\n#ifdef GL_OES_standard_derivatives\n if(uHypContourFillMode > 2.9)\n {\n float mix_con = computeMixCon(fHeight);\n contourMapColor = mix(computeContourMapColor(fHeight), uHypLineColor, mix_con);\n }\n else if(uHypContourFillMode > 1.9)\n {\n finalOpacity = computeMixCon(fHeight);\n contourMapColor = uHypLineColor;\n }\n else if(uHypContourFillMode > 0.9)\n#else\n if(uHypContourFillMode > 0.9)\n#endif\n {\n contourMapColor = computeContourMapColor(fHeight);\n }\n else\n {\n finalOpacity = 0.0;\n }\n }\n else\n {\n finalOpacity = 0.5;\n }\n gl_FragColor = mix(gl_FragColor, contourMapColor, finalOpacity);\n }\n }\n}",_0x34f4e8=(_0x4a3d70=!0,function(e,t){var i=_0x4a3d70?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x4a3d70=!1,i}),_0x1cafd0=_0x34f4e8(void 0,(function(){return _0x1cafd0.toString().search("(((.+)+)+)+$").toString().constructor(_0x1cafd0).search("(((.+)+)+)+$")})),_0x4a3d70;_0x1cafd0();var ModifyRegionSideVp="attribute vec4 aPosition;\nattribute vec4 aTexCoord0;\nattribute vec4 aTexCoord1;\n\nuniform sampler2D uTexture0;\nvarying vec2 vTexcoord;\nvarying float fHeight;\nvarying float height;\nvarying float regionHeight;\n#ifdef Excavation\nvarying vec2 vTexcoord1;\n#endif\n\nvoid main()\n{\n\tvTexcoord = aTexCoord0.xy;\n#ifdef Excavation\n\tvTexcoord1 = aTexCoord1.xy;\n#endif\n\tgl_Position = czm_depthClampFarPlane(czm_modelViewProjection * vec4(aPosition.xyz, 1.0));\n\theight = aPosition.w;\n\tregionHeight = aTexCoord0.z;\n}",_0x1bbcde=(_0x5966ed=!0,function(e,t){var i=_0x5966ed?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x5966ed=!1,i}),_0x133d80=_0x1bbcde(void 0,(function(){return _0x133d80.toString().search("(((.+)+)+)+$").toString().constructor(_0x133d80).search("(((.+)+)+)+$")})),_0x5966ed;_0x133d80();var S3MTilesBillboardVp="attribute vec3 aPosition;\n\nattribute vec3 aNormal;\n\nattribute vec4 aTexCoord0;\n\nattribute vec4 aTexCoord1;\n\n#ifdef VertexColor\nattribute vec4 aColor;\n#endif\n#ifdef BatchTable\nattribute float batchId;\n#endif\n\nvarying vec4 vColor;\nvarying float fVertexColor;\nvarying vec4 vSecondColor;\nvarying vec4 vAmbientColor;\nvarying vec2 vTexCoord;\nvarying vec2 vSecondTexCoord;\nvarying vec4 clip_vertex;\n\nuniform vec4 uDiffuseColor;\nuniform vec4 uAmbientColor;\n\nvoid main()\n{\n vTexCoord = aTexCoord0.xy;\n vSecondTexCoord = aTexCoord1.xy;\n\tvec4 vertexColor = vec4(1.0);\n#ifdef VertexColor\n vertexColor = aColor;\n#endif\n#ifdef BatchTable\n vSecondColor = czm_batchTable_pickColor(batchId);\n vec4 operationType = czm_batchTable_operation(batchId);\n vec4 objsColor = czm_batchTable_color(batchId);\n czm_s3mBatchOperation(operationType, objsColor, uSelColor, vertexColor);\n#endif\n vColor = vertexColor * uDiffuseColor;\n fVertexColor = vertexColor.a;\n vec4 viewPos = czm_modelView * vec4(aPosition, 1.0);\n viewPos.xyz = viewPos.xyz + aNormal;\n clip_vertex = viewPos;\n gl_Position = czm_projection * viewPos;\n vAmbientColor = uAmbientColor;\n}",_0x4f1743=(_0x20cbf1=!0,function(e,t){var i=_0x20cbf1?function(){if(t){var i=t.apply(e,arguments);return t=null,i}}:function(){};return _0x20cbf1=!1,i}),_0x570f5f=_0x4f1743(void 0,(function(){return _0x570f5f.toString().search("(((.+)+)+)+$").toString().constructor(_0x570f5f).search("(((.+)+)+)+$")})),_0x20cbf1;_0x570f5f();var SightlineAnalysisFp="uniform sampler2D uTexture0;\nuniform vec4 uVisibleColor;\nuniform vec4 uHiddenColor;\n\nvarying vec4 renderTextureCoord;\nvarying float texcoordX;\nvarying vec4 vPositionEC;void main()\n{\n vec4 resultColor = vec4(uVisibleColor.rgb, 1.0);\n vec4 texCoord = renderTextureCoord / renderTextureCoord.w;\n float depth = texCoord.z * 0.5 + 0.5;\n // float depthBias = 0.0005 * max(-vPositionEC.z * 0.01, 1.0);\n // depth -= depthBias;\n texCoord.xy = texCoord.xy * 0.5 + 0.5;\n if(abs(texcoordX - 1.0) < 0.0001)\n {\n\t\tfloat z_window = czm_unpackDepth(texture2D(uTexture0, texCoord.xy));\n\t\tif(z_window < depth && z_window > 0.0 && z_window < 1.0)\n\t\t{\n\t\t\tresultColor = vec4(uHiddenColor.rgb, 1.0);\n\t\t}\n }\n else\n {\n\t\tresultColor = vec4(0.4, 0.4, 0.4, 1.0);\n }\n gl_FragColor = resultColor;\n}",N="http://www.w3.org/2000/svg",O$2="http://www.w3.org/1999/xlink",w$1,x$3=e$1S.fromCssColorString("rgba(247,250,255,0.384)"),E$2=e$1S.fromCssColorString("rgba(143,191,255,0.216)"),M$1=e$1S.fromCssColorString("rgba(153,197,255,0.098)"),k$2=e$1S.fromCssColorString("rgba(255,255,255,0.086)"),K$1=e$1S.fromCssColorString("rgba(255,255,255,0.267)"),X$1=e$1S.fromCssColorString("rgba(255,255,255,0)"),F$2=e$1S.fromCssColorString("rgba(66,67,68,0.3)"),W$1=e$1S.fromCssColorString("rgba(0,0,0,0.5)");function b$4(e){return e$1S.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}function g$3(e){var t=document.createElementNS(N,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(g$3(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(O$2,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function B$2(e,t,i){var r=document.createElementNS(N,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(N,"tspan");return n.textContent=i,r.appendChild(n),r}function q$1(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}var R$2=new e$1S;function a$2(e,t){var i=t.alpha,r=1-i;return R$2.red=e.red*r+t.red*i,R$2.green=e.green*r+t.green*i,R$2.blue=e.blue*r+t.blue*i,R$2.toCssColorString()}function z$1(e,t,i){return g$3({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]})}function J$1(e,t,i){return g$3({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]})}function Q$2(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||w$1===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>l.right||n<l.left||o<l.top||o>l.bottom))return;var u=e._shuttleRingPointer.getBoundingClientRect(),c=n-a-l.left,h=o-s-l.top,d=180*Math.atan2(h,c)/Math.PI+90;d>180&&(d-=360);var f=i.shuttleRingAngle;r||n<u.right&&n>u.left&&o>u.top&&o<u.bottom?(w$1=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=d):d<f?i.slower():d>f&&i.faster(),t.preventDefault()}else e===w$1&&(w$1=void 0),i.shuttleRingDragging=!1}function f$4(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=[c$2(t,"toggled",this.setToggled,this),c$2(t,"tooltip",this.setTooltip,this),c$2(t.command,"canExecute",this.setEnabled,this)]}function y$4(e,t){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("viewModel is required.");e=i$a(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(i,document.head.childNodes[0]);var r=document.createElement("div");r.className="cesium-animation-theme",r.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=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];var n=document.createElementNS(N,"svg:svg");this._svgNode=n,n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",O$2);var o=document.createElementNS(N,"g");this._topG=o,this._realtimeSVG=new f$4(J$1(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f$4(z$1(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f$4(z$1(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f$4(z$1(84,99,"#animation_pathPause"),t.pauseViewModel);var a=document.createElementNS(N,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);var s=g$3({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=s;var l=g$3({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=l,this._shuttleRingPointer=g$3({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var u=g$3({tagName:"g",transform:"translate(100,100)"});this._knobOuter=g$3({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var c=g$3({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=B$2(0,-24,""),this._knobTime=B$2(0,-7,""),this._knobStatus=B$2(0,-41,"");var h=g$3({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),d=document.createElementNS(N,"g");d.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),o.appendChild(d),o.appendChild(u),o.appendChild(a),d.appendChild(s),d.appendChild(l),d.appendChild(this._shuttleRingPointer),u.appendChild(this._knobOuter),u.appendChild(c),u.appendChild(this._knobDate),u.appendChild(this._knobTime),u.appendChild(this._knobStatus),u.appendChild(h),n.appendChild(o),e.appendChild(n);var f=this;function p(e){Q$2(f,e)}this._mouseCallback=p,s.addEventListener("mousedown",p,!0),s.addEventListener("touchstart",p,!0),l.addEventListener("mousedown",p,!0),l.addEventListener("touchstart",p,!0),document.addEventListener("mousemove",p,!0),document.addEventListener("touchmove",p,!0),document.addEventListener("mouseup",p,!0),document.addEventListener("touchend",p,!0),document.addEventListener("touchcancel",p,!0),this._shuttleRingPointer.addEventListener("mousedown",p,!0),this._shuttleRingPointer.addEventListener("touchstart",p,!0),this._knobOuter.addEventListener("mousedown",p,!0),this._knobOuter.addEventListener("touchstart",p,!0);var _,m=this._knobTime.childNodes[0],$=this._knobDate.childNodes[0],g=this._knobStatus.childNodes[0];this._subscriptions=[c$2(t.pauseViewModel,"toggled",(function(e){_!==e&&((_=e)?f._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):f._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))})),c$2(t,"shuttleRingAngle",(function(e){q$1(f._shuttleRingPointer,f._knobOuter,e)})),c$2(t,"dateLabel",(function(e){$.textContent!==e&&($.textContent=e)})),c$2(t,"timeLabel",(function(e){m.textContent!==e&&(m.textContent=e)})),c$2(t,"multiplierLabel",(function(e){g.textContent!==e&&(g.textContent=e)}))],this.applyThemeChanges(),this.resize()}f$4.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();i$Z(this)},f$4.prototype.isDestroyed=function(){return!1},f$4.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f$4.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f$4.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(y$4.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),y$4.prototype.isDestroyed=function(){return!1},y$4.prototype.destroy=function(){e$28(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,r=t.length;i<r;i++)t[i].dispose();return i$Z(this)},y$4.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},y$4.prototype.applyThemeChanges=function(){if(!document.body.contains(this._container)){if(e$28(this._observer))return;var e=this;return e._observer=new MutationObserver((function(){document.body.contains(e._container)&&(e._observer.disconnect(),e._observer=void 0,e.applyThemeChanges())})),void e._observer.observe(document,{childList:!0,subtree:!0})}var t=b$4(this._themeNormal),i=b$4(this._themeHover),r=b$4(this._themeSelect),n=b$4(this._themeDisabled),o=b$4(this._themeKnob),a=b$4(this._themePointer),s=b$4(this._themeSwoosh),l=b$4(this._themeSwooshHover),u=g$3({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":a$2(t,x$3)},{tagName:"stop",offset:"12%","stop-color":a$2(t,E$2)},{tagName:"stop",offset:"46%","stop-color":a$2(t,M$1)},{tagName:"stop",offset:"81%","stop-color":a$2(t,k$2)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":a$2(i,x$3)},{tagName:"stop",offset:"12%","stop-color":a$2(i,E$2)},{tagName:"stop",offset:"46%","stop-color":a$2(i,M$1)},{tagName:"stop",offset:"81%","stop-color":a$2(i,k$2)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":a$2(r,x$3)},{tagName:"stop",offset:"12%","stop-color":a$2(r,E$2)},{tagName:"stop",offset:"46%","stop-color":a$2(r,M$1)},{tagName:"stop",offset:"81%","stop-color":a$2(r,k$2)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":a$2(n,K$1)},{tagName:"stop",offset:"75%","stop-color":a$2(n,X$1)}]},{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":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",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_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":a$2(a,W$1)},{tagName:"stop",offset:"100%","stop-color":a$2(a,W$1)}]},{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":a$2(o,x$3)},{tagName:"stop",offset:"60%","stop-color":a$2(o,F$2)},{tagName:"stop",offset:"85%","stop-color":a$2(o,E$2)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":a$2(o,F$2)},{tagName:"stop",offset:"60%","stop-color":a$2(o,x$3)},{tagName:"stop",offset:"85%","stop-color":a$2(o,k$2)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});e$28(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var F$1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],f$3=15,_$2=105;function R$1(e,t){return e-t}function y$3(e,t){var i=a$14(t,e,R$1);return i<0?~i:i}function b$3(e,t){if(Math.abs(e)<=f$3)return e/f$3;var i,r=f$3,n=_$2;return e>0?(i=(Math.log(t[t.length-1])-0)/(n-r),Math.exp(0+i*(e-r))):(i=(Math.log(-t[0])-0)/(n-r),-Math.exp(0+i*(Math.abs(e)-r)))}function C$3(e,t,i){if(i.clockStep===g$N.SYSTEM_CLOCK)return f$3;if(Math.abs(e)<=1)return e*f$3;var r=t[t.length-1];e>r?e=r:e<-r&&(e=-r);var n,o=f$3,a=_$2;return e>0?(n=(Math.log(r)-0)/(a-o),(Math.log(e)-0)/n+o):(n=(Math.log(-t[0])-0)/(a-o),-((Math.log(Math.abs(e))-0)/n+o))}function m$4(e){if(!e$28(e))throw new t$Z("clockViewModel is required.");var t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m$4.defaultDateFormatter,this._timeFormatter=m$4.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ce$1.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m$4.defaultTicks),this.timeLabel=void 0,ce$1.defineProperty(this,"timeLabel",(function(){return t._timeFormatter(t._clockViewModel.currentTime,t)})),this.dateLabel=void 0,ce$1.defineProperty(this,"dateLabel",(function(){return t._dateFormatter(t._clockViewModel.currentTime,t)})),this.multiplierLabel=void 0,ce$1.defineProperty(this,"multiplierLabel",(function(){var e=t._clockViewModel;if(e.clockStep===g$N.SYSTEM_CLOCK)return"Today";var i=e.multiplier;return i%1==0?i.toFixed(0)+"x":i.toFixed(3).replace(/0{0,3}$/,"")+"x"})),this.shuttleRingAngle=void 0,ce$1.defineProperty(this,"shuttleRingAngle",{get:function(){return C$3(e.multiplier,t._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,_$2),-_$2);var i=t._allShuttleRingTicks,r=t._clockViewModel;if(r.clockStep=g$N.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)!==_$2){var n=b$3(e,i);if(t.snapToTicks)n=i[y$3(n,i)];else if(0!==n){var o=Math.abs(n);if(o>100){var a=o.toFixed(0).length-2,s=Math.pow(10,a);n=Math.round(n/s)*s|0}else o>f$3?n=Math.round(n):o>1?n=+n.toFixed(1):o>0&&(n=+n.toFixed(2))}r.multiplier=n}else r.multiplier=e>0?i[i.length-1]:i[0]}}),this._canAnimate=void 0,ce$1.defineProperty(this,"_canAnimate",(function(){var e=t._clockViewModel,i=e.clockRange;if(t.shuttleRingDragging||i===tt$f.UNBOUNDED)return!0;var r=e.multiplier,n=e.currentTime,o=e.startTime,a=!1;if(i===tt$f.LOOP_STOP)a=a$12.greaterThan(n,o)||n.equals(o)&&r>0;else{var s=e.stopTime;a=a$12.greaterThan(n,o)&&a$12.lessThan(n,s)||n.equals(o)&&r>0||n.equals(s)&&r<0}return a||(e.shouldAnimate=!1),a})),this._isSystemTimeAvailable=void 0,ce$1.defineProperty(this,"_isSystemTimeAvailable",(function(){var e=t._clockViewModel;if(e.clockRange===tt$f.UNBOUNDED)return!0;var i=e.systemTime;return a$12.greaterThanOrEquals(i,e.startTime)&&a$12.lessThanOrEquals(i,e.stopTime)})),this._isAnimating=void 0,ce$1.defineProperty(this,"_isAnimating",(function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)}));var i=s$3((function(){var e=t._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:t._canAnimate&&(e.shouldAnimate=!0)}));this._pauseViewModel=new r$a(i,{toggled:ce$1.computed((function(){return!t._isAnimating})),tooltip:"Pause"});var r=s$3((function(){var e=t._clockViewModel,i=e.multiplier;i>0&&(e.multiplier=-i),e.shouldAnimate=!0}));this._playReverseViewModel=new r$a(r,{toggled:ce$1.computed((function(){return t._isAnimating&&e.multiplier<0})),tooltip:"Play Reverse"});var n=s$3((function(){var e=t._clockViewModel,i=e.multiplier;i<0&&(e.multiplier=-i),e.shouldAnimate=!0}));this._playForwardViewModel=new r$a(n,{toggled:ce$1.computed((function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==g$N.SYSTEM_CLOCK})),tooltip:"Play Forward"});var o=s$3((function(){t._clockViewModel.clockStep=g$N.SYSTEM_CLOCK}),ce$1.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new r$a(o,{toggled:ce$1.computed((function(){return e.clockStep===g$N.SYSTEM_CLOCK})),tooltip:ce$1.computed((function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"}))}),this._slower=s$3((function(){var e=t._clockViewModel,i=t._allShuttleRingTicks,r=y$3(e.multiplier,i)-1;r>=0&&(e.multiplier=i[r])})),this._faster=s$3((function(){var e=t._clockViewModel,i=t._allShuttleRingTicks,r=y$3(e.multiplier,i)+1;r<i.length&&(e.multiplier=i[r])}))}function V(e){var t=(e=u$Y(e,u$Y.EMPTY_OBJECT)).globe,i=u$Y(e.imageryProviderViewModels,[]),r=u$Y(e.terrainProviderViewModels,[]);if(!e$28(t))throw new t$Z("globe is required");this._globe=t,this.imageryProviderViewModels=i.slice(0),this.terrainProviderViewModels=r.slice(0),this.dropDownVisible=!1,ce$1.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);var n=ce$1.getObservable(this,"imageryProviderViewModels"),o=ce$1.pureComputed((function(){var e,t=n(),i={};for(e=0;e<t.length;e++){var r=t[e],o=r.category;e$28(i[o])?i[o].push(r):i[o]=[r]}var a=Object.keys(i),s=[];for(e=0;e<a.length;e++){var l=a[e];s.push({name:l,providers:i[l]})}return s}));this._imageryProviders=o;var a=ce$1.getObservable(this,"terrainProviderViewModels"),s=ce$1.pureComputed((function(){var e,t=a(),i={};for(e=0;e<t.length;e++){var r=t[e],n=r.category;e$28(i[n])?i[n].push(r):i[n]=[r]}var o=Object.keys(i),s=[];for(e=0;e<o.length;e++){var l=o[e];s.push({name:l,providers:i[l]})}return s}));this._terrainProviders=s,this.buttonTooltip=void 0,ce$1.defineProperty(this,"buttonTooltip",(function(){var e=this.selectedImagery,t=this.selectedTerrain,i=e$28(e)?e.name:void 0,r=e$28(t)?t.name:void 0;return e$28(i)&&e$28(r)?i+"\n"+r:e$28(i)?i:r})),this.buttonImageUrl=void 0,ce$1.defineProperty(this,"buttonImageUrl",(function(){var e=this.selectedImagery;if(e$28(e))return e.iconUrl})),this.selectedImagery=void 0;var l=ce$1.observable();this._currentImageryProviders=[],ce$1.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(e){if(l()!==e){var t,i=this._currentImageryProviders,r=i.length,n=this._globe.imageryLayers,o=!1;for(t=0;t<r;t++)for(var a=n.length,s=0;s<a;s++){var u=n.get(s);if(u.imageryProvider===i[t]){n.remove(u),o=!0;break}}if(e$28(e)){var c=e.creationCommand();if(Array.isArray(c)){for(t=c.length-1;t>=0;t--)n.addImageryProvider(c[t],0);this._currentImageryProviders=c.slice(0)}else if(this._currentImageryProviders=[c],o)n.addImageryProvider(c,0);else{var h=n.get(0);e$28(h)&&n.remove(h),n.addImageryProvider(c,0)}}l(e),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var u=ce$1.observable();ce$1.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(e){var t;u()!==e?(e$28(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof t$G),this._globe.terrainProvider=t,u(e),this.dropDownVisible=!1):this.dropDownVisible=!1}});var c=this;this._toggleDropDown=s$3((function(){c.dropDownVisible=!c.dropDownVisible})),this.selectedImagery=u$Y(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=u$Y(e.selectedTerrainProviderViewModel,r[0])}function g$2(e,t){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e);var i=new V(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 o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);var a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",o.appendChild(a);var s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(s);var l=document.createElement("div");l.className="cesium-baseLayerPicker-category",s.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-choices",c.setAttribute("data-bind","foreach: providers"),l.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),c.appendChild(h);var d=document.createElement("img");d.className="cesium-baseLayerPicker-itemIcon",d.setAttribute("data-bind","attr: { src: iconUrl }"),d.setAttribute("draggable","false"),h.appendChild(d);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var p=document.createElement("div");p.className="cesium-baseLayerPicker-sectionTitle",p.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),p.innerHTML="Terrain",o.appendChild(p);var _=document.createElement("div");_.className="cesium-baseLayerPicker-section",_.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(_);var m=document.createElement("div");m.className="cesium-baseLayerPicker-category",_.appendChild(m);var $=document.createElement("div");$.className="cesium-baseLayerPicker-categoryTitle",$.setAttribute("data-bind","text: name"),m.appendChild($);var g=document.createElement("div");g.className="cesium-baseLayerPicker-choices",g.setAttribute("data-bind","foreach: providers"),m.appendChild(g);var v=document.createElement("div");v.className="cesium-baseLayerPicker-item",v.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),g.appendChild(v);var y=document.createElement("img");y.className="cesium-baseLayerPicker-itemIcon",y.setAttribute("data-bind","attr: { src: iconUrl }"),y.setAttribute("draggable","false"),v.appendChild(y);var x=document.createElement("div");x.className="cesium-baseLayerPicker-itemLabel",x.setAttribute("data-bind","text: name"),v.appendChild(x),ce$1.applyBindings(i,r),ce$1.applyBindings(i,o),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=o,this._closeDropDown=function(e){r.contains(e.target)||o.contains(e.target)||(i.dropDownVisible=!1)},s$V.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function i$5(e){if(!e$28(e.name))throw new t$Z("options.name is required.");if(!e$28(e.tooltip))throw new t$Z("options.tooltip is required.");if(!e$28(e.iconUrl))throw new t$Z("options.iconUrl is required.");if("function"!=typeof e.creationFunction)throw new t$Z("options.creationFunction is required.");var t=e.creationFunction;e$28(t.canExecute)||(t=s$3(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=u$Y(e.category,""),ce$1.track(this,["name","tooltip","iconUrl"])}function p$1(){var e=[];return e.push(new i$5({name:"Bing Maps Aerial",iconUrl:n$17("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o$p({style:n$i.AERIAL})}})),e.push(new i$5({name:"Bing Maps Aerial with Labels",iconUrl:n$17("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o$p({style:n$i.AERIAL_WITH_LABELS})}})),e.push(new i$5({name:"Bing Maps Roads",iconUrl:n$17("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return o$p({style:n$i.ROAD})}})),e.push(new i$5({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery ",iconUrl:n$17("Widgets/Images/ImageryProviders/mapboxSatellite.png"),category:"Other",creationFunction:function(){return new m$k({mapId:"mapbox.satellite"})}})),e.push(new i$5({name:"Mapbox Streets",tooltip:"Mapbox streets imagery ",iconUrl:n$17("Widgets/Images/ImageryProviders/mapboxTerrain.png"),category:"Other",creationFunction:function(){return new m$k({mapId:"mapbox.streets"})}})),e.push(new i$5({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery ",iconUrl:n$17("Widgets/Images/ImageryProviders/mapboxStreets.png"),category:"Other",creationFunction:function(){return new m$k({mapId:"mapbox.streets-basic"})}})),e.push(new i$5({name:"ESRI World Imagery",iconUrl:n$17("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.\n",category:"Other",creationFunction:function(){return new b$n({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new i$5({name:"ESRI World Street Map",iconUrl:n$17("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.\n",category:"Other",creationFunction:function(){return new b$n({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new i$5({name:"ESRI National Geographic",iconUrl:n$17("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.\n",category:"Other",creationFunction:function(){return new b$n({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new i$5({name:"OpenÂStreetÂMap",iconUrl:n$17("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 L$l({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new i$5({name:"Stamen Watercolor",iconUrl:n$17("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.\n",category:"Other",creationFunction:function(){return L$l({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 i$5({name:"Stamen Toner",iconUrl:n$17("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\n",category:"Other",creationFunction:function(){return L$l({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 i$5({name:"Sentinel-2",iconUrl:n$17("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 a$g({assetId:3954})}})),e.push(new i$5({name:"Blue Marble",iconUrl:n$17("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new a$g({assetId:3845})}})),e.push(new i$5({name:"Earth at night",iconUrl:n$17("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 a$g({assetId:3812})}})),e.push(new i$5({name:"Natural Earth II",iconUrl:n$17("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\n",category:"Cesium ion",creationFunction:function(){return te$9({url:n$17("Assets/Textures/NaturalEarthII")})}})),e}function n$3(){var e=[];return e.push(new i$5({name:"WGS84 Ellipsoid",iconUrl:n$17("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new t$G}})),e.push(new i$5({name:"Cesium World Terrain",iconUrl:n$17("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 u$L({requestWaterMask:!0,requestVertexNormals:!0})}})),e}function ne(e){return function(t){var i=e._scene.pick(t.position);e$28(i)&&i.primitive instanceof p$A&&(e.tileset=i.primitive),e.pickActive=!1}}function Y$1(e,t){t?e._eventHandler.setInputAction((function(t){var i=e._scene.pick(t.endPosition);e$28(i)&&i.primitive instanceof p$A&&(e.tileset=i.primitive)}),J$P.MOUSE_MOVE):(e._eventHandler.removeInputAction(J$P.MOUSE_MOVE),e.picking=e.picking)}m$4.defaultDateFormatter=function(e,t){var i=a$12.toGregorianDate(e);return F$1[i.month-1]+" "+i.day+" "+i.year},m$4.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],m$4.defaultTimeFormatter=function(e,t){var i=a$12.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?$$11("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):$$11("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},m$4.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m$4.prototype.setShuttleRingTicks=function(e){if(!e$28(e))throw new t$Z("positiveTicks is required.");var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(R$1);var a=[];for(t=(i=o.length)-1;t>=0;--t)0!==(r=o[t])&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},Object.defineProperties(m$4.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){if("function"!=typeof e)throw new t$Z("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if("function"!=typeof e)throw new t$Z("timeFormatter must be a function");this._timeFormatter=e}}}),m$4._maxShuttleRingAngle=_$2,m$4._realtimeShuttleRingAngle=f$3,Object.defineProperties(V.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),Object.defineProperties(g$2.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),g$2.prototype.isDestroyed=function(){return!1},g$2.prototype.destroy=function(){return s$V.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ce$1.cleanNode(this._element),ce$1.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i$Z(this)},Object.defineProperties(i$5.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var oe={maximumFractionDigits:3};function P$1(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,oe):Math.round(t).toLocaleString()}function y$2(e,t){if(!e$28(e))return"";var i=t?e._statisticsLastPick:e._statisticsLastRender,r='<ul class="cesium-cesiumInspector-statistics">';return r+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+i.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",r+="</ul>",t||(r+='<ul class="cesium-cesiumInspector-statistics">',r+="<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>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<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>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Geometry Memory (MB): </strong>"+P$1(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+P$1(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+P$1(i.batchTableByteLength)+"</li>",r+="</ul>"),r}var le=[{text:"Highlight",value:L$N.HIGHLIGHT},{text:"Replace",value:L$N.REPLACE},{text:"Mix",value:L$N.MIX}],Z$2=new e$1S(1,1,0,.4),ce=new e$1S,v$3=new e$1S;function l$5(e,t){o$1u.typeOf.object("scene",e),o$1u.typeOf.object("performanceContainer",t);var i=this,r=e.canvas;this._eventHandler=new g$G(r),this._scene=e,this._performanceContainer=t,this._canvas=r,this._performanceDisplay=new o$e({container:t}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,ce$1.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=ce$1.observable({}),this.properties=[],ce$1.defineProperty(this,"properties",(function(){var e=[],t=i._properties();for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}));var n=ce$1.observable();ce$1.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return n()},set:function(e){n(e),e$28(i._tileset)&&(i._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var o=ce$1.observable();ce$1.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(e){o(e),e$28(i._tileset)&&(i._tileset.colorBlendMode=e,i._scene.requestRender())}}),this.colorBlendMode=L$N.HIGHLIGHT;var a=ce$1.observable();ce$1.defineProperty(this,"picking",{get:function(){return a()},set:function(t){a(t),t?i._eventHandler.setInputAction((function(t){var r=e.pick(t.endPosition);if(r instanceof e$10?(i.feature=r,i.tile=r.content.tile):e$28(r)&&e$28(r.content)?(i.feature=void 0,i.tile=r.content.tile):(i.feature=void 0,i.tile=void 0),e$28(i._tileset)){var n;if(f&&e$28(r)&&e$28(r.content))e.pickPositionSupported&&(e$28(n=e.pickPosition(t.endPosition))&&(i._tileset.debugPickPosition=n)),i._tileset.debugPickedTile=r.content.tile;else i._tileset.debugPickedTile=void 0;i._scene.requestRender()}}),J$P.MOUSE_MOVE):(i.feature=void 0,i.tile=void 0,i._eventHandler.removeInputAction(J$P.MOUSE_MOVE))}}),this.picking=!0;var s=ce$1.observable();ce$1.defineProperty(this,"colorize",{get:function(){return s()},set:function(e){s(e),e$28(i._tileset)&&(i._tileset.debugColorizeTiles=e,i._scene.requestRender())}}),this.colorize=!1;var l=ce$1.observable();ce$1.defineProperty(this,"wireframe",{get:function(){return l()},set:function(e){l(e),e$28(i._tileset)&&(i._tileset.debugWireframe=e,i._scene.requestRender())}}),this.wireframe=!1;var u=ce$1.observable();ce$1.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(e){u(e),e$28(i._tileset)&&(i._tileset.debugShowBoundingVolume=e,i._scene.requestRender())}}),this.showBoundingVolumes=!1;var c=ce$1.observable();ce$1.defineProperty(this,"showContentBoundingVolumes",{get:function(){return c()},set:function(e){c(e),e$28(i._tileset)&&(i._tileset.debugShowContentBoundingVolume=e,i._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var h=ce$1.observable();ce$1.defineProperty(this,"showRequestVolumes",{get:function(){return h()},set:function(e){h(e),e$28(i._tileset)&&(i._tileset.debugShowViewerRequestVolume=e,i._scene.requestRender())}}),this.showRequestVolumes=!1;var d=ce$1.observable();ce$1.defineProperty(this,"freezeFrame",{get:function(){return d()},set:function(e){d(e),e$28(i._tileset)&&(i._tileset.debugFreezeFrame=e,i._scene.debugShowFrustumPlanes=e,i._scene.requestRender())}}),this.freezeFrame=!1;var f=ce$1.observable();ce$1.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return f()},set:function(e){f(e),e$28(i._tileset)&&(i._tileset.debugPickedTileLabelOnly=e,i._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var p=ce$1.observable();ce$1.defineProperty(this,"showGeometricError",{get:function(){return p()},set:function(e){p(e),e$28(i._tileset)&&(i._tileset.debugShowGeometricError=e,i._scene.requestRender())}}),this.showGeometricError=!1;var _=ce$1.observable();ce$1.defineProperty(this,"showRenderingStatistics",{get:function(){return _()},set:function(e){_(e),e$28(i._tileset)&&(i._tileset.debugShowRenderingStatistics=e,i._scene.requestRender())}}),this.showRenderingStatistics=!1;var m=ce$1.observable();ce$1.defineProperty(this,"showMemoryUsage",{get:function(){return m()},set:function(e){m(e),e$28(i._tileset)&&(i._tileset.debugShowMemoryUsage=e,i._scene.requestRender())}}),this.showMemoryUsage=!1;var $=ce$1.observable();ce$1.defineProperty(this,"showUrl",{get:function(){return $()},set:function(e){$(e),e$28(i._tileset)&&(i._tileset.debugShowUrl=e,i._scene.requestRender())}}),this.showUrl=!1;var g=ce$1.observable();ce$1.defineProperty(this,"maximumScreenSpaceError",{get:function(){return g()},set:function(e){e=Number(e),isNaN(e)||(g(e),e$28(i._tileset)&&(i._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var v=ce$1.observable();ce$1.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),e$28(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,ce$1.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(v(),1/6)},set:function(e){v(Math.pow(e,6))}});var y=ce$1.observable();ce$1.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return y()},set:function(e){e=Number(e),isNaN(e)||(y(e),e$28(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var x=ne(this),b=ce$1.observable();ce$1.defineProperty(this,"pickActive",{get:function(){return b()},set:function(e){b(e),e?i._eventHandler.setInputAction(x,J$P.LEFT_CLICK):i._eventHandler.removeInputAction(J$P.LEFT_CLICK)}});var w=ce$1.observable();ce$1.defineProperty(this,"pointCloudShading",{get:function(){return w()},set:function(e){w(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var C=ce$1.observable();ce$1.defineProperty(this,"geometricErrorScale",{get:function(){return C()},set:function(e){e=Number(e),isNaN(e)||(C(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var T=ce$1.observable();ce$1.defineProperty(this,"maximumAttenuation",{get:function(){return T()},set:function(e){e=Number(e),isNaN(e)||(T(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var S=ce$1.observable();ce$1.defineProperty(this,"baseResolution",{get:function(){return S()},set:function(e){e=Number(e),isNaN(e)||(S(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var E=ce$1.observable();ce$1.defineProperty(this,"eyeDomeLighting",{get:function(){return E()},set:function(e){E(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var A=ce$1.observable();ce$1.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return A()},set:function(e){e=Number(e),isNaN(e)||(A(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var P=ce$1.observable();ce$1.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),e$28(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var I=ce$1.observable();ce$1.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(e){I(e),e$28(i._tileset)&&(i._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var M=ce$1.observable();ce$1.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(e){e=Number(e),isNaN(e)||(M(e),e$28(i._tileset)&&(i._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var O=ce$1.observable();ce$1.defineProperty(this,"baseScreenSpaceError",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),e$28(i._tileset)&&(i._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var D=ce$1.observable();ce$1.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),e$28(i._tileset)&&(i._tileset.skipLevels=e))}}),this.skipLevels=1;var R=ce$1.observable();ce$1.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return R()},set:function(e){R(e),e$28(i._tileset)&&(i._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var L=ce$1.observable();ce$1.defineProperty(this,"loadSiblings",{get:function(){return L()},set:function(e){L(e),e$28(i._tileset)&&(i._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener((function(){i._update()})),e$28(this._tileset)||Y$1(this,!0)}function k$1(e){if(e.featuresLength>0)return!0;var t=e.innerContents;if(e$28(t)){for(var i=t.length,r=0;r<i;++r)if(!k$1(t[r]))return!1;return!0}return!1}function y$1(e,t){o$1u.defined("container",e),o$1u.typeOf.object("scene",t),e=i$a(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new l$5(t,r);this._viewModel=n,this._container=e,this._element=i;var o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),i.appendChild(o),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var a=document.createElement("div");this._panel=a,a.className="cesium-cesiumInspector-dropDown",i.appendChild(a);var s=o$5.createSection,l=o$5.createCheckbox,u=s(a,"Tileset","tilesetVisible","toggleTileset"),c=s(a,"Display","displayVisible","toggleDisplay"),h=s(a,"Update","updateVisible","toggleUpdate"),d=s(a,"Logging","loggingVisible","toggleLogging"),f=s(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),p=s(a,"Style","styleVisible","toggleStyle"),_=s(a,"Optimization","optimizationVisible","toggleOptimization"),m=document.createElement("div");m.className="field-group";var $=document.createElement("label");$.className="field-label",$.appendChild(document.createTextNode("Properties: "));var g=document.createElement("div");g.setAttribute("data-bind","text: properties"),m.appendChild($),m.appendChild(g),u.appendChild(m),u.appendChild(L$2("togglePickTileset","Pick Tileset","pickActive")),u.appendChild(L$2("trimTilesCache","Trim Tiles Cache")),u.appendChild(l("Enable Picking","picking")),c.appendChild(l("Colorize","colorize")),c.appendChild(l("Wireframe","wireframe")),c.appendChild(l("Bounding Volumes","showBoundingVolumes")),c.appendChild(l("Content Volumes","showContentBoundingVolumes")),c.appendChild(l("Request Volumes","showRequestVolumes")),c.appendChild(l("Point Cloud Shading","pointCloudShading"));var v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(r$9("geometricErrorScale",0,2,.01,"Geometric Error Scale")),v.appendChild(r$9("maximumAttenuation",0,32,1,"Maximum Attenuation")),v.appendChild(r$9("baseResolution",0,1,.01,"Base Resolution")),v.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),c.appendChild(v);var y=document.createElement("div");y.setAttribute("data-bind","visible: eyeDomeLighting"),y.appendChild(r$9("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),y.appendChild(r$9("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),v.appendChild(y),h.appendChild(l("Freeze Frame","freezeFrame")),h.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));var x=document.createElement("div");x.appendChild(r$9("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),h.appendChild(x);var b=document.createElement("div");b.setAttribute("data-bind","visible: dynamicScreenSpaceError"),b.appendChild(r$9("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),b.appendChild(r$9("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),h.appendChild(b),d.appendChild(l("Performance","performance")),d.appendChild(r),d.appendChild(l("Statistics","showStatistics"));var w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),d.appendChild(w),d.appendChild(l("Pick Statistics","showPickStatistics"));var C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),d.appendChild(C);var T=document.createElement("div");p.appendChild(T),T.appendChild(document.createTextNode("Color Blend Mode: "));var S=document.createElement("select");S.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),T.appendChild(S);var E=document.createElement("textarea");E.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),T.className="cesium-cesiumInspector-styleEditor",T.appendChild(E);var A=L$2("compileStyle","Compile (Ctrl+Enter)");T.appendChild(A);var P=document.createElement("div");P.className="cesium-cesiumInspector-error",P.setAttribute("data-bind","text: editorError"),T.appendChild(P),f.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),f.appendChild(l("Geometric Error","showGeometricError")),f.appendChild(l("Rendering Statistics","showRenderingStatistics")),f.appendChild(l("Memory Usage (MB)","showMemoryUsage")),f.appendChild(l("Url","showUrl")),_.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));var I=document.createElement("div");I.appendChild(r$9("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),_.appendChild(I);var M=document.createElement("div");M.appendChild(r$9("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),_.appendChild(M);var O=document.createElement("div");O.appendChild(r$9("skipLevels",0,10,1,"Min. levels to skip")),_.appendChild(O),_.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),_.appendChild(l("Load siblings of visible tiles","loadSiblings")),ce$1.applyBindings(n,i)}function r$9(e,t,i,r,n,o){o=u$Y(o,e);var a=document.createElement("input");a.setAttribute("data-bind","value: "+o),a.type="number";var s=document.createElement("input");s.type="range",s.min=t,s.max=i,s.step=r,s.setAttribute("data-bind",'valueUpdate: "input", value: '+e);var l=document.createElement("div");l.appendChild(s);var u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(n)),u.appendChild(a),u.appendChild(l),u}function L$2(e,t,i){var r=document.createElement("button");r.type="button",r.textContent=t,r.className="cesium-cesiumInspector-pickButton";var n="click: "+e;return e$28(i)&&(n+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),r.setAttribute("data-bind",n),r}function M(e){var t;if(e$28(e)){t="Command Statistics";var i=e.commandsInFrustums;for(var r in i)if(i.hasOwnProperty(r)){var n,o=parseInt(r,10);if(7===o)n="1, 2 and 3";else{for(var a=[],s=2;s>=0;s--){var l=Math.pow(2,s);o>=l&&(a.push(s+1),o-=l)}n=a.reverse().join(" and ")}t+="<br> "+i[r]+" in frustum "+n}t+="<br>Total: "+e.totalCommands}return t}function g$1(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function m$3(e,t){if(!e$28(e))throw new t$Z("scene is required");if(!e$28(t))throw new t$Z("performanceContainer is required");var i=this,r=e.canvas,n=new g$G(r);this._eventHandler=n,this._scene=e,this._canvas=r,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;var o,a=this._scene.globe;function s(e){var t=i._scene.pick({x:e.position.x,y:e.position.y});e$28(t)&&(i.primitive=e$28(t.collection)?t.collection:t.primitive),i._scene.requestRender(),i.pickPrimitiveActive=!1}function l(e){var t,r=a.ellipsoid,n=i._scene.camera.pickEllipsoid({x:e.position.x,y:e.position.y},r);if(e$28(n))for(var o=r.cartesianToCartographic(n),s=a._surface.tileProvider._tilesToRenderByTextureCount,l=0;!t&&l<s.length;++l){var u=s[l];if(e$28(u))for(var c=0;!t&&c<u.length;++c){var h=u[c];h$10.contains(h.rectangle,o)&&(t=h)}}i.tile=t,i.pickTileActive=!1}a.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="",ce$1.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=s$3((function(){i.dropDownVisible=!i.dropDownVisible})),this._toggleGeneral=s$3((function(){i.generalVisible=!i.generalVisible})),this._togglePrimitives=s$3((function(){i.primitivesVisible=!i.primitivesVisible})),this._toggleTerrain=s$3((function(){i.terrainVisible=!i.terrainVisible})),this._frustumsSubscription=ce$1.getObservable(this,"frustums").subscribe((function(e){i._scene.debugShowFrustums=e,i._scene.requestRender()})),this._frustumPlanesSubscription=ce$1.getObservable(this,"frustumPlanes").subscribe((function(e){i._scene.debugShowFrustumPlanes=e,i._scene.requestRender()})),this._performanceSubscription=ce$1.getObservable(this,"performance").subscribe((function(e){e?i._performanceDisplay=new o$e({container:i._performanceContainer}):i._performanceContainer.innerHTML=""})),this._showPrimitiveBoundingSphere=s$3((function(){return i._primitive.debugShowBoundingVolume=i.primitiveBoundingSphere,i._scene.requestRender(),!0})),this._primitiveBoundingSphereSubscription=ce$1.getObservable(this,"primitiveBoundingSphere").subscribe((function(){i._showPrimitiveBoundingSphere()})),this._showPrimitiveReferenceFrame=s$3((function(){if(i.primitiveReferenceFrame){var e=i._primitive.modelMatrix;i._modelMatrixPrimitive=new s$f({modelMatrix:e}),i._scene.primitives.add(i._modelMatrixPrimitive)}else e$28(i._modelMatrixPrimitive)&&(i._scene.primitives.remove(i._modelMatrixPrimitive),i._modelMatrixPrimitive=void 0);return i._scene.requestRender(),!0})),this._primitiveReferenceFrameSubscription=ce$1.getObservable(this,"primitiveReferenceFrame").subscribe((function(){i._showPrimitiveReferenceFrame()})),this._doFilterPrimitive=s$3((function(){return i.filterPrimitive?i._scene.debugCommandFilter=function(e){return!(!e$28(i._modelMatrixPrimitive)||e.owner!==i._modelMatrixPrimitive._primitive)||!!e$28(i._primitive)&&(e.owner===i._primitive||e.owner===i._primitive._billboardCollection||e.owner.primitive===i._primitive)}:i._scene.debugCommandFilter=void 0,!0})),this._filterPrimitiveSubscription=ce$1.getObservable(this,"filterPrimitive").subscribe((function(){i._doFilterPrimitive(),i._scene.requestRender()})),this._wireframeSubscription=ce$1.getObservable(this,"wireframe").subscribe((function(e){a._surface.tileProvider._debug.wireframe=e,i._scene.requestRender()})),this._globeDepthSubscription=ce$1.getObservable(this,"globeDepth").subscribe((function(e){i._scene.debugShowGlobeDepth=e,i._scene.requestRender()})),this._pickDepthSubscription=ce$1.getObservable(this,"pickDepth").subscribe((function(e){i._scene.debugShowPickDepth=e,i._scene.requestRender()})),this._depthFrustumSubscription=ce$1.getObservable(this,"depthFrustum").subscribe((function(e){i._scene.debugShowDepthFrustum=e,i._scene.requestRender()})),this._incrementDepthFrustum=s$3((function(){var e=i.depthFrustum+1;return i.depthFrustum=g$1(1,i._numberOfFrustums,e),i._scene.requestRender(),!0})),this._decrementDepthFrustum=s$3((function(){var e=i.depthFrustum-1;return i.depthFrustum=g$1(1,i._numberOfFrustums,e),i._scene.requestRender(),!0})),this._suspendUpdatesSubscription=ce$1.getObservable(this,"suspendUpdates").subscribe((function(e){a._surface._debug.suspendLodUpdate=e,e||(i.filterTile=!1)})),this._showTileCoordinates=s$3((function(){return i.tileCoordinates&&!e$28(o)?o=e.imageryLayers.addImageryProvider(new n$4({tilingScheme:e.terrainProvider.tilingScheme})):!i.tileCoordinates&&e$28(o)&&(e.imageryLayers.remove(o),o=void 0),!0})),this._tileCoordinatesSubscription=ce$1.getObservable(this,"tileCoordinates").subscribe((function(){i._showTileCoordinates(),i._scene.requestRender()})),this._tileBoundingSphereSubscription=ce$1.getObservable(this,"tileBoundingSphere").subscribe((function(){i._showTileBoundingSphere(),i._scene.requestRender()})),this._showTileBoundingSphere=s$3((function(){return i.tileBoundingSphere?a._surface.tileProvider._debug.boundingSphereTile=i._tile:a._surface.tileProvider._debug.boundingSphereTile=void 0,i._scene.requestRender(),!0})),this._doFilterTile=s$3((function(){return i.filterTile?(i.suspendUpdates=!0,a._surface._tilesToRender=[],e$28(i._tile)&&i._tile.renderable&&a._surface._tilesToRender.push(i._tile)):i.suspendUpdates=!1,!0})),this._filterTileSubscription=ce$1.getObservable(this,"filterTile").subscribe((function(){i.doFilterTile(),i._scene.requestRender()})),this._pickPrimitive=s$3((function(){i.pickPrimitiveActive=!i.pickPrimitiveActive})),this._pickPrimitiveActiveSubscription=ce$1.getObservable(this,"pickPrimitiveActive").subscribe((function(e){e?n.setInputAction(s,J$P.LEFT_CLICK):n.removeInputAction(J$P.LEFT_CLICK)})),this._pickTile=s$3((function(){i.pickTileActive=!i.pickTileActive})),this._pickTileActiveSubscription=ce$1.getObservable(this,"pickTileActive").subscribe((function(e){e?n.setInputAction(l,J$P.LEFT_CLICK):n.removeInputAction(J$P.LEFT_CLICK)})),this._removePostRenderEvent=e.postRender.addEventListener((function(){i._update()}))}function g(e,t){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("scene is required.");e=i$a(e);var i=document.createElement("div"),r=new m$3(t,i);this._viewModel=r,this._container=e;var n=document.createElement("div");this._element=n;var o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),n.appendChild(o),n.className="cesium-cesiumInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var a=document.createElement("div");this._panel=a,a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);var s=o$5.createSection,l=o$5.createCheckbox,u=s(a,"General","generalVisible","toggleGeneral"),c=l("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),c.appendChild(h),u.appendChild(c),u.appendChild(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(i);var d=document.createElement("div");d.className="cesium-cesiumInspector-shaderCache",d.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(d);var f=document.createElement("div");u.appendChild(f);var p=document.createElement("span");p.setAttribute("data-bind",'html: " Frustum:"'),f.appendChild(p);var _=document.createElement("span");_.setAttribute("data-bind","text: depthFrustumText"),f.appendChild(_);var m=document.createElement("input");m.type="button",m.value="-",m.className="cesium-cesiumInspector-pickButton",m.setAttribute("data-bind","click: decrementDepthFrustum"),f.appendChild(m);var $=document.createElement("input");$.type="button",$.value="+",$.className="cesium-cesiumInspector-pickButton",$.setAttribute("data-bind","click: incrementDepthFrustum"),f.appendChild($);var g=s(a,"Primitives","primitivesVisible","togglePrimitives"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",g.appendChild(v);var y=document.createElement("input");y.type="button",y.value="Pick a primitive",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var x=document.createElement("div");x.className="cesium-cesiumInspector-center",x.appendChild(y),v.appendChild(x),v.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),v.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),v.appendChild(this._primitiveOnly);var b=s(a,"Terrain","terrainVisible","toggleTerrain"),w=document.createElement("div");w.className="cesium-cesiumInspector-pickSection",b.appendChild(w);var C=document.createElement("input");C.type="button",C.value="Pick a tile",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),(x=document.createElement("div")).appendChild(C),x.className="cesium-cesiumInspector-center",w.appendChild(x);var T=document.createElement("div");w.appendChild(T);var S=document.createElement("input");S.type="button",S.value="Parent",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: selectParent");var E=document.createElement("input");E.type="button",E.value="NW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectNW");var A=document.createElement("input");A.type="button",A.value="NE",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: selectNE");var P=document.createElement("input");P.type="button",P.value="SW",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSW");var I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");var M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",T.className="cesium-cesiumInspector-frustumStatistics",T.appendChild(M),T.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");var O=document.createElement("div");O.className="cesium-cesiumInspector-relativeText",O.textContent="Select relative:",T.appendChild(O);var D=document.createElement("table"),R=document.createElement("tr"),L=document.createElement("tr"),B=document.createElement("td");B.appendChild(S);var N=document.createElement("td");N.appendChild(E);var F=document.createElement("td");F.appendChild(A),R.appendChild(B),R.appendChild(N),R.appendChild(F);var z=document.createElement("td"),k=document.createElement("td");k.appendChild(P);var V=document.createElement("td");V.appendChild(I),L.appendChild(z),L.appendChild(k),L.appendChild(V),D.appendChild(R),D.appendChild(L),T.appendChild(D),w.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),w.appendChild(l("Show only selected","filterTile","hasPickedTile")),b.appendChild(l("Wireframe","wireframe")),b.appendChild(l("Suspend LOD update","suspendUpdates")),b.appendChild(l("Show tile coordinates","tileCoordinates")),ce$1.applyBindings(r,this._element)}function p(e){return n$17("Assets/Textures/SkyBox/tycho2t3_80_"+e+".jpg")}function K(e){e._renderLoopRunning=!0;var t=0;p$Q((function i(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(e$28(n)){var o=1e3/n,a=r-t;a>o&&(e.resize(),e.render(),t=r-a%o),p$Q(i)}else e.resize(),e.render(),p$Q(i)}catch(t){e._errorListenerEvent.raiseEvent(t)}else e._renderLoopRunning=!1}))}function J(e){var t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,e._pixelRatio=t,e$28(e._scene)&&(e._scene.pixelRatio=t),t}function Q$1(e,t,i,r){var n=e,o=t;(n>i||o>r)&&(n/i>o/r?(n=i,o=t/e*i):(n=e/t*r,o=r));return{width:n,height:o}}function b$2(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=J(e);e._canvasClientWidth=i,e._canvasClientHeight=r,i*=n,r*=n;var o=3840,a=1080,s=e._options;e$28(s.contextOptions)&&(o=u$Y(s.contextOptions.maxDrawingBufferWidth,o),a=u$Y(s.contextOptions.maxDrawingBufferHeight,a));var l=Q$1(i,r,o,a);t.width=l.width,t.height=l.height,e._canRender=0!==i&&0!==r,e._lastDevicePixelRatio=window.devicePixelRatio}function B$1(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;e$28(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function f$2(e,t){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e),t=u$Y(t,{}),this._options=t;var i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);var r=document.createElement("canvas"),n=s$V.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=n,n&&(r.style.imageRendering=s$V.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},i.appendChild(r);var o=document.createElement("div");o.className="cesium-widget-credits";var a=e$28(t.creditContainer)?i$a(t.creditContainer):i;a.appendChild(o);var s=e$28(t.creditViewport)?i$a(t.creditViewport):i,l=u$Y(t.showRenderLoopErrors,!0),u=u$Y(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=r,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=s,this._creditContainer=a,this._innerCreditContainer=o,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=l,this._resolutionScale=1,this._useBrowserRecommendedResolution=u,this._forceResize=!1,this._clock=e$28(t.clock)?t.clock:new u$M,this._isShowErrorPanel=!0,this._errorListenerEvent=new o$1o,b$2(this);try{var c=new F$4({canvas:r,contextOptions:t.contextOptions,creditContainer:o,creditViewport:s,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:u$Y(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});c.pixelRatio=this._pixelRatio,this._scene=c,c.camera.constrainedAxis=t$X.UNIT_Z,B$1(this);var h=u$Y(c.mapProjection.ellipsoid,t$V.WGS84),d=t.globe;e$28(d)||(d=new h$a(h)),!1!==d&&(c.globe=d,c.globe.shadows=u$Y(t.terrainShadows,q$L.RECEIVE_ONLY));var f=t.skyBox;e$28(f)||(f=new m$7({sources:{positiveX:p("px"),negativeX:p("mx"),positiveY:p("py"),negativeY:p("my"),positiveZ:p("pz"),negativeZ:p("mz")}})),!1!==f&&(c.skyBox=f,c.sun=new u$6,c.moon=new s$c);var _=t.cloudBox;e$28(_)&&(c.cloudBox=_);var m=t.skyAtmosphere;e$28(m)||(m=new s$8(h)),!1!==m&&(c.skyAtmosphere=m);var $=!1!==t.globe&&t.imageryProvider;e$28($)||($=new u$f({url:n$17("Assets/Textures/GlobalBkLayer.jpg")})),!1!==$&&c.imageryLayers.addImageryProvider($),e$28(t.terrainProvider)&&!1!==t.globe&&(c.terrainProvider=t.terrainProvider,t.terrainProvider.readyPromise.otherwise((function(){c.terrainProvider=c.globe._defaultTerrainProvider}))),e$28(t.gridProvider)&&c.imageryLayers.addGridProvider(t.gridProvider),this._screenSpaceEventHandler=new g$G(r,!1),e$28(t.sceneMode)&&(t.sceneMode===P$$.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===P$$.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=u$Y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var g=this;c.renderError.addEventListener((function(e,t){if(g._useDefaultRenderLoop=!1,g._renderLoopRunning=!1,g._showRenderLoopErrors){g.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}}))}catch(e){if(l){this.showErrorPanel("Error constructing CesiumWidget.","verify your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:",e)}throw e}}function r$8(e){var t=this,i=ce$1.observable(l$1b.fullscreen),r=ce$1.observable(l$1b.enabled);this.isFullscreen=void 0,ce$1.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,ce$1.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(e){r(e&&l$1b.enabled)}}),this.tooltip=void 0,ce$1.defineProperty(this,"tooltip",(function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"})),this._command=s$3((function(){l$1b.fullscreen?l$1b.exitFullscreen():l$1b.requestFullscreen(t._fullscreenElement)}),ce$1.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=u$Y(i$a(e),document.body),this._callback=function(){i(l$1b.fullscreen)},document.addEventListener(l$1b.changeEventName,this._callback)}Object.defineProperties(l$5.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 le}},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,e$28(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 o=i[n];this[o]=this[o]}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 a=e.pointCloudShading;this.pointCloudShading=a.attenuation,this.geometricErrorScale=a.geometricErrorScale,this.maximumAttenuation=a.maximumAttenuation?a.maximumAttenuation:0,this.baseResolution=a.baseResolution?a.baseResolution:0,this.eyeDomeLighting=a.eyeDomeLighting,this.eyeDomeLightingStrength=a.eyeDomeLightingStrength,this.eyeDomeLightingRadius=a.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=y$2(e,!1),this._pickStatisticsText=y$2(e,!0),Y$1(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature!==e){var t=this._feature;e$28(t)&&!t.content.isDestroyed()&&(!this.colorize&&e$28(this._style)?t.color=e$28(this._style.color)?this._style.color.evaluateColor(t,ce):e$1S.WHITE:t.color=v$3,this._scene.requestRender()),e$28(e)&&(e$1S.clone(e.color,v$3),e.color=Z$2,this._scene.requestRender()),this._feature=e}}},tile:{get:function(){return this._tile},set:function(e){if(this._tile!==e){var t=this._tile;e$28(t)&&!t.isDestroyed()&&!k$1(t.content)&&(t.color=v$3,this._scene.requestRender()),e$28(e)&&!k$1(e.content)&&(e$1S.clone(e.color,v$3),e.color=Z$2,this._scene.requestRender()),this._tile=e}}}}),l$5.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},l$5.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},l$5.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},l$5.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},l$5.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},l$5.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},l$5.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},l$5.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},l$5.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},l$5.prototype.trimTilesCache=function(){e$28(this._tileset)&&this._tileset.trimLoadedTiles()},l$5.prototype.compileStyle=function(){var e=this._tileset;if(e$28(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new d$o(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},l$5.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,o=r.selectionEnd,a=o,s=r.value.slice(n,o).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),a-=2):(s[i]=s[i].substr(1),a-=1));else for(i=0;i<l;++i)s[i]=" "+s[i],a+=2;var u=s.join("\n");r.value=r.value.slice(0,n)+u+r.value.slice(o),r.selectionStart=n!==o?n:a,r.selectionEnd=a}else t.ctrlKey&&(10===t.keyCode||13===t.keyCode)&&this.compileStyle();return!0},l$5.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),e$28(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=y$2(e,!1),this._pickStatisticsText=y$2(e,!0))},l$5.prototype.isDestroyed=function(){return!1},l$5.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var e=this;return this._definedProperties.forEach((function(t){ce$1.getObservable(e,t).dispose()})),i$Z(this)},l$5.getStatistics=y$2,Object.defineProperties(y$1.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),y$1.prototype.isDestroyed=function(){return!1},y$1.prototype.destroy=function(){return ce$1.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i$Z(this)},Object.defineProperties(m$3.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 s$3((function(){e.tile=e.tile.parent}))}},selectNW:{get:function(){var e=this;return s$3((function(){e.tile=e.tile.northwestChild}))}},selectNE:{get:function(){var e=this;return s$3((function(){e.tile=e.tile.northeastChild}))}},selectSW:{get:function(){var e=this;return s$3((function(){e.tile=e.tile.southwestChild}))}},selectSE:{get:function(){var e=this;return s$3((function(){e.tile=e.tile.southeastChild}))}},primitive:{get:function(){return this._primitive},set:function(e){var t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,e$28(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e$28(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout((function(){e.show=!0}),50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(e$28(e)){if(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;var t=e.data;e$28(t)?this.tileText+="<br>Min: "+t.minimumHeight+" Max: "+t.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),m$3.prototype._update=function(){this.frustums&&(this.frustumStatisticText=M(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=g$1(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},m$3.prototype.isDestroyed=function(){return!1},m$3.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(),i$Z(this)},Object.defineProperties(g.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return ce$1.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i$Z(this)},Object.defineProperties(f$2.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){if(e<=0)throw new t$Z("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&K(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new t$Z("resolutionScale must be greater than 0.");this._resolutionScale=e,this._forceResize=!0}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},setErrorPanelIsShow:{get:function(){return this._isShowErrorPanel},set:function(e){this._isShowErrorPanel!==e&&(this._isShowErrorPanel=e)}},errorListenerEvent:{get:function(){return this._errorListenerEvent}}}),f$2.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel",!1===this.setErrorPanelIsShow?n.style.display="none":n.style.display="block";var o=document.createElement("div");o.className="cesium-widget-errorPanel-content",n.appendChild(o);var a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),o.appendChild(a);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}if(s.className="cesium-widget-errorPanel-scroll",o.appendChild(s),l(),e$28(window.addEventListener)&&window.addEventListener("resize",l,!1),e$28(t)){var u=document.createElement("div");u.className="cesium-widget-errorPanel-message",u.innerHTML="<p>"+t+"</p>",s.appendChild(u)}var c="(no error details available)";e$28(i)&&(c=f$$(i));var h=document.createElement("div");h.className="cesium-widget-errorPanel-message",h.appendChild(document.createTextNode(c)),s.appendChild(h);var d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){e$28(l)&&e$28(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},d.appendChild(f),r.appendChild(n),typeof console<"u"&&console.error(e+"\n"+t+"\n"+c)},f$2.prototype.isDestroyed=function(){return!1},f$2.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),i$Z(this)},f$2.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;!this._forceResize&&this._canvasClientWidth===t&&this._canvasClientHeight===i&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,b$2(this),B$1(this),this._scene.requestRender())},f$2.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},Object.defineProperties(r$8.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new t$Z("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}}),r$8.prototype.isDestroyed=function(){return!1},r$8.prototype.destroy=function(){document.removeEventListener(l$1b.changeEventName,this._callback),i$Z(this)};var a$1="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",d$4="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 r$7(e,t){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e);var i=new r$8(t);i._exitFullScreenPath=d$4,i._enterFullScreenPath=a$1;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),ce$1.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}function D$1(e){if(!e$28(e)||!e$28(e.scene)||!e$28(e.viewer))throw new t$Z("options.scene and optinss.viewer is required.");this._viewer=e.viewer,this._url=u$Y(e.url,"//dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e$1O.getKey(e.key),this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new o$1o,this._dataSource=void 0;var t=this;this._searchCommand=s$3((function(){t.isSearchInProgress?U(t):Q(t)})),this.keepExpanded=!1,ce$1.track(this,["_searchText","_isSearchInProgress","keepExpanded"]),this.isSearchInProgress=void 0,ce$1.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,ce$1.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){if("string"!=typeof e)throw new t$Z("value must be a valid string.");this._searchText=e}}),this.flightDuration=void 0,ce$1.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){if(e$28(e)&&e<0)throw new t$Z("value must be positive.");this._flightDuration=e}})}function j$2(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:y$15.IDENTITY})}Object.defineProperties(r$7.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),r$7.prototype.isDestroyed=function(){return!1},r$7.prototype.destroy=function(){return this._viewModel.destroy(),ce$1.cleanNode(this._element),this._container.removeChild(this._element),i$Z(this)},Object.defineProperties(D$1.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},dataSource:{get:function(){return this._dataSource}}});var L$1="https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json";function Q(e){var t=e.searchText;if(!/^\s*$/.test(t)){var i=t.match(/[^\s,\n]+/g);if(2===i.length||3===i.length){var r=+i[0],n=+i[1],o=3===i.length?+i[2]:300;if(!isNaN(r)&&!isNaN(n)&&!isNaN(o))return void j$2(e,t$X.fromDegrees(r,n,o))}e._isSearchInProgress=!0;var a={key:e.geoKey},s=t.match(/[^\s-\n]+/g);2===s.length?(a.city=s[0],a.keywords=s[1]):a.keywords=s[0],t$S.fetch({url:L$1,queryParameters:a}).then((t=>{t=JSON.parse(t);if(e._isSearchInProgress=!1,e$28(t.error))return e._isSearchInProgress=!1,void(e.searchText=t.error.errorMsg);e$28(e._datasource)&&(e._viewer.dataSources.remove(e._datasource),e._datasource=void 0);var i=t.poiInfos[0];e._searchText=i.name;var r=i.location;r.lon=r.x,r.lat=r.y,!e$28(t$X.fromDegrees(r.x,r.y,500))||(e._datasource=Y(t,e),e._viewer.dataSources.add(e._datasource),o$1q(e._datasource,(function(t){e._datasource=t,e._viewer.flyTo(t)}),(function(e){console.log(e)})))})).catch((e=>{console.log("error",e)}))}}function U(e){e._isSearchInProgress=!1,e$28(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}function Y(e,t){for(var i={type:"FeatureCollection",features:[]},r=e.poiInfos,n=[],o=0,a=r.length;o<a;o++){var s=r[o];s.address;var l=s.location,u=e$27.toRadians(l.x),c=e$27.toRadians(l.y);n.push(new t$W(u,c))}return o$1q(y$K(t._viewer.terrainProvider,9,n),(function(e){for(var t=0,n=r.length;t<n;t++){var o=r[t],a=o.address,s=e[t],l={type:"Feature",geometry:{type:"Point",coordinates:[e$27.toDegrees(s.longitude),e$27.toDegrees(s.latitude),s.height]},properties:{title:o.name,"marker-color":"#B9EB14",tel:o.telephone,address:a}};i.features.push(l)}return(new y$t).loadPoiJsonData(i)}))}var l$4="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",f$1="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 s$2(e){if(!e$28(e)||!e$28(e.container))throw new t$Z("options.container is required.");if(!e$28(e.scene)||!e$28(e.viewer))throw new t$Z("options.scene and options.viewer is required.");var t=i$a(e.container),i=new D$1(e);i._startSearchPath=l$4,i._stopSearchPath=f$1;var r=document.createElement("form");r.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",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 }'),r.appendChild(n);var o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(o),t.appendChild(r),ce$1.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||n.blur()},this._onInputEnd=function(e){t.contains(e.target)&&n.focus()},s$V.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0))}function r$6(e,t){if(!e$28(e))throw new t$Z("scene is required.");this._scene=e,this._duration=t;var i=this;this._command=s$3((function(){i._scene.camera.flyHome(i._duration)})),this.tooltip="View Home",ce$1.track(this,["tooltip"])}function o$4(e,t,i){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e);var r=new r$6(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-toolbar-button cesium-home-button",n.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(n),ce$1.applyBindings(r,n),this._container=e,this._viewModel=r,this._element=n}Object.defineProperties(s$2.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s$2.prototype.isDestroyed=function(){return!1},s$2.prototype.destroy=function(){return s$V.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),ce$1.cleanNode(this._form),this._container.removeChild(this._form),i$Z(this)},Object.defineProperties(r$6.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(e$28(e)&&e<0)throw new t$Z("value must be positive.");this._duration=e}}}),Object.defineProperties(o$4.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),o$4.prototype.isDestroyed=function(){return!1},o$4.prototype.destroy=function(){return ce$1.cleanNode(this._element),this._container.removeChild(this._element),i$Z(this)};var r$5="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",o$3="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 i$4(){this._cameraClicked=new o$1o,this._closeClicked=new o$1o,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",ce$1.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,ce$1.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?o$3:r$5}}),ce$1.defineProperty(this,"_bodyless",{get:function(){return!e$28(this.description)||0===this.description.length}})}function l$3(e){o$1u.defined("container",e),e=i$a(e);var t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);var i=document.createElement("div");i.className="cesium-infoBox-title",i.setAttribute("data-bind","text: titleText"),t.appendChild(i);var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-infoBox-camera",r.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(r);var n=document.createElement("button");n.type="button",n.className="cesium-infoBox-close",n.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),n.innerHTML="×",t.appendChild(n);var o=document.createElement("iframe");o.className="cesium-infoBox-iframe",o.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),o.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),o.setAttribute("allowfullscreen",!0),t.appendChild(o);var a=new i$4;ce$1.applyBindings(a,t),this._container=e,this._element=t,this._frame=o,this._viewModel=a,this._descriptionSubscription=void 0;var s=this;o.addEventListener("load",(function(){var e=o.contentDocument,i=e.createElement("link");i.href=n$17("Widgets/InfoBox/InfoBoxDescription.css"),i.rel="stylesheet",i.type="text/css";var r=e.createElement("div");r.className="cesium-infoBox-description",e.head.appendChild(i),e.body.appendChild(r),s._descriptionSubscription=c$2(a,"description",(function(e){o.style.height="5px",r.innerHTML=e;var i=null,n=r.firstElementChild;if(null!==n&&1===r.childNodes.length){var a=window.getComputedStyle(n);if(null!==a){var s=a["background-color"],l=e$1S.fromCssColorString(s);e$28(l)&&0!==l.alpha&&(i=a["background-color"])}}t.style["background-color"]=i;var u=r.getBoundingClientRect().height;o.style.height=u+"px"}))})),o.setAttribute("src","about:blank")}i$4.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(i$4.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),Object.defineProperties(l$3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),l$3.prototype.isDestroyed=function(){return!1},l$3.prototype.destroy=function(){var e=this._container;return ce$1.cleanNode(this._element),e.removeChild(this._element),e$28(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),i$Z(this)};var n$2=function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=document.createDocumentFragment();t.firstChild;)i.appendChild(t.firstChild);return i},f=function(e,t,i){t=i$a(t);var r,n=n$2(e),o=[];for(r=0;r<n.childNodes.length;++r)o.push(n.childNodes[r]);for(t.appendChild(n),r=0;r<o.length;++r){var a=o[r];(1===a.nodeType||8===a.nodeType)&&ce$1.applyBindings(i,a)}return o},y=function(e,t){if(!e$28(e)||!e$28(e.viewer)||!e$28(e.scene))throw new t$Z("options and options.viewer and optins.scene is required.");this.viewer=e.viewer,this.viewer.afterViewerChanged=new o$1o,this.viewer.beforeViewerChanged=new o$1o,this.scene=e.scene,this.eventHelper=new n$R,this.showCompass=e$28(this.scene),this.heading=this.showCompass?this.scene.camera.heading:0,this.isOrbiting=!1,this.orbitCursorAngle=0,this.isRotating=!1,this.rotateInitialCursorAngle=void 0,this.rotateFrame=void 0,this.rotateMouseMoveFunction=void 0,this.rotateMouseUpFunction=void 0,this._unsubcribeFromPostRender=void 0,this.tiltbarLeft=56,this.tiltbarTop=3,this.isTilting=!1,this.zoombarTop=65,this.tiltInitialCursorAngle=0,this.screenSpaceEventHandler=new g$G(t),this.clickStartPosition=null,ce$1.track(this,["showCompass","heading","isOrbiting","orbitCursorAngle","isRotating","tiltbarLeft","tiltbarTop","isTilting","zoombarTop"]);var i=this;function r(){e$28(i.viewer)?(i._unsubcribeFromPostRender&&(i._unsubcribeFromPostRender(),i._unsubcribeFromPostRender=void 0),i.showCompass=!0,i._unsubcribeFromPostRender=i.scene.postRender.addEventListener((function(){var e=Math.abs(i.scene.camera.heading-i.heading);if((e<e$27.PI_OVER_TWO||e>3*e$27.PI_OVER_TWO)&&(i.heading=i.scene.camera.heading),i.scene.screenSpaceCameraController,!i.isTilting){var t=i.scene.camera.pitch+e$27.PI_OVER_TWO,r=e$27.PI_OVER_TWO/20,n=Math.floor(t/r);n=(n=n>19?19:n)<0?0:n,i.tiltbarLeft=L[n].x,i.tiltbarTop=L[n].y}}))):(i._unsubcribeFromPostRender&&(i._unsubcribeFromPostRender(),i._unsubcribeFromPostRender=void 0),i.showCompass=!1)}this.eventHelper.add(this.viewer.afterViewerChanged,r,this),function(){var t=e$27.PI_OVER_TWO+e.scene.camera.pitch,r=Math.PI/2/20,n=Math.floor(t/r);n=(n=n>19?19:n)<0?0:n,i.tiltbarLeft=L[n].x,i.tiltbarTop=L[n].y}(),r()},C$2=new o$1k;new t$X,y.prototype.handleZoomBarScrollMouseDown=function(e,t){e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e$28(e.zoombarTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoombarTickFunction),e.zoomBarScrollMouseUpFunction=void 0,e.zoombarTickFunction=void 0,e.isZoomBarScrolling=!0;var i=e.viewer.scene.camera;e.zoombarTickFunction=function(t){var r=e.zoombarTop-65;r>0?e.viewer.scene.mode===P$$.COLUMBUS_VIEW?i.zoomOut():z(e,-1):r<0&&(e.viewer.scene.mode===P$$.COLUMBUS_VIEW?i.zoomIn():z(e,1))},e.zoomBarScrollMouseMoveFunction=function(t,r){var n=e.zoombarTop,o=t.endPosition.y-t.startPosition.y+n;o=(o=o<0?0:o)>120?120:o,e.zoombarTop=o,e.zoombarTop-n>0?e.viewer.scene.mode===P$$.COLUMBUS_VIEW?i.zoomOut():z(e,-1):e.viewer.scene.mode===P$$.COLUMBUS_VIEW?i.zoomIn():z(e,1)},e.zoomBarScrollMouseUpFunction=function(t){e.isZoomBarScrolling=!1,e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e$28(e.zoombarTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoombarTickFunction),e.zoomBarScrollMouseUpFunction=void 0,e.zoomBarScrollMouseMoveFunction=void 0,e.zoombarTickFunction=void 0,e.zoombarTop=65},e.screenSpaceEventHandler.setInputAction(e.zoomBarScrollMouseUpFunction,J$P.LEFT_UP),e.screenSpaceEventHandler.setInputAction(e.zoomBarScrollMouseMoveFunction,J$P.MOUSE_MOVE),e.viewer.clock.onTick.addEventListener(e.zoombarTickFunction)},y.prototype.handleZoomInMouseDown=function(e,t){e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.zoominTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoominTickFunction),e.zoominMouseUpFunction=void 0,e.zoominTickFunction=void 0,e.isZoomin=!0,e.zoominLastTimestamp=kt$7();var i=e.viewer.scene,r=i.camera;e.zoominTickFunction=function(t){if(e.viewer.scene.mode===P$$.COLUMBUS_VIEW){var n=j$1(i,1);e$28(n)&&r.zoomIn(n)}else z(e,1)},e.zoominMouseUpFunction=function(t){e.isZoomin=!1,e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.zoominTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoominTickFunction),e.zoominMouseUpFunction=void 0,e.zoominTickFunction=void 0},e.screenSpaceEventHandler.setInputAction(e.zoominMouseUpFunction,J$P.LEFT_UP),e.viewer.clock.onTick.addEventListener(e.zoominTickFunction)},y.prototype.handleZoomOutMouseDown=function(e,t){e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.zoomoutTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoomoutTickFunction),e.zoomoutMouseUpFunction=void 0,e.zoomoutTickFunction=void 0,e.iszoomout=!0,e.zoomoutLastTimestamp=kt$7();var i=e.viewer.scene,r=i.camera;e.zoomoutTickFunction=function(t){if(e.viewer.scene.mode===P$$.COLUMBUS_VIEW){var n=j$1(i,1);e$28(n)&&r.zoomOut(n)}else z(e,-1)},e.zoomoutMouseUpFunction=function(t){e.iszoomout=!1,e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.zoomoutTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.zoomoutTickFunction),e.zoomoutMouseUpFunction=void 0,e.zoomoutTickFunction=void 0},e.screenSpaceEventHandler.setInputAction(e.zoomoutMouseUpFunction,J$P.LEFT_UP),e.viewer.clock.onTick.addEventListener(e.zoomoutTickFunction)};var X=1;function w(e,t,i){e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.rotateEastTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.rotateEastTickFunction),e.rotateEastMouseUpFunction=void 0,e.rotateEastTickFunction=void 0,e.isrotateEasting=!0,e.rotateEastLastTimestamp=kt$7(),e.viewer.scene.camera;var r=e$27.PI_OVER_TWO-Math.atan2(-i.y,i.x),n=Math.PI/4,o=0,a=1,s=2,l=3,u=4;o=r>=-n&&r<=n?u:r>=n&&r<=3*n?s:r>=3*n&&r<=5*n?l:a,e.rotateEastTickFunction=function(t){var i=e.viewer.scene.camera,n=kt$7();switch(e.rotateEastLastTimestamp,r=20*Math.abs(i._positionCartographic.height/6378317)*5e-4,o){case a:i.rotate(i.up,r);break;case s:i.rotate(i.up,-r);break;case l:i.rotate(i.right,-r);break;case u:i.rotate(i.right,r)}e.rotateLastTimestamp=n},e.rotateEastMouseUpFunction=function(t){e.isRotateEasting=!1,e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e$28(e.rotateEastTickFunction)&&e.viewer.clock.onTick.removeEventListener(e.rotateEastTickFunction),e.rotateEastMouseUpFunction=void 0,e.rotateEastTickFunction=void 0},e.screenSpaceEventHandler.setInputAction(e.rotateEastMouseUpFunction,J$P.LEFT_UP),e.viewer.clock.onTick.addEventListener(e.rotateEastTickFunction)}y.prototype.handleMouseDown=function(e,t){var i=t.currentTarget,r=t.currentTarget.getBoundingClientRect();X=r.height/i.clientHeight,r.width;var n=new o$1k((r.right-r.left)/2,(r.bottom-r.top)/2),o=0;o="mousedown"===t.type?new o$1k(t.clientX-r.left,t.clientY-r.top):new o$1k(t.originalEvent.touches[0].clientX-r.left,t.originalEvent.touches[0].clientY-r.top);var a=o$1k.subtract(o,n,C$2);this.clickStartPosition=new o$1k(t.clientX,t.clientY);var s=o$1k.magnitude(a);if((s/=X)>30&&s<45)tt(this,i,a);else{if(!(s>50&&s<70))return w(this,i,a);var l=e$27.PI_OVER_TWO-Math.atan2(-a.y,a.x);l>=0&&l<=e$27.PI_OVER_TWO&&nt(this,i,a)}},y.prototype.handleMouseUp=function(e,t){var i=t.currentTarget.getBoundingClientRect(),r=new o$1k((i.right-i.left)/2,(i.bottom-i.top)/2),n=0;n="mouseup"===t.type?new o$1k(t.clientX-i.left,t.clientY-i.top):new o$1k(t.originalEvent.touches[0].clientX-i.left,t.originalEvent.touches[0].clientY-i.top);var o=o$1k.subtract(n,r,C$2),a=o$1k.magnitude(o);if(a>30&&a<45){var s=e$27.toDegrees(Math.atan2(-o.y,o.x)),l=new o$1k(t.clientX,t.clientY),u=l.x-this.clickStartPosition.x,c=l.y-this.clickStartPosition.y;if(Math.sqrt(u*u+c*c)>5)return;var h=e$27.toDegrees(e.heading),d=Math.abs(s-h),f=e.viewer.scene;(s>0&&h>0&&h<90&&d>80&&d<100||d>260&&d<280)&&f.camera.flyTo({destination:f.camera.position,orientation:{heading:0,pitch:f.camera.pitch}})}};var x$2=new y$15,W=new y$15,d$3=new t$X,B=new o$1k;function tt(e,t,i){e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.rotateMouseMoveFunction=void 0,e.rotateMouseUpFunction=void 0,e.isRotating=!0,e.rotateInitialCursorAngle=Math.atan2(-i.y,i.x);var r=e.viewer.scene,n=r.camera,o=B;o.x=r.canvas.clientWidth/2,o.y=r.canvas.clientHeight/2;var a=n.pickEllipsoid(o,r.globe.ellipsoid,d$3);e$28(a)?(e.rotateFrame=m$1b.eastNorthUpToFixedFrame(a,r.globe.ellipsoid,W),e.rotateIsLook=!1):(e.rotateFrame=m$1b.eastNorthUpToFixedFrame(n.positionWC,r.globe.ellipsoid,W),e.rotateIsLook=!0);var s=y$15.clone(n.transform,x$2);n.lookAtTransform(e.rotateFrame),e.rotateInitialCameraAngle=-n.heading,e.rotateInitialCameraDistance=t$X.magnitude(new t$X(n.position.x,n.position.y,0)),n.lookAtTransform(s),e.rotateMouseMoveFunction=function(i,r){var n=t.getBoundingClientRect(),o=new o$1k((n.right-n.left)/2,(n.bottom-n.top)/2),a=new o$1k(r.clientX-n.left,r.clientY-n.top),s=o$1k.subtract(a,o,C$2),l=Math.atan2(-s.y,s.x)-e.rotateInitialCursorAngle,u=e$27.zeroToTwoPi(e.rotateInitialCameraAngle-l),c=e.viewer.scene.camera,h=y$15.clone(c.transform,x$2);c.lookAtTransform(e.rotateFrame);var d=-c.heading;c.rotateRight(u-d),c.lookAtTransform(h)},e.rotateMouseUpFunction=function(t){e.isRotating=!1,e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.rotateMouseMoveFunction=void 0,e.rotateMouseUpFunction=void 0},e.screenSpaceEventHandler.setInputAction(e.rotateMouseMoveFunction,J$P.MOUSE_MOVE),e.screenSpaceEventHandler.setInputAction(e.rotateMouseUpFunction,J$P.LEFT_UP)}var L=[{x:56,y:3},{x:59,y:4},{x:64,y:5},{x:69,y:6},{x:74,y:7},{x:79,y:9},{x:84,y:12},{x:89,y:15},{x:92,y:19},{x:94,y:20},{x:99,y:25},{x:104,y:34},{x:106,y:40},{x:107,y:44},{x:107,y:46},{x:107,y:48},{x:107,y:50},{x:107,y:52},{x:107,y:54},{x:107,y:56}],Z$1=Math.PI/40;function nt(e,t,i){e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.tiltMouseMoveFunction=void 0,e.tiltMouseUpFunction=void 0;var r=e$27.PI_OVER_TWO-Math.atan2(-i.y,i.x);r=(r=r<0?0:r)>e$27.PI_OVER_TWO?e$27.PI_OVER_TWO:r,e.tiltInitialCursorAngle=r,e.isTilting=!0;var n=e.viewer.scene,o=n.camera,a=B;a.x=n.canvas.clientWidth/2,a.y=n.canvas.clientHeight/2;for(var s=o.pickEllipsoid(a,n.globe.ellipsoid,d$3);!e$28(s)&&a.y<n.canvas.clientHeight;)a.y+=5,s=o.pickEllipsoid(a,n.globe.ellipsoid,d$3);!e$28(s)||(e.tiltFrame=m$1b.eastNorthUpToFixedFrame(s,n.globe.ellipsoid,W),e.tiltMouseMoveFunction=function(i,r){e.isTilting=!0;var n=t.getBoundingClientRect(),o=new o$1k((n.right-n.left)/2,(n.bottom-n.top)/2),a=new o$1k(r.clientX-n.left,r.clientY-n.top),s=o$1k.subtract(a,o,C$2),l=e$27.PI_OVER_TWO-Math.atan2(-s.y,s.x);l=(l=l<0?0:l)>e$27.PI_OVER_TWO?e$27.PI_OVER_TWO:l;var u=e.viewer.scene.camera,c=y$15.clone(u.transform,x$2);u.lookAtTransform(e.tiltFrame);var h=l-e.tiltInitialCursorAngle;u.rotateUp(h),e.tiltInitialCursorAngle=l,u.lookAtTransform(c);var d=Math.ceil(l/Z$1),f=L[d=d>19?19:d];e.tiltbarLeft=f.x,e.tiltbarTop=f.y},e.tiltMouseUpFunction=function(t){e.isTilting=!1,e.screenSpaceEventHandler.removeInputAction(J$P.MOUSE_MOVE),e.screenSpaceEventHandler.removeInputAction(J$P.LEFT_UP),e.tiltMouseMoveFunction=void 0,e.tiltMouseUpFunction=void 0},e.screenSpaceEventHandler.setInputAction(e.tiltMouseMoveFunction,J$P.MOUSE_MOVE),e.screenSpaceEventHandler.setInputAction(e.tiltMouseUpFunction,J$P.LEFT_UP))}function j$1(e,t){var i=e.camera,r=e.canvas,n=new o$1k;n.x=r.clientWidth/2,n.y=r.clientHeight/2;var o=q(e,n);if(e$28(o)){var a=t$X.distance(i.positionWC,o),s=.0618*t*.2;return a*(s=a>300?s:2*s)}}function z(e,t){var i=e.viewer.scene,r=i.camera,n=i.canvas,o=new o$1k;o.x=n.clientWidth/2,o.y=n.clientHeight/2;var a=q(i,o);if(e$28(a)){var s=t$X.distance(r.position,a),l=.0618*t*.2;l=s>300?l:2*l,r.position;var u=s*l,c=new t$X;t$X.subtract(a,r.position,c);var h=new t$X,d=(h=t$X.clone(r.right,h),t$X.dot(c,h)),f=new t$X;f=t$X.multiplyByScalar(h,d,f);var p=new t$X;p=t$X.subtract(c,f,p);var _=new t$X;_=t$X.normalize(p,_),new t$X,r.move(_,u);var m=new t$X;m=t$X.normalize(a,m);var $=t$X.magnitude(a),g=t$V.fromCartesian3($),v=r.pickEllipsoid(o,g,new t$X);if(e$28(v)&&!isNaN(v.x)&&!isNaN(v.y)&&!isNaN(v.z)&&(v=t$X.normalize(v,v),!(r._positionCartographic.height<0))){var y=t$X.angleBetween(m,v);if(!e$27.equalsEpsilon(y,0,e$27.EPSILON10)){var x=new t$X;x=t$X.cross(m,v,x),r.rotate(x,y)}}}}var et=new f$18,rt$1=new t$X,at$1=new t$X;function q(e,t){var i=e.globe,r=e.camera;if(e$28(i)){var n;e.pickPositionSupported&&(n=e.pickPositionWorldCoordinates(t,rt$1));var o=r.getPickRay(t,et),a=i.pick(o,e,at$1);return(e$28(n)?t$X.distance(n,r.positionWC):Number.POSITIVE_INFINITY)<(e$28(a)?t$X.distance(a,r.positionWC):Number.POSITIVE_INFINITY)?n:a}}var t=function(e){if(!e$28(e)||!e$28(e.container))throw new t$Z("options.container is required.");if(!e$28(e.scene))throw new t$Z("options.scene is required.");if(!e$28(e.viewer))throw new t$Z("options.viewer is required.");var t=i$a(e.container);this._viewModel=new y(e,t),m$2(t,this._viewModel),s$V.isPCBroswer()||(document.querySelector(".sm-zoom").style.visibility="visible",document.querySelector(".sm-compass-tiltbar").style.visibility="visible",document.querySelector(".sm-compass-arrows").style.visibility="visible",document.querySelector(".sm-compass-tilt").style.visibility="visible")};function m$2(e,t){var i=['<div class="sm-compass" data-bind="visible: showCompass, event: { mousedown: handleMouseDown , touchstart : handleMouseDown, mouseup: handleMouseUp, touchend: handleMouseUp}">','<div class="sm-compass-tilt"></div>',"<div class=\"sm-compass-tiltbar\" data-bind = \"style : { left : + tiltbarLeft + 'px',top : + tiltbarTop + 'px'}\"></div>",'<div class="sm-compass-arrows"></div>',"<div class=\"sm-compass-outer-ring\" data-bind=\"style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }\"></div>",'<div class="arrows_e_active"></div>','<div class="arrows_n_active"></div>','<div class="arrows_s_active"></div>','<div class="arrows_w_active"></div>',"</div>",'<div class="sm-zoom">','<div class="sm-zoomin" data-bind="event : {mousedown : handleZoomInMouseDown,touchstart : handleZoomInMouseDown}"></div>','<div class="sm-zoomout" data-bind="event : {mousedown : handleZoomOutMouseDown, touchstart : handleZoomOutMouseDown}"></div>','<div class="sm-zoombar" data-bind="event : {mousedown : handleZoomBarScrollMouseDown, touchstart : handleZoomBarScrollMouseDown},style : {top : + zoombarTop + \'px\' }"></div>'," </div>"].join("");f(i,e,t)}function i$3(){this.showInstructions=!1;var e=this;this._command=s$3((function(){e.showInstructions=!e.showInstructions})),this._showClick=s$3((function(){e._touch=!1})),this._showTouch=s$3((function(){e._touch=!0})),this._touch=!1,this.tooltip="Navigation Instructions",ce$1.track(this,["tooltip","showInstructions","_touch"])}function v$2(e){if(!e$28(e)||!e$28(e.container))throw new t$Z("options.container is required.");var t=i$a(e.container),i=new i$3,r=u$Y(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 o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),n.appendChild(o);var a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),n.appendChild(a);var s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var l=document.createElement("img");l.src=n$17("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",s.appendChild(l),s.appendChild(document.createTextNode("Mouse"));var u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var c=document.createElement("img");c.src=n$17("Widgets/Images/NavigationHelp/Touch.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",u.appendChild(c),u.appendChild(document.createTextNode("Touch")),a.appendChild(s),a.appendChild(u);var h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=' <table> <tr> <td><img src="'+n$17("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="'+n$17("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="'+n$17("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>',a.appendChild(h);var d=document.createElement("div");d.className="cesium-touch-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),d.innerHTML=' <table> <tr> <td><img src="'+n$17("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="'+n$17("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="'+n$17("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="'+n$17("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>',a.appendChild(d),ce$1.applyBindings(i,n),this._container=t,this._viewModel=i,this._wrapper=n,this._closeInstructions=function(e){n.contains(e.target)||(i.showInstructions=!1)},s$V.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}function r$4(e){if(!e$28(e)||!e$28(e.scene))throw new t$Z("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=u$Y(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,ce$1.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var t=this;this._dismissMessage=s$3((function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0}));var i=i$c.fromScene(e.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener((function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)})),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener((function(){t.showingLowFrameRateMessage=!1}))}function i$2(e){if(!e$28(e)||!e$28(e.container))throw new t$Z("options.container is required.");if(!e$28(e.scene))throw new t$Z("options.scene is required.");var t=i$a(e.container),i=new r$4(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var n=document.createElement("button");n.setAttribute("type","button"),n.className="cesium-performance-watchdog-message-dismiss",n.innerHTML="×",n.setAttribute("data-bind","click: dismissMessage"),r.appendChild(n);var o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(o),t.appendChild(r),ce$1.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}function o$2(e){if(!e$28(e))throw new t$Z("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof a$X,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,ce$1.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var t=this;ce$1.defineProperty(this,"selectedTooltip",(function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective})),this._toggleDropDown=s$3((function(){t.sceneMode===P$$.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)})),this._eventHelper=new n$R,this._eventHelper.add(e.morphComplete,(function(e,i,r,n){t.sceneMode=r,t._orthographic=r===P$$.SCENE2D||t._scene.camera.frustum instanceof a$X})),this._eventHelper.add(e.preRender,(function(){t._flightInProgress=e$28(e.camera._currentFlight)})),this._switchToPerspective=s$3((function(){t.sceneMode!==P$$.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)})),this._switchToOrthographic=s$3((function(){t.sceneMode!==P$$.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)})),this._sceneMode=P$$}Object.defineProperties(t.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Object.defineProperties(i$3.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),Object.defineProperties(v$2.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),v$2.prototype.isDestroyed=function(){return!1},v$2.prototype.destroy=function(){return s$V.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),ce$1.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i$Z(this)},Object.defineProperties(r$4.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),r$4.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i$Z(this)},Object.defineProperties(i$2.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),i$2.prototype.isDestroyed=function(){return!1},i$2.prototype.destroy=function(){return this._viewModel.destroy(),ce$1.cleanNode(this._element),this._container.removeChild(this._element),i$Z(this)},Object.defineProperties(o$2.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}}}),o$2.prototype.isDestroyed=function(){return!1},o$2.prototype.destroy=function(){this._eventHelper.removeAll(),i$Z(this)};var v$1="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",b$1="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 n$1(e,t){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("scene is required.");e=i$a(e);var i=new o$2(t);i._perspectivePath=v$1,i._orthographicPath=b$1;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-toolbar-button",n.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'),n.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(n);var o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.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(o);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.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(a),ce$1.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},s$V.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function i$1(e,t){if(!e$28(e))throw new t$Z("scene is required.");this._scene=e;var i=this;this._eventHelper=new n$R,this._eventHelper.add(e.morphStart,(function(e,t,r,n){i.sceneMode=r,i.dropDownVisible=!1})),this._duration=u$Y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",ce$1.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,ce$1.defineProperty(this,"selectedTooltip",(function(){var e=i.sceneMode;return e===P$$.SCENE2D?i.tooltip2D:e===P$$.SCENE3D?i.tooltip3D:i.tooltipColumbusView})),this._toggleDropDown=s$3((function(){i.dropDownVisible=!i.dropDownVisible})),this._morphTo2D=s$3((function(){e.morphTo2D(i._duration)})),this._morphTo3D=s$3((function(){e.morphTo3D(i._duration)})),this._morphToColumbusView=s$3((function(){e.morphToColumbusView(i._duration)})),this._sceneMode=P$$}Object.defineProperties(n$1.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),n$1.prototype.isDestroyed=function(){return!1},n$1.prototype.destroy=function(){return this._viewModel.destroy(),s$V.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ce$1.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i$Z(this)},Object.defineProperties(i$1.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new t$Z("duration value must be positive.");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}}}),i$1.prototype.isDestroyed=function(){return!1},i$1.prototype.destroy=function(){this._eventHelper.removeAll(),i$Z(this)};var D="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",P="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",_$1="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 r$3(e,t,i){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("scene is required.");e=i$a(e);var r=new i$1(t,i);r._globePath=D,r._flatMapPath=P,r._columbusViewPath=_$1;var n=document.createElement("span");n.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(n);var o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.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'),o.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(o);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.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(a);var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.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(s);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.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(l),ce$1.applyBindings(r,n),this._viewModel=r,this._container=e,this._wrapper=n,this._closeDropDown=function(e){n.contains(e.target)||(r.dropDownVisible=!1)},s$V.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(r$3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),r$3.prototype.isDestroyed=function(){return!1},r$3.prototype.destroy=function(){return this._viewModel.destroy(),s$V.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ce$1.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i$Z(this)};var m$1=new o$1k,s$1="-1000px";function n(e,t,i){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("selectionIndicatorElement is required.");if(!e$28(i))throw new t$Z("container is required.");this._scene=e,this._screenPositionX=s$1,this._screenPositionY=s$1,this._tweens=e.tweens,this._container=u$Y(i,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,ce$1.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,ce$1.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&e$28(this.position)}}),ce$1.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return m$W.wgs84ToWindowCoordinates(e,t,i)}}function r$2(e,t){if(!e$28(e))throw new t$Z("container is required.");e=i$a(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",o=document.createElementNS(r,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");var a=document.createElementNS(r,"g");a.setAttribute("transform","translate(80,80)"),o.appendChild(a);var s=document.createElementNS(r,"path");s.setAttribute("data-bind","attr: { transform: _transform }"),s.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"),a.appendChild(s),i.appendChild(o);var l=new n(t,this._element,this._container);this._viewModel=l,ce$1.applyBindings(this._viewModel,this._element)}n.prototype.update=function(){if(this.showSelection&&e$28(this.position)){var e=this.computeScreenSpacePosition(this.position,m$1);if(e$28(e)){var t=this._container,i=t.parentNode.clientWidth,r=t.parentNode.clientHeight,n=this._selectionIndicatorElement.clientWidth,o=.5*n;e.x=Math.min(Math.max(e.x,-n),i+n)-o,e.y=Math.min(Math.max(e.y,-n),r+n)-o,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=s$1,this._screenPositionY=s$1}},n.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:m$S.EXPONENTIAL_OUT})},n.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:m$S.EXPONENTIAL_OUT})},Object.defineProperties(n.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(r$2.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),r$2.prototype.isDestroyed=function(){return!1},r$2.prototype.destroy=function(){var e=this._container;return ce$1.cleanNode(this._element),e.removeChild(this._element),i$Z(this)};var C$1={UNLOAD:0,LOADING:1,LOADED:2,LOST:3},Be=new i$W("S3MTilesParser",1e4);function x$1(e,t,i,r,n){this._context=t,this._state=C$1.UNLOAD,this._url=i,this._viewer=e,this._gl=t._gl,this._renderEntities=[],this._visible=!1,this._scale=u$Y(n,1),this._position=t$X.clone(r),this._modelMatrix=m$1b.eastNorthUpToFixedFrame(r,void 0,new y$15),null!==t.s3tc?this._supportCompressType=1:null!==t.pvrtc?this._supportCompressType=2:null!==t.etc1&&(this._supportCompressType=3)}function Ue(e){let t=t$X.distance(e._position,e._viewer.camera.position),i=e._viewer.camera.frustum.near,r=e._viewer.scene._view.viewport.height,n=e._viewer.camera.frustum.fov;return 25/r*Math.tan(n/2)*i*2/(i/(i+t))}function d$2(e,t,i){if(e$28(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(e$28(i)){if(a.localName===t&&-1!==i.indexOf(a.namespaceURI))return a}else if(a.localName===t)return a}}function pe(e,t,i){if(e$28(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];e$28(i)?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}}function Fe(e,t,i){if(!e$28(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];e$28(i)?s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s):s.localName===t&&r.push(s)}return r}function l$2(e,t,i){var r=d$2(e,t,i);if(e$28(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function R(e,t,i){var r=d$2(e,t,i);if(e$28(r))return r.textContent.trim()}function Ve$1(e,t,i){var r=d$2(e,t,i);if(e$28(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}Object.defineProperties(x$1.prototype,{visible:{set:function(e){this._visible=e},get:function(){return this._visible}},position:{get:function(){return this._position}},scale:{get:function(){return this._scale}}}),x$1.prototype.setModelMatrix=function(e,t){this._position=t$X.clone(t);var i=Ue(this),r=m$1b.eastNorthUpToFixedFrame(t,void 0,new y$15);y$15.multiplyByUniformScale(r,i,this._modelMatrix);for(var n=this._renderEntities,o=0,a=n.length;o<a;o++){var s=n[o],l=s._oriCenter,u=s._colorCommand;e$28(u)&&y$15.multiplyByPoint(this._modelMatrix,l,u.boundingVolume.center)}},x$1.prototype.load=function(){var e=this,t=this._state;if(C$1.UNLOAD==t){var i=o$U(this._url,(function(e){return o$$(e)}));e$28(i)&&(this._state=C$1.LOADING,i.then((function(t){Me$1(e,t)}),(function(e){this._state=C$1.UNLOAD})))}},x$1.prototype.update=function(e){if(this._visible){if(!this._ready)return void this.load();e.context;var t=this._renderEntities;if(t&&0!=t.length)for(var i=0,r=t.length;i<r;i++){var n=t[i];e$28(n._colorCommand)&&!t$X.equals(n._colorCommand.boundingVolume.center,t$X.ZERO)&&e.commandList.push(n._colorCommand)}}},x$1.prototype.isDestroyed=function(){return!1},x$1.prototype.destroy=function(){for(var e=this._renderEntities,t=0,i=e.length;t<i;t++){e[t].destroy()}return this._renderEntities.length=0,i$Z(this)};var Ge=new s$P;function Me$1(e,t){var i={buffer:t,supportCompressType:e._supportCompressType},r=Be.scheduleTask(i,[t]);e$28(r)?r.then((function(t){if(t.result){e._gl;for(var i=e._context,r=Ge.read(t.xmlDoc).firstChild,n=r.namespaceURI,o=Fe(d$2(r,"Material3Ds",n),"material",n),a={},s=0,l=o.length;s<l;s++){var u=o[s],c=R(u,"name",n),h=new _0x34bd01({});a[c]=h;var d=d$2(u,"Ambient",n),f=l$2(d,"AmbientR",n),p=l$2(d,"AmbientG",n),_=l$2(d,"AmbientB",n),m=l$2(d,"AmbientA",n);h._ambientColor=new e$1S(f,p,_,m);var $=d$2(u,"Diffuse",n);f=l$2($,"DiffuseR",n),p=l$2($,"DiffuseG",n),_=l$2($,"DiffuseB",n),m=l$2($,"DiffuseA",n),h._diffuseColor=new e$1S(f,p,_,m);var g=d$2(u,"Specular",n);f=l$2(g,"SpecularR",n),p=l$2(g,"SpecularG",n),_=l$2(g,"SpecularB",n),m=l$2(g,"SpecularA",n),h._specularColor=new e$1S(f,p,_,m);var v=l$2(u,"Shininess",n);h._shininess=v,d$2(u,"TransparentSorting",n),h._bTransparentSorting=Ve$1(u,"TransparentSorting",n);var y=d$2(u,"texture",n),x=R(y,"name",n),b=d$2(y,"AddressMode",n),w=R(b,"u",n),C=R(b,"v",n);w="TAM_WRAP"===w?q$11.REPEAT:q$11.CLAMP_TO_EDGE,C="TAM_WRAP"===C?q$11.REPEAT:q$11.CLAMP_TO_EDGE;var S=t.texturePackage[x];if(e$28(S)){x=i._id+"_"+x;var E=Se$8.CreateTexture(x,i,S.width,S.height,S.nFormat,S.compressType,S.imageBuffer,!1,w,C);h._textures.push(E)}}var A=pe(d$2(r,"PageLods",n),"Geode",n);for(s=0,l=A.length;s<l;s++){for(var P=A[s],I=R(P,"GeoDeModMatrix",n).split(","),M=0;M<16;M++)I[M]=parseFloat(I[M]);I=y$15.unpack(I,0);for(var O=pe(P,"GeoName",n),D=[],L=0,B=O.length;L<B;L++){var N=O[L].textContent.trim();D.push(N)}for(var F=[],z=new i$19,k=0;k<D.length;k++){var V=ze(H=(X=t.geoPackage[D[k]]).vertexPackage,I);F.push(V)}var U=new t$X;F.length>0&&(i$19.fromBoundingSpheres(F,z),U=t$X.clone(z.center),F.length=0),e.oriRadius=z.radius;for(B=0;B<D.length;B++){var X,H=(X=t.geoPackage[D[B]]).vertexPackage,G=X.arrIndexPackage,W={};for(var Y in G){var q=G[Y];if(e$28(q)){h=a[c=q.materialCode];W[c]=h}}var j=new T({vertexPackage:H,arrIndexPackage:G,version:t.version,mapPass:W,boundingVolume:z,oriCenter:U,owner:e});j.initialize(e._context),e._renderEntities.push(j)}}e._ready=!0,e._state=C$1.LOADED}else e._state=C$1.UNLOAD})):e.state=C$1.UNLOAD}function ze(e,t){for(var i=[],r=new i$19,n=new t$X,o=(new t$X,e.vertexAttributes[0]),a=o.componentsPerAttribute,s=new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4),l=0;l<e.verticesCount;l++)t$X.fromArray(s,a*l,n),i.push(t$X.clone(n));return i$19.fromPoints(i,r),i.length=0,i$19.transform(r,t,r),r}function T(e){var t=(e=e||{}).arrIndexPackage,i=e.vertexPackage,r=e.mapPass;this._arrIndexPackage=t,this._vertexPackage=i,this._owner=e.owner,this._attributeLocations={},this._initialize=!1,this._mapPass=r,this._boundingVolume=e.boundingVolume,this._oriCenter=e.oriCenter}function s(e,t,i){this._color=e,this._height=t,this._base=u$Y(i,0)}function v(e,t,i,r){this.interval=e,this.height=t,this.color=i||new e$1S(.5,.5,.5,1),this.backgroundColor=r||new e$1S(0,0,0,0)}T.prototype.initialize=function(e){this._initialize||(this.createCommand(e),this._initialize=!0)},T.prototype.createVertexData=function(e){for(var t=this._vertexPackage.vertexAttributes,i=0,r=t.length;i<r;i++){var n=t[i];!e$28(n.typedArray)||(n.vertexBuffer=h$W.createVertexBuffer({context:e,typedArray:n.typedArray,usage:A$1c.STATIC_DRAW}),n.typedArray=null,delete n.typedArray)}return this._attributeLocations=this._vertexPackage.attrLocation,t},T.prototype.createCommand=function(e){var t=this.createVertexData(e),i=Le$p.OPAQUE,r=u$R.fromCache({cull:{enabled:!1},depthTest:{enabled:!1},blending:Ee$n.ALPHA_BLEND}),n=this._vertexPackage.verticesCount,o=this._arrIndexPackage[0];if(e$28(o)){var a=ce$v.UNSIGNED_SHORT;(1===o.indexType||n>=e$27.SIXTY_FOUR_KILOBYTES)&&e.elementIndexUint&&(a=ce$v.UNSIGNED_INT);var s=h$W.createIndexBuffer({context:e,typedArray:o.indicesTypedArray,usage:A$1c.STATIC_DRAW,indexDatatype:a}),l=this._mapPass[o.materialCode]||_0x34bd01.Default,u=W$_.TRIANGLES;switch(o.primitiveType){case 1:u=W$_.POINTS;break;case 2:u=W$_.LINES;break;case 4:u=W$_.TRIANGLES}var c=new r$15({primitiveType:u,boundingVolume:this._boundingVolume,pass:i,owner:this,cull:!1,modelMatrix:this._owner._modelMatrix});c.vertexArray=new m$19({context:e,attributes:t,indexBuffer:s});var h=new a$$({sources:["attribute vec4 aPosition;\n attribute vec3 aNormal;\n attribute vec4 aTexCoord0;\n #ifdef VertexColor\n attribute vec4 aColor;\n #endif\n uniform vec4 uAmbientColor;\n uniform vec4 uDiffuseColor;\n uniform vec4 uSpecularColor;\n varying vec2 vTexCoord;\n varying vec4 vColor;\n const float SHIFT_LEFT8 = 256.0;\n const float SHIFT_RIGHT8 = 1.0 / 256.0;\n const vec4 LIGHT_COLOR = vec4(0.8, 0.8, 0.8, 1.0);\n vec4 vertexColor = vec4(1.0);\n #ifdef VertexColor\n vertexColor = aColor;\n #endif\n void main()\n {\n vec4 vertexPos = aPosition;\n vTexCoord = aTexCoord0.xy;\n vertexPos.w = 1.0;\n gl_Position = czm_modelViewProjection * vertexPos;\n vColor = vertexColor;\n vec4 eyePosition = czm_modelView * vertexPos;\n vec3 normal = normalize(aNormal);\n vec3 lightDirection = normalize(czm_sunPositionWC - vec3(eyePosition));\n float nDotL = max(dot(lightDirection, normal), 0.0);\n vec4 diffuse = uDiffuseColor * LIGHT_COLOR * nDotL;\n vec4 ambient = uAmbientColor * LIGHT_COLOR;\n vec4 materialColor = clamp(diffuse + ambient, vec4(0.0), vec4(1.0));\n vColor = vColor * materialColor;\n }"]}),d=new a$$({sources:["#ifdef TEXTURE_ENABLE\n uniform sampler2D uTexture;\n #endif\n varying vec2 vTexCoord;\n varying vec4 vColor;\n void main()\n {\n #ifdef TEXTURE_ENABLE\n vec2 vecTexCoord = vec2(vTexCoord.x,1.0-vTexCoord.y);\n gl_FragColor = texture2D(uTexture, vecTexCoord.xy, 0.0) * vColor;\n #else\n gl_FragColor = vColor;\n #endif\n if(gl_FragColor.a < 0.1)\n {\n discard;\n }\n }"]});e$28(this._attributeLocations.aTexCoord0)&&l._textures.length>0&&d.defines.push("TEXTURE_ENABLE"),e$28(this._attributeLocations.aColor)&&h.defines.push("VertexColor"),c.shaderProgram=S$T.fromCache({context:e,vertexShaderSource:h,fragmentShaderSource:d,attributeLocations:this._attributeLocations}),c.uniformMap={uTexture:function(){return l._textures[0]},uAmbientColor:function(){return l._ambientColor},uDiffuseColor:function(){return l._diffuseColor},uSpecularColor:function(){return l._specularColor}},c.renderState=r,this._colorCommand=c,this._vertexPackage=null,this._arrIndexPackage.length=0}},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){for(var e in this._mapPass)this._mapPass.hasOwnProperty(e)&&this._mapPass[e].destroy();return this._mapPass.length=0,e$28(this._colorCommand)&&(this._colorCommand.vertexArray=this._colorCommand.vertexArray&&!this._colorCommand.vertexArray.isDestroyed()&&this._colorCommand.vertexArray.destroy(),this._colorCommand.shaderProgram=this._colorCommand.shaderProgram&&!this._colorCommand.shaderProgram.isDestroyed()&&this._colorCommand.shaderProgram.destroy(),this._colorCommand=void 0),this._vertexPackage=null,this._arrIndexPackage.length=0,this._attributeLocations=void 0,i$Z(this)},s.prototype.getHeight=function(){return this._height},s.prototype.getBase=function(){return this._base},s.prototype.getStartTime=function(){return this._start},s.prototype.getStopTime=function(){return this._stop},s.prototype.setRange=function(e,t){this._start=e,this._stop=t},s.prototype.render=function(e){var t="";if(this._start&&this._stop&&this._color){var i=a$12.secondsDifference(this._start,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(i)),n=a$12.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(n))-r;r<0&&(o+=r,r=0),r+o>e.timeBarWidth&&(o=e.timeBarWidth-r),o>0&&(t='<span class="cesium-timeline-highlight" style="left: '+r.toString()+"px; width: "+o.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return t},v.prototype.render=function(e,t){var i=this.interval.start,r=this.interval.stop,n=t.startJulian,o=a$12.addSeconds(t.startJulian,t.duration,new a$12);if(a$12.lessThan(i,n)&&a$12.greaterThan(r,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(a$12.lessThanOrEquals(i,o)&&a$12.greaterThanOrEquals(r,n)){var a,s,l;for(a=0;a<t.timeBarWidth;++a){var u=a$12.addSeconds(t.startJulian,a/t.timeBarWidth*t.duration,new a$12);!e$28(s)&&a$12.greaterThanOrEquals(u,i)?s=a:!e$28(l)&&a$12.greaterThanOrEquals(u,r)&&(l=a)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),e$28(s)&&(e$28(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(l-s,1),this.height))}};var Z=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},c$1={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},E$1=[.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],ot=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function u$3(e,t){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("clock is required.");e=i$a(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=_.none,this._touchMode=c$1.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=at(this),this._onMouseUp=rt(this),this._onMouseMove=ht(this),this._onMouseWheel=ct(this),this._onTouchStart=ut(this),this._onTouchMove=lt(this),this._onTouchEnd=dt(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function A(e){return e<10?"0"+e.toString():e.toString()}function at(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function rt(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function ht(e){return function(t){var i;if(e._mouseMode===_.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var n=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(a$12.addSeconds(e._startJulian,n,new a$12),a$12.addSeconds(e._endJulian,n,new a$12))}}else e._mouseMode===_.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function ct(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;i/=Z=Math.max(Math.min(Math.abs(i),Z),1),e.zoomFrom(Math.pow(1.05,-i))}}function ut(e){return function(t){var i,r,n=t.touches.length,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===n?(i=a$12.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=c$1.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===n?"-16px 0":"0 0")):(e._touchMode=c$1.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):2===n?(e._touchMode=c$1.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=c$1.ignore}}function dt(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===c$1.singleTap?(e._touchMode=c$1.scrub,e._onTouchMove(t)):e._touchMode===c$1.scrub&&e._onTouchMove(t),e._mouseMode=_.touchOnly,1!==i?e._touchMode=i>0?c$1.ignore:c$1.none:e._touchMode===c$1.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function lt(e){return function(t){var i,r,n,o,a,s,l=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===c$1.singleTap&&(e._touchMode=c$1.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===c$1.scrub?(t.preventDefault(),1===t.changedTouches.length&&((r=t.changedTouches[0].clientX-u)>=0&&r<=e._topDiv.clientWidth&&e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===c$1.slideZoom&&(2===(n=t.touches.length)?(o=.5*(t.touches[0].clientX+t.touches[1].clientX)-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):1===n&&(o=t.touches[0].clientX-u,a=0),e$28(o)&&(a>0&&e._touchState.spanX>0?(l=e._touchState.spanX/a,s=a$12.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*l)/e._topDiv.clientWidth,new a$12)):(i=e._touchState.centerX-o,s=a$12.addSeconds(e._startJulian,i*e._timeBarSecondsSpan/e._topDiv.clientWidth,new a$12)),e.zoomTo(s,a$12.addSeconds(s,e._timeBarSecondsSpan*l,new a$12)),e._touchState.centerX=o,e._touchState.spanX=a))}}function E(e){var t=!1,i=window.screen;return e$28(i)&&(e$28(i.lockOrientation)?t=i.lockOrientation(e):e$28(i.mozLockOrientation)?t=i.mozLockOrientation(e):e$28(i.msLockOrientation)?t=i.msLockOrientation(e):e$28(i.orientation&&i.orientation.lock)&&(t=i.orientation.lock(e))),t}function u$2(){var e=window.screen;e$28(e)&&(e$28(e.unlockOrientation)?e.unlockOrientation():e$28(e.mozUnlockOrientation)?e.mozUnlockOrientation():e$28(e.msUnlockOrientation)?e.msUnlockOrientation():e$28(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function O$1(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(u$2(),e._locked=!1),e._noSleep.disable(),l$1b.exitFullscreen(),i(!1)):(l$1b.fullscreen||l$1b.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=E("landscape")),t.useWebVR=!0,i(!0)))}function a(e,t){if(!e$28(e))throw new t$Z("scene is required.");var i=this,r=ce$1.observable(l$1b.enabled),n=ce$1.observable(!1);this.isVRMode=void 0,ce$1.defineProperty(this,"isVRMode",{get:function(){return n()}}),this.isVREnabled=void 0,ce$1.defineProperty(this,"isVREnabled",{get:function(){return r()},set:function(e){r(e&&l$1b.enabled)}}),this.tooltip=void 0,ce$1.defineProperty(this,"tooltip",(function(){return r()?n()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}));var o=ce$1.observable(!1);this._isOrthographic=void 0,ce$1.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new n$R,this._eventHelper.add(e.preRender,(function(){o(e.camera.frustum instanceof a$X)})),this._locked=!1,this._noSleep=new b$5,this._command=s$3((function(){O$1(i,e,n,o)}),ce$1.getObservable(this,"isVREnabled")),this._vrElement=u$Y(i$a(t),document.body),this._callback=function(){!l$1b.fullscreen&&n()&&(e.useWebVR=!1,i._locked&&(u$2(),i._locked=!1),i._noSleep.disable(),n(!1))},document.addEventListener(l$1b.changeEventName,this._callback)}u$3.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},u$3.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},u$3.prototype.isDestroyed=function(){return!1},u$3.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i$Z(this)},u$3.prototype.addHighlightRange=function(e,t,i){var r=new s(e,t,i);return this._highlightRanges.push(r),this.resize(),r},u$3.prototype.addTrack=function(e,t,i,r){var n=new v(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},u$3.prototype.zoomTo=function(e,t){if(!e$28(e))throw new t$Z("startTime is required.");if(!e$28(t))throw new t$Z("stopTime is required");if(a$12.lessThanOrEquals(t,e))throw new t$Z("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=a$12.secondsDifference(t,e),this._clock&&this._clock.clockRange!==tt$f.UNBOUNDED){var i=this._clock.startTime,r=this._clock.stopTime,n=a$12.secondsDifference(r,i),o=a$12.secondsDifference(i,this._startJulian),a=a$12.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=n?(this._timeBarSecondsSpan=n,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):o>0?(this._endJulian=a$12.addSeconds(this._endJulian,o,new a$12),this._startJulian=i,this._timeBarSecondsSpan=a$12.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=a$12.addSeconds(this._startJulian,a,new a$12),this._endJulian=r,this._timeBarSecondsSpan=a$12.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var s=document.createEvent("Event");s.initEvent("setzoom",!0,!0),s.startJulian=this._startJulian,s.endJulian=this._endJulian,s.epochJulian=this._epochJulian,s.totalSpan=this._timeBarSecondsSpan,s.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(s)},u$3.prototype.zoomFrom=function(e){var t=a$12.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(a$12.addSeconds(this._startJulian,t-t*e,new a$12),a$12.addSeconds(this._endJulian,i*e-i,new a$12))},u$3.prototype.makeLabel=function(e){var t=a$12.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return ot[t.month-1]+" "+t.day+" "+t.year+" "+A(t.hour)+":"+A(t.minute)+":"+A(t.second)+r},u$3.prototype.smallestTicInPixels=7,u$3.prototype._makeTics=function(){var e,t=this._timeBarEle,i=a$12.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan),n=r-8,o=this;this._needleEle.style.left=r.toString()+"px";var a="",s=.01,l=31536e6,u=1e-10,c=0,h=this._timeBarSecondsSpan;h<s?(h=s,this._timeBarSecondsSpan=s,this._endJulian=a$12.addSeconds(this._startJulian,s,new a$12)):h>l&&(h=l,this._timeBarSecondsSpan=l,this._endJulian=a$12.addSeconds(this._startJulian,l,new a$12));var d=this._timeBarEle.clientWidth;d<10&&(d=10);var f,p=this._startJulian,_=Math.min(h/d*1e-5,.4),m=a$12.toGregorianDate(p);f=h>31536e4?a$12.fromDate(new Date(Date.UTC(100*Math.floor(m.year/100),0))):h>31536e3?a$12.fromDate(new Date(Date.UTC(10*Math.floor(m.year/10),0))):h>86400?a$12.fromDate(new Date(Date.UTC(m.year,0))):a$12.fromDate(new Date(Date.UTC(m.year,m.month,m.day)));var $=a$12.secondsDifference(this._startJulian,a$12.addSeconds(f,_,new a$12)),g=$+h;function v(e){return Math.floor($/e)*e}function y(e,t){return Math.ceil(e/t+.5)*t}function x(e){return(e-$)/h}function b(e,t){return e-t*Math.round(e/t)}this._epochJulian=f,this._rulerEle.innerHTML=this.makeLabel(a$12.addSeconds(this._endJulian,-s,new a$12));var w=this._rulerEle.offsetWidth+20;w<30&&(w=180);var C=c;c-=u;var T={startTime:$,startJulian:p,epochJulian:f,duration:h,timeBarWidth:d,getAlpha:x};this._highlightRanges.forEach((function(e){a+=e.render(T)}));var S=0,E=0,A=0,P=w/d;P>1&&(P=1),P*=this._timeBarSecondsSpan;var I,M=-1,O=-1,D=E$1.length;for(I=0;I<D;++I){var R=E$1[I];if(++M,S=R,R>P&&R>c)break;O<0&&d*(R/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=M)}if(M>0){for(;M>0;)if(--M,Math.abs(b(S,E$1[M]))<1e-5){E$1[M]>=c&&(E=E$1[M]);break}if(O>=0)for(;O<M;){if(Math.abs(b(E,E$1[O]))<1e-5&&E$1[O]>=c){A=E$1[O];break}++O}}(c=C)>u&&A<1e-5&&Math.abs(c-S)>u&&(A=c,c<=S+u&&(E=0));var L,B=-999999;if(d*(A/this._timeBarSecondsSpan)>=3)for(e=v(A);e<=g;e=y(e,A))a+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(d*x(e)).toString()+'px;"></span>';if(d*(E/this._timeBarSecondsSpan)>=3)for(e=v(E);e<=g;e=y(e,E))a+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(d*x(e)).toString()+'px;"></span>';if(d*(S/this._timeBarSecondsSpan)>=2){this._mainTicSpan=S,g+=S,e=v(S);for(var N=a$12.computeTaiMinusUtc(f);e<=g;){var F=a$12.addSeconds(p,e-$,new a$12);if(S>2.1){var z=a$12.computeTaiMinusUtc(F);Math.abs(z-N)>.1&&(e+=z-N,F=a$12.addSeconds(p,e-$,new a$12))}var k=Math.round(d*x(e)),V=this.makeLabel(F);this._rulerEle.innerHTML=V,(L=this._rulerEle.offsetWidth)<10&&(L=w);var U=k-(L/2-1);U>B?(B=U+L+5,a+='<span class="cesium-timeline-ticMain" style="left: '+k.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+U.toString()+'px;">'+V+"</span>"):a+='<span class="cesium-timeline-ticSub" style="left: '+k.toString()+'px;"></span>',e=y(e,S)}}else this._mainTicSpan=-1;a+='<span class="cesium-timeline-icon16" style="left:'+n+'px;bottom:0;background-position: 0 0;"></span>',t.innerHTML=a,this._scrubElement=t.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),T.y=0,this._trackList.forEach((function(e){e.render(o._context,T),T.y+=e.height}))},u$3.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(e$28(this._scrubElement)){var t=a$12.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}e$28(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(a$12.addSeconds(this._startJulian,this._timelineDrag,new a$12),a$12.addSeconds(this._endJulian,this._timelineDrag,new a$12)))},u$3.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=a$12.addSeconds(this._startJulian,t,new a$12),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},u$3.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach((function(e){i+=e.height})),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},Object.defineProperties(a.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new t$Z("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}}),a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(l$1b.changeEventName,this._callback),i$Z(this)};var h$1="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u$1="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 o$1(e,t,i){if(!e$28(e))throw new t$Z("container is required.");if(!e$28(t))throw new t$Z("scene is required.");e=i$a(e);var r=new a(t,i);r._exitVRPath=u$1,r._enterVRPath=h$1;var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-vrButton",n.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(n),ce$1.applyBindings(r,n),this._container=e,this._viewModel=r,this._element=n}Object.defineProperties(o$1.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),o$1.prototype.isDestroyed=function(){return!1},o$1.prototype.destroy=function(){return this._viewModel.destroy(),ce$1.cleanNode(this._element),this._container.removeChild(this._element),i$Z(this)},new o$1k;var l$1="-1000px";function r$1(e,t,i){if(!e$28(e))throw new t$Z("scene is required.");if(!e$28(t))throw new t$Z("zoomIndicatorElement is required.");if(!e$28(i))throw new t$Z("container is required.");this._scene=e,this._screenPositionX=l$1,this._screenPositionY=l$1,this._tweens=e.tweens,this._container=u$Y(i,document.body),this._zoomIndicatorElement=t,this._scale=1,this._opacity=1,this.position=void 0,this.showSelection=!1,ce$1.track(this,["position","_screenPositionX","_screenPositionY","_opacity","showSelection"]),this.isVisible=void 0,ce$1.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&e$28(this.position)}}),ce$1.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return m$W.wgs84ToWindowCoordinates(e,t,i)}}function o(e,t){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e),this._container=e;var i=document.createElement("div");i.className="cesium-zoom-wrapper",i.setAttribute("data-bind",' style: { "top" : _screenPositionY, "left" : _screenPositionX,"opacity" : _opacity }, css: { "cesium-zoom-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r=document.createElement("img");r.src=n$17("Widgets/Images/ZoomIndicator/zoom_Identifiers.png"),r.style.width="48px",r.style.height="48px",i.appendChild(r);var n=new r$1(t,this._element,this._container);this._viewModel=n,ce$1.applyBindings(this._viewModel,this._element)}r$1.prototype.update=function(){var e=this.scene._screenSpaceCameraController;if(e.zoomActive){e.zoomActive=!1;var t=this._container,i=t.parentNode.clientWidth,r=t.parentNode.clientHeight,n=o$1k.clone(e._zoomMouseStart);n.x=Math.min(Math.max(n.x,-48),i+48)-24,n.y=Math.min(Math.max(n.y,-48),r+48)-24,this._screenPositionX=Math.floor(n.x+.25)+"px",this._screenPositionY=Math.floor(n.y+.25)+"px",this._opacity=1,this.showSelection=!0,this.animateDepart()}},r$1.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:m$S.EXPONENTIAL_OUT})},r$1.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_opacity",startValue:this._opacity,stopValue:0,duration:1,easingFunction:m$S.EXPONENTIAL_OUT})},Object.defineProperties(r$1.prototype,{container:{get:function(){return this._container}},zoomIndicatorElement:{get:function(){return this._zoomIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(o.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._container;return ce$1.cleanNode(this._element),e.removeChild(this._element),i$Z(this)};var C=new i$19;function Ie(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function De(e,t){if(e$28(e.scene._frameState)&&e$28(e.scene._frameState.pickIDColor)&&(e.scene._frameState.pickIDColor=new e$1S(1,1,1,1)),e$28(e._activeBillboard)){if(e$28(e._activeBillboard.billboard._billboardsBySymbol))for(var i=e._activeBillboard.billboard._billboardsBySymbol.length,r=0;r<i;r++)e._activeBillboard.billboard._billboardsBySymbol[r].color=e._activeBillboard.originalColor;e._activeBillboard=void 0}var n=e.scene.pick(t.position);if(e$28(n)){var o=u$Y(n.id,n.primitive.id);if(o instanceof h$F)return o.pickHeight=n.height,o;if(e$28(n.primitive)){if(e.scene.layers._layerQueue.length>0&&wt(e,t.position),e$28(n.collection)&&n.collection._isMVT){if(e$28(n.primitive)&&n.primitive instanceof n$X&&e$28(n.primitive._billboardsBySymbol))for(var a=0;a<n.primitive._billboardsBySymbol.length;a++)e._activeBillboard={billboard:n.primitive,originalColor:e$1S.clone(n.primitive._billboardsBySymbol[a].color)},n.primitive._billboardsBySymbol[a].color=e$1S.CYAN;return{pickResult:{featureID:n.primitive._id,layerID:n.primitive._mvtLayerID,mapName:n.primitive._mapName,position:n.primitive._position,primitive:n.primitive,properties:n.primitive._mvtProperties}}}for(r=e.scene._vectorTileSource.values.length-1;r>=0;r--){var s=e.scene._vectorTileSource.values[r];s._MVTStyle.cancelHighLight(s)}return n}}if(e$28(e.scene.globe))return Pt(e,t.position)}function Te(e,t,i){if(e$28(i)){var r=i.clock;e$28(r)&&(r.getValue(t),e$28(e)&&(e.updateFromClock(),e.zoomTo(r.startTime,r.stopTime)))}}var Me=new t$X;function Ct(e,t){var i,r=null,n=e._frameState;if(!e$28(i)){var o=e.pickPosition(t);if(!e$28(o))return null;i=t$W.fromCartesian(o)}for(var a=e._vectorTileSource.values.length-1;a>=0;a--){var s=e._vectorTileSource.values[a];if((!e$28(s._selectEnabled)||s._selectEnabled)&&e$28(r=s.pick(i,n)))return r.mapName=s._owner._name,new h$F({id:r.featureID,layerID:r.layerID,pickResult:r})}return null}function Pt(e,t){var i=e.scene,r=Ct(i,t);if(null!=r)return r;var n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(e$28(o)){var a=new h$F({id:"Loading...",description:"Loading feature information..."});return o$1q(o,(function(t){if(e.selectedEntity===a){if(!e$28(t)||0===t.length)return void(e.selectedEntity=Le());var i=t[0],r=new h$F({id:i.name,description:i.description});if(e$28(i.position)){var n=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,Me);r.position=new r$G(n)}e.selectedEntity=r}}),(function(){e.selectedEntity===a&&(e.selectedEntity=Le())})),a}}function wt(e,t){var i=e.scene,r=i.layers.pickFeatures(t,i);if(!e$28(r))return!1;var n=new h$F({id:"Loading...",description:"Loading feature information..."});o$1q(r,(function(i){if(e$28(i)){var r=i.fieldNames,n=i.fieldValues;if(e$28(r)&&e$28(n)){for(var o={},a=0,s=r.length;a<s;a++)o[r[a]]=n[a];var l=new h$F({feature:o});if(l.scenePos=e.scene.pickPosition(t),e$28(o.position)){var u=e.scene.globe.ellipsoid.cartographicToCartesian(o.position,Me);l.position=new r$G(u)}e$28(i.geometry)&&(o.geometry=i.geometry),e.selectedEntity=l,e.pickEvent.raiseEvent(o)}else e.selectedEntity=void 0}else e.selectedEntity=void 0}),(function(){e.selectedEntity===n&&(e.selectedEntity=void 0)}))}function Le(){return new h$F({id:"None",description:"No features found."})}function Bt(e,t){var i=e._geocoder,r=e._homeButton,n=e._sceneModePicker,o=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(e$28(i)&&(i.container.style.visibility=d),e$28(r)&&(r.container.style.visibility=d),e$28(n)&&(n.container.style.visibility=d),e$28(o)&&(o.container.style.visibility=d),e$28(a)&&(a.container.style.visibility=d),e$28(s)&&(s.container.style.visibility=d),e$28(l)&&(l.container.style.visibility=d),e$28(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),e$28(c)&&(c.container.style.visibility=d),e$28(h)&&(h.container.style.visibility=d),e._container){var f=t||!e$28(u)?0:u.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function u(e,i){if(!e$28(e))throw new t$Z("container is required.");e=i$a(e);var r=(!e$28((i=u$Y(i,u$Y.EMPTY_OBJECT)).globe)||!1!==i.globe)&&e$28(i.baseLayerPicker)&&!1!==i.baseLayerPicker;if(!r&&e$28(i.selectedImageryProviderViewModel))throw new t$Z("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");if(!r&&e$28(i.selectedTerrainProviderViewModel))throw new t$Z("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");var n=this,a=document.createElement("div");a.className="cesium-viewer",e.appendChild(a);var s=document.createElement("div");s.className="cesium-viewer-cesiumWidgetContainer",a.appendChild(s);var l=document.createElement("div");l.className="cesium-viewer-bottom",a.appendChild(l);var c,h,d=u$Y(i.scene3DOnly,!1),f=!1;if(e$28(i.clockViewModel))c=(h=i.clockViewModel).clock;else{var p=new Date;p.setHours(10),h=new r$b(c=new u$M({currentTime:a$12.fromDate(p)})),f=!0}c.shouldAnimate=u$Y(i.shouldAnimate,!1);var _=new f$2(s,{terrainProvider:i.terrainProvider,imageryProvider:!r&&!e$28(i.imageryProvider)&&void 0,gridProvider:i.gridProvider,clock:c,skyBox:i.skyBox,skyAtmosphere:i.skyAtmosphere,sceneMode:i.sceneMode,mapProjection:i.mapProjection,globe:i.globe,orderIndependentTranslucency:i.orderIndependentTranslucency,contextOptions:i.contextOptions,useDefaultRenderLoop:i.useDefaultRenderLoop,targetFrameRate:i.targetFrameRate,showRenderLoopErrors:i.showRenderLoopErrors,useBrowserRecommendedResolution:i.useBrowserRecommendedResolution,creditContainer:e$28(i.creditContainer)?i.creditContainer:l,creditViewport:i.creditViewport,scene3DOnly:d,terrainExaggeration:i.terrainExaggeration,shadows:i.shadows,terrainShadows:i.terrainShadows,mapMode2D:i.mapMode2D,requestRenderMode:i.requestRenderMode,maximumRenderTimeChange:i.maximumRenderTimeChange,cloudBox:i.cloudBox}),m=i.dataSources,$=!1;e$28(m)||(m=new i$s,$=!0);var g,v,y=_.scene,x=new u$n({scene:y,dataSourceCollection:m}),b=new n$R;if(b.add(c.onTick,u.prototype._onTick,this),b.add(y.morphStart,u.prototype._clearTrackedObject,this),!e$28(i.selectionIndicator)||!1!==i.selectionIndicator){var w=document.createElement("div");w.className="cesium-viewer-selectionIndicatorContainer",a.appendChild(w),g=new r$2(w,y)}if(!e$28(i.infoBox)||!1!==i.infoBox){var C=document.createElement("div");C.className="cesium-viewer-infoBoxContainer",a.appendChild(C);var T=(v=new l$3(C)).viewModel;b.add(T.cameraClicked,u.prototype._onInfoBoxCameraClicked,this),b.add(T.closeClicked,u.prototype._onInfoBoxClockClicked,this)}var S,E,A,P,I,M,O,D,R,L,B,N,F,z,k,V,U=document.createElement("div");if(U.className="cesium-viewer-toolbar",a.appendChild(U),e$28(i.geocoder)&&!1!==i.geocoder){var X,H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",U.appendChild(H),e$28(i.geocoder)&&"boolean"!=typeof i.geocoder&&(X=Array.isArray(i.geocoder)?i.geocoder:[i.geocoder]),S=new s$2({container:H,geocoderServices:X,scene:y,viewer:this}),b.add(S.viewModel.search.beforeExecute,u.prototype._clearObjects,this)}if(e$28(i.homeButton)&&!1!==i.homeButton&&(E=new o$4(U,y),e$28(S)&&b.add(E.viewModel.command.afterExecute,(function(){var e=S.viewModel;e.searchText="",e.isSearchInProgress&&e.search()})),b.add(E.viewModel.command.beforeExecute,u.prototype._clearTrackedObject,this)),!0===i.sceneModePicker&&d)throw new t$Z("options.sceneModePicker is not available when options.scene3DOnly is set to true.");if(!d&&e$28(i.sceneModePicker)&&!1!==i.sceneModePicker&&(A=new r$3(U,y)),i.projectionPicker&&(P=new n$1(U,y)),r){var G=u$Y(i.imageryProviderViewModels,p$1()),W=u$Y(i.terrainProviderViewModels,n$3());I=new g$2(U,{globe:y.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:i.selectedImageryProviderViewModel,terrainProviderViewModels:W,selectedTerrainProviderViewModel:i.selectedTerrainProviderViewModel}),M=U.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(e$28(i.imageryProvider)&&!1!==i.imageryProvider&&(r&&(I.viewModel.selectedImagery=void 0),y.imageryLayers.removeAll(),y.imageryLayers.addImageryProvider(i.imageryProvider)),e$28(i.terrainProvider)&&(r&&(I.viewModel.selectedTerrain=void 0),y.terrainProvider=i.terrainProvider),e$28(i.navigationHelpButton)&&!1!==i.navigationHelpButton){var Y=!0;try{if(e$28(window.localStorage)){var q=window.localStorage.getItem("cesium-hasSeenNavHelp");e$28(q)&&Boolean(q)?Y=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}O=new v$2({container:U,instructionsInitiallyVisible:u$Y(i.navigationInstructionsInitiallyVisible,Y)})}if(e$28(i.animation)&&!1!==i.animation){var j=document.createElement("div");j.className="cesium-viewer-animationContainer",a.appendChild(j),D=new y$4(j,new m$4(h))}if(e$28(i.timeline)&&!1!==i.timeline){var Z=document.createElement("div");Z.className="cesium-viewer-timelineContainer",a.appendChild(Z),(R=new u$3(Z,c)).addEventListener("settime",Ie,!1),R.zoomTo(c.startTime,c.stopTime)}if(e$28(i.fullscreenButton)&&!1!==i.fullscreenButton&&((N=document.createElement("div")).className="cesium-viewer-fullscreenContainer",a.appendChild(N),B=c$2((L=new r$7(N,i.fullscreenElement)).viewModel,"isFullscreenEnabled",(function(e){N.style.display=e?"block":"none",e$28(R)&&(R.container.style.right=N.clientWidth+"px",R.resize())}))),i.vrButton){var K=document.createElement("div");K.className="cesium-viewer-vrContainer",a.appendChild(K),z=c$2((F=new o$1(K,y,i.fullScreenElement)).viewModel,"isVREnabled",(function(e){K.style.display=e?"block":"none",e$28(L)&&(K.style.right=N.clientWidth+"px"),e$28(R)&&(R.container.style.right=K.clientWidth+"px",R.resize())})),k=c$2(F.viewModel,"isVRMode",(function(e){Bt(n,e)}))}if(e$28(i.navigation)&&!1!==i.navigation){var Q=document.createElement("div");Q.className="cesium-viewer-navigationContainer",a.appendChild(Q),V=new t({container:Q,scene:y,viewer:this})}this._scratchHoldUrl="url("+n$17("Widgets/Images/cur/Hold.cur")+"), auto",this._scratchPanUrl="url("+n$17("Widgets/Images/cur/Pan.cur")+"), auto",this._activeBillboard=void 0,this._baseLayerPickerDropDown=M,this._fullscreenSubscription=B,this._vrSubscription=z,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=u$Y(i.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=l,this._element=a,this._cesiumWidget=_,this._selectionIndicator=g,this._infoBox=v,this._dataSourceCollection=m,this._destroyDataSourceCollection=$,this._dataSourceDisplay=x,this._clockViewModel=h,this._destroyClockViewModel=f,this._toolbar=U,this._homeButton=E,this._sceneModePicker=A,this._projectionPicker=P,this._baseLayerPicker=I,this._navigationHelpButton=O,this._animation=D,this._timeline=R,this._fullscreenButton=L,this._vrButton=F,this._geocoder=S,this._navigation=V,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=e$28(v)||e$28(g),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new o$1o,this._trackedEntityChanged=new o$1o,this._capturePointSize=16,this._capturePointColor=e$1S.fromCssColorString("#0173c7"),ce$1.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),b.add(m.dataSourceAdded,u.prototype._onDataSourceAdded,this),b.add(m.dataSourceRemoved,u.prototype._onDataSourceRemoved,this),b.add(y.postUpdate,u.prototype.resize,this),b.add(y.postRender,u.prototype._postRender,this);for(var J=m.length,ee=0;ee<J;ee++)this._dataSourceAdded(m,m.get(ee));this._dataSourceAdded(void 0,x.defaultDataSource),b.add(m.dataSourceAdded,u.prototype._dataSourceAdded,this),b.add(m.dataSourceRemoved,u.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction((function(e){n.selectedEntity=De(n,e)}),J$P.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction((function(e){var t=De(n,e);e$28(t)?r$K.getValueOrUndefined(t.position,n.clock.currentTime)?n.trackedEntity=t:n.zoomTo(t):e$28(n.trackedEntity)&&(n.trackedEntity=void 0)}),J$P.LEFT_DOUBLE_CLICK),this.pickEvent=new o$1o;var te=document.createElement("div");te.className="cesium-viewer-zoomIndicatorContainer",a.appendChild(te),this._zoomIndicator=new o(te,_.scene);var ie=this._zoomIndicator._viewModel;ie._screenPositionX="100px",ie._screenPositionY="100px",ie.position="absolute",ie.showSelection=!1}Object.defineProperties(u.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}},navigation:{get:function(){return this._navigation}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainLayers:{get:function(){return this.scene.terrainLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e;var t=this;e.readyPromise.otherwise((function(){t.scene.terrainProvider=t.scene.globe._defaultTerrainProvider}))}},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,this._forceResize=!0}},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){if(this._trackedEntity!==e){this._trackedEntity=e,de(this);var t=this.scene,i=t.mode;e$28(e)&&e$28(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,(i===P$$.COLUMBUS_VIEW||i===P$$.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(i===P$$.COLUMBUS_VIEW||i===P$$.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(y$15.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=e$28(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;e$28(e)?e$28(t)&&t.animateAppear():e$28(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,Te(this._timeline,this.clock,e))}}}),u.prototype.extend=function(e,t){if(!e$28(e))throw new t$Z("mixin is required.");e(this,t)},u.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,r=t.clientHeight,n=e$28(this._animation),o=e$28(this._timeline);if(this._forceResize||i!==this._lastWidth||r!==this._lastHeight){e.resize(),this._forceResize=!1;var a=r-125,s=this._baseLayerPickerDropDown;e$28(s)&&(s.style.maxHeight=a+"px"),e$28(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);var l,u=this._timeline,c=0,h=0,d=0;if(n&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var f=this._lastWidth;l=this._animation.container,i>900?(c=169,f<=900&&(l.style.width="169px",l.style.height="112px",this._animation.resize())):i>=600?(c=136,(f<600||f>900)&&(l.style.width="136px",l.style.height="90px",this._animation.resize())):(c=106,(f>600||0===f)&&(l.style.width="106px",l.style.height="70px",this._animation.resize())),h=c+5}if(o&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var p=this._fullscreenButton,_=this._vrButton,m=u.container,$=m.style;d=m.clientHeight+3,$.left=c+"px";var g=0;e$28(p)&&(g+=p.container.clientWidth),e$28(_)&&(g+=_.container.clientWidth),$.right=g+"px",u.resize()}this._bottomContainer.style.left=h+"px",this._bottomContainer.style.bottom=d+"px",this._lastWidth=i,this._lastHeight=r}},u.prototype.forceResize=function(){this._lastWidth=0,this.resize()},u.prototype.render=function(){this._cesiumWidget.render()},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(J$P.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(J$P.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),e$28(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),e$28(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),e$28(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),e$28(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),e$28(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),e$28(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),e$28(this._timeline)&&(this._timeline.removeEventListener("settime",Ie,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),e$28(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),e$28(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),e$28(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),e$28(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.isDestroyed()&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),i$Z(this)},u.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(u.prototype._onEntityCollectionChanged,this)},u.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(u.prototype._onEntityCollectionChanged,this),e$28(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),e$28(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};var ee=!1,F,xe=0;function Ve(e,t,i,r){if(!e$28(t))throw new t$Z("zoomTarget is required.");de(e);var n=o$1q.defer();return e._zoomPromise=n,e._zoomIsFlight=r,e._zoomOptions=i,o$1q(t,(function(t){if(e._zoomPromise===n){if(t instanceof h$p)return void t.getViewableRectangle().then((function(t){return a$h(t,e.scene)})).then((function(t){e._zoomPromise===n&&(e._zoomTarget=t)}));if(t instanceof p$A)return void(e._zoomTarget=t);if(t instanceof g$6)return void(e._zoomTarget=t);if(t.isLoading&&e$28(t.loadingEvent)){var i=t.loadingEvent.addEventListener((function(){i(),e._zoomPromise===n&&(e._zoomTarget=t.entities.values.slice(0))}));return}if(Array.isArray(t))return void(e._zoomTarget=t.slice(0));if(t instanceof _0x47d916)return void(e._zoomTarget=t.layerBounds);if(t instanceof p$c)return void t.getViewableRectangle().then((function(t){return a$h(t,e.scene)})).then((function(t){e._zoomPromise===n&&(e._zoomTarget=t)}));e$28((t=u$Y(t.values,t)).entities)&&(t=t.entities.values),Array.isArray(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}})),e.scene.requestRender(),n.promise}function x(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function de(e){var t=e._zoomPromise;e$28(t)&&(x(e),t.resolve(!1))}function It(e){var t=e._zoomTarget;if(e$28(t)&&e.scene.mode!==P$$.MORPHING){var i=e.scene,r=i.camera,n=e._zoomPromise,o=u$Y(e._zoomOptions,{});if(t instanceof p$A)return t.readyPromise.then((function(){var i=t.boundingSphere;e$28(o.offset)||(o.offset=new a$S(0,-.5,i.radius)),s={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?r.flyToBoundingSphere(t.boundingSphere,s):(r.viewBoundingSphere(i,o.offset),r.lookAtTransform(y$15.IDENTITY),n.resolve(!0)),x(e)}));if(t instanceof g$6)return t.readyPromise.then((function(){var i=t.boundingSphere;e$28(o.offset)||(o.offset=new a$S(0,-.5,i.radius)),s={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?r.flyToBoundingSphere(i,s):(r.viewBoundingSphere(i,o.offset),r.lookAtTransform(y$15.IDENTITY),n.resolve(!0)),x(e)}));if(t instanceof t$W)return s={destination:i.mapProjection.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}},e._zoomIsFlight?r.flyTo(s):(r.setView(s),n.resolve(!0)),void x(e);var a=t;if(a instanceof h$10){var s={offset:o.offset,destination:a,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)}};if(e._zoomIsFlight){var l=i$19.fromRectangle3D(t);r.flyToBoundingSphere(l,s)}else r.setView(s),n.resolve(!0);return void x(e)}for(var u=[],c=0,h=a.length;c<h;c++){var d=e._dataSourceDisplay.getBoundingSphere(a[c],!1,C);if(d===A$U.PENDING)return;d!==A$U.FAILED&&u.push(i$19.clone(C))}if(0===u.length)return void de(e);e.trackedEntity=void 0,l=i$19.fromBoundingSpheres(u),e._zoomIsFlight?(x(e),r.flyToBoundingSphere(l,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){n.resolve(!0)},cancel:function(){n.resolve(!1)},offset:o.offset})):(r.viewBoundingSphere(l,o.offset),r.lookAtTransform(y$15.IDENTITY),x(e),n.resolve(!0))}}function Dt(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime;if(e$28(r$K.getValueOrUndefined(t.position,i))){var r=e.scene,n=e._dataSourceDisplay.getBoundingSphere(t,!1,C);if(n!==A$U.PENDING){var o=r.mode;(o===P$$.COLUMBUS_VIEW||o===P$$.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(o===P$$.COLUMBUS_VIEW||o===P$$.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);var a=n!==A$U.FAILED?C:void 0;e._entityView=new V$m(t,r,r.mapProjection.ellipsoid),e._entityView.update(i,a),e._needTrackedEntityUpdate=!1}}}}function r(e){o$1u.typeOf.object("viewer",e);var t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);var i=new y$1(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return i}}})}function c(e){if(!e$28(e))throw new t$Z("viewer is required.");var t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);var i=new g(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}function $(e,t){if(!e$28(e))throw new t$Z("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new t$Z("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new t$Z("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new t$Z("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new t$Z("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new t$Z("flyToOnDrop is already defined by another mixin.");t=u$Y(t,u$Y.EMPTY_OBJECT);var i=!0,r=u$Y(t.flyToOnDrop,!0),n=new o$1o,o=u$Y(t.clearOnDrop,!0),a=u$Y(t.dropTarget,e.container),s=u$Y(t.clampToGround,!0),l=t.proxy;function u(t){d$1(t),o&&(e.entities.removeAll(),e.dataSources.removeAll());for(var i=t.dataTransfer.files,r=i.length,n=0;n<r;n++){var a=i[n],u=new FileReader;u.onload=j(e,a,l,s),u.onerror=k(e,a),u.readAsText(a)}}a=i$a(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(e){if(!e$28(e))throw new t$Z("value is required.");O(a,u),h(a=e,u)}},dropEnabled:{get:function(){return i},set:function(e){e!==i&&(e?h(a,u):O(a,u),i=e)}},dropError:{get:function(){return n}},clearOnDrop:{get:function(){return o},set:function(e){o=e}},flyToOnDrop:{get:function(){return r},set:function(e){r=e}},proxy:{get:function(){return l},set:function(e){l=e}},clampToGround:{get:function(){return s},set:function(e){s=e}}}),h(a,u),e.destroy=e$1e(e,e.destroy,(function(){e.dropEnabled=!1})),e._handleDrop=u}function d$1(e){e.stopPropagation(),e.preventDefault()}function O(e,t){var i=e;e$28(i)&&(i.removeEventListener("drop",t,!1),i.removeEventListener("dragenter",d$1,!1),i.removeEventListener("dragover",d$1,!1),i.removeEventListener("dragexit",d$1,!1))}function h(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",d$1,!1),e.addEventListener("dragover",d$1,!1),e.addEventListener("dragexit",d$1,!1)}function j(e,t,i,r){var n=e.scene;return function(o){var a=t.name;try{var s;if(/\.czml$/i.test(a))s=E$y.load(JSON.parse(o.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=y$t.load(JSON.parse(o.target.result),{sourceUri:a,clampToGround:r});else{if(!/\.(kml|kmz)$/i.test(a))return void e.dropError.raiseEvent(e,a,"Unrecognized file: "+a);s=U$m.load(t,{sourceUri:a,proxy:i,camera:n.camera,canvas:n.canvas,clampToGround:r})}e$28(s)&&e.dataSources.add(s).then((function(t){e.flyToOnDrop&&e.flyTo(t)})).otherwise((function(t){e.dropError.raiseEvent(e,a,t)}))}catch(t){e.dropError.raiseEvent(e,a,t)}}}function k(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}function m(e,t){if(!e$28(e))throw new t$Z("viewer is required.");t=u$Y(t,u$Y.EMPTY_OBJECT);var i=new i$2({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return i}}})}function d(e,t,i){try{return e(t,i)}catch(e){return o$1q.reject(e)}}function l(e){var t;return function(i){var r=i.data,n=[],o={id:r.id,result:void 0,error:void 0};return o$1q(d(e,r.parameters,n)).then((function(e){o.result=e})).otherwise((function(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e})).always((function(){e$28(t)||(t=u$Y(self.webkitPostMessage,self.postMessage)),r.canTransferArrayBuffer||(n.length=0);try{t(o,n)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+f$$(e)+"\n with responseMessage: "+JSON.stringify(o),t(o)}}))}}u.prototype._onTick=function(e){var t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var r=this._entityView;if(e$28(r)){var n=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(n,!1,C)===A$U.DONE&&r.update(t,C)}var o,a=!1,s=this.selectedEntity,l=e$28(s)&&this._enableInfoOrSelection,u=this.customInfobox;if(e$28(u))if(this._enableInfoOrSelection=!1,e$28(s)&&e$28(s.scenePos)){var c=this.scene.canvas.height,h=s.scenePos,d=new o$1k;m$W.wgs84ToWindowCoordinates(this.scene,h,d),u.style.bottom=c-d.y+45+"px",u.style.left=d.x-70+"px",u.style.visibility="visible"}else u.style.visibility="hidden";if((l=e$28(s)&&this._enableInfoOrSelection)&&s.isShowing&&s.isAvailable(t)){var f=this._dataSourceDisplay.getBoundingSphere(s,!0,C);if(e$28(s.position))o=s.position.getValue(t,o);else if(f!==A$U.FAILED){if(e$28(s.pickHeight)){var p=Cesium.Cartographic.fromCartesian(C.center);p.height=s.pickHeight,C.center=Cesium.Cartographic.toCartesian(p)}o=C.center}a=e$28(o)}var _=e$28(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;e$28(_)&&(_.position=t$X.clone(o,_.position),_.showSelection=l&&a,_.update());var m=e$28(this._infoBox)?this._infoBox.viewModel:void 0;e$28(m)&&(m.showInfo=l,m.enableCamera=a,m.isCameraTracking=this.trackedEntity===this.selectedEntity,l?(m.titleText=u$Y(s.name,s.id),m.description=r$K.getValueOrDefault(s.description,t,"")):(m.titleText="",m.description="")),this._zoomIndicator._viewModel.update();var $=this.scene._screenSpaceCameraController,g=$.tiltEventTypes,v=$._aggregator._isDown;(v[g[0]]&&3==this.scene.mode?(e$28(this._tiltIndicator)?this._tiltIndicator.setModelMatrix(this.scene.frameState,$._tiltCenter):(this._tiltIndicator=new x$1(this,this.scene.context,n$17("Widgets/Images/compass.s3m"),$._tiltCenter),this.scene.primitives.add(this._tiltIndicator)),this._tiltIndicator._visible=!0):e$28(this._tiltIndicator)&&(this._tiltIndicator._visible=!1),e$28(this.enableCursorStyle)&&0==this.enableCursorStyle)||(""==this._element.style.cursor&&(this._element.style.cursor=this._scratchPanUrl),v[$.rotateEventTypes]?ee||(ee=!0,this._element.style.cursor=this._scratchHoldUrl):ee&&(ee=!1,this._element.style.cursor=this._scratchPanUrl));if($._scene.pickPointEnabled){e$28(this.pointCloudIndicator)||(this.pointCloudIndicator=this.entities.add({id:"pont-cloud-indicator",position:new n$G((function(){return $._scene.pickPoint}),!1),point:{pixelSize:this._capturePointSize,color:this._capturePointColor,disableDepthTestDistance:Number.POSITIVE_INFINITY}})),this.pointCloudIndicator.show=!0;var y=$._aggregator;e$28(F)||(F=o$1k.clone(y.currentMousePosition));var x=kt$7();if(x-xe>$._scene.pickPointInterval){xe=x;var b=o$1k.clone(y.currentMousePosition),w=b.x-F.x,T=b.y-F.y,S=Math.sqrt(w*w+T*T);F=o$1k.clone(y.currentMousePosition),S>5&&$._scene.pointPick(b)}}else e$28(this.pointCloudIndicator)&&(this.pointCloudIndicator.show=!1)},u.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},u.prototype._onInfoBoxCameraClicked=function(e){e.isCameraTracking&&this.trackedEntity===this.selectedEntity?this.trackedEntity=void 0:e$28(this.selectedEntity.position)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)},u.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},u.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},u.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},u.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Te(this.timeline,this.clock,e)},u.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,u.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},u.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},u.prototype.zoomTo=function(e,t){return Ve(this,e,{offset:t},!1)},u.prototype.flyTo=function(e,t){return Ve(this,e,t,!0)},u.prototype._postRender=function(){It(this),Dt(this)};var SuperMapVersion="42035",Module=void 0!==Module?Module:{},moduleOverrides=Object.assign({},Module),thisProgram="./this.program",ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)");var scriptDirectory="",read_,readAsync,readBinary;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE){if("undefined"==typeof process||!process.release||"node"!==process.release.name)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");var fs=require("fs"),nodePath=require("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(e,t)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,t?void 0:"utf8")),readBinary=e=>{var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},readAsync=(e,t,i)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,(function(e,r){e?i(e):t(r.buffer)}))},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",(function(e){if(!(e instanceof ExitStatus))throw e})),process.on("unhandledRejection",(function(e){throw e})),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if("object"==typeof process&&"function"==typeof require||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(read_=function(e){return read(e)}),readBinary=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),assert("object"==typeof t),t)},readAsync=function(e,t,i){setTimeout((()=>t(readBinary(e))),0)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw new Error("environment detection error");if(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,i)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)}}var out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console),wasmBinary,wasmMemory;function legacyModuleProp(e,t){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get:function(){abort("Module."+e+" has been replaced with plain "+t+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}function ignoredModuleProp(e){Object.getOwnPropertyDescriptor(Module,e)&&abort("`Module."+e+"` was supplied but `"+e+"` not included in INCOMING_MODULE_JS_API")}function isExportedByForceFilesystem(e){return"FS_createPath"===e||"FS_createDataFile"===e||"FS_createPreloadedFile"===e||"FS_unlink"===e||"addRunDependency"===e||"FS_createLazyFile"===e||"FS_createDevice"===e||"removeRunDependency"===e}function missingLibrarySymbol(e){"undefined"==typeof globalThis||Object.getOwnPropertyDescriptor(globalThis,e)||Object.defineProperty(globalThis,e,{configurable:!0,get:function(){var t="`"+e+"` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line",i=e;i.startsWith("_")||(i="$"+e),t+=" (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE="+i+")",isExportedByForceFilesystem(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),warnOnce(t)}})}function unexportedRuntimeSymbol(e){Object.getOwnPropertyDescriptor(Module,e)||Object.defineProperty(Module,e,{configurable:!0,get:function(){var t="'"+e+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";isExportedByForceFilesystem(e)&&(t+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"),abort(t)}})}Object.assign(Module,moduleOverrides),moduleOverrides=null,checkIncomingModuleAPI(),Module.arguments,legacyModuleProp("arguments","arguments_"),Module.thisProgram&&(thisProgram=Module.thisProgram),legacyModuleProp("thisProgram","thisProgram"),Module.quit,legacyModuleProp("quit","quit_"),assert(void 0===Module.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.read,"Module.read option was removed (modify read_ in JS)"),assert(void 0===Module.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),assert(void 0===Module.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),assert(void 0===Module.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),assert(void 0===Module.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),legacyModuleProp("read","read_"),legacyModuleProp("readAsync","readAsync"),legacyModuleProp("readBinary","readBinary"),legacyModuleProp("setWindowTitle","setWindowTitle"),assert(!ENVIRONMENT_IS_SHELL,"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable."),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),legacyModuleProp("wasmBinary","wasmBinary"),Module.noExitRuntime,legacyModuleProp("noExitRuntime","noExitRuntime"),"object"!=typeof WebAssembly&&abort("no native wasm support detected");var ABORT=!1;function assert(e,t){e||abort("Assertion failed"+(t?": "+t:""))}var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(e,t,i){for(var r=t+i,n=t;e[n]&&!(n>=r);)++n;if(n-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var o="";t<n;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|l:(240!=(248&a)&&warnOnce("Invalid UTF-8 leading byte "+ptrToString(a)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|l<<6|63&e[t++]),a<65536)o+=String.fromCharCode(a);else{var u=a-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,i,r){if(!(r>0))return 0;for(var n=i,o=i+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(i>=o)break;t[i++]=s}else if(s<=2047){if(i+1>=o)break;t[i++]=192|s>>6,t[i++]=128|63&s}else if(s<=65535){if(i+2>=o)break;t[i++]=224|s>>12,t[i++]=128|s>>6&63,t[i++]=128|63&s}else{if(i+3>=o)break;s>1114111&&warnOnce("Invalid Unicode code point "+ptrToString(s)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[i++]=240|s>>18,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}}return t[i]=0,i-n}function stringToUTF8(e,t,i){return assert("number"==typeof i,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,t,i)}function lengthBytesUTF8(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++i):t+=3}return t}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var STACK_SIZE=65536;Module.STACK_SIZE&&assert(STACK_SIZE===Module.STACK_SIZE,"the stack size can no longer be determined at runtime");var INITIAL_MEMORY=Module.INITIAL_MEMORY||16777216,wasmTable;function writeStackCookie(){var e=_emscripten_stack_get_end();assert(0==(3&e)),0==e&&(e+=4),HEAPU32[e>>2]=34821223,HEAPU32[e+4>>2]=2310721022,HEAPU32[0]=1668509029}function checkStackCookie(){if(!ABORT){var e=_emscripten_stack_get_end();0==e&&(e+=4);var t=HEAPU32[e>>2],i=HEAPU32[e+4>>2];34821223==t&&2310721022==i||abort("Stack overflow! Stack cookie has been overwritten at "+ptrToString(e)+", expected hex dwords 0x89BACDFE and 0x2135467, but received "+ptrToString(i)+" "+ptrToString(t)),1668509029!==HEAPU32[0]&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}legacyModuleProp("INITIAL_MEMORY","INITIAL_MEMORY"),assert(INITIAL_MEMORY>=STACK_SIZE,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+INITIAL_MEMORY+"! (STACK_SIZE="+STACK_SIZE+")"),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&null!=Int32Array.prototype.subarray&&null!=Int32Array.prototype.set,"JS engine does not provide full typed array support"),assert(!Module.wasmMemory,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),assert(16777216==INITIAL_MEMORY,"Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)"}();var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){assert(!runtimeInitialized),runtimeInitialized=!0,checkStackCookie(),Module.noFSInit||FS$1.init.initialized||FS$1.init(),FS$1.ignorePermissions=!1,callRuntimeCallbacks(__ATINIT__)}function postRun(){if(checkStackCookie(),Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function getUniqueRunDependency(e){for(var t=e;;){if(!runDependencyTracking[e])return e;e=t+Math.random()}}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval((function(){if(ABORT)return clearInterval(runDependencyWatcher),void(runDependencyWatcher=null);var e=!1;for(var t in runDependencyTracking)e||(e=!0,err("still waiting on run dependencies:")),err("dependency: "+t);e&&err("(end of list)")}),1e4))):err("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):err("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){if(Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,"undefined"!=typeof WebAssembly)throw new WebAssembly.RuntimeError(e)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble$1,tempI64$1;function isDataURI(e){return e.startsWith(dataURIPrefix)}function isFileURI(e){return e.startsWith("file://")}function createExportWrapper(e,t){return function(){var i=e,r=t;return t||(r=Module.asm),assert(runtimeInitialized,"native function `"+i+"` called before runtime initialization"),r[e]||assert(r[e],"exported native function `"+i+"` not found"),r[e].apply(null,arguments)}}function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if("function"==typeof fetch&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()})).catch((function(){return getBinary(wasmBinaryFile)}));if(readAsync)return new Promise((function(e,t){readAsync(wasmBinaryFile,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return getBinary(wasmBinaryFile)}))}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg};function t(e,t){var i=e.exports;Module.asm=i,assert(wasmMemory=Module.asm.memory,"memory not found in wasm exports"),updateGlobalBufferAndViews(wasmMemory.buffer),assert(wasmTable=Module.asm.__indirect_function_table,"table not found in wasm exports"),addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");var i=Module;function r(e){assert(Module===i,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),i=null,t(e.instance)}function n(t){return getBinaryPromise().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),isFileURI(wasmBinaryFile)&&err("warning: Loading from a file URI ("+wasmBinaryFile+") is not supported in most browsers."),abort(e)}))}if(Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||"function"!=typeof fetch?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),n(r)}))})),{}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function callRuntimeCallbacks(e){for(;e.length>0;)e.shift()(Module)}function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];case"*":return HEAPU32[e>>2];default:abort("invalid type for getValue: "+t)}return null}function ptrToString(e){return assert("number"==typeof e),"0x"+e.toString(16).padStart(8,"0")}function setValue(e,t,i="i8"){switch(i.endsWith("*")&&(i="*"),i){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64$1=[t>>>0,(tempDouble$1=t,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64$1[0],HEAP32[e+4>>2]=tempI64$1[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;case"*":HEAPU32[e>>2]=t;break;default:abort("invalid type for setValue: "+i)}}function warnOnce(e){warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,ENVIRONMENT_IS_NODE&&(e="warning: "+e),err(e))}function ___assert_fail(e,t,i,r){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",i,r?UTF8ToString(r):"unknown function"])}function ExceptionInfo(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){HEAPU32[this.ptr+4>>2]=e},this.get_type=function(){return HEAPU32[this.ptr+4>>2]},this.set_destructor=function(e){HEAPU32[this.ptr+8>>2]=e},this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]},this.set_refcount=function(e){HEAP32[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,HEAP8[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=HEAP8[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,HEAP8[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=HEAP8[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=e+1},this.release_ref=function(){var e=HEAP32[this.ptr>>2];return HEAP32[this.ptr>>2]=e-1,assert(e>0),1===e},this.set_adjusted_ptr=function(e){HEAPU32[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]},this.get_exception_ptr=function(){if(___cxa_is_pointer_type(this.get_type()))return HEAPU32[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function ___cxa_throw(e,t,i){throw new ExceptionInfo(e).init(t,i),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch."}wasmBinaryFile="SuModeling.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var PATH={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var i=0,r=e.length-1;r>=0;r--){var n=e[r];"."===n?e.splice(r,1):".."===n?(e.splice(r,1),i++):i&&(e.splice(r,1),i--)}if(t)for(;i;i--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),i="/"===e.substr(-1);return e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"),e||t||(e="."),e&&i&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),i=t[0],r=t[1];return i||r?(r&&(r=r.substr(0,r.length-1)),i+r):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return PATH.normalize(e.join("/"))},join2:(e,t)=>PATH.normalize(e+"/"+t)};function getRandomDevice(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}if(ENVIRONMENT_IS_NODE)try{var t=require("crypto");return()=>t.randomBytes(1)[0]}catch(e){}return()=>abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}var PATH_FS={resolve:function(){for(var e="",t=!1,i=arguments.length-1;i>=-1&&!t;i--){var r=i>=0?arguments[i]:FS$1.cwd();if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,t=PATH.isAbs(r)}return e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"),(t?"/":"")+e||"."},relative:(e,t)=>{function i(e){for(var t=0;t<e.length&&""===e[t];t++);for(var i=e.length-1;i>=0&&""===e[i];i--);return t>i?[]:e.slice(t,i-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var r=i(e.split("/")),n=i(t.split("/")),o=Math.min(r.length,n.length),a=o,s=0;s<o;s++)if(r[s]!==n[s]){a=s;break}var l=[];for(s=a;s<r.length;s++)l.push("..");return(l=l.concat(n.slice(a))).join("/")}};function intArrayFromString(e,t,i){var r=i>0?i:lengthBytesUTF8(e)+1,n=new Array(r),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS$1.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS$1.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,i,r,n){if(!e.tty||!e.tty.ops.get_char)throw new FS$1.ErrnoError(60);for(var o=0,a=0;a<r;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new FS$1.ErrnoError(29)}if(void 0===s&&0===o)throw new FS$1.ErrnoError(6);if(null==s)break;o++,t[i+a]=s}return o&&(e.node.timestamp=Date.now()),o},write:function(e,t,i,r,n){if(!e.tty||!e.tty.ops.put_char)throw new FS$1.ErrnoError(60);try{for(var o=0;o<r;o++)e.tty.ops.put_char(e.tty,t[i+o])}catch(e){throw new FS$1.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(ENVIRONMENT_IS_NODE){var i=Buffer.alloc(256),r=0;try{r=fs.readSync(process.stdin.fd,i,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}t=r>0?i.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}};function mmapAlloc(e){abort("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported")}var MEMFS={ops_table:null,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,i,r){if(FS$1.isBlkdev(i)||FS$1.isFIFO(i))throw new FS$1.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS$1.chrdev_stream_ops}});var n=FS$1.createNode(e,t,i,r);return FS$1.isDir(n.mode)?(n.node_ops=MEMFS.ops_table.dir.node,n.stream_ops=MEMFS.ops_table.dir.stream,n.contents={}):FS$1.isFile(n.mode)?(n.node_ops=MEMFS.ops_table.file.node,n.stream_ops=MEMFS.ops_table.file.stream,n.usedBytes=0,n.contents=null):FS$1.isLink(n.mode)?(n.node_ops=MEMFS.ops_table.link.node,n.stream_ops=MEMFS.ops_table.link.stream):FS$1.isChrdev(n.mode)&&(n.node_ops=MEMFS.ops_table.chrdev.node,n.stream_ops=MEMFS.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var i=e.contents?e.contents.length:0;if(!(i>=t)){t=Math.max(t,i*(i<1048576?2:1.125)>>>0),0!=i&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var i=e.contents;e.contents=new Uint8Array(t),i&&e.contents.set(i.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=FS$1.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS$1.isDir(e.mode)?t.size=4096:FS$1.isFile(e.mode)?t.size=e.usedBytes:FS$1.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&MEMFS.resizeFileStorage(e,t.size)},lookup:function(e,t){throw FS$1.genericErrors[44]},mknod:function(e,t,i,r){return MEMFS.createNode(e,t,i,r)},rename:function(e,t,i){if(FS$1.isDir(e.mode)){var r;try{r=FS$1.lookupNode(t,i)}catch(e){}if(r)for(var n in r.contents)throw new FS$1.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=i,t.contents[i]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var i=FS$1.lookupNode(e,t);for(var r in i.contents)throw new FS$1.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var i in e.contents)e.contents.hasOwnProperty(i)&&t.push(i);return t},symlink:function(e,t,i){var r=MEMFS.createNode(e,t,41471,0);return r.link=i,r},readlink:function(e){if(!FS$1.isLink(e.mode))throw new FS$1.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,i,r,n){var o=e.node.contents;if(n>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-n,r);if(assert(a>=0),a>8&&o.subarray)t.set(o.subarray(n,n+a),i);else for(var s=0;s<a;s++)t[i+s]=o[n+s];return a},write:function(e,t,i,r,n,o){if(assert(!(t instanceof ArrayBuffer)),t.buffer===HEAP8.buffer&&(o=!1),!r)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(o)return assert(0===n,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(i,i+r),a.usedBytes=r,r;if(0===a.usedBytes&&0===n)return a.contents=t.slice(i,i+r),a.usedBytes=r,r;if(n+r<=a.usedBytes)return a.contents.set(t.subarray(i,i+r),n),r}if(MEMFS.expandFileStorage(a,n+r),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(i,i+r),n);else for(var s=0;s<r;s++)a.contents[n+s]=t[i+s];return a.usedBytes=Math.max(a.usedBytes,n+r),r},llseek:function(e,t,i){var r=t;if(1===i?r+=e.position:2===i&&FS$1.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new FS$1.ErrnoError(28);return r},allocate:function(e,t,i){MEMFS.expandFileStorage(e.node,t+i),e.node.usedBytes=Math.max(e.node.usedBytes,t+i)},mmap:function(e,t,i,r,n){if(!FS$1.isFile(e.node.mode))throw new FS$1.ErrnoError(43);var o,a,s=e.node.contents;if(2&n||s.buffer!==buffer){if((i>0||i+t<s.length)&&(s=s.subarray?s.subarray(i,i+t):Array.prototype.slice.call(s,i,i+t)),a=!0,!(o=mmapAlloc()))throw new FS$1.ErrnoError(48);HEAP8.set(s,o)}else a=!1,o=s.byteOffset;return{ptr:o,allocated:a}},msync:function(e,t,i,r,n){return MEMFS.stream_ops.write(e,t,0,r,i,!1),0}}};function asyncLoad(e,t,i,r){var n=r?"":getUniqueRunDependency("al "+e);readAsync(e,(i=>{assert(i,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(i)),n&&removeRunDependency(n)}),(t=>{if(!i)throw'Loading data file "'+e+'" failed.';i()})),n&&addRunDependency(n)}var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ERRNO_CODES={};function demangle(e){return warnOnce("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:t+" ["+e+"]"}))}var FS$1={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=PATH_FS.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new FS$1.ErrnoError(32);for(var i=e.split("/").filter((e=>!!e)),r=FS$1.root,n="/",o=0;o<i.length;o++){var a=o===i.length-1;if(a&&t.parent)break;if(r=FS$1.lookupNode(r,i[o]),n=PATH.join2(n,i[o]),FS$1.isMountpoint(r)&&(!a||a&&t.follow_mount)&&(r=r.mounted.root),!a||t.follow)for(var s=0;FS$1.isLink(r.mode);){var l=FS$1.readlink(n);if(n=PATH_FS.resolve(PATH.dirname(n),l),r=FS$1.lookupPath(n,{recurse_count:t.recurse_count+1}).node,s++>40)throw new FS$1.ErrnoError(32)}}return{path:n,node:r}},getPath:e=>{for(var t;;){if(FS$1.isRoot(e)){var i=e.mount.mountpoint;return t?"/"!==i[i.length-1]?i+"/"+t:i+t:i}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var i=0,r=0;r<t.length;r++)i=(i<<5)-i+t.charCodeAt(r)|0;return(e+i>>>0)%FS$1.nameTable.length},hashAddNode:e=>{var t=FS$1.hashName(e.parent.id,e.name);e.name_next=FS$1.nameTable[t],FS$1.nameTable[t]=e},hashRemoveNode:e=>{var t=FS$1.hashName(e.parent.id,e.name);if(FS$1.nameTable[t]===e)FS$1.nameTable[t]=e.name_next;else for(var i=FS$1.nameTable[t];i;){if(i.name_next===e){i.name_next=e.name_next;break}i=i.name_next}},lookupNode:(e,t)=>{var i=FS$1.mayLookup(e);if(i)throw new FS$1.ErrnoError(i,e);for(var r=FS$1.hashName(e.id,t),n=FS$1.nameTable[r];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===t)return n}return FS$1.lookup(e,t)},createNode:(e,t,i,r)=>{assert("object"==typeof e);var n=new FS$1.FSNode(e,t,i,r);return FS$1.hashAddNode(n),n},destroyNode:e=>{FS$1.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=FS$1.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>FS$1.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>{var t=FS$1.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{FS$1.lookupNode(e,t);return 20}catch(e){}return FS$1.nodePermissions(e,"wx")},mayDelete:(e,t,i)=>{var r;try{r=FS$1.lookupNode(e,t)}catch(e){return e.errno}var n=FS$1.nodePermissions(e,"wx");if(n)return n;if(i){if(!FS$1.isDir(r.mode))return 54;if(FS$1.isRoot(r)||FS$1.getPath(r)===FS$1.cwd())return 10}else if(FS$1.isDir(r.mode))return 31;return 0},mayOpen:(e,t)=>e?FS$1.isLink(e.mode)?32:FS$1.isDir(e.mode)&&("r"!==FS$1.flagsToPermissionString(t)||512&t)?31:FS$1.nodePermissions(e,FS$1.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=FS$1.MAX_OPEN_FDS)=>{for(var i=e;i<=t;i++)if(!FS$1.streams[i])return i;throw new FS$1.ErrnoError(33)},getStream:e=>FS$1.streams[e],createStream:(e,t,i)=>{FS$1.FSStream||(FS$1.FSStream=function(){this.shared={}},FS$1.FSStream.prototype={},Object.defineProperties(FS$1.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new FS$1.FSStream,e);var r=FS$1.nextfd(t,i);return e.fd=r,FS$1.streams[r]=e,e},closeStream:e=>{FS$1.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=FS$1.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new FS$1.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{FS$1.devices[e]={stream_ops:t}},getDevice:e=>FS$1.devices[e],getMounts:e=>{for(var t=[],i=[e];i.length;){var r=i.pop();t.push(r),i.push.apply(i,r.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),FS$1.syncFSRequests++,FS$1.syncFSRequests>1&&err("warning: "+FS$1.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var i=FS$1.getMounts(FS$1.root.mount),r=0;function n(e){return assert(FS$1.syncFSRequests>0),FS$1.syncFSRequests--,t(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,n(e));++r>=i.length&&n(null)}i.forEach((t=>{if(!t.type.syncfs)return o(null);t.type.syncfs(t,e,o)}))},mount:(e,t,i)=>{if("string"==typeof e)throw e;var r,n="/"===i,o=!i;if(n&&FS$1.root)throw new FS$1.ErrnoError(10);if(!n&&!o){var a=FS$1.lookupPath(i,{follow_mount:!1});if(i=a.path,r=a.node,FS$1.isMountpoint(r))throw new FS$1.ErrnoError(10);if(!FS$1.isDir(r.mode))throw new FS$1.ErrnoError(54)}var s={type:e,opts:t,mountpoint:i,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,n?FS$1.root=l:r&&(r.mounted=s,r.mount&&r.mount.mounts.push(s)),l},unmount:e=>{var t=FS$1.lookupPath(e,{follow_mount:!1});if(!FS$1.isMountpoint(t.node))throw new FS$1.ErrnoError(28);var i=t.node,r=i.mounted,n=FS$1.getMounts(r);Object.keys(FS$1.nameTable).forEach((e=>{for(var t=FS$1.nameTable[e];t;){var i=t.name_next;n.includes(t.mount)&&FS$1.destroyNode(t),t=i}})),i.mounted=null;var o=i.mount.mounts.indexOf(r);assert(-1!==o),i.mount.mounts.splice(o,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,i)=>{var r=FS$1.lookupPath(e,{parent:!0}).node,n=PATH.basename(e);if(!n||"."===n||".."===n)throw new FS$1.ErrnoError(28);var o=FS$1.mayCreate(r,n);if(o)throw new FS$1.ErrnoError(o);if(!r.node_ops.mknod)throw new FS$1.ErrnoError(63);return r.node_ops.mknod(r,n,t,i)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,FS$1.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,FS$1.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var i=e.split("/"),r="",n=0;n<i.length;++n)if(i[n]){r+="/"+i[n];try{FS$1.mkdir(r,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,i)=>(void 0===i&&(i=t,t=438),t|=8192,FS$1.mknod(e,t,i)),symlink:(e,t)=>{if(!PATH_FS.resolve(e))throw new FS$1.ErrnoError(44);var i=FS$1.lookupPath(t,{parent:!0}).node;if(!i)throw new FS$1.ErrnoError(44);var r=PATH.basename(t),n=FS$1.mayCreate(i,r);if(n)throw new FS$1.ErrnoError(n);if(!i.node_ops.symlink)throw new FS$1.ErrnoError(63);return i.node_ops.symlink(i,r,e)},rename:(e,t)=>{var i,r,n=PATH.dirname(e),o=PATH.dirname(t),a=PATH.basename(e),s=PATH.basename(t);if(i=FS$1.lookupPath(e,{parent:!0}).node,r=FS$1.lookupPath(t,{parent:!0}).node,!i||!r)throw new FS$1.ErrnoError(44);if(i.mount!==r.mount)throw new FS$1.ErrnoError(75);var l,u=FS$1.lookupNode(i,a),c=PATH_FS.relative(e,o);if("."!==c.charAt(0))throw new FS$1.ErrnoError(28);if("."!==(c=PATH_FS.relative(t,n)).charAt(0))throw new FS$1.ErrnoError(55);try{l=FS$1.lookupNode(r,s)}catch(e){}if(u!==l){var h=FS$1.isDir(u.mode),d=FS$1.mayDelete(i,a,h);if(d)throw new FS$1.ErrnoError(d);if(d=l?FS$1.mayDelete(r,s,h):FS$1.mayCreate(r,s))throw new FS$1.ErrnoError(d);if(!i.node_ops.rename)throw new FS$1.ErrnoError(63);if(FS$1.isMountpoint(u)||l&&FS$1.isMountpoint(l))throw new FS$1.ErrnoError(10);if(r!==i&&(d=FS$1.nodePermissions(i,"w")))throw new FS$1.ErrnoError(d);FS$1.hashRemoveNode(u);try{i.node_ops.rename(u,r,s)}catch(e){throw e}finally{FS$1.hashAddNode(u)}}},rmdir:e=>{var t=FS$1.lookupPath(e,{parent:!0}).node,i=PATH.basename(e),r=FS$1.lookupNode(t,i),n=FS$1.mayDelete(t,i,!0);if(n)throw new FS$1.ErrnoError(n);if(!t.node_ops.rmdir)throw new FS$1.ErrnoError(63);if(FS$1.isMountpoint(r))throw new FS$1.ErrnoError(10);t.node_ops.rmdir(t,i),FS$1.destroyNode(r)},readdir:e=>{var t=FS$1.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS$1.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=FS$1.lookupPath(e,{parent:!0}).node;if(!t)throw new FS$1.ErrnoError(44);var i=PATH.basename(e),r=FS$1.lookupNode(t,i),n=FS$1.mayDelete(t,i,!1);if(n)throw new FS$1.ErrnoError(n);if(!t.node_ops.unlink)throw new FS$1.ErrnoError(63);if(FS$1.isMountpoint(r))throw new FS$1.ErrnoError(10);t.node_ops.unlink(t,i),FS$1.destroyNode(r)},readlink:e=>{var t=FS$1.lookupPath(e).node;if(!t)throw new FS$1.ErrnoError(44);if(!t.node_ops.readlink)throw new FS$1.ErrnoError(28);return PATH_FS.resolve(FS$1.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var i=FS$1.lookupPath(e,{follow:!t}).node;if(!i)throw new FS$1.ErrnoError(44);if(!i.node_ops.getattr)throw new FS$1.ErrnoError(63);return i.node_ops.getattr(i)},lstat:e=>FS$1.stat(e,!0),chmod:(e,t,i)=>{var r;"string"==typeof e?r=FS$1.lookupPath(e,{follow:!i}).node:r=e;if(!r.node_ops.setattr)throw new FS$1.ErrnoError(63);r.node_ops.setattr(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})},lchmod:(e,t)=>{FS$1.chmod(e,t,!0)},fchmod:(e,t)=>{var i=FS$1.getStream(e);if(!i)throw new FS$1.ErrnoError(8);FS$1.chmod(i.node,t)},chown:(e,t,i,r)=>{var n;"string"==typeof e?n=FS$1.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new FS$1.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:(e,t,i)=>{FS$1.chown(e,t,i,!0)},fchown:(e,t,i)=>{var r=FS$1.getStream(e);if(!r)throw new FS$1.ErrnoError(8);FS$1.chown(r.node,t,i)},truncate:(e,t)=>{if(t<0)throw new FS$1.ErrnoError(28);var i;"string"==typeof e?i=FS$1.lookupPath(e,{follow:!0}).node:i=e;if(!i.node_ops.setattr)throw new FS$1.ErrnoError(63);if(FS$1.isDir(i.mode))throw new FS$1.ErrnoError(31);if(!FS$1.isFile(i.mode))throw new FS$1.ErrnoError(28);var r=FS$1.nodePermissions(i,"w");if(r)throw new FS$1.ErrnoError(r);i.node_ops.setattr(i,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var i=FS$1.getStream(e);if(!i)throw new FS$1.ErrnoError(8);if(0==(2097155&i.flags))throw new FS$1.ErrnoError(28);FS$1.truncate(i.node,t)},utime:(e,t,i)=>{var r=FS$1.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,i)})},open:(e,t,i)=>{if(""===e)throw new FS$1.ErrnoError(44);var r;if(i=void 0===i?438:i,i=64&(t="string"==typeof t?FS$1.modeStringToFlags(t):t)?4095&i|32768:0,"object"==typeof e)r=e;else{e=PATH.normalize(e);try{r=FS$1.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n=!1;if(64&t)if(r){if(128&t)throw new FS$1.ErrnoError(20)}else r=FS$1.mknod(e,i,0),n=!0;if(!r)throw new FS$1.ErrnoError(44);if(FS$1.isChrdev(r.mode)&&(t&=-513),65536&t&&!FS$1.isDir(r.mode))throw new FS$1.ErrnoError(54);if(!n){var o=FS$1.mayOpen(r,t);if(o)throw new FS$1.ErrnoError(o)}512&t&&!n&&FS$1.truncate(r,0),t&=-131713;var a=FS$1.createStream({node:r,path:FS$1.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!Module.logReadFiles||1&t||(FS$1.readFiles||(FS$1.readFiles={}),e in FS$1.readFiles||(FS$1.readFiles[e]=1)),a},close:e=>{if(FS$1.isClosed(e))throw new FS$1.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS$1.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,i)=>{if(FS$1.isClosed(e))throw new FS$1.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS$1.ErrnoError(70);if(0!=i&&1!=i&&2!=i)throw new FS$1.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,i),e.ungotten=[],e.position},read:(e,t,i,r,n)=>{if(r<0||n<0)throw new FS$1.ErrnoError(28);if(FS$1.isClosed(e))throw new FS$1.ErrnoError(8);if(1==(2097155&e.flags))throw new FS$1.ErrnoError(8);if(FS$1.isDir(e.node.mode))throw new FS$1.ErrnoError(31);if(!e.stream_ops.read)throw new FS$1.ErrnoError(28);var o=void 0!==n;if(o){if(!e.seekable)throw new FS$1.ErrnoError(70)}else n=e.position;var a=e.stream_ops.read(e,t,i,r,n);return o||(e.position+=a),a},write:(e,t,i,r,n,o)=>{if(r<0||n<0)throw new FS$1.ErrnoError(28);if(FS$1.isClosed(e))throw new FS$1.ErrnoError(8);if(0==(2097155&e.flags))throw new FS$1.ErrnoError(8);if(FS$1.isDir(e.node.mode))throw new FS$1.ErrnoError(31);if(!e.stream_ops.write)throw new FS$1.ErrnoError(28);e.seekable&&1024&e.flags&&FS$1.llseek(e,0,2);var a=void 0!==n;if(a){if(!e.seekable)throw new FS$1.ErrnoError(70)}else n=e.position;var s=e.stream_ops.write(e,t,i,r,n,o);return a||(e.position+=s),s},allocate:(e,t,i)=>{if(FS$1.isClosed(e))throw new FS$1.ErrnoError(8);if(t<0||i<=0)throw new FS$1.ErrnoError(28);if(0==(2097155&e.flags))throw new FS$1.ErrnoError(8);if(!FS$1.isFile(e.node.mode)&&!FS$1.isDir(e.node.mode))throw new FS$1.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS$1.ErrnoError(138);e.stream_ops.allocate(e,t,i)},mmap:(e,t,i,r,n)=>{if(0!=(2&r)&&0==(2&n)&&2!=(2097155&e.flags))throw new FS$1.ErrnoError(2);if(1==(2097155&e.flags))throw new FS$1.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS$1.ErrnoError(43);return e.stream_ops.mmap(e,t,i,r,n)},msync:(e,t,i,r,n)=>e.stream_ops.msync?e.stream_ops.msync(e,t,i,r,n):0,munmap:e=>0,ioctl:(e,t,i)=>{if(!e.stream_ops.ioctl)throw new FS$1.ErrnoError(59);return e.stream_ops.ioctl(e,t,i)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var i,r=FS$1.open(e,t.flags),n=FS$1.stat(e).size,o=new Uint8Array(n);return FS$1.read(r,o,0,n,0),"utf8"===t.encoding?i=UTF8ArrayToString(o,0):"binary"===t.encoding&&(i=o),FS$1.close(r),i},writeFile:(e,t,i={})=>{i.flags=i.flags||577;var r=FS$1.open(e,i.flags,i.mode);if("string"==typeof t){var n=new Uint8Array(lengthBytesUTF8(t)+1),o=stringToUTF8Array(t,n,0,n.length);FS$1.write(r,n,0,o,void 0,i.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");FS$1.write(r,t,0,t.byteLength,void 0,i.canOwn)}FS$1.close(r)},cwd:()=>FS$1.currentPath,chdir:e=>{var t=FS$1.lookupPath(e,{follow:!0});if(null===t.node)throw new FS$1.ErrnoError(44);if(!FS$1.isDir(t.node.mode))throw new FS$1.ErrnoError(54);var i=FS$1.nodePermissions(t.node,"x");if(i)throw new FS$1.ErrnoError(i);FS$1.currentPath=t.path},createDefaultDirectories:()=>{FS$1.mkdir("/tmp"),FS$1.mkdir("/home"),FS$1.mkdir("/home/web_user")},createDefaultDevices:()=>{FS$1.mkdir("/dev"),FS$1.registerDevice(FS$1.makedev(1,3),{read:()=>0,write:(e,t,i,r,n)=>r}),FS$1.mkdev("/dev/null",FS$1.makedev(1,3)),TTY.register(FS$1.makedev(5,0),TTY.default_tty_ops),TTY.register(FS$1.makedev(6,0),TTY.default_tty1_ops),FS$1.mkdev("/dev/tty",FS$1.makedev(5,0)),FS$1.mkdev("/dev/tty1",FS$1.makedev(6,0));var e=getRandomDevice();FS$1.createDevice("/dev","random",e),FS$1.createDevice("/dev","urandom",e),FS$1.mkdir("/dev/shm"),FS$1.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS$1.mkdir("/proc");var e=FS$1.mkdir("/proc/self");FS$1.mkdir("/proc/self/fd"),FS$1.mount({mount:()=>{var t=FS$1.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var i=+t,r=FS$1.getStream(i);if(!r)throw new FS$1.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>r.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{Module.stdin?FS$1.createDevice("/dev","stdin",Module.stdin):FS$1.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS$1.createDevice("/dev","stdout",null,Module.stdout):FS$1.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS$1.createDevice("/dev","stderr",null,Module.stderr):FS$1.symlink("/dev/tty1","/dev/stderr");var e=FS$1.open("/dev/stdin",0),t=FS$1.open("/dev/stdout",1),i=FS$1.open("/dev/stderr",1);assert(0===e.fd,"invalid handle for stdin ("+e.fd+")"),assert(1===t.fd,"invalid handle for stdout ("+t.fd+")"),assert(2===i.fd,"invalid handle for stderr ("+i.fd+")")},ensureErrnoError:()=>{FS$1.ErrnoError||(FS$1.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,ERRNO_CODES)if(ERRNO_CODES[t]===e){this.code=t;break}},this.setErrno(e),this.message=ERRNO_MESSAGES[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=demangleAll(this.stack))},FS$1.ErrnoError.prototype=new Error,FS$1.ErrnoError.prototype.constructor=FS$1.ErrnoError,[44].forEach((e=>{FS$1.genericErrors[e]=new FS$1.ErrnoError(e),FS$1.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{FS$1.ensureErrnoError(),FS$1.nameTable=new Array(4096),FS$1.mount(MEMFS,{},"/"),FS$1.createDefaultDirectories(),FS$1.createDefaultDevices(),FS$1.createSpecialDirectories(),FS$1.filesystems={MEMFS:MEMFS}},init:(e,t,i)=>{assert(!FS$1.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),FS$1.init.initialized=!0,FS$1.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=i||Module.stderr,FS$1.createStandardStreams()},quit:()=>{FS$1.init.initialized=!1,_fflush(0);for(var e=0;e<FS$1.streams.length;e++){var t=FS$1.streams[e];t&&FS$1.close(t)}},getMode:(e,t)=>{var i=0;return e&&(i|=365),t&&(i|=146),i},findObject:(e,t)=>{var i=FS$1.analyzePath(e,t);return i.exists?i.object:null},analyzePath:(e,t)=>{try{e=(r=FS$1.lookupPath(e,{follow:!t})).path}catch(e){}var i={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var r=FS$1.lookupPath(e,{parent:!0});i.parentExists=!0,i.parentPath=r.path,i.parentObject=r.node,i.name=PATH.basename(e),r=FS$1.lookupPath(e,{follow:!t}),i.exists=!0,i.path=r.path,i.object=r.node,i.name=r.node.name,i.isRoot="/"===r.path}catch(e){i.error=e.errno}return i},createPath:(e,t,i,r)=>{e="string"==typeof e?e:FS$1.getPath(e);for(var n=t.split("/").reverse();n.length;){var o=n.pop();if(o){var a=PATH.join2(e,o);try{FS$1.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,i,r,n)=>{var o=PATH.join2("string"==typeof e?e:FS$1.getPath(e),t),a=FS$1.getMode(r,n);return FS$1.create(o,a)},createDataFile:(e,t,i,r,n,o)=>{var a=t;e&&(e="string"==typeof e?e:FS$1.getPath(e),a=t?PATH.join2(e,t):e);var s=FS$1.getMode(r,n),l=FS$1.create(a,s);if(i){if("string"==typeof i){for(var u=new Array(i.length),c=0,h=i.length;c<h;++c)u[c]=i.charCodeAt(c);i=u}FS$1.chmod(l,146|s);var d=FS$1.open(l,577);FS$1.write(d,i,0,i.length,0,o),FS$1.close(d),FS$1.chmod(l,s)}return l},createDevice:(e,t,i,r)=>{var n=PATH.join2("string"==typeof e?e:FS$1.getPath(e),t),o=FS$1.getMode(!!i,!!r);FS$1.createDevice.major||(FS$1.createDevice.major=64);var a=FS$1.makedev(FS$1.createDevice.major++,0);return FS$1.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{r&&r.buffer&&r.buffer.length&&r(10)},read:(e,t,r,n,o)=>{for(var a=0,s=0;s<n;s++){var l;try{l=i()}catch(e){throw new FS$1.ErrnoError(29)}if(void 0===l&&0===a)throw new FS$1.ErrnoError(6);if(null==l)break;a++,t[r+s]=l}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,i,n,o)=>{for(var a=0;a<n;a++)try{r(t[i+a])}catch(e){throw new FS$1.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}}),FS$1.mkdev(n,o,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!read_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(read_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new FS$1.ErrnoError(29)}},createLazyFile:(e,t,i,r,n)=>{function o(){this.lengthKnown=!1,this.chunks=[]}if(o.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,i=e/this.chunkSize|0;return this.getter(i)[t]}},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",i,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+i+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,o=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;n||(a=r);var s=this;s.setDataGetter((e=>{var t=e*a,n=(e+1)*a-1;if(n=Math.min(n,r-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",i,!1),r!==a&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+i+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):intArrayFromString(n.responseText||"",!0)})(t,n)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!o&&r||(a=r=1,r=this.getter(0).length,a=r,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new o;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:i};var l=FS$1.createFile(e,t,s,r,n);s.contents?l.contents=s.contents:s.url&&(l.contents=null,l.url=s.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var u={};function c(e,t,i,r,n){var o=e.node.contents;if(n>=o.length)return 0;var a=Math.min(o.length-n,r);if(assert(a>=0),o.slice)for(var s=0;s<a;s++)t[i+s]=o[n+s];else for(s=0;s<a;s++)t[i+s]=o.get(n+s);return a}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];u[e]=function(){return FS$1.forceLoadFile(l),t.apply(null,arguments)}})),u.read=(e,t,i,r,n)=>(FS$1.forceLoadFile(l),c(e,t,i,r,n)),u.mmap=(e,t,i,r,n)=>{FS$1.forceLoadFile(l);var o=mmapAlloc();if(!o)throw new FS$1.ErrnoError(48);return c(e,HEAP8,o,t,i),{ptr:o,allocated:!0}},l.stream_ops=u,l},createPreloadedFile:(e,t,i,r,n,o,a,s,l,u)=>{var c=t?PATH_FS.resolve(PATH.join2(e,t)):e,h=getUniqueRunDependency("cp "+c);function d(i){function d(i){u&&u(),s||FS$1.createDataFile(e,t,i,r,n,l),o&&o(),removeRunDependency(h)}Browser.handledByPreloadPlugin(i,c,d,(()=>{a&&a(),removeRunDependency(h)}))||d(i)}addRunDependency(h),"string"==typeof i?asyncLoad(i,(e=>d(e)),a):d(i)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,i)=>{t=t||(()=>{}),i=i||(()=>{});var r=FS$1.indexedDB();try{var n=r.open(FS$1.DB_NAME(),FS$1.DB_VERSION)}catch(e){return i(e)}n.onupgradeneeded=()=>{out("creating db"),n.result.createObjectStore(FS$1.DB_STORE_NAME)},n.onsuccess=()=>{var r=n.result.transaction([FS$1.DB_STORE_NAME],"readwrite"),o=r.objectStore(FS$1.DB_STORE_NAME),a=0,s=0,l=e.length;function u(){0==s?t():i()}e.forEach((e=>{var t=o.put(FS$1.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==l&&u()},t.onerror=()=>{s++,a+s==l&&u()}})),r.onerror=i},n.onerror=i},loadFilesFromDB:(e,t,i)=>{t=t||(()=>{}),i=i||(()=>{});var r=FS$1.indexedDB();try{var n=r.open(FS$1.DB_NAME(),FS$1.DB_VERSION)}catch(e){return i(e)}n.onupgradeneeded=i,n.onsuccess=()=>{var r=n.result;try{var o=r.transaction([FS$1.DB_STORE_NAME],"readonly")}catch(e){return void i(e)}var a=o.objectStore(FS$1.DB_STORE_NAME),s=0,l=0,u=e.length;function c(){0==l?t():i()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{FS$1.analyzePath(e).exists&&FS$1.unlink(e),FS$1.createDataFile(PATH.dirname(e),PATH.basename(e),t.result,!0,!0,!0),++s+l==u&&c()},t.onerror=()=>{l++,s+l==u&&c()}})),o.onerror=i},n.onerror=i},absolutePath:()=>{abort("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{abort("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{abort("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{abort("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{abort("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{abort("FS.standardizePath has been removed; use PATH.normalize instead")}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(e,t,i){if(PATH.isAbs(t))return t;var r;-100===e?r=FS$1.cwd():r=SYSCALLS.getStreamFromFD(e).path;if(0==t.length){if(!i)throw new FS$1.ErrnoError(44);return r}return PATH.join2(r,t)},doStat:function(e,t,i){try{var r=e(t)}catch(e){if(e&&e.node&&PATH.normalize(t)!==PATH.normalize(FS$1.getPath(e.node)))return-54;throw e}HEAP32[i>>2]=r.dev,HEAP32[i+8>>2]=r.ino,HEAP32[i+12>>2]=r.mode,HEAPU32[i+16>>2]=r.nlink,HEAP32[i+20>>2]=r.uid,HEAP32[i+24>>2]=r.gid,HEAP32[i+28>>2]=r.rdev,tempI64$1=[r.size>>>0,(tempDouble$1=r.size,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[i+40>>2]=tempI64$1[0],HEAP32[i+44>>2]=tempI64$1[1],HEAP32[i+48>>2]=4096,HEAP32[i+52>>2]=r.blocks;var n=r.atime.getTime(),o=r.mtime.getTime(),a=r.ctime.getTime();return tempI64$1=[Math.floor(n/1e3)>>>0,(tempDouble$1=Math.floor(n/1e3),+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[i+56>>2]=tempI64$1[0],HEAP32[i+60>>2]=tempI64$1[1],HEAPU32[i+64>>2]=n%1e3*1e3,tempI64$1=[Math.floor(o/1e3)>>>0,(tempDouble$1=Math.floor(o/1e3),+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[i+72>>2]=tempI64$1[0],HEAP32[i+76>>2]=tempI64$1[1],HEAPU32[i+80>>2]=o%1e3*1e3,tempI64$1=[Math.floor(a/1e3)>>>0,(tempDouble$1=Math.floor(a/1e3),+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[i+88>>2]=tempI64$1[0],HEAP32[i+92>>2]=tempI64$1[1],HEAPU32[i+96>>2]=a%1e3*1e3,tempI64$1=[r.ino>>>0,(tempDouble$1=r.ino,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[i+104>>2]=tempI64$1[0],HEAP32[i+108>>2]=tempI64$1[1],0},doMsync:function(e,t,i,r,n){if(!FS$1.isFile(t.node.mode))throw new FS$1.ErrnoError(43);if(2&r)return 0;var o=HEAPU8.slice(e,e+i);FS$1.msync(t,o,n,i,r)},varargs:void 0,get:function(){return assert(null!=SYSCALLS.varargs),SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(e){return UTF8ToString(e)},getStreamFromFD:function(e){var t=FS$1.getStream(e);if(!t)throw new FS$1.ErrnoError(8);return t}};function ___syscall_faccessat(e,t,i,r){try{if(t=SYSCALLS.getStr(t),assert(0===r),t=SYSCALLS.calculateAt(e,t),-8&i)return-28;var n=FS$1.lookupPath(t,{follow:!0}).node;if(!n)return-44;var o="";return 4&i&&(o+="r"),2&i&&(o+="w"),1&i&&(o+="x"),o&&FS$1.nodePermissions(n,o)?-2:0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_getdents64(e,t,i){try{var r=SYSCALLS.getStreamFromFD(e);r.getdents||(r.getdents=FS$1.readdir(r.path));for(var n=280,o=0,a=FS$1.llseek(r,0,1),s=Math.floor(a/n);s<r.getdents.length&&o+n<=i;){var l,u,c=r.getdents[s];if("."===c)l=r.node.id,u=4;else if(".."===c){l=FS$1.lookupPath(r.path,{parent:!0}).node.id,u=4}else{var h=FS$1.lookupNode(r.node,c);l=h.id,u=FS$1.isChrdev(h.mode)?2:FS$1.isDir(h.mode)?4:FS$1.isLink(h.mode)?10:8}assert(l),tempI64$1=[l>>>0,(tempDouble$1=l,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[t+o>>2]=tempI64$1[0],HEAP32[t+o+4>>2]=tempI64$1[1],tempI64$1=[(s+1)*n>>>0,(tempDouble$1=(s+1)*n,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[t+o+8>>2]=tempI64$1[0],HEAP32[t+o+12>>2]=tempI64$1[1],HEAP16[t+o+16>>1]=280,HEAP8[t+o+18>>0]=u,stringToUTF8(c,t+o+19,256),o+=n,s+=1}return FS$1.llseek(r,s*n,0),o}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_mkdirat(e,t,i){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),"/"===(t=PATH.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),FS$1.mkdir(t,i,0),0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_openat(e,t,i,r){SYSCALLS.varargs=r;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var n=r?SYSCALLS.get():0;return FS$1.open(t,i,n).fd}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_rmdir(e){try{return e=SYSCALLS.getStr(e),FS$1.rmdir(e),0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_statfs64(e,t,i){try{return e=SYSCALLS.getStr(e),assert(64===t),HEAP32[i+4>>2]=4096,HEAP32[i+40>>2]=4096,HEAP32[i+8>>2]=1e6,HEAP32[i+12>>2]=5e5,HEAP32[i+16>>2]=5e5,HEAP32[i+20>>2]=FS$1.nextInode,HEAP32[i+24>>2]=1e6,HEAP32[i+28>>2]=42,HEAP32[i+44>>2]=2,HEAP32[i+36>>2]=255,0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function ___syscall_unlinkat(e,t,i){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),0===i?FS$1.unlink(t):512===i?FS$1.rmdir(t):abort("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return-e.errno}}function __dlinit(e){}var dlopenMissingError="To use dlopen, you need enable dynamic linking";function __dlopen_js(e,t){abort(dlopenMissingError)}function __dlsym_js(e,t){abort(dlopenMissingError)}function __emscripten_throw_longjmp(){throw 1/0}function readI53FromI64(e){return HEAPU32[e>>2]+4294967296*HEAP32[e+4>>2]}function __isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}var __MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],__MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];function __yday_from_date(e){return(__isLeapYear(e.getFullYear())?__MONTH_DAYS_LEAP_CUMULATIVE:__MONTH_DAYS_REGULAR_CUMULATIVE)[e.getMonth()]+e.getDate()-1}function __localtime_js(e,t){var i=new Date(1e3*readI53FromI64(e));HEAP32[t>>2]=i.getSeconds(),HEAP32[t+4>>2]=i.getMinutes(),HEAP32[t+8>>2]=i.getHours(),HEAP32[t+12>>2]=i.getDate(),HEAP32[t+16>>2]=i.getMonth(),HEAP32[t+20>>2]=i.getFullYear()-1900,HEAP32[t+24>>2]=i.getDay();var r=0|__yday_from_date(i);HEAP32[t+28>>2]=r,HEAP32[t+36>>2]=-60*i.getTimezoneOffset();var n=new Date(i.getFullYear(),0,1),o=new Date(i.getFullYear(),6,1).getTimezoneOffset(),a=n.getTimezoneOffset(),s=0|(o!=a&&i.getTimezoneOffset()==Math.min(a,o));HEAP32[t+32>>2]=s}function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,i=_malloc(t);return i&&stringToUTF8Array(e,HEAP8,i,t),i}function __tzset_js(e,t,i){var r=(new Date).getFullYear(),n=new Date(r,0,1),o=new Date(r,6,1),a=n.getTimezoneOffset(),s=o.getTimezoneOffset(),l=Math.max(a,s);function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}HEAPU32[e>>2]=60*l,HEAP32[t>>2]=Number(a!=s);var c=u(n),h=u(o),d=allocateUTF8(c),f=allocateUTF8(h);s<a?(HEAPU32[i>>2]=d,HEAPU32[i+4>>2]=f):(HEAPU32[i>>2]=f,HEAPU32[i+4>>2]=d)}function _abort(){abort("native code called abort()")}function _emscripten_date_now(){return Date.now()}function _emscripten_memcpy_big(e,t,i){HEAPU8.copyWithin(e,t,t+i)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(e){try{return wasmMemory.grow(e-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch(t){err("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function _emscripten_resize_heap(e){var t=HEAPU8.length;assert((e>>>=0)>t);var i=getHeapMax();if(e>i)return err("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+i+" bytes!"),!1;let r=(e,t)=>e+(t-e%t)%t;for(var n=1;n<=4;n*=2){var o=t*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(i,r(Math.max(e,o),65536));if(emscripten_realloc_buffer(a))return!0}return err("Failed to grow the heap from "+t+" bytes to "+a+" bytes, not enough memory!"),!1}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var e={USER:"SuModeling",LOGNAME:"SuModeling",PATH:"/",PWD:"/",HOME:"/home/SuModeling",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:getExecutableName()};for(var t in ENV)void 0===ENV[t]?delete e[t]:e[t]=ENV[t];var i=[];for(var t in e)i.push(t+"="+e[t]);getEnvStrings.strings=i}return getEnvStrings.strings}function writeAsciiToMemory(e,t,i){for(var r=0;r<e.length;++r)assert(e.charCodeAt(r)===(255&e.charCodeAt(r))),HEAP8[t++>>0]=e.charCodeAt(r);i||(HEAP8[t>>0]=0)}function _environ_get(e,t){var i=0;return getEnvStrings().forEach((function(r,n){var o=t+i;HEAPU32[e+4*n>>2]=o,writeAsciiToMemory(r,o),i+=r.length+1})),0}function _environ_sizes_get(e,t){var i=getEnvStrings();HEAPU32[e>>2]=i.length;var r=0;return i.forEach((function(e){r+=e.length+1})),HEAPU32[t>>2]=r,0}function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS$1.close(t),0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return e.errno}}function doReadv(e,t,i,r){for(var n=0,o=0;o<i;o++){var a=HEAPU32[t>>2],s=HEAPU32[t+4>>2];t+=8;var l=FS$1.read(e,HEAP8,a,s,r);if(l<0)return-1;if(n+=l,l<s)break;void 0!==r&&(r+=l)}return n}function _fd_read(e,t,i,r){try{var n=doReadv(SYSCALLS.getStreamFromFD(e),t,i);return HEAPU32[r>>2]=n,0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return e.errno}}function convertI32PairToI53Checked(e,t){return assert(e==e>>>0||e==(0|e)),assert(t===(0|t)),t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}function _fd_seek(e,t,i,r,n){try{var o=convertI32PairToI53Checked(t,i);if(isNaN(o))return 61;var a=SYSCALLS.getStreamFromFD(e);return FS$1.llseek(a,o,r),tempI64$1=[a.position>>>0,(tempDouble$1=a.position,+Math.abs(tempDouble$1)>=1?tempDouble$1>0?(0|Math.min(+Math.floor(tempDouble$1/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble$1-+(~~tempDouble$1>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64$1[0],HEAP32[n+4>>2]=tempI64$1[1],a.getdents&&0===o&&0===r&&(a.getdents=null),0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return e.errno}}function doWritev(e,t,i,r){for(var n=0,o=0;o<i;o++){var a=HEAPU32[t>>2],s=HEAPU32[t+4>>2];t+=8;var l=FS$1.write(e,HEAP8,a,s,r);if(l<0)return-1;n+=l,void 0!==r&&(r+=l)}return n}function _fd_write(e,t,i,r){try{var n=doWritev(SYSCALLS.getStreamFromFD(e),t,i);return HEAPU32[r>>2]=n,0}catch(e){if(void 0===FS$1||!(e instanceof FS$1.ErrnoError))throw e;return e.errno}}function __arraySum(e,t){for(var i=0,r=0;r<=t;i+=e[r++]);return i}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(e,t){for(var i=new Date(e.getTime());t>0;){var r=__isLeapYear(i.getFullYear()),n=i.getMonth(),o=(r?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[n];if(!(t>o-i.getDate()))return i.setDate(i.getDate()+t),i;t-=o-i.getDate()+1,i.setDate(1),n<11?i.setMonth(n+1):(i.setMonth(0),i.setFullYear(i.getFullYear()+1))}return i}function writeArrayToMemory(e,t){assert(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),HEAP8.set(e,t)}function _strftime(e,t,i,r){var n=HEAP32[r+40>>2],o={tm_sec:HEAP32[r>>2],tm_min:HEAP32[r+4>>2],tm_hour:HEAP32[r+8>>2],tm_mday:HEAP32[r+12>>2],tm_mon:HEAP32[r+16>>2],tm_year:HEAP32[r+20>>2],tm_wday:HEAP32[r+24>>2],tm_yday:HEAP32[r+28>>2],tm_isdst:HEAP32[r+32>>2],tm_gmtoff:HEAP32[r+36>>2],tm_zone:n?UTF8ToString(n):""},a=UTF8ToString(i),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in s)a=a.replace(new RegExp(l,"g"),s[l]);var u=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],c=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(e,t,i){for(var r="number"==typeof e?e.toString():e||"";r.length<t;)r=i[0]+r;return r}function d(e,t){return h(e,t,"0")}function f(e,t){function i(e){return e<0?-1:e>0?1:0}var r;return 0===(r=i(e.getFullYear()-t.getFullYear()))&&0===(r=i(e.getMonth()-t.getMonth()))&&(r=i(e.getDate()-t.getDate())),r}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function _(e){var t=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday),i=new Date(t.getFullYear(),0,4),r=new Date(t.getFullYear()+1,0,4),n=p(i),o=p(r);return f(n,t)<=0?f(o,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var m={"%a":function(e){return u[e.tm_wday].substring(0,3)},"%A":function(e){return u[e.tm_wday]},"%b":function(e){return c[e.tm_mon].substring(0,3)},"%B":function(e){return c[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return h(e.tm_mday,2," ")},"%g":function(e){return _(e).toString().substring(2)},"%G":function(e){return _(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+__arraySum(__isLeapYear(e.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var i=(e.tm_wday+371-e.tm_yday)%7;4==i||3==i&&__isLeapYear(e.tm_year)||(t=1)}}else{t=52;var r=(e.tm_wday+7-e.tm_yday-1)%7;(4==r||5==r&&__isLeapYear(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,i=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(i?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in a=a.replace(/%%/g,"\0\0"),m)a.includes(l)&&(a=a.replace(new RegExp(l,"g"),m[l](o)));var $=intArrayFromString(a=a.replace(/\0\0/g,"%"),!1);return $.length>t?0:(writeArrayToMemory($,e),$.length-1)}function _strftime_l(e,t,i,r,n){return _strftime(e,t,i,r)}var wasmTableMirror=[];function getWasmTableEntry(e){var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),assert(wasmTable.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function getCFunc(e){var t=Module["_"+e];return assert(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function ccall(e,t,i,r,n){var o={string:e=>{var t=0;if(null!=e&&0!==e){var i=1+(e.length<<2);stringToUTF8(e,t=stackAlloc(i),i)}return t},array:e=>{var t=stackAlloc(e.length);return writeArrayToMemory(e,t),t}};var a=getCFunc(e),s=[],l=0;if(assert("array"!==t,'Return type should not be "array".'),r)for(var u=0;u<r.length;u++){var c=o[i[u]];c?(0===l&&(l=stackSave()),s[u]=c(r[u])):s[u]=r[u]}var h=a.apply(null,s);return h=function(e){return 0!==l&&stackRestore(l),function(e){return"string"===t?UTF8ToString(e):"boolean"===t?Boolean(e):e}(e)}(h)}function cwrap(e,t,i,r){return function(){return ccall(e,t,i,arguments)}}var FSNode=function(e,t,i,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS$1.nextInode++,this.name=t,this.mode=i,this.node_ops={},this.stream_ops={},this.rdev=r},readMode=365,writeMode=146;function checkIncomingModuleAPI(){ignoredModuleProp("fetchSettings")}Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(e){e?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(e){e?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS$1.isDir(this.mode)}},isDevice:{get:function(){return FS$1.isChrdev(this.mode)}}}),FS$1.FSNode=FSNode,FS$1.staticInit(),ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var asmLibraryArg={__assert_fail:___assert_fail,__cxa_throw:___cxa_throw,__syscall_faccessat:___syscall_faccessat,__syscall_getdents64:___syscall_getdents64,__syscall_mkdirat:___syscall_mkdirat,__syscall_openat:___syscall_openat,__syscall_rmdir:___syscall_rmdir,__syscall_statfs64:___syscall_statfs64,__syscall_unlinkat:___syscall_unlinkat,_dlinit:__dlinit,_dlopen_js:__dlopen_js,_dlsym_js:__dlsym_js,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_localtime_js:__localtime_js,_tzset_js:__tzset_js,abort:_abort,emscripten_date_now:_emscripten_date_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,fd_close:_fd_close,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,invoke_ii:invoke_ii,invoke_iii:invoke_iii,invoke_vi:invoke_vi,invoke_vii:invoke_vii,invoke_viii:invoke_viii,invoke_viiiii:invoke_viiiii,strftime:_strftime,strftime_l:_strftime_l};"undefined"!=typeof WebAssembly&&createWasm(),Module.___wasm_call_ctors=createExportWrapper("__wasm_call_ctors"),Module._linearExtrude=createExportWrapper("linearExtrude"),Module._rotateExtrude=createExportWrapper("rotateExtrude"),Module._loft=createExportWrapper("loft"),Module._free=createExportWrapper("free");var _malloc=Module._malloc=createExportWrapper("malloc");Module._saveSetjmp=createExportWrapper("saveSetjmp"),Module.___errno_location=createExportWrapper("__errno_location"),Module.___dl_seterr=createExportWrapper("__dl_seterr");var _fflush=Module._fflush=createExportWrapper("fflush"),_setThrew=Module._setThrew=createExportWrapper("setThrew"),_emscripten_stack_init=Module._emscripten_stack_init=function(){return(_emscripten_stack_init=Module._emscripten_stack_init=Module.asm.emscripten_stack_init).apply(null,arguments)};Module._emscripten_stack_get_free=function(){return(Module._emscripten_stack_get_free=Module.asm.emscripten_stack_get_free).apply(null,arguments)},Module._emscripten_stack_get_base=function(){return(Module._emscripten_stack_get_base=Module.asm.emscripten_stack_get_base).apply(null,arguments)};var _emscripten_stack_get_end=Module._emscripten_stack_get_end=function(){return(_emscripten_stack_get_end=Module._emscripten_stack_get_end=Module.asm.emscripten_stack_get_end).apply(null,arguments)},stackSave=Module.stackSave=createExportWrapper("stackSave"),stackRestore=Module.stackRestore=createExportWrapper("stackRestore"),stackAlloc=Module.stackAlloc=createExportWrapper("stackAlloc");Module._emscripten_stack_get_current=function(){return(Module._emscripten_stack_get_current=Module.asm.emscripten_stack_get_current).apply(null,arguments)};var ___cxa_is_pointer_type=Module.___cxa_is_pointer_type=createExportWrapper("__cxa_is_pointer_type");function invoke_vii(e,t,i){var r=stackSave();try{getWasmTableEntry(e)(t,i)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(e,t){var i=stackSave();try{getWasmTableEntry(e)(t)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(e,t){var i=stackSave();try{return getWasmTableEntry(e)(t)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(e,t,i){var r=stackSave();try{return getWasmTableEntry(e)(t,i)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(e,t,i,r){var n=stackSave();try{getWasmTableEntry(e)(t,i,r)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiii(e,t,i,r,n,o){var a=stackSave();try{getWasmTableEntry(e)(t,i,r,n,o)}catch(e){if(stackRestore(a),e!==e+0)throw e;_setThrew(1,0)}}Module.dynCall_ji=createExportWrapper("dynCall_ji"),Module.dynCall_iiji=createExportWrapper("dynCall_iiji"),Module.dynCall_jiji=createExportWrapper("dynCall_jiji"),Module.dynCall_viijii=createExportWrapper("dynCall_viijii"),Module.dynCall_iiiiij=createExportWrapper("dynCall_iiiiij"),Module.dynCall_iiiiijj=createExportWrapper("dynCall_iiiiijj"),Module.dynCall_iiiiiijj=createExportWrapper("dynCall_iiiiiijj"),Module.ccall=ccall,Module.cwrap=cwrap;var unexportedRuntimeSymbols=["run","UTF8ArrayToString","UTF8ToString","stringToUTF8Array","stringToUTF8","lengthBytesUTF8","addOnPreRun","addOnInit","addOnPreMain","addOnExit","addOnPostRun","addRunDependency","removeRunDependency","FS_createFolder","FS_createPath","FS_createDataFile","FS_createPreloadedFile","FS_createLazyFile","FS_createLink","FS_createDevice","FS_unlink","getLEB","getFunctionTables","alignFunctionTables","registerFunctions","prettyPrint","getCompilerSetting","out","err","callMain","abort","keepRuntimeAlive","wasmMemory","stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0","writeStackCookie","checkStackCookie","ptrToString","zeroMemory","stringToNewUTF8","exitJS","getHeapMax","emscripten_realloc_buffer","ENV","ERRNO_CODES","ERRNO_MESSAGES","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","DNS","getHostByName","Protocols","Sockets","getRandomDevice","warnOnce","traverseStack","UNWIND_CACHE","convertPCtoSourceLocation","readEmAsmArgsArray","readEmAsmArgs","runEmAsmFunction","runMainThreadEmAsm","jstoi_q","jstoi_s","getExecutableName","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","asyncLoad","alignMemory","mmapAlloc","handleAllocator","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromI64","readI53FromU64","convertI32PairToI53","convertI32PairToI53Checked","convertU32PairToI53","getCFunc","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","freeTableIndexes","functionsInTableMap","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","setValue","getValue","PATH","PATH_FS","intArrayFromString","intArrayToString","AsciiToString","stringToAscii","UTF16Decoder","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8","allocateUTF8OnStack","writeStringToMemory","writeArrayToMemory","writeAsciiToMemory","SYSCALLS","getSocketFromFD","getSocketAddress","JSEvents","registerKeyEventCallback","specialHTMLTargets","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","currentFullscreenStrategy","restoreOldWindowedStyle","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","demangle","demangleAll","jsStackTrace","stackTrace","ExitStatus","getEnvStrings","checkWasiClock","doReadv","doWritev","dlopenMissingError","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","promiseMap","newNativePromise","getPromise","uncaughtExceptionCount","exceptionLast","exceptionCaught","ExceptionInfo","exception_addRef","exception_decRef","Browser","setMainLoop","wget","FS","MEMFS","TTY","PIPEFS","SOCKFS","_setNetworkCallback","tempFixedLengthArray","miniTempWebGLFloatBuffers","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","GL","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","AL","SDL_unicode","SDL_ttfContext","SDL_audio","SDL","SDL_gfx","GLUT","EGL","GLFW_Window","GLFW","GLEW","IDBStore","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate"];unexportedRuntimeSymbols.forEach(unexportedRuntimeSymbol);var missingLibrarySymbols=["stringToNewUTF8","exitJS","setErrNo","inetPton4","inetNtop4","inetPton6","inetNtop6","readSockaddr","writeSockaddr","getHostByName","traverseStack","convertPCtoSourceLocation","readEmAsmArgs","runEmAsmFunction","runMainThreadEmAsm","jstoi_q","jstoi_s","listenOnce","autoResumeAudioContext","dynCallLegacy","getDynCaller","dynCall","handleException","runtimeKeepalivePush","runtimeKeepalivePop","callUserCallback","maybeExit","safeSetTimeout","asmjsMangle","handleAllocator","writeI53ToI64","writeI53ToI64Clamped","writeI53ToI64Signaling","writeI53ToU64Clamped","writeI53ToU64Signaling","readI53FromU64","convertI32PairToI53","convertU32PairToI53","uleb128Encode","sigToWasmTypes","generateFuncType","convertJsFunctionToWasm","getEmptyTableSlot","updateTableMap","addFunction","removeFunction","reallyNegative","unSign","strLen","reSign","formatString","intArrayToString","AsciiToString","stringToAscii","UTF16ToString","stringToUTF16","lengthBytesUTF16","UTF32ToString","stringToUTF32","lengthBytesUTF32","allocateUTF8OnStack","writeStringToMemory","getSocketFromFD","getSocketAddress","registerKeyEventCallback","maybeCStringToJsString","findEventTarget","findCanvasEventTarget","getBoundingClientRect","fillMouseEventData","registerMouseEventCallback","registerWheelEventCallback","registerUiEventCallback","registerFocusEventCallback","fillDeviceOrientationEventData","registerDeviceOrientationEventCallback","fillDeviceMotionEventData","registerDeviceMotionEventCallback","screenOrientation","fillOrientationChangeEventData","registerOrientationChangeEventCallback","fillFullscreenChangeEventData","registerFullscreenChangeEventCallback","JSEvents_requestFullscreen","JSEvents_resizeCanvasForFullscreen","registerRestoreOldStyle","hideEverythingExceptGivenElement","restoreHiddenElements","setLetterbox","softFullscreenResizeWebGLRenderTarget","doRequestFullscreen","fillPointerlockChangeEventData","registerPointerlockChangeEventCallback","registerPointerlockErrorEventCallback","requestPointerLock","fillVisibilityChangeEventData","registerVisibilityChangeEventCallback","registerTouchEventCallback","fillGamepadEventData","registerGamepadEventCallback","registerBeforeUnloadEventCallback","fillBatteryEventData","battery","registerBatteryEventCallback","setCanvasElementSize","getCanvasElementSize","jsStackTrace","stackTrace","checkWasiClock","createDyncallWrapper","setImmediateWrapped","clearImmediateWrapped","polyfillSetImmediate","newNativePromise","getPromise","exception_addRef","exception_decRef","setMainLoop","_setNetworkCallback","heapObjectForWebGLType","heapAccessShiftForWebGLHeap","emscriptenWebGLGet","computeUnpackAlignedImageSize","emscriptenWebGLGetTexPixelData","emscriptenWebGLGetUniform","webglGetUniformLocation","webglPrepareUniformLocationsBeforeFirstUse","webglGetLeftBracePos","emscriptenWebGLGetVertexAttrib","writeGLArray","SDL_unicode","SDL_ttfContext","SDL_audio","GLFW_Window","runAndAbortIfError","ALLOC_NORMAL","ALLOC_STACK","allocate"],calledRun;function stackCheckInit(){_emscripten_stack_init(),writeStackCookie()}function run(e){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),assert(!Module._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),postRun()))}runDependencies>0||(stackCheckInit(),preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t(),checkStackCookie()))}if(missingLibrarySymbols.forEach(missingLibrarySymbol),dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();"undefined"!=typeof WebAssembly&&run();var SuModeling=Object.freeze({__proto__:null,Module:Module,setValue:setValue,getValue:getValue,default:Module});exports.AlphaMode=_0x9df4c2,exports.Animation=y$4,exports.AnimationViewModel=m$4,exports.Appearance=a$P,exports.ApproximateTerrainHeights=e$1_,exports.ArcGISTiledElevationTerrainProvider=_$V,exports.ArcGisGeographicTilingScheme=g$12,exports.ArcGisMapServerImageryProvider=b$n,exports.ArcGisWebMercatorTilingScheme=w$J,exports.ArcType=m$_,exports.AssociativeArray=e$1P,exports.AttributeCompression=t$N,exports.AttributeLoader=_0x46f1f4,exports.AttributeType=Q$C,exports.AutoExposure=a$m,exports.Autolinker=zr$1,exports.AutomaticUniforms=s$T,exports.Axis=z$z,exports.AxisAlignedBoundingBox=e$1Y,exports.BaseLayerPicker=g$2,exports.BaseLayerPickerViewModel=V,exports.BatchTable=x$Q,exports.Batched3DModel3DTileContent=n$u,exports.Billboard=n$X,exports.BillboardAxialVp=_0x33fbe7,exports.BillboardCollection=B$q,exports.BillboardGraphics=n$I,exports.BillboardMode=$r$4,exports.BillboardPixelSizeWithAngleVp=_0x4e338f,exports.BillboardVisualizer=g$F,exports.BingMapsApi=e$1O,exports.BingMapsGeocoderService=o$1d,exports.BingMapsImageryProvider=o$v,exports.BingMapsStyle=I$o,exports.BlendEquation=b$18,exports.BlendFunction=l$15,exports.BlendOption=S$s,exports.BlendingState=Ee$n,exports.BlockCacheList=r$$,exports.BlockCacheNode=e$1B,exports.BloomEffect=e$i,exports.BoundingRectangle=f$10,exports.BoundingSphere=i$19,exports.BoundingSphereState=A$U,exports.BoxEditor=A$t,exports.BoxEmitter=a$l,exports.BoxGeometry=O$H,exports.BoxGeometryUpdater=i$E,exports.BoxGraphics=n$F,exports.BoxOutlineGeometry=o$1c,exports.BrdfLutGenerator=t$9,exports.Buffer=h$W,exports.BufferManager=_0x26554f,exports.BufferUsage=A$1c,exports.CGCS2000MapServerImageryProvider=I$n,exports.CallbackProperty=n$G,exports.Camera=v$n,exports.CameraEventAggregator=l$j,exports.CameraEventType=K$c,exports.CameraFlightPath=mr$1,exports.Cartesian2=o$1k,exports.Cartesian3=t$X,exports.Cartesian4=e$25,exports.Cartographic=t$W,exports.CartographicGeocoderService=N$P,exports.CaseTable=_0x4a23c9,exports.CategoryVisibleMode=_0x58b6ee,exports.Catenaryline=z$k,exports.CatmullRomSpline=c$_,exports.Cesium3DTile=c$y,exports.Cesium3DTileBatchTable=h$D,exports.Cesium3DTileColorBlendMode=L$N,exports.Cesium3DTileContent=r$m,exports.Cesium3DTileContentFactory=i$w,exports.Cesium3DTileContentState=X$o,exports.Cesium3DTileFeature=e$10,exports.Cesium3DTileFeatureTable=o$P,exports.Cesium3DTileOptimizationHint=s$r,exports.Cesium3DTileOptimizations=I$Q,exports.Cesium3DTilePass=gr$4,exports.Cesium3DTilePassState=a$k,exports.Cesium3DTilePointFeature=i$y,exports.Cesium3DTileRefine=f$H,exports.Cesium3DTileStyle=d$o,exports.Cesium3DTileStyleEngine=e$N,exports.Cesium3DTilesInspector=y$1,exports.Cesium3DTilesInspectorViewModel=l$5,exports.Cesium3DTileset=p$A,exports.Cesium3DTilesetAsyncTraversal=h$h,exports.Cesium3DTilesetCache=e$O,exports.Cesium3DTilesetGraphics=i$G,exports.Cesium3DTilesetHeatmap=a$w,exports.Cesium3DTilesetMostDetailedTraversal=f$F,exports.Cesium3DTilesetStatistics=r$B,exports.Cesium3DTilesetTraversal=W$x,exports.Cesium3DTilesetVisualizer=l$H,exports.CesiumInspector=g,exports.CesiumInspectorViewModel=m$3,exports.CesiumTerrainProvider=se$x,exports.CesiumWidget=f$2,exports.Check=o$1u,exports.CheckerboardMaterialProperty=r$A,exports.CircleEmitter=u$g,exports.CircleGeometry=n$V,exports.CircleOutlineGeometry=a$W,exports.ClampFramebuffer=t$e,exports.ClampMode=l$o,exports.ClassificationModel=A$M,exports.ClassificationPrimitive=x$P,exports.ClassificationType=L$V,exports.ClearCommand=r$11,exports.ClipPlaneDepthFp=_0x24c6ad,exports.ClipPlaneFp=_0x212d6e,exports.ClipPlaneMode=_0x3f3b8b,exports.ClipPlaneVp=V$j,exports.ClippingPlane=a$D,exports.ClippingPlaneCollection=h$C,exports.ClippingType=V$i,exports.Clock=u$M,exports.ClockRange=tt$f,exports.ClockStep=g$N,exports.ClockViewModel=r$b,exports.ClosedDepthFramebuffer=a$n,exports.CloudBox=e$g,exports.Color=e$1S,exports.ColorBlendMode=I$X,exports.ColorCorrection=o$t,exports.ColorGeometryInstanceAttribute=o$18,exports.ColorMaterialProperty=t$z,exports.ColorTable=i$O,exports.ColorTransferFunction=_0xc6c4b6,exports.Command=t$1,exports.CommonNoLigthNoTextureVp=He$7,exports.CommonNoLigthOneTextureVp=de$8,exports.CommonNoTextureFS=me$8,exports.CommonNoTextureFp=Ye$4,exports.CommonNoTextureVS=he$5,exports.CommonOneTextureFp=CommonOneTextureFp,exports.ComponentDatatype=S$W,exports.Composite3DTileContent=i$A,exports.CompositeEntityCollection=s$p,exports.CompositeMaterialProperty=e$K,exports.CompositePositionProperty=t$q,exports.CompositeProperty=e$L,exports.Compositor=o$r,exports.CompressedTextureBuffer=e$1y,exports.ComputeCommand=t$u,exports.ComputeEngine=f$n,exports.ConditionsExpression=u$h,exports.ConeEmitter=n$k,exports.ConstantPositionProperty=r$G,exports.ConstantProperty=e$1d,exports.Context=d$s,exports.ContextLimits=e$1U,exports.ControlMode=ni$1,exports.CoplanarPolygonGeometry=P$W,exports.CoplanarPolygonGeometryLibrary=g$M,exports.CoplanarPolygonOutlineGeometry=a$V,exports.CornerType=ar$a,exports.CorridorGeometry=P$U,exports.CorridorGeometryLibrary=b$$,exports.CorridorGeometryUpdater=f$A,exports.CorridorGraphics=n$E,exports.CorridorOutlineGeometry=V$K,exports.Credential=a$Y,exports.CredentialType=E$13,exports.Credit=r$1a,exports.CreditDisplay=r$k,exports.CubeMap=X$z,exports.CubeMapFace=P$J,exports.CubicRealPolynomial=j$1c,exports.CullFace=k$11,exports.CullingVolume=i$S,exports.CustomDataSource=n$t,exports.CustomGeometryUpdater=l$F,exports.CustomProjection=p$V,exports.CylinderGeometry=l$_,exports.CylinderGeometryLibrary=I$1a,exports.CylinderGeometryUpdater=s$n,exports.CylinderGraphics=n$D,exports.CylinderOutlineGeometry=d$13,exports.CzmlDataSource=E$y,exports.DBLoader=_0x4e28c6,exports.DDSTexture=_0x33f6d6,exports.DDSTextureManager=Se$8,exports.DXTTextureDecode=L$12,exports.DamBreakAnalysis=r$j,exports.DataFileType=f$r,exports.DataSource=o$L,exports.DataSourceClock=e$J,exports.DataSourceCollection=i$s,exports.DataSourceDisplay=u$n,exports.DebugAppearance=i$e,exports.DebugCameraPrimitive=p$k,exports.DebugModelMatrixPrimitive=s$f,exports.DefaultProxy=o$16,exports.DepthFramebuffer=s$h,exports.DepthFunction=Me$l,exports.DepthMapAnalysisVp=DepthMapAnalysisVp,exports.DepthOfFieldEffect=n$l,exports.DepthPlane=c$d,exports.DerivedCommand=_$g,exports.DeveloperError=t$Z,exports.DeviceOrientationCameraController=h$e,exports.DirectionalLight=c$j,exports.DiscardColorTileImagePolicy=r$i,exports.DiscardEmptyTileImagePolicy=A$n,exports.DiscardMissingTileImagePolicy=u$i,exports.DistanceDisplayCondition=r$10,exports.DistanceDisplayConditionGeometryInstanceAttribute=t$H,exports.DoublyLinkedList=h$P,exports.DracoLoader=r$E,exports.DrawCommand=r$15,exports.DrawHandler=P$m,exports.DrawMode=o$y,exports.DxtTexture=_0x33be61,exports.DynamicExtendRegionFp=_0x332cde,exports.DynamicExtendRegionVp=_0xcb6db0,exports.DynamicGeometryBatch=r$w,exports.DynamicGeometryUpdater=a$L,exports.DynamicLayer3D=_0x335c8a,exports.DynamicLayerVertex=_0x2517ed,exports.DynamicObjectState=_0x78f1ab,exports.EarthOrientationParameters=x$1c,exports.EarthOrientationParametersSample=n$16,exports.EasingFunction=m$S,exports.EdgePreprocessing=_0x4ed087,exports.EditHandler=_$m,exports.EllipseGeometry=Y$K,exports.EllipseGeometryLibrary=C$Q,exports.EllipseGeometryUpdater=u$r,exports.EllipseGraphics=n$C,exports.EllipseOutlineGeometry=M$W,exports.Ellipsoid=t$V,exports.EllipsoidGeodesic=E$$,exports.EllipsoidGeometry=b$Y,exports.EllipsoidGeometryUpdater=l$B,exports.EllipsoidGraphics=e$16,exports.EllipsoidOutlineGeometry=x$Y,exports.EllipsoidPrimitive=p$d,exports.EllipsoidRhumbLine=P$17,exports.EllipsoidSurfaceAppearance=t$8,exports.EllipsoidTangentPlane=f$16,exports.EllipsoidTerrainProvider=t$G,exports.EllipsoidalOccluder=s$W,exports.EmissionMaterialProperty=t$j,exports.EmissionTextureUnit=_0x97cdd3,exports.Empty3DTileContent=t$s,exports.EncodedCartesian3=i$Q,exports.Entity=h$F,exports.EntityCluster=a$v,exports.EntityCollection=r$z,exports.EntityView=V$m,exports.Event=o$1o,exports.EventHelper=n$R,exports.ExcavationBottomFS=da,exports.ExcavationBottomVS=ua$1,exports.ExcavationFS=$$k,exports.ExcavationSources=S$k,exports.ExcavationVS=Z$k,exports.Expression=L$J,exports.ExpressionNodeType=s$y,exports.ExtrapolationType=_0x33054b,exports.FXAA3_11=X$d,exports.Facade=C$i,exports.FeatureDetection=s$V,exports.FieldLayer3D=i$d,exports.FillStyle=yt$3,exports.FixedRotateAngleVp=_0xc95c54,exports.FlattenRegion=f$X,exports.FloodAnalysis3D=I$g,exports.FlyInterpolationMode=hi$3,exports.FlyManager=l$q,exports.FlyTurningMode=v$q,exports.Fog=h$d,exports.ForEach=e$$,exports.FrameBufferType=L$T,exports.FrameRateMonitor=i$c,exports.FrameState=h$c,exports.Framebuffer=a$z,exports.FresnelFp=_0xab5c07,exports.FresnelVp=_0x1948de,exports.FrustumCommands=i$b,exports.FrustumGeometry=z$M,exports.FrustumOutlineGeometry=s$L,exports.Fullscreen=l$1b,exports.FullscreenButton=r$7,exports.FullscreenButtonViewModel=r$8,exports.GLBModel3DTileContent=i$x,exports.GLSLPreprocessor=T$X,exports.GeoBillboard=i$n,exports.GeoBox=r$r,exports.GeoCircle3D=i$m,exports.GeoCone=r$q,exports.GeoCylinder=i$l,exports.GeoEllipsoid=i$k,exports.GeoJsonDataSource=y$t,exports.GeoLine3D=p$x,exports.GeoModel3D=t$f,exports.GeoPoint3D=e$t,exports.GeoPolyline=o$z,exports.GeoRegion3D=n$s,exports.GeoSphere=e$s,exports.GeocodeType=c$V,exports.Geocoder=s$2,exports.GeocoderService=o$14,exports.GeocoderViewModel=D$1,exports.GeographicProjection=n$1b,exports.GeographicTilingScheme=g$14,exports.Geometry=I$1n,exports.Geometry3D=o$M,exports.Geometry3DTileContent=p$C,exports.Geometry3DType=P$v,exports.GeometryAttribute=o$1g,exports.GeometryAttributes=a$_,exports.GeometryInstance=d$15,exports.GeometryInstanceAttribute=o$13,exports.GeometryOffsetAttribute=ee$C,exports.GeometryPipeline=k$Z,exports.GeometryType=Me$r,exports.GeometryUpdater=i$F,exports.GeometryVisualizer=c$p,exports.GetFeatureInfoFormat=R$h,exports.Globe=h$a,exports.GlobeDepth=o$l,exports.GlobeSurfaceShaderSet=D$g,exports.GlobeSurfaceTile=c$l,exports.GlobeSurfaceTileProvider=R$l,exports.GltfSkeleton=_0x9790ee,exports.GltfSkeletonProcessor=_0x5ab4c8,exports.GoogleEarthEnterpriseImageryProvider=h$9,exports.GoogleEarthEnterpriseMapsProvider=n$j,exports.GoogleEarthEnterpriseMetadata=c$T,exports.GoogleEarthEnterpriseTerrainData=T$K,exports.GoogleEarthEnterpriseTerrainProvider=_$M,exports.GoogleEarthEnterpriseTileInformation=e$1t,exports.GregorianDate=d$1e,exports.GridImagery=n$g,exports.GridImageryProvider=o$k,exports.GridLayer=p$c,exports.GridMaterialProperty=t$o,exports.GridProvider=w$a,exports.GridState=_$f,exports.GridTileImagery=d$j,exports.GroundGeometryUpdater=i$v,exports.GroundPolylineGeometry=aa$1,exports.GroundPolylinePrimitive=g$D,exports.GroundPrimitive=d$Q,exports.HeadingPitchRange=a$S,exports.HeadingPitchRoll=i$10,exports.Heap=o$1n,exports.HeatMap=o$j,exports.HeightReference=k$_,exports.HeightmapEncoding=T$10,exports.HeightmapTerrainData=T$S,exports.HeightmapTessellator=m$10,exports.HemisphereLight=e$n,exports.HermitePolynomialApproximation=E$V,exports.HermiteSpline=m$Y,exports.HomeButton=o$4,exports.HomeButtonViewModel=r$6,exports.HorizontalOrigin=j$13,exports.HypsometricSetting=u$K,exports.HypsometricSettingEnum=k$T,exports.Iau2000Orientation=y$N,exports.Iau2006XysData=D$18,exports.Iau2006XysSample=a$11,exports.IauOrientationAxes=h$N,exports.IauOrientationParameters=o$12,exports.ImageMarchingCubes=_0x423d8d,exports.ImageMaterialProperty=a$N,exports.Imagery=n$q,exports.ImageryLayer=h$p,exports.ImageryLayerCollection=n$f,exports.ImageryLayerFeatureInfo=o$w,exports.ImageryProvider=e$k,exports.ImagerySplitDirection=Xe$4,exports.ImageryState=_t$6,exports.IndexDatatype=ce$v,exports.IndexedDBScheduler=l$11,exports.InfoBox=l$3,exports.InfoBoxViewModel=i$4,exports.InspectorShared=o$5,exports.Instance=_0x4ca9cd,exports.InstanceInfo=_0x214eb4,exports.InstanceLayer=_0x3d23f1,exports.InstanceMode=_0x3199cb,exports.InstanceSkeletonManager=_0x4a5bf1,exports.InstanceTile=_0x12b3b7,exports.InstanceTilesLayerVS=_0x2f95b3,exports.Instanced3DModel3DTileContent=u$x,exports.InstancedType=oi$2,exports.InterpolationAlgorithm=r$W,exports.InterpolationType=_0x3eee90,exports.Intersect=pt$a,exports.IntersectionTests=g$10,exports.Intersections2D=d$19,exports.Interval=o$1t,exports.InvertClassification=t$7,exports.Ion=e$1w,exports.IonGeocoderService=s$J,exports.IonImageryProvider=a$g,exports.IonResource=n$T,exports.IonWorldImageryStyle=n$i,exports.Iso8601=o$11,exports.JobScheduler=o$i,exports.JobType=i$B,exports.JulianDate=a$12,exports.KTX2Transcoder=o$10,exports.KeyboardEventModifier=Na$2,exports.KmlCamera=o$G,exports.KmlDataSource=U$m,exports.KmlLookAt=o$F,exports.KmlTour=l$u,exports.KmlTourFlyTo=a$q,exports.KmlTourWait=i$q,exports.Label=O$t,exports.LabelCollection=w$p,exports.LabelGraphics=n$B,exports.LabelStyle=R$t,exports.LabelVisualizer=l$y,exports.LagrangePolynomialApproximation=i$M,exports.Layers=h$8,exports.LeapSecond=a$13,exports.LercDecode=LercDecode,exports.Light=r$g,exports.LightGroupType=Ct$2,exports.LightSource=h$l,exports.LightSourceType=w$i,exports.LimitBody=C$h,exports.LineCallOut=_$z,exports.LineCallOutVp=F$H,exports.LineDisplayType=Q$G,exports.LinearApproximation=v$F,exports.LinearSpline=r$12,exports.LoadState=I$F,exports.LoadingPriorityMode=U$p,exports.ManagedArray=r$U,exports.MapMode2D=Jt$1,exports.MapProjection=r$T,exports.MapboxApi=e$1q,exports.MapboxImageryProvider=m$k,exports.MapboxStyleImageryProvider=o$h,exports.Material=a$O,exports.MaterialAppearance=t$A,exports.MaterialExt=_0x469da,exports.MaterialManager=_0x4749eb,exports.MaterialPass=_0x34bd01,exports.MaterialProperty=r$H,exports.Math=e$27,exports.Matrix2=f$15,exports.Matrix3=p$1a,exports.Matrix4=y$15,exports.MeasureHandler=P$l,exports.MeasureMode=d$v,exports.MemoryManager=to,exports.MeshProcessing=_0x1eb77f,exports.MipmapHint=S$N,exports.MixColorType=_0x125991,exports.Model=D$G,exports.ModelAnimation=a$C,exports.ModelAnimationCache=S$u,exports.ModelAnimationCollection=f$J,exports.ModelAnimationLoop=_0x3df4ed,exports.ModelAnimationState=E$I,exports.ModelEdgeFp=_0x2252ea,exports.ModelEdgeVp=_0x31c99f,exports.ModelEditor=u$l,exports.ModelGraphics=t$x,exports.ModelInstance=e$W,exports.ModelInstanceCollection=w$s,exports.ModelLoadResources=t$v,exports.ModelMaterial=a$B,exports.ModelMesh=a$A,exports.ModelNode=r$D,exports.ModelUtility=s$z,exports.ModelVisualizer=d$B,exports.ModifyRegionBottomFp=ModifyRegionBottomFp,exports.ModifyRegionBottomVp=ModifyRegionBottomVp,exports.ModifyRegionMode=Ge$8,exports.ModifyRegionOuterFS=ModifyRegionOuterFS,exports.ModifyRegionOuterVS=ModifyRegionOuterVS,exports.ModifyRegionSideFp=ModifyRegionSideFp,exports.ModifyRegionSideVp=ModifyRegionSideVp,exports.ModifyTerrain=Ce$9,exports.Module=_0x43b100,exports.Moon=s$c,exports.MultiViewShed3D=o$x,exports.MultiViewShedAnalysisFp=se$4,exports.MultiViewportMode=te$6,exports.MvtProviderGL=M$X,exports.Navigation=t,exports.NavigationHelpButton=v$2,exports.NavigationHelpButtonViewModel=i$3,exports.NavigationViewModel=y,exports.NearFarScalar=o$1b,exports.NetCDFParser=x$a,exports.NeverTileDiscardPolicy=e$8,exports.NoSleep=b$5,exports.NodeTransformationProperty=a$K,exports.NormalFramebuffer=r$n,exports.OIT=_$b,exports.ObjsOperationType=_0xfef200,exports.Occluder=d$Y,exports.OctahedralProjectedCubeMap=u$z,exports.OffsetGeometryInstanceAttribute=e$1o,exports.OpenCageGeocoderService=s$I,exports.OpenStreetMapImageryProvider=a$e,exports.OrderedGroundPrimitiveCollection=r$x,exports.OrientedBoundingBox=x$13,exports.OrthographicFrustum=a$X,exports.OrthographicOffCenterFrustum=l$$,exports.PBRExtensionParamterType=ie$y,exports.PBRMaterialType=je$b,exports.Packable=t$C,exports.PackableForInterpolation=o$Z,exports.PackingRequest=ee$B,exports.PagedLOD=_0x575d8a,exports.Particle=a$d,exports.ParticleBurst=m$f,exports.ParticleEmitter=e$7,exports.ParticlePostRenderer=u$d,exports.ParticleSystem=g$c,exports.ParticleSystemType=v$b,exports.ParticleTrailsPostRenderer=r$f,exports.ParticleVelocityFieldEffect=P$e,exports.Pass=Le$p,exports.PassState=n$p,exports.PathGraphics=n$A,exports.PathVisualizer=w$l,exports.PeliasGeocoderService=i$N,exports.PerInstanceColorAppearance=r$J,exports.PerformanceDisplay=o$e,exports.PerformanceWatchdog=i$2,exports.PerformanceWatchdogViewModel=r$4,exports.PerspectiveFrustum=o$15,exports.PerspectiveOffCenterFrustum=l$X,exports.PickDepth=f$d,exports.PickDepthFramebuffer=a$b,exports.PickFramebuffer=f$c,exports.PickPointFramebuffer=a$a,exports.PickRectFramebuffer=t$c,exports.Picking=d$g,exports.PiecewiseFunction=_0x5a3e2e,exports.PinBuilder=s$H,exports.PixelDatatype=y$U,exports.PixelFormat=V$O,exports.Plane=o$1i,exports.PlaneGeometry=f$T,exports.PlaneGeometryUpdater=p$s,exports.PlaneGraphics=e$14,exports.PlaneOutlineGeometry=i$K,exports.Point3D=s$q,exports.Point3Ds=t$p,exports.PointCloud=ie$l,exports.PointCloud3DTileContent=a$y,exports.PointCloudClassificationInfo=_0x59d91c,exports.PointCloudEyeDomeLighting=m$C,exports.PointCloudRenderMode=_0x5a7173,exports.PointCloudShading=o$O,exports.PointGraphics=n$z,exports.PointHandler=d$u,exports.PointLight=c$i,exports.PointPrimitive=s$o,exports.PointPrimitiveCollection=D$B,exports.PointVisualizer=v$u,exports.PolygonEmitter=M$9,exports.PolygonGeometry=U$Q,exports.PolygonGeometryLibrary=y$Q,exports.PolygonGeometryUpdater=l$A,exports.PolygonGraphics=u$B,exports.PolygonHandler=l$m,exports.PolygonHierarchy=e$1m,exports.PolygonOutlineGeometry=A$X,exports.PolygonPipeline=A$1d,exports.Polyline=e$19,exports.PolylineArrowMaterialProperty=t$n,exports.PolylineCollection=X$v,exports.PolylineColorAppearance=e$17,exports.PolylineDashMaterialProperty=o$K,exports.PolylineDynamicMaterialProperty=e$y,exports.PolylineFp=_0x32ca44,exports.PolylineGeometry=R$J,exports.PolylineGeometryUpdater=u$o,exports.PolylineGlowMaterialProperty=t$m,exports.PolylineGraphics=a$I,exports.PolylineHandler=d$t,exports.PolylineMaterialAppearance=r$I,exports.PolylineOutlineMaterialProperty=e$I,exports.PolylinePipeline=m$U,exports.PolylineRasterVp=_0xba57d1,exports.PolylineShadowVolumeFS=_0x3a5032,exports.PolylineShadowVolumeVS=_0x558b7c,exports.PolylineTrailMaterialProperty=o$H,exports.PolylineVisualizer=l$w,exports.PolylineVolumeGeometry=N$G,exports.PolylineVolumeGeometryLibrary=J$V,exports.PolylineVolumeGeometryUpdater=a$r,exports.PolylineVolumeGraphics=e$13,exports.PolylineVolumeOutlineGeometry=_$K,exports.PolylineVp=_0x4c7dfa,exports.PositionMode=j$l,exports.PositionProperty=t$y,exports.PositionPropertyArray=n$r,exports.PostEffectFilterlFramebuffer=t$d,exports.PostProcessStage=p$8,exports.PostProcessStageCollection=f$a,exports.PostProcessStageComposite=s$b,exports.PostProcessStageLibrary=o$c,exports.PostProcessStageSampleMode=e$6,exports.PostProcessStageTextureCache=l$b,exports.PrefilterRadianceMap=I$4,exports.PreprocessCubeMap=b$r,exports.Primitive=v$C,exports.PrimitiveCollection=o$I,exports.PrimitivePipeline=k$I,exports.PrimitiveState=ce$o,exports.PrimitiveType=W$_,exports.Profile=V$g,exports.ProfilePlaneGeometry=h$6,exports.ProfileRender=p$7,exports.ProgramDefines=H$r,exports.ProjectionImage=b$q,exports.ProjectionImageFp=We$4,exports.ProjectionMode=Q$g,exports.ProjectionName=ProjectionName,exports.ProjectionPicker=n$1,exports.ProjectionPickerViewModel=o$2,exports.Property=r$K,exports.PropertyArray=i$u,exports.PropertyBag=f$L,exports.ProviderViewModel=i$5,exports.QuadraticRealPolynomial=m$1e,exports.QuadtreeOccluders=e$a,exports.QuadtreePrimitive=L$g,exports.QuadtreeTile=h$b,exports.QuadtreeTileLoadState=re$B,exports.QuadtreeTileProvider=r$e,exports.Quality=Quality,exports.QuantizedMeshTerrainData=p$_,exports.QuarticRealPolynomial=F$1j,exports.Quaternion=n$14,exports.QuaternionSpline=r$Q,exports.Queue=r$_,exports.RGBELoader=U$g,exports.RangeMode=_0x189b29,exports.RasterFramebuffer=t$g,exports.RasterGeometryType=C$l,exports.RasterVectorCollection=p$a,exports.Ray=f$18,exports.Rectangle=h$10,exports.RectangleCollisionChecker=r$P,exports.RectangleGeometry=j$N,exports.RectangleGeometryLibrary=j$O,exports.RectangleGeometryUpdater=d$D,exports.RectangleGraphics=n$y,exports.RectangleOutlineGeometry=k$P,exports.ReferenceFrame=Re$j,exports.ReferenceProperty=a$t,exports.ReflectFramebuffer=i$g,exports.RegionAltitudeVectex=_0xc1bb56,exports.RegionFragment=_0x5e5993,exports.RegionMaterialFp=_0x313bb9,exports.RegionMaterialVp=_0x3f8a14,exports.RegionTextureVertex=_0x252df4,exports.RegionVectex=_0x2a32b0,exports.RenderClipPlane=_0x5077e8,exports.RenderEntityPagedLOD=_0x1f65d5,exports.RenderState=u$R,exports.RenderTexture=o$B,exports.Renderbuffer=o$C,exports.RenderbufferFormat=M$q,exports.Renderer2D=t$b,exports.Request=r$1c,exports.RequestErrorEvent=s$Y,exports.RequestScheduler=r$1b,exports.RequestState=W$14,exports.RequestType=$$13,exports.Resource=t$S,exports.Rotation=m$w,exports.RotationOrigin=O$r,exports.Route=f$o,exports.RouteCollection=d$x,exports.RouteStop=e$v,exports.RuntimeError=t$U,exports.S3MAttributeFactory=_0x20c152,exports.S3MBDataParser=_0x1eccda,exports.S3MBSkeletonProcessor=_0x387fb6,exports.S3MBlock=_0x5d30f9,exports.S3MBlockCache=_0x349de1,exports.S3MBloomEffect=_0x369b4a,exports.S3MCompressType=_0xbc8ee1,exports.S3MCreateIndexJob=_0x524a34,exports.S3MCreateVertexJob=_0x144583,exports.S3MDataParser=_0x27cba5,exports.S3MDracoDecode=_0x5562dc,exports.S3MEdgeProcessor=_0x5598e9,exports.S3MEntity=_0x100161,exports.S3MFeature=_0x1875be,exports.S3MGroupLayer=_0x2564e5,exports.S3MInstance=_0x375cb8,exports.S3MInstanceCollection=_0x36e54b,exports.S3MInstanceCollectionVertex=_0x5a8ca1,exports.S3MLayerScheduler=_0x151d57,exports.S3MLineCallout=_0x3a39e5,exports.S3MPBRMaterialLib=_0x294c83,exports.S3MPixelFormat=_0x493d0c,exports.S3MPointCloudEDL=_0x4e48d2,exports.S3MPointCloudEDLFp=_0x2e1f09,exports.S3MPointCloudFp=_0x3191d0,exports.S3MPointCloudVp=_0x2baa71,exports.S3MPolylineEffect=_0x300acb,exports.S3MRegionEffect=_0x31641,exports.S3MRenderStateCreator=_0x17966c,exports.S3MShaderProgramJob=_0x43ddbc,exports.S3MSkeleton=_0x3ae5d1,exports.S3MSkeletonProcessor=_0x35f716,exports.S3MTaskManager=_0x333f13,exports.S3MTextureManager=_0x2dd764,exports.S3MThemeGraph=_0x3e8cbd,exports.S3MTilesBillboardPixelSizeVp=_0xd76675,exports.S3MTilesBillboardVp=S3MTilesBillboardVp,exports.S3MTilesCommonOntTextureFP=_0x45f285,exports.S3MTilesExtendPolygonShadowVP=_0x3fb63c,exports.S3MTilesFontWithHaloFp=_0x5a5938,exports.S3MTilesFragment=_0x4cdf29,exports.S3MTilesFragmentRaster=_0x321a25,exports.S3MTilesLabelStyle=_0x5255c6,exports.S3MTilesLayer=_0x47d916,exports.S3MTilesLineShadowVectex=_0x36fa1b,exports.S3MTilesNormalFP=_0xb5c174,exports.S3MTilesRectSelection=_0x27e460,exports.S3MTilesRegionShadowVectex=_0x2cebc1,exports.S3MTilesSelection=_0x308597,exports.S3MTilesShadowVolumeFP=_0x271d9d,exports.S3MTilesVectex=_0xbceba,exports.S3MTilesVectexRaster=_0x33bf99,exports.S3MUniformBufferCreator=_0x3fa369,exports.S3MUniformMapCreator=_0x20b1b5,exports.S3MUploadSubTextureJob=_0x5650c2,exports.S3MVersion=_0x2528fb,exports.S3MVertexPackage=_0x4327f2,exports.S3MVoxelGridFp=_0x180856,exports.S3MVoxelGridVp=_0x1162a0,exports.S3ModelFP=_0x9293b3,exports.S3mdLoader=_0x4ac716,exports.SCTTerrainProvider=se$r,exports.SDFSettings=G$J,exports.SMAA=i$9,exports.SQFramebuffer=t$a,exports.SSAOEffect=a$j,exports.SampledPositionProperty=o$J,exports.SampledProperty=g$q,exports.Sampler=n$Y,exports.ScaledPositionProperty=i$r,exports.ScanEffect=c$e,exports.ScanEffectMode=A$l,exports.Scene=F$4,exports.SceneFramebuffer=n$b,exports.SceneMode=P$$,exports.SceneModePicker=r$3,exports.SceneModePickerViewModel=i$1,exports.SceneTransforms=m$W,exports.SceneTransitioner=R$7,exports.ScreenSpaceCameraController=ua,exports.ScreenSpaceEventHandler=g$G,exports.ScreenSpaceEventType=J$P,exports.SelectColorType=Ya$1,exports.SelectionIndicator=r$2,exports.SelectionIndicatorViewModel=n,exports.ShaderCache=i$i,exports.ShaderChunk=f$13,exports.ShaderProgram=S$T,exports.ShaderProgramCreator=_0xa7e56d,exports.ShaderSource=a$$,exports.ShadowAnalysisFp=ve$4,exports.ShadowMap=F$j,exports.ShadowMapShader=p$j,exports.ShadowMode=q$L,exports.ShadowQueryFp=ge$8,exports.ShadowQueryPoints=M$m,exports.ShadowQueryVp=ce$9,exports.ShadowType=_0x121e29,exports.ShadowVolumeAppearance=y$F,exports.SharedEDLFrameBuffer=_0xdced8,exports.ShowGeometryInstanceAttribute=e$1h,exports.Sightline=x$o,exports.SightlineAnalysisFp=SightlineAnalysisFp,exports.SilverLightingAtmosphere=n$7,exports.SilverLightingEphemeris=a$4,exports.SilverLightingLocalTime=e$2,exports.SilverLightingLocation=i$7,exports.SilverLightingLuminanceMapper=a$5,exports.SilverLightingSky=l$a,exports.SilverLightingSolarSpectrum=o$9,exports.SilverLightingSpectrum=G$4,exports.Simon1994PlanetaryPositions=F$T,exports.SimplePolylineGeometry=S$D,exports.SingleTileImageryProvider=u$f,exports.SkeletonProcessor=_0x5ddad8;exports.SkeletonState=_0x5aa9da,exports.SkyAtmosphere=s$8,exports.SkyBox=m$7,exports.Skyline=c$g,exports.SkylineFp=ae$8,exports.SkylineVp=oe$7,exports.SlopeSetting=l$R,exports.SlopeSettingEnum=Vi$3,exports.SmoothStepSpline=r$O,exports.SolidModelsProfile=n$a,exports.SolidProfileFp=k$8,exports.SpatialQuery3D=p$i,exports.SpatialQueryFp=z$m,exports.SphereEmitter=o$f,exports.SphereGeometry=n$M,exports.SphereOutlineGeometry=a$Q,exports.Spherical=c$M,exports.Spline=n$_,exports.SplitDirection=_0x171baa,exports.SpotLight=_$l,exports.StaticGeometryColorBatch=y$w,exports.StaticGeometryPerMaterialBatch=c$r,exports.StaticGroundGeometryColorBatch=p$q,exports.StaticGroundGeometryPerMaterialBatch=f$u,exports.StaticGroundPolylinePerMaterialBatch=m$t,exports.StaticOutlineGeometryBatch=y$v,exports.StencilConstants=Fa$6,exports.StencilFunction=m$12,exports.StencilOperation=n$12,exports.StopPlayMode=A$u,exports.StripeMaterialProperty=i$t,exports.StripeOrientation=mr$3,exports.Style3D=e$E,exports.StyleExpression=t$5,exports.SubTextureCache=_0x37db74,exports.SubTextureManager=_0x20c3f2,exports.Sun=u$6,exports.SunLight=i$h,exports.SunPostProcess=u$b,exports.SuperMapImageryProvider=H$6,exports.SuperMapVersion=SuperMapVersion,exports.SupportTools=f$R,exports.SvgPathBindingHandler=g$4,exports.TaskProcessor=i$W,exports.TemporalAA=a$i,exports.TemporalSetting=o$V,exports.TerrainData=r$M,exports.TerrainEncoding=h$T,exports.TerrainFillMesh=Q$n,exports.TerrainLayer=r$h,exports.TerrainLayerCollection=o$m,exports.TerrainMesh=T$T,exports.TerrainOffsetProperty=h$E,exports.TerrainProvider=I$1i,exports.TerrainQuantization=ye$s,exports.TerrainState=De$d,exports.TextLineCalloutFp=_0xc05137,exports.TextLineCalloutVp=_0x59da62,exports.TextOverlapInfo=_0x1e730b,exports.Texture=L$17,exports.Texture3D=f$m,exports.TextureAtlas=w$q,exports.TextureCache=r$o,exports.TextureMagnificationFilter=rt$g,exports.TextureManager=_0x55f040,exports.TextureMinificationFilter=tt$h,exports.TextureWrap=q$11,exports.ThreeDDesigner=_0x3a9934,exports.ThreeDModeling=_0x11c7a0,exports.TiandituAnnotationProvider=h$3,exports.TiandituImageryProvider=f$7,exports.TiandituMapsStyle=t$4,exports.TiandituTerrainProvider=d$8,exports.TileAvailability=n$11,exports.TileBoundingRegion=y$z,exports.TileBoundingSphere=t$r,exports.TileBoundingVolume=o$8,exports.TileCoordinatesImageryProvider=n$4,exports.TileDiscardPolicy=r$c,exports.TileEdge=T$G,exports.TileImagery=o$D,exports.TileMapServiceImageryProvider=g$h,exports.TileOrientedBoundingBox=c$z,exports.TileProviderError=l$13,exports.TileReplacementQueue=i$R,exports.TileSelectionResult=D$t,exports.TileState=TileState,exports.TileTerrain=x$s,exports.Tileset3DTileContent=t$t,exports.TilingScheme=o$T,exports.TiltIndicator=x$1,exports.TimeConstants=h$Z,exports.TimeDynamicImagery=f$p,exports.TimeDynamicPointCloud=g$6,exports.TimeInterval=d$_,exports.TimeIntervalCollection=c$L,exports.TimeIntervalCollectionPositionProperty=t$l,exports.TimeIntervalCollectionProperty=t$k,exports.TimeStandard=H$12,exports.Timeline=u$3,exports.TimelineHighlightRange=s,exports.TimelineTrack=v,exports.Tipsify=D$U,exports.ToggleButtonViewModel=r$a,exports.Tonemapper=k$a,exports.TransformFeedback=s$g,exports.Transforms=m$1b,exports.TranslationRotationScale=e$1f,exports.TridiagonalSystemSolver=m$Z,exports.TrustedServers=u$V,exports.Tween=f$Y,exports.TweenCollection=s$a,exports.UnderGlobe=t$6,exports.UniformBuffer=r$u,exports.UniformBufferManager=f$q,exports.UniformDataBase=t$i,exports.UniformState=P$k,exports.UniformlyVariableMotionSpline=n$K,exports.Uri=h$$,exports.UrlTemplateImageryProvider=_$i,exports.UrlType=fi$5,exports.VRButton=o$1,exports.VRButtonViewModel=a,exports.VRTheWorldTerrainProvider=l$P,exports.Vector3DTileBatch=c$F,exports.Vector3DTileContent=y$A,exports.Vector3DTileGeometry=e$X,exports.Vector3DTilePoints=b$J,exports.Vector3DTilePolygons=a$x,exports.Vector3DTilePolylines=h$B,exports.Vector3DTilePrimitive=y$E,exports.VectorTilesLayer=_$8,exports.VectorTilesMap=i$o,exports.VelocityOrientationProperty=e$G,exports.VelocityVectorProperty=r$y,exports.VertexArray=m$19,exports.VertexArrayFacade=f$G,exports.VertexCompressOption=_0x33a28d,exports.VertexFormat=n$10,exports.VertexWeightMode=_0x4a384f,exports.VerticalOrigin=S$L,exports.VideoSynchronizer=n$J,exports.View=L$c,exports.ViewDome=b$o,exports.ViewDomeFp=rr$1,exports.ViewDomeType=ur,exports.ViewDomeVp=D$n,exports.ViewShed3D=x$n,exports.ViewShedAnalysisFp=Re$4,exports.ViewShedAnalysisVp=Ee$7,exports.Viewer=u,exports.ViewportQuad=o$7,exports.Visibility=fe$s,exports.Visualizer=r$s,exports.Volume=A$2,exports.VolumeBillboardCollection=c$5,exports.VolumeBoxFp=Ne,exports.VolumeBoxVp=Me$3,exports.VolumeRenderMode=gt$1,exports.VoxelGridLayer3D=g$9,exports.VoxelGridPostRenderer=a$7,exports.VoxelGridTile=m$9,exports.VoxelGridTileMultiResolution=o$b,exports.VulkanConstants=VulkanConstants,exports.WalkingMode=ni,exports.WallGeometry=E$R,exports.WallGeometryLibrary=D$O,exports.WallGeometryUpdater=r$v,exports.WallGraphics=e$12,exports.WallOutlineGeometry=P$L,exports.WaterMode=K$a,exports.WebGLConstants=de$y,exports.WebMapServiceImageryProvider=m$j,exports.WebMapTileServiceImageryProvider=y$r,exports.WebMercatorProjection=t$M,exports.WebMercatorTilingScheme=c$10,exports.WeightSpline=r$L,exports.WindingOrder=_0x4a48d8,exports.WireFrameType=_0x255091,exports.XML=s$P,exports.ZoomIndicator=o,exports.ZoomIndicatorViewModel=r$1,exports.addBuffer=a$E,exports.addDefaults=E$K,exports.addExtensionsRequired=s$B,exports.addExtensionsUsed=i$C,exports.addPipelineExtras=s$D,exports.addToArray=d$P,exports.appendForwardSlash=n$1c,exports.arrayFill=d$1a,exports.arrayRemoveDuplicates=D$Z,exports.arraySlice=l$12,exports.barycentricCoordinates=S$P,exports.bignumber=Ar,exports.binarySearch=a$14,exports.bitmap_sdf=b$K,exports.brdf=l$17,exports.buildModuleUrl=n$17,exports.bytebuffer=u$5,exports.cancelAnimationFrame=t$L,exports.checkFloatTexturePrecision=r$p,exports.clone=l$1e,exports.combine=p$17,exports.computeFlyToLocationForRectangle=a$h,exports.createBillboardPointCallback=i$z,exports.createCommand=s$3,exports.createDefaultImageryProviderViewModels=p$1,exports.createDefaultTerrainProviderViewModels=n$3,exports.createFragmentFromTemplate=n$2,exports.createGuid=e$1K,exports.createMaterialPropertyDescriptor=c$K,exports.createOpenStreetMapImageryProvider=L$l,exports.createPropertyDescriptor=C$H,exports.createRawPropertyDescriptor=c$J,exports.createTangentSpaceDebugPrimitive=y$g,exports.createTaskProcessorWorker=l,exports.createTileMapServiceImageryProvider=te$9,exports.createUniform=O$L,exports.createUniformArray=V$T,exports.createWorldImagery=o$p,exports.createWorldTerrain=u$L,exports.crunchprevious=Module$2,exports.cubeUV_reflection=h$V,exports.decodeGoogleEarthEnterpriseData=f$Z,exports.defaultValue=u$Y,exports.defined=e$28,exports.deprecationWarning=t$T,exports.destroyObject=i$Z,exports.directionLightDecl=c$14,exports.dynamicGeometryGetBoundingSphere=h$s,exports.earcut_2_2_1=z$W,exports.executeServerExcavationDecl=p$12,exports.exportKml=oe$e,exports.fill_style_layer=_0x40369e,exports.findAccessorMinMax=B$y,exports.formatError=f$$,exports.freezeRenderState=c$13,exports.getAbsoluteUri=o$1r,exports.getAccessorByteStride=p$G,exports.getBaseUri=i$18,exports.getBinaryAccessor=M$H,exports.getClipAndStyleCode=p$D,exports.getClippingFunction=f$K,exports.getComponentReader=c$G,exports.getElement=i$a,exports.getExtensionFromUri=a$18,exports.getFilenameFromUri=f$V,exports.getImagePixels=d$11,exports.getMagic=a$U,exports.getPreciseArea=R$L,exports.getStringFromTypedArray=a$Z,exports.getTimestamp=kt$7,exports.graphemesplitter=T$s,exports.hasExtension=i$D,exports.heightReferenceOnEntityPropertyChanged=a$H,exports.hemisphereLightDecl=o$1f,exports.isBitSet=i$U,exports.isBlobUri=i$17,exports.isCrossOriginUrl=i$16,exports.isDataUri=e$23,exports.isLeapYear=i$11,exports.joinUrls=n$Z,exports.jsep=q$I,exports.kdbush=O$u,exports.knockout=ce$1,exports.knockout_3_5_1=ce$1,exports.knockout_es5=t$3,exports.lightSourceImpl=m$16,exports.line_style_layer=_0x3fe6a2,exports.loadAndExecuteScript=a$16,exports.loadArrayBuffer=o$$,exports.loadBlob=l$V,exports.loadCRN=a$R,exports.loadCRNForS3M=h$M,exports.loadCubeMap=d$r,exports.loadDXTZ=B$E,exports.loadImage=t$D,exports.loadImageFromTypedArray=w$B,exports.loadImageViaBlob=c$S,exports.loadJson=u$O,exports.loadJsonp=d$Z,exports.loadKTX=k$R,exports.loadKTX2=f$U,exports.loadText=u$P,exports.loadView=f,exports.loadWithXhr=p$Z,exports.loadXML=d$17,exports.long=s$6,exports.measureText=F$U,exports.mergeSort=m$Q,exports.mersenne_twister=s$$,exports.meshopt_decoder_module=V$1,exports.modernizeShader=S$V,exports.moveTechniqueRenderStates=R$C,exports.moveTechniquesToExtension=R$B,exports.netcdf=k$5,exports.numberOfComponentsForType=r$F,exports.objectToQuery=m$1k,exports.oneTimeWarning=e$1$,exports.parseGlb=O$z,exports.parseResponseHeaders=n$19,exports.pbf=h$Q,exports.pointInsideTriangle=c$P,exports.pointLightDecl=t$R,exports.potpack=W$V,exports.processModelMaterialsCommon=ue$k,exports.processPbrMaterials=he$j,exports.proj4_src=k$W,exports.protobuf=f$8,exports.protobuf_minimal=R$K,exports.purify=je$k,exports.queryToObject=m$1j,exports.quickselect=s$O,exports.rainDecl=e$1T,exports.rbush=B$C,exports.readAccessorPacked=T$B,exports.removeExtensionsRequired=s$C,exports.removeExtensionsUsed=d$N,exports.removePipelineExtras=f$I,exports.removeUnusedElements=d$L,exports.requestAnimationFrame=p$Q,exports.sampleTerrain=y$K,exports.sampleTerrainMostDetailed=y$J,exports.scaleToGeodeticSurface=P$1f,exports.snowDecl=r$14,exports.spotLightDecl=i$X,exports.sprintf=$$11,exports.subdivideArray=u$F,exports.subscribeAndEvaluate=c$2,exports.supermap3D_openlayer_4_6_5=t$2,exports.throttleRequestByServer=o$U,exports.tinySDF=l$6,exports.topojson=ke$8,exports.unzip=_0x175ffe,exports.updateAccessorComponentTypes=T$A,exports.updateVersion=re$q,exports.viewerCesium3DTilesInspectorMixin=r,exports.viewerCesiumInspectorMixin=c,exports.viewerDragDropMixin=$,exports.viewerPerformanceWatchdogMixin=m,exports.webGLConstantToGlslType=t$B,exports.websocketScheduler=l$O,exports.when=o$1q,exports.wrapFunction=e$1e,exports.writeTextToCanvas=x$V,exports.zip=he$c,Object.defineProperty(exports,"__esModule",{value:!0})}));
|